harperdb 4.7.12 → 4.7.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/harperdb.js +34 -34
- package/bin/lite.js +28 -28
- package/launchServiceScripts/launchNatsIngestService.js +29 -29
- package/launchServiceScripts/launchNatsReplyService.js +29 -29
- package/launchServiceScripts/launchUpdateNodes4-0-0.js +29 -29
- package/npm-shrinkwrap.json +292 -256
- package/package.json +3 -3
- package/resources/RequestTarget.d.ts +1 -1
- package/resources/Resource.d.ts +13 -13
- package/resources/Table.d.ts +12 -10
- package/resources/transactionBroadcast.d.ts +4 -3
- package/server/jobs/jobProcess.js +29 -29
- package/server/replication/knownNodes.d.ts +1 -1
- package/server/threads/threadServer.js +29 -29
- package/studio/web/HDBDogOnly.svg +78 -1
- package/studio/web/assets/index-BwlW0AMB.css +1 -0
- package/studio/web/assets/{index-YHth6Ryl.css → index-CVjGhoEG.css} +1 -1
- package/studio/web/assets/{index-B_cFV1Ze.js → index-DCIk8mGR.js} +1 -1
- package/studio/web/assets/index-DHFTW4ZU.js +36 -0
- package/studio/web/assets/index-KVLE5Pus.js +217 -0
- package/studio/web/assets/{index.lazy-CFrFVE2k.js → index.lazy-CwPUt0Bc.js} +53 -53
- package/studio/web/assets/{profiler-_PkvXANS.js → profiler-Cnhc6FqT.js} +1 -1
- package/studio/web/assets/{react-redux-Cuw5Q5nk.js → react-redux-Dy0makvb.js} +2 -2
- package/studio/web/assets/startRecording-IOmSWGHg.js +2 -0
- package/studio/web/github-icon.svg +14 -2
- package/studio/web/index.html +14 -16
- package/studio/web/running.html +137 -92
- package/studio/web/running.js +1 -1
- package/utility/scripts/restartHdb.js +29 -29
- package/studio/web/assets/index-B-eMLFIg.css +0 -1
- package/studio/web/assets/index-BedIpyD2.js +0 -37
- package/studio/web/assets/index-CYB7LsMb.js +0 -203
- package/studio/web/assets/startRecording-BAY7HJ6r.js +0 -2
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.lazy-CFrFVE2k.js","assets/react-redux-Cuw5Q5nk.js","assets/index-YHth6Ryl.css","assets/index-BedIpyD2.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
function qq(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var GTe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Uw={exports:{}},em={};var gA;function Gq(){if(gA)return em;gA=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,o){var a=null;if(o!==void 0&&(a=""+o),i.key!==void 0&&(a=""+i.key),"key"in i){o={};for(var c in i)c!=="key"&&(o[c]=i[c])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:a,ref:i!==void 0?i:null,props:o}}return em.Fragment=t,em.jsx=n,em.jsxs=n,em}var vA;function Kq(){return vA||(vA=1,Uw.exports=Gq()),Uw.exports}var u=Kq();const Qu=!0,Zq="/",cd=9925,I_="HDB_ADMIN",oa="/",gC="../";function rM(e,t){return function(){return e.apply(t,arguments)}}const{toString:Yq}=Object.prototype,{getPrototypeOf:vC}=Object,{iterator:Py,toStringTag:iM}=Symbol,zy=(e=>t=>{const n=Yq.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Uo=e=>(e=e.toLowerCase(),t=>zy(t)===e),Ly=e=>t=>typeof t===e,{isArray:Dd}=Array,ud=Ly("undefined");function pp(e){return e!==null&&!ud(e)&&e.constructor!==null&&!ud(e.constructor)&&li(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const oM=Uo("ArrayBuffer");function Wq(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&oM(e.buffer),t}const Xq=Ly("string"),li=Ly("function"),aM=Ly("number"),hp=e=>e!==null&&typeof e=="object",Qq=e=>e===!0||e===!1,dv=e=>{if(zy(e)!=="object")return!1;const t=vC(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(iM in e)&&!(Py in e)},Jq=e=>{if(!hp(e)||pp(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},eG=Uo("Date"),tG=Uo("File"),nG=Uo("Blob"),rG=Uo("FileList"),iG=e=>hp(e)&&li(e.pipe),oG=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||li(e.append)&&((t=zy(e))==="formdata"||t==="object"&&li(e.toString)&&e.toString()==="[object FormData]"))},aG=Uo("URLSearchParams"),[sG,lG,cG,uG]=["ReadableStream","Request","Response","Headers"].map(Uo),dG=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function gp(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),Dd(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(pp(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let c;for(r=0;r<a;r++)c=o[r],t.call(null,e[c],c,e)}}function sM(e,t){if(pp(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Gl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,lM=e=>!ud(e)&&e!==Gl;function N_(){const{caseless:e,skipUndefined:t}=lM(this)&&this||{},n={},r=(i,o)=>{const a=e&&sM(n,o)||o;dv(n[a])&&dv(i)?n[a]=N_(n[a],i):dv(i)?n[a]=N_({},i):Dd(i)?n[a]=i.slice():(!t||!ud(i))&&(n[a]=i)};for(let i=0,o=arguments.length;i<o;i++)arguments[i]&&gp(arguments[i],r);return n}const fG=(e,t,n,{allOwnKeys:r}={})=>(gp(t,(i,o)=>{n&&li(i)?e[o]=rM(i,n):e[o]=i},{allOwnKeys:r}),e),mG=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),pG=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},hG=(e,t,n,r)=>{let i,o,a;const c={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],(!r||r(a,e,t))&&!c[a]&&(t[a]=e[a],c[a]=!0);e=n!==!1&&vC(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},gG=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},vG=e=>{if(!e)return null;if(Dd(e))return e;let t=e.length;if(!aM(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},yG=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&vC(Uint8Array)),bG=(e,t)=>{const r=(e&&e[Py]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},xG=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},wG=Uo("HTMLFormElement"),SG=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),yA=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),_G=Uo("RegExp"),cM=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};gp(n,(i,o)=>{let a;(a=t(i,o,e))!==!1&&(r[o]=a||i)}),Object.defineProperties(e,r)},CG=e=>{cM(e,(t,n)=>{if(li(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(li(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},EG=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return Dd(e)?r(e):r(String(e).split(t)),n},kG=()=>{},jG=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function RG(e){return!!(e&&li(e.append)&&e[iM]==="FormData"&&e[Py])}const IG=e=>{const t=new Array(10),n=(r,i)=>{if(hp(r)){if(t.indexOf(r)>=0)return;if(pp(r))return r;if(!("toJSON"in r)){t[i]=r;const o=Dd(r)?[]:{};return gp(r,(a,c)=>{const d=n(a,i+1);!ud(d)&&(o[c]=d)}),t[i]=void 0,o}}return r};return n(e,0)},NG=Uo("AsyncFunction"),TG=e=>e&&(hp(e)||li(e))&&li(e.then)&&li(e.catch),uM=((e,t)=>e?setImmediate:t?((n,r)=>(Gl.addEventListener("message",({source:i,data:o})=>{i===Gl&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Gl.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",li(Gl.postMessage)),AG=typeof queueMicrotask<"u"?queueMicrotask.bind(Gl):typeof process<"u"&&process.nextTick||uM,OG=e=>e!=null&&li(e[Py]),fe={isArray:Dd,isArrayBuffer:oM,isBuffer:pp,isFormData:oG,isArrayBufferView:Wq,isString:Xq,isNumber:aM,isBoolean:Qq,isObject:hp,isPlainObject:dv,isEmptyObject:Jq,isReadableStream:sG,isRequest:lG,isResponse:cG,isHeaders:uG,isUndefined:ud,isDate:eG,isFile:tG,isBlob:nG,isRegExp:_G,isFunction:li,isStream:iG,isURLSearchParams:aG,isTypedArray:yG,isFileList:rG,forEach:gp,merge:N_,extend:fG,trim:dG,stripBOM:mG,inherits:pG,toFlatObject:hG,kindOf:zy,kindOfTest:Uo,endsWith:gG,toArray:vG,forEachEntry:bG,matchAll:xG,isHTMLForm:wG,hasOwnProperty:yA,hasOwnProp:yA,reduceDescriptors:cM,freezeMethods:CG,toObjectSet:EG,toCamelCase:SG,noop:kG,toFiniteNumber:jG,findKey:sM,global:Gl,isContextDefined:lM,isSpecCompliantForm:RG,toJSONObject:IG,isAsyncFn:NG,isThenable:TG,setImmediate:uM,asap:AG,isIterable:OG};function ft(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}fe.inherits(ft,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:fe.toJSONObject(this.config),code:this.code,status:this.status}}});const dM=ft.prototype,fM={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{fM[e]={value:e}});Object.defineProperties(ft,fM);Object.defineProperty(dM,"isAxiosError",{value:!0});ft.from=(e,t,n,r,i,o)=>{const a=Object.create(dM);fe.toFlatObject(e,a,function(p){return p!==Error.prototype},f=>f!=="isAxiosError");const c=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return ft.call(a,c,d,n,r,i),e&&a.cause==null&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",o&&Object.assign(a,o),a};const DG=null;function T_(e){return fe.isPlainObject(e)||fe.isArray(e)}function mM(e){return fe.endsWith(e,"[]")?e.slice(0,-2):e}function bA(e,t,n){return e?e.concat(t).map(function(i,o){return i=mM(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function $G(e){return fe.isArray(e)&&!e.some(T_)}const MG=fe.toFlatObject(fe,{},null,function(t){return/^is[A-Z]/.test(t)});function Uy(e,t,n){if(!fe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=fe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,C){return!fe.isUndefined(C[S])});const r=n.metaTokens,i=n.visitor||p,o=n.dots,a=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&fe.isSpecCompliantForm(t);if(!fe.isFunction(i))throw new TypeError("visitor must be a function");function f(b){if(b===null)return"";if(fe.isDate(b))return b.toISOString();if(fe.isBoolean(b))return b.toString();if(!d&&fe.isBlob(b))throw new ft("Blob is not supported. Use a Buffer instead.");return fe.isArrayBuffer(b)||fe.isTypedArray(b)?d&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function p(b,S,C){let E=b;if(b&&!C&&typeof b=="object"){if(fe.endsWith(S,"{}"))S=r?S:S.slice(0,-2),b=JSON.stringify(b);else if(fe.isArray(b)&&$G(b)||(fe.isFileList(b)||fe.endsWith(S,"[]"))&&(E=fe.toArray(b)))return S=mM(S),E.forEach(function(j,I){!(fe.isUndefined(j)||j===null)&&t.append(a===!0?bA([S],I,o):a===null?S:S+"[]",f(j))}),!1}return T_(b)?!0:(t.append(bA(C,S,o),f(b)),!1)}const h=[],v=Object.assign(MG,{defaultVisitor:p,convertValue:f,isVisitable:T_});function y(b,S){if(!fe.isUndefined(b)){if(h.indexOf(b)!==-1)throw Error("Circular reference detected in "+S.join("."));h.push(b),fe.forEach(b,function(E,k){(!(fe.isUndefined(E)||E===null)&&i.call(t,E,fe.isString(k)?k.trim():k,S,v))===!0&&y(E,S?S.concat(k):[k])}),h.pop()}}if(!fe.isObject(e))throw new TypeError("data must be an object");return y(e),t}function xA(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function yC(e,t){this._pairs=[],e&&Uy(e,this,t)}const pM=yC.prototype;pM.append=function(t,n){this._pairs.push([t,n])};pM.toString=function(t){const n=t?function(r){return t.call(this,r,xA)}:xA;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function PG(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function hM(e,t,n){if(!t)return e;const r=n&&n.encode||PG;fe.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(i?o=i(t,n):o=fe.isURLSearchParams(t)?t.toString():new yC(t,n).toString(r),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class wA{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){fe.forEach(this.handlers,function(r){r!==null&&t(r)})}}const gM={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zG=typeof URLSearchParams<"u"?URLSearchParams:yC,LG=typeof FormData<"u"?FormData:null,UG=typeof Blob<"u"?Blob:null,FG={isBrowser:!0,classes:{URLSearchParams:zG,FormData:LG,Blob:UG},protocols:["http","https","file","blob","url","data"]},bC=typeof window<"u"&&typeof document<"u",A_=typeof navigator=="object"&&navigator||void 0,VG=bC&&(!A_||["ReactNative","NativeScript","NS"].indexOf(A_.product)<0),BG=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",HG=bC&&window.location.href||"http://localhost",qG=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:bC,hasStandardBrowserEnv:VG,hasStandardBrowserWebWorkerEnv:BG,navigator:A_,origin:HG},Symbol.toStringTag,{value:"Module"})),Sr={...qG,...FG};function GG(e,t){return Uy(e,new Sr.classes.URLSearchParams,{visitor:function(n,r,i,o){return Sr.isNode&&fe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function KG(e){return fe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function ZG(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}function vM(e){function t(n,r,i,o){let a=n[o++];if(a==="__proto__")return!0;const c=Number.isFinite(+a),d=o>=n.length;return a=!a&&fe.isArray(i)?i.length:a,d?(fe.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!c):((!i[a]||!fe.isObject(i[a]))&&(i[a]=[]),t(n,r,i[a],o)&&fe.isArray(i[a])&&(i[a]=ZG(i[a])),!c)}if(fe.isFormData(e)&&fe.isFunction(e.entries)){const n={};return fe.forEachEntry(e,(r,i)=>{t(KG(r),i,n,0)}),n}return null}function YG(e,t,n){if(fe.isString(e))try{return(t||JSON.parse)(e),fe.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const vp={transitional:gM,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=fe.isObject(t);if(o&&fe.isHTMLForm(t)&&(t=new FormData(t)),fe.isFormData(t))return i?JSON.stringify(vM(t)):t;if(fe.isArrayBuffer(t)||fe.isBuffer(t)||fe.isStream(t)||fe.isFile(t)||fe.isBlob(t)||fe.isReadableStream(t))return t;if(fe.isArrayBufferView(t))return t.buffer;if(fe.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return GG(t,this.formSerializer).toString();if((c=fe.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Uy(c?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),YG(t)):t}],transformResponse:[function(t){const n=this.transitional||vp.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(fe.isResponse(t)||fe.isReadableStream(t))return t;if(t&&fe.isString(t)&&(r&&!this.responseType||i)){const a=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(c){if(a)throw c.name==="SyntaxError"?ft.from(c,ft.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Sr.classes.FormData,Blob:Sr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};fe.forEach(["delete","get","head","post","put","patch"],e=>{vp.headers[e]={}});const WG=fe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),XG=e=>{const t={};let n,r,i;return e&&e.split(`
|
|
3
|
-
`).forEach(function(a){i=a.indexOf(":"),n=a.substring(0,i).trim().toLowerCase(),r=a.substring(i+1).trim(),!(!n||t[n]&&WG[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},SA=Symbol("internals");function tm(e){return e&&String(e).trim().toLowerCase()}function fv(e){return e===!1||e==null?e:fe.isArray(e)?e.map(fv):String(e)}function QG(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const JG=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Fw(e,t,n,r,i){if(fe.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!fe.isString(t)){if(fe.isString(r))return t.indexOf(r)!==-1;if(fe.isRegExp(r))return r.test(t)}}function eK(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function tK(e,t){const n=fe.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,o,a){return this[r].call(this,t,i,o,a)},configurable:!0})})}let ci=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(c,d,f){const p=tm(d);if(!p)throw new Error("header name must be a non-empty string");const h=fe.findKey(i,p);(!h||i[h]===void 0||f===!0||f===void 0&&i[h]!==!1)&&(i[h||d]=fv(c))}const a=(c,d)=>fe.forEach(c,(f,p)=>o(f,p,d));if(fe.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(fe.isString(t)&&(t=t.trim())&&!JG(t))a(XG(t),n);else if(fe.isObject(t)&&fe.isIterable(t)){let c={},d,f;for(const p of t){if(!fe.isArray(p))throw TypeError("Object iterator must return a key-value pair");c[f=p[0]]=(d=c[f])?fe.isArray(d)?[...d,p[1]]:[d,p[1]]:p[1]}a(c,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=tm(t),t){const r=fe.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return QG(i);if(fe.isFunction(n))return n.call(this,i,r);if(fe.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=tm(t),t){const r=fe.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Fw(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(a){if(a=tm(a),a){const c=fe.findKey(r,a);c&&(!n||Fw(r,r[c],c,n))&&(delete r[c],i=!0)}}return fe.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||Fw(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return fe.forEach(this,(i,o)=>{const a=fe.findKey(r,o);if(a){n[a]=fv(i),delete n[o];return}const c=t?eK(o):String(o).trim();c!==o&&delete n[o],n[c]=fv(i),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return fe.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&fe.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
4
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[SA]=this[SA]={accessors:{}}).accessors,i=this.prototype;function o(a){const c=tm(a);r[c]||(tK(i,a),r[c]=!0)}return fe.isArray(t)?t.forEach(o):o(t),this}};ci.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);fe.reduceDescriptors(ci.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});fe.freezeMethods(ci);function Vw(e,t){const n=this||vp,r=t||n,i=ci.from(r.headers);let o=r.data;return fe.forEach(e,function(c){o=c.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function yM(e){return!!(e&&e.__CANCEL__)}function $d(e,t,n){ft.call(this,e??"canceled",ft.ERR_CANCELED,t,n),this.name="CanceledError"}fe.inherits($d,ft,{__CANCEL__:!0});function bM(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ft("Request failed with status code "+n.status,[ft.ERR_BAD_REQUEST,ft.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function nK(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function rK(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,a;return t=t!==void 0?t:1e3,function(d){const f=Date.now(),p=r[o];a||(a=f),n[i]=d,r[i]=f;let h=o,v=0;for(;h!==i;)v+=n[h++],h=h%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),f-a<t)return;const y=p&&f-p;return y?Math.round(v*1e3/y):void 0}}function iK(e,t){let n=0,r=1e3/t,i,o;const a=(f,p=Date.now())=>{n=p,i=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const p=Date.now(),h=p-n;h>=r?a(f,p):(i=f,o||(o=setTimeout(()=>{o=null,a(i)},r-h)))},()=>i&&a(i)]}const Tv=(e,t,n=3)=>{let r=0;const i=rK(50,250);return iK(o=>{const a=o.loaded,c=o.lengthComputable?o.total:void 0,d=a-r,f=i(d),p=a<=c;r=a;const h={loaded:a,total:c,progress:c?a/c:void 0,bytes:d,rate:f||void 0,estimated:f&&c&&p?(c-a)/f:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(h)},n)},_A=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},CA=e=>(...t)=>fe.asap(()=>e(...t)),oK=Sr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Sr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Sr.origin),Sr.navigator&&/(msie|trident)/i.test(Sr.navigator.userAgent)):()=>!0,aK=Sr.hasStandardBrowserEnv?{write(e,t,n,r,i,o,a){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];fe.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),fe.isString(r)&&c.push(`path=${r}`),fe.isString(i)&&c.push(`domain=${i}`),o===!0&&c.push("secure"),fe.isString(a)&&c.push(`SameSite=${a}`),document.cookie=c.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 sK(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function lK(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function xM(e,t,n){let r=!sK(t);return e&&(r||n==!1)?lK(e,t):t}const EA=e=>e instanceof ci?{...e}:e;function lc(e,t){t=t||{};const n={};function r(f,p,h,v){return fe.isPlainObject(f)&&fe.isPlainObject(p)?fe.merge.call({caseless:v},f,p):fe.isPlainObject(p)?fe.merge({},p):fe.isArray(p)?p.slice():p}function i(f,p,h,v){if(fe.isUndefined(p)){if(!fe.isUndefined(f))return r(void 0,f,h,v)}else return r(f,p,h,v)}function o(f,p){if(!fe.isUndefined(p))return r(void 0,p)}function a(f,p){if(fe.isUndefined(p)){if(!fe.isUndefined(f))return r(void 0,f)}else return r(void 0,p)}function c(f,p,h){if(h in t)return r(f,p);if(h in e)return r(void 0,f)}const d={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(f,p,h)=>i(EA(f),EA(p),h,!0)};return fe.forEach(Object.keys({...e,...t}),function(p){const h=d[p]||i,v=h(e[p],t[p],p);fe.isUndefined(v)&&h!==c||(n[p]=v)}),n}const wM=e=>{const t=lc({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:a,auth:c}=t;if(t.headers=a=ci.from(a),t.url=hM(xM(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),fe.isFormData(n)){if(Sr.hasStandardBrowserEnv||Sr.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(fe.isFunction(n.getHeaders)){const d=n.getHeaders(),f=["content-type","content-length"];Object.entries(d).forEach(([p,h])=>{f.includes(p.toLowerCase())&&a.set(p,h)})}}if(Sr.hasStandardBrowserEnv&&(r&&fe.isFunction(r)&&(r=r(t)),r||r!==!1&&oK(t.url))){const d=i&&o&&aK.read(o);d&&a.set(i,d)}return t},cK=typeof XMLHttpRequest<"u",uK=cK&&function(e){return new Promise(function(n,r){const i=wM(e);let o=i.data;const a=ci.from(i.headers).normalize();let{responseType:c,onUploadProgress:d,onDownloadProgress:f}=i,p,h,v,y,b;function S(){y&&y(),b&&b(),i.cancelToken&&i.cancelToken.unsubscribe(p),i.signal&&i.signal.removeEventListener("abort",p)}let C=new XMLHttpRequest;C.open(i.method.toUpperCase(),i.url,!0),C.timeout=i.timeout;function E(){if(!C)return;const j=ci.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),A={data:!c||c==="text"||c==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:j,config:e,request:C};bM(function(T){n(T),S()},function(T){r(T),S()},A),C=null}"onloadend"in C?C.onloadend=E:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(E)},C.onabort=function(){C&&(r(new ft("Request aborted",ft.ECONNABORTED,e,C)),C=null)},C.onerror=function(I){const A=I&&I.message?I.message:"Network Error",N=new ft(A,ft.ERR_NETWORK,e,C);N.event=I||null,r(N),C=null},C.ontimeout=function(){let I=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const A=i.transitional||gM;i.timeoutErrorMessage&&(I=i.timeoutErrorMessage),r(new ft(I,A.clarifyTimeoutError?ft.ETIMEDOUT:ft.ECONNABORTED,e,C)),C=null},o===void 0&&a.setContentType(null),"setRequestHeader"in C&&fe.forEach(a.toJSON(),function(I,A){C.setRequestHeader(A,I)}),fe.isUndefined(i.withCredentials)||(C.withCredentials=!!i.withCredentials),c&&c!=="json"&&(C.responseType=i.responseType),f&&([v,b]=Tv(f,!0),C.addEventListener("progress",v)),d&&C.upload&&([h,y]=Tv(d),C.upload.addEventListener("progress",h),C.upload.addEventListener("loadend",y)),(i.cancelToken||i.signal)&&(p=j=>{C&&(r(!j||j.type?new $d(null,e,C):j),C.abort(),C=null)},i.cancelToken&&i.cancelToken.subscribe(p),i.signal&&(i.signal.aborted?p():i.signal.addEventListener("abort",p)));const k=nK(i.url);if(k&&Sr.protocols.indexOf(k)===-1){r(new ft("Unsupported protocol "+k+":",ft.ERR_BAD_REQUEST,e));return}C.send(o||null)})},dK=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const o=function(f){if(!i){i=!0,c();const p=f instanceof Error?f:this.reason;r.abort(p instanceof ft?p:new $d(p instanceof Error?p.message:p))}};let a=t&&setTimeout(()=>{a=null,o(new ft(`timeout ${t} of ms exceeded`,ft.ETIMEDOUT))},t);const c=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(o):f.removeEventListener("abort",o)}),e=null)};e.forEach(f=>f.addEventListener("abort",o));const{signal:d}=r;return d.unsubscribe=()=>fe.asap(c),d}},fK=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},mK=async function*(e,t){for await(const n of pK(e))yield*fK(n,t)},pK=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},kA=(e,t,n,r)=>{const i=mK(e,t);let o=0,a,c=d=>{a||(a=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:f,value:p}=await i.next();if(f){c(),d.close();return}let h=p.byteLength;if(n){let v=o+=h;n(v)}d.enqueue(new Uint8Array(p))}catch(f){throw c(f),f}},cancel(d){return c(d),i.return()}},{highWaterMark:2})},jA=64*1024,{isFunction:wg}=fe,hK=(({Request:e,Response:t})=>({Request:e,Response:t}))(fe.global),{ReadableStream:RA,TextEncoder:IA}=fe.global,NA=(e,...t)=>{try{return!!e(...t)}catch{return!1}},gK=e=>{e=fe.merge.call({skipUndefined:!0},hK,e);const{fetch:t,Request:n,Response:r}=e,i=t?wg(t):typeof fetch=="function",o=wg(n),a=wg(r);if(!i)return!1;const c=i&&wg(RA),d=i&&(typeof IA=="function"?(b=>S=>b.encode(S))(new IA):async b=>new Uint8Array(await new n(b).arrayBuffer())),f=o&&c&&NA(()=>{let b=!1;const S=new n(Sr.origin,{body:new RA,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!S}),p=a&&c&&NA(()=>fe.isReadableStream(new r("").body)),h={stream:p&&(b=>b.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!h[b]&&(h[b]=(S,C)=>{let E=S&&S[b];if(E)return E.call(S);throw new ft(`Response type '${b}' is not supported`,ft.ERR_NOT_SUPPORT,C)})});const v=async b=>{if(b==null)return 0;if(fe.isBlob(b))return b.size;if(fe.isSpecCompliantForm(b))return(await new n(Sr.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(fe.isArrayBufferView(b)||fe.isArrayBuffer(b))return b.byteLength;if(fe.isURLSearchParams(b)&&(b=b+""),fe.isString(b))return(await d(b)).byteLength},y=async(b,S)=>{const C=fe.toFiniteNumber(b.getContentLength());return C??v(S)};return async b=>{let{url:S,method:C,data:E,signal:k,cancelToken:j,timeout:I,onDownloadProgress:A,onUploadProgress:N,responseType:T,headers:z,withCredentials:L="same-origin",fetchOptions:G}=wM(b),J=t||fetch;T=T?(T+"").toLowerCase():"text";let Y=dK([k,j&&j.toAbortSignal()],I),W=null;const F=Y&&Y.unsubscribe&&(()=>{Y.unsubscribe()});let Z;try{if(N&&f&&C!=="get"&&C!=="head"&&(Z=await y(z,E))!==0){let P=new n(S,{method:"POST",body:E,duplex:"half"}),V;if(fe.isFormData(E)&&(V=P.headers.get("content-type"))&&z.setContentType(V),P.body){const[O,ee]=_A(Z,Tv(CA(N)));E=kA(P.body,jA,O,ee)}}fe.isString(L)||(L=L?"include":"omit");const M=o&&"credentials"in n.prototype,K={...G,signal:Y,method:C.toUpperCase(),headers:z.normalize().toJSON(),body:E,duplex:"half",credentials:M?L:void 0};W=o&&new n(S,K);let U=await(o?J(W,G):J(S,K));const te=p&&(T==="stream"||T==="response");if(p&&(A||te&&F)){const P={};["status","statusText","headers"].forEach(ue=>{P[ue]=U[ue]});const V=fe.toFiniteNumber(U.headers.get("content-length")),[O,ee]=A&&_A(V,Tv(CA(A),!0))||[];U=new r(kA(U.body,jA,O,()=>{ee&&ee(),F&&F()}),P)}T=T||"text";let D=await h[fe.findKey(h,T)||"text"](U,b);return!te&&F&&F(),await new Promise((P,V)=>{bM(P,V,{data:D,headers:ci.from(U.headers),status:U.status,statusText:U.statusText,config:b,request:W})})}catch(M){throw F&&F(),M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new ft("Network Error",ft.ERR_NETWORK,b,W),{cause:M.cause||M}):ft.from(M,M&&M.code,b,W)}}},vK=new Map,SM=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let a=o.length,c=a,d,f,p=vK;for(;c--;)d=o[c],f=p.get(d),f===void 0&&p.set(d,f=c?new Map:gK(t)),p=f;return f};SM();const xC={http:DG,xhr:uK,fetch:{get:SM}};fe.forEach(xC,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const TA=e=>`- ${e}`,yK=e=>fe.isFunction(e)||e===null||e===!1;function bK(e,t){e=fe.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let a=0;a<n;a++){r=e[a];let c;if(i=r,!yK(r)&&(i=xC[(c=String(r)).toLowerCase()],i===void 0))throw new ft(`Unknown adapter '${c}'`);if(i&&(fe.isFunction(i)||(i=i.get(t))))break;o[c||"#"+a]=i}if(!i){const a=Object.entries(o).map(([d,f])=>`adapter ${d} `+(f===!1?"is not supported by the environment":"is not available in the build"));let c=n?a.length>1?`since :
|
|
5
|
-
`+a.map(TA).join(`
|
|
6
|
-
`):" "+TA(a[0]):"as no adapter specified";throw new ft("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return i}const _M={getAdapter:bK,adapters:xC};function Bw(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new $d(null,e)}function AA(e){return Bw(e),e.headers=ci.from(e.headers),e.data=Vw.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),_M.getAdapter(e.adapter||vp.adapter,e)(e).then(function(r){return Bw(e),r.data=Vw.call(e,e.transformResponse,r),r.headers=ci.from(r.headers),r},function(r){return yM(r)||(Bw(e),r&&r.response&&(r.response.data=Vw.call(e,e.transformResponse,r.response),r.response.headers=ci.from(r.response.headers))),Promise.reject(r)})}const CM="1.13.2",Fy={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Fy[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const OA={};Fy.transitional=function(t,n,r){function i(o,a){return"[Axios v"+CM+"] Transitional option '"+o+"'"+a+(r?". "+r:"")}return(o,a,c)=>{if(t===!1)throw new ft(i(a," has been removed"+(n?" in "+n:"")),ft.ERR_DEPRECATED);return n&&!OA[a]&&(OA[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,a,c):!0}};Fy.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function xK(e,t,n){if(typeof e!="object")throw new ft("options must be an object",ft.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],a=t[o];if(a){const c=e[o],d=c===void 0||a(c,o,e);if(d!==!0)throw new ft("option "+o+" must be "+d,ft.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ft("Unknown option "+o,ft.ERR_BAD_OPTION)}}const mv={assertOptions:xK,validators:Fy},Zo=mv.validators;let ec=class{constructor(t){this.defaults=t||{},this.interceptors={request:new wA,response:new wA}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
7
|
-
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=lc(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&mv.assertOptions(r,{silentJSONParsing:Zo.transitional(Zo.boolean),forcedJSONParsing:Zo.transitional(Zo.boolean),clarifyTimeoutError:Zo.transitional(Zo.boolean)},!1),i!=null&&(fe.isFunction(i)?n.paramsSerializer={serialize:i}:mv.assertOptions(i,{encode:Zo.function,serialize:Zo.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),mv.assertOptions(n,{baseUrl:Zo.spelling("baseURL"),withXsrfToken:Zo.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&fe.merge(o.common,o[n.method]);o&&fe.forEach(["delete","get","head","post","put","patch","common"],b=>{delete o[b]}),n.headers=ci.concat(a,o);const c=[];let d=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(d=d&&S.synchronous,c.unshift(S.fulfilled,S.rejected))});const f=[];this.interceptors.response.forEach(function(S){f.push(S.fulfilled,S.rejected)});let p,h=0,v;if(!d){const b=[AA.bind(this),void 0];for(b.unshift(...c),b.push(...f),v=b.length,p=Promise.resolve(n);h<v;)p=p.then(b[h++],b[h++]);return p}v=c.length;let y=n;for(;h<v;){const b=c[h++],S=c[h++];try{y=b(y)}catch(C){S.call(this,C);break}}try{p=AA.call(this,y)}catch(b){return Promise.reject(b)}for(h=0,v=f.length;h<v;)p=p.then(f[h++],f[h++]);return p}getUri(t){t=lc(this.defaults,t);const n=xM(t.baseURL,t.url,t.allowAbsoluteUrls);return hM(n,t.params,t.paramsSerializer)}};fe.forEach(["delete","get","head","options"],function(t){ec.prototype[t]=function(n,r){return this.request(lc(r||{},{method:t,url:n,data:(r||{}).data}))}});fe.forEach(["post","put","patch"],function(t){function n(r){return function(o,a,c){return this.request(lc(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}ec.prototype[t]=n(),ec.prototype[t+"Form"]=n(!0)});let wK=class EM{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(c=>{r.subscribe(c),o=c}).then(i);return a.cancel=function(){r.unsubscribe(o)},a},t(function(o,a,c){r.reason||(r.reason=new $d(o,a,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new EM(function(i){t=i}),cancel:t}}};function SK(e){return function(n){return e.apply(null,n)}}function _K(e){return fe.isObject(e)&&e.isAxiosError===!0}const O_={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(O_).forEach(([e,t])=>{O_[t]=e});function kM(e){const t=new ec(e),n=rM(ec.prototype.request,t);return fe.extend(n,ec.prototype,t,{allOwnKeys:!0}),fe.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return kM(lc(e,i))},n}const Rn=kM(vp);Rn.Axios=ec;Rn.CanceledError=$d;Rn.CancelToken=wK;Rn.isCancel=yM;Rn.VERSION=CM;Rn.toFormData=Uy;Rn.AxiosError=ft;Rn.Cancel=Rn.CanceledError;Rn.all=function(t){return Promise.all(t)};Rn.spread=SK;Rn.isAxiosError=_K;Rn.mergeConfig=lc;Rn.AxiosHeaders=ci;Rn.formToJSON=e=>vM(fe.isHTMLForm(e)?new FormData(e):e);Rn.getAdapter=_M.getAdapter;Rn.HttpStatusCode=O_;Rn.default=Rn;const{Axios:YTe,AxiosError:WTe,CanceledError:XTe,isCancel:QTe,CancelToken:JTe,VERSION:eAe,all:tAe,Cancel:nAe,isAxiosError:rAe,spread:iAe,toFormData:oAe,AxiosHeaders:aAe,HttpStatusCode:sAe,formToJSON:lAe,getAdapter:cAe,mergeConfig:uAe}=Rn,Ut=Rn.create({withCredentials:!0,baseURL:"/",timeout:15e3,headers:{"Content-Type":"application/json"}});function Io(e,t,n){return e===1||e==="1"?`${e} ${t}`:`${e} ${n}`}function CK(e){return e.replicated?.some(t=>jM(t))??!1}function EK(e){return e.status!=="failed"}function jM(e){return e.status==="failed"}function kK(e){if(CK(e.data)){const t=e.data.replicated.filter(EK),n=e.data.replicated.filter(jM),r=t.length?`The operation partially succeeded, but ${Io(n.length,"node","nodes")} failed:`:n.length===1?"The operation failed on the single node:":`The operation failed on all ${n.length} nodes:`,i=n.map(o=>`${o.node}: ${o.reason}`).join(`
|
|
8
|
-
`);return Promise.reject(r+`
|
|
9
|
-
`+i)}return e}function Md(e=1e3){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}function jK(e){return async t=>{const n=t?.response?.status,r=t?.config;if(!r||!(n===502||n===503||n===504))return Promise.reject(t);const o=3;if(r.__retryCount=r.__retryCount||0,r.__retryCount>=o)return Promise.reject(t);r.__retryCount+=1;const c=5e3*Math.pow(2,r.__retryCount-1);return await Md(c),e.request(r)}}function Va({id:e=_n,operationsUrl:t,port:n,secure:r,forceFabricConnect:i}={}){let o=t||Tt.getOperationsUrl(e);if(o&&(n||r!==void 0)){const f=new URL(o);n&&(f.port=String(n)),r!==void 0&&(f.protocol=r?"https:":"http:"),o=f.toString()}const a=i||Tt.checkForFabricConnect(e);a&&(e.startsWith("clu-")?o=Ut.defaults.baseURL+`/Cluster/${e}/operation`:e.startsWith("ins-")&&(o=Ut.defaults.baseURL+`/HDBInstance/${e}/operation`));const c=Tt.checkForBasicAuth(e),d=Rn.create({auth:a?void 0:c,withCredentials:a||!c,timeout:15e3,headers:{"Content-Type":"application/json"},baseURL:o});return d.interceptors.response.use(kK,jK(d)),d}var Pd=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},RK={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},IK=class{#e=RK;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Kl=new IK;function NK(e){setTimeout(e,0)}var cc=typeof window>"u"||"Deno"in globalThis;function Mr(){}function TK(e,t){return typeof e=="function"?e(t):e}function D_(e){return typeof e=="number"&&e>=0&&e!==1/0}function RM(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Hs(e,t){return typeof e=="function"?e(t):e}function eo(e,t){return typeof e=="function"?e(t):e}function DA(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:c}=e;if(a){if(r){if(t.queryHash!==wC(a,t.options))return!1}else if(!Km(t.queryKey,a))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||i&&i!==t.state.fetchStatus||o&&!o(t))}function $A(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(uc(t.options.mutationKey)!==uc(o))return!1}else if(!Km(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function wC(e,t){return(t?.queryKeyHashFn||uc)(e)}function uc(e){return JSON.stringify(e,(t,n)=>$_(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Km(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Km(e[n],t[n])):!1}var AK=Object.prototype.hasOwnProperty;function IM(e,t){if(e===t)return e;const n=MA(e)&&MA(t);if(!n&&!($_(e)&&$_(t)))return t;const i=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),a=o.length,c=n?new Array(a):{};let d=0;for(let f=0;f<a;f++){const p=n?f:o[f],h=e[p],v=t[p];if(h===v){c[p]=h,(n?f<i:AK.call(e,p))&&d++;continue}if(h===null||v===null||typeof h!="object"||typeof v!="object"){c[p]=v;continue}const y=IM(h,v);c[p]=y,y===h&&d++}return i===a&&d===i?e:c}function Av(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function MA(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function $_(e){if(!PA(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!PA(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function PA(e){return Object.prototype.toString.call(e)==="[object Object]"}function OK(e){return new Promise(t=>{Kl.setTimeout(t,e)})}function M_(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?IM(e,t):t}function DK(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function $K(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var SC=Symbol();function NM(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===SC?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function TM(e,t){return typeof e=="function"?e(...t):!!e}var MK=class extends Pd{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!cc&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},_C=new MK;function P_(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var PK=NK;function zK(){let e=[],t=0,n=c=>{c()},r=c=>{c()},i=PK;const o=c=>{t?e.push(c):i(()=>{n(c)})},a=()=>{const c=e;e=[],c.length&&i(()=>{r(()=>{c.forEach(d=>{n(d)})})})};return{batch:c=>{let d;t++;try{d=c()}finally{t--,t||a()}return d},batchCalls:c=>(...d)=>{o(()=>{c(...d)})},schedule:o,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{i=c}}}var er=zK(),LK=class extends Pd{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!cc&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Ov=new LK;function UK(e){return Math.min(1e3*2**e,3e4)}function AM(e){return(e??"online")==="online"?Ov.isOnline():!0}var z_=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function OM(e){let t=!1,n=0,r;const i=P_(),o=()=>i.status!=="pending",a=S=>{if(!o()){const C=new z_(S);v(C),e.onCancel?.(C)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>_C.isFocused()&&(e.networkMode==="always"||Ov.isOnline())&&e.canRun(),p=()=>AM(e.networkMode)&&e.canRun(),h=S=>{o()||(r?.(),i.resolve(S))},v=S=>{o()||(r?.(),i.reject(S))},y=()=>new Promise(S=>{r=C=>{(o()||f())&&S(C)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),b=()=>{if(o())return;let S;const C=n===0?e.initialPromise:void 0;try{S=C??e.fn()}catch(E){S=Promise.reject(E)}Promise.resolve(S).then(h).catch(E=>{if(o())return;const k=e.retry??(cc?0:3),j=e.retryDelay??UK,I=typeof j=="function"?j(n,E):j,A=k===!0||typeof k=="number"&&n<k||typeof k=="function"&&k(n,E);if(t||!A){v(E);return}n++,e.onFail?.(n,E),OK(I).then(()=>f()?void 0:y()).then(()=>{t?v(E):b()})})};return{promise:i,status:()=>i.status,cancel:a,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:d,canStart:p,start:()=>(p()?b():y().then(b),i)}}var DM=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),D_(this.gcTime)&&(this.#e=Kl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(cc?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Kl.clearTimeout(this.#e),this.#e=void 0)}},FK=class extends DM{#e;#t;#n;#i;#r;#a;#s;constructor(e){super(),this.#s=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=LA(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=LA(this.options);t.data!==void 0&&(this.setState(zA(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=M_(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Mr).catch(Mr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>eo(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===SC||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Hs(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!RM(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#s?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(d=>d.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{const c=NM(this.options,t),f=(()=>{const p={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(p),p})();return this.#s=!1,this.options.persister?this.options.persister(c,f,this):c(f)},a=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(c),c})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#o({type:"fetch",meta:a.fetchOptions?.meta}),this.#r=OM({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:c=>{c instanceof z_&&c.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(c,d)=>{this.#o({type:"failed",failureCount:c,error:d})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const c=await this.#r.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#n.config.onSuccess?.(c,this),this.#n.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof z_){if(c.silent)return this.#r.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#o({type:"error",error:c}),this.#n.config.onError?.(c,this),this.#n.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...$M(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...zA(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),er.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function $M(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:AM(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function zA(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function LA(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var MM=class extends Pd{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#s=P_(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#i=void 0;#r;#a;#s;#o;#h;#f;#m;#c;#u;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),UA(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return L_(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return L_(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof eo(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Av(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&FA(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||eo(this.options.enabled,this.#t)!==eo(t.enabled,this.#t)||Hs(this.options.staleTime,this.#t)!==Hs(t.staleTime,this.#t))&&this.#g();const i=this.#v();r&&(this.#t!==n||eo(this.options.enabled,this.#t)!==eo(t.enabled,this.#t)||i!==this.#l)&&this.#y(i)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return BK(this,n)&&(this.#i=n,this.#a=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#d(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Mr)),t}#g(){this.#x();const e=Hs(this.options.staleTime,this.#t);if(cc||this.#i.isStale||!D_(e))return;const n=RM(this.#i.dataUpdatedAt,e)+1;this.#c=Kl.setTimeout(()=>{this.#i.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#l=e,!(cc||eo(this.options.enabled,this.#t)===!1||!D_(this.#l)||this.#l===0)&&(this.#u=Kl.setInterval(()=>{(this.options.refetchIntervalInBackground||_C.isFocused())&&this.#d()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#c&&(Kl.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(Kl.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,i=this.#i,o=this.#r,a=this.#a,d=e!==n?e.state:this.#n,{state:f}=e;let p={...f},h=!1,v;if(t._optimisticResults){const z=this.hasListeners(),L=!z&&UA(e,t),G=z&&FA(e,n,t,r);(L||G)&&(p={...p,...$M(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:y,errorUpdatedAt:b,status:S}=p;v=p.data;let C=!1;if(t.placeholderData!==void 0&&v===void 0&&S==="pending"){let z;i?.isPlaceholderData&&t.placeholderData===a?.placeholderData?(z=i.data,C=!0):z=typeof t.placeholderData=="function"?t.placeholderData(this.#m?.state.data,this.#m):t.placeholderData,z!==void 0&&(S="success",v=M_(i?.data,z,t),h=!0)}if(t.select&&v!==void 0&&!C)if(i&&v===o?.data&&t.select===this.#h)v=this.#f;else try{this.#h=t.select,v=t.select(v),v=M_(i?.data,v,t),this.#f=v,this.#o=null}catch(z){this.#o=z}this.#o&&(y=this.#o,v=this.#f,b=Date.now(),S="error");const E=p.fetchStatus==="fetching",k=S==="pending",j=S==="error",I=k&&E,A=v!==void 0,T={status:S,fetchStatus:p.fetchStatus,isPending:k,isSuccess:S==="success",isError:j,isInitialLoading:I,isLoading:I,data:v,dataUpdatedAt:p.dataUpdatedAt,error:y,errorUpdatedAt:b,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:E,isRefetching:E&&!k,isLoadingError:j&&!A,isPaused:p.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:j&&A,isStale:CC(e,t),refetch:this.refetch,promise:this.#s,isEnabled:eo(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const z=J=>{T.status==="error"?J.reject(T.error):T.data!==void 0&&J.resolve(T.data)},L=()=>{const J=this.#s=T.promise=P_();z(J)},G=this.#s;switch(G.status){case"pending":e.queryHash===n.queryHash&&z(G);break;case"fulfilled":(T.status==="error"||T.data!==G.value)&&L();break;case"rejected":(T.status!=="error"||T.error!==G.reason)&&L();break}}return T}updateResult(){const e=this.#i,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#a=this.options,this.#r.data!==void 0&&(this.#m=this.#t),Av(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#p.size)return!0;const o=new Set(i??this.#p);return this.options.throwOnError&&o.add("error"),Object.keys(this.#i).some(a=>{const c=a;return this.#i[c]!==e[c]&&o.has(c)})};this.#_({listeners:n()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#_(e){er.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function VK(e,t){return eo(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function UA(e,t){return VK(e,t)||e.state.data!==void 0&&L_(e,t,t.refetchOnMount)}function L_(e,t,n){if(eo(t.enabled,e)!==!1&&Hs(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&CC(e,t)}return!1}function FA(e,t,n,r){return(e!==t||eo(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&CC(e,n)}function CC(e,t){return eo(t.enabled,e)!==!1&&e.isStaleByTime(Hs(t.staleTime,e))}function BK(e,t){return!Av(e.getCurrentResult(),t)}function VA(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let c={pages:[],pageParams:[]},d=0;const f=async()=>{let p=!1;const h=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},v=NM(t.options,t.fetchOptions),y=async(b,S,C)=>{if(p)return Promise.reject();if(S==null&&b.pages.length)return Promise.resolve(b);const k=(()=>{const N={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return h(N),N})(),j=await v(k),{maxPages:I}=t.options,A=C?$K:DK;return{pages:A(b.pages,j,I),pageParams:A(b.pageParams,S,I)}};if(i&&o.length){const b=i==="backward",S=b?HK:BA,C={pages:o,pageParams:a},E=S(r,C);c=await y(C,E,b)}else{const b=e??o.length;do{const S=d===0?a[0]??r.initialPageParam:BA(r,c);if(d>0&&S==null)break;c=await y(c,S),d++}while(d<b)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=f}}}function BA(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function HK(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var qK=class extends DM{#e;#t;#n;#i;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||PM(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=OM({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(o,a)=>{this.#r({type:"failed",failureCount:o,error:a})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#i.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:i}),await this.#n.config.onMutate?.(e,this,n);const a=await this.options.onMutate?.(e,n);a!==this.state.context&&this.#r({type:"pending",context:a,variables:e,isPaused:i})}const o=await this.#i.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#r({type:"success",data:o}),o}catch(o){try{throw await this.#n.config.onError?.(o,e,this.state.context,this,n),await this.options.onError?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,o,e,this.state.context,n),o}finally{this.#r({type:"error",error:o})}}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),er.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function PM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var zM=class extends Pd{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new qK({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Sg(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Sg(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Sg(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Sg(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){er.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>$A(t,n))}findAll(e={}){return this.getAll().filter(t=>$A(e,t))}notify(e){er.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return er.batch(()=>Promise.all(e.map(t=>t.continue().catch(Mr))))}};function Sg(e){return e.options.scope?.id}var GK=class extends Pd{#e;#t=void 0;#n;#i;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),Av(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&uc(n.mutationKey)!==uc(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#a(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#a()}mutate(t,n){return this.#i=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??PM();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){er.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#i.onSuccess?.(t.data,n,r,i),this.#i.onSettled?.(t.data,null,n,r,i)):t?.type==="error"&&(this.#i.onError?.(t.error,n,r,i),this.#i.onSettled?.(void 0,t.error,n,r,i))}this.listeners.forEach(n=>{n(this.#t)})})}},LM=class extends Pd{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??wC(r,t);let o=this.get(i);return o||(o=new FK({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){er.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>DA(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>DA(e,n)):t}notify(e){er.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){er.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){er.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},KK=class{#e;#t;#n;#i;#r;#a;#s;#o;constructor(e={}){this.#e=e.queryCache||new LM,this.#t=e.mutationCache||new zM,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#s=_C.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=Ov.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#s?.(),this.#s=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Hs(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,a=TK(t,o);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return er.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;er.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return er.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=er.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Mr).catch(Mr)}invalidateQueries(e,t={}){return er.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=er.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Mr)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Mr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Hs(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Mr).catch(Mr)}fetchInfiniteQuery(e){return e.behavior=VA(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Mr).catch(Mr)}ensureInfiniteQueryData(e){return e.behavior=VA(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ov.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(uc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{Km(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(uc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Km(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=wC(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===SC&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Hw={exports:{}},lt={};var HA;function ZK(){if(HA)return lt;HA=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),v=Symbol.iterator;function y(P){return P===null||typeof P!="object"?null:(P=v&&P[v]||P["@@iterator"],typeof P=="function"?P:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function E(P,V,O){this.props=P,this.context=V,this.refs=C,this.updater=O||b}E.prototype.isReactComponent={},E.prototype.setState=function(P,V){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,V,"setState")},E.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function k(){}k.prototype=E.prototype;function j(P,V,O){this.props=P,this.context=V,this.refs=C,this.updater=O||b}var I=j.prototype=new k;I.constructor=j,S(I,E.prototype),I.isPureReactComponent=!0;var A=Array.isArray;function N(){}var T={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function L(P,V,O){var ee=O.ref;return{$$typeof:e,type:P,key:V,ref:ee!==void 0?ee:null,props:O}}function G(P,V){return L(P.type,V,P.props)}function J(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function Y(P){var V={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(O){return V[O]})}var W=/\/+/g;function F(P,V){return typeof P=="object"&&P!==null&&P.key!=null?Y(""+P.key):V.toString(36)}function Z(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(N,N):(P.status="pending",P.then(function(V){P.status==="pending"&&(P.status="fulfilled",P.value=V)},function(V){P.status==="pending"&&(P.status="rejected",P.reason=V)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function M(P,V,O,ee,ue){var pe=typeof P;(pe==="undefined"||pe==="boolean")&&(P=null);var B=!1;if(P===null)B=!0;else switch(pe){case"bigint":case"string":case"number":B=!0;break;case"object":switch(P.$$typeof){case e:case t:B=!0;break;case p:return B=P._init,M(B(P._payload),V,O,ee,ue)}}if(B)return ue=ue(P),B=ee===""?"."+F(P,0):ee,A(ue)?(O="",B!=null&&(O=B.replace(W,"$&/")+"/"),M(ue,V,O,"",function(Ie){return Ie})):ue!=null&&(J(ue)&&(ue=G(ue,O+(ue.key==null||P&&P.key===ue.key?"":(""+ue.key).replace(W,"$&/")+"/")+B)),V.push(ue)),1;B=0;var ie=ee===""?".":ee+":";if(A(P))for(var Se=0;Se<P.length;Se++)ee=P[Se],pe=ie+F(ee,Se),B+=M(ee,V,O,pe,ue);else if(Se=y(P),typeof Se=="function")for(P=Se.call(P),Se=0;!(ee=P.next()).done;)ee=ee.value,pe=ie+F(ee,Se++),B+=M(ee,V,O,pe,ue);else if(pe==="object"){if(typeof P.then=="function")return M(Z(P),V,O,ee,ue);throw V=String(P),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return B}function K(P,V,O){if(P==null)return P;var ee=[],ue=0;return M(P,ee,"","",function(pe){return V.call(O,pe,ue++)}),ee}function U(P){if(P._status===-1){var V=P._result;V=V(),V.then(function(O){(P._status===0||P._status===-1)&&(P._status=1,P._result=O)},function(O){(P._status===0||P._status===-1)&&(P._status=2,P._result=O)}),P._status===-1&&(P._status=0,P._result=V)}if(P._status===1)return P._result.default;throw P._result}var te=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},D={map:K,forEach:function(P,V,O){K(P,function(){V.apply(this,arguments)},O)},count:function(P){var V=0;return K(P,function(){V++}),V},toArray:function(P){return K(P,function(V){return V})||[]},only:function(P){if(!J(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return lt.Activity=h,lt.Children=D,lt.Component=E,lt.Fragment=n,lt.Profiler=i,lt.PureComponent=j,lt.StrictMode=r,lt.Suspense=d,lt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,lt.__COMPILER_RUNTIME={__proto__:null,c:function(P){return T.H.useMemoCache(P)}},lt.cache=function(P){return function(){return P.apply(null,arguments)}},lt.cacheSignal=function(){return null},lt.cloneElement=function(P,V,O){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var ee=S({},P.props),ue=P.key;if(V!=null)for(pe in V.key!==void 0&&(ue=""+V.key),V)!z.call(V,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&V.ref===void 0||(ee[pe]=V[pe]);var pe=arguments.length-2;if(pe===1)ee.children=O;else if(1<pe){for(var B=Array(pe),ie=0;ie<pe;ie++)B[ie]=arguments[ie+2];ee.children=B}return L(P.type,ue,ee)},lt.createContext=function(P){return P={$$typeof:a,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:o,_context:P},P},lt.createElement=function(P,V,O){var ee,ue={},pe=null;if(V!=null)for(ee in V.key!==void 0&&(pe=""+V.key),V)z.call(V,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(ue[ee]=V[ee]);var B=arguments.length-2;if(B===1)ue.children=O;else if(1<B){for(var ie=Array(B),Se=0;Se<B;Se++)ie[Se]=arguments[Se+2];ue.children=ie}if(P&&P.defaultProps)for(ee in B=P.defaultProps,B)ue[ee]===void 0&&(ue[ee]=B[ee]);return L(P,pe,ue)},lt.createRef=function(){return{current:null}},lt.forwardRef=function(P){return{$$typeof:c,render:P}},lt.isValidElement=J,lt.lazy=function(P){return{$$typeof:p,_payload:{_status:-1,_result:P},_init:U}},lt.memo=function(P,V){return{$$typeof:f,type:P,compare:V===void 0?null:V}},lt.startTransition=function(P){var V=T.T,O={};T.T=O;try{var ee=P(),ue=T.S;ue!==null&&ue(O,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(N,te)}catch(pe){te(pe)}finally{V!==null&&O.types!==null&&(V.types=O.types),T.T=V}},lt.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},lt.use=function(P){return T.H.use(P)},lt.useActionState=function(P,V,O){return T.H.useActionState(P,V,O)},lt.useCallback=function(P,V){return T.H.useCallback(P,V)},lt.useContext=function(P){return T.H.useContext(P)},lt.useDebugValue=function(){},lt.useDeferredValue=function(P,V){return T.H.useDeferredValue(P,V)},lt.useEffect=function(P,V){return T.H.useEffect(P,V)},lt.useEffectEvent=function(P){return T.H.useEffectEvent(P)},lt.useId=function(){return T.H.useId()},lt.useImperativeHandle=function(P,V,O){return T.H.useImperativeHandle(P,V,O)},lt.useInsertionEffect=function(P,V){return T.H.useInsertionEffect(P,V)},lt.useLayoutEffect=function(P,V){return T.H.useLayoutEffect(P,V)},lt.useMemo=function(P,V){return T.H.useMemo(P,V)},lt.useOptimistic=function(P,V){return T.H.useOptimistic(P,V)},lt.useReducer=function(P,V,O){return T.H.useReducer(P,V,O)},lt.useRef=function(P){return T.H.useRef(P)},lt.useState=function(P){return T.H.useState(P)},lt.useSyncExternalStore=function(P,V,O){return T.H.useSyncExternalStore(P,V,O)},lt.useTransition=function(){return T.H.useTransition()},lt.version="19.2.0",lt}var qA;function yp(){return qA||(qA=1,Hw.exports=ZK()),Hw.exports}var x=yp();const X=mp(x),EC=qq({__proto__:null,default:X},[x]);var UM=x.createContext(void 0),gr=e=>{const t=x.useContext(UM);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},YK=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(UM.Provider,{value:e,children:t})),FM=x.createContext(!1),WK=()=>x.useContext(FM);FM.Provider;function XK(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var QK=x.createContext(XK()),JK=()=>x.useContext(QK),eZ=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},tZ=e=>{x.useEffect(()=>{e.clearReset()},[e])},nZ=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||TM(n,[e.error,r])),rZ=(e,t)=>t.state.data===void 0,iZ=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},oZ=(e,t)=>e.isLoading&&e.isFetching&&!t,aZ=(e,t)=>e?.suspense&&t.isPending,GA=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function VM(e,t,n){const r=WK(),i=JK(),o=gr(),a=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=r?"isRestoring":"optimistic",iZ(a),eZ(a,i),tZ(i);const c=!o.getQueryCache().get(a.queryHash),[d]=x.useState(()=>new t(o,a)),f=d.getOptimisticResult(a),p=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(h=>{const v=p?d.subscribe(er.batchCalls(h)):Mr;return d.updateResult(),v},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),x.useEffect(()=>{d.setOptions(a)},[a,d]),aZ(a,f))throw GA(a,d,i);if(nZ({result:f,errorResetBoundary:i,throwOnError:a.throwOnError,query:o.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw f.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(a,f),a.experimental_prefetchInRender&&!cc&&oZ(f,r)&&(c?GA(a,d,i):o.getQueryCache().get(a.queryHash)?.promise)?.catch(Mr).finally(()=>{d.updateResult()}),a.notifyOnChangeProps?f:d.trackResult(f)}function Mt(e,t){return VM(e,MM)}function Mi(e,t){return VM({...e,enabled:!0,suspense:!0,throwOnError:rZ,placeholderData:void 0},MM)}function fAe(e){return e}function at(e,t){const n=gr(),[r]=x.useState(()=>new GK(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const i=x.useSyncExternalStore(x.useCallback(a=>r.subscribe(er.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=x.useCallback((a,c)=>{r.mutate(a,c).catch(Mr)},[r]);if(i.error&&TM(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}async function BM(){const{data:e}=await Ut.get("/User/current");return e}const Vy=["current-user"];function sZ(){return{queryKey:Vy,queryFn:BM,retry:!1}}async function bp({instanceClient:e,entityId:t}){const{data:n}=await e.post("/",{operation:"logout"});if(Tt.flagForBasicAuth(t,null),n)return n;throw new Error("Something went wrong")}async function qs({instanceClient:e,...t}){const{data:n}=await e.post("/",{operation:"user_info"},t);return n}function kC(e){let t=e?.fqdn;if(!t)return null;t.match(/^https?:\/\//i)||(t=`https://${t}`);const n=new URL(t);return t.match(/:\d+/)||(n.port=String(cd)),t.includes("://")||(n.protocol="https:"),n.toString()}function jC(e){let t=e.instanceFqdn;t.match(/^https?:\/\//i)||(t=`https://${t}`);const n=new URL(t);return e.operationsApiPort&&(n.port=String(e.operationsApiPort)),e.operationsApiSecure!==void 0&&(n.protocol=e.operationsApiSecure?"https:":"http:"),n.toString()}const _n="OverallAppSignIn";class lZ{broadListeners=[];specificListeners={};potentiallyAuthenticatedKey="Studio:PotentiallyAuthenticated";basicAuthKeyPrefix="Studio:BasicAuth:";fabricConnectKeyPrefix="Studio:FabricConnect:";potentiallyAuthenticated;checkedAuthentication={};allConnections={};constructor(){this.potentiallyAuthenticated=JSON.parse(localStorage.getItem(this.potentiallyAuthenticatedKey)||"{}")}getAllConnections(){return this.potentiallyAuthenticated.OverallAppSignIn||(this.allConnections[_n]={user:null,isLoading:!1}),this.allConnections}getConnectionById(t){return this.allConnections[t]||(this.allConnections[t]={user:null,isLoading:!!this.potentiallyAuthenticated[t]}),this.allConnections[t]}listenToAllEntities(t){this.broadListeners.includes(t)||this.broadListeners.push(t);for(const n in this.potentiallyAuthenticated)this.ensureUserIsLoaded(n);return()=>{const n=this.broadListeners.indexOf(t);n>=0&&this.broadListeners.splice(n,1)}}listenToEntity(t,n){if(t)return this.specificListeners[t]||(this.specificListeners[t]=[]),this.specificListeners[t].includes(n)||this.specificListeners[t].push(n),this.ensureUserIsLoaded(t),()=>{const r=this.specificListeners[t].indexOf(n);r>=0&&this.specificListeners[t].splice(r,1)}}setUserForEntity(t,n){const r=this.calculateIdFromEntity(t),i=this.calculateKeyFromEntity(t);if(!(!r||!i))return this.setUserForIdAndKey(r,i,n)}setUserForIdAndKey(t,n,r){r?this.flagKeyAsSignedIn(t,n):this.flagKeyAsSignedOut(t),this.updateConnectionIfChanged(t,!1,r)}updateUserForEntity(t,n){const r=this.calculateIdFromEntity(t);if(!r)return;const i=this.getConnectionById(r);i.user&&this.updateConnectionIfChanged(r,!1,{...i.user,...n})}calculateIdFromEntity(t){return _n}flagForBasicAuth(t,n){n!==null?localStorage.setItem(this.basicAuthKeyPrefix+t,btoa(JSON.stringify(n))):localStorage.removeItem(this.basicAuthKeyPrefix+t)}flagForFabricConnect(t,n){n?localStorage.setItem(this.fabricConnectKeyPrefix+t,"true"):localStorage.removeItem(this.fabricConnectKeyPrefix+t)}checkForBasicAuth(t){const n=localStorage.getItem(this.basicAuthKeyPrefix+t);return n?JSON.parse(atob(n)):void 0}checkForFabricConnect(t){return localStorage.getItem(this.fabricConnectKeyPrefix+t)==="true"}async signOutFromPotentiallyAuthenticatedInstances(){for(const t in this.potentiallyAuthenticated)if(this.allConnections[t].user=null,this.allConnections[t].isLoading=!1,this.flagKeyAsSignedOut(t),t!==_n)try{const n=Va({id:t});await bp({entityId:t,instanceClient:n})}catch(n){console.error(`Failed to log out from ${t}, carrying on`,n)}}calculateKeyFromEntity(t){return _n}updateConnectionIfChanged(t,n,r){this.checkedAuthentication[t]=!0;const i=this.getConnectionById(t);let o=!1;i.isLoading!==n&&(i.isLoading=n,o=!0),i.user!==r&&(i.user=r,o=!0),o&&this.updateListeners(t)}flagKeyAsSignedIn(t,n){this.potentiallyAuthenticated[t]!==n&&(this.potentiallyAuthenticated[t]=n,localStorage.setItem(this.potentiallyAuthenticatedKey,JSON.stringify(this.potentiallyAuthenticated)))}flagKeyAsSignedOut(t){this.potentiallyAuthenticated[t]&&(delete this.potentiallyAuthenticated[t],localStorage.setItem(this.potentiallyAuthenticatedKey,JSON.stringify(this.potentiallyAuthenticated)))}async updateListeners(t){if(await Md(1),this.broadListeners)for(const n of this.broadListeners)this.updateListener(t,n);if(this.specificListeners[t])for(const n of this.specificListeners[t])this.updateListener(t,n)}updateListener(t,n){n(this.getConnectionById(t),t)}async ensureUserIsLoaded(t){this.checkedAuthentication[t]||await this.reloadUser(t)}getOperationsUrl(t){return Zq}async reloadUser(t){return this.potentiallyAuthenticated[t]?this.loadUser(t):(this.updateConnectionIfChanged(t,!1,null),null)}async loadUser(t){const n=this.potentiallyAuthenticated[t];this.updateConnectionIfChanged(t,!0,null);let r=null;try{t===_n?Qu&&(r=await qs({instanceClient:Va()})):t&&(r=await qs({instanceClient:Va({id:t})}))}catch(i){console.error(i),r=null}return r?this.flagKeyAsSignedIn(t,n):this.flagKeyAsSignedOut(t),this.updateConnectionIfChanged(t,!1,r),r}}const Tt=new lZ,Ju=new WeakMap,pv=new WeakMap,Dv={current:[]};let qw=!1,Om=0;const jm=new Set,_g=new Map;function HM(e){const t=Array.from(e).sort((n,r)=>n instanceof ed&&n.options.deps.includes(r)?1:r instanceof ed&&r.options.deps.includes(n)?-1:0);for(const n of t){if(Dv.current.includes(n))continue;Dv.current.push(n),n.recompute();const r=pv.get(n);if(r)for(const i of r){const o=Ju.get(i);o&&HM(o)}}}function cZ(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function uZ(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function qM(e){if(Om>0&&!_g.has(e)&&_g.set(e,e.prevState),jm.add(e),!(Om>0)&&!qw)try{for(qw=!0;jm.size>0;){const t=Array.from(jm);jm.clear();for(const n of t){const r=_g.get(n)??n.prevState;n.prevState=r,cZ(n)}for(const n of t){const r=Ju.get(n);r&&(Dv.current.push(n),HM(r))}for(const n of t){const r=Ju.get(n);if(r)for(const i of r)uZ(i)}}}finally{qw=!1,Dv.current=[],_g.clear()}}function Dm(e){Om++;try{e()}finally{if(Om--,Om===0){const t=jm.values().next().value;t&&qM(t)}}}function dZ(e){return typeof e=="function"}class U_{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var i,o;this.listeners.add(r);const a=(o=(i=this.options)==null?void 0:i.onSubscribe)==null?void 0:o.call(i,r,this);return()=>{this.listeners.delete(r),a?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,r,i;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):dZ(t)?this.state=t(this.prevState):this.state=t,(i=(r=this.options)==null?void 0:r.onUpdate)==null||i.call(r),qM(this)}}class ed{constructor(t){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{const n=this.options.deps.length,r=new Array(n),i=new Array(n);for(let o=0;o<n;o++){const a=this.options.deps[o];r[o]=a.prevState,i[o]=a.state}return this.lastSeenDepValues=i,{prevDepVals:r,currDepVals:i,prevVal:this.prevState??void 0}},this.recompute=()=>{var n,r;this.prevState=this.state;const i=this.getDepVals();this.state=this.options.fn(i),(r=(n=this.options).onUpdate)==null||r.call(n)},this.checkIfRecalculationNeededDeeply=()=>{for(const o of this.options.deps)o instanceof ed&&o.checkIfRecalculationNeededDeeply();let n=!1;const r=this.lastSeenDepValues,{currDepVals:i}=this.getDepVals();for(let o=0;o<i.length;o++)if(i[o]!==r[o]){n=!0;break}n&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(const n of this._subscriptions)n()}),this.subscribe=n=>{var r,i;this.listeners.add(n);const o=(i=(r=this.options).onSubscribe)==null?void 0:i.call(r,n,this);return()=>{this.listeners.delete(n),o?.()}},this.options=t,this.state=t.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(t=this.options.deps){for(const n of t)if(n instanceof ed)n.registerOnGraph(),this.registerOnGraph(n.options.deps);else if(n instanceof U_){let r=Ju.get(n);r||(r=new Set,Ju.set(n,r)),r.add(this);let i=pv.get(this);i||(i=new Set,pv.set(this,i)),i.add(n)}}unregisterFromGraph(t=this.options.deps){for(const n of t)if(n instanceof ed)this.unregisterFromGraph(n.options.deps);else if(n instanceof U_){const r=Ju.get(n);r&&r.delete(this);const i=pv.get(this);i&&i.delete(n)}}}const Gs="__TSR_index",KA="popstate",ZA="beforeunload";function fZ(e){let t=e.getLocation();const n=new Set,r=a=>{t=e.getLocation(),n.forEach(c=>c({location:t,action:a}))},i=a=>{e.notifyOnIndexChange??!0?r(a):t=e.getLocation()},o=async({task:a,navigateOpts:c,...d})=>{if(c?.ignoreBlocker??!1){a();return}const p=e.getBlockers?.()??[],h=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&p.length&&h)for(const v of p){const y=Zm(d.path,d.state);if(await v.blockerFn({currentLocation:t,nextLocation:y,action:d.type})){e.onBlocked?.();return}}a()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:a=>(n.add(a),()=>{n.delete(a)}),push:(a,c,d)=>{const f=t.state[Gs];c=YA(f+1,c),o({task:()=>{e.pushState(a,c),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:a,state:c})},replace:(a,c,d)=>{const f=t.state[Gs];c=YA(f,c),o({task:()=>{e.replaceState(a,c),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:a,state:c})},go:(a,c)=>{o({task:()=>{e.go(a),i({type:"GO",index:a})},navigateOpts:c,type:"GO"})},back:a=>{o({task:()=>{e.back(a?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{o({task:()=>{e.forward(a?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>t.state[Gs]!==0,createHref:a=>e.createHref(a),block:a=>{if(!e.setBlockers)return()=>{};const c=e.getBlockers?.()??[];return e.setBlockers([...c,a]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==a))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function YA(e,t){t||(t={});const n=RC();return{...t,key:n,__TSR_key:n,[Gs]:e}}function GM(e){const t=e?.window??(typeof document<"u"?window:void 0),n=t.history.pushState,r=t.history.replaceState;let i=[];const o=()=>i,a=z=>i=z,c=e?.createHref??(z=>z),d=e?.parseLocation??(()=>Zm(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const z=RC();t.history.replaceState({[Gs]:0,key:z,__TSR_key:z},"")}let f=d(),p,h=!1,v=!1,y=!1,b=!1;const S=()=>f;let C,E;const k=()=>{C&&(T._ignoreSubscribers=!0,(C.isPush?t.history.pushState:t.history.replaceState)(C.state,"",C.href),T._ignoreSubscribers=!1,C=void 0,E=void 0,p=void 0)},j=(z,L,G)=>{const J=c(L);E||(p=f),f=Zm(L,G),C={href:J,state:G,isPush:C?.isPush||z==="push"},E||(E=Promise.resolve().then(()=>k()))},I=z=>{f=d(),T.notify({type:z})},A=async()=>{if(v){v=!1;return}const z=d(),L=z.state[Gs]-f.state[Gs],G=L===1,J=L===-1,Y=!G&&!J||h;h=!1;const W=Y?"GO":J?"BACK":"FORWARD",F=Y?{type:"GO",index:L}:{type:J?"BACK":"FORWARD"};if(y)y=!1;else{const Z=o();if(typeof document<"u"&&Z.length){for(const M of Z)if(await M.blockerFn({currentLocation:f,nextLocation:z,action:W})){v=!0,t.history.go(1),T.notify(F);return}}}f=d(),T.notify(F)},N=z=>{if(b){b=!1;return}let L=!1;const G=o();if(typeof document<"u"&&G.length)for(const J of G){const Y=J.enableBeforeUnload??!0;if(Y===!0){L=!0;break}if(typeof Y=="function"&&Y()===!0){L=!0;break}}if(L)return z.preventDefault(),z.returnValue=""},T=fZ({getLocation:S,getLength:()=>t.history.length,pushState:(z,L)=>j("push",z,L),replaceState:(z,L)=>j("replace",z,L),back:z=>(z&&(y=!0),b=!0,t.history.back()),forward:z=>{z&&(y=!0),b=!0,t.history.forward()},go:z=>{h=!0,t.history.go(z)},createHref:z=>c(z),flush:k,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(ZA,N,{capture:!0}),t.removeEventListener(KA,A)},onBlocked:()=>{p&&f!==p&&(f=p)},getBlockers:o,setBlockers:a,notifyOnIndexChange:!1});return t.addEventListener(ZA,N,{capture:!0}),t.addEventListener(KA,A),t.history.pushState=function(...z){const L=n.apply(t.history,z);return T._ignoreSubscribers||I("PUSH"),L},t.history.replaceState=function(...z){const L=r.apply(t.history,z);return T._ignoreSubscribers||I("REPLACE"),L},T}function mZ(e){const t=typeof document<"u"?window:void 0;return GM({window:t,parseLocation:()=>{const n=t.location.hash.split("#").slice(1),r=n[0]??"/",i=t.location.search,o=n.slice(1),a=o.length===0?"":`#${o.join("#")}`,c=`${r}${i}${a}`;return Zm(c,t.history.state)},createHref:n=>`${t.location.pathname}${t.location.search}#${n}`})}function Zm(e,t){const n=e.indexOf("#"),r=e.indexOf("?"),i=RC();return{href:e,pathname:e.substring(0,n>0?r>0?Math.min(n,r):n:r>0?r:e.length),hash:n>-1?e.substring(n):"",search:r>-1?e.slice(r,n===-1?void 0:n):"",state:t||{[Gs]:0,key:i,__TSR_key:i}}}function RC(){return(Math.random()+1).toString(36).substring(7)}function F_(e){return e[e.length-1]}function pZ(e){return typeof e=="function"}function tc(e,t){return pZ(e)?e(t):e}const hZ=Object.prototype.hasOwnProperty;function Qi(e,t){if(e===t)return e;const n=t,r=QA(e)&&QA(n);if(!r&&!($v(e)&&$v(n)))return n;const i=r?e:WA(e);if(!i)return n;const o=r?n:WA(n);if(!o)return n;const a=i.length,c=o.length,d=r?new Array(c):{};let f=0;for(let p=0;p<c;p++){const h=r?p:o[p],v=e[h],y=n[h];if(v===y){d[h]=v,(r?p<a:hZ.call(e,h))&&f++;continue}if(v===null||y===null||typeof v!="object"||typeof y!="object"){d[h]=y;continue}const b=Qi(v,y);d[h]=b,b===v&&f++}return a===c&&f===a?e:d}function WA(e){const t=[],n=Object.getOwnPropertyNames(e);for(const i of n){if(!Object.prototype.propertyIsEnumerable.call(e,i))return!1;t.push(i)}const r=Object.getOwnPropertySymbols(e);for(const i of r){if(!Object.prototype.propertyIsEnumerable.call(e,i))return!1;t.push(i)}return t}function $v(e){if(!XA(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!XA(n)||!n.hasOwnProperty("isPrototypeOf"))}function XA(e){return Object.prototype.toString.call(e)==="[object Object]"}function QA(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function nc(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!nc(e[r],t[r],n))return!1;return!0}if($v(e)&&$v(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const a in t)if((!r||t[a]!==void 0)&&!nc(e[a],t[a],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const a in e)e[a]!==void 0&&i++;let o=0;for(const a in t)if((!r||t[a]!==void 0)&&(o++,o>i||!nc(e[a],t[a],n)))return!1;return i===o}return!1}function dd(e){let t,n;const r=new Promise((i,o)=>{t=i,n=o});return r.status="pending",r.resolve=i=>{r.status="resolved",r.value=i,t(i),e?.(i)},r.reject=i=>{r.status="rejected",n(i)},r}function gZ(e){return typeof e?.message!="string"?!1:e.message.startsWith("Failed to fetch dynamically imported module")||e.message.startsWith("error loading dynamically imported module")||e.message.startsWith("Importing a module script failed")}function Ks(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}var vZ="Invariant failed";function qa(e,t){if(!e)throw new Error(vZ)}const oi="__root__",na=0,dc=1,fd=2,md=3;function Ba(e){return IC(e.filter(t=>t!==void 0).join("/"))}function IC(e){return e.replace(/\/{2,}/g,"/")}function NC(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Zs(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function hv(e){return Zs(NC(e))}function Mv(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function yZ(e,t,n){return Mv(e,n)===Mv(t,n)}function bZ(e){const{type:t,value:n}=e;if(t===na)return n;const{prefixSegment:r,suffixSegment:i}=e;if(t===dc){const o=n.substring(1);if(r&&i)return`${r}{$${o}}${i}`;if(r)return`${r}{$${o}}`;if(i)return`{$${o}}${i}`}if(t===md){const o=n.substring(1);return r&&i?`${r}{-$${o}}${i}`:r?`${r}{-$${o}}`:i?`{-$${o}}${i}`:`{-$${o}}`}if(t===fd){if(r&&i)return`${r}{$}${i}`;if(r)return`${r}{$}`;if(i)return`{$}${i}`}return n}function xZ({base:e,to:t,trailingSlash:n="never",parseCache:r}){let i=KM(e,r).slice();const o=By(t,r);i.length>1&&F_(i)?.value==="/"&&i.pop();for(let d=0,f=o.length;d<f;d++){const p=o[d],h=p.value;h==="/"?d?d===f-1&&i.push(p):i=[p]:h===".."?i.pop():h==="."||i.push(p)}i.length>1&&(F_(i).value==="/"?n==="never"&&i.pop():n==="always"&&i.push({type:na,value:"/"}));const a=i.map(bZ);return Ba(a)}const KM=(e,t)=>ZM(e,t,!0),By=(e,t)=>ZM(e,t,!1),ZM=(e,t,n)=>{if(!e)return[];const r=t?.get(e);if(r)return r;const i=kZ(e,n);return t?.set(e,i),i},wZ=/^\$.{1,}$/,SZ=/^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,_Z=/^(.*?)\{-(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,CZ=/^\$$/,EZ=/^(.*?)\{\$\}(.*)$/;function kZ(e,t){e=IC(e);const n=[];if(e.slice(0,1)==="/"&&(e=e.substring(1),n.push({type:na,value:"/"})),!e)return n;const r=e.split("/").filter(Boolean);return n.push(...r.map(i=>{const o=!t&&i!==oi&&i.slice(-1)==="_"?i.slice(0,-1):i,a=o.match(EZ);if(a){const f=a[1],p=a[2];return{type:fd,value:"$",prefixSegment:f||void 0,suffixSegment:p||void 0}}const c=o.match(_Z);if(c){const f=c[1],p=c[2],h=c[3];return{type:md,value:p,prefixSegment:f||void 0,suffixSegment:h||void 0}}const d=o.match(SZ);if(d){const f=d[1],p=d[2],h=d[3];return{type:dc,value:""+p,prefixSegment:f||void 0,suffixSegment:h||void 0}}if(wZ.test(o)){const f=o.substring(1);return{type:dc,value:"$"+f,prefixSegment:void 0,suffixSegment:void 0}}return CZ.test(o)?{type:fd,value:"$",prefixSegment:void 0,suffixSegment:void 0}:{type:na,value:o.includes("%25")?o.split("%25").map(f=>decodeURI(f)).join("%25"):decodeURI(o)}})),e.slice(-1)==="/"&&(e=e.substring(1),n.push({type:na,value:"/"})),n}function Cg({path:e,params:t,leaveWildcards:n,leaveParams:r,decodeCharMap:i,parseCache:o}){const a=By(e,o);function c(h){const v=t[h],y=typeof v=="string";return h==="*"||h==="_splat"?y?encodeURI(v):v:y?jZ(v,i):v}let d=!1;const f={},p=Ba(a.map(h=>{if(h.type===na)return h.value;if(h.type===fd){f._splat=t._splat,f["*"]=t._splat;const v=h.prefixSegment||"",y=h.suffixSegment||"";if(!t._splat)return d=!0,n?`${v}${h.value}${y}`:v||y?`${v}${y}`:void 0;const b=c("_splat");return n?`${v}${h.value}${b??""}${y}`:`${v}${b}${y}`}if(h.type===dc){const v=h.value.substring(1);!d&&!(v in t)&&(d=!0),f[v]=t[v];const y=h.prefixSegment||"",b=h.suffixSegment||"";if(r){const S=c(h.value);return`${y}${h.value}${S??""}${b}`}return`${y}${c(v)??"undefined"}${b}`}if(h.type===md){const v=h.value.substring(1),y=h.prefixSegment||"",b=h.suffixSegment||"";if(!(v in t)||t[v]==null)return n?`${y}${v}${b}`:y||b?`${y}${b}`:void 0;if(f[v]=t[v],r){const S=c(h.value);return`${y}${h.value}${S??""}${b}`}return n?`${y}${v}${c(v)??""}${b}`:`${y}${c(v)??""}${b}`}return h.value}));return{usedParams:f,interpolatedPath:p,isMissingParams:d}}function jZ(e,t){let n=encodeURIComponent(e);if(t)for(const[r,i]of t)n=n.replaceAll(r,i);return n}function V_(e,t,n){const r=RZ(e,t,n);if(!(t.to&&!r))return r??{}}function RZ(e,{to:t,fuzzy:n,caseSensitive:r},i){const o=t,a=KM(e.startsWith("/")?e:`/${e}`,i),c=By(o.startsWith("/")?o:`/${o}`,i),d={};return IZ(a,c,d,n,r)?d:void 0}function IZ(e,t,n,r,i){let o=0,a=0;for(;o<e.length||a<t.length;){const c=e[o],d=t[a];if(d){if(d.type===fd){const f=e.slice(o);let p;if(d.prefixSegment||d.suffixSegment){if(!c)return!1;const h=d.prefixSegment||"",v=d.suffixSegment||"",y=c.value;if("prefixSegment"in d&&!y.startsWith(h)||"suffixSegment"in d&&!e[e.length-1]?.value.endsWith(v))return!1;let b=decodeURI(Ba(f.map(S=>S.value)));h&&b.startsWith(h)&&(b=b.slice(h.length)),v&&b.endsWith(v)&&(b=b.slice(0,b.length-v.length)),p=b}else p=decodeURI(Ba(f.map(h=>h.value)));return n["*"]=p,n._splat=p,!0}if(d.type===na){if(d.value==="/"&&!c?.value){a++;continue}if(c){if(i){if(d.value!==c.value)return!1}else if(d.value.toLowerCase()!==c.value.toLowerCase())return!1;o++,a++;continue}else return!1}if(d.type===dc){if(!c||c.value==="/")return!1;let f="",p=!1;if(d.prefixSegment||d.suffixSegment){const h=d.prefixSegment||"",v=d.suffixSegment||"",y=c.value;if(h&&!y.startsWith(h)||v&&!y.endsWith(v))return!1;let b=y;h&&b.startsWith(h)&&(b=b.slice(h.length)),v&&b.endsWith(v)&&(b=b.slice(0,b.length-v.length)),f=decodeURIComponent(b),p=!0}else f=decodeURIComponent(c.value),p=!0;p&&(n[d.value.substring(1)]=f,o++),a++;continue}if(d.type===md){if(!c){a++;continue}if(c.value==="/"){a++;continue}let f="",p=!1;if(d.prefixSegment||d.suffixSegment){const h=d.prefixSegment||"",v=d.suffixSegment||"",y=c.value;if((!h||y.startsWith(h))&&(!v||y.endsWith(v))){let b=y;h&&b.startsWith(h)&&(b=b.slice(h.length)),v&&b.endsWith(v)&&(b=b.slice(0,b.length-v.length)),f=decodeURIComponent(b),p=!0}}else{let h=!0;for(let v=a+1;v<t.length;v++){const y=t[v];if(y?.type===na&&y.value===c.value){h=!1;break}if(y?.type===dc||y?.type===fd){e.length<t.length&&(h=!1);break}}h&&(f=decodeURIComponent(c.value),p=!0)}p&&(n[d.value.substring(1)]=f,o++),a++;continue}}if(o<e.length&&a>=t.length)return n["**"]=Ba(e.slice(o).map(f=>f.value)),!!r&&t[t.length-1]?.value!=="/";if(a<t.length&&o>=e.length){for(let f=a;f<t.length;f++)if(t[f]?.type!==md)return!1;break}break}return!0}const NZ=.75,TZ=1,AZ=.5,OZ=.4,DZ=.25,$Z=.2,MZ=.05,PZ=.02,zZ=.01,JA=2e-4,eO=1e-4;function tO(e,t){return e.prefixSegment&&e.suffixSegment?t+MZ+JA*e.prefixSegment.length+eO*e.suffixSegment.length:e.prefixSegment?t+PZ+JA*e.prefixSegment.length:e.suffixSegment?t+zZ+eO*e.suffixSegment.length:t}function LZ(e){const t=[];return e.forEach((r,i)=>{if(r.isRoot||!r.path)return;const o=NC(r.fullPath);let a=By(o),c=0;for(;a.length>c+1&&a[c]?.value==="/";)c++;c>0&&(a=a.slice(c));let d=0,f=!1;const p=a.map((h,v)=>{if(h.value==="/")return NZ;if(h.type===na)return TZ;let y;h.type===dc?y=AZ:h.type===md?(y=OZ,d++):y=DZ;for(let b=v+1;b<a.length;b++){const S=a[b];if(S.type===na&&S.value!=="/")return f=!0,tO(h,y+$Z)}return tO(h,y)});t.push({child:r,trimmed:o,parsed:a,index:i,scores:p,optionalParamCount:d,hasStaticAfter:f})}),t.sort((r,i)=>{const o=Math.min(r.scores.length,i.scores.length);for(let a=0;a<o;a++)if(r.scores[a]!==i.scores[a])return i.scores[a]-r.scores[a];if(r.scores.length!==i.scores.length){if(r.optionalParamCount!==i.optionalParamCount){if(r.hasStaticAfter===i.hasStaticAfter)return r.optionalParamCount-i.optionalParamCount;if(r.hasStaticAfter&&!i.hasStaticAfter)return-1;if(!r.hasStaticAfter&&i.hasStaticAfter)return 1}return i.scores.length-r.scores.length}for(let a=0;a<o;a++)if(r.parsed[a].value!==i.parsed[a].value)return r.parsed[a].value>i.parsed[a].value?1:-1;return r.index-i.index}).map((r,i)=>(r.child.rank=i,r.child))}function UZ({routeTree:e,initRoute:t}){const n={},r={},i=a=>{a.forEach((c,d)=>{t?.(c,d);const f=n[c.id];if(qa(!f,`Duplicate routes found with id: ${String(c.id)}`),n[c.id]=c,!c.isRoot&&c.path){const h=Zs(c.fullPath);(!r[h]||c.fullPath.endsWith("/"))&&(r[h]=c)}const p=c.children;p?.length&&i(p)})};i([e]);const o=LZ(Object.values(n));return{routesById:n,routesByPath:r,flatRoutes:o}}function Ao(e){return!!e?.isNotFound}function FZ(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Pv="tsr-scroll-restoration-v1_3",VZ=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function BZ(){const e=FZ();if(!e)return null;const t=e.getItem(Pv);let n=t?JSON.parse(t):{};return{state:n,set:r=>(n=tc(r,n)||n,e.setItem(Pv,JSON.stringify(n)))}}const Eg=BZ(),B_=e=>e.state.__TSR_key||e.href;function HZ(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let zv=!1;function YM({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:o}){let a;try{a=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(f){console.error(f);return}const c=t||window.history.state?.__TSR_key,d=a[c];zv=!0;e:{if(r&&d&&Object.keys(d).length>0){for(const h in d){const v=d[h];if(h==="window")window.scrollTo({top:v.scrollY,left:v.scrollX,behavior:n});else if(h){const y=document.querySelector(h);y&&(y.scrollLeft=v.scrollX,y.scrollTop=v.scrollY)}}break e}const f=(o??window.location).hash.split("#",2)[1];if(f){const h=window.history.state?.__hashScrollIntoViewOptions??!0;if(h){const v=document.getElementById(f);v&&v.scrollIntoView(h)}break e}const p={top:0,left:0,behavior:n};if(window.scrollTo(p),i)for(const h of i){if(h==="window")continue;const v=typeof h=="function"?h():document.querySelector(h);v&&v.scrollTo(p)}}zv=!1}function qZ(e,t){if(!Eg&&!e.isServer||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isServer||e.isScrollRestorationSetup||!Eg))return;e.isScrollRestorationSetup=!0,zv=!1;const r=e.options.getScrollRestorationKey||B_;window.history.scrollRestoration="manual";const i=o=>{if(zv||!e.isScrollRestoring)return;let a="";if(o.target===document||o.target===window)a="window";else{const d=o.target.getAttribute("data-scroll-restoration-id");d?a=`[data-scroll-restoration-id="${d}"]`:a=HZ(o.target)}const c=r(e.state.location);Eg.set(d=>{const f=d[c]||={},p=f[a]||={};if(a==="window")p.scrollX=window.scrollX||0,p.scrollY=window.scrollY||0;else if(a){const h=document.querySelector(a);h&&(p.scrollX=h.scrollLeft||0,p.scrollY=h.scrollTop||0)}return d})};typeof document<"u"&&document.addEventListener("scroll",VZ(i,100),!0),e.subscribe("onRendered",o=>{const a=r(o.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(YM({storageKey:Pv,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Eg.set(c=>(c[a]||={},c)))})}function GZ(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function KZ(e,t=String){const n=new URLSearchParams;for(const r in e){const i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function Gw(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function ZZ(e){const t=new URLSearchParams(e),n={};for(const[r,i]of t.entries()){const o=n[r];o==null?n[r]=Gw(i):Array.isArray(o)?o.push(Gw(i)):n[r]=[o,Gw(i)]}return n}const YZ=XZ(JSON.parse),WZ=QZ(JSON.stringify,JSON.parse);function XZ(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=ZZ(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function QZ(e,t){const n=typeof t=="function";function r(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const o=KZ(i,r);return o?`?${o}`:""}}function Sc(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Jo(e){return e instanceof Response&&!!e.options}function JZ(e){const t=new Map;let n,r;const i=o=>{o.next&&(o.prev?(o.prev.next=o.next,o.next.prev=o.prev,o.next=void 0,r&&(r.next=o,o.prev=r)):(o.next.prev=void 0,n=o.next,o.next=void 0,r&&(o.prev=r,r.next=o)),r=o)};return{get(o){const a=t.get(o);if(a)return i(a),a.value},set(o,a){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const c=t.get(o);if(c)c.value=a,i(c);else{const d={key:o,value:a,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(o,d)}}}}const gv=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Hy=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),WM=(e,t)=>{const n=e.router.routesById[t.routeId??""]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),qa(n.options.notFoundComponent);const r=e.matches.find(i=>i.routeId===n.id);qa(r,"Could not find match for route: "+n.id),e.updateMatch(r.id,i=>({...i,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,WM(e,t))},Ps=(e,t,n)=>{if(!(!Jo(n)&&!Ao(n))){if(Jo(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const r=Jo(n)?"redirected":"notFound";e.updateMatch(t.id,i=>({...i,status:r,isFetching:!1,error:n})),Ao(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw Jo(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(WM(e,n),n)}},XM=(e,t)=>{const n=e.router.getMatch(t);return!!(!e.router.isServer&&n._nonReactive.dehydrated||e.router.isServer&&n.ssr===!1)},nm=(e,t,n,r)=>{const{id:i,routeId:o}=e.matches[t],a=e.router.looseRoutesById[o];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Ps(e,e.router.getMatch(i),n);try{a.options.onError?.(n)}catch(c){n=c,Ps(e,e.router.getMatch(i),n)}e.updateMatch(i,c=>(c._nonReactive.beforeLoadPromise?.resolve(),c._nonReactive.beforeLoadPromise=void 0,c._nonReactive.loadPromise?.resolve(),{...c,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},eY=(e,t,n,r)=>{const i=e.router.getMatch(t),o=e.matches[n-1]?.id,a=o?e.router.getMatch(o):void 0;if(e.router.isShell()){i.ssr=t===oi;return}if(a?.ssr===!1){i.ssr=!1;return}const c=y=>y===!0&&a?.ssr==="data-only"?"data-only":y,d=e.router.options.defaultSsr??!0;if(r.options.ssr===void 0){i.ssr=c(d);return}if(typeof r.options.ssr!="function"){i.ssr=c(r.options.ssr);return}const{search:f,params:p}=i,h={search:kg(f,i.searchError),params:kg(p,i.paramsError),location:e.location,matches:e.matches.map(y=>({index:y.index,pathname:y.pathname,fullPath:y.fullPath,staticData:y.staticData,id:y.id,routeId:y.routeId,search:kg(y.search,y.searchError),params:kg(y.params,y.paramsError),ssr:y.ssr}))},v=r.options.ssr(h);if(Ks(v))return v.then(y=>{i.ssr=c(y??d)});i.ssr=c(v??d)},QM=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!e.router.isServer&&!Hy(e,t)&&(n.options.loader||n.options.beforeLoad||tP(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const a=setTimeout(()=>{gv(e)},i);r._nonReactive.pendingTimeout=a}},tY=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;QM(e,t,n,r);const i=()=>{const o=e.router.getMatch(t);o.preload&&(o.status==="redirected"||o.status==="notFound")&&Ps(e,o,o.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},nY=(e,t,n,r)=>{const i=e.router.getMatch(t),o=i._nonReactive.loadPromise;i._nonReactive.loadPromise=dd(()=>{o?.resolve()});const{paramsError:a,searchError:c}=i;a&&nm(e,n,a,"PARSE_PARAMS"),c&&nm(e,n,c,"VALIDATE_SEARCH"),QM(e,t,r,i);const d=new AbortController,f=e.matches[n-1]?.id,v={...(f?e.router.getMatch(f):void 0)?.context??e.router.options.context??void 0,...i.__routeContext};let y=!1;const b=()=>{y||(y=!0,e.updateMatch(t,T=>({...T,isFetching:"beforeLoad",fetchCount:T.fetchCount+1,abortController:d,context:v})))},S=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,T=>({...T,isFetching:!1}))};if(!r.options.beforeLoad){Dm(()=>{b(),S()});return}i._nonReactive.beforeLoadPromise=dd();const{search:C,params:E,cause:k}=i,j=Hy(e,t),I={search:C,abortController:d,params:E,preload:j,context:v,location:e.location,navigate:T=>e.router.navigate({...T,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:j?"preload":k,matches:e.matches,...e.router.options.additionalContext},A=T=>{if(T===void 0){Dm(()=>{b(),S()});return}(Jo(T)||Ao(T))&&(b(),nm(e,n,T,"BEFORE_LOAD")),Dm(()=>{b(),e.updateMatch(t,z=>({...z,__beforeLoadContext:T,context:{...z.context,...T}})),S()})};let N;try{if(N=r.options.beforeLoad(I),Ks(N))return b(),N.catch(T=>{nm(e,n,T,"BEFORE_LOAD")}).then(A)}catch(T){b(),nm(e,n,T,"BEFORE_LOAD")}A(N)},rY=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],o=()=>{if(e.router.isServer){const d=eY(e,n,t,i);if(Ks(d))return d.then(c)}return c()},a=()=>nY(e,n,t,i),c=()=>{if(XM(e,n))return;const d=tY(e,n,i);return Ks(d)?d.then(a):a()};return o()},$m=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([o,a,c])=>{const d=o?.meta,f=o?.links,p=o?.scripts,h=o?.styles;return{meta:d,links:f,headScripts:p,headers:c,scripts:a,styles:h}})},JM=(e,t,n,r)=>{const i=e.matchPromises[n-1],{params:o,loaderDeps:a,abortController:c,context:d,cause:f}=e.router.getMatch(t),p=Hy(e,t);return{params:o,deps:a,preload:!!p,parentMatchPromise:i,abortController:c,context:d,location:e.location,navigate:h=>e.router.navigate({...h,_fromLocation:e.location}),cause:p?"preload":f,route:r,...e.router.options.additionalContext}},nO=async(e,t,n,r)=>{try{const i=e.router.getMatch(t);try{(!e.router.isServer||i.ssr===!0)&&eP(r);const o=r.options.loader?.(JM(e,t,n,r)),a=r.options.loader&&Ks(o);if(!!(a||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||i._nonReactive.minPendingPromise)&&e.updateMatch(t,h=>({...h,isFetching:"loader"})),r.options.loader){const h=a?await o:o;Ps(e,e.router.getMatch(t),h),h!==void 0&&e.updateMatch(t,v=>({...v,loaderData:h}))}r._lazyPromise&&await r._lazyPromise;const d=$m(e,t,r),f=d?await d:void 0,p=i._nonReactive.minPendingPromise;p&&await p,r._componentsPromise&&await r._componentsPromise,e.updateMatch(t,h=>({...h,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),...f}))}catch(o){let a=o;const c=i._nonReactive.minPendingPromise;c&&await c,Ao(o)&&await r.options.notFoundComponent?.preload?.(),Ps(e,e.router.getMatch(t),o);try{r.options.onError?.(o)}catch(p){a=p,Ps(e,e.router.getMatch(t),p)}const d=$m(e,t,r),f=d?await d:void 0;e.updateMatch(t,p=>({...p,error:a,status:"error",isFetching:!1,...f}))}}catch(i){const o=e.router.getMatch(t);if(o){const a=$m(e,t,r);if(a){const c=await a;e.updateMatch(t,d=>({...d,...c}))}o._nonReactive.loaderPromise=void 0}Ps(e,o,i)}},iY=async(e,t)=>{const{id:n,routeId:r}=e.matches[t];let i=!1,o=!1;const a=e.router.looseRoutesById[r];if(XM(e,n)){if(e.router.isServer){const f=$m(e,n,a);if(f){const p=await f;e.updateMatch(n,h=>({...h,...p}))}return e.router.getMatch(n)}}else{const f=e.router.getMatch(n);if(f._nonReactive.loaderPromise){if(f.status==="success"&&!e.sync&&!f.preload)return f;await f._nonReactive.loaderPromise;const p=e.router.getMatch(n);p.error&&Ps(e,p,p.error)}else{const p=Date.now()-f.updatedAt,h=Hy(e,n),v=h?a.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:a.options.staleTime??e.router.options.defaultStaleTime??0,y=a.options.shouldReload,b=typeof y=="function"?y(JM(e,n,t,a)):y,S=!!h&&!e.router.state.matches.some(j=>j.id===n),C=e.router.getMatch(n);C._nonReactive.loaderPromise=dd(),S!==C.preload&&e.updateMatch(n,j=>({...j,preload:S}));const{status:E,invalid:k}=C;if(i=E==="success"&&(k||(b??p>v)),!(h&&a.options.preload===!1))if(i&&!e.sync)o=!0,(async()=>{try{await nO(e,n,t,a);const j=e.router.getMatch(n);j._nonReactive.loaderPromise?.resolve(),j._nonReactive.loadPromise?.resolve(),j._nonReactive.loaderPromise=void 0}catch(j){Jo(j)&&await e.router.navigate(j.options)}})();else if(E!=="success"||i&&e.sync)await nO(e,n,t,a);else{const j=$m(e,n,a);if(j){const I=await j;e.updateMatch(n,A=>({...A,...I}))}}}}const c=e.router.getMatch(n);o||(c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loadPromise?.resolve()),clearTimeout(c._nonReactive.pendingTimeout),c._nonReactive.pendingTimeout=void 0,o||(c._nonReactive.loaderPromise=void 0),c._nonReactive.dehydrated=void 0;const d=o?c.isFetching:!1;return d!==c.isFetching||c.invalid!==!1?(e.updateMatch(n,f=>({...f,isFetching:d,invalid:!1})),e.router.getMatch(n)):c};async function rO(e){const t=Object.assign(e,{matchPromises:[]});!t.router.isServer&&t.router.state.matches.some(n=>n._forcePending)&&gv(t);try{for(let i=0;i<t.matches.length;i++){const o=rY(t,i);Ks(o)&&await o}const n=t.firstBadMatchIndex??t.matches.length;for(let i=0;i<n;i++)t.matchPromises.push(iY(t,i));await Promise.all(t.matchPromises);const r=gv(t);Ks(r)&&await r}catch(n){if(Ao(n)&&!t.preload){const r=gv(t);throw Ks(r)&&await r,n}if(Jo(n))throw n}return t.matches}async function eP(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const r of nP){const i=e.options[r]?.preload;i&&n.push(i())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function kg(e,t){return t?{status:"error",error:t}:{status:"success",value:e}}function tP(e){for(const t of nP)if(e.options[t]?.preload)return!0;return!1}const nP=["component","errorComponent","pendingComponent","notFoundComponent"];function oY(e){return{input:({url:t})=>{for(const n of e)t=rP(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=iP(e[n],t);return t}}}function aY(e){const t=hv(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),o=e.caseSensitive?r:r.toLowerCase();return{input:({url:a})=>{const c=e.caseSensitive?a.pathname:a.pathname.toLowerCase();return c===i?a.pathname="/":c.startsWith(o)&&(a.pathname=a.pathname.slice(n.length)),a},output:({url:a})=>(a.pathname=Ba(["/",t,a.pathname]),a)}}function rP(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function iP(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function rc(e){const t=e.resolvedLocation,n=e.location,r=t?.pathname!==n.pathname,i=t?.href!==n.href,o=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:r,hrefChanged:i,hashChanged:o}}class sY{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const r=this.options,i=this.basepath??r?.basepath??"/",o=this.basepath===void 0,a=r?.rewrite;this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(v=>[encodeURIComponent(v),v])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=GM())),this.origin=this.options.origin,this.origin||(!this.isServer&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new U_(cY(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(v=>!["redirected"].includes(v.status))}}}),qZ(this));let c=!1;const d=this.options.basepath??"/",f=this.options.rewrite;if(o||i!==d||a!==f){this.basepath=d;const v=[];hv(d)!==""&&v.push(aY({basepath:d})),f&&v.push(f),this.rewrite=v.length===0?void 0:v.length===1?v[0]:oY(v),this.history&&this.updateLatestLocation(),c=!0}c&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const{routesById:n,routesByPath:r,flatRoutes:i}=UZ({routeTree:this.routeTree,initRoute:(a,c)=>{a.init({originalIndex:c})}});this.routesById=n,this.routesByPath=r,this.flatRoutes=i;const o=this.options.notFoundRoute;o&&(o.init({originalIndex:99999999999}),this.routesById[o.id]=o)},this.subscribe=(n,r)=>{const i={eventType:n,fn:r};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const i=({href:d,state:f})=>{const p=new URL(d,this.origin),h=rP(this.rewrite,p),v=this.options.parseSearch(h.search),y=this.options.stringifySearch(v);h.search=y;const b=h.href.replace(h.origin,""),{pathname:S,hash:C}=h;return{href:b,publicHref:d,url:h.href,pathname:S,searchStr:y,search:Qi(r?.search,v),hash:C.split("#").reverse()[0]??"",state:Qi(r?.state,f)}},o=i(n),{__tempLocation:a,__tempKey:c}=o.state;if(a&&(!c||c===this.tempLocationKey)){const d=i(a);return d.state.key=o.state.key,d.state.__TSR_key=o.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:o}}return o},this.resolvePathWithBase=(n,r)=>xZ({base:n,to:IC(r),trailingSlash:this.options.trailingSlash,parseCache:this.parsePathnameCache}),this.matchRoutes=(n,r,i)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},i):this.matchRoutesInternal(n,r),this.parsePathnameCache=JZ(1e3),this.getMatchedRoutes=(n,r)=>uY({pathname:n,routePathname:r,caseSensitive:this.options.caseSensitive,routesByPath:this.routesByPath,routesById:this.routesById,flatRoutes:this.flatRoutes,parseCache:this.parsePathnameCache}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.state.pendingMatches?.forEach(n=>{this.cancelMatch(n.id)})},this.buildLocation=n=>{const r=(o={})=>{const a=o._fromLocation||this.latestLocation,c=this.matchRoutes(a,{_buildLocation:!0}),d=F_(c);o.from;const f=o.unsafeRelative==="path"?a.pathname:o.from??d.fullPath,p=this.resolvePathWithBase(f,"."),h=d.search,v={...d.params},y=o.to?this.resolvePathWithBase(p,`${o.to}`):this.resolvePathWithBase(p,"."),b=o.params===!1||o.params===null?{}:(o.params??!0)===!0?v:Object.assign(v,tc(o.params,v)),S=Cg({path:y,params:b,parseCache:this.parsePathnameCache}).interpolatedPath,C=this.matchRoutes(S,void 0,{_buildLocation:!0}).map(G=>this.looseRoutesById[G.routeId]);if(Object.keys(b).length>0)for(const G of C){const J=G.options.params?.stringify??G.options.stringifyParams;J&&Object.assign(b,J(b))}const E=Cg({path:y,params:b,leaveWildcards:!1,leaveParams:n.leaveParams,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath;let k=h;if(n._includeValidateSearch&&this.options.search?.strict){const G={};C.forEach(J=>{if(J.options.validateSearch)try{Object.assign(G,H_(J.options.validateSearch,{...G,...k}))}catch{}}),k=G}k=dY({search:k,dest:o,destRoutes:C,_includeValidateSearch:n._includeValidateSearch}),k=Qi(h,k);const j=this.options.stringifySearch(k),I=o.hash===!0?a.hash:o.hash?tc(o.hash,a.hash):void 0,A=I?`#${I}`:"";let N=o.state===!0?a.state:o.state?tc(o.state,a.state):{};N=Qi(a.state,N);const T=`${E}${j}${A}`,z=new URL(T,this.origin),L=iP(this.rewrite,z);return{publicHref:L.pathname+L.search+L.hash,href:T,url:L.href,pathname:E,search:k,searchStr:j,state:N,hash:I??"",unmaskOnReload:o.unmaskOnReload}},i=(o={},a)=>{const c=r(o);let d=a?r(a):void 0;if(!d){let f={};const p=this.options.routeMasks?.find(h=>{const v=V_(c.pathname,{to:h.from,caseSensitive:!1,fuzzy:!1},this.parsePathnameCache);return v?(f=v,!0):!1});if(p){const{from:h,...v}=p;a={from:n.from,...v,params:f},d=r(a)}}return d&&(c.maskedLocation=d),c};return n.mask?i(n,{from:n.from,...n.mask}):i(n)},this.commitLocation=({viewTransition:n,ignoreBlocker:r,...i})=>{const o=()=>{const d=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];d.forEach(p=>{i.state[p]=this.latestLocation.state[p]});const f=nc(i.state,this.latestLocation.state);return d.forEach(p=>{delete i.state[p]}),f},a=Zs(this.latestLocation.href)===Zs(i.href),c=this.commitLocationPromise;if(this.commitLocationPromise=dd(()=>{c?.resolve()}),a&&o())this.load();else{let{maskedLocation:d,hashScrollIntoView:f,...p}=i;d&&(p={...d,state:{...d.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=f??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[i.replace?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:r})}return this.resetNextScroll=i.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:i,viewTransition:o,ignoreBlocker:a,href:c,...d}={})=>{if(c){const p=this.history.location.state.__TSR_index,h=Zm(c,{__TSR_index:n?p:p+1});d.to=h.pathname,d.search=this.options.parseSearch(h.search),d.hash=h.hash.slice(1)}const f=this.buildLocation({...d,_includeValidateSearch:!0});return this.commitLocation({...f,viewTransition:o,replace:n,resetScroll:r,hashScrollIntoView:i,ignoreBlocker:a})},this.navigate=({to:n,reloadDocument:r,href:i,...o})=>{if(!r&&i)try{new URL(`${i}`),r=!0}catch{}return r?(i||(i=this.buildLocation({to:n,...o}).url),o.replace?window.location.replace(i):window.location.href=i,Promise.resolve()):this.buildAndCommitLocation({...o,href:i,to:n,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const r=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0}),i=o=>{try{return encodeURI(decodeURI(o))}catch{return o}};if(hv(i(this.latestLocation.href))!==hv(i(r.href))){let o=r.url;throw this.origin&&o.startsWith(this.origin)&&(o=o.replace(this.origin,"")||"/"),Sc({href:o})}}const n=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:r.cachedMatches.filter(i=>!n.some(o=>o.id===i.id))}))},this.load=async n=>{let r,i,o;for(o=new Promise(c=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,f=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...rc({resolvedLocation:f,location:d})}),this.emit({type:"onBeforeLoad",...rc({resolvedLocation:f,location:d})}),await rO({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startViewTransition(async()=>{let p,h,v;Dm(()=>{this.__store.setState(y=>{const b=y.matches,S=y.pendingMatches||y.matches;return p=b.filter(C=>!S.some(E=>E.id===C.id)),h=S.filter(C=>!b.some(E=>E.id===C.id)),v=b.filter(C=>S.some(E=>E.id===C.id)),{...y,isLoading:!1,loadedAt:Date.now(),matches:S,pendingMatches:void 0,cachedMatches:[...y.cachedMatches,...p.filter(C=>C.status!=="error")]}}),this.clearExpiredCache()}),[[p,"onLeave"],[h,"onEnter"],[v,"onStay"]].forEach(([y,b])=>{y.forEach(S=>{this.looseRoutesById[S.routeId].options[b]?.(S)})})})}})}catch(d){Jo(d)?(r=d,this.isServer||this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):Ao(d)&&(i=d),this.__store.setState(f=>({...f,statusCode:r?r.status:i?404:f.matches.some(p=>p.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===o&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),c()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.__store.state.matches.some(c=>c.status==="error")&&(a=500),a!==void 0&&this.__store.setState(c=>({...c,statusCode:a}))},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let i;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,a=this.state.resolvedLocation,c=typeof r.types=="function"?r.types(rc({resolvedLocation:a,location:o})):r.types;if(c===!1){n();return}i={update:n,types:c}}else i=n;document.startViewTransition(i)}else n()},this.updateMatch=(n,r)=>{const i=this.state.pendingMatches?.some(o=>o.id===n)?"pendingMatches":this.state.matches.some(o=>o.id===n)?"matches":this.state.cachedMatches.some(o=>o.id===n)?"cachedMatches":"";i&&this.__store.setState(o=>({...o,[i]:o[i]?.map(a=>a.id===n?r(a):a)}))},this.getMatch=n=>{const r=i=>i.id===n;return this.state.cachedMatches.find(r)??this.state.pendingMatches?.find(r)??this.state.matches.find(r)},this.invalidate=n=>{const r=i=>n?.filter?.(i)??!0?{...i,invalid:!0,...n?.forcePending||i.status==="error"?{status:"pending",error:void 0}:void 0}:i;return this.__store.setState(i=>({...i,matches:i.matches.map(r),cachedMatches:i.cachedMatches.map(r),pendingMatches:i.pendingMatches?.map(r)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.resolveRedirect=n=>{if(!n.options.href){const r=this.buildLocation(n.options);let i=r.url;this.origin&&i.startsWith(this.origin)&&(i=i.replace(this.origin,"")||"/"),n.options.href=r.href,n.headers.set("Location",i)}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.__store.setState(i=>({...i,cachedMatches:i.cachedMatches.filter(o=>!r(o))})):this.__store.setState(i=>({...i,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=r=>{const i=this.looseRoutesById[r.routeId];if(!i.options.loader)return!0;const o=(r.preload?i.options.preloadGcTime??this.options.defaultPreloadGcTime:i.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=o};this.clearCache({filter:n})},this.loadRouteChunk=eP,this.preloadRoute=async n=>{const r=this.buildLocation(n);let i=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const o=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(c=>c.id)),a=new Set([...o,...this.state.cachedMatches.map(c=>c.id)]);Dm(()=>{i.forEach(c=>{a.has(c.id)||this.__store.setState(d=>({...d,cachedMatches:[...d.cachedMatches,c]}))})});try{return i=await rO({router:this,matches:i,location:r,preload:!0,updateMatch:(c,d)=>{o.has(c)?i=i.map(f=>f.id===c?d(f):f):this.updateMatch(c,d)}}),i}catch(c){if(Jo(c))return c.options.reloadDocument?void 0:await this.preloadRoute({...c.options,_fromLocation:r});Ao(c)||console.error(c);return}},this.matchRoute=(n,r)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},o=this.buildLocation(i);if(r?.pending&&this.state.status!=="pending")return!1;const c=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=V_(c.pathname,{...r,to:o.pathname},this.parsePathnameCache);return!d||n.params&&!nc(d,n.params,{partial:!0})?!1:d&&(r?.includeSearch??!0)?nc(c.search,o.search,{partial:!0})?d:!1:d},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??WZ,parseSearch:t.parseSearch??YZ}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,n){const{foundRoute:r,matchedRoutes:i,routeParams:o}=this.getMatchedRoutes(t.pathname,n?.dest?.to);let a=!1;(r?r.path!=="/"&&o["**"]:Zs(t.pathname))&&(this.options.notFoundRoute?i.push(this.options.notFoundRoute):a=!0);const c=(()=>{if(a){if(this.options.notFoundMode!=="root")for(let p=i.length-1;p>=0;p--){const h=i[p];if(h.children)return h.id}return oi}})(),d=[],f=p=>p?.id?p.context??this.options.context??void 0:this.options.context??void 0;return i.forEach((p,h)=>{const v=d[h-1],[y,b,S]=(()=>{const Y=v?.search??t.search,W=v?._strictSearch??void 0;try{const F=H_(p.options.validateSearch,{...Y})??void 0;return[{...Y,...F},{...W,...F},void 0]}catch(F){let Z=F;if(F instanceof Lv||(Z=new Lv(F.message,{cause:F})),n?.throwOnError)throw Z;return[Y,{},Z]}})(),C=p.options.loaderDeps?.({search:y})??"",E=C?JSON.stringify(C):"",{interpolatedPath:k,usedParams:j}=Cg({path:p.fullPath,params:o,decodeCharMap:this.pathParamsDecodeCharMap}),I=Cg({path:p.id,params:o,leaveWildcards:!0,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath+E,A=this.getMatch(I),N=this.state.matches.find(Y=>Y.routeId===p.id),T=A?._strictParams??j;let z;if(!A){const Y=p.options.params?.parse??p.options.parseParams;if(Y)try{Object.assign(T,Y(T))}catch(W){if(z=new lY(W.message,{cause:W}),n?.throwOnError)throw z}}Object.assign(o,T);const L=N?"stay":"enter";let G;if(A)G={...A,cause:L,params:N?Qi(N.params,o):o,_strictParams:T,search:Qi(N?N.search:A.search,y),_strictSearch:b};else{const Y=p.options.loader||p.options.beforeLoad||p.lazyFn||tP(p)?"pending":"success";G={id:I,index:h,routeId:p.id,params:N?Qi(N.params,o):o,_strictParams:T,pathname:k,updatedAt:Date.now(),search:N?Qi(N.search,y):y,_strictSearch:b,searchError:void 0,status:Y,isFetching:!1,error:void 0,paramsError:z,__routeContext:void 0,_nonReactive:{loadPromise:dd()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:L,loaderDeps:N?Qi(N.loaderDeps,C):C,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:p.options.staticData||{},fullPath:p.fullPath}}n?.preload||(G.globalNotFound=c===p.id),G.searchError=S;const J=f(v);G.context={...J,...G.__routeContext,...G.__beforeLoadContext},d.push(G)}),d.forEach((p,h)=>{const v=this.looseRoutesById[p.routeId];if(!this.getMatch(p.id)&&n?._buildLocation!==!0){const b=d[h-1],S=f(b);if(v.options.context){const C={deps:p.loaderDeps,params:p.params,context:S??{},location:t,navigate:E=>this.navigate({...E,_fromLocation:t}),buildLocation:this.buildLocation,cause:p.cause,abortController:p.abortController,preload:!!p.preload,matches:d};p.__routeContext=v.options.context(C)??void 0}p.context={...S,...p.__routeContext,...p.__beforeLoadContext}}}),d}}class Lv extends Error{}class lY extends Error{}function cY(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function H_(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Lv("Async validation not supported");if(n.issues)throw new Lv(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function uY({pathname:e,routePathname:t,caseSensitive:n,routesByPath:r,routesById:i,flatRoutes:o,parseCache:a}){let c={};const d=Zs(e),f=y=>V_(d,{to:y.fullPath,caseSensitive:y.options?.caseSensitive??n,fuzzy:!0},a);let p=t!==void 0?r[t]:void 0;if(p)c=f(p);else{let y;for(const b of o){const S=f(b);if(S)if(b.path!=="/"&&S["**"])y||(y={foundRoute:b,routeParams:S});else{p=b,c=S;break}}!p&&y&&(p=y.foundRoute,c=y.routeParams)}let h=p||i[oi];const v=[h];for(;h.parentRoute;)h=h.parentRoute,v.push(h);return v.reverse(),{matchedRoutes:v,routeParams:c,foundRoute:p}}function dY({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){const i=n.reduce((c,d)=>{const f=[];if("search"in d.options)d.options.search?.middlewares&&f.push(...d.options.search.middlewares);else if(d.options.preSearchFilters||d.options.postSearchFilters){const p=({search:h,next:v})=>{let y=h;"preSearchFilters"in d.options&&d.options.preSearchFilters&&(y=d.options.preSearchFilters.reduce((S,C)=>C(S),h));const b=v(y);return"postSearchFilters"in d.options&&d.options.postSearchFilters?d.options.postSearchFilters.reduce((S,C)=>C(S),b):b};f.push(p)}if(r&&d.options.validateSearch){const p=({search:h,next:v})=>{const y=v(h);try{return{...y,...H_(d.options.validateSearch,y)??void 0}}catch{return y}};f.push(p)}return c.concat(f)},[])??[],o=({search:c})=>t.search?t.search===!0?c:tc(t.search,c):{};i.push(o);const a=(c,d)=>{if(c>=i.length)return d;const f=i[c];return f({search:d,next:h=>a(c+1,h)})};return a(0,e)}const fY="Error preloading route! ☝️";class oP{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const r=this.options,i=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),i?this._path=oi:this.parentRoute||qa(!1);let o=i?oi:r?.path;o&&o!=="/"&&(o=NC(o));const a=r?.id||o;let c=i?oi:Ba([this.parentRoute.id===oi?"":this.parentRoute.id,a]);o===oi&&(o="/"),c!==oi&&(c=Ba(["/",c]));const d=c===oi?"/":Ba([this.parentRoute.fullPath,o]);this._path=o,this._id=c,this._fullPath=d,this._to=d},this.clone=n=>{this._path=n._path,this._id=n._id,this._fullPath=n._fullPath,this._to=n._to,this.options.getParentRoute=n.options.getParentRoute,this.children=n.children},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class mY extends oP{constructor(t){super(t)}}function TC(e){const t=e.errorComponent??qy;return u.jsx(pY,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?x.createElement(t,{error:n,reset:r}):e.children})}class pY extends x.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function qy({error:e}){const[t,n]=x.useState(!1);return u.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[u.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[u.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),u.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),u.jsx("div",{style:{height:".25rem"}}),t?u.jsx("div",{children:u.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?u.jsx("code",{children:e.message}):null})}):null]})}function hY({children:e,fallback:t=null}){return gY()?u.jsx(X.Fragment,{children:e}):u.jsx(X.Fragment,{children:t})}function gY(){return X.useSyncExternalStore(vY,()=>!0,()=>!1)}function vY(){return()=>{}}var Kw={exports:{}},Zw={},Yw={exports:{}},Ww={};var iO;function yY(){if(iO)return Ww;iO=1;var e=yp();function t(h,v){return h===v&&(h!==0||1/h===1/v)||h!==h&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function c(h,v){var y=v(),b=r({inst:{value:y,getSnapshot:v}}),S=b[0].inst,C=b[1];return o(function(){S.value=y,S.getSnapshot=v,d(S)&&C({inst:S})},[h,y,v]),i(function(){return d(S)&&C({inst:S}),h(function(){d(S)&&C({inst:S})})},[h]),a(y),y}function d(h){var v=h.getSnapshot;h=h.value;try{var y=v();return!n(h,y)}catch{return!0}}function f(h,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return Ww.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Ww}var oO;function bY(){return oO||(oO=1,Yw.exports=yY()),Yw.exports}var aO;function xY(){if(aO)return Zw;aO=1;var e=yp(),t=bY();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,c=e.useMemo,d=e.useDebugValue;return Zw.useSyncExternalStoreWithSelector=function(f,p,h,v,y){var b=o(null);if(b.current===null){var S={hasValue:!1,value:null};b.current=S}else S=b.current;b=c(function(){function E(N){if(!k){if(k=!0,j=N,N=v(N),y!==void 0&&S.hasValue){var T=S.value;if(y(T,N))return I=T}return I=N}if(T=I,r(j,N))return T;var z=v(N);return y!==void 0&&y(T,z)?(j=N,T):(j=N,I=z)}var k=!1,j,I,A=h===void 0?null:h;return[function(){return E(p())},A===null?void 0:function(){return E(A())}]},[p,h,v,y]);var C=i(f,b[0],b[1]);return a(function(){S.hasValue=!0,S.value=C},[C]),d(C),C},Zw}var sO;function wY(){return sO||(sO=1,Kw.exports=xY()),Kw.exports}var SY=wY();function _Y(e,t=n=>n){return SY.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,CY)}function CY(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!t.has(r)||!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=lO(e);if(n.length!==lO(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function lO(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const Xw=x.createContext(null);function aP(){return typeof document>"u"?Xw:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Xw,Xw)}function an(e){const t=x.useContext(aP());return e?.warn,t}function zr(e){const t=an({warn:e?.router===void 0}),n=e?.router||t,r=x.useRef(void 0);return _Y(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const o=Qi(r.current,e.select(i));return r.current=o,o}return e.select(i)}return i})}const Gy=x.createContext(void 0),EY=x.createContext(void 0);function Oo(e){const t=x.useContext(e.from?EY:Gy);return zr({select:r=>{const i=r.matches.find(o=>e.from?e.from===o.routeId:o.id===t);if(qa(!((e.shouldThrow??!0)&&!i),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),i!==void 0)return e.select?e.select(i):i},structuralSharing:e.structuralSharing})}function Ky(e){return Oo({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function AC(e){const{select:t,...n}=e;return Oo({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function tt(e){return Oo({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function vr(e){return Oo({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function pn(e){const t=an();return x.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function ic(e){const t=an(),n=pn(),r=x.useRef(null);return x.useEffect(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}var Qw={exports:{}},xr={};var cO;function kY(){if(cO)return xr;cO=1;var e=yp();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function o(d,f,p){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:h==null?null:""+h,children:d,containerInfo:f,implementation:p}}var a=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return xr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,xr.createPortal=function(d,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return o(d,f,null,p)},xr.flushSync=function(d){var f=a.T,p=r.p;try{if(a.T=null,r.p=2,d)return d()}finally{a.T=f,r.p=p,r.d.f()}},xr.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(d,f))},xr.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},xr.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var p=f.as,h=c(p,f.crossOrigin),v=typeof f.integrity=="string"?f.integrity:void 0,y=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?r.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:h,integrity:v,fetchPriority:y}):p==="script"&&r.d.X(d,{crossOrigin:h,integrity:v,fetchPriority:y,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},xr.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=c(f.as,f.crossOrigin);r.d.M(d,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(d)},xr.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,h=c(p,f.crossOrigin);r.d.L(d,p,{crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},xr.preloadModule=function(d,f){if(typeof d=="string")if(f){var p=c(f.as,f.crossOrigin);r.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(d)},xr.requestFormReset=function(d){r.d.r(d)},xr.unstable_batchedUpdates=function(d,f){return d(f)},xr.useFormState=function(d,f,p){return a.H.useFormState(d,f,p)},xr.useFormStatus=function(){return a.H.useHostTransitionStatus()},xr.version="19.2.0",xr}var uO;function sP(){if(uO)return Qw.exports;uO=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Qw.exports=kY(),Qw.exports}var zd=sP();const OC=mp(zd),jg=typeof window<"u"?x.useLayoutEffect:x.useEffect;function Jw(e){const t=x.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function jY(e,t,n={},r={}){x.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([o])=>{t(o)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function RY(e){const t=x.useRef(null);return x.useImperativeHandle(e,()=>t.current,[]),t}function IY(e,t){const n=an(),[r,i]=x.useState(!1),o=x.useRef(!1),a=RY(t),{activeProps:c,inactiveProps:d,activeOptions:f,to:p,preload:h,preloadDelay:v,hashScrollIntoView:y,replace:b,startTransition:S,resetScroll:C,viewTransition:E,children:k,target:j,disabled:I,style:A,className:N,onClick:T,onFocus:z,onMouseEnter:L,onMouseLeave:G,onTouchStart:J,ignoreBlocker:Y,params:W,search:F,hash:Z,state:M,mask:K,reloadDocument:U,unsafeRelative:te,from:D,_fromLocation:P,...V}=e,O=zr({select:we=>we.location.search,structuralSharing:!0}),ee=e.from,ue=x.useMemo(()=>({...e,from:ee}),[n,O,ee,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),pe=x.useMemo(()=>n.buildLocation({...ue}),[n,ue]),B=x.useMemo(()=>{if(I)return;let we=pe.maskedLocation?pe.maskedLocation.url:pe.url,ve=!1;return n.origin&&(we.startsWith(n.origin)?we=n.history.createHref(we.replace(n.origin,""))||"/":ve=!0),{href:we,external:ve}},[I,pe.maskedLocation,pe.url,n.origin,n.history]),ie=x.useMemo(()=>{if(B?.external)return B.href;try{return new URL(p),p}catch{}},[p,B]),Se=e.reloadDocument||ie?!1:h??n.options.defaultPreload,Ie=v??n.options.defaultPreloadDelay??0,Fe=zr({select:we=>{if(ie)return!1;if(f?.exact){if(!yZ(we.location.pathname,pe.pathname,n.basepath))return!1}else{const ve=Mv(we.location.pathname,n.basepath),Ee=Mv(pe.pathname,n.basepath);if(!(ve.startsWith(Ee)&&(ve.length===Ee.length||ve[Ee.length]==="/")))return!1}return(f?.includeSearch??!0)&&!nc(we.location.search,pe.search,{partial:!f?.exact,ignoreUndefined:!f?.explicitUndefined})?!1:f?.includeHash?we.location.hash===pe.hash:!0}}),Ue=x.useCallback(()=>{n.preloadRoute({...ue}).catch(we=>{console.warn(we),console.warn(fY)})},[n,ue]),Ye=x.useCallback(we=>{we?.isIntersecting&&Ue()},[Ue]);jY(a,Ye,DY,{disabled:!!I||Se!=="viewport"}),x.useEffect(()=>{o.current||!I&&Se==="render"&&(Ue(),o.current=!0)},[I,Ue,Se]);const _t=we=>{const ve=we.currentTarget.target,Ee=j!==void 0?j:ve;if(!I&&!$Y(we)&&!we.defaultPrevented&&(!Ee||Ee==="_self")&&we.button===0){we.preventDefault(),zd.flushSync(()=>{i(!0)});const ne=n.subscribe("onResolved",()=>{ne(),i(!1)});n.navigate({...ue,replace:b,resetScroll:C,hashScrollIntoView:y,startTransition:S,viewTransition:E,ignoreBlocker:Y})}};if(ie)return{...V,ref:a,href:ie,...k&&{children:k},...j&&{target:j},...I&&{disabled:I},...A&&{style:A},...N&&{className:N},...T&&{onClick:T},...z&&{onFocus:z},...L&&{onMouseEnter:L},...G&&{onMouseLeave:G},...J&&{onTouchStart:J}};const gn=we=>{I||Se&&Ue()},Tn=gn,Fn=we=>{if(!(I||!Se))if(!Ie)Ue();else{const ve=we.target;if(rm.has(ve))return;const Ee=setTimeout(()=>{rm.delete(ve),Ue()},Ie);rm.set(ve,Ee)}},hi=we=>{if(I||!Se||!Ie)return;const ve=we.target,Ee=rm.get(ve);Ee&&(clearTimeout(Ee),rm.delete(ve))},tn=Fe?tc(c,{})??NY:eS,q=Fe?eS:tc(d,{})??eS,oe=[N,tn.className,q.className].filter(Boolean).join(" "),de=(A||tn.style||q.style)&&{...A,...tn.style,...q.style};return{...V,...tn,...q,href:B?.href,ref:a,onClick:im([T,_t]),onFocus:im([z,gn]),onMouseEnter:im([L,Fn]),onMouseLeave:im([G,hi]),onTouchStart:im([J,Tn]),disabled:!!I,target:j,...de&&{style:de},...oe&&{className:oe},...I&&TY,...Fe&&AY,...r&&OY}}const eS={},NY={className:"active"},TY={role:"link","aria-disabled":!0},AY={"data-status":"active","aria-current":"page"},OY={"data-transitioning":"transitioning"},rm=new WeakMap,DY={rootMargin:"100px"},im=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}},Ge=x.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,ref:o,...a}=IY(r,t),c=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;return n===void 0&&delete a.disabled,x.createElement(n||"a",{...a,ref:o},c)});function $Y(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class MY extends oP{constructor(t){super(t),this.useMatch=n=>Oo({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Oo({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>vr({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>tt({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>AC({...n,from:this.id}),this.useLoaderData=n=>Ky({...n,from:this.id}),this.useNavigate=()=>pn({from:this.fullPath}),this.Link=X.forwardRef((n,r)=>u.jsx(Ge,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function Qe(e){return new MY(e)}function PY(){return e=>LY(e)}class zY extends mY{constructor(t){super(t),this.useMatch=n=>Oo({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Oo({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>vr({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>tt({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>AC({...n,from:this.id}),this.useLoaderData=n=>Ky({...n,from:this.id}),this.useNavigate=()=>pn({from:this.fullPath}),this.Link=X.forwardRef((n,r)=>u.jsx(Ge,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function LY(e){return new zY(e)}function dO(e){return typeof e=="object"?new fO(e,{silent:!0}).createRoute(e):new fO(e,{silent:!0}).createRoute}class fO{constructor(t,n){this.path=t,this.createRoute=r=>{this.silent;const i=Qe(r);return i.isRoot=!1,i},this.silent=n?.silent}}class q_{constructor(t){this.useMatch=n=>Oo({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Oo({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>vr({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>tt({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>AC({...n,from:this.options.id}),this.useLoaderData=n=>Ky({...n,from:this.options.id}),this.useNavigate=()=>{const n=an();return pn({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function mAe(e){return t=>new q_({id:e,...t})}function mO(e){return typeof e=="object"?new q_(e):t=>new q_({id:e,...t})}function lP(e,t){let n,r,i,o;const a=()=>(n||(n=e().then(d=>{n=void 0,r=d[t??"default"]}).catch(d=>{if(i=d,gZ(i)&&i instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const f=`tanstack_router_reload:${i.message}`;sessionStorage.getItem(f)||(sessionStorage.setItem(f,"1"),o=!0)}})),n),c=function(f){if(o)throw window.location.reload(),new Promise(()=>{});if(i)throw i;if(!r)throw a();return x.createElement(r,f)};return c.preload=a,c}function UY(){const e=an(),t=x.useRef({router:e,mounted:!1}),[n,r]=x.useState(!1),{hasPendingMatches:i,isLoading:o}=zr({select:h=>({isLoading:h.isLoading,hasPendingMatches:h.matches.some(v=>v.status==="pending")}),structuralSharing:!0}),a=Jw(o),c=o||n||i,d=Jw(c),f=o||i,p=Jw(f);return e.startTransition=h=>{r(!0),x.startTransition(()=>{h(),r(!1)})},x.useEffect(()=>{const h=e.history.subscribe(e.load),v=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Zs(e.latestLocation.href)!==Zs(v.href)&&e.commitLocation({...v,replace:!0}),()=>{h()}},[e,e.history]),jg(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(v){console.error(v)}})()},[e]),jg(()=>{a&&!o&&e.emit({type:"onLoad",...rc(e.state)})},[a,e,o]),jg(()=>{p&&!f&&e.emit({type:"onBeforeRouteMount",...rc(e.state)})},[f,p,e]),jg(()=>{d&&!c&&(e.emit({type:"onResolved",...rc(e.state)}),e.__store.setState(h=>({...h,status:"idle",resolvedLocation:h.location})),GZ(e))},[c,d,e]),null}function FY(e){const t=zr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return u.jsx(TC,{getResetKey:()=>t,onCatch:(n,r)=>{if(Ao(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(Ao(n))return e.fallback?.(n);throw n},children:e.children})}function VY(){return u.jsx("p",{children:"Not Found"})}function Vu(e){return u.jsx(u.Fragment,{children:e.children})}function cP(e,t,n){return t.options.notFoundComponent?u.jsx(t.options.notFoundComponent,{data:n}):e.options.defaultNotFoundComponent?u.jsx(e.options.defaultNotFoundComponent,{data:n}):u.jsx(VY,{})}function BY({children:e}){const t=an();return t.isServer?u.jsx("script",{nonce:t.options.ssr?.nonce,className:"$tsr",dangerouslySetInnerHTML:{__html:[e].filter(Boolean).join(`
|
|
10
|
-
`)+";$_TSR.c()"}}):null}function HY(){const e=an();if(!e.isScrollRestoring||!e.isServer||typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return null;const n=(e.options.getScrollRestorationKey||B_)(e.latestLocation),r=n!==B_(e.latestLocation)?n:void 0,i={storageKey:Pv,shouldScrollRestoration:!0};return r&&(i.key=r),u.jsx(BY,{children:`(${YM.toString()})(${JSON.stringify(i)})`})}const uP=x.memo(function({matchId:t}){const n=an(),r=zr({select:E=>{const k=E.matches.find(j=>j.id===t);return qa(k),{routeId:k.routeId,ssr:k.ssr,_displayPending:k._displayPending}},structuralSharing:!0}),i=n.routesById[r.routeId],o=i.options.pendingComponent??n.options.defaultPendingComponent,a=o?u.jsx(o,{}):null,c=i.options.errorComponent??n.options.defaultErrorComponent,d=i.options.onCatch??n.options.defaultOnCatch,f=i.isRoot?i.options.notFoundComponent??n.options.notFoundRoute?.options.component:i.options.notFoundComponent,p=r.ssr===!1||r.ssr==="data-only",h=(!i.isRoot||i.options.wrapInSuspense||p)&&(i.options.wrapInSuspense??o??(i.options.errorComponent?.preload||p))?x.Suspense:Vu,v=c?TC:Vu,y=f?FY:Vu,b=zr({select:E=>E.loadedAt}),S=zr({select:E=>{const k=E.matches.findIndex(j=>j.id===t);return E.matches[k-1]?.routeId}}),C=i.isRoot?i.options.shellComponent??Vu:Vu;return u.jsxs(C,{children:[u.jsx(Gy.Provider,{value:t,children:u.jsx(h,{fallback:a,children:u.jsx(v,{getResetKey:()=>b,errorComponent:c||qy,onCatch:(E,k)=>{if(Ao(E))throw E;d?.(E,k)},children:u.jsx(y,{fallback:E=>{if(!f||E.routeId&&E.routeId!==r.routeId||!E.routeId&&!i.isRoot)throw E;return x.createElement(f,E)},children:p||r._displayPending?u.jsx(hY,{fallback:a,children:u.jsx(pO,{matchId:t})}):u.jsx(pO,{matchId:t})})})})}),S===oi&&n.options.scrollRestoration?u.jsxs(u.Fragment,{children:[u.jsx(qY,{}),u.jsx(HY,{})]}):null]})});function qY(){const e=an(),t=x.useRef(void 0);return u.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...rc(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const pO=x.memo(function({matchId:t}){const n=an(),{match:r,key:i,routeId:o}=zr({select:d=>{const f=d.matches.find(b=>b.id===t),p=f.routeId,v=(n.routesById[p].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:p,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch});return{key:v?JSON.stringify(v):void 0,routeId:p,match:{id:f.id,status:f.status,error:f.error,_forcePending:f._forcePending,_displayPending:f._displayPending}}},structuralSharing:!0}),a=n.routesById[o],c=x.useMemo(()=>{const d=a.options.component??n.options.defaultComponent;return d?u.jsx(d,{},i):u.jsx(ll,{})},[i,a.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const d=a.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const f=n.getMatch(r.id);if(f&&!f._nonReactive.minPendingPromise&&!n.isServer){const p=dd();f._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),f._nonReactive.minPendingPromise=void 0},d)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return qa(Ao(r.error)),cP(n,a,r.error);if(r.status==="redirected")throw qa(Jo(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error"){if(n.isServer){const d=(a.options.errorComponent??n.options.defaultErrorComponent)||qy;return u.jsx(d,{error:r.error,reset:void 0,info:{componentStack:""}})}throw r.error}return c}),ll=x.memo(function(){const t=an(),n=x.useContext(Gy),r=zr({select:f=>f.matches.find(p=>p.id===n)?.routeId}),i=t.routesById[r],o=zr({select:f=>{const h=f.matches.find(v=>v.id===n);return qa(h),h.globalNotFound}}),a=zr({select:f=>{const p=f.matches,h=p.findIndex(v=>v.id===n);return p[h+1]?.id}}),c=t.options.defaultPendingComponent?u.jsx(t.options.defaultPendingComponent,{}):null;if(o)return cP(t,i,void 0);if(!a)return null;const d=u.jsx(uP,{matchId:a});return n===oi?u.jsx(x.Suspense,{fallback:c,children:d}):d});function GY(){const e=an(),n=e.routesById[oi].options.pendingComponent??e.options.defaultPendingComponent,r=n?u.jsx(n,{}):null,i=e.isServer||typeof document<"u"&&e.ssr?Vu:x.Suspense,o=u.jsxs(i,{fallback:r,children:[!e.isServer&&u.jsx(UY,{}),u.jsx(KY,{})]});return e.options.InnerWrap?u.jsx(e.options.InnerWrap,{children:o}):o}function KY(){const e=an(),t=zr({select:i=>i.matches[0]?.id}),n=zr({select:i=>i.loadedAt}),r=t?u.jsx(uP,{matchId:t}):null;return u.jsx(Gy.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:u.jsx(TC,{getResetKey:()=>n,errorComponent:qy,onCatch:i=>{i.message||i.toString()},children:r})})}const ZY=e=>new YY(e);class YY extends sY{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=dO,globalThis.createLazyFileRoute=mO):typeof window<"u"&&(window.createFileRoute=dO,window.createLazyFileRoute=mO);function WY({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=aP(),i=u.jsx(r.Provider,{value:e,children:t});return e.options.Wrap?u.jsx(e.options.Wrap,{children:i}):i}function XY({router:e,...t}){return u.jsx(WY,{router:e,...t,children:u.jsx(GY,{})})}function xp(e){return Oo({...e,select:t=>e.select?e.select(t.context):t.context})}function QY(e){return zr({select:t=>t.location})}function JY(){const[e,t]=x.useState(Tt.getAllConnections());return x.useEffect(()=>Tt.listenToAllEntities((n,r)=>{t({...e,[r]:n})}),[e]),e}function _c(){const e=Tt.calculateIdFromEntity(_n),[t,n]=x.useState(Tt.getConnectionById(_n));return x.useEffect(()=>Tt.listenToEntity(e,n),[e]),t}function cl(){return _c()}function Ja(e){const t=_n,{clusterId:n,instanceId:r}=tt({strict:!1}),[i,o]=x.useState(Tt.getConnectionById(t));return x.useEffect(()=>Tt.listenToEntity(t,o),[t]),i}function dP(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=dP(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function fP(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=dP(e))&&(r&&(r+=" "),r+=t);return r}const hO=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,aa=fP,Zy=(e,t)=>n=>{var r;if(t?.variants==null)return aa(e,n?.class,n?.className);const{variants:i,defaultVariants:o}=t,a=Object.keys(i).map(f=>{const p=n?.[f],h=o?.[f];if(p===null)return null;const v=hO(p)||hO(h);return i[f][v]}),c=n&&Object.entries(n).reduce((f,p)=>{let[h,v]=p;return v===void 0||(f[h]=v),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:h,className:v,...y}=p;return Object.entries(y).every(b=>{let[S,C]=b;return Array.isArray(C)?C.includes({...o,...c}[S]):{...o,...c}[S]===C})?[...f,h,v]:f},[]);return aa(e,a,d,n?.class,n?.className)},om="hover:-translate-y-1 transition duration-200",am="border bg-transparent border-2 text-white shadow-xs hover:bg-grey-700/40",eW=Zy(`inline-flex
|
|
11
|
-
items-center
|
|
12
|
-
justify-center
|
|
13
|
-
gap-2
|
|
14
|
-
whitespace-nowrap
|
|
15
|
-
rounded-lg
|
|
16
|
-
text-sm
|
|
17
|
-
transition-[color,box-shadow]
|
|
18
|
-
disabled:pointer-events-none
|
|
19
|
-
disabled:opacity-50
|
|
20
|
-
[&_svg]:pointer-events-none
|
|
21
|
-
[&_svg:not([class*='size-'])]:size-4
|
|
22
|
-
[&_svg]:shrink-0
|
|
23
|
-
ring-ring/10
|
|
24
|
-
dark:ring-ring/20
|
|
25
|
-
dark:outline-ring/40
|
|
26
|
-
outline-ring/50
|
|
27
|
-
focus-visible:ring-1
|
|
28
|
-
focus-visible:outline-1
|
|
29
|
-
focus-visible:ring-purple-200
|
|
30
|
-
aria-invalid:focus-visible:ring-0`,{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",submit:"bg-gradient-to-r from-blue-100 from-0% to-blue to-100% hover:bg-gradient-to-r hover:from-blue text-primary-foreground shadow-sm",destructive:"bg-destructive shadow-xs hover:bg-destructive/90",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-muted-foreground",destructiveGhost:"hover:bg-accent hover:text-red",link:"text-primary underline-offset-4 hover:underline",positive:"bg-green text-white shadow-xs hover:bg-green/90",warning:"bg-yellow text-white shadow-xs hover:bg-yellow/90",outline:`${am} ${om}`,ghostOutline:`${am} ${om} border-none`,positiveOutline:`${am} ${om} border-green`,destructiveOutline:`${am} ${om} border-destructive`,defaultOutline:`${am} ${om} border-primary`},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4 text-md",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),DC="-",tW=e=>{const t=rW(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const c=a.split(DC);return c[0]===""&&c.length!==1&&c.shift(),mP(c,t)||nW(a)},getConflictingClassGroupIds:(a,c)=>{const d=n[a]||[];return c&&r[a]?[...d,...r[a]]:d}}},mP=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?mP(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(DC);return t.validators.find(({validator:a})=>a(o))?.classGroupId},gO=/^\[(.+)\]$/,nW=e=>{if(gO.test(e)){const t=gO.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},rW=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const i in n)G_(n[i],r,i,t);return r},G_=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:vO(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(iW(i)){G_(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,a])=>{G_(a,vO(t,o),n,r)})})},vO=(e,t)=>{let n=e;return t.split(DC).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},iW=e=>e.isThemeGetter,oW=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set(o,a){n.has(o)?n.set(o,a):i(o,a)}}},K_="!",Z_=":",aW=Z_.length,sW=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let a=0,c=0,d=0,f;for(let b=0;b<i.length;b++){let S=i[b];if(a===0&&c===0){if(S===Z_){o.push(i.slice(d,b)),d=b+aW;continue}if(S==="/"){f=b;continue}}S==="["?a++:S==="]"?a--:S==="("?c++:S===")"&&c--}const p=o.length===0?i:i.substring(d),h=lW(p),v=h!==p,y=f&&f>d?f-d:void 0;return{modifiers:o,hasImportantModifier:v,baseClassName:h,maybePostfixModifierPosition:y}};if(t){const i=t+Z_,o=r;r=a=>a.startsWith(i)?o(a.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},lW=e=>e.endsWith(K_)?e.substring(0,e.length-1):e.startsWith(K_)?e.substring(1):e,cW=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const i=[];let o=[];return r.forEach(a=>{a[0]==="["||t[a]?(i.push(...o.sort(),a),o=[]):o.push(a)}),i.push(...o.sort()),i}},uW=e=>({cache:oW(e.cacheSize),parseClassName:sW(e),sortModifiers:cW(e),...tW(e)}),dW=/\s+/,fW=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,a=[],c=e.trim().split(dW);let d="";for(let f=c.length-1;f>=0;f-=1){const p=c[f],{isExternal:h,modifiers:v,hasImportantModifier:y,baseClassName:b,maybePostfixModifierPosition:S}=n(p);if(h){d=p+(d.length>0?" "+d:d);continue}let C=!!S,E=r(C?b.substring(0,S):b);if(!E){if(!C){d=p+(d.length>0?" "+d:d);continue}if(E=r(b),!E){d=p+(d.length>0?" "+d:d);continue}C=!1}const k=o(v).join(":"),j=y?k+K_:k,I=j+E;if(a.includes(I))continue;a.push(I);const A=i(E,C);for(let N=0;N<A.length;++N){const T=A[N];a.push(j+T)}d=p+(d.length>0?" "+d:d)}return d};function mW(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=pP(t))&&(r&&(r+=" "),r+=n);return r}const pP=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=pP(e[r]))&&(n&&(n+=" "),n+=t);return n};function pW(e,...t){let n,r,i,o=a;function a(d){const f=t.reduce((p,h)=>h(p),e());return n=uW(f),r=n.cache.get,i=n.cache.set,o=c,c(d)}function c(d){const f=r(d);if(f)return f;const p=fW(d,n);return i(d,p),p}return function(){return o(mW.apply(null,arguments))}}const Qn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},hP=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,gP=/^\((?:(\w[\w-]*):)?(.+)\)$/i,hW=/^\d+\/\d+$/,gW=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,vW=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,yW=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,bW=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xW=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Nu=e=>hW.test(e),wt=e=>!!e&&!Number.isNaN(Number(e)),Is=e=>!!e&&Number.isInteger(Number(e)),tS=e=>e.endsWith("%")&&wt(e.slice(0,-1)),Da=e=>gW.test(e),wW=()=>!0,SW=e=>vW.test(e)&&!yW.test(e),vP=()=>!1,_W=e=>bW.test(e),CW=e=>xW.test(e),EW=e=>!Be(e)&&!He(e),kW=e=>Ld(e,xP,vP),Be=e=>hP.test(e),zl=e=>Ld(e,wP,SW),nS=e=>Ld(e,TW,wt),yO=e=>Ld(e,yP,vP),jW=e=>Ld(e,bP,CW),Rg=e=>Ld(e,SP,_W),He=e=>gP.test(e),sm=e=>Ud(e,wP),RW=e=>Ud(e,AW),bO=e=>Ud(e,yP),IW=e=>Ud(e,xP),NW=e=>Ud(e,bP),Ig=e=>Ud(e,SP,!0),Ld=(e,t,n)=>{const r=hP.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ud=(e,t,n=!1)=>{const r=gP.exec(e);return r?r[1]?t(r[1]):n:!1},yP=e=>e==="position"||e==="percentage",bP=e=>e==="image"||e==="url",xP=e=>e==="length"||e==="size"||e==="bg-size",wP=e=>e==="length",TW=e=>e==="number",AW=e=>e==="family-name",SP=e=>e==="shadow",OW=()=>{const e=Qn("color"),t=Qn("font"),n=Qn("text"),r=Qn("font-weight"),i=Qn("tracking"),o=Qn("leading"),a=Qn("breakpoint"),c=Qn("container"),d=Qn("spacing"),f=Qn("radius"),p=Qn("shadow"),h=Qn("inset-shadow"),v=Qn("text-shadow"),y=Qn("drop-shadow"),b=Qn("blur"),S=Qn("perspective"),C=Qn("aspect"),E=Qn("ease"),k=Qn("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...I(),He,Be],N=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],z=()=>[He,Be,d],L=()=>[Nu,"full","auto",...z()],G=()=>[Is,"none","subgrid",He,Be],J=()=>["auto",{span:["full",Is,He,Be]},Is,He,Be],Y=()=>[Is,"auto",He,Be],W=()=>["auto","min","max","fr",He,Be],F=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...z()],K=()=>[Nu,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...z()],U=()=>[e,He,Be],te=()=>[...I(),bO,yO,{position:[He,Be]}],D=()=>["no-repeat",{repeat:["","x","y","space","round"]}],P=()=>["auto","cover","contain",IW,kW,{size:[He,Be]}],V=()=>[tS,sm,zl],O=()=>["","none","full",f,He,Be],ee=()=>["",wt,sm,zl],ue=()=>["solid","dashed","dotted","double"],pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>[wt,tS,bO,yO],ie=()=>["","none",b,He,Be],Se=()=>["none",wt,He,Be],Ie=()=>["none",wt,He,Be],Fe=()=>[wt,He,Be],Ue=()=>[Nu,"full",...z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Da],breakpoint:[Da],color:[wW],container:[Da],"drop-shadow":[Da],ease:["in","out","in-out"],font:[EW],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Da],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Da],shadow:[Da],spacing:["px",wt],text:[Da],"text-shadow":[Da],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Nu,Be,He,C]}],container:["container"],columns:[{columns:[wt,Be,He,c]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[Is,"auto",He,Be]}],basis:[{basis:[Nu,"full","auto",c,...z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[wt,Nu,"auto","initial","none",Be]}],grow:[{grow:["",wt,He,Be]}],shrink:[{shrink:["",wt,He,Be]}],order:[{order:[Is,"first","last","none",He,Be]}],"grid-cols":[{"grid-cols":G()}],"col-start-end":[{col:J()}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":G()}],"row-start-end":[{row:J()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:z()}],"gap-x":[{"gap-x":z()}],"gap-y":[{"gap-y":z()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:z()}],px:[{px:z()}],py:[{py:z()}],ps:[{ps:z()}],pe:[{pe:z()}],pt:[{pt:z()}],pr:[{pr:z()}],pb:[{pb:z()}],pl:[{pl:z()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":z()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[c,"screen",...K()]}],"min-w":[{"min-w":[c,"screen","none",...K()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[a]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",n,sm,zl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,He,nS]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",tS,Be]}],"font-family":[{font:[RW,Be,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,He,Be]}],"line-clamp":[{"line-clamp":[wt,"none",He,nS]}],leading:[{leading:[o,...z()]}],"list-image":[{"list-image":["none",He,Be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",He,Be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ue(),"wavy"]}],"text-decoration-thickness":[{decoration:[wt,"from-font","auto",He,zl]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[wt,"auto",He,Be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",He,Be]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",He,Be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:te()}],"bg-repeat":[{bg:D()}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Is,He,Be],radial:["",He,Be],conic:[Is,He,Be]},NW,jW]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:V()}],"gradient-via-pos":[{via:V()}],"gradient-to-pos":[{to:V()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:O()}],"rounded-s":[{"rounded-s":O()}],"rounded-e":[{"rounded-e":O()}],"rounded-t":[{"rounded-t":O()}],"rounded-r":[{"rounded-r":O()}],"rounded-b":[{"rounded-b":O()}],"rounded-l":[{"rounded-l":O()}],"rounded-ss":[{"rounded-ss":O()}],"rounded-se":[{"rounded-se":O()}],"rounded-ee":[{"rounded-ee":O()}],"rounded-es":[{"rounded-es":O()}],"rounded-tl":[{"rounded-tl":O()}],"rounded-tr":[{"rounded-tr":O()}],"rounded-br":[{"rounded-br":O()}],"rounded-bl":[{"rounded-bl":O()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ue(),"hidden","none"]}],"divide-style":[{divide:[...ue(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...ue(),"none","hidden"]}],"outline-offset":[{"outline-offset":[wt,He,Be]}],"outline-w":[{outline:["",wt,sm,zl]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",p,Ig,Rg]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",h,Ig,Rg]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[wt,zl]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",v,Ig,Rg]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[wt,He,Be]}],"mix-blend":[{"mix-blend":[...pe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":pe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[wt]}],"mask-image-linear-from-pos":[{"mask-linear-from":B()}],"mask-image-linear-to-pos":[{"mask-linear-to":B()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":B()}],"mask-image-t-to-pos":[{"mask-t-to":B()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":B()}],"mask-image-r-to-pos":[{"mask-r-to":B()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":B()}],"mask-image-b-to-pos":[{"mask-b-to":B()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":B()}],"mask-image-l-to-pos":[{"mask-l-to":B()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":B()}],"mask-image-x-to-pos":[{"mask-x-to":B()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":B()}],"mask-image-y-to-pos":[{"mask-y-to":B()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[He,Be]}],"mask-image-radial-from-pos":[{"mask-radial-from":B()}],"mask-image-radial-to-pos":[{"mask-radial-to":B()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":I()}],"mask-image-conic-pos":[{"mask-conic":[wt]}],"mask-image-conic-from-pos":[{"mask-conic-from":B()}],"mask-image-conic-to-pos":[{"mask-conic-to":B()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:te()}],"mask-repeat":[{mask:D()}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",He,Be]}],filter:[{filter:["","none",He,Be]}],blur:[{blur:ie()}],brightness:[{brightness:[wt,He,Be]}],contrast:[{contrast:[wt,He,Be]}],"drop-shadow":[{"drop-shadow":["","none",y,Ig,Rg]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",wt,He,Be]}],"hue-rotate":[{"hue-rotate":[wt,He,Be]}],invert:[{invert:["",wt,He,Be]}],saturate:[{saturate:[wt,He,Be]}],sepia:[{sepia:["",wt,He,Be]}],"backdrop-filter":[{"backdrop-filter":["","none",He,Be]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[wt,He,Be]}],"backdrop-contrast":[{"backdrop-contrast":[wt,He,Be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",wt,He,Be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[wt,He,Be]}],"backdrop-invert":[{"backdrop-invert":["",wt,He,Be]}],"backdrop-opacity":[{"backdrop-opacity":[wt,He,Be]}],"backdrop-saturate":[{"backdrop-saturate":[wt,He,Be]}],"backdrop-sepia":[{"backdrop-sepia":["",wt,He,Be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":z()}],"border-spacing-x":[{"border-spacing-x":z()}],"border-spacing-y":[{"border-spacing-y":z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",He,Be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[wt,"initial",He,Be]}],ease:[{ease:["linear","initial",E,He,Be]}],delay:[{delay:[wt,He,Be]}],animate:[{animate:["none",k,He,Be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,He,Be]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:Ie()}],"scale-x":[{"scale-x":Ie()}],"scale-y":[{"scale-y":Ie()}],"scale-z":[{"scale-z":Ie()}],"scale-3d":["scale-3d"],skew:[{skew:Fe()}],"skew-x":[{"skew-x":Fe()}],"skew-y":[{"skew-y":Fe()}],transform:[{transform:[He,Be,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ue()}],"translate-x":[{"translate-x":Ue()}],"translate-y":[{"translate-y":Ue()}],"translate-z":[{"translate-z":Ue()}],"translate-none":["translate-none"],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",He,Be]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",He,Be]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[wt,sm,zl,nS]}],stroke:[{stroke:["none",...U()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},DW=pW(OW);function Pe(...e){return DW(fP(e))}function xO(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Fd(...e){return t=>{let n=!1;const r=e.map(i=>{const o=xO(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():xO(e[i],null)}}}}function ut(...e){return x.useCallback(Fd(...e),e)}var $W=Symbol.for("react.lazy"),Uv=EC[" use ".trim().toString()];function MW(e){return typeof e=="object"&&e!==null&&"then"in e}function _P(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===$W&&"_payload"in e&&MW(e._payload)}function CP(e){const t=PW(e),n=x.forwardRef((r,i)=>{let{children:o,...a}=r;_P(o)&&typeof Uv=="function"&&(o=Uv(o._payload));const c=x.Children.toArray(o),d=c.find(LW);if(d){const f=d.props.children,p=c.map(h=>h===d?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:h);return u.jsx(t,{...a,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,p):null})}return u.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var $C=CP("Slot");function PW(e){const t=x.forwardRef((n,r)=>{let{children:i,...o}=n;if(_P(i)&&typeof Uv=="function"&&(i=Uv(i._payload)),x.isValidElement(i)){const a=FW(i),c=UW(o,i.props);return i.type!==x.Fragment&&(c.ref=r?Fd(r,a):a),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zW=Symbol("radix.slottable");function LW(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zW}function UW(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...c)=>{const d=o(...c);return i(...c),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function FW(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function be({className:e,variant:t,size:n,asChild:r=!1,...i}){const o=r?$C:"button";return u.jsx(o,{"data-slot":"button",className:Pe(eW({variant:t,size:n,className:e})),...i})}function fc({className:e,...t}){return u.jsx("div",{"data-slot":"card",className:Pe("bg-card text-card-foreground flex flex-col gap-6 rounded-xl py-4 shadow-deep",e),...t})}function ul({className:e,...t}){return u.jsx("div",{"data-slot":"card-header",className:Pe("flex flex-col gap-1.5 px-6",e),...t})}function dl({className:e,...t}){return u.jsx("div",{"data-slot":"card-title",className:Pe("leading-none text-lg",e),...t})}function Cc({className:e,...t}){return u.jsx("div",{"data-slot":"card-description",className:Pe("text-muted-foreground text-xs",e),...t})}function es({className:e,...t}){return u.jsx("div",{"data-slot":"card-content",className:Pe("px-6",e),...t})}function VW(e){return e!==null&&!!e.username}function Ec(e){if(e&&!VW(e)){const t=Object.keys(e.roles);if(t.length===1)return`/${t[0]}`}return"/"}const BW=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),HW=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),wO=e=>{const t=HW(e);return t.charAt(0).toUpperCase()+t.slice(1)},EP=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),qW=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var GW={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const KW=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...c},d)=>x.createElement("svg",{ref:d,...GW,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:EP("lucide",i),...!o&&!qW(c)&&{"aria-hidden":"true"},...c},[...a.map(([f,p])=>x.createElement(f,p)),...Array.isArray(o)?o:[o]]));const Le=(e,t)=>{const n=x.forwardRef(({className:r,...i},o)=>x.createElement(KW,{ref:o,iconNode:t,className:EP(`lucide-${BW(wO(e))}`,`lucide-${e}`,r),...i}));return n.displayName=wO(e),n};const ZW=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],YW=Le("activity",ZW);const WW=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],kP=Le("arrow-down",WW);const XW=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],mc=Le("arrow-left",XW);const QW=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],ro=Le("arrow-right",QW);const JW=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],eX=Le("arrow-up-down",JW);const tX=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],nX=Le("arrow-up",tX);const rX=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M16 12h2",key:"7q9ll5"}],["path",{d:"M16 8h2",key:"msurwy"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}],["path",{d:"M6 12h2",key:"32wvfc"}],["path",{d:"M6 8h2",key:"30oboj"}]],jP=Le("book-open-text",rX);const iX=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],oX=Le("boxes",iX);const aX=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],sX=Le("bug",aX);const lX=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],RP=Le("chart-pie",lX);const cX=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],MC=Le("check",cX);const uX=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],IP=Le("chevron-down",uX);const dX=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],fX=Le("chevron-up",dX);const mX=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],pX=Le("circle-check-big",mX);const hX=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],NP=Le("circle",hX);const gX=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]],vX=Le("clipboard-check",gX);const yX=[["path",{d:"M12 12v4",key:"tww15h"}],["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M17 18h.5a1 1 0 0 0 0-9h-1.79A7 7 0 1 0 7 17.708",key:"xsb5ju"}]],bX=Le("cloud-alert",yX);const xX=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],wX=Le("cloud-upload",xX);const SX=[["path",{d:"M10.5 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v5.5",key:"1g2yzs"}],["path",{d:"m14.3 19.6 1-.4",key:"11sv9r"}],["path",{d:"M15 3v7.5",key:"7lm50a"}],["path",{d:"m15.2 16.9-.9-.3",key:"1t7mvx"}],["path",{d:"m16.6 21.7.3-.9",key:"1j67ps"}],["path",{d:"m16.8 15.3-.4-1",key:"1ei7r6"}],["path",{d:"m19.1 15.2.3-.9",key:"18r7jp"}],["path",{d:"m19.6 21.7-.4-1",key:"z2vh2"}],["path",{d:"m20.7 16.8 1-.4",key:"19m87a"}],["path",{d:"m21.7 19.4-.9-.3",key:"1qgwi9"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}]],_X=Le("columns-3-cog",SX);const CX=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],TP=Le("copy",CX);const EX=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],AP=Le("credit-card",EX);const kX=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],jX=Le("database",kX);const RX=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],OP=Le("download",RX);const IX=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],PC=Le("ellipsis",IX);const NX=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],TX=Le("external-link",NX);const AX=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],OX=Le("file",AX);const DX=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],$X=Le("folder",DX);const MX=[["path",{d:"M12.531 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14v6a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341l.427-.473",key:"ol2ft2"}],["path",{d:"m16.5 3.5 5 5",key:"15e6fa"}],["path",{d:"m21.5 3.5-5 5",key:"m0lwru"}]],SO=Le("funnel-x",MX);const PX=[["path",{d:"M13.354 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14v6a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341l1.218-1.348",key:"8mvsmf"}],["path",{d:"M16 6h6",key:"1dogtp"}],["path",{d:"M19 3v6",key:"1ytpjt"}]],zX=Le("funnel-plus",PX);const LX=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],UX=Le("funnel",LX);const FX=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],VX=Le("gauge",FX);const BX=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],HX=Le("git-branch",BX);const qX=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],zC=Le("github",qX);const GX=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],KX=Le("grip-vertical",GX);const ZX=[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]],DP=Le("handshake",ZX);const YX=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],WX=Le("house",YX);const XX=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m8 11 4 4 4-4",key:"1dohi6"}],["path",{d:"M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4",key:"1ywtjm"}]],QX=Le("import",XX);const JX=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],$P=Le("key",JX);const eQ=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],tQ=Le("link",eQ);const nQ=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],MP=Le("loader-circle",nQ);const rQ=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],iQ=Le("log-in",rQ);const oQ=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],aQ=Le("lock",oQ);const sQ=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],lQ=Le("log-out",sQ);const cQ=[["path",{d:"M22 10.5V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h12.5",key:"e61zoh"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"M20 14v4",key:"1hm744"}],["path",{d:"M20 22v.01",key:"12bgn6"}]],uQ=Le("mail-warning",cQ);const dQ=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],PP=Le("menu",dQ);const fQ=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"16",height:"18",x:"4",y:"4",rx:"2",key:"1u9h20"}],["path",{d:"M8 10h6",key:"3oa6kw"}],["path",{d:"M8 14h8",key:"1fgep2"}],["path",{d:"M8 18h5",key:"17enja"}]],mQ=Le("notepad-text",fQ);const pQ=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],LC=Le("package",pQ);const hQ=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],gQ=Le("panel-right-close",hQ);const vQ=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]],yQ=Le("panel-right-open",vQ);const bQ=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],zP=Le("pencil",bQ);const xQ=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],po=Le("plus",xQ);const wQ=[["path",{d:"M13 16H8",key:"wsln4y"}],["path",{d:"M14 8H8",key:"1l3xfs"}],["path",{d:"M16 12H8",key:"1fr5h0"}],["path",{d:"M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z",key:"ycz6yz"}]],LP=Le("receipt-text",wQ);const SQ=[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]],_Q=Le("receipt",SQ);const CQ=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],sa=Le("refresh-cw",CQ);const EQ=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],UP=Le("rocket",EQ);const kQ=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],jQ=Le("rotate-ccw",kQ);const RQ=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],ho=Le("save",RQ);const IQ=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],NQ=Le("server",IQ);const TQ=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],AQ=Le("settings",TQ);const OQ=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],DQ=Le("table",OQ);const $Q=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],UC=Le("terminal",$Q);const MQ=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],PQ=Le("trash-2",MQ);const zQ=[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ts=Le("trash",zQ);const LQ=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],UQ=Le("triangle-alert",LQ);const FQ=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],VQ=Le("undo-2",FQ);const BQ=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],FP=Le("users",BQ);const HQ=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],VP=Le("x",HQ);function Fv({className:e,error:t,title:n,showReturnToHome:r,children:i}){const{user:o,isLoading:a}=_c();return Ec(o),u.jsxs(fc,{className:Pe("text-red p-5 border border-red rounded-md m-12 mt-36",e),children:[u.jsxs(ul,{children:[u.jsx(dl,{className:"text-2xl",children:u.jsx("h2",{children:n??"Component Error"})}),u.jsx(Cc,{children:t.message})]}),u.jsxs(es,{children:[i,r!==!1&&(o&&!a?u.jsx(Ge,{to:oa,children:u.jsxs(be,{children:[" ",u.jsx(mc,{})," Return to Home"]})}):u.jsx(Ge,{to:"/sign-in",children:u.jsxs(be,{children:[" ",u.jsx(mc,{})," Go to Sign In Page"]})}))]})]})}function qQ(){const{user:e,isLoading:t}=_c();return Ec(e),u.jsx("div",{className:"flex items-center justify-center h-screen px-3",children:u.jsxs(fc,{className:"text-red p-5 border border-red rounded-md w-full max-w-md",children:[u.jsx(ul,{children:u.jsx(dl,{className:"text-2xl",children:u.jsx("h2",{children:"Sorry, Page Not Found"})})}),u.jsx(es,{children:e&&!t?u.jsx(Ge,{to:oa,children:u.jsxs(be,{children:[" ",u.jsx(mc,{})," Return to Home"]})}):u.jsx(Ge,{to:"/sign-in",children:u.jsxs(be,{children:[" ",u.jsx(mc,{})," Go Sign In Page"]})})})]})})}function GQ(){return"ontouchstart"in window||navigator.maxTouchPoints>0}function KQ(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const ZQ=e=>{switch(e){case"success":return XQ;case"info":return JQ;case"warning":return QQ;case"error":return eJ;default:return null}},YQ=Array(12).fill(0),WQ=({visible:e,className:t})=>X.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},X.createElement("div",{className:"sonner-spinner"},YQ.map((n,r)=>X.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),XQ=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},X.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"})),QQ=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},X.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"})),JQ=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},X.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"})),eJ=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},X.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"})),tJ=X.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"},X.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),X.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),nJ=()=>{const[e,t]=X.useState(document.hidden);return X.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Y_=1;class rJ{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...i}=t,o=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Y_++,a=this.toasts.find(d=>d.id===o),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),a?this.toasts=this.toasts.map(d=>d.id===o?(this.publish({...d,...t,id:o,title:r}),{...d,...t,id:o,dismissible:c,title:r}):d):this.addToast({title:r,...i,dismissible:c,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,a;const c=i.then(async f=>{if(a=["resolve",f],X.isValidElement(f))o=!1,this.create({id:r,type:"default",message:f});else if(oJ(f)&&!f.ok){o=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,v=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,b=typeof h=="object"&&!X.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:v,...b})}else if(f instanceof Error){o=!1;const h=typeof n.error=="function"?await n.error(f):n.error,v=typeof n.description=="function"?await n.description(f):n.description,b=typeof h=="object"&&!X.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:v,...b})}else if(n.success!==void 0){o=!1;const h=typeof n.success=="function"?await n.success(f):n.success,v=typeof n.description=="function"?await n.description(f):n.description,b=typeof h=="object"&&!X.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:v,...b})}}).catch(async f=>{if(a=["reject",f],n.error!==void 0){o=!1;const p=typeof n.error=="function"?await n.error(f):n.error,h=typeof n.description=="function"?await n.description(f):n.description,y=typeof p=="object"&&!X.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:h,...y})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((f,p)=>c.then(()=>a[0]==="reject"?p(a[1]):f(a[1])).catch(p));return typeof r!="string"&&typeof r!="number"?{unwrap:d}:Object.assign(r,{unwrap:d})},this.custom=(t,n)=>{const r=n?.id||Y_++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const ri=new rJ,iJ=(e,t)=>{const n=t?.id||Y_++;return ri.addToast({title:e,...t,id:n}),n},oJ=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",aJ=iJ,sJ=()=>ri.toasts,lJ=()=>ri.getActiveToasts(),_e=Object.assign(aJ,{success:ri.success,info:ri.info,warning:ri.warning,error:ri.error,custom:ri.custom,message:ri.message,promise:ri.promise,dismiss:ri.dismiss,loading:ri.loading},{getHistory:sJ,getToasts:lJ});KQ("[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 Ng(e){return e.label!==void 0}const cJ=3,uJ="24px",dJ="16px",_O=4e3,fJ=356,mJ=14,pJ=45,hJ=200;function Yo(...e){return e.filter(Boolean).join(" ")}function gJ(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const vJ=e=>{var t,n,r,i,o,a,c,d,f;const{invert:p,toast:h,unstyled:v,interacting:y,setHeights:b,visibleToasts:S,heights:C,index:E,toasts:k,expanded:j,removeToast:I,defaultRichColors:A,closeButton:N,style:T,cancelButtonStyle:z,actionButtonStyle:L,className:G="",descriptionClassName:J="",duration:Y,position:W,gap:F,expandByDefault:Z,classNames:M,icons:K,closeButtonAriaLabel:U="Close toast"}=e,[te,D]=X.useState(null),[P,V]=X.useState(null),[O,ee]=X.useState(!1),[ue,pe]=X.useState(!1),[B,ie]=X.useState(!1),[Se,Ie]=X.useState(!1),[Fe,Ue]=X.useState(!1),[Ye,_t]=X.useState(0),[gn,Tn]=X.useState(0),Fn=X.useRef(h.duration||Y||_O),hi=X.useRef(null),tn=X.useRef(null),q=E===0,oe=E+1<=S,de=h.type,we=h.dismissible!==!1,ve=h.className||"",Ee=h.descriptionClassName||"",ne=X.useMemo(()=>C.findIndex(ot=>ot.toastId===h.id)||0,[C,h.id]),ye=X.useMemo(()=>{var ot;return(ot=h.closeButton)!=null?ot:N},[h.closeButton,N]),Te=X.useMemo(()=>h.duration||Y||_O,[h.duration,Y]),Ze=X.useRef(0),st=X.useRef(0),qt=X.useRef(0),Vn=X.useRef(null),[xn,Yt]=W.split("-"),Ct=X.useMemo(()=>C.reduce((ot,vn,ir)=>ir>=ne?ot:ot+vn.height,0),[C,ne]),yt=nJ(),Hr=h.invert||p,rr=de==="loading";st.current=X.useMemo(()=>ne*F+Ct,[ne,Ct]),X.useEffect(()=>{Fn.current=Te},[Te]),X.useEffect(()=>{ee(!0)},[]),X.useEffect(()=>{const ot=tn.current;if(ot){const vn=ot.getBoundingClientRect().height;return Tn(vn),b(ir=>[{toastId:h.id,height:vn,position:h.position},...ir]),()=>b(ir=>ir.filter(br=>br.toastId!==h.id))}},[b,h.id]),X.useLayoutEffect(()=>{if(!O)return;const ot=tn.current,vn=ot.style.height;ot.style.height="auto";const ir=ot.getBoundingClientRect().height;ot.style.height=vn,Tn(ir),b(br=>br.find(wn=>wn.toastId===h.id)?br.map(wn=>wn.toastId===h.id?{...wn,height:ir}:wn):[{toastId:h.id,height:ir,position:h.position},...br])},[O,h.title,h.description,b,h.id,h.jsx,h.action,h.cancel]);const Vo=X.useCallback(()=>{pe(!0),_t(st.current),b(ot=>ot.filter(vn=>vn.toastId!==h.id)),setTimeout(()=>{I(h)},hJ)},[h,I,b,st]);X.useEffect(()=>{if(h.promise&&de==="loading"||h.duration===1/0||h.type==="loading")return;let ot;return j||y||yt?(()=>{if(qt.current<Ze.current){const br=new Date().getTime()-Ze.current;Fn.current=Fn.current-br}qt.current=new Date().getTime()})():(()=>{Fn.current!==1/0&&(Ze.current=new Date().getTime(),ot=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),Vo()},Fn.current))})(),()=>clearTimeout(ot)},[j,y,h,de,yt,Vo]),X.useEffect(()=>{h.delete&&(Vo(),h.onDismiss==null||h.onDismiss.call(h,h))},[Vo,h.delete]);function Bc(){var ot;if(K?.loading){var vn;return X.createElement("div",{className:Yo(M?.loader,h==null||(vn=h.classNames)==null?void 0:vn.loader,"sonner-loader"),"data-visible":de==="loading"},K.loading)}return X.createElement(WQ,{className:Yo(M?.loader,h==null||(ot=h.classNames)==null?void 0:ot.loader),visible:de==="loading"})}const Hc=h.icon||K?.[de]||ZQ(de);var bl,Bo;return X.createElement("li",{tabIndex:0,ref:tn,className:Yo(G,ve,M?.toast,h==null||(t=h.classNames)==null?void 0:t.toast,M?.default,M?.[de],h==null||(n=h.classNames)==null?void 0:n[de]),"data-sonner-toast":"","data-rich-colors":(bl=h.richColors)!=null?bl:A,"data-styled":!(h.jsx||h.unstyled||v),"data-mounted":O,"data-promise":!!h.promise,"data-swiped":Fe,"data-removed":ue,"data-visible":oe,"data-y-position":xn,"data-x-position":Yt,"data-index":E,"data-front":q,"data-swiping":B,"data-dismissible":we,"data-type":de,"data-invert":Hr,"data-swipe-out":Se,"data-swipe-direction":P,"data-expanded":!!(j||Z&&O),"data-testid":h.testId,style:{"--index":E,"--toasts-before":E,"--z-index":k.length-E,"--offset":`${ue?Ye:st.current}px`,"--initial-height":Z?"auto":`${gn}px`,...T,...h.style},onDragEnd:()=>{ie(!1),D(null),Vn.current=null},onPointerDown:ot=>{ot.button!==2&&(rr||!we||(hi.current=new Date,_t(st.current),ot.target.setPointerCapture(ot.pointerId),ot.target.tagName!=="BUTTON"&&(ie(!0),Vn.current={x:ot.clientX,y:ot.clientY})))},onPointerUp:()=>{var ot,vn,ir;if(Se||!we)return;Vn.current=null;const br=Number(((ot=tn.current)==null?void 0:ot.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),is=Number(((vn=tn.current)==null?void 0:vn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),wn=new Date().getTime()-((ir=hi.current)==null?void 0:ir.getTime()),qr=te==="x"?br:is,xl=Math.abs(qr)/wn;if(Math.abs(qr)>=pJ||xl>.11){_t(st.current),h.onDismiss==null||h.onDismiss.call(h,h),V(te==="x"?br>0?"right":"left":is>0?"down":"up"),Vo(),Ie(!0);return}else{var Gr,Kr;(Gr=tn.current)==null||Gr.style.setProperty("--swipe-amount-x","0px"),(Kr=tn.current)==null||Kr.style.setProperty("--swipe-amount-y","0px")}Ue(!1),ie(!1),D(null)},onPointerMove:ot=>{var vn,ir,br;if(!Vn.current||!we||((vn=window.getSelection())==null?void 0:vn.toString().length)>0)return;const wn=ot.clientY-Vn.current.y,qr=ot.clientX-Vn.current.x;var xl;const Gr=(xl=e.swipeDirections)!=null?xl:gJ(W);!te&&(Math.abs(qr)>1||Math.abs(wn)>1)&&D(Math.abs(qr)>Math.abs(wn)?"x":"y");let Kr={x:0,y:0};const qc=xo=>1/(1.5+Math.abs(xo)/20);if(te==="y"){if(Gr.includes("top")||Gr.includes("bottom"))if(Gr.includes("top")&&wn<0||Gr.includes("bottom")&&wn>0)Kr.y=wn;else{const xo=wn*qc(wn);Kr.y=Math.abs(xo)<Math.abs(wn)?xo:wn}}else if(te==="x"&&(Gr.includes("left")||Gr.includes("right")))if(Gr.includes("left")&&qr<0||Gr.includes("right")&&qr>0)Kr.x=qr;else{const xo=qr*qc(qr);Kr.x=Math.abs(xo)<Math.abs(qr)?xo:qr}(Math.abs(Kr.x)>0||Math.abs(Kr.y)>0)&&Ue(!0),(ir=tn.current)==null||ir.style.setProperty("--swipe-amount-x",`${Kr.x}px`),(br=tn.current)==null||br.style.setProperty("--swipe-amount-y",`${Kr.y}px`)}},ye&&!h.jsx&&de!=="loading"?X.createElement("button",{"aria-label":U,"data-disabled":rr,"data-close-button":!0,onClick:rr||!we?()=>{}:()=>{Vo(),h.onDismiss==null||h.onDismiss.call(h,h)},className:Yo(M?.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(Bo=K?.close)!=null?Bo:tJ):null,(de||h.icon||h.promise)&&h.icon!==null&&(K?.[de]!==null||h.icon)?X.createElement("div",{"data-icon":"",className:Yo(M?.icon,h==null||(i=h.classNames)==null?void 0:i.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||Bc():null,h.type!=="loading"?Hc:null):null,X.createElement("div",{"data-content":"",className:Yo(M?.content,h==null||(o=h.classNames)==null?void 0:o.content)},X.createElement("div",{"data-title":"",className:Yo(M?.title,h==null||(a=h.classNames)==null?void 0:a.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?X.createElement("div",{"data-description":"",className:Yo(J,Ee,M?.description,h==null||(c=h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),X.isValidElement(h.cancel)?h.cancel:h.cancel&&Ng(h.cancel)?X.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||z,onClick:ot=>{Ng(h.cancel)&&we&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,ot),Vo())},className:Yo(M?.cancelButton,h==null||(d=h.classNames)==null?void 0:d.cancelButton)},h.cancel.label):null,X.isValidElement(h.action)?h.action:h.action&&Ng(h.action)?X.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||L,onClick:ot=>{Ng(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,ot),!ot.defaultPrevented&&Vo())},className:Yo(M?.actionButton,h==null||(f=h.classNames)==null?void 0:f.actionButton)},h.action.label):null)};function CO(){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 yJ(e,t){const n={};return[e,t].forEach((r,i)=>{const o=i===1,a=o?"--mobile-offset":"--offset",c=o?dJ:uJ;function d(f){["top","right","bottom","left"].forEach(p=>{n[`${a}-${p}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${a}-${f}`]=c:n[`${a}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):d(c)}),n}const bJ=X.forwardRef(function(t,n){const{id:r,invert:i,position:o="bottom-right",hotkey:a=["altKey","KeyT"],expand:c,closeButton:d,className:f,offset:p,mobileOffset:h,theme:v="light",richColors:y,duration:b,style:S,visibleToasts:C=cJ,toastOptions:E,dir:k=CO(),gap:j=mJ,icons:I,containerAriaLabel:A="Notifications"}=t,[N,T]=X.useState([]),z=X.useMemo(()=>r?N.filter(O=>O.toasterId===r):N.filter(O=>!O.toasterId),[N,r]),L=X.useMemo(()=>Array.from(new Set([o].concat(z.filter(O=>O.position).map(O=>O.position)))),[z,o]),[G,J]=X.useState([]),[Y,W]=X.useState(!1),[F,Z]=X.useState(!1),[M,K]=X.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=X.useRef(null),te=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=X.useRef(null),P=X.useRef(!1),V=X.useCallback(O=>{T(ee=>{var ue;return(ue=ee.find(pe=>pe.id===O.id))!=null&&ue.delete||ri.dismiss(O.id),ee.filter(({id:pe})=>pe!==O.id)})},[]);return X.useEffect(()=>ri.subscribe(O=>{if(O.dismiss){requestAnimationFrame(()=>{T(ee=>ee.map(ue=>ue.id===O.id?{...ue,delete:!0}:ue))});return}setTimeout(()=>{OC.flushSync(()=>{T(ee=>{const ue=ee.findIndex(pe=>pe.id===O.id);return ue!==-1?[...ee.slice(0,ue),{...ee[ue],...O},...ee.slice(ue+1)]:[O,...ee]})})})}),[N]),X.useEffect(()=>{if(v!=="system"){K(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?K("dark"):K("light")),typeof window>"u")return;const O=window.matchMedia("(prefers-color-scheme: dark)");try{O.addEventListener("change",({matches:ee})=>{K(ee?"dark":"light")})}catch{O.addListener(({matches:ue})=>{try{K(ue?"dark":"light")}catch(pe){console.error(pe)}})}},[v]),X.useEffect(()=>{N.length<=1&&W(!1)},[N]),X.useEffect(()=>{const O=ee=>{var ue;if(a.every(ie=>ee[ie]||ee.code===ie)){var B;W(!0),(B=U.current)==null||B.focus()}ee.code==="Escape"&&(document.activeElement===U.current||(ue=U.current)!=null&&ue.contains(document.activeElement))&&W(!1)};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[a]),X.useEffect(()=>{if(U.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,P.current=!1)}},[U.current]),X.createElement("section",{ref:n,"aria-label":`${A} ${te}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((O,ee)=>{var ue;const[pe,B]=O.split("-");return z.length?X.createElement("ol",{key:O,dir:k==="auto"?CO():k,tabIndex:-1,ref:U,className:f,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":pe,"data-x-position":B,style:{"--front-toast-height":`${((ue=G[0])==null?void 0:ue.height)||0}px`,"--width":`${fJ}px`,"--gap":`${j}px`,...S,...yJ(p,h)},onBlur:ie=>{P.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(P.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||P.current||(P.current=!0,D.current=ie.relatedTarget)},onMouseEnter:()=>W(!0),onMouseMove:()=>W(!0),onMouseLeave:()=>{F||W(!1)},onDragEnd:()=>W(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||Z(!0)},onPointerUp:()=>Z(!1)},z.filter(ie=>!ie.position&&ee===0||ie.position===O).map((ie,Se)=>{var Ie,Fe;return X.createElement(vJ,{key:ie.id,icons:I,index:Se,toast:ie,defaultRichColors:y,duration:(Ie=E?.duration)!=null?Ie:b,className:E?.className,descriptionClassName:E?.descriptionClassName,invert:i,visibleToasts:C,closeButton:(Fe=E?.closeButton)!=null?Fe:d,interacting:F,position:O,style:E?.style,unstyled:E?.unstyled,classNames:E?.classNames,cancelButtonStyle:E?.cancelButtonStyle,actionButtonStyle:E?.actionButtonStyle,closeButtonAriaLabel:E?.closeButtonAriaLabel,removeToast:V,toasts:z.filter(Ue=>Ue.position==ie.position),heights:G.filter(Ue=>Ue.position==ie.position),setHeights:J,expandByDefault:c,gap:j,expanded:Y,swipeDirections:t.swipeDirections})})):null}))});function EO(e){let t="Error",n="We had some trouble!";console.error(e);const r=e,i=e;if(typeof e=="string"?n=e:r?.response?.data?typeof r.response.data=="string"?n=r.response.data:r.response.data.error?n=r.response.data.error:r.response.data.message&&(n=r.response.data.message):i?.message&&(n=i.message),n.includes(":")){const o=n.split(":");t=o.shift(),n=o.join(":")}_e.error(t,{description:n,action:{label:"Dismiss",onClick:()=>_e.dismiss()}})}const Vv=new KK({queryCache:new LM({onError:EO}),mutationCache:new zM({onError:EO})});function fa(e){return!!e}const Yy={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},za=console,Bu={};Object.keys(Yy).forEach(e=>{Bu[e]=za[e]});const lm="Datadog Browser SDK:",mt={debug:Bu.debug.bind(za,lm),log:Bu.log.bind(za,lm),info:Bu.info.bind(za,lm),warn:Bu.warn.bind(za,lm),error:Bu.error.bind(za,lm)},Wy="https://docs.datadoghq.com",xJ=`${Wy}/real_user_monitoring/browser/troubleshooting`,FC="More details:";function BP(e,t){return(...n)=>{try{return e(...n)}catch(r){mt.error(t,r)}}}function Zl(e){return e!==0&&Math.random()*100<=e}function Mm(e,t){return+e.toFixed(t)}function wJ(e){return wp(e)&&e>=0&&e<=100}function wp(e){return typeof e=="number"}function Ym(e){return{...e}}function Bv(e,t){return Object.keys(e).some(n=>e[n]===t)}function fl(e){return Object.keys(e).length===0}function HP(e,t){const n={};for(const r of Object.keys(e))n[r]=t(e[r]);return n}function go(){if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let e=_dd_temp_;return delete Object.prototype._dd_temp_,typeof e!="object"&&(typeof self=="object"?e=self:typeof window=="object"?e=window:e={}),e}const la=go(),Xy="WorkerGlobalScope"in la;function Qs(e,t){const n=go();let r;return n.Zone&&typeof n.Zone.__symbol__=="function"&&(r=e[n.Zone.__symbol__(t)]),r||(r=e[t]),r}let W_,qP=!1;function SJ(e){W_=e}function _J(e){qP=e}function bt(e){return function(){return Ys(e,this,arguments)}}function Ys(e,t,n){try{return e.apply(t,n)}catch(r){Js(r)}}function Js(e){if(X_(e),W_)try{W_(e)}catch(t){X_(t)}}function X_(...e){qP&&mt.error("[MONITOR]",...e)}function Cr(e,t){return Qs(go(),"setTimeout")(bt(e),t)}function io(e){Qs(go(),"clearTimeout")(e)}function Vd(e,t){return Qs(go(),"setInterval")(bt(e),t)}function Qy(e){Qs(go(),"clearInterval")(e)}function kO(e){var t;const n=(t=la.queueMicrotask)===null||t===void 0?void 0:t.bind(la);typeof n=="function"?n(bt(e)):Promise.resolve().then(bt(e))}class At{constructor(t){this.onFirstSubscribe=t,this.observers=[]}subscribe(t){return this.addObserver(t),{unsubscribe:()=>this.removeObserver(t)}}notify(t){this.observers.forEach(n=>n(t))}addObserver(t){this.observers.push(t),this.observers.length===1&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0)}removeObserver(t){this.observers=this.observers.filter(n=>t!==n),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}function GP(...e){return new At(t=>{const n=e.map(r=>r.subscribe(i=>t.notify(i)));return()=>n.forEach(r=>r.unsubscribe())})}class KP extends At{constructor(t){super(),this.maxBufferSize=t,this.buffer=[]}notify(t){this.buffer.push(t),this.buffer.length>this.maxBufferSize&&this.buffer.shift(),super.notify(t)}subscribe(t){let n=!1;const r={unsubscribe:()=>{n=!0,this.removeObserver(t)}};return kO(()=>{for(const i of this.buffer){if(n)return;t(i)}n||this.addObserver(t)}),r}unbuffer(){kO(()=>{this.maxBufferSize=this.buffer.length=0})}}const Rr=1e3,Fr=60*Rr,ZP=60*Fr,CJ=24*ZP,YP=365*CJ;function Jy(e){return{relative:e,timeStamp:kJ(e)}}function EJ(e){return{relative:VC(e),timeStamp:e}}function kJ(e){const t=Lr()-performance.now();return t>Sp()?Math.round(Bd(t,e)):RJ(e)}function jJ(){return Math.round(Lr()-Bd(Sp(),performance.now()))}function gt(e){return wp(e)?Mm(e*1e6,0):e}function Lr(){return new Date().getTime()}function hr(){return Lr()}function Oi(){return performance.now()}function nr(){return{relative:Oi(),timeStamp:hr()}}function WP(){return{relative:0,timeStamp:Sp()}}function Pn(e,t){return t-e}function Bd(e,t){return e+t}function VC(e){return e-Sp()}function RJ(e){return Math.round(Bd(Sp(),e))}function IJ(e){return e<YP}let rS;function Sp(){var e,t;return rS===void 0&&(rS=(t=(e=performance.timing)===null||e===void 0?void 0:e.navigationStart)!==null&&t!==void 0?t:performance.timeOrigin),rS}function eb(e,t,n){const r=n&&n.leading!==void 0?n.leading:!0,i=n&&n.trailing!==void 0?n.trailing:!0;let o=!1,a,c;return{throttled:(...d)=>{if(o){a=d;return}r?e(...d):a=d,o=!0,c=Cr(()=>{i&&a&&e(...a),o=!1,a=void 0},t)},cancel:()=>{io(c),o=!1,a=void 0}}}function Ht(){}function kr(e){return e?(parseInt(e,10)^Math.random()*16>>parseInt(e,10)/4).toString(16):`10000000-1000-4000-8000-${1e11}`.replace(/[018]/g,kr)}const pd=/([\w-]+)\s*=\s*([^;]+)/g;function Wm(e,t){for(pd.lastIndex=0;;){const n=pd.exec(e);if(n){if(n[1]===t)return n[2]}else break}}function NJ(e){const t=new Map;for(pd.lastIndex=0;;){const n=pd.exec(e);if(n){const r=n[1],i=n[2];t.has(r)?t.get(r).push(i):t.set(r,[i])}else break}return t}function TJ(e){const t=new Map;for(pd.lastIndex=0;;){const n=pd.exec(e);if(n)t.set(n[1],n[2]);else break}return t}function BC(e,t,n=""){const r=e.charCodeAt(t-1),o=r>=55296&&r<=56319?t+1:t;return e.length<=o?e:`${e.slice(0,o)}${n}`}function AJ(){return XP()===0}function pAe(){return XP()===1}let Tg;function XP(){return Tg??(Tg=OJ())}function OJ(e=window){var t;const n=e.navigator.userAgent;return e.chrome||/HeadlessChrome/.test(n)?0:((t=e.navigator.vendor)===null||t===void 0?void 0:t.indexOf("Apple"))===0||/safari/i.test(n)&&!/chrome|android/i.test(n)?1:2}function HC(e){return tb(e,location.href).href}function DJ(e){try{return!!tb(e)}catch{return!1}}function $J(e){const t=tb(e).pathname;return t[0]==="/"?t:`/${t}`}function tb(e,t){const{URL:n}=MJ();try{return t!==void 0?new n(e,t):new n(e)}catch(r){throw new Error(`Failed to construct URL: ${String(r)}`)}}let iS;function MJ(){if(!iS){let e,t;try{e=document.createElement("iframe"),e.style.display="none",document.body.appendChild(e),t=e.contentWindow}catch{t=la}iS={URL:t.URL},e?.remove()}return iS}function nb(e,t,n=0,r){const i=new Date;i.setTime(i.getTime()+n);const o=`expires=${i.toUTCString()}`,a=r&&r.crossSite?"none":"strict",c=r&&r.domain?`;domain=${r.domain}`:"",d=r&&r.secure?";secure":"",f=r&&r.partitioned?";partitioned":"";document.cookie=`${e}=${t};${o};path=/;samesite=${a}${c}${d}${f}`}function rb(e){return Wm(document.cookie,e)}function PJ(e){return NJ(document.cookie).get(e)||[]}let oS;function zs(e){return oS||(oS=TJ(document.cookie)),oS.get(e)}function QP(e,t){nb(e,"",0,t)}function zJ(e){if(document.cookie===void 0||document.cookie===null)return!1;try{const t=`dd_cookie_test_${kr()}`,n="test";nb(t,n,Fr,e);const r=rb(t)===n;return QP(t,e),r}catch(t){return mt.error(t),!1}}let aS;function JP(e=location.hostname,t=document.referrer){if(aS===void 0){const n=LJ(e,t);if(n){const r=`dd_site_test_${kr()}`,i="test",o=n.split(".");let a=o.pop();for(;o.length&&!rb(r);)a=`${o.pop()}.${a}`,nb(r,i,Rr,{domain:a});QP(r,{domain:a}),aS=a}}return aS}function LJ(e,t){try{return e||tb(t).hostname}catch{}}const Ga="_dd_s";function ez(e,t){for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(t(r,n,e))return r}}function tz(e){return Object.values(e)}function qC(e){return Object.entries(e)}const kc=4*ZP,nz=15*Fr,UJ=YP,rz="0",hd={COOKIE:"cookie",LOCAL_STORAGE:"local-storage"},iz=/^([a-zA-Z]+)=([a-z0-9-]+)$/,GC="&";function FJ(e){return!!e&&(e.indexOf(GC)!==-1||iz.test(e))}const VJ="1";function Ul(e,t){const n={isExpired:VJ};return t.trackAnonymousUser&&e?.anonymousId&&(n.anonymousId=e?.anonymousId),n}function vv(e){return fl(e)}function oz(e){return!vv(e)}function Pm(e){return e.isExpired!==void 0||!BJ(e)}function BJ(e){return(e.created===void 0||Lr()-Number(e.created)<kc)&&(e.expire===void 0||Lr()<Number(e.expire))}function az(e){e.expire=String(Lr()+nz)}function Q_(e){return qC(e).map(([t,n])=>t==="anonymousId"?`aid=${n}`:`${t}=${n}`).join(GC)}function ib(e){const t={};return FJ(e)&&e.split(GC).forEach(n=>{const r=iz.exec(n);if(r!==null){const[,i,o]=r;i==="aid"?t.anonymousId=o:t[i]=o}}),t}const HJ="_dd",qJ="_dd_r",GJ="_dd_l",KJ="rum",ZJ="logs";function YJ(e){if(!zs(Ga)){const n=zs(HJ),r=zs(qJ),i=zs(GJ),o={};n&&(o.id=n),i&&/^[01]$/.test(i)&&(o[ZJ]=i),r&&/^[012]$/.test(r)&&(o[KJ]=r),oz(o)&&(az(o),e.persistSession(o))}}const WJ=0;function jO(e){const t=QJ(e);return t&&zJ(t)?{type:hd.COOKIE,cookieOptions:t}:void 0}function XJ(e,t){const n={isLockEnabled:AJ(),persistSession:r=>RO(t,e,r,nz),retrieveSession:()=>sz(t,e),expireSession:r=>RO(t,e,Ul(r,e),kc)};return YJ(n),n}function RO(e,t,n,r){let i=Q_(n);t.betaEncodeCookieOptions&&(i=Q_({...n,...fl(n)?{}:{c:lz(e)}})),nb(Ga,i,t.trackAnonymousUser?UJ:r,e)}function sz(e,t){if(t.betaEncodeCookieOptions)return JJ(e);const n=rb(Ga);return ib(n)}function QJ(e){const t={};if(t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains){const n=JP();if(!n)return;t.domain=n}return t}function lz(e){const t=e.domain?e.domain.split(".").length-1:0;let n=0;return n|=WJ<<5,n|=t<<1,n|=e.crossSite?1:0,n.toString(16)}function JJ(e){const t=PJ(Ga),n=lz(e);let r;for(const i of t.reverse())if(r=ib(i),r.c===n)break;return r==null||delete r.c,r??{}}const eee="_dd_test_";function IO(){try{const e=kr(),t=`${eee}${e}`;localStorage.setItem(t,e);const n=localStorage.getItem(t);return localStorage.removeItem(t),e===n?{type:hd.LOCAL_STORAGE}:void 0}catch{return}}function tee(e){return{isLockEnabled:!1,persistSession:cz,retrieveSession:uz,expireSession:t=>nee(t,e)}}function cz(e){localStorage.setItem(Ga,Q_(e))}function uz(){const e=localStorage.getItem(Ga);return ib(e)}function nee(e,t){cz(Ul(e,t))}const ree=10,iee=100,oee=Rr,dz="--",fz=[];let yv;function Fl(e,t,n=0){var r;const{isLockEnabled:i,persistSession:o,expireSession:a}=t,c=v=>o({...v,lock:f}),d=()=>{const{lock:v,...y}=t.retrieveSession();return{session:y,lock:v&&!see(v)?v:void 0}};if(yv||(yv=e),e!==yv){fz.push(e);return}if(i&&n>=iee){NO(t);return}let f,p=d();if(i){if(p.lock){Ag(e,t,n);return}if(f=aee(),c(p.session),p=d(),p.lock!==f){Ag(e,t,n);return}}let h=e.process(p.session);if(i&&(p=d(),p.lock!==f)){Ag(e,t,n);return}if(h&&(Pm(h)?a(h):(az(h),i?c(h):o(h))),i&&!(h&&Pm(h))){if(p=d(),p.lock!==f){Ag(e,t,n);return}o(p.session),h=p.session}(r=e.after)===null||r===void 0||r.call(e,h||p.session),NO(t)}function Ag(e,t,n){Cr(()=>{Fl(e,t,n+1)},ree)}function NO(e){yv=void 0;const t=fz.shift();t&&Fl(t,e)}function aee(){return kr()+dz+hr()}function see(e){const[,t]=e.split(dz);return!t||Pn(Number(t),hr())>oee}const TO=Rr;function lee(e){switch(e.sessionPersistence){case hd.COOKIE:return jO(e);case hd.LOCAL_STORAGE:return IO();case void 0:{let t=jO(e);return!t&&e.allowFallbackToLocalStorage&&(t=IO()),t}default:mt.error(`Invalid session persistence '${String(e.sessionPersistence)}'`)}}function cee(e,t){return e.type===hd.COOKIE?XJ(t,e.cookieOptions):tee(t)}function uee(e,t,n,r,i=cee(e,t)){const o=new At,a=new At,c=new At,d=Vd(y,TO);let f;S();const{throttled:p,cancel:h}=eb(()=>{Fl({process:N=>{if(vv(N))return;const T=b(N);return C(T),T},after:N=>{oz(N)&&!E()&&I(N),f=N}},i)},TO);function v(){Fl({process:N=>E()?b(N):void 0},i)}function y(){const N=i.retrieveSession();Pm(N)?Fl({process:T=>Pm(T)?Ul(T,t):void 0,after:b},i):b(N)}function b(N){return Pm(N)&&(N=Ul(N,t)),E()&&(k(N)?j():(c.notify({previousState:f,newState:N}),f=N)),N}function S(){Fl({process:N=>{if(vv(N))return N.anonymousId=kr(),Ul(N,t)},after:N=>{f=N}},i)}function C(N){if(vv(N))return!1;const T=r(N[n]);N[n]=T,delete N.isExpired,T!==rz&&!N.id&&(N.id=kr(),N.created=String(Lr()))}function E(){return f?.[n]!==void 0}function k(N){return f.id!==N.id||f[n]!==N[n]}function j(){f=Ul(f,t),a.notify()}function I(N){f=N,o.notify()}function A(N){Fl({process:T=>({...T,...N}),after:b},i)}return{expandOrRenewSession:p,expandSession:v,getSession:()=>f,renewObservable:o,expireObservable:a,sessionStateUpdateObservable:c,restartSession:S,expire:N=>{h(),N===!1&&f&&delete f.anonymousId,i.expireSession(f),b(Ul(f,t))},stop:()=>{Qy(d)},updateSessionState:A}}const J_={GRANTED:"granted",NOT_GRANTED:"not-granted"};function dee(e){const t=new At;return{tryToInit(n){e||(e=n)},update(n){e=n,t.notify()},isGranted(){return e===J_.GRANTED},observable:t}}function jc(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function Xm(e){const t=jc(e);return t==="string"||t==="function"||e instanceof RegExp}function ob(e,t,n=!1){return e.some(r=>{try{if(typeof r=="function")return r(t);if(r instanceof RegExp)return r.test(t);if(typeof r=="string")return n?t.startsWith(r):r===t}catch(i){mt.error(i)}return!1})}const fee=["chrome-extension://","moz-extension://"];function AO(e){return fee.some(t=>e.includes(t))}function mee(e,t=""){if(AO(e))return!1;const r=t.split(`
|
|
31
|
-
`).filter(i=>{const o=i.trim();return o.length&&/^at\s+|@/.test(o)})[1]||"";return AO(r)}const pee="Running the Browser SDK in a Web extension content script is forbidden unless the `allowedTrackingOrigins` option is provided.",hee="SDK initialized on a non-allowed domain.";function gee(e,t,n=typeof location<"u"?location.origin:""){const r=e.allowedTrackingOrigins;if(!r)return mee(n,t)?(mt.error(pee),!1):!0;const i=ob(r,n);return i||mt.error(hee),i}const mz="datad0g.com",vee="dd0g-gov.com",Yl="datadoghq.com",yee="datadoghq.eu",bee="ddog-gov.com",xee="pci.browser-intake-datadoghq.com",wee=["ddsource","dd-api-key","dd-request-id"];function Vl(e,t,n){const r=See(e,t);return{build(i,o){const a=_ee(e,t,i,o,n);return r(a)},trackType:t}}function See(e,t){const n=`/api/v2/${t}`,r=e.proxy;if(typeof r=="string"){const o=HC(r);return a=>`${o}?ddforward=${encodeURIComponent(`${n}?${a}`)}`}if(typeof r=="function")return o=>r({path:n,parameters:o});const i=pz(t,e);return o=>`https://${i}${n}?${o}`}function pz(e,t){const{site:n=Yl,internalAnalyticsSubdomain:r}=t;if(e==="logs"&&t.usePciIntake&&n===Yl)return xee;if(r&&n===Yl)return`${r}.${Yl}`;if(n===vee)return`http-intake.logs.${n}`;const i=n.split("."),o=i.pop();return`browser-intake-${i.join("-")}.${o}`}function _ee({clientToken:e,internalAnalyticsSubdomain:t,source:n="browser"},r,i,{retry:o,encoding:a},c=[]){const d=[`ddsource=${n}`,`dd-api-key=${e}`,`dd-evp-origin-version=${encodeURIComponent("6.24.1")}`,"dd-evp-origin=browser",`dd-request-id=${kr()}`].concat(c);return a&&d.push(`dd-evp-encoding=${a}`),r==="rum"&&(d.push(`batch_time=${hr()}`,`_dd.api=${i}`),o&&d.push(`_dd.retry_count=${o.count}`,`_dd.retry_after=${o.lastFailureStatus}`)),t&&d.reverse(),d.join("&")}function Cee(e){const t=e.site||Yl,n=Eee(e.source),r=kee({...e,site:t,source:n});return{replica:jee({...e,site:t,source:n}),site:t,source:n,...r}}function Eee(e){return e==="flutter"||e==="unity"?e:"browser"}function kee(e){return{logsEndpointBuilder:Vl(e,"logs"),rumEndpointBuilder:Vl(e,"rum"),profilingEndpointBuilder:Vl(e,"profile"),sessionReplayEndpointBuilder:Vl(e,"replay"),exposuresEndpointBuilder:Vl(e,"exposures")}}function jee(e){if(!e.replica)return;const t={...e,site:Yl,clientToken:e.replica.clientToken};return{logsEndpointBuilder:Vl(t,"logs"),rumEndpointBuilder:Vl(t,"rum",[`application.id=${e.replica.applicationId}`])}}function Ree(e){return wee.every(t=>e.includes(t))}const Gu={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input",MASK_UNLESS_ALLOWLISTED:"mask-unless-allowlisted"},e1={ALL:"all",SAMPLED:"sampled"};function sS(e,t){return e!=null&&typeof e!="string"?(mt.error(`${t} must be defined as a string`),!1):!0}function Iee(e){return e&&typeof e=="string"&&!/(datadog|ddog|datad0g|dd0g)/.test(e)?(mt.error(`Site should be a valid Datadog site. ${FC} ${Wy}/getting_started/site/.`),!1):!0}function Ku(e,t){return e!==void 0&&!wJ(e)?(mt.error(`${t} Sample Rate should be a number between 0 and 100`),!1):!0}function Nee(e,t){var n,r,i,o,a,c,d,f,p,h;if(!e||!e.clientToken){mt.error("Client Token is not configured, we will not send any data.");return}if(e.allowedTrackingOrigins!==void 0&&!Array.isArray(e.allowedTrackingOrigins)){mt.error("Allowed Tracking Origins must be an array");return}if(!(!Iee(e.site)||!Ku(e.sessionSampleRate,"Session")||!Ku(e.telemetrySampleRate,"Telemetry")||!Ku(e.telemetryConfigurationSampleRate,"Telemetry Configuration")||!Ku(e.telemetryUsageSampleRate,"Telemetry Usage")||!sS(e.version,"Version")||!sS(e.env,"Env")||!sS(e.service,"Service")||!gee(e,t??""))){if(e.trackingConsent!==void 0&&!Bv(J_,e.trackingConsent)){mt.error('Tracking Consent should be either "granted" or "not-granted"');return}return{beforeSend:e.beforeSend&&BP(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Xy?void 0:lee(e),sessionSampleRate:(n=e.sessionSampleRate)!==null&&n!==void 0?n:100,telemetrySampleRate:(r=e.telemetrySampleRate)!==null&&r!==void 0?r:20,telemetryConfigurationSampleRate:(i=e.telemetryConfigurationSampleRate)!==null&&i!==void 0?i:5,telemetryUsageSampleRate:(o=e.telemetryUsageSampleRate)!==null&&o!==void 0?o:5,service:(a=e.service)!==null&&a!==void 0?a:void 0,env:(c=e.env)!==null&&c!==void 0?c:void 0,version:(d=e.version)!==null&&d!==void 0?d:void 0,datacenter:(f=e.datacenter)!==null&&f!==void 0?f:void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:(p=e.trackingConsent)!==null&&p!==void 0?p:J_.GRANTED,trackAnonymousUser:(h=e.trackAnonymousUser)!==null&&h!==void 0?h:!0,storeContextsAcrossPages:!!e.storeContextsAcrossPages,betaEncodeCookieOptions:!!e.betaEncodeCookieOptions,variant:e.variant,sdkVersion:e.sdkVersion,...Cee(e)}}}function Tee(e){return{session_sample_rate:e.sessionSampleRate,telemetry_sample_rate:e.telemetrySampleRate,telemetry_configuration_sample_rate:e.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:e.telemetryUsageSampleRate,use_before_send:!!e.beforeSend,use_partitioned_cross_site_session_cookie:e.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:e.useSecureSessionCookie,use_proxy:!!e.proxy,silent_multiple_init:e.silentMultipleInit,track_session_across_subdomains:e.trackSessionAcrossSubdomains,track_anonymous_user:e.trackAnonymousUser,session_persistence:e.sessionPersistence,allow_fallback_to_local_storage:!!e.allowFallbackToLocalStorage,store_contexts_across_pages:!!e.storeContextsAcrossPages,allow_untrusted_events:!!e.allowUntrustedEvents,tracking_consent:e.trackingConsent,use_allowed_tracking_origins:Array.isArray(e.allowedTrackingOrigins),beta_encode_cookie_options:e.betaEncodeCookieOptions,source:e.source,sdk_version:e.sdkVersion,variant:e.variant}}var el;(function(e){e.TRACK_INTAKE_REQUESTS="track_intake_requests",e.USE_TREE_WALKER_FOR_ACTION_NAME="use_tree_walker_for_action_name",e.FEATURE_OPERATION_VITAL="feature_operation_vital",e.SHORT_SESSION_INVESTIGATION="short_session_investigation",e.AVOID_FETCH_KEEPALIVE="avoid_fetch_keepalive"})(el||(el={}));const KC=new Set;function Aee(e){Array.isArray(e)&&Oee(e.filter(t=>Bv(el,t)))}function Oee(e){e.forEach(t=>{KC.add(t)})}function _p(e){return KC.has(e)}function Dee(){return KC}const gd="?";function Cp(e){var t,n;const r=[];let i=lS(e,"stack");const o=String(e);if(i&&i.startsWith(o)&&(i=i.slice(o.length)),i&&i.split(`
|
|
32
|
-
`).forEach(a=>{const c=Pee(a)||Lee(a)||Fee(a)||Hee(a);c&&(!c.func&&c.line&&(c.func=gd),r.push(c))}),r.length>0&&Zee()&&e instanceof Error){const a=[];let c=e;for(;(c=Object.getPrototypeOf(c))&&gz(c);){const d=((t=c.constructor)===null||t===void 0?void 0:t.name)||gd;a.push(d)}for(let d=a.length-1;d>=0&&((n=r[0])===null||n===void 0?void 0:n.func)===a[d];d--)r.shift()}return{message:lS(e,"message"),name:lS(e,"name"),stack:r}}const hz="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",vd="(?::(\\d+))",$ee=new RegExp(`^\\s*at (.*?) ?\\(${hz}${vd}?${vd}?\\)?\\s*$`,"i"),Mee=new RegExp(`\\((\\S*)${vd}${vd}\\)`);function Pee(e){const t=$ee.exec(e);if(!t)return;const n=t[2]&&t[2].indexOf("native")===0,r=t[2]&&t[2].indexOf("eval")===0,i=Mee.exec(t[2]);return r&&i&&(t[2]=i[1],t[3]=i[2],t[4]=i[3]),{args:n?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||gd,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}const zee=new RegExp(`^\\s*at ?${hz}${vd}?${vd}??\\s*$`,"i");function Lee(e){const t=zee.exec(e);if(t)return{args:[],column:t[3]?+t[3]:void 0,func:gd,line:t[2]?+t[2]:void 0,url:t[1]}}const Uee=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Fee(e){const t=Uee.exec(e);if(t)return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||gd,line:+t[3],url:t[2]}}const Vee=/^\s*(.*?)(?:\((.*?)\))?(?:(?:(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle|\[wasm code\])(?::(\d+))?(?::(\d+))?)|@)\s*$/i,Bee=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Hee(e){const t=Vee.exec(e);if(!t)return;const n=t[3]&&t[3].indexOf(" > eval")>-1,r=Bee.exec(t[3]);return n&&r&&(t[3]=r[1],t[4]=r[2],t[5]=void 0),{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||gd,line:t[4]?+t[4]:void 0,url:t[3]}}function lS(e,t){if(typeof e!="object"||!e||!(t in e))return;const n=e[t];return typeof n=="string"?n:void 0}function qee(e,t,n,r){if(t===void 0)return;const{name:i,message:o}=Kee(e);return{name:i,message:o,stack:[{url:t,column:r,line:n}]}}const Gee=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function Kee(e){let t,n;return{}.toString.call(e)==="[object String]"&&([,t,n]=Gee.exec(e)),{name:t,message:n}}function gz(e){return String(e.constructor).startsWith("class ")}let Og;function Zee(){if(Og!==void 0)return Og;class e extends Error{constructor(){super(),this.name="Error"}}const[t,n]=[e,Error].map(r=>new r);return Og=gz(Object.getPrototypeOf(t))&&n.stack!==t.stack,Og}function Qm(e){const n=new Error(e);n.name="HandlingStack";let r;return Ys(()=>{const i=Cp(n);i.stack=i.stack.slice(2),r=Ep(i)}),r}function Ep(e){let t=vz(e);return e.stack.forEach(n=>{const r=n.func==="?"?"<anonymous>":n.func,i=n.args&&n.args.length>0?`(${n.args.join(", ")})`:"",o=n.line?`:${n.line}`:"",a=n.line&&n.column?`:${n.column}`:"";t+=`
|
|
33
|
-
at ${r}${i} @ ${n.url}${o}${a}`}),t}function vz(e){return`${e.name||"Error"}: ${e.message}`}function ra(e,t,n,{computeHandlingStack:r}={}){let i=e[t];if(typeof i!="function")if(t in e&&t.startsWith("on"))i=Ht;else return{stop:Ht};let o=!1;const a=function(){if(o)return i.apply(this,arguments);const c=Array.from(arguments);let d;Ys(n,null,[{target:this,parameters:c,onPostCall:p=>{d=p},handlingStack:r?Qm("instrumented method"):void 0}]);const f=i.apply(this,c);return d&&Ys(d,null,[f]),f};return e[t]=a,{stop:()=>{o=!0,e[t]===a&&(e[t]=i)}}}function hAe(e,t,n){const r=Object.getOwnPropertyDescriptor(e,t);if(!r||!r.set||!r.configurable)return{stop:Ht};const i=Ht;let o=(c,d)=>{Cr(()=>{o!==i&&n(c,d)},0)};const a=function(c){r.set.call(this,c),o(this,c)};return Object.defineProperty(e,t,{set:a}),{stop:()=>{var c;((c=Object.getOwnPropertyDescriptor(e,t))===null||c===void 0?void 0:c.set)===a&&Object.defineProperty(e,t,r),o=i}}}const Rc=1024,yz=1024*Rc,Yee=/[^\u0000-\u007F]/;function bz(e){return Yee.test(e)?window.TextEncoder!==void 0?new TextEncoder().encode(e).length:new Blob([e]).size:e.length}function xz(e){if(e.length===1)return e[0];const t=e.reduce((i,o)=>i+o.length,0),n=new Uint8Array(t);let r=0;for(const i of e)n.set(i,r),r+=i.length;return n}function kp(e,t,n){if(typeof e!="object"||e===null)return JSON.stringify(e);const r=Zu(Object.prototype),i=Zu(Array.prototype),o=Zu(Object.getPrototypeOf(e)),a=Zu(e);try{return JSON.stringify(e,t,n)}catch{return"<error: unable to serialize object>"}finally{r(),i(),o(),a()}}function Zu(e){const t=e,n=t.toJSON;return n?(delete t.toJSON,()=>{t.toJSON=n}):Ht}const Wee=220*Rc,Xee="$",Qee=3;function fn(e,t=Wee){const n=Zu(Object.prototype),r=Zu(Array.prototype),i=[],o=new WeakMap,a=cS(e,Xee,void 0,i,o),c=JSON.stringify(a);let d=c?c.length:0;if(d>t){uS(t,"discarded",e);return}for(;i.length>0&&d<t;){const f=i.shift();let p=0;if(Array.isArray(f.source))for(let h=0;h<f.source.length;h++){const v=cS(f.source[h],f.path,h,i,o);if(v!==void 0?d+=JSON.stringify(v).length:d+=4,d+=p,p=1,d>t){uS(t,"truncated",e);break}f.target[h]=v}else for(const h in f.source)if(Object.prototype.hasOwnProperty.call(f.source,h)){const v=cS(f.source[h],f.path,h,i,o);if(v!==void 0&&(d+=JSON.stringify(v).length+p+h.length+Qee,p=1),d>t){uS(t,"truncated",e);break}f.target[h]=v}}return n(),r(),a}function cS(e,t,n,r,i){const o=tte(e);if(!o||typeof o!="object")return Jee(o);const a=t1(o);if(a!=="[Object]"&&a!=="[Array]"&&a!=="[Error]")return a;const c=e;if(i.has(c))return`[Reference seen at ${i.get(c)}]`;const d=n!==void 0?`${t}.${n}`:t,f=Array.isArray(o)?[]:{};return i.set(c,d),r.push({source:o,target:f,path:d}),f}function Jee(e){return typeof e=="bigint"?`[BigInt] ${e.toString()}`:typeof e=="function"?`[Function] ${e.name||"unknown"}`:typeof e=="symbol"?`[Symbol] ${e.description||e.toString()}`:e}function t1(e){try{if(e instanceof Event)return ete(e);if(e instanceof RegExp)return`[RegExp] ${e.toString()}`;const n=Object.prototype.toString.call(e).match(/\[object (.*)\]/);if(n&&n[1])return`[${n[1]}]`}catch{}return"[Unserializable]"}function ete(e){return{type:e.type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?t1(e.currentTarget):null,target:e.target?t1(e.target):null}}function tte(e){const t=e;if(t&&typeof t.toJSON=="function")try{return t.toJSON()}catch{}return e}function uS(e,t,n){mt.warn(`The data provided has been ${t} as it is over the limit of ${e} characters:`,n)}const wz="No stack, consider using an instance of Error";function ZC({stackTrace:e,originalError:t,handlingStack:n,componentStack:r,startClocks:i,nonErrorPrefix:o,useFallbackStack:a=!0,source:c,handling:d}){const f=Ic(t);return!e&&f&&(e=Cp(t)),{startClocks:i,source:c,handling:d,handlingStack:n,componentStack:r,originalError:t,type:e?e.name:void 0,message:nte(e,f,o,t),stack:e?Ep(e):a?wz:void 0,causes:f?ote(t,c):void 0,fingerprint:rte(t),context:ite(t)}}function nte(e,t,n,r){return e?.message&&e?.name?e.message:t?"Empty message":`${n} ${kp(fn(r))}`}function rte(e){return Ic(e)&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function ite(e){if(e!==null&&typeof e=="object"&&"dd_context"in e)return e.dd_context}function Ic(e){return e instanceof Error||Object.prototype.toString.call(e)==="[object Error]"}function ote(e,t){let n=e;const r=[];for(;Ic(n?.cause)&&r.length<10;){const i=Cp(n.cause);r.push({message:n.cause.message,source:t,type:i?.name,stack:i&&Ep(i)}),n=n.cause}return r.length?r:void 0}const Hd={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};function ate(){return new At(e=>{const t=(i,o)=>{const a=ZC({stackTrace:o,originalError:i,startClocks:nr(),nonErrorPrefix:"Uncaught",source:Hd.SOURCE,handling:"unhandled"});e.notify(a)},{stop:n}=ste(t),{stop:r}=lte(t);return()=>{n(),r()}})}function ste(e){return ra(go(),"onerror",({parameters:[t,n,r,i,o]})=>{let a;Ic(o)||(a=qee(t,n,r,i)),e(o??t,a)})}function lte(e){return ra(go(),"onunhandledrejection",({parameters:[t]})=>{e(t.reason||"Empty reason")})}function cte(e){const t={version:"6.24.1",onReady(n){n()},...e};return Object.defineProperty(t,"_setDebug",{get(){return _J},enumerable:!1}),t}function ute(e,t,n){const r=e[t];r&&!r.q&&r.version&&mt.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),e[t]=n,r&&r.q&&r.q.forEach(i=>BP(i,"onReady callback threw an error:")())}function Sz(e,t){t.silentMultipleInit||mt.error(`${e} is already initialized.`)}function Cn(e,t,n,r,i){return tl(e,t,[n],r,i)}function tl(e,t,n,r,{once:i,capture:o,passive:a}={}){const c=bt(v=>{!v.isTrusted&&!v.__ddIsTrusted&&!e.allowUntrustedEvents||(i&&h(),r(v))}),d=a?{capture:o,passive:a}:o,f=window.EventTarget&&t instanceof EventTarget?window.EventTarget.prototype:t,p=Qs(f,"addEventListener");n.forEach(v=>p.call(t,v,c,d));function h(){const v=Qs(f,"removeEventListener");n.forEach(y=>v.call(t,y,c,d))}return{stop:h}}const Jm={intervention:"intervention",cspViolation:"csp_violation"};function dte(e,t){const n=[];t.includes(Jm.cspViolation)&&n.push(mte(e));const r=t.filter(i=>i!==Jm.cspViolation);return r.length&&n.push(fte(r)),GP(...n)}function fte(e){return new At(t=>{if(!window.ReportingObserver)return;const n=bt((i,o)=>i.forEach(a=>t.notify(pte(a)))),r=new window.ReportingObserver(n,{types:e,buffered:!0});return r.observe(),()=>{r.disconnect()}})}function mte(e){return new At(t=>{const{stop:n}=Cn(e,document,"securitypolicyviolation",r=>{t.notify(hte(r))});return n})}function pte(e){const{type:t,body:n}=e;return _z({type:n.id,message:`${t}: ${n.message}`,originalError:e,stack:Cz(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}function hte(e){const t=`'${e.blockedURI}' blocked by '${e.effectiveDirective}' directive`;return _z({type:e.effectiveDirective,message:`${Jm.cspViolation}: ${t}`,originalError:e,csp:{disposition:e.disposition},stack:Cz(e.effectiveDirective,e.originalPolicy?`${t} of the policy "${BC(e.originalPolicy,100,"...")}"`:"no policy",e.sourceFile,e.lineNumber,e.columnNumber)})}function _z(e){return{startClocks:nr(),source:Hd.REPORT,handling:"unhandled",...e}}function Cz(e,t,n,r,i){return n?Ep({name:e,message:t,stack:[{func:"?",url:n,line:r??void 0,column:i??void 0}]}):void 0}const gte=200;function Ez(e){const{env:t,service:n,version:r,datacenter:i,sdkVersion:o,variant:a}=e,c=[Tu("sdk_version",o??"6.24.1")];return t&&c.push(Tu("env",t)),n&&c.push(Tu("service",n)),r&&c.push(Tu("version",r)),i&&c.push(Tu("datacenter",i)),a&&c.push(Tu("variant",a)),c}function Tu(e,t){const n=t?`${e}:${t}`:e;return(n.length>gte||yte(n))&&mt.warn(`Tag ${n} doesn't meet tag requirements and will be sanitized. ${FC} ${Wy}/getting_started/tagging/#defining-tags`),vte(n)}function vte(e){return e.replace(/,/g,"_")}function yte(e){return bte()?new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(e):!1}function bte(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch{return!1}}function kz(e,t){const n=la.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}function Hv(e,t,n=xte()){if(t===void 0)return e;if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const i=t.flags||[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.sticky?"y":"",t.unicode?"u":""].join("");return new RegExp(t.source,i)}if(n.hasAlreadyBeenSeen(t))return;if(Array.isArray(t)){const i=Array.isArray(e)?e:[];for(let o=0;o<t.length;++o)i[o]=Hv(i[o],t[o],n);return i}const r=jc(e)==="object"?e:{};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=Hv(r[i],t[i],n));return r}function YC(e){return Hv(void 0,e)}function Ka(...e){let t;for(const n of e)n!=null&&(t=Hv(t,n));return t}function xte(){if(typeof WeakSet<"u"){const t=new WeakSet;return{hasAlreadyBeenSeen(n){const r=t.has(n);return r||t.add(n),r}}}const e=[];return{hasAlreadyBeenSeen(t){const n=e.indexOf(t)>=0;return n||e.push(t),n}}}function jz(){var e;const t=la.navigator;return{status:t.onLine?"connected":"not_connected",interfaces:t.connection&&t.connection.type?[t.connection.type]:void 0,effective_type:(e=t.connection)===null||e===void 0?void 0:e.effectiveType}}function wte(e){return e>=500}function Ste(e){try{return e.clone()}catch{return}}const _te=80*Rc,Cte=32,Rz=20*yz,Ete=Fr,Iz=Rr;function Nz(e,t,n,r,i,o){t.transportStatus===0&&t.queuedPayloads.size()===0&&t.bandwidthMonitor.canHandle(e)?Az(e,t,n,o,{onSuccess:()=>Oz(0,t,n,r,i,o),onFailure:()=>{t.queuedPayloads.enqueue(e)||o.notify({type:"queue-full",bandwidth:t.bandwidthMonitor.stats(),payload:e}),Tz(t,n,r,i,o)}}):t.queuedPayloads.enqueue(e)||o.notify({type:"queue-full",bandwidth:t.bandwidthMonitor.stats(),payload:e})}function Tz(e,t,n,r,i){e.transportStatus===2&&Cr(()=>{const o=e.queuedPayloads.first();Az(o,e,t,i,{onSuccess:()=>{e.queuedPayloads.dequeue(),e.currentBackoffTime=Iz,Oz(1,e,t,n,r,i)},onFailure:()=>{e.currentBackoffTime=Math.min(Ete,e.currentBackoffTime*2),Tz(e,t,n,r,i)}})},e.currentBackoffTime)}function Az(e,t,n,r,{onSuccess:i,onFailure:o}){t.bandwidthMonitor.add(e),n(e,a=>{t.bandwidthMonitor.remove(e),kte(a)?(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:a.status},r.notify({type:"failure",bandwidth:t.bandwidthMonitor.stats(),payload:e}),o()):(t.transportStatus=0,r.notify({type:"success",bandwidth:t.bandwidthMonitor.stats(),payload:e}),i())})}function Oz(e,t,n,r,i,o){e===0&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(i({message:`Reached max ${r} events size queued for upload: ${Rz/yz}MiB`,source:Hd.AGENT,startClocks:nr()}),t.queueFullReported=!0);const a=t.queuedPayloads;for(t.queuedPayloads=Dz();a.size()>0;)Nz(a.dequeue(),t,n,r,i,o)}function kte(e){return e.type!=="opaque"&&(e.status===0&&!navigator.onLine||e.status===408||e.status===429||wte(e.status))}function jte(){return{transportStatus:0,currentBackoffTime:Iz,bandwidthMonitor:Rte(),queuedPayloads:Dz(),queueFullReported:!1}}function Dz(){const e=[];return{bytesCount:0,enqueue(t){return this.isFull()?!1:(e.push(t),this.bytesCount+=t.bytesCount,!0)},first(){return e[0]},dequeue(){const t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size(){return e.length},isFull(){return this.bytesCount>=Rz}}}function Rte(){return{ongoingRequestCount:0,ongoingByteCount:0,canHandle(e){return this.ongoingRequestCount===0||this.ongoingByteCount+e.bytesCount<=_te&&this.ongoingRequestCount<Cte},add(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount},stats(){return{ongoingByteCount:this.ongoingByteCount,ongoingRequestCount:this.ongoingRequestCount}}}}const n1=16*Rc;function $z(e,t,n=n1){const r=new At,i=jte();return{observable:r,send:o=>{for(const a of e)Nz(o,i,(c,d)=>{_p(el.AVOID_FETCH_KEEPALIVE)?qv(a,c,d):Tte(a,n,c,d)},a.trackType,t,r)},sendOnExit:o=>{for(const a of e)Ite(a,n,o)}}}function Ite(e,t,n){if(!!navigator.sendBeacon&&n.bytesCount<t)try{const i=e.build("beacon",n);if(navigator.sendBeacon(i,n.data))return}catch(i){Nte(i)}qv(e,n)}let OO=!1;function Nte(e){OO||(OO=!0,Js(e))}function Tte(e,t,n,r){if(Ate()&&n.bytesCount<t){const o=e.build("fetch-keepalive",n);fetch(o,{method:"POST",body:n.data,keepalive:!0,mode:"cors"}).then(bt(a=>r?.({status:a.status,type:a.type}))).catch(bt(()=>qv(e,n,r)))}else qv(e,n,r)}function qv(e,t,n){const r=e.build("fetch",t);fetch(r,{method:"POST",body:t.data,mode:"cors"}).then(bt(i=>n?.({status:i.status,type:i.type}))).catch(bt(()=>n?.({status:0})))}function Ate(){try{return window.Request&&"keepalive"in new Request("http://a")}catch{return!1}}function jp(){const e=Ote();if(e)return{getCapabilities(){var t;return JSON.parse(((t=e.getCapabilities)===null||t===void 0?void 0:t.call(e))||"[]")},getPrivacyLevel(){var t;return(t=e.getPrivacyLevel)===null||t===void 0?void 0:t.call(e)},getAllowedWebViewHosts(){return JSON.parse(e.getAllowedWebViewHosts())},send(t,n,r){const i=r?{id:r}:void 0;e.send(JSON.stringify({eventType:t,event:n,view:i}))}}}function Mz(e){const t=jp();return!!t&&t.getCapabilities().includes(e)}function yd(e){var t;e===void 0&&(e=(t=go().location)===null||t===void 0?void 0:t.hostname);const n=jp();return!!n&&n.getAllowedWebViewHosts().some(r=>e===r||e.endsWith(`.${r}`))}function Ote(){return go().DatadogEventBridge}const td={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function Dte(e){return new At(t=>{const{stop:n}=tl(e,window,["visibilitychange","freeze"],i=>{i.type==="visibilitychange"&&document.visibilityState==="hidden"?t.notify({reason:td.HIDDEN}):i.type==="freeze"&&t.notify({reason:td.FROZEN})},{capture:!0}),r=Cn(e,window,"beforeunload",()=>{t.notify({reason:td.UNLOADING})}).stop;return()=>{n(),r()}})}function $te(e){return tz(td).includes(e)}const DO=256*Rc;function Pz({encoder:e,request:t,flushController:n}){let r={};const i=n.flushObservable.subscribe(p=>f(p));function o(p,h,v){n.notifyBeforeAddMessage(h),v!==void 0?(r[v]=p,n.notifyAfterAddMessage()):e.write(e.isEmpty?p:`
|
|
34
|
-
${p}`,y=>{n.notifyAfterAddMessage(y-h)})}function a(p){return p!==void 0&&r[p]!==void 0}function c(p){const h=r[p];delete r[p];const v=e.estimateEncodedBytesCount(h);n.notifyAfterRemoveMessage(v)}function d(p,h){const v=kp(p),y=e.estimateEncodedBytesCount(v);if(y>=DO){mt.warn(`Discarded a message whose size was bigger than the maximum allowed size ${DO/Rc}KiB. ${FC} ${xJ}/#technical-limitations`);return}a(h)&&c(h),o(v,y,h)}function f(p){const h=tz(r).join(`
|
|
35
|
-
`);r={};const v=$te(p.reason),y=v?t.sendOnExit:t.send;if(v&&e.isAsync){const b=e.finishSync();b.outputBytesCount&&y($O(b));const S=[b.pendingData,h].filter(Boolean).join(`
|
|
36
|
-
`);S&&y({data:S,bytesCount:bz(S)})}else h&&e.write(e.isEmpty?h:`
|
|
37
|
-
${h}`),e.finish(b=>{y($O(b))})}return{flushController:n,add:d,upsert:d,stop:i.unsubscribe}}function $O(e){let t;return typeof e.output=="string"?t=e.output:t=new Blob([e.output],{type:"text/plain"}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}const Mte=30*Rr,Pte=Xy?1:50;function zz({pageMayExitObservable:e,sessionExpireObservable:t}){const n=e.subscribe(h=>c(h.reason)),r=t.subscribe(()=>c("session_expire")),i=new At(()=>()=>{n.unsubscribe(),r.unsubscribe()});let o=0,a=0;function c(h){if(a===0)return;const v=a,y=o;a=0,o=0,p(),i.notify({reason:h,messagesCount:v,bytesCount:y})}let d;function f(){d===void 0&&(d=Cr(()=>{c("duration_limit")},Mte))}function p(){io(d),d=void 0}return{flushObservable:i,get messagesCount(){return a},notifyBeforeAddMessage(h){o+h>=n1&&c("bytes_limit"),a+=1,o+=h,f()},notifyAfterAddMessage(h=0){o+=h,a>=Pte?c("messages_limit"):o>=n1&&c("bytes_limit")},notifyAfterRemoveMessage(h){o-=h,a-=1,a===0&&p()}}}const nl="DISCARDED",Di="SKIPPED";function zte(){const e={};return{register(t,n){return e[t]||(e[t]=[]),e[t].push(n),{unregister:()=>{e[t]=e[t].filter(r=>r!==n)}}},triggerHook(t,n){const r=e[t]||[],i=[];for(const o of r){const a=o(n);if(a===nl)return nl;a!==Di&&i.push(a)}return Ka(...i)}}}const Ws={LOG:"log",CONFIGURATION:"configuration",USAGE:"usage"},Lte=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],Ute=1,Fte=[bee],Vte=15;let dS;function qd(){return dS||(dS=new KP(100)),dS}function Bte(e,t,n,r,i,o){const a=new At,{stop:c}=qte(t,r,i,o,a),{enabled:d,metricsEnabled:f}=Hte(e,t,n,a);return{stop:c,enabled:d,metricsEnabled:f}}function Hte(e,t,n,r,i=Ute,o=Vte){const a={},c=!Fte.includes(t.site)&&Zl(t.telemetrySampleRate),d={[Ws.LOG]:c,[Ws.CONFIGURATION]:c&&Zl(t.telemetryConfigurationSampleRate),[Ws.USAGE]:c&&Zl(t.telemetryUsageSampleRate),metric:c&&Zl(i)},f=Gte(),p=qd();return p.subscribe(({rawEvent:v,metricName:y})=>{if(y&&!d.metric||!d[v.type])return;const b=y||v.status||v.type;let S=a[b];if(S||(S=a[b]=new Set),S.size>=o)return;const C=kp(v);if(S.has(C))return;const E=n.triggerHook(1,{startTime:nr().relative});if(E===nl)return;const k=h(E,e,v,f);r.notify(k),kz("telemetry",k),S.add(C)}),p.unbuffer(),SJ(WC),{enabled:c,metricsEnabled:d.metric};function h(v,y,b,S){const E={type:"telemetry",date:nr().timeStamp,service:y,version:"6.24.1",source:"browser",_dd:{format_version:2},telemetry:Ka(b,{runtime_env:S,connectivity:jz(),sdk_setup:"npm"}),ddtags:Ez(t).join(","),experimental_features:Array.from(Dee())};return Ka(E,v)}}function qte(e,t,n,r,i){const o=[];if(yd()){const a=jp(),c=i.subscribe(d=>a.send("internal_telemetry",d));o.push(c.unsubscribe)}else{const a=[e.rumEndpointBuilder];e.replica&&Kte(e)&&a.push(e.replica.rumEndpointBuilder);const c=Pz({encoder:r(4),request:$z(a,t),flushController:zz({pageMayExitObservable:n,sessionExpireObservable:new At})});o.push(c.stop);const d=i.subscribe(c.add);o.push(d.unsubscribe)}return{stop:()=>o.forEach(a=>a())}}function Gte(){var e;return{is_local_file:((e=la.location)===null||e===void 0?void 0:e.protocol)==="file:",is_worker:Xy}}function Kte(e){return e.site===mz}function Rp(e,t){X_(Yy.debug,e,t),qd().notify({rawEvent:{type:Ws.LOG,message:e,status:"debug",...t}})}function WC(e,t){qd().notify({rawEvent:{type:Ws.LOG,status:"error",...Yte(e),...t}})}function Zte(e){qd().notify({rawEvent:{type:Ws.CONFIGURATION,configuration:e}})}function ab(e,t){qd().notify({rawEvent:{type:Ws.LOG,message:e,status:"debug",...t},metricName:e})}function sr(e){qd().notify({rawEvent:{type:Ws.USAGE,usage:e}})}function Yte(e){if(Ic(e)){const t=Cp(e);return{error:{kind:t.name,stack:Ep(Wte(t))},message:t.message}}return{error:{stack:wz},message:`Uncaught ${kp(e)}`}}function Wte(e){return e.stack=e.stack.filter(t=>!t.url||Lte.some(n=>t.url.startsWith(n))),e}function Lz(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}function oc(e){return Array.isArray(e)&&e.length>0}const Dg=1/0,Xte=Fr;let cm=null;const bv=new Set;function Qte(){bv.forEach(e=>e())}function Gd({expireDelay:e,maxEntries:t}){let n=[];cm||(cm=Vd(()=>Qte(),Xte));const r=()=>{const p=Oi()-e;for(;n.length>0&&n[n.length-1].endTime<p;)n.pop()};bv.add(r);function i(p,h){const v={value:p,startTime:h,endTime:Dg,remove:()=>{Lz(n,v)},close:y=>{v.endTime=y}};return t&&n.length>=t&&n.pop(),n.unshift(v),v}function o(p=Dg,h={returnInactive:!1}){for(const v of n)if(v.startTime<=p){if(h.returnInactive||p<=v.endTime)return v.value;break}}function a(p){const h=n[0];h&&h.endTime===Dg&&h.close(p)}function c(p=Dg,h=0){const v=Bd(p,h);return n.filter(y=>y.startTime<=v&&p<=y.endTime).map(y=>y.value)}function d(){n=[]}function f(){bv.delete(r),bv.size===0&&cm&&(Qy(cm),cm=null)}return{add:i,find:o,closeActive:a,findAll:c,reset:d,stop:f}}const Jte="datadog-synthetics-public-id",ene="datadog-synthetics-result-id",tne="datadog-synthetics-injects-rum";function Uz(){return Xy?!1:!!(la._DATADOG_SYNTHETICS_INJECTS_RUM||zs(tne))}function Fz(){const e=window._DATADOG_SYNTHETICS_PUBLIC_ID||zs(Jte);return typeof e=="string"?e:void 0}function Vz(){const e=window._DATADOG_SYNTHETICS_RESULT_ID||zs(ene);return typeof e=="string"?e:void 0}function Bz(){return!!(Fz()&&Vz())}const nne=Fr,rne=kc;function ine(e,t,n,r){const i=new At,o=new At,a=uee(e.sessionStoreStrategyType,e,t,n),c=Gd({expireDelay:rne});if(a.renewObservable.subscribe(()=>{c.add(d(),Oi()),i.notify()}),a.expireObservable.subscribe(()=>{o.notify(),c.closeActive(Oi())}),a.expandOrRenewSession(),c.add(d(),WP().relative),_p(el.SHORT_SESSION_INVESTIGATION)){const f=a.getSession();f&&cne(e,f)}r.observable.subscribe(()=>{r.isGranted()?a.expandOrRenewSession():a.expire(!1)}),one(e,()=>{r.isGranted()&&a.expandOrRenewSession()}),ane(e,()=>a.expandSession()),sne(e,()=>a.restartSession());function d(){const f=a.getSession();return f?{id:f.id,trackingType:f[t],isReplayForced:!!f.forcedReplay,anonymousId:f.anonymousId}:(lne(e).catch(()=>{}),{id:"invalid",trackingType:rz,isReplayForced:!1,anonymousId:void 0})}return{findSession:(f,p)=>c.find(f,p),renewObservable:i,expireObservable:o,sessionStateUpdateObservable:a.sessionStateUpdateObservable,expire:a.expire,updateSessionState:a.updateSessionState}}function one(e,t){const{stop:n}=tl(e,window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0})}function ane(e,t){const n=()=>{document.visibilityState==="visible"&&t()},{stop:r}=Cn(e,document,"visibilitychange",n);Vd(n,nne)}function sne(e,t){const{stop:n}=Cn(e,window,"resume",t,{capture:!0})}async function lne(e){const t=e.sessionStoreStrategyType;if(!t)return;let n,r;t.type===hd.COOKIE?(n=sz(t.cookieOptions,e),r={cookie:await Hz(),currentDomain:`${window.location.protocol}//${window.location.hostname}`}):n=uz(),Rp("Unexpected session state",{sessionStoreStrategyType:t.type,session:n,isSyntheticsTest:Bz(),createdTimestamp:n?.created,expireTimestamp:n?.expire,...r})}function cne(e,t){if(!window.cookieStore||!t.created)return;const n=Number(t.created),r=Lr(),{stop:i}=Cn(e,cookieStore,"change",o);function o(a){const c=ez(a.changed,f=>f.name===Ga);if(!c)return;const d=Lr()-n;if(d>14*Fr)i();else{const f=ib(c.value);if(f.id&&f.id!==t.id){i();const p=Lr()-r;Hz().then(h=>{Rp("Session cookie changed",{time:p,session_age:d,old:t,new:f,cookie:h})}).catch(Js)}}}}async function Hz(){let e;return"cookieStore"in window?e=await window.cookieStore.getAll(Ga):e=document.cookie.split(/\s*;\s*/).filter(t=>t.startsWith(Ga)),{count:e.length,domain:JP()||"undefined",...e}}function une(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(n,r){const i=bz(n);t+=i,e+=n,r&&r(i)},finish(n){n(this.finishSync())},finishSync(){const n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount(n){return n.length}}}class dne{constructor(){this.callbacks={}}notify(t,n){const r=this.callbacks[t];r&&r.forEach(i=>i(n))}subscribe(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter(r=>n!==r)}}}}const fne=3e3;function fS(e,t,n=fne){let r=0,i=!1;return{isLimitReached(){if(r===0&&Cr(()=>{r=0},Fr),r+=1,r<=n||i)return i=!1,!1;if(r===n+1){i=!0;try{t({message:`Reached max number of ${e}s by minute: ${n}`,source:Hd.AGENT,startClocks:nr()})}finally{i=!1}}return!0}}}function XC(e,t,n){return document.readyState===t||document.readyState==="complete"?(n(),{stop:Ht}):Cn(e,window,t==="complete"?"load":"DOMContentLoaded",n,{once:!0})}function mne(e,t){return new Promise(n=>{XC(e,t,n)})}let mS;const QC=new WeakMap;function pne(e){return mS||(mS=hne(e)),mS}function hne(e){return new At(t=>{const{stop:n}=ra(XMLHttpRequest.prototype,"open",gne),{stop:r}=ra(XMLHttpRequest.prototype,"send",o=>{vne(o,e,t)},{computeHandlingStack:!0}),{stop:i}=ra(XMLHttpRequest.prototype,"abort",yne);return()=>{n(),r(),i()}})}function gne({target:e,parameters:[t,n]}){QC.set(e,{state:"open",method:String(t).toUpperCase(),url:HC(String(n))})}function vne({target:e,parameters:[t],handlingStack:n},r,i){const o=QC.get(e);if(!o)return;const a=o;a.state="start",a.startClocks=nr(),a.isAborted=!1,a.xhr=e,a.handlingStack=n,a.requestBody=t;let c=!1;const{stop:d}=ra(e,"onreadystatechange",()=>{e.readyState===XMLHttpRequest.DONE&&f()}),f=()=>{if(p(),d(),c)return;c=!0;const h=o;h.state="complete",h.duration=Pn(a.startClocks.timeStamp,hr()),h.status=e.status,typeof e.response=="string"&&(h.responseBody=e.response),i.notify(Ym(h))},{stop:p}=Cn(r,e,"loadend",f);i.notify(a)}function yne({target:e}){const t=QC.get(e);t&&(t.isAborted=!0)}async function bne(e,t){const n=e.getReader(),r=[];for(;;){const i=await n.read();if(i.done)break;t.collectStreamBody&&r.push(i.value)}return n.cancel().catch(Ht),t.collectStreamBody?xz(r):void 0}let pS;const qz=[];function Gz({responseBodyAction:e}={}){return e&&qz.push(e),pS||(pS=xne()),pS}function xne(){return new At(e=>{if(!la.fetch)return;const{stop:t}=ra(la,"fetch",n=>wne(n,e),{computeHandlingStack:!0});return t})}function wne({parameters:e,onPostCall:t,handlingStack:n},r){const[i,o]=e;let a=o&&o.method;a===void 0&&i instanceof Request&&(a=i.method);const c=a!==void 0?String(a).toUpperCase():"GET",d=i instanceof Request?i.url:HC(String(i)),f=nr(),p={state:"start",init:o,input:i,method:c,startClocks:f,url:d,handlingStack:n};r.notify(p),e[0]=p.input,e[1]=p.init,t(h=>{Sne(r,h,p).catch(Js)})}async function Sne(e,t,n){var r,i;const o=n;o.state="resolve";let a;try{a=await t}catch(d){o.status=0,o.isAborted=((i=(r=o.init)===null||r===void 0?void 0:r.signal)===null||i===void 0?void 0:i.aborted)||d instanceof DOMException&&d.code===DOMException.ABORT_ERR,o.error=d,e.notify(o);return}o.response=a,o.status=a.status,o.responseType=a.type,o.isAborted=!1;const c=qz.reduce((d,f)=>Math.max(d,f(o)),0);if(c!==0){const d=Ste(a);if(d&&d.body)try{const f=await bne(d.body,{collectStreamBody:c===2});o.responseBody=f&&new TextDecoder().decode(f)}catch{}}e.notify(o)}function _ne(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){const n=window.requestIdleCallback(bt(e),t);return()=>window.cancelIdleCallback(n)}return Ene(e)}const Cne=50;function Ene(e){const t=Lr(),n=Cr(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,Cne-(Lr()-t))})},0);return()=>io(n)}const kne=Rr,jne=30;function Rne(){const e=[];function t(r){let i;if(r.didTimeout){const o=performance.now();i=()=>jne-(performance.now()-o)}else i=r.timeRemaining.bind(r);for(;i()>0&&e.length;)e.shift()();e.length&&n()}function n(){_ne(t,{timeout:kne})}return{push(r){e.push(r)===1&&n()},stop(){e.length=0}}}let hS={};function Ine(e){const t=e.map(n=>(hS[n]||(hS[n]=Nne(n)),hS[n]));return GP(...t)}function Nne(e){return new At(t=>{const n=za[e];return za[e]=(...r)=>{n.apply(console,r);const i=Qm("console error");Ys(()=>{t.notify(Tne(r,e,i))})},()=>{za[e]=n}})}function Tne(e,t,n){const r=e.map(i=>Ane(i)).join(" ");if(t===Yy.error){const i=e.find(Ic),o=ZC({originalError:i,handlingStack:n,startClocks:nr(),source:Hd.CONSOLE,handling:"handled",nonErrorPrefix:"Provided",useFallbackStack:!1});return o.message=r,{api:t,message:r,handlingStack:n,error:o}}return{api:t,message:r,error:void 0,handlingStack:n}}function Ane(e){return typeof e=="string"?fn(e):Ic(e)?vz(Cp(e)):kp(fn(e),void 0,2)}const One=500;function Dne(){const e=[];return{add:i=>{e.push(i)>One&&e.splice(0,1)},remove:i=>{Lz(e,i)},drain:i=>{e.forEach(o=>o(i)),e.length=0}}}function $ne(e){const t=jc(e)==="object";return t||mt.error("Unsupported context:",e),t}function gS(e,t,n){const r={...e};for(const[i,{required:o,type:a}]of Object.entries(t))a==="string"&&!MO(r[i])&&(r[i]=String(r[i])),o&&MO(r[i])&&mt.warn(`The property ${i} of ${n} is required; context will not be sent to the intake.`);return r}function MO(e){return e==null||e===""}function sb(e="",{propertiesConfig:t={}}={}){let n={};const r=new At,i={getContext:()=>YC(n),setContext:o=>{$ne(o)?n=fn(gS(o,t,e)):i.clearContext(),r.notify()},setContextProperty:(o,a)=>{n=fn(gS({...n,[o]:a},t,e)),r.notify()},removeContextProperty:o=>{delete n[o],gS(n,t,e),r.notify()},clearContext:()=>{n={},r.notify()},changeObservable:r};return i}function Tr(e,t,n,r){return bt((...i)=>(r&&sr({feature:r}),e()[t][n](...i)))}const Mne="_dd_c",Pne=[];function JC(e,t,n,r){const i=zne(n,r);Pne.push(Cn(e,window,"storage",({key:f})=>{i===f&&a()})),t.changeObservable.subscribe(c);const o=Ka(d(),t.getContext());fl(o)||t.setContext(o);function a(){t.setContext(d())}function c(){localStorage.setItem(i,JSON.stringify(t.getContext()))}function d(){const f=localStorage.getItem(i);return f?JSON.parse(f):{}}}function zne(e,t){return`${Mne}_${e}_${t}`}function Lne(e,t,n){const r=Kz();return t.storeContextsAcrossPages&&JC(t,r,n,4),e.register(0,()=>{const i=r.getContext();return fl(i)||!i.id?Di:{account:i}}),r}function Kz(){return sb("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function Une(e,t,n,r){const i=Zz();return t.storeContextsAcrossPages&&JC(t,i,n,2),e.register(0,()=>({context:i.getContext()})),i}function Zz(){return sb("global context")}function Fne(e,t,n,r){const i=Yz();return t.storeContextsAcrossPages&&JC(t,i,r,1),e.register(0,({eventType:o,startTime:a})=>{const c=i.getContext(),d=n.findTrackedSession(a);return d&&d.anonymousId&&!c.anonymous_id&&t.trackAnonymousUser&&(c.anonymous_id=d.anonymousId),fl(c)?Di:{type:o,usr:c}}),e.register(1,({startTime:o})=>{var a;return{anonymous_id:(a=n.findTrackedSession(o))===null||a===void 0?void 0:a.anonymousId}}),i}function Yz(){return sb("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}const lr={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},Ar={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"},$r={DOCUMENT:"document",XHR:"xhr",BEACON:"beacon",FETCH:"fetch",CSS:"css",JS:"js",IMAGE:"image",FONT:"font",MEDIA:"media",OTHER:"other"},lb={FETCH:$r.FETCH,XHR:$r.XHR},Vne=500;function Bne(e=ate){const t=new KP(Vne),n=e().subscribe(r=>{t.notify({type:0,error:r})});return{observable:t,stop:()=>{n.unsubscribe()}}}function Hne(){try{return new Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const vt={ACTION:"action",ERROR:"error",LONG_TASK:"long_task",VIEW:"view",RESOURCE:"resource",VITAL:"vital"},Wz={LONG_TASK:"long-task",LONG_ANIMATION_FRAME:"long-animation-frame"},La={INITIAL_LOAD:"initial_load",ROUTE_CHANGE:"route_change",BF_CACHE:"bf_cache"},eE={CLICK:"click",CUSTOM:"custom"},um={RAGE_CLICK:"rage_click",ERROR_CLICK:"error_click",DEAD_CLICK:"dead_click"},ep={DURATION:"duration",OPERATION_STEP:"operation_step"};function qne(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}function Gne(e,t,n){function r(a){return!t.wasInPageStateDuringPeriod("frozen",a.startClocks.relative,a.duration)}function i(a){r(a)&&e.notify(12,PO(a))}function o(a,c,d,f){if(!_p(el.FEATURE_OPERATION_VITAL))return;const{operationKey:p,context:h,description:v}=d||{},y={name:a,type:ep.OPERATION_STEP,operationKey:p,failureReason:f,stepType:c,startClocks:nr(),context:fn(h),description:v};e.notify(12,PO(y))}return{addOperationStepVital:o,addDurationVital:i,startDurationVital:(a,c={})=>Xz(n,a,c),stopDurationVital:(a,c={})=>{Qz(i,n,a,c)}}}function Xz({vitalsByName:e,vitalsByReference:t},n,r={}){const i={name:n,startClocks:nr(),...r},o={__dd_vital_reference:!0};return e.set(n,i),t.set(o,i),o}function Qz(e,{vitalsByName:t,vitalsByReference:n},r,i={}){const o=typeof r=="string"?t.get(r):n.get(r);o&&(e(Kne(o,o.startClocks,i,nr())),typeof r=="string"?t.delete(r):n.delete(r))}function Kne(e,t,n,r){var i;return{name:e.name,type:ep.DURATION,startClocks:t,duration:Pn(t.timeStamp,r.timeStamp),context:Ka(e.context,n.context),description:(i=n.description)!==null&&i!==void 0?i:e.description}}function PO(e){const{startClocks:t,type:n,name:r,description:i,context:o}=e,a={id:kr(),type:n,name:r,description:i,...n===ep.DURATION?{duration:gt(e.duration)}:{step_type:e.stepType,operation_key:e.operationKey,failure_reason:e.failureReason}};return{rawRumEvent:{date:t.timeStamp,vital:a,type:vt.VITAL,context:o},startTime:t.relative,duration:n===ep.DURATION?e.duration:void 0,domainContext:{}}}function Jz(e,t,n){if(e)for(const r of e){const i=r[t];i&&i(n)}}const zO=new Map;function e4(e,t){if(t===100)return!0;if(t===0)return!1;const n=zO.get(t);if(n&&e===n.sessionId)return n.decision;let r;return window.BigInt?r=Zne(BigInt(`0x${e.split("-")[4]}`),t):r=Zl(t),zO.set(t,{sessionId:e,decision:r}),r}function Zne(e,t){const n=BigInt("1111111111111111111"),r=BigInt("0x10000000000000000"),i=e*n%r;return Number(i)<=t/100*Number(r)}function Yne(){return n4(64)}function t4(){return n4(63)}function n4(e){const t=crypto.getRandomValues(new Uint32Array(2));return e===63&&(t[t.length-1]>>>=1),{toString(n=10){let r=t[1],i=t[0],o="";do{const a=r%n*4294967296+i;r=Math.floor(r/n),i=Math.floor(a/n),o=(a%n).toString(n)+o}while(r||i);return o}}}function Au(e){return e.toString(16).padStart(16,"0")}function Wne(e){const t=e;return jc(t)==="object"&&Xm(t.match)&&Array.isArray(t.propagatorTypes)}function Xne(e){e.status===0&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function Qne(e,t,n,r){return{clearTracingIfNeeded:Xne,traceFetch:i=>LO(e,i,t,n,r,o=>{var a;if(i.input instanceof Request&&!(!((a=i.init)===null||a===void 0)&&a.headers))i.input=new Request(i.input),Object.keys(o).forEach(c=>{i.input.headers.append(c,o[c])});else{i.init=Ym(i.init);const c=[];i.init.headers instanceof Headers?i.init.headers.forEach((d,f)=>{c.push([f,d])}):Array.isArray(i.init.headers)?i.init.headers.forEach(d=>{c.push(d)}):i.init.headers&&Object.keys(i.init.headers).forEach(d=>{c.push([d,i.init.headers[d]])}),i.init.headers=c.concat(qC(o))}}),traceXhr:(i,o)=>LO(e,i,t,n,r,a=>{Object.keys(a).forEach(c=>{o.setRequestHeader(c,a[c])})})}}function LO(e,t,n,r,i,o){const a=n.findTrackedSession();if(!a)return;const c=e.allowedTracingUrls.find(p=>ob([p.match],t.url,!0));if(!c)return;const d=e4(a.id,e.traceSampleRate);(d||e.traceContextInjection===e1.ALL)&&(t.traceSampled=d,t.traceId=Yne(),t.spanId=t4(),o(Jne(t.traceId,t.spanId,t.traceSampled,a.id,c.propagatorTypes,r,i,e)))}function Jne(e,t,n,r,i,o,a,c){const d={};if(i.forEach(f=>{switch(f){case"datadog":{Object.assign(d,{"x-datadog-origin":"rum","x-datadog-parent-id":t.toString(),"x-datadog-sampling-priority":n?"1":"0","x-datadog-trace-id":e.toString()});break}case"tracecontext":{Object.assign(d,{traceparent:`00-0000000000000000${Au(e)}-${Au(t)}-0${n?"1":"0"}`,tracestate:`dd=s:${n?"1":"0"};o:rum`});break}case"b3":{Object.assign(d,{b3:`${Au(e)}-${Au(t)}-${n?"1":"0"}`});break}case"b3multi":{Object.assign(d,{"X-B3-TraceId":Au(e),"X-B3-SpanId":Au(t),"X-B3-Sampled":n?"1":"0"});break}}}),c.propagateTraceBaggage){const f={"session.id":r},p=o.getContext().id;typeof p=="string"&&(f["user.id"]=p);const h=a.getContext().id;typeof h=="string"&&(f["account.id"]=h);const v=Object.entries(f).map(([y,b])=>`${y}=${encodeURIComponent(b)}`).join(",");v&&(d.baggage=v)}return d}const r4=["tracecontext","datadog"];function ere(e,t){var n,r,i,o,a,c,d;if(e.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(e.trackFeatureFlagsForEvents)&&mt.warn("trackFeatureFlagsForEvents should be an array"),!e.applicationId){mt.error("Application ID is not configured, no RUM data will be collected.");return}if(!Ku(e.sessionReplaySampleRate,"Session Replay")||!Ku(e.traceSampleRate,"Trace"))return;if(e.excludedActivityUrls!==void 0&&!Array.isArray(e.excludedActivityUrls)){mt.error("Excluded Activity Urls should be an array");return}const f=tre(e);if(!f)return;const p=Nee(e,t),h=rre(e);if(!p)return;const v=(n=e.sessionReplaySampleRate)!==null&&n!==void 0?n:0;return{applicationId:e.applicationId,actionNameAttribute:e.actionNameAttribute,sessionReplaySampleRate:v,startSessionReplayRecordingManually:e.startSessionReplayRecordingManually!==void 0?!!e.startSessionReplayRecordingManually:v===0,traceSampleRate:(r=e.traceSampleRate)!==null&&r!==void 0?r:100,rulePsr:wp(e.traceSampleRate)?e.traceSampleRate/100:void 0,allowedTracingUrls:f,excludedActivityUrls:(i=e.excludedActivityUrls)!==null&&i!==void 0?i:[],workerUrl:e.workerUrl,compressIntakeRequests:!!e.compressIntakeRequests,trackUserInteractions:!!(!((o=e.trackUserInteractions)!==null&&o!==void 0)||o),trackViewsManually:!!e.trackViewsManually,trackResources:!!(!((a=e.trackResources)!==null&&a!==void 0)||a),trackLongTasks:!!(!((c=e.trackLongTasks)!==null&&c!==void 0)||c),trackBfcacheViews:!!e.trackBfcacheViews,trackEarlyRequests:!!e.trackEarlyRequests,subdomain:e.subdomain,defaultPrivacyLevel:Bv(Gu,e.defaultPrivacyLevel)?e.defaultPrivacyLevel:Gu.MASK,enablePrivacyForActionName:!!e.enablePrivacyForActionName,traceContextInjection:Bv(e1,e.traceContextInjection)?e.traceContextInjection:e1.SAMPLED,plugins:e.plugins||[],trackFeatureFlagsForEvents:e.trackFeatureFlagsForEvents||[],profilingSampleRate:(d=e.profilingSampleRate)!==null&&d!==void 0?d:0,propagateTraceBaggage:!!e.propagateTraceBaggage,allowedGraphQlUrls:h,...p}}function tre(e){if(e.allowedTracingUrls===void 0)return[];if(!Array.isArray(e.allowedTracingUrls)){mt.error("Allowed Tracing URLs should be an array");return}if(e.allowedTracingUrls.length!==0&&e.service===void 0){mt.error("Service needs to be configured when tracing is enabled");return}const t=[];return e.allowedTracingUrls.forEach(n=>{Xm(n)?t.push({match:n,propagatorTypes:r4}):Wne(n)?t.push(n):mt.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",n)}),t}function nre(e){const t=new Set;return oc(e.allowedTracingUrls)&&e.allowedTracingUrls.forEach(n=>{Xm(n)?r4.forEach(r=>t.add(r)):jc(n)==="object"&&Array.isArray(n.propagatorTypes)&&n.propagatorTypes.forEach(r=>t.add(r))}),Array.from(t)}function rre(e){if(!e.allowedGraphQlUrls)return[];if(!Array.isArray(e.allowedGraphQlUrls))return mt.warn("allowedGraphQlUrls should be an array"),[];const t=[];return e.allowedGraphQlUrls.forEach(n=>{Xm(n)?t.push({match:n,trackPayload:!1,trackResponseErrors:!1}):n&&typeof n=="object"&&"match"in n&&Xm(n.match)&&t.push({match:n.match,trackPayload:!!n.trackPayload,trackResponseErrors:!!n.trackResponseErrors})}),t}function ire(e){return oc(e)&&e.some(t=>typeof t=="object"&&"trackPayload"in t?!!t.trackPayload:!1)}function ore(e){return oc(e)&&e.some(t=>typeof t=="object"&&"trackResponseErrors"in t?!!t.trackResponseErrors:!1)}function are(e){var t;const n=Tee(e);return{session_replay_sample_rate:e.sessionReplaySampleRate,start_session_replay_recording_manually:e.startSessionReplayRecordingManually,trace_sample_rate:e.traceSampleRate,trace_context_injection:e.traceContextInjection,propagate_trace_baggage:e.propagateTraceBaggage,action_name_attribute:e.actionNameAttribute,use_allowed_tracing_urls:oc(e.allowedTracingUrls),use_allowed_graph_ql_urls:oc(e.allowedGraphQlUrls),use_track_graph_ql_payload:ire(e.allowedGraphQlUrls),use_track_graph_ql_response_errors:ore(e.allowedGraphQlUrls),selected_tracing_propagators:nre(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:oc(e.excludedActivityUrls),use_worker_url:!!e.workerUrl,compress_intake_requests:e.compressIntakeRequests,track_views_manually:e.trackViewsManually,track_user_interactions:e.trackUserInteractions,track_resources:e.trackResources,track_long_task:e.trackLongTasks,track_bfcache_views:e.trackBfcacheViews,track_early_requests:e.trackEarlyRequests,plugins:(t=e.plugins)===null||t===void 0?void 0:t.map(r=>{var i;return{name:r.name,...(i=r.getConfigurationTelemetry)===null||i===void 0?void 0:i.call(r)}}),track_feature_flags_for_events:e.trackFeatureFlagsForEvents,remote_configuration_id:e.remoteConfigurationId,profiling_sample_rate:e.profilingSampleRate,use_remote_configuration_proxy:!!e.remoteConfigurationProxy,...n}}function sre(e){const t=[];let n=0,r;const i={quote:void 0,escapeSequence:void 0};let o="";for(const a of e){if(r=UO[n].find(c=>mre[c](a,i)),!r)return[];if(i.escapeSequence!==void 0&&r!==12){if(!gre(i.escapeSequence))return[];o+=yre(i.escapeSequence),i.escapeSequence=void 0}pre.includes(r)?o+=a:hre.includes(r)&&o!==""?(t.push(o),o=""):r===12?i.escapeSequence=i.escapeSequence?`${i.escapeSequence}${a}`:a:r===8?i.quote=a:r===9&&(i.quote=void 0),n=r}return UO[n].includes(1)?(o!==""&&t.push(o),t):[]}const lre=/[a-zA-Z_$]/,cre=/[a-zA-Z0-9_$]/,ure=/[0-9]/,dre=/[a-fA-F0-9]/,fre=`'"`,mre={0:()=>!1,1:()=>!1,2:e=>lre.test(e),3:e=>cre.test(e),4:e=>e===".",5:e=>e==="[",6:e=>e==="]",7:e=>ure.test(e),8:e=>fre.includes(e),9:(e,t)=>e===t.quote,10:()=>!0,11:e=>e==="\\",12:(e,t)=>t.escapeSequence===void 0?`${t.quote}/\\bfnrtu`.includes(e):t.escapeSequence.startsWith("u")&&t.escapeSequence.length<5?dre.test(e):!1},UO={0:[2,5],1:[],2:[3,4,5,1],3:[3,4,5,1],4:[2],5:[8,7],6:[4,5,1],7:[7,6],8:[11,9,10],9:[6],10:[11,9,10],11:[12],12:[12,11,9,10]},pre=[2,3,7,10],hre=[4,5,6];function gre(e){return`"'/\\bfnrt`.includes(e)||e.startsWith("u")&&e.length===5}const vre={'"':'"',"'":"'","/":"/","\\":"\\",b:"\b",f:"\f",n:`
|
|
38
|
-
`,r:"\r",t:" "};function yre(e){return e.startsWith("u")?String.fromCharCode(parseInt(e.slice(1),16)):vre[e]}const bre="v1",xre=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function wre(e,t){let n;const r=_re(),i=await jre(e);return i.ok?(r.increment("fetch","success"),n=Sre(e,i.value,t,r)):(r.increment("fetch","failure"),mt.error(i.error)),ab("remote configuration metrics",{metrics:r.get()}),n}function Sre(e,t,n,r){const i={...e};return xre.forEach(v=>{v in t&&(i[v]=o(t[v]))}),Object.keys(n).forEach(v=>{t[v]!==void 0&&a(n[v],t[v])}),i;function o(v){if(Array.isArray(v))return v.map(o);if(Cre(v)){if(Ere(v)){const y=v.rcSerializedType;switch(y){case"string":return v.value;case"regex":return i4(v.value);case"dynamic":return c(v);default:mt.error(`Unsupported remote configuration: "rcSerializedType": "${y}"`);return}}return HP(v,o)}return v}function a(v,y){y.forEach(({key:b,value:S})=>{v.setContextProperty(b,o(S))})}function c(v){const y=v.strategy;let b;switch(y){case"cookie":b=d(v);break;case"dom":b=f(v);break;case"js":b=h(v);break;default:mt.error(`Unsupported remote configuration: "strategy": "${y}"`);return}const S=v.extractor;return S!==void 0&&typeof b=="string"?kre(S,b):b}function d({name:v}){const y=rb(v);return r.increment("cookie",y!==void 0?"success":"missing"),y}function f({selector:v,attribute:y}){let b;try{b=document.querySelector(v)}catch{mt.error(`Invalid selector in the remote configuration: '${v}'`),r.increment("dom","failure");return}if(!b){r.increment("dom","missing");return}if(p(b,y)){mt.error(`Forbidden element selected by the remote configuration: '${v}'`),r.increment("dom","failure");return}const S=y!==void 0?b.getAttribute(y):b.textContent;if(S===null){r.increment("dom","missing");return}return r.increment("dom","success"),S}function p(v,y){return v.getAttribute("type")==="password"&&y==="value"}function h({path:v}){let y=window;const b=sre(v);if(b.length===0){mt.error(`Invalid JSON path in the remote configuration: '${v}'`),r.increment("js","failure");return}for(const S of b){if(!(S in y)){r.increment("js","missing");return}try{y=y[S]}catch(C){mt.error(`Error accessing: '${v}'`,C),r.increment("js","failure");return}}return r.increment("js","success"),y}}function _re(){const e={fetch:{}};return{get:()=>e,increment:(t,n)=>{e[t]||(e[t]={}),e[t][n]||(e[t][n]=0),e[t][n]=e[t][n]+1}}}function Cre(e){return typeof e=="object"&&e!==null}function Ere(e){return"rcSerializedType"in e}function i4(e){try{return new RegExp(e)}catch{mt.error(`Invalid regex in the remote configuration: '${e}'`)}}function kre(e,t){const n=i4(e.value);if(n===void 0)return;const r=n.exec(t);if(r===null)return;const[i,o]=r;return o||i}async function jre(e){let t;try{t=await fetch(Rre(e))}catch{t=void 0}if(!t||!t.ok)return{ok:!1,error:new Error("Error fetching the remote configuration.")};const n=await t.json();return n.rum?{ok:!0,value:n.rum}:{ok:!1,error:new Error("No remote configuration for RUM.")}}function Rre(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${pz("rum",e)}/${bre}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function Ire({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},n,r,i){const o=Dne(),a=Zz();vS(a,lr.globalContext,o);const c=Yz();vS(c,lr.userContext,o);const d=Kz();vS(d,lr.accountContext,o);let f,p,h,v;const y=n.observable.subscribe(S),b={};function S(){if(!h||!v||!n.isGranted())return;y.unsubscribe();let I;if(v.trackViewsManually){if(!f)return;o.remove(f.callback),I=f.options}const A=i(v,p,I);o.drain(A)}function C(I,A){const N=yd();if(N&&(I=Nre(I)),h=I,Zte(are(I)),v){Sz("DD_RUM",I);return}const T=ere(I,A);if(T){if(!N&&!T.sessionStoreStrategyType){mt.warn("No storage available for session. We will not send any data.");return}T.compressIntakeRequests&&!N&&t&&(p=t(T,"Datadog RUM",Ht),!p)||(v=T,Gz().subscribe(Ht),n.tryToInit(T.trackingConsent),S())}}const E=I=>{o.add(A=>A.addDurationVital(I))};return{init(I,A,N){if(!I){mt.error("Missing configuration");return}Aee(I.enableExperimentalFeatures),h=I,!(e&&Uz())&&(Jz(I.plugins,"onInit",{initConfiguration:I,publicApi:A}),I.remoteConfigurationId?wre(I,{user:c,context:a}).then(T=>{T&&C(T,N)}).catch(Js):C(I,N))},get initConfiguration(){return h},getInternalContext:Ht,stopSession:Ht,addTiming(I,A=hr()){o.add(N=>N.addTiming(I,A))},startView(I,A=nr()){const N=T=>{T.startView(I,A)};o.add(N),f||(f={options:I,callback:N},S())},setViewName(I){o.add(A=>A.setViewName(I))},setViewContext(I){o.add(A=>A.setViewContext(I))},setViewContextProperty(I,A){o.add(N=>N.setViewContextProperty(I,A))},getViewContext:()=>b,globalContext:a,userContext:c,accountContext:d,addAction(I){o.add(A=>A.addAction(I))},addError(I){o.add(A=>A.addError(I))},addFeatureFlagEvaluation(I,A){o.add(N=>N.addFeatureFlagEvaluation(I,A))},startDurationVital(I,A){return Xz(r,I,A)},stopDurationVital(I,A){Qz(E,r,I,A)},addDurationVital:E,addOperationStepVital:(I,A,N,T)=>{o.add(z=>z.addOperationStepVital(fn(I),A,fn(N),fn(T)))}}}function Nre(e){var t,n;return{...e,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(t=e.defaultPrivacyLevel)!==null&&t!==void 0?t:(n=jp())===null||n===void 0?void 0:n.getPrivacyLevel()}}function vS(e,t,n){e.changeObservable.subscribe(()=>{const r=e.getContext();n.add(i=>i[t].setContext(r))})}function Tre(e,t,n,r={}){const i=dee(),o=qne(),a=Bne().observable;let c=Ire(r,i,o,(h,v,y)=>{const b=v&&r.createDeflateEncoder?C=>r.createDeflateEncoder(h,v,C):une,S=e(h,t,n,y,b,i,o,a,r.sdkName);return t.onRumStart(S.lifeCycle,h,S.session,S.viewHistory,v,S.telemetry),n.onRumStart(S.lifeCycle,S.hooks,h,S.session,S.viewHistory,b),c=Are(c,S),Jz(h.plugins,"onRumStart",{strategy:c,addEvent:S.addEvent}),S});const d=()=>c,f=bt(h=>{const v=typeof h=="object"?h:{name:h};c.startView(v),sr({feature:"start-view"})}),p=cte({init:h=>{const v=new Error().stack;Ys(()=>c.init(h,p,v))},setTrackingConsent:bt(h=>{i.update(h),sr({feature:"set-tracking-consent",tracking_consent:h})}),setViewName:bt(h=>{c.setViewName(h),sr({feature:"set-view-name"})}),setViewContext:bt(h=>{c.setViewContext(h),sr({feature:"set-view-context"})}),setViewContextProperty:bt((h,v)=>{c.setViewContextProperty(h,v),sr({feature:"set-view-context-property"})}),getViewContext:bt(()=>(sr({feature:"set-view-context-property"}),c.getViewContext())),getInternalContext:bt(h=>c.getInternalContext(h)),getInitConfiguration:bt(()=>YC(c.initConfiguration)),addAction:(h,v)=>{const y=Qm("action");Ys(()=>{c.addAction({name:fn(h),context:fn(v),startClocks:nr(),type:eE.CUSTOM,handlingStack:y}),sr({feature:"add-action"})})},addError:(h,v)=>{const y=Qm("error");Ys(()=>{c.addError({error:h,handlingStack:y,context:fn(v),startClocks:nr()}),sr({feature:"add-error"})})},addTiming:bt((h,v)=>{c.addTiming(fn(h),v)}),setGlobalContext:Tr(d,lr.globalContext,Ar.setContext,"set-global-context"),getGlobalContext:Tr(d,lr.globalContext,Ar.getContext,"get-global-context"),setGlobalContextProperty:Tr(d,lr.globalContext,Ar.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:Tr(d,lr.globalContext,Ar.removeContextProperty,"remove-global-context-property"),clearGlobalContext:Tr(d,lr.globalContext,Ar.clearContext,"clear-global-context"),setUser:Tr(d,lr.userContext,Ar.setContext,"set-user"),getUser:Tr(d,lr.userContext,Ar.getContext,"get-user"),setUserProperty:Tr(d,lr.userContext,Ar.setContextProperty,"set-user-property"),removeUserProperty:Tr(d,lr.userContext,Ar.removeContextProperty,"remove-user-property"),clearUser:Tr(d,lr.userContext,Ar.clearContext,"clear-user"),setAccount:Tr(d,lr.accountContext,Ar.setContext,"set-account"),getAccount:Tr(d,lr.accountContext,Ar.getContext,"get-account"),setAccountProperty:Tr(d,lr.accountContext,Ar.setContextProperty,"set-account-property"),removeAccountProperty:Tr(d,lr.accountContext,Ar.removeContextProperty,"remove-account-property"),clearAccount:Tr(d,lr.accountContext,Ar.clearContext,"clear-account"),startView:f,stopSession:bt(()=>{c.stopSession(),sr({feature:"stop-session"})}),addFeatureFlagEvaluation:bt((h,v)=>{c.addFeatureFlagEvaluation(fn(h),fn(v)),sr({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:bt(()=>t.getSessionReplayLink()),startSessionReplayRecording:bt(h=>{t.start(h),sr({feature:"start-session-replay-recording",force:h&&h.force})}),stopSessionReplayRecording:bt(()=>t.stop()),addDurationVital:bt((h,v)=>{sr({feature:"add-duration-vital"}),c.addDurationVital({name:fn(h),type:ep.DURATION,startClocks:EJ(v.startTime),duration:v.duration,context:fn(v&&v.context),description:fn(v&&v.description)})}),startDurationVital:bt((h,v)=>(sr({feature:"start-duration-vital"}),c.startDurationVital(fn(h),{context:fn(v&&v.context),description:fn(v&&v.description)}))),stopDurationVital:bt((h,v)=>{sr({feature:"stop-duration-vital"}),c.stopDurationVital(typeof h=="string"?fn(h):h,{context:fn(v&&v.context),description:fn(v&&v.description)})}),startFeatureOperation:bt((h,v)=>{sr({feature:"add-operation-step-vital",action_type:"start"}),c.addOperationStepVital(h,"start",v)}),succeedFeatureOperation:bt((h,v)=>{sr({feature:"add-operation-step-vital",action_type:"succeed"}),c.addOperationStepVital(h,"end",v)}),failFeatureOperation:bt((h,v,y)=>{sr({feature:"add-operation-step-vital",action_type:"fail"}),c.addOperationStepVital(h,"end",y,v)})});return p}function Are(e,t){return{init:n=>{Sz("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function Ore(){const e=Dre();return new At(t=>{if(!e)return;const n=new e(bt(r=>t.notify(r)));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function Dre(){let e;const t=window;if(t.Zone&&(e=Qs(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(Ht),r=Qs(n,"originalInstance");e=r&&r.constructor}return e||(e=t.MutationObserver),e}function $re(){const e=new At,{stop:t}=ra(window,"open",()=>e.notify());return{observable:e,stop:t}}function Mre(e,t,n,r,i){return{get:o=>{const a=n.findView(o),c=i.findUrl(o),d=t.findTrackedSession(o);if(d&&a&&c){const f=r.findActionId(o);return{application_id:e,session_id:d.id,user_action:f?{id:f}:void 0,view:{id:a.id,name:a.name,referrer:c.referrer,url:c.url}}}}}}const Pre=dne,zre=kc;function Lre(e){const t=Gd({expireDelay:zre});e.subscribe(1,r=>{t.add(n(r),r.startClocks.relative)}),e.subscribe(6,({endClocks:r})=>{t.closeActive(r.relative)}),e.subscribe(3,r=>{const i=t.find(r.startClocks.relative);i&&(r.name&&(i.name=r.name),r.context&&(i.context=r.context),i.sessionIsActive=r.sessionIsActive)}),e.subscribe(10,()=>{t.reset()});function n(r){return{service:r.service,version:r.version,context:r.context,id:r.id,name:r.name,startClocks:r.startClocks}}return{findView:r=>t.find(r),stop:()=>{t.stop()}}}const o4="initial_document",Ure=[[$r.DOCUMENT,e=>o4===e],[$r.XHR,e=>e==="xmlhttprequest"],[$r.FETCH,e=>e==="fetch"],[$r.BEACON,e=>e==="beacon"],[$r.CSS,(e,t)=>/\.css$/i.test(t)],[$r.JS,(e,t)=>/\.js$/i.test(t)],[$r.IMAGE,(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],[$r.FONT,(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],[$r.MEDIA,(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function Fre(e){const t=e.name;if(!DJ(t))return $r.OTHER;const n=$J(t);for(const[r,i]of Ure)if(i(e.initiatorType,n))return r;return $r.OTHER}function FO(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function a4(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function Vre(e){const{duration:t,startTime:n,responseEnd:r}=e;return t===0&&n<r?Pn(n,r):t}function Bre(e){if(!l4(e))return;const{startTime:t,fetchStart:n,workerStart:r,redirectStart:i,redirectEnd:o,domainLookupStart:a,domainLookupEnd:c,connectStart:d,secureConnectionStart:f,connectEnd:p,requestStart:h,responseStart:v,responseEnd:y}=e,b={download:Ll(t,v,y),first_byte:Ll(t,h,v)};return 0<r&&r<n&&(b.worker=Ll(t,r,n)),n<p&&(b.connect=Ll(t,d,p),d<=f&&f<=p&&(b.ssl=Ll(t,f,p))),n<c&&(b.dns=Ll(t,a,c)),t<o&&(b.redirect=Ll(t,i,o)),b}function s4(e){return e.duration>=0}function l4(e){const t=FO(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=Hre(e)?FO(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function Hre(e){return e.redirectEnd>e.startTime}function Ll(e,t,n){if(e<=t&&t<=n)return{duration:gt(Pn(t,n)),start:gt(Pn(e,t))}}function qre(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function Gre(e){return e.deliveryType===""?"other":e.deliveryType}function Kre(e){if(e.startTime<e.responseStart){const{encodedBodySize:t,decodedBodySize:n,transferSize:r}=e;return{size:n,encoded_body_size:t,decoded_body_size:n,transfer_size:r}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function tE(e){return e&&(!Ree(e)||_p(el.TRACK_INTAKE_REQUESTS))}const Zre=/data:(.+)?(;base64)?,/g,Yre=24e3;function Wre(e,t=Yre){if(e.length<=t||!e.startsWith("data:"))return e;const n=e.substring(0,100).match(Zre);return n?`${n[0]}[...]`:e}const Xre=32*Rc;function Qre(e,t){const n=eie(e.requestBody,t.trackPayload);if(n){if(t.trackResponseErrors&&e.responseBody){const r=Jre(e.responseBody);r&&(n.errors_count=r.length,n.errors=r)}return n}}function Jre(e){let t;try{t=JSON.parse(e)}catch{return}if(!t||typeof t!="object")return;const n=t;return oc(n.errors)?n.errors.map(i=>{var o;return{message:i.message,path:i.path,locations:i.locations,code:(o=i.extensions)===null||o===void 0?void 0:o.code}}):void 0}function c4(e,t){return t.allowedGraphQlUrls.find(n=>ob([n.match],e))}function eie(e,t=!1){if(!e||typeof e!="string")return;let n;try{n=JSON.parse(e)}catch{return}if(!n||!n.query)return;const r=n.query.trim(),i=tie(r),o=n.operationName;if(!i)return;let a;return n.variables&&(a=JSON.stringify(n.variables)),{operationType:i,operationName:o,variables:a,payload:t?BC(r,Xre,"..."):void 0}}function tie(e){var t;return(t=e.match(/^\s*(query|mutation|subscription)\b/i))===null||t===void 0?void 0:t[1]}let VO=1;function nie(e,t,n,r,i){const o=Qne(t,n,r,i);rie(e,t,o),iie(e,t,o)}function rie(e,t,n){const r=pne(t).subscribe(i=>{const o=i;if(tE(o.url))switch(o.state){case"start":n.traceXhr(o,o.xhr),o.requestIndex=u4(),e.notify(7,{requestIndex:o.requestIndex,url:o.url});break;case"complete":n.clearTracingIfNeeded(o),e.notify(8,{duration:o.duration,method:o.method,requestIndex:o.requestIndex,spanId:o.spanId,startClocks:o.startClocks,status:o.status,traceId:o.traceId,traceSampled:o.traceSampled,type:lb.XHR,url:o.url,xhr:o.xhr,isAborted:o.isAborted,handlingStack:o.handlingStack,requestBody:o.requestBody,responseBody:o.responseBody});break}});return{stop:()=>r.unsubscribe()}}function iie(e,t,n){const r=Gz({responseBodyAction:i=>{var o;return!((o=c4(i.url,t))===null||o===void 0)&&o.trackResponseErrors?2:1}}).subscribe(i=>{var o;const a=i;if(tE(a.url))switch(a.state){case"start":n.traceFetch(a),a.requestIndex=u4(),e.notify(7,{requestIndex:a.requestIndex,url:a.url});break;case"resolve":n.clearTracingIfNeeded(a),e.notify(8,{duration:Pn(a.startClocks.timeStamp,hr()),method:a.method,requestIndex:a.requestIndex,responseType:a.responseType,spanId:a.spanId,startClocks:a.startClocks,status:a.status,traceId:a.traceId,traceSampled:a.traceSampled,type:lb.FETCH,url:a.url,response:a.response,init:a.init,input:a.input,isAborted:a.isAborted,handlingStack:a.handlingStack,requestBody:(o=a.init)===null||o===void 0?void 0:o.body,responseBody:a.responseBody});break}});return{stop:()=>r.unsubscribe()}}function u4(){const e=VO;return VO+=1,e}function d4(e){return wp(e)&&e<0?void 0:e}function f4({lifeCycle:e,isChildEvent:t,onChange:n=Ht}){const r={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},i=e.subscribe(13,o=>{var a;if(!(o.type==="view"||o.type==="vital"||!t(o)))switch(o.type){case vt.ERROR:r.errorCount+=1,n();break;case vt.ACTION:r.actionCount+=1,o.action.frustration&&(r.frustrationCount+=o.action.frustration.type.length),n();break;case vt.LONG_TASK:r.longTaskCount+=1,n();break;case vt.RESOURCE:!((a=o._dd)===null||a===void 0)&&a.discarded||(r.resourceCount+=1,n());break}});return{stop:()=>{i.unsubscribe()},eventCounts:r}}function oie(e,t){const n=Lr();let r=!1;const{stop:i}=tl(e,window,["click","mousedown","keydown","touchstart","pointerdown"],c=>{if(!c.cancelable)return;const d={entryType:"first-input",processingStart:Oi(),processingEnd:Oi(),startTime:c.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};c.type==="pointerdown"?o(e,d):a(d)},{passive:!0,capture:!0});return{stop:i};function o(c,d){tl(c,window,["pointerup","pointercancel"],f=>{f.type==="pointerup"&&a(d)},{once:!0})}function a(c){if(!r){r=!0,i();const d=c.processingStart-c.startTime;d>=0&&d<Lr()-n&&t(c)}}}var $t;(function(e){e.EVENT="event",e.FIRST_INPUT="first-input",e.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",e.LAYOUT_SHIFT="layout-shift",e.LONG_TASK="longtask",e.LONG_ANIMATION_FRAME="long-animation-frame",e.NAVIGATION="navigation",e.PAINT="paint",e.RESOURCE="resource",e.VISIBILITY_STATE="visibility-state"})($t||($t={}));function ca(e,t){return new At(n=>{if(!window.PerformanceObserver)return;const r=d=>{const f=lie(d);f.length>0&&n.notify(f)};let i,o=!0;const a=new PerformanceObserver(bt(d=>{o?i=Cr(()=>r(d.getEntries())):r(d.getEntries())}));try{a.observe(t)}catch{if([$t.RESOURCE,$t.NAVIGATION,$t.LONG_TASK,$t.PAINT].includes(t.type)){t.buffered&&(i=Cr(()=>r(performance.getEntriesByType(t.type))));try{a.observe({entryTypes:[t.type]})}catch{return}}}o=!1,aie(e);let c;return!Nc($t.FIRST_INPUT)&&t.type===$t.FIRST_INPUT&&({stop:c}=oie(e,d=>{r([d])})),()=>{a.disconnect(),c&&c(),io(i)}})}let dm;function aie(e){return!dm&&sie()&&"addEventListener"in performance&&(dm=Cn(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{dm?.stop()}}function sie(){return window.performance!==void 0&&"getEntries"in performance}function Nc(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function lie(e){return e.filter(t=>!cie(t))}function cie(e){return e.entryType===$t.RESOURCE&&(!tE(e.name)||!s4(e))}function r1(e){return e.nodeType===Node.TEXT_NODE}function uie(e){return e.nodeType===Node.COMMENT_NODE}function Za(e){return e.nodeType===Node.ELEMENT_NODE}function m4(e){return Za(e)&&!!e.shadowRoot}function die(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&Za(t.host)}function gAe(e){return e.childNodes.length>0||m4(e)}function vAe(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;m4(e)&&t(e.shadowRoot)}function fie(e){return die(e)?e.host:e.parentNode}const p4=100,mie=100,BO="data-dd-excluded-activity-mutations";function nE(e,t,n,r,i,o){const a=hie(e,t,n,r);return pie(a,i,o)}function pie(e,t,n){let r,i=!1;const o=Cr(bt(()=>f({hadActivity:!1})),p4),a=n!==void 0?Cr(bt(()=>f({hadActivity:!0,end:hr()})),n):void 0,c=e.subscribe(({isBusy:p})=>{io(o),io(r);const h=hr();p||(r=Cr(bt(()=>f({hadActivity:!0,end:h})),mie))}),d=()=>{i=!0,io(o),io(r),io(a),c.unsubscribe()};function f(p){i||(d(),t(p))}return{stop:d}}function hie(e,t,n,r){return new At(i=>{const o=[];let a,c=0;return o.push(t.subscribe(f=>{f.every(gie)||d()}),n.subscribe(d),ca(r,{type:$t.RESOURCE}).subscribe(f=>{f.some(p=>!yS(r,p.name))&&d()}),e.subscribe(7,f=>{yS(r,f.url)||(a===void 0&&(a=f.requestIndex),c+=1,d())}),e.subscribe(8,f=>{yS(r,f.url)||a===void 0||f.requestIndex<a||(c-=1,d())})),()=>{o.forEach(f=>f.unsubscribe())};function d(){i.notify({isBusy:c>0})}})}function yS(e,t){return ob(e.excludedActivityUrls,t)}function gie(e){const t=e.type==="characterData"?e.target.parentElement:e.target;return!!(t&&Za(t)&&t.matches(`[${BO}], [${BO}] *`))}const cb="data-dd-action-name",h4="Masked Element",g4=[cb,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],vie=[y4,bie],yie=[y4,xie,wie];function Ip(e,t){if(!e.isConnected)return;let n,r=e;for(;r&&r.nodeName!=="HTML";){const i=HO(r,vie,_ie,t,n);if(i)return i;n=HO(r,yie,Cie,t,n)||ub(Sie(r),n),r=r.parentElement}return n}function v4(e){return/[0-9]/.test(e)}function bie(e){if(e.id&&!v4(e.id))return`#${CSS.escape(e.id)}`}function xie(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const r=t[n];if(!v4(r))return`${CSS.escape(e.tagName)}.${CSS.escape(r)}`}}function wie(e){return CSS.escape(e.tagName)}function y4(e,t){if(t){const r=n(t);if(r)return r}for(const r of g4){const i=n(r);if(i)return i}function n(r){if(e.hasAttribute(r))return`${CSS.escape(e.tagName)}[${r}="${CSS.escape(e.getAttribute(r))}"]`}}function Sie(e){let t=e.parentElement.firstElementChild,n=1;for(;t&&t!==e;)t.tagName===e.tagName&&(n+=1),t=t.nextElementSibling;return`${CSS.escape(e.tagName)}:nth-of-type(${n})`}function HO(e,t,n,r,i){for(const o of t){const a=o(e,r);if(a&&n(e,a,i))return ub(a,i)}}function _ie(e,t,n){return e.ownerDocument.querySelectorAll(ub(t,n)).length===1}function Cie(e,t,n){let r;if(n===void 0)r=a=>a.matches(t);else{const a=ub(`${t}:scope`,n);r=c=>c.querySelector(a)!==null}let o=e.parentElement.firstElementChild;for(;o;){if(o!==e&&r(o))return!1;o=o.nextElementSibling}return!0}function ub(e,t){return t?`${e}>${t}`:e}const St={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:Gu.ALLOW,MASK:Gu.MASK,MASK_USER_INPUT:Gu.MASK_USER_INPUT,MASK_UNLESS_ALLOWLISTED:Gu.MASK_UNLESS_ALLOWLISTED},b4="data-dd-privacy",yAe="hidden",Eie="dd-privacy-",bS="***",bAe="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",kie={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},jie="x";function Bl(e){return`[${b4}="${e}"], .${Eie}${e}`}function db(e,t,n){if(n&&n.has(e))return n.get(e);const r=fie(e),i=r?db(r,t,n):t,o=Iie(e),a=Rie(o,i);return n&&n.set(e,a),a}function Rie(e,t){switch(t){case St.HIDDEN:case St.IGNORE:return t}switch(e){case St.ALLOW:case St.MASK:case St.MASK_USER_INPUT:case St.MASK_UNLESS_ALLOWLISTED:case St.HIDDEN:case St.IGNORE:return e;default:return t}}function Iie(e){if(Za(e)){if(e.tagName==="BASE")return St.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return St.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return St.MASK}if(e.matches(Bl(St.HIDDEN)))return St.HIDDEN;if(e.matches(Bl(St.MASK)))return St.MASK;if(e.matches(Bl(St.MASK_UNLESS_ALLOWLISTED)))return St.MASK_UNLESS_ALLOWLISTED;if(e.matches(Bl(St.MASK_USER_INPUT)))return St.MASK_USER_INPUT;if(e.matches(Bl(St.ALLOW)))return St.ALLOW;if(Tie(e))return St.IGNORE}}function x4(e,t){switch(t){case St.MASK:case St.HIDDEN:case St.IGNORE:return!0;case St.MASK_UNLESS_ALLOWLISTED:return r1(e)?$g(e.parentNode)?!0:!S4(e.textContent||""):$g(e);case St.MASK_USER_INPUT:return r1(e)?$g(e.parentNode):$g(e);default:return!1}}function Nie(e,t,n,r,i){if(r!==St.MASK&&r!==St.MASK_UNLESS_ALLOWLISTED||t===b4||g4.includes(t)||t===i.actionNameAttribute)return!1;switch(t){case"title":case"alt":case"placeholder":return!0}return!!(e==="A"&&t==="href"||e==="IFRAME"&&t==="srcdoc"||n&&t.startsWith("data-")||(e==="IMG"||e==="SOURCE")&&(t==="src"||t==="srcset"))}function $g(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;const t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!kie[t.tagName]}const w4=e=>e.replace(/\S/g,jie);function xAe(e,t){var n;const r=(n=e.parentElement)===null||n===void 0?void 0:n.tagName;let i=e.textContent||"";if(r==="HEAD"&&!i.trim())return;const a=t;if(r==="SCRIPT")i=bS;else if(a===St.HIDDEN)i=bS;else if(x4(e,a))if(r==="DATALIST"||r==="SELECT"||r==="OPTGROUP"){if(!i.trim())return}else r==="OPTION"?i=bS:a===St.MASK_UNLESS_ALLOWLISTED?i=_4(i):i=w4(i);return i}function Tie(e){if(e.nodeName==="SCRIPT")return!0;if(e.nodeName==="LINK"){const n=t("rel");return/preload|prefetch/i.test(n)&&t("as")==="script"||n==="shortcut icon"||n==="icon"}if(e.nodeName==="META"){const n=t("name"),r=t("rel"),i=t("property");return/^msapplication-tile(image|color)$/.test(n)||n==="application-name"||r==="icon"||r==="apple-touch-icon"||r==="shortcut icon"||n==="keywords"||n==="description"||/^(og|twitter|fb):/.test(i)||/^(og|twitter):/.test(n)||n==="pinterest"||n==="robots"||n==="googlebot"||n==="bingbot"||e.hasAttribute("http-equiv")||n==="author"||n==="generator"||n==="framework"||n==="publisher"||n==="progid"||/^article:/.test(i)||/^product:/.test(i)||n==="google-site-verification"||n==="yandex-verification"||n==="csrf-token"||n==="p:domain_verify"||n==="verify-v1"||n==="verification"||n==="shopify-checkout-api-token"}function t(n){return(e.getAttribute(n)||"").toLowerCase()}return!1}function S4(e){var t;return!e||!e.trim()?!0:((t=window.$DD_ALLOW)===null||t===void 0?void 0:t.has(e.toLocaleLowerCase()))||!1}function _4(e,t){return S4(e)?e:t||w4(e)}const C4=Rr,Aie=100;function Oie(e,t){const n=[];let r=0,i;o(e);function o(d){d.stopObservable.subscribe(a),n.push(d),io(i),i=Cr(c,C4)}function a(){r===1&&n.every(d=>d.isStopped())&&(r=2,t(n))}function c(){io(i),r===0&&(r=1,a())}return{tryAppend:d=>r!==0?!1:n.length>0&&!Die(n[n.length-1].event,d.event)?(c(),!1):(o(d),!0),stop:()=>{c()}}}function Die(e,t){return e.target===t.target&&$ie(e,t)<=Aie&&e.timeStamp-t.timeStamp<=C4}function $ie(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function Mie(e,t,n=St.ALLOW){const r=new Map,{actionNameAttribute:i}=t,o=qO(e,cb)||i&&qO(e,i);return o?{name:o,nameSource:"custom_attribute"}:n===St.MASK?{name:h4,nameSource:"mask_placeholder"}:GO(e,Pie,t,r)||GO(e,zie,t,r)||{name:"",nameSource:"blank"}}function qO(e,t){const n=e.closest(`[${t}]`);if(!n)return;const r=n.getAttribute(t);return k4(E4(r.trim()))}const Pie=[(e,t,n)=>{if("labels"in e&&e.labels&&e.labels.length>0)return xv(e.labels[0],t,n)},e=>{if(e.nodeName==="INPUT"){const t=e,n=t.getAttribute("type");if(n==="button"||n==="submit"||n==="reset")return{name:t.value,nameSource:"text_content"}}},(e,t,n)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return xv(e,t,n)},(e,t,n)=>fm(e,"aria-label",t,n),(e,t,n)=>{const r=e.getAttribute("aria-labelledby");if(r)return{name:r.split(/\s+/).map(i=>Uie(e,i)).filter(i=>!!i).map(i=>j4(i,t,n)).join(" "),nameSource:"text_content"}},(e,t,n)=>fm(e,"alt",t,n),(e,t,n)=>fm(e,"name",t,n),(e,t,n)=>fm(e,"title",t,n),(e,t,n)=>fm(e,"placeholder",t,n),(e,t,n)=>{if("options"in e&&e.options.length>0)return xv(e.options[0],t,n)}],zie=[(e,t,n)=>xv(e,t,n)],Lie=10;function GO(e,t,n,r){let i=e,o=0;for(;o<=Lie&&i&&i.nodeName!=="BODY"&&i.nodeName!=="HTML"&&i.nodeName!=="HEAD";){for(const a of t){const c=a(i,n,r);if(c){const{name:d,nameSource:f}=c,p=d&&d.trim();if(p)return{name:k4(E4(p)),nameSource:f}}}if(i.nodeName==="FORM")break;i=i.parentElement,o+=1}}function E4(e){return e.replace(/\s+/g," ")}function k4(e){return e.length>100?`${BC(e,100)} [...]`:e}function Uie(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function fm(e,t,n,r){const{enablePrivacyForActionName:i,defaultPrivacyLevel:o}=n;let a=e.getAttribute(t);if(a&&i){const c=db(e,o,r);Nie(e.tagName,t,a,c,n)&&(a=_4(a,h4))}else a||(a="");return{name:a,nameSource:"standard_attribute"}}function xv(e,t,n){return{name:j4(e,t,n)||"",nameSource:"text_content"}}function j4(e,t,n){if(e.isContentEditable)return;const{enablePrivacyForActionName:r,actionNameAttribute:i,defaultPrivacyLevel:o}=t;if(_p(el.USE_TREE_WALKER_FOR_ACTION_NAME))return Fie(e,i,r,o,n);if("innerText"in e){let a=e.innerText;const c=d=>{const f=e.querySelectorAll(d);for(let p=0;p<f.length;p+=1){const h=f[p];if("innerText"in h){const v=h.innerText;v&&v.trim().length>0&&(a=a.replace(v,""))}}};return c(`[${cb}]`),i&&c(`[${i}]`),r&&c(`${Bl(St.HIDDEN)}, ${Bl(St.MASK)}`),a}return e.textContent}function Fie(e,t,n,r,i){const o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,c);let a="";for(;o.nextNode();){const d=o.currentNode;if(Za(d)){(d.nodeName==="BR"||d.nodeName==="P"||["block","flex","grid","list-item","table","table-caption"].includes(getComputedStyle(d).display))&&(a+=" ");continue}a+=d.textContent||""}return a.replace(/\s+/g," ").trim();function c(d){const f=db(d,r,i);if(n&&f&&x4(d,f))return NodeFilter.FILTER_REJECT;if(Za(d)){if(d.hasAttribute(cb)||t&&d.hasAttribute(t))return NodeFilter.FILTER_REJECT;const p=getComputedStyle(d);if(p.visibility!=="visible"||p.display==="none"||p.contentVisibility&&p.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}function Vie(e,{onPointerDown:t,onPointerUp:n}){let r,i={selection:!1,input:!1,scroll:!1},o;const a=[Cn(e,window,"pointerdown",c=>{ZO(c)&&(r=KO(),i={selection:!1,input:!1,scroll:!1},o=t(c))},{capture:!0}),Cn(e,window,"selectionchange",()=>{(!r||!KO())&&(i.selection=!0)},{capture:!0}),Cn(e,window,"scroll",()=>{i.scroll=!0},{capture:!0,passive:!0}),Cn(e,window,"pointerup",c=>{if(ZO(c)&&o){const d=i;n(o,c,()=>d),o=void 0}},{capture:!0}),Cn(e,window,"input",()=>{i.input=!0},{capture:!0})];return{stop:()=>{a.forEach(c=>c.stop())}}}function KO(){const e=window.getSelection();return!e||e.isCollapsed}function ZO(e){return e.target instanceof Element&&e.isPrimary!==!1}const YO=3;function Bie(e,t){if(Hie(e))return t.addFrustration(um.RAGE_CLICK),e.some(WO)&&t.addFrustration(um.DEAD_CLICK),t.hasError&&t.addFrustration(um.ERROR_CLICK),{isRage:!0};const n=e.some(r=>r.getUserActivity().selection);return e.forEach(r=>{r.hasError&&r.addFrustration(um.ERROR_CLICK),WO(r)&&!n&&r.addFrustration(um.DEAD_CLICK)}),{isRage:!1}}function Hie(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(YO-1);t+=1)if(e[t+YO-1].event.timeStamp-e[t].event.timeStamp<=Rr)return!0;return!1}const qie='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function WO(e){if(e.hasPageActivity||e.getUserActivity().input||e.getUserActivity().scroll)return!1;let t=e.event.target;return t.tagName==="LABEL"&&t.hasAttribute("for")&&(t=document.getElementById(t.getAttribute("for"))),!t||!t.matches(qie)}const R4=10*Rr,zm=new Map;function Gie(e){const t=zm.get(e);return zm.delete(e),t}function I4(e,t){zm.set(e,t),zm.forEach((n,r)=>{Pn(r,Oi())>R4&&zm.delete(r)})}const Kie=5*Fr;function Zie(e,t,n,r){const i=Gd({expireDelay:Kie}),o=new At;let a;e.subscribe(10,()=>{i.reset()}),e.subscribe(5,p),e.subscribe(11,h=>{h.reason===td.UNLOADING&&p()});const{stop:c}=Vie(r,{onPointerDown:h=>Yie(r,e,t,h,n),onPointerUp:({clickActionBase:h,hadActivityOnPointerDown:v},y,b)=>{Wie(r,e,t,n,i,o,f,h,y,b,v)}});return{stop:()=>{p(),o.notify(),c()},actionContexts:{findActionId:h=>i.findAll(h)}};function f(h){if(!a||!a.tryAppend(h)){const v=h.clone();a=Oie(h,y=>{Qie(y,v)})}}function p(){a&&a.stop()}}function Yie(e,t,n,r,i){let o;if(e.enablePrivacyForActionName?o=db(r.target,e.defaultPrivacyLevel):o=St.ALLOW,o===St.HIDDEN)return;const a=Xie(r,o,e);let c=!1;return nE(t,n,i,e,d=>{c=d.hadActivity},p4),{clickActionBase:a,hadActivityOnPointerDown:()=>c}}function Wie(e,t,n,r,i,o,a,c,d,f,p){var h;const v=N4(t,i,f,c,d);a(v);const y=(h=c?.target)===null||h===void 0?void 0:h.selector;y&&I4(d.timeStamp,y);const{stop:b}=nE(t,n,r,e,E=>{E.hadActivity&&E.end<v.startClocks.timeStamp?v.discard():E.hadActivity?v.stop(E.end):p()?v.stop(v.startClocks.timeStamp):v.stop()},R4),S=t.subscribe(5,({endClocks:E})=>{v.stop(E.timeStamp)}),C=o.subscribe(()=>{v.stop()});v.stopObservable.subscribe(()=>{S.unsubscribe(),b(),C.unsubscribe()})}function Xie(e,t,n){const r=e.target.getBoundingClientRect(),i=Ip(e.target,n.actionNameAttribute);i&&I4(e.timeStamp,i);const{name:o,nameSource:a}=Mie(e.target,n,t);return{type:eE.CLICK,target:{width:Math.round(r.width),height:Math.round(r.height),selector:i},position:{x:Math.round(e.clientX-r.left),y:Math.round(e.clientY-r.top)},name:o,nameSource:a}}function N4(e,t,n,r,i){const o=kr(),a=nr(),c=t.add(o,a.relative),d=f4({lifeCycle:e,isChildEvent:b=>b.action!==void 0&&(Array.isArray(b.action.id)?b.action.id.includes(o):b.action.id===o)});let f=0,p;const h=[],v=new At;function y(b){f===0&&(p=b,f=1,p?c.close(VC(p)):c.remove(),d.stop(),v.notify())}return{event:i,stop:y,stopObservable:v,get hasError(){return d.eventCounts.errorCount>0},get hasPageActivity(){return p!==void 0},getUserActivity:n,addFrustration:b=>{h.push(b)},startClocks:a,isStopped:()=>f===1||f===2,clone:()=>N4(e,t,n,r,i),validate:b=>{if(y(),f!==1)return;const{resourceCount:S,errorCount:C,longTaskCount:E}=d.eventCounts,k={duration:p&&Pn(a.timeStamp,p),startClocks:a,id:o,frustrationTypes:h,counts:{resourceCount:S,errorCount:C,longTaskCount:E},events:b??[i],event:i,...r};e.notify(0,k),f=2},discard:()=>{y(),f=2}}}function Qie(e,t){const{isRage:n}=Bie(e,t);n?(e.forEach(r=>r.discard()),t.stop(hr()),t.validate(e.map(r=>r.event))):(t.discard(),e.forEach(r=>r.validate()))}function Jie(e,t,n,r,i){const{unsubscribe:o}=e.subscribe(0,d=>{e.notify(12,XO(d))});t.register(0,({startTime:d,eventType:f})=>{if(f!==vt.ERROR&&f!==vt.RESOURCE&&f!==vt.LONG_TASK)return Di;const p=a.findActionId(d);return p?{type:f,action:{id:p}}:Di}),t.register(1,({startTime:d})=>({action:{id:a.findActionId(d)}}));let a={findActionId:Ht},c=Ht;return i.trackUserInteractions&&({actionContexts:a,stop:c}=Zie(e,n,r,i)),{addAction:d=>{e.notify(12,XO(d))},actionContexts:a,stop:()=>{o(),c()}}}function XO(e){const t=xS(e)?{action:{id:e.id,loading_time:d4(gt(e.duration)),frustration:{type:e.frustrationTypes},error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}},_dd:{action:{target:e.target,position:e.position,name_source:e.nameSource}}}:{context:e.context},n=Ka({action:{id:kr(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:vt.ACTION},t),r=xS(e)?e.duration:void 0,i=xS(e)?{events:e.events}:{handlingStack:e.handlingStack};return{rawRumEvent:n,duration:r,startTime:e.startClocks.relative,domainContext:i}}function xS(e){return e.type!==eE.CUSTOM}function eoe(e){const t=Ine([Yy.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function toe(e,t){const n=dte(e,[Jm.cspViolation,Jm.intervention]).subscribe(r=>t.notify(r));return{stop:()=>{n.unsubscribe()}}}function noe(e,t,n){const r=new At;return n.subscribe(i=>{i.type===0&&r.notify(i.error)}),eoe(r),toe(t,r),r.subscribe(i=>e.notify(14,{error:i})),roe(e)}function roe(e){return e.subscribe(14,({error:t})=>{e.notify(12,ioe(t))}),{addError:({error:t,handlingStack:n,componentStack:r,startClocks:i,context:o})=>{const a=ZC({originalError:t,handlingStack:n,componentStack:r,startClocks:i,nonErrorPrefix:"Provided",source:Hd.CUSTOM,handling:"handled"});a.context=Ka(a.context,o),e.notify(14,{error:a})}}}function ioe(e){const t={date:e.startClocks.timeStamp,error:{id:kr(),message:e.message,source:e.source,stack:e.stack,handling_stack:e.handlingStack,component_stack:e.componentStack,type:e.type,handling:e.handling,causes:e.causes,source_type:"browser",fingerprint:e.fingerprint,csp:e.csp},type:vt.ERROR,context:e.context},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const QO=new WeakSet;function ooe(e){if(!performance||!("getEntriesByName"in performance))return;const t=performance.getEntriesByName(e.url,"resource");if(!t.length||!("toJSON"in t[0]))return;const n=t.filter(r=>!QO.has(r)).filter(r=>s4(r)&&l4(r)).filter(r=>aoe(r,e.startClocks.relative,T4({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return QO.add(n[0]),n[0].toJSON()}function T4(e){return Bd(e.startTime,e.duration)}function aoe(e,t,n){return e.startTime>=t-1&&T4(e)<=Bd(n,1)}const soe=2*Fr;function loe(e){const t=coe(e)||uoe(e);if(!(!t||t.traceTime<=Lr()-soe))return t.traceId}function coe(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return A4(t&&t.content,n&&n.content)}function uoe(e){const t=doe(e);if(t)return A4(Wm(t,"trace-id"),Wm(t,"trace-time"))}function A4(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function doe(e){for(let t=0;t<e.childNodes.length;t+=1){const n=JO(e.childNodes[t]);if(n)return n}if(e.body)for(let t=e.body.childNodes.length-1;t>=0;t-=1){const n=e.body.childNodes[t],r=JO(n);if(r)return r;if(!r1(n))break}}function JO(e){if(e&&uie(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function O4(){if(Nc($t.NAVIGATION)){const n=performance.getEntriesByType($t.NAVIGATION)[0];if(n)return n}const e=foe(),t={entryType:$t.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:e.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...t,toJSON:void 0}),...e};return t}function foe(){const e={},t=performance.timing;for(const n in t)if(wp(t[n])){const r=n,i=t[r];e[r]=i===0?0:VC(i)}return e}function moe(e,t,n=O4){XC(e,"interactive",()=>{const r=n(),i=Object.assign(r.toJSON(),{entryType:$t.RESOURCE,initiatorType:o4,duration:r.responseEnd,traceId:loe(document),toJSON:()=>({...i,toJSON:void 0})});t(i)})}const poe=1e3;function hoe(e){const t=new Set,n=e.subscribe(8,r=>{t.add(r),t.size>poe&&(Rp("Too many requests"),t.delete(t.values().next().value))});return{getMatchingRequest(r){let i=1/0,o;for(const a of t){const c=r.startTime-a.startClocks.relative;0<=c&&c<i&&a.url===r.name&&(i=Math.abs(c),o=a)}return o&&t.delete(o),o},stop(){n.unsubscribe()}}}function goe(e,t,n,r=Rne(),i=moe){let o;const a=t.trackEarlyRequests;a?o=hoe(e):e.subscribe(8,f=>{d(()=>voe(f,t,n))});const c=ca(t,{type:$t.RESOURCE,buffered:!0}).subscribe(f=>{for(const p of f)(a||!a4(p))&&d(()=>eD(p,t,n,o))});i(t,f=>{d(()=>eD(f,t,n,o))});function d(f){r.push(()=>{const p=f();p&&e.notify(12,p)})}return{stop:()=>{r.stop(),c.unsubscribe()}}}function voe(e,t,n){const r=ooe(e);return D4(r,e,n,t)}function eD(e,t,n,r){const i=a4(e)&&r?r.getMatchingRequest(e):void 0;return D4(e,i,n,t)}function D4(e,t,n,r){if(!e&&!t)return;const i=t?woe(t,r):Soe(e,r);if(!r.trackResources&&!i)return;const o=e?Jy(e.startTime):t.startClocks,a=e?Vre(e):_oe(n,o,t.duration),c=t&&yoe(t,r),d=Ka({date:o.timeStamp,resource:{id:kr(),duration:gt(a),type:t?t.type===lb.XHR?$r.XHR:$r.FETCH:Fre(e),method:t?t.method:void 0,status_code:t?t.status:Coe(e.responseStatus),url:t?Wre(t.url):e.name,protocol:e&&qre(e),delivery_type:e&&Gre(e),graphql:c},type:vt.RESOURCE,_dd:{discarded:!r.trackResources}},i,e&&xoe(e));return{startTime:o.relative,duration:a,rawRumEvent:d,domainContext:boe(e,t)}}function yoe(e,t){const n=c4(e.url,t);if(n)return Qre(e,n)}function boe(e,t){if(t){const n={performanceEntry:e,isAborted:t.isAborted,handlingStack:t.handlingStack};return t.type===lb.XHR?{xhr:t.xhr,...n}:{requestInput:t.input,requestInit:t.init,response:t.response,error:t.error,...n}}return{performanceEntry:e}}function xoe(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...Kre(e),...Bre(e)}}}function woe(e,t){if(e.traceSampled&&e.traceId&&e.spanId)return{_dd:{span_id:e.spanId.toString(),trace_id:e.traceId.toString(),rule_psr:t.rulePsr}}}function Soe(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:t4().toString(),rule_psr:t.rulePsr}}}function _oe(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function Coe(e){return e===0?void 0:e}function Eoe(e,t,n){const{stop:r,eventCounts:i}=f4({lifeCycle:e,isChildEvent:o=>o.view.id===t,onChange:n});return{stop:r,eventCounts:i}}const koe=10*Fr;function joe(e,t,n){return{stop:ca(e,{type:$t.PAINT,buffered:!0}).subscribe(i=>{const o=i.find(a=>a.name==="first-contentful-paint"&&a.startTime<t.timeStamp&&a.startTime<koe);o&&n(o.startTime)}).unsubscribe}}function Roe(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(Pn(e,Oi()))})})}function Ioe(e,t,n){const r=ca(e,{type:$t.FIRST_INPUT,buffered:!0}).subscribe(i=>{const o=i.find(a=>a.startTime<t.timeStamp);if(o){const a=Pn(o.startTime,o.processingStart);let c;o.target&&Za(o.target)&&(c=Ip(o.target,e.actionNameAttribute)),n({delay:a>=0?a:0,time:o.startTime,targetSelector:c})}});return{stop:()=>{r.unsubscribe()}}}function Noe(e,t,n=O4){return Ooe(e,()=>{const r=n();Aoe(r)||t(Toe(r))})}function Toe(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=Oi()?e.responseStart:void 0}}function Aoe(e){return e.loadEventEnd<=0}function Ooe(e,t){let n;const{stop:r}=XC(e,"complete",()=>{n=Cr(()=>t())});return{stop:()=>{r(),io(n)}}}const Doe=10*Fr;function $oe(e,t,n,r){let i=1/0;const{stop:o}=tl(e,n,["pointerdown","keydown"],d=>{i=d.timeStamp},{capture:!0,once:!0});let a=0;const c=ca(e,{type:$t.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(d=>{const f=ez(d,p=>p.entryType===$t.LARGEST_CONTENTFUL_PAINT&&p.startTime<i&&p.startTime<t.timeStamp&&p.startTime<Doe&&p.size>a);if(f){let p;f.element&&(p=Ip(f.element,e.actionNameAttribute)),r({value:f.startTime,targetSelector:p,resourceUrl:Moe(f)}),a=f.size}});return{stop:()=>{o(),c.unsubscribe()}}}function Moe(e){return e.url===""?void 0:e.url}function $4(e,t,n=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:Ht};if(Nc($t.VISIBILITY_STATE)){const o=performance.getEntriesByType($t.VISIBILITY_STATE).filter(a=>a.name==="hidden").find(a=>a.startTime>=t.relative);if(o)return{timeStamp:o.startTime,stop:Ht}}let r=1/0;const{stop:i}=tl(e,n,["pagehide","visibilitychange"],o=>{(o.type==="pagehide"||document.visibilityState==="hidden")&&(r=o.timeStamp,i())},{capture:!0});return{get timeStamp(){return r},stop:i}}function Poe(e,t,n,r){const i={},{stop:o}=Noe(e,h=>{n(h.loadEvent),i.navigationTimings=h,r()}),a=$4(e,t),{stop:c}=joe(e,a,h=>{i.firstContentfulPaint=h,r()}),{stop:d}=$oe(e,a,window,h=>{i.largestContentfulPaint=h,r()}),{stop:f}=Ioe(e,a,h=>{i.firstInput=h,r()});function p(){o(),c(),d(),f(),a.stop()}return{stop:p,initialViewMetrics:i}}const i1=(e,t)=>e*t,zoe=(e,t)=>{const n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),o=Math.min(e.bottom,t.bottom);return n>=i||r>=o?0:i1(i-n,o-r)},tD=e=>{const t=i1(e.previousRect.width,e.previousRect.height),n=i1(e.currentRect.width,e.currentRect.height),r=zoe(e.previousRect,e.currentRect);return t+n-r};function Loe(e,t,n){if(!Hoe())return{stop:Ht};let r=0,i;n({value:0});const o=Boe(),a=ca(e,{type:$t.LAYOUT_SHIFT,buffered:!0}).subscribe(c=>{var d;for(const f of c){if(f.hadRecentInput||f.startTime<t)continue;const{cumulatedValue:p,isMaxValue:h}=o.update(f);if(h){const v=Uoe(f.sources);i={target:v?.node?new WeakRef(v.node):void 0,time:Pn(t,f.startTime),previousRect:v?.previousRect,currentRect:v?.currentRect,devicePixelRatio:window.devicePixelRatio}}if(p>r){r=p;const v=(d=i?.target)===null||d===void 0?void 0:d.deref();n({value:Mm(r,4),targetSelector:v&&Ip(v,e.actionNameAttribute),time:i?.time,previousRect:i?.previousRect?nD(i.previousRect):void 0,currentRect:i?.currentRect?nD(i.currentRect):void 0,devicePixelRatio:i?.devicePixelRatio})}}});return{stop:()=>{a.unsubscribe()}}}function Uoe(e){let t;for(const n of e)if(n.node&&Za(n.node)){const r=tD(n);(!t||tD(t)<r)&&(t=n)}return t}function nD({x:e,y:t,width:n,height:r}){return{x:e,y:t,width:n,height:r}}const Foe=5*Rr,Voe=Rr;function Boe(){let e=0,t,n,r=0;return{update:i=>{const o=t===void 0||i.startTime-n>=Voe||i.startTime-t>=Foe;let a;return o?(t=n=i.startTime,r=e=i.value,a=!0):(e+=i.value,n=i.startTime,a=i.value>r,a&&(r=i.value)),{cumulatedValue:e,isMaxValue:a}}}}function Hoe(){return Nc($t.LAYOUT_SHIFT)&&"WeakRef"in window}let wv,M4=0,wS=1/0,SS=0;function qoe(){"interactionCount"in performance||wv||(wv=new window.PerformanceObserver(bt(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(wS=Math.min(wS,n.interactionId),SS=Math.max(SS,n.interactionId),M4=(SS-wS)/7+1)})})),wv.observe({type:"event",buffered:!0,durationThreshold:0}))}const rD=()=>wv?M4:window.performance.interactionCount||0,iD=10,Goe=1*Fr;function Koe(e,t,n){if(!Woe())return{getInteractionToNextPaint:()=>{},setViewEnd:Ht,stop:Ht};const{getViewInteractionCount:r,stopViewInteractionCount:i}=Yoe(n);let o=1/0;const a=Zoe(r);let c=-1,d,f;function p(y){for(const S of y)S.interactionId&&S.startTime>=t&&S.startTime<=o&&a.process(S);const b=a.estimateP98Interaction();b&&b.duration!==c&&(c=b.duration,f=Pn(t,b.startTime),d=Gie(b.startTime),!d&&b.target&&Za(b.target)&&(d=Ip(b.target,e.actionNameAttribute)))}const h=ca(e,{type:$t.FIRST_INPUT,buffered:!0}).subscribe(p),v=ca(e,{type:$t.EVENT,durationThreshold:40,buffered:!0}).subscribe(p);return{getInteractionToNextPaint:()=>{if(c>=0)return{value:Math.min(c,Goe),targetSelector:d,time:f};if(r())return{value:0}},setViewEnd:y=>{o=y,i()},stop:()=>{v.unsubscribe(),h.unsubscribe()}}}function Zoe(e){const t=[];function n(){t.sort((r,i)=>i.duration-r.duration).splice(iD)}return{process(r){const i=t.findIndex(a=>r.interactionId===a.interactionId),o=t[t.length-1];i!==-1?r.duration>t[i].duration&&(t[i]=r,n()):(t.length<iD||r.duration>o.duration)&&(t.push(r),n())},estimateP98Interaction(){const r=Math.min(t.length-1,Math.floor(e()/50));return t[r]}}}function Yoe(e){qoe();const t=e===La.INITIAL_LOAD?0:rD();let n={stopped:!1};function r(){return rD()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:r(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:r()}}}}function Woe(){return Nc($t.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function Xoe(e,t,n,r,i,o,a){let c=i===La.INITIAL_LOAD,d=!0;const f=[],p=$4(r,o);function h(){if(!d&&!c&&f.length>0){const y=Math.max(...f);y<p.timeStamp-o.relative&&a(y)}}const{stop:v}=nE(e,t,n,r,y=>{d&&(d=!1,y.hadActivity&&f.push(Pn(o.timeStamp,y.end)),h())});return{stop:()=>{v(),p.stop()},setLoadEvent:y=>{c&&(c=!1,f.push(y),h())}}}function wAe(){let e;const t=window.visualViewport;return t?e=t.pageLeft-t.offsetLeft:window.scrollX!==void 0?e=window.scrollX:e=window.pageXOffset||0,Math.round(e)}function Qoe(){let e;const t=window.visualViewport;return t?e=t.pageTop-t.offsetTop:window.scrollY!==void 0?e=window.scrollY:e=window.pageYOffset||0,Math.round(e)}let _S;function Joe(e){return _S||(_S=eae(e)),_S}function eae(e){return new At(t=>{const{throttled:n}=eb(()=>{t.notify(rE())},200);return Cn(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function rE(){const e=window.visualViewport;return e?{width:Number(e.width*e.scale),height:Number(e.height*e.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}const tae=Rr;function nae(e,t,n,r=iae(e)){let i=0,o=0,a=0;const c=r.subscribe(({scrollDepth:d,scrollTop:f,scrollHeight:p})=>{let h=!1;if(d>i&&(i=d,h=!0),p>o){o=p;const v=Oi();a=Pn(t.relative,v),h=!0}h&&n({maxDepth:Math.min(i,o),maxDepthScrollTop:f,maxScrollHeight:o,maxScrollHeightTime:a})});return{stop:()=>c.unsubscribe()}}function rae(){const e=Qoe(),{height:t}=rE(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),r=Math.round(t+e);return{scrollHeight:n,scrollDepth:r,scrollTop:e}}function iae(e,t=tae){return new At(n=>{function r(){n.notify(rae())}if(window.ResizeObserver){const i=eb(r,t,{leading:!1,trailing:!0}),o=document.scrollingElement||document.documentElement,a=new ResizeObserver(bt(i.throttled));o&&a.observe(o);const c=Cn(e,window,"scroll",i.throttled,{passive:!0});return()=>{i.cancel(),a.disconnect(),c.stop()}}})}function oae(e,t,n,r,i,o,a){const c={},{stop:d,setLoadEvent:f}=Xoe(e,t,n,r,o,a,S=>{c.loadingTime=S,i()}),{stop:p}=nae(r,a,S=>{c.scroll=S}),{stop:h}=Loe(r,a.relative,S=>{c.cumulativeLayoutShift=S,i()}),{stop:v,getInteractionToNextPaint:y,setViewEnd:b}=Koe(r,a.relative,o);return{stop:()=>{d(),h(),p()},stopINPTracking:v,setLoadEvent:f,setViewEnd:b,getCommonViewMetrics:()=>(c.interactionToNextPaint=y(),c)}}function aae(e,t){const{stop:n}=Cn(e,window,"pageshow",r=>{r.persisted&&t(r)},{capture:!0});return n}function sae(e,t,n){Roe(e.relative,r=>{t.firstContentfulPaint=r,t.largestContentfulPaint={value:r},n()})}const lae=3e3,cae=5*Fr,uae=5*Fr;function dae(e,t,n,r,i,o,a,c){const d=new Set;let f=v(La.INITIAL_LOAD,WP(),c),p;y();let h;a&&(h=b(o),i.trackBfcacheViews&&(p=aae(i,S=>{f.end();const C=Jy(S.timeStamp);f=v(La.BF_CACHE,C,void 0)})));function v(S,C,E){const k=fae(t,n,r,i,e,S,C,E);return d.add(k),k.stopObservable.subscribe(()=>{d.delete(k)}),k}function y(){t.subscribe(10,()=>{f=v(La.ROUTE_CHANGE,void 0,{name:f.name,service:f.service,version:f.version,context:f.contextManager.getContext()})}),t.subscribe(9,()=>{f.end({sessionIsActive:!1})})}function b(S){return S.subscribe(({oldLocation:C,newLocation:E})=>{pae(C,E)&&(f.end(),f=v(La.ROUTE_CHANGE))})}return{addTiming:(S,C=hr())=>{f.addTiming(S,C)},startView:(S,C)=>{f.end({endClocks:C}),f=v(La.ROUTE_CHANGE,C,S)},setViewContext:S=>{f.contextManager.setContext(S)},setViewContextProperty:(S,C)=>{f.contextManager.setContextProperty(S,C)},setViewName:S=>{f.setViewName(S)},getViewContext:()=>f.contextManager.getContext(),stop:()=>{h&&h.unsubscribe(),p&&p(),f.end(),d.forEach(S=>S.stop())}}}function fae(e,t,n,r,i,o,a=nr(),c){const d=kr(),f=new At,p={};let h=0,v;const y=Ym(i),b=sb();let S=!0,C=c?.name;const E=c?.service||r.service,k=c?.version||r.version,j=c?.context;j&&b.setContext(j);const I={id:d,name:C,startClocks:a,service:E,version:k,context:j};e.notify(1,I),e.notify(2,I);const{throttled:A,cancel:N}=eb(D,lae,{leading:!1}),{setLoadEvent:T,setViewEnd:z,stop:L,stopINPTracking:G,getCommonViewMetrics:J}=oae(e,t,n,r,te,o,a),{stop:Y,initialViewMetrics:W}=o===La.INITIAL_LOAD?Poe(r,a,T,te):{stop:Ht,initialViewMetrics:{}};o===La.BF_CACHE&&sae(a,W,te);const{stop:F,eventCounts:Z}=Eoe(e,d,te),M=Vd(D,cae),K=e.subscribe(11,P=>{P.reason===td.UNLOADING&&D()});D(),b.changeObservable.subscribe(te);function U(){e.notify(3,{id:d,name:C,context:b.getContext(),startClocks:a,sessionIsActive:S})}function te(){U(),A()}function D(){N(),U(),h+=1;const P=v===void 0?hr():v.timeStamp;e.notify(4,{customTimings:p,documentVersion:h,id:d,name:C,service:E,version:k,context:b.getContext(),loadingType:o,location:y,startClocks:a,commonViewMetrics:J(),initialViewMetrics:W,duration:Pn(a.timeStamp,P),isActive:v===void 0,sessionIsActive:S,eventCounts:Z})}return{get name(){return C},service:E,version:k,contextManager:b,stopObservable:f,end(P={}){var V,O;v||(v=(V=P.endClocks)!==null&&V!==void 0?V:nr(),S=(O=P.sessionIsActive)!==null&&O!==void 0?O:!0,e.notify(5,{endClocks:v}),e.notify(6,{endClocks:v}),Qy(M),z(v.relative),L(),K.unsubscribe(),D(),Cr(()=>{this.stop()},uae))},stop(){Y(),F(),G(),f.notify()},addTiming(P,V){if(v)return;const O=IJ(V)?V:Pn(a.timeStamp,V);p[mae(P)]=O,te()},setViewName(P){C=P,D()}}}function mae(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&mt.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function pae(e,t){return e.pathname!==t.pathname||!hae(t.hash)&&oD(t.hash)!==oD(e.hash)}function hae(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function oD(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function gae(e,t,n,r,i,o,a,c,d,f){return e.subscribe(4,p=>e.notify(12,vae(p,n,c))),t.register(0,({startTime:p,eventType:h})=>{const v=d.findView(p);return v?{type:h,service:v.service,version:v.version,context:v.context,view:{id:v.id,name:v.name}}:nl}),t.register(1,({startTime:p})=>{var h;return{view:{id:(h=d.findView(p))===null||h===void 0?void 0:h.id}}}),dae(r,e,i,o,n,a,!n.trackViewsManually,f)}function vae(e,t,n){var r,i,o,a,c,d,f,p,h,v,y,b,S,C,E,k,j,I;const A=n.getReplayStats(e.id),N=(i=(r=e.commonViewMetrics)===null||r===void 0?void 0:r.cumulativeLayoutShift)===null||i===void 0?void 0:i.devicePixelRatio,T={_dd:{document_version:e.documentVersion,replay_stats:A,cls:N?{device_pixel_ratio:N}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:vt.VIEW,view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:(o=e.commonViewMetrics.cumulativeLayoutShift)===null||o===void 0?void 0:o.value,cumulative_layout_shift_time:gt((a=e.commonViewMetrics.cumulativeLayoutShift)===null||a===void 0?void 0:a.time),cumulative_layout_shift_target_selector:(c=e.commonViewMetrics.cumulativeLayoutShift)===null||c===void 0?void 0:c.targetSelector,first_byte:gt((d=e.initialViewMetrics.navigationTimings)===null||d===void 0?void 0:d.firstByte),dom_complete:gt((f=e.initialViewMetrics.navigationTimings)===null||f===void 0?void 0:f.domComplete),dom_content_loaded:gt((p=e.initialViewMetrics.navigationTimings)===null||p===void 0?void 0:p.domContentLoaded),dom_interactive:gt((h=e.initialViewMetrics.navigationTimings)===null||h===void 0?void 0:h.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:gt(e.initialViewMetrics.firstContentfulPaint),first_input_delay:gt((v=e.initialViewMetrics.firstInput)===null||v===void 0?void 0:v.delay),first_input_time:gt((y=e.initialViewMetrics.firstInput)===null||y===void 0?void 0:y.time),first_input_target_selector:(b=e.initialViewMetrics.firstInput)===null||b===void 0?void 0:b.targetSelector,interaction_to_next_paint:gt((S=e.commonViewMetrics.interactionToNextPaint)===null||S===void 0?void 0:S.value),interaction_to_next_paint_time:gt((C=e.commonViewMetrics.interactionToNextPaint)===null||C===void 0?void 0:C.time),interaction_to_next_paint_target_selector:(E=e.commonViewMetrics.interactionToNextPaint)===null||E===void 0?void 0:E.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:gt((k=e.initialViewMetrics.largestContentfulPaint)===null||k===void 0?void 0:k.value),largest_contentful_paint_target_selector:(j=e.initialViewMetrics.largestContentfulPaint)===null||j===void 0?void 0:j.targetSelector,load_event:gt((I=e.initialViewMetrics.navigationTimings)===null||I===void 0?void 0:I.loadEvent),loading_time:d4(gt(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:yae(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:gt(e.duration)},display:e.commonViewMetrics.scroll?{scroll:{max_depth:e.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:e.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:e.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:gt(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:Hne()}};return fl(e.customTimings)||(T.view.custom_timings=HP(e.customTimings,gt)),{rawRumEvent:T,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function yae({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:r,largestContentfulPaint:i}){return{cls:e&&{score:e.value,timestamp:gt(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:gt(n)},fid:r&&{duration:gt(r.delay),timestamp:gt(r.time),target_selector:r.targetSelector},inp:t&&{duration:gt(t.value),timestamp:gt(t.time),target_selector:t.targetSelector},lcp:i&&{timestamp:gt(i.value),target_selector:i.targetSelector,resource_url:i.resourceUrl}}}const bae="rum";function xae(e,t,n){const r=ine(e,bae,i=>Sae(e,i),n);return r.expireObservable.subscribe(()=>{t.notify(9)}),r.renewObservable.subscribe(()=>{t.notify(10)}),r.sessionStateUpdateObservable.subscribe(({previousState:i,newState:o})=>{if(!i.forcedReplay&&o.forcedReplay){const a=r.findSession();a&&(a.isReplayForced=!0)}}),{findTrackedSession:i=>{const o=r.findSession(i);if(!(!o||o.trackingType==="0"))return{id:o.id,sessionReplay:o.trackingType==="1"?1:o.isReplayForced?2:0,anonymousId:o.anonymousId}},expire:r.expire,expireObservable:r.expireObservable,setForcedReplay:()=>r.updateSessionState({forcedReplay:"1"})}}function wae(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:Mz("records")?1:0};return{findTrackedSession:()=>e,expire:Ht,expireObservable:new At,setForcedReplay:Ht}}function Sae(e,t){return _ae(t)?t:Zl(e.sessionSampleRate)?Zl(e.sessionReplaySampleRate)?"1":"2":"0"}function _ae(e){return e==="0"||e==="1"||e==="2"}function Cae(e,t,n,r,i,o){const a=[e.rumEndpointBuilder];e.replica&&a.push(e.replica.rumEndpointBuilder);const c=Pz({encoder:o(2),request:$z(a,n),flushController:zz({pageMayExitObservable:r,sessionExpireObservable:i})});return t.subscribe(13,d=>{d.type===vt.VIEW?c.upsert(d,d.view.id):c.add(d)}),c}function Eae(e){const t=jp();e.subscribe(13,n=>{t.send("rum",n)})}const kae=kc;function jae(e,t,n,r){const i=Gd({expireDelay:kae});let o;e.subscribe(1,({startClocks:d})=>{const f=r.href;i.add(c({url:f,referrer:o||document.referrer}),d.relative),o=f}),e.subscribe(6,({endClocks:d})=>{i.closeActive(d.relative)});const a=n.subscribe(({newLocation:d})=>{const f=i.find();if(f){const p=Oi();i.closeActive(p),i.add(c({url:d.href,referrer:f.referrer}),p)}});function c({url:d,referrer:f}){return{url:d,referrer:f}}return t.register(0,({startTime:d,eventType:f})=>{const p=i.find(d);return p?{type:f,view:{url:p.url,referrer:p.referrer}}:nl}),{findUrl:d=>i.find(d),stop:()=>{a.unsubscribe(),i.stop()}}}function Rae(e,t){let n=Ym(t);return new At(r=>{const{stop:i}=Iae(e,a),{stop:o}=Nae(e,a);function a(){if(n.href===t.href)return;const c=Ym(t);r.notify({newLocation:c,oldLocation:n}),n=c}return()=>{i(),o()}})}function Iae(e,t){const{stop:n}=ra(aD("pushState"),"pushState",({onPostCall:o})=>{o(t)}),{stop:r}=ra(aD("replaceState"),"replaceState",({onPostCall:o})=>{o(t)}),{stop:i}=Cn(e,window,"popstate",t);return{stop:()=>{n(),r(),i()}}}function Nae(e,t){return Cn(e,window,"hashchange",t)}function aD(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const Tae=kc;function Aae(e,t,n){const r=Gd({expireDelay:Tae});return e.subscribe(1,({startClocks:i})=>{r.add({},i.relative)}),e.subscribe(6,({endClocks:i})=>{r.closeActive(i.relative)}),t.register(0,({startTime:i,eventType:o})=>{if(!n.trackFeatureFlagsForEvents.concat([vt.VIEW,vt.ERROR]).includes(o))return Di;const c=r.find(i);return!c||fl(c)?Di:{type:o,feature_flags:c}}),{addFeatureFlagEvaluation:(i,o)=>{const a=r.find();a&&(a[i]=o)}}}const Oae=10*Rr;let nd,Mg;function Dae(e,t,n){e.metricsEnabled&&(P4(),Mg=!1,t.subscribe(13,()=>{Mg=!0}),n.subscribe(({bytesCount:r,messagesCount:i})=>{Mg&&(Mg=!1,nd.batchCount+=1,lD(nd.batchBytesCount,r),lD(nd.batchMessagesCount,i))}),Vd($ae,Oae))}function $ae(){nd.batchCount!==0&&(ab("Customer data measures",nd),P4())}function sD(){return{min:1/0,max:0,sum:0}}function lD(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function P4(){nd={batchCount:0,batchBytesCount:sD(),batchMessagesCount:sD()}}const Mae=4e3,Pae=500,zae=kc;function Lae(e,t,n=Pae){const r=Gd({expireDelay:zae,maxEntries:Mae});let i;Nc($t.VISIBILITY_STATE)&&performance.getEntriesByType($t.VISIBILITY_STATE).forEach(f=>{const p=f.name==="hidden"?"hidden":"active";a(p,f.startTime)}),a(z4(),Oi());const{stop:o}=tl(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],d=>{a(Fae(d),d.timeStamp)},{capture:!0});function a(d,f=Oi()){d!==i&&(i=d,r.closeActive(f),r.add({state:i,startTime:f},f))}function c(d,f,p){return r.findAll(f,p).some(h=>h.state===d)}return e.register(0,({startTime:d,duration:f=0,eventType:p})=>{if(p===vt.VIEW){const h=r.findAll(d,f);return{type:p,_dd:{page_states:Uae(h,d,n)}}}return p===vt.ACTION||p===vt.ERROR?{type:p,view:{in_foreground:c("active",d,0)}}:Di}),{wasInPageStateDuringPeriod:c,addPageState:a,stop:()=>{o(),r.stop()}}}function Uae(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:r,startTime:i})=>({state:r,start:gt(Pn(t,i))}))}function Fae(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":z4()}function z4(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function Vae(e,t){let n;const r=requestAnimationFrame(bt(()=>{n=rE()})),i=Joe(t).subscribe(o=>{n=o}).unsubscribe;return e.register(0,({eventType:o})=>({type:o,display:n?{viewport:n}:void 0})),{stop:()=>{i(),r&&cancelAnimationFrame(r)}}}function Bae(e,t){const n=window.cookieStore?Hae(e):Gae;return new At(r=>n(t,i=>r.notify(i)))}function Hae(e){return(t,n)=>Cn(e,window.cookieStore,"change",i=>{const o=i.changed.find(a=>a.name===t)||i.deleted.find(a=>a.name===t);o&&n(o.value)}).stop}const qae=Rr;function Gae(e,t){const n=Wm(document.cookie,e),r=Vd(()=>{const i=Wm(document.cookie,e);i!==n&&t(i)},qae);return()=>{Qy(r)}}const cD="datadog-ci-visibility-test-execution-id";function Kae(e,t,n=Bae(e,cD)){var r;let i=zs(cD)||((r=window.Cypress)===null||r===void 0?void 0:r.env("traceId"));const o=n.subscribe(a=>{i=a});return t.register(0,({eventType:a})=>typeof i!="string"?Di:{type:a,session:{type:"ci_test"},ci_test:{test_execution_id:i}}),{stop:()=>{o.unsubscribe()}}}function Zae(e,t){const n=ca(t,{type:$t.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(r=>{for(const i of r){const o=Jy(i.startTime),a={date:o.timeStamp,long_task:{id:kr(),entry_type:Wz.LONG_ANIMATION_FRAME,duration:gt(i.duration),blocking_duration:gt(i.blockingDuration),first_ui_event_timestamp:gt(i.firstUIEventTimestamp),render_start:gt(i.renderStart),style_and_layout_start:gt(i.styleAndLayoutStart),start_time:gt(i.startTime),scripts:i.scripts.map(c=>({duration:gt(c.duration),pause_duration:gt(c.pauseDuration),forced_style_and_layout_duration:gt(c.forcedStyleAndLayoutDuration),start_time:gt(c.startTime),execution_start:gt(c.executionStart),source_url:c.sourceURL,source_function_name:c.sourceFunctionName,source_char_position:c.sourceCharPosition,invoker:c.invoker,invoker_type:c.invokerType,window_attribution:c.windowAttribution}))},type:vt.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:o.relative,duration:i.duration,domainContext:{performanceEntry:i}})}});return{stop:()=>n.unsubscribe()}}function Yae(e,t){const n=ca(t,{type:$t.LONG_TASK,buffered:!0}).subscribe(r=>{for(const i of r){if(i.entryType!==$t.LONG_TASK||!t.trackLongTasks)break;const o=Jy(i.startTime),a={date:o.timeStamp,long_task:{id:kr(),entry_type:Wz.LONG_TASK,duration:gt(i.duration)},type:vt.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:o.relative,duration:i.duration,domainContext:{performanceEntry:i}})}});return{stop(){n.unsubscribe()}}}function Wae(e){e.register(0,({eventType:t})=>{if(!Bz())return Di;const n=Fz(),r=Vz();return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:r,injected:Uz()}}})}function Xae(e,t,n){const r=YC(e),i=n(r);return qC(t).forEach(([o,a])=>o1(e,r,o.split(/\.|(?=\[\])/),a)),i}function o1(e,t,n,r){const[i,...o]=n;if(i==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((a,c)=>o1(a,t[c],o,r));return}if(!(!uD(e)||!uD(t))){if(o.length>0)return o1(e[i],t[i],o,r);Qae(e,i,t[i],r)}}function Qae(e,t,n,r){const i=jc(n);i===r?e[t]=fn(n):r==="object"&&(i==="undefined"||i==="null")&&(e[t]={})}function uD(e){return jc(e)==="object"}const Ou={"view.name":"string","view.url":"string","view.referrer":"string"},Du={context:"object"},$u={service:"string",version:"string"};let L4;function Jae(e,t,n,r,i){L4={[vt.VIEW]:{"view.performance.lcp.resource_url":"string",...Du,...Ou,...$u},[vt.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...Du,...Ou,...$u},[vt.RESOURCE]:{"resource.url":"string","resource.graphql.variables":"string",...Du,...Ou,...$u},[vt.ACTION]:{"action.target.name":"string",...Du,...Ou,...$u},[vt.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...Du,...Ou,...$u},[vt.VITAL]:{...Du,...Ou,...$u}};const o={[vt.ERROR]:fS(vt.ERROR,r,i),[vt.ACTION]:fS(vt.ACTION,r,i),[vt.VITAL]:fS(vt.VITAL,r,i)};t.subscribe(12,({startTime:a,duration:c,rawRumEvent:d,domainContext:f})=>{const p=n.triggerHook(0,{eventType:d.type,startTime:a,duration:c});if(p===nl)return;const h=Ka(p,d,{ddtags:Ez(e).join(",")});ese(h,e.beforeSend,f,o)&&(fl(h.context)&&delete h.context,t.notify(13,h))})}function ese(e,t,n,r){var i;if(t){const a=Xae(e,L4[e.type],c=>t(c,n));if(a===!1&&e.type!==vt.VIEW)return!1;a===!1&&mt.warn("Can't dismiss view events using beforeSend!")}return!((i=r[e.type])===null||i===void 0?void 0:i.isLimitReached())}function tse(e,t,n,r){e.register(0,({eventType:i,startTime:o})=>{const a=t.findTrackedSession(o),c=r.findView(o);if(!a||!c)return nl;let d,f,p;return i===vt.VIEW?(d=n.getReplayStats(c.id)?!0:void 0,f=a.sessionReplay===1,p=c.sessionIsActive?void 0:!1):d=n.isRecording()?!0:void 0,{type:i,session:{id:a.id,type:"user",has_replay:d,sampled_for_replay:f,is_active:p}}}),e.register(1,({startTime:i})=>{const o=t.findTrackedSession(i);return o?{session:{id:o.id}}:Di})}function nse(e){e.register(0,({eventType:t})=>({type:t,connectivity:jz()}))}function rse(e,t,n){e.register(0,({eventType:r})=>{const i=t.source;return{type:r,_dd:{format_version:2,drift:jJ(),configuration:{session_sample_rate:Mm(t.sessionSampleRate,3),session_replay_sample_rate:Mm(t.sessionReplaySampleRate,3),profiling_sample_rate:Mm(t.profilingSampleRate,3),beta_encode_cookie_options:t.betaEncodeCookieOptions},browser_sdk_version:yd()?"6.24.1":void 0,sdk_name:n},application:{id:t.applicationId},date:hr(),source:i}}),e.register(1,()=>({application:{id:t.applicationId}}))}function ise(e,t){e.register(1,()=>t.isGranted()?Di:nl)}const ose=zte,ase=[vt.ACTION,vt.ERROR,vt.LONG_TASK,vt.RESOURCE,vt.VITAL];function sse(e){return{addEvent:(t,n,r,i)=>{ase.includes(n.type)&&e.notify(12,{startTime:t,rawRumEvent:n,domainContext:r,duration:i})}}}function lse(e,t){if(!t.metricsEnabled)return{stop:Ht};const{unsubscribe:n}=e.subscribe(4,({initialViewMetrics:r})=>{!r.largestContentfulPaint||!r.navigationTimings||(ab("Initial view metrics",{metrics:cse(r.largestContentfulPaint,r.navigationTimings)}),n())});return{stop:n}}function cse(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function use(e,t,n,r,i,o,a,c,d){const f=[],p=new Pre,h=ose();p.subscribe(13,ie=>kz("rum",ie));const v=ie=>{p.notify(14,{error:ie}),Rp("Error reported to customer",{"error.message":ie.message})},y=Dte(e),b=y.subscribe(ie=>{p.notify(11,ie)});f.push(()=>b.unsubscribe());const S=Bte("browser-rum-sdk",e,h,v,y,i);f.push(S.stop);const C=yd()?wae():xae(e,p,o);if(yd())Eae(p);else{const ie=Cae(e,p,v,y,C.expireObservable,i);f.push(()=>ie.stop()),Dae(S,p,ie.flushController.flushObservable)}const E=Ore(),k=Rae(e,location),{observable:j,stop:I}=$re();f.push(I),rse(h,e,d);const A=Lae(h,e),N=Lre(p);f.push(()=>N.stop());const T=jae(p,h,k,location);f.push(()=>T.stop());const z=Aae(p,h,e);tse(h,C,t,N),nse(h),ise(h,o);const L=Une(h,e,"rum"),G=Fne(h,e,C,"rum"),J=Lne(h,e,"rum"),{actionContexts:Y,addAction:W,addEvent:F,stop:Z}=dse(p,h,e,A,E,j,v);f.push(Z);const{addTiming:M,startView:K,setViewName:U,setViewContext:te,setViewContextProperty:D,getViewContext:P,stop:V}=gae(p,h,e,location,E,j,k,t,N,r);f.push(V);const{stop:O}=lse(p,S);f.push(O);const{stop:ee}=goe(p,e,A);if(f.push(ee),e.trackLongTasks)if(Nc($t.LONG_ANIMATION_FRAME)){const{stop:ie}=Zae(p,e);f.push(ie)}else Yae(p,e);const{addError:ue}=noe(p,e,c);c.unbuffer(),nie(p,e,C,G,J);const pe=Gne(p,A,a),B=Mre(e.applicationId,C,N,Y,T);return f.push(()=>n.stop()),{addAction:W,addEvent:F,addError:ue,addTiming:M,addFeatureFlagEvaluation:z.addFeatureFlagEvaluation,startView:K,setViewContext:te,setViewContextProperty:D,getViewContext:P,setViewName:U,lifeCycle:p,viewHistory:N,session:C,stopSession:()=>C.expire(),getInternalContext:B.get,startDurationVital:pe.startDurationVital,stopDurationVital:pe.stopDurationVital,addDurationVital:pe.addDurationVital,addOperationStepVital:pe.addOperationStepVital,globalContext:L,userContext:G,accountContext:J,telemetry:S,stop:()=>{f.forEach(ie=>ie())},hooks:h}}function dse(e,t,n,r,i,o,a){const c=Jie(e,t,i,o,n),d=sse(e),f=Vae(t,n),p=Kae(n,t);return Wae(t),Jae(n,e,t,a),{pageStateHistory:r,addAction:c.addAction,addEvent:d.addEvent,actionContexts:c.actionContexts,stop:()=>{c.stop(),p.stop(),f.stop(),r.stop()}}}function fse(e,{session:t,viewContext:n,errorType:r}){const i=t?t.id:"no-session-id",o=[];r!==void 0&&o.push(`error-type=${r}`),n&&(o.push(`seed=${n.id}`),o.push(`from=${n.startClocks.timeStamp}`));const a=mse(e),c=`/rum/replay/sessions/${i}`;return`${a}${c}?${o.join("&")}`}function mse(e){const t=e.site,n=e.subdomain||pse(e);return`https://${n?`${n}.`:""}${t}`}function pse(e){switch(e.site){case Yl:case yee:return"app";case mz:return"dd";default:return}}const hse=1e3;let to;function SAe(e){return fb(e).segments_count}function _Ae(e){fb(e).segments_count+=1}function CAe(e){fb(e).records_count+=1}function EAe(e,t){fb(e).segments_total_raw_size+=t}function gse(e){return to?.get(e)}function fb(e){to||(to=new Map);let t;return to.has(e)?t=to.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},to.set(e,t),to.size>hse&&vse()),t}function vse(){if(!to)return;const e=to.keys().next().value;e&&to.delete(e)}function U4(e,t,n){let r=0,i=[],o,a=!0,c=0;const d=[],{stop:f}=Cn(e,t,"message",({data:v})=>{if(v.type!=="wrote"||v.streamId!==n)return;const y=d[0];y&&(y.id===v.id?(d.shift(),r+=v.additionalBytesCount,i.push(v.result),o=v.trailer,y.writeCallback?y.writeCallback(v.result.byteLength):y.finishCallback&&y.finishCallback()):y.id<v.id&&f())});function p(){const v=i.length===0?new Uint8Array(0):xz(i.concat(o)),y={rawBytesCount:r,output:v,outputBytesCount:v.byteLength,encoding:"deflate"};return r=0,i=[],y}function h(){a||(t.postMessage({action:"reset",streamId:n}),a=!0)}return{isAsync:!0,get isEmpty(){return a},write(v,y){t.postMessage({action:"write",id:c,data:v,streamId:n}),d.push({id:c,writeCallback:y,data:v}),a=!1,c+=1},finish(v){h(),d.length?(d.forEach(y=>{delete y.writeCallback}),d[d.length-1].finishCallback=()=>v(p())):v(p())},finishSync(){h();const v=d.map(y=>y.data).join("");return d.length=0,{...p(),pendingData:v}},estimateEncodedBytesCount(v){return v.length/8},stop(){f()}}}function iE({configuredUrl:e,error:t,source:n,scriptType:r}){if(mt.error(`${n} failed to start: an error occurred while initializing the ${r}:`,t),t instanceof Event||t instanceof Error&&yse(t.message)){let i;e?i=`Please make sure the ${r} URL ${e} is correct and CSP is correctly configured.`:i="Please make sure CSP is correctly configured.",mt.error(`${i} See documentation at ${Wy}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else r==="worker"&&WC(t)}function yse(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const bse=30*Rr;function F4(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){if(1===t.length)return t[0];const e=t.reduce((t,e)=>t+e.length,0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!==--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return-1^t},O={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=L(t.adler,e,r,a):2===t.state.wrap&&(t.adler=T(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!==--r);return s<=t.lookahead?s:t.lookahead},at=function(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-J)){t.window.set(t.window.subarray(s,s+s),0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--a);e=a=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=tt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},nt=function(t,e){for(var a,n;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},rt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function it(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var st=[new it(0,0,0,0,function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)}),new it(4,4,8,4,nt),new it(4,5,16,8,nt),new it(4,6,32,32,nt),new it(4,4,16,16,rt),new it(8,16,32,32,rt),new it(8,16,128,128,rt),new it(8,32,128,256,rt),new it(32,128,258,1024,rt),new it(32,258,258,4096,rt)];function ht(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var lt=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=st[e.level].max_lazy,e.good_match=st[e.level].good_length,e.nice_match=st[e.level].nice_length,e.max_chain_length=st[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},_t=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(at(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(at(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):st[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},ot=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},dt=new Uint8Array(256),ut=0;ut<256;ut++)dt[ut]=ut>=252?6:ut>=248?5:ut>=240?4:ut>=224?3:ut>=192?2:1;dt[254]=dt[254]=1;var ft=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ct=Object.prototype.toString;function pt(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new ht;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,lt(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ct.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,at(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,at(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function gt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function vt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}pt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ct.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=_t(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=ot(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},pt.prototype.onData=function(t){this.chunks.push(t)},pt.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.24.1"};case"write":{let n=e.get(a.streamId);n||(n=new pt,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:vt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){gt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}})}catch(t){gt(e,t)}}()})();'])))}let Mn={status:0};function V4(e,t,n,r=F4){switch(Mn.status===0&&xse(e,t,r),Mn.status){case 1:return Mn.initializationFailureCallbacks.push(n),Mn.worker;case 3:return Mn.worker}}function dD(){return Mn.status}function xse(e,t,n=F4){try{const r=n(e),{stop:i}=Cn(e,r,"error",c=>{CS(e,t,c)}),{stop:o}=Cn(e,r,"message",({data:c})=>{c.type==="errored"?CS(e,t,c.error,c.streamId):c.type==="initialized"&&Sse(c.version)});r.postMessage({action:"init"}),Cr(()=>wse(t),bse),Mn={status:1,worker:r,stop:()=>{i(),o()},initializationFailureCallbacks:[]}}catch(r){CS(e,t,r)}}function wse(e){Mn.status===1&&(mt.error(`${e} failed to start: a timeout occurred while initializing the Worker`),Mn.initializationFailureCallbacks.forEach(t=>t()),Mn={status:2})}function Sse(e){Mn.status===1&&(Mn={status:3,worker:Mn.worker,stop:Mn.stop,version:e})}function CS(e,t,n,r){Mn.status===1||Mn.status===0?(iE({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),Mn.status===1&&Mn.initializationFailureCallbacks.forEach(i=>i()),Mn={status:2}):WC(n,{worker_version:Mn.status===3&&Mn.version,stream_id:r})}function B4(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function _se(e,t,n,r){const i=t.findTrackedSession(),o=Cse(i,r),a=n.findView();return fse(e,{viewContext:a,errorType:o,session:i})}function Cse(e,t){if(!B4())return"browser-not-supported";if(!e)return"rum-not-tracked";if(e.sessionReplay===0)return"incorrect-session-plan";if(!t)return"replay-not-started"}function Ese(e,t){if(!e.metricsEnabled)return{stop:Ht};let n,r,i;const{unsubscribe:o}=t.subscribe(a=>{switch(a.type){case"start":n={forced:a.forced,timestamp:hr()},r=void 0,i=void 0;break;case"document-ready":n&&(r=Pn(n.timestamp,hr()));break;case"recorder-settled":n&&(i=Pn(n.timestamp,hr()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":o(),n&&ab("Recorder init metrics",{metrics:kse(n.forced,i,Pn(n.timestamp,hr()),a.type,r)});break}});return{stop:o}}function kse(e,t,n,r,i){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:n,result:r,waitForDocReadyDuration:i}}function jse(e,t,n,r,i,o,a){let c=0,d;t.subscribe(9,()=>{(c===2||c===3)&&(v(),c=1)}),t.subscribe(10,()=>{c===1&&h()});const f=new At;Ese(a,f);const p=async y=>{f.notify({type:"start",forced:y});const[b]=await Promise.all([fD(f,{type:"recorder-settled"},i()),fD(f,{type:"document-ready"},mne(e,"interactive"))]);if(c!==2){f.notify({type:"aborted"});return}if(!b){c=0,f.notify({type:"recorder-load-failed"});return}const S=o();if(!S){c=0,f.notify({type:"deflate-encoder-load-failed"});return}({stop:d}=b(t,e,n,r,S,a)),c=3,f.notify({type:"succeeded"})};function h(y){const b=n.findTrackedSession();if(Rse(b,y)){c=1;return}if(Ise(c))return;c=2;const S=Nse(b,y)||!1;p(S).catch(Js),S&&n.setForcedReplay()}function v(){c===3&&d?.(),c=0}return{start:h,stop:v,getSessionReplayLink(){return _se(e,n,r,c!==0)},isRecording:()=>c===3}}function Rse(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function Ise(e){return e===2||e===3}function Nse(e,t){return t&&t.force&&e.sessionReplay===0}async function fD(e,t,n){try{return await n}finally{e.notify(t)}}function Tse(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:Ht},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function Ase(e,t){if(yd()&&!Mz("records")||!B4())return{start:Ht,stop:Ht,getReplayStats:()=>{},onRumStart:Ht,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:r}=Tse();return{start:o=>n.start(o),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:i,isRecording:()=>dD()===3&&n.isRecording(),getReplayStats:o=>dD()===3?gse(o):void 0};function i(o,a,c,d,f,p){let h;function v(){return h||(f??(f=V4(a,"Datadog Session Replay",()=>{n.stop()},t)),f&&(h=U4(a,f,1))),h}n=jse(a,o,c,d,e,v,p),r(a)&&n.start()}}const Ose="modulepreload",Dse=function(e){return"/"+e},mD={},Np=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let d=function(f){return Promise.all(f.map(p=>Promise.resolve(p).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");i=d(n.map(f=>{if(f=Dse(f),f in mD)return;mD[f]=!0;const p=f.endsWith(".css"),h=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${h}`))return;const v=document.createElement("link");if(v.rel=p?"stylesheet":Ose,p||(v.as="script"),v.crossOrigin="",v.href=f,c&&v.setAttribute("nonce",c),document.head.appendChild(v),p)return new Promise((y,b)=>{v.addEventListener("load",y),v.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return i.then(a=>{for(const c of a||[])c.status==="rejected"&&o(c.reason);return t().catch(o)})};async function $se(e=Mse){try{return await e()}catch(t){iE({error:t,source:"Recorder",scriptType:"module"})}}async function Mse(){return(await Np(()=>import("./startRecording-BAY7HJ6r.js"),[])).startRecording}function Pse(){return go().Profiler!==void 0}const zse=e=>{let t={status:"starting"};return e.register(0,({eventType:n})=>n!==vt.VIEW&&n!==vt.LONG_TASK?Di:{type:n,_dd:{profiling:t}}),{get:()=>t,set:n=>{t=n}}};async function Lse(e=Use){try{return await e()}catch(t){iE({error:t,source:"Profiler",scriptType:"module"})}}async function Use(){return(await Np(()=>import("./profiler-_PkvXANS.js"),[])).createRumProfiler}function Fse(){let e;function t(n,r,i,o,a,c){const d=o.findTrackedSession();if(!d||!e4(d.id,i.profilingSampleRate))return;const f=zse(r);if(!Pse()){f.set({status:"error",error_reason:"not-supported-by-browser"});return}Lse().then(p=>{if(!p){Rp("[DD_RUM] Failed to lazy load the RUM Profiler"),f.set({status:"error",error_reason:"failed-to-lazy-load"});return}e=p(i,n,o,f,c),e.start(a.findView())}).catch(Js)}return{onRumStart:t,stop:()=>{e?.stop().catch(Js)}}}const Vse=Ase($se),Bse=Fse(),Hse=Tre(use,Vse,Bse,{startDeflateWorker:V4,createDeflateEncoder:U4,sdkName:"rum"});ute(go(),"DD_RUM",Hse);function Sv(e,t){Qm("react error"),nr()}const pD={didCatch:!1,error:null};class kAe extends X.Component{constructor(t){super(t),this.resetError=()=>{this.setState(pD)},this.state=pD}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}componentDidCatch(t,n){Sv()}render(){return this.state.didCatch?X.createElement(this.props.fallback,{error:this.state.error,resetError:this.resetError}):this.props.children}}let hD=!1;function qse(){x.useEffect(()=>{hD||(hD=!0)},[])}function Gse(){return u.jsx(u.Fragment,{children:u.jsx(ll,{})})}const mb=PY()({component:Gse});function Kse(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 126.644 96",width:24,height:24,children:u.jsx("path",{fill:"currentColor",d:"M81.15,0c-1.2376,2.1973-2.3489,4.4704-3.3591,6.794-9.5975-1.4396-19.3718-1.4396-28.9945,0-.985-2.3236-2.1216-4.5967-3.3591-6.794-9.0166,1.5407-17.8059,4.2431-26.1405,8.0568C2.779,32.5304-1.6914,56.3725.5312,79.8863c9.6732,7.1476,20.5083,12.603,32.0505,16.0884,2.6014-3.4854,4.8998-7.1981,6.8698-11.0623-3.738-1.3891-7.3497-3.1318-10.8098-5.1523.9092-.6567,1.7932-1.3386,2.6519-1.9953,20.281,9.547,43.7696,9.547,64.0758,0,.8587.7072,1.7427,1.3891,2.6519,1.9953-3.4601,2.0457-7.0718,3.7632-10.835,5.1776,1.97,3.8642,4.2683,7.5769,6.8698,11.0623,11.5419-3.4854,22.3769-8.9156,32.0509-16.0631,2.626-27.2771-4.496-50.9172-18.817-71.8548C98.9811,4.2684,90.1918,1.5659,81.1752.0505l-.0252-.0505ZM42.2802,65.4144c-6.2383,0-11.4159-5.6575-11.4159-12.6535s4.9755-12.6788,11.3907-12.6788,11.5169,5.708,11.4159,12.6788c-.101,6.9708-5.026,12.6535-11.3907,12.6535ZM84.3576,65.4144c-6.2637,0-11.3907-5.6575-11.3907-12.6535s4.9755-12.6788,11.3907-12.6788,11.4917,5.708,11.3906,12.6788c-.101,6.9708-5.026,12.6535-11.3906,12.6535Z"})})}function oE(){return u.jsxs(u.Fragment,{children:[u.jsx("img",{src:"/harper-studio_white.png",alt:"Harper Studio",className:"w-64 hidden md:inline-block"}),u.jsx("img",{src:"/HDBDogOnly.svg",width:"50px",height:"44px",alt:"Harper",className:"inline-block md:hidden"})]})}function Zse(e,t){const n=x.createContext(t),r=o=>{const{children:a,...c}=o,d=x.useMemo(()=>c,Object.values(c));return u.jsx(n.Provider,{value:d,children:a})};r.displayName=e+"Provider";function i(o){const a=x.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function Pi(e,t=[]){let n=[];function r(o,a){const c=x.createContext(a),d=n.length;n=[...n,a];const f=h=>{const{scope:v,children:y,...b}=h,S=v?.[e]?.[d]||c,C=x.useMemo(()=>b,Object.values(b));return u.jsx(S.Provider,{value:C,children:y})};f.displayName=o+"Provider";function p(h,v){const y=v?.[e]?.[d]||c,b=x.useContext(y);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,p]}const i=()=>{const o=n.map(a=>x.createContext(a));return function(c){const d=c?.[e]||o;return x.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return i.scopeName=e,[r,Yse(i,...t)]}function Yse(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((c,{useScope:d,scopeName:f})=>{const h=d(o)[`__scope${f}`];return{...c,...h}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function je(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function bd(e){const t=Wse(e),n=x.forwardRef((r,i)=>{const{children:o,...a}=r,c=x.Children.toArray(o),d=c.find(Qse);if(d){const f=d.props.children,p=c.map(h=>h===d?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:h);return u.jsx(t,{...a,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,p):null})}return u.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function Wse(e){const t=x.forwardRef((n,r)=>{const{children:i,...o}=n;if(x.isValidElement(i)){const a=ele(i),c=Jse(o,i.props);return i.type!==x.Fragment&&(c.ref=r?Fd(r,a):a),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var H4=Symbol("radix.slottable");function Xse(e){const t=({children:n})=>u.jsx(u.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=H4,t}function Qse(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===H4}function Jse(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...c)=>{const d=o(...c);return i(...c),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function ele(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tle=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ke=tle.reduce((e,t)=>{const n=bd(`Primitive.${t}`),r=x.forwardRef((i,o)=>{const{asChild:a,...c}=i,d=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(d,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Gv(e,t){e&&zd.flushSync(()=>e.dispatchEvent(t))}var Yn=globalThis?.document?x.useLayoutEffect:()=>{},nle=EC[" useInsertionEffect ".trim().toString()]||Yn;function Do({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=rle({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:i;{const p=x.useRef(e!==void 0);x.useEffect(()=>{const h=p.current;h!==c&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=c},[c,r])}const f=x.useCallback(p=>{if(c){const h=ile(p)?p(e):p;h!==e&&a.current?.(h)}else o(p)},[c,e,o,a]);return[d,f]}function rle({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),o=x.useRef(t);return nle(()=>{o.current=t},[t]),x.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function ile(e){return typeof e=="function"}var ole=x.createContext(void 0);function Tc(e){const t=x.useContext(ole);return e||t||"ltr"}function ale(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var Wn=e=>{const{present:t,children:n}=e,r=sle(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),o=ut(r.ref,lle(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:o}):null};Wn.displayName="Presence";function sle(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),o=x.useRef("none"),a=e?"mounted":"unmounted",[c,d]=ale(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const f=Pg(r.current);o.current=c==="mounted"?f:"none"},[c]),Yn(()=>{const f=r.current,p=i.current;if(p!==e){const v=o.current,y=Pg(f);e?d("MOUNT"):y==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&v!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),Yn(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,h=y=>{const S=Pg(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&S&&(d("ANIMATION_END"),!i.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},v=y=>{y.target===t&&(o.current=Pg(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:x.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Pg(e){return e?.animationName||"none"}function lle(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var cle=EC[" useId ".trim().toString()]||(()=>{}),ule=0;function Ni(e){const[t,n]=x.useState(cle());return Yn(()=>{n(r=>r??String(ule++))},[e]),t?`radix-${t}`:""}function Tp(e){const t=e+"CollectionProvider",[n,r]=Pi(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=S=>{const{scope:C,children:E}=S,k=X.useRef(null),j=X.useRef(new Map).current;return u.jsx(i,{scope:C,itemMap:j,collectionRef:k,children:E})};a.displayName=t;const c=e+"CollectionSlot",d=bd(c),f=X.forwardRef((S,C)=>{const{scope:E,children:k}=S,j=o(c,E),I=ut(C,j.collectionRef);return u.jsx(d,{ref:I,children:k})});f.displayName=c;const p=e+"CollectionItemSlot",h="data-radix-collection-item",v=bd(p),y=X.forwardRef((S,C)=>{const{scope:E,children:k,...j}=S,I=X.useRef(null),A=ut(C,I),N=o(p,E);return X.useEffect(()=>(N.itemMap.set(I,{ref:I,...j}),()=>void N.itemMap.delete(I))),u.jsx(v,{[h]:"",ref:A,children:k})});y.displayName=p;function b(S){const C=o(e+"CollectionConsumer",S);return X.useCallback(()=>{const k=C.collectionRef.current;if(!k)return[];const j=Array.from(k.querySelectorAll(`[${h}]`));return Array.from(C.itemMap.values()).sort((N,T)=>j.indexOf(N.ref.current)-j.indexOf(T.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:a,Slot:f,ItemSlot:y},b,r]}function bn(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}function dle(e,t=globalThis?.document){const n=bn(e);x.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var fle="DismissableLayer",a1="dismissableLayer.update",mle="dismissableLayer.pointerDownOutside",ple="dismissableLayer.focusOutside",gD,q4=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Kd=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...d}=e,f=x.useContext(q4),[p,h]=x.useState(null),v=p?.ownerDocument??globalThis?.document,[,y]=x.useState({}),b=ut(t,T=>h(T)),S=Array.from(f.layers),[C]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),E=S.indexOf(C),k=p?S.indexOf(p):-1,j=f.layersWithOutsidePointerEventsDisabled.size>0,I=k>=E,A=vle(T=>{const z=T.target,L=[...f.branches].some(G=>G.contains(z));!I||L||(i?.(T),a?.(T),T.defaultPrevented||c?.())},v),N=yle(T=>{const z=T.target;[...f.branches].some(G=>G.contains(z))||(o?.(T),a?.(T),T.defaultPrevented||c?.())},v);return dle(T=>{k===f.layers.size-1&&(r?.(T),!T.defaultPrevented&&c&&(T.preventDefault(),c()))},v),x.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(gD=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),vD(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=gD)}},[p,v,n,f]),x.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),vD())},[p,f]),x.useEffect(()=>{const T=()=>y({});return document.addEventListener(a1,T),()=>document.removeEventListener(a1,T)},[]),u.jsx(Ke.div,{...d,ref:b,style:{pointerEvents:j?I?"auto":"none":void 0,...e.style},onFocusCapture:je(e.onFocusCapture,N.onFocusCapture),onBlurCapture:je(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:je(e.onPointerDownCapture,A.onPointerDownCapture)})});Kd.displayName=fle;var hle="DismissableLayerBranch",gle=x.forwardRef((e,t)=>{const n=x.useContext(q4),r=x.useRef(null),i=ut(t,r);return x.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(Ke.div,{...e,ref:i})});gle.displayName=hle;function vle(e,t=globalThis?.document){const n=bn(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const o=c=>{if(c.target&&!r.current){let d=function(){G4(mle,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=d,t.addEventListener("click",i.current,{once:!0})):d()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function yle(e,t=globalThis?.document){const n=bn(e),r=x.useRef(!1);return x.useEffect(()=>{const i=o=>{o.target&&!r.current&&G4(ple,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function vD(){const e=new CustomEvent(a1);document.dispatchEvent(e)}function G4(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Gv(i,o):i.dispatchEvent(o)}function aE(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var K4=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ble="VisuallyHidden",Z4=x.forwardRef((e,t)=>u.jsx(Ke.span,{...e,ref:t,style:{...K4,...e.style}}));Z4.displayName=ble;var Y4=Z4,Ac="NavigationMenu",[sE,W4,xle]=Tp(Ac),[s1,wle,Sle]=Tp(Ac),[lE]=Pi(Ac,[xle,Sle]),[_le,vo]=lE(Ac),[Cle,Ele]=lE(Ac),X4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:o,delayDuration:a=200,skipDelayDuration:c=300,orientation:d="horizontal",dir:f,...p}=e,[h,v]=x.useState(null),y=ut(t,L=>v(L)),b=Tc(f),S=x.useRef(0),C=x.useRef(0),E=x.useRef(0),[k,j]=x.useState(!0),[I,A]=Do({prop:r,onChange:L=>{const G=L!=="",J=c>0;G?(window.clearTimeout(E.current),J&&j(!1)):(window.clearTimeout(E.current),E.current=window.setTimeout(()=>j(!0),c)),i?.(L)},defaultProp:o??"",caller:Ac}),N=x.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>A(""),150)},[A]),T=x.useCallback(L=>{window.clearTimeout(C.current),A(L)},[A]),z=x.useCallback(L=>{I===L?window.clearTimeout(C.current):S.current=window.setTimeout(()=>{window.clearTimeout(C.current),A(L)},a)},[I,A,a]);return x.useEffect(()=>()=>{window.clearTimeout(S.current),window.clearTimeout(C.current),window.clearTimeout(E.current)},[]),u.jsx(Q4,{scope:n,isRootMenu:!0,value:I,dir:b,orientation:d,rootNavigationMenu:h,onTriggerEnter:L=>{window.clearTimeout(S.current),k?z(L):T(L)},onTriggerLeave:()=>{window.clearTimeout(S.current),N()},onContentEnter:()=>window.clearTimeout(C.current),onContentLeave:N,onItemSelect:L=>{A(G=>G===L?"":L)},onItemDismiss:()=>A(""),children:u.jsx(Ke.nav,{"aria-label":"Main","data-orientation":d,dir:b,...p,ref:y})})});X4.displayName=Ac;var l1="NavigationMenuSub",kle=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",...c}=e,d=vo(l1,n),[f,p]=Do({prop:r,onChange:i,defaultProp:o??"",caller:l1});return u.jsx(Q4,{scope:n,isRootMenu:!1,value:f,dir:d.dir,orientation:a,rootNavigationMenu:d.rootNavigationMenu,onTriggerEnter:h=>p(h),onItemSelect:h=>p(h),onItemDismiss:()=>p(""),children:u.jsx(Ke.div,{"data-orientation":a,...c,ref:t})})});kle.displayName=l1;var Q4=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:i,orientation:o,children:a,value:c,onItemSelect:d,onItemDismiss:f,onTriggerEnter:p,onTriggerLeave:h,onContentEnter:v,onContentLeave:y}=e,[b,S]=x.useState(null),[C,E]=x.useState(new Map),[k,j]=x.useState(null);return u.jsx(_le,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:c,previousValue:aE(c),baseId:Ni(),dir:i,orientation:o,viewport:b,onViewportChange:S,indicatorTrack:k,onIndicatorTrackChange:j,onTriggerEnter:bn(p),onTriggerLeave:bn(h),onContentEnter:bn(v),onContentLeave:bn(y),onItemSelect:bn(d),onItemDismiss:bn(f),onViewportContentChange:x.useCallback((I,A)=>{E(N=>(N.set(I,A),new Map(N)))},[]),onViewportContentRemove:x.useCallback(I=>{E(A=>A.has(I)?(A.delete(I),new Map(A)):A)},[]),children:u.jsx(sE.Provider,{scope:t,children:u.jsx(Cle,{scope:t,items:C,children:a})})})},J4="NavigationMenuList",eL=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=vo(J4,n),o=u.jsx(Ke.ul,{"data-orientation":i.orientation,...r,ref:t});return u.jsx(Ke.div,{style:{position:"relative"},ref:i.onIndicatorTrackChange,children:u.jsx(sE.Slot,{scope:n,children:i.isRootMenu?u.jsx(sL,{asChild:!0,children:o}):o})})});eL.displayName=J4;var tL="NavigationMenuItem",[jle,nL]=lE(tL),rL=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...i}=e,o=Ni(),a=r||o||"LEGACY_REACT_AUTO_VALUE",c=x.useRef(null),d=x.useRef(null),f=x.useRef(null),p=x.useRef(()=>{}),h=x.useRef(!1),v=x.useCallback((b="start")=>{if(c.current){p.current();const S=u1(c.current);S.length&&dE(b==="start"?S:S.reverse())}},[]),y=x.useCallback(()=>{if(c.current){const b=u1(c.current);b.length&&(p.current=Ple(b))}},[]);return u.jsx(jle,{scope:n,value:a,triggerRef:d,contentRef:c,focusProxyRef:f,wasEscapeCloseRef:h,onEntryKeyDown:v,onFocusProxyEnter:v,onRootContentClose:y,onContentFocusOutside:y,children:u.jsx(Ke.li,{...i,ref:t})})});rL.displayName=tL;var c1="NavigationMenuTrigger",Rle=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...i}=e,o=vo(c1,e.__scopeNavigationMenu),a=nL(c1,e.__scopeNavigationMenu),c=x.useRef(null),d=ut(c,a.triggerRef,t),f=cL(o.baseId,a.value),p=uL(o.baseId,a.value),h=x.useRef(!1),v=x.useRef(!1),y=a.value===o.value;return u.jsxs(u.Fragment,{children:[u.jsx(sE.ItemSlot,{scope:n,value:a.value,children:u.jsx(lL,{asChild:!0,children:u.jsx(Ke.button,{id:f,disabled:r,"data-disabled":r?"":void 0,"data-state":fE(y),"aria-expanded":y,"aria-controls":p,...i,ref:d,onPointerEnter:je(e.onPointerEnter,()=>{v.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:je(e.onPointerMove,Kv(()=>{r||v.current||a.wasEscapeCloseRef.current||h.current||(o.onTriggerEnter(a.value),h.current=!0)})),onPointerLeave:je(e.onPointerLeave,Kv(()=>{r||(o.onTriggerLeave(),h.current=!1)})),onClick:je(e.onClick,()=>{o.onItemSelect(a.value),v.current=y}),onKeyDown:je(e.onKeyDown,b=>{const C={horizontal:"ArrowDown",vertical:o.dir==="rtl"?"ArrowLeft":"ArrowRight"}[o.orientation];y&&b.key===C&&(a.onEntryKeyDown(),b.preventDefault())})})})}),y&&u.jsxs(u.Fragment,{children:[u.jsx(Y4,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:b=>{const S=a.contentRef.current,C=b.relatedTarget,E=C===c.current,k=S?.contains(C);(E||!k)&&a.onFocusProxyEnter(E?"start":"end")}}),o.viewport&&u.jsx("span",{"aria-owns":p})]})]})});Rle.displayName=c1;var Ile="NavigationMenuLink",yD="navigationMenu.linkSelect",iL=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:i,...o}=e;return u.jsx(lL,{asChild:!0,children:u.jsx(Ke.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...o,ref:t,onClick:je(e.onClick,a=>{const c=a.target,d=new CustomEvent(yD,{bubbles:!0,cancelable:!0});if(c.addEventListener(yD,f=>i?.(f),{once:!0}),Gv(c,d),!d.defaultPrevented&&!a.metaKey){const f=new CustomEvent(_v,{bubbles:!0,cancelable:!0});Gv(c,f)}},{checkForDefaultPrevented:!1})})})});iL.displayName=Ile;var cE="NavigationMenuIndicator",Nle=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=vo(cE,e.__scopeNavigationMenu),o=!!i.value;return i.indicatorTrack?OC.createPortal(u.jsx(Wn,{present:n||o,children:u.jsx(Tle,{...r,ref:t})}),i.indicatorTrack):null});Nle.displayName=cE;var Tle=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=vo(cE,n),o=W4(n),[a,c]=x.useState(null),[d,f]=x.useState(null),p=i.orientation==="horizontal",h=!!i.value;x.useEffect(()=>{const b=o().find(S=>S.value===i.value)?.ref.current;b&&c(b)},[o,i.value]);const v=()=>{a&&f({size:p?a.offsetWidth:a.offsetHeight,offset:p?a.offsetLeft:a.offsetTop})};return d1(a,v),d1(i.indicatorTrack,v),d?u.jsx(Ke.div,{"aria-hidden":!0,"data-state":h?"visible":"hidden","data-orientation":i.orientation,...r,ref:t,style:{position:"absolute",...p?{left:0,width:d.size+"px",transform:`translateX(${d.offset}px)`}:{top:0,height:d.size+"px",transform:`translateY(${d.offset}px)`},...r.style}}):null}),xd="NavigationMenuContent",Ale=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=vo(xd,e.__scopeNavigationMenu),o=nL(xd,e.__scopeNavigationMenu),a=ut(o.contentRef,t),c=o.value===i.value,d={value:o.value,triggerRef:o.triggerRef,focusProxyRef:o.focusProxyRef,wasEscapeCloseRef:o.wasEscapeCloseRef,onContentFocusOutside:o.onContentFocusOutside,onRootContentClose:o.onRootContentClose,...r};return i.viewport?u.jsx(Ole,{forceMount:n,...d,ref:a}):u.jsx(Wn,{present:n||c,children:u.jsx(oL,{"data-state":fE(c),...d,ref:a,onPointerEnter:je(e.onPointerEnter,i.onContentEnter),onPointerLeave:je(e.onPointerLeave,Kv(i.onContentLeave)),style:{pointerEvents:!c&&i.isRootMenu?"none":void 0,...d.style}})})});Ale.displayName=xd;var Ole=x.forwardRef((e,t)=>{const n=vo(xd,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:i}=n;return Yn(()=>{r(e.value,{ref:t,...e})},[e,t,r]),Yn(()=>()=>i(e.value),[e.value,i]),null}),_v="navigationMenu.rootContentDismiss",oL=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:i,focusProxyRef:o,wasEscapeCloseRef:a,onRootContentClose:c,onContentFocusOutside:d,...f}=e,p=vo(xd,n),h=x.useRef(null),v=ut(h,t),y=cL(p.baseId,r),b=uL(p.baseId,r),S=W4(n),C=x.useRef(null),{onItemDismiss:E}=p;x.useEffect(()=>{const j=h.current;if(p.isRootMenu&&j){const I=()=>{E(),c(),j.contains(document.activeElement)&&i.current?.focus()};return j.addEventListener(_v,I),()=>j.removeEventListener(_v,I)}},[p.isRootMenu,e.value,i,E,c]);const k=x.useMemo(()=>{const I=S().map(G=>G.value);p.dir==="rtl"&&I.reverse();const A=I.indexOf(p.value),N=I.indexOf(p.previousValue),T=r===p.value,z=N===I.indexOf(r);if(!T&&!z)return C.current;const L=(()=>{if(A!==N){if(T&&N!==-1)return A>N?"from-end":"from-start";if(z&&A!==-1)return A>N?"to-start":"to-end"}return null})();return C.current=L,L},[p.previousValue,p.value,p.dir,S,r]);return u.jsx(sL,{asChild:!0,children:u.jsx(Kd,{id:b,"aria-labelledby":y,"data-motion":k,"data-orientation":p.orientation,...f,ref:v,disableOutsidePointerEvents:!1,onDismiss:()=>{const j=new Event(_v,{bubbles:!0,cancelable:!0});h.current?.dispatchEvent(j)},onFocusOutside:je(e.onFocusOutside,j=>{d();const I=j.target;p.rootNavigationMenu?.contains(I)&&j.preventDefault()}),onPointerDownOutside:je(e.onPointerDownOutside,j=>{const I=j.target,A=S().some(T=>T.ref.current?.contains(I)),N=p.isRootMenu&&p.viewport?.contains(I);(A||N||!p.isRootMenu)&&j.preventDefault()}),onKeyDown:je(e.onKeyDown,j=>{const I=j.altKey||j.ctrlKey||j.metaKey;if(j.key==="Tab"&&!I){const N=u1(j.currentTarget),T=document.activeElement,z=N.findIndex(J=>J===T),G=j.shiftKey?N.slice(0,z).reverse():N.slice(z+1,N.length);dE(G)?j.preventDefault():o.current?.focus()}}),onEscapeKeyDown:je(e.onEscapeKeyDown,j=>{a.current=!0})})})}),uE="NavigationMenuViewport",aL=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=!!vo(uE,e.__scopeNavigationMenu).value;return u.jsx(Wn,{present:n||o,children:u.jsx(Dle,{...r,ref:t})})});aL.displayName=uE;var Dle=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...i}=e,o=vo(uE,n),a=ut(t,o.onViewportChange),c=Ele(xd,e.__scopeNavigationMenu),[d,f]=x.useState(null),[p,h]=x.useState(null),v=d?d?.width+"px":void 0,y=d?d?.height+"px":void 0,b=!!o.value,S=b?o.value:o.previousValue;return d1(p,()=>{p&&f({width:p.offsetWidth,height:p.offsetHeight})}),u.jsx(Ke.div,{"data-state":fE(b),"data-orientation":o.orientation,...i,ref:a,style:{pointerEvents:!b&&o.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":v,"--radix-navigation-menu-viewport-height":y,...i.style},onPointerEnter:je(e.onPointerEnter,o.onContentEnter),onPointerLeave:je(e.onPointerLeave,Kv(o.onContentLeave)),children:Array.from(c.items).map(([E,{ref:k,forceMount:j,...I}])=>{const A=S===E;return u.jsx(Wn,{present:j||A,children:u.jsx(oL,{...I,ref:Fd(k,N=>{A&&N&&h(N)})})},E)})})}),$le="FocusGroup",sL=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=vo($le,n);return u.jsx(s1.Provider,{scope:n,children:u.jsx(s1.Slot,{scope:n,children:u.jsx(Ke.div,{dir:i.dir,...r,ref:t})})})}),bD=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],Mle="FocusGroupItem",lL=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=wle(n),o=vo(Mle,n);return u.jsx(s1.ItemSlot,{scope:n,children:u.jsx(Ke.button,{...r,ref:t,onKeyDown:je(e.onKeyDown,a=>{if(["Home","End",...bD].includes(a.key)){let d=i().map(h=>h.ref.current);if([o.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&d.reverse(),bD.includes(a.key)){const h=d.indexOf(a.currentTarget);d=d.slice(h+1)}setTimeout(()=>dE(d)),a.preventDefault()}})})})});function u1(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function dE(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function Ple(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const n=t.dataset.tabindex;t.setAttribute("tabindex",n)})}}function d1(e,t){const n=bn(t);Yn(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}function fE(e){return e?"open":"closed"}function cL(e,t){return`${e}-trigger-${t}`}function uL(e,t){return`${e}-content-${t}`}function Kv(e){return t=>t.pointerType==="mouse"?e(t):void 0}var zle=X4,Lle=eL,Ule=rL,Fle=iL,Vle=aL;function Ble({className:e,...t}){return u.jsx("div",{className:Pe("absolute top-full left-0 isolate z-50 flex justify-center"),children:u.jsx(Vle,{"data-slot":"navigation-menu-viewport",className:Pe("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",e),...t})})}function dL({className:e,children:t,viewport:n=!0,...r}){return u.jsxs(zle,{"data-slot":"navigation-menu","data-viewport":n,className:Pe("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",e),...r,children:[t,n&&u.jsx(Ble,{})]})}function f1({className:e,...t}){return u.jsx(Ule,{"data-slot":"navigation-menu-item",className:Pe("relative",e),...t})}function m1({className:e,...t}){return u.jsx(Fle,{"data-slot":"navigation-menu-link",className:Pe("hover:text-white ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 flex flex-col gap-1 rounded-sm p-2 text-sm transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",e),...t})}function fL({className:e,...t}){return u.jsx(Lle,{"data-slot":"navigation-menu-list",className:Pe("group flex flex-1 list-none items-center justify-center gap-1",e),...t})}const mL=Zy("inline-flex items-center justify-center rounded-md 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-auto",{variants:{variant:{default:"border-primary bg-primary/40 text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-secondary bg-secondary/40 text-secondary-foreground [a&]:hover:bg-secondary/90",warning:"border-yellow bg-yellow/40 text-white [a&]:hover:bg-yellow/90",success:"border-green bg-green/40 text-white [a&]:hover:bg-green/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",outline:"text-white [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function mE(){return u.jsx("a",{href:"https://github.com/HarperFast/studio/releases",target:"_blank",rel:"noopener noreferrer",children:u.jsxs("span",{className:Pe(mL({variant:"default"}),"text-xs inline-block ml-2 align-text-top"),children:["v4.7.12"," BETA"]})})}function pb(e,t,n){const{instanceId:r,clusterId:i}=tt({strict:!1});return Va({id:_n,operationsUrl:e,port:t,secure:n})}function hb(e,t,n){const{instanceId:r,clusterId:i}=tt({strict:!1});return{instanceClient:Va({id:_n,operationsUrl:e,port:t,secure:n}),entityType:"instance"}}function Ft(e,t,n){const r=tt({strict:!1});return pL({...r,operationsUrl:e,port:t,secure:n})}function pL({instanceId:e,clusterId:t,operationsUrl:n,port:r,secure:i}){const o=_n;return{instanceClient:Va({id:o,operationsUrl:n,port:r,secure:i}),entityId:o,entityType:"instance"}}function Hle(){localStorage.clear()}function qle(){sessionStorage.clear()}async function Gle(){Tt.setUserForEntity(_n,null),Vv.getQueryCache().clear(),Hle(),qle(),await Vv.invalidateQueries({refetchType:"none"})}async function Kle(e){await Tt.signOutFromPotentiallyAuthenticatedInstances(),await bp({...e,entityId:_n})}function Zle(){const e=pb();return at({mutationFn:()=>Kle({instanceClient:e}),onSuccess:Gle})}function gb(e){const{user:t}=cl(),{organizationId:n}=tt({strict:!1}),r=t?.roles?.[e??n];return!r?.permission&&!r?.organization?{update:!1,remove:!1}:r.permission?.super_user?{update:!0,remove:!0}:{update:r.organization.update,remove:r.organization.delete}}function Zd(e){const{user:t}=cl(),{organizationId:n}=tt({strict:!1}),r=t?.roles?.[e??n];if(!r?.permission&&!r?.organization?.roles)return{create:!1,remove:!1,update:!1,view:!1};if(r.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const i=r.organization.roles;return{create:i.create,remove:i.delete,update:i.update,view:i.view}}function vb(e,t){const{user:n}=cl(),{organizationId:r,clusterId:i}=tt({strict:!1});return hL(n,e??r,t??i)}function hL(e,t,n){const r=e?.roles?.[t];if(!r?.permission&&!r?.organization?.clusters)return{create:!1,remove:!1,update:!1,view:!1};if(r.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const i=r.organization.clusters.resources?.find(a=>a.id===n),o=r.organization.clusters;return{create:o.create,remove:i?i.delete:o.delete,update:i?i.update:o.update,view:i?i.view:o.view}}function Yle(e,t){const{user:n}=cl(),{organizationId:r,clusterId:i}=tt({strict:!1});return gL(n,r,i)}function gL(e,t,n){const r=e?.roles?.[t];if(!r?.permission&&!r?.organization?.clusters)return{create:!1,remove:!1,update:!1,view:!1};if(r.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const i=r.organization.clusters.resources?.find(a=>a.id===n)?.instances,o=r.organization.clusters;return{create:i?i.create:o.create,remove:i?i.delete:o.delete,update:i?i.update:o.update,view:i?i.view:o.view}}function pE(e){const{clusterId:t,instanceId:n}=tt({strict:!1}),{user:r}=Ja(),i=r?.role?.permission;return i?i.super_user===!0:!1}function Yd(e){const{clusterId:t,instanceId:n}=tt({strict:!1}),{user:r}=Ja(),i=r?.role?.permission;return i?i.super_user===!0||i.structure_user===!0:!1}function ES(e,t,n,r){const{clusterId:i,instanceId:o}=tt({strict:!1}),{user:a}=Ja(),c=a?.role?.permission;return c?c.super_user===!0||c.structure_user===!0?!0:c[t]?.tables?.[n][r]===!0:!1}const hE={className:"text-white"};function vL(){const{mutate:e}=Zle(),t=pn(),{user:n}=_c(),r=an(),{organizationId:i}=tt({strict:!1}),{update:o}=gb(i),{view:a}=Zd(i),c=o,d=x.useCallback(()=>{e(void 0,{onSuccess:async()=>{_e.success("Success",{description:"You have been signed out successfully.",action:{label:"Dismiss",onClick:()=>_e.dismiss()}}),t({to:"/sign-in"}),r.invalidate()}})},[e,r,t]),f=x.useMemo(()=>[!Qu,!Qu,!Qu,{to:"https://docs.harperdb.io/docs",target:"_blank",icon:u.jsx(jP,{}),text:"Docs",textBreakpoint:"md"},{to:"https://github.com/HarperFast/studio/issues",target:"_blank",icon:u.jsx(sX,{}),text:"Report an Issue",textBreakpoint:"lg"},{to:"https://discord.gg/VzZuaw3Xay",target:"_blank",icon:u.jsx(Kse,{}),text:"Discord",textBreakpoint:"lg"},{onClick:d,icon:u.jsx(lQ,{}),text:"Sign Out",textBreakpoint:"md"}].filter(fa),[i,c,a,d]);return n?u.jsxs(u.Fragment,{children:[u.jsx(Qle,{menuItems:f}),u.jsx(Xle,{menuItems:f})]}):u.jsx(Wle,{})}function yL(e){return e.items!==void 0}function Wle(){return u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"inline-block",children:[u.jsx(Ge,{to:"/sign-in",children:u.jsx(oE,{})}),u.jsx(mE,{})]}),u.jsx(dL,{children:u.jsxs(fL,{className:"text-grey-400",children:[u.jsx(f1,{children:u.jsx(m1,{asChild:!0,children:u.jsxs(Ge,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[u.jsx(jP,{})," ",u.jsx("span",{className:"hidden md:inline-block",children:"Docs"})]})})}),u.jsx(f1,{children:u.jsx(m1,{asChild:!0,children:u.jsxs(Ge,{to:"/sign-in",className:"flex-row items-center",activeProps:hE,children:[u.jsx(iQ,{})," Sign In"]})})})]})})]})}function Xle({menuItems:e}){const{user:t}=_c();return Ec(t),u.jsx("div",{className:"hidden md:block",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"inline-block",children:[u.jsx(Ge,{to:oa,children:u.jsx(oE,{})}),u.jsx(mE,{})]}),u.jsx(dL,{children:u.jsx(fL,{className:"text-grey-400",children:e.map(n=>yL(n)?!!n.items.length&&u.jsx("div",{className:"bg-black rounded-2xl flex",children:n.items.map(r=>u.jsx(xD,{menuItem:r},r.text))},n.text):u.jsx(xD,{menuItem:n},n.text))})})]})})}function xD({menuItem:e}){return u.jsx(f1,{className:"text-gray-400 hover:text-white",children:u.jsx(m1,{asChild:!0,children:u.jsxs(Ge,{to:e.to,onClick:e.onClick,className:"flex-row items-center",target:e.target,activeProps:e.to?hE:void 0,children:[e.icon,u.jsx("span",{className:`hidden ${e.textBreakpoint}:inline-block`,children:e.text}),u.jsx("span",{className:`${e.textBreakpoint}:hidden`,children:" "})]})})})}function Qle({menuItems:e}){const{user:t}=_c();Ec(t);const[n,r]=x.useState(!1),i=x.useCallback(()=>r(a=>!a),[]),o=x.useCallback(()=>r(!1),[]);return u.jsxs("div",{className:"md:hidden",id:"mobile-menu",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Ge,{to:oa,children:u.jsx(oE,{})}),u.jsx(mE,{}),u.jsxs("button",{type:"button",className:"shadow-xs text-grey-400 hover:text-white hover:bg-black-dark",onClick:i,children:[u.jsx("span",{className:"sr-only",children:n?"Close menu":"Open menu"}),n?u.jsx(VP,{}):u.jsx(PP,{})]})]}),u.jsx("div",{className:`${n?"fixed":"hidden"} top-40 bottom-0 left-0 right-0 bg-black-dark opacity-70`,onClick:o}),u.jsx("div",{className:`${n?"block":"hidden"} md:hidden z-50 space-y-1 pb-3 bg-black-dark absolute left-0 top-full w-full rounded-b-md`,children:e.map(a=>yL(a)?!!a.items.length&&u.jsx("div",{className:"bg-black pl-10 pr-2 py-2",children:a.items.map(c=>u.jsx(wD,{menuItem:c,onClick:o},c.text))},a.text):u.jsx(wD,{menuItem:a,onClick:o},a.text))})]})}function wD({menuItem:e,onClick:t}){const n=x.useCallback(()=>{e.onClick?.(),t()},[e,t]);return u.jsxs(Ge,{to:e.to,onClick:n,target:e.target,className:"flex flex-row px-3 py-2 text-base font-medium rounded-md text-gray-400 hover:text-white",activeProps:e.to?hE:void 0,children:[e.icon,u.jsx("span",{className:"ml-4",children:e.text})]})}function mm({title:e,children:t}){return u.jsxs("li",{className:"list-image-(--checkmark-icon) mt-4",children:[u.jsx("h3",{className:"text-xl font-bold",children:e}),t]})}function Jle(){return u.jsxs(u.Fragment,{children:[u.jsx("header",{className:"fixed top-0 z-40 w-full h-20 p-4 bg-black-dark dark:bg-black-dark dark:border-b dark:border-black md:px-12",children:u.jsx(vL,{})}),u.jsxs("div",{className:"pt-20 grid h-screen grid-cols-1 md:grid-cols-2",children:[u.jsx("section",{className:"items-center justify-center hidden text-white md:flex bg-linear-(--blue-pink-gradient) px-6",children:u.jsxs("div",{children:[u.jsx("h1",{className:"text-4xl font-bold",children:"Harper Fabric"}),u.jsxs("ul",{className:"ps-5",children:[u.jsx(mm,{title:"Free Tier",children:u.jsx("span",{children:"Try us out, no credit card required!"})}),u.jsx(mm,{title:"Global Deployments Managed as One",children:u.jsx("span",{children:"Coordinate global environments as if they were a single node."})}),u.jsx(mm,{title:"Database, App, Cache, & Messaging",children:u.jsx("span",{children:"Bring your stack together for reliable, ultra-fast performance."})}),u.jsx(mm,{title:"NoSQL, Vector, & Blob",children:u.jsx("span",{children:"Store and serve modern data types with low latency, semantic search ability, and global reach."})}),u.jsx(mm,{title:"Simplified Operations",children:u.jsx("span",{children:"Focus on what differentiates your app; leave infrastructure to us."})})]}),u.jsx("span",{className:"opacity-5",children:"Bravo!"})]})}),u.jsx("section",{className:"flex items-center justify-center px-6 bg-linear-(--purple-gradient) dark:bg-linear-(--black-dark-gradient)",children:u.jsx(ll,{})})]})]})}function ece(){x.useEffect(()=>{},[])}const tce=["gmail.com","yahoo.com","hotmail.com","outlook.com","icloud.com","aol.com","protonmail.com","mail.com","zoho.com","yandex.com","gmx.com","live.com","msn.com","me.com","inbox.com"];function gE(e){if(!e||!e.includes("@"))return null;const t=e.split("@").pop()||"";if(!t)return null;for(const n of tce)if(t===n||t.endsWith("."+n))return null;return t}let kS=null;function nce(){const e=pn(),t=an(),n=gr(),{redirect:r}=vr({strict:!1});return x.useEffect(()=>{kS||(kS=(async function(){const i=await BM().catch(()=>null);if(!i)_e.error("We were not able to verify your sign-in. Please try signing in again.",{duration:1e4}),await e({to:"/sign-in"});else{Tt.setUserForEntity(_n,i);const o=Ec(i);gE(i.email),await n.invalidateQueries({queryKey:Vy,refetchType:"none"}),await t.invalidate(),await e({to:r?.startsWith("/")?r:o})}kS=null})())},[]),u.jsxs("div",{className:"text-white w-lg flex flex-col gap-4",children:[u.jsxs("h1",{className:"text-3xl font-light",children:[u.jsx("span",{"aria-hidden":"true",className:"text-2xl animate-flower-dance mr-4",title:"Loading",children:"🌼"}),"Checking..."]}),u.jsx("div",{className:"underline flex gap-4",children:u.jsx(Ge,{className:"text-sm opacity-50 hover:text-blue-300",to:"/sign-in",children:"Try signing in again"})})]})}const rce=["top","right","bottom","left"],rl=Math.min,ki=Math.max,Zv=Math.round,zg=Math.floor,ia=e=>({x:e,y:e}),ice={left:"right",right:"left",bottom:"top",top:"bottom"},oce={start:"end",end:"start"};function p1(e,t,n){return ki(e,rl(t,n))}function Ya(e,t){return typeof e=="function"?e(t):e}function Wa(e){return e.split("-")[0]}function Wd(e){return e.split("-")[1]}function vE(e){return e==="x"?"y":"x"}function yE(e){return e==="y"?"height":"width"}const ace=new Set(["top","bottom"]);function ea(e){return ace.has(Wa(e))?"y":"x"}function bE(e){return vE(ea(e))}function sce(e,t,n){n===void 0&&(n=!1);const r=Wd(e),i=bE(e),o=yE(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Yv(a)),[a,Yv(a)]}function lce(e){const t=Yv(e);return[h1(e),t,h1(t)]}function h1(e){return e.replace(/start|end/g,t=>oce[t])}const SD=["left","right"],_D=["right","left"],cce=["top","bottom"],uce=["bottom","top"];function dce(e,t,n){switch(e){case"top":case"bottom":return n?t?_D:SD:t?SD:_D;case"left":case"right":return t?cce:uce;default:return[]}}function fce(e,t,n,r){const i=Wd(e);let o=dce(Wa(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(h1)))),o}function Yv(e){return e.replace(/left|right|bottom|top/g,t=>ice[t])}function mce(e){return{top:0,right:0,bottom:0,left:0,...e}}function bL(e){return typeof e!="number"?mce(e):{top:e,right:e,bottom:e,left:e}}function Wv(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function CD(e,t,n){let{reference:r,floating:i}=e;const o=ea(t),a=bE(t),c=yE(a),d=Wa(t),f=o==="y",p=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,v=r[c]/2-i[c]/2;let y;switch(d){case"top":y={x:p,y:r.y-i.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:h};break;case"left":y={x:r.x-i.width,y:h};break;default:y={x:r.x,y:r.y}}switch(Wd(t)){case"start":y[a]-=v*(n&&f?-1:1);break;case"end":y[a]+=v*(n&&f?-1:1);break}return y}const pce=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,c=o.filter(Boolean),d=await(a.isRTL==null?void 0:a.isRTL(t));let f=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:p,y:h}=CD(f,r,d),v=r,y={},b=0;for(let S=0;S<c.length;S++){const{name:C,fn:E}=c[S],{x:k,y:j,data:I,reset:A}=await E({x:p,y:h,initialPlacement:r,placement:v,strategy:i,middlewareData:y,rects:f,platform:a,elements:{reference:e,floating:t}});p=k??p,h=j??h,y={...y,[C]:{...y[C],...I}},A&&b<=50&&(b++,typeof A=="object"&&(A.placement&&(v=A.placement),A.rects&&(f=A.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:p,y:h}=CD(f,v,d)),S=-1)}return{x:p,y:h,placement:v,strategy:i,middlewareData:y}};async function tp(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:h="floating",altBoundary:v=!1,padding:y=0}=Ya(t,e),b=bL(y),C=c[v?h==="floating"?"reference":"floating":h],E=Wv(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(C)))==null||n?C:C.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:f,rootBoundary:p,strategy:d})),k=h==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,j=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),I=await(o.isElement==null?void 0:o.isElement(j))?await(o.getScale==null?void 0:o.getScale(j))||{x:1,y:1}:{x:1,y:1},A=Wv(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:k,offsetParent:j,strategy:d}):k);return{top:(E.top-A.top+b.top)/I.y,bottom:(A.bottom-E.bottom+b.bottom)/I.y,left:(E.left-A.left+b.left)/I.x,right:(A.right-E.right+b.right)/I.x}}const hce=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:c,middlewareData:d}=t,{element:f,padding:p=0}=Ya(e,t)||{};if(f==null)return{};const h=bL(p),v={x:n,y:r},y=bE(i),b=yE(y),S=await a.getDimensions(f),C=y==="y",E=C?"top":"left",k=C?"bottom":"right",j=C?"clientHeight":"clientWidth",I=o.reference[b]+o.reference[y]-v[y]-o.floating[b],A=v[y]-o.reference[y],N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let T=N?N[j]:0;(!T||!await(a.isElement==null?void 0:a.isElement(N)))&&(T=c.floating[j]||o.floating[b]);const z=I/2-A/2,L=T/2-S[b]/2-1,G=rl(h[E],L),J=rl(h[k],L),Y=G,W=T-S[b]-J,F=T/2-S[b]/2+z,Z=p1(Y,F,W),M=!d.arrow&&Wd(i)!=null&&F!==Z&&o.reference[b]/2-(F<Y?G:J)-S[b]/2<0,K=M?F<Y?F-Y:F-W:0;return{[y]:v[y]+K,data:{[y]:Z,centerOffset:F-Z-K,...M&&{alignmentOffset:K}},reset:M}}}),gce=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:c,platform:d,elements:f}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:S=!0,...C}=Ya(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const E=Wa(i),k=ea(c),j=Wa(c)===c,I=await(d.isRTL==null?void 0:d.isRTL(f.floating)),A=v||(j||!S?[Yv(c)]:lce(c)),N=b!=="none";!v&&N&&A.push(...fce(c,S,b,I));const T=[c,...A],z=await tp(t,C),L=[];let G=((r=o.flip)==null?void 0:r.overflows)||[];if(p&&L.push(z[E]),h){const F=sce(i,a,I);L.push(z[F[0]],z[F[1]])}if(G=[...G,{placement:i,overflows:L}],!L.every(F=>F<=0)){var J,Y;const F=(((J=o.flip)==null?void 0:J.index)||0)+1,Z=T[F];if(Z&&(!(h==="alignment"?k!==ea(Z):!1)||G.every(U=>ea(U.placement)===k?U.overflows[0]>0:!0)))return{data:{index:F,overflows:G},reset:{placement:Z}};let M=(Y=G.filter(K=>K.overflows[0]<=0).sort((K,U)=>K.overflows[1]-U.overflows[1])[0])==null?void 0:Y.placement;if(!M)switch(y){case"bestFit":{var W;const K=(W=G.filter(U=>{if(N){const te=ea(U.placement);return te===k||te==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(te=>te>0).reduce((te,D)=>te+D,0)]).sort((U,te)=>U[1]-te[1])[0])==null?void 0:W[0];K&&(M=K);break}case"initialPlacement":M=c;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function ED(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function kD(e){return rce.some(t=>e[t]>=0)}const vce=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Ya(e,t);switch(r){case"referenceHidden":{const o=await tp(t,{...i,elementContext:"reference"}),a=ED(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:kD(a)}}}case"escaped":{const o=await tp(t,{...i,altBoundary:!0}),a=ED(o,n.floating);return{data:{escapedOffsets:a,escaped:kD(a)}}}default:return{}}}}},xL=new Set(["left","top"]);async function yce(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Wa(n),c=Wd(n),d=ea(n)==="y",f=xL.has(a)?-1:1,p=o&&d?-1:1,h=Ya(t,e);let{mainAxis:v,crossAxis:y,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof b=="number"&&(y=c==="end"?b*-1:b),d?{x:y*p,y:v*f}:{x:v*f,y:y*p}}const bce=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:c}=t,d=await yce(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:i+d.x,y:o+d.y,data:{...d,placement:a}}}}},xce=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:c={fn:C=>{let{x:E,y:k}=C;return{x:E,y:k}}},...d}=Ya(e,t),f={x:n,y:r},p=await tp(t,d),h=ea(Wa(i)),v=vE(h);let y=f[v],b=f[h];if(o){const C=v==="y"?"top":"left",E=v==="y"?"bottom":"right",k=y+p[C],j=y-p[E];y=p1(k,y,j)}if(a){const C=h==="y"?"top":"left",E=h==="y"?"bottom":"right",k=b+p[C],j=b-p[E];b=p1(k,b,j)}const S=c.fn({...t,[v]:y,[h]:b});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[v]:o,[h]:a}}}}}},wce=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=Ya(e,t),p={x:n,y:r},h=ea(i),v=vE(h);let y=p[v],b=p[h];const S=Ya(c,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(d){const j=v==="y"?"height":"width",I=o.reference[v]-o.floating[j]+C.mainAxis,A=o.reference[v]+o.reference[j]-C.mainAxis;y<I?y=I:y>A&&(y=A)}if(f){var E,k;const j=v==="y"?"width":"height",I=xL.has(Wa(i)),A=o.reference[h]-o.floating[j]+(I&&((E=a.offset)==null?void 0:E[h])||0)+(I?0:C.crossAxis),N=o.reference[h]+o.reference[j]+(I?0:((k=a.offset)==null?void 0:k[h])||0)-(I?C.crossAxis:0);b<A?b=A:b>N&&(b=N)}return{[v]:y,[h]:b}}}},Sce=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:a,elements:c}=t,{apply:d=()=>{},...f}=Ya(e,t),p=await tp(t,f),h=Wa(i),v=Wd(i),y=ea(i)==="y",{width:b,height:S}=o.floating;let C,E;h==="top"||h==="bottom"?(C=h,E=v===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(E=h,C=v==="end"?"top":"bottom");const k=S-p.top-p.bottom,j=b-p.left-p.right,I=rl(S-p[C],k),A=rl(b-p[E],j),N=!t.middlewareData.shift;let T=I,z=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(z=j),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=k),N&&!v){const G=ki(p.left,0),J=ki(p.right,0),Y=ki(p.top,0),W=ki(p.bottom,0);y?z=b-2*(G!==0||J!==0?G+J:ki(p.left,p.right)):T=S-2*(Y!==0||W!==0?Y+W:ki(p.top,p.bottom))}await d({...t,availableWidth:z,availableHeight:T});const L=await a.getDimensions(c.floating);return b!==L.width||S!==L.height?{reset:{rects:!0}}:{}}}};function yb(){return typeof window<"u"}function Xd(e){return wL(e)?(e.nodeName||"").toLowerCase():"#document"}function Ti(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ma(e){var t;return(t=(wL(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function wL(e){return yb()?e instanceof Node||e instanceof Ti(e).Node:!1}function $o(e){return yb()?e instanceof Element||e instanceof Ti(e).Element:!1}function ua(e){return yb()?e instanceof HTMLElement||e instanceof Ti(e).HTMLElement:!1}function jD(e){return!yb()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ti(e).ShadowRoot}const _ce=new Set(["inline","contents"]);function Ap(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Mo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!_ce.has(i)}const Cce=new Set(["table","td","th"]);function Ece(e){return Cce.has(Xd(e))}const kce=[":popover-open",":modal"];function bb(e){return kce.some(t=>{try{return e.matches(t)}catch{return!1}})}const jce=["transform","translate","scale","rotate","perspective"],Rce=["transform","translate","scale","rotate","perspective","filter"],Ice=["paint","layout","strict","content"];function xE(e){const t=wE(),n=$o(e)?Mo(e):e;return jce.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Rce.some(r=>(n.willChange||"").includes(r))||Ice.some(r=>(n.contain||"").includes(r))}function Nce(e){let t=il(e);for(;ua(t)&&!wd(t);){if(xE(t))return t;if(bb(t))return null;t=il(t)}return null}function wE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Tce=new Set(["html","body","#document"]);function wd(e){return Tce.has(Xd(e))}function Mo(e){return Ti(e).getComputedStyle(e)}function xb(e){return $o(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function il(e){if(Xd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||jD(e)&&e.host||ma(e);return jD(t)?t.host:t}function SL(e){const t=il(e);return wd(t)?e.ownerDocument?e.ownerDocument.body:e.body:ua(t)&&Ap(t)?t:SL(t)}function np(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=SL(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=Ti(i);if(o){const c=g1(a);return t.concat(a,a.visualViewport||[],Ap(i)?i:[],c&&n?np(c):[])}return t.concat(i,np(i,[],n))}function g1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _L(e){const t=Mo(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=ua(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,c=Zv(n)!==o||Zv(r)!==a;return c&&(n=o,r=a),{width:n,height:r,$:c}}function SE(e){return $o(e)?e:e.contextElement}function rd(e){const t=SE(e);if(!ua(t))return ia(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=_L(t);let a=(o?Zv(n.width):n.width)/r,c=(o?Zv(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const Ace=ia(0);function CL(e){const t=Ti(e);return!wE()||!t.visualViewport?Ace:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Oce(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ti(e)?!1:t}function pc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=SE(e);let a=ia(1);t&&(r?$o(r)&&(a=rd(r)):a=rd(e));const c=Oce(o,n,r)?CL(o):ia(0);let d=(i.left+c.x)/a.x,f=(i.top+c.y)/a.y,p=i.width/a.x,h=i.height/a.y;if(o){const v=Ti(o),y=r&&$o(r)?Ti(r):r;let b=v,S=g1(b);for(;S&&r&&y!==b;){const C=rd(S),E=S.getBoundingClientRect(),k=Mo(S),j=E.left+(S.clientLeft+parseFloat(k.paddingLeft))*C.x,I=E.top+(S.clientTop+parseFloat(k.paddingTop))*C.y;d*=C.x,f*=C.y,p*=C.x,h*=C.y,d+=j,f+=I,b=Ti(S),S=g1(b)}}return Wv({width:p,height:h,x:d,y:f})}function wb(e,t){const n=xb(e).scrollLeft;return t?t.left+n:pc(ma(e)).left+n}function EL(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-wb(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Dce(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=ma(r),c=t?bb(t.floating):!1;if(r===a||c&&o)return n;let d={scrollLeft:0,scrollTop:0},f=ia(1);const p=ia(0),h=ua(r);if((h||!h&&!o)&&((Xd(r)!=="body"||Ap(a))&&(d=xb(r)),ua(r))){const y=pc(r);f=rd(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const v=a&&!h&&!o?EL(a,d):ia(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+p.x+v.x,y:n.y*f.y-d.scrollTop*f.y+p.y+v.y}}function $ce(e){return Array.from(e.getClientRects())}function Mce(e){const t=ma(e),n=xb(e),r=e.ownerDocument.body,i=ki(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ki(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+wb(e);const c=-n.scrollTop;return Mo(r).direction==="rtl"&&(a+=ki(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:c}}const RD=25;function Pce(e,t){const n=Ti(e),r=ma(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,c=0,d=0;if(i){o=i.width,a=i.height;const p=wE();(!p||p&&t==="fixed")&&(c=i.offsetLeft,d=i.offsetTop)}const f=wb(r);if(f<=0){const p=r.ownerDocument,h=p.body,v=getComputedStyle(h),y=p.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,b=Math.abs(r.clientWidth-h.clientWidth-y);b<=RD&&(o-=b)}else f<=RD&&(o+=f);return{width:o,height:a,x:c,y:d}}const zce=new Set(["absolute","fixed"]);function Lce(e,t){const n=pc(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=ua(e)?rd(e):ia(1),a=e.clientWidth*o.x,c=e.clientHeight*o.y,d=i*o.x,f=r*o.y;return{width:a,height:c,x:d,y:f}}function ID(e,t,n){let r;if(t==="viewport")r=Pce(e,n);else if(t==="document")r=Mce(ma(e));else if($o(t))r=Lce(t,n);else{const i=CL(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Wv(r)}function kL(e,t){const n=il(e);return n===t||!$o(n)||wd(n)?!1:Mo(n).position==="fixed"||kL(n,t)}function Uce(e,t){const n=t.get(e);if(n)return n;let r=np(e,[],!1).filter(c=>$o(c)&&Xd(c)!=="body"),i=null;const o=Mo(e).position==="fixed";let a=o?il(e):e;for(;$o(a)&&!wd(a);){const c=Mo(a),d=xE(a);!d&&c.position==="fixed"&&(i=null),(o?!d&&!i:!d&&c.position==="static"&&!!i&&zce.has(i.position)||Ap(a)&&!d&&kL(e,a))?r=r.filter(p=>p!==a):i=c,a=il(a)}return t.set(e,r),r}function Fce(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?bb(t)?[]:Uce(t,this._c):[].concat(n),r],c=a[0],d=a.reduce((f,p)=>{const h=ID(t,p,i);return f.top=ki(h.top,f.top),f.right=rl(h.right,f.right),f.bottom=rl(h.bottom,f.bottom),f.left=ki(h.left,f.left),f},ID(t,c,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Vce(e){const{width:t,height:n}=_L(e);return{width:t,height:n}}function Bce(e,t,n){const r=ua(t),i=ma(t),o=n==="fixed",a=pc(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const d=ia(0);function f(){d.x=wb(i)}if(r||!r&&!o)if((Xd(t)!=="body"||Ap(i))&&(c=xb(t)),r){const y=pc(t,!0,o,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}else i&&f();o&&!r&&i&&f();const p=i&&!r&&!o?EL(i,c):ia(0),h=a.left+c.scrollLeft-d.x-p.x,v=a.top+c.scrollTop-d.y-p.y;return{x:h,y:v,width:a.width,height:a.height}}function jS(e){return Mo(e).position==="static"}function ND(e,t){if(!ua(e)||Mo(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ma(e)===n&&(n=n.ownerDocument.body),n}function jL(e,t){const n=Ti(e);if(bb(e))return n;if(!ua(e)){let i=il(e);for(;i&&!wd(i);){if($o(i)&&!jS(i))return i;i=il(i)}return n}let r=ND(e,t);for(;r&&Ece(r)&&jS(r);)r=ND(r,t);return r&&wd(r)&&jS(r)&&!xE(r)?n:r||Nce(e)||n}const Hce=async function(e){const t=this.getOffsetParent||jL,n=this.getDimensions,r=await n(e.floating);return{reference:Bce(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function qce(e){return Mo(e).direction==="rtl"}const Gce={convertOffsetParentRelativeRectToViewportRelativeRect:Dce,getDocumentElement:ma,getClippingRect:Fce,getOffsetParent:jL,getElementRects:Hce,getClientRects:$ce,getDimensions:Vce,getScale:rd,isElement:$o,isRTL:qce};function RL(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Kce(e,t){let n=null,r;const i=ma(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),o();const f=e.getBoundingClientRect(),{left:p,top:h,width:v,height:y}=f;if(c||t(),!v||!y)return;const b=zg(h),S=zg(i.clientWidth-(p+v)),C=zg(i.clientHeight-(h+y)),E=zg(p),j={rootMargin:-b+"px "+-S+"px "+-C+"px "+-E+"px",threshold:ki(0,rl(1,d))||1};let I=!0;function A(N){const T=N[0].intersectionRatio;if(T!==d){if(!I)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},1e3)}T===1&&!RL(f,e.getBoundingClientRect())&&a(),I=!1}try{n=new IntersectionObserver(A,{...j,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,j)}n.observe(e)}return a(!0),o}function Zce(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=SE(e),p=i||o?[...f?np(f):[],...np(t)]:[];p.forEach(E=>{i&&E.addEventListener("scroll",n,{passive:!0}),o&&E.addEventListener("resize",n)});const h=f&&c?Kce(f,n):null;let v=-1,y=null;a&&(y=new ResizeObserver(E=>{let[k]=E;k&&k.target===f&&y&&(y.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var j;(j=y)==null||j.observe(t)})),n()}),f&&!d&&y.observe(f),y.observe(t));let b,S=d?pc(e):null;d&&C();function C(){const E=pc(e);S&&!RL(S,E)&&n(),S=E,b=requestAnimationFrame(C)}return n(),()=>{var E;p.forEach(k=>{i&&k.removeEventListener("scroll",n),o&&k.removeEventListener("resize",n)}),h?.(),(E=y)==null||E.disconnect(),y=null,d&&cancelAnimationFrame(b)}}const Yce=bce,Wce=xce,Xce=gce,Qce=Sce,Jce=vce,TD=hce,eue=wce,tue=(e,t,n)=>{const r=new Map,i={platform:Gce,...n},o={...i.platform,_c:r};return pce(e,t,{...i,platform:o})};var nue=typeof document<"u",rue=function(){},Cv=nue?x.useLayoutEffect:rue;function Xv(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Xv(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Xv(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function IL(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function AD(e,t){const n=IL(e);return Math.round(t*n)/n}function RS(e){const t=x.useRef(e);return Cv(()=>{t.current=e}),t}function iue(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:c=!0,whileElementsMounted:d,open:f}=e,[p,h]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,y]=x.useState(r);Xv(v,r)||y(r);const[b,S]=x.useState(null),[C,E]=x.useState(null),k=x.useCallback(U=>{U!==N.current&&(N.current=U,S(U))},[]),j=x.useCallback(U=>{U!==T.current&&(T.current=U,E(U))},[]),I=o||b,A=a||C,N=x.useRef(null),T=x.useRef(null),z=x.useRef(p),L=d!=null,G=RS(d),J=RS(i),Y=RS(f),W=x.useCallback(()=>{if(!N.current||!T.current)return;const U={placement:t,strategy:n,middleware:v};J.current&&(U.platform=J.current),tue(N.current,T.current,U).then(te=>{const D={...te,isPositioned:Y.current!==!1};F.current&&!Xv(z.current,D)&&(z.current=D,zd.flushSync(()=>{h(D)}))})},[v,t,n,J,Y]);Cv(()=>{f===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,h(U=>({...U,isPositioned:!1})))},[f]);const F=x.useRef(!1);Cv(()=>(F.current=!0,()=>{F.current=!1}),[]),Cv(()=>{if(I&&(N.current=I),A&&(T.current=A),I&&A){if(G.current)return G.current(I,A,W);W()}},[I,A,W,G,L]);const Z=x.useMemo(()=>({reference:N,floating:T,setReference:k,setFloating:j}),[k,j]),M=x.useMemo(()=>({reference:I,floating:A}),[I,A]),K=x.useMemo(()=>{const U={position:n,left:0,top:0};if(!M.floating)return U;const te=AD(M.floating,p.x),D=AD(M.floating,p.y);return c?{...U,transform:"translate("+te+"px, "+D+"px)",...IL(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:te,top:D}},[n,c,M.floating,p.x,p.y]);return x.useMemo(()=>({...p,update:W,refs:Z,elements:M,floatingStyles:K}),[p,W,Z,M,K])}const oue=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?TD({element:r.current,padding:i}).fn(n):{}:r?TD({element:r,padding:i}).fn(n):{}}}},aue=(e,t)=>({...Yce(e),options:[e,t]}),sue=(e,t)=>({...Wce(e),options:[e,t]}),lue=(e,t)=>({...eue(e),options:[e,t]}),cue=(e,t)=>({...Xce(e),options:[e,t]}),uue=(e,t)=>({...Qce(e),options:[e,t]}),due=(e,t)=>({...Jce(e),options:[e,t]}),fue=(e,t)=>({...oue(e),options:[e,t]});var mue="Arrow",NL=x.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return u.jsx(Ke.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});NL.displayName=mue;var pue=NL;function TL(e){const[t,n]=x.useState(void 0);return Yn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,c;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;a=f.inlineSize,c=f.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var _E="Popper",[AL,Qd]=Pi(_E),[hue,OL]=AL(_E),DL=e=>{const{__scopePopper:t,children:n}=e,[r,i]=x.useState(null);return u.jsx(hue,{scope:t,anchor:r,onAnchorChange:i,children:n})};DL.displayName=_E;var $L="PopperAnchor",ML=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=OL($L,n),a=x.useRef(null),c=ut(t,a),d=x.useRef(null);return x.useEffect(()=>{const f=d.current;d.current=r?.current||a.current,f!==d.current&&o.onAnchorChange(d.current)}),r?null:u.jsx(Ke.div,{...i,ref:c})});ML.displayName=$L;var CE="PopperContent",[gue,vue]=AL(CE),PL=x.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:h="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:b,...S}=e,C=OL(CE,n),[E,k]=x.useState(null),j=ut(t,B=>k(B)),[I,A]=x.useState(null),N=TL(I),T=N?.width??0,z=N?.height??0,L=r+(o!=="center"?"-"+o:""),G=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},J=Array.isArray(f)?f:[f],Y=J.length>0,W={padding:G,boundary:J.filter(bue),altBoundary:Y},{refs:F,floatingStyles:Z,placement:M,isPositioned:K,middlewareData:U}=iue({strategy:"fixed",placement:L,whileElementsMounted:(...B)=>Zce(...B,{animationFrame:y==="always"}),elements:{reference:C.anchor},middleware:[aue({mainAxis:i+z,alignmentAxis:a}),d&&sue({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?lue():void 0,...W}),d&&cue({...W}),uue({...W,apply:({elements:B,rects:ie,availableWidth:Se,availableHeight:Ie})=>{const{width:Fe,height:Ue}=ie.reference,Ye=B.floating.style;Ye.setProperty("--radix-popper-available-width",`${Se}px`),Ye.setProperty("--radix-popper-available-height",`${Ie}px`),Ye.setProperty("--radix-popper-anchor-width",`${Fe}px`),Ye.setProperty("--radix-popper-anchor-height",`${Ue}px`)}}),I&&fue({element:I,padding:c}),xue({arrowWidth:T,arrowHeight:z}),v&&due({strategy:"referenceHidden",...W})]}),[te,D]=UL(M),P=bn(b);Yn(()=>{K&&P?.()},[K,P]);const V=U.arrow?.x,O=U.arrow?.y,ee=U.arrow?.centerOffset!==0,[ue,pe]=x.useState();return Yn(()=>{E&&pe(window.getComputedStyle(E).zIndex)},[E]),u.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:K?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(gue,{scope:n,placedSide:te,onArrowChange:A,arrowX:V,arrowY:O,shouldHideArrow:ee,children:u.jsx(Ke.div,{"data-side":te,"data-align":D,...S,ref:j,style:{...S.style,animation:K?void 0:"none"}})})})});PL.displayName=CE;var zL="PopperArrow",yue={top:"bottom",right:"left",bottom:"top",left:"right"},LL=x.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=vue(zL,r),a=yue[o.placedSide];return u.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:u.jsx(pue,{...i,ref:n,style:{...i.style,display:"block"}})})});LL.displayName=zL;function bue(e){return e!==null}var xue=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,c=a?0:e.arrowWidth,d=a?0:e.arrowHeight,[f,p]=UL(n),h={start:"0%",center:"50%",end:"100%"}[p],v=(i.arrow?.x??0)+c/2,y=(i.arrow?.y??0)+d/2;let b="",S="";return f==="bottom"?(b=a?h:`${v}px`,S=`${-d}px`):f==="top"?(b=a?h:`${v}px`,S=`${r.floating.height+d}px`):f==="right"?(b=`${-d}px`,S=a?h:`${y}px`):f==="left"&&(b=`${r.floating.width+d}px`,S=a?h:`${y}px`),{data:{x:b,y:S}}}});function UL(e){const[t,n="center"]=e.split("-");return[t,n]}var EE=DL,kE=ML,jE=PL,RE=LL,wue="Portal",Op=x.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=x.useState(!1);Yn(()=>o(!0),[]);const a=n||i&&globalThis?.document?.body;return a?OC.createPortal(u.jsx(Ke.div,{...r,ref:t}),a):null});Op.displayName=wue;var[Sb]=Pi("Tooltip",[Qd]),_b=Qd(),FL="TooltipProvider",Sue=700,v1="tooltip.open",[_ue,IE]=Sb(FL),VL=e=>{const{__scopeTooltip:t,delayDuration:n=Sue,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,a=x.useRef(!0),c=x.useRef(!1),d=x.useRef(0);return x.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),u.jsx(_ue,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(d.current),a.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:x.useCallback(f=>{c.current=f},[]),disableHoverableContent:i,children:o})};VL.displayName=FL;var rp="Tooltip",[Cue,Dp]=Sb(rp),BL=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:a,delayDuration:c}=e,d=IE(rp,e.__scopeTooltip),f=_b(t),[p,h]=x.useState(null),v=Ni(),y=x.useRef(0),b=a??d.disableHoverableContent,S=c??d.delayDuration,C=x.useRef(!1),[E,k]=Do({prop:r,defaultProp:i??!1,onChange:T=>{T?(d.onOpen(),document.dispatchEvent(new CustomEvent(v1))):d.onClose(),o?.(T)},caller:rp}),j=x.useMemo(()=>E?C.current?"delayed-open":"instant-open":"closed",[E]),I=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C.current=!1,k(!0)},[k]),A=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,k(!1)},[k]),N=x.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{C.current=!0,k(!0),y.current=0},S)},[S,k]);return x.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),u.jsx(EE,{...f,children:u.jsx(Cue,{scope:t,contentId:v,open:E,stateAttribute:j,trigger:p,onTriggerChange:h,onTriggerEnter:x.useCallback(()=>{d.isOpenDelayedRef.current?N():I()},[d.isOpenDelayedRef,N,I]),onTriggerLeave:x.useCallback(()=>{b?A():(window.clearTimeout(y.current),y.current=0)},[A,b]),onOpen:I,onClose:A,disableHoverableContent:b,children:n})})};BL.displayName=rp;var y1="TooltipTrigger",HL=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Dp(y1,n),o=IE(y1,n),a=_b(n),c=x.useRef(null),d=ut(t,c,i.onTriggerChange),f=x.useRef(!1),p=x.useRef(!1),h=x.useCallback(()=>f.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),u.jsx(kE,{asChild:!0,...a,children:u.jsx(Ke.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:d,onPointerMove:je(e.onPointerMove,v=>{v.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:je(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:je(e.onPointerDown,()=>{i.open&&i.onClose(),f.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:je(e.onFocus,()=>{f.current||i.onOpen()}),onBlur:je(e.onBlur,i.onClose),onClick:je(e.onClick,i.onClose)})})});HL.displayName=y1;var NE="TooltipPortal",[Eue,kue]=Sb(NE,{forceMount:void 0}),qL=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=Dp(NE,t);return u.jsx(Eue,{scope:t,forceMount:n,children:u.jsx(Wn,{present:n||o.open,children:u.jsx(Op,{asChild:!0,container:i,children:r})})})};qL.displayName=NE;var Sd="TooltipContent",GL=x.forwardRef((e,t)=>{const n=kue(Sd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=Dp(Sd,e.__scopeTooltip);return u.jsx(Wn,{present:r||a.open,children:a.disableHoverableContent?u.jsx(KL,{side:i,...o,ref:t}):u.jsx(jue,{side:i,...o,ref:t})})}),jue=x.forwardRef((e,t)=>{const n=Dp(Sd,e.__scopeTooltip),r=IE(Sd,e.__scopeTooltip),i=x.useRef(null),o=ut(t,i),[a,c]=x.useState(null),{trigger:d,onClose:f}=n,p=i.current,{onPointerInTransitChange:h}=r,v=x.useCallback(()=>{c(null),h(!1)},[h]),y=x.useCallback((b,S)=>{const C=b.currentTarget,E={x:b.clientX,y:b.clientY},k=Tue(E,C.getBoundingClientRect()),j=Aue(E,k),I=Oue(S.getBoundingClientRect()),A=$ue([...j,...I]);c(A),h(!0)},[h]);return x.useEffect(()=>()=>v(),[v]),x.useEffect(()=>{if(d&&p){const b=C=>y(C,p),S=C=>y(C,d);return d.addEventListener("pointerleave",b),p.addEventListener("pointerleave",S),()=>{d.removeEventListener("pointerleave",b),p.removeEventListener("pointerleave",S)}}},[d,p,y,v]),x.useEffect(()=>{if(a){const b=S=>{const C=S.target,E={x:S.clientX,y:S.clientY},k=d?.contains(C)||p?.contains(C),j=!Due(E,a);k?v():j&&(v(),f())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[d,p,a,f,v]),u.jsx(KL,{...e,ref:o})}),[Rue,Iue]=Sb(rp,{isInside:!1}),Nue=Xse("TooltipContent"),KL=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...c}=e,d=Dp(Sd,n),f=_b(n),{onClose:p}=d;return x.useEffect(()=>(document.addEventListener(v1,p),()=>document.removeEventListener(v1,p)),[p]),x.useEffect(()=>{if(d.trigger){const h=v=>{v.target?.contains(d.trigger)&&p()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[d.trigger,p]),u.jsx(Kd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:p,children:u.jsxs(jE,{"data-state":d.stateAttribute,...f,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[u.jsx(Nue,{children:r}),u.jsx(Rue,{scope:n,isInside:!0,children:u.jsx(Y4,{id:d.contentId,role:"tooltip",children:i||r})})]})})});GL.displayName=Sd;var ZL="TooltipArrow",YL=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=_b(n);return Iue(ZL,n).isInside?null:u.jsx(RE,{...i,...r,ref:t})});YL.displayName=ZL;function Tue(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Aue(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Oue(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Due(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const c=t[o],d=t[a],f=c.x,p=c.y,h=d.x,v=d.y;p>r!=v>r&&n<(h-f)*(r-p)/(v-p)+f&&(i=!i)}return i}function $ue(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Mue(t)}function Mue(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Pue=VL,zue=BL,Lue=HL,Uue=qL,Fue=GL,Vue=YL;function Bue({delayDuration:e=0,...t}){return u.jsx(Pue,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Cb({...e}){return u.jsx(Bue,{children:u.jsx(zue,{"data-slot":"tooltip",...e})})}function Eb({...e}){return u.jsx(Lue,{"data-slot":"tooltip-trigger",...e})}function kb({className:e,sideOffset:t=0,arrowClassName:n,children:r,...i}){return u.jsx(Uue,{children:u.jsxs(Fue,{"data-slot":"tooltip-content",sideOffset:t,className:Pe("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...i,children:[r,u.jsx(Vue,{className:Pe("bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",n)})]})})}const pm=new Map;function Eo(e){if(!e)return"";if(pm.has(e))return pm.get(e);const t=e.replace(/[-_]+/g," ").replace(/\s+/g," ").trim();if(!t)return pm.set(e,""),"";const n=t.match(/([A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+|[0-9]+)/g);if(!n)return pm.set(e,""),"";const r=[];for(let a=0;a<n.length;a++){const c=n[a],d=a+1<n.length?n[a+1]:void 0;/^[A-Z]{2,}$/.test(c)&&d&&/[A-Z]*s$/.test(d)||/^[A-Z]$/.test(c)&&d!==void 0&&/^[A-Z]s$/.test(d)?(r.push(c+d),a++):r.push(c)}const o=r.map(Hue).join(" ");return pm.set(e,o),o}function Hue(e){return/^[A-Z]{2,3}s?$/.test(e)||/^[0-9]+$/.test(e)?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function jb({restartRequired:e}){const t=QY(),{organization:n,instance:r,cluster:i}=xp({strict:!1}),o="Instance",a=x.useMemo(()=>{const c=t.pathname.split("/").filter(f=>f&&f.length>0),d=[u.jsxs(Ge,{to:"/",children:[u.jsx(WX,{"aria-hidden":"true",className:"size-5 shrink-0"}),u.jsx("span",{className:"sr-only",children:"Home"})]})];for(let f=0;f<c.length;f++){const p=c[f];if(p==="instance")continue;let h=`/${c.slice(0,f+1).join("/")}`,v=Eo(p),y;p==="databases"&&c.length===f+3?(v=c[f+2],f+=2):v.startsWith("Org ")?v=n?.name||"Org":v.startsWith("Clu ")?(v=i?.name||"Cluster",c[f+1]==="instance"&&(h+="/instances")):v.startsWith("Ins ")?v=r?.name?.split(".")?.shift()||"Instance":v==="Apis"&&(v="APIs"),d.push(u.jsx("svg",{fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true",className:"size-5 shrink-0 text-grey",children:u.jsx("path",{d:"M5.555 17.776l8-16 .894.448-8 16-.894-.448z"})}),u.jsxs(Ge,{to:h,className:"text-xs md:text-sm font-medium hover:text-grey truncate max-w-48",children:[v,y]}))}return d},[t.pathname,i?.name,r?.name,n?.name]);return u.jsxs("div",{role:"list",className:"flex items-center space-x-2 xl:space-x-4 sm:max-w-9/10 max-w-[calc(100%-56px)]",children:[...a,e&&u.jsxs(Cb,{children:[u.jsx(Eb,{asChild:!0,children:u.jsxs("div",{className:"text-xs italic text-muted-foreground",children:["* Restart ",u.jsx("span",{className:"hidden lg:inline-block",children:"Requested"})]})}),u.jsxs(kb,{side:"bottom",children:["This ",o," is requesting a restart, when convenient, to apply your latest changes.",u.jsx("br",{}),"You can do this from the Apps or Config pages."]})]})]})}var $p=e=>e.type==="checkbox",Wl=e=>e instanceof Date,ii=e=>e==null;const WL=e=>typeof e=="object";var Zn=e=>!ii(e)&&!Array.isArray(e)&&WL(e)&&!Wl(e),XL=e=>Zn(e)&&e.target?$p(e.target)?e.target.checked:e.target.value:e,que=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,QL=(e,t)=>e.has(que(t)),Gue=e=>{const t=e.constructor&&e.constructor.prototype;return Zn(t)&&t.hasOwnProperty("isPrototypeOf")},TE=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function dn(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(TE&&(e instanceof Blob||r))&&(n||Zn(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!Gue(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=dn(e[i]));else return e;return t}var Rb=e=>/^\w*$/.test(e),rn=e=>e===void 0,Ib=e=>Array.isArray(e)?e.filter(Boolean):[],AE=e=>Ib(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ne=(e,t,n)=>{if(!t||!Zn(e))return n;const r=(Rb(t)?[t]:AE(t)).reduce((i,o)=>ii(i)?i:i[o],e);return rn(r)||r===e?rn(e[t])?n:e[t]:r},Ci=e=>typeof e=="boolean",zt=(e,t,n)=>{let r=-1;const i=Rb(t)?[t]:AE(t),o=i.length,a=o-1;for(;++r<o;){const c=i[r];let d=n;if(r!==a){const f=e[c];d=Zn(f)||Array.isArray(f)?f:isNaN(+i[r+1])?{}:[]}if(c==="__proto__"||c==="constructor"||c==="prototype")return;e[c]=d,e=e[c]}};const Qv={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},oo={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},$a={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},OE=X.createContext(null);OE.displayName="HookFormContext";const Mp=()=>X.useContext(OE),Kue=e=>{const{children:t,...n}=e;return X.createElement(OE.Provider,{value:n},t)};var JL=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const a=o;return t._proxyFormState[a]!==oo.all&&(t._proxyFormState[a]=!r||oo.all),n&&(n[a]=!0),e[a]}});return i};const Nb=typeof window<"u"?X.useLayoutEffect:X.useEffect;function DE(e){const t=Mp(),{control:n=t.control,disabled:r,name:i,exact:o}=e||{},[a,c]=X.useState(n._formState),d=X.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Nb(()=>n._subscribe({name:i,formState:d.current,exact:o,callback:f=>{!r&&c({...n._formState,...f})}}),[i,r,o]),X.useEffect(()=>{d.current.isValid&&n._setValid(!0)},[n]),X.useMemo(()=>JL(a,n,d.current,!1),[a,n])}var ji=e=>typeof e=="string",eU=(e,t,n,r,i)=>ji(e)?(r&&t.watch.add(e),Ne(n,e,i)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),Ne(n,o))):(r&&(t.watchAll=!0),n),b1=e=>ii(e)||!WL(e);function Ua(e,t,n=new WeakSet){if(b1(e)||b1(t))return e===t;if(Wl(e)&&Wl(t))return e.getTime()===t.getTime();const r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const o of r){const a=e[o];if(!i.includes(o))return!1;if(o!=="ref"){const c=t[o];if(Wl(a)&&Wl(c)||Zn(a)&&Zn(c)||Array.isArray(a)&&Array.isArray(c)?!Ua(a,c,n):a!==c)return!1}}return!0}function Zue(e){const t=Mp(),{control:n=t.control,name:r,defaultValue:i,disabled:o,exact:a,compute:c}=e||{},d=X.useRef(i),f=X.useRef(c),p=X.useRef(void 0);f.current=c;const h=X.useMemo(()=>n._getWatch(r,d.current),[n,r]),[v,y]=X.useState(f.current?f.current(h):h);return Nb(()=>n._subscribe({name:r,formState:{values:!0},exact:a,callback:b=>{if(!o){const S=eU(r,n._names,b.values||n._formValues,!1,d.current);if(f.current){const C=f.current(S);Ua(C,p.current)||(y(C),p.current=C)}else y(S)}}}),[n,o,r,a]),X.useEffect(()=>n._removeUnmounted()),v}function Yue(e){const t=Mp(),{name:n,disabled:r,control:i=t.control,shouldUnregister:o,defaultValue:a}=e,c=QL(i._names.array,n),d=X.useMemo(()=>Ne(i._formValues,n,Ne(i._defaultValues,n,a)),[i,n,a]),f=Zue({control:i,name:n,defaultValue:d,exact:!0}),p=DE({control:i,name:n,exact:!0}),h=X.useRef(e),v=X.useRef(void 0),y=X.useRef(i.register(n,{...e.rules,value:f,...Ci(e.disabled)?{disabled:e.disabled}:{}}));h.current=e;const b=X.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ne(p.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ne(p.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ne(p.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ne(p.validatingFields,n)},error:{enumerable:!0,get:()=>Ne(p.errors,n)}}),[p,n]),S=X.useCallback(j=>y.current.onChange({target:{value:XL(j),name:n},type:Qv.CHANGE}),[n]),C=X.useCallback(()=>y.current.onBlur({target:{value:Ne(i._formValues,n),name:n},type:Qv.BLUR}),[n,i._formValues]),E=X.useCallback(j=>{const I=Ne(i._fields,n);I&&j&&(I._f.ref={focus:()=>j.focus&&j.focus(),select:()=>j.select&&j.select(),setCustomValidity:A=>j.setCustomValidity(A),reportValidity:()=>j.reportValidity()})},[i._fields,n]),k=X.useMemo(()=>({name:n,value:f,...Ci(r)||p.disabled?{disabled:p.disabled||r}:{},onChange:S,onBlur:C,ref:E}),[n,r,p.disabled,S,C,E,f]);return X.useEffect(()=>{const j=i._options.shouldUnregister||o,I=v.current;I&&I!==n&&!c&&i.unregister(I),i.register(n,{...h.current.rules,...Ci(h.current.disabled)?{disabled:h.current.disabled}:{}});const A=(N,T)=>{const z=Ne(i._fields,N);z&&z._f&&(z._f.mount=T)};if(A(n,!0),j){const N=dn(Ne(i._options.defaultValues,n,h.current.defaultValue));zt(i._defaultValues,n,N),rn(Ne(i._formValues,n))&&zt(i._formValues,n,N)}return!c&&i.register(n),v.current=n,()=>{(c?j&&!i._state.action:j)?i.unregister(n):A(n,!1)}},[n,i,c,o]),X.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),X.useMemo(()=>({field:k,formState:p,fieldState:b}),[k,p,b])}const Wue=e=>e.render(Yue(e));var $E=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},si=e=>Array.isArray(e)?e:[e],OD=()=>{let e=[];return{get observers(){return e},next:i=>{for(const o of e)o.next&&o.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(o=>o!==i)}}),unsubscribe:()=>{e=[]}}};function tU(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const i=e[r],o=t[r];if(i&&Zn(i)&&o){const a=tU(i,o);Zn(a)&&(n[r]=a)}else e[r]&&(n[r]=o)}return n}var Dr=e=>Zn(e)&&!Object.keys(e).length,ME=e=>e.type==="file",ko=e=>typeof e=="function",Jv=e=>{if(!TE)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},nU=e=>e.type==="select-multiple",PE=e=>e.type==="radio",Xue=e=>PE(e)||$p(e),IS=e=>Jv(e)&&e.isConnected;function Que(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=rn(e)?r++:e[t[r++]];return e}function Jue(e){for(const t in e)if(e.hasOwnProperty(t)&&!rn(e[t]))return!1;return!0}function $n(e,t){const n=Array.isArray(t)?t:Rb(t)?[t]:AE(t),r=n.length===1?e:Que(e,n),i=n.length-1,o=n[i];return r&&delete r[o],i!==0&&(Zn(r)&&Dr(r)||Array.isArray(r)&&Jue(r))&&$n(e,n.slice(0,-1)),e}var ede=e=>{for(const t in e)if(ko(e[t]))return!0;return!1};function rU(e){return Array.isArray(e)||Zn(e)&&!ede(e)}function x1(e,t={}){for(const n in e)rU(e[n])?(t[n]=Array.isArray(e[n])?[]:{},x1(e[n],t[n])):rn(e[n])||(t[n]=!0);return t}function Hu(e,t,n){n||(n=x1(t));for(const r in e)rU(e[r])?rn(t)||b1(n[r])?n[r]=x1(e[r],Array.isArray(e[r])?[]:{}):Hu(e[r],ii(t)?{}:t[r],n[r]):n[r]=!Ua(e[r],t[r]);return n}const DD={value:!1,isValid:!1},$D={value:!0,isValid:!0};var iU=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!rn(e[0].attributes.value)?rn(e[0].value)||e[0].value===""?$D:{value:e[0].value,isValid:!0}:$D:DD}return DD},oU=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>rn(e)?e:t?e===""?NaN:e&&+e:n&&ji(e)?new Date(e):r?r(e):e;const MD={isValid:!1,value:null};var aU=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,MD):MD;function PD(e){const t=e.ref;return ME(t)?t.files:PE(t)?aU(e.refs).value:nU(t)?[...t.selectedOptions].map(({value:n})=>n):$p(t)?iU(e.refs).value:oU(rn(t.value)?e.ref.value:t.value,e)}var tde=(e,t,n,r)=>{const i={};for(const o of e){const a=Ne(t,o);a&&zt(i,o,a._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},ey=e=>e instanceof RegExp,hm=e=>rn(e)?e:ey(e)?e.source:Zn(e)?ey(e.value)?e.value.source:e.value:e,Yu=e=>({isOnSubmit:!e||e===oo.onSubmit,isOnBlur:e===oo.onBlur,isOnChange:e===oo.onChange,isOnAll:e===oo.all,isOnTouch:e===oo.onTouched});const zD="AsyncFunction";var nde=e=>!!e&&!!e.validate&&!!(ko(e.validate)&&e.validate.constructor.name===zD||Zn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===zD)),rde=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),w1=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const id=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const o=Ne(e,i);if(o){const{_f:a,...c}=o;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],i)&&!r)return!0;if(a.ref&&t(a.ref,a.name)&&!r)return!0;if(id(c,t))break}else if(Zn(c)&&id(c,t))break}}};function LD(e,t,n){const r=Ne(e,n);if(r||Rb(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),a=Ne(t,o),c=Ne(e,o);if(a&&!Array.isArray(a)&&n!==o)return{name:n};if(c&&c.type)return{name:o,error:c};if(c&&c.root&&c.root.type)return{name:`${o}.root`,error:c.root};i.pop()}return{name:n}}var ide=(e,t,n,r)=>{n(e);const{name:i,...o}=e;return Dr(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!r||oo.all))},ode=(e,t,n)=>!e||!t||e===t||si(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),ade=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,sde=(e,t)=>!Ib(Ne(e,t)).length&&$n(e,t),sU=(e,t,n)=>{const r=si(Ne(e,n));return zt(r,"root",t[n]),zt(e,n,r),e};function UD(e,t,n="validate"){if(ji(e)||Array.isArray(e)&&e.every(ji)||Ci(e)&&!e)return{type:n,message:ji(e)?e:"",ref:t}}var Mu=e=>Zn(e)&&!ey(e)?e:{value:e,message:""},S1=async(e,t,n,r,i,o)=>{const{ref:a,refs:c,required:d,maxLength:f,minLength:p,min:h,max:v,pattern:y,validate:b,name:S,valueAsNumber:C,mount:E}=e._f,k=Ne(n,S);if(!E||t.has(S))return{};const j=c?c[0]:a,I=Y=>{i&&j.reportValidity&&(j.setCustomValidity(Ci(Y)?"":Y||""),j.reportValidity())},A={},N=PE(a),T=$p(a),z=N||T,L=(C||ME(a))&&rn(a.value)&&rn(k)||Jv(a)&&a.value===""||k===""||Array.isArray(k)&&!k.length,G=$E.bind(null,S,r,A),J=(Y,W,F,Z=$a.maxLength,M=$a.minLength)=>{const K=Y?W:F;A[S]={type:Y?Z:M,message:K,ref:a,...G(Y?Z:M,K)}};if(o?!Array.isArray(k)||!k.length:d&&(!z&&(L||ii(k))||Ci(k)&&!k||T&&!iU(c).isValid||N&&!aU(c).isValid)){const{value:Y,message:W}=ji(d)?{value:!!d,message:d}:Mu(d);if(Y&&(A[S]={type:$a.required,message:W,ref:j,...G($a.required,W)},!r))return I(W),A}if(!L&&(!ii(h)||!ii(v))){let Y,W;const F=Mu(v),Z=Mu(h);if(!ii(k)&&!isNaN(k)){const M=a.valueAsNumber||k&&+k;ii(F.value)||(Y=M>F.value),ii(Z.value)||(W=M<Z.value)}else{const M=a.valueAsDate||new Date(k),K=D=>new Date(new Date().toDateString()+" "+D),U=a.type=="time",te=a.type=="week";ji(F.value)&&k&&(Y=U?K(k)>K(F.value):te?k>F.value:M>new Date(F.value)),ji(Z.value)&&k&&(W=U?K(k)<K(Z.value):te?k<Z.value:M<new Date(Z.value))}if((Y||W)&&(J(!!Y,F.message,Z.message,$a.max,$a.min),!r))return I(A[S].message),A}if((f||p)&&!L&&(ji(k)||o&&Array.isArray(k))){const Y=Mu(f),W=Mu(p),F=!ii(Y.value)&&k.length>+Y.value,Z=!ii(W.value)&&k.length<+W.value;if((F||Z)&&(J(F,Y.message,W.message),!r))return I(A[S].message),A}if(y&&!L&&ji(k)){const{value:Y,message:W}=Mu(y);if(ey(Y)&&!k.match(Y)&&(A[S]={type:$a.pattern,message:W,ref:a,...G($a.pattern,W)},!r))return I(W),A}if(b){if(ko(b)){const Y=await b(k,n),W=UD(Y,j);if(W&&(A[S]={...W,...G($a.validate,W.message)},!r))return I(W.message),A}else if(Zn(b)){let Y={};for(const W in b){if(!Dr(Y)&&!r)break;const F=UD(await b[W](k,n),j,W);F&&(Y={...F,...G(W,F.message)},I(F.message),r&&(A[S]=Y))}if(!Dr(Y)&&(A[S]={ref:j,...Y},!r))return A}}return I(!0),A};const lde={mode:oo.onSubmit,reValidateMode:oo.onChange,shouldFocusError:!0};function cde(e={}){let t={...lde,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:ko(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=Zn(t.defaultValues)||Zn(t.values)?dn(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:dn(i),a={action:!1,mount:!1,watch:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},d,f=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let h={...p};const v={array:OD(),state:OD()},y=t.criteriaMode===oo.all,b=q=>oe=>{clearTimeout(f),f=setTimeout(q,oe)},S=async q=>{if(!t.disabled&&(p.isValid||h.isValid||q)){const oe=t.resolver?Dr((await T()).errors):await L(r,!0);oe!==n.isValid&&v.state.next({isValid:oe})}},C=(q,oe)=>{!t.disabled&&(p.isValidating||p.validatingFields||h.isValidating||h.validatingFields)&&((q||Array.from(c.mount)).forEach(de=>{de&&(oe?zt(n.validatingFields,de,oe):$n(n.validatingFields,de))}),v.state.next({validatingFields:n.validatingFields,isValidating:!Dr(n.validatingFields)}))},E=(q,oe=[],de,we,ve=!0,Ee=!0)=>{if(we&&de&&!t.disabled){if(a.action=!0,Ee&&Array.isArray(Ne(r,q))){const ne=de(Ne(r,q),we.argA,we.argB);ve&&zt(r,q,ne)}if(Ee&&Array.isArray(Ne(n.errors,q))){const ne=de(Ne(n.errors,q),we.argA,we.argB);ve&&zt(n.errors,q,ne),sde(n.errors,q)}if((p.touchedFields||h.touchedFields)&&Ee&&Array.isArray(Ne(n.touchedFields,q))){const ne=de(Ne(n.touchedFields,q),we.argA,we.argB);ve&&zt(n.touchedFields,q,ne)}(p.dirtyFields||h.dirtyFields)&&(n.dirtyFields=Hu(i,o)),v.state.next({name:q,isDirty:J(q,oe),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else zt(o,q,oe)},k=(q,oe)=>{zt(n.errors,q,oe),v.state.next({errors:n.errors})},j=q=>{n.errors=q,v.state.next({errors:n.errors,isValid:!1})},I=(q,oe,de,we)=>{const ve=Ne(r,q);if(ve){const Ee=Ne(o,q,rn(de)?Ne(i,q):de);rn(Ee)||we&&we.defaultChecked||oe?zt(o,q,oe?Ee:PD(ve._f)):F(q,Ee),a.mount&&S()}},A=(q,oe,de,we,ve)=>{let Ee=!1,ne=!1;const ye={name:q};if(!t.disabled){if(!de||we){(p.isDirty||h.isDirty)&&(ne=n.isDirty,n.isDirty=ye.isDirty=J(),Ee=ne!==ye.isDirty);const Te=Ua(Ne(i,q),oe);ne=!!Ne(n.dirtyFields,q),Te?$n(n.dirtyFields,q):zt(n.dirtyFields,q,!0),ye.dirtyFields=n.dirtyFields,Ee=Ee||(p.dirtyFields||h.dirtyFields)&&ne!==!Te}if(de){const Te=Ne(n.touchedFields,q);Te||(zt(n.touchedFields,q,de),ye.touchedFields=n.touchedFields,Ee=Ee||(p.touchedFields||h.touchedFields)&&Te!==de)}Ee&&ve&&v.state.next(ye)}return Ee?ye:{}},N=(q,oe,de,we)=>{const ve=Ne(n.errors,q),Ee=(p.isValid||h.isValid)&&Ci(oe)&&n.isValid!==oe;if(t.delayError&&de?(d=b(()=>k(q,de)),d(t.delayError)):(clearTimeout(f),d=null,de?zt(n.errors,q,de):$n(n.errors,q)),(de?!Ua(ve,de):ve)||!Dr(we)||Ee){const ne={...we,...Ee&&Ci(oe)?{isValid:oe}:{},errors:n.errors,name:q};n={...n,...ne},v.state.next(ne)}},T=async q=>{C(q,!0);const oe=await t.resolver(o,t.context,tde(q||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return C(q),oe},z=async q=>{const{errors:oe}=await T(q);if(q)for(const de of q){const we=Ne(oe,de);we?zt(n.errors,de,we):$n(n.errors,de)}else n.errors=oe;return oe},L=async(q,oe,de={valid:!0})=>{for(const we in q){const ve=q[we];if(ve){const{_f:Ee,...ne}=ve;if(Ee){const ye=c.array.has(Ee.name),Te=ve._f&&nde(ve._f);Te&&p.validatingFields&&C([Ee.name],!0);const Ze=await S1(ve,c.disabled,o,y,t.shouldUseNativeValidation&&!oe,ye);if(Te&&p.validatingFields&&C([Ee.name]),Ze[Ee.name]&&(de.valid=!1,oe))break;!oe&&(Ne(Ze,Ee.name)?ye?sU(n.errors,Ze,Ee.name):zt(n.errors,Ee.name,Ze[Ee.name]):$n(n.errors,Ee.name))}!Dr(ne)&&await L(ne,oe,de)}}return de.valid},G=()=>{for(const q of c.unMount){const oe=Ne(r,q);oe&&(oe._f.refs?oe._f.refs.every(de=>!IS(de)):!IS(oe._f.ref))&&B(q)}c.unMount=new Set},J=(q,oe)=>!t.disabled&&(q&&oe&&zt(o,q,oe),!Ua(D(),i)),Y=(q,oe,de)=>eU(q,c,{...a.mount?o:rn(oe)?i:ji(q)?{[q]:oe}:oe},de,oe),W=q=>Ib(Ne(a.mount?o:i,q,t.shouldUnregister?Ne(i,q,[]):[])),F=(q,oe,de={})=>{const we=Ne(r,q);let ve=oe;if(we){const Ee=we._f;Ee&&(!Ee.disabled&&zt(o,q,oU(oe,Ee)),ve=Jv(Ee.ref)&&ii(oe)?"":oe,nU(Ee.ref)?[...Ee.ref.options].forEach(ne=>ne.selected=ve.includes(ne.value)):Ee.refs?$p(Ee.ref)?Ee.refs.forEach(ne=>{(!ne.defaultChecked||!ne.disabled)&&(Array.isArray(ve)?ne.checked=!!ve.find(ye=>ye===ne.value):ne.checked=ve===ne.value||!!ve)}):Ee.refs.forEach(ne=>ne.checked=ne.value===ve):ME(Ee.ref)?Ee.ref.value="":(Ee.ref.value=ve,Ee.ref.type||v.state.next({name:q,values:dn(o)})))}(de.shouldDirty||de.shouldTouch)&&A(q,ve,de.shouldTouch,de.shouldDirty,!0),de.shouldValidate&&te(q)},Z=(q,oe,de)=>{for(const we in oe){if(!oe.hasOwnProperty(we))return;const ve=oe[we],Ee=q+"."+we,ne=Ne(r,Ee);(c.array.has(q)||Zn(ve)||ne&&!ne._f)&&!Wl(ve)?Z(Ee,ve,de):F(Ee,ve,de)}},M=(q,oe,de={})=>{const we=Ne(r,q),ve=c.array.has(q),Ee=dn(oe);zt(o,q,Ee),ve?(v.array.next({name:q,values:dn(o)}),(p.isDirty||p.dirtyFields||h.isDirty||h.dirtyFields)&&de.shouldDirty&&v.state.next({name:q,dirtyFields:Hu(i,o),isDirty:J(q,Ee)})):we&&!we._f&&!ii(Ee)?Z(q,Ee,de):F(q,Ee,de),w1(q,c)&&v.state.next({...n,name:q}),v.state.next({name:a.mount?q:void 0,values:dn(o)})},K=async q=>{a.mount=!0;const oe=q.target;let de=oe.name,we=!0;const ve=Ne(r,de),Ee=Te=>{we=Number.isNaN(Te)||Wl(Te)&&isNaN(Te.getTime())||Ua(Te,Ne(o,de,Te))},ne=Yu(t.mode),ye=Yu(t.reValidateMode);if(ve){let Te,Ze;const st=oe.type?PD(ve._f):XL(q),qt=q.type===Qv.BLUR||q.type===Qv.FOCUS_OUT,Vn=!rde(ve._f)&&!t.resolver&&!Ne(n.errors,de)&&!ve._f.deps||ade(qt,Ne(n.touchedFields,de),n.isSubmitted,ye,ne),xn=w1(de,c,qt);zt(o,de,st),qt?(!oe||!oe.readOnly)&&(ve._f.onBlur&&ve._f.onBlur(q),d&&d(0)):ve._f.onChange&&ve._f.onChange(q);const Yt=A(de,st,qt),Ct=!Dr(Yt)||xn;if(!qt&&v.state.next({name:de,type:q.type,values:dn(o)}),Vn)return(p.isValid||h.isValid)&&(t.mode==="onBlur"?qt&&S():qt||S()),Ct&&v.state.next({name:de,...xn?{}:Yt});if(!qt&&xn&&v.state.next({...n}),t.resolver){const{errors:yt}=await T([de]);if(Ee(st),we){const Hr=LD(n.errors,r,de),rr=LD(yt,r,Hr.name||de);Te=rr.error,de=rr.name,Ze=Dr(yt)}}else C([de],!0),Te=(await S1(ve,c.disabled,o,y,t.shouldUseNativeValidation))[de],C([de]),Ee(st),we&&(Te?Ze=!1:(p.isValid||h.isValid)&&(Ze=await L(r,!0)));we&&(ve._f.deps&&(!Array.isArray(ve._f.deps)||ve._f.deps.length>0)&&te(ve._f.deps),N(de,Ze,Te,Yt))}},U=(q,oe)=>{if(Ne(n.errors,oe)&&q.focus)return q.focus(),1},te=async(q,oe={})=>{let de,we;const ve=si(q);if(t.resolver){const Ee=await z(rn(q)?q:ve);de=Dr(Ee),we=q?!ve.some(ne=>Ne(Ee,ne)):de}else q?(we=(await Promise.all(ve.map(async Ee=>{const ne=Ne(r,Ee);return await L(ne&&ne._f?{[Ee]:ne}:ne)}))).every(Boolean),!(!we&&!n.isValid)&&S()):we=de=await L(r);return v.state.next({...!ji(q)||(p.isValid||h.isValid)&&de!==n.isValid?{}:{name:q},...t.resolver||!q?{isValid:de}:{},errors:n.errors}),oe.shouldFocus&&!we&&id(r,U,q?ve:c.mount),we},D=(q,oe)=>{let de={...a.mount?o:i};return oe&&(de=tU(oe.dirtyFields?n.dirtyFields:n.touchedFields,de)),rn(q)?de:ji(q)?Ne(de,q):q.map(we=>Ne(de,we))},P=(q,oe)=>({invalid:!!Ne((oe||n).errors,q),isDirty:!!Ne((oe||n).dirtyFields,q),error:Ne((oe||n).errors,q),isValidating:!!Ne(n.validatingFields,q),isTouched:!!Ne((oe||n).touchedFields,q)}),V=q=>{q&&si(q).forEach(oe=>$n(n.errors,oe)),v.state.next({errors:q?n.errors:{}})},O=(q,oe,de)=>{const we=(Ne(r,q,{_f:{}})._f||{}).ref,ve=Ne(n.errors,q)||{},{ref:Ee,message:ne,type:ye,...Te}=ve;zt(n.errors,q,{...Te,...oe,ref:we}),v.state.next({name:q,errors:n.errors,isValid:!1}),de&&de.shouldFocus&&we&&we.focus&&we.focus()},ee=(q,oe)=>ko(q)?v.state.subscribe({next:de=>"values"in de&&q(Y(void 0,oe),de)}):Y(q,oe,!0),ue=q=>v.state.subscribe({next:oe=>{ode(q.name,oe.name,q.exact)&&ide(oe,q.formState||p,Fn,q.reRenderRoot)&&q.callback({values:{...o},...n,...oe,defaultValues:i})}}).unsubscribe,pe=q=>(a.mount=!0,h={...h,...q.formState},ue({...q,formState:h})),B=(q,oe={})=>{for(const de of q?si(q):c.mount)c.mount.delete(de),c.array.delete(de),oe.keepValue||($n(r,de),$n(o,de)),!oe.keepError&&$n(n.errors,de),!oe.keepDirty&&$n(n.dirtyFields,de),!oe.keepTouched&&$n(n.touchedFields,de),!oe.keepIsValidating&&$n(n.validatingFields,de),!t.shouldUnregister&&!oe.keepDefaultValue&&$n(i,de);v.state.next({values:dn(o)}),v.state.next({...n,...oe.keepDirty?{isDirty:J()}:{}}),!oe.keepIsValid&&S()},ie=({disabled:q,name:oe})=>{(Ci(q)&&a.mount||q||c.disabled.has(oe))&&(q?c.disabled.add(oe):c.disabled.delete(oe))},Se=(q,oe={})=>{let de=Ne(r,q);const we=Ci(oe.disabled)||Ci(t.disabled);return zt(r,q,{...de||{},_f:{...de&&de._f?de._f:{ref:{name:q}},name:q,mount:!0,...oe}}),c.mount.add(q),de?ie({disabled:Ci(oe.disabled)?oe.disabled:t.disabled,name:q}):I(q,!0,oe.value),{...we?{disabled:oe.disabled||t.disabled}:{},...t.progressive?{required:!!oe.required,min:hm(oe.min),max:hm(oe.max),minLength:hm(oe.minLength),maxLength:hm(oe.maxLength),pattern:hm(oe.pattern)}:{},name:q,onChange:K,onBlur:K,ref:ve=>{if(ve){Se(q,oe),de=Ne(r,q);const Ee=rn(ve.value)&&ve.querySelectorAll&&ve.querySelectorAll("input,select,textarea")[0]||ve,ne=Xue(Ee),ye=de._f.refs||[];if(ne?ye.find(Te=>Te===Ee):Ee===de._f.ref)return;zt(r,q,{_f:{...de._f,...ne?{refs:[...ye.filter(IS),Ee,...Array.isArray(Ne(i,q))?[{}]:[]],ref:{type:Ee.type,name:q}}:{ref:Ee}}}),I(q,!1,void 0,Ee)}else de=Ne(r,q,{}),de._f&&(de._f.mount=!1),(t.shouldUnregister||oe.shouldUnregister)&&!(QL(c.array,q)&&a.action)&&c.unMount.add(q)}}},Ie=()=>t.shouldFocusError&&id(r,U,c.mount),Fe=q=>{Ci(q)&&(v.state.next({disabled:q}),id(r,(oe,de)=>{const we=Ne(r,de);we&&(oe.disabled=we._f.disabled||q,Array.isArray(we._f.refs)&&we._f.refs.forEach(ve=>{ve.disabled=we._f.disabled||q}))},0,!1))},Ue=(q,oe)=>async de=>{let we;de&&(de.preventDefault&&de.preventDefault(),de.persist&&de.persist());let ve=dn(o);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:Ee,values:ne}=await T();n.errors=Ee,ve=dn(ne)}else await L(r);if(c.disabled.size)for(const Ee of c.disabled)$n(ve,Ee);if($n(n.errors,"root"),Dr(n.errors)){v.state.next({errors:{}});try{await q(ve,de)}catch(Ee){we=Ee}}else oe&&await oe({...n.errors},de),Ie(),setTimeout(Ie);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Dr(n.errors)&&!we,submitCount:n.submitCount+1,errors:n.errors}),we)throw we},Ye=(q,oe={})=>{Ne(r,q)&&(rn(oe.defaultValue)?M(q,dn(Ne(i,q))):(M(q,oe.defaultValue),zt(i,q,dn(oe.defaultValue))),oe.keepTouched||$n(n.touchedFields,q),oe.keepDirty||($n(n.dirtyFields,q),n.isDirty=oe.defaultValue?J(q,dn(Ne(i,q))):J()),oe.keepError||($n(n.errors,q),p.isValid&&S()),v.state.next({...n}))},_t=(q,oe={})=>{const de=q?dn(q):i,we=dn(de),ve=Dr(q),Ee=ve?i:we;if(oe.keepDefaultValues||(i=de),!oe.keepValues){if(oe.keepDirtyValues){const ne=new Set([...c.mount,...Object.keys(Hu(i,o))]);for(const ye of Array.from(ne))Ne(n.dirtyFields,ye)?zt(Ee,ye,Ne(o,ye)):M(ye,Ne(Ee,ye))}else{if(TE&&rn(q))for(const ne of c.mount){const ye=Ne(r,ne);if(ye&&ye._f){const Te=Array.isArray(ye._f.refs)?ye._f.refs[0]:ye._f.ref;if(Jv(Te)){const Ze=Te.closest("form");if(Ze){Ze.reset();break}}}}if(oe.keepFieldsRef)for(const ne of c.mount)M(ne,Ne(Ee,ne));else r={}}o=t.shouldUnregister?oe.keepDefaultValues?dn(i):{}:dn(Ee),v.array.next({values:{...Ee}}),v.state.next({values:{...Ee}})}c={mount:oe.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!p.isValid||!!oe.keepIsValid||!!oe.keepDirtyValues,a.watch=!!t.shouldUnregister,v.state.next({submitCount:oe.keepSubmitCount?n.submitCount:0,isDirty:ve?!1:oe.keepDirty?n.isDirty:!!(oe.keepDefaultValues&&!Ua(q,i)),isSubmitted:oe.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ve?{}:oe.keepDirtyValues?oe.keepDefaultValues&&o?Hu(i,o):n.dirtyFields:oe.keepDefaultValues&&q?Hu(i,q):oe.keepDirty?n.dirtyFields:{},touchedFields:oe.keepTouched?n.touchedFields:{},errors:oe.keepErrors?n.errors:{},isSubmitSuccessful:oe.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},gn=(q,oe)=>_t(ko(q)?q(o):q,oe),Tn=(q,oe={})=>{const de=Ne(r,q),we=de&&de._f;if(we){const ve=we.refs?we.refs[0]:we.ref;ve.focus&&(ve.focus(),oe.shouldSelect&&ko(ve.select)&&ve.select())}},Fn=q=>{n={...n,...q}},tn={control:{register:Se,unregister:B,getFieldState:P,handleSubmit:Ue,setError:O,_subscribe:ue,_runSchema:T,_focusError:Ie,_getWatch:Y,_getDirty:J,_setValid:S,_setFieldArray:E,_setDisabledField:ie,_setErrors:j,_getFieldArray:W,_reset:_t,_resetDefaultValues:()=>ko(t.defaultValues)&&t.defaultValues().then(q=>{gn(q,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:G,_disableForm:Fe,_subjects:v,_proxyFormState:p,get _fields(){return r},get _formValues(){return o},get _state(){return a},set _state(q){a=q},get _defaultValues(){return i},get _names(){return c},set _names(q){c=q},get _formState(){return n},get _options(){return t},set _options(q){t={...t,...q}}},subscribe:pe,trigger:te,register:Se,handleSubmit:Ue,watch:ee,setValue:M,getValues:D,reset:gn,resetField:Ye,clearErrors:V,unregister:B,setError:O,setFocus:Tn,getFieldState:P};return{...tn,formControl:tn}}var Ns=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},NS=(e,t,n={})=>n.shouldFocus||rn(n.shouldFocus)?n.focusName||`${e}.${rn(n.focusIndex)?t:n.focusIndex}.`:"",TS=(e,t)=>[...e,...si(t)],AS=e=>Array.isArray(e)?e.map(()=>{}):void 0;function OS(e,t,n){return[...e.slice(0,t),...si(n),...e.slice(t)]}var DS=(e,t,n)=>Array.isArray(e)?(rn(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],$S=(e,t)=>[...si(t),...si(e)];function ude(e,t){let n=0;const r=[...e];for(const i of t)r.splice(i-n,1),n++;return Ib(r).length?r:[]}var MS=(e,t)=>rn(t)?[]:ude(e,si(t).sort((n,r)=>n-r)),PS=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},FD=(e,t,n)=>(e[t]=n,e);function lU(e){const t=Mp(),{control:n=t.control,name:r,keyName:i="id",shouldUnregister:o,rules:a}=e,[c,d]=X.useState(n._getFieldArray(r)),f=X.useRef(n._getFieldArray(r).map(Ns)),p=X.useRef(!1);n._names.array.add(r),X.useMemo(()=>a&&c.length>=0&&n.register(r,a),[n,r,c.length,a]),Nb(()=>n._subjects.array.subscribe({next:({values:I,name:A})=>{if(A===r||!A){const N=Ne(I,r);Array.isArray(N)&&(d(N),f.current=N.map(Ns))}}}).unsubscribe,[n,r]);const h=X.useCallback(I=>{p.current=!0,n._setFieldArray(r,I)},[n,r]),v=(I,A)=>{const N=si(dn(I)),T=TS(n._getFieldArray(r),N);n._names.focus=NS(r,T.length-1,A),f.current=TS(f.current,N.map(Ns)),h(T),d(T),n._setFieldArray(r,T,TS,{argA:AS(I)})},y=(I,A)=>{const N=si(dn(I)),T=$S(n._getFieldArray(r),N);n._names.focus=NS(r,0,A),f.current=$S(f.current,N.map(Ns)),h(T),d(T),n._setFieldArray(r,T,$S,{argA:AS(I)})},b=I=>{const A=MS(n._getFieldArray(r),I);f.current=MS(f.current,I),h(A),d(A),!Array.isArray(Ne(n._fields,r))&&zt(n._fields,r,void 0),n._setFieldArray(r,A,MS,{argA:I})},S=(I,A,N)=>{const T=si(dn(A)),z=OS(n._getFieldArray(r),I,T);n._names.focus=NS(r,I,N),f.current=OS(f.current,I,T.map(Ns)),h(z),d(z),n._setFieldArray(r,z,OS,{argA:I,argB:AS(A)})},C=(I,A)=>{const N=n._getFieldArray(r);PS(N,I,A),PS(f.current,I,A),h(N),d(N),n._setFieldArray(r,N,PS,{argA:I,argB:A},!1)},E=(I,A)=>{const N=n._getFieldArray(r);DS(N,I,A),DS(f.current,I,A),h(N),d(N),n._setFieldArray(r,N,DS,{argA:I,argB:A},!1)},k=(I,A)=>{const N=dn(A),T=FD(n._getFieldArray(r),I,N);f.current=[...T].map((z,L)=>!z||L===I?Ns():f.current[L]),h(T),d([...T]),n._setFieldArray(r,T,FD,{argA:I,argB:N},!0,!1)},j=I=>{const A=si(dn(I));f.current=A.map(Ns),h([...A]),d([...A]),n._setFieldArray(r,[...A],N=>N,{},!0,!1)};return X.useEffect(()=>{if(n._state.action=!1,w1(r,n._names)&&n._subjects.state.next({...n._formState}),p.current&&(!Yu(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!Yu(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([r]).then(I=>{const A=Ne(I.errors,r),N=Ne(n._formState.errors,r);(N?!A&&N.type||A&&(N.type!==A.type||N.message!==A.message):A&&A.type)&&(A?zt(n._formState.errors,r,A):$n(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const I=Ne(n._fields,r);I&&I._f&&!(Yu(n._options.reValidateMode).isOnSubmit&&Yu(n._options.mode).isOnSubmit)&&S1(I,n._names.disabled,n._formValues,n._options.criteriaMode===oo.all,n._options.shouldUseNativeValidation,!0).then(A=>!Dr(A)&&n._subjects.state.next({errors:sU(n._formState.errors,A,r)}))}n._subjects.state.next({name:r,values:dn(n._formValues)}),n._names.focus&&id(n._fields,(I,A)=>{if(n._names.focus&&A.startsWith(n._names.focus)&&I.focus)return I.focus(),1}),n._names.focus="",n._setValid(),p.current=!1},[c,r,n]),X.useEffect(()=>(!Ne(n._formValues,r)&&n._setFieldArray(r),()=>{const I=(A,N)=>{const T=Ne(n._fields,A);T&&T._f&&(T._f.mount=N)};n._options.shouldUnregister||o?n.unregister(r):I(r,!1)}),[r,n,i,o]),{swap:X.useCallback(C,[h,r,n]),move:X.useCallback(E,[h,r,n]),prepend:X.useCallback(y,[h,r,n]),append:X.useCallback(v,[h,r,n]),remove:X.useCallback(b,[h,r,n]),insert:X.useCallback(S,[h,r,n]),update:X.useCallback(k,[h,r,n]),replace:X.useCallback(j,[h,r,n]),fields:X.useMemo(()=>c.map((I,A)=>({...I,[i]:f.current[A]||Ns()})),[c,i])}}function Qt(e={}){const t=X.useRef(void 0),n=X.useRef(void 0),[r,i]=X.useState({isDirty:!1,isValidating:!1,isLoading:ko(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:ko(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!ko(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...c}=cde(e);t.current={...c,formState:r}}const o=t.current.control;return o._options=e,Nb(()=>{const a=o._subscribe({formState:o._proxyFormState,callback:()=>i({...o._formState}),reRenderRoot:!0});return i(c=>({...c,isReady:!0})),o._formState.isReady=!0,a},[o]),X.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),X.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),X.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),X.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),X.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==r.isDirty&&o._subjects.state.next({isDirty:a})}},[o,r.isDirty]),X.useEffect(()=>{e.values&&!Ua(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),n.current=e.values,i(a=>({...a}))):o._resetDefaultValues()},[o,e.values]),X.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=JL(r,o),t.current}const Jt=Kue,cU=x.createContext({}),uU=x.createContext({});function Tb(){const e=x.useContext(cU),t=x.useContext(uU),{getFieldState:n}=Mp(),r=DE({name:e.name}),i=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...i}}function $e({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:i}=Tb();return u.jsx($C,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${i}`:`${r}`,"aria-invalid":!!t,...e})}function Me({...e}){return u.jsx(cU,{value:{name:e.name},children:u.jsx(Wue,{...e})})}function Ae({className:e,...t}){const n=x.useId();return u.jsx(uU,{value:{id:n},children:u.jsx("div",{"data-slot":"form-item",className:Pe("grid gap-2",e),...t})})}var dde=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],dU=dde.reduce((e,t)=>{const n=CP(`Primitive.${t}`),r=x.forwardRef((i,o)=>{const{asChild:a,...c}=i,d=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(d,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),fde="Label",fU=x.forwardRef((e,t)=>u.jsx(dU.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));fU.displayName=fde;var mde=fU;function Pp({className:e,...t}){return u.jsx(mde,{"data-slot":"label",className:Pe("text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function Oe({className:e,...t}){const{error:n,formItemId:r}=Tb();return u.jsx(Pp,{"data-slot":"form-label","data-error":!!n,className:Pe("data-[error=true]:text-destructive",e),htmlFor:r,...t})}function De({className:e,...t}){const{error:n,formMessageId:r}=Tb(),i=n?String(n?.message):t.children;return i?u.jsx("p",{"data-slot":"form-message",id:r,className:Pe("text-destructive text-sm",e),...t,children:i}):null}function ze({className:e,type:t,...n}){return u.jsx("input",{type:t,"data-slot":"input",className:Pe(`border-input file:text-foreground placeholder:text-muted-foreground selection:bg-purple
|
|
39
|
-
selection:text-primary-foreground
|
|
40
|
-
dark:aria-invalid:outline-destructive dark:aria-invalid:ring-destructive/50 ring-ring/10
|
|
41
|
-
dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 aria-invalid:outline-destructive/60
|
|
42
|
-
aria-invalid:ring-destructive/20 aria-invalid:border-destructive/60 dark:aria-invalid:border-destructive
|
|
43
|
-
flex h-9 w-full min-w-0 rounded-md border bg-grey-700 px-3 py-1 text-base text-white
|
|
44
|
-
file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium
|
|
45
|
-
focus-visible:ring-1 focus-visible:outline-none focus-visible:ring-purple disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50
|
|
46
|
-
aria-invalid:focus-visible:ring-[1px] aria-invalid:focus-visible:outline-none md:text-sm dark:aria-invalid:focus-visible:ring-1`,e),...n})}const Ab=["RUNNING"],zE=["TERMINATING","TERMINATED","REMOVED"];function pde(){return"https://fabric.harper.fast/#/?createCluster="+encodeURIComponent(JSON.stringify({deploymentDescription:"Self-Hosted",performanceDescription:"Self Supported and Managed",instances:[{secure:String(location.protocol==="https:"),fqdn:location.hostname,port:parseInt(location.port,10)}]}))}async function _1({username:e,password:t,instanceClient:n,entityId:r}){const{data:{message:i}}=await n.post("/",{operation:"login",username:e,password:t});try{const c=await qs({instanceClient:n});return{message:i,user:c}}catch(c){console.error("Failed to get user after login, trying basic auth",c)}try{const c=await qs({instanceClient:n,auth:{username:e,password:t}});return Tt.flagForBasicAuth(r,{username:e,password:t}),{message:i,user:c}}catch(c){throw c}const o=Va({id:r,forceFabricConnect:!0}),a=await qs({instanceClient:o});return Tt.flagForFabricConnect(r,!0),{message:i,user:a,instanceClient:n}}function hde(){return at({mutationFn:_1})}function gde({cluster:e,instance:t,instanceParams:n}){const r=pn(),i=an(),{redirect:o}=vr({strict:!1}),{mutate:a,isPending:c}=hde(),d=x.useCallback(async f=>{a({...f,...n},{onSuccess:async({message:p,user:h})=>{if(_e.success(p),e?.instances?.length&&!t)for(const y of e.instances)Tt.setUserForEntity(y,h);const v=_n;Tt.setUserForEntity(v,h),i.invalidate(),await r({to:o?.startsWith("/")?o:oa})}})},[e,t,n,r,o,i,a]);return{isPending:c,submitForm:d}}async function LE(e){const{data:t}=await Ut.get(`/Cluster/${e}`);return t}function Oc(e,t){return{queryKey:[e],queryFn:()=>LE(e),retry:!1,enabled:!!e,refetchInterval:t?t===!0?1e4:t:void 0}}const mU=Object.freeze({status:"aborted"});function ae(e,t,n){function r(c,d){var f;Object.defineProperty(c,"_zod",{value:c._zod??{},enumerable:!1}),(f=c._zod).traits??(f.traits=new Set),c._zod.traits.add(e),t(c,d);for(const p in a.prototype)p in c||Object.defineProperty(c,p,{value:a.prototype[p].bind(c)});c._zod.constr=a,c._zod.def=d}const i=n?.Parent??Object;class o extends i{}Object.defineProperty(o,"name",{value:e});function a(c){var d;const f=n?.Parent?new o:this;r(f,c),(d=f._zod).deferred??(d.deferred=[]);for(const p of f._zod.deferred)p();return f}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}const pU=Symbol("zod_brand");class ac extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ob extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const ty={};function Ur(e){return e&&Object.assign(ty,e),ty}function vde(e){return e}function yde(e){return e}function bde(e){}function xde(e){throw new Error}function wde(e){}function UE(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function Re(e,t="|"){return e.map(n=>it(n)).join(t)}function ny(e,t){return typeof t=="bigint"?t.toString():t}function zp(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Dc(e){return e==null}function Db(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function hU(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const d=r.match(/\d?e-(\d?)/);d?.[1]&&(i=Number.parseInt(d[1]))}const o=n>i?n:i,a=Number.parseInt(e.toFixed(o).replace(".","")),c=Number.parseInt(t.toFixed(o).replace(".",""));return a%c/10**o}const VD=Symbol("evaluating");function jt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==VD)return r===void 0&&(r=VD,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Sde(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function ml(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ns(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function _de(e){return ns(e._zod.def)}function Cde(e,t){return t?t.reduce((n,r)=>n?.[r],e):e}function Ede(e){const t=Object.keys(e),n=t.map(r=>e[r]);return Promise.all(n).then(r=>{const i={};for(let o=0;o<t.length;o++)i[t[o]]=r[o];return i})}function kde(e=10){const t="abcdefghijklmnopqrstuvwxyz";let n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n}function C1(e){return JSON.stringify(e)}const FE="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function _d(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const gU=zp(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function hc(e){if(_d(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(_d(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function $b(e){return hc(e)?{...e}:Array.isArray(e)?[...e]:e}function jde(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}const Rde=e=>{const t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},ry=new Set(["string","number","symbol"]),vU=new Set(["string","number","bigint","boolean","symbol","undefined"]);function ol(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function yo(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Ce(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 Ide(e){let t;return new Proxy({},{get(n,r,i){return t??(t=e()),Reflect.get(t,r,i)},set(n,r,i,o){return t??(t=e()),Reflect.set(t,r,i,o)},has(n,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(n,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??(t=e()),Reflect.defineProperty(t,r,i)}})}function it(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function yU(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const bU={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},xU={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function wU(e,t){const n=e._zod.def,r=ns(e._zod.def,{get shape(){const i={};for(const o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(i[o]=n.shape[o])}return ml(this,"shape",i),i},checks:[]});return yo(e,r)}function SU(e,t){const n=e._zod.def,r=ns(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete i[o]}return ml(this,"shape",i),i},checks:[]});return yo(e,r)}function _U(e,t){if(!hc(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const i=ns(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return ml(this,"shape",o),o},checks:[]});return yo(e,i)}function CU(e,t){if(!hc(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const r={...e._zod.def.shape,...t};return ml(this,"shape",r),r},checks:e._zod.def.checks};return yo(e,n)}function EU(e,t){const n=ns(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return ml(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return yo(e,n)}function kU(e,t,n){const r=ns(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const a in n){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(o[a]=e?new e({type:"optional",innerType:i[a]}):i[a])}else for(const a in i)o[a]=e?new e({type:"optional",innerType:i[a]}):i[a];return ml(this,"shape",o),o},checks:[]});return yo(t,r)}function jU(e,t,n){const r=ns(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const a in n){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(o[a]=new e({type:"nonoptional",innerType:i[a]}))}else for(const a in i)o[a]=new e({type:"nonoptional",innerType:i[a]});return ml(this,"shape",o),o},checks:[]});return yo(t,r)}function Xl(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function jo(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Rm(e){return typeof e=="string"?e:e?.message}function Po(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=Rm(e.inst?._zod.def?.error?.(e))??Rm(t?.error?.(e))??Rm(n.customError?.(e))??Rm(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Mb(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Pb(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Cd(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function Nde(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function RU(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function IU(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Tde(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return RU(t+n)}function Ade(e){return IU(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ode(e){const t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");const n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r/2]=Number.parseInt(t.slice(r,r+2),16);return n}function Dde(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}class $de{constructor(...t){}}const NU=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:xU,Class:$de,NUMBER_FORMAT_RANGES:bU,aborted:Xl,allowsEval:gU,assert:wde,assertEqual:vde,assertIs:bde,assertNever:xde,assertNotEqual:yde,assignProp:ml,base64ToUint8Array:RU,base64urlToUint8Array:Tde,cached:zp,captureStackTrace:FE,cleanEnum:Nde,cleanRegex:Db,clone:yo,cloneDef:_de,createTransparentProxy:Ide,defineLazy:jt,esc:C1,escapeRegex:ol,extend:_U,finalizeIssue:Po,floatSafeRemainder:hU,getElementAtPath:Cde,getEnumValues:UE,getLengthableOrigin:Pb,getParsedType:Rde,getSizableOrigin:Mb,hexToUint8Array:Ode,isObject:_d,isPlainObject:hc,issue:Cd,joinValues:Re,jsonStringifyReplacer:ny,merge:EU,mergeDefs:ns,normalizeParams:Ce,nullish:Dc,numKeys:jde,objectClone:Sde,omit:SU,optionalKeys:yU,partial:kU,pick:wU,prefixIssues:jo,primitiveTypes:vU,promiseAllObject:Ede,propertyKeyTypes:ry,randomString:kde,required:jU,safeExtend:CU,shallowClone:$b,stringifyPrimitive:it,uint8ArrayToBase64:IU,uint8ArrayToBase64url:Ade,uint8ArrayToHex:Dde,unwrapMessage:Rm},Symbol.toStringTag,{value:"Module"})),TU=(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,ny,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},zb=ae("$ZodError",TU),zi=ae("$ZodError",TU,{Parent:Error});function VE(e,t=n=>n.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function BE(e,t=n=>n.message){const n={_errors:[]},r=i=>{for(const o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>r({issues:a}));else if(o.code==="invalid_key")r({issues:o.issues});else if(o.code==="invalid_element")r({issues:o.issues});else if(o.path.length===0)n._errors.push(t(o));else{let a=n,c=0;for(;c<o.path.length;){const d=o.path[c];c===o.path.length-1?(a[d]=a[d]||{_errors:[]},a[d]._errors.push(t(o))):a[d]=a[d]||{_errors:[]},a=a[d],c++}}};return r(e),n}function AU(e,t=n=>n.message){const n={errors:[]},r=(i,o=[])=>{var a,c;for(const d of i.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(f=>r({issues:f},d.path));else if(d.code==="invalid_key")r({issues:d.issues},d.path);else if(d.code==="invalid_element")r({issues:d.issues},d.path);else{const f=[...o,...d.path];if(f.length===0){n.errors.push(t(d));continue}let p=n,h=0;for(;h<f.length;){const v=f[h],y=h===f.length-1;typeof v=="string"?(p.properties??(p.properties={}),(a=p.properties)[v]??(a[v]={errors:[]}),p=p.properties[v]):(p.items??(p.items=[]),(c=p.items)[v]??(c[v]={errors:[]}),p=p.items[v]),y&&p.errors.push(t(d)),h++}}};return r(e),n}function OU(e){const t=[],n=e.map(r=>typeof r=="object"?r.key:r);for(const r of n)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function DU(e){const t=[],n=[...e.issues].sort((r,i)=>(r.path??[]).length-(i.path??[]).length);for(const r of n)t.push(`✖ ${r.message}`),r.path?.length&&t.push(` → at ${OU(r.path)}`);return t.join(`
|
|
47
|
-
`)}const Lp=e=>(t,n,r,i)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise)throw new ac;if(a.issues.length){const c=new(i?.Err??e)(a.issues.map(d=>Po(d,o,Ur())));throw FE(c,i?.callee),c}return a.value},iy=Lp(zi),Up=e=>async(t,n,r,i)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){const c=new(i?.Err??e)(a.issues.map(d=>Po(d,o,Ur())));throw FE(c,i?.callee),c}return a.value},oy=Up(zi),Fp=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new ac;return o.issues.length?{success:!1,error:new(e??zb)(o.issues.map(a=>Po(a,i,Ur())))}:{success:!0,data:o.value}},$U=Fp(zi),Vp=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(a=>Po(a,i,Ur())))}:{success:!0,data:o.value}},MU=Vp(zi),HE=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Lp(e)(t,n,i)},Mde=HE(zi),qE=e=>(t,n,r)=>Lp(e)(t,n,r),Pde=qE(zi),GE=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Up(e)(t,n,i)},zde=GE(zi),KE=e=>async(t,n,r)=>Up(e)(t,n,r),Lde=KE(zi),ZE=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Fp(e)(t,n,i)},Ude=ZE(zi),YE=e=>(t,n,r)=>Fp(e)(t,n,r),Fde=YE(zi),WE=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Vp(e)(t,n,i)},Vde=WE(zi),XE=e=>async(t,n,r)=>Vp(e)(t,n,r),Bde=XE(zi),PU=/^[cC][^\s-]{8,}$/,zU=/^[0-9a-z]+$/,LU=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,UU=/^[0-9a-vA-V]{20}$/,FU=/^[A-Za-z0-9]{27}$/,VU=/^[a-zA-Z0-9_-]{21}$/,BU=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Hde=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,HU=/^([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})$/,Ed=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)$/,qde=Ed(4),Gde=Ed(6),Kde=Ed(7),qU=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Zde=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Yde=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,GU=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Wde=GU,Xde=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Qde="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function KU(){return new RegExp(Qde,"u")}const ZU=/^(?:(?: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])$/,YU=/^(([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}|:))$/,WU=/^((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])$/,XU=/^(([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])$/,QU=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,QE=/^[A-Za-z0-9_-]*$/,JE=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,JU=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,eF=/^\+(?:[0-9]){6,14}[0-9]$/,tF="(?:(?:\\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])))",nF=new RegExp(`^${tF}$`);function rF(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 iF(e){return new RegExp(`^${rF(e)}$`)}function oF(e){const t=rF({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${tF}T(?:${r})$`)}const aF=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},sF=/^-?\d+n?$/,lF=/^-?\d+$/,cF=/^-?\d+(?:\.\d+)?/,uF=/^(?:true|false)$/i,dF=/^null$/i,fF=/^undefined$/i,mF=/^[^A-Z]*$/,pF=/^[^a-z]*$/,hF=/^[0-9a-fA-F]*$/;function Bp(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Hp(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const Jde=/^[0-9a-fA-F]{32}$/,efe=Bp(22,"=="),tfe=Hp(22),nfe=/^[0-9a-fA-F]{40}$/,rfe=Bp(27,"="),ife=Hp(27),ofe=/^[0-9a-fA-F]{64}$/,afe=Bp(43,"="),sfe=Hp(43),lfe=/^[0-9a-fA-F]{96}$/,cfe=Bp(64,""),ufe=Hp(64),dfe=/^[0-9a-fA-F]{128}$/,ffe=Bp(86,"=="),mfe=Hp(86),ek=Object.freeze(Object.defineProperty({__proto__:null,base64:QU,base64url:QE,bigint:sF,boolean:uF,browserEmail:Xde,cidrv4:WU,cidrv6:XU,cuid:PU,cuid2:zU,date:nF,datetime:oF,domain:JU,duration:BU,e164:eF,email:qU,emoji:KU,extendedDuration:Hde,guid:HU,hex:hF,hostname:JE,html5Email:Zde,idnEmail:Wde,integer:lF,ipv4:ZU,ipv6:YU,ksuid:FU,lowercase:mF,md5_base64:efe,md5_base64url:tfe,md5_hex:Jde,nanoid:VU,null:dF,number:cF,rfc5322Email:Yde,sha1_base64:rfe,sha1_base64url:ife,sha1_hex:nfe,sha256_base64:afe,sha256_base64url:sfe,sha256_hex:ofe,sha384_base64:cfe,sha384_base64url:ufe,sha384_hex:lfe,sha512_base64:ffe,sha512_base64url:mfe,sha512_hex:dfe,string:aF,time:iF,ulid:LU,undefined:fF,unicodeEmail:GU,uppercase:pF,uuid:Ed,uuid4:qde,uuid6:Gde,uuid7:Kde,xid:UU},Symbol.toStringTag,{value:"Module"})),In=ae("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),gF={number:"number",bigint:"bigint",object:"date"},tk=ae("$ZodCheckLessThan",(e,t)=>{In.init(e,t);const n=gF[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,o=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),nk=ae("$ZodCheckGreaterThan",(e,t)=>{In.init(e,t);const n=gF[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,o=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),vF=ae("$ZodCheckMultipleOf",(e,t)=>{In.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):hU(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),yF=ae("$ZodCheckNumberFormat",(e,t)=>{In.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,o]=bU[t.format];e._zod.onattach.push(a=>{const c=a._zod.bag;c.format=t.format,c.minimum=i,c.maximum=o,n&&(c.pattern=lF)}),e._zod.check=a=>{const c=a.value;if(n){if(!Number.isInteger(c)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort});return}}c<i&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),c>o&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:o,inst:e})}}),bF=ae("$ZodCheckBigIntFormat",(e,t)=>{In.init(e,t);const[n,r]=xU[t.format];e._zod.onattach.push(i=>{const o=i._zod.bag;o.format=t.format,o.minimum=n,o.maximum=r}),e._zod.check=i=>{const o=i.value;o<n&&i.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),o>r&&i.issues.push({origin:"bigint",input:o,code:"too_big",maximum:r,inst:e})}}),xF=ae("$ZodCheckMaxSize",(e,t)=>{var n;In.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Dc(i)&&i.size!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;i.size<=t.maximum||r.issues.push({origin:Mb(i),code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),wF=ae("$ZodCheckMinSize",(e,t)=>{var n;In.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Dc(i)&&i.size!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;i.size>=t.minimum||r.issues.push({origin:Mb(i),code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),SF=ae("$ZodCheckSizeEquals",(e,t)=>{var n;In.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Dc(i)&&i.size!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.size,i.maximum=t.size,i.size=t.size}),e._zod.check=r=>{const i=r.value,o=i.size;if(o===t.size)return;const a=o>t.size;r.issues.push({origin:Mb(i),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),_F=ae("$ZodCheckMaxLength",(e,t)=>{var n;In.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Dc(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const a=Pb(i);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),CF=ae("$ZodCheckMinLength",(e,t)=>{var n;In.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Dc(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const a=Pb(i);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),EF=ae("$ZodCheckLengthEquals",(e,t)=>{var n;In.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Dc(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,o=i.length;if(o===t.length)return;const a=Pb(i),c=o>t.length;r.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),qp=ae("$ZodCheckStringFormat",(e,t)=>{var n,r;In.init(e,t),e._zod.onattach.push(i=>{const o=i._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),kF=ae("$ZodCheckRegex",(e,t)=>{qp.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),jF=ae("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=mF),qp.init(e,t)}),RF=ae("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=pF),qp.init(e,t)}),IF=ae("$ZodCheckIncludes",(e,t)=>{In.init(e,t);const n=ol(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),NF=ae("$ZodCheckStartsWith",(e,t)=>{In.init(e,t);const n=new RegExp(`^${ol(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),TF=ae("$ZodCheckEndsWith",(e,t)=>{In.init(e,t);const n=new RegExp(`.*${ol(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function BD(e,t,n){e.issues.length&&t.issues.push(...jo(n,e.issues))}const AF=ae("$ZodCheckProperty",(e,t)=>{In.init(e,t),e._zod.check=n=>{const r=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(i=>BD(i,n,t.property));BD(r,n,t.property)}}),OF=ae("$ZodCheckMimeType",(e,t)=>{In.init(e,t);const n=new Set(t.mime);e._zod.onattach.push(r=>{r._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),DF=ae("$ZodCheckOverwrite",(e,t)=>{In.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class $F{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 r=t.split(`
|
|
48
|
-
`).filter(a=>a),i=Math.min(...r.map(a=>a.length-a.trimStart().length)),o=r.map(a=>a.slice(i)).map(a=>" ".repeat(this.indent*2)+a);for(const a of o)this.content.push(a)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(o=>` ${o}`)];return new t(...n,i.join(`
|
|
49
|
-
`))}}const MF={major:4,minor:1,patch:12},ct=ae("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=MF;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const o of i._zod.onattach)o(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(a,c,d)=>{let f=Xl(a),p;for(const h of c){if(h._zod.def.when){if(!h._zod.def.when(a))continue}else if(f)continue;const v=a.issues.length,y=h._zod.check(a);if(y instanceof Promise&&d?.async===!1)throw new ac;if(p||y instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await y,a.issues.length!==v&&(f||(f=Xl(a,v)))});else{if(a.issues.length===v)continue;f||(f=Xl(a,v))}}return p?p.then(()=>a):a},o=(a,c,d)=>{if(Xl(a))return a.aborted=!0,a;const f=i(c,r,d);if(f instanceof Promise){if(d.async===!1)throw new ac;return f.then(p=>e._zod.parse(p,d))}return e._zod.parse(f,d)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){const f=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return f instanceof Promise?f.then(p=>o(p,a,c)):o(f,a,c)}const d=e._zod.parse(a,c);if(d instanceof Promise){if(c.async===!1)throw new ac;return d.then(f=>i(f,r,c))}return i(d,r,c)}}e["~standard"]={validate:i=>{try{const o=$U(e,i);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return MU(e,i).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),Gp=ae("$ZodString",(e,t)=>{ct.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??aF(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),sn=ae("$ZodStringFormat",(e,t)=>{qp.init(e,t),Gp.init(e,t)}),PF=ae("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=HU),sn.init(e,t)}),zF=ae("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ed(r))}else t.pattern??(t.pattern=Ed());sn.init(e,t)}),LF=ae("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=qU),sn.init(e,t)}),UF=ae("$ZodURL",(e,t)=>{sn.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:JE.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),FF=ae("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=KU()),sn.init(e,t)}),VF=ae("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=VU),sn.init(e,t)}),BF=ae("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=PU),sn.init(e,t)}),HF=ae("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=zU),sn.init(e,t)}),qF=ae("$ZodULID",(e,t)=>{t.pattern??(t.pattern=LU),sn.init(e,t)}),GF=ae("$ZodXID",(e,t)=>{t.pattern??(t.pattern=UU),sn.init(e,t)}),KF=ae("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=FU),sn.init(e,t)}),ZF=ae("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=oF(t)),sn.init(e,t)}),YF=ae("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=nF),sn.init(e,t)}),WF=ae("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=iF(t)),sn.init(e,t)}),XF=ae("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=BU),sn.init(e,t)}),QF=ae("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ZU),sn.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv4"})}),JF=ae("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=YU),sn.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),e6=ae("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=WU),sn.init(e,t)}),t6=ae("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=XU),sn.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,o]=r;if(!o)throw new Error;const a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function rk(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const n6=ae("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=QU),sn.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{rk(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function r6(e){if(!QE.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return rk(n)}const i6=ae("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=QE),sn.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{r6(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),o6=ae("$ZodE164",(e,t)=>{t.pattern??(t.pattern=eF),sn.init(e,t)});function a6(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const s6=ae("$ZodJWT",(e,t)=>{sn.init(e,t),e._zod.check=n=>{a6(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),l6=ae("$ZodCustomStringFormat",(e,t)=>{sn.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),ik=ae("$ZodNumber",(e,t)=>{ct.init(e,t),e._zod.pattern=e._zod.bag.pattern??cF,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),n}}),c6=ae("$ZodNumber",(e,t)=>{yF.init(e,t),ik.init(e,t)}),ok=ae("$ZodBoolean",(e,t)=>{ct.init(e,t),e._zod.pattern=uF,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),ak=ae("$ZodBigInt",(e,t)=>{ct.init(e,t),e._zod.pattern=sF,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),u6=ae("$ZodBigInt",(e,t)=>{bF.init(e,t),ak.init(e,t)}),d6=ae("$ZodSymbol",(e,t)=>{ct.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;return typeof i=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:e}),n}}),f6=ae("$ZodUndefined",(e,t)=>{ct.init(e,t),e._zod.pattern=fF,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,r)=>{const i=n.value;return typeof i>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:e}),n}}),m6=ae("$ZodNull",(e,t)=>{ct.init(e,t),e._zod.pattern=dF,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{const i=n.value;return i===null||n.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),n}}),p6=ae("$ZodAny",(e,t)=>{ct.init(e,t),e._zod.parse=n=>n}),h6=ae("$ZodUnknown",(e,t)=>{ct.init(e,t),e._zod.parse=n=>n}),g6=ae("$ZodNever",(e,t)=>{ct.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),v6=ae("$ZodVoid",(e,t)=>{ct.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;return typeof i>"u"||n.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),n}}),y6=ae("$ZodDate",(e,t)=>{ct.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}const i=n.value,o=i instanceof Date;return o&&!Number.isNaN(i.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:e}),n}});function HD(e,t,n){e.issues.length&&t.issues.push(...jo(n,e.issues)),t.value[n]=e.value}const b6=ae("$ZodArray",(e,t)=>{ct.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const o=[];for(let a=0;a<i.length;a++){const c=i[a],d=t.element._zod.run({value:c,issues:[]},r);d instanceof Promise?o.push(d.then(f=>HD(f,n,a))):HD(d,n,a)}return o.length?Promise.all(o).then(()=>n):n}});function ay(e,t,n,r){e.issues.length&&t.issues.push(...jo(n,e.issues)),e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function x6(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=yU(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function w6(e,t,n,r,i,o){const a=[],c=i.keySet,d=i.catchall._zod,f=d.def.type;for(const p of Object.keys(t)){if(c.has(p))continue;if(f==="never"){a.push(p);continue}const h=d.run({value:t[p],issues:[]},r);h instanceof Promise?e.push(h.then(v=>ay(v,n,p,t))):ay(h,n,p,t)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const S6=ae("$ZodObject",(e,t)=>{if(ct.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const c=t.shape;Object.defineProperty(t,"shape",{get:()=>{const d={...c};return Object.defineProperty(t,"shape",{value:d}),d}})}const r=zp(()=>x6(t));jt(e._zod,"propValues",()=>{const c=t.shape,d={};for(const f in c){const p=c[f]._zod;if(p.values){d[f]??(d[f]=new Set);for(const h of p.values)d[f].add(h)}}return d});const i=_d,o=t.catchall;let a;e._zod.parse=(c,d)=>{a??(a=r.value);const f=c.value;if(!i(f))return c.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),c;c.value={};const p=[],h=a.shape;for(const v of a.keys){const b=h[v]._zod.run({value:f[v],issues:[]},d);b instanceof Promise?p.push(b.then(S=>ay(S,c,v,f))):ay(b,c,v,f)}return o?w6(p,f,c,d,r.value,e):p.length?Promise.all(p).then(()=>c):c}}),_6=ae("$ZodObjectJIT",(e,t)=>{S6.init(e,t);const n=e._zod.parse,r=zp(()=>x6(t)),i=v=>{const y=new $F(["shape","payload","ctx"]),b=r.value,S=j=>{const I=C1(j);return`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`};y.write("const input = payload.value;");const C=Object.create(null);let E=0;for(const j of b.keys)C[j]=`key_${E++}`;y.write("const newResult = {};");for(const j of b.keys){const I=C[j],A=C1(j);y.write(`const ${I} = ${S(j)};`),y.write(`
|
|
50
|
-
if (${I}.issues.length) {
|
|
51
|
-
payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
|
|
52
|
-
...iss,
|
|
53
|
-
path: iss.path ? [${A}, ...iss.path] : [${A}]
|
|
54
|
-
})));
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (${I}.value === undefined) {
|
|
59
|
-
if (${A} in input) {
|
|
60
|
-
newResult[${A}] = undefined;
|
|
61
|
-
}
|
|
62
|
-
} else {
|
|
63
|
-
newResult[${A}] = ${I}.value;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
`)}y.write("payload.value = newResult;"),y.write("return payload;");const k=y.compile();return(j,I)=>k(v,j,I)};let o;const a=_d,c=!ty.jitless,f=c&&gU.value,p=t.catchall;let h;e._zod.parse=(v,y)=>{h??(h=r.value);const b=v.value;return a(b)?c&&f&&y?.async===!1&&y.jitless!==!0?(o||(o=i(t.shape)),v=o(v,y),p?w6([],b,v,y,h,e):v):n(v,y):(v.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),v)}});function qD(e,t,n,r){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const i=e.filter(o=>!Xl(o));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(a=>Po(a,r,Ur())))}),t)}const sk=ae("$ZodUnion",(e,t)=>{ct.init(e,t),jt(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),jt(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),jt(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),jt(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>Db(o.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,o)=>{if(n)return r(i,o);let a=!1;const c=[];for(const d of t.options){const f=d._zod.run({value:i.value,issues:[]},o);if(f instanceof Promise)c.push(f),a=!0;else{if(f.issues.length===0)return f;c.push(f)}}return a?Promise.all(c).then(d=>qD(d,i,e,o)):qD(c,i,e,o)}}),C6=ae("$ZodDiscriminatedUnion",(e,t)=>{sk.init(e,t);const n=e._zod.parse;jt(e._zod,"propValues",()=>{const i={};for(const o of t.options){const a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[c,d]of Object.entries(a)){i[c]||(i[c]=new Set);for(const f of d)i[c].add(f)}}return i});const r=zp(()=>{const i=t.options,o=new Map;for(const a of i){const c=a._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const d of c){if(o.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);o.set(d,a)}}return o});e._zod.parse=(i,o)=>{const a=i.value;if(!_d(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),i;const c=r.value.get(a?.[t.discriminator]);return c?c._zod.run(i,o):t.unionFallback?n(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),i)}}),E6=ae("$ZodIntersection",(e,t)=>{ct.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,o=t.left._zod.run({value:i,issues:[]},r),a=t.right._zod.run({value:i,issues:[]},r);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([d,f])=>GD(n,d,f)):GD(n,o,a)}});function E1(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(hc(e)&&hc(t)){const n=Object.keys(t),r=Object.keys(e).filter(o=>n.indexOf(o)!==-1),i={...e,...t};for(const o of r){const a=E1(e[o],t[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};i[o]=a.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const i=e[r],o=t[r],a=E1(i,o);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function GD(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Xl(e))return e;const r=E1(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const lk=ae("$ZodTuple",(e,t)=>{ct.init(e,t);const n=t.items,r=n.length-[...n].reverse().findIndex(i=>i._zod.optin!=="optional");e._zod.parse=(i,o)=>{const a=i.value;if(!Array.isArray(a))return i.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=[];const c=[];if(!t.rest){const f=a.length>n.length,p=a.length<r-1;if(f||p)return i.issues.push({...f?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},input:a,inst:e,origin:"array"}),i}let d=-1;for(const f of n){if(d++,d>=a.length&&d>=r)continue;const p=f._zod.run({value:a[d],issues:[]},o);p instanceof Promise?c.push(p.then(h=>Lg(h,i,d))):Lg(p,i,d)}if(t.rest){const f=a.slice(n.length);for(const p of f){d++;const h=t.rest._zod.run({value:p,issues:[]},o);h instanceof Promise?c.push(h.then(v=>Lg(v,i,d))):Lg(h,i,d)}}return c.length?Promise.all(c).then(()=>i):i}});function Lg(e,t,n){e.issues.length&&t.issues.push(...jo(n,e.issues)),t.value[n]=e.value}const k6=ae("$ZodRecord",(e,t)=>{ct.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!hc(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const o=[];if(t.keyType._zod.values){const a=t.keyType._zod.values;n.value={};for(const d of a)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){const f=t.valueType._zod.run({value:i[d],issues:[]},r);f instanceof Promise?o.push(f.then(p=>{p.issues.length&&n.issues.push(...jo(d,p.issues)),n.value[d]=p.value})):(f.issues.length&&n.issues.push(...jo(d,f.issues)),n.value[d]=f.value)}let c;for(const d in i)a.has(d)||(c=c??[],c.push(d));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c})}else{n.value={};for(const a of Reflect.ownKeys(i)){if(a==="__proto__")continue;const c=t.keyType._zod.run({value:a,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(c.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(f=>Po(f,r,Ur())),input:a,path:[a],inst:e}),n.value[c.value]=c.value;continue}const d=t.valueType._zod.run({value:i[a],issues:[]},r);d instanceof Promise?o.push(d.then(f=>{f.issues.length&&n.issues.push(...jo(a,f.issues)),n.value[c.value]=f.value})):(d.issues.length&&n.issues.push(...jo(a,d.issues)),n.value[c.value]=d.value)}}return o.length?Promise.all(o).then(()=>n):n}}),j6=ae("$ZodMap",(e,t)=>{ct.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!(i instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),n;const o=[];n.value=new Map;for(const[a,c]of i){const d=t.keyType._zod.run({value:a,issues:[]},r),f=t.valueType._zod.run({value:c,issues:[]},r);d instanceof Promise||f instanceof Promise?o.push(Promise.all([d,f]).then(([p,h])=>{KD(p,h,n,a,i,e,r)})):KD(d,f,n,a,i,e,r)}return o.length?Promise.all(o).then(()=>n):n}});function KD(e,t,n,r,i,o,a){e.issues.length&&(ry.has(typeof r)?n.issues.push(...jo(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:i,inst:o,issues:e.issues.map(c=>Po(c,a,Ur()))})),t.issues.length&&(ry.has(typeof r)?n.issues.push(...jo(r,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:i,inst:o,key:r,issues:t.issues.map(c=>Po(c,a,Ur()))})),n.value.set(e.value,t.value)}const R6=ae("$ZodSet",(e,t)=>{ct.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),n;const o=[];n.value=new Set;for(const a of i){const c=t.valueType._zod.run({value:a,issues:[]},r);c instanceof Promise?o.push(c.then(d=>ZD(d,n))):ZD(c,n)}return o.length?Promise.all(o).then(()=>n):n}});function ZD(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const I6=ae("$ZodEnum",(e,t)=>{ct.init(e,t);const n=UE(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>ry.has(typeof i)).map(i=>typeof i=="string"?ol(i):i.toString()).join("|")})$`),e._zod.parse=(i,o)=>{const a=i.value;return r.has(a)||i.issues.push({code:"invalid_value",values:n,input:a,inst:e}),i}}),N6=ae("$ZodLiteral",(e,t)=>{if(ct.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?ol(n):n?ol(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,r)=>{const i=n.value;return e._zod.values.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}}),T6=ae("$ZodFile",(e,t)=>{ct.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;return i instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:i,inst:e}),n}}),A6=ae("$ZodTransform",(e,t)=>{ct.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Ob(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(a=>(n.value=a,n));if(i instanceof Promise)throw new ac;return n.value=i,n}});function YD(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const O6=ae("$ZodOptional",(e,t)=>{ct.init(e,t),e._zod.optin="optional",e._zod.optout="optional",jt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),jt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Db(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>YD(o,n.value)):YD(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),D6=ae("$ZodNullable",(e,t)=>{ct.init(e,t),jt(e._zod,"optin",()=>t.innerType._zod.optin),jt(e._zod,"optout",()=>t.innerType._zod.optout),jt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Db(n.source)}|null)$`):void 0}),jt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),$6=ae("$ZodDefault",(e,t)=>{ct.init(e,t),e._zod.optin="optional",jt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>WD(o,t)):WD(i,t)}});function WD(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const M6=ae("$ZodPrefault",(e,t)=>{ct.init(e,t),e._zod.optin="optional",jt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),P6=ae("$ZodNonOptional",(e,t)=>{ct.init(e,t),jt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>XD(o,e)):XD(i,e)}});function XD(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const z6=ae("$ZodSuccess",(e,t)=>{ct.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Ob("ZodSuccess");const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>(n.value=o.issues.length===0,n)):(n.value=i.issues.length===0,n)}}),L6=ae("$ZodCatch",(e,t)=>{ct.init(e,t),jt(e._zod,"optin",()=>t.innerType._zod.optin),jt(e._zod,"optout",()=>t.innerType._zod.optout),jt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(a=>Po(a,r,Ur()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(o=>Po(o,r,Ur()))},input:n.value}),n.issues=[]),n)}}),U6=ae("$ZodNaN",(e,t)=>{ct.init(e,t),e._zod.parse=(n,r)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),F6=ae("$ZodPipe",(e,t)=>{ct.init(e,t),jt(e._zod,"values",()=>t.in._zod.values),jt(e._zod,"optin",()=>t.in._zod.optin),jt(e._zod,"optout",()=>t.out._zod.optout),jt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const o=t.out._zod.run(n,r);return o instanceof Promise?o.then(a=>Ug(a,t.in,r)):Ug(o,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(o=>Ug(o,t.out,r)):Ug(i,t.out,r)}});function Ug(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const ck=ae("$ZodCodec",(e,t)=>{ct.init(e,t),jt(e._zod,"values",()=>t.in._zod.values),jt(e._zod,"optin",()=>t.in._zod.optin),jt(e._zod,"optout",()=>t.out._zod.optout),jt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if((r.direction||"forward")==="forward"){const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(a=>Fg(a,t,r)):Fg(o,t,r)}else{const o=t.out._zod.run(n,r);return o instanceof Promise?o.then(a=>Fg(a,t,r)):Fg(o,t,r)}}});function Fg(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){const i=t.transform(e.value,e);return i instanceof Promise?i.then(o=>Vg(e,o,t.out,n)):Vg(e,i,t.out,n)}else{const i=t.reverseTransform(e.value,e);return i instanceof Promise?i.then(o=>Vg(e,o,t.in,n)):Vg(e,i,t.in,n)}}function Vg(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}const V6=ae("$ZodReadonly",(e,t)=>{ct.init(e,t),jt(e._zod,"propValues",()=>t.innerType._zod.propValues),jt(e._zod,"values",()=>t.innerType._zod.values),jt(e._zod,"optin",()=>t.innerType._zod.optin),jt(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(QD):QD(i)}});function QD(e){return e.value=Object.freeze(e.value),e}const B6=ae("$ZodTemplateLiteral",(e,t)=>{ct.init(e,t);const n=[];for(const r of t.parts)if(typeof r=="object"&&r!==null){if(!r._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...r._zod.traits].shift()}`);const i=r._zod.pattern instanceof RegExp?r._zod.pattern.source:r._zod.pattern;if(!i)throw new Error(`Invalid template literal part: ${r._zod.traits}`);const o=i.startsWith("^")?1:0,a=i.endsWith("$")?i.length-1:i.length;n.push(i.slice(o,a))}else if(r===null||vU.has(typeof r))n.push(ol(`${r}`));else throw new Error(`Invalid template literal part: ${r}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(r,i)=>typeof r.value!="string"?(r.issues.push({input:r.value,inst:e,expected:"template_literal",code:"invalid_type"}),r):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),r)}),H6=ae("$ZodFunction",(e,t)=>(ct.init(e,t),e._def=t,e._zod.def=t,e.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return function(...r){const i=e._def.input?iy(e._def.input,r):r,o=Reflect.apply(n,this,i);return e._def.output?iy(e._def.output,o):o}},e.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return async function(...r){const i=e._def.input?await oy(e._def.input,r):r,o=await Reflect.apply(n,this,i);return e._def.output?await oy(e._def.output,o):o}},e._zod.parse=(n,r)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type==="promise"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{const r=e.constructor;return Array.isArray(n[0])?new r({type:"function",input:new lk({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output}):new r({type:"function",input:n[0],output:e._def.output})},e.output=n=>{const r=e.constructor;return new r({type:"function",input:e._def.input,output:n})},e)),q6=ae("$ZodPromise",(e,t)=>{ct.init(e,t),e._zod.parse=(n,r)=>Promise.resolve(n.value).then(i=>t.innerType._zod.run({value:i,issues:[]},r))}),G6=ae("$ZodLazy",(e,t)=>{ct.init(e,t),jt(e._zod,"innerType",()=>t.getter()),jt(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),jt(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),jt(e._zod,"optin",()=>e._zod.innerType._zod.optin??void 0),jt(e._zod,"optout",()=>e._zod.innerType._zod.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),K6=ae("$ZodCustom",(e,t)=>{In.init(e,t),ct.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(o=>JD(o,n,r,e));JD(i,n,r,e)}});function JD(e,t,n,r){if(!e){const i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(Cd(i))}}const pfe=()=>{const e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return i=>{switch(i.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${i.expected}، ولكن تم إدخال ${n(i.input)}`;case"invalid_value":return i.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${it(i.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?` أكبر من اللازم: يفترض أن تكون ${i.origin??"القيمة"} ${o} ${i.maximum.toString()} ${a.unit??"عنصر"}`:`أكبر من اللازم: يفترض أن تكون ${i.origin??"القيمة"} ${o} ${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`أصغر من اللازم: يفترض لـ ${i.origin} أن يكون ${o} ${i.minimum.toString()} ${a.unit}`:`أصغر من اللازم: يفترض لـ ${i.origin} أن يكون ${o} ${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`نَص غير مقبول: يجب أن يبدأ بـ "${i.prefix}"`:o.format==="ends_with"?`نَص غير مقبول: يجب أن ينتهي بـ "${o.suffix}"`:o.format==="includes"?`نَص غير مقبول: يجب أن يتضمَّن "${o.includes}"`:o.format==="regex"?`نَص غير مقبول: يجب أن يطابق النمط ${o.pattern}`:`${r[o.format]??i.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${i.divisor}`;case"unrecognized_keys":return`معرف${i.keys.length>1?"ات":""} غريب${i.keys.length>1?"ة":""}: ${Re(i.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${i.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${i.origin}`;default:return"مدخل غير مقبول"}}};function hfe(){return{localeError:pfe()}}const gfe=()=>{const e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return i=>{switch(i.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${i.expected}, daxil olan ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Yanlış dəyər: gözlənilən ${it(i.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Çox böyük: gözlənilən ${i.origin??"dəyər"} ${o}${i.maximum.toString()} ${a.unit??"element"}`:`Çox böyük: gözlənilən ${i.origin??"dəyər"} ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Çox kiçik: gözlənilən ${i.origin} ${o}${i.minimum.toString()} ${a.unit}`:`Çox kiçik: gözlənilən ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Yanlış mətn: "${o.prefix}" ilə başlamalıdır`:o.format==="ends_with"?`Yanlış mətn: "${o.suffix}" ilə bitməlidir`:o.format==="includes"?`Yanlış mətn: "${o.includes}" daxil olmalıdır`:o.format==="regex"?`Yanlış mətn: ${o.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${r[o.format]??i.format}`}case"not_multiple_of":return`Yanlış ədəd: ${i.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${i.keys.length>1?"lar":""}: ${Re(i.keys,", ")}`;case"invalid_key":return`${i.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${i.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function vfe(){return{localeError:gfe()}}function e2(e,t,n,r){const i=Math.abs(e),o=i%10,a=i%100;return a>=11&&a<=19?r:o===1?t:o>=2&&o<=4?n:r}const yfe=()=>{const e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"лік";case"object":{if(Array.isArray(i))return"масіў";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return i=>{switch(i.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${i.expected}, атрымана ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Няправільны ўвод: чакалася ${it(i.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);if(a){const c=Number(i.maximum),d=e2(c,a.unit.one,a.unit.few,a.unit.many);return`Занадта вялікі: чакалася, што ${i.origin??"значэнне"} павінна ${a.verb} ${o}${i.maximum.toString()} ${d}`}return`Занадта вялікі: чакалася, што ${i.origin??"значэнне"} павінна быць ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);if(a){const c=Number(i.minimum),d=e2(c,a.unit.one,a.unit.few,a.unit.many);return`Занадта малы: чакалася, што ${i.origin} павінна ${a.verb} ${o}${i.minimum.toString()} ${d}`}return`Занадта малы: чакалася, што ${i.origin} павінна быць ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Няправільны радок: павінен пачынацца з "${o.prefix}"`:o.format==="ends_with"?`Няправільны радок: павінен заканчвацца на "${o.suffix}"`:o.format==="includes"?`Няправільны радок: павінен змяшчаць "${o.includes}"`:o.format==="regex"?`Няправільны радок: павінен адпавядаць шаблону ${o.pattern}`:`Няправільны ${r[o.format]??i.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${i.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${i.keys.length>1?"ключы":"ключ"}: ${Re(i.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${i.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${i.origin}`;default:return"Няправільны ўвод"}}};function bfe(){return{localeError:yfe()}}const xfe=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"число";case"object":{if(Array.isArray(e))return"масив";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},wfe=()=>{const e={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function t(r){return e[r]??null}const n={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"};return r=>{switch(r.code){case"invalid_type":return`Невалиден вход: очакван ${r.expected}, получен ${xfe(r.input)}`;case"invalid_value":return r.values.length===1?`Невалиден вход: очакван ${it(r.values[0])}`:`Невалидна опция: очаквано едно от ${Re(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",o=t(r.origin);return o?`Твърде голямо: очаква се ${r.origin??"стойност"} да съдържа ${i}${r.maximum.toString()} ${o.unit??"елемента"}`:`Твърде голямо: очаква се ${r.origin??"стойност"} да бъде ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",o=t(r.origin);return o?`Твърде малко: очаква се ${r.origin} да съдържа ${i}${r.minimum.toString()} ${o.unit}`:`Твърде малко: очаква се ${r.origin} да бъде ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;if(i.format==="starts_with")return`Невалиден низ: трябва да започва с "${i.prefix}"`;if(i.format==="ends_with")return`Невалиден низ: трябва да завършва с "${i.suffix}"`;if(i.format==="includes")return`Невалиден низ: трябва да включва "${i.includes}"`;if(i.format==="regex")return`Невалиден низ: трябва да съвпада с ${i.pattern}`;let o="Невалиден";return i.format==="emoji"&&(o="Невалидно"),i.format==="datetime"&&(o="Невалидно"),i.format==="date"&&(o="Невалидна"),i.format==="time"&&(o="Невалидно"),i.format==="duration"&&(o="Невалидна"),`${o} ${n[i.format]??r.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${r.divisor}`;case"unrecognized_keys":return`Неразпознат${r.keys.length>1?"и":""} ключ${r.keys.length>1?"ове":""}: ${Re(r.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${r.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${r.origin}`;default:return"Невалиден вход"}}};function Sfe(){return{localeError:wfe()}}const _fe=()=>{const e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return i=>{switch(i.code){case"invalid_type":return`Tipus invàlid: s'esperava ${i.expected}, s'ha rebut ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Valor invàlid: s'esperava ${it(i.values[0])}`:`Opció invàlida: s'esperava una de ${Re(i.values," o ")}`;case"too_big":{const o=i.inclusive?"com a màxim":"menys de",a=t(i.origin);return a?`Massa gran: s'esperava que ${i.origin??"el valor"} contingués ${o} ${i.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${i.origin??"el valor"} fos ${o} ${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?"com a mínim":"més de",a=t(i.origin);return a?`Massa petit: s'esperava que ${i.origin} contingués ${o} ${i.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${i.origin} fos ${o} ${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Format invàlid: ha de començar amb "${o.prefix}"`:o.format==="ends_with"?`Format invàlid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format invàlid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format invàlid: ha de coincidir amb el patró ${o.pattern}`:`Format invàlid per a ${r[o.format]??i.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${i.divisor}`;case"unrecognized_keys":return`Clau${i.keys.length>1?"s":""} no reconeguda${i.keys.length>1?"s":""}: ${Re(i.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${i.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${i.origin}`;default:return"Entrada invàlida"}}};function Cfe(){return{localeError:_fe()}}const Efe=()=>{const e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(i))return"pole";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return i=>{switch(i.code){case"invalid_type":return`Neplatný vstup: očekáváno ${i.expected}, obdrženo ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Neplatný vstup: očekáváno ${it(i.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Hodnota je příliš velká: ${i.origin??"hodnota"} musí mít ${o}${i.maximum.toString()} ${a.unit??"prvků"}`:`Hodnota je příliš velká: ${i.origin??"hodnota"} musí být ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Hodnota je příliš malá: ${i.origin??"hodnota"} musí mít ${o}${i.minimum.toString()} ${a.unit??"prvků"}`:`Hodnota je příliš malá: ${i.origin??"hodnota"} musí být ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Neplatný řetězec: musí začínat na "${o.prefix}"`:o.format==="ends_with"?`Neplatný řetězec: musí končit na "${o.suffix}"`:o.format==="includes"?`Neplatný řetězec: musí obsahovat "${o.includes}"`:o.format==="regex"?`Neplatný řetězec: musí odpovídat vzoru ${o.pattern}`:`Neplatný formát ${r[o.format]??i.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${i.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${Re(i.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${i.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${i.origin}`;default:return"Neplatný vstup"}}};function kfe(){return{localeError:Efe()}}const jfe=()=>{const e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},t={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};function n(a){return e[a]??null}function r(a){return t[a]??a}const i=a=>{const c=typeof a;switch(c){case"number":return Number.isNaN(a)?"NaN":"tal";case"object":return Array.isArray(a)?"liste":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype&&a.constructor?a.constructor.name:"objekt"}return c},o={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return a=>{switch(a.code){case"invalid_type":return`Ugyldigt input: forventede ${r(a.expected)}, fik ${r(i(a.input))}`;case"invalid_value":return a.values.length===1?`Ugyldig værdi: forventede ${it(a.values[0])}`:`Ugyldigt valg: forventede en af følgende ${Re(a.values,"|")}`;case"too_big":{const c=a.inclusive?"<=":"<",d=n(a.origin),f=r(a.origin);return d?`For stor: forventede ${f??"value"} ${d.verb} ${c} ${a.maximum.toString()} ${d.unit??"elementer"}`:`For stor: forventede ${f??"value"} havde ${c} ${a.maximum.toString()}`}case"too_small":{const c=a.inclusive?">=":">",d=n(a.origin),f=r(a.origin);return d?`For lille: forventede ${f} ${d.verb} ${c} ${a.minimum.toString()} ${d.unit}`:`For lille: forventede ${f} havde ${c} ${a.minimum.toString()}`}case"invalid_format":{const c=a;return c.format==="starts_with"?`Ugyldig streng: skal starte med "${c.prefix}"`:c.format==="ends_with"?`Ugyldig streng: skal ende med "${c.suffix}"`:c.format==="includes"?`Ugyldig streng: skal indeholde "${c.includes}"`:c.format==="regex"?`Ugyldig streng: skal matche mønsteret ${c.pattern}`:`Ugyldig ${o[c.format]??a.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${a.divisor}`;case"unrecognized_keys":return`${a.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${Re(a.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${a.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${a.origin}`;default:return"Ugyldigt input"}}};function Rfe(){return{localeError:jfe()}}const Ife=()=>{const e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"Zahl";case"object":{if(Array.isArray(i))return"Array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return i=>{switch(i.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${i.expected}, erhalten ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Ungültige Eingabe: erwartet ${it(i.values[0])}`:`Ungültige Option: erwartet eine von ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Zu groß: erwartet, dass ${i.origin??"Wert"} ${o}${i.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu groß: erwartet, dass ${i.origin??"Wert"} ${o}${i.maximum.toString()} ist`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Zu klein: erwartet, dass ${i.origin} ${o}${i.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${i.origin} ${o}${i.minimum.toString()} ist`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Ungültiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ungültiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ungültiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ungültiger String: muss dem Muster ${o.pattern} entsprechen`:`Ungültig: ${r[o.format]??i.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${i.divisor} sein`;case"unrecognized_keys":return`${i.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${Re(i.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${i.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${i.origin}`;default:return"Ungültige Eingabe"}}};function Nfe(){return{localeError:Ife()}}const Tfe=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},Afe=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(r){return e[r]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Invalid input: expected ${r.expected}, received ${Tfe(r.input)}`;case"invalid_value":return r.values.length===1?`Invalid input: expected ${it(r.values[0])}`:`Invalid option: expected one of ${Re(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",o=t(r.origin);return o?`Too big: expected ${r.origin??"value"} to have ${i}${r.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${r.origin??"value"} to be ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",o=t(r.origin);return o?`Too small: expected ${r.origin} to have ${i}${r.minimum.toString()} ${o.unit}`:`Too small: expected ${r.origin} to be ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${n[i.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${Re(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}};function Z6(){return{localeError:Afe()}}const Ofe=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"nombro";case"object":{if(Array.isArray(e))return"tabelo";if(e===null)return"senvalora";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},Dfe=()=>{const e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(r){return e[r]??null}const n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return r=>{switch(r.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${r.expected}, riceviĝis ${Ofe(r.input)}`;case"invalid_value":return r.values.length===1?`Nevalida enigo: atendiĝis ${it(r.values[0])}`:`Nevalida opcio: atendiĝis unu el ${Re(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",o=t(r.origin);return o?`Tro granda: atendiĝis ke ${r.origin??"valoro"} havu ${i}${r.maximum.toString()} ${o.unit??"elementojn"}`:`Tro granda: atendiĝis ke ${r.origin??"valoro"} havu ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",o=t(r.origin);return o?`Tro malgranda: atendiĝis ke ${r.origin} havu ${i}${r.minimum.toString()} ${o.unit}`:`Tro malgranda: atendiĝis ke ${r.origin} estu ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Nevalida karaktraro: devas komenciĝi per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas finiĝi per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${n[i.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} ŝlosilo${r.keys.length>1?"j":""}: ${Re(r.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}};function $fe(){return{localeError:Dfe()}}const Mfe=()=>{const e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},t={string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};function n(a){return e[a]??null}function r(a){return t[a]??a}const i=a=>{const c=typeof a;switch(c){case"number":return Number.isNaN(a)?"NaN":"number";case"object":return Array.isArray(a)?"array":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype?a.constructor.name:"object"}return c},o={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return a=>{switch(a.code){case"invalid_type":return`Entrada inválida: se esperaba ${r(a.expected)}, recibido ${r(i(a.input))}`;case"invalid_value":return a.values.length===1?`Entrada inválida: se esperaba ${it(a.values[0])}`:`Opción inválida: se esperaba una de ${Re(a.values,"|")}`;case"too_big":{const c=a.inclusive?"<=":"<",d=n(a.origin),f=r(a.origin);return d?`Demasiado grande: se esperaba que ${f??"valor"} tuviera ${c}${a.maximum.toString()} ${d.unit??"elementos"}`:`Demasiado grande: se esperaba que ${f??"valor"} fuera ${c}${a.maximum.toString()}`}case"too_small":{const c=a.inclusive?">=":">",d=n(a.origin),f=r(a.origin);return d?`Demasiado pequeño: se esperaba que ${f} tuviera ${c}${a.minimum.toString()} ${d.unit}`:`Demasiado pequeño: se esperaba que ${f} fuera ${c}${a.minimum.toString()}`}case"invalid_format":{const c=a;return c.format==="starts_with"?`Cadena inválida: debe comenzar con "${c.prefix}"`:c.format==="ends_with"?`Cadena inválida: debe terminar en "${c.suffix}"`:c.format==="includes"?`Cadena inválida: debe incluir "${c.includes}"`:c.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${c.pattern}`:`Inválido ${o[c.format]??a.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${a.divisor}`;case"unrecognized_keys":return`Llave${a.keys.length>1?"s":""} desconocida${a.keys.length>1?"s":""}: ${Re(a.keys,", ")}`;case"invalid_key":return`Llave inválida en ${r(a.origin)}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${r(a.origin)}`;default:return"Entrada inválida"}}};function Pfe(){return{localeError:Mfe()}}const zfe=()=>{const e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"عدد";case"object":{if(Array.isArray(i))return"آرایه";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return i=>{switch(i.code){case"invalid_type":return`ورودی نامعتبر: میبایست ${i.expected} میبود، ${n(i.input)} دریافت شد`;case"invalid_value":return i.values.length===1?`ورودی نامعتبر: میبایست ${it(i.values[0])} میبود`:`گزینه نامعتبر: میبایست یکی از ${Re(i.values,"|")} میبود`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`خیلی بزرگ: ${i.origin??"مقدار"} باید ${o}${i.maximum.toString()} ${a.unit??"عنصر"} باشد`:`خیلی بزرگ: ${i.origin??"مقدار"} باید ${o}${i.maximum.toString()} باشد`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`خیلی کوچک: ${i.origin} باید ${o}${i.minimum.toString()} ${a.unit} باشد`:`خیلی کوچک: ${i.origin} باید ${o}${i.minimum.toString()} باشد`}case"invalid_format":{const o=i;return o.format==="starts_with"?`رشته نامعتبر: باید با "${o.prefix}" شروع شود`:o.format==="ends_with"?`رشته نامعتبر: باید با "${o.suffix}" تمام شود`:o.format==="includes"?`رشته نامعتبر: باید شامل "${o.includes}" باشد`:o.format==="regex"?`رشته نامعتبر: باید با الگوی ${o.pattern} مطابقت داشته باشد`:`${r[o.format]??i.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${i.divisor} باشد`;case"unrecognized_keys":return`کلید${i.keys.length>1?"های":""} ناشناس: ${Re(i.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${i.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${i.origin}`;default:return"ورودی نامعتبر"}}};function Lfe(){return{localeError:zfe()}}const Ufe=()=>{const e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return i=>{switch(i.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${i.expected}, oli ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Virheellinen syöte: täytyy olla ${it(i.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Liian suuri: ${a.subject} täytyy olla ${o}${i.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon täytyy olla ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Liian pieni: ${a.subject} täytyy olla ${o}${i.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon täytyy olla ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Virheellinen syöte: täytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen syöte: täytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen syöte: täytyy sisältää "${o.includes}"`:o.format==="regex"?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${o.pattern}`:`Virheellinen ${r[o.format]??i.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${i.divisor} monikerta`;case"unrecognized_keys":return`${i.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${Re(i.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function Ffe(){return{localeError:Ufe()}}const Vfe=()=>{const e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"nombre";case"object":{if(Array.isArray(i))return"tableau";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return i=>{switch(i.code){case"invalid_type":return`Entrée invalide : ${i.expected} attendu, ${n(i.input)} reçu`;case"invalid_value":return i.values.length===1?`Entrée invalide : ${it(i.values[0])} attendu`:`Option invalide : une valeur parmi ${Re(i.values,"|")} attendue`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Trop grand : ${i.origin??"valeur"} doit ${a.verb} ${o}${i.maximum.toString()} ${a.unit??"élément(s)"}`:`Trop grand : ${i.origin??"valeur"} doit être ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Trop petit : ${i.origin} doit ${a.verb} ${o}${i.minimum.toString()} ${a.unit}`:`Trop petit : ${i.origin} doit être ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Chaîne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Chaîne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Chaîne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Chaîne invalide : doit correspondre au modèle ${o.pattern}`:`${r[o.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${i.divisor}`;case"unrecognized_keys":return`Clé${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${Re(i.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${i.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entrée invalide"}}};function Bfe(){return{localeError:Vfe()}}const Hfe=()=>{const e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return i=>{switch(i.code){case"invalid_type":return`Entrée invalide : attendu ${i.expected}, reçu ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Entrée invalide : attendu ${it(i.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"≤":"<",a=t(i.origin);return a?`Trop grand : attendu que ${i.origin??"la valeur"} ait ${o}${i.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${i.origin??"la valeur"} soit ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?"≥":">",a=t(i.origin);return a?`Trop petit : attendu que ${i.origin} ait ${o}${i.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${i.origin} soit ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Chaîne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Chaîne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Chaîne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Chaîne invalide : doit correspondre au motif ${o.pattern}`:`${r[o.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${i.divisor}`;case"unrecognized_keys":return`Clé${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${Re(i.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${i.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entrée invalide"}}};function qfe(){return{localeError:Hfe()}}const Gfe=()=>{const e={string:{unit:"אותיות",verb:"לכלול"},file:{unit:"בייטים",verb:"לכלול"},array:{unit:"פריטים",verb:"לכלול"},set:{unit:"פריטים",verb:"לכלול"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"קלט",email:"כתובת אימייל",url:"כתובת רשת",emoji:"אימוג'י",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"תאריך וזמן ISO",date:"תאריך ISO",time:"זמן ISO",duration:"משך זמן ISO",ipv4:"כתובת IPv4",ipv6:"כתובת IPv6",cidrv4:"טווח IPv4",cidrv6:"טווח IPv6",base64:"מחרוזת בבסיס 64",base64url:"מחרוזת בבסיס 64 לכתובות רשת",json_string:"מחרוזת JSON",e164:"מספר E.164",jwt:"JWT",template_literal:"קלט"};return i=>{switch(i.code){case"invalid_type":return`קלט לא תקין: צריך ${i.expected}, התקבל ${n(i.input)}`;case"invalid_value":return i.values.length===1?`קלט לא תקין: צריך ${it(i.values[0])}`:`קלט לא תקין: צריך אחת מהאפשרויות ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`גדול מדי: ${i.origin??"value"} צריך להיות ${o}${i.maximum.toString()} ${a.unit??"elements"}`:`גדול מדי: ${i.origin??"value"} צריך להיות ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`קטן מדי: ${i.origin} צריך להיות ${o}${i.minimum.toString()} ${a.unit}`:`קטן מדי: ${i.origin} צריך להיות ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`מחרוזת לא תקינה: חייבת להתחיל ב"${o.prefix}"`:o.format==="ends_with"?`מחרוזת לא תקינה: חייבת להסתיים ב "${o.suffix}"`:o.format==="includes"?`מחרוזת לא תקינה: חייבת לכלול "${o.includes}"`:o.format==="regex"?`מחרוזת לא תקינה: חייבת להתאים לתבנית ${o.pattern}`:`${r[o.format]??i.format} לא תקין`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${i.divisor}`;case"unrecognized_keys":return`מפתח${i.keys.length>1?"ות":""} לא מזוה${i.keys.length>1?"ים":"ה"}: ${Re(i.keys,", ")}`;case"invalid_key":return`מפתח לא תקין ב${i.origin}`;case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${i.origin}`;default:return"קלט לא תקין"}}};function Kfe(){return{localeError:Gfe()}}const Zfe=()=>{const e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"szám";case"object":{if(Array.isArray(i))return"tömb";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return i=>{switch(i.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${i.expected}, a kapott érték ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Érvénytelen bemenet: a várt érték ${it(i.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Túl nagy: ${i.origin??"érték"} mérete túl nagy ${o}${i.maximum.toString()} ${a.unit??"elem"}`:`Túl nagy: a bemeneti érték ${i.origin??"érték"} túl nagy: ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Túl kicsi: a bemeneti érték ${i.origin} mérete túl kicsi ${o}${i.minimum.toString()} ${a.unit}`:`Túl kicsi: a bemeneti érték ${i.origin} túl kicsi ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Érvénytelen string: "${o.prefix}" értékkel kell kezdődnie`:o.format==="ends_with"?`Érvénytelen string: "${o.suffix}" értékkel kell végződnie`:o.format==="includes"?`Érvénytelen string: "${o.includes}" értéket kell tartalmaznia`:o.format==="regex"?`Érvénytelen string: ${o.pattern} mintának kell megfelelnie`:`Érvénytelen ${r[o.format]??i.format}`}case"not_multiple_of":return`Érvénytelen szám: ${i.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${i.keys.length>1?"s":""}: ${Re(i.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${i.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${i.origin}`;default:return"Érvénytelen bemenet"}}};function Yfe(){return{localeError:Zfe()}}const Wfe=()=>{const e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return i=>{switch(i.code){case"invalid_type":return`Input tidak valid: diharapkan ${i.expected}, diterima ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Input tidak valid: diharapkan ${it(i.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Terlalu besar: diharapkan ${i.origin??"value"} memiliki ${o}${i.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${i.origin??"value"} menjadi ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Terlalu kecil: diharapkan ${i.origin} memiliki ${o}${i.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${i.origin} menjadi ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${r[o.format]??i.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${i.keys.length>1?"s":""}: ${Re(i.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${i.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${i.origin}`;default:return"Input tidak valid"}}};function Xfe(){return{localeError:Wfe()}}const Qfe=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"númer";case"object":{if(Array.isArray(e))return"fylki";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},Jfe=()=>{const e={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function t(r){return e[r]??null}const n={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"};return r=>{switch(r.code){case"invalid_type":return`Rangt gildi: Þú slóst inn ${Qfe(r.input)} þar sem á að vera ${r.expected}`;case"invalid_value":return r.values.length===1?`Rangt gildi: gert ráð fyrir ${it(r.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${Re(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",o=t(r.origin);return o?`Of stórt: gert er ráð fyrir að ${r.origin??"gildi"} hafi ${i}${r.maximum.toString()} ${o.unit??"hluti"}`:`Of stórt: gert er ráð fyrir að ${r.origin??"gildi"} sé ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",o=t(r.origin);return o?`Of lítið: gert er ráð fyrir að ${r.origin} hafi ${i}${r.minimum.toString()} ${o.unit}`:`Of lítið: gert er ráð fyrir að ${r.origin} sé ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Ógildur strengur: verður að byrja á "${i.prefix}"`:i.format==="ends_with"?`Ógildur strengur: verður að enda á "${i.suffix}"`:i.format==="includes"?`Ógildur strengur: verður að innihalda "${i.includes}"`:i.format==="regex"?`Ógildur strengur: verður að fylgja mynstri ${i.pattern}`:`Rangt ${n[i.format]??r.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`Óþekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${Re(r.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${r.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${r.origin}`;default:return"Rangt gildi"}}};function eme(){return{localeError:Jfe()}}const tme=()=>{const e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"numero";case"object":{if(Array.isArray(i))return"vettore";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return i=>{switch(i.code){case"invalid_type":return`Input non valido: atteso ${i.expected}, ricevuto ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Input non valido: atteso ${it(i.values[0])}`:`Opzione non valida: atteso uno tra ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Troppo grande: ${i.origin??"valore"} deve avere ${o}${i.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${i.origin??"valore"} deve essere ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Troppo piccolo: ${i.origin} deve avere ${o}${i.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${i.origin} deve essere ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${r[o.format]??i.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${i.divisor}`;case"unrecognized_keys":return`Chiav${i.keys.length>1?"i":"e"} non riconosciut${i.keys.length>1?"e":"a"}: ${Re(i.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${i.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${i.origin}`;default:return"Input non valido"}}};function nme(){return{localeError:tme()}}const rme=()=>{const e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"数値";case"object":{if(Array.isArray(i))return"配列";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return i=>{switch(i.code){case"invalid_type":return`無効な入力: ${i.expected}が期待されましたが、${n(i.input)}が入力されました`;case"invalid_value":return i.values.length===1?`無効な入力: ${it(i.values[0])}が期待されました`:`無効な選択: ${Re(i.values,"、")}のいずれかである必要があります`;case"too_big":{const o=i.inclusive?"以下である":"より小さい",a=t(i.origin);return a?`大きすぎる値: ${i.origin??"値"}は${i.maximum.toString()}${a.unit??"要素"}${o}必要があります`:`大きすぎる値: ${i.origin??"値"}は${i.maximum.toString()}${o}必要があります`}case"too_small":{const o=i.inclusive?"以上である":"より大きい",a=t(i.origin);return a?`小さすぎる値: ${i.origin}は${i.minimum.toString()}${a.unit}${o}必要があります`:`小さすぎる値: ${i.origin}は${i.minimum.toString()}${o}必要があります`}case"invalid_format":{const o=i;return o.format==="starts_with"?`無効な文字列: "${o.prefix}"で始まる必要があります`:o.format==="ends_with"?`無効な文字列: "${o.suffix}"で終わる必要があります`:o.format==="includes"?`無効な文字列: "${o.includes}"を含む必要があります`:o.format==="regex"?`無効な文字列: パターン${o.pattern}に一致する必要があります`:`無効な${r[o.format]??i.format}`}case"not_multiple_of":return`無効な数値: ${i.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${i.keys.length>1?"群":""}: ${Re(i.keys,"、")}`;case"invalid_key":return`${i.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${i.origin}内の無効な値`;default:return"無効な入力"}}};function ime(){return{localeError:rme()}}const ome=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"რიცხვი";case"object":{if(Array.isArray(e))return"მასივი";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return{string:"სტრინგი",boolean:"ბულეანი",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"ფუნქცია"}[t]??t},ame=()=>{const e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function t(r){return e[r]??null}const n={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"};return r=>{switch(r.code){case"invalid_type":return`არასწორი შეყვანა: მოსალოდნელი ${r.expected}, მიღებული ${ome(r.input)}`;case"invalid_value":return r.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${it(r.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${Re(r.values,"|")}-დან`;case"too_big":{const i=r.inclusive?"<=":"<",o=t(r.origin);return o?`ზედმეტად დიდი: მოსალოდნელი ${r.origin??"მნიშვნელობა"} ${o.verb} ${i}${r.maximum.toString()} ${o.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${r.origin??"მნიშვნელობა"} იყოს ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",o=t(r.origin);return o?`ზედმეტად პატარა: მოსალოდნელი ${r.origin} ${o.verb} ${i}${r.minimum.toString()} ${o.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${r.origin} იყოს ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`არასწორი სტრინგი: უნდა იწყებოდეს "${i.prefix}"-ით`:i.format==="ends_with"?`არასწორი სტრინგი: უნდა მთავრდებოდეს "${i.suffix}"-ით`:i.format==="includes"?`არასწორი სტრინგი: უნდა შეიცავდეს "${i.includes}"-ს`:i.format==="regex"?`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${i.pattern}`:`არასწორი ${n[i.format]??r.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${r.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${r.keys.length>1?"ები":"ი"}: ${Re(r.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${r.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${r.origin}-ში`;default:return"არასწორი შეყვანა"}}};function sme(){return{localeError:ame()}}const lme=()=>{const e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(i))return"អារេ (Array)";if(i===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return i=>{switch(i.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${i.expected} ប៉ុន្តែទទួលបាន ${n(i.input)}`;case"invalid_value":return i.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${it(i.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`ធំពេក៖ ត្រូវការ ${i.origin??"តម្លៃ"} ${o} ${i.maximum.toString()} ${a.unit??"ធាតុ"}`:`ធំពេក៖ ត្រូវការ ${i.origin??"តម្លៃ"} ${o} ${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`តូចពេក៖ ត្រូវការ ${i.origin} ${o} ${i.minimum.toString()} ${a.unit}`:`តូចពេក៖ ត្រូវការ ${i.origin} ${o} ${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${o.prefix}"`:o.format==="ends_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${o.suffix}"`:o.format==="includes"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${o.includes}"`:o.format==="regex"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${o.pattern}`:`មិនត្រឹមត្រូវ៖ ${r[o.format]??i.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${i.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${Re(i.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${i.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${i.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function Y6(){return{localeError:lme()}}function cme(){return Y6()}const ume=()=>{const e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return i=>{switch(i.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${i.expected}, 받은 타입은 ${n(i.input)}입니다`;case"invalid_value":return i.values.length===1?`잘못된 입력: 값은 ${it(i.values[0])} 이어야 합니다`:`잘못된 옵션: ${Re(i.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{const o=i.inclusive?"이하":"미만",a=o==="미만"?"이어야 합니다":"여야 합니다",c=t(i.origin),d=c?.unit??"요소";return c?`${i.origin??"값"}이 너무 큽니다: ${i.maximum.toString()}${d} ${o}${a}`:`${i.origin??"값"}이 너무 큽니다: ${i.maximum.toString()} ${o}${a}`}case"too_small":{const o=i.inclusive?"이상":"초과",a=o==="이상"?"이어야 합니다":"여야 합니다",c=t(i.origin),d=c?.unit??"요소";return c?`${i.origin??"값"}이 너무 작습니다: ${i.minimum.toString()}${d} ${o}${a}`:`${i.origin??"값"}이 너무 작습니다: ${i.minimum.toString()} ${o}${a}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`잘못된 문자열: "${o.prefix}"(으)로 시작해야 합니다`:o.format==="ends_with"?`잘못된 문자열: "${o.suffix}"(으)로 끝나야 합니다`:o.format==="includes"?`잘못된 문자열: "${o.includes}"을(를) 포함해야 합니다`:o.format==="regex"?`잘못된 문자열: 정규식 ${o.pattern} 패턴과 일치해야 합니다`:`잘못된 ${r[o.format]??i.format}`}case"not_multiple_of":return`잘못된 숫자: ${i.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${Re(i.keys,", ")}`;case"invalid_key":return`잘못된 키: ${i.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${i.origin}`;default:return"잘못된 입력"}}};function dme(){return{localeError:ume()}}const fme=e=>Im(typeof e,e),Im=(e,t=void 0)=>{switch(e){case"number":return Number.isNaN(t)?"NaN":"skaičius";case"bigint":return"sveikasis skaičius";case"string":return"eilutė";case"boolean":return"loginė reikšmė";case"undefined":case"void":return"neapibrėžta reikšmė";case"function":return"funkcija";case"symbol":return"simbolis";case"object":return t===void 0?"nežinomas objektas":t===null?"nulinė reikšmė":Array.isArray(t)?"masyvas":Object.getPrototypeOf(t)!==Object.prototype&&t.constructor?t.constructor.name:"objektas";case"null":return"nulinė reikšmė"}return e},gm=e=>e.charAt(0).toUpperCase()+e.slice(1);function t2(e){const t=Math.abs(e),n=t%10,r=t%100;return r>=11&&r<=19||n===0?"many":n===1?"one":"few"}const mme=()=>{const e={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function t(r,i,o,a){const c=e[r]??null;return c===null?c:{unit:c.unit[i],verb:c.verb[a][o?"inclusive":"notInclusive"]}}const n={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"};return r=>{switch(r.code){case"invalid_type":return`Gautas tipas ${fme(r.input)}, o tikėtasi - ${Im(r.expected)}`;case"invalid_value":return r.values.length===1?`Privalo būti ${it(r.values[0])}`:`Privalo būti vienas iš ${Re(r.values,"|")} pasirinkimų`;case"too_big":{const i=Im(r.origin),o=t(r.origin,t2(Number(r.maximum)),r.inclusive??!1,"smaller");if(o?.verb)return`${gm(i??r.origin??"reikšmė")} ${o.verb} ${r.maximum.toString()} ${o.unit??"elementų"}`;const a=r.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${gm(i??r.origin??"reikšmė")} turi būti ${a} ${r.maximum.toString()} ${o?.unit}`}case"too_small":{const i=Im(r.origin),o=t(r.origin,t2(Number(r.minimum)),r.inclusive??!1,"bigger");if(o?.verb)return`${gm(i??r.origin??"reikšmė")} ${o.verb} ${r.minimum.toString()} ${o.unit??"elementų"}`;const a=r.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${gm(i??r.origin??"reikšmė")} turi būti ${a} ${r.minimum.toString()} ${o?.unit}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Eilutė privalo prasidėti "${i.prefix}"`:i.format==="ends_with"?`Eilutė privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilutė privalo įtraukti "${i.includes}"`:i.format==="regex"?`Eilutė privalo atitikti ${i.pattern}`:`Neteisingas ${n[i.format]??r.format}`}case"not_multiple_of":return`Skaičius privalo būti ${r.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${r.keys.length>1?"i":"as"} rakt${r.keys.length>1?"ai":"as"}: ${Re(r.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{const i=Im(r.origin);return`${gm(i??r.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function pme(){return{localeError:mme()}}const hme=()=>{const e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"број";case"object":{if(Array.isArray(i))return"низа";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return i=>{switch(i.code){case"invalid_type":return`Грешен внес: се очекува ${i.expected}, примено ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Invalid input: expected ${it(i.values[0])}`:`Грешана опција: се очекува една ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Премногу голем: се очекува ${i.origin??"вредноста"} да има ${o}${i.maximum.toString()} ${a.unit??"елементи"}`:`Премногу голем: се очекува ${i.origin??"вредноста"} да биде ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Премногу мал: се очекува ${i.origin} да има ${o}${i.minimum.toString()} ${a.unit}`:`Премногу мал: се очекува ${i.origin} да биде ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Неважечка низа: мора да започнува со "${o.prefix}"`:o.format==="ends_with"?`Неважечка низа: мора да завршува со "${o.suffix}"`:o.format==="includes"?`Неважечка низа: мора да вклучува "${o.includes}"`:o.format==="regex"?`Неважечка низа: мора да одгоара на патернот ${o.pattern}`:`Invalid ${r[o.format]??i.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${Re(i.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${i.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${i.origin}`;default:return"Грешен внес"}}};function gme(){return{localeError:hme()}}const vme=()=>{const e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"nombor";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return i=>{switch(i.code){case"invalid_type":return`Input tidak sah: dijangka ${i.expected}, diterima ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Input tidak sah: dijangka ${it(i.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Terlalu besar: dijangka ${i.origin??"nilai"} ${a.verb} ${o}${i.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${i.origin??"nilai"} adalah ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Terlalu kecil: dijangka ${i.origin} ${a.verb} ${o}${i.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${i.origin} adalah ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${r[o.format]??i.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${Re(i.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${i.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${i.origin}`;default:return"Input tidak sah"}}};function yme(){return{localeError:vme()}}const bme=()=>{const e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"getal";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return i=>{switch(i.code){case"invalid_type":return`Ongeldige invoer: verwacht ${i.expected}, ontving ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Ongeldige invoer: verwacht ${it(i.values[0])}`:`Ongeldige optie: verwacht één van ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Te lang: verwacht dat ${i.origin??"waarde"} ${o}${i.maximum.toString()} ${a.unit??"elementen"} bevat`:`Te lang: verwacht dat ${i.origin??"waarde"} ${o}${i.maximum.toString()} is`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Te kort: verwacht dat ${i.origin} ${o}${i.minimum.toString()} ${a.unit} bevat`:`Te kort: verwacht dat ${i.origin} ${o}${i.minimum.toString()} is`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${r[o.format]??i.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${i.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${i.keys.length>1?"s":""}: ${Re(i.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${i.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${i.origin}`;default:return"Ongeldige invoer"}}};function xme(){return{localeError:bme()}}const wme=()=>{const e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"tall";case"object":{if(Array.isArray(i))return"liste";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return i=>{switch(i.code){case"invalid_type":return`Ugyldig input: forventet ${i.expected}, fikk ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Ugyldig verdi: forventet ${it(i.values[0])}`:`Ugyldig valg: forventet en av ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`For stor(t): forventet ${i.origin??"value"} til å ha ${o}${i.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${i.origin??"value"} til å ha ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`For lite(n): forventet ${i.origin} til å ha ${o}${i.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${i.origin} til å ha ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Ugyldig streng: må starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: må ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: må inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: må matche mønsteret ${o.pattern}`:`Ugyldig ${r[o.format]??i.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${Re(i.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${i.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${i.origin}`;default:return"Ugyldig input"}}};function Sme(){return{localeError:wme()}}const _me=()=>{const e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"numara";case"object":{if(Array.isArray(i))return"saf";if(i===null)return"gayb";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return i=>{switch(i.code){case"invalid_type":return`Fâsit giren: umulan ${i.expected}, alınan ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Fâsit giren: umulan ${it(i.values[0])}`:`Fâsit tercih: mûteberler ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Fazla büyük: ${i.origin??"value"}, ${o}${i.maximum.toString()} ${a.unit??"elements"} sahip olmalıydı.`:`Fazla büyük: ${i.origin??"value"}, ${o}${i.maximum.toString()} olmalıydı.`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Fazla küçük: ${i.origin}, ${o}${i.minimum.toString()} ${a.unit} sahip olmalıydı.`:`Fazla küçük: ${i.origin}, ${o}${i.minimum.toString()} olmalıydı.`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Fâsit metin: "${o.prefix}" ile başlamalı.`:o.format==="ends_with"?`Fâsit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`Fâsit metin: "${o.includes}" ihtivâ etmeli.`:o.format==="regex"?`Fâsit metin: ${o.pattern} nakşına uymalı.`:`Fâsit ${r[o.format]??i.format}`}case"not_multiple_of":return`Fâsit sayı: ${i.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${i.keys.length>1?"s":""}: ${Re(i.keys,", ")}`;case"invalid_key":return`${i.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${i.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function Cme(){return{localeError:_me()}}const Eme=()=>{const e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"عدد";case"object":{if(Array.isArray(i))return"ارې";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return i=>{switch(i.code){case"invalid_type":return`ناسم ورودي: باید ${i.expected} وای, مګر ${n(i.input)} ترلاسه شو`;case"invalid_value":return i.values.length===1?`ناسم ورودي: باید ${it(i.values[0])} وای`:`ناسم انتخاب: باید یو له ${Re(i.values,"|")} څخه وای`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`ډیر لوی: ${i.origin??"ارزښت"} باید ${o}${i.maximum.toString()} ${a.unit??"عنصرونه"} ولري`:`ډیر لوی: ${i.origin??"ارزښت"} باید ${o}${i.maximum.toString()} وي`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`ډیر کوچنی: ${i.origin} باید ${o}${i.minimum.toString()} ${a.unit} ولري`:`ډیر کوچنی: ${i.origin} باید ${o}${i.minimum.toString()} وي`}case"invalid_format":{const o=i;return o.format==="starts_with"?`ناسم متن: باید د "${o.prefix}" سره پیل شي`:o.format==="ends_with"?`ناسم متن: باید د "${o.suffix}" سره پای ته ورسيږي`:o.format==="includes"?`ناسم متن: باید "${o.includes}" ولري`:o.format==="regex"?`ناسم متن: باید د ${o.pattern} سره مطابقت ولري`:`${r[o.format]??i.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${i.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${i.keys.length>1?"کلیډونه":"کلیډ"}: ${Re(i.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${i.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${i.origin} کې`;default:return"ناسمه ورودي"}}};function kme(){return{localeError:Eme()}}const jme=()=>{const e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"liczba";case"object":{if(Array.isArray(i))return"tablica";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return i=>{switch(i.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${i.expected}, otrzymano ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${it(i.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Za duża wartość: oczekiwano, że ${i.origin??"wartość"} będzie mieć ${o}${i.maximum.toString()} ${a.unit??"elementów"}`:`Zbyt duż(y/a/e): oczekiwano, że ${i.origin??"wartość"} będzie wynosić ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Za mała wartość: oczekiwano, że ${i.origin??"wartość"} będzie mieć ${o}${i.minimum.toString()} ${a.unit??"elementów"}`:`Zbyt mał(y/a/e): oczekiwano, że ${i.origin??"wartość"} będzie wynosić ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${o.prefix}"`:o.format==="ends_with"?`Nieprawidłowy ciąg znaków: musi kończyć się na "${o.suffix}"`:o.format==="includes"?`Nieprawidłowy ciąg znaków: musi zawierać "${o.includes}"`:o.format==="regex"?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${o.pattern}`:`Nieprawidłow(y/a/e) ${r[o.format]??i.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${i.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${i.keys.length>1?"s":""}: ${Re(i.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${i.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${i.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function Rme(){return{localeError:jme()}}const Ime=()=>{const e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"número";case"object":{if(Array.isArray(i))return"array";if(i===null)return"nulo";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return i=>{switch(i.code){case"invalid_type":return`Tipo inválido: esperado ${i.expected}, recebido ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Entrada inválida: esperado ${it(i.values[0])}`:`Opção inválida: esperada uma das ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Muito grande: esperado que ${i.origin??"valor"} tivesse ${o}${i.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${i.origin??"valor"} fosse ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Muito pequeno: esperado que ${i.origin} tivesse ${o}${i.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${i.origin} fosse ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Texto inválido: deve começar com "${o.prefix}"`:o.format==="ends_with"?`Texto inválido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inválido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inválido: deve corresponder ao padrão ${o.pattern}`:`${r[o.format]??i.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${i.divisor}`;case"unrecognized_keys":return`Chave${i.keys.length>1?"s":""} desconhecida${i.keys.length>1?"s":""}: ${Re(i.keys,", ")}`;case"invalid_key":return`Chave inválida em ${i.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${i.origin}`;default:return"Campo inválido"}}};function Nme(){return{localeError:Ime()}}function n2(e,t,n,r){const i=Math.abs(e),o=i%10,a=i%100;return a>=11&&a<=19?r:o===1?t:o>=2&&o<=4?n:r}const Tme=()=>{const e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"число";case"object":{if(Array.isArray(i))return"массив";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return i=>{switch(i.code){case"invalid_type":return`Неверный ввод: ожидалось ${i.expected}, получено ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Неверный ввод: ожидалось ${it(i.values[0])}`:`Неверный вариант: ожидалось одно из ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);if(a){const c=Number(i.maximum),d=n2(c,a.unit.one,a.unit.few,a.unit.many);return`Слишком большое значение: ожидалось, что ${i.origin??"значение"} будет иметь ${o}${i.maximum.toString()} ${d}`}return`Слишком большое значение: ожидалось, что ${i.origin??"значение"} будет ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);if(a){const c=Number(i.minimum),d=n2(c,a.unit.one,a.unit.few,a.unit.many);return`Слишком маленькое значение: ожидалось, что ${i.origin} будет иметь ${o}${i.minimum.toString()} ${d}`}return`Слишком маленькое значение: ожидалось, что ${i.origin} будет ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Неверная строка: должна начинаться с "${o.prefix}"`:o.format==="ends_with"?`Неверная строка: должна заканчиваться на "${o.suffix}"`:o.format==="includes"?`Неверная строка: должна содержать "${o.includes}"`:o.format==="regex"?`Неверная строка: должна соответствовать шаблону ${o.pattern}`:`Неверный ${r[o.format]??i.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${i.divisor}`;case"unrecognized_keys":return`Нераспознанн${i.keys.length>1?"ые":"ый"} ключ${i.keys.length>1?"и":""}: ${Re(i.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${i.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${i.origin}`;default:return"Неверные входные данные"}}};function Ame(){return{localeError:Tme()}}const Ome=()=>{const e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"število";case"object":{if(Array.isArray(i))return"tabela";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"};return i=>{switch(i.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${i.expected}, prejeto ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Neveljaven vnos: pričakovano ${it(i.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Preveliko: pričakovano, da bo ${i.origin??"vrednost"} imelo ${o}${i.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pričakovano, da bo ${i.origin??"vrednost"} ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Premajhno: pričakovano, da bo ${i.origin} imelo ${o}${i.minimum.toString()} ${a.unit}`:`Premajhno: pričakovano, da bo ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Neveljaven niz: mora se začeti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se končati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${r[o.format]??i.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${i.divisor}`;case"unrecognized_keys":return`Neprepoznan${i.keys.length>1?"i ključi":" ključ"}: ${Re(i.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${i.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${i.origin}`;default:return"Neveljaven vnos"}}};function Dme(){return{localeError:Ome()}}const $me=()=>{const e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"antal";case"object":{if(Array.isArray(i))return"lista";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return i=>{switch(i.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${i.expected}, fick ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Ogiltig inmatning: förväntat ${it(i.values[0])}`:`Ogiltigt val: förväntade en av ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`För stor(t): förväntade ${i.origin??"värdet"} att ha ${o}${i.maximum.toString()} ${a.unit??"element"}`:`För stor(t): förväntat ${i.origin??"värdet"} att ha ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`För lite(t): förväntade ${i.origin??"värdet"} att ha ${o}${i.minimum.toString()} ${a.unit}`:`För lite(t): förväntade ${i.origin??"värdet"} att ha ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Ogiltig sträng: måste börja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig sträng: måste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig sträng: måste innehålla "${o.includes}"`:o.format==="regex"?`Ogiltig sträng: måste matcha mönstret "${o.pattern}"`:`Ogiltig(t) ${r[o.format]??i.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${Re(i.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${i.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${i.origin??"värdet"}`;default:return"Ogiltig input"}}};function Mme(){return{localeError:$me()}}const Pme=()=>{const e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(i))return"அணி";if(i===null)return"வெறுமை";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return i=>{switch(i.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${i.expected}, பெறப்பட்டது ${n(i.input)}`;case"invalid_value":return i.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${it(i.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${Re(i.values,"|")} இல் ஒன்று`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${i.origin??"மதிப்பு"} ${o}${i.maximum.toString()} ${a.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${i.origin??"மதிப்பு"} ${o}${i.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${i.origin} ${o}${i.minimum.toString()} ${a.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${i.origin} ${o}${i.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{const o=i;return o.format==="starts_with"?`தவறான சரம்: "${o.prefix}" இல் தொடங்க வேண்டும்`:o.format==="ends_with"?`தவறான சரம்: "${o.suffix}" இல் முடிவடைய வேண்டும்`:o.format==="includes"?`தவறான சரம்: "${o.includes}" ஐ உள்ளடக்க வேண்டும்`:o.format==="regex"?`தவறான சரம்: ${o.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${r[o.format]??i.format}`}case"not_multiple_of":return`தவறான எண்: ${i.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${i.keys.length>1?"கள்":""}: ${Re(i.keys,", ")}`;case"invalid_key":return`${i.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${i.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function zme(){return{localeError:Pme()}}const Lme=()=>{const e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(i))return"อาร์เรย์ (Array)";if(i===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return i=>{switch(i.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${i.expected} แต่ได้รับ ${n(i.input)}`;case"invalid_value":return i.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${it(i.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"ไม่เกิน":"น้อยกว่า",a=t(i.origin);return a?`เกินกำหนด: ${i.origin??"ค่า"} ควรมี${o} ${i.maximum.toString()} ${a.unit??"รายการ"}`:`เกินกำหนด: ${i.origin??"ค่า"} ควรมี${o} ${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?"อย่างน้อย":"มากกว่า",a=t(i.origin);return a?`น้อยกว่ากำหนด: ${i.origin} ควรมี${o} ${i.minimum.toString()} ${a.unit}`:`น้อยกว่ากำหนด: ${i.origin} ควรมี${o} ${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${o.prefix}"`:o.format==="ends_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${o.suffix}"`:o.format==="includes"?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${o.includes}" อยู่ในข้อความ`:o.format==="regex"?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${o.pattern}`:`รูปแบบไม่ถูกต้อง: ${r[o.format]??i.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${i.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${Re(i.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${i.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${i.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function Ume(){return{localeError:Lme()}}const Fme=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},Vme=()=>{const e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(r){return e[r]??null}const n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return r=>{switch(r.code){case"invalid_type":return`Geçersiz değer: beklenen ${r.expected}, alınan ${Fme(r.input)}`;case"invalid_value":return r.values.length===1?`Geçersiz değer: beklenen ${it(r.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${Re(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",o=t(r.origin);return o?`Çok büyük: beklenen ${r.origin??"değer"} ${i}${r.maximum.toString()} ${o.unit??"öğe"}`:`Çok büyük: beklenen ${r.origin??"değer"} ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",o=t(r.origin);return o?`Çok küçük: beklenen ${r.origin} ${i}${r.minimum.toString()} ${o.unit}`:`Çok küçük: beklenen ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Geçersiz metin: "${i.prefix}" ile başlamalı`:i.format==="ends_with"?`Geçersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Geçersiz metin: "${i.includes}" içermeli`:i.format==="regex"?`Geçersiz metin: ${i.pattern} desenine uymalı`:`Geçersiz ${n[i.format]??r.format}`}case"not_multiple_of":return`Geçersiz sayı: ${r.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${r.keys.length>1?"lar":""}: ${Re(r.keys,", ")}`;case"invalid_key":return`${r.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${r.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function Bme(){return{localeError:Vme()}}const Hme=()=>{const e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"число";case"object":{if(Array.isArray(i))return"масив";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return i=>{switch(i.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${i.expected}, отримано ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Неправильні вхідні дані: очікується ${it(i.values[0])}`:`Неправильна опція: очікується одне з ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Занадто велике: очікується, що ${i.origin??"значення"} ${a.verb} ${o}${i.maximum.toString()} ${a.unit??"елементів"}`:`Занадто велике: очікується, що ${i.origin??"значення"} буде ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Занадто мале: очікується, що ${i.origin} ${a.verb} ${o}${i.minimum.toString()} ${a.unit}`:`Занадто мале: очікується, що ${i.origin} буде ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Неправильний рядок: повинен починатися з "${o.prefix}"`:o.format==="ends_with"?`Неправильний рядок: повинен закінчуватися на "${o.suffix}"`:o.format==="includes"?`Неправильний рядок: повинен містити "${o.includes}"`:o.format==="regex"?`Неправильний рядок: повинен відповідати шаблону ${o.pattern}`:`Неправильний ${r[o.format]??i.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${i.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${i.keys.length>1?"і":""}: ${Re(i.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${i.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${i.origin}`;default:return"Неправильні вхідні дані"}}};function W6(){return{localeError:Hme()}}function qme(){return W6()}const Gme=()=>{const e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"نمبر";case"object":{if(Array.isArray(i))return"آرے";if(i===null)return"نل";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return i=>{switch(i.code){case"invalid_type":return`غلط ان پٹ: ${i.expected} متوقع تھا، ${n(i.input)} موصول ہوا`;case"invalid_value":return i.values.length===1?`غلط ان پٹ: ${it(i.values[0])} متوقع تھا`:`غلط آپشن: ${Re(i.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`بہت بڑا: ${i.origin??"ویلیو"} کے ${o}${i.maximum.toString()} ${a.unit??"عناصر"} ہونے متوقع تھے`:`بہت بڑا: ${i.origin??"ویلیو"} کا ${o}${i.maximum.toString()} ہونا متوقع تھا`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`بہت چھوٹا: ${i.origin} کے ${o}${i.minimum.toString()} ${a.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${i.origin} کا ${o}${i.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{const o=i;return o.format==="starts_with"?`غلط سٹرنگ: "${o.prefix}" سے شروع ہونا چاہیے`:o.format==="ends_with"?`غلط سٹرنگ: "${o.suffix}" پر ختم ہونا چاہیے`:o.format==="includes"?`غلط سٹرنگ: "${o.includes}" شامل ہونا چاہیے`:o.format==="regex"?`غلط سٹرنگ: پیٹرن ${o.pattern} سے میچ ہونا چاہیے`:`غلط ${r[o.format]??i.format}`}case"not_multiple_of":return`غلط نمبر: ${i.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${i.keys.length>1?"ز":""}: ${Re(i.keys,"، ")}`;case"invalid_key":return`${i.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${i.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function Kme(){return{localeError:Gme()}}const Zme=()=>{const e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"số";case"object":{if(Array.isArray(i))return"mảng";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return i=>{switch(i.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${i.expected}, nhận được ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Đầu vào không hợp lệ: mong đợi ${it(i.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Quá lớn: mong đợi ${i.origin??"giá trị"} ${a.verb} ${o}${i.maximum.toString()} ${a.unit??"phần tử"}`:`Quá lớn: mong đợi ${i.origin??"giá trị"} ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Quá nhỏ: mong đợi ${i.origin} ${a.verb} ${o}${i.minimum.toString()} ${a.unit}`:`Quá nhỏ: mong đợi ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Chuỗi không hợp lệ: phải bắt đầu bằng "${o.prefix}"`:o.format==="ends_with"?`Chuỗi không hợp lệ: phải kết thúc bằng "${o.suffix}"`:o.format==="includes"?`Chuỗi không hợp lệ: phải bao gồm "${o.includes}"`:o.format==="regex"?`Chuỗi không hợp lệ: phải khớp với mẫu ${o.pattern}`:`${r[o.format]??i.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${i.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${Re(i.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${i.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${i.origin}`;default:return"Đầu vào không hợp lệ"}}};function Yme(){return{localeError:Zme()}}const Wme=()=>{const e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(i))return"数组";if(i===null)return"空值(null)";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return i=>{switch(i.code){case"invalid_type":return`无效输入:期望 ${i.expected},实际接收 ${n(i.input)}`;case"invalid_value":return i.values.length===1?`无效输入:期望 ${it(i.values[0])}`:`无效选项:期望以下之一 ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`数值过大:期望 ${i.origin??"值"} ${o}${i.maximum.toString()} ${a.unit??"个元素"}`:`数值过大:期望 ${i.origin??"值"} ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`数值过小:期望 ${i.origin} ${o}${i.minimum.toString()} ${a.unit}`:`数值过小:期望 ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`无效字符串:必须以 "${o.prefix}" 开头`:o.format==="ends_with"?`无效字符串:必须以 "${o.suffix}" 结尾`:o.format==="includes"?`无效字符串:必须包含 "${o.includes}"`:o.format==="regex"?`无效字符串:必须满足正则表达式 ${o.pattern}`:`无效${r[o.format]??i.format}`}case"not_multiple_of":return`无效数字:必须是 ${i.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${Re(i.keys,", ")}`;case"invalid_key":return`${i.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${i.origin} 中包含无效值(value)`;default:return"无效输入"}}};function Xme(){return{localeError:Wme()}}const Qme=()=>{const e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return i=>{switch(i.code){case"invalid_type":return`無效的輸入值:預期為 ${i.expected},但收到 ${n(i.input)}`;case"invalid_value":return i.values.length===1?`無效的輸入值:預期為 ${it(i.values[0])}`:`無效的選項:預期為以下其中之一 ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`數值過大:預期 ${i.origin??"值"} 應為 ${o}${i.maximum.toString()} ${a.unit??"個元素"}`:`數值過大:預期 ${i.origin??"值"} 應為 ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`數值過小:預期 ${i.origin} 應為 ${o}${i.minimum.toString()} ${a.unit}`:`數值過小:預期 ${i.origin} 應為 ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`無效的字串:必須以 "${o.prefix}" 開頭`:o.format==="ends_with"?`無效的字串:必須以 "${o.suffix}" 結尾`:o.format==="includes"?`無效的字串:必須包含 "${o.includes}"`:o.format==="regex"?`無效的字串:必須符合格式 ${o.pattern}`:`無效的 ${r[o.format]??i.format}`}case"not_multiple_of":return`無效的數字:必須為 ${i.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${i.keys.length>1?"們":""}:${Re(i.keys,"、")}`;case"invalid_key":return`${i.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${i.origin} 中有無效的值`;default:return"無效的輸入值"}}};function Jme(){return{localeError:Qme()}}const epe=()=>{const e={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"nọ́mbà";case"object":{if(Array.isArray(i))return"akopọ";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"};return i=>{switch(i.code){case"invalid_type":return`Ìbáwọlé aṣìṣe: a ní láti fi ${i.expected}, àmọ̀ a rí ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${it(i.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${Re(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Tó pọ̀ jù: a ní láti jẹ́ pé ${i.origin??"iye"} ${a.verb} ${o}${i.maximum} ${a.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${o}${i.maximum}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Kéré ju: a ní láti jẹ́ pé ${i.origin} ${a.verb} ${o}${i.minimum} ${a.unit}`:`Kéré ju: a ní láti jẹ́ ${o}${i.minimum}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${o.prefix}"`:o.format==="ends_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${o.suffix}"`:o.format==="includes"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${o.includes}"`:o.format==="regex"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${o.pattern}`:`Aṣìṣe: ${r[o.format]??i.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${i.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${Re(i.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${i.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${i.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function tpe(){return{localeError:epe()}}const X6=Object.freeze(Object.defineProperty({__proto__:null,ar:hfe,az:vfe,be:bfe,bg:Sfe,ca:Cfe,cs:kfe,da:Rfe,de:Nfe,en:Z6,eo:$fe,es:Pfe,fa:Lfe,fi:Ffe,fr:Bfe,frCA:qfe,he:Kfe,hu:Yfe,id:Xfe,is:eme,it:nme,ja:ime,ka:sme,kh:cme,km:Y6,ko:dme,lt:pme,mk:gme,ms:yme,nl:xme,no:Sme,ota:Cme,pl:Rme,ps:kme,pt:Nme,ru:Ame,sl:Dme,sv:Mme,ta:zme,th:Ume,tr:Bme,ua:qme,uk:W6,ur:Kme,vi:Yme,yo:tpe,zhCN:Xme,zhTW:Jme},Symbol.toStringTag,{value:"Module"})),Q6=Symbol("ZodOutput"),J6=Symbol("ZodInput");class uk{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];if(this._map.set(t,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const i={...r,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function dk(){return new uk}const Ql=dk();function e3(e,t){return new e({type:"string",...Ce(t)})}function t3(e,t){return new e({type:"string",coerce:!0,...Ce(t)})}function fk(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ce(t)})}function sy(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ce(t)})}function mk(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ce(t)})}function pk(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ce(t)})}function hk(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ce(t)})}function gk(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ce(t)})}function Lb(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ce(t)})}function vk(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ce(t)})}function yk(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ce(t)})}function bk(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ce(t)})}function xk(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ce(t)})}function wk(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ce(t)})}function Sk(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ce(t)})}function _k(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ce(t)})}function Ck(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ce(t)})}function Ek(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ce(t)})}function kk(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ce(t)})}function jk(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ce(t)})}function Rk(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ce(t)})}function Ik(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ce(t)})}function Nk(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ce(t)})}function Tk(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ce(t)})}const n3={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function r3(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ce(t)})}function i3(e,t){return new e({type:"string",format:"date",check:"string_format",...Ce(t)})}function o3(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ce(t)})}function a3(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ce(t)})}function s3(e,t){return new e({type:"number",checks:[],...Ce(t)})}function l3(e,t){return new e({type:"number",coerce:!0,checks:[],...Ce(t)})}function c3(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ce(t)})}function u3(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...Ce(t)})}function d3(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...Ce(t)})}function f3(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...Ce(t)})}function m3(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...Ce(t)})}function p3(e,t){return new e({type:"boolean",...Ce(t)})}function h3(e,t){return new e({type:"boolean",coerce:!0,...Ce(t)})}function g3(e,t){return new e({type:"bigint",...Ce(t)})}function v3(e,t){return new e({type:"bigint",coerce:!0,...Ce(t)})}function y3(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Ce(t)})}function b3(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Ce(t)})}function x3(e,t){return new e({type:"symbol",...Ce(t)})}function w3(e,t){return new e({type:"undefined",...Ce(t)})}function S3(e,t){return new e({type:"null",...Ce(t)})}function _3(e){return new e({type:"any"})}function C3(e){return new e({type:"unknown"})}function E3(e,t){return new e({type:"never",...Ce(t)})}function k3(e,t){return new e({type:"void",...Ce(t)})}function j3(e,t){return new e({type:"date",...Ce(t)})}function R3(e,t){return new e({type:"date",coerce:!0,...Ce(t)})}function I3(e,t){return new e({type:"nan",...Ce(t)})}function gc(e,t){return new tk({check:"less_than",...Ce(t),value:e,inclusive:!1})}function No(e,t){return new tk({check:"less_than",...Ce(t),value:e,inclusive:!0})}function vc(e,t){return new nk({check:"greater_than",...Ce(t),value:e,inclusive:!1})}function Ri(e,t){return new nk({check:"greater_than",...Ce(t),value:e,inclusive:!0})}function N3(e){return vc(0,e)}function T3(e){return gc(0,e)}function A3(e){return No(0,e)}function O3(e){return Ri(0,e)}function ip(e,t){return new vF({check:"multiple_of",...Ce(t),value:e})}function Ub(e,t){return new xF({check:"max_size",...Ce(t),maximum:e})}function op(e,t){return new wF({check:"min_size",...Ce(t),minimum:e})}function Ak(e,t){return new SF({check:"size_equals",...Ce(t),size:e})}function Fb(e,t){return new _F({check:"max_length",...Ce(t),maximum:e})}function kd(e,t){return new CF({check:"min_length",...Ce(t),minimum:e})}function Vb(e,t){return new EF({check:"length_equals",...Ce(t),length:e})}function Ok(e,t){return new kF({check:"string_format",format:"regex",...Ce(t),pattern:e})}function Dk(e){return new jF({check:"string_format",format:"lowercase",...Ce(e)})}function $k(e){return new RF({check:"string_format",format:"uppercase",...Ce(e)})}function Mk(e,t){return new IF({check:"string_format",format:"includes",...Ce(t),includes:e})}function Pk(e,t){return new NF({check:"string_format",format:"starts_with",...Ce(t),prefix:e})}function zk(e,t){return new TF({check:"string_format",format:"ends_with",...Ce(t),suffix:e})}function D3(e,t,n){return new AF({check:"property",property:e,schema:t,...Ce(n)})}function Lk(e,t){return new OF({check:"mime_type",mime:e,...Ce(t)})}function $c(e){return new DF({check:"overwrite",tx:e})}function Uk(e){return $c(t=>t.normalize(e))}function Fk(){return $c(e=>e.trim())}function Vk(){return $c(e=>e.toLowerCase())}function Bk(){return $c(e=>e.toUpperCase())}function $3(e,t,n){return new e({type:"array",element:t,...Ce(n)})}function npe(e,t,n){return new e({type:"union",options:t,...Ce(n)})}function rpe(e,t,n,r){return new e({type:"union",options:n,discriminator:t,...Ce(r)})}function ipe(e,t,n){return new e({type:"intersection",left:t,right:n})}function ope(e,t,n,r){const i=n instanceof ct,o=i?r:n,a=i?n:null;return new e({type:"tuple",items:t,rest:a,...Ce(o)})}function ape(e,t,n,r){return new e({type:"record",keyType:t,valueType:n,...Ce(r)})}function spe(e,t,n,r){return new e({type:"map",keyType:t,valueType:n,...Ce(r)})}function lpe(e,t,n){return new e({type:"set",valueType:t,...Ce(n)})}function cpe(e,t,n){const r=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new e({type:"enum",entries:r,...Ce(n)})}function upe(e,t,n){return new e({type:"enum",entries:t,...Ce(n)})}function dpe(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...Ce(n)})}function M3(e,t){return new e({type:"file",...Ce(t)})}function fpe(e,t){return new e({type:"transform",transform:t})}function mpe(e,t){return new e({type:"optional",innerType:t})}function ppe(e,t){return new e({type:"nullable",innerType:t})}function hpe(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():$b(n)}})}function gpe(e,t,n){return new e({type:"nonoptional",innerType:t,...Ce(n)})}function vpe(e,t){return new e({type:"success",innerType:t})}function ype(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:()=>n})}function bpe(e,t,n){return new e({type:"pipe",in:t,out:n})}function xpe(e,t){return new e({type:"readonly",innerType:t})}function wpe(e,t,n){return new e({type:"template_literal",parts:t,...Ce(n)})}function Spe(e,t){return new e({type:"lazy",getter:t})}function _pe(e,t){return new e({type:"promise",innerType:t})}function P3(e,t,n){const r=Ce(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function z3(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ce(n)})}function L3(e){const t=U3(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Cd(r,n.value,t._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(Cd(i))}},e(n.value,n)));return t}function U3(e,t){const n=new In({check:"custom",...Ce(t)});return n._zod.check=e,n}function F3(e,t){const n=Ce(t);let r=n.truthy??["true","1","yes","on","y","enabled"],i=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(r=r.map(y=>typeof y=="string"?y.toLowerCase():y),i=i.map(y=>typeof y=="string"?y.toLowerCase():y));const o=new Set(r),a=new Set(i),c=e.Codec??ck,d=e.Boolean??ok,f=e.String??Gp,p=new f({type:"string",error:n.error}),h=new d({type:"boolean",error:n.error}),v=new c({type:"pipe",in:p,out:h,transform:((y,b)=>{let S=y;return n.case!=="sensitive"&&(S=S.toLowerCase()),o.has(S)?!0:a.has(S)?!1:(b.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:b.value,inst:v,continue:!1}),{})}),reverseTransform:((y,b)=>y===!0?r[0]||"true":i[0]||"false"),error:n.error});return v}function Kp(e,t,n,r={}){const i=Ce(r),o={...Ce(r),check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:c=>n.test(c),...i};return n instanceof RegExp&&(o.pattern=n),new e(o)}class k1{constructor(t){this.counter=0,this.metadataRegistry=t?.metadata??Ql,this.target=t?.target??"draft-2020-12",this.unrepresentable=t?.unrepresentable??"throw",this.override=t?.override??(()=>{}),this.io=t?.io??"output",this.seen=new Map}process(t,n={path:[],schemaPath:[]}){var r;const i=t._zod.def,o={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},a=this.seen.get(t);if(a)return a.count++,n.schemaPath.includes(t)&&(a.cycle=n.path),a.schema;const c={schema:{},count:1,cycle:void 0,path:n.path};this.seen.set(t,c);const d=t._zod.toJSONSchema?.();if(d)c.schema=d;else{const h={...n,schemaPath:[...n.schemaPath,t],path:n.path},v=t._zod.parent;if(v)c.ref=v,this.process(v,h),this.seen.get(v).isParent=!0;else{const y=c.schema;switch(i.type){case"string":{const b=y;b.type="string";const{minimum:S,maximum:C,format:E,patterns:k,contentEncoding:j}=t._zod.bag;if(typeof S=="number"&&(b.minLength=S),typeof C=="number"&&(b.maxLength=C),E&&(b.format=o[E]??E,b.format===""&&delete b.format),j&&(b.contentEncoding=j),k&&k.size>0){const I=[...k];I.length===1?b.pattern=I[0].source:I.length>1&&(c.schema.allOf=[...I.map(A=>({...this.target==="draft-7"||this.target==="draft-4"||this.target==="openapi-3.0"?{type:"string"}:{},pattern:A.source}))])}break}case"number":{const b=y,{minimum:S,maximum:C,format:E,multipleOf:k,exclusiveMaximum:j,exclusiveMinimum:I}=t._zod.bag;typeof E=="string"&&E.includes("int")?b.type="integer":b.type="number",typeof I=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(b.minimum=I,b.exclusiveMinimum=!0):b.exclusiveMinimum=I),typeof S=="number"&&(b.minimum=S,typeof I=="number"&&this.target!=="draft-4"&&(I>=S?delete b.minimum:delete b.exclusiveMinimum)),typeof j=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(b.maximum=j,b.exclusiveMaximum=!0):b.exclusiveMaximum=j),typeof C=="number"&&(b.maximum=C,typeof j=="number"&&this.target!=="draft-4"&&(j<=C?delete b.maximum:delete b.exclusiveMaximum)),typeof k=="number"&&(b.multipleOf=k);break}case"boolean":{const b=y;b.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{this.target==="openapi-3.0"?(y.type="string",y.nullable=!0,y.enum=[null]):y.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{y.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{const b=y,{minimum:S,maximum:C}=t._zod.bag;typeof S=="number"&&(b.minItems=S),typeof C=="number"&&(b.maxItems=C),b.type="array",b.items=this.process(i.element,{...h,path:[...h.path,"items"]});break}case"object":{const b=y;b.type="object",b.properties={};const S=i.shape;for(const k in S)b.properties[k]=this.process(S[k],{...h,path:[...h.path,"properties",k]});const C=new Set(Object.keys(S)),E=new Set([...C].filter(k=>{const j=i.shape[k]._zod;return this.io==="input"?j.optin===void 0:j.optout===void 0}));E.size>0&&(b.required=Array.from(E)),i.catchall?._zod.def.type==="never"?b.additionalProperties=!1:i.catchall?i.catchall&&(b.additionalProperties=this.process(i.catchall,{...h,path:[...h.path,"additionalProperties"]})):this.io==="output"&&(b.additionalProperties=!1);break}case"union":{const b=y,S=i.options.map((C,E)=>this.process(C,{...h,path:[...h.path,"anyOf",E]}));b.anyOf=S;break}case"intersection":{const b=y,S=this.process(i.left,{...h,path:[...h.path,"allOf",0]}),C=this.process(i.right,{...h,path:[...h.path,"allOf",1]}),E=j=>"allOf"in j&&Object.keys(j).length===1,k=[...E(S)?S.allOf:[S],...E(C)?C.allOf:[C]];b.allOf=k;break}case"tuple":{const b=y;b.type="array";const S=this.target==="draft-2020-12"?"prefixItems":"items",C=this.target==="draft-2020-12"||this.target==="openapi-3.0"?"items":"additionalItems",E=i.items.map((A,N)=>this.process(A,{...h,path:[...h.path,S,N]})),k=i.rest?this.process(i.rest,{...h,path:[...h.path,C,...this.target==="openapi-3.0"?[i.items.length]:[]]}):null;this.target==="draft-2020-12"?(b.prefixItems=E,k&&(b.items=k)):this.target==="openapi-3.0"?(b.items={anyOf:E},k&&b.items.anyOf.push(k),b.minItems=E.length,k||(b.maxItems=E.length)):(b.items=E,k&&(b.additionalItems=k));const{minimum:j,maximum:I}=t._zod.bag;typeof j=="number"&&(b.minItems=j),typeof I=="number"&&(b.maxItems=I);break}case"record":{const b=y;b.type="object",(this.target==="draft-7"||this.target==="draft-2020-12")&&(b.propertyNames=this.process(i.keyType,{...h,path:[...h.path,"propertyNames"]})),b.additionalProperties=this.process(i.valueType,{...h,path:[...h.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{const b=y,S=UE(i.entries);S.every(C=>typeof C=="number")&&(b.type="number"),S.every(C=>typeof C=="string")&&(b.type="string"),b.enum=S;break}case"literal":{const b=y,S=[];for(const C of i.values)if(C===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof C=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");S.push(Number(C))}else S.push(C);if(S.length!==0)if(S.length===1){const C=S[0];b.type=C===null?"null":typeof C,this.target==="draft-4"||this.target==="openapi-3.0"?b.enum=[C]:b.const=C}else S.every(C=>typeof C=="number")&&(b.type="number"),S.every(C=>typeof C=="string")&&(b.type="string"),S.every(C=>typeof C=="boolean")&&(b.type="string"),S.every(C=>C===null)&&(b.type="null"),b.enum=S;break}case"file":{const b=y,S={type:"string",format:"binary",contentEncoding:"binary"},{minimum:C,maximum:E,mime:k}=t._zod.bag;C!==void 0&&(S.minLength=C),E!==void 0&&(S.maxLength=E),k?k.length===1?(S.contentMediaType=k[0],Object.assign(b,S)):b.anyOf=k.map(j=>({...S,contentMediaType:j})):Object.assign(b,S);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{const b=this.process(i.innerType,h);this.target==="openapi-3.0"?(c.ref=i.innerType,y.nullable=!0):y.anyOf=[b,{type:"null"}];break}case"nonoptional":{this.process(i.innerType,h),c.ref=i.innerType;break}case"success":{const b=y;b.type="boolean";break}case"default":{this.process(i.innerType,h),c.ref=i.innerType,y.default=JSON.parse(JSON.stringify(i.defaultValue));break}case"prefault":{this.process(i.innerType,h),c.ref=i.innerType,this.io==="input"&&(y._prefault=JSON.parse(JSON.stringify(i.defaultValue)));break}case"catch":{this.process(i.innerType,h),c.ref=i.innerType;let b;try{b=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}y.default=b;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{const b=y,S=t._zod.pattern;if(!S)throw new Error("Pattern not found in template literal");b.type="string",b.pattern=S.source;break}case"pipe":{const b=this.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;this.process(b,h),c.ref=b;break}case"readonly":{this.process(i.innerType,h),c.ref=i.innerType,y.readOnly=!0;break}case"promise":{this.process(i.innerType,h),c.ref=i.innerType;break}case"optional":{this.process(i.innerType,h),c.ref=i.innerType;break}case"lazy":{const b=t._zod.innerType;this.process(b,h),c.ref=b;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}case"function":{if(this.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema");break}}}}const f=this.metadataRegistry.get(t);return f&&Object.assign(c.schema,f),this.io==="input"&&Jn(t)&&(delete c.schema.examples,delete c.schema.default),this.io==="input"&&c.schema._prefault&&((r=c.schema).default??(r.default=c.schema._prefault)),delete c.schema._prefault,this.seen.get(t).schema}emit(t,n){const r={cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0},i=this.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=p=>{const h=this.target==="draft-2020-12"?"$defs":"definitions";if(r.external){const S=r.external.registry.get(p[0])?.id,C=r.external.uri??(k=>k);if(S)return{ref:C(S)};const E=p[1].defId??p[1].schema.id??`schema${this.counter++}`;return p[1].defId=E,{defId:E,ref:`${C("__shared")}#/${h}/${E}`}}if(p[1]===i)return{ref:"#"};const y=`#/${h}/`,b=p[1].schema.id??`__schema${this.counter++}`;return{defId:b,ref:y+b}},a=p=>{if(p[1].schema.$ref)return;const h=p[1],{ref:v,defId:y}=o(p);h.def={...h.schema},y&&(h.defId=y);const b=h.schema;for(const S in b)delete b[S];b.$ref=v};if(r.cycles==="throw")for(const p of this.seen.entries()){const h=p[1];if(h.cycle)throw new Error(`Cycle detected: #/${h.cycle?.join("/")}/<root>
|
|
67
|
-
|
|
68
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const p of this.seen.entries()){const h=p[1];if(t===p[0]){a(p);continue}if(r.external){const y=r.external.registry.get(p[0])?.id;if(t!==p[0]&&y){a(p);continue}}if(this.metadataRegistry.get(p[0])?.id){a(p);continue}if(h.cycle){a(p);continue}if(h.count>1&&r.reused==="ref"){a(p);continue}}const c=(p,h)=>{const v=this.seen.get(p),y=v.def??v.schema,b={...y};if(v.ref===null)return;const S=v.ref;if(v.ref=null,S){c(S,h);const C=this.seen.get(S).schema;C.$ref&&(h.target==="draft-7"||h.target==="draft-4"||h.target==="openapi-3.0")?(y.allOf=y.allOf??[],y.allOf.push(C)):(Object.assign(y,C),Object.assign(y,b))}v.isParent||this.override({zodSchema:p,jsonSchema:y,path:v.path??[]})};for(const p of[...this.seen.entries()].reverse())c(p[0],{target:this.target});const d={};if(this.target==="draft-2020-12"?d.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?d.$schema="http://json-schema.org/draft-07/schema#":this.target==="draft-4"?d.$schema="http://json-schema.org/draft-04/schema#":this.target==="openapi-3.0"||console.warn(`Invalid target: ${this.target}`),r.external?.uri){const p=r.external.registry.get(t)?.id;if(!p)throw new Error("Schema is missing an `id` property");d.$id=r.external.uri(p)}Object.assign(d,i.def);const f=r.external?.defs??{};for(const p of this.seen.entries()){const h=p[1];h.def&&h.defId&&(f[h.defId]=h.def)}r.external||Object.keys(f).length>0&&(this.target==="draft-2020-12"?d.$defs=f:d.definitions=f);try{return JSON.parse(JSON.stringify(d))}catch{throw new Error("Error converting schema to JSON.")}}}function V3(e,t){if(e instanceof uk){const r=new k1(t),i={};for(const c of e._idmap.entries()){const[d,f]=c;r.process(f)}const o={},a={registry:e,uri:t?.uri,defs:i};for(const c of e._idmap.entries()){const[d,f]=c;o[d]=r.emit(f,{...t,external:a})}if(Object.keys(i).length>0){const c=r.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[c]:i}}return{schemas:o}}const n=new k1(t);return n.process(e),n.emit(e,t)}function Jn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const i=e._zod.def;switch(i.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Jn(i.element,n);case"object":{for(const o in i.shape)if(Jn(i.shape[o],n))return!0;return!1}case"union":{for(const o of i.options)if(Jn(o,n))return!0;return!1}case"intersection":return Jn(i.left,n)||Jn(i.right,n);case"tuple":{for(const o of i.items)if(Jn(o,n))return!0;return!!(i.rest&&Jn(i.rest,n))}case"record":return Jn(i.keyType,n)||Jn(i.valueType,n);case"map":return Jn(i.keyType,n)||Jn(i.valueType,n);case"set":return Jn(i.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Jn(i.innerType,n);case"lazy":return Jn(i.getter(),n);case"default":return Jn(i.innerType,n);case"prefault":return Jn(i.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return Jn(i.in,n)||Jn(i.out,n);case"success":return!1;case"catch":return!1;case"function":return!1}throw new Error(`Unknown schema type: ${i.type}`)}const Cpe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Epe=Object.freeze(Object.defineProperty({__proto__:null,$ZodAny:p6,$ZodArray:b6,$ZodAsyncError:ac,$ZodBase64:n6,$ZodBase64URL:i6,$ZodBigInt:ak,$ZodBigIntFormat:u6,$ZodBoolean:ok,$ZodCIDRv4:e6,$ZodCIDRv6:t6,$ZodCUID:BF,$ZodCUID2:HF,$ZodCatch:L6,$ZodCheck:In,$ZodCheckBigIntFormat:bF,$ZodCheckEndsWith:TF,$ZodCheckGreaterThan:nk,$ZodCheckIncludes:IF,$ZodCheckLengthEquals:EF,$ZodCheckLessThan:tk,$ZodCheckLowerCase:jF,$ZodCheckMaxLength:_F,$ZodCheckMaxSize:xF,$ZodCheckMimeType:OF,$ZodCheckMinLength:CF,$ZodCheckMinSize:wF,$ZodCheckMultipleOf:vF,$ZodCheckNumberFormat:yF,$ZodCheckOverwrite:DF,$ZodCheckProperty:AF,$ZodCheckRegex:kF,$ZodCheckSizeEquals:SF,$ZodCheckStartsWith:NF,$ZodCheckStringFormat:qp,$ZodCheckUpperCase:RF,$ZodCodec:ck,$ZodCustom:K6,$ZodCustomStringFormat:l6,$ZodDate:y6,$ZodDefault:$6,$ZodDiscriminatedUnion:C6,$ZodE164:o6,$ZodEmail:LF,$ZodEmoji:FF,$ZodEncodeError:Ob,$ZodEnum:I6,$ZodError:zb,$ZodFile:T6,$ZodFunction:H6,$ZodGUID:PF,$ZodIPv4:QF,$ZodIPv6:JF,$ZodISODate:YF,$ZodISODateTime:ZF,$ZodISODuration:XF,$ZodISOTime:WF,$ZodIntersection:E6,$ZodJWT:s6,$ZodKSUID:KF,$ZodLazy:G6,$ZodLiteral:N6,$ZodMap:j6,$ZodNaN:U6,$ZodNanoID:VF,$ZodNever:g6,$ZodNonOptional:P6,$ZodNull:m6,$ZodNullable:D6,$ZodNumber:ik,$ZodNumberFormat:c6,$ZodObject:S6,$ZodObjectJIT:_6,$ZodOptional:O6,$ZodPipe:F6,$ZodPrefault:M6,$ZodPromise:q6,$ZodReadonly:V6,$ZodRealError:zi,$ZodRecord:k6,$ZodRegistry:uk,$ZodSet:R6,$ZodString:Gp,$ZodStringFormat:sn,$ZodSuccess:z6,$ZodSymbol:d6,$ZodTemplateLiteral:B6,$ZodTransform:A6,$ZodTuple:lk,$ZodType:ct,$ZodULID:qF,$ZodURL:UF,$ZodUUID:zF,$ZodUndefined:f6,$ZodUnion:sk,$ZodUnknown:h6,$ZodVoid:v6,$ZodXID:GF,$brand:pU,$constructor:ae,$input:J6,$output:Q6,Doc:$F,JSONSchema:Cpe,JSONSchemaGenerator:k1,NEVER:mU,TimePrecision:n3,_any:_3,_array:$3,_base64:Rk,_base64url:Ik,_bigint:g3,_boolean:p3,_catch:ype,_check:U3,_cidrv4:kk,_cidrv6:jk,_coercedBigint:v3,_coercedBoolean:h3,_coercedDate:R3,_coercedNumber:l3,_coercedString:t3,_cuid:bk,_cuid2:xk,_custom:P3,_date:j3,_decode:qE,_decodeAsync:KE,_default:hpe,_discriminatedUnion:rpe,_e164:Nk,_email:fk,_emoji:vk,_encode:HE,_encodeAsync:GE,_endsWith:zk,_enum:cpe,_file:M3,_float32:u3,_float64:d3,_gt:vc,_gte:Ri,_guid:sy,_includes:Mk,_int:c3,_int32:f3,_int64:y3,_intersection:ipe,_ipv4:Ck,_ipv6:Ek,_isoDate:i3,_isoDateTime:r3,_isoDuration:a3,_isoTime:o3,_jwt:Tk,_ksuid:_k,_lazy:Spe,_length:Vb,_literal:dpe,_lowercase:Dk,_lt:gc,_lte:No,_map:spe,_max:No,_maxLength:Fb,_maxSize:Ub,_mime:Lk,_min:Ri,_minLength:kd,_minSize:op,_multipleOf:ip,_nan:I3,_nanoid:yk,_nativeEnum:upe,_negative:T3,_never:E3,_nonnegative:O3,_nonoptional:gpe,_nonpositive:A3,_normalize:Uk,_null:S3,_nullable:ppe,_number:s3,_optional:mpe,_overwrite:$c,_parse:Lp,_parseAsync:Up,_pipe:bpe,_positive:N3,_promise:_pe,_property:D3,_readonly:xpe,_record:ape,_refine:z3,_regex:Ok,_safeDecode:YE,_safeDecodeAsync:XE,_safeEncode:ZE,_safeEncodeAsync:WE,_safeParse:Fp,_safeParseAsync:Vp,_set:lpe,_size:Ak,_startsWith:Pk,_string:e3,_stringFormat:Kp,_stringbool:F3,_success:vpe,_superRefine:L3,_symbol:x3,_templateLiteral:wpe,_toLowerCase:Vk,_toUpperCase:Bk,_transform:fpe,_trim:Fk,_tuple:ope,_uint32:m3,_uint64:b3,_ulid:wk,_undefined:w3,_union:npe,_unknown:C3,_uppercase:$k,_url:Lb,_uuid:mk,_uuidv4:pk,_uuidv6:hk,_uuidv7:gk,_void:k3,_xid:Sk,clone:yo,config:Ur,decode:Pde,decodeAsync:Lde,encode:Mde,encodeAsync:zde,flattenError:VE,formatError:BE,globalConfig:ty,globalRegistry:Ql,isValidBase64:rk,isValidBase64URL:r6,isValidJWT:a6,locales:X6,parse:iy,parseAsync:oy,prettifyError:DU,regexes:ek,registry:dk,safeDecode:Fde,safeDecodeAsync:Bde,safeEncode:Ude,safeEncodeAsync:Vde,safeParse:$U,safeParseAsync:MU,toDotPath:OU,toJSONSchema:V3,treeifyError:AU,util:NU,version:MF},Symbol.toStringTag,{value:"Module"})),Hk=ae("ZodISODateTime",(e,t)=>{ZF.init(e,t),hn.init(e,t)});function B3(e){return r3(Hk,e)}const qk=ae("ZodISODate",(e,t)=>{YF.init(e,t),hn.init(e,t)});function H3(e){return i3(qk,e)}const Gk=ae("ZodISOTime",(e,t)=>{WF.init(e,t),hn.init(e,t)});function q3(e){return o3(Gk,e)}const Kk=ae("ZodISODuration",(e,t)=>{XF.init(e,t),hn.init(e,t)});function G3(e){return a3(Kk,e)}const kpe=Object.freeze(Object.defineProperty({__proto__:null,ZodISODate:qk,ZodISODateTime:Hk,ZodISODuration:Kk,ZodISOTime:Gk,date:H3,datetime:B3,duration:G3,time:q3},Symbol.toStringTag,{value:"Module"})),K3=(e,t)=>{zb.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>BE(e,n)},flatten:{value:n=>VE(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,ny,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,ny,2)}},isEmpty:{get(){return e.issues.length===0}}})},jpe=ae("ZodError",K3),Li=ae("ZodError",K3,{Parent:Error}),Z3=Lp(Li),Y3=Up(Li),W3=Fp(Li),X3=Vp(Li),Q3=HE(Li),J3=qE(Li),e5=GE(Li),t5=KE(Li),n5=ZE(Li),r5=YE(Li),i5=WE(Li),o5=XE(Li),xt=ae("ZodType",(e,t)=>(ct.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(ns(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]})),e.clone=(n,r)=>yo(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>Z3(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>W3(e,n,r),e.parseAsync=async(n,r)=>Y3(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>X3(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>Q3(e,n,r),e.decode=(n,r)=>J3(e,n,r),e.encodeAsync=async(n,r)=>e5(e,n,r),e.decodeAsync=async(n,r)=>t5(e,n,r),e.safeEncode=(n,r)=>n5(e,n,r),e.safeDecode=(n,r)=>r5(e,n,r),e.safeEncodeAsync=async(n,r)=>i5(e,n,r),e.safeDecodeAsync=async(n,r)=>o5(e,n,r),e.refine=(n,r)=>e.check(H5(n,r)),e.superRefine=n=>e.check(q5(n)),e.overwrite=n=>e.check($c(n)),e.optional=()=>uy(e),e.nullable=()=>dy(e),e.nullish=()=>uy(dy(e)),e.nonoptional=n=>A5(e,n),e.array=()=>Id(e),e.or=n=>gj([e,n]),e.and=n=>b5(e,n),e.transform=n=>fy(e,bj(n)),e.default=n=>I5(e,n),e.prefault=n=>T5(e,n),e.catch=n=>$5(e,n),e.pipe=n=>fy(e,n),e.readonly=()=>z5(e),e.describe=n=>{const r=e.clone();return Ql.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Ql.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Ql.get(e);const r=e.clone();return Ql.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Zk=ae("_ZodString",(e,t)=>{Gp.init(e,t),xt.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(Ok(...r)),e.includes=(...r)=>e.check(Mk(...r)),e.startsWith=(...r)=>e.check(Pk(...r)),e.endsWith=(...r)=>e.check(zk(...r)),e.min=(...r)=>e.check(kd(...r)),e.max=(...r)=>e.check(Fb(...r)),e.length=(...r)=>e.check(Vb(...r)),e.nonempty=(...r)=>e.check(kd(1,...r)),e.lowercase=r=>e.check(Dk(r)),e.uppercase=r=>e.check($k(r)),e.trim=()=>e.check(Fk()),e.normalize=(...r)=>e.check(Uk(...r)),e.toLowerCase=()=>e.check(Vk()),e.toUpperCase=()=>e.check(Bk())}),Bb=ae("ZodString",(e,t)=>{Gp.init(e,t),Zk.init(e,t),e.email=n=>e.check(fk(Yk,n)),e.url=n=>e.check(Lb(Hb,n)),e.jwt=n=>e.check(Tk(uj,n)),e.emoji=n=>e.check(vk(Wk,n)),e.guid=n=>e.check(sy(ly,n)),e.uuid=n=>e.check(mk(Fa,n)),e.uuidv4=n=>e.check(pk(Fa,n)),e.uuidv6=n=>e.check(hk(Fa,n)),e.uuidv7=n=>e.check(gk(Fa,n)),e.nanoid=n=>e.check(yk(Xk,n)),e.guid=n=>e.check(sy(ly,n)),e.cuid=n=>e.check(bk(Qk,n)),e.cuid2=n=>e.check(xk(Jk,n)),e.ulid=n=>e.check(wk(ej,n)),e.base64=n=>e.check(Rk(sj,n)),e.base64url=n=>e.check(Ik(lj,n)),e.xid=n=>e.check(Sk(tj,n)),e.ksuid=n=>e.check(_k(nj,n)),e.ipv4=n=>e.check(Ck(rj,n)),e.ipv6=n=>e.check(Ek(ij,n)),e.cidrv4=n=>e.check(kk(oj,n)),e.cidrv6=n=>e.check(jk(aj,n)),e.e164=n=>e.check(Nk(cj,n)),e.datetime=n=>e.check(B3(n)),e.date=n=>e.check(H3(n)),e.time=n=>e.check(q3(n)),e.duration=n=>e.check(G3(n))});function nt(e){return e3(Bb,e)}const hn=ae("ZodStringFormat",(e,t)=>{sn.init(e,t),Zk.init(e,t)}),Yk=ae("ZodEmail",(e,t)=>{LF.init(e,t),hn.init(e,t)});function a5(e){return fk(Yk,e)}const ly=ae("ZodGUID",(e,t)=>{PF.init(e,t),hn.init(e,t)});function Rpe(e){return sy(ly,e)}const Fa=ae("ZodUUID",(e,t)=>{zF.init(e,t),hn.init(e,t)});function Ipe(e){return mk(Fa,e)}function Npe(e){return pk(Fa,e)}function Tpe(e){return hk(Fa,e)}function Ape(e){return gk(Fa,e)}const Hb=ae("ZodURL",(e,t)=>{UF.init(e,t),hn.init(e,t)});function Ope(e){return Lb(Hb,e)}function Dpe(e){return Lb(Hb,{protocol:/^https?$/,hostname:JU,...Ce(e)})}const Wk=ae("ZodEmoji",(e,t)=>{FF.init(e,t),hn.init(e,t)});function $pe(e){return vk(Wk,e)}const Xk=ae("ZodNanoID",(e,t)=>{VF.init(e,t),hn.init(e,t)});function Mpe(e){return yk(Xk,e)}const Qk=ae("ZodCUID",(e,t)=>{BF.init(e,t),hn.init(e,t)});function Ppe(e){return bk(Qk,e)}const Jk=ae("ZodCUID2",(e,t)=>{HF.init(e,t),hn.init(e,t)});function zpe(e){return xk(Jk,e)}const ej=ae("ZodULID",(e,t)=>{qF.init(e,t),hn.init(e,t)});function Lpe(e){return wk(ej,e)}const tj=ae("ZodXID",(e,t)=>{GF.init(e,t),hn.init(e,t)});function Upe(e){return Sk(tj,e)}const nj=ae("ZodKSUID",(e,t)=>{KF.init(e,t),hn.init(e,t)});function Fpe(e){return _k(nj,e)}const rj=ae("ZodIPv4",(e,t)=>{QF.init(e,t),hn.init(e,t)});function Vpe(e){return Ck(rj,e)}const ij=ae("ZodIPv6",(e,t)=>{JF.init(e,t),hn.init(e,t)});function Bpe(e){return Ek(ij,e)}const oj=ae("ZodCIDRv4",(e,t)=>{e6.init(e,t),hn.init(e,t)});function Hpe(e){return kk(oj,e)}const aj=ae("ZodCIDRv6",(e,t)=>{t6.init(e,t),hn.init(e,t)});function qpe(e){return jk(aj,e)}const sj=ae("ZodBase64",(e,t)=>{n6.init(e,t),hn.init(e,t)});function Gpe(e){return Rk(sj,e)}const lj=ae("ZodBase64URL",(e,t)=>{i6.init(e,t),hn.init(e,t)});function Kpe(e){return Ik(lj,e)}const cj=ae("ZodE164",(e,t)=>{o6.init(e,t),hn.init(e,t)});function Zpe(e){return Nk(cj,e)}const uj=ae("ZodJWT",(e,t)=>{s6.init(e,t),hn.init(e,t)});function Ype(e){return Tk(uj,e)}const Zp=ae("ZodCustomStringFormat",(e,t)=>{l6.init(e,t),hn.init(e,t)});function Wpe(e,t,n={}){return Kp(Zp,e,t,n)}function Xpe(e){return Kp(Zp,"hostname",JE,e)}function Qpe(e){return Kp(Zp,"hex",hF,e)}function Jpe(e,t){const n=t?.enc??"hex",r=`${e}_${n}`,i=ek[r];if(!i)throw new Error(`Unrecognized hash format: ${r}`);return Kp(Zp,r,i,t)}const qb=ae("ZodNumber",(e,t)=>{ik.init(e,t),xt.init(e,t),e.gt=(r,i)=>e.check(vc(r,i)),e.gte=(r,i)=>e.check(Ri(r,i)),e.min=(r,i)=>e.check(Ri(r,i)),e.lt=(r,i)=>e.check(gc(r,i)),e.lte=(r,i)=>e.check(No(r,i)),e.max=(r,i)=>e.check(No(r,i)),e.int=r=>e.check(j1(r)),e.safe=r=>e.check(j1(r)),e.positive=r=>e.check(vc(0,r)),e.nonnegative=r=>e.check(Ri(0,r)),e.negative=r=>e.check(gc(0,r)),e.nonpositive=r=>e.check(No(0,r)),e.multipleOf=(r,i)=>e.check(ip(r,i)),e.step=(r,i)=>e.check(ip(r,i)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function dj(e){return s3(qb,e)}const Jd=ae("ZodNumberFormat",(e,t)=>{c6.init(e,t),qb.init(e,t)});function j1(e){return c3(Jd,e)}function ehe(e){return u3(Jd,e)}function the(e){return d3(Jd,e)}function nhe(e){return f3(Jd,e)}function rhe(e){return m3(Jd,e)}const Gb=ae("ZodBoolean",(e,t)=>{ok.init(e,t),xt.init(e,t)});function jd(e){return p3(Gb,e)}const Kb=ae("ZodBigInt",(e,t)=>{ak.init(e,t),xt.init(e,t),e.gte=(r,i)=>e.check(Ri(r,i)),e.min=(r,i)=>e.check(Ri(r,i)),e.gt=(r,i)=>e.check(vc(r,i)),e.gte=(r,i)=>e.check(Ri(r,i)),e.min=(r,i)=>e.check(Ri(r,i)),e.lt=(r,i)=>e.check(gc(r,i)),e.lte=(r,i)=>e.check(No(r,i)),e.max=(r,i)=>e.check(No(r,i)),e.positive=r=>e.check(vc(BigInt(0),r)),e.negative=r=>e.check(gc(BigInt(0),r)),e.nonpositive=r=>e.check(No(BigInt(0),r)),e.nonnegative=r=>e.check(Ri(BigInt(0),r)),e.multipleOf=(r,i)=>e.check(ip(r,i));const n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function ihe(e){return g3(Kb,e)}const fj=ae("ZodBigIntFormat",(e,t)=>{u6.init(e,t),Kb.init(e,t)});function ohe(e){return y3(fj,e)}function ahe(e){return b3(fj,e)}const s5=ae("ZodSymbol",(e,t)=>{d6.init(e,t),xt.init(e,t)});function she(e){return x3(s5,e)}const l5=ae("ZodUndefined",(e,t)=>{f6.init(e,t),xt.init(e,t)});function cy(e){return w3(l5,e)}const c5=ae("ZodNull",(e,t)=>{m6.init(e,t),xt.init(e,t)});function u5(e){return S3(c5,e)}const d5=ae("ZodAny",(e,t)=>{p6.init(e,t),xt.init(e,t)});function lhe(){return _3(d5)}const f5=ae("ZodUnknown",(e,t)=>{h6.init(e,t),xt.init(e,t)});function Rd(){return C3(f5)}const m5=ae("ZodNever",(e,t)=>{g6.init(e,t),xt.init(e,t)});function mj(e){return E3(m5,e)}const p5=ae("ZodVoid",(e,t)=>{v6.init(e,t),xt.init(e,t)});function che(e){return k3(p5,e)}const pj=ae("ZodDate",(e,t)=>{y6.init(e,t),xt.init(e,t),e.min=(r,i)=>e.check(Ri(r,i)),e.max=(r,i)=>e.check(No(r,i));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function uhe(e){return j3(pj,e)}const h5=ae("ZodArray",(e,t)=>{b6.init(e,t),xt.init(e,t),e.element=t.element,e.min=(n,r)=>e.check(kd(n,r)),e.nonempty=n=>e.check(kd(1,n)),e.max=(n,r)=>e.check(Fb(n,r)),e.length=(n,r)=>e.check(Vb(n,r)),e.unwrap=()=>e.element});function Id(e,t){return $3(h5,e,t)}function dhe(e){const t=e._zod.def.shape;return ef(Object.keys(t))}const Zb=ae("ZodObject",(e,t)=>{_6.init(e,t),xt.init(e,t),jt(e,"shape",()=>t.shape),e.keyof=()=>ef(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Rd()}),e.loose=()=>e.clone({...e._zod.def,catchall:Rd()}),e.strict=()=>e.clone({...e._zod.def,catchall:mj()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>_U(e,n),e.safeExtend=n=>CU(e,n),e.merge=n=>EU(e,n),e.pick=n=>wU(e,n),e.omit=n=>SU(e,n),e.partial=(...n)=>kU(xj,e,n[0]),e.required=(...n)=>jU(wj,e,n[0])});function mn(e,t){const n={type:"object",shape:e??{},...Ce(t)};return new Zb(n)}function fhe(e,t){return new Zb({type:"object",shape:e,catchall:mj(),...Ce(t)})}function mhe(e,t){return new Zb({type:"object",shape:e,catchall:Rd(),...Ce(t)})}const hj=ae("ZodUnion",(e,t)=>{sk.init(e,t),xt.init(e,t),e.options=t.options});function gj(e,t){return new hj({type:"union",options:e,...Ce(t)})}const g5=ae("ZodDiscriminatedUnion",(e,t)=>{hj.init(e,t),C6.init(e,t)});function v5(e,t,n){return new g5({type:"union",options:t,discriminator:e,...Ce(n)})}const y5=ae("ZodIntersection",(e,t)=>{E6.init(e,t),xt.init(e,t)});function b5(e,t){return new y5({type:"intersection",left:e,right:t})}const x5=ae("ZodTuple",(e,t)=>{lk.init(e,t),xt.init(e,t),e.rest=n=>e.clone({...e._zod.def,rest:n})});function w5(e,t,n){const r=t instanceof ct,i=r?n:t,o=r?t:null;return new x5({type:"tuple",items:e,rest:o,...Ce(i)})}const vj=ae("ZodRecord",(e,t)=>{k6.init(e,t),xt.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function yj(e,t,n){return new vj({type:"record",keyType:e,valueType:t,...Ce(n)})}function phe(e,t,n){const r=yo(e);return r._zod.values=void 0,new vj({type:"record",keyType:r,valueType:t,...Ce(n)})}const S5=ae("ZodMap",(e,t)=>{j6.init(e,t),xt.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function hhe(e,t,n){return new S5({type:"map",keyType:e,valueType:t,...Ce(n)})}const _5=ae("ZodSet",(e,t)=>{R6.init(e,t),xt.init(e,t),e.min=(...n)=>e.check(op(...n)),e.nonempty=n=>e.check(op(1,n)),e.max=(...n)=>e.check(Ub(...n)),e.size=(...n)=>e.check(Ak(...n))});function ghe(e,t){return new _5({type:"set",valueType:e,...Ce(t)})}const ap=ae("ZodEnum",(e,t)=>{I6.init(e,t),xt.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const o={};for(const a of r)if(n.has(a))o[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new ap({...t,checks:[],...Ce(i),entries:o})},e.exclude=(r,i)=>{const o={...t.entries};for(const a of r)if(n.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new ap({...t,checks:[],...Ce(i),entries:o})}});function ef(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new ap({type:"enum",entries:n,...Ce(t)})}function vhe(e,t){return new ap({type:"enum",entries:e,...Ce(t)})}const C5=ae("ZodLiteral",(e,t)=>{N6.init(e,t),xt.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Yb(e,t){return new C5({type:"literal",values:Array.isArray(e)?e:[e],...Ce(t)})}const E5=ae("ZodFile",(e,t)=>{T6.init(e,t),xt.init(e,t),e.min=(n,r)=>e.check(op(n,r)),e.max=(n,r)=>e.check(Ub(n,r)),e.mime=(n,r)=>e.check(Lk(Array.isArray(n)?n:[n],r))});function yhe(e){return M3(E5,e)}const k5=ae("ZodTransform",(e,t)=>{A6.init(e,t),xt.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Ob(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(Cd(o,n.value,t));else{const a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=e),n.issues.push(Cd(a))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(o=>(n.value=o,n)):(n.value=i,n)}});function bj(e){return new k5({type:"transform",transform:e})}const xj=ae("ZodOptional",(e,t)=>{O6.init(e,t),xt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function uy(e){return new xj({type:"optional",innerType:e})}const j5=ae("ZodNullable",(e,t)=>{D6.init(e,t),xt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function dy(e){return new j5({type:"nullable",innerType:e})}function bhe(e){return uy(dy(e))}const R5=ae("ZodDefault",(e,t)=>{$6.init(e,t),xt.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function I5(e,t){return new R5({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():$b(t)}})}const N5=ae("ZodPrefault",(e,t)=>{M6.init(e,t),xt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function T5(e,t){return new N5({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():$b(t)}})}const wj=ae("ZodNonOptional",(e,t)=>{P6.init(e,t),xt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function A5(e,t){return new wj({type:"nonoptional",innerType:e,...Ce(t)})}const O5=ae("ZodSuccess",(e,t)=>{z6.init(e,t),xt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function xhe(e){return new O5({type:"success",innerType:e})}const D5=ae("ZodCatch",(e,t)=>{L6.init(e,t),xt.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function $5(e,t){return new D5({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const M5=ae("ZodNaN",(e,t)=>{U6.init(e,t),xt.init(e,t)});function whe(e){return I3(M5,e)}const Sj=ae("ZodPipe",(e,t)=>{F6.init(e,t),xt.init(e,t),e.in=t.in,e.out=t.out});function fy(e,t){return new Sj({type:"pipe",in:e,out:t})}const _j=ae("ZodCodec",(e,t)=>{Sj.init(e,t),ck.init(e,t)});function She(e,t,n){return new _j({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}const P5=ae("ZodReadonly",(e,t)=>{V6.init(e,t),xt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function z5(e){return new P5({type:"readonly",innerType:e})}const L5=ae("ZodTemplateLiteral",(e,t)=>{B6.init(e,t),xt.init(e,t)});function _he(e,t){return new L5({type:"template_literal",parts:e,...Ce(t)})}const U5=ae("ZodLazy",(e,t)=>{G6.init(e,t),xt.init(e,t),e.unwrap=()=>e._zod.def.getter()});function F5(e){return new U5({type:"lazy",getter:e})}const V5=ae("ZodPromise",(e,t)=>{q6.init(e,t),xt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Che(e){return new V5({type:"promise",innerType:e})}const B5=ae("ZodFunction",(e,t)=>{H6.init(e,t),xt.init(e,t)});function r2(e){return new B5({type:"function",input:Array.isArray(e?.input)?w5(e?.input):e?.input??Id(Rd()),output:e?.output??Rd()})}const Wb=ae("ZodCustom",(e,t)=>{K6.init(e,t),xt.init(e,t)});function Ehe(e){const t=new In({check:"custom"});return t._zod.check=e,t}function khe(e,t){return P3(Wb,e??(()=>!0),t)}function H5(e,t={}){return z3(Wb,e,t)}function q5(e){return L3(e)}function jhe(e,t={error:`Input not instance of ${e.name}`}){const n=new Wb({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...Ce(t)});return n._zod.bag.Class=e,n}const Rhe=(...e)=>F3({Codec:_j,Boolean:Gb,String:Bb},...e);function Ihe(e){const t=F5(()=>gj([nt(e),dj(),jd(),u5(),Id(t),yj(nt(),t)]));return t}function Nhe(e,t){return fy(bj(e),t)}const The={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function Ahe(e){Ur({customError:e})}function Ohe(){return Ur().customError}var R1;R1||(R1={});function Dhe(e){return t3(Bb,e)}function $he(e){return l3(qb,e)}function Mhe(e){return h3(Gb,e)}function Phe(e){return v3(Kb,e)}function zhe(e){return R3(pj,e)}const Lhe=Object.freeze(Object.defineProperty({__proto__:null,bigint:Phe,boolean:Mhe,date:zhe,number:$he,string:Dhe},Symbol.toStringTag,{value:"Module"}));Ur(Z6());const _r=Object.freeze(Object.defineProperty({__proto__:null,$brand:pU,$input:J6,$output:Q6,NEVER:mU,TimePrecision:n3,ZodAny:d5,ZodArray:h5,ZodBase64:sj,ZodBase64URL:lj,ZodBigInt:Kb,ZodBigIntFormat:fj,ZodBoolean:Gb,ZodCIDRv4:oj,ZodCIDRv6:aj,ZodCUID:Qk,ZodCUID2:Jk,ZodCatch:D5,ZodCodec:_j,ZodCustom:Wb,ZodCustomStringFormat:Zp,ZodDate:pj,ZodDefault:R5,ZodDiscriminatedUnion:g5,ZodE164:cj,ZodEmail:Yk,ZodEmoji:Wk,ZodEnum:ap,ZodError:jpe,ZodFile:E5,get ZodFirstPartyTypeKind(){return R1},ZodFunction:B5,ZodGUID:ly,ZodIPv4:rj,ZodIPv6:ij,ZodISODate:qk,ZodISODateTime:Hk,ZodISODuration:Kk,ZodISOTime:Gk,ZodIntersection:y5,ZodIssueCode:The,ZodJWT:uj,ZodKSUID:nj,ZodLazy:U5,ZodLiteral:C5,ZodMap:S5,ZodNaN:M5,ZodNanoID:Xk,ZodNever:m5,ZodNonOptional:wj,ZodNull:c5,ZodNullable:j5,ZodNumber:qb,ZodNumberFormat:Jd,ZodObject:Zb,ZodOptional:xj,ZodPipe:Sj,ZodPrefault:N5,ZodPromise:V5,ZodReadonly:P5,ZodRealError:Li,ZodRecord:vj,ZodSet:_5,ZodString:Bb,ZodStringFormat:hn,ZodSuccess:O5,ZodSymbol:s5,ZodTemplateLiteral:L5,ZodTransform:k5,ZodTuple:x5,ZodType:xt,ZodULID:ej,ZodURL:Hb,ZodUUID:Fa,ZodUndefined:l5,ZodUnion:hj,ZodUnknown:f5,ZodVoid:p5,ZodXID:tj,_ZodString:Zk,_default:I5,_function:r2,any:lhe,array:Id,base64:Gpe,base64url:Kpe,bigint:ihe,boolean:jd,catch:$5,check:Ehe,cidrv4:Hpe,cidrv6:qpe,clone:yo,codec:She,coerce:Lhe,config:Ur,core:Epe,cuid:Ppe,cuid2:zpe,custom:khe,date:uhe,decode:J3,decodeAsync:t5,discriminatedUnion:v5,e164:Zpe,email:a5,emoji:$pe,encode:Q3,encodeAsync:e5,endsWith:zk,enum:ef,file:yhe,flattenError:VE,float32:ehe,float64:the,formatError:BE,function:r2,getErrorMap:Ohe,globalRegistry:Ql,gt:vc,gte:Ri,guid:Rpe,hash:Jpe,hex:Qpe,hostname:Xpe,httpUrl:Dpe,includes:Mk,instanceof:jhe,int:j1,int32:nhe,int64:ohe,intersection:b5,ipv4:Vpe,ipv6:Bpe,iso:kpe,json:Ihe,jwt:Ype,keyof:dhe,ksuid:Fpe,lazy:F5,length:Vb,literal:Yb,locales:X6,looseObject:mhe,lowercase:Dk,lt:gc,lte:No,map:hhe,maxLength:Fb,maxSize:Ub,mime:Lk,minLength:kd,minSize:op,multipleOf:ip,nan:whe,nanoid:Mpe,nativeEnum:vhe,negative:T3,never:mj,nonnegative:O3,nonoptional:A5,nonpositive:A3,normalize:Uk,null:u5,nullable:dy,nullish:bhe,number:dj,object:mn,optional:uy,overwrite:$c,parse:Z3,parseAsync:Y3,partialRecord:phe,pipe:fy,positive:N3,prefault:T5,preprocess:Nhe,prettifyError:DU,promise:Che,property:D3,readonly:z5,record:yj,refine:H5,regex:Ok,regexes:ek,registry:dk,safeDecode:r5,safeDecodeAsync:o5,safeEncode:n5,safeEncodeAsync:i5,safeParse:W3,safeParseAsync:X3,set:ghe,setErrorMap:Ahe,size:Ak,startsWith:Pk,strictObject:fhe,string:nt,stringFormat:Wpe,stringbool:Rhe,success:xhe,superRefine:q5,symbol:she,templateLiteral:_he,toJSONSchema:V3,toLowerCase:Vk,toUpperCase:Bk,transform:bj,treeifyError:AU,trim:Fk,tuple:w5,uint32:rhe,uint64:ahe,ulid:Lpe,undefined:cy,union:gj,unknown:Rd,uppercase:$k,url:Ope,util:NU,uuid:Ipe,uuidv4:Npe,uuidv6:Tpe,uuidv7:Ape,void:che,xid:Upe},Symbol.toStringTag,{value:"Module"})),tf=a5({error:"Please enter a valid email address."}).toLowerCase().trim(),Yp=nt().nonempty({error:"Please enter your password."}),Cj=nt().nonempty({error:"Please enter a username."}),Uhe=mn({username:Cj,password:Yp}),Fhe=mn({email:tf,password:Yp});function Vhe({entityId:e,instanceClient:t}){return{queryKey:[e,"health"],queryFn:async()=>{try{return await t.get("/health"),!0}catch{return!1}},retry:2,refetchInterval:5e3}}const i2=["localhost","127.0.0.1"];var I1=(e=>(e.MixedLoopback="MixedLoopback",e.InsecureCookieOutsideChromeAndFirefox="InsecureCookieOutsideChromeAndFirefox",e))(I1||{});function Bhe(e,t,n){if(!n||!t||!e)return null;const r=new URL(n).hostname,i=i2.includes(t),o=i2.includes(r);if(i&&o&&r!==t)return"MixedLoopback";if(!i&&o){const a=e.indexOf("Chrome")>=0,c=e.indexOf("Firefox")>=0;if(!a&&!c)return"InsecureCookieOutsideChromeAndFirefox"}return null}const o2=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Ne(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},N1=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?o2(r.ref,n,e):r&&r.refs&&r.refs.forEach(i=>o2(i,n,e))}},a2=(e,t)=>{t.shouldUseNativeValidation&&N1(e,t);const n={};for(const r in e){const i=Ne(t.fields,r),o=Object.assign(e[r]||{},{ref:i&&i.ref});if(Hhe(t.names||Object.keys(e),r)){const a=Object.assign({},Ne(n,r));zt(a,"root",o),zt(n,r,a)}else zt(n,r,o)}return n},Hhe=(e,t)=>{const n=s2(t);return e.some(r=>s2(r).match(`^${n}\\.\\d+`))};function s2(e){return e.replace(/\]|\[/g,"")}function l2(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function qhe(e,t){for(var n={};e.length;){var r=e[0],i=r.code,o=r.message,a=r.path.join(".");if(!n[a])if("unionErrors"in r){var c=r.unionErrors[0].errors[0];n[a]={message:c.message,type:c.code}}else n[a]={message:o,type:i};if("unionErrors"in r&&r.unionErrors.forEach(function(p){return p.errors.forEach(function(h){return e.push(h)})}),t){var d=n[a].types,f=d&&d[r.code];n[a]=$E(a,t,n,i,f?[].concat(f,r.message):r.message)}e.shift()}return n}function Ghe(e,t){for(var n={};e.length;){var r=e[0],i=r.code,o=r.message,a=r.path.join(".");if(!n[a])if(r.code==="invalid_union"&&r.errors.length>0){var c=r.errors[0][0];n[a]={message:c.message,type:c.code}}else n[a]={message:o,type:i};if(r.code==="invalid_union"&&r.errors.forEach(function(p){return p.forEach(function(h){return e.push(h)})}),t){var d=n[a].types,f=d&&d[r.code];n[a]=$E(a,t,n,i,f?[].concat(f,r.message):r.message)}e.shift()}return n}function ln(e,t,n){if(n===void 0&&(n={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(e))return function(r,i,o){try{return Promise.resolve(l2(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(a){return o.shouldUseNativeValidation&&N1({},o),{errors:{},values:n.raw?Object.assign({},r):a}})},function(a){if((function(c){return Array.isArray(c?.issues)})(a))return{values:{},errors:a2(qhe(a.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw a}))}catch(a){return Promise.reject(a)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,i,o){try{return Promise.resolve(l2(function(){return Promise.resolve((n.mode==="sync"?iy:oy)(e,r,t)).then(function(a){return o.shouldUseNativeValidation&&N1({},o),{errors:{},values:n.raw?Object.assign({},r):a}})},function(a){if((function(c){return c instanceof zb})(a))return{values:{},errors:a2(Ghe(a.issues,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw a}))}catch(a){return Promise.reject(a)}};throw new Error("Invalid input: not a Zod schema")}function Ej(){const{clusterId:e,instanceId:t}=tt({strict:!1}),{data:n}=Mt(Oc(e,!0)),r=x.useMemo(()=>t&&n&&n?.instances?.find(E=>E.id===t)||void 0,[n,t]),i=x.useMemo(()=>n?.status&&Ab.includes(n.status),[n?.status]),o="Local",a="instance",c=x.useMemo(()=>n?r?(Tt.flagForFabricConnect(r.id,!1),jC(r)):(Tt.flagForFabricConnect(n.id,!1),kC(n)):null,[n,r]),d=Ft(c),f=x.useMemo(()=>c?.includes("localhost")||c?.includes("127.0.0.1"),[c]),p=x.useMemo(()=>Bhe(navigator.userAgent,location.hostname,c),[c]),{data:h}=Mt(Vhe(d)),v=Qt({resolver:ln(Uhe),defaultValues:{username:"",password:""}}),{control:y,handleSubmit:b}=v,{submitForm:S,isPending:C}=gde({cluster:n,instance:r,instanceParams:d});return!t&&n&&!n?.fqdn?u.jsx(ic,{to:"../instances",replace:!0}):i&&n?.resetPassword?u.jsx(ic,{to:`/${n.organizationId}/${n.id}/finish-setup`,replace:!0}):!i&&n?.resetPassword?u.jsx(ic,{to:`/${n.organizationId}/${n.id}/starting-up`,replace:!0}):u.jsxs(u.Fragment,{children:[!Qu,u.jsx("div",{className:"h-screen items-center justify-center flex",children:u.jsxs("div",{className:"text-white w-xs",children:[u.jsxs("h2",{className:"text-2xl font-light",children:["Sign in to Harper ",o]}),u.jsx(Jt,{...v,children:u.jsxs("form",{onSubmit:b(S),className:"my-4",children:[u.jsx(Me,{control:y,name:"username",render:({field:E})=>u.jsxs(Ae,{className:"my-4",children:[u.jsx(Oe,{children:"Username"}),u.jsx($e,{children:u.jsx(ze,{autoComplete:"username",autoFocus:!0,type:"text",...E})}),u.jsx(De,{})]})}),u.jsx(Me,{control:y,name:"password",render:({field:E})=>u.jsxs(Ae,{className:"my-4",children:[u.jsx(Oe,{children:"Password"}),u.jsx($e,{children:u.jsx(ze,{type:"password",...E})}),u.jsx(De,{})]})}),u.jsx(be,{disabled:C,type:"submit",variant:"submit",className:"w-full my-2 rounded-full",children:"Sign In"}),h===!1&&u.jsxs("div",{className:"p-4 mt-4 text-sm text-yellow-800 rounded-lg bg-yellow-50 dark:bg-gray-800 dark:text-yellow-300",role:"alert",children:[u.jsx("span",{className:"font-medium",children:"Warning!"})," This ",a," is not responding to GET ",u.jsxs("a",{href:`${c}health`,className:"underline",target:"_blank",children:[c,"health"]})," checks.",u.jsxs("ol",{className:"list-decimal ml-8 mt-2",children:[u.jsx("li",{children:"Is the server running?"}),u.jsxs("li",{children:["Have you ",u.jsx("a",{href:"https://docs.harperdb.io/docs/developers/security/configuration#cors",target:"_blank",className:"underline",children:"enabled CORS"})," for the operations API?"]}),f&&u.jsxs("li",{children:["Have you allowed ",u.jsx("a",{href:"https://www.google.com/search?q=How+do+I+enable+local+network+access+in+my+browser%3F",className:"underline",target:"_blank",children:"local network access"})," in your browser?"]})]})]}),p===I1.MixedLoopback&&u.jsxs("div",{className:"p-4 mt-4 text-sm text-yellow-800 rounded-lg bg-yellow-50 dark:bg-gray-800 dark:text-yellow-300",role:"alert",children:[u.jsx("span",{className:"font-medium",children:"Warning!"})," Your login might not work because you're mixing 127.0.0.1 and localhost. Pick one or the other."]}),p===I1.InsecureCookieOutsideChromeAndFirefox&&u.jsxs("div",{className:"p-4 mt-4 text-sm text-yellow-800 rounded-lg bg-yellow-50 dark:bg-gray-800 dark:text-yellow-300",role:"alert",children:[u.jsx("span",{className:"font-medium",children:"Warning!"})," Your login might not work because your browser doesn't consider localhost to be secure, so it doesn't pass the cookies along. Firefox or Chromium based browsers should pass the cookies properly."]}),u.jsxs("div",{className:"p-4 mt-4 text-sm rounded-lg bg-purple-950",role:"alert",children:[u.jsx("span",{className:"font-medium",children:"Did you know?"})," You can add this instance to your Harper account to manage it remotely.",u.jsx("div",{className:"text-center pt-2",children:u.jsx(Ge,{to:pde(),target:"_blank",children:u.jsx(be,{type:"button",variant:"positive",children:"Connect to Harper Fabric"})})})]})]})})]})})]})}async function Khe({email:e}){const{data:t}=await Ut.post("/ForgotPassword/",{email:e});if(t)return t;throw new Error("Something went wrong")}function Zhe(){return at({mutationFn:e=>Khe(e)})}const Yhe=mn({email:tf});function Whe(){const e=pn(),{me:t}=vr({strict:!1}),n=Qt({resolver:ln(Yhe),defaultValues:{email:t||""}}),r=n.watch("email"),{setFocus:i,control:o,handleSubmit:a}=n;x.useEffect(()=>{i("email")},[i]);const{mutate:c,isPending:d}=Zhe(),f=async p=>{c(p,{onSuccess:h=>{_e.success("Success",{description:`${h}`,action:{label:"Dismiss",onClick:()=>_e.dismiss()}}),e({to:"/sign-in",search:{me:r}})}})};return u.jsxs("div",{className:"text-white w-xs",children:[u.jsx("h2",{className:"text-2xl font-light",children:"Enter your account email"}),u.jsx("p",{className:"text-sm pt-1",children:"If a matching account exists, we'll send you a password reset link."}),u.jsx(Jt,{...n,children:u.jsxs("form",{onSubmit:a(f),className:"my-4",children:[u.jsx(Me,{control:o,name:"email",render:({field:p})=>u.jsxs(Ae,{className:"my-2",children:[u.jsx(Oe,{children:"Email"}),u.jsx($e,{children:u.jsx(ze,{disabled:d,type:"email",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...p})}),u.jsx(De,{})]})}),u.jsx(be,{type:"submit",variant:"submit",disabled:d,className:"w-full my-2 rounded-full",children:"Send Password Reset Email"})]})}),u.jsxs("div",{className:"flex px-4 mt-4 underline place-content-between",children:[u.jsx(Ge,{className:"text-sm hover:text-blue-300",to:"/sign-in",search:{me:r},children:"Sign in to your account"}),u.jsx(Ge,{className:"text-sm hover:text-blue-300",to:"/sign-up",search:{me:r},children:"Sign up for free"})]})]})}const Xhe=async({token:e,password:t})=>{const{data:n}=await Ut.put("/ResetPassword/",{token:e,newPassword:t});return n};function Qhe(){return at({mutationFn:e=>Xhe(e)})}const Jhe=mn({password:Yp.min(8,{error:"Password must be at least 8 characters long."}).max(50,{error:"Password cannot be longer than 50 characters."}),confirmPassword:nt()}).refine(e=>e.password===e.confirmPassword,{error:"Passwords do not match.",path:["confirmPassword"]});function ege(){const{token:e}=vr({strict:!1}),t=pn();x.useEffect(()=>{e||t({to:"/sign-in"})},[e,t]);const n=Qt({resolver:ln(Jhe),defaultValues:{password:"",confirmPassword:""}}),{setFocus:r,control:i,handleSubmit:o}=n;x.useEffect(()=>{r("password")},[r]);const{mutate:a,isPending:c}=Qhe(),d=x.useCallback(async f=>{a({token:e,password:f.password},{onSuccess:()=>{_e.success("Success",{description:"Your password has been reset successfully.",action:{label:"Dismiss",onClick:()=>_e.dismiss()}}),t({to:"/sign-in"})}})},[t,a,e]);return u.jsxs("div",{className:"text-white w-xs",children:[u.jsx("h2",{className:"text-2xl font-light",children:"Reset Password"}),u.jsx(Jt,{...n,children:u.jsxs("form",{className:"my-4",onSubmit:o(d),children:[u.jsx(Me,{control:i,name:"password",render:({field:f})=>u.jsxs(Ae,{className:"my-2",children:[u.jsx(Oe,{children:"New Password"}),u.jsx($e,{children:u.jsx(ze,{disabled:c,type:"password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...f})}),u.jsx(De,{})]})}),u.jsx(Me,{control:i,name:"confirmPassword",render:({field:f})=>u.jsxs(Ae,{className:"my-2",children:[u.jsx(Oe,{children:"Confirm Password"}),u.jsx($e,{children:u.jsx(ze,{disabled:c,type:"password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...f})}),u.jsx(De,{})]})}),u.jsx(be,{variant:"submit",type:"submit",disabled:c,className:"w-full my-2 rounded-full",children:"Submit New Password"})]})})]})}function G5({text:e}){return u.jsx("a",{href:"/oauth/github/login?redirect=%2F%23%2Fcheck-oauth",children:u.jsxs("button",{className:"github-signin-btn",children:[u.jsx(zC,{className:"github-icon"}),e]})})}function K5({text:e}){return u.jsx("a",{href:"/oauth/google/login?redirect=%2F%23%2Fcheck-oauth",children:u.jsxs("button",{className:"gsi-material-button",children:[u.jsx("div",{className:"gsi-material-button-state"}),u.jsxs("div",{className:"gsi-material-button-content-wrapper",children:[u.jsx("div",{className:"gsi-material-button-icon",children:u.jsxs("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",xmlnsXlink:"http://www.w3.org/1999/xlink",className:"block",children:[u.jsx("path",{fill:"#EA4335",d:"M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"}),u.jsx("path",{fill:"#4285F4",d:"M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"}),u.jsx("path",{fill:"#FBBC05",d:"M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"}),u.jsx("path",{fill:"#34A853",d:"M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"}),u.jsx("path",{fill:"none",d:"M0 0h48v48H0z"})]})}),u.jsx("span",{className:"gsi-material-button-contents",children:e}),u.jsx("span",{className:"hidden",children:e})]})]})})}function tge(){const e=pn(),t=gr(),n=an(),{redirect:r}=vr({strict:!1}),{mutate:i,isPending:o}=nge(),a=x.useCallback(c=>{i(c,{onSuccess:async d=>{Tt.setUserForEntity(_n,d);const f=Ec(d);gE(d.email),await t.invalidateQueries({queryKey:Vy,refetchType:"none"}),n.invalidate(),await e({to:r?.startsWith("/")?r:f})}})},[e,t,r,n,i]);return{isPending:o,submitForm:a}}function nge(){return at({mutationFn:e=>rge(e)})}async function rge({email:e,password:t}){const{data:n}=await Ut.post("/Login/",{email:e,password:t});if(n)return n;throw new Error("Something went wrong")}function ige(){const{me:e}=vr({strict:!1}),t=Qt({resolver:ln(Fhe),defaultValues:{email:e||"",password:""}}),{handleSubmit:n,control:r}=t,i=t.watch("email"),{submitForm:o,isPending:a}=tge();return u.jsxs("div",{className:"text-white w-xs",children:[u.jsx("h2",{className:"text-2xl font-light",children:"Sign in to Harper Fabric"}),u.jsx(Jt,{...t,children:u.jsxs("form",{onSubmit:n(o),className:"my-4",children:[u.jsx(Me,{control:r,name:"email",render:({field:c})=>u.jsxs(Ae,{className:"my-4",children:[u.jsx(Oe,{children:"Email"}),u.jsx($e,{children:u.jsx(ze,{type:"email",autoFocus:!0,className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...c})}),u.jsx(De,{})]})}),u.jsx(Me,{control:r,name:"password",render:({field:c})=>u.jsxs(Ae,{className:"my-4",children:[u.jsx(Oe,{children:"Password"}),u.jsx($e,{children:u.jsx(ze,{type:"password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...c})}),u.jsx(De,{})]})}),u.jsx(be,{type:"submit",variant:"submit",className:"w-full my-2 rounded-full",disabled:a,children:"Sign In"}),u.jsxs("div",{className:"flex px-4 mt-4 underline place-content-between",children:[u.jsx(Ge,{className:"text-sm hover:text-blue-300",to:"/sign-up",search:{me:i},children:"Sign up for free"}),u.jsx(Ge,{className:"text-sm hover:text-blue-300",to:"/forgot-password",search:{me:i},children:"Forgot password?"})]})]})}),u.jsx("hr",{className:"border-gray-600 my-6"}),u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsx(K5,{text:"Sign in with Google"}),u.jsx(G5,{text:"Sign in with GitHub"})]})]})}async function oge(e){const{data:t}=await Ut.post("/User/",e);if(t)return t;throw new Error("Something went wrong")}function age(){return at({mutationFn:e=>oge(e)})}const sge=mn({email:tf.max(80,{error:"Email cannot be longer than 80 characters."}),firstname:nt().trim().min(2,{error:"Please enter your first name."}).max(40,{error:"First name cannot be longer than 40 characters."}),lastname:nt().trim().min(2,{error:"Please enter your last name."}).max(80,{error:"Last name cannot be longer than 80 characters."}),password:Yp.min(8,{error:"Password must be at least 8 characters long."}),confirmPassword:nt()}).refine(e=>e.password===e.confirmPassword,{error:"Passwords do not match.",path:["confirmPassword"]});function lge(){const e=pn(),{email:t,me:n}=vr({strict:!1}),r=Qt({resolver:ln(sge),defaultValues:{firstname:"",lastname:"",email:n||t||"",password:"",confirmPassword:""}}),i=r.watch("email"),{setFocus:o,control:a,handleSubmit:c}=r;x.useEffect(()=>{o("firstname")},[o]);const{mutate:d}=age(),f=x.useCallback(async p=>{const{confirmPassword:h,...v}=p;d(v,{onSuccess:()=>{gE(v.email),e({to:"/verifying?email="+encodeURIComponent(v.email)})}})},[e,d]);return u.jsxs("div",{className:"text-white w-xs",children:[u.jsx("h2",{className:"text-2xl font-light",children:"Sign up for Harper Fabric"}),u.jsxs("div",{className:"flex flex-col gap-2 my-6",children:[u.jsx(K5,{text:"Sign up with Google"}),u.jsx(G5,{text:"Sign up with GitHub"})]}),u.jsx("hr",{className:"border-gray-600"}),u.jsx(Jt,{...r,children:u.jsxs("form",{onSubmit:c(f),className:"grid gap-4 my-4",children:[u.jsx(Me,{control:a,name:"firstname",render:({field:p})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"First Name"}),u.jsx($e,{children:u.jsx(ze,{type:"text",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",autoCapitalize:"words",...p})}),u.jsx(De,{})]})}),u.jsx(Me,{control:a,name:"lastname",render:({field:p})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Last Name"}),u.jsx($e,{children:u.jsx(ze,{type:"text",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",autoCapitalize:"words",...p})}),u.jsx(De,{})]})}),u.jsx(Me,{control:a,name:"email",render:({field:p})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Email"}),u.jsx($e,{children:u.jsx(ze,{type:"email",readOnly:!!t,disabled:!!t,className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",autoComplete:"email",autoCapitalize:"none",...p})}),u.jsx(De,{})]})}),u.jsx(Me,{control:a,name:"password",render:({field:p})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Password"}),u.jsx($e,{children:u.jsx(ze,{type:"password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...p})}),u.jsx(De,{})]})}),u.jsx(Me,{control:a,name:"confirmPassword",render:({field:p})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Confirm Password"}),u.jsx($e,{children:u.jsx(ze,{type:"password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...p})}),u.jsx(De,{})]})}),u.jsxs("p",{className:"text-xs",children:["By creating an account, you agree to the ",u.jsx("a",{rel:"noopener",href:"https://www.harper.fast/resources/privacy-policy",target:"_blank",className:"underline hover:text-blue-300",children:"Privacy Policy"})," and ",u.jsx("a",{rel:"noopener",href:"https://www.harper.fast/resources/terms-of-use",target:"_blank",className:"underline hover:text-blue-300",children:"Terms of Service"})]}),u.jsx(be,{type:"submit",variant:"submit",className:"w-full rounded-full my-4",children:"Sign Up For Free"})]})}),u.jsx("div",{className:"flex px-4 mt-4 underline place-content-between",children:u.jsx(Ge,{className:"m-auto text-sm hover:text-blue-300",to:"/sign-in",search:{me:i},children:"Already have an account? Sign in instead."})})]})}const cge=async({email:e})=>{const{data:t}=await Ut.post("/ResendVerificationEmail/",{email:e});return t};function Z5(){return at({mutationFn:e=>cge(e)})}const uge=async e=>{const{data:t}=await Ut.put("/VerifyEmail/",{token:e.toString()});return t};function dge(){return at({mutationFn:e=>uge(e)})}const fge=mn({email:tf});function mge(){const e=pn(),{mutate:t,isPending:n}=Z5(),r=Qt({resolver:ln(fge),defaultValues:{email:""}}),i=r.watch("email"),{setFocus:o,control:a,handleSubmit:c}=r;x.useEffect(()=>{o("email")},[o]);const d=x.useCallback(async f=>{t(f,{onSuccess:p=>{_e.success("Success",{description:`${p}`,action:{label:"Dismiss",onClick:()=>_e.dismiss()}}),e({to:"/sign-in",search:{me:i}})}})},[i,e,t]);return u.jsxs(Jt,{...r,children:[u.jsx("p",{className:"text-sm py-2",children:"Please Enter an Email"}),u.jsxs("form",{onSubmit:c(d),className:"my-4",children:[u.jsx(Me,{control:a,name:"email",render:({field:f})=>u.jsxs(Ae,{className:"my-2",children:[u.jsx(Oe,{children:"Email"}),u.jsx($e,{children:u.jsx(ze,{disabled:n,type:"email",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...f})}),u.jsx(De,{})]})}),u.jsx(be,{type:"submit",variant:"submit",disabled:n,className:"w-full my-2 rounded-full",children:"Send Verification Email"})]})]})}function pge(){const{token:e}=vr({strict:!1}),t=pn(),{mutate:n,isPending:r}=dge(),i=x.useCallback(o=>{n(o,{onSuccess:()=>{_e.success("Success",{description:"Email verified successfully",action:{label:"Dismiss",onClick:()=>_e.dismiss()}}),t({to:"/sign-in"})}})},[n,t]);return x.useEffect(()=>{e&&i(e)},[i,e]),u.jsxs("div",{className:"text-white w-xs",children:[u.jsx("h1",{className:"text-3xl font-light",children:"Verify Email"}),r?u.jsx("p",{className:"text-sm pt-1",children:"Verifying email..."}):u.jsx(mge,{})]})}function hge(){const{email:e}=vr({strict:!1}),{mutate:t,isPending:n}=Z5(),r=x.useCallback(i=>(i.preventDefault(),e&&t({email:e},{onSuccess:o=>{_e.success("Code Sent",{description:`${o}`,action:{label:"Dismiss",onClick:()=>_e.dismiss()}})}}),!1),[e,t]);return u.jsxs("div",{className:"text-white w-lg flex flex-col gap-4",children:[u.jsxs("h1",{className:"text-3xl font-light",children:[u.jsx("span",{"aria-hidden":"true",className:"text-2xl animate-flower-dance mr-4",title:"Loading",children:"🌼"}),"Check your email!"]}),u.jsxs("p",{children:["Your account has been created! You should receive an email with a link to ",u.jsx("strong",{children:"[Verify My Email]"}),"!"]}),u.jsxs("p",{children:["From: ",u.jsx("strong",{children:"harper@notifications.harperfabric.com"})]}),u.jsxs("p",{children:["To: ",u.jsx("strong",{children:e||"your email"})]}),u.jsx("p",{children:"Can you click it? Then we can carry on to more fun things!"}),u.jsxs("div",{className:"underline flex gap-4",children:[u.jsx(Ge,{className:"text-sm hover:text-blue-300",to:"/sign-in",search:{me:e},children:"I did it, let me sign in!"}),u.jsx(Ge,{className:"text-sm opacity-50 hover:text-blue-300",to:void 0,onClick:r,disabled:n,children:"Send me another code, please."})]})]})}const pl=Qe({getParentRoute:()=>mb,id:"_authLayout",component:Jle}),gge=Qe({getParentRoute:()=>pl,path:"sign-in",component:ige,beforeLoad:({context:e,location:t})=>{const n=e.authentication[_n]?.user;if(n){const r=t?.search,i=Ec(n);throw Sc({to:r?.redirect?.startsWith("/")?r.redirect:i})}}}),vge=Qe({getParentRoute:()=>mb,path:"sign-in",component:Ej,beforeLoad:({context:e,location:t})=>{if(e.authentication[_n]?.user){const n=t?.search;throw Sc({to:n?.redirect?.startsWith("/")?n.redirect:oa})}}}),yge=Qe({getParentRoute:()=>pl,path:"sign-up",component:lge}),bge=Qe({getParentRoute:()=>pl,path:"forgot-password",component:Whe}),xge=Qe({getParentRoute:()=>pl,path:"verify-email",component:pge}),wge=Qe({getParentRoute:()=>pl,path:"verifying",component:hge}),Sge=Qe({getParentRoute:()=>pl,path:"check-oauth",component:nce}),_ge=Qe({getParentRoute:()=>pl,path:"reset-password",component:ege});pl.addChildren([gge,yge,Sge,bge,xge,wge,_ge]);const Cge=[vge];function rs({children:e}){return u.jsx("nav",{className:"fixed top-20 w-full md:h-12 z-39 py-2 px-4 md:px-12 bg-grey-700",children:u.jsxs("div",{className:"md:flex items-center h-full space-x-8",children:[u.jsx(jb,{}),e]})})}function Y5(e){if(T1(e)||A1(e))return"warning";if(W5(e))return"success";switch(e){case"STOPPED":return"secondary";case"TERMINATING":case"TERMINATED":case"FAILED":case"REMOVED":case"ERROR":return"destructive";default:return"default"}}function W5(e){switch(e){case"RUNNING":case"UPDATED":return!0;default:return!1}}function Wp(e){switch(e){case"FAILED":return!0;default:return!1}}function kj(e){switch(e){case"TERMINATED":return!0;default:return!1}}function T1(e){switch(e){case"CLONE_PENDING":return!0;default:return!1}}function A1(e){switch(e){case"PROVISIONING":case"CLONING":case"CLONE_READY":case"UPDATING_HDB_NODES":case"UPDATING":return!0;default:return!1}}var zS="focusScope.autoFocusOnMount",LS="focusScope.autoFocusOnUnmount",c2={bubbles:!1,cancelable:!0},Ege="FocusScope",Xb=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[c,d]=x.useState(null),f=bn(i),p=bn(o),h=x.useRef(null),v=ut(t,S=>d(S)),y=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let S=function(j){if(y.paused||!c)return;const I=j.target;c.contains(I)?h.current=I:Os(h.current,{select:!0})},C=function(j){if(y.paused||!c)return;const I=j.relatedTarget;I!==null&&(c.contains(I)||Os(h.current,{select:!0}))},E=function(j){if(document.activeElement===document.body)for(const A of j)A.removedNodes.length>0&&Os(c)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const k=new MutationObserver(E);return c&&k.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),k.disconnect()}}},[r,c,y.paused]),x.useEffect(()=>{if(c){d2.add(y);const S=document.activeElement;if(!c.contains(S)){const E=new CustomEvent(zS,c2);c.addEventListener(zS,f),c.dispatchEvent(E),E.defaultPrevented||(kge(Tge(X5(c)),{select:!0}),document.activeElement===S&&Os(c))}return()=>{c.removeEventListener(zS,f),setTimeout(()=>{const E=new CustomEvent(LS,c2);c.addEventListener(LS,p),c.dispatchEvent(E),E.defaultPrevented||Os(S??document.body,{select:!0}),c.removeEventListener(LS,p),d2.remove(y)},0)}}},[c,f,p,y]);const b=x.useCallback(S=>{if(!n&&!r||y.paused)return;const C=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,E=document.activeElement;if(C&&E){const k=S.currentTarget,[j,I]=jge(k);j&&I?!S.shiftKey&&E===I?(S.preventDefault(),n&&Os(j,{select:!0})):S.shiftKey&&E===j&&(S.preventDefault(),n&&Os(I,{select:!0})):E===k&&S.preventDefault()}},[n,r,y.paused]);return u.jsx(Ke.div,{tabIndex:-1,...a,ref:v,onKeyDown:b})});Xb.displayName=Ege;function kge(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Os(r,{select:t}),document.activeElement!==n)return}function jge(e){const t=X5(e),n=u2(t,e),r=u2(t.reverse(),e);return[n,r]}function X5(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function u2(e,t){for(const n of e)if(!Rge(n,{upTo:t}))return n}function Rge(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Ige(e){return e instanceof HTMLInputElement&&"select"in e}function Os(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ige(e)&&t&&e.select()}}var d2=Nge();function Nge(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=f2(e,t),e.unshift(t)},remove(t){e=f2(e,t),e[0]?.resume()}}}function f2(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Tge(e){return e.filter(t=>t.tagName!=="A")}var US=0;function jj(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??m2()),document.body.insertAdjacentElement("beforeend",e[1]??m2()),US++,()=>{US===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),US--}},[])}function m2(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var O1=function(e,t){return O1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},O1(e,t)};function jAe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");O1(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Xo=function(){return Xo=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Xo.apply(this,arguments)};function Q5(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Age(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Ev="right-scroll-bar-position",kv="width-before-scroll-bar",Oge="with-scroll-bars-hidden",Dge="--removed-body-scroll-bar-size";function FS(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function $ge(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var Mge=typeof window<"u"?x.useLayoutEffect:x.useEffect,p2=new WeakMap;function Pge(e,t){var n=$ge(null,function(r){return e.forEach(function(i){return FS(i,r)})});return Mge(function(){var r=p2.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(c){o.has(c)||FS(c,null)}),o.forEach(function(c){i.has(c)||FS(c,a)})}p2.set(n,e)},[e]),n}function zge(e){return e}function Lge(e,t){t===void 0&&(t=zge);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(c){return o(c)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(o),a=n}var d=function(){var p=a;a=[],p.forEach(o)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(p){a.push(p),f()},filter:function(p){return a=a.filter(p),n}}}};return i}function Uge(e){e===void 0&&(e={});var t=Lge(null);return t.options=Xo({async:!0,ssr:!1},e),t}var J5=function(e){var t=e.sideCar,n=Q5(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,Xo({},n))};J5.isSideCarExport=!0;function Fge(e,t){return e.useMedium(t),J5}var eV=Uge(),VS=function(){},Qb=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:VS,onWheelCapture:VS,onTouchMoveCapture:VS}),i=r[0],o=r[1],a=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,p=e.enabled,h=e.shards,v=e.sideCar,y=e.noRelative,b=e.noIsolation,S=e.inert,C=e.allowPinchZoom,E=e.as,k=E===void 0?"div":E,j=e.gapMode,I=Q5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=v,N=Pge([n,t]),T=Xo(Xo({},I),i);return x.createElement(x.Fragment,null,p&&x.createElement(A,{sideCar:eV,removeScrollBar:f,shards:h,noRelative:y,noIsolation:b,inert:S,setCallbacks:o,allowPinchZoom:!!C,lockRef:n,gapMode:j}),a?x.cloneElement(x.Children.only(c),Xo(Xo({},T),{ref:N})):x.createElement(k,Xo({},T,{className:d,ref:N}),c))});Qb.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Qb.classNames={fullWidth:kv,zeroRight:Ev};var Vge=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Bge(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Vge();return t&&e.setAttribute("nonce",t),e}function Hge(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function qge(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Gge=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Bge())&&(Hge(t,n),qge(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Kge=function(){var e=Gge();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},tV=function(){var e=Kge(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Zge={left:0,top:0,right:0,gap:0},BS=function(e){return parseInt(e||"",10)||0},Yge=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[BS(n),BS(r),BS(i)]},Wge=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Zge;var t=Yge(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Xge=tV(),od="data-scroll-locked",Qge=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
69
|
-
.`.concat(Oge,` {
|
|
70
|
-
overflow: hidden `).concat(r,`;
|
|
71
|
-
padding-right: `).concat(c,"px ").concat(r,`;
|
|
72
|
-
}
|
|
73
|
-
body[`).concat(od,`] {
|
|
74
|
-
overflow: hidden `).concat(r,`;
|
|
75
|
-
overscroll-behavior: contain;
|
|
76
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
77
|
-
padding-left: `.concat(i,`px;
|
|
78
|
-
padding-top: `).concat(o,`px;
|
|
79
|
-
padding-right: `).concat(a,`px;
|
|
80
|
-
margin-left:0;
|
|
81
|
-
margin-top:0;
|
|
82
|
-
margin-right: `).concat(c,"px ").concat(r,`;
|
|
83
|
-
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.`).concat(Ev,` {
|
|
87
|
-
right: `).concat(c,"px ").concat(r,`;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.`).concat(kv,` {
|
|
91
|
-
margin-right: `).concat(c,"px ").concat(r,`;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.`).concat(Ev," .").concat(Ev,` {
|
|
95
|
-
right: 0 `).concat(r,`;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.`).concat(kv," .").concat(kv,` {
|
|
99
|
-
margin-right: 0 `).concat(r,`;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
body[`).concat(od,`] {
|
|
103
|
-
`).concat(Dge,": ").concat(c,`px;
|
|
104
|
-
}
|
|
105
|
-
`)},h2=function(){var e=parseInt(document.body.getAttribute(od)||"0",10);return isFinite(e)?e:0},Jge=function(){x.useEffect(function(){return document.body.setAttribute(od,(h2()+1).toString()),function(){var e=h2()-1;e<=0?document.body.removeAttribute(od):document.body.setAttribute(od,e.toString())}},[])},eve=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Jge();var o=x.useMemo(function(){return Wge(i)},[i]);return x.createElement(Xge,{styles:Qge(o,!t,i,n?"":"!important")})},D1=!1;if(typeof window<"u")try{var Bg=Object.defineProperty({},"passive",{get:function(){return D1=!0,!0}});window.addEventListener("test",Bg,Bg),window.removeEventListener("test",Bg,Bg)}catch{D1=!1}var Pu=D1?{passive:!1}:!1,tve=function(e){return e.tagName==="TEXTAREA"},nV=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!tve(e)&&n[t]==="visible")},nve=function(e){return nV(e,"overflowY")},rve=function(e){return nV(e,"overflowX")},g2=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=rV(e,r);if(i){var o=iV(e,r),a=o[1],c=o[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ive=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ove=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},rV=function(e,t){return e==="v"?nve(t):rve(t)},iV=function(e,t){return e==="v"?ive(t):ove(t)},ave=function(e,t){return e==="h"&&t==="rtl"?-1:1},sve=function(e,t,n,r,i){var o=ave(e,window.getComputedStyle(t).direction),a=o*r,c=n.target,d=t.contains(c),f=!1,p=a>0,h=0,v=0;do{if(!c)break;var y=iV(e,c),b=y[0],S=y[1],C=y[2],E=S-C-o*b;(b||E)&&rV(e,c)&&(h+=E,v+=b);var k=c.parentNode;c=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(p&&Math.abs(h)<1||!p&&Math.abs(v)<1)&&(f=!0),f},Hg=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},v2=function(e){return[e.deltaX,e.deltaY]},y2=function(e){return e&&"current"in e?e.current:e},lve=function(e,t){return e[0]===t[0]&&e[1]===t[1]},cve=function(e){return`
|
|
106
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
107
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
108
|
-
`)},uve=0,zu=[];function dve(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(uve++)[0],o=x.useState(tV)[0],a=x.useRef(e);x.useEffect(function(){a.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var S=Age([e.lockRef.current],(e.shards||[]).map(y2),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var c=x.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!a.current.allowPinchZoom;var E=Hg(S),k=n.current,j="deltaX"in S?S.deltaX:k[0]-E[0],I="deltaY"in S?S.deltaY:k[1]-E[1],A,N=S.target,T=Math.abs(j)>Math.abs(I)?"h":"v";if("touches"in S&&T==="h"&&N.type==="range")return!1;var z=g2(T,N);if(!z)return!0;if(z?A=T:(A=T==="v"?"h":"v",z=g2(T,N)),!z)return!1;if(!r.current&&"changedTouches"in S&&(j||I)&&(r.current=A),!A)return!0;var L=r.current||A;return sve(L,C,S,L==="h"?j:I)},[]),d=x.useCallback(function(S){var C=S;if(!(!zu.length||zu[zu.length-1]!==o)){var E="deltaY"in C?v2(C):Hg(C),k=t.current.filter(function(A){return A.name===C.type&&(A.target===C.target||C.target===A.shadowParent)&&lve(A.delta,E)})[0];if(k&&k.should){C.cancelable&&C.preventDefault();return}if(!k){var j=(a.current.shards||[]).map(y2).filter(Boolean).filter(function(A){return A.contains(C.target)}),I=j.length>0?c(C,j[0]):!a.current.noIsolation;I&&C.cancelable&&C.preventDefault()}}},[]),f=x.useCallback(function(S,C,E,k){var j={name:S,delta:C,target:E,should:k,shadowParent:fve(E)};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(I){return I!==j})},1)},[]),p=x.useCallback(function(S){n.current=Hg(S),r.current=void 0},[]),h=x.useCallback(function(S){f(S.type,v2(S),S.target,c(S,e.lockRef.current))},[]),v=x.useCallback(function(S){f(S.type,Hg(S),S.target,c(S,e.lockRef.current))},[]);x.useEffect(function(){return zu.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:v}),document.addEventListener("wheel",d,Pu),document.addEventListener("touchmove",d,Pu),document.addEventListener("touchstart",p,Pu),function(){zu=zu.filter(function(S){return S!==o}),document.removeEventListener("wheel",d,Pu),document.removeEventListener("touchmove",d,Pu),document.removeEventListener("touchstart",p,Pu)}},[]);var y=e.removeScrollBar,b=e.inert;return x.createElement(x.Fragment,null,b?x.createElement(o,{styles:cve(i)}):null,y?x.createElement(eve,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function fve(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const mve=Fge(eV,dve);var Jb=x.forwardRef(function(e,t){return x.createElement(Qb,Xo({},e,{ref:t,sideCar:mve}))});Jb.classNames=Qb.classNames;var pve=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Lu=new WeakMap,qg=new WeakMap,Gg={},HS=0,oV=function(e){return e&&(e.host||oV(e.parentNode))},hve=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=oV(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},gve=function(e,t,n,r){var i=hve(t,Array.isArray(e)?e:[e]);Gg[n]||(Gg[n]=new WeakMap);var o=Gg[n],a=[],c=new Set,d=new Set(i),f=function(h){!h||c.has(h)||(c.add(h),f(h.parentNode))};i.forEach(f);var p=function(h){!h||d.has(h)||Array.prototype.forEach.call(h.children,function(v){if(c.has(v))p(v);else try{var y=v.getAttribute(r),b=y!==null&&y!=="false",S=(Lu.get(v)||0)+1,C=(o.get(v)||0)+1;Lu.set(v,S),o.set(v,C),a.push(v),S===1&&b&&qg.set(v,!0),C===1&&v.setAttribute(n,"true"),b||v.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",v,E)}})};return p(t),c.clear(),HS++,function(){a.forEach(function(h){var v=Lu.get(h)-1,y=o.get(h)-1;Lu.set(h,v),o.set(h,y),v||(qg.has(h)||h.removeAttribute(r),qg.delete(h)),y||h.removeAttribute(n)}),HS--,HS||(Lu=new WeakMap,Lu=new WeakMap,qg=new WeakMap,Gg={})}},Rj=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=pve(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),gve(r,i,n,"aria-hidden")):function(){return null}},ex="Dialog",[aV]=Pi(ex),[vve,Fo]=aV(ex),sV=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,c=x.useRef(null),d=x.useRef(null),[f,p]=Do({prop:r,defaultProp:i??!1,onChange:o,caller:ex});return u.jsx(vve,{scope:t,triggerRef:c,contentRef:d,contentId:Ni(),titleId:Ni(),descriptionId:Ni(),open:f,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(h=>!h),[p]),modal:a,children:n})};sV.displayName=ex;var lV="DialogTrigger",cV=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Fo(lV,n),o=ut(t,i.triggerRef);return u.jsx(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Tj(i.open),...r,ref:o,onClick:je(e.onClick,i.onOpenToggle)})});cV.displayName=lV;var Ij="DialogPortal",[yve,uV]=aV(Ij,{forceMount:void 0}),dV=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Fo(Ij,t);return u.jsx(yve,{scope:t,forceMount:n,children:x.Children.map(r,a=>u.jsx(Wn,{present:n||o.open,children:u.jsx(Op,{asChild:!0,container:i,children:a})}))})};dV.displayName=Ij;var my="DialogOverlay",fV=x.forwardRef((e,t)=>{const n=uV(my,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Fo(my,e.__scopeDialog);return o.modal?u.jsx(Wn,{present:r||o.open,children:u.jsx(xve,{...i,ref:t})}):null});fV.displayName=my;var bve=bd("DialogOverlay.RemoveScroll"),xve=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Fo(my,n);return u.jsx(Jb,{as:bve,allowPinchZoom:!0,shards:[i.contentRef],children:u.jsx(Ke.div,{"data-state":Tj(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),yc="DialogContent",mV=x.forwardRef((e,t)=>{const n=uV(yc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Fo(yc,e.__scopeDialog);return u.jsx(Wn,{present:r||o.open,children:o.modal?u.jsx(wve,{...i,ref:t}):u.jsx(Sve,{...i,ref:t})})});mV.displayName=yc;var wve=x.forwardRef((e,t)=>{const n=Fo(yc,e.__scopeDialog),r=x.useRef(null),i=ut(t,n.contentRef,r);return x.useEffect(()=>{const o=r.current;if(o)return Rj(o)},[]),u.jsx(pV,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:je(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:je(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&o.preventDefault()}),onFocusOutside:je(e.onFocusOutside,o=>o.preventDefault())})}),Sve=x.forwardRef((e,t)=>{const n=Fo(yc,e.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return u.jsx(pV,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;n.triggerRef.current?.contains(a)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),pV=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,c=Fo(yc,n),d=x.useRef(null),f=ut(t,d);return jj(),u.jsxs(u.Fragment,{children:[u.jsx(Xb,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:u.jsx(Kd,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Tj(c.open),...a,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(_ve,{titleId:c.titleId}),u.jsx(Eve,{contentRef:d,descriptionId:c.descriptionId})]})]})}),Nj="DialogTitle",hV=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Fo(Nj,n);return u.jsx(Ke.h2,{id:i.titleId,...r,ref:t})});hV.displayName=Nj;var gV="DialogDescription",vV=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Fo(gV,n);return u.jsx(Ke.p,{id:i.descriptionId,...r,ref:t})});vV.displayName=gV;var yV="DialogClose",bV=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Fo(yV,n);return u.jsx(Ke.button,{type:"button",...r,ref:t,onClick:je(e.onClick,()=>i.onOpenChange(!1))})});bV.displayName=yV;function Tj(e){return e?"open":"closed"}var xV="DialogTitleWarning",[RAe,wV]=Zse(xV,{contentName:yc,titleName:Nj,docsSlug:"dialog"}),_ve=({titleId:e})=>{const t=wV(xV),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
109
|
-
|
|
110
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
111
|
-
|
|
112
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Cve="DialogDescriptionWarning",Eve=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${wV(Cve).contentName}}.`;return x.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},kve=sV,jve=cV,Rve=dV,Ive=fV,Nve=mV,Tve=hV,Ave=vV,Ove=bV;function zn({...e}){return u.jsx(kve,{"data-slot":"dialog",...e})}function SV({...e}){return u.jsx(jve,{"data-slot":"dialog-trigger",...e})}function Dve({...e}){return u.jsx(Rve,{"data-slot":"dialog-portal",...e})}function $ve({className:e,...t}){return u.jsx(Ive,{"data-slot":"dialog-overlay",className:Pe("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black-dark/90",e),...t})}function Ln({className:e,children:t,...n}){return u.jsxs(Dve,{"data-slot":"dialog-portal",children:[u.jsx($ve,{}),u.jsxs(Nve,{"data-slot":"dialog-content",className:Pe("bg-black data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] lg:max-w-2xl max-h-screen overflow-y-auto translate-x-[-50%] translate-y-[-50%] gap-4 rounded-md p-6 shadow-lg duration-200",e),...n,children:[t,u.jsxs(Ove,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[u.jsx(VP,{className:"text-white"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function yr({className:e,...t}){return u.jsx("div",{"data-slot":"dialog-header",className:Pe("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Un({className:e,...t}){return u.jsx("div",{"data-slot":"dialog-footer",className:Pe("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Nn({className:e,...t}){return u.jsx(Tve,{"data-slot":"dialog-title",className:Pe("text-lg leading-none text-white font-semibold",e),...t})}function jr({className:e,...t}){return u.jsx(Ave,{"data-slot":"dialog-description",className:Pe("text-muted-foreground text-sm",e),...t})}function tx({typeOfThingBeingDeleted:e,nameOfThingBeingDeleted:t,isModalOpen:n,hideDataLossWarning:r,setIsModalOpen:i,deletionConfirmed:o,deletionPending:a,trigger:c,presentParticiple:d="Deleting",transitiveVerb:f="Delete"}){return u.jsxs(zn,{open:n,onOpenChange:i,children:[c&&u.jsx(SV,{asChild:!0,children:c}),u.jsxs(Ln,{className:"sm:max-w-[750px]",children:[u.jsxs(yr,{children:[u.jsxs(Nn,{children:["Are you sure you want to ",f.toLowerCase()," this ",e,"?"]}),u.jsx(jr,{children:"This action cannot be undone."})]}),!r&&u.jsxs("div",{className:"p-3 my-5 text-white rounded-md bg-amber-600",children:[u.jsxs("p",{className:"flex space-x-1 font-semibold align-baseline",children:[u.jsx(UQ,{className:"inline-block size-5"})," ",u.jsx("span",{children:"Warning"})]}),u.jsxs("p",{className:"pt-2 text-base",children:["By ",d.toLowerCase()," ",e,u.jsxs("span",{className:"font-semibold",children:[" ",t," "]}),"you will lose the data stored in it permanently."]})]}),u.jsx(Un,{children:u.jsxs("div",{className:"flex justify-center space-x-5",children:[u.jsxs(be,{className:"rounded-full",onClick:()=>i(!1),children:[u.jsx(mc,{})," Cancel"]}),u.jsxs(be,{variant:"destructive",className:"rounded-full",onClick:o,disabled:a,children:[u.jsx(ts,{})," ",f]})]})})]})]})}function zo({className:e,variant:t,asChild:n=!1,...r}){const i=n?$C:"span";return u.jsx(i,{"data-slot":"badge",className:Pe(mL({variant:t}),e),...r})}var qS="rovingFocusGroup.onEntryFocus",Mve={bubbles:!1,cancelable:!0},Xp="RovingFocusGroup",[$1,_V,Pve]=Tp(Xp),[zve,nf]=Pi(Xp,[Pve]),[Lve,Uve]=zve(Xp),CV=x.forwardRef((e,t)=>u.jsx($1.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx($1.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(Fve,{...e,ref:t})})}));CV.displayName=Xp;var Fve=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:p=!1,...h}=e,v=x.useRef(null),y=ut(t,v),b=Tc(o),[S,C]=Do({prop:a,defaultProp:c??null,onChange:d,caller:Xp}),[E,k]=x.useState(!1),j=bn(f),I=_V(n),A=x.useRef(!1),[N,T]=x.useState(0);return x.useEffect(()=>{const z=v.current;if(z)return z.addEventListener(qS,j),()=>z.removeEventListener(qS,j)},[j]),u.jsx(Lve,{scope:n,orientation:r,dir:b,loop:i,currentTabStopId:S,onItemFocus:x.useCallback(z=>C(z),[C]),onItemShiftTab:x.useCallback(()=>k(!0),[]),onFocusableItemAdd:x.useCallback(()=>T(z=>z+1),[]),onFocusableItemRemove:x.useCallback(()=>T(z=>z-1),[]),children:u.jsx(Ke.div,{tabIndex:E||N===0?-1:0,"data-orientation":r,...h,ref:y,style:{outline:"none",...e.style},onMouseDown:je(e.onMouseDown,()=>{A.current=!0}),onFocus:je(e.onFocus,z=>{const L=!A.current;if(z.target===z.currentTarget&&L&&!E){const G=new CustomEvent(qS,Mve);if(z.currentTarget.dispatchEvent(G),!G.defaultPrevented){const J=I().filter(M=>M.focusable),Y=J.find(M=>M.active),W=J.find(M=>M.id===S),Z=[Y,W,...J].filter(Boolean).map(M=>M.ref.current);jV(Z,p)}}A.current=!1}),onBlur:je(e.onBlur,()=>k(!1))})})}),EV="RovingFocusGroupItem",kV=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:a,...c}=e,d=Ni(),f=o||d,p=Uve(EV,n),h=p.currentTabStopId===f,v=_V(n),{onFocusableItemAdd:y,onFocusableItemRemove:b,currentTabStopId:S}=p;return x.useEffect(()=>{if(r)return y(),()=>b()},[r,y,b]),u.jsx($1.ItemSlot,{scope:n,id:f,focusable:r,active:i,children:u.jsx(Ke.span,{tabIndex:h?0:-1,"data-orientation":p.orientation,...c,ref:t,onMouseDown:je(e.onMouseDown,C=>{r?p.onItemFocus(f):C.preventDefault()}),onFocus:je(e.onFocus,()=>p.onItemFocus(f)),onKeyDown:je(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){p.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const E=Hve(C,p.orientation,p.dir);if(E!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let j=v().filter(I=>I.focusable).map(I=>I.ref.current);if(E==="last")j.reverse();else if(E==="prev"||E==="next"){E==="prev"&&j.reverse();const I=j.indexOf(C.currentTarget);j=p.loop?qve(j,I+1):j.slice(I+1)}setTimeout(()=>jV(j))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:S!=null}):a})})});kV.displayName=EV;var Vve={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Bve(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Hve(e,t,n){const r=Bve(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Vve[r]}function jV(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function qve(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Aj=CV,Oj=kV,M1=["Enter"," "],Gve=["ArrowDown","PageUp","Home"],RV=["ArrowUp","PageDown","End"],Kve=[...Gve,...RV],Zve={ltr:[...M1,"ArrowRight"],rtl:[...M1,"ArrowLeft"]},Yve={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Qp="Menu",[sp,Wve,Xve]=Tp(Qp),[Mc,IV]=Pi(Qp,[Xve,Qd,nf]),nx=Qd(),NV=nf(),[Qve,Pc]=Mc(Qp),[Jve,Jp]=Mc(Qp),TV=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,c=nx(t),[d,f]=x.useState(null),p=x.useRef(!1),h=bn(o),v=Tc(i);return x.useEffect(()=>{const y=()=>{p.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>p.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),u.jsx(EE,{...c,children:u.jsx(Qve,{scope:t,open:n,onOpenChange:h,content:d,onContentChange:f,children:u.jsx(Jve,{scope:t,onClose:x.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:p,dir:v,modal:a,children:r})})})};TV.displayName=Qp;var eye="MenuAnchor",Dj=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=nx(n);return u.jsx(kE,{...i,...r,ref:t})});Dj.displayName=eye;var $j="MenuPortal",[tye,AV]=Mc($j,{forceMount:void 0}),OV=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=Pc($j,t);return u.jsx(tye,{scope:t,forceMount:n,children:u.jsx(Wn,{present:n||o.open,children:u.jsx(Op,{asChild:!0,container:i,children:r})})})};OV.displayName=$j;var lo="MenuContent",[nye,Mj]=Mc(lo),DV=x.forwardRef((e,t)=>{const n=AV(lo,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Pc(lo,e.__scopeMenu),a=Jp(lo,e.__scopeMenu);return u.jsx(sp.Provider,{scope:e.__scopeMenu,children:u.jsx(Wn,{present:r||o.open,children:u.jsx(sp.Slot,{scope:e.__scopeMenu,children:a.modal?u.jsx(rye,{...i,ref:t}):u.jsx(iye,{...i,ref:t})})})})}),rye=x.forwardRef((e,t)=>{const n=Pc(lo,e.__scopeMenu),r=x.useRef(null),i=ut(t,r);return x.useEffect(()=>{const o=r.current;if(o)return Rj(o)},[]),u.jsx(Pj,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:je(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),iye=x.forwardRef((e,t)=>{const n=Pc(lo,e.__scopeMenu);return u.jsx(Pj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),oye=bd("MenuContent.ScrollLock"),Pj=x.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:v,onDismiss:y,disableOutsideScroll:b,...S}=e,C=Pc(lo,n),E=Jp(lo,n),k=nx(n),j=NV(n),I=Wve(n),[A,N]=x.useState(null),T=x.useRef(null),z=ut(t,T,C.onContentChange),L=x.useRef(0),G=x.useRef(""),J=x.useRef(0),Y=x.useRef(null),W=x.useRef("right"),F=x.useRef(0),Z=b?Jb:x.Fragment,M=b?{as:oye,allowPinchZoom:!0}:void 0,K=te=>{const D=G.current+te,P=I().filter(B=>!B.disabled),V=document.activeElement,O=P.find(B=>B.ref.current===V)?.textValue,ee=P.map(B=>B.textValue),ue=vye(ee,D,O),pe=P.find(B=>B.textValue===ue)?.ref.current;(function B(ie){G.current=ie,window.clearTimeout(L.current),ie!==""&&(L.current=window.setTimeout(()=>B(""),1e3))})(D),pe&&setTimeout(()=>pe.focus())};x.useEffect(()=>()=>window.clearTimeout(L.current),[]),jj();const U=x.useCallback(te=>W.current===Y.current?.side&&bye(te,Y.current?.area),[]);return u.jsx(nye,{scope:n,searchRef:G,onItemEnter:x.useCallback(te=>{U(te)&&te.preventDefault()},[U]),onItemLeave:x.useCallback(te=>{U(te)||(T.current?.focus(),N(null))},[U]),onTriggerLeave:x.useCallback(te=>{U(te)&&te.preventDefault()},[U]),pointerGraceTimerRef:J,onPointerGraceIntentChange:x.useCallback(te=>{Y.current=te},[]),children:u.jsx(Z,{...M,children:u.jsx(Xb,{asChild:!0,trapped:i,onMountAutoFocus:je(o,te=>{te.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:u.jsx(Kd,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:v,onDismiss:y,children:u.jsx(Aj,{asChild:!0,...j,dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:N,onEntryFocus:je(d,te=>{E.isUsingKeyboardRef.current||te.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(jE,{role:"menu","aria-orientation":"vertical","data-state":WV(C.open),"data-radix-menu-content":"",dir:E.dir,...k,...S,ref:z,style:{outline:"none",...S.style},onKeyDown:je(S.onKeyDown,te=>{const P=te.target.closest("[data-radix-menu-content]")===te.currentTarget,V=te.ctrlKey||te.altKey||te.metaKey,O=te.key.length===1;P&&(te.key==="Tab"&&te.preventDefault(),!V&&O&&K(te.key));const ee=T.current;if(te.target!==ee||!Kve.includes(te.key))return;te.preventDefault();const pe=I().filter(B=>!B.disabled).map(B=>B.ref.current);RV.includes(te.key)&&pe.reverse(),hye(pe)}),onBlur:je(e.onBlur,te=>{te.currentTarget.contains(te.target)||(window.clearTimeout(L.current),G.current="")}),onPointerMove:je(e.onPointerMove,lp(te=>{const D=te.target,P=F.current!==te.clientX;if(te.currentTarget.contains(D)&&P){const V=te.clientX>F.current?"right":"left";W.current=V,F.current=te.clientX}}))})})})})})})});DV.displayName=lo;var aye="MenuGroup",zj=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Ke.div,{role:"group",...r,ref:t})});zj.displayName=aye;var sye="MenuLabel",$V=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Ke.div,{...r,ref:t})});$V.displayName=sye;var py="MenuItem",b2="menu.itemSelect",rx=x.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=x.useRef(null),a=Jp(py,e.__scopeMenu),c=Mj(py,e.__scopeMenu),d=ut(t,o),f=x.useRef(!1),p=()=>{const h=o.current;if(!n&&h){const v=new CustomEvent(b2,{bubbles:!0,cancelable:!0});h.addEventListener(b2,y=>r?.(y),{once:!0}),Gv(h,v),v.defaultPrevented?f.current=!1:a.onClose()}};return u.jsx(MV,{...i,ref:d,disabled:n,onClick:je(e.onClick,p),onPointerDown:h=>{e.onPointerDown?.(h),f.current=!0},onPointerUp:je(e.onPointerUp,h=>{f.current||h.currentTarget?.click()}),onKeyDown:je(e.onKeyDown,h=>{const v=c.searchRef.current!=="";n||v&&h.key===" "||M1.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});rx.displayName=py;var MV=x.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=Mj(py,n),c=NV(n),d=x.useRef(null),f=ut(t,d),[p,h]=x.useState(!1),[v,y]=x.useState("");return x.useEffect(()=>{const b=d.current;b&&y((b.textContent??"").trim())},[o.children]),u.jsx(sp.ItemSlot,{scope:n,disabled:r,textValue:i??v,children:u.jsx(Oj,{asChild:!0,...c,focusable:!r,children:u.jsx(Ke.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:f,onPointerMove:je(e.onPointerMove,lp(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:je(e.onPointerLeave,lp(b=>a.onItemLeave(b))),onFocus:je(e.onFocus,()=>h(!0)),onBlur:je(e.onBlur,()=>h(!1))})})})}),lye="MenuCheckboxItem",PV=x.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return u.jsx(VV,{scope:e.__scopeMenu,checked:n,children:u.jsx(rx,{role:"menuitemcheckbox","aria-checked":hy(n)?"mixed":n,...i,ref:t,"data-state":Uj(n),onSelect:je(i.onSelect,()=>r?.(hy(n)?!0:!n),{checkForDefaultPrevented:!1})})})});PV.displayName=lye;var zV="MenuRadioGroup",[cye,uye]=Mc(zV,{value:void 0,onValueChange:()=>{}}),LV=x.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=bn(r);return u.jsx(cye,{scope:e.__scopeMenu,value:n,onValueChange:o,children:u.jsx(zj,{...i,ref:t})})});LV.displayName=zV;var UV="MenuRadioItem",FV=x.forwardRef((e,t)=>{const{value:n,...r}=e,i=uye(UV,e.__scopeMenu),o=n===i.value;return u.jsx(VV,{scope:e.__scopeMenu,checked:o,children:u.jsx(rx,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":Uj(o),onSelect:je(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});FV.displayName=UV;var Lj="MenuItemIndicator",[VV,dye]=Mc(Lj,{checked:!1}),BV=x.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=dye(Lj,n);return u.jsx(Wn,{present:r||hy(o.checked)||o.checked===!0,children:u.jsx(Ke.span,{...i,ref:t,"data-state":Uj(o.checked)})})});BV.displayName=Lj;var fye="MenuSeparator",HV=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Ke.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});HV.displayName=fye;var mye="MenuArrow",qV=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=nx(n);return u.jsx(RE,{...i,...r,ref:t})});qV.displayName=mye;var pye="MenuSub",[IAe,GV]=Mc(pye),Nm="MenuSubTrigger",KV=x.forwardRef((e,t)=>{const n=Pc(Nm,e.__scopeMenu),r=Jp(Nm,e.__scopeMenu),i=GV(Nm,e.__scopeMenu),o=Mj(Nm,e.__scopeMenu),a=x.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=o,f={__scopeMenu:e.__scopeMenu},p=x.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return x.useEffect(()=>p,[p]),x.useEffect(()=>{const h=c.current;return()=>{window.clearTimeout(h),d(null)}},[c,d]),u.jsx(Dj,{asChild:!0,...f,children:u.jsx(MV,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":WV(n.open),...e,ref:Fd(t,i.onTriggerChange),onClick:h=>{e.onClick?.(h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:je(e.onPointerMove,lp(h=>{o.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:je(e.onPointerLeave,lp(h=>{p();const v=n.content?.getBoundingClientRect();if(v){const y=n.content?.dataset.side,b=y==="right",S=b?-5:5,C=v[b?"left":"right"],E=v[b?"right":"left"];o.onPointerGraceIntentChange({area:[{x:h.clientX+S,y:h.clientY},{x:C,y:v.top},{x:E,y:v.top},{x:E,y:v.bottom},{x:C,y:v.bottom}],side:y}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(h),h.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:je(e.onKeyDown,h=>{const v=o.searchRef.current!=="";e.disabled||v&&h.key===" "||Zve[r.dir].includes(h.key)&&(n.onOpenChange(!0),n.content?.focus(),h.preventDefault())})})})});KV.displayName=Nm;var ZV="MenuSubContent",YV=x.forwardRef((e,t)=>{const n=AV(lo,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Pc(lo,e.__scopeMenu),a=Jp(lo,e.__scopeMenu),c=GV(ZV,e.__scopeMenu),d=x.useRef(null),f=ut(t,d);return u.jsx(sp.Provider,{scope:e.__scopeMenu,children:u.jsx(Wn,{present:r||o.open,children:u.jsx(sp.Slot,{scope:e.__scopeMenu,children:u.jsx(Pj,{id:c.contentId,"aria-labelledby":c.triggerId,...i,ref:f,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{a.isUsingKeyboardRef.current&&d.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:je(e.onFocusOutside,p=>{p.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:je(e.onEscapeKeyDown,p=>{a.onClose(),p.preventDefault()}),onKeyDown:je(e.onKeyDown,p=>{const h=p.currentTarget.contains(p.target),v=Yve[a.dir].includes(p.key);h&&v&&(o.onOpenChange(!1),c.trigger?.focus(),p.preventDefault())})})})})})});YV.displayName=ZV;function WV(e){return e?"open":"closed"}function hy(e){return e==="indeterminate"}function Uj(e){return hy(e)?"indeterminate":e?"checked":"unchecked"}function hye(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function gye(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function vye(e,t,n){const i=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=gye(e,Math.max(o,0));i.length===1&&(a=a.filter(f=>f!==n));const d=a.find(f=>f.toLowerCase().startsWith(i.toLowerCase()));return d!==n?d:void 0}function yye(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const c=t[o],d=t[a],f=c.x,p=c.y,h=d.x,v=d.y;p>r!=v>r&&n<(h-f)*(r-p)/(v-p)+f&&(i=!i)}return i}function bye(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return yye(n,t)}function lp(e){return t=>t.pointerType==="mouse"?e(t):void 0}var xye=TV,wye=Dj,Sye=OV,_ye=DV,Cye=zj,Eye=$V,kye=rx,jye=PV,Rye=LV,Iye=FV,Nye=BV,Tye=HV,Aye=qV,Oye=KV,Dye=YV,ix="DropdownMenu",[$ye]=Pi(ix,[IV]),Vr=IV(),[Mye,XV]=$ye(ix),QV=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:a,modal:c=!0}=e,d=Vr(t),f=x.useRef(null),[p,h]=Do({prop:i,defaultProp:o??!1,onChange:a,caller:ix});return u.jsx(Mye,{scope:t,triggerId:Ni(),triggerRef:f,contentId:Ni(),open:p,onOpenChange:h,onOpenToggle:x.useCallback(()=>h(v=>!v),[h]),modal:c,children:u.jsx(xye,{...d,open:p,onOpenChange:h,dir:r,modal:c,children:n})})};QV.displayName=ix;var JV="DropdownMenuTrigger",eB=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=XV(JV,n),a=Vr(n);return u.jsx(wye,{asChild:!0,...a,children:u.jsx(Ke.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:Fd(t,o.triggerRef),onPointerDown:je(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(o.onOpenToggle(),o.open||c.preventDefault())}),onKeyDown:je(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&o.onOpenToggle(),c.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});eB.displayName=JV;var Pye="DropdownMenuPortal",tB=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Vr(t);return u.jsx(Sye,{...r,...n})};tB.displayName=Pye;var nB="DropdownMenuContent",rB=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=XV(nB,n),o=Vr(n),a=x.useRef(!1);return u.jsx(_ye,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:t,onCloseAutoFocus:je(e.onCloseAutoFocus,c=>{a.current||i.triggerRef.current?.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:je(e.onInteractOutside,c=>{const d=c.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,p=d.button===2||f;(!i.modal||p)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});rB.displayName=nB;var zye="DropdownMenuGroup",Lye=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return u.jsx(Cye,{...i,...r,ref:t})});Lye.displayName=zye;var Uye="DropdownMenuLabel",iB=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return u.jsx(Eye,{...i,...r,ref:t})});iB.displayName=Uye;var Fye="DropdownMenuItem",oB=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return u.jsx(kye,{...i,...r,ref:t})});oB.displayName=Fye;var Vye="DropdownMenuCheckboxItem",aB=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return u.jsx(jye,{...i,...r,ref:t})});aB.displayName=Vye;var Bye="DropdownMenuRadioGroup",Hye=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return u.jsx(Rye,{...i,...r,ref:t})});Hye.displayName=Bye;var qye="DropdownMenuRadioItem",Gye=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return u.jsx(Iye,{...i,...r,ref:t})});Gye.displayName=qye;var Kye="DropdownMenuItemIndicator",sB=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return u.jsx(Nye,{...i,...r,ref:t})});sB.displayName=Kye;var Zye="DropdownMenuSeparator",lB=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return u.jsx(Tye,{...i,...r,ref:t})});lB.displayName=Zye;var Yye="DropdownMenuArrow",Wye=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return u.jsx(Aye,{...i,...r,ref:t})});Wye.displayName=Yye;var Xye="DropdownMenuSubTrigger",Qye=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return u.jsx(Oye,{...i,...r,ref:t})});Qye.displayName=Xye;var Jye="DropdownMenuSubContent",ebe=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return u.jsx(Dye,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ebe.displayName=Jye;var tbe=QV,nbe=eB,rbe=tB,ibe=rB,obe=iB,abe=oB,sbe=aB,lbe=sB,cbe=lB;function eh({...e}){return u.jsx(tbe,{"data-slot":"dropdown-menu",...e})}function th({...e}){return u.jsx(nbe,{"data-slot":"dropdown-menu-trigger",...e})}function nh({className:e,sideOffset:t=4,...n}){return u.jsx(rbe,{children:u.jsx(ibe,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Pe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-grey-700 p-1 shadow-md",e),...n})})}function pr({className:e,inset:t,variant:n="default",...r}){return u.jsx(abe,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Pe("focus:bg-accent focus:text-grey data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function ube({className:e,children:t,checked:n,...r}){return u.jsxs(sbe,{"data-slot":"dropdown-menu-checkbox-item",className:Pe("focus:bg-primary relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[u.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:u.jsx(lbe,{children:u.jsx(MC,{className:"size-4"})})}),t]})}function gy({className:e,inset:t,...n}){return u.jsx(obe,{"data-slot":"dropdown-menu-label","data-inset":t,className:Pe("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function vy({className:e,...t}){return u.jsx(cbe,{"data-slot":"dropdown-menu-separator",className:Pe("bg-grey-700 -mx-1 my-1 h-px",e),...t})}function Fj(e){return!!e?.plans?.[0]?.planId?.startsWith("self-hosted")}function Vj({cluster:e}){const t=Ja(e.id),{view:n,update:r}=vb(e.organizationId,e.id),o=!Tt.checkForFabricConnect(e.id)&&!!t.user;if(n){if(!e.fqdn)return u.jsx(Ge,{to:`/${e.organizationId}/${e.id}/instances`,className:"text-sm text-nowrap","aria-label":`View ${e.name}`,title:`View ${e.name}`,children:u.jsxs("span",{className:"py-2 hover:border-b-2",children:["Instances ",u.jsx(ro,{className:"inline-block"})]})});if(e.resetPassword)return r?u.jsx(Ge,{to:`/${e.organizationId}/${e.id}/finish-setup`,className:"text-sm text-nowrap","aria-label":`Set Password on ${e.name}`,title:`Set Password on ${e.name}`,children:u.jsxs(be,{variant:"positive",className:"py-2 hover:border-b-2 animate-glow-pulse",children:["Finish Setup ",u.jsx(ro,{className:"inline-block"})]})}):u.jsx("span",{className:"py-2 text-nowrap",children:"Pending Owner Setup"});if(!t.isLoading)return o?u.jsx(Ge,{to:`/${e.organizationId}/${e.id}${oa}`,className:"text-sm text-nowrap","aria-label":`View ${e.name}`,title:`View ${e.name}`,children:u.jsxs("span",{className:"py-2 hover:border-b-2",children:["Direct Connect ",u.jsx(ro,{className:"inline-block"})]})}):r&&!Fj(e)?u.jsx(Ge,{to:`/${e.organizationId}/${e.id}${oa}`,className:"text-sm text-nowrap","aria-label":`Connect to ${e.name}`,title:`Connect to ${e.name}`,children:u.jsxs("span",{className:"py-2 hover:border-b-2",children:["Fabric Connect ",u.jsx(ro,{className:"inline-block"})]})}):u.jsx(Ge,{to:`/${e.organizationId}/${e.id}/sign-in`,className:"text-sm text-nowrap","aria-label":`Sign In to ${e.name}`,title:`Sign In to ${e.name}`,children:u.jsxs("span",{className:"py-2 hover:border-b-2",children:["Direct Sign In ",u.jsx(ro,{className:"inline-block"})]})})}}function dbe(e,t){const n=[];if(e)for(const r of e)n.push(r[t]);return n}function cp({cluster:e,forceProgressBarVisible:t}){const[n,r]=x.useState(t||!1),{data:i}=Mt(Oc(n&&e.id,2e3));x.useEffect(function(){(T1(e.status)||A1(e.status))&&r(!0)},[n,e.status,i?.instances]);const o=x.useMemo(()=>{const a=dbe(i?.plans??[],"planId"),c=i?.instances??[];let d=0;const f={};let p=0;const h={};let v=0;const y={};let b=0;const S={};for(const E of c){const k=E.status;!k||kj(k)||(T1(k)?(d+=1,f[k]=`${d} ${Eo(k)}`):A1(k)?(p+=1,h[k]=`${p} ${Eo(k)}`):Wp(k)?(b+=1,S[k]=`${b} ${Eo(k)}`):!E.planId||!a.includes(E.planId)?(p+=1,h.DRAINING_TRAFFIC=`${p} ${Eo("Draining Traffic")}`):W5(k)&&(v+=1,y[k]=`${v} ${Eo(k)}`))}const C=d+p+v;return{pendingWidth:`${C===0?100:d===0?0:d/C*100}%`,updatingWidth:`${p===0?0:p/C*100}%`,failedWidth:`${b===0?0:b/C*100}%`,runningWidth:`${v===0?0:v/C*100}%`,text:[...Object.values(y).sort(),...Object.values(S).sort(),...Object.values(h).sort(),...Object.values(f).sort()].join(" · ")}},[i]);return n?u.jsxs("div",{className:"w-full text-center",children:[u.jsxs("div",{className:"w-full h-2.5 rounded-full overflow-clip flex shadow",children:[u.jsx("div",{style:{width:o.runningWidth},className:"grow bg-green/80 transition-[width] duration-1000 ease-in-out motion-reduce:transition-none"}),u.jsx("div",{style:{width:o.failedWidth},className:"grow bg-red/80 transition-[width] duration-1000 ease-in-out motion-reduce:transition-none"}),u.jsx("div",{style:{width:o.updatingWidth},className:"grow animate-pulse bg-yellow/80 transition-[width] duration-1000 ease-in-out motion-reduce:transition-none"}),u.jsx("div",{style:{width:o.pendingWidth},className:"grow bg-gray-600 transition-[width] duration-1000 ease-in-out motion-reduce:transition-none"})]}),o.text&&u.jsx("div",{className:"text-xs text-muted-foreground font-light mt-2",children:o.text})]}):null}async function cB(e){const{data:t}=await Ut.delete(`/Cluster/${e}`,{timeout:0});return t}function fbe(){return at({mutationFn:e=>cB(e)})}function uB(...e){return x.useMemo(()=>e.map(t=>(()=>{navigator.clipboard.writeText(t),_e.info("Copied to clipboard!",{icon:u.jsx(vX,{}),duration:1e3})})),e)}function Bj(e){try{return e==="null"||e==="undefined"||e===null||e===void 0?null:JSON.parse(e)}catch(t){return console.error("safeParse failed to parse value, returning null instead",t),null}}function mbe(e,t){return Bj(localStorage.getItem(e))??t}function pbe(e,t){t==null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(t))}function rf(e,t){const n=x.useState(mbe(e,t)),[r]=n;return x.useEffect(()=>pbe(e,r),[e,r]),n}var zc=(e=>(e.SavedClusterState="SavedClusterState",e))(zc||{});function hbe({cluster:e}){const t=an(),n=gr(),r=x.useMemo(()=>kC(e),[e]),i=pb(r),o=Ja(e.id),[,a]=rf(zc.SavedClusterState,null),{view:c,update:d,remove:f,create:p}=vb(e.organizationId,e.id),{mutate:h,isPending:v}=fbe(),[y,b]=x.useState(!1),[S,C]=x.useState(!1),E=x.useMemo(()=>e.status&&Ab.includes(e.status),[e.status]),k=Fj(e),j=Tt.checkForFabricConnect(e.id),I=!j&&!!o.user,A=x.useMemo(()=>e.status&&zE.includes(e.status),[e.status]),N=x.useMemo(()=>e.status&&Wp(e.status),[e.status]),T=x.useCallback(async()=>{b(!0);const F=await LE(e.id).catch(Z=>(console.error("Failed to lookup cluster details, proceeding without checking instances.",Z),null));if(await bp({entityId:e.id,instanceClient:i}),F?.instances?.length)for(const Z of F.instances)Tt.setUserForEntity(Z,null);Tt.setUserForEntity(e,null)},[e,i]),z=x.useCallback(()=>{a(e),t.navigate({to:`/${e.organizationId}/new-cluster`})},[e,t,a]),L=x.useCallback(()=>C(!0),[]),G=x.useCallback(()=>{const F=e.organizationId;h(e.id,{onSuccess:async()=>{await n.invalidateQueries({queryKey:[F],refetchType:"active"}),await t.invalidate(),_e.success("Success",{description:k?"Cluster successfully removed.":"Cluster successfully terminated.",duration:5e3,action:{label:"Dismiss",onClick:()=>_e.dismiss()}}),C(!1)},onError:()=>{_e.error("Error",{description:k?`Failed to remove cluster: ${e.name}`:`Failed to terminate cluster: ${e.name}.`,duration:5e3,action:{label:"Dismiss",onClick:()=>_e.dismiss()}}),C(!1)}})},[t,e.organizationId,e.id,e.name,h,k,n]),[J,Y]=uB(`${e.fqdn}`,`https://${e.fqdn}`),W=[E&&d&&!o.isLoading&&(!I||j)&&u.jsx(Ge,{to:`${e.id}/sign-in`,disabled:y,children:u.jsx(pr,{children:"Direct Sign In"})}),E&&d&&u.jsx(Ge,{to:`${e.id}/edit`,disabled:y,children:u.jsx(pr,{children:"Edit"})}),E&&c&&u.jsx(Ge,{to:`${e.id}/instances`,disabled:y,children:u.jsx(pr,{children:"Instances"})}),E&&c&&e.fqdn&&u.jsx(pr,{onClick:J,disabled:y,children:"Copy Host Name"}),E&&c&&e.fqdn&&u.jsx(pr,{onClick:Y,disabled:y,children:"Copy API URL"}),E&&c&&!!r&&!o.isLoading&&I&&u.jsx(pr,{onClick:T,disabled:y,children:"Direct Sign Out"}),N&&p&&u.jsx(pr,{className:"focus:bg-green/70 focus:text-white",onClick:z,children:"Try Again"}),!A&&f&&u.jsx(pr,{className:"focus:bg-red/70 focus:text-white",onClick:L,children:k?"Remove":"Terminate"})].filter(fa);return u.jsxs(fc,{className:"relative h-full justify-between",children:[u.jsxs(ul,{children:[u.jsxs(Cc,{className:"flex items-center justify-between",children:[e.fqdn?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"truncate max-w-48",children:e.fqdn}),u.jsx(TP,{onClick:J,size:16,className:"cursor-pointer"}),u.jsx("span",{className:"grow"})]}):u.jsx("span",{children:"Self-Hosted"}),!A&&u.jsxs(eh,{children:[u.jsx(th,{children:u.jsx(PC,{"aria-label":"Cluster options"})}),u.jsxs(nh,{children:[!N&&u.jsxs(u.Fragment,{children:[u.jsx(gy,{className:"text-gray-600 text-xs",children:"Plans"}),e.plans?.map(F=>u.jsxs(gy,{children:[F.planId," / ",F.regionId,u.jsx("br",{}),"Auto Renewal ",u.jsx(zo,{variant:"success",children:"ON"})]},F.planId+F.regionId)),W.length>0&&u.jsx(vy,{})]}),...W]})]})]}),u.jsx(dl,{children:u.jsx("h2",{children:e.name})})]}),u.jsxs(es,{className:"flex items-center justify-between gap-2",children:[u.jsx(cp,{cluster:e}),E&&c&&u.jsx(Vj,{cluster:e}),N&&e.status&&u.jsxs(u.Fragment,{children:[u.jsx(zo,{variant:Y5(e.status),children:Eo(e.status)}),u.jsx("span",{className:"text-xs",children:'Click "..." to choose how to proceed.'})]})]}),u.jsx(tx,{typeOfThingBeingDeleted:"cluster",transitiveVerb:k?"Remove":"Terminate",presentParticiple:k?"Removing":"Terminating",nameOfThingBeingDeleted:e.name,isModalOpen:S,hideDataLossWarning:k,setIsModalOpen:F=>C(F),deletionConfirmed:G,deletionPending:v})]})}function al({overEmail:e}){return u.jsx("a",{href:e?"mailto:support@harperdb.io":"https://discord.com/channels/1415002037439041710/1415002038286286994",target:"_blank",className:"underline",children:"Contact us"})}function Ui({className:e,text:t,centered:n,...r}){const i=n?"flex flex-col items-center justify-center":"";return u.jsxs("div",{className:`text-white h-full w-full ${e||""} ${i}`,...r,children:[u.jsx("img",{src:"/HDBDogOnly.svg",width:"100px",height:"100px",alt:"HDB Dog Logo Loading",className:"inline-block"}),u.jsx("p",{className:"pt-4",children:t||"Loading..."})]})}function Kg({children:e}){return u.jsxs(u.Fragment,{children:[u.jsx(rs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))] relative",children:e})]})}async function gbe(e){const{data:t}=await Ut.get("/Plan/",{params:{organizationId:e}});return t}function vbe(e){return{queryKey:[e,"instancePlan"],queryFn:()=>gbe(e),retry:!1}}async function ybe({organizationId:e,availableHosts:t}={}){const{data:n}=await Ut.get("/Region/",{params:{availableHosts:t,organizationId:e}});return n}function x2({organizationId:e,availableHosts:t}={}){return{queryKey:[e,"regionLocations",t],queryFn:()=>ybe({organizationId:e,availableHosts:t}),retry:!1}}function P1(e){return(t,n)=>t[e]===n[e]?0:t[e]>n[e]?1:-1}function w2(e){const t=e.split(".").map(Number);return(t[0]<<24|t[1]<<16|t[2]<<8|t[3])>>>0}function S2(e){return typeof e!="string"?!1:/^(?:25[0-5]|2[0-4]\d|1?\d?\d)(?:\.(?:25[0-5]|2[0-4]\d|1?\d?\d)){3}$/.test(e)}function dB(e,t){return e.instanceFqdn===t.instanceFqdn?e.operationsApiPort-t.operationsApiPort:S2(e.instanceFqdn)&&S2(t.instanceFqdn)?w2(e.instanceFqdn)-w2(t.instanceFqdn):e.instanceFqdn>t.instanceFqdn?1:-1}function bbe(e,t){const n={};for(const r of e){const i=r[t];if(i!==void 0)if(Array.isArray(i))for(const o of i)n[o]||(n[o]=[]),n[o].push(r);else n[i]||(n[i]=[]),n[i].push(r)}return n}function of(e,t){const n={};for(const r of e){const i=r[t];if(i!==void 0)if(Array.isArray(i))for(const o of i)n[o]=r;else n[i]=r}return n}function z1(e,t,n){const r=bbe(e,t),i={};for(const o in r)i[o]=of(r[o],n);return i}function up({width:e,className:t,animated:n,placeholder:r}){return u.jsxs("div",{className:aa("w-full bg-gray-200 rounded-full relative",r?"h-6":"h-2.5"),children:[r&&u.jsx("div",{className:"absolute top-0 h-full w-full font-bold text-xs flex flex-col items-center justify-center text-black/60 text-shadow-2xs",children:r}),u.jsx("div",{className:aa("rounded-full",r?"h-6":"h-2.5",!t?.includes("bg-")&&"bg-purple/40",n&&"transition-[width] duration-1000 ease-in-out motion-reduce:transition-none",t),style:{width:e}})]})}function xbe({duration:e,message:t,lateMessage:n}){const r=x.useRef(0),i=x.useRef(0),[o,a]=x.useState(!1),c=5,[d,f]=x.useState(`${c}%`),p=x.useCallback(function h(v){i.current||(i.current=v);const y=v-i.current,b=Math.min(y/e,1);f(Math.max(c,b*100)+"%"),b<1?r.current=requestAnimationFrame(h):a(!0)},[e]);return x.useEffect(()=>(r.current=requestAnimationFrame(p),()=>cancelAnimationFrame(r.current)),[p]),u.jsxs(u.Fragment,{children:[o?n:t,u.jsx(up,{width:d,animated:!1})]})}async function wbe(e){const{data:t}=await Ut.post("/Cluster/",e,{timeout:0});return t}function Sbe(){return at({mutationFn:e=>wbe(e)})}async function _be(e){const{data:t}=await Ut.put(`/Cluster/${e.id}`,{regionPlans:e.regionPlans},{timeout:0});return t}function Cbe(){return at({mutationFn:e=>_be(e)})}async function fB(e){const{data:t}=await Ut.get(`/Organization/${e}`);return t}function Lc(e){return{queryKey:[e],queryFn:()=>fB(e),retry:!1,refetchInterval:1e4}}function mB(e,t){if(t<=0)return"";if(e.length<=t)return e;const n=e.split("-");if(n.length===1)return n[0].slice(0,t);const r=[n[0],...n.slice(1).map(d=>d.charAt(0))],i=r.join("-");if(i.length<=t)return i;const o=r.slice(1).join("").length,a=r.length-1,c=t-o-a;if(c>0)return r[0]=r[0].slice(0,c),r.join("-");{const d=[];let f=0;t>0&&(d.push(n[0].charAt(0)),f=1);for(let p=1;p<r.length&&f+2<=t;p++)d.push(r[p]),f+=2;return d.join("-")}}function Ebe(e,t,n="-"){const r=t.split(n)[0];return e.findIndex(i=>i.startsWith(r))!==-1}function ox(e){return e.replace(/[^a-zA-Z0-9]/g,"-").replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().replace(/-+/g,"-").replace(/^-+|-+$/g,"")}async function kbe(e){await Ut.put("/Payment/",e)}function jbe(){return at({mutationFn:e=>kbe(e)})}function pB(e){const{mutate:t}=jbe();return x.useCallback((n,r)=>{t({paymentMethodId:typeof n=="string"?n:n.id,organizationId:e},{onSuccess:()=>{_e.success("Success! Your payment method has been saved."),r(!0)},onError:()=>{_e.error("Failed to process payment method details. Please try another payment method."),r(!1)}})},[t,e])}const Rbe=x.createContext(null);function Ibe(){return x.useContext(Rbe)}var GS={exports:{}},KS,_2;function Nbe(){if(_2)return KS;_2=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return KS=e,KS}var ZS,C2;function Tbe(){if(C2)return ZS;C2=1;var e=Nbe();function t(){}function n(){}return n.resetWarningCache=t,ZS=function(){function r(a,c,d,f,p,h){if(h!==e){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},ZS}var E2;function Abe(){return E2||(E2=1,GS.exports=Tbe()()),GS.exports}var Obe=Abe();const Xt=mp(Obe);function k2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function j2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?k2(Object(n),!0).forEach(function(r){hB(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jv(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?jv=function(t){return typeof t}:jv=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jv(e)}function hB(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dbe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function $be(e,t){if(e==null)return{};var n=Dbe(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Mbe(e,t){return Pbe(e)||zbe(e,t)||Lbe(e,t)||Ube()}function Pbe(e){if(Array.isArray(e))return e}function zbe(e,t){var n=e&&(typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"]);if(n!=null){var r=[],i=!0,o=!1,a,c;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));i=!0);}catch(d){o=!0,c=d}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw c}}return r}}function Lbe(e,t){if(e){if(typeof e=="string")return R2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R2(e,t)}}function R2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ube(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
113
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Or=function(t,n,r){var i=!!r,o=X.useRef(r);X.useEffect(function(){o.current=r},[r]),X.useEffect(function(){if(!i||!t)return function(){};var a=function(){o.current&&o.current.apply(o,arguments)};return t.on(n,a),function(){t.off(n,a)}},[i,n,t,o])},Fbe=function(t){var n=X.useRef(t);return X.useEffect(function(){n.current=t},[t]),n.current},yy=function(t){return t!==null&&jv(t)==="object"},I2="[object Object]",Vbe=function e(t,n){if(!yy(t)||!yy(n))return t===n;var r=Array.isArray(t),i=Array.isArray(n);if(r!==i)return!1;var o=Object.prototype.toString.call(t)===I2,a=Object.prototype.toString.call(n)===I2;if(o!==a)return!1;if(!o&&!r)return t===n;var c=Object.keys(t),d=Object.keys(n);if(c.length!==d.length)return!1;for(var f={},p=0;p<c.length;p+=1)f[c[p]]=!0;for(var h=0;h<d.length;h+=1)f[d[h]]=!0;var v=Object.keys(f);if(v.length!==c.length)return!1;var y=t,b=n,S=function(E){return e(y[E],b[E])};return v.every(S)},Bbe=function(t,n,r){return yy(t)?Object.keys(t).reduce(function(i,o){var a=!yy(n)||!Vbe(t[o],n[o]);return r.includes(o)?(a&&console.warn("Unsupported prop change: options.".concat(o," is not a mutable property.")),i):a?j2(j2({},i||{}),{},hB({},o,t[o])):i},null):null},Hj=X.createContext(null);Hj.displayName="ElementsContext";var gB=function(t,n){if(!t)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(n," in an <Elements> provider."));return t};Xt.any,Xt.object;var Hbe=function(t){var n=X.useContext(Hj);return gB(n,t)},qbe=function(){var t=Hbe("calls useElements()"),n=t.elements;return n};Xt.func.isRequired;var vB=X.createContext(null);vB.displayName="CheckoutContext";Xt.any,Xt.shape({clientSecret:Xt.oneOfType([Xt.string,Xt.instanceOf(Promise)]).isRequired,elementsOptions:Xt.object}).isRequired;var L1=function(t){var n=X.useContext(vB),r=X.useContext(Hj);if(n){if(r)throw new Error("You cannot wrap the part of your app that ".concat(t," in both <CheckoutProvider> and <Elements> providers."));return n}else return gB(r,t)},Gbe=["mode"],Kbe=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},di=function(t,n){var r="".concat(Kbe(t),"Element"),i=function(d){var f=d.id,p=d.className,h=d.options,v=h===void 0?{}:h,y=d.onBlur,b=d.onFocus,S=d.onReady,C=d.onChange,E=d.onEscape,k=d.onClick,j=d.onLoadError,I=d.onLoaderStart,A=d.onNetworksChange,N=d.onConfirm,T=d.onCancel,z=d.onShippingAddressChange,L=d.onShippingRateChange,G=d.onSavedPaymentMethodRemove,J=d.onSavedPaymentMethodUpdate,Y=L1("mounts <".concat(r,">")),W="elements"in Y?Y.elements:null,F="checkoutState"in Y?Y.checkoutState:null,Z=F?.type==="success"||F?.type==="loading"?F.sdk:null,M=X.useState(null),K=Mbe(M,2),U=K[0],te=K[1],D=X.useRef(null),P=X.useRef(null);Or(U,"blur",y),Or(U,"focus",b),Or(U,"escape",E),Or(U,"click",k),Or(U,"loaderror",j),Or(U,"loaderstart",I),Or(U,"networkschange",A),Or(U,"confirm",N),Or(U,"cancel",T),Or(U,"shippingaddresschange",z),Or(U,"shippingratechange",L),Or(U,"savedpaymentmethodremove",G),Or(U,"savedpaymentmethodupdate",J),Or(U,"change",C);var V;S&&(t==="expressCheckout"?V=S:V=function(){S(U)}),Or(U,"ready",V),X.useLayoutEffect(function(){if(D.current===null&&P.current!==null&&(W||Z)){var ee=null;if(Z)switch(t){case"paymentForm":ee=Z.createPaymentFormElement();break;case"payment":ee=Z.createPaymentElement(v);break;case"address":if("mode"in v){var ue=v.mode,pe=$be(v,Gbe);if(ue==="shipping")ee=Z.createShippingAddressElement(pe);else if(ue==="billing")ee=Z.createBillingAddressElement(pe);else throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":ee=Z.createExpressCheckoutElement(v);break;case"currencySelector":ee=Z.createCurrencySelectorElement();break;case"taxId":ee=Z.createTaxIdElement(v);break;default:throw new Error("Invalid Element type ".concat(r,". You must use either the <PaymentElement />, <AddressElement options={{mode: 'shipping'}} />, <AddressElement options={{mode: 'billing'}} />, or <ExpressCheckoutElement />."))}else W&&(ee=W.create(t,v));D.current=ee,te(ee),ee&&ee.mount(P.current)}},[W,Z,v]);var O=Fbe(v);return X.useEffect(function(){if(D.current){var ee=Bbe(v,O,["paymentRequest"]);ee&&"update"in D.current&&D.current.update(ee)}},[v,O]),X.useLayoutEffect(function(){return function(){if(D.current&&typeof D.current.destroy=="function")try{D.current.destroy(),D.current=null}catch{}}},[]),X.createElement("div",{id:f,className:p,ref:P})},o=function(d){L1("mounts <".concat(r,">"));var f=d.id,p=d.className;return X.createElement("div",{id:f,className:p})},a=n?o:i;return a.propTypes={id:Xt.string,className:Xt.string,onChange:Xt.func,onBlur:Xt.func,onFocus:Xt.func,onReady:Xt.func,onEscape:Xt.func,onClick:Xt.func,onLoadError:Xt.func,onLoaderStart:Xt.func,onNetworksChange:Xt.func,onConfirm:Xt.func,onCancel:Xt.func,onShippingAddressChange:Xt.func,onShippingRateChange:Xt.func,onSavedPaymentMethodRemove:Xt.func,onSavedPaymentMethodUpdate:Xt.func,options:Xt.object},a.displayName=r,a.__elementType=t,a},fi=typeof window>"u",Zbe=X.createContext(null);Zbe.displayName="EmbeddedCheckoutProviderContext";var yB=function(){var t=L1("calls useStripe()"),n=t.stripe;return n};di("auBankAccount",fi);di("card",fi);di("cardNumber",fi);di("cardExpiry",fi);di("cardCvc",fi);di("iban",fi);var Ybe=di("payment",fi);di("expressCheckout",fi);di("paymentRequestButton",fi);di("linkAuthentication",fi);var Wbe=di("address",fi);di("shippingAddress",fi);di("paymentMethodMessaging",fi);di("taxId",fi);function Xbe({hasExistingBilling:e,onPaymentAdded:t,onSaveStateForBillingRedirect:n}){const{organizationId:r}=tt({strict:!1}),i=yB(),o=Ibe(),a=qbe(),[c,d]=x.useState(!1),f=pB(r),p=x.useCallback(()=>{t(!1)},[t]),h=x.useCallback(async v=>{if(v.preventDefault(),!i||!a)return;d(!0),await a.submit(),n?.(!0);const y=await i.confirmSetup({clientSecret:o.clientSecret,elements:a,redirect:"if_required",confirmParams:{return_url:`${window.location.origin}/#/${r}/billing/confirm`}});y.error?(console.error(y.error.message),_e.error(y.error.message),d(!1),n?.(!1)):y.setupIntent.payment_method&&(f(y.setupIntent.payment_method,t),n?.(!1))},[a,t,n,r,f,i,o.clientSecret]);return u.jsxs("form",{onSubmit:h,className:"max-w-xl",children:[u.jsx(Ybe,{}),u.jsx(Wbe,{options:{mode:"billing"}}),u.jsxs("div",{className:"mt-4 flex gap-8 items-center",children:[u.jsxs(be,{disabled:!i||!a||c,variant:"submit",className:"rounded-full",children:[u.jsx(ho,{})," Add Payment Method"]}),e&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"text-xs text-gray-600",children:"Your existing payment method will be overwritten."}),u.jsx(be,{variant:"defaultOutline",type:"button",onClick:p,children:"Cancel"})]})]})]})}var Qbe="clover",bB="https://js.stripe.com",Jbe="".concat(bB,"/").concat(Qbe,"/stripe.js"),exe=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,txe=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/;var nxe=function(t){return exe.test(t)||txe.test(t)},rxe=function(){for(var t=document.querySelectorAll('script[src^="'.concat(bB,'"]')),n=0;n<t.length;n++){var r=t[n];if(nxe(r.src))return r}return null},N2=function(t){var n="",r=document.createElement("script");r.src="".concat(Jbe).concat(n);var i=document.head||document.body;if(!i)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return i.appendChild(r),r},vm=null,Zg=null,Yg=null,ixe=function(t){return function(n){t(new Error("Failed to load Stripe.js",{cause:n}))}},oxe=function(t,n){return function(){window.Stripe?t(window.Stripe):n(new Error("Stripe.js not available"))}},axe=function(t){return vm!==null?vm:(vm=new Promise(function(n,r){if(typeof window>"u"||typeof document>"u"){n(null);return}if(window.Stripe){n(window.Stripe);return}try{var i=rxe();if(!(i&&t)){if(!i)i=N2(t);else if(i&&Yg!==null&&Zg!==null){var o;i.removeEventListener("load",Yg),i.removeEventListener("error",Zg),(o=i.parentNode)===null||o===void 0||o.removeChild(i),i=N2(t)}}Yg=oxe(n,r),Zg=ixe(r),i.addEventListener("load",Yg),i.addEventListener("error",Zg)}catch(a){r(a);return}}),vm.catch(function(n){return vm=null,Promise.reject(n)}))},ym,sxe=function(){return ym||(ym=axe(null).catch(function(t){return ym=null,Promise.reject(t)}),ym)};Promise.resolve().then(function(){return sxe()}).catch(function(e){console.warn(e)});async function lxe(e){const{data:t}=await Ut.post("/StripeAccount/",e);return t}function cxe(){return at({mutationFn:e=>lxe(e)})}async function uxe(e){const{data:t}=await Ut.post("/Payment/",{organizationId:e.organizationId});return t}function dxe(){return at({mutationFn:e=>uxe(e)})}function fxe(e){const{enabled:t,existingStripeId:n,organizationId:r}=e,{mutate:i}=cxe(),{mutate:o}=dxe(),[a,c]=x.useState(void 0),d=x.useCallback(f=>{c(f.clientSecret)},[]);return x.useEffect(()=>{},[i,t,n,o,d,r]),a}function xB({children:e}){const{organizationId:t}=tt({strict:!1}),{data:n}=Mt(Lc(t)),r=fxe({organizationId:t,enabled:!!n,existingStripeId:n?.stripeId});return x.useMemo(()=>({clientSecret:r||"",appearance:{theme:"night"}}),[r]),console.error("No VITE_PUBLIC_STRIPE_KEY is configured for this environment."),u.jsx("div",{className:"mt-20 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:"Setting up your billing is currently disabled. Please check back again later."})}function mxe({onPaymentAdded:e,onSaveStateForBillingRedirect:t}){const{organizationId:n}=tt({strict:!1}),{data:r}=Mt(Lc(n)),i=r?.billing,o=i?.paymentMethod;return u.jsxs(xB,{children:[u.jsx("div",{className:"mt-2 mb-6",children:!o&&"You currently have no payment method on file. Please fill out the secure form below."}),u.jsx(Xbe,{hasExistingBilling:!!i,onSaveStateForBillingRedirect:t,onPaymentAdded:e})]})}var ta=(e=>(e.PASS="pass",e.FAIL="fail",e.PENDING="pending",e.ERROR="error",e))(ta||{});function pxe(e){switch(e){case ta.PASS:return"success";case ta.FAIL:case ta.ERROR:return"destructive";case ta.PENDING:default:return"default"}}function hxe(e){switch(e){case ta.PASS:return"READY";case ta.FAIL:case ta.ERROR:case ta.PENDING:default:return e.toUpperCase()}}function gxe(e,t){const n=String(e).padStart(2,"0"),r=String(t%100).padStart(2,"0");return`${n}/${r}`}function wB(e){const{onSaveStateForBillingRedirect:t,onReplacingPaymentMethod:n}=e??{},{organizationId:r}=tt({strict:!1}),{update:i}=gb(r),{data:o,refetch:a}=Mt(Lc(r)),d=o?.billing?.paymentMethod,[f,p]=x.useState(!1),h=x.useCallback(()=>{p(!f),n?.(!f)},[n,f]),v=x.useCallback(y=>{p(!1),n?.(!1),y&&a()},[n,a]);return o?.type==="ENTERPRISE"?u.jsxs("span",{children:["You are part of an enterprise organization! We don’t currently show your payment methods on this page. Want to explore your solution with Harper more? ",u.jsx(al,{}),", we would love to talk!"]}):d&&!f?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"mt-2",children:[d.brand?.toUpperCase()??"Card"," ending in ",d.last4??"••••",d.expMonth&&d.expYear?u.jsxs(u.Fragment,{children:[" (exp ",gxe(d.expMonth,d.expYear),")"]}):null,d.status?u.jsxs(u.Fragment,{children:[" — ",u.jsx(zo,{variant:pxe(d.status),children:hxe(d.status)})]}):null]}),i&&u.jsx("div",{className:"mt-2 mb-6",children:u.jsx(be,{variant:"defaultOutline",type:"button",onClick:h,children:"Replace Payment Method"})})]}):i?u.jsx(mxe,{onSaveStateForBillingRedirect:t,onPaymentAdded:v}):u.jsx("div",{children:"This org doesn't have a payment method, and you don't have access to add one. Please contact your administrator."})}function Dn(e){return e!==void 0&&e>0}function vxe({clusterId:e,isPending:t,onGoBackToDetails:n,onSaveStateForBillingRedirect:r,onSubmit:i,organizationId:o,selectedPlan:a}){const{data:c}=Mt(Lc(o)),d=c?.billing,f=c?.type==="ENTERPRISE",p=f||d?.paymentMethod?.status===ta.PASS,[h,v]=x.useState(!1),y=Dn(a?.planLimits?.expirationMonths)&&a.planLimits.expirationMonths<1e3&&a.planLimits.expirationMonths,b=u.jsx(u.Fragment,{children:u.jsxs("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end mt-3 max-w-xl",children:[u.jsxs(be,{type:"button",variant:"defaultOutline",className:"rounded-full",disabled:t,onClick:n,children:[u.jsx(mc,{})," Back to Details"]}),u.jsxs(be,{disabled:t||!p||h,type:"submit",variant:"submit",className:"rounded-full",onClick:i,children:[e?"Edit Cluster":"Create New Cluster"," ",u.jsx(ro,{})]})]})});if(f)return u.jsxs(u.Fragment,{children:[u.jsxs("ul",{className:"list-disc ml-6",children:[u.jsx("li",{children:"Your organization’s enterprise agreement with Harper can adjust the retail price you see on this page."}),u.jsxs("li",{children:["Your account representative can work with you to sort out more precise details, and to help accomplish your objectives with this cluster. ",u.jsx(al,{overEmail:!0}),", we are here to help."]})]}),b]});const S=y&&`, or ${Io(y,"month","months")} elapse`;return u.jsxs(u.Fragment,{children:[u.jsxs("ul",{className:"list-disc ml-6 mb-6",children:[u.jsx("li",{children:"You will be billed for this cluster today, and will receive a license for the block of usage you've requested."}),e&&u.jsx("li",{children:"If you scale up, you'll be charged for the additional blocks you've purchased now, and your next auto renewal will be for all purchased blocks."}),e&&u.jsx("li",{children:"If you remove a region, that region's usage block will not be used anymore (because it is specific to that region)."}),u.jsxs("li",{children:["When that block is used up",S,", you will be automatically renewed."]}),u.jsx("li",{children:"While refunds are not available, we’d be happy to assist you with troubleshooting."}),u.jsxs("li",{children:["We would love to work with you to sort out more precise details, and to help accomplish your objectives with this cluster. ",u.jsx(al,{overEmail:!0}),", we are here to help."]})]}),u.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:"Payment method:"}),u.jsx(wB,{onSaveStateForBillingRedirect:r,onReplacingPaymentMethod:v}),b]})}function Er({className:e}={}){const t=x.useMemo(()=>aa("animate-pulse h-2.5 bg-gray-200 rounded-full dark:bg-gray-700",!e?.includes("mb-")&&"mb-4 ",!e?.includes("w-")&&"w-48 ",e),[e]);return u.jsx("div",{className:t})}function U1(e,[t,n]){return Math.min(n,Math.max(t,e))}var yxe=[" ","Enter","ArrowUp","ArrowDown"],bxe=[" ","Enter"],bc="Select",[ax,sx,xxe]=Tp(bc),[af]=Pi(bc,[xxe,Qd]),lx=Qd(),[wxe,hl]=af(bc),[Sxe,_xe]=af(bc),SB=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:c,onValueChange:d,dir:f,name:p,autoComplete:h,disabled:v,required:y,form:b}=e,S=lx(t),[C,E]=x.useState(null),[k,j]=x.useState(null),[I,A]=x.useState(!1),N=Tc(f),[T,z]=Do({prop:r,defaultProp:i??!1,onChange:o,caller:bc}),[L,G]=Do({prop:a,defaultProp:c,onChange:d,caller:bc}),J=x.useRef(null),Y=C?b||!!C.closest("form"):!0,[W,F]=x.useState(new Set),Z=Array.from(W).map(M=>M.props.value).join(";");return u.jsx(EE,{...S,children:u.jsxs(wxe,{required:y,scope:t,trigger:C,onTriggerChange:E,valueNode:k,onValueNodeChange:j,valueNodeHasChildren:I,onValueNodeHasChildrenChange:A,contentId:Ni(),value:L,onValueChange:G,open:T,onOpenChange:z,dir:N,triggerPointerDownPosRef:J,disabled:v,children:[u.jsx(ax.Provider,{scope:t,children:u.jsx(Sxe,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(M=>{F(K=>new Set(K).add(M))},[]),onNativeOptionRemove:x.useCallback(M=>{F(K=>{const U=new Set(K);return U.delete(M),U})},[]),children:n})}),Y?u.jsxs(GB,{"aria-hidden":!0,required:y,tabIndex:-1,name:p,autoComplete:h,value:L,onChange:M=>G(M.target.value),disabled:v,form:b,children:[L===void 0?u.jsx("option",{value:""}):null,Array.from(W)]},Z):null]})})};SB.displayName=bc;var _B="SelectTrigger",CB=x.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=lx(n),a=hl(_B,n),c=a.disabled||r,d=ut(t,a.onTriggerChange),f=sx(n),p=x.useRef("touch"),[h,v,y]=ZB(S=>{const C=f().filter(j=>!j.disabled),E=C.find(j=>j.value===a.value),k=YB(C,S,E);k!==void 0&&a.onValueChange(k.value)}),b=S=>{c||(a.onOpenChange(!0),y()),S&&(a.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return u.jsx(kE,{asChild:!0,...o,children:u.jsx(Ke.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":KB(a.value)?"":void 0,...i,ref:d,onClick:je(i.onClick,S=>{S.currentTarget.focus(),p.current!=="mouse"&&b(S)}),onPointerDown:je(i.onPointerDown,S=>{p.current=S.pointerType;const C=S.target;C.hasPointerCapture(S.pointerId)&&C.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(b(S),S.preventDefault())}),onKeyDown:je(i.onKeyDown,S=>{const C=h.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&v(S.key),!(C&&S.key===" ")&&yxe.includes(S.key)&&(b(),S.preventDefault())})})})});CB.displayName=_B;var EB="SelectValue",kB=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...c}=e,d=hl(EB,n),{onValueNodeHasChildrenChange:f}=d,p=o!==void 0,h=ut(t,d.onValueNodeChange);return Yn(()=>{f(p)},[f,p]),u.jsx(Ke.span,{...c,ref:h,style:{pointerEvents:"none"},children:KB(d.value)?u.jsx(u.Fragment,{children:a}):o})});kB.displayName=EB;var Cxe="SelectIcon",jB=x.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return u.jsx(Ke.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});jB.displayName=Cxe;var Exe="SelectPortal",RB=e=>u.jsx(Op,{asChild:!0,...e});RB.displayName=Exe;var xc="SelectContent",IB=x.forwardRef((e,t)=>{const n=hl(xc,e.__scopeSelect),[r,i]=x.useState();if(Yn(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?zd.createPortal(u.jsx(NB,{scope:e.__scopeSelect,children:u.jsx(ax.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),o):null}return u.jsx(TB,{...e,ref:t})});IB.displayName=xc;var Co=10,[NB,gl]=af(xc),kxe="SelectContentImpl",jxe=bd("SelectContent.RemoveScroll"),TB=x.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:c,sideOffset:d,align:f,alignOffset:p,arrowPadding:h,collisionBoundary:v,collisionPadding:y,sticky:b,hideWhenDetached:S,avoidCollisions:C,...E}=e,k=hl(xc,n),[j,I]=x.useState(null),[A,N]=x.useState(null),T=ut(t,B=>I(B)),[z,L]=x.useState(null),[G,J]=x.useState(null),Y=sx(n),[W,F]=x.useState(!1),Z=x.useRef(!1);x.useEffect(()=>{if(j)return Rj(j)},[j]),jj();const M=x.useCallback(B=>{const[ie,...Se]=Y().map(Ue=>Ue.ref.current),[Ie]=Se.slice(-1),Fe=document.activeElement;for(const Ue of B)if(Ue===Fe||(Ue?.scrollIntoView({block:"nearest"}),Ue===ie&&A&&(A.scrollTop=0),Ue===Ie&&A&&(A.scrollTop=A.scrollHeight),Ue?.focus(),document.activeElement!==Fe))return},[Y,A]),K=x.useCallback(()=>M([z,j]),[M,z,j]);x.useEffect(()=>{W&&K()},[W,K]);const{onOpenChange:U,triggerPointerDownPosRef:te}=k;x.useEffect(()=>{if(j){let B={x:0,y:0};const ie=Ie=>{B={x:Math.abs(Math.round(Ie.pageX)-(te.current?.x??0)),y:Math.abs(Math.round(Ie.pageY)-(te.current?.y??0))}},Se=Ie=>{B.x<=10&&B.y<=10?Ie.preventDefault():j.contains(Ie.target)||U(!1),document.removeEventListener("pointermove",ie),te.current=null};return te.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",Se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",Se,{capture:!0})}}},[j,U,te]),x.useEffect(()=>{const B=()=>U(!1);return window.addEventListener("blur",B),window.addEventListener("resize",B),()=>{window.removeEventListener("blur",B),window.removeEventListener("resize",B)}},[U]);const[D,P]=ZB(B=>{const ie=Y().filter(Fe=>!Fe.disabled),Se=ie.find(Fe=>Fe.ref.current===document.activeElement),Ie=YB(ie,B,Se);Ie&&setTimeout(()=>Ie.ref.current.focus())}),V=x.useCallback((B,ie,Se)=>{const Ie=!Z.current&&!Se;(k.value!==void 0&&k.value===ie||Ie)&&(L(B),Ie&&(Z.current=!0))},[k.value]),O=x.useCallback(()=>j?.focus(),[j]),ee=x.useCallback((B,ie,Se)=>{const Ie=!Z.current&&!Se;(k.value!==void 0&&k.value===ie||Ie)&&J(B)},[k.value]),ue=r==="popper"?F1:AB,pe=ue===F1?{side:c,sideOffset:d,align:f,alignOffset:p,arrowPadding:h,collisionBoundary:v,collisionPadding:y,sticky:b,hideWhenDetached:S,avoidCollisions:C}:{};return u.jsx(NB,{scope:n,content:j,viewport:A,onViewportChange:N,itemRefCallback:V,selectedItem:z,onItemLeave:O,itemTextRefCallback:ee,focusSelectedItem:K,selectedItemText:G,position:r,isPositioned:W,searchRef:D,children:u.jsx(Jb,{as:jxe,allowPinchZoom:!0,children:u.jsx(Xb,{asChild:!0,trapped:k.open,onMountAutoFocus:B=>{B.preventDefault()},onUnmountAutoFocus:je(i,B=>{k.trigger?.focus({preventScroll:!0}),B.preventDefault()}),children:u.jsx(Kd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:B=>B.preventDefault(),onDismiss:()=>k.onOpenChange(!1),children:u.jsx(ue,{role:"listbox",id:k.contentId,"data-state":k.open?"open":"closed",dir:k.dir,onContextMenu:B=>B.preventDefault(),...E,...pe,onPlaced:()=>F(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:je(E.onKeyDown,B=>{const ie=B.ctrlKey||B.altKey||B.metaKey;if(B.key==="Tab"&&B.preventDefault(),!ie&&B.key.length===1&&P(B.key),["ArrowUp","ArrowDown","Home","End"].includes(B.key)){let Ie=Y().filter(Fe=>!Fe.disabled).map(Fe=>Fe.ref.current);if(["ArrowUp","End"].includes(B.key)&&(Ie=Ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(B.key)){const Fe=B.target,Ue=Ie.indexOf(Fe);Ie=Ie.slice(Ue+1)}setTimeout(()=>M(Ie)),B.preventDefault()}})})})})})})});TB.displayName=kxe;var Rxe="SelectItemAlignedPosition",AB=x.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=hl(xc,n),a=gl(xc,n),[c,d]=x.useState(null),[f,p]=x.useState(null),h=ut(t,T=>p(T)),v=sx(n),y=x.useRef(!1),b=x.useRef(!0),{viewport:S,selectedItem:C,selectedItemText:E,focusSelectedItem:k}=a,j=x.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&f&&S&&C&&E){const T=o.trigger.getBoundingClientRect(),z=f.getBoundingClientRect(),L=o.valueNode.getBoundingClientRect(),G=E.getBoundingClientRect();if(o.dir!=="rtl"){const Fe=G.left-z.left,Ue=L.left-Fe,Ye=T.left-Ue,_t=T.width+Ye,gn=Math.max(_t,z.width),Tn=window.innerWidth-Co,Fn=U1(Ue,[Co,Math.max(Co,Tn-gn)]);c.style.minWidth=_t+"px",c.style.left=Fn+"px"}else{const Fe=z.right-G.right,Ue=window.innerWidth-L.right-Fe,Ye=window.innerWidth-T.right-Ue,_t=T.width+Ye,gn=Math.max(_t,z.width),Tn=window.innerWidth-Co,Fn=U1(Ue,[Co,Math.max(Co,Tn-gn)]);c.style.minWidth=_t+"px",c.style.right=Fn+"px"}const J=v(),Y=window.innerHeight-Co*2,W=S.scrollHeight,F=window.getComputedStyle(f),Z=parseInt(F.borderTopWidth,10),M=parseInt(F.paddingTop,10),K=parseInt(F.borderBottomWidth,10),U=parseInt(F.paddingBottom,10),te=Z+M+W+U+K,D=Math.min(C.offsetHeight*5,te),P=window.getComputedStyle(S),V=parseInt(P.paddingTop,10),O=parseInt(P.paddingBottom,10),ee=T.top+T.height/2-Co,ue=Y-ee,pe=C.offsetHeight/2,B=C.offsetTop+pe,ie=Z+M+B,Se=te-ie;if(ie<=ee){const Fe=J.length>0&&C===J[J.length-1].ref.current;c.style.bottom="0px";const Ue=f.clientHeight-S.offsetTop-S.offsetHeight,Ye=Math.max(ue,pe+(Fe?O:0)+Ue+K),_t=ie+Ye;c.style.height=_t+"px"}else{const Fe=J.length>0&&C===J[0].ref.current;c.style.top="0px";const Ye=Math.max(ee,Z+S.offsetTop+(Fe?V:0)+pe)+Se;c.style.height=Ye+"px",S.scrollTop=ie-ee+S.offsetTop}c.style.margin=`${Co}px 0`,c.style.minHeight=D+"px",c.style.maxHeight=Y+"px",r?.(),requestAnimationFrame(()=>y.current=!0)}},[v,o.trigger,o.valueNode,c,f,S,C,E,o.dir,r]);Yn(()=>j(),[j]);const[I,A]=x.useState();Yn(()=>{f&&A(window.getComputedStyle(f).zIndex)},[f]);const N=x.useCallback(T=>{T&&b.current===!0&&(j(),k?.(),b.current=!1)},[j,k]);return u.jsx(Nxe,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:y,onScrollButtonChange:N,children:u.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:I},children:u.jsx(Ke.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});AB.displayName=Rxe;var Ixe="SelectPopperPosition",F1=x.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Co,...o}=e,a=lx(n);return u.jsx(jE,{...a,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});F1.displayName=Ixe;var[Nxe,qj]=af(xc,{}),V1="SelectViewport",OB=x.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=gl(V1,n),a=qj(V1,n),c=ut(t,o.onViewportChange),d=x.useRef(0);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),u.jsx(ax.Slot,{scope:n,children:u.jsx(Ke.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:je(i.onScroll,f=>{const p=f.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:v}=a;if(v?.current&&h){const y=Math.abs(d.current-p.scrollTop);if(y>0){const b=window.innerHeight-Co*2,S=parseFloat(h.style.minHeight),C=parseFloat(h.style.height),E=Math.max(S,C);if(E<b){const k=E+y,j=Math.min(b,k),I=k-j;h.style.height=j+"px",h.style.bottom==="0px"&&(p.scrollTop=I>0?I:0,h.style.justifyContent="flex-end")}}}d.current=p.scrollTop})})})]})});OB.displayName=V1;var DB="SelectGroup",[Txe,Axe]=af(DB),$B=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Ni();return u.jsx(Txe,{scope:n,id:i,children:u.jsx(Ke.div,{role:"group","aria-labelledby":i,...r,ref:t})})});$B.displayName=DB;var MB="SelectLabel",PB=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Axe(MB,n);return u.jsx(Ke.div,{id:i.id,...r,ref:t})});PB.displayName=MB;var by="SelectItem",[Oxe,zB]=af(by),LB=x.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=e,c=hl(by,n),d=gl(by,n),f=c.value===r,[p,h]=x.useState(o??""),[v,y]=x.useState(!1),b=ut(t,k=>d.itemRefCallback?.(k,r,i)),S=Ni(),C=x.useRef("touch"),E=()=>{i||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return u.jsx(Oxe,{scope:n,value:r,disabled:i,textId:S,isSelected:f,onItemTextChange:x.useCallback(k=>{h(j=>j||(k?.textContent??"").trim())},[]),children:u.jsx(ax.ItemSlot,{scope:n,value:r,disabled:i,textValue:p,children:u.jsx(Ke.div,{role:"option","aria-labelledby":S,"data-highlighted":v?"":void 0,"aria-selected":f&&v,"data-state":f?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:b,onFocus:je(a.onFocus,()=>y(!0)),onBlur:je(a.onBlur,()=>y(!1)),onClick:je(a.onClick,()=>{C.current!=="mouse"&&E()}),onPointerUp:je(a.onPointerUp,()=>{C.current==="mouse"&&E()}),onPointerDown:je(a.onPointerDown,k=>{C.current=k.pointerType}),onPointerMove:je(a.onPointerMove,k=>{C.current=k.pointerType,i?d.onItemLeave?.():C.current==="mouse"&&k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:je(a.onPointerLeave,k=>{k.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:je(a.onKeyDown,k=>{d.searchRef?.current!==""&&k.key===" "||(bxe.includes(k.key)&&E(),k.key===" "&&k.preventDefault())})})})})});LB.displayName=by;var Tm="SelectItemText",UB=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,a=hl(Tm,n),c=gl(Tm,n),d=zB(Tm,n),f=_xe(Tm,n),[p,h]=x.useState(null),v=ut(t,E=>h(E),d.onItemTextChange,E=>c.itemTextRefCallback?.(E,d.value,d.disabled)),y=p?.textContent,b=x.useMemo(()=>u.jsx("option",{value:d.value,disabled:d.disabled,children:y},d.value),[d.disabled,d.value,y]),{onNativeOptionAdd:S,onNativeOptionRemove:C}=f;return Yn(()=>(S(b),()=>C(b)),[S,C,b]),u.jsxs(u.Fragment,{children:[u.jsx(Ke.span,{id:d.textId,...o,ref:v}),d.isSelected&&a.valueNode&&!a.valueNodeHasChildren?zd.createPortal(o.children,a.valueNode):null]})});UB.displayName=Tm;var FB="SelectItemIndicator",VB=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return zB(FB,n).isSelected?u.jsx(Ke.span,{"aria-hidden":!0,...r,ref:t}):null});VB.displayName=FB;var B1="SelectScrollUpButton",BB=x.forwardRef((e,t)=>{const n=gl(B1,e.__scopeSelect),r=qj(B1,e.__scopeSelect),[i,o]=x.useState(!1),a=ut(t,r.onScrollButtonChange);return Yn(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=d.scrollTop>0;o(f)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),i?u.jsx(qB,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});BB.displayName=B1;var H1="SelectScrollDownButton",HB=x.forwardRef((e,t)=>{const n=gl(H1,e.__scopeSelect),r=qj(H1,e.__scopeSelect),[i,o]=x.useState(!1),a=ut(t,r.onScrollButtonChange);return Yn(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=d.scrollHeight-d.clientHeight,p=Math.ceil(d.scrollTop)<f;o(p)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),i?u.jsx(qB,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});HB.displayName=H1;var qB=x.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=gl("SelectScrollButton",n),a=x.useRef(null),c=sx(n),d=x.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return x.useEffect(()=>()=>d(),[d]),Yn(()=>{c().find(p=>p.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),u.jsx(Ke.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:je(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:je(i.onPointerMove,()=>{o.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:je(i.onPointerLeave,()=>{d()})})}),Dxe="SelectSeparator",$xe=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return u.jsx(Ke.div,{"aria-hidden":!0,...r,ref:t})});$xe.displayName=Dxe;var q1="SelectArrow",Mxe=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=lx(n),o=hl(q1,n),a=gl(q1,n);return o.open&&a.position==="popper"?u.jsx(RE,{...i,...r,ref:t}):null});Mxe.displayName=q1;var Pxe="SelectBubbleInput",GB=x.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=x.useRef(null),o=ut(r,i),a=aE(t);return x.useEffect(()=>{const c=i.current;if(!c)return;const d=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(d,"value").set;if(a!==t&&p){const h=new Event("change",{bubbles:!0});p.call(c,t),c.dispatchEvent(h)}},[a,t]),u.jsx(Ke.select,{...n,style:{...K4,...n.style},ref:o,defaultValue:t})});GB.displayName=Pxe;function KB(e){return e===""||e===void 0}function ZB(e){const t=bn(e),n=x.useRef(""),r=x.useRef(0),i=x.useCallback(a=>{const c=n.current+a;t(c),(function d(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(c)},[t]),o=x.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function YB(e,t,n){const i=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=zxe(e,Math.max(o,0));i.length===1&&(a=a.filter(f=>f!==n));const d=a.find(f=>f.textValue.toLowerCase().startsWith(i.toLowerCase()));return d!==n?d:void 0}function zxe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Lxe=SB,Uxe=CB,Fxe=kB,Vxe=jB,Bxe=RB,Hxe=IB,qxe=OB,Gxe=$B,Kxe=PB,Zxe=LB,Yxe=UB,Wxe=VB,Xxe=BB,Qxe=HB;function co({...e}){return u.jsx(Lxe,{"data-slot":"select",...e})}function Lo({...e}){return u.jsx(Gxe,{"data-slot":"select-group",...e})}function uo({...e}){return u.jsx(Fxe,{"data-slot":"select-value",...e})}function fo({className:e,children:t,...n}){return u.jsxs(Uxe,{"data-slot":"select-trigger",className:Pe("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex h-9 w-fit items-center justify-between gap-2 rounded-md border bg-grey-700 px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:truncate *:data-[slot=select-value]:block *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[t,u.jsx(Vxe,{asChild:!0,children:u.jsx(IP,{className:"opacity-50 size-4"})})]})}function mo({className:e,children:t,position:n="popper",...r}){return u.jsx(Bxe,{children:u.jsxs(Hxe,{"data-slot":"select-content",className:Pe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[u.jsx(Jxe,{}),u.jsx(qxe,{className:Pe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),u.jsx(e0e,{})]})})}function Gj({className:e,...t}){return u.jsx(Kxe,{"data-slot":"select-label",className:Pe("px-2 py-1.5 text-sm font-medium",e),...t})}function Sn({className:e,children:t,...n}){return u.jsxs(Zxe,{"data-slot":"select-item",className:Pe("focus:bg-grey-200 focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[u.jsx(Yxe,{children:t}),u.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:u.jsx(Wxe,{children:u.jsx(MC,{className:"size-4"})})})]})}function Jxe({className:e,...t}){return u.jsx(Xxe,{"data-slot":"select-scroll-up-button",className:Pe("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(fX,{className:"size-4"})})}function e0e({className:e,...t}){return u.jsx(Qxe,{"data-slot":"select-scroll-down-button",className:Pe("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(IP,{className:"size-4"})})}const T2=new RegExp(/^\d+/);function t0e(e,t){const n=parseInt(e.match(T2)?.[0]||"0",10),r=parseInt(t.match(T2)?.[0]||"0",10);return n===r?0:n>r?1:-1}const WB=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],XB=["secs","mins","hrs"],xy={bytes:1e3,secs:60};function n0e(e,t,n){let r,i;switch(t){case"bytes":{r=WB,i=xy.bytes;break}case"secs":{r=XB,i=xy.secs;break}default:return e}const o=r.indexOf(n);if(o===-1)return e;const a=i**o;return e/a}function r0e(e,t){let n,r;switch(e){case"bytes":n=WB,r=xy.bytes;break;case"secs":n=XB,r=xy.secs;break;default:return e}let i=0;for(;t>=r&&i<n.length-1;)t/=r,i++;return n[i]}function Ma(e,t=1){const n=e*t,r=r0e("bytes",n),i=n0e(n,"bytes",r);return`${new Intl.NumberFormat().format(Math.round(i))} ${r}`}function Rv(e){return new Intl.NumberFormat().format(e)}const A2=["K","M","B","T","Qa","Qi","Sx","Sp","Oc","No","Dc"];function Xi(e){let n=e;if(Math.abs(n)<1e3)return String(Math.round(n));let r=-1;const i=10;do n/=1e3,++r;while(Math.round(Math.abs(n)*i)/i>=1e3&&r<A2.length-1);return`${Rv(Math.round(n))} ${A2[r]}`}function i0e({planLimits:e,resourcesPerInstance:t,selectedRegion:n}){const[r,i]=x.useState(!1),o=x.useCallback(()=>{i(!r)},[r,i]),a=Dn(e?.expirationMonths)&&e.expirationMonths<1e3&&e.expirationMonths,c=n?.purchasedBlockMultiplier??1,d=x.useMemo(()=>e?[Dn(e.totalReadCount)&&{label:"Total Reads",value:`${Xi(e.totalReadCount*c)} reads`},Dn(e.totalReadsBytes)&&{label:"Total Read Transfer",value:`${Ma(e.totalReadsBytes*c)}`},Dn(e.readsPerMinuteCount)&&{label:"Read Rate",value:`${Xi(e.readsPerMinuteCount*60*c)}/min`},Dn(e.readsPerMinuteBytes)&&{label:"Read Bandwidth",value:`${Ma(e.readsPerMinuteBytes*60*c)}/min`},Dn(e.totalWriteCount)&&{label:"Total Writes",value:`${Xi(e.totalWriteCount)} reads`},Dn(e.totalWritesBytes)&&{label:"Total Write Transfer",value:`${Ma(e.totalWritesBytes)}`},Dn(e.writesPerMinuteCount)&&{label:"Write Rate",value:`${Xi(e.writesPerMinuteCount*60)}/min`},Dn(e.writesPerMinuteBytes)&&{label:"Write Bandwidth",value:`${Ma(e.writesPerMinuteBytes*60)}/min`},Dn(e.totalRealTimeMessageDeliveries)&&{label:"Total Real-Time Messages",value:`${Xi(e.totalRealTimeMessageDeliveries*c)} messages`},Dn(e.totalRealTimeMessageDeliveryBytes)&&{label:"Total Real-Time Message Transfer",value:`${Ma(e.totalRealTimeMessageDeliveryBytes*c)}`},Dn(e.realTimeMessageDeliveriesPerMinute)&&{label:"Real-Time Message Rate",value:`${Xi(e.realTimeMessageDeliveriesPerMinute*60*c)}/min`},Dn(e.realTimeMessageDeliveryBytesPerMinute)&&{label:"Real-Time Message Bandwidth",value:`${Ma(e.realTimeMessageDeliveryBytesPerMinute*60*c)}/min`},Dn(e.tlsHandshakes)&&{label:"TLS Handshakes",value:`${Xi(e.tlsHandshakes*60*c)}`},Dn(e.applicationComputeHours)&&{label:"Application Compute Hours",value:`${Xi(e.applicationComputeHours*60*c)}`},t&&Dn(t.storageGb)&&{label:"Storage",value:`${Ma(t.storageGb*1e9)}`},a&&{label:"Expiration",value:Io(a,"month","months")}].filter(fa):[],[a,e,t,c]);return e?Dn(e.totalReadCount)?u.jsxs(Ae,{className:"basis-full",children:[u.jsxs(Oe,{onClick:o,children:["Purchasing usage block for ",Dn(e.readsPerMinuteCount)?`${Xi(e.readsPerMinuteCount*c)} reads/min & `:"",Xi(e.totalReadCount*c)," total reads ",Dn(e.readsPerMinuteCount)?"in "+(n?.region??"")+" region":"per server",",",u.jsx("br",{className:"hidden sm:block"}),Dn(e.writesPerMinuteCount)?` ${Xi(e.writesPerMinuteCount)} writes/min & `:" ",Xi(e.totalWriteCount)," total writes",a&&`, for ${Io(a,"month","months")}`,". Beta pricing subject to change",u.jsx("br",{className:"block sm:hidden"}),u.jsxs(be,{type:"button",variant:"link",className:"text-white",children:["Learn More ",r?u.jsx(kP,{}):u.jsx(ro,{})]})]}),u.jsx($e,{children:u.jsxs("dl",{className:Pe("divide-y divide-black overflow-hidden transition-[max-height] duration-200 ease-in",r?"max-h-fit":"max-h-0"),children:["This plan licenses Harper for the usage limits below, for the price listed above. The usage license expires ",a&&`in ${Io(a,"month","months")} or `,"when any usage limit is reached. New usage blocks are automatically purchased/billed as blocks are consumed.",d.map((f,p)=>u.jsxs("div",{className:Pe("px-4 py-1 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-3",p%2===0&&"bg-gray-700"),children:[u.jsx("dt",{className:"text-sm/6 font-medium text-gray-300",children:f.label}),u.jsx("dd",{className:"mt-1 text-sm/6 sm:col-span-2 sm:mt-0",children:f.value})]},f.label))]})}),u.jsx(De,{})]}):"This plan has no usage limits.":""}function o0e({control:e,fieldArray:t,form:n,index:r,regionNameToLatencyToRegion:i,selectedPlan:o}){const a=x.useMemo(()=>Object.keys(i).sort(),[i]),c=n.watch("deploymentDescription")?.startsWith("Dedicated"),d=n.watch(`regionPlans.${r}.regionName`),f=n.watch(`regionPlans.${r}.latencyDescription`),p=x.useMemo(()=>Object.keys(i[d]||{}).sort(t0e).reverse(),[i,d]);x.useEffect(function(){if(d&&p?.length&&!p?.includes(f)){const y=f?.split(" ")[0].toLowerCase(),b=p.find(S=>y?S.split(" ")[0].toLowerCase()===y:!0)||p[0];n.setValue(`regionPlans.${r}.latencyDescription`,b),n.trigger()}},[p,n,r,f,d]);const h=x.useCallback(()=>{t?.remove(r),n.trigger()},[t,n,r]);return u.jsxs("div",{className:"md:col-span-6 col-span-3 p-4 rounded-md bg-accent gap-6 flex flex-wrap items-start",children:[u.jsx(Me,{control:e,name:`regionPlans.${r}.regionName`,render:({field:v})=>u.jsxs(Ae,{className:"flex-1",children:[u.jsxs(Oe,{children:["Region ",t.fields.length>1?r+1:""]}),u.jsx($e,{children:u.jsxs(co,{onValueChange:y=>{v.onChange(y),n.trigger()},...v,children:[u.jsx(fo,{className:"w-full",children:u.jsx(uo,{placeholder:"Choose Region"})}),u.jsx(mo,{children:u.jsx(Lo,{children:a.map(y=>u.jsx(Sn,{value:y,children:y},y))})})]})}),u.jsx(De,{})]})}),u.jsx(Me,{control:e,name:`regionPlans.${r}.latencyDescription`,render:({field:v})=>u.jsxs(Ae,{className:"flex-1",children:[u.jsxs(Oe,{children:["Estimated ",c?"P95":"P90"," Latency, Distribution"]}),u.jsx($e,{children:u.jsxs(co,{onValueChange:y=>{v.onChange(y),n.trigger()},...v,disabled:!p?.length,children:[u.jsx(fo,{className:"w-full",children:u.jsx(uo,{placeholder:"Choose Latency Tier"})}),u.jsx(mo,{children:u.jsx(Lo,{children:p.map(y=>u.jsx(Sn,{value:y,children:y},y))})})]})}),u.jsx(De,{})]})}),t?.fields?.length&&t?.fields?.length>1&&u.jsx("div",{className:"flex-none mt-6",children:u.jsxs(be,{type:"button",variant:"destructiveOutline",size:"sm",onClick:h,children:[u.jsx(ts,{})," ",u.jsx("span",{className:"sr-only",children:"Remove"})]})}),u.jsx(i0e,{planLimits:o?.planLimits,resourcesPerInstance:o?.resourcesPerInstance,selectedRegion:i[d]?.[f]})]})}function a0e({form:e,regionLocations:t,regionNameToLatencyToRegion:n,selectedPlan:r,totalPrice:i}){const o=e.watch("regionPlans"),a=lU({control:e.control,name:"regionPlans"}),c=x.useMemo(()=>{const f=o.map(p=>n?.[p.regionName]?.[p.latencyDescription]?.region);return i?t?.find(p=>!f.includes(p.region)):null},[t,n,o,i]),d=x.useCallback(()=>{c&&(a.append({regionName:c.region,latencyDescription:c.latencyDescription}),e.trigger())},[e,c,a]);return t?.length?u.jsxs(u.Fragment,{children:[a.fields.map((f,p)=>u.jsx(o0e,{control:e.control,fieldArray:a,form:e,index:p,regionNameToLatencyToRegion:n,selectedPlan:r},f.id)),c&&u.jsx("div",{className:"md:col-span-6 col-span-3",children:u.jsxs(be,{type:"button",variant:"positiveOutline",className:"rounded-full",onClick:d,children:[u.jsx(po,{}),"Add Additional Region Usage"]})})]}):u.jsx("div",{className:"md:col-span-6 col-span-3",children:u.jsx(Fv,{className:"mt-0 m-0",title:"No Regions Available",showReturnToHome:!1,error:{message:u.jsxs(u.Fragment,{children:["The deployment type you selected currently has no available regions. Please try a different deployment type, try again later, or ",u.jsx(al,{}),"."]})}})})}const QB=0,JB=65535;function s0e({control:e,fieldArray:t,form:n,index:r}){const i=x.useCallback(()=>{t?.remove(r)},[t,r]);return u.jsxs("div",{className:"md:col-span-6 col-span-3 p-4 rounded-md bg-accent gap-6 flex flex-wrap items-start",children:[u.jsx(Me,{control:e,name:`instances.${r}.secure`,render:({field:o})=>u.jsxs(Ae,{children:[u.jsxs(Oe,{children:["Instance ",t.fields.length>1?r+1:""]}),u.jsx($e,{children:u.jsxs(co,{...o,onValueChange:a=>{o.onChange(a),n.trigger()},children:[u.jsx(fo,{className:"w-full",children:u.jsx(uo,{placeholder:"https://"})}),u.jsx(mo,{children:u.jsxs(Lo,{children:[u.jsx(Sn,{value:"true",children:"https://"}),u.jsx(Sn,{value:"false",children:"http://"})]})})]})}),u.jsx(De,{})]})}),u.jsx(Me,{control:e,name:`instances.${r}.fqdn`,render:({field:o})=>u.jsxs(Ae,{className:"flex-3",children:[u.jsx(Oe,{children:"Host Name"}),u.jsx($e,{children:u.jsx(ze,{...o,type:"text",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off"})}),u.jsx(De,{})]})}),u.jsx(Me,{control:e,name:`instances.${r}.port`,render:({field:o})=>u.jsxs(Ae,{children:[u.jsx(Oe,{children:"Operations API Port"}),u.jsx($e,{children:u.jsx(ze,{...o,type:"number",min:QB,max:JB,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:String(cd),onChange:a=>{o.onChange(a.target.value?parseInt(a.target.value,10):void 0),n.trigger()}})}),u.jsx(De,{})]})}),t?.fields?.length&&t?.fields?.length>1&&u.jsx("div",{className:"flex-none mt-6",children:u.jsxs(be,{type:"button",variant:"destructiveOutline",size:"sm",onClick:i,children:[u.jsx(ts,{})," ",u.jsx("span",{className:"sr-only",children:"Remove"})]})})]})}function l0e({form:e}){const t=lU({control:e.control,name:"instances"}),n=x.useCallback(()=>{t.append({secure:"true",fqdn:"",port:cd})},[t]);return u.jsxs(u.Fragment,{children:[t.fields.map((r,i)=>u.jsx(s0e,{control:e.control,fieldArray:t,form:e,index:i},r.id)),u.jsx("div",{className:"md:col-span-6 col-span-3",children:u.jsxs(be,{type:"button",variant:"positiveOutline",className:"rounded-full",onClick:n,children:[u.jsx(po,{}),"Add Instance"]})})]})}const O2=/(^$|^(?:localhost|(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}|(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,})$)/i,wy=mn({clusterName:nt().nonempty("Please enter a cluster name.").max(255,"Cluster name cannot be longer than 255 characters long."),abbreviatedName:nt().max(20,"Must be at most 20 characters long.").regex(/^[a-zA-Z0-9-]*$/,"Can only contain letters, numbers and dashes").optional(),fqdn:nt().regex(O2,"Please enter a valid host name without the port or any path.").optional(),deploymentDescription:nt().nonempty("Please select a deployment tier."),performanceDescription:nt().nonempty("Please select a performance tier."),regionPlans:Id(mn({regionName:nt().nonempty("Please select a region."),latencyDescription:nt().nonempty("Please select a latency tier.")})).max(50,{error:"A maximum of 50 regions can be selected for each cluster. "}),instances:Id(mn({secure:ef(["true","false"]),fqdn:nt().nonempty("Please enter the host name of your instance.").regex(O2,"Please enter a valid host name without the port or any path."),port:dj().min(QB,"Positive thinking only, please.").max(JB,"That port number is too high.").optional()})).max(100,{error:"A maximum of 100 instances can be added to each cluster."}),skipToBilling:jd().optional(),sourceClusterId:nt().optional()}),D2={Colocated:"Shared infrastructure for optimized value",Dedicated:"Dedicated infrastructure for consistent performance","Self-Hosted":"Your own infrastructure"};function c0e({calculatedNames:e,clusterId:t,deploymentToPerformanceToPlan:n,form:r,isPending:i,regionLocations:o,regionNameToLatencyToRegion:a,selectedDeployment:c,selectedPerformance:d,selectedPlan:f,totalPrice:p}){const{isDirty:h,isValid:v}=DE(),y=x.useMemo(()=>Object.keys(n[c]||{}).map(C=>{const E=C.slice(0,-1).split("(");if(E.length>1)return{performanceTier:C,name:E[0],description:E[1]};const k=C.split(" for ");return k.length>1?{performanceTier:C,name:k[0],description:"For "+k[1]}:{performanceTier:C,name:C,description:""}}),[n,c]),b=x.useMemo(()=>Object.keys(n).sort(),[n]);x.useEffect(function(){y?.length&&!y.find(E=>E.performanceTier===d)&&(r.setValue("performanceDescription",y[0].performanceTier),r.trigger())},[c,d,y,r]);const S=c==="Self-Hosted";return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"grid grid-cols-3 gap-6 text-white md:grid-cols-6",children:[u.jsx(Me,{control:r.control,name:"clusterName",render:({field:C})=>u.jsxs(Ae,{className:"col-span-3 md:col-span-6",children:[u.jsx(Oe,{className:"pb-1",children:"Cluster Name"}),u.jsx($e,{children:u.jsx(ze,{autoFocus:!0,type:"text",maxLength:wy.shape.clusterName.maxLength,autoCapitalize:"words",disabled:!!t,...C})}),u.jsx(De,{})]})}),u.jsx(Me,{control:r.control,name:"deploymentDescription",render:({field:C})=>u.jsxs(Ae,{className:"col-span-3",children:[u.jsx(Oe,{className:"pb-1",children:"Harper Deployment"}),u.jsx(x.Suspense,{fallback:u.jsx(Er,{}),children:u.jsx($e,{children:u.jsxs(co,{...C,disabled:!!t,onValueChange:E=>{C.onChange(E),r.trigger()},children:[u.jsx(fo,{className:"w-full h-auto",children:u.jsx(uo,{placeholder:"Choose Tier"})}),u.jsx(mo,{children:u.jsx(Lo,{children:b.map(E=>u.jsxs(Sn,{value:E,children:[u.jsx("dt",{className:"text-left font-bold text-sm/6",children:E}),D2[E]&&u.jsx("dd",{className:"font-light",children:D2[E]})]},E))})})]})})}),u.jsx(De,{})]})}),u.jsx(Me,{control:r.control,name:"performanceDescription",render:({field:C})=>u.jsxs(Ae,{className:"col-span-3",children:[u.jsxs(Oe,{className:"pb-1",children:[c.startsWith("Self")?"Support":"Performance"," & Usage"]}),u.jsx(x.Suspense,{fallback:u.jsx(Er,{}),children:u.jsx($e,{children:u.jsxs(co,{...C,onValueChange:E=>{C.onChange(E),r.trigger()},disabled:!y?.length,children:[u.jsx(fo,{className:"w-full h-auto",children:u.jsx(uo,{placeholder:"Choose Tier"})}),u.jsx(mo,{children:u.jsx(Lo,{children:y.map(E=>u.jsxs(Sn,{value:E.performanceTier,children:[u.jsx("dt",{className:"text-left font-bold text-sm/6",children:E.name}),E.description&&u.jsx("dd",{className:"font-light",children:E.description})]},E.name))})})]})})}),u.jsx(De,{})]})}),S?u.jsx(u.Fragment,{children:u.jsx(Me,{control:r.control,name:"fqdn",render:({field:C})=>u.jsxs(Ae,{className:"md:col-span-6 col-span-3",children:[u.jsx(Oe,{className:"pb-1",children:"Optional Cluster Load Balancer Host Name"}),u.jsx($e,{children:u.jsx(ze,{...C,type:"text",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:"example.your-company.com",disabled:!!t})}),u.jsx(De,{})]})})}):u.jsxs(u.Fragment,{children:[u.jsx(Me,{control:r.control,name:"abbreviatedName",render:({field:C})=>u.jsxs(Ae,{className:"col-span-3",children:[u.jsx(Oe,{className:"pb-1",children:"Host Name"}),u.jsx($e,{children:u.jsx(ze,{...C,type:"text",maxLength:wy.shape.abbreviatedName.unwrap().maxLength,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:e.suggestedAbbreviatedName,disabled:!!t})}),u.jsx(De,{})]})}),u.jsxs(Ae,{className:"col-span-3 ",children:[u.jsx(Oe,{className:"pb-1",children:"Full Host Name"}),u.jsx($e,{children:u.jsx("span",{children:e.fullHostName})}),u.jsx(De,{})]})]}),S?u.jsx(l0e,{form:r}):u.jsx(a0e,{form:r,regionLocations:o,regionNameToLatencyToRegion:a,selectedPlan:f,totalPrice:p})]}),u.jsx(Un,{className:"mt-3 mb-12",children:u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",disabled:i||t&&!h||!v,children:[p>0?"Confirm Payment Details":t?"Edit Cluster":"Create New Cluster",u.jsx(ro,{})]})})]})}function eH(e){const{fqdn:t}=e;let{secure:n,port:r}=e;return r||(r=cd),r===443&&n==="false"&&(n="true"),r===80&&n==="true"&&(n="false"),`${n==="true"?"https":"http"}://${t}${r===443||r===80?"":":"+r}`.toLowerCase()}function tH(e,t,n){const r=e.find(o=>(n?!!o.priceUsd:!o.priceUsd)&&o.deploymentType==="colocated")||e.find(o=>o.deploymentType==="colocated")||e[0],i=r?.allowedRegionIds;if(r){const o=i?t.filter(c=>i.includes(c.id)):t,a=o.find(c=>c.region==="US")||o[0];if(a)return{deploymentDescription:r.deploymentDescription,performanceDescription:r.performanceDescription,regionPlans:[{regionName:a.region,latencyDescription:a.latencyDescription}]}}return null}function u0e(e,t,n){if(t&&n){const r=e.getValues();if(!r.deploymentDescription||!r.performanceDescription||!r.regionPlans.length){const i=tH(t,n);i&&(!r.deploymentDescription&&!r.performanceDescription&&(e.setValue("deploymentDescription",i.deploymentDescription),e.setValue("performanceDescription",i.performanceDescription)),r.regionPlans.length||e.setValue("regionPlans",i.regionPlans))}}}function d0e({price:e}){const n=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).formatToParts(e||0);return u.jsx("span",{className:"text-4xl",children:n.map((r,i)=>u.jsx(f0e,{type:r.type,value:r.value},i))})}function f0e({type:e,value:t}){switch(e){case"currency":case"decimal":case"fraction":return u.jsx("sup",{className:"font-light text-xl",children:t});default:return t}}function m0e({alreadyUsingFree:e,clusterId:t,defaultValues:n,deploymentToPerformanceToPlan:r,organization:i,organizationId:o,planTypes:a,regionLocationsColocated:c,regionLocationsDedicated:d,setSavedClusterState:f,startOffOnBilling:p}){const h=pn(),v=an(),y=gr(),{mutate:b,isPending:S}=Sbe(),{mutate:C,isPending:E}=Cbe(),[k,j]=x.useState(p),I=x.useMemo(()=>z1(c?.sort(P1("latencyDescription"))||[],"region","latencyDescription"),[c]),A=x.useMemo(()=>z1(d?.sort(P1("latencyDescription"))||[],"region","latencyDescription"),[d]),N=x.useCallback((B,ie)=>{const Se=new Set,Ie=r?.[B.deploymentDescription]?.[B.performanceDescription];if(B.deploymentDescription==="Self-Hosted")for(let Ue=0;Ue<B.instances.length;Ue++){const Ye=eH(B.instances[Ue]);Se.has(Ye)?ie.addIssue({code:"custom",path:[`instances.${Ue}.fqdn`],message:"Every instance url must be unique!"}):Se.add(Ye)}else{Ie?.priceUsd===0&&e&&ie.addIssue({code:"custom",path:["performanceDescription"],message:"Only one free cluster is allowed per organization."});const Ue=Ie?.deploymentDescription!=="Dedicated"?I:A;for(let Ye=0;Ye<B.regionPlans.length;Ye++){const _t=B.regionPlans[Ye],gn=Ue[_t.regionName]?.[_t.latencyDescription];Se.has(_t.regionName)?ie.addIssue({code:"custom",path:[`regionPlans.${Ye}.regionName`],message:"You can only select a region once!"}):Se.add(_t.regionName),Ie?.allowedRegionIds?.length&&gn?.id&&(Ie.allowedRegionIds.includes(gn.id)?Ye>=1&&ie.addIssue({code:"custom",path:[`regionPlans.${Ye}.regionName`],message:"You can only select one region with this performance tier!"}):Ebe(Ie.allowedRegionIds,gn.id)?ie.addIssue({code:"custom",path:[`regionPlans.${Ye}.latencyDescription`],message:"This latency is not available with the selected performance tier!"}):ie.addIssue({code:"custom",path:[`regionPlans.${Ye}.regionName`],message:"This region is not available with the selected performance tier!"}))}}},[e,I,A,r]),T=Qt({mode:"onChange",resolver:ln(wy.superRefine(N)),defaultValues:n}),[z,L]=x.useState(!0);x.useEffect(()=>{z&&n&&(f(null),L(!1))},[n,z,f]);const G=T.watch("clusterName"),J=T.watch("abbreviatedName"),Y=T.watch("deploymentDescription"),W=T.watch("performanceDescription"),F=T.watch("regionPlans"),Z=T.watch("instances"),M=Y!=="Dedicated"?I:A,K=Y!=="Dedicated"?c:d;x.useEffect(function(){const ie=T.getValues(),Se=Y==="Self-Hosted";Y&&(Se?(ie.abbreviatedName&&T.setValue("abbreviatedName",""),ie.regionPlans.length&&T.setValue("regionPlans",[]),ie.instances.length||T.setValue("instances",[{secure:"true",fqdn:"",port:cd}])):(ie.fqdn&&T.setValue("fqdn",""),ie.instances.length&&T.setValue("instances",[]),ie.regionPlans.length||u0e(T,a,K)))},[T,a,K,Y]);const U=x.useMemo(()=>{const B=mB(ox(G),wy.shape.abbreviatedName.unwrap().maxLength);return{suggestedAbbreviatedName:B,fullHostName:`${J||B}.${i.subdomain||"your-org"}.harperfabric.com`}},[G,J,i]),te=x.useMemo(()=>r?.[Y]?.[W],[r,Y,W]);x.useEffect(function(){const ie=te?.allowedRegionIds;if(ie?.length&&F?.length===1){const Se=F[0],Ie=M?.[Se.regionName]?.[Se.latencyDescription];if(!ie.includes(Ie?.id)){const Fe=K?.filter(Ye=>ie.includes(Ye.id)),Ue=Fe?.find(Ye=>Ye.region==="US")||Fe?.[0];Ue&&(T.setValue("regionPlans.0.regionName",Ue.region),T.setValue("regionPlans.0.latencyDescription",Ue.latencyDescription),T.trigger())}}},[te,F,T,M,K]),x.useEffect(function(){if(!(Y==="Self-Hosted")&&Object.keys(M).length&&F.length)for(let Se=0;Se<F.length;Se++){const Ie=F[Se];M[Ie.regionName]||T.setValue(`regionPlans.${Se}.regionName`,"")}},[T,M,Y,F]);const D=te?.priceUsd?Y==="Self-Hosted"?Z.length*te.priceUsd:F.reduce((B,ie)=>{const Se=M?.[ie.regionName]?.[ie.latencyDescription];return B+(Se?te.priceUsd*Se.instanceCount/2:0)},0):0,P=x.useCallback(({creating:B,deploymentDescription:ie})=>_e.message(B?"Creating Cluster":"Updating Cluster",{description:u.jsx(xbe,{message:"This may take a little bit, hold tight!",lateMessage:"Still working on it... why don't you grab a coffee, and I'll let you know when it's done?",duration:ie==="Dedicated"?6e4:5e3}),duration:12e4}),[]),V=x.useCallback(async({clusterId:B,sourceClusterId:ie,creating:Se,toastId:Ie,isSelfManaged:Fe})=>{if(ie){const Ye=(await fB(o)).clusters?.find(_t=>_t.id===ie);Wp(Ye?.status)&&await cB(ie)}y.invalidateQueries({queryKey:[o],refetchType:"active"}),Se||y.invalidateQueries({queryKey:[B],refetchType:"active"}),v.invalidate(),h(Fe?{to:`/${o}/${B}/instances`}:Se?{to:`/${o}/${B}/starting-up`}:{to:`/${o}/${B}/scaling`}),T.reset(),_e.success(Se?"Cluster Created":"Cluster Updated",{id:Ie,description:Fe?void 0:Se?"It is being provisioned now.":"The updates are being provisioned now.",duration:5e3})},[y,v,h,o,T]),O=x.useCallback(async()=>{const B=T.getValues(),ie=[],Se=r[B.deploymentDescription][B.performanceDescription],Ie=B.deploymentDescription==="Self-Hosted";if(Ie)for(const Ye of B.instances)ie.push({autoRenew:!0,instanceFqdn:Ye.fqdn,operationsApiPort:Ye.port||cd,operationsApiSecure:Ye.secure==="true",planId:Se.id});else for(const Ye of B.regionPlans){const _t=M[Ye.regionName][Ye.latencyDescription];ie.push({autoRenew:!0,planId:Se.id,regionId:_t.id})}f(null);const Fe=P({creating:!t,deploymentDescription:B.deploymentDescription}),Ue=()=>_e.dismiss(Fe);t?C({id:t,regionPlans:ie},{onSuccess:Ye=>V({clusterId:Ye.id,sourceClusterId:B.sourceClusterId,isSelfManaged:Ie,creating:!1,toastId:Fe}),onError:Ue}):b({abbreviatedName:Ie?void 0:B.abbreviatedName||U.suggestedAbbreviatedName,autoRenew:!0,fqdn:Ie&&B.fqdn||void 0,name:B.clusterName,organizationId:o,regionPlans:ie},{onSuccess:Ye=>V({clusterId:Ye.id,sourceClusterId:B.sourceClusterId,isSelfManaged:Ie,creating:!0,toastId:Fe}),onError:Ue})},[U.suggestedAbbreviatedName,t,r,T,V,P,o,M,f,C,b]),ee=x.useCallback(()=>{if(D>0){j(!0);return}return O()},[O,D]),ue=x.useCallback(B=>{f(B?{clusterId:t,...T.getValues(),skipToBilling:!0}:null)},[t,T,f]),pe=x.useCallback(()=>{j(!1)},[]);return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"absolute top-3 right-12 text-right",children:[u.jsx("dt",{className:"font-light",children:"Total Price"}),u.jsx("dd",{className:"font-bold",children:u.jsx(d0e,{price:D})})]}),u.jsx(Jt,{...T,children:k?u.jsxs(u.Fragment,{children:[u.jsx("h1",{className:"text-lg leading-none text-white font-semibold mb-4",children:"Cluster Billing"}),u.jsx("p",{className:"text-muted-foreground text-sm mb-2",children:"Please confirm the following billing details:"}),u.jsx(vxe,{clusterId:t,isPending:S||E,onGoBackToDetails:pe,onSaveStateForBillingRedirect:ue,onSubmit:O,organizationId:o,selectedPlan:te})]}):u.jsxs(u.Fragment,{children:[u.jsx("h1",{className:"text-lg leading-none text-white font-semibold mb-4",children:"Cluster Configuration"}),u.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:"Configure your Harper cluster and define deployment plans."}),u.jsx("form",{onSubmit:T.handleSubmit(ee),children:u.jsx(c0e,{calculatedNames:U,clusterId:t,deploymentToPerformanceToPlan:r,form:T,isPending:S||E,regionLocations:K,regionNameToLatencyToRegion:M,selectedDeployment:Y,selectedPerformance:W,selectedPlan:te,totalPrice:D})})]})})]})}function $2(e){return e?.clusterName!==void 0}function Kj(){const{organizationId:e,clusterId:t}=tt({strict:!1}),{create:n,update:r}=vb(e),{organization:i,cluster:o}=xp({strict:!1}),[a,c]=rf(zc.SavedClusterState,null),{data:d}=Mt(vbe(e)),{data:f}=Mt(x2({availableHosts:!0,organizationId:e})),{data:p}=Mt(x2({organizationId:e})),h=x.useMemo(()=>{for(const S of i?.clusters??[])if(S.id!==o?.id&&d&&!kj(S.status)&&!Wp(S.status)&&S.plans)for(const C of S.plans){const E=d.find(k=>k.id===C.planId);if(E?.priceUsd===0&&!E.id.startsWith("self-hosted"))return!0}return!1},[o?.id,i?.clusters,d]),v=x.useMemo(()=>z1(d?.sort(P1("priceUsd"))||[],"deploymentDescription","performanceDescription"),[d]),y=x.useMemo(()=>{if(!d||!f||!p||t&&!o)return null;let S=o;if(a){if($2(a))return{...a,clusterName:a.clusterName||"",abbreviatedName:a.abbreviatedName||"",deploymentDescription:a.deploymentDescription||"",performanceDescription:a.performanceDescription||"",fqdn:a.fqdn||"",regionPlans:a.regionPlans||[],instances:a.instances||[]};S=a}const C=d?.find(N=>N.id===o?.plans?.[0].planId),E=[],k=[],j=C?.deploymentDescription!=="Dedicated"?f:p,I=tH(d,j,h);let A=!1;if(S){if(S.plans){for(const N of S.plans)if(N.regionId){const T=j.find(z=>z.id===N.regionId);T&&E.push({regionName:T.region,latencyDescription:T.latencyDescription})}}if(!E.length&&S.instances){const N=S.instances.filter(T=>T.status&&!zE.includes(T.status)).sort(dB);for(const T of N)A=!0,k.push({fqdn:T.instanceFqdn,port:T.operationsApiPort,secure:T.operationsApiSecure?"true":"false"})}}else I&&E.push(...I.regionPlans);return!A&&!E.length&&E.push({regionName:"",latencyDescription:""}),{sourceClusterId:S?.id,autoRenew:S?.plans?.[0]?.autoRenew??!0,clusterName:S?.name??"",abbreviatedName:S?.abbreviatedName??"",deploymentDescription:C?.deploymentDescription??I?.deploymentDescription??"",performanceDescription:C?.performanceDescription??I?.performanceDescription??"",fqdn:A?S?.fqdn??"":"",instances:k,regionPlans:E}},[h,o,t,d,f,p,a]);return!y||!i||!d||!f||!p?u.jsx(Kg,{children:u.jsx(Ui,{centered:!0,text:"Loading..."})}):(o?.id?!r:!n)?u.jsx(Kg,{children:u.jsx(Fv,{title:"Not Allowed",error:{message:u.jsxs(u.Fragment,{children:["You do not have permission to ",o?.id?"update":"create"," clusters in this org."]})}})}):d.length===0?u.jsx(Kg,{children:u.jsx(Fv,{title:`Cluster ${t?"Modification":"Creation"} Not Currently Allowed`,error:{message:u.jsxs(u.Fragment,{children:["There are no available deployment types right now! Please try again later, or ",u.jsx(al,{}),"."]})}})}):u.jsx(Kg,{children:u.jsx(m0e,{alreadyUsingFree:h,clusterId:t,defaultValues:y,deploymentToPerformanceToPlan:v,organization:i,organizationId:e,planTypes:d,regionLocationsColocated:f,regionLocationsDedicated:p,setSavedClusterState:c,startOffOnBilling:$2(a)&&a.skipToBilling===!0})})}const G1={FAILED:0,UPDATING:1,PROVISIONING:2,RUNNING:3,TERMINATED:4},Wg=G1.RUNNING;function p0e(e,t){if(e.status===t.status)return e.name.localeCompare(t.name);const n=e.status?G1[e.status]??Wg:Wg,r=t.status?G1[t.status]??Wg:Wg;return n-r}function nH(e,t){const n=t.toLowerCase();return r=>{for(const i of e){const o=r[i];if(o!=null)if(typeof o=="string"){if(o.toLowerCase().includes(n))return!0}else if(typeof o=="boolean"){if(o&&(n==="yes"||n==="true"||n==="1")||!o&&(n==="no"||n==="false"||n==="0"))return!0}else throw new Error("curryFilterByFuzzySearch has not implemented support for "+typeof o+" fields yet!")}return!1}}function h0e(){const{organizationId:e}=tt({strict:!1}),{create:t}=vb(e),{data:n,isSuccess:r}=Mi(Lc(e)),[i]=rf(zc.SavedClusterState,null),[o,a]=x.useState(""),c=x.useCallback(()=>a(""),[]),d=x.useCallback(h=>{a(h.currentTarget.value?.toLowerCase()||"")},[]),f=x.useMemo(()=>n?.clusters?.slice().filter(h=>!kj(h.status)).sort(p0e)||[],[n?.clusters]),p=x.useMemo(()=>f.filter(nH(["id","name"],o))||[],[o,f]);return n&&f.length===0&&t?u.jsx(Kj,{}):i?u.jsx(ic,{to:`/${e}/new-cluster`}):u.jsxs(u.Fragment,{children:[u.jsx(rs,{children:r?u.jsxs("div",{className:"flex w-full justify-end gap-2",children:[u.jsx(ze,{placeholder:"Filter by name",className:"inline-block w-48 md:w-64 bg-black border",value:o,onChange:d}),t&&u.jsx(Ge,{to:"new-cluster",children:u.jsxs(be,{variant:"positive",className:"w-full rounded-full md:w-44",accessKey:"n",children:[u.jsx(po,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"N"}),"ew Cluster"]})]})})]}):null}),u.jsx("section",{className:"mt-40 md:mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-12 mb-4",children:[p.map(h=>u.jsx("div",{className:"col-span-1 md:col-span-4 lg:col-span-3 2xl:col-span-2",children:u.jsx(hbe,{cluster:h})},h.id)),!p.length&&u.jsxs("div",{className:"col-span-1 md:col-span-12 text-center",children:[u.jsx("h2",{className:"my-4 text-xl",children:"No matches found."}),u.jsx(be,{variant:"outline",onClick:c,children:"Clear Filters"})]})]})})]})}function rH(){const e=URL.parse(location.href);return e?.hash?e.hash.startsWith("#/")?e.hash.slice(1):e.hash:"/"}function iH(){return"/#"+rH()}function g0e(){const{organizationId:e}=tt({strict:!1}),t=pn(),r=new URLSearchParams(window.location.search).get("setup_intent_client_secret"),{setup_intent_client_secret:i}=vr({strict:!1}),[o]=rf(zc.SavedClusterState,null),a=r||i,c=yB(),d=pB(e),f=x.useCallback(()=>{const p=o?o.clusterId?`../../${o.clusterId}/edit`:"../../new-cluster":"../";window.history.replaceState(null,"",iH()),t({search:void 0,to:p})},[t,o]);return x.useEffect(()=>{!c||!a||!d||!e||!f||(async function(){try{const{setupIntent:p}=await c.retrieveSetupIntent(a);switch(p?.status){case"succeeded":p.payment_method!==null?d(p.payment_method,f):(_e.error("Failed to process payment method details. Please try another payment method."),f());break;case"processing":_e.warning("Processing payment method. Please check back later."),f();break;case"requires_payment_method":_e.error("Failed to process payment method details. Please try another payment method."),f();break;default:_e.error("Failed to process payment method details. Please try another payment method."),f();break}}catch(p){console.error(p),_e.error("Failed to process payment method details. Please try another payment method."),f()}})()},[a,f,e,d,c]),u.jsx(Ui,{centered:!0})}function v0e(){return u.jsx(xB,{children:u.jsx(g0e,{})})}function tr({clusterId:e,instanceId:t,organizationId:n},r){return"/"+[n,e,t&&"instance",t,r].filter(fa).join("/")}const Lm="flex items-center p-2 rounded-lg group",Sy={className:"text-white hover:bg-gray-700"},_y={className:"text-black bg-white pointer-events-none cursor-default"};function y0e(){const{organizationId:e}=tt({strict:!1}),{update:t}=gb(e);return t?u.jsxs(u.Fragment,{children:[u.jsx(rs,{}),u.jsx("div",{className:"mt-40 md:mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs("div",{className:"md:grid gap-4 md:grid-cols-12 min-h-[calc(100vh-theme(spacing.36))] mb-12",children:[u.jsxs("section",{className:"col-span-1 text-white md:col-span-4 lg:col-span-3 md:border-r-1 border-b md:border-b-0 md:pr-4 border-gray-700",children:[u.jsx(b0e,{}),u.jsx(x0e,{})]}),u.jsx("section",{className:"col-span-1 text-white md:col-span-8 lg:col-span-9",children:u.jsx(ll,{})})]})})]}):u.jsx("div",{className:"mt-40 md:mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:"You don't have access to manage payments for this organization. Please contact your administrator."})}function b0e(){const e=tt({strict:!1});return u.jsxs("div",{className:"hidden md:block",children:[u.jsxs("span",{className:Lm,children:[u.jsx(_Q,{className:"inline-block"}),u.jsx("h3",{className:"ms-3 text-2xl font-extrabold dark:text-white",children:"Billing"})]}),u.jsxs("ul",{className:"border-t border-gray-700 pt-4 mt-4 space-y-2",children:[u.jsx("li",{children:u.jsxs(Ge,{to:tr(e,"billing"),className:Lm,activeOptions:{exact:!0},inactiveProps:Sy,activeProps:_y,children:[u.jsx(AP,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Payment Method"})]})}),u.jsx("li",{children:u.jsxs(Ge,{to:tr(e,"billing/invoices"),className:Lm,inactiveProps:Sy,activeProps:_y,children:[u.jsx(LP,{className:"inline-block"}),u.jsx("span",{className:"ms-3",children:"Invoices & Payments"})]})})]})]})}function x0e(){const e=tt({strict:!1});return u.jsxs("ul",{className:"flex space-x-4 md:hidden py-2",children:[u.jsx("li",{children:u.jsxs(Ge,{to:tr(e,"billing"),className:Lm,activeOptions:{exact:!0},inactiveProps:Sy,activeProps:_y,children:[u.jsx(AP,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Payment Method"})]})}),u.jsx("li",{children:u.jsxs(Ge,{to:tr(e,"billing/invoices"),className:Lm,inactiveProps:Sy,activeProps:_y,children:[u.jsx(LP,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Invoices & Payments"})]})})]})}function cx(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function Ls(e,t){return typeof e=="function"?e(t):e}function $i(e,t){return n=>{t.setState(r=>({...r,[e]:Ls(n,r[e])}))}}function ux(e){return e instanceof Function}function w0e(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function S0e(e,t){const n=[],r=i=>{i.forEach(o=>{n.push(o);const a=t(o);a!=null&&a.length&&r(a)})};return r(e),n}function Je(e,t,n){let r=[],i;return o=>{let a;n.key&&n.debug&&(a=Date.now());const c=e(o);if(!(c.length!==r.length||c.some((p,h)=>r[h]!==p)))return i;r=c;let f;if(n.key&&n.debug&&(f=Date.now()),i=t(...c),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const p=Math.round((Date.now()-a)*100)/100,h=Math.round((Date.now()-f)*100)/100,v=h/16,y=(b,S)=>{for(b=String(b);b.length<S;)b=" "+b;return b};console.info(`%c⏱ ${y(h,5)} /${y(p,5)} ms`,`
|
|
114
|
-
font-size: .6rem;
|
|
115
|
-
font-weight: bold;
|
|
116
|
-
color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,n?.key)}return i}}function et(e,t,n,r){return{debug:()=>{var i;return(i=e?.debugAll)!=null?i:e[t]},key:!1,onChange:r}}function _0e(e,t,n,r){const i=()=>{var a;return(a=o.getValue())!=null?a:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:i,getContext:Je(()=>[e,n,t,o],(a,c,d,f)=>({table:a,column:c,row:d,cell:f,getValue:f.getValue,renderValue:f.renderValue}),et(e.options,"debugCells"))};return e._features.forEach(a=>{a.createCell==null||a.createCell(o,n,t,e)},{}),o}function C0e(e,t,n,r){var i,o;const c={...e._getDefaultColumnDef(),...t},d=c.accessorKey;let f=(i=(o=c.id)!=null?o:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?i:typeof c.header=="string"?c.header:void 0,p;if(c.accessorFn?p=c.accessorFn:d&&(d.includes(".")?p=v=>{let y=v;for(const S of d.split(".")){var b;y=(b=y)==null?void 0:b[S]}return y}:p=v=>v[c.accessorKey]),!f)throw new Error;let h={id:`${String(f)}`,accessorFn:p,parent:r,depth:n,columnDef:c,columns:[],getFlatColumns:Je(()=>[!0],()=>{var v;return[h,...(v=h.columns)==null?void 0:v.flatMap(y=>y.getFlatColumns())]},et(e.options,"debugColumns")),getLeafColumns:Je(()=>[e._getOrderColumnsFn()],v=>{var y;if((y=h.columns)!=null&&y.length){let b=h.columns.flatMap(S=>S.getLeafColumns());return v(b)}return[h]},et(e.options,"debugColumns"))};for(const v of e._features)v.createColumn==null||v.createColumn(h,e);return h}const wr="debugHeaders";function M2(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],c=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(c),a.push(d)};return c(o),a},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(o,e)}),o}const E0e={createTable:e=>{e.getHeaderGroups=Je(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{var o,a;const c=(o=r?.map(h=>n.find(v=>v.id===h)).filter(Boolean))!=null?o:[],d=(a=i?.map(h=>n.find(v=>v.id===h)).filter(Boolean))!=null?a:[],f=n.filter(h=>!(r!=null&&r.includes(h.id))&&!(i!=null&&i.includes(h.id)));return Xg(t,[...c,...f,...d],e)},et(e.options,wr)),e.getCenterHeaderGroups=Je(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(i!=null&&i.includes(o.id))),Xg(t,n,e,"center")),et(e.options,wr)),e.getLeftHeaderGroups=Je(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var i;const o=(i=r?.map(a=>n.find(c=>c.id===a)).filter(Boolean))!=null?i:[];return Xg(t,o,e,"left")},et(e.options,wr)),e.getRightHeaderGroups=Je(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var i;const o=(i=r?.map(a=>n.find(c=>c.id===a)).filter(Boolean))!=null?i:[];return Xg(t,o,e,"right")},et(e.options,wr)),e.getFooterGroups=Je(()=>[e.getHeaderGroups()],t=>[...t].reverse(),et(e.options,wr)),e.getLeftFooterGroups=Je(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),et(e.options,wr)),e.getCenterFooterGroups=Je(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),et(e.options,wr)),e.getRightFooterGroups=Je(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),et(e.options,wr)),e.getFlatHeaders=Je(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),et(e.options,wr)),e.getLeftFlatHeaders=Je(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),et(e.options,wr)),e.getCenterFlatHeaders=Je(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),et(e.options,wr)),e.getRightFlatHeaders=Je(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),et(e.options,wr)),e.getCenterLeafHeaders=Je(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),et(e.options,wr)),e.getLeftLeafHeaders=Je(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),et(e.options,wr)),e.getRightLeafHeaders=Je(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),et(e.options,wr)),e.getLeafHeaders=Je(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var i,o,a,c,d,f;return[...(i=(o=t[0])==null?void 0:o.headers)!=null?i:[],...(a=(c=n[0])==null?void 0:c.headers)!=null?a:[],...(d=(f=r[0])==null?void 0:f.headers)!=null?d:[]].map(p=>p.getLeafHeaders()).flat()},et(e.options,wr))}};function Xg(e,t,n,r){var i,o;let a=0;const c=function(v,y){y===void 0&&(y=1),a=Math.max(a,y),v.filter(b=>b.getIsVisible()).forEach(b=>{var S;(S=b.columns)!=null&&S.length&&c(b.columns,y+1)},0)};c(e);let d=[];const f=(v,y)=>{const b={depth:y,id:[r,`${y}`].filter(Boolean).join("_"),headers:[]},S=[];v.forEach(C=>{const E=[...S].reverse()[0],k=C.column.depth===b.depth;let j,I=!1;if(k&&C.column.parent?j=C.column.parent:(j=C.column,I=!0),E&&E?.column===j)E.subHeaders.push(C);else{const A=M2(n,j,{id:[r,y,j.id,C?.id].filter(Boolean).join("_"),isPlaceholder:I,placeholderId:I?`${S.filter(N=>N.column===j).length}`:void 0,depth:y,index:S.length});A.subHeaders.push(C),S.push(A)}b.headers.push(C),C.headerGroup=b}),d.push(b),y>0&&f(S,y-1)},p=t.map((v,y)=>M2(n,v,{depth:a,index:y}));f(p,a-1),d.reverse();const h=v=>v.filter(b=>b.column.getIsVisible()).map(b=>{let S=0,C=0,E=[0];b.subHeaders&&b.subHeaders.length?(E=[],h(b.subHeaders).forEach(j=>{let{colSpan:I,rowSpan:A}=j;S+=I,E.push(A)})):S=1;const k=Math.min(...E);return C=C+k,b.colSpan=S,b.rowSpan=C,{colSpan:S,rowSpan:C}});return h((i=(o=d[0])==null?void 0:o.headers)!=null?i:[]),d}const k0e=(e,t,n,r,i,o,a)=>{let c={id:t,index:r,original:n,depth:i,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(c._valuesCache.hasOwnProperty(d))return c._valuesCache[d];const f=e.getColumn(d);if(f!=null&&f.accessorFn)return c._valuesCache[d]=f.accessorFn(c.original,r),c._valuesCache[d]},getUniqueValues:d=>{if(c._uniqueValuesCache.hasOwnProperty(d))return c._uniqueValuesCache[d];const f=e.getColumn(d);if(f!=null&&f.accessorFn)return f.columnDef.getUniqueValues?(c._uniqueValuesCache[d]=f.columnDef.getUniqueValues(c.original,r),c._uniqueValuesCache[d]):(c._uniqueValuesCache[d]=[c.getValue(d)],c._uniqueValuesCache[d])},renderValue:d=>{var f;return(f=c.getValue(d))!=null?f:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>S0e(c.subRows,d=>d.subRows),getParentRow:()=>c.parentId?e.getRow(c.parentId,!0):void 0,getParentRows:()=>{let d=[],f=c;for(;;){const p=f.getParentRow();if(!p)break;d.push(p),f=p}return d.reverse()},getAllCells:Je(()=>[e.getAllLeafColumns()],d=>d.map(f=>_0e(e,c,f,f.id)),et(e.options,"debugRows")),_getAllCellsByColumnId:Je(()=>[c.getAllCells()],d=>d.reduce((f,p)=>(f[p.column.id]=p,f),{}),et(e.options,"debugRows"))};for(let d=0;d<e._features.length;d++){const f=e._features[d];f==null||f.createRow==null||f.createRow(c,e)}return c},j0e={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},oH=(e,t,n)=>{var r,i;const o=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((i=e.getValue(t))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(o))};oH.autoRemove=e=>To(e);const aH=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};aH.autoRemove=e=>To(e);const sH=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};sH.autoRemove=e=>To(e);const lH=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};lH.autoRemove=e=>To(e);const cH=(e,t,n)=>!n.some(r=>{var i;return!((i=e.getValue(t))!=null&&i.includes(r))});cH.autoRemove=e=>To(e)||!(e!=null&&e.length);const uH=(e,t,n)=>n.some(r=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(r)});uH.autoRemove=e=>To(e)||!(e!=null&&e.length);const dH=(e,t,n)=>e.getValue(t)===n;dH.autoRemove=e=>To(e);const fH=(e,t,n)=>e.getValue(t)==n;fH.autoRemove=e=>To(e);const Zj=(e,t,n)=>{let[r,i]=n;const o=e.getValue(t);return o>=r&&o<=i};Zj.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,i=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,a=n===null||Number.isNaN(i)?1/0:i;if(o>a){const c=o;o=a,a=c}return[o,a]};Zj.autoRemove=e=>To(e)||To(e[0])&&To(e[1]);const Pa={includesString:oH,includesStringSensitive:aH,equalsString:sH,arrIncludes:lH,arrIncludesAll:cH,arrIncludesSome:uH,equals:dH,weakEquals:fH,inNumberRange:Zj};function To(e){return e==null||e===""}const R0e={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:$i("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);return typeof r=="string"?Pa.includesString:typeof r=="number"?Pa.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Pa.equals:Array.isArray(r)?Pa.arrIncludes:Pa.weakEquals},e.getFilterFn=()=>{var n,r;return ux(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:Pa[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,i;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const i=e.getFilterFn(),o=r?.find(p=>p.id===e.id),a=Ls(n,o?o.value:void 0);if(P2(i,a,e)){var c;return(c=r?.filter(p=>p.id!==e.id))!=null?c:[]}const d={id:e.id,value:a};if(o){var f;return(f=r?.map(p=>p.id===e.id?d:p))!=null?f:[]}return r!=null&&r.length?[...r,d]:[d]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=i=>{var o;return(o=Ls(t,i))==null?void 0:o.filter(a=>{const c=n.find(d=>d.id===a.id);if(c){const d=c.getFilterFn();if(P2(d,a.value,c))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function P2(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const I0e=(e,t,n)=>n.reduce((r,i)=>{const o=i.getValue(e);return r+(typeof o=="number"?o:0)},0),N0e=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},T0e=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r<o||r===void 0&&o>=o)&&(r=o)}),r},A0e=(e,t,n)=>{let r,i;return n.forEach(o=>{const a=o.getValue(e);a!=null&&(r===void 0?a>=a&&(r=i=a):(r>a&&(r=a),i<a&&(i=a)))}),[r,i]},O0e=(e,t)=>{let n=0,r=0;if(t.forEach(i=>{let o=i.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},D0e=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!w0e(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),i=n.sort((o,a)=>o-a);return n.length%2!==0?i[r]:(i[r-1]+i[r])/2},$0e=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),M0e=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,P0e=(e,t)=>t.length,YS={sum:I0e,min:N0e,max:T0e,extent:A0e,mean:O0e,median:D0e,unique:$0e,uniqueCount:M0e,count:P0e},z0e={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:$i("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);if(typeof r=="number")return YS.sum;if(Object.prototype.toString.call(r)==="[object Date]")return YS.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return ux(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:YS[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var i;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function L0e(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(a=>a.id===o)).filter(Boolean),...r]}const U0e={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:$i("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Je(n=>[Um(t,n)],n=>n.findIndex(r=>r.id===e.id),et(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Um(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const i=Um(t,n);return((r=i[i.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Je(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>i=>{let o=[];if(!(t!=null&&t.length))o=i;else{const a=[...t],c=[...i];for(;c.length&&a.length;){const d=a.shift(),f=c.findIndex(p=>p.id===d);f>-1&&o.push(c.splice(f,1)[0])}o=[...o,...c]}return L0e(o,n,r)},et(e.options,"debugTable"))}},WS=()=>({left:[],right:[]}),F0e={getInitialState:e=>({columnPinning:WS(),...e}),getDefaultOptions:e=>({onColumnPinningChange:$i("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(i=>i.id).filter(Boolean);t.setColumnPinning(i=>{var o,a;if(n==="right"){var c,d;return{left:((c=i?.left)!=null?c:[]).filter(h=>!(r!=null&&r.includes(h))),right:[...((d=i?.right)!=null?d:[]).filter(h=>!(r!=null&&r.includes(h))),...r]}}if(n==="left"){var f,p;return{left:[...((f=i?.left)!=null?f:[]).filter(h=>!(r!=null&&r.includes(h))),...r],right:((p=i?.right)!=null?p:[]).filter(h=>!(r!=null&&r.includes(h)))}}return{left:((o=i?.left)!=null?o:[]).filter(h=>!(r!=null&&r.includes(h))),right:((a=i?.right)!=null?a:[]).filter(h=>!(r!=null&&r.includes(h)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var i,o,a;return((i=r.columnDef.enablePinning)!=null?i:!0)&&((o=(a=t.options.enableColumnPinning)!=null?a:t.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(c=>c.id),{left:r,right:i}=t.getState().columnPinning,o=n.some(c=>r?.includes(c)),a=n.some(c=>i?.includes(c));return o?"left":a?"right":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();return i?(n=(r=t.getState().columnPinning)==null||(r=r[i])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Je(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,i)=>{const o=[...r??[],...i??[]];return n.filter(a=>!o.includes(a.column.id))},et(t.options,"debugRows")),e.getLeftVisibleCells=Je(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(o=>n.find(a=>a.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),et(t.options,"debugRows")),e.getRightVisibleCells=Je(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(a=>a.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),et(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?WS():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:WS())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var i,o;return!!((i=r.left)!=null&&i.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=Je(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),et(e.options,"debugColumns")),e.getRightLeafColumns=Je(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),et(e.options,"debugColumns")),e.getCenterLeafColumns=Je(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const i=[...n??[],...r??[]];return t.filter(o=>!i.includes(o.id))},et(e.options,"debugColumns"))}};function V0e(e){return e||(typeof document<"u"?document:null)}const Qg={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},XS=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),B0e={getDefaultColumnDef:()=>Qg,getInitialState:e=>({columnSizing:{},columnSizingInfo:XS(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:$i("columnSizing",e),onColumnSizingInfoChange:$i("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,i;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Qg.minSize,(r=o??e.columnDef.size)!=null?r:Qg.size),(i=e.columnDef.maxSize)!=null?i:Qg.maxSize)},e.getStart=Je(n=>[n,Um(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((i,o)=>i+o.getSize(),0),et(t.options,"debugColumns")),e.getAfter=Je(n=>[n,Um(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((i,o)=>i+o.getSize(),0),et(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...i}=n;return i})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=i=>{if(i.subHeaders.length)i.subHeaders.forEach(r);else{var o;n+=(o=i.column.getSize())!=null?o:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),i=r?.getCanResize();return o=>{if(!r||!i||(o.persist==null||o.persist(),QS(o)&&o.touches&&o.touches.length>1))return;const a=e.getSize(),c=e?e.getLeafHeaders().map(E=>[E.column.id,E.column.getSize()]):[[r.id,r.getSize()]],d=QS(o)?Math.round(o.touches[0].clientX):o.clientX,f={},p=(E,k)=>{typeof k=="number"&&(t.setColumnSizingInfo(j=>{var I,A;const N=t.options.columnResizeDirection==="rtl"?-1:1,T=(k-((I=j?.startOffset)!=null?I:0))*N,z=Math.max(T/((A=j?.startSize)!=null?A:0),-.999999);return j.columnSizingStart.forEach(L=>{let[G,J]=L;f[G]=Math.round(Math.max(J+J*z,0)*100)/100}),{...j,deltaOffset:T,deltaPercentage:z}}),(t.options.columnResizeMode==="onChange"||E==="end")&&t.setColumnSizing(j=>({...j,...f})))},h=E=>p("move",E),v=E=>{p("end",E),t.setColumnSizingInfo(k=>({...k,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},y=V0e(n),b={moveHandler:E=>h(E.clientX),upHandler:E=>{y?.removeEventListener("mousemove",b.moveHandler),y?.removeEventListener("mouseup",b.upHandler),v(E.clientX)}},S={moveHandler:E=>(E.cancelable&&(E.preventDefault(),E.stopPropagation()),h(E.touches[0].clientX),!1),upHandler:E=>{var k;y?.removeEventListener("touchmove",S.moveHandler),y?.removeEventListener("touchend",S.upHandler),E.cancelable&&(E.preventDefault(),E.stopPropagation()),v((k=E.touches[0])==null?void 0:k.clientX)}},C=H0e()?{passive:!1}:!1;QS(o)?(y?.addEventListener("touchmove",S.moveHandler,C),y?.addEventListener("touchend",S.upHandler,C)):(y?.addEventListener("mousemove",b.moveHandler,C),y?.addEventListener("mouseup",b.upHandler,C)),t.setColumnSizingInfo(E=>({...E,startOffset:d,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:c,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?XS():(n=e.initialState.columnSizingInfo)!=null?n:XS())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0}}};let Jg=null;function H0e(){if(typeof Jg=="boolean")return Jg;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Jg=e,Jg}function QS(e){return e.type==="touchstart"}const q0e={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:$i("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const i=e.columns;return(n=i.length?i.some(o=>o.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Je(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),et(t.options,"debugRows")),e.getVisibleCells=Je(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,i)=>[...n,...r,...i],et(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>Je(()=>[r(),r().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),et(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((i,o)=>({...i,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Um(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const G0e={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},K0e={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:$i("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,i,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Pa.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return ux(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Pa[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Z0e={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:$i("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var i,o;e.setExpanded(r?{}:(i=(o=e.initialState)==null?void 0:o.expanded)!=null?i:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const a=o.split(".");r=Math.max(r,a.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var i;const o=r===!0?!0:!!(r!=null&&r[e.id]);let a={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(c=>{a[c]=!0}):a=r,n=(i=n)!=null?i:!o,!o&&n)return{...a,[e.id]:!0};if(o&&!n){const{[e.id]:c,...d}=a;return d}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r?.[e.id])},e.getCanExpand=()=>{var n,r,i;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((i=e.subRows)!=null&&i.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},K1=0,Z1=10,JS=()=>({pageIndex:K1,pageSize:Z1}),Y0e={getInitialState:e=>({...e,pagination:{...JS(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:$i("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const i=o=>Ls(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},e.resetPagination=r=>{var i;e.setPagination(r?JS():(i=e.initialState.pagination)!=null?i:JS())},e.setPageIndex=r=>{e.setPagination(i=>{let o=Ls(r,i.pageIndex);const a=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,a)),{...i,pageIndex:o}})},e.resetPageIndex=r=>{var i,o;e.setPageIndex(r?K1:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?i:K1)},e.resetPageSize=r=>{var i,o;e.setPageSize(r?Z1:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?i:Z1)},e.setPageSize=r=>{e.setPagination(i=>{const o=Math.max(1,Ls(r,i.pageSize)),a=i.pageSize*i.pageIndex,c=Math.floor(a/o);return{...i,pageIndex:c,pageSize:o}})},e.setPageCount=r=>e.setPagination(i=>{var o;let a=Ls(r,(o=e.options.pageCount)!=null?o:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...i,pageCount:a}}),e.getPageOptions=Je(()=>[e.getPageCount()],r=>{let i=[];return r&&r>0&&(i=[...new Array(r)].fill(null).map((o,a)=>a)),i},et(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,i=e.getPageCount();return i===-1?!0:i===0?!1:r<i-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},e_=()=>({top:[],bottom:[]}),W0e={getInitialState:e=>({rowPinning:e_(),...e}),getDefaultOptions:e=>({onRowPinningChange:$i("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,i)=>{const o=r?e.getLeafRows().map(d=>{let{id:f}=d;return f}):[],a=i?e.getParentRows().map(d=>{let{id:f}=d;return f}):[],c=new Set([...a,e.id,...o]);t.setRowPinning(d=>{var f,p;if(n==="bottom"){var h,v;return{top:((h=d?.top)!=null?h:[]).filter(S=>!(c!=null&&c.has(S))),bottom:[...((v=d?.bottom)!=null?v:[]).filter(S=>!(c!=null&&c.has(S))),...Array.from(c)]}}if(n==="top"){var y,b;return{top:[...((y=d?.top)!=null?y:[]).filter(S=>!(c!=null&&c.has(S))),...Array.from(c)],bottom:((b=d?.bottom)!=null?b:[]).filter(S=>!(c!=null&&c.has(S)))}}return{top:((f=d?.top)!=null?f:[]).filter(S=>!(c!=null&&c.has(S))),bottom:((p=d?.bottom)!=null?p:[]).filter(S=>!(c!=null&&c.has(S)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:i}=t.options;return typeof r=="function"?r(e):(n=r??i)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,o=n.some(c=>r?.includes(c)),a=n.some(c=>i?.includes(c));return o?"top":a?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();if(!i)return-1;const o=(n=i==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(a=>{let{id:c}=a;return c});return(r=o?.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?e_():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:e_())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var i,o;return!!((i=r.top)!=null&&i.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var i;return((i=e.options.keepPinnedRows)==null||i?(n??[]).map(a=>{const c=e.getRow(a,!0);return c.getIsAllParentsExpanded()?c:null}):(n??[]).map(a=>t.find(c=>c.id===a))).filter(Boolean).map(a=>({...a,position:r}))},e.getTopRows=Je(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),et(e.options,"debugRows")),e.getBottomRows=Je(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),et(e.options,"debugRows")),e.getCenterRows=Je(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const i=new Set([...n??[],...r??[]]);return t.filter(o=>!i.has(o.id))},et(e.options,"debugRows"))}},X0e={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:$i("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):i.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),i={...n};return e.getRowModel().rows.forEach(o=>{Y1(i,o.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Je(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?t_(e,n):{rows:[],flatRows:[],rowsById:{}},et(e.options,"debugTable")),e.getFilteredSelectedRowModel=Je(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?t_(e,n):{rows:[],flatRows:[],rowsById:{}},et(e.options,"debugTable")),e.getGroupedSelectedRowModel=Je(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?t_(e,n):{rows:[],flatRows:[],rowsById:{}},et(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(i=>i.getCanSelect()&&!n[i.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(i=>!n[i.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const i=e.getIsSelected();t.setRowSelection(o=>{var a;if(n=typeof n<"u"?n:!i,e.getCanSelect()&&i===n)return o;const c={...o};return Y1(c,e.id,n,(a=r?.selectChildren)!=null?a:!0,t),c})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Yj(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return W1(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return W1(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var i;n&&e.toggleSelected((i=r.target)==null?void 0:i.checked)}}}},Y1=(e,t,n,r,i)=>{var o;const a=i.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(c=>delete e[c]),a.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=a.subRows)!=null&&o.length&&a.getCanSelectSubRows()&&a.subRows.forEach(c=>Y1(e,c.id,n,r,i))};function t_(e,t){const n=e.getState().rowSelection,r=[],i={},o=function(a,c){return a.map(d=>{var f;const p=Yj(d,n);if(p&&(r.push(d),i[d.id]=d),(f=d.subRows)!=null&&f.length&&(d={...d,subRows:o(d.subRows)}),p)return d}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:i}}function Yj(e,t){var n;return(n=t[e.id])!=null?n:!1}function W1(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let i=!0,o=!1;return e.subRows.forEach(a=>{if(!(o&&!i)&&(a.getCanSelect()&&(Yj(a,t)?o=!0:i=!1),a.subRows&&a.subRows.length)){const c=W1(a,t);c==="all"?o=!0:(c==="some"&&(o=!0),i=!1)}}),i?"all":o?"some":!1}const X1=/([0-9]+)/gm,Q0e=(e,t,n)=>mH(sl(e.getValue(n)).toLowerCase(),sl(t.getValue(n)).toLowerCase()),J0e=(e,t,n)=>mH(sl(e.getValue(n)),sl(t.getValue(n))),ewe=(e,t,n)=>Wj(sl(e.getValue(n)).toLowerCase(),sl(t.getValue(n)).toLowerCase()),twe=(e,t,n)=>Wj(sl(e.getValue(n)),sl(t.getValue(n))),nwe=(e,t,n)=>{const r=e.getValue(n),i=t.getValue(n);return r>i?1:r<i?-1:0},rwe=(e,t,n)=>Wj(e.getValue(n),t.getValue(n));function Wj(e,t){return e===t?0:e>t?1:-1}function sl(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function mH(e,t){const n=e.split(X1).filter(Boolean),r=t.split(X1).filter(Boolean);for(;n.length&&r.length;){const i=n.shift(),o=r.shift(),a=parseInt(i,10),c=parseInt(o,10),d=[a,c].sort();if(isNaN(d[0])){if(i>o)return 1;if(o>i)return-1;continue}if(isNaN(d[1]))return isNaN(a)?-1:1;if(a>c)return 1;if(c>a)return-1}return n.length-r.length}const bm={alphanumeric:Q0e,alphanumericCaseSensitive:J0e,text:ewe,textCaseSensitive:twe,datetime:nwe,basic:rwe},iwe={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:$i("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const i of n){const o=i?.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return bm.datetime;if(typeof o=="string"&&(r=!0,o.split(X1).length>1))return bm.alphanumeric}return r?bm.text:bm.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return ux(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:bm[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const i=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(a=>{const c=a?.find(y=>y.id===e.id),d=a?.findIndex(y=>y.id===e.id);let f=[],p,h=o?n:i==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&r?c?p="toggle":p="add":a!=null&&a.length&&d!==a.length-1?p="replace":c?p="toggle":p="replace",p==="toggle"&&(o||i||(p="remove")),p==="add"){var v;f=[...a,{id:e.id,desc:h}],f.splice(0,f.length-((v=t.options.maxMultiSortColCount)!=null?v:Number.MAX_SAFE_INTEGER))}else p==="toggle"?f=a.map(y=>y.id===e.id?{...y,desc:h}:y):p==="remove"?f=a.filter(y=>y.id!==e.id):f=[{id:e.id,desc:h}];return f})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,i;const o=e.getFirstSortDir(),a=e.getIsSorted();return a?a!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(i=t.options.enableMultiRemove)!=null)||i)?!1:a==="desc"?"asc":"desc":o},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(i=>i.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},owe=[E0e,q0e,U0e,F0e,j0e,R0e,G0e,K0e,iwe,z0e,Z0e,Y0e,W0e,X0e,B0e];function awe(e){var t,n;const r=[...owe,...(t=e._features)!=null?t:[]];let i={_features:r};const o=i._features.reduce((v,y)=>Object.assign(v,y.getDefaultOptions==null?void 0:y.getDefaultOptions(i)),{}),a=v=>i.options.mergeOptions?i.options.mergeOptions(o,v):{...o,...v};let d={...{},...(n=e.initialState)!=null?n:{}};i._features.forEach(v=>{var y;d=(y=v.getInitialState==null?void 0:v.getInitialState(d))!=null?y:d});const f=[];let p=!1;const h={_features:r,options:{...o,...e},initialState:d,_queue:v=>{f.push(v),p||(p=!0,Promise.resolve().then(()=>{for(;f.length;)f.shift()();p=!1}).catch(y=>setTimeout(()=>{throw y})))},reset:()=>{i.setState(i.initialState)},setOptions:v=>{const y=Ls(v,i.options);i.options=a(y)},getState:()=>i.options.state,setState:v=>{i.options.onStateChange==null||i.options.onStateChange(v)},_getRowId:(v,y,b)=>{var S;return(S=i.options.getRowId==null?void 0:i.options.getRowId(v,y,b))!=null?S:`${b?[b.id,y].join("."):y}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(v,y)=>{let b=(y?i.getPrePaginationRowModel():i.getRowModel()).rowsById[v];if(!b&&(b=i.getCoreRowModel().rowsById[v],!b))throw new Error;return b},_getDefaultColumnDef:Je(()=>[i.options.defaultColumn],v=>{var y;return v=(y=v)!=null?y:{},{header:b=>{const S=b.header.column.columnDef;return S.accessorKey?S.accessorKey:S.accessorFn?S.id:null},cell:b=>{var S,C;return(S=(C=b.renderValue())==null||C.toString==null?void 0:C.toString())!=null?S:null},...i._features.reduce((b,S)=>Object.assign(b,S.getDefaultColumnDef==null?void 0:S.getDefaultColumnDef()),{}),...v}},et(e,"debugColumns")),_getColumnDefs:()=>i.options.columns,getAllColumns:Je(()=>[i._getColumnDefs()],v=>{const y=function(b,S,C){return C===void 0&&(C=0),b.map(E=>{const k=C0e(i,E,C,S),j=E;return k.columns=j.columns?y(j.columns,k,C+1):[],k})};return y(v)},et(e,"debugColumns")),getAllFlatColumns:Je(()=>[i.getAllColumns()],v=>v.flatMap(y=>y.getFlatColumns()),et(e,"debugColumns")),_getAllFlatColumnsById:Je(()=>[i.getAllFlatColumns()],v=>v.reduce((y,b)=>(y[b.id]=b,y),{}),et(e,"debugColumns")),getAllLeafColumns:Je(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(v,y)=>{let b=v.flatMap(S=>S.getLeafColumns());return y(b)},et(e,"debugColumns")),getColumn:v=>i._getAllFlatColumnsById()[v]};Object.assign(i,h);for(let v=0;v<i._features.length;v++){const y=i._features[v];y==null||y.createTable==null||y.createTable(i)}return i}function dx(){return e=>Je(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(i,o,a){o===void 0&&(o=0);const c=[];for(let f=0;f<i.length;f++){const p=k0e(e,e._getRowId(i[f],f,a),i[f],f,o,void 0,a?.id);if(n.flatRows.push(p),n.rowsById[p.id]=p,c.push(p),e.options.getSubRows){var d;p.originalSubRows=e.options.getSubRows(i[f],f),(d=p.originalSubRows)!=null&&d.length&&(p.subRows=r(p.originalSubRows,o+1,p))}}return c};return n.rows=r(t),n},et(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function swe(e){const t=[],n=r=>{var i;t.push(r),(i=r.subRows)!=null&&i.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function lwe(e){return t=>Je(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:i,pageIndex:o}=n;let{rows:a,flatRows:c,rowsById:d}=r;const f=i*o,p=f+i;a=a.slice(f,p);let h;t.options.paginateExpandedRows?h={rows:a,flatRows:c,rowsById:d}:h=swe({rows:a,flatRows:c,rowsById:d}),h.flatRows=[];const v=y=>{h.flatRows.push(y),y.subRows.length&&y.subRows.forEach(v)};return h.rows.forEach(v),h},et(t.options,"debugTable"))}function cwe(){return e=>Je(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,i=[],o=r.filter(d=>{var f;return(f=e.getColumn(d.id))==null?void 0:f.getCanSort()}),a={};o.forEach(d=>{const f=e.getColumn(d.id);f&&(a[d.id]={sortUndefined:f.columnDef.sortUndefined,invertSorting:f.columnDef.invertSorting,sortingFn:f.getSortingFn()})});const c=d=>{const f=d.map(p=>({...p}));return f.sort((p,h)=>{for(let y=0;y<o.length;y+=1){var v;const b=o[y],S=a[b.id],C=S.sortUndefined,E=(v=b?.desc)!=null?v:!1;let k=0;if(C){const j=p.getValue(b.id),I=h.getValue(b.id),A=j===void 0,N=I===void 0;if(A||N){if(C==="first")return A?-1:1;if(C==="last")return A?1:-1;k=A&&N?0:A?C:-C}}if(k===0&&(k=S.sortingFn(p,h,b.id)),k!==0)return E&&(k*=-1),S.invertSorting&&(k*=-1),k}return p.index-h.index}),f.forEach(p=>{var h;i.push(p),(h=p.subRows)!=null&&h.length&&(p.subRows=c(p.subRows))}),f};return{rows:c(n.rows),flatRows:i,rowsById:n.rowsById}},et(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function wc(e,t){return e?uwe(e)?x.createElement(e,t):e:null}function uwe(e){return dwe(e)||typeof e=="function"||fwe(e)}function dwe(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function fwe(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function fx(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=x.useState(()=>({current:awe(t)})),[r,i]=x.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:a=>{i(a),e.onStateChange==null||e.onStateChange(a)}})),n.current}function mx({className:e,containerClassName:t,...n}){return u.jsx("div",{"data-slot":"table-container",className:Pe("relative w-full overflow-x-auto",t),children:u.jsx("table",{"data-slot":"table",className:Pe("w-full caption-bottom text-sm",e),...n})})}function rh({className:e,...t}){return u.jsx("thead",{"data-slot":"table-header",className:Pe("[&_tr]:border-b",e),...t})}function px({className:e,...t}){return u.jsx("tbody",{"data-slot":"table-body",className:Pe("[&_tr:last-child]:border-0",e),...t})}function Ai({className:e,...t}){return u.jsx("tr",{"data-slot":"table-row",className:Pe("border-b border-grey-700 transition-colors",e),...t})}function Xj({className:e,...t}){return u.jsx("th",{"data-slot":"table-head",className:Pe("h-10 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function pH({header:e,onColumnClick:t,...n}){const r=x.useCallback(()=>{e.column.toggleSorting(e.column.getIsSorted()==="asc");const d=e.column.getIsSorted()===!1||e.column.getIsSorted()!=="asc";t?.(e.column.columnDef.accessorKey,d)},[e,t]),i=e.column.columnDef.enableSorting,o=e.column.columnDef.enableResizing,a=e.isPlaceholder?null:wc(e.column.columnDef.header,e.getContext()),c=x.useCallback(()=>{e.column.resetSize()},[e]);return u.jsx(Xj,{...n,style:{width:`${e.getSize()}px`},className:i?"px-0":"px-2",children:u.jsxs("div",{className:"flex items-center justify-between",children:[i?u.jsxs(be,{type:"button",variant:"ghost",className:Pe("rounded-none",!e.column.getIsSorted()||e.column.getIsSorted()==="asc"?"cursor-n-resize":"cursor-s-resize"),onClick:r,children:[a,e.column.getIsSorted()==="asc"?u.jsx(nX,{}):e.column.getIsSorted()==="desc"?u.jsx(kP,{}):u.jsx(eX,{className:"text-gray-600"})]}):a,o&&u.jsx(be,{type:"button",variant:"ghost",className:"cursor-col-resize",onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),onDoubleClick:c,style:{transform:e.column.getIsResizing()?`translateX(${e.getContext().table.getState().columnSizingInfo.deltaOffset}px)`:""},children:u.jsx(KX,{})})]})})}function Xa({className:e,...t}){return u.jsx("td",{"data-slot":"table-cell",className:Pe("align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function sf({columns:e,data:t,isFetching:n,onRowClick:r,onColumnClick:i,sortingState:o,children:a}){const c=fx({data:t,columns:e,getCoreRowModel:dx(),getSortedRowModel:cwe(),initialState:{sorting:o}});return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center justify-end space-x-2 pb-4",children:[u.jsx("div",{className:"grow lg:hidden"}),a,u.jsx("div",{className:"grow hidden lg:visible"})]}),u.jsxs(mx,{containerClassName:"rounded-md bg-black-dark",children:[u.jsx(rh,{children:c.getHeaderGroups().map(d=>u.jsx(Ai,{className:"border-none",children:d.headers.map(f=>u.jsx(pH,{header:f,onColumnClick:i},f.id))},d.id))}),u.jsx(px,{className:"bg-black border border-grey-700",children:c.getRowModel().rows?.length?c.getRowModel().rows.map(d=>u.jsx(Ai,{"data-state":d.getIsSelected()&&"selected",onClick:()=>r?.(d),className:Pe("hover:bg-muted/10 data-[state=selected]:bg-muted",r&&"cursor-pointer"),children:d.getVisibleCells().map(f=>u.jsx(Xa,{className:"py-2 px-2 overflow-x-hidden max-w-32 text-ellipsis whitespace-nowrap",children:wc(f.column.columnDef.cell,f.getContext())},f.id))},d.id)):u.jsx(Ai,{children:u.jsx(Xa,{colSpan:e.length,className:"h-24 text-center",children:n?u.jsx("div",{children:u.jsx(Ui,{className:"p-12"})}):u.jsx("span",{children:"No results."})})})})]})]})}function mwe(e){switch(e){case"paid":return"success";case"void":case"uncollectible":return"destructive";case"draft":case"open":default:return"default"}}function n_(e){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(e)}function sc(e,t){if(e<45)return"a few seconds ago";if(e<120)return"a minute ago";const n=Math.floor(e/60);if(n<60)return`${n} minutes ago`;if(n<120)return"an hour ago";const r=Math.floor(e/3600);return r>48?new Date(t).toLocaleString():`${r} hours ago`}const pwe=[{header:"Invoice Id",accessorKey:"id",enableSorting:!1},{header:"Status",accessorKey:"status",enableSorting:!1,cell:({cell:e})=>u.jsx(zo,{variant:mwe(e.getValue()),children:e.getValue()})},{header:"Date",accessorKey:"periodStart",enableSorting:!1,cell:({cell:e})=>{const t=e.row.original.periodStart*1e3,n=e.row.original.periodEnd*1e3,r=(Date.now()-t)/1e3,i=(Date.now()-n)/1e3;return Math.abs(r-i)<1e3?sc(r,t):[t?sc(r,t):"-",n?sc(i,n):"-"].join(" to ")}},{header:"Amount Due",accessorKey:"amountDue",enableSorting:!1,cell:({cell:e})=>n_(e.getValue()?e.getValue()/100:0)},{header:"Amount Paid",accessorKey:"amountPaid",enableSorting:!1,cell:({cell:e})=>n_(e.getValue()?e.getValue()/100:0)},{header:"Lines",accessorKey:"lines",enableSorting:!1,cell:({cell:e})=>{const t=e.getValue(),n=[];for(const r of t)n.push(`${r.quantity}x ${r.description} @ ${n_(r.amount/100)}`);return n.join(`
|
|
117
|
-
`)}}];function vl(e){return x.useCallback(async()=>{const t=_e.loading("Refreshing..."),n=Date.now();await e(),Date.now()-n<500&&await Md(500),_e.dismiss(t),_e.success("Refreshed!")},[e])}async function hwe(e){const{data:t}=await Ut.get(`/Invoice/${e}`);return t}function gwe(e,t){return{queryKey:[e,"invoices"],queryFn:()=>hwe(e),retry:!1,enabled:!!e,refetchInterval:void 0}}function vwe(){const{organizationId:e}=tt({strict:!1}),{data:t}=Mt(Lc(e)),{data:n,refetch:r,isLoading:i,isFetching:o,isRefetching:a}=Mt(gwe(t?.type!=="ENTERPRISE"&&t?.id)),c=vl(r);return t?.type==="ENTERPRISE"?u.jsxs("span",{children:["You are part of an enterprise organization! We don’t currently show your invoices on this page. Want to explore your solution with Harper more? ",u.jsx(al,{}),", we would love to talk!"]}):i?u.jsx(Ui,{centered:!0}):!n||!n.length?u.jsxs("span",{children:["Your invoices will be shown here once one is available! Want to explore your solution with Harper more? ",u.jsx(al,{overEmail:!0}),", we would love to talk!"]}):u.jsx(sf,{data:n,columns:pwe,children:u.jsxs(be,{variant:"defaultOutline",onClick:c,accessKey:"r",disabled:o||a,children:[u.jsx(sa,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]})})}function ywe(e){const t=Qe({getParentRoute:()=>e,path:"billing",component:y0e}),n=Qe({getParentRoute:()=>t,path:"/",component:wB}),r=Qe({getParentRoute:()=>t,path:"invoices",component:vwe}),i=Qe({getParentRoute:()=>t,path:"confirm",component:v0e});return t.addChildren([n,r,i])}async function bwe(e){const{data:t}=await Ut.get(`/OrganizationRole/${e}`);return t}function hx(e){return{queryKey:[e,"roles"],queryFn:()=>bwe(e),retry:!1,refetchInterval:10*1e3}}const xwe=cx(),wwe=[{header:"Role Name",accessorKey:"roleName",enableSorting:!1},xwe.display({header:"Users Assigned",enableSorting:!1,id:"userIds",cell:e=>!e.row.original.userIds||e.row.original.userIds.length===0?"No users assigned":e.row.original.userIds.length})],Swe=_r.object({roleName:_r.string().nonempty({error:"Please enter a role name."}).regex(/^[a-zA-Z_]*$/,{error:"Role must contain only letters and underscores."}).max(30,{error:"Role name cannot be longer than 30 characters."}),updateOrganization:_r.boolean(),deleteOrganization:_r.boolean()});async function _we(e){const{data:t}=await Ut.post("/Role/",e);return t}function Cwe(){return at({mutationFn:e=>_we(e)})}function Ewe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function L2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?z2(Object(n),!0).forEach(function(r){Ewe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kwe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function jwe(e,t){if(e==null)return{};var n=kwe(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Rwe(e,t){return Iwe(e)||Nwe(e,t)||Twe(e,t)||Awe()}function Iwe(e){if(Array.isArray(e))return e}function Nwe(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,o=void 0;try{for(var a=e[Symbol.iterator](),c;!(r=(c=a.next()).done)&&(n.push(c.value),!(t&&n.length===t));r=!0);}catch(d){i=!0,o=d}finally{try{!r&&a.return!=null&&a.return()}finally{if(i)throw o}}return n}}function Twe(e,t){if(e){if(typeof e=="string")return U2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return U2(e,t)}}function U2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Awe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
118
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Owe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function V2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?F2(Object(n),!0).forEach(function(r){Owe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dwe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(i,o){return o(i)},r)}}function Am(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var a=arguments.length,c=new Array(a),d=0;d<a;d++)c[d]=arguments[d];return t.apply(n,[].concat(i,c))}}}function Cy(e){return{}.toString.call(e).includes("Object")}function $we(e){return!Object.keys(e).length}function dp(e){return typeof e=="function"}function Mwe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Pwe(e,t){return Cy(t)||Xs("changeType"),Object.keys(t).some(function(n){return!Mwe(e,n)})&&Xs("changeField"),t}function zwe(e){dp(e)||Xs("selectorType")}function Lwe(e){dp(e)||Cy(e)||Xs("handlerType"),Cy(e)&&Object.values(e).some(function(t){return!dp(t)})&&Xs("handlersType")}function Uwe(e){e||Xs("initialIsRequired"),Cy(e)||Xs("initialType"),$we(e)&&Xs("initialContent")}function Fwe(e,t){throw new Error(e[t]||e.default)}var Vwe={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Xs=Am(Fwe)(Vwe),ev={changes:Pwe,selector:zwe,handler:Lwe,initial:Uwe};function Bwe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ev.initial(e),ev.handler(t);var n={current:e},r=Am(Gwe)(n,t),i=Am(qwe)(n),o=Am(ev.changes)(e),a=Am(Hwe)(n);function c(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(p){return p};return ev.selector(f),f(n.current)}function d(f){Dwe(r,i,o,a)(f)}return[c,d]}function Hwe(e,t){return dp(t)?t(e.current):t}function qwe(e,t){return e.current=V2(V2({},e.current),t),t}function Gwe(e,t,n){return dp(t)?t(e.current):Object.keys(n).forEach(function(r){var i;return(i=t[r])===null||i===void 0?void 0:i.call(t,e.current[r])}),n}var Kwe={create:Bwe},Zwe={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"}};function Ywe(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var a=arguments.length,c=new Array(a),d=0;d<a;d++)c[d]=arguments[d];return t.apply(n,[].concat(i,c))}}}function Wwe(e){return{}.toString.call(e).includes("Object")}function Xwe(e){return e||B2("configIsRequired"),Wwe(e)||B2("configType"),e.urls?(Qwe(),{paths:{vs:e.urls.monacoBase}}):e}function Qwe(){console.warn(hH.deprecation)}function Jwe(e,t){throw new Error(e[t]||e.default)}var hH={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
119
|
-
You are using deprecated way of configuration.
|
|
120
|
-
|
|
121
|
-
Instead of using
|
|
122
|
-
monaco.config({ urls: { monacoBase: '...' } })
|
|
123
|
-
use
|
|
124
|
-
monaco.config({ paths: { vs: '...' } })
|
|
125
|
-
|
|
126
|
-
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
127
|
-
`},B2=Ywe(Jwe)(hH),eSe={config:Xwe},tSe=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(i){return n.reduceRight(function(o,a){return a(o)},i)}};function gH(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],gH(e[n],t[n]))}),L2(L2({},e),t)}var nSe={type:"cancelation",msg:"operation is manually canceled"};function r_(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(nSe):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var rSe=Kwe.create({config:Zwe,isInitialized:!1,resolve:null,reject:null,monaco:null}),vH=Rwe(rSe,2),ih=vH[0],gx=vH[1];function iSe(e){var t=eSe.config(e),n=t.monaco,r=jwe(t,["monaco"]);gx(function(i){return{config:gH(i.config,r),monaco:n}})}function oSe(){var e=ih(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(gx({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),r_(i_);if(window.monaco&&window.monaco.editor)return yH(window.monaco),e.resolve(window.monaco),r_(i_);tSe(aSe,lSe)(cSe)}return r_(i_)}function aSe(e){return document.body.appendChild(e)}function sSe(e){var t=document.createElement("script");return e&&(t.src=e),t}function lSe(e){var t=ih(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=sSe("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function cSe(){var e=ih(function(n){var r=n.config,i=n.resolve,o=n.reject;return{config:r,resolve:i,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){yH(n),e.resolve(n)},function(n){e.reject(n)})}function yH(e){ih().monaco||gx({monaco:e})}function uSe(){return ih(function(e){var t=e.monaco;return t})}var i_=new Promise(function(e,t){return gx({resolve:e,reject:t})}),bH={config:iSe,init:oSe,__getMonacoInstance:uSe},dSe={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},o_=dSe,fSe={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},mSe=fSe;function pSe({children:e}){return X.createElement("div",{style:mSe.container},e)}var hSe=pSe,gSe=hSe;function vSe({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:a}){return X.createElement("section",{style:{...o_.wrapper,width:e,height:t},...a},!n&&X.createElement(gSe,null,r),X.createElement("div",{ref:i,style:{...o_.fullWidth,...!n&&o_.hide},className:o}))}var ySe=vSe,xH=x.memo(ySe);function bSe(e){x.useEffect(e,[])}var wH=bSe;function xSe(e,t,n=!0){let r=x.useRef(!0);x.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Ei=xSe;function Fm(){}function Wu(e,t,n,r){return wSe(e,r)||SSe(e,t,n,r)}function wSe(e,t){return e.editor.getModel(SH(e,t))}function SSe(e,t,n,r){return e.editor.createModel(t,n,r?SH(e,r):void 0)}function SH(e,t){return e.Uri.parse(t)}function _Se({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:a,keepCurrentOriginalModel:c=!1,keepCurrentModifiedModel:d=!1,theme:f="light",loading:p="Loading...",options:h={},height:v="100%",width:y="100%",className:b,wrapperProps:S={},beforeMount:C=Fm,onMount:E=Fm}){let[k,j]=x.useState(!1),[I,A]=x.useState(!0),N=x.useRef(null),T=x.useRef(null),z=x.useRef(null),L=x.useRef(E),G=x.useRef(C),J=x.useRef(!1);wH(()=>{let Z=bH.init();return Z.then(M=>(T.current=M)&&A(!1)).catch(M=>M?.type!=="cancelation"&&console.error("Monaco initialization: error:",M)),()=>N.current?F():Z.cancel()}),Ei(()=>{if(N.current&&T.current){let Z=N.current.getOriginalEditor(),M=Wu(T.current,e||"",r||n||"text",o||"");M!==Z.getModel()&&Z.setModel(M)}},[o],k),Ei(()=>{if(N.current&&T.current){let Z=N.current.getModifiedEditor(),M=Wu(T.current,t||"",i||n||"text",a||"");M!==Z.getModel()&&Z.setModel(M)}},[a],k),Ei(()=>{let Z=N.current.getModifiedEditor();Z.getOption(T.current.editor.EditorOption.readOnly)?Z.setValue(t||""):t!==Z.getValue()&&(Z.executeEdits("",[{range:Z.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),Z.pushUndoStop())},[t],k),Ei(()=>{N.current?.getModel()?.original.setValue(e||"")},[e],k),Ei(()=>{let{original:Z,modified:M}=N.current.getModel();T.current.editor.setModelLanguage(Z,r||n||"text"),T.current.editor.setModelLanguage(M,i||n||"text")},[n,r,i],k),Ei(()=>{T.current?.editor.setTheme(f)},[f],k),Ei(()=>{N.current?.updateOptions(h)},[h],k);let Y=x.useCallback(()=>{if(!T.current)return;G.current(T.current);let Z=Wu(T.current,e||"",r||n||"text",o||""),M=Wu(T.current,t||"",i||n||"text",a||"");N.current?.setModel({original:Z,modified:M})},[n,t,i,e,r,o,a]),W=x.useCallback(()=>{!J.current&&z.current&&(N.current=T.current.editor.createDiffEditor(z.current,{automaticLayout:!0,...h}),Y(),T.current?.editor.setTheme(f),j(!0),J.current=!0)},[h,f,Y]);x.useEffect(()=>{k&&L.current(N.current,T.current)},[k]),x.useEffect(()=>{!I&&!k&&W()},[I,k,W]);function F(){let Z=N.current?.getModel();c||Z?.original?.dispose(),d||Z?.modified?.dispose(),N.current?.dispose()}return X.createElement(xH,{width:y,height:v,isEditorReady:k,loading:p,_ref:z,className:b,wrapperProps:S})}var CSe=_Se;x.memo(CSe);function ESe(e){let t=x.useRef();return x.useEffect(()=>{t.current=e},[e]),t.current}var kSe=ESe,tv=new Map;function jSe({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:o,theme:a="light",line:c,loading:d="Loading...",options:f={},overrideServices:p={},saveViewState:h=!0,keepCurrentModel:v=!1,width:y="100%",height:b="100%",className:S,wrapperProps:C={},beforeMount:E=Fm,onMount:k=Fm,onChange:j,onValidate:I=Fm}){let[A,N]=x.useState(!1),[T,z]=x.useState(!0),L=x.useRef(null),G=x.useRef(null),J=x.useRef(null),Y=x.useRef(k),W=x.useRef(E),F=x.useRef(),Z=x.useRef(r),M=kSe(o),K=x.useRef(!1),U=x.useRef(!1);wH(()=>{let P=bH.init();return P.then(V=>(L.current=V)&&z(!1)).catch(V=>V?.type!=="cancelation"&&console.error("Monaco initialization: error:",V)),()=>G.current?D():P.cancel()}),Ei(()=>{let P=Wu(L.current,e||r||"",t||i||"",o||n||"");P!==G.current?.getModel()&&(h&&tv.set(M,G.current?.saveViewState()),G.current?.setModel(P),h&&G.current?.restoreViewState(tv.get(o)))},[o],A),Ei(()=>{G.current?.updateOptions(f)},[f],A),Ei(()=>{!G.current||r===void 0||(G.current.getOption(L.current.editor.EditorOption.readOnly)?G.current.setValue(r):r!==G.current.getValue()&&(U.current=!0,G.current.executeEdits("",[{range:G.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),G.current.pushUndoStop(),U.current=!1))},[r],A),Ei(()=>{let P=G.current?.getModel();P&&i&&L.current?.editor.setModelLanguage(P,i)},[i],A),Ei(()=>{c!==void 0&&G.current?.revealLine(c)},[c],A),Ei(()=>{L.current?.editor.setTheme(a)},[a],A);let te=x.useCallback(()=>{if(!(!J.current||!L.current)&&!K.current){W.current(L.current);let P=o||n,V=Wu(L.current,r||e||"",t||i||"",P||"");G.current=L.current?.editor.create(J.current,{model:V,automaticLayout:!0,...f},p),h&&G.current.restoreViewState(tv.get(P)),L.current.editor.setTheme(a),c!==void 0&&G.current.revealLine(c),N(!0),K.current=!0}},[e,t,n,r,i,o,f,p,h,a,c]);x.useEffect(()=>{A&&Y.current(G.current,L.current)},[A]),x.useEffect(()=>{!T&&!A&&te()},[T,A,te]),Z.current=r,x.useEffect(()=>{A&&j&&(F.current?.dispose(),F.current=G.current?.onDidChangeModelContent(P=>{U.current||j(G.current.getValue(),P)}))},[A,j]),x.useEffect(()=>{if(A){let P=L.current.editor.onDidChangeMarkers(V=>{let O=G.current.getModel()?.uri;if(O&&V.find(ee=>ee.path===O.path)){let ee=L.current.editor.getModelMarkers({resource:O});I?.(ee)}});return()=>{P?.dispose()}}return()=>{}},[A,I]);function D(){F.current?.dispose(),v?h&&tv.set(o,G.current.saveViewState()):G.current.getModel()?.dispose(),G.current.dispose()}return X.createElement(xH,{width:y,height:b,isEditorReady:A,loading:d,_ref:J,className:S,wrapperProps:C})}var RSe=jSe,oh=x.memo(RSe),vx=oh;const H2={roles:{create:!0,view:!0,update:!0,delete:!0},clusters:{create:!0,view:!0,update:!0,delete:!0,resources:[]}};function ISe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const{organizationId:r}=tt({strict:!1}),[i,o]=x.useState(!0),[a,c]=x.useState(JSON.stringify(H2,null,2)),{mutate:d,isPending:f}=Cwe(),p=Qt({resolver:ln(Swe),defaultValues:{roleName:"",updateOrganization:!1,deleteOrganization:!1}}),h=x.useCallback(y=>{o(y.length===0)},[o]),v=x.useCallback(async y=>{const b={organizationId:r,name:y.roleName,update:y.updateOrganization,delete:y.deleteOrganization,...JSON.parse(a)};y&&i&&d(b,{onSuccess:()=>{p.reset(),t(),_e.success("Organization role added successfully!")},onError:S=>{_e.error(`Failed to add organization role: ${S.message}`)}})},[i,a,d,p,t,r]);return u.jsx(zn,{onOpenChange:n,open:e,children:u.jsxs(Ln,{children:[u.jsx(Nn,{children:"Add New Organization Role"}),u.jsx(jr,{children:"Set the new organization role permissions."}),u.jsx(Jt,{...p,children:u.jsxs("form",{className:"grid grid-cols-2 gap-4 my-4",onSubmit:p.handleSubmit(v),children:[u.jsx(Me,{control:p.control,name:"roleName",render:({field:y})=>u.jsxs(Ae,{className:"col-span-2",children:[u.jsx(Oe,{className:"pb-1",children:"Role Name"}),u.jsx($e,{children:u.jsx(ze,{type:"text",placeholder:"Developer",className:"",...y})}),u.jsx(De,{})]})}),u.jsx(Me,{control:p.control,name:"updateOrganization",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Can Update Organization"}),u.jsx($e,{children:u.jsx(ze,{type:"checkbox",className:"w-6 ml-2",checked:y.value,onChange:b=>y.onChange(b.target.checked)})}),u.jsx(De,{})]})}),u.jsx(Me,{control:p.control,name:"deleteOrganization",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Can Delete Organization"}),u.jsx($e,{children:u.jsx(ze,{type:"checkbox",className:"w-6 ml-2",checked:y.value,onChange:b=>y.onChange(b.target.checked)})}),u.jsx(De,{})]})}),u.jsx("div",{className:"col-span-2",children:u.jsx(oh,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate:h,onChange:y=>{y&&c(y)},defaultValue:JSON.stringify(H2,null,2)})}),u.jsx(Un,{className:"col-span-2",children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx(be,{variant:"destructiveOutline",className:"rounded-full",type:"button",onClick:()=>n(!1),disabled:f,children:"Cancel"}),u.jsx(be,{variant:"submit",className:"rounded-full",disabled:f||!i,children:"Save Changes"})]})})]})})]})})}async function NSe({roleId:e}){const{data:t}=await Ut.delete(`/Role/${e}`,{id:e,deleted:!0});return t}function TSe(){return at({mutationFn:({roleId:e})=>NSe({roleId:e})})}const ASe=_r.object({roleName:_r.string().nonempty({error:"Please enter a role name."}).regex(/^[a-zA-Z_]*$/,{error:"Role must contain only letters and underscores."}).max(30,{error:"Role name cannot be longer than 30 characters."}),updateOrganization:_r.boolean(),deleteOrganization:_r.boolean()});async function OSe({roleId:e,updatedRoleInfo:t}){const{data:n}=await Ut.put(`/Role/${e}`,t);return n}function DSe(){return at({mutationFn:({roleId:e,updatedRoleInfo:t})=>OSe({roleId:e,updatedRoleInfo:t})})}function $Se({organizationId:e,roleId:t}){return{queryKey:[e,"roles",t],queryFn:()=>MSe(t),refetchInterval:10*1e3}}async function MSe(e){const{data:t}=await Ut.get(`/Role/${e}`);return t}const PSe=({onRoleDeleteClick:e,setIsConfirmingRoleDeletion:t,isRoleDeletionPending:n})=>u.jsxs(u.Fragment,{children:[u.jsx(Nn,{children:"Confirm Role Deletion"}),u.jsx(jr,{children:"Are you sure you want to delete this role? This action cannot be undone."}),u.jsxs(Un,{children:[u.jsx(be,{type:"button",variant:"defaultOutline",className:"rounded-full",onClick:()=>t(!1),children:"Cancel"}),u.jsx(be,{variant:"destructiveOutline",className:"rounded-full",onClick:e,disabled:n,children:n?"Deleting...":"Delete Role"})]})]});function zSe({data:e,isModalOpen:t,closeModal:n,roleDeleted:r}){const{data:i}=Mi($Se({roleId:e.id,organizationId:e.organizationId})),o=cl(),a=o.user&&o.user?.roles?.[e.organizationId]?.role===e.roleName,{update:c,remove:d}=Zd(e.organizationId),{mutate:f,isPending:p}=DSe(),{mutate:h,isPending:v}=TSe(),[y,b]=x.useState(!1),S=x.useCallback(()=>{h({roleId:e.id},{onSuccess:()=>{_e.success("Role deleted successfully!"),r(),n()},onError:T=>{_e.error("Error",{description:`Failed to delete role: ${T instanceof Error?T.message:String(T)}.`,action:{label:"Dismiss",onClick:()=>_e.dismiss()}})}})},[e.id,h,r,n]),[C,E]=x.useState(!0),[k,j]=x.useState(JSON.stringify({roles:{...i.organization.roles},clusters:{...i.organization.clusters}},null,2)),I=Qt({resolver:ln(ASe),defaultValues:{roleName:i.role,updateOrganization:i?.organization.update||!1,deleteOrganization:i?.organization.delete||!1}}),A=x.useCallback(T=>{E(T.length===0)},[E]),N=x.useCallback(async T=>{if(!c)return;const z={...i};z.organizationId=e.organizationId,z.name=T.roleName,z.role=T.roleName,z.organization.roles=JSON.parse(k).roles,z.organization.clusters=JSON.parse(k).clusters,z.organization.update=T.updateOrganization,z.organization.delete=T.deleteOrganization,k&&C&&f({roleId:e.id,updatedRoleInfo:z},{onSuccess:()=>{_e.success("Role updated successfully!"),n()},onError:L=>{_e.error("Error",{description:`Failed to update role: ${L instanceof Error?L.message:String(L)}.`,action:{label:"Dismiss",onClick:()=>_e.dismiss()}})}})},[c,i,e.organizationId,e.id,k,C,f,n]);return u.jsx(zn,{onOpenChange:n,open:t,children:u.jsx(Ln,{children:y?u.jsx(PSe,{onRoleDeleteClick:S,setIsConfirmingRoleDeletion:b,isRoleDeletionPending:v}):u.jsxs(u.Fragment,{children:[u.jsxs(Nn,{children:[a||!c?"View":"Edit",' Organization Role "',i.role,'"']}),u.jsx(Jt,{...I,children:u.jsxs("form",{className:"grid grid-cols-2 gap-4 my-4",onSubmit:I.handleSubmit(N),children:[u.jsx(Me,{control:I.control,name:"roleName",render:({field:T})=>u.jsxs(Ae,{className:"col-span-2",children:[u.jsx(Oe,{className:"pb-1",children:"Role Name"}),u.jsx($e,{children:u.jsx(ze,{type:"text",placeholder:"Developer",className:"",...T,disabled:a||!c,readOnly:a||!c})}),u.jsx(De,{})]})}),u.jsx(Me,{control:I.control,name:"updateOrganization",render:({field:T})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Can Update Organization"}),u.jsx($e,{children:u.jsx(ze,{type:"checkbox",className:"w-6 ml-2",disabled:a||!c,readOnly:a||!c,checked:T.value,onChange:z=>T.onChange(z.target.checked)})}),u.jsx(De,{})]})}),u.jsx(Me,{control:I.control,name:"deleteOrganization",render:({field:T})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Can Delete Organization"}),u.jsx($e,{children:u.jsx(ze,{type:"checkbox",className:"w-6 ml-2",disabled:a||!c,readOnly:a||!c,checked:T.value,onChange:z=>T.onChange(z.target.checked)})}),u.jsx(De,{})]})}),u.jsx("div",{className:"col-span-2",children:u.jsx(oh,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate:A,onChange:T=>{T&&j(T)},options:a||!c?{readOnly:!0}:void 0,defaultValue:k})}),!a&&(d||c)&&u.jsx(Un,{className:"col-span-2",children:u.jsxs("div",{className:"flex justify-between w-full",children:[d&&u.jsx(be,{type:"button",variant:"destructiveOutline",className:"rounded-full",onClick:()=>b(!0),disabled:p,children:"Delete Role"}),c&&u.jsx(be,{variant:"submit",className:"rounded-full",disabled:!C||p,children:"Save Changes"})]})})]})})]})})})}function _H(){const e=pn(),{organizationId:t,orgRoleId:n}=tt({strict:!1}),{create:r}=Zd(t),{data:i,refetch:o,isFetching:a,isRefetching:c}=Mi(hx(t)),d=x.useMemo(()=>i&&i?.find(j=>j.id===n),[i,n]),f=!!n&&!!d,[p,h]=x.useState(!1),v=x.useCallback(j=>{const I=[n?"..":"",j].filter(Boolean);e({to:I.join("/")})},[n,e]),y=x.useCallback(()=>{o(),h(!1)},[o,h]),b=x.useCallback(()=>{h(!0)},[h]),S=x.useCallback(()=>{o(),h(!1)},[o,h]),C=x.useCallback(j=>{v(j.original.id)},[v]),E=x.useCallback(()=>{v(void 0)},[v]),k=vl(o);return u.jsxs(u.Fragment,{children:[u.jsx(rs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs(x.Suspense,{fallback:u.jsx(Ui,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(sf,{data:i,columns:wwe,onRowClick:C,children:[u.jsxs(be,{variant:"defaultOutline",onClick:k,accessKey:"r",disabled:a||c,children:[u.jsx(sa,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),r&&u.jsxs(be,{variant:"positiveOutline",onClick:b,accessKey:"a",disabled:p,children:[u.jsx(po,{}),u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),r&&u.jsx(ISe,{isModalOpen:p,onChangesSaved:S,setIsModalOpen:h}),f&&u.jsx(zSe,{roleDeleted:y,data:d,isModalOpen:f,closeModal:E})]})})]})}const LSe=cx(),USe=[{header:"User Id",accessorKey:"id",enableSorting:!1},{header:"Email",accessorKey:"email",enableSorting:!1},{header:"First Name",accessorKey:"firstname",enableSorting:!1},{header:"Last Name",accessorKey:"lastname",enableSorting:!1},LSe.display({header:"Roles",enableSorting:!1,id:"roles",cell:e=>e.row.original.roles?.map(t=>t.roleName)?.sort()?.join(", ")}),{header:"Status",accessorKey:"status",enableSorting:!1},{header:"Verified",accessorKey:"isVerified",enableSorting:!1}],FSe=_r.object({email:tf.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:_r.string().nonempty({error:"Please select a role."})});async function VSe(e){const{data:t}=await Ut.post("/OrganizationRole/",e);return t}function CH(){return at({mutationFn:e=>VSe(e)})}_r.object({email:tf.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:_r.string().nonempty({error:"Please select a role."})});async function BSe(e){const{data:t}=await Ut.post("/UserInvite/",e);return t}function HSe(){return at({mutationFn:e=>BSe(e)})}function qSe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const{organizationId:r}=tt({strict:!1}),{data:i}=Mi(hx(r)),[o,a]=x.useState(!1),c=Qt({resolver:ln(FSe),defaultValues:{email:"",roleId:""}}),{mutate:d,isPending:f}=CH(),{mutate:p,isPending:h}=HSe(),v=x.useCallback(async y=>{y&&(o?p:d)(y,{onSuccess:()=>{const b=y.roleId;c.reset(),c.setValue("roleId",b),t(),_e.success("User invited successfully!"),n(!1),a(!1)},onError:b=>{b?.status===404&&a(!0)}})},[d,c,p,t,n,o]);return u.jsx(zn,{onOpenChange:()=>{n(!1),a(!1),c.reset()},open:e,children:u.jsx(Ln,{"aria-describedby":void 0,children:u.jsx(Jt,{...c,children:u.jsxs("form",{onSubmit:c.handleSubmit(v),className:"grid gap-4 my-4",children:[u.jsx(yr,{children:u.jsx(Nn,{children:o?"Invite User":"Add User"})}),u.jsx(Me,{control:c.control,name:"email",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Email"}),u.jsx($e,{children:u.jsx(ze,{type:"email",enterKeyHint:"next",autoComplete:"email",...y})}),u.jsx(De,{})]})}),u.jsx(Me,{control:c.control,name:"roleId",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Roles"}),u.jsx(x.Suspense,{fallback:u.jsx(Er,{}),children:u.jsx($e,{children:u.jsxs(co,{...y,onValueChange:b=>y.onChange(b),children:[u.jsx(fo,{className:"w-full",children:u.jsx(uo,{placeholder:"Choose Role"})}),u.jsx(mo,{children:u.jsxs(Lo,{children:[u.jsx(Gj,{children:"Role"}),i?.map(b=>u.jsx(Sn,{value:b.id,children:b.roleName},b.id))]})})]})})}),u.jsx(De,{})]})}),o&&u.jsxs(jr,{className:"p-3 my-5 text-white rounded-md bg-amber-600 flex",children:[u.jsx(uQ,{className:"inline-block size-12 pr-2"}),u.jsx("span",{children:"This person doesn’t have a Fabric account. Do you want to invite them?"})]}),u.jsx(Un,{children:u.jsx("div",{className:"flex justify-between w-full",children:u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",disabled:f||h,children:[u.jsx(ho,{})," ",o?"Invite User":"Add User"]})})})]})})})})}async function GSe({roleId:e,userId:t}){const{data:n}=await Ut.delete(`/OrganizationRole/role/${e}/user/${t}`);return n}function KSe(){return at({mutationFn:({roleId:e,userId:t})=>GSe({roleId:e,userId:t})})}function EH(e){const[t,n]=x.useState(e||!1),r=x.useCallback(i=>{n(i.target.checked)},[]);return[t,r]}function ZSe({data:e,readOnly:t,canRemove:n,orgRole:r,selectedRoles:i,setChangesMade:o}){const{mutate:a,isPending:c}=CH(),{mutate:d,isPending:f}=KSe(),p=!!i[r.roleName],[h,v]=x.useState(p),[y,b]=EH(p);return x.useEffect(()=>{y!==h&&(y?a({email:e.email,roleId:r.id},{onSuccess:()=>{v(y),o(!0),_e.success("Role added successfully")}}):d({userId:e.id,roleId:r.id},{onSuccess:()=>{v(y),o(!0),_e.success("Role removed successfully")}}))},[a,e.email,e.id,y,r.id,d,o,h]),u.jsxs(Pp,{className:"flex",children:[u.jsx(ze,{type:"checkbox",className:"w-6",disabled:t||c||f||!n&&y,checked:y,onChange:b}),u.jsx("span",{className:"pl-4 pr-8 flex-1 py-2.5",children:r.roleName})]},r.id)}function YSe({closeModal:e,data:t,isModalOpen:n,onUserUpdated:r}){const{organizationId:i}=tt({strict:!1}),o=cl(),{update:a,remove:c}=Zd(i),d=o.user?.email===t.email,{data:f}=Mi(hx(i)),p=x.useMemo(()=>t.roles?of(t.roles,"roleName"):{},[t]),[h,v]=x.useState(!1);return u.jsx(zn,{onOpenChange:h?r:e,open:n,children:u.jsxs(Ln,{className:"sm:max-w-[750px]",children:[u.jsx(yr,{children:u.jsxs(Nn,{children:[a?"Edit ":"View "," ",t.email," ",d?"(yourself)":""]})}),a&&u.jsxs(jr,{children:["To remove ",d?"your self":"this user"," from the organization, uncheck all of the boxes below."]}),f.map(y=>u.jsx(ZSe,{readOnly:!a,canRemove:c,data:t,orgRole:y,selectedRoles:p,setChangesMade:v},y.id))]})})}function WSe(e,t){return e.email>t.email?1:-1}function kH(){const e=pn(),{organizationId:t,orgUserId:n}=tt({strict:!1}),{update:r}=Zd(t),{data:i,refetch:o,isFetching:a,isRefetching:c}=Mi(hx(t)),d=x.useMemo(()=>{const N={};for(const T of i)if(T.users)for(const z of T.users)N[z.id]||(N[z.id]={...z,roles:[]}),N[z.id].roles.push(T);return Object.values(N).sort(WSe)},[i]),f=x.useMemo(()=>d?.find(N=>N.id===n),[d,n]),p=x.useCallback(N=>{const T=[n?"..":"",N].filter(Boolean);e({to:T.join("/")})},[n,e]),h=!!n&&!!f,[v,y]=x.useState(!1),[b]=x.useState({attribute:"email",descending:!1}),S=x.useMemo(()=>[{desc:b.descending,id:b.attribute}],[b]),C=x.useCallback(()=>{y(!0)},[y]),E=x.useCallback(()=>{o(),y(!1)},[o,y]),k=x.useCallback(N=>{p(N.original.id)},[p]),j=x.useCallback(()=>{p(void 0)},[p]),I=x.useCallback(()=>{o(),p(void 0)},[p,o]),A=vl(o);return u.jsxs(u.Fragment,{children:[u.jsx(rs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs(x.Suspense,{fallback:u.jsx(Ui,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(sf,{data:d,isFetching:a||c,columns:USe,onRowClick:k,sortingState:S,children:[u.jsxs(be,{variant:"defaultOutline",onClick:A,accessKey:"r",disabled:a||c,children:[u.jsx(sa,{})," ",u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),r&&u.jsxs(be,{variant:"positiveOutline",onClick:C,accessKey:"a",disabled:v,children:[u.jsx(po,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),r&&u.jsx(qSe,{isModalOpen:v,onChangesSaved:E,setIsModalOpen:y}),h&&u.jsx(YSe,{closeModal:j,data:f,isModalOpen:h,onUserUpdated:I})]})})]})}function XSe({organizationRole:e,onDeleteOrgModal:t}){const{organizationId:n,organizationName:r,roleName:i}=e,{remove:o,update:a}=gb(n),c=a,{view:d}=Zd(n),f=x.useCallback(()=>{t(e)},[t,e]);return u.jsxs(fc,{className:"relative h-full justify-between",children:[u.jsxs(ul,{children:[u.jsxs(Cc,{className:"flex items-center justify-between",children:[u.jsx("span",{className:"truncate",children:n}),o&&u.jsxs(eh,{children:[u.jsx(th,{className:"p-4 -m-4 -mr-6 hover:text-white",children:u.jsx(PC,{"aria-label":"Options"})}),u.jsxs(nh,{children:[u.jsx(gy,{className:"text-gray-600 text-xs",children:"Options"}),u.jsx(vy,{}),u.jsx(Ge,{to:`${n}`,children:u.jsx(pr,{children:"Clusters"})}),d&&u.jsx(Ge,{to:`${n}/roles`,children:u.jsx(pr,{children:"Roles"})}),d&&u.jsx(Ge,{to:`${n}/users`,children:u.jsx(pr,{children:"Users"})}),c&&u.jsx(Ge,{to:`${n}/billing`,children:u.jsx(pr,{children:"Billing"})}),u.jsx(vy,{}),o&&u.jsx(pr,{className:"focus:bg-red/70 focus:text-white",onClick:f,children:"Delete"})]})]})]}),u.jsx(dl,{children:u.jsx("h2",{children:r})})]}),u.jsxs(es,{className:"flex justify-between",children:[u.jsx(zo,{children:Eo(i)}),u.jsx(Ge,{to:n,className:"text-sm","aria-label":`View ${r}`,title:`View ${r}`,children:u.jsxs("span",{className:"py-2 transition-all duration-100 ease-in-out border-0 hover:border-b-2",children:["View ",u.jsx(ro,{className:"inline-block"})]})})]})]})}async function QSe(e){const{data:t}=await Ut.delete(`/Organization/${e}`);return t}function JSe(){return at({mutationFn:e=>QSe(e)})}async function e_e(e){const{data:t}=await Ut.post("/Organization/",{...e});return t}function t_e(){return at({mutationFn:e=>e_e(e)})}const nv=mn({name:nt().max(255,{error:"Name cannot be longer than 255 characters."}),subdomain:nt().max(62,{error:"The subdomain cannot be longer than 62 characters."}).regex(/^[a-zA-Z0-9-]*$/,{error:"Please only use letters, digits and dashes (-) in the subdomain."})});function n_e(){const{user:e}=cl(),t=pn(),n=Qt({resolver:ln(nv),defaultValues:{name:"",subdomain:""}}),{setFocus:r,watch:i}=n;x.useEffect(()=>{r("name")},[r]);const o=`${e?.firstname} ${e?.lastname} Org`,a=i("name")||o,c=i("subdomain"),d=x.useMemo(()=>{const y=mB(ox(a),nv.shape.subdomain.maxLength);return{suggestedSubdomain:y,fullHostName:`future-cluster-names.${c||y}.harperfabric.com`}},[a,c]),{mutate:f,isPending:p}=t_e(),h=gr(),v=x.useCallback(async y=>{f({name:y.name||o,subdomain:y.subdomain||d.suggestedSubdomain},{onSuccess:b=>{h.invalidateQueries({queryKey:Vy,refetchType:"active"}),Tt.reloadUser(_n),t({to:`/${b.id}`})}})},[d.suggestedSubdomain,h,f,o,t]);return u.jsx(u.Fragment,{children:u.jsx(Jt,{...n,children:u.jsxs("form",{onSubmit:n.handleSubmit(v),className:"grid gap-6 text-white max-w-xl",children:[u.jsx(Me,{control:n.control,name:"name",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Name"}),u.jsx($e,{children:u.jsx(ze,{type:"text",maxLength:nv.shape.name.maxLength,autoCapitalize:"words",placeholder:o,...y})}),u.jsx(De,{})]})}),u.jsx(Me,{control:n.control,name:"subdomain",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Subdomain"}),u.jsx($e,{children:u.jsx(ze,{type:"text",maxLength:nv.shape.subdomain.maxLength,autoCapitalize:"none",placeholder:d.suggestedSubdomain,...y})}),u.jsx(De,{})]})}),u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Full Host Name"}),u.jsx($e,{children:u.jsx("span",{children:d.fullHostName})}),u.jsx(De,{})]}),u.jsx(Un,{children:u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",disabled:p,children:["Create New Organization ",u.jsx(ro,{})]})})]})})})}function jH(){return u.jsxs(u.Fragment,{children:[u.jsx(rs,{}),u.jsx("section",{className:"mt-40 md:mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx(n_e,{})})]})}function r_e(){const e=gr(),{data:t}=Mi(sZ()),{mutate:n,isPending:r}=JSe(),[i,o]=x.useState(!1),[a,c]=x.useState(null),[d,f]=x.useState(""),p=x.useCallback(()=>f(""),[]),h=x.useMemo(()=>{const C=t?.roles||{},E=Object.values(C);return Object.keys(C).map((j,I)=>({organizationId:j,organizationName:E[I].organizationName,roleName:E[I].role})).filter(nH(["organizationId","organizationName"],d)).sort((j,I)=>(j.organizationName||"")>(I.organizationName||"")?1:-1)||[]},[d,t?.roles]),v=x.useCallback(C=>{f(C.currentTarget.value?.toLowerCase()||"")},[]),y=x.useCallback(C=>{C?.organizationId&&n(C.organizationId,{onSuccess:()=>{_e.success("Success",{description:"Organization successfully deleted.",duration:5e3,action:{label:"Dismiss",onClick:()=>_e.dismiss()}}),e.invalidateQueries({queryKey:[]}),o(!1)},onError:()=>o(!1)})},[n,e,o]),b=x.useCallback(C=>{c(C),o(!0)},[]),{createCluster:S}=vr({strict:!1});return h.length===1&&!d.length&&S?u.jsx(ic,{to:`/${h[0].organizationId}/new-cluster`,replace:!0}):!h.length&&!d.length?u.jsx(jH,{}):u.jsxs(u.Fragment,{children:[u.jsx(rs,{children:u.jsxs("div",{className:"flex w-full justify-end gap-2",children:[u.jsx(ze,{placeholder:"Filter by name",className:"inline-block w-48 md:w-64 bg-black border",value:d,onChange:v}),u.jsx(Ge,{to:"/new-org",children:u.jsxs(be,{variant:"positive",className:"rounded-full w-44",accessKey:"n",children:[u.jsx(po,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"N"}),"ew Organization"]})]})})]})}),u.jsx("section",{className:"mt-40 md:mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-12",children:[h.map(C=>u.jsx("div",{className:"col-span-1 md:col-span-4 lg:col-span-3 2xl:col-span-2",children:u.jsx(XSe,{organizationRole:C,onDeleteOrgModal:b})},C.organizationId)),!h.length&&u.jsxs("div",{className:"col-span-1 md:col-span-12 text-center",children:[u.jsx("h2",{className:"my-4 text-xl",children:"No matches found."}),u.jsx(be,{variant:"outline",onClick:p,children:"Clear Filters"})]})]})}),a&&u.jsx(tx,{typeOfThingBeingDeleted:"organization",nameOfThingBeingDeleted:a.organizationName,isModalOpen:i,setIsModalOpen:()=>o(!1),deletionConfirmed:()=>y(a),deletionPending:r})]})}function i_e(){const{isLoading:e}=_c(),{createCluster:t}=vr({strict:!1}),[,n]=rf(zc.SavedClusterState,null);return x.useEffect(()=>{t&&n(t)},[t,n]),e?u.jsx(Ui,{className:"fixed z-50 translate-1/2"}):u.jsxs(u.Fragment,{children:[u.jsx("header",{className:"fixed top-0 z-40 w-full h-20 p-4 bg-black-dark dark:bg-black-dark dark:border-b dark:border-black md:px-12",children:u.jsx(vL,{})}),u.jsx("main",{children:u.jsx(ll,{})})]})}const o_e=["/","/forgot-password","/reset-password","/sign-in","/sign-up","/verify-email"];function RH(){const e=rH();return!o_e.includes(e)&&{redirect:e}}const yx=Qe({getParentRoute:()=>mb,id:"_dashboardLayout",component:i_e,beforeLoad:({context:e})=>{const t=e.authentication[_n];if(t&&!t.isLoading&&!t.user)throw Sc({to:"/sign-in",search:RH()})}}),Qj=Qe({getParentRoute:()=>yx,id:"_orgsLayout"});Qe({getParentRoute:()=>Qj,path:"/",component:r_e});Qe({getParentRoute:()=>Qj,path:"/new-org",component:jH});const Uc=Qe({getParentRoute:()=>Qj,path:"$organizationId",beforeLoad:async e=>({organization:await e.context.queryClient.ensureQueryData(Lc(e.params.organizationId))})}),a_e=Qe({getParentRoute:()=>Uc,path:"/roles",component:_H}),s_e=Qe({getParentRoute:()=>Uc,path:"/roles/$orgRoleId",component:_H}),l_e=Qe({getParentRoute:()=>Uc,path:"/users",component:kH}),c_e=Qe({getParentRoute:()=>Uc,path:"/users/$orgUserId",component:kH});ywe(Uc);const IH=Qe({getParentRoute:()=>Uc,id:"_clusterLayout"});Qe({getParentRoute:()=>IH,path:"/",component:h0e});Qe({getParentRoute:()=>Uc,path:"/new-cluster",component:Kj});Qe({getParentRoute:()=>Qa,path:"/edit",component:Kj});function u_e(){return u.jsx(ll,{})}const Qa=Qe({getParentRoute:()=>IH,path:"$clusterId",component:u_e,beforeLoad:async({context:e,params:t})=>({cluster:await e.queryClient.ensureQueryData(Oc(t.clusterId))})}),Xu=mn({username:Cj,role:nt().nonempty({error:"Please select a role."}),password:Yp.min(8,{error:"Password must be at least 8 characters long."}),confirmPassword:nt()}).refine(e=>e.password===e.confirmPassword,{error:"Passwords do not match.",path:["confirmPassword"]});async function d_e(e){await Ut.patch(`/ResetPasswordUpdater/${e}`)}async function NH(e){const{instanceClient:t,...n}=e,{data:r}=await t.post("/",{operation:"add_user",...n});return r}function f_e(){return at({mutationFn:NH})}async function TH({username:e,password:t,role:n,active:r,instanceClient:i}){const{data:o}=await i.post("/",{operation:"alter_user",username:e,password:t,role:n,active:r});return o}function m_e(){return at({mutationFn:TH})}async function AH({username:e,instanceClient:t}){const{data:n}=await t.post("/",{operation:"drop_user",username:e});return n}function p_e(){return at({mutationFn:AH})}async function h_e({clusterId:e,initialUsername:t,desiredUsername:n,newPassword:r,tempPassword:i,instanceClient:o}){if(!i)throw new Error("You may not have permission to set the password on this cluster.");let a=o;try{const c=await _1({username:t,password:i,instanceClient:a,entityId:e});return c.instanceClient&&(a=c.instanceClient),n===I_?await TH({username:n,password:r,instanceClient:a}):(await NH({username:n,password:r,role:"super_user",active:!0,instanceClient:a}),await AH({username:I_,instanceClient:a}),await _1({username:n,password:r,instanceClient:a,entityId:e})),await d_e(e),c}catch(c){throw await bp({entityId:e,instanceClient:a}),c}}function g_e(){return at({mutationFn:h_e})}function v_e(){const{user:e}=cl(),{clusterId:t}=tt({strict:!1}),{data:n}=Mt(Oc(t,!0)),r=pn(),i=x.useMemo(()=>kC(n),[n]),o=pb(i),{redirect:a}=vr({strict:!1}),c=an(),d=Qt({resolver:ln(Xu),defaultValues:{confirmPassword:"",password:"",role:"super_user",username:e?.email??""}}),{setFocus:f,control:p,handleSubmit:h}=d;x.useEffect(()=>{f("password")},[f]);const v=n?.instances?.find(C=>C.tempPassword)?.tempPassword,{mutate:y,isPending:b}=g_e(),S=x.useCallback(async C=>{if(!i){_e.error("Cluster is not yet fully loaded, please wait a moment before trying to sign in.");return}y({instanceClient:o,clusterId:t,newPassword:C.password,tempPassword:v,initialUsername:I_,desiredUsername:C.username},{onSuccess:async({message:E,user:k})=>{_e.success(E),Tt.setUserForEntity(n,k),c.invalidate(),await r({to:a?.startsWith("/")?a:gC})}})},[n,t,o,r,i,a,c,y,v]);return n&&!n.resetPassword?u.jsx(ic,{to:"../sign-in",replace:!0}):u.jsxs(u.Fragment,{children:[u.jsx("nav",{className:"fixed top-20 w-full h-12 z-39 px-4 md:px-12 bg-grey-700 flex items-center",children:u.jsx(jb,{})}),u.jsx("div",{className:"items-center justify-center flex mt-32 py-4 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs("div",{className:"text-white w-xs",children:[u.jsx("h2",{className:"text-2xl font-light",children:"Create Admin User"}),u.jsx("p",{className:"text-muted-foreground",children:"You are ready to create your first user in your new cluster. These credentials belong to you alone, and you can create more users and roles once you create this first one."}),u.jsx(Jt,{...d,children:u.jsxs("form",{onSubmit:h(S),className:"my-4",children:[u.jsx(Me,{control:p,name:"username",render:({field:C})=>u.jsxs(Ae,{className:"my-4",children:[u.jsx(Oe,{children:"Username"}),u.jsx($e,{children:u.jsx(ze,{autoComplete:"username",type:"text",...C})}),u.jsx(De,{})]})}),u.jsx(Me,{control:p,name:"password",render:({field:C})=>u.jsxs(Ae,{className:"my-4",children:[u.jsx(Oe,{children:"Password"}),u.jsx($e,{children:u.jsx(ze,{type:"password",...C})}),u.jsx(De,{})]})}),u.jsx(Me,{control:p,name:"confirmPassword",render:({field:C})=>u.jsxs(Ae,{className:"my-4",children:[u.jsx(Oe,{children:"Confirm Password"}),u.jsx($e,{children:u.jsx(ze,{type:"password",...C})}),u.jsx(De,{})]})}),u.jsx(be,{disabled:b,type:"submit",variant:"submit",className:"w-full my-2 rounded-full",children:"Create Admin User"})]})}),u.jsxs("p",{className:"text-muted-foreground flex gap-2 align-middle",children:[u.jsx(YW,{size:36,className:"flex-none"}),u.jsx("span",{children:"These credentials will be used to sign into your cluster directly, providing you a secure connection from your browser to your cluster."})]})]})})]})}function y_e({columns:e,data:t}){const n=fx({data:t,columns:e,getCoreRowModel:dx()});return u.jsx("div",{className:"bg-black-dark rounded-md",children:u.jsxs(mx,{children:[u.jsx(rh,{children:n.getHeaderGroups().map(r=>u.jsx(Ai,{className:"border-none",children:r.headers.map(i=>u.jsx(Xj,{className:"p-4",style:{width:`${i.getSize()}%`},children:i.isPlaceholder?null:wc(i.column.columnDef.header,i.getContext())},i.id))},r.id))}),u.jsx(px,{className:"bg-black",children:n.getRowModel().rows?.length?n.getRowModel().rows.map(r=>u.jsx(Ai,{"data-state":r.getIsSelected()&&"selected",className:"hover:bg-muted/10 data-[state=selected]:bg-muted",children:r.getVisibleCells().map(i=>u.jsx(Xa,{className:"p-4",style:{width:`${i.column.getSize()}%`},children:wc(i.column.columnDef.cell,i.getContext())},i.id))},r.id)):u.jsx(Ai,{children:u.jsx(Xa,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})})}function b_e(){return u.jsx("div",{className:"flex-col items-center justify-center px-16 space-y-3 text-center pt-30",children:u.jsx("p",{children:"No instances found."})})}function x_e({isSelfManaged:e,instance:t}){const{user:n,isLoading:r}=Ja(t.id),i=x.useMemo(()=>jC(t),[t]),o=pb(i),{update:a}=Yle(),c=Tt.checkForFabricConnect(t.id),d=x.useCallback(async()=>{await bp({instanceClient:o,entityId:t.id}),Tt.setUserForEntity(t,null)},[t,o]);return r||!["CLONE_READY","RUNNING","UPDATED"].includes(t.status)?u.jsx(MP,{className:"animate-spin",color:"gray"}):!n||c?u.jsxs("span",{className:"flex gap-4",children:[a&&!e&&u.jsx(Ge,{to:`../instance/${t.id}${oa}`,className:"text-sm","aria-label":`Connect to ${t.name} instance`,title:`Connect to ${t.name} instance`,children:u.jsx(be,{variant:"positiveOutline",children:"Fabric Connect"})}),u.jsx(Ge,{to:`../instance/${t.id}/sign-in`,className:"text-sm","aria-label":`Sign in to ${t.name} instance`,title:`Sign in to ${t.name} instance`,children:u.jsx(be,{variant:a?"defaultOutline":"positiveOutline",children:"Direct Sign In"})})]}):u.jsxs("span",{className:"flex gap-4",children:[u.jsx(Ge,{to:`../instance/${t.id}${oa}`,className:"text-sm","aria-label":`Go to ${t.name} instance`,title:`Go to ${t.name} instance`,children:u.jsx(be,{variant:"positiveOutline",children:"Direct Connect"})}),u.jsx(be,{variant:"destructiveOutline",className:"text-sm","aria-label":`Sign out from ${t.name} instance`,title:`Sign out from ${t.name} instance`,onClick:d,children:"Direct Sign Out"})]})}function w_e(){const{clusterId:e}=tt({strict:!1}),{data:t,isLoading:n}=Mt(Oc(e,!0)),r=Fj(t),i=x.useMemo(()=>[{id:"instanceActions",size:1,minSize:1,cell:a=>u.jsx("div",{className:"flex justify-end",children:u.jsx(x_e,{isSelfManaged:r,instance:a.row.original})})},r&&{accessorKey:"instanceFqdn",size:90,header:"URL",cell:a=>eH({secure:a.row.original.operationsApiSecure?"true":"false",port:a.row.original.operationsApiPort,fqdn:a.row.original.instanceFqdn})},!r&&{accessorKey:"name",size:90,header:"Name"},!r&&{accessorKey:"status",header:"Status",size:1,minSize:1,cell:a=>{const c=a.getValue();return u.jsx(zo,{variant:Y5(c),children:Eo(c)})}},!r&&{accessorKey:"version",size:1,minSize:1,header:"Version"},!r&&{accessorKey:"storageGb",size:1,minSize:1,header:"Storage",cell:a=>{const c=a.getValue();return Ma(c,Math.pow(1024,3))}},!r&&{accessorKey:"cpuCores",size:1,minSize:1,header:"Cores/Threads",cell:a=>u.jsxs(u.Fragment,{children:[a.row.original.cpuCores," / ",a.row.original.threads]})},!r&&{accessorKey:"memoryMb",size:1,minSize:1,header:"Memory",cell:a=>{const c=a.getValue();return Ma(c,Math.pow(1024,2))}}].filter(fa),[r]),o=x.useMemo(()=>t?.instances?t.instances.filter(a=>a.status&&!zE.includes(a.status)).sort(dB):[],[t]);return u.jsxs(u.Fragment,{children:[u.jsx(rs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx(fc,{className:"p-0 mt-4 min-h-96",children:u.jsx(es,{className:"p-0 min-h-96",children:n?u.jsx(Er,{}):o.length?u.jsx(y_e,{data:o,columns:i}):u.jsx(b_e,{})})})})]})}function Jl({children:e,className:t}){return u.jsxs(u.Fragment,{children:[u.jsx(rs,{}),u.jsx("div",{className:aa("mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))] flex justify-center",t),children:e})]})}function S_e(){const{clusterId:e}=tt({strict:!1}),{data:t,isLoading:n}=Mt(Oc(e,2e3)),r=t?.status,i=x.useMemo(()=>r&&Ab.includes(r),[r]);return n||!t?u.jsx(Jl,{className:"flex justify-center",children:u.jsx(Er,{})}):i?u.jsx(Jl,{className:"flex justify-center",children:u.jsxs("div",{className:"center w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"All done!"}),u.jsx(cp,{cluster:t,forceProgressBarVisible:!0}),u.jsx("p",{children:"Your cluster finished updating, and is ready for interaction."}),u.jsx("div",{className:"text-center",children:u.jsx(Vj,{cluster:t})})]})}):u.jsx(Jl,{className:"flex justify-center",children:u.jsxs("div",{className:"center w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"Here we go!"}),u.jsx(cp,{cluster:t,forceProgressBarVisible:!0}),u.jsxs("p",{children:["Your cluster is updating with the latest changes. This includes waiting several minutes to let traffic drain safely.",u.jsxs("span",{className:"text-muted-foreground",children:["We will let you know when we are ready for you to connect! In the meantime, join us on ",u.jsx("a",{href:"https://discord.gg/VzZuaw3Xay",target:"_blank",children:"Discord"}),"! Get real-time help from our engineers, see feature drops early, and connect with others building on Fabric."]})]})]})})}function __e(){const e=an(),{clusterId:t}=tt({strict:!1}),{data:n,isLoading:r}=Mt(Oc(t,2e3)),i=n?.status,o=x.useMemo(()=>i&&Ab.includes(i),[i]),a=Wp(i),[,c]=rf(zc.SavedClusterState,null),d=x.useCallback(()=>{c(n),e.navigate({to:`/${n.organizationId}/new-cluster`})},[n,e,c]);return r||!n?u.jsx(Jl,{className:"flex justify-center",children:u.jsx(Er,{})}):a?u.jsx(Jl,{className:"flex justify-center",children:u.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4 items-center",children:[u.jsx(bX,{className:"w-24 h-24"}),u.jsxs("span",{children:["Your cluster failed to successfully start. This is usually caused by temporary communication problems. Would you like to try again? We also get notified about these failures. ",u.jsx(al,{})," if you want more help."]}),u.jsx(be,{type:"button",variant:"positiveOutline",onClick:d,children:"Try Again"})]})}):o?u.jsx(Jl,{className:"flex justify-center",children:u.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"It's ready!"}),u.jsx(cp,{cluster:n,forceProgressBarVisible:!0}),u.jsxs("p",{children:["Let's set up your secure, browser-to-cluster connection now. ",u.jsxs("span",{className:"text-muted-foreground",children:["Did you know during this step, you connect straight to your cluster, providing a private secure connection? That's ",u.jsx("em",{children:"Direct Connect"}),"! Once you create your user, you will have the option to ",u.jsx("em",{children:"Fabric Connect"})," from your Fabric account without having to sign in again."]})]}),u.jsx("div",{className:"text-center",children:u.jsx(Vj,{cluster:n})})]})}):u.jsx(Jl,{className:"flex justify-center",children:u.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"Here we go!"}),u.jsx(cp,{cluster:n,forceProgressBarVisible:!0}),u.jsxs("p",{children:["Your cluster is spinning up with the latest changes, including your own DNS records and private connections. Please wait while we get everything going.",u.jsxs("span",{className:"text-muted-foreground",children:["We will let you know when we are ready for you to connect! In the meantime, join us on ",u.jsx("a",{href:"https://discord.gg/VzZuaw3Xay",target:"_blank",children:"Discord"}),"! Get real-time help from our engineers, see feature drops early, and connect with others building on Fabric."]})]})]})})}Qe({getParentRoute:()=>Qa,path:"instances",component:w_e});Qe({getParentRoute:()=>Qa,path:"starting-up",component:__e});Qe({getParentRoute:()=>Qa,path:"scaling",component:S_e});Qe({getParentRoute:()=>Qa,path:"sign-in",component:Ej,beforeLoad:({context:e,location:t,params:n})=>{const r=Tt.checkForFabricConnect(n.clusterId);if(e.authentication[n.clusterId]?.user&&!r){const i=t?.search;throw Sc({to:i?.redirect?.startsWith("/")?i.redirect:gC})}}});Qe({getParentRoute:()=>Qa,path:"instance/$instanceId/sign-in",component:Ej,beforeLoad:({context:e,location:t,params:n})=>{if(!(Tt.checkForFabricConnect(n.clusterId)||Tt.checkForFabricConnect(n.instanceId))&&e.authentication[n.instanceId]?.user){const i=t?.search;throw Sc({to:i?.redirect?.startsWith("/")?i.redirect:gC})}}});Qe({getParentRoute:()=>Qa,path:"finish-setup",component:v_e});function C_e(e){return Qe({getParentRoute:()=>e,path:"apis"}).lazy(()=>Np(()=>import("./index.lazy-CFrFVE2k.js"),__vite__mapDeps([0,1,2])).then(t=>t.route))}async function E_e(e,t=3,n=1e3){let r=0;if(t<=0)throw new Error("retries must be greater than 0");let i;for(;r<t;)try{return await e()}catch(o){if(r++,i=o,r===t)break;await Md(n)}throw i}async function OH({operation:e,replicated:t,instanceClient:n}){const{data:r}=await n.post("/",{operation:e,service:e==="restart_service"?"http":void 0,replicated:t});return await Md(1e4),await E_e(()=>qs({instanceClient:n,timeout:3e3}),12,15e3),r}function k_e(){return at({mutationFn:OH})}function j_e({onRestartedSuccessfully:e}={}){const{clusterId:t}=tt({strict:!1}),n=gr(),[r,i]=x.useState(!1);return{onRestartClick:x.useCallback(async()=>{if(!t)throw new Error("clusterId must be set in the route to invoke useRestartClusterClick");i(!0);let a=!1;const c={duration:6e4,action:{label:"Cancel",onClick:()=>{a=!0}}},d=_e.loading("Restarting",{...c,description:u.jsx(up,{animated:!0,width:"0%"})}),f=await LE(t),p=Tt.checkForFabricConnect(f.id),h=f?.instances??[],v=h.filter(b=>b.status==="RUNNING").map(b=>Va({id:b.id,forceFabricConnect:p,operationsUrl:jC(b)})).reverse();let y=0;if(v.length)for(let b=0;b<v.length;b++){const S=v[b];if(!a){_e.loading(`Restarting Instance ${b+1} of ${v.length}`,{...c,id:d,description:u.jsx(up,{animated:!0,width:(b===0?0:b/v.length*100)+"%"})});try{await qs({instanceClient:S}),await OH({operation:"restart",replicated:!1,instanceClient:S}),y+=1}catch{b+1!==v.length&&(_e.loading(`Failed Restarting Instance ${b+1} of ${v.length}`,{...c,id:d,description:"We will carry on momentarily."}),await Md(3e3))}}}if(i(!1),n.invalidateQueries({queryKey:[t]}),a)_e.error("Cancelled",{id:d,description:"The restart was partially cancelled.",duration:1e4,action:{label:"Dismiss",onClick:()=>_e.dismiss()}});else if(h.length===y)e?.(),_e.success("Success",{id:d,description:"Cluster fully restarted!",duration:1e4,action:{label:"Dismiss",onClick:()=>_e.dismiss()}});else{const b=Io(h.length,"instance","instances"),S=Io(y,'"RUNNING" instance was','"RUNNING" instances were');_e.error("Error",{id:d,description:`Failed to fully restart cluster.
|
|
128
|
-
`+([h.length===0&&"No instances were found within the cluster to restart.",y===0&&`No instances were in a "RUNNING" state of ${b}.`,h.length!==y&&`Only ${S} restarted of ${b}.`].filter(fa).shift()||""),duration:1e4,action:{label:"Dismiss",onClick:()=>_e.dismiss()}})}},[t,e,n]),isRestartPending:r}}function R_e({operation:e,instanceClient:t,onRestartedSuccessfully:n}){const{clusterId:r,instanceId:i}=tt({strict:!1}),o="Instance",{mutate:a,isPending:c}=k_e(),d=gr();return{onRestartClick:x.useCallback(()=>{const p=_e.loading("Restarting",{description:`Restarting ${o.toLowerCase()}. This may take up to 60 seconds.`,duration:18e4,action:{label:"Dismiss",onClick:()=>_e.dismiss()}});a({operation:e,replicated:e==="restart_service"&&o==="Cluster",instanceClient:t},{onSuccess:()=>{d.invalidateQueries({queryKey:[r]}),d.invalidateQueries({queryKey:[i]}),_e.dismiss(p),_e.success("Success",{description:`${o} restarted!`,action:{label:"Dismiss",onClick:()=>_e.dismiss()}}),n?.()},onError:()=>{_e.dismiss(p),_e.error("Error",{description:`Failed to restart ${o.toLowerCase()}.`,action:{label:"Dismiss",onClick:()=>_e.dismiss()}})}})},[r,t,i,n,e,d,a,o]),isRestartPending:c}}function DH({className:e,disabled:t,hideText:n,instanceClient:r,operation:i,targetNoun:o,tooltip:a,variant:c}){const{onRestartClick:d,isRestartPending:f}=j_e(),{onRestartClick:p,isRestartPending:h}=R_e({operation:i,instanceClient:r});return u.jsxs(Cb,{children:[u.jsx(Eb,{asChild:!0,children:u.jsxs(be,{variant:c||"positiveOutline",className:aa("mx-0 md:mx-4 rounded-full",e),onClick:o==="Cluster"&&i==="restart"?d:p,disabled:t||h||f,children:[u.jsx(jQ,{}),n!==!0&&u.jsxs("span",{className:"hidden md:inline-block",children:["Restart ",o]})]})}),u.jsx(kb,{children:a||(i==="restart_service"?"Restarts all service threads to apply changes. No downtime expected. Performance may be briefly slower during restart.":"This fully restarts the Harper service and causes downtime.")})]})}const a_="__root__",Hl="importedApplications",Ro="newApplication";function q2(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!r.includes(i)||e[i]!==t[i])return!1;return!0}function Iv(e,t){const[n,r]=x.useState(t),[i,o]=x.useState(e);return x.useEffect(()=>{q2(n,t)||(r(t),o(e))},[n,t,e]),q2(n,t)?[i,o]:[e,o]}const qu={};function Ey(e,t,n){const r=x.useCallback(i=>t(i),[n]);x.useEffect(()=>(qu[e]||(qu[e]=[]),qu[e].push(r),function(){const o=qu[e].indexOf(r);o>=0&&qu[e].splice(o,1)}),[e,t,r])}function bx(e,t){const n=qu[e];if(n)for(const r of n)r(t)}function G2(e,t){return()=>bx(e,t)}function K2(e,t){return x.useCallback(()=>bx(e,t),[e,t])}function Z2(e,t){return Bj(sessionStorage.getItem(String(e)))??t}function I_e(e,t){t==null?sessionStorage.removeItem(String(e)):sessionStorage.setItem(String(e),JSON.stringify(t))}function ad(e,t){const n=Iv(Z2(e,t),[e]),[r,i]=n;return x.useEffect(()=>{I_e(e,r),bx(`Session:${e}`,r)},[e,r]),Ey(`Session:${e}`,function(a){r!==a&&i(a)},[r,e,t]),x.useEffect(function(){const a=c=>{c.key===e&&i(Z2(e,t))};return window.addEventListener("storage",a),()=>{window.removeEventListener("storage",a)}},[e,i,t]),n}function xx(e){const{instanceId:t,clusterId:n}=tt({strict:!1}),r=_n,[i,o]=ad(`EditorFileContent/${r}}/${e}`,void 0);return x.useMemo(()=>({content:e?i:void 0,setContent:o}),[e,i,o])}function Pr(e){return!!e?.entries}const $H=x.createContext(null);function mi(){return x.useContext($H)}function Fc(e,t){const[n,r]=x.useState(t);return Ey(e,i=>r(i),[r]),n}function Nd(e,t){bx(e,t)}function rv(e,t){return()=>Nd(e,t)}function ai(e,t){return x.useCallback(()=>Nd(e,t),[e,t])}function N_e({toggledSidebar:e,toggleSidebar:t}){const n=Ft(),{openedEntryContents:r,openedEntry:i,isSavingFile:o,restrictPackageModification:a}=mi(),{content:c}=xx(i?.path),d=Yd(),f=n.entityType==="instance"?"Instance":"Cluster",p=ai("ShowAddDirectoryOrFileModalType","file"),h=ai("ShowAddDirectoryOrFileModalType","directory"),v=ai("ShowDownloadApplicationModal",!0),y=ai("ShowRenameFileModal",!0),b=ai("ShowDeleteDirectoryOrFileModal",!0),S=ai("ShowRedeployApplicationModal",!0),C=K2("SaveFile",!0),E=K2("RevertChanges",!0),k=c===void 0||c===r;return u.jsxs("div",{className:"absolute top-0 right-0 left-0 backdrop-blur-sm bg-black-10 shadow-xl flex pr-4 md:pr-12",children:[u.jsxs(be,{variant:"ghost",className:(e?"toggled-sidebar-toggler":"hidden-sidebar-toggler")+" inline-flex text-sm md:hidden focus:outline-none focus:ring-2 text-white hover:text-grey focus:ring-gray-600 rounded-none",onClick:t,children:[u.jsxs("span",{className:"sr-only",children:[e?"Close":"Open"," sidebar"]}),e?u.jsx(yQ,{}):u.jsx(gQ,{})]}),i&&i?.path!==Ro&&u.jsxs(u.Fragment,{children:[i.package&&u.jsxs(Cb,{children:[u.jsx(Eb,{asChild:!0,children:u.jsxs(be,{variant:"ghost",type:"button",className:"cursor-help",children:[u.jsx(aQ,{width:16,height:16}),u.jsx("span",{className:"hidden md:inline-block",children:"Imported applications are read-only"})]})}),u.jsx(kb,{children:a?u.jsxs(u.Fragment,{children:["This application is read-only, and cannot be modified.",u.jsx("br",{}),"It helps govern clustering amongst your instances."]}):u.jsx(u.Fragment,{children:"This application is read-only, and cannot be directly modified. But you can re-deploy or remove it."})})]}),!Pr(i)&&!i.package&&d&&u.jsxs(be,{variant:"default",className:"rounded-none",onClick:C,disabled:k||o,children:[u.jsx(ho,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"S"}),"ave"]})]}),!Pr(i)&&!i.package&&d&&u.jsxs(be,{variant:"ghost",className:"rounded-none",onClick:y,disabled:!k||o,children:[u.jsx(zP,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"ename"]})]}),!i.package&&d&&u.jsxs(be,{variant:"ghost",className:"rounded-none",onClick:p,children:[u.jsx(OX,{}),u.jsxs("span",{children:[u.jsx("u",{children:"N"}),"ew",u.jsx("span",{className:"hidden mlg:inline-block",children:" File"})]})]}),!i.package&&d&&u.jsxs(be,{variant:"ghost",className:"rounded-none",onClick:h,children:[u.jsx($X,{}),u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd",u.jsx("span",{className:"hidden xl:inline-block",children:" Directory"})]})]}),i.project&&u.jsxs(be,{variant:"ghost",className:"rounded-none",onClick:v,children:[u.jsx(OP,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:["Download",u.jsx("span",{className:"hidden xl:inline-block",children:" Application"})]})]}),!!i.package&&d&&!a&&u.jsxs(be,{variant:"ghost",className:"rounded-none",onClick:S,children:[u.jsx(LC,{}),u.jsxs("span",{children:["Redeploy ",u.jsx("u",{children:"P"}),"ackage"]})]}),u.jsx("div",{className:"grow"}),d&&u.jsx(DH,{targetNoun:f,instanceClient:n.instanceClient,operation:"restart_service",variant:"ghost",className:"rounded-none mx-0 md:mx-0",disabled:!k||o}),!Pr(i)&&!i.package&&d&&u.jsxs(be,{variant:"ghost",className:"rounded-none",onClick:E,disabled:k||o,children:[u.jsx(VQ,{}),u.jsx("span",{className:"hidden xl:inline-block",children:"Revert Changes"})]}),!a&&d&&u.jsxs(be,{variant:"destructiveGhost",className:"rounded-none",onClick:b,children:[u.jsx(ts,{}),u.jsxs("span",{className:"hidden xl:inline-block",children:[u.jsx("u",{children:"D"}),"elete"]})]})]})]})}function T_e(e){return x.useCallback((t,n,r)=>{if(n!=="href")return t;if(t.startsWith("http"))return r.properties.target="_blank",t;{const i=iH().split("?")[0];switch(t){case"./apis":case"./config":case"./config/roles":case"./config/users":case"./databases":case"./logs":case"./status":return`${i}/${t.slice(2)}`}return`${i}?open=${e}/${t.slice(2)}`}},[e])}function A_e(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const O_e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,D_e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$_e={};function Y2(e,t){return($_e.jsx?D_e:O_e).test(e)}const M_e=/[ \t\n\f\r]/g;function P_e(e){return typeof e=="object"?e.type==="text"?W2(e.value):!1:W2(e)}function W2(e){return e.replace(M_e,"")===""}class ah{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ah.prototype.normal={};ah.prototype.property={};ah.prototype.space=void 0;function MH(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new ah(n,r,t)}function Q1(e){return e.toLowerCase()}class pi{constructor(t,n){this.attribute=n,this.property=t}}pi.prototype.attribute="";pi.prototype.booleanish=!1;pi.prototype.boolean=!1;pi.prototype.commaOrSpaceSeparated=!1;pi.prototype.commaSeparated=!1;pi.prototype.defined=!1;pi.prototype.mustUseProperty=!1;pi.prototype.number=!1;pi.prototype.overloadedBoolean=!1;pi.prototype.property="";pi.prototype.spaceSeparated=!1;pi.prototype.space=void 0;let z_e=0;const ht=Vc(),Kn=Vc(),J1=Vc(),ke=Vc(),nn=Vc(),sd=Vc(),_i=Vc();function Vc(){return 2**++z_e}const eC=Object.freeze(Object.defineProperty({__proto__:null,boolean:ht,booleanish:Kn,commaOrSpaceSeparated:_i,commaSeparated:sd,number:ke,overloadedBoolean:J1,spaceSeparated:nn},Symbol.toStringTag,{value:"Module"})),s_=Object.keys(eC);class Jj extends pi{constructor(t,n,r,i){let o=-1;if(super(t,n),X2(this,"space",i),typeof r=="number")for(;++o<s_.length;){const a=s_[o];X2(this,s_[o],(r&eC[a])===eC[a])}}}Jj.prototype.defined=!0;function X2(e,t,n){n&&(e[t]=n)}function lf(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Jj(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Q1(r)]=r,n[Q1(o.attribute)]=r}return new ah(t,n,e.space)}const PH=lf({properties:{ariaActiveDescendant:null,ariaAtomic:Kn,ariaAutoComplete:null,ariaBusy:Kn,ariaChecked:Kn,ariaColCount:ke,ariaColIndex:ke,ariaColSpan:ke,ariaControls:nn,ariaCurrent:null,ariaDescribedBy:nn,ariaDetails:null,ariaDisabled:Kn,ariaDropEffect:nn,ariaErrorMessage:null,ariaExpanded:Kn,ariaFlowTo:nn,ariaGrabbed:Kn,ariaHasPopup:null,ariaHidden:Kn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nn,ariaLevel:ke,ariaLive:null,ariaModal:Kn,ariaMultiLine:Kn,ariaMultiSelectable:Kn,ariaOrientation:null,ariaOwns:nn,ariaPlaceholder:null,ariaPosInSet:ke,ariaPressed:Kn,ariaReadOnly:Kn,ariaRelevant:null,ariaRequired:Kn,ariaRoleDescription:nn,ariaRowCount:ke,ariaRowIndex:ke,ariaRowSpan:ke,ariaSelected:Kn,ariaSetSize:ke,ariaSort:null,ariaValueMax:ke,ariaValueMin:ke,ariaValueNow:ke,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function zH(e,t){return t in e?e[t]:t}function LH(e,t){return zH(e,t.toLowerCase())}const L_e=lf({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:sd,acceptCharset:nn,accessKey:nn,action:null,allow:null,allowFullScreen:ht,allowPaymentRequest:ht,allowUserMedia:ht,alt:null,as:null,async:ht,autoCapitalize:null,autoComplete:nn,autoFocus:ht,autoPlay:ht,blocking:nn,capture:null,charSet:null,checked:ht,cite:null,className:nn,cols:ke,colSpan:null,content:null,contentEditable:Kn,controls:ht,controlsList:nn,coords:ke|sd,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ht,defer:ht,dir:null,dirName:null,disabled:ht,download:J1,draggable:Kn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ht,formTarget:null,headers:nn,height:ke,hidden:J1,high:ke,href:null,hrefLang:null,htmlFor:nn,httpEquiv:nn,id:null,imageSizes:null,imageSrcSet:null,inert:ht,inputMode:null,integrity:null,is:null,isMap:ht,itemId:null,itemProp:nn,itemRef:nn,itemScope:ht,itemType:nn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ht,low:ke,manifest:null,max:null,maxLength:ke,media:null,method:null,min:null,minLength:ke,multiple:ht,muted:ht,name:null,nonce:null,noModule:ht,noValidate:ht,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ht,optimum:ke,pattern:null,ping:nn,placeholder:null,playsInline:ht,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ht,referrerPolicy:null,rel:nn,required:ht,reversed:ht,rows:ke,rowSpan:ke,sandbox:nn,scope:null,scoped:ht,seamless:ht,selected:ht,shadowRootClonable:ht,shadowRootDelegatesFocus:ht,shadowRootMode:null,shape:null,size:ke,sizes:null,slot:null,span:ke,spellCheck:Kn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ke,step:null,style:null,tabIndex:ke,target:null,title:null,translate:null,type:null,typeMustMatch:ht,useMap:null,value:Kn,width:ke,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:nn,axis:null,background:null,bgColor:null,border:ke,borderColor:null,bottomMargin:ke,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ht,declare:ht,event:null,face:null,frame:null,frameBorder:null,hSpace:ke,leftMargin:ke,link:null,longDesc:null,lowSrc:null,marginHeight:ke,marginWidth:ke,noResize:ht,noHref:ht,noShade:ht,noWrap:ht,object:null,profile:null,prompt:null,rev:null,rightMargin:ke,rules:null,scheme:null,scrolling:Kn,standby:null,summary:null,text:null,topMargin:ke,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ke,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ht,disableRemotePlayback:ht,prefix:null,property:null,results:ke,security:null,unselectable:null},space:"html",transform:LH}),U_e=lf({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:_i,accentHeight:ke,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ke,amplitude:ke,arabicForm:null,ascent:ke,attributeName:null,attributeType:null,azimuth:ke,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ke,by:null,calcMode:null,capHeight:ke,className:nn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ke,diffuseConstant:ke,direction:null,display:null,dur:null,divisor:ke,dominantBaseline:null,download:ht,dx:null,dy:null,edgeMode:null,editable:null,elevation:ke,enableBackground:null,end:null,event:null,exponent:ke,externalResourcesRequired:null,fill:null,fillOpacity:ke,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:sd,g2:sd,glyphName:sd,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ke,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ke,horizOriginX:ke,horizOriginY:ke,id:null,ideographic:ke,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ke,k:ke,k1:ke,k2:ke,k3:ke,k4:ke,kernelMatrix:_i,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ke,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ke,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ke,overlineThickness:ke,paintOrder:null,panose1:null,path:null,pathLength:ke,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ke,pointsAtY:ke,pointsAtZ:ke,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:_i,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:_i,rev:_i,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:_i,requiredFeatures:_i,requiredFonts:_i,requiredFormats:_i,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ke,specularExponent:ke,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ke,strikethroughThickness:ke,string:null,stroke:null,strokeDashArray:_i,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ke,strokeOpacity:ke,strokeWidth:null,style:null,surfaceScale:ke,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:_i,tabIndex:ke,tableValues:null,target:null,targetX:ke,targetY:ke,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:_i,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ke,underlineThickness:ke,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ke,values:null,vAlphabetic:ke,vMathematical:ke,vectorEffect:null,vHanging:ke,vIdeographic:ke,version:null,vertAdvY:ke,vertOriginX:ke,vertOriginY:ke,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ke,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:zH}),UH=lf({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),FH=lf({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:LH}),VH=lf({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),F_e={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},V_e=/[A-Z]/g,Q2=/-[a-z]/g,B_e=/^data[-\w.:]+$/i;function H_e(e,t){const n=Q1(t);let r=t,i=pi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&B_e.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Q2,G_e);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Q2.test(o)){let a=o.replace(V_e,q_e);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Jj}return new i(r,t)}function q_e(e){return"-"+e.toLowerCase()}function G_e(e){return e.charAt(1).toUpperCase()}const K_e=MH([PH,L_e,UH,FH,VH],"html"),eR=MH([PH,U_e,UH,FH,VH],"svg");function Z_e(e){return e.join(" ").trim()}var Uu={},l_,J2;function Y_e(){if(J2)return l_;J2=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
|
|
129
|
-
`,f="/",p="*",h="",v="comment",y="declaration";l_=function(S,C){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];C=C||{};var E=1,k=1;function j(W){var F=W.match(t);F&&(E+=F.length);var Z=W.lastIndexOf(d);k=~Z?W.length-Z:k+W.length}function I(){var W={line:E,column:k};return function(F){return F.position=new A(W),z(),F}}function A(W){this.start=W,this.end={line:E,column:k},this.source=C.source}A.prototype.content=S;function N(W){var F=new Error(C.source+":"+E+":"+k+": "+W);if(F.reason=W,F.filename=C.source,F.line=E,F.column=k,F.source=S,!C.silent)throw F}function T(W){var F=W.exec(S);if(F){var Z=F[0];return j(Z),S=S.slice(Z.length),F}}function z(){T(n)}function L(W){var F;for(W=W||[];F=G();)F!==!1&&W.push(F);return W}function G(){var W=I();if(!(f!=S.charAt(0)||p!=S.charAt(1))){for(var F=2;h!=S.charAt(F)&&(p!=S.charAt(F)||f!=S.charAt(F+1));)++F;if(F+=2,h===S.charAt(F-1))return N("End of comment missing");var Z=S.slice(2,F-2);return k+=2,j(Z),S=S.slice(F),k+=2,W({type:v,comment:Z})}}function J(){var W=I(),F=T(r);if(F){if(G(),!T(i))return N("property missing ':'");var Z=T(o),M=W({type:y,property:b(F[0].replace(e,h)),value:Z?b(Z[0].replace(e,h)):h});return T(a),M}}function Y(){var W=[];L(W);for(var F;F=J();)F!==!1&&(W.push(F),L(W));return W}return z(),Y()};function b(S){return S?S.replace(c,h):h}return l_}var e$;function W_e(){if(e$)return Uu;e$=1;var e=Uu&&Uu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Uu,"__esModule",{value:!0}),Uu.default=n;const t=e(Y_e());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const a=(0,t.default)(r),c=typeof i=="function";return a.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:p}=d;c?i(f,p,d):p&&(o=o||{},o[f]=p)}),o}return Uu}var xm={},t$;function X_e(){if(t$)return xm;t$=1,Object.defineProperty(xm,"__esModule",{value:!0}),xm.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(f){return!f||n.test(f)||e.test(f)},a=function(f,p){return p.toUpperCase()},c=function(f,p){return"".concat(p,"-")},d=function(f,p){return p===void 0&&(p={}),o(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(i,c):f=f.replace(r,c),f.replace(t,a))};return xm.camelCase=d,xm}var wm,n$;function Q_e(){if(n$)return wm;n$=1;var e=wm&&wm.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(W_e()),n=X_e();function r(i,o){var a={};return!i||typeof i!="string"||(0,t.default)(i,function(c,d){c&&d&&(a[(0,n.camelCase)(c,o)]=d)}),a}return r.default=r,wm=r,wm}var J_e=Q_e();const e1e=mp(J_e),BH=HH("end"),tR=HH("start");function HH(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function t1e(e){const t=tR(e),n=BH(e);if(t&&n)return{start:t,end:n}}function Vm(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?r$(e.position):"start"in e||"end"in e?r$(e):"line"in e||"column"in e?tC(e):""}function tC(e){return i$(e&&e.line)+":"+i$(e&&e.column)}function r$(e){return tC(e&&e.start)+"-"+tC(e&&e.end)}function i$(e){return e&&typeof e=="number"?e:1}class Ir extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?o.ruleId=r:(o.source=r.slice(0,d),o.ruleId=r.slice(d+1))}if(!o.place&&o.ancestors&&o.ancestors){const d=o.ancestors[o.ancestors.length-1];d&&(o.place=d.position)}const c=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=c?c.line:void 0,this.name=Vm(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ir.prototype.file="";Ir.prototype.name="";Ir.prototype.reason="";Ir.prototype.message="";Ir.prototype.stack="";Ir.prototype.column=void 0;Ir.prototype.line=void 0;Ir.prototype.ancestors=void 0;Ir.prototype.cause=void 0;Ir.prototype.fatal=void 0;Ir.prototype.place=void 0;Ir.prototype.ruleId=void 0;Ir.prototype.source=void 0;const nR={}.hasOwnProperty,n1e=new Map,r1e=/[A-Z]/g,i1e=new Set(["table","tbody","thead","tfoot","tr"]),o1e=new Set(["td","th"]),qH="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function a1e(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=p1e(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=m1e(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?eR:K_e,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=GH(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function GH(e,t,n){if(t.type==="element")return s1e(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return l1e(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return u1e(e,t,n);if(t.type==="mdxjsEsm")return c1e(e,t);if(t.type==="root")return d1e(e,t,n);if(t.type==="text")return f1e(e,t)}function s1e(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=eR,e.schema=i),e.ancestors.push(t);const o=ZH(e,t.tagName,!1),a=h1e(e,t);let c=iR(e,t);return i1e.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!P_e(d):!0})),KH(e,a,o,t),rR(a,c),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function l1e(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}fp(e,t.position)}function c1e(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);fp(e,t.position)}function u1e(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=eR,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:ZH(e,t.name,!0),a=g1e(e,t),c=iR(e,t);return KH(e,a,o,t),rR(a,c),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function d1e(e,t,n){const r={};return rR(r,iR(e,t)),e.create(t,e.Fragment,r,n)}function f1e(e,t){return t.value}function KH(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function rR(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function m1e(e,t,n){return r;function r(i,o,a,c){const f=Array.isArray(a.children)?n:t;return c?f(o,a,c):f(o,a)}}function p1e(e,t){return n;function n(r,i,o,a){const c=Array.isArray(o.children),d=tR(r);return t(i,o,a,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function h1e(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&nR.call(t.properties,i)){const o=v1e(e,i,t.properties[i]);if(o){const[a,c]=o;e.tableCellAlignToStyle&&a==="align"&&typeof c=="string"&&o1e.has(t.tagName)?r=c:n[a]=c}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function g1e(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const c=a.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else fp(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,o=e.evaluater.evaluateExpression(c.expression)}else fp(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function iR(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:n1e;for(;++r<t.children.length;){const o=t.children[r];let a;if(e.passKeys){const d=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(d){const f=i.get(d)||0;a=d+"-"+f,i.set(d,f+1)}}const c=GH(e,o,a);c!==void 0&&n.push(c)}return n}function v1e(e,t,n){const r=H_e(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?A_e(n):Z_e(n)),r.property==="style"){let i=typeof n=="object"?n:y1e(e,String(n));return e.stylePropertyNameCase==="css"&&(i=b1e(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?F_e[r.property]||r.property:r.attribute,n]}}function y1e(e,t){try{return e1e(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Ir("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=qH+"#cannot-parse-style-attribute",i}}function ZH(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,a;for(;++o<i.length;){const c=Y2(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:c,computed:!!(o&&c.type==="Literal"),optional:!1}:c}r=a}else r=Y2(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return nR.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);fp(e)}function fp(e,t){const n=new Ir("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=qH+"#cannot-handle-mdx-estrees-without-createevaluater",n}function b1e(e){const t={};let n;for(n in e)nR.call(e,n)&&(t[x1e(n)]=e[n]);return t}function x1e(e){let t=e.replace(r1e,w1e);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function w1e(e){return"-"+e.toLowerCase()}const c_={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},S1e={};function _1e(e,t){const n=S1e,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return YH(e,r,i)}function YH(e,t,n){if(C1e(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return o$(e.children,t,n)}return Array.isArray(e)?o$(e,t,n):""}function o$(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=YH(e[i],t,n);return r.join("")}function C1e(e){return!!(e&&typeof e=="object")}const a$=document.createElement("i");function oR(e){const t="&"+e+";";a$.innerHTML=t;const n=a$.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function da(e,t,n,r){const i=e.length;let o=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(t,0),e.splice(...a),o+=1e4,t+=1e4}function no(e,t){return e.length>0?(da(e,e.length,0,t),e):t}const s$={}.hasOwnProperty;function E1e(e){const t={};let n=-1;for(;++n<e.length;)k1e(t,e[n]);return t}function k1e(e,t){let n;for(n in t){const i=(s$.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){s$.call(i,a)||(i[a]=[]);const c=o[a];j1e(i[a],Array.isArray(c)?c:c?[c]:[])}}}function j1e(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);da(e,0,0,r)}function WH(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ld(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Qo=yl(/[A-Za-z]/),Ii=yl(/[\dA-Za-z]/),R1e=yl(/[#-'*+\--9=?A-Z^-~]/);function nC(e){return e!==null&&(e<32||e===127)}const rC=yl(/\d/),I1e=yl(/[\dA-Fa-f]/),N1e=yl(/[!-/:-@[-`{-~]/);function rt(e){return e!==null&&e<-2}function ui(e){return e!==null&&(e<0||e===32)}function Lt(e){return e===-2||e===-1||e===32}const T1e=yl(new RegExp("\\p{P}|\\p{S}","u")),A1e=yl(/\s/);function yl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function cf(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&&Ii(e.charCodeAt(n+1))&&Ii(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const c=e.charCodeAt(n+1);o<56320&&c>56319&&c<57344?(a=String.fromCharCode(o,c),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function on(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(d){return Lt(d)?(e.enter(n),c(d)):t(d)}function c(d){return Lt(d)&&o++<i?(e.consume(d),c):(e.exit(n),t(d))}}const O1e={tokenize:D1e};function D1e(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),on(e,t,"linePrefix")}function i(c){return e.enter("paragraph"),o(c)}function o(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,a(c)}function a(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return rt(c)?(e.consume(c),e.exit("chunkText"),o):(e.consume(c),a)}}const $1e={tokenize:M1e},l$={tokenize:P1e};function M1e(e){const t=this,n=[];let r=0,i,o,a;return c;function c(j){if(r<n.length){const I=n[r];return t.containerState=I[1],e.attempt(I[0].continuation,d,f)(j)}return f(j)}function d(j){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&k();const I=t.events.length;let A=I,N;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){N=t.events[A][1].end;break}E(r);let T=I;for(;T<t.events.length;)t.events[T][1].end={...N},T++;return da(t.events,A+1,0,t.events.slice(I)),t.events.length=T,f(j)}return c(j)}function f(j){if(r===n.length){if(!i)return v(j);if(i.currentConstruct&&i.currentConstruct.concrete)return b(j);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(l$,p,h)(j)}function p(j){return i&&k(),E(r),v(j)}function h(j){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,b(j)}function v(j){return t.containerState={},e.attempt(l$,y,b)(j)}function y(j){return r++,n.push([t.currentConstruct,t.containerState]),v(j)}function b(j){if(j===null){i&&k(),E(0),e.consume(j);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),S(j)}function S(j){if(j===null){C(e.exit("chunkFlow"),!0),E(0),e.consume(j);return}return rt(j)?(e.consume(j),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(j),S)}function C(j,I){const A=t.sliceStream(j);if(I&&A.push(null),j.previous=o,o&&(o.next=j),o=j,i.defineSkip(j.start),i.write(A),t.parser.lazy[j.start.line]){let N=i.events.length;for(;N--;)if(i.events[N][1].start.offset<a&&(!i.events[N][1].end||i.events[N][1].end.offset>a))return;const T=t.events.length;let z=T,L,G;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){if(L){G=t.events[z][1].end;break}L=!0}for(E(r),N=T;N<t.events.length;)t.events[N][1].end={...G},N++;da(t.events,z+1,0,t.events.slice(T)),t.events.length=N}}function E(j){let I=n.length;for(;I-- >j;){const A=n[I];t.containerState=A[1],A[0].exit.call(t,e)}n.length=j}function k(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function P1e(e,t,n){return on(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function c$(e){if(e===null||ui(e)||A1e(e))return 1;if(T1e(e))return 2}function aR(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const iC={name:"attention",resolveAll:z1e,tokenize:L1e};function z1e(e,t){let n=-1,r,i,o,a,c,d,f,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},v={...e[n][1].start};u$(h,-d),u$(v,d),a={type:d>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},o={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:d>1?"strong":"emphasis",start:{...a.start},end:{...c.end}},e[r][1].end={...a.start},e[n][1].start={...c.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=no(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=no(f,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),f=no(f,aR(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=no(f,[["exit",o,t],["enter",c,t],["exit",c,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=no(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,da(e,r-1,n-r+3,f),n=r+f.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function L1e(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=c$(r);let o;return a;function a(d){return o=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===o)return e.consume(d),c;const f=e.exit("attentionSequence"),p=c$(d),h=!p||p===2&&i||n.includes(d),v=!i||i===2&&p||n.includes(r);return f._open=!!(o===42?h:h&&(i||!v)),f._close=!!(o===42?v:v&&(p||!h)),t(d)}}function u$(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const U1e={name:"autolink",tokenize:F1e};function F1e(e,t,n){let r=0;return i;function i(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(y){return Qo(y)?(e.consume(y),a):y===64?n(y):f(y)}function a(y){return y===43||y===45||y===46||Ii(y)?(r=1,c(y)):f(y)}function c(y){return y===58?(e.consume(y),r=0,d):(y===43||y===45||y===46||Ii(y))&&r++<32?(e.consume(y),c):(r=0,f(y))}function d(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||nC(y)?n(y):(e.consume(y),d)}function f(y){return y===64?(e.consume(y),p):R1e(y)?(e.consume(y),f):n(y)}function p(y){return Ii(y)?h(y):n(y)}function h(y){return y===46?(e.consume(y),r=0,p):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):v(y)}function v(y){if((y===45||Ii(y))&&r++<63){const b=y===45?v:h;return e.consume(y),b}return n(y)}}const wx={partial:!0,tokenize:V1e};function V1e(e,t,n){return r;function r(o){return Lt(o)?on(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||rt(o)?t(o):n(o)}}const XH={continuation:{tokenize:H1e},exit:q1e,name:"blockQuote",tokenize:B1e};function B1e(e,t,n){const r=this;return i;function i(a){if(a===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return n(a)}function o(a){return Lt(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function H1e(e,t,n){const r=this;return i;function i(a){return Lt(a)?on(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(XH,t,n)(a)}}function q1e(e){e.exit("blockQuote")}const QH={name:"characterEscape",tokenize:G1e};function G1e(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return N1e(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const JH={name:"characterReference",tokenize:K1e};function K1e(e,t,n){const r=this;let i=0,o,a;return c;function c(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),d}function d(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),o=31,a=Ii,p(h))}function f(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=I1e,p):(e.enter("characterReferenceValue"),o=7,a=rC,p(h))}function p(h){if(h===59&&i){const v=e.exit("characterReferenceValue");return a===Ii&&!oR(r.sliceSerialize(v))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(h)&&i++<o?(e.consume(h),p):n(h)}}const d$={partial:!0,tokenize:Y1e},f$={concrete:!0,name:"codeFenced",tokenize:Z1e};function Z1e(e,t,n){const r=this,i={partial:!0,tokenize:A};let o=0,a=0,c;return d;function d(N){return f(N)}function f(N){const T=r.events[r.events.length-1];return o=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,c=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(N)}function p(N){return N===c?(a++,e.consume(N),p):a<3?n(N):(e.exit("codeFencedFenceSequence"),Lt(N)?on(e,h,"whitespace")(N):h(N))}function h(N){return N===null||rt(N)?(e.exit("codeFencedFence"),r.interrupt?t(N):e.check(d$,S,I)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(N))}function v(N){return N===null||rt(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(N)):Lt(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),on(e,y,"whitespace")(N)):N===96&&N===c?n(N):(e.consume(N),v)}function y(N){return N===null||rt(N)?h(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(N))}function b(N){return N===null||rt(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(N)):N===96&&N===c?n(N):(e.consume(N),b)}function S(N){return e.attempt(i,I,C)(N)}function C(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),E}function E(N){return o>0&&Lt(N)?on(e,k,"linePrefix",o+1)(N):k(N)}function k(N){return N===null||rt(N)?e.check(d$,S,I)(N):(e.enter("codeFlowValue"),j(N))}function j(N){return N===null||rt(N)?(e.exit("codeFlowValue"),k(N)):(e.consume(N),j)}function I(N){return e.exit("codeFenced"),t(N)}function A(N,T,z){let L=0;return G;function G(Z){return N.enter("lineEnding"),N.consume(Z),N.exit("lineEnding"),J}function J(Z){return N.enter("codeFencedFence"),Lt(Z)?on(N,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):Y(Z)}function Y(Z){return Z===c?(N.enter("codeFencedFenceSequence"),W(Z)):z(Z)}function W(Z){return Z===c?(L++,N.consume(Z),W):L>=a?(N.exit("codeFencedFenceSequence"),Lt(Z)?on(N,F,"whitespace")(Z):F(Z)):z(Z)}function F(Z){return Z===null||rt(Z)?(N.exit("codeFencedFence"),T(Z)):z(Z)}}}function Y1e(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const u_={name:"codeIndented",tokenize:X1e},W1e={partial:!0,tokenize:Q1e};function X1e(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),on(e,o,"linePrefix",5)(f)}function o(f){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?a(f):n(f)}function a(f){return f===null?d(f):rt(f)?e.attempt(W1e,a,d)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||rt(f)?(e.exit("codeFlowValue"),a(f)):(e.consume(f),c)}function d(f){return e.exit("codeIndented"),t(f)}}function Q1e(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):rt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):on(e,o,"linePrefix",5)(a)}function o(a){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(a):rt(a)?i(a):n(a)}}const J1e={name:"codeText",previous:tCe,resolve:eCe,tokenize:nCe};function eCe(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function tCe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function nCe(e,t,n){let r=0,i,o;return a;function a(h){return e.enter("codeText"),e.enter("codeTextSequence"),c(h)}function c(h){return h===96?(e.consume(h),r++,c):(e.exit("codeTextSequence"),d(h))}function d(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),d):h===96?(o=e.enter("codeTextSequence"),i=0,p(h)):rt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(h))}function f(h){return h===null||h===32||h===96||rt(h)?(e.exit("codeTextData"),d(h)):(e.consume(h),f)}function p(h){return h===96?(e.consume(h),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(o.type="codeTextData",f(h))}}class rCe{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Sm(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Sm(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Sm(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Sm(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Sm(this.left,n.reverse())}}}function Sm(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function e8(e){const t={};let n=-1,r,i,o,a,c,d,f;const p=new rCe(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,o=0,o<d.length&&d[o][1].type==="lineEndingBlank"&&(o+=2),o<d.length&&d[o][1].type==="content"))for(;++o<d.length&&d[o][1].type!=="content";)d[o][1].type==="chunkText"&&(d[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,iCe(p,n)),n=t[n],f=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(a=p.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},c=p.slice(i,n),c.unshift(r),p.splice(i,n-i+1,c))}}return da(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function iCe(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const c=a.events,d=[],f={};let p,h,v=-1,y=n,b=0,S=0;const C=[S];for(;y;){for(;e.get(++i)[1]!==y;);o.push(i),y._tokenizer||(p=r.sliceStream(y),y.next||p.push(null),h&&a.defineSkip(y.start),y._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(p),y._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=y,y=y.next}for(y=n;++v<c.length;)c[v][0]==="exit"&&c[v-1][0]==="enter"&&c[v][1].type===c[v-1][1].type&&c[v][1].start.line!==c[v][1].end.line&&(S=v+1,C.push(S),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(a.events=[],y?(y._tokenizer=void 0,y.previous=void 0):C.pop(),v=C.length;v--;){const E=c.slice(C[v],C[v+1]),k=o.pop();d.push([k,k+E.length-1]),e.splice(k,2,E)}for(d.reverse(),v=-1;++v<d.length;)f[b+d[v][0]]=b+d[v][1],b+=d[v][1]-d[v][0]-1;return f}const oCe={resolve:sCe,tokenize:lCe},aCe={partial:!0,tokenize:cCe};function sCe(e){return e8(e),e}function lCe(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(c)}function i(c){return c===null?o(c):rt(c)?e.check(aCe,a,o)(c):(e.consume(c),i)}function o(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function a(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function cCe(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),on(e,o,"linePrefix")}function o(a){if(a===null||rt(a))return n(a);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function t8(e,t,n,r,i,o,a,c,d){const f=d||Number.POSITIVE_INFINITY;let p=0;return h;function h(E){return E===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(E),e.exit(o),v):E===null||E===32||E===41||nC(E)?n(E):(e.enter(r),e.enter(a),e.enter(c),e.enter("chunkString",{contentType:"string"}),S(E))}function v(E){return E===62?(e.enter(o),e.consume(E),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),y(E))}function y(E){return E===62?(e.exit("chunkString"),e.exit(c),v(E)):E===null||E===60||rt(E)?n(E):(e.consume(E),E===92?b:y)}function b(E){return E===60||E===62||E===92?(e.consume(E),y):y(E)}function S(E){return!p&&(E===null||E===41||ui(E))?(e.exit("chunkString"),e.exit(c),e.exit(a),e.exit(r),t(E)):p<f&&E===40?(e.consume(E),p++,S):E===41?(e.consume(E),p--,S):E===null||E===32||E===40||nC(E)?n(E):(e.consume(E),E===92?C:S)}function C(E){return E===40||E===41||E===92?(e.consume(E),S):S(E)}}function n8(e,t,n,r,i,o){const a=this;let c=0,d;return f;function f(y){return e.enter(r),e.enter(i),e.consume(y),e.exit(i),e.enter(o),p}function p(y){return c>999||y===null||y===91||y===93&&!d||y===94&&!c&&"_hiddenFootnoteSupport"in a.parser.constructs?n(y):y===93?(e.exit(o),e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):rt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===null||y===91||y===93||rt(y)||c++>999?(e.exit("chunkString"),p(y)):(e.consume(y),d||(d=!Lt(y)),y===92?v:h)}function v(y){return y===91||y===92||y===93?(e.consume(y),c++,h):h(y)}}function r8(e,t,n,r,i,o){let a;return c;function c(v){return v===34||v===39||v===40?(e.enter(r),e.enter(i),e.consume(v),e.exit(i),a=v===40?41:v,d):n(v)}function d(v){return v===a?(e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):(e.enter(o),f(v))}function f(v){return v===a?(e.exit(o),d(a)):v===null?n(v):rt(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),on(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===a||v===null||rt(v)?(e.exit("chunkString"),f(v)):(e.consume(v),v===92?h:p)}function h(v){return v===a||v===92?(e.consume(v),p):p(v)}}function Bm(e,t){let n;return r;function r(i){return rt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Lt(i)?on(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const uCe={name:"definition",tokenize:fCe},dCe={partial:!0,tokenize:mCe};function fCe(e,t,n){const r=this;let i;return o;function o(y){return e.enter("definition"),a(y)}function a(y){return n8.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function c(y){return i=ld(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),d):n(y)}function d(y){return ui(y)?Bm(e,f)(y):f(y)}function f(y){return t8(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function p(y){return e.attempt(dCe,h,h)(y)}function h(y){return Lt(y)?on(e,v,"whitespace")(y):v(y)}function v(y){return y===null||rt(y)?(e.exit("definition"),r.parser.defined.push(i),t(y)):n(y)}}function mCe(e,t,n){return r;function r(c){return ui(c)?Bm(e,i)(c):n(c)}function i(c){return r8(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function o(c){return Lt(c)?on(e,a,"whitespace")(c):a(c)}function a(c){return c===null||rt(c)?t(c):n(c)}}const pCe={name:"hardBreakEscape",tokenize:hCe};function hCe(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return rt(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const gCe={name:"headingAtx",resolve:vCe,tokenize:yCe};function vCe(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},da(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function yCe(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),a(p)}function a(p){return p===35&&r++<6?(e.consume(p),a):p===null||ui(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||rt(p)?(e.exit("atxHeading"),t(p)):Lt(p)?on(e,c,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),c(p))}function f(p){return p===null||p===35||ui(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),f)}}const bCe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],m$=["pre","script","style","textarea"],xCe={concrete:!0,name:"htmlFlow",resolveTo:_Ce,tokenize:CCe},wCe={partial:!0,tokenize:kCe},SCe={partial:!0,tokenize:ECe};function _Ce(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function CCe(e,t,n){const r=this;let i,o,a,c,d;return f;function f(O){return p(O)}function p(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),h}function h(O){return O===33?(e.consume(O),v):O===47?(e.consume(O),o=!0,S):O===63?(e.consume(O),i=3,r.interrupt?t:D):Qo(O)?(e.consume(O),a=String.fromCharCode(O),C):n(O)}function v(O){return O===45?(e.consume(O),i=2,y):O===91?(e.consume(O),i=5,c=0,b):Qo(O)?(e.consume(O),i=4,r.interrupt?t:D):n(O)}function y(O){return O===45?(e.consume(O),r.interrupt?t:D):n(O)}function b(O){const ee="CDATA[";return O===ee.charCodeAt(c++)?(e.consume(O),c===ee.length?r.interrupt?t:Y:b):n(O)}function S(O){return Qo(O)?(e.consume(O),a=String.fromCharCode(O),C):n(O)}function C(O){if(O===null||O===47||O===62||ui(O)){const ee=O===47,ue=a.toLowerCase();return!ee&&!o&&m$.includes(ue)?(i=1,r.interrupt?t(O):Y(O)):bCe.includes(a.toLowerCase())?(i=6,ee?(e.consume(O),E):r.interrupt?t(O):Y(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):o?k(O):j(O))}return O===45||Ii(O)?(e.consume(O),a+=String.fromCharCode(O),C):n(O)}function E(O){return O===62?(e.consume(O),r.interrupt?t:Y):n(O)}function k(O){return Lt(O)?(e.consume(O),k):G(O)}function j(O){return O===47?(e.consume(O),G):O===58||O===95||Qo(O)?(e.consume(O),I):Lt(O)?(e.consume(O),j):G(O)}function I(O){return O===45||O===46||O===58||O===95||Ii(O)?(e.consume(O),I):A(O)}function A(O){return O===61?(e.consume(O),N):Lt(O)?(e.consume(O),A):j(O)}function N(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),d=O,T):Lt(O)?(e.consume(O),N):z(O)}function T(O){return O===d?(e.consume(O),d=null,L):O===null||rt(O)?n(O):(e.consume(O),T)}function z(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||ui(O)?A(O):(e.consume(O),z)}function L(O){return O===47||O===62||Lt(O)?j(O):n(O)}function G(O){return O===62?(e.consume(O),J):n(O)}function J(O){return O===null||rt(O)?Y(O):Lt(O)?(e.consume(O),J):n(O)}function Y(O){return O===45&&i===2?(e.consume(O),M):O===60&&i===1?(e.consume(O),K):O===62&&i===4?(e.consume(O),P):O===63&&i===3?(e.consume(O),D):O===93&&i===5?(e.consume(O),te):rt(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(wCe,V,W)(O)):O===null||rt(O)?(e.exit("htmlFlowData"),W(O)):(e.consume(O),Y)}function W(O){return e.check(SCe,F,V)(O)}function F(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),Z}function Z(O){return O===null||rt(O)?W(O):(e.enter("htmlFlowData"),Y(O))}function M(O){return O===45?(e.consume(O),D):Y(O)}function K(O){return O===47?(e.consume(O),a="",U):Y(O)}function U(O){if(O===62){const ee=a.toLowerCase();return m$.includes(ee)?(e.consume(O),P):Y(O)}return Qo(O)&&a.length<8?(e.consume(O),a+=String.fromCharCode(O),U):Y(O)}function te(O){return O===93?(e.consume(O),D):Y(O)}function D(O){return O===62?(e.consume(O),P):O===45&&i===2?(e.consume(O),D):Y(O)}function P(O){return O===null||rt(O)?(e.exit("htmlFlowData"),V(O)):(e.consume(O),P)}function V(O){return e.exit("htmlFlow"),t(O)}}function ECe(e,t,n){const r=this;return i;function i(a){return rt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function kCe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(wx,t,n)}}const jCe={name:"htmlText",tokenize:RCe};function RCe(e,t,n){const r=this;let i,o,a;return c;function c(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),d}function d(D){return D===33?(e.consume(D),f):D===47?(e.consume(D),A):D===63?(e.consume(D),j):Qo(D)?(e.consume(D),z):n(D)}function f(D){return D===45?(e.consume(D),p):D===91?(e.consume(D),o=0,b):Qo(D)?(e.consume(D),k):n(D)}function p(D){return D===45?(e.consume(D),y):n(D)}function h(D){return D===null?n(D):D===45?(e.consume(D),v):rt(D)?(a=h,K(D)):(e.consume(D),h)}function v(D){return D===45?(e.consume(D),y):h(D)}function y(D){return D===62?M(D):D===45?v(D):h(D)}function b(D){const P="CDATA[";return D===P.charCodeAt(o++)?(e.consume(D),o===P.length?S:b):n(D)}function S(D){return D===null?n(D):D===93?(e.consume(D),C):rt(D)?(a=S,K(D)):(e.consume(D),S)}function C(D){return D===93?(e.consume(D),E):S(D)}function E(D){return D===62?M(D):D===93?(e.consume(D),E):S(D)}function k(D){return D===null||D===62?M(D):rt(D)?(a=k,K(D)):(e.consume(D),k)}function j(D){return D===null?n(D):D===63?(e.consume(D),I):rt(D)?(a=j,K(D)):(e.consume(D),j)}function I(D){return D===62?M(D):j(D)}function A(D){return Qo(D)?(e.consume(D),N):n(D)}function N(D){return D===45||Ii(D)?(e.consume(D),N):T(D)}function T(D){return rt(D)?(a=T,K(D)):Lt(D)?(e.consume(D),T):M(D)}function z(D){return D===45||Ii(D)?(e.consume(D),z):D===47||D===62||ui(D)?L(D):n(D)}function L(D){return D===47?(e.consume(D),M):D===58||D===95||Qo(D)?(e.consume(D),G):rt(D)?(a=L,K(D)):Lt(D)?(e.consume(D),L):M(D)}function G(D){return D===45||D===46||D===58||D===95||Ii(D)?(e.consume(D),G):J(D)}function J(D){return D===61?(e.consume(D),Y):rt(D)?(a=J,K(D)):Lt(D)?(e.consume(D),J):L(D)}function Y(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),i=D,W):rt(D)?(a=Y,K(D)):Lt(D)?(e.consume(D),Y):(e.consume(D),F)}function W(D){return D===i?(e.consume(D),i=void 0,Z):D===null?n(D):rt(D)?(a=W,K(D)):(e.consume(D),W)}function F(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||ui(D)?L(D):(e.consume(D),F)}function Z(D){return D===47||D===62||ui(D)?L(D):n(D)}function M(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function K(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),U}function U(D){return Lt(D)?on(e,te,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):te(D)}function te(D){return e.enter("htmlTextData"),a(D)}}const sR={name:"labelEnd",resolveAll:ACe,resolveTo:OCe,tokenize:DCe},ICe={tokenize:$Ce},NCe={tokenize:MCe},TCe={tokenize:PCe};function ACe(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&da(e,0,e.length,n),e}function OCe(e,t){let n=e.length,r=0,i,o,a,c;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const d={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[o][1].start},end:{...e[a][1].end}},p={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return c=[["enter",d,t],["enter",f,t]],c=no(c,e.slice(o+1,o+r+3)),c=no(c,[["enter",p,t]]),c=no(c,aR(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),c=no(c,[["exit",p,t],e[a-2],e[a-1],["exit",f,t]]),c=no(c,e.slice(a+1)),c=no(c,[["exit",d,t]]),da(e,o,e.length,c),e}function DCe(e,t,n){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return c;function c(v){return o?o._inactive?h(v):(a=r.parser.defined.includes(ld(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),d):n(v)}function d(v){return v===40?e.attempt(ICe,p,a?p:h)(v):v===91?e.attempt(NCe,p,a?f:h)(v):a?p(v):h(v)}function f(v){return e.attempt(TCe,p,h)(v)}function p(v){return t(v)}function h(v){return o._balanced=!0,n(v)}}function $Ce(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return ui(h)?Bm(e,o)(h):o(h)}function o(h){return h===41?p(h):t8(e,a,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return ui(h)?Bm(e,d)(h):p(h)}function c(h){return n(h)}function d(h){return h===34||h===39||h===40?r8(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):p(h)}function f(h){return ui(h)?Bm(e,p)(h):p(h)}function p(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function MCe(e,t,n){const r=this;return i;function i(c){return n8.call(r,e,o,a,"reference","referenceMarker","referenceString")(c)}function o(c){return r.parser.defined.includes(ld(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function a(c){return n(c)}}function PCe(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const zCe={name:"labelStartImage",resolveAll:sR.resolveAll,tokenize:LCe};function LCe(e,t,n){const r=this;return i;function i(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),o}function o(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),a):n(c)}function a(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const UCe={name:"labelStartLink",resolveAll:sR.resolveAll,tokenize:FCe};function FCe(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const d_={name:"lineEnding",tokenize:VCe};function VCe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),on(e,t,"linePrefix")}}const Nv={name:"thematicBreak",tokenize:BCe};function BCe(e,t,n){let r=0,i;return o;function o(f){return e.enter("thematicBreak"),a(f)}function a(f){return i=f,c(f)}function c(f){return f===i?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||rt(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===i?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),Lt(f)?on(e,c,"whitespace")(f):c(f))}}const ti={continuation:{tokenize:KCe},exit:YCe,name:"list",tokenize:GCe},HCe={partial:!0,tokenize:WCe},qCe={partial:!0,tokenize:ZCe};function GCe(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return c;function c(y){const b=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:rC(y)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(Nv,n,f)(y):f(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(y)}return n(y)}function d(y){return rC(y)&&++a<10?(e.consume(y),d):(!r.interrupt||a<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),f(y)):n(y)}function f(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(wx,r.interrupt?n:p,e.attempt(HCe,v,h))}function p(y){return r.containerState.initialBlankLine=!0,o++,v(y)}function h(y){return Lt(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),v):n(y)}function v(y){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function KCe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(wx,i,o);function i(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,on(e,t,"listItemIndent",r.containerState.size+1)(c)}function o(c){return r.containerState.furtherBlankLines||!Lt(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(qCe,t,a)(c))}function a(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,on(e,e.attempt(ti,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function ZCe(e,t,n){const r=this;return on(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function YCe(e){e.exit(this.containerState.type)}function WCe(e,t,n){const r=this;return on(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!Lt(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const p$={name:"setextUnderline",resolveTo:XCe,tokenize:QCe};function XCe(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function QCe(e,t,n){const r=this;let i;return o;function o(f){let p=r.events.length,h;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){h=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=f,a(f)):n(f)}function a(f){return e.enter("setextHeadingLineSequence"),c(f)}function c(f){return f===i?(e.consume(f),c):(e.exit("setextHeadingLineSequence"),Lt(f)?on(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||rt(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const JCe={tokenize:eEe};function eEe(e){const t=this,n=e.attempt(wx,r,e.attempt(this.parser.constructs.flowInitial,i,on(e,e.attempt(this.parser.constructs.flow,i,e.attempt(oCe,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const tEe={resolveAll:o8()},nEe=i8("string"),rEe=i8("text");function i8(e){return{resolveAll:o8(e==="text"?iEe:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,c);return a;function a(p){return f(p)?o(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return f(p)?(n.exit("data"),o(p)):(n.consume(p),d)}function f(p){if(p===null)return!0;const h=i[p];let v=-1;if(h)for(;++v<h.length;){const y=h[v];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function o8(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function iEe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,a=-1,c=0,d;for(;o--;){const f=i[o];if(typeof f=="string"){for(a=f.length;f.charCodeAt(a-1)===32;)c++,a--;if(a)break;a=-1}else if(f===-2)d=!0,c++;else if(f!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const f={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const oEe={42:ti,43:ti,45:ti,48:ti,49:ti,50:ti,51:ti,52:ti,53:ti,54:ti,55:ti,56:ti,57:ti,62:XH},aEe={91:uCe},sEe={[-2]:u_,[-1]:u_,32:u_},lEe={35:gCe,42:Nv,45:[p$,Nv],60:xCe,61:p$,95:Nv,96:f$,126:f$},cEe={38:JH,92:QH},uEe={[-5]:d_,[-4]:d_,[-3]:d_,33:zCe,38:JH,42:iC,60:[U1e,jCe],91:UCe,92:[pCe,QH],93:sR,95:iC,96:J1e},dEe={null:[iC,tEe]},fEe={null:[42,95]},mEe={null:[]},pEe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:fEe,contentInitial:aEe,disable:mEe,document:oEe,flow:lEe,flowInitial:sEe,insideSpan:dEe,string:cEe,text:uEe},Symbol.toStringTag,{value:"Module"}));function hEe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let a=[],c=[];const d={attempt:T(A),check:T(N),consume:k,enter:j,exit:I,interrupt:T(N,{interrupt:!0})},f={code:null,containerState:{},defineSkip:S,events:[],now:b,parser:e,previous:null,sliceSerialize:v,sliceStream:y,write:h};let p=t.tokenize.call(f,d);return t.resolveAll&&o.push(t),f;function h(J){return a=no(a,J),C(),a[a.length-1]!==null?[]:(z(t,0),f.events=aR(o,f.events,f),f.events)}function v(J,Y){return vEe(y(J),Y)}function y(J){return gEe(a,J)}function b(){const{_bufferIndex:J,_index:Y,line:W,column:F,offset:Z}=r;return{_bufferIndex:J,_index:Y,line:W,column:F,offset:Z}}function S(J){i[J.line]=J.column,G()}function C(){let J;for(;r._index<a.length;){const Y=a[r._index];if(typeof Y=="string")for(J=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===J&&r._bufferIndex<Y.length;)E(Y.charCodeAt(r._bufferIndex));else E(Y)}}function E(J){p=p(J)}function k(J){rt(J)?(r.line++,r.column=1,r.offset+=J===-3?2:1,G()):J!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=J}function j(J,Y){const W=Y||{};return W.type=J,W.start=b(),f.events.push(["enter",W,f]),c.push(W),W}function I(J){const Y=c.pop();return Y.end=b(),f.events.push(["exit",Y,f]),Y}function A(J,Y){z(J,Y.from)}function N(J,Y){Y.restore()}function T(J,Y){return W;function W(F,Z,M){let K,U,te,D;return Array.isArray(F)?V(F):"tokenize"in F?V([F]):P(F);function P(pe){return B;function B(ie){const Se=ie!==null&&pe[ie],Ie=ie!==null&&pe.null,Fe=[...Array.isArray(Se)?Se:Se?[Se]:[],...Array.isArray(Ie)?Ie:Ie?[Ie]:[]];return V(Fe)(ie)}}function V(pe){return K=pe,U=0,pe.length===0?M:O(pe[U])}function O(pe){return B;function B(ie){return D=L(),te=pe,pe.partial||(f.currentConstruct=pe),pe.name&&f.parser.constructs.disable.null.includes(pe.name)?ue():pe.tokenize.call(Y?Object.assign(Object.create(f),Y):f,d,ee,ue)(ie)}}function ee(pe){return J(te,D),Z}function ue(pe){return D.restore(),++U<K.length?O(K[U]):M}}}function z(J,Y){J.resolveAll&&!o.includes(J)&&o.push(J),J.resolve&&da(f.events,Y,f.events.length-Y,J.resolve(f.events.slice(Y),f)),J.resolveTo&&(f.events=J.resolveTo(f.events,f))}function L(){const J=b(),Y=f.previous,W=f.currentConstruct,F=f.events.length,Z=Array.from(c);return{from:F,restore:M};function M(){r=J,f.previous=Y,f.currentConstruct=W,f.events.length=F,c=Z,G()}}function G(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function gEe(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){const c=a[0];typeof c=="string"?a[0]=c.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function vEe(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
|
|
130
|
-
`;break}case-3:{a=`\r
|
|
131
|
-
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}function yEe(e){const r={constructs:E1e([pEe,...(e||{}).extensions||[]]),content:i(O1e),defined:[],document:i($1e),flow:i(JCe),lazy:{},string:i(nEe),text:i(rEe)};return r;function i(o){return a;function a(c){return hEe(r,o,c)}}}function bEe(e){for(;!e8(e););return e}const h$=/[\0\t\n\r]/g;function xEe(){let e=1,t="",n=!0,r;return i;function i(o,a,c){const d=[];let f,p,h,v,y;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),h=0,t="",n&&(o.charCodeAt(0)===65279&&h++,n=void 0);h<o.length;){if(h$.lastIndex=h,f=h$.exec(o),v=f&&f.index!==void 0?f.index:o.length,y=o.charCodeAt(v),!f){t=o.slice(h);break}if(y===10&&h===v&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),h<v&&(d.push(o.slice(h,v)),e+=v-h),y){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}h=v+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const wEe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function SEe(e){return e.replace(wEe,_Ee)}function _Ee(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return WH(n.slice(o?2:1),o?16:10)}return oR(n)||e}const a8={}.hasOwnProperty;function CEe(e,t,n){return typeof t!="string"&&(n=t,t=void 0),EEe(n)(bEe(yEe(n).document().write(xEe()(e,t,!0))))}function EEe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(tn),autolinkProtocol:L,autolinkEmail:L,atxHeading:o(gn),blockQuote:o(Ie),characterEscape:L,characterReference:L,codeFenced:o(Fe),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(Fe,a),codeText:o(Ue,a),codeTextData:L,data:L,codeFlowValue:L,definition:o(Ye),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(_t),hardBreakEscape:o(Tn),hardBreakTrailing:o(Tn),htmlFlow:o(Fn,a),htmlFlowData:L,htmlText:o(Fn,a),htmlTextData:L,image:o(hi),label:a,link:o(tn),listItem:o(oe),listItemValue:v,listOrdered:o(q,h),listUnordered:o(q),paragraph:o(de),reference:O,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(gn),strong:o(we),thematicBreak:o(Ee)},exit:{atxHeading:d(),atxHeadingSequence:A,autolink:d(),autolinkEmail:Se,autolinkProtocol:ie,blockQuote:d(),characterEscapeValue:G,characterReferenceMarkerHexadecimal:ue,characterReferenceMarkerNumeric:ue,characterReferenceValue:pe,characterReference:B,codeFenced:d(C),codeFencedFence:S,codeFencedFenceInfo:y,codeFencedFenceMeta:b,codeFlowValue:G,codeIndented:d(E),codeText:d(Z),codeTextData:G,data:G,definition:d(),definitionDestinationString:I,definitionLabelString:k,definitionTitleString:j,emphasis:d(),hardBreakEscape:d(Y),hardBreakTrailing:d(Y),htmlFlow:d(W),htmlFlowData:G,htmlText:d(F),htmlTextData:G,image:d(K),label:te,labelText:U,lineEnding:J,link:d(M),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:ee,resourceDestinationString:D,resourceTitleString:P,resource:V,setextHeading:d(z),setextHeadingLineSequence:T,setextHeadingText:N,strong:d(),thematicBreak:d()}};s8(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ne){let ye={type:"root",children:[]};const Te={stack:[ye],tokenStack:[],config:t,enter:c,exit:f,buffer:a,resume:p,data:n},Ze=[];let st=-1;for(;++st<ne.length;)if(ne[st][1].type==="listOrdered"||ne[st][1].type==="listUnordered")if(ne[st][0]==="enter")Ze.push(st);else{const qt=Ze.pop();st=i(ne,qt,st)}for(st=-1;++st<ne.length;){const qt=t[ne[st][0]];a8.call(qt,ne[st][1].type)&&qt[ne[st][1].type].call(Object.assign({sliceSerialize:ne[st][2].sliceSerialize},Te),ne[st][1])}if(Te.tokenStack.length>0){const qt=Te.tokenStack[Te.tokenStack.length-1];(qt[1]||g$).call(Te,void 0,qt[0])}for(ye.position={start:Ts(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:Ts(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},st=-1;++st<t.transforms.length;)ye=t.transforms[st](ye)||ye;return ye}function i(ne,ye,Te){let Ze=ye-1,st=-1,qt=!1,Vn,xn,Yt,Ct;for(;++Ze<=Te;){const yt=ne[Ze];switch(yt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{yt[0]==="enter"?st++:st--,Ct=void 0;break}case"lineEndingBlank":{yt[0]==="enter"&&(Vn&&!Ct&&!st&&!Yt&&(Yt=Ze),Ct=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ct=void 0}if(!st&&yt[0]==="enter"&&yt[1].type==="listItemPrefix"||st===-1&&yt[0]==="exit"&&(yt[1].type==="listUnordered"||yt[1].type==="listOrdered")){if(Vn){let Hr=Ze;for(xn=void 0;Hr--;){const rr=ne[Hr];if(rr[1].type==="lineEnding"||rr[1].type==="lineEndingBlank"){if(rr[0]==="exit")continue;xn&&(ne[xn][1].type="lineEndingBlank",qt=!0),rr[1].type="lineEnding",xn=Hr}else if(!(rr[1].type==="linePrefix"||rr[1].type==="blockQuotePrefix"||rr[1].type==="blockQuotePrefixWhitespace"||rr[1].type==="blockQuoteMarker"||rr[1].type==="listItemIndent"))break}Yt&&(!xn||Yt<xn)&&(Vn._spread=!0),Vn.end=Object.assign({},xn?ne[xn][1].start:yt[1].end),ne.splice(xn||Ze,0,["exit",Vn,yt[2]]),Ze++,Te++}if(yt[1].type==="listItemPrefix"){const Hr={type:"listItem",_spread:!1,start:Object.assign({},yt[1].start),end:void 0};Vn=Hr,ne.splice(Ze,0,["enter",Hr,yt[2]]),Ze++,Te++,Yt=void 0,Ct=!0}}}return ne[ye][1]._spread=qt,Te}function o(ne,ye){return Te;function Te(Ze){c.call(this,ne(Ze),Ze),ye&&ye.call(this,Ze)}}function a(){this.stack.push({type:"fragment",children:[]})}function c(ne,ye,Te){this.stack[this.stack.length-1].children.push(ne),this.stack.push(ne),this.tokenStack.push([ye,Te||void 0]),ne.position={start:Ts(ye.start),end:void 0}}function d(ne){return ye;function ye(Te){ne&&ne.call(this,Te),f.call(this,Te)}}function f(ne,ye){const Te=this.stack.pop(),Ze=this.tokenStack.pop();if(Ze)Ze[0].type!==ne.type&&(ye?ye.call(this,ne,Ze[0]):(Ze[1]||g$).call(this,ne,Ze[0]));else throw new Error("Cannot close `"+ne.type+"` ("+Vm({start:ne.start,end:ne.end})+"): it’s not open");Te.position.end=Ts(ne.end)}function p(){return _1e(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function v(ne){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(ne),10),this.data.expectingFirstListItemValue=void 0}}function y(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=ne}function b(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=ne}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ne.replace(/(\r?\n|\r)$/g,"")}function k(ne){const ye=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ye,Te.identifier=ld(this.sliceSerialize(ne)).toLowerCase()}function j(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.title=ne}function I(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.url=ne}function A(ne){const ye=this.stack[this.stack.length-1];if(!ye.depth){const Te=this.sliceSerialize(ne).length;ye.depth=Te}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function T(ne){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(ne).codePointAt(0)===61?1:2}function z(){this.data.setextHeadingSlurpLineEnding=void 0}function L(ne){const Te=this.stack[this.stack.length-1].children;let Ze=Te[Te.length-1];(!Ze||Ze.type!=="text")&&(Ze=ve(),Ze.position={start:Ts(ne.start),end:void 0},Te.push(Ze)),this.stack.push(Ze)}function G(ne){const ye=this.stack.pop();ye.value+=this.sliceSerialize(ne),ye.position.end=Ts(ne.end)}function J(ne){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Te=ye.children[ye.children.length-1];Te.position.end=Ts(ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ye.type)&&(L.call(this,ne),G.call(this,ne))}function Y(){this.data.atHardBreak=!0}function W(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ne}function F(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ne}function Z(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ne}function M(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=ye,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function K(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=ye,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function U(ne){const ye=this.sliceSerialize(ne),Te=this.stack[this.stack.length-2];Te.label=SEe(ye),Te.identifier=ld(ye).toLowerCase()}function te(){const ne=this.stack[this.stack.length-1],ye=this.resume(),Te=this.stack[this.stack.length-1];if(this.data.inReference=!0,Te.type==="link"){const Ze=ne.children;Te.children=Ze}else Te.alt=ye}function D(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.url=ne}function P(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.title=ne}function V(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function ee(ne){const ye=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ye,Te.identifier=ld(this.sliceSerialize(ne)).toLowerCase(),this.data.referenceType="full"}function ue(ne){this.data.characterReferenceType=ne.type}function pe(ne){const ye=this.sliceSerialize(ne),Te=this.data.characterReferenceType;let Ze;Te?(Ze=WH(ye,Te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ze=oR(ye);const st=this.stack[this.stack.length-1];st.value+=Ze}function B(ne){const ye=this.stack.pop();ye.position.end=Ts(ne.end)}function ie(ne){G.call(this,ne);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(ne)}function Se(ne){G.call(this,ne);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(ne)}function Ie(){return{type:"blockquote",children:[]}}function Fe(){return{type:"code",lang:null,meta:null,value:""}}function Ue(){return{type:"inlineCode",value:""}}function Ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function _t(){return{type:"emphasis",children:[]}}function gn(){return{type:"heading",depth:0,children:[]}}function Tn(){return{type:"break"}}function Fn(){return{type:"html",value:""}}function hi(){return{type:"image",title:null,url:"",alt:null}}function tn(){return{type:"link",title:null,url:"",children:[]}}function q(ne){return{type:"list",ordered:ne.type==="listOrdered",start:null,spread:ne._spread,children:[]}}function oe(ne){return{type:"listItem",spread:ne._spread,checked:null,children:[]}}function de(){return{type:"paragraph",children:[]}}function we(){return{type:"strong",children:[]}}function ve(){return{type:"text",value:""}}function Ee(){return{type:"thematicBreak"}}}function Ts(e){return{line:e.line,column:e.column,offset:e.offset}}function s8(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?s8(e,r):kEe(e,r)}}function kEe(e,t){let n;for(n in t)if(a8.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function g$(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Vm({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Vm({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Vm({start:t.start,end:t.end})+") is still open")}function jEe(e){const t=this;t.parser=n;function n(r){return CEe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function REe(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function IEe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
132
|
-
`}]}function NEe(e,t){const n=t.value?t.value+`
|
|
133
|
-
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function TEe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function AEe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function OEe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=cf(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+1,c+=1,e.footnoteCounts.set(r,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function DEe(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $Ee(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function l8(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function MEe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return l8(e,t);const i={src:cf(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function PEe(e,t){const n={src:cf(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function zEe(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function LEe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return l8(e,t);const i={href:cf(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function UEe(e,t){const n={href:cf(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function FEe(e,t,n){const r=e.all(t),i=n?VEe(n):c8(t),o={},a=[];if(typeof t.checked=="boolean"){const p=r[0];let h;p&&p.type==="element"&&p.tagName==="p"?h=p:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const p=r[c];(i||c!==0||p.type!=="element"||p.tagName!=="p")&&a.push({type:"text",value:`
|
|
134
|
-
`}),p.type==="element"&&p.tagName==="p"&&!i?a.push(...p.children):a.push(p)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
|
|
135
|
-
`});const f={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,f),e.applyData(t,f)}function VEe(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=c8(n[r])}return t}function c8(e){const t=e.spread;return t??e.children.length>1}function BEe(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function HEe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qEe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function GEe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function KEe(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=tR(t.children[1]),d=BH(t.children[t.children.length-1]);c&&d&&(a.position={start:c,end:d}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function ZEe(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,c=a?a.length:t.children.length;let d=-1;const f=[];for(;++d<c;){const h=t.children[d],v={},y=a?a[d]:void 0;y&&(v.align=y);let b={type:"element",tagName:o,properties:v,children:[]};h&&(b.children=e.all(h),e.patch(h,b),b=e.applyData(h,b)),f.push(b)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function YEe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const v$=9,y$=32;function WEe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(b$(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(b$(t.slice(i),i>0,!1)),o.join("")}function b$(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===v$||o===y$;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===v$||o===y$;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function XEe(e,t){const n={type:"text",value:WEe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function QEe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const JEe={blockquote:REe,break:IEe,code:NEe,delete:TEe,emphasis:AEe,footnoteReference:OEe,heading:DEe,html:$Ee,imageReference:MEe,image:PEe,inlineCode:zEe,linkReference:LEe,link:UEe,listItem:FEe,list:BEe,paragraph:HEe,root:qEe,strong:GEe,table:KEe,tableCell:YEe,tableRow:ZEe,text:XEe,thematicBreak:QEe,toml:iv,yaml:iv,definition:iv,footnoteDefinition:iv};function iv(){}const u8=-1,Sx=0,Hm=1,ky=2,lR=3,cR=4,uR=5,dR=6,d8=7,f8=8,x$=typeof self=="object"?self:globalThis,eke=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,a]=t[i];switch(o){case Sx:case u8:return n(a,i);case Hm:{const c=n([],i);for(const d of a)c.push(r(d));return c}case ky:{const c=n({},i);for(const[d,f]of a)c[r(d)]=r(f);return c}case lR:return n(new Date(a),i);case cR:{const{source:c,flags:d}=a;return n(new RegExp(c,d),i)}case uR:{const c=n(new Map,i);for(const[d,f]of a)c.set(r(d),r(f));return c}case dR:{const c=n(new Set,i);for(const d of a)c.add(r(d));return c}case d8:{const{name:c,message:d}=a;return n(new x$[c](d),i)}case f8:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:c}=new Uint8Array(a);return n(new DataView(c),a)}}return n(new x$[o](a),i)};return r},w$=e=>eke(new Map,e)(0),Fu="",{toString:tke}={},{keys:nke}=Object,_m=e=>{const t=typeof e;if(t!=="object"||!e)return[Sx,t];const n=tke.call(e).slice(8,-1);switch(n){case"Array":return[Hm,Fu];case"Object":return[ky,Fu];case"Date":return[lR,Fu];case"RegExp":return[cR,Fu];case"Map":return[uR,Fu];case"Set":return[dR,Fu];case"DataView":return[Hm,n]}return n.includes("Array")?[Hm,n]:n.includes("Error")?[d8,n]:[ky,n]},ov=([e,t])=>e===Sx&&(t==="function"||t==="symbol"),rke=(e,t,n,r)=>{const i=(a,c)=>{const d=r.push(a)-1;return n.set(c,d),d},o=a=>{if(n.has(a))return n.get(a);let[c,d]=_m(a);switch(c){case Sx:{let p=a;switch(d){case"bigint":c=f8,p=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return i([u8],a)}return i([c,p],a)}case Hm:{if(d){let v=a;return d==="DataView"?v=new Uint8Array(a.buffer):d==="ArrayBuffer"&&(v=new Uint8Array(a)),i([d,[...v]],a)}const p=[],h=i([c,p],a);for(const v of a)p.push(o(v));return h}case ky:{if(d)switch(d){case"BigInt":return i([d,a.toString()],a);case"Boolean":case"Number":case"String":return i([d,a.valueOf()],a)}if(t&&"toJSON"in a)return o(a.toJSON());const p=[],h=i([c,p],a);for(const v of nke(a))(e||!ov(_m(a[v])))&&p.push([o(v),o(a[v])]);return h}case lR:return i([c,a.toISOString()],a);case cR:{const{source:p,flags:h}=a;return i([c,{source:p,flags:h}],a)}case uR:{const p=[],h=i([c,p],a);for(const[v,y]of a)(e||!(ov(_m(v))||ov(_m(y))))&&p.push([o(v),o(y)]);return h}case dR:{const p=[],h=i([c,p],a);for(const v of a)(e||!ov(_m(v)))&&p.push(o(v));return h}}const{message:f}=a;return i([c,{name:d,message:f}],a)};return o},S$=(e,{json:t,lossy:n}={})=>{const r=[];return rke(!(t||n),!!t,new Map,r)(e),r},jy=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?w$(S$(e,t)):structuredClone(e):(e,t)=>w$(S$(e,t));function ike(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function oke(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function ake(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||ike,r=e.options.footnoteBackLabel||oke,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[d]);if(!f)continue;const p=e.all(f),h=String(f.identifier).toUpperCase(),v=cf(h.toLowerCase());let y=0;const b=[],S=e.footnoteCounts.get(h);for(;S!==void 0&&++y<=S;){b.length>0&&b.push({type:"text",value:" "});let k=typeof n=="string"?n:n(d,y);typeof k=="string"&&(k={type:"text",value:k}),b.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,y),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const C=p[p.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const k=C.children[C.children.length-1];k&&k.type==="text"?k.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...b)}else p.push(...b);const E={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(p,!0)};e.patch(f,E),c.push(E)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...jy(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
136
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
137
|
-
`}]}}const m8=(function(e){if(e==null)return uke;if(typeof e=="function")return _x(e);if(typeof e=="object")return Array.isArray(e)?ske(e):lke(e);if(typeof e=="string")return cke(e);throw new Error("Expected function, string, or object as test")});function ske(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=m8(e[n]);return _x(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function lke(e){const t=e;return _x(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function cke(e){return _x(t);function t(n){return n&&n.type===e}}function _x(e){return t;function t(n,r,i){return!!(dke(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function uke(){return!0}function dke(e){return e!==null&&typeof e=="object"&&"type"in e}const p8=[],fke=!0,_$=!1,mke="skip";function pke(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=m8(i),a=r?-1:1;c(e,void 0,[])();function c(d,f,p){const h=d&&typeof d=="object"?d:{};if(typeof h.type=="string"){const y=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(d.type+(y?"<"+y+">":""))+")"})}return v;function v(){let y=p8,b,S,C;if((!t||o(d,f,p[p.length-1]||void 0))&&(y=hke(n(d,p)),y[0]===_$))return y;if("children"in d&&d.children){const E=d;if(E.children&&y[0]!==mke)for(S=(r?E.children.length:-1)+a,C=p.concat(E);S>-1&&S<E.children.length;){const k=E.children[S];if(b=c(k,S,C)(),b[0]===_$)return b;S=typeof b[1]=="number"?b[1]:S+a}}return y}}}function hke(e){return Array.isArray(e)?e:typeof e=="number"?[fke,e]:e==null?p8:[e]}function h8(e,t,n,r){let i,o,a;typeof t=="function"&&typeof n!="function"?(o=void 0,a=t,i=n):(o=t,a=n,i=r),pke(e,o,c,i);function c(d,f){const p=f[f.length-1],h=p?p.children.indexOf(d):void 0;return a(d,h,p)}}const oC={}.hasOwnProperty,gke={};function vke(e,t){const n=t||gke,r=new Map,i=new Map,o=new Map,a={...JEe,...n.handlers},c={all:f,applyData:bke,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:d,options:n,patch:yke,wrap:wke};return h8(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const h=p.type==="definition"?r:i,v=String(p.identifier).toUpperCase();h.has(v)||h.set(v,p)}}),c;function d(p,h){const v=p.type,y=c.handlers[v];if(oC.call(c.handlers,v)&&y)return y(c,p,h);if(c.options.passThrough&&c.options.passThrough.includes(v)){if("children"in p){const{children:S,...C}=p,E=jy(C);return E.children=c.all(p),E}return jy(p)}return(c.options.unknownHandler||xke)(c,p,h)}function f(p){const h=[];if("children"in p){const v=p.children;let y=-1;for(;++y<v.length;){const b=c.one(v[y],p);if(b){if(y&&v[y-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=C$(b.value)),!Array.isArray(b)&&b.type==="element")){const S=b.children[0];S&&S.type==="text"&&(S.value=C$(S.value))}Array.isArray(b)?h.push(...b):h.push(b)}}}return h}}function yke(e,t){e.position&&(t.position=t1e(e))}function bke(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&o&&Object.assign(n.properties,jy(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function xke(e,t){const n=t.data||{},r="value"in t&&!(oC.call(n,"hProperties")||oC.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function wke(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
138
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
139
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
140
|
-
`}),n}function C$(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function E$(e,t){const n=vke(e,t),r=n.one(e,void 0),i=ake(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
|
141
|
-
`},i),o}function Ske(e,t){return e&&"run"in e?async function(n,r){const i=E$(n,{file:r,...t});await e.run(i,r)}:function(n,r){return E$(n,{file:r,...e||t})}}function k$(e){if(e)throw e}var f_,j$;function _ke(){if(j$)return f_;j$=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},o=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),h=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!h)return!1;var v;for(v in f);return typeof v>"u"||e.call(f,v)},a=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},c=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return f_=function d(){var f,p,h,v,y,b,S=arguments[0],C=1,E=arguments.length,k=!1;for(typeof S=="boolean"&&(k=S,S=arguments[1]||{},C=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});C<E;++C)if(f=arguments[C],f!=null)for(p in f)h=c(S,p),v=c(f,p),S!==v&&(k&&v&&(o(v)||(y=i(v)))?(y?(y=!1,b=h&&i(h)?h:[]):b=h&&o(h)?h:{},a(S,{name:p,newValue:d(k,b,v)})):typeof v<"u"&&a(S,{name:p,newValue:v}));return S},f_}var Cke=_ke();const m_=mp(Cke);function aC(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Eke(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);c(null,...i);function c(d,...f){const p=e[++o];let h=-1;if(d){a(d);return}for(;++h<i.length;)(f[h]===null||f[h]===void 0)&&(f[h]=i[h]);i=f,p?kke(p,c)(...f):a(null,...f)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function kke(e,t){let n;return r;function r(...a){const c=e.length>a.length;let d;c&&a.push(i);try{d=e.apply(this,a)}catch(f){const p=f;if(c&&n)throw p;return i(p)}c||(d&&d.then&&typeof d.then=="function"?d.then(o,i):d instanceof Error?i(d):o(d))}function i(a,...c){n||(n=!0,t(a,...c))}function o(a){i(null,a)}}const Wo={basename:jke,dirname:Rke,extname:Ike,join:Nke,sep:"/"};function jke(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');sh(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,c=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),c>-1&&(e.codePointAt(i)===t.codePointAt(c--)?c<0&&(r=i):(c=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function Rke(e){if(sh(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Ike(e){sh(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const c=e.codePointAt(t);if(c===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),c===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Nke(...e){let t=-1,n;for(;++t<e.length;)sh(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Tke(n)}function Tke(e){sh(e);const t=e.codePointAt(0)===47;let n=Ake(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Ake(e,t){let n="",r=0,i=-1,o=0,a=-1,c,d;for(;++a<=e.length;){if(a<e.length)c=e.codePointAt(a);else{if(c===47)break;c=47}if(c===47){if(!(i===a-1||o===1))if(i!==a-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else c===46&&o>-1?o++:o=-1}return n}function sh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Oke={cwd:Dke};function Dke(){return"/"}function sC(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function $ke(e){if(typeof e=="string")e=new URL(e);else if(!sC(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Mke(e)}function Mke(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const p_=["history","path","basename","stem","extname","dirname"];class g8{constructor(t){let n;t?sC(t)?n={path:t}:typeof t=="string"||Pke(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Oke.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<p_.length;){const o=p_[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)p_.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Wo.basename(this.path):void 0}set basename(t){g_(t,"basename"),h_(t,"basename"),this.path=Wo.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Wo.dirname(this.path):void 0}set dirname(t){R$(this.basename,"dirname"),this.path=Wo.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Wo.extname(this.path):void 0}set extname(t){if(h_(t,"extname"),R$(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Wo.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){sC(t)&&(t=$ke(t)),g_(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Wo.basename(this.path,this.extname):void 0}set stem(t){g_(t,"stem"),h_(t,"stem"),this.path=Wo.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Ir(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function h_(e,t){if(e&&e.includes(Wo.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Wo.sep+"`")}function g_(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function R$(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Pke(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const zke=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),Lke={}.hasOwnProperty;class fR extends zke{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Eke()}copy(){const t=new fR;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(m_(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(b_("data",this.frozen),this.namespace[t]=n,this):Lke.call(this.namespace,t)&&this.namespace[t]||void 0:t?(b_("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=av(t),r=this.parser||this.Parser;return v_("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),v_("process",this.parser||this.Parser),y_("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,a){const c=av(t),d=r.parse(c);r.run(d,c,function(p,h,v){if(p||!h||!v)return f(p);const y=h,b=r.stringify(y,v);Vke(b)?v.value=b:v.result=b,f(p,v)});function f(p,h){p||!h?a(p):o?o(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),v_("processSync",this.parser||this.Parser),y_("processSync",this.compiler||this.Compiler),this.process(t,i),N$("processSync","process",n),r;function i(o,a){n=!0,k$(o),r=a}}run(t,n,r){I$(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(a,c){const d=av(n);i.run(t,d,f);function f(p,h,v){const y=h||t;p?c(p):a?a(y):r(void 0,y,v)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),N$("runSync","run",r),i;function o(a,c){k$(a),i=c,r=!0}}stringify(t,n){this.freeze();const r=av(n),i=this.compiler||this.Compiler;return y_("stringify",i),I$(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(b_("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...h]=f;d(p,h)}else a(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function a(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(f.plugins),f.settings&&(i.settings=m_(!0,i.settings,f.settings))}function c(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const h=f[p];o(h)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,p){let h=-1,v=-1;for(;++h<r.length;)if(r[h][0]===f){v=h;break}if(v===-1)r.push([f,...p]);else if(p.length>0){let[y,...b]=p;const S=r[v][1];aC(S)&&aC(y)&&(y=m_(!0,S,y)),r[v]=[f,y,...b]}}}}const Uke=new fR().freeze();function v_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function y_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function b_(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function I$(e){if(!aC(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function N$(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function av(e){return Fke(e)?e:new g8(e)}function Fke(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Vke(e){return typeof e=="string"||Bke(e)}function Bke(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Hke="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",T$=[],A$={allowDangerousHtml:!0},qke=/^(https?|ircs?|mailto|xmpp)$/i,Gke=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Kke(e){const t=Zke(e),n=Yke(e);return Wke(t.runSync(t.parse(n),n),e)}function Zke(e){const t=e.rehypePlugins||T$,n=e.remarkPlugins||T$,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...A$}:A$;return Uke().use(jEe).use(n).use(Ske,r).use(t)}function Yke(e){const t=e.children||"",n=new g8;return typeof t=="string"&&(n.value=t),n}function Wke(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,a=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||Xke;for(const p of Gke)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+Hke+p.id,void 0);return h8(e,f),a1e(e,{Fragment:u.Fragment,components:i,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function f(p,h,v){if(p.type==="raw"&&v&&typeof h=="number")return a?v.children.splice(h,1):v.children[h]={type:"text",value:p.value},h;if(p.type==="element"){let y;for(y in c_)if(Object.hasOwn(c_,y)&&Object.hasOwn(p.properties,y)){const b=p.properties[y],S=c_[y];(S===null||S.includes(p.tagName))&&(p.properties[y]=d(String(b||""),y,p))}}if(p.type==="element"){let y=n?!n.includes(p.tagName):o?o.includes(p.tagName):!1;if(!y&&r&&typeof h=="number"&&(y=!r(p,h,v)),y&&v&&typeof h=="number")return c&&p.children?v.children.splice(h,1,...p.children):v.children.splice(h,1),h}}}function Xke(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||qke.test(e.slice(0,t))?e:""}var Qke="Separator",O$="horizontal",Jke=["horizontal","vertical"],v8=x.forwardRef((e,t)=>{const{decorative:n,orientation:r=O$,...i}=e,o=eje(r)?r:O$,c=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return u.jsx(dU.div,{"data-orientation":o,...c,...i,ref:t})});v8.displayName=Qke;function eje(e){return Jke.includes(e)}var tje=v8;function Cx({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return u.jsx(tje,{"data-slot":"separator-root",decorative:n,orientation:t,className:Pe("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}var Ex="Tabs",[nje]=Pi(Ex,[nf]),y8=nf(),[rje,mR]=nje(Ex),b8=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",dir:c,activationMode:d="automatic",...f}=e,p=Tc(c),[h,v]=Do({prop:r,onChange:i,defaultProp:o??"",caller:Ex});return u.jsx(rje,{scope:n,baseId:Ni(),value:h,onValueChange:v,orientation:a,dir:p,activationMode:d,children:u.jsx(Ke.div,{dir:p,"data-orientation":a,...f,ref:t})})});b8.displayName=Ex;var x8="TabsList",w8=x.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=mR(x8,n),a=y8(n);return u.jsx(Aj,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:u.jsx(Ke.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});w8.displayName=x8;var S8="TabsTrigger",_8=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,a=mR(S8,n),c=y8(n),d=k8(a.baseId,r),f=j8(a.baseId,r),p=r===a.value;return u.jsx(Oj,{asChild:!0,...c,focusable:!i,active:p,children:u.jsx(Ke.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:d,...o,ref:t,onMouseDown:je(e.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?a.onValueChange(r):h.preventDefault()}),onKeyDown:je(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&a.onValueChange(r)}),onFocus:je(e.onFocus,()=>{const h=a.activationMode!=="manual";!p&&!i&&h&&a.onValueChange(r)})})})});_8.displayName=S8;var C8="TabsContent",E8=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...a}=e,c=mR(C8,n),d=k8(c.baseId,r),f=j8(c.baseId,r),p=r===c.value,h=x.useRef(p);return x.useEffect(()=>{const v=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(v)},[]),u.jsx(Wn,{present:i||p,children:({present:v})=>u.jsx(Ke.div,{"data-state":p?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!v,id:f,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:v&&o})})});E8.displayName=C8;function k8(e,t){return`${e}-trigger-${t}`}function j8(e,t){return`${e}-content-${t}`}var ije=b8,oje=w8,aje=_8,sje=E8;function lC({className:e,...t}){return u.jsx(ije,{"data-slot":"tabs",className:Pe("flex flex-col gap-2",e),...t})}function cC({className:e,...t}){return u.jsx(oje,{"data-slot":"tabs-list",className:Pe("text-muted-foreground inline-flex w-fit items-center justify-center rounded-full bg-gray-950 p-1",e),...t})}function $s({className:e,...t}){return u.jsx(aje,{"data-slot":"tabs-trigger",className:Pe("data-[state=active]:text-white data-[state=active]:bg-gray-600 dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring focus-visible:ring-[3px] focus-visible:outline-1 text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 border rounded-full border-transparent px-2 py-1 font-medium whitespace-nowrap transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function Ms({className:e,...t}){return u.jsx(sje,{"data-slot":"tabs-content",className:Pe("flex-1 outline-none",e),...t})}function R8(e,t,n){for(const r of e)if(r[t]===n)return r}const lje=Zy("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function pR({className:e,variant:t,...n}){return u.jsx("div",{"data-slot":"alert",role:"alert",className:Pe(lje({variant:t}),e),...n})}function cje({className:e,...t}){return u.jsx("div",{"data-slot":"alert-title",className:Pe("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function hR({className:e,...t}){return u.jsx("div",{"data-slot":"alert-description",className:Pe("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function uje(e){const{user:t}=Ja(),n=hb(),{instance:r,cluster:i}=xp({strict:!1}),o=n.instanceClient.defaults.baseURL;return x.useMemo(()=>{const a=ox(e);return[{title:"Install Harper CLI",code:"npm install -g harperdb"},{title:"Clone Template",code:`git clone https://github.com/HarperFast/application-template.git ${a}
|
|
142
|
-
cd ${a}`},{title:"Start Local Harper Instance",code:"npm run dev",alert:"You will be prompted to configure your instance"},{title:"Make Changes!",code:"pico schema.graphql"},{title:"Configure your .env file",code:`npm run login ${t?.username}@${o}`,note:"Your credentials are your own! Remember to exclude the .env file from source control."},{title:"Deploy Application",code:"npm run deploy"}]},[e,o,t?.username])}function dje({defaultApplicationName:e,formState:t,watch:n}){const r=n("applicationName")||e,i=uje(r),o=uB(...i.map(a=>a.code));return u.jsxs(u.Fragment,{children:[u.jsxs(ul,{children:[u.jsx(dl,{children:"Deploy with Harper CLI"}),u.jsx(Cc,{children:"Follow these steps to deploy your application using the Harper CLI"})]}),u.jsxs(es,{className:"space-y-6",children:[i.map((a,c)=>u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"w-6 h-6 rounded-full bg-primary text-primary-foreground flex items-center justify-center shrink-0",children:c+1}),u.jsx("h3",{children:a.title})]}),u.jsxs("div",{className:"ml-8",children:[u.jsxs("div",{className:"bg-black rounded-lg p-4 flex items-center justify-between group",children:[u.jsx("code",{className:"text-sm whitespace-pre truncate max-w-[calc(100vw-theme(spacing.48))]",children:a.code}),u.jsx(be,{type:"button",variant:"default",size:"sm",onClick:o[c],children:u.jsx(TP,{className:"w-4 h-4"})})]}),a.note&&u.jsx("p",{className:"text-muted-foreground text-sm mt-2",children:a.note}),a.alert&&u.jsxs(pR,{className:"mt-2",children:[u.jsx(UC,{className:"w-4 h-4"}),u.jsx(hR,{children:a.alert})]})]}),u.jsx(Cx,{className:"bg-black"})]},a.title)),r&&u.jsxs("div",{className:"bg-accent rounded-lg p-4",children:[u.jsxs("p",{className:"text-sm",children:[u.jsx("strong",{children:"Application Name:"})," ",r]}),u.jsx("p",{className:"text-muted-foreground text-sm mt-2",children:"Your application will be deployed with this name"})]}),u.jsxs(be,{className:"w-full",variant:"secondary",disabled:!t.isValid,children:[u.jsx(MC,{className:"w-4 h-4 mr-2"}),"I Have Completed These Steps"]})]})]})}function fje({control:e,defaultApplicationName:t}){return u.jsxs(u.Fragment,{children:[u.jsxs(ul,{children:[u.jsx(dl,{children:"Application Name"}),u.jsx(Cc,{children:"Choose a name for your new API application"})]}),u.jsx(es,{children:u.jsxs("div",{className:"space-y-2",children:[u.jsx(Me,{control:e,name:"applicationName",render:({field:n})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Name"}),u.jsx($e,{children:u.jsx(ze,{type:"text",autoCapitalize:"words",autoComplete:"off",autoFocus:!0,placeholder:t,...n})}),u.jsx(De,{})]})}),u.jsx("p",{className:"text-muted-foreground text-sm",children:"Use lowercase letters, numbers, underscores, and hyphens"})]})})]})}function mje({control:e,formState:t,isImportingApplication:n,setValue:r,watch:i}){const o=i("contents.source"),a=x.useCallback(c=>{r("contents.source",c)},[r]);return u.jsxs(u.Fragment,{children:[u.jsxs(ul,{children:[u.jsx(dl,{children:"Import Existing Application"}),u.jsx(Cc,{children:"Import from Git, NPM, or a tarball URL"})]}),u.jsxs(es,{className:"space-y-6",children:[u.jsxs(lC,{value:o,onValueChange:a,children:[u.jsxs(cC,{className:"grid w-full grid-cols-3",children:[u.jsxs($s,{value:"git",children:[u.jsx(zC,{className:"w-4 h-4 mr-2"}),"Git"]}),u.jsxs($s,{value:"npm",children:[u.jsx(LC,{className:"w-4 h-4 mr-2"}),"NPM"]}),u.jsxs($s,{value:"tarball",children:[u.jsx(tQ,{className:"w-4 h-4 mr-2"}),"Tarball"]})]}),u.jsx(Ms,{value:"git",className:"space-y-4 mt-4",children:u.jsx("div",{className:"space-y-2",children:u.jsx(Me,{control:e,name:"contents.ref",render:({field:c})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Git Repository URL"}),u.jsx($e,{children:u.jsx(ze,{type:"text",autoCapitalize:"none",autoComplete:"off",autoFocus:!0,...c})}),u.jsx(De,{})]})})})}),u.jsx(Ms,{value:"npm",className:"space-y-4 mt-4",children:u.jsx("div",{className:"space-y-2",children:u.jsx(Me,{control:e,name:"contents.ref",render:({field:c})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"NPM Package Reference"}),u.jsx($e,{children:u.jsx(ze,{type:"text",autoCapitalize:"none",autoComplete:"off",autoFocus:!0,...c})}),u.jsx(De,{})]})})})}),u.jsx(Ms,{value:"tarball",className:"space-y-4 mt-4",children:u.jsx("div",{className:"space-y-2",children:u.jsx(Me,{control:e,name:"contents.ref",render:({field:c})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Tarball URL"}),u.jsx($e,{children:u.jsx(ze,{type:"url",autoCapitalize:"none",autoComplete:"off",autoFocus:!0,...c})}),u.jsx(De,{})]})})})})]}),u.jsx(Me,{control:e,name:"contents.installCommand",render:({field:c})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Install Command"}),u.jsx($e,{children:u.jsx(ze,{type:"text",autoCapitalize:"none",autoComplete:"off",placeholder:"npm install",...c})}),u.jsx(De,{})]})}),u.jsx(Oe,{children:"Authorization"}),u.jsx(Me,{control:e,name:"contents.requiresAuth",render:({field:c})=>u.jsxs(lC,{className:"w-full pt-2 pb-0 mb-0",value:String(c.value),onValueChange:d=>c.onChange(d==="true"),children:[u.jsxs(cC,{className:"grid w-full grid-cols-2",children:[u.jsx($s,{value:"false",children:"Public Access"}),u.jsx($s,{value:"true",children:"Requires Auth"})]}),u.jsx(Ms,{value:"false",className:"space-y-4 mt-4"}),u.jsx(Ms,{value:"true",className:"space-y-4 mt-4",children:u.jsx(pR,{children:u.jsx(hR,{children:u.jsxs("span",{children:["You can manage your certificates over in ",u.jsx(Ge,{to:"config",className:"underline",children:"Config"})," > ",u.jsx(Ge,{to:"config/ssh-keys",className:"underline",children:"SSH Keys"}),". This enables SSH based auth for private repos, i.e. following the pattern of ",u.jsx("a",{href:"https://github.com/HarperFast/Studio",target:"_blank",className:"underline",children:"git@github.com:HarperFast/studio.git"}),". If you have more than one key, make sure to utilize unique hostnames!"]})})})})]})}),u.jsx(Cx,{className:"bg-black"}),u.jsxs(be,{className:"w-full",disabled:!t.isValid||n,children:[u.jsx(UP,{className:"w-4 h-4 mr-2"}),"Import Application"]})]})]})}const gR=[{id:"harper",name:"Web + REST ORM",description:"Define your entities in schema.graphql, add your HTML/CSS/JS in web, and you're cooking!",tags:["Harper","ORM","REST","GraphQL"],githubUrl:"https://github.com/HarperFast/application-template/tree/fabric"},{id:"harper-ts",name:"TypeScript",description:"The same Web + REST ORM from the first template, but with TypeScript sprinkled in.",tags:["Harper","TypeScript","GraphQL"],githubUrl:"https://github.com/HarperFast/application-template/tree/fabric-typescript"}],pje=mn({type:Yb("template"),id:nt("Please select a template.")}),hje={type:"template",id:gR[0].id},gje=mn({type:Yb("import"),source:ef(["git","npm","tarball"]),ref:nt().nonempty("Please enter a URL or package reference."),installCommand:nt(),requiresAuth:jd()}),vje={type:"import",source:"git",ref:"",requiresAuth:!1,installCommand:""},yje=mn({type:Yb("cli")}),bje={type:"cli"},xje=mn({applicationName:nt().trim().max(75,{error:"Application name cannot be longer than 75 characters."}).regex(/^[a-zA-Z0-9-_]*$/,{error:"Can only contain letters, numbers, dashes and underscores."}),contents:v5("type",[pje,gje,yje])});var vR="Radio",[wje,I8]=Pi(vR),[Sje,_je]=wje(vR),N8=x.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:o,disabled:a,value:c="on",onCheck:d,form:f,...p}=e,[h,v]=x.useState(null),y=ut(t,C=>v(C)),b=x.useRef(!1),S=h?f||!!h.closest("form"):!0;return u.jsxs(Sje,{scope:n,checked:i,disabled:a,children:[u.jsx(Ke.button,{type:"button",role:"radio","aria-checked":i,"data-state":D8(i),"data-disabled":a?"":void 0,disabled:a,value:c,...p,ref:y,onClick:je(e.onClick,C=>{i||d?.(),S&&(b.current=C.isPropagationStopped(),b.current||C.stopPropagation())})}),S&&u.jsx(O8,{control:h,bubbles:!b.current,name:r,value:c,checked:i,required:o,disabled:a,form:f,style:{transform:"translateX(-100%)"}})]})});N8.displayName=vR;var T8="RadioIndicator",A8=x.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...i}=e,o=_je(T8,n);return u.jsx(Wn,{present:r||o.checked,children:u.jsx(Ke.span,{"data-state":D8(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:t})})});A8.displayName=T8;var Cje="RadioBubbleInput",O8=x.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...i},o)=>{const a=x.useRef(null),c=ut(a,o),d=aE(n),f=TL(t);return x.useEffect(()=>{const p=a.current;if(!p)return;const h=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(h,"checked").set;if(d!==n&&y){const b=new Event("click",{bubbles:r});y.call(p,n),p.dispatchEvent(b)}},[d,n,r]),u.jsx(Ke.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:c,style:{...i.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});O8.displayName=Cje;function D8(e){return e?"checked":"unchecked"}var Eje=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],kx="RadioGroup",[kje]=Pi(kx,[nf,I8]),$8=nf(),M8=I8(),[jje,Rje]=kje(kx),P8=x.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:o,required:a=!1,disabled:c=!1,orientation:d,dir:f,loop:p=!0,onValueChange:h,...v}=e,y=$8(n),b=Tc(f),[S,C]=Do({prop:o,defaultProp:i??null,onChange:h,caller:kx});return u.jsx(jje,{scope:n,name:r,required:a,disabled:c,value:S,onValueChange:C,children:u.jsx(Aj,{asChild:!0,...y,orientation:d,dir:b,loop:p,children:u.jsx(Ke.div,{role:"radiogroup","aria-required":a,"aria-orientation":d,"data-disabled":c?"":void 0,dir:b,...v,ref:t})})})});P8.displayName=kx;var z8="RadioGroupItem",L8=x.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...i}=e,o=Rje(z8,n),a=o.disabled||r,c=$8(n),d=M8(n),f=x.useRef(null),p=ut(t,f),h=o.value===i.value,v=x.useRef(!1);return x.useEffect(()=>{const y=S=>{Eje.includes(S.key)&&(v.current=!0)},b=()=>v.current=!1;return document.addEventListener("keydown",y),document.addEventListener("keyup",b),()=>{document.removeEventListener("keydown",y),document.removeEventListener("keyup",b)}},[]),u.jsx(Oj,{asChild:!0,...c,focusable:!a,active:h,children:u.jsx(N8,{disabled:a,required:o.required,checked:h,...d,...i,name:o.name,ref:p,onCheck:()=>o.onValueChange(i.value),onKeyDown:je(y=>{y.key==="Enter"&&y.preventDefault()}),onFocus:je(i.onFocus,()=>{v.current&&f.current?.click()})})})});L8.displayName=z8;var Ije="RadioGroupIndicator",U8=x.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,i=M8(n);return u.jsx(A8,{...i,...r,ref:t})});U8.displayName=Ije;var Nje=P8,Tje=L8,Aje=U8;function Oje({className:e,...t}){return u.jsx(Nje,{"data-slot":"radio-group",className:Pe("grid gap-3",e),...t})}function Dje({className:e,...t}){return u.jsx(Tje,{"data-slot":"radio-group-item",className:Pe("border-input text-primary 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 dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:u.jsx(Aje,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:u.jsx(NP,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function F8(e){e.stopPropagation()}function $je({control:e,formState:t,isCreatingFromTemplate:n}){return u.jsxs(u.Fragment,{children:[u.jsxs(ul,{children:[u.jsx(dl,{children:"Choose a Template"}),u.jsx(Cc,{children:"Start with a pre-configured template for common use cases"})]}),u.jsxs(es,{children:[u.jsx(Me,{control:e,name:"contents.id",render:({field:r})=>u.jsx(Oje,{value:r.value,onValueChange:r.onChange,children:u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:gR.map(i=>u.jsxs("div",{className:"relative",children:[u.jsx(Dje,{value:i.id,id:i.id,className:"peer sr-only"}),u.jsxs(Pp,{htmlFor:i.id,className:"flex flex-col gap-3 p-4 border-2 rounded-lg cursor-pointer hover:bg-accent peer-data-[state=checked]:border-green peer-data-[state=checked]:bg-primary/5",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[u.jsx("span",{children:i.name}),u.jsx("a",{href:i.githubUrl,target:"_blank",rel:"noopener noreferrer",onClick:F8,className:"text-muted-foreground hover:text-white transition-colors -m-4 p-4",children:u.jsx(zC,{className:"w-4 h-4"})})]}),u.jsx("p",{className:"text-muted-foreground text-sm",children:i.description})]}),u.jsx("div",{className:"flex flex-wrap gap-2",children:i.tags.map(o=>u.jsx(zo,{variant:"outline",children:o},o))})]})]},i.id))})})}),u.jsx(Cx,{className:"my-6 bg-black"}),u.jsxs(be,{className:"w-full",disabled:!t.isValid||n,children:[u.jsx(UP,{className:"w-4 h-4 mr-2"}),"Create from Template"]})]})]})}function Mje(e){const t=hb(),{reloadRootEntries:n,setFocusedItem:r,setExpandedItems:i,setSelectedItems:o}=mi(),a=x.useCallback(({project:c})=>{const d=_e.loading("Looking for application...",{description:"This may take a bit.",duration:3e5});e(!0),n().then(f=>{const p=f?.entries||[];for(const h of p)if(h.name.toLowerCase()===c.toLowerCase()){r(h.name),o([h.name]),i([h.name]),e(!1),_e.success("Imported successfully",{description:`${c} is now available in your ${t.entityType}!`,id:d,duration:5e3});return}_e.warning("Deployment Not Detected",{description:`I searched for ${c} but did not find it in the ${t.entityType} yet. Do you see it on the left? Did you use a different name, perhaps?`,id:d,duration:1e4}),e(!1)})},[t,e,n,r,i,o]);return x.useMemo(()=>({checkCLI:a}),[a])}async function Pje({instanceClient:e,project:t,template:n,entityType:r}){const{data:i}=await e.post("/",{operation:"add_component",project:t,template:n,replicated:r==="cluster"});return i}function zje(){return at({mutationFn:Pje})}function Lje(e){const{mutate:t,isPending:n}=zje(),r=hb(),{reloadRootEntries:i,setFocusedItem:o,setExpandedItems:a,setSelectedItems:c}=mi(),d=x.useCallback(({contents:f,project:p})=>{const h=_e.loading("Creating from template...",{description:"This may take a bit.",duration:3e5}),v=R8(gR,"id",f.id);if(!v)return _e.error("Template Not Found",{description:"Please select a template",duration:1e4,id:h});t({project:p,template:v.githubUrl,...r},{onSuccess:()=>{_e.success("Created successfully!",{description:`${p} will be available once you restart your ${r.entityType}!`,id:h,duration:5e3}),e(!0),i(),o(p),c([p]),a([p])}})},[t,r,e,i,o,a,c]);return x.useMemo(()=>({isCreatingFromTemplate:n,createFromTemplate:d}),[n,d])}async function Uje({applicationName:e,applicationUrl:t,installCommand:n,entityType:r,instanceClient:i}){const{data:o}=await i.post("/",{operation:"deploy_component",package:t,project:e,replicated:r==="cluster",install_command:n||void 0,restart:"rolling"},{timeout:3e5});return o}function V8(){return at({mutationFn:Uje})}function Fje(e){const{mutate:t,isPending:n}=V8(),r=gr(),i=Ft(),{reloadRootEntries:o,setFocusedItem:a,setExpandedItems:c,setSelectedItems:d}=mi(),f=x.useCallback(({contents:p,project:h})=>{const v=_e.loading("Importing application...",{description:"This may take a bit.",duration:3e5});t({applicationName:h,applicationUrl:p.ref,installCommand:p.installCommand,...i},{onSuccess:()=>{_e.success("Imported successfully",{description:`${h} will be available once you restart your ${i.entityType}!`,id:v,duration:5e3}),e(!0),r.invalidateQueries({queryKey:[i.entityId]}),o(),a(h),d([h]),c([h])},onError:()=>{_e.dismiss(v)}})},[t,r,i,e,o,a,c,d]);return x.useMemo(()=>({isImportingApplication:n,importApplication:f}),[n,f])}function Vje(){const{rootEntries:e}=mi(),{organization:t,instance:n,cluster:r}=xp({strict:!1}),i=x.useMemo(()=>{const T=ox(r?.name||n?.name||t?.name||"");if(T==="")return T;let z=T,L=1;for(;R8(e,"name",z);)L+=1,z=`${T}-${L}`;return z},[e,r,n,t]),o=x.useCallback((T,z)=>{!T.applicationName&&!i&&z.addIssue({code:"custom",path:["applicationName"],message:"Please name your application!"})},[i]),a=Qt({resolver:ln(xje.superRefine(o)),defaultValues:{applicationName:"",contents:{...vje,...bje,...hje}}}),{watch:c,handleSubmit:d,control:f,setValue:p,formState:h,trigger:v}=a,[y,b]=x.useState(!1),{isCreatingFromTemplate:S,createFromTemplate:C}=Lje(b),{isImportingApplication:E,importApplication:k}=Fje(b),{checkCLI:j}=Mje(b),I=x.useCallback(T=>{const z=T.applicationName||i;switch(T.contents.type){case"template":{C({contents:T.contents,project:z});break}case"import":{k({contents:T.contents,project:z});break}case"cli":{j({contents:T.contents,project:z});break}}},[j,C,i,k]),A=c("contents.type"),N=x.useCallback(T=>{const z=h.isValid;p("contents.type",T),z||v()},[p,h,v]);return u.jsxs("div",{className:"mx-auto max-w-4xl mt-6",children:[u.jsxs("div",{className:"text-center",children:[u.jsx("h1",{className:"text-4xl pt-4 pb-2",children:"Bootstrap New API Application"}),u.jsx("p",{className:"text-muted-foreground",children:"Create a new application from templates, import existing code, or deploy with Harper CLI"})]}),u.jsx(Jt,{...a,children:u.jsx("form",{onSubmit:d(I),className:"flex flex-col gap-4 p-4",children:u.jsxs("fieldset",{disabled:E||S||y,children:[u.jsx(fc,{className:"bg-black-dark",children:u.jsx(fje,{control:f,defaultApplicationName:i})}),u.jsx(fc,{className:"bg-black-dark mt-4 pt-0",children:u.jsxs(lC,{defaultValue:A,onValueChange:N,children:[u.jsxs(cC,{className:"w-full grid grid-cols-3 mt-0",children:[u.jsxs($s,{value:"template",children:[u.jsx(oX,{}),u.jsx("span",{className:"hidden sm:inline-block",children:"Templates"})]}),u.jsxs($s,{value:"import",children:[u.jsx(HX,{}),"Import"]}),u.jsxs($s,{value:"cli",children:[u.jsx(UC,{}),u.jsx("span",{className:"hidden md:inline-block",children:"Harper"})," CLI"]})]}),u.jsx(Cx,{className:"bg-black mx-6 mt-1"}),u.jsx(Ms,{value:"template",className:"space-y-4",children:u.jsx($je,{control:f,formState:h,isCreatingFromTemplate:S})}),u.jsx(Ms,{value:"import",className:"space-y-4",children:u.jsx(mje,{control:f,formState:h,isImportingApplication:E,setValue:p,watch:c})}),u.jsx(Ms,{value:"cli",className:"space-y-4",children:u.jsx(dje,{defaultApplicationName:i,formState:h,watch:c})})]})})]})})})]})}function B8(e){const t=(e||"")?.split(".");return t.length>1?t.slice(-1)[0]:""}const Bje={js:"javascript",cjs:"javascript",jsx:"javascript",yaml:"yaml",ts:"typescript",tsx:"typescript",json:"json",md:"markdown",html:"html",css:"css",graphql:"graphql",mjs:"javascript"};function Hje(){const e=Ft(),{openedEntryContents:t,openedEntry:n,restrictPackageModification:r,isSavingFile:i,saveFile:o}=mi(),{content:a,setContent:c}=xx(!!n&&!n.package&&n.path),d=x.useCallback(C=>{c(C!==t?C:void 0)},[t,c]),f=Yd(),[p,h]=x.useState(null),v=B8(n?.path),y=Bje[v]||"plaintext",b=x.useCallback((C,E)=>{h([C,E])},[]);if(x.useEffect(()=>{if(!p||!f||n?.package||r)return;const[C,E]=p,k=[C.addAction({id:"new-file",label:"New File",keybindings:[E.KeyMod.WinCtrl|E.KeyMod.Alt|E.KeyCode.KeyN],run:rv("ShowAddDirectoryOrFileModalType","file")}),C.addAction({id:"rename-file",label:"Rename File",keybindings:[E.KeyMod.WinCtrl|E.KeyMod.Alt|E.KeyCode.KeyR],run:rv("ShowRenameFileModal",!0)}),C.addAction({id:"new-directory",label:"New Directory",keybindings:[E.KeyMod.WinCtrl|E.KeyMod.Alt|E.KeyMod.Shift|E.KeyCode.KeyN],run:rv("ShowAddDirectoryOrFileModalType","directory")}),C.addAction({id:"save-file",label:"Save Changes",keybindings:[E.KeyMod.CtrlCmd|E.KeyCode.KeyS],run:G2("SaveFile",!0)}),C.addAction({id:"revert-file",label:"Revert File",run:G2("RevertChanges",!0)}),C.addAction({id:"delete-file",label:"Delete File",run:rv("ShowDeleteDirectoryOrFileModal",!0)})];return()=>{for(const j of k)j?.dispose()}},[p,f,n,r]),Ey("SaveFile",()=>{n&&!i&&a!==void 0&&o({...e,file:n.path.split("/").slice(1).join("/"),payload:a,project:n.project},n.path)},[n,e,a]),Ey("RevertChanges",()=>{if(t!==void 0&&p){const[C]=p;d(void 0),C.setValue(t)}},[t,p]),!n)return null;const S=i||!!n.package||!f;return u.jsx(oh,{className:"w-full min-h-full h-80",language:y,theme:"vs-dark",value:a??t,onMount:b,onChange:S?void 0:d,options:{automaticLayout:!0,minimap:{enabled:!1},readOnly:S,padding:{top:48}}})}function qje(){const{openedEntry:e,openedEntryContents:t}=mi(),n=T_e(e?.project);return e?.path===Ro?u.jsx(Vje,{}):Pr(e)?u.jsx("div",{className:"directoryReadMe max-w-3xl",children:u.jsx(Kke,{urlTransform:n,children:t})}):u.jsx(Hje,{})}async function H8({file:e,payload:t,project:n,entityType:r,instanceClient:i}){const{data:o}=await i.post("/",{operation:"set_component_file",file:e,payload:t,project:n,replicated:r==="cluster"});return o}function q8(){return at({mutationFn:H8})}function Gje(){const e=Fc("ShowAddDirectoryOrFileModalType",!1),t=ai("ShowAddDirectoryOrFileModalType",!1),{openedEntry:n,reloadRootEntries:r,setFocusedItem:i,setSelectedItems:o,setExpandedItems:a}=mi(),c=Ft(),{mutate:d,isPending:f}=q8(),p=_r.object({name:_r.string().nonempty({error:"Please enter a valid name."}).regex(/^[a-zA-Z0-9_\- .]*$/,{error:"Names can only contain letters, numbers, underscores, hyphens, periods, and spaces."}).max(50,{error:"Names cannot be longer than 50 characters."}).trim()}),h=Qt({resolver:ln(p),defaultValues:{name:""}}),v=x.useCallback(b=>{if(!n)return;const S=n.path.split("/"),C=(Pr(n)?S.slice(1):S.slice(1,-1)).join("/");d({file:`${C}/${b.name}`,project:n.project,payload:e==="directory"?void 0:"",...c},{onSuccess:()=>{r(),t(),h.reset();const E=[n.project,C,b.name].filter(fa).join("/");i(E),o([E]),e==="directory"&&a(k=>[...k,E])}})},[d,h,t,c,n,r,a,i,o,e]),y=x.useCallback(()=>{t(),h.reset()},[t,h]);return u.jsx(zn,{onOpenChange:t,open:!!e,children:u.jsx(Ln,{"aria-describedby":void 0,className:"text-white",children:u.jsx(Jt,{...h,children:u.jsxs("form",{onSubmit:h.handleSubmit(v),children:[u.jsxs(yr,{children:[u.jsxs(Nn,{children:["Add ",e]}),u.jsxs(jr,{children:["Enter the name of the ",e," you want to add:"]})]}),u.jsx(Me,{control:h.control,name:"name",render:({field:b})=>u.jsxs(Ae,{className:"my-2",children:[u.jsx(Oe,{children:"Name"}),u.jsx($e,{children:u.jsx(ze,{disabled:f,type:"text",autoComplete:"off",autoCapitalize:"off",...b})}),u.jsx(De,{})]})}),u.jsx(Un,{children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx(be,{type:"button",variant:"ghostOutline",className:"rounded-full",onClick:y,children:"Cancel"}),u.jsxs(be,{variant:"positiveOutline",type:"submit",className:"rounded-full",disabled:f,children:[u.jsx(po,{})," Add ",e]})]})})]})})})})}async function G8({file:e,project:t,entityType:n,instanceClient:r}){const{data:i}=await r.post("/",{operation:"drop_component",file:e||void 0,project:t,replicated:n==="cluster"});return i}function Kje(){return at({mutationFn:G8})}function Zje(){const e=Fc("ShowDeleteDirectoryOrFileModal",!1),t=Ft(),{openedEntry:n,reloadRootEntries:r,setFocusedItem:i,setSelectedItems:o}=mi(),a=Pr(n),c=!!n?.package,d=c?"Remove":"Delete",f=c?"Imported Application":a?"Directory":"File",{mutate:p,isPending:h,isSuccess:v}=Kje(),y=v?`${d}d`:h?`${d.slice(0,-1)}ing`:d,b=x.useCallback(()=>{n&&p({file:n.package?void 0:`${n.path.split("/").slice(1).join("/")}`,project:n.project,...t},{onSuccess:()=>{Nd("ShowDeleteDirectoryOrFileModal",!1);const E=!n.package&&n.path.split("/").slice(0,-1).join("/");i(E||void 0),o(E?[E]:[]),r()}})},[p,t,n,r,i,o]),S=x.useCallback(E=>{E.preventDefault(),b()},[b]),C=ai("ShowDeleteDirectoryOrFileModal",!1);return u.jsx(zn,{onOpenChange:C,open:e,children:u.jsxs(Ln,{"aria-describedby":void 0,className:"text-white",children:[u.jsxs(yr,{children:[u.jsxs(Nn,{children:[d," ",f]}),u.jsxs(jr,{children:["Are you sure you want to ",d.toLowerCase()," this ",f.toLowerCase(),"?"]}),!c&&u.jsx(jr,{children:n?.path})]}),u.jsxs("div",{className:"flex w-full gap-4",children:[u.jsx(be,{variant:"ghostOutline",className:"w-full rounded-full",onClick:C,children:"Cancel"}),u.jsxs(be,{variant:"destructiveOutline",type:"button",className:"w-full rounded-full",disabled:h,autoFocus:!0,onClick:S,children:[u.jsx(ts,{})," ",y," ",f,h?"...":""]})]})]})})}async function Yje({packageName:e,project:t,skipNodeModules:n,skipSymlinks:r,instanceClient:i}){const{data:o}=await i.post("/",{operation:"package_component",package:e,project:t,skip_node_modules:n,skip_symlinks:r},{timeout:3e5});return o}function Wje(){return at({mutationFn:Yje})}function Xje(){const e=Fc("ShowDownloadApplicationModal",!1),t=Ft(),{openedEntry:n}=mi(),{mutate:r,isPending:i,isSuccess:o}=Wje(),a=o?"Downloaded":i?"Downloading":"Download",[c,d]=x.useState(!1),f=x.useCallback(v=>{d(v.target.checked)},[]),p=ai("ShowDownloadApplicationModal",!1),h=x.useCallback(v=>{if(v.preventDefault(),!n)return;Nd("ShowDownloadApplicationModal",!1);const y=_e.loading("Packaging...");r({packageName:n.package,project:n.project,skipNodeModules:!c,...t},{onSuccess:b=>{_e.success("Download ready!",{id:y});const S=document.createElement("a");S.setAttribute("class","invisible absolute top-0");const C=Uint8Array.from(atob(b.payload),k=>k.charCodeAt(0)),E=new Blob([C],{type:"application/gzip"});S.href=URL.createObjectURL(E),S.download=`${n.project}.gz`,document.body.appendChild(S),S.click(),document.body.removeChild(S)}})},[n,r,c,t]);return u.jsx(zn,{onOpenChange:p,open:e,children:u.jsxs(Ln,{"aria-describedby":void 0,className:"text-white",children:[u.jsxs(yr,{children:[u.jsx(Nn,{children:"Download Application"}),u.jsxs(jr,{children:["This will package up the contents of ",u.jsx("strong",{children:n?.project})," into a gzipped file."]})]}),u.jsxs(Pp,{className:"flex",children:[u.jsx(ze,{type:"checkbox",className:"w-6",disabled:i,checked:c,onChange:f}),u.jsx("span",{className:"pl-4 pr-8 flex-1 py-2.5",children:"Include Node Modules"})]}),u.jsxs("div",{className:"flex w-full gap-4",children:[u.jsx(be,{variant:"ghostOutline",className:"w-full rounded-full",onClick:p,children:"Cancel"}),u.jsxs(be,{variant:"positive",type:"button",className:"w-full rounded-full",disabled:i,autoFocus:!0,onClick:h,children:[u.jsx(OP,{})," ",a,i?"...":""]})]})]})})}function Qje(){const e=Fc("ShowRedeployApplicationModal",!1),t=gr(),n=Ft(),{openedEntry:r}=mi(),i=r?.package,{mutate:o,isPending:a}=V8(),c=Qt({defaultValues:{applicationUrl:i,installCommand:""}}),{control:d,handleSubmit:f,reset:p}=c;x.useEffect(()=>{p({applicationUrl:i})},[p,i]);const h=x.useCallback((b,S)=>{if(!r)return;Nd("ShowRedeployApplicationModal",!1);const C=_e.loading("Redeploying...");o({applicationName:r.project,applicationUrl:b,installCommand:S,...n},{onSuccess:()=>{_e.success(`Application ${r.project} redeployed successfully`,{id:C}),t.invalidateQueries({queryKey:[n.entityId,"get_components"],refetchType:"active"})},onError:()=>{_e.dismiss(C)}})},[o,r,n,t]),v=({applicationUrl:b,installCommand:S})=>{b&&h(b,S)},y=x.useCallback(()=>{Nd("ShowRedeployApplicationModal",!1),p({applicationUrl:i})},[p,i]);return u.jsx(zn,{onOpenChange:y,open:e,children:u.jsxs(Ln,{"aria-describedby":void 0,className:"text-white",children:[u.jsxs(yr,{children:[u.jsx(Nn,{children:"Redeploy Package"}),u.jsx(jr,{children:" Redeploy this package?"})]}),u.jsx("div",{children:u.jsx(Jt,{...c,children:u.jsxs("form",{className:"flex flex-col w-full gap-4",onSubmit:f(v),children:[u.jsx(Me,{control:d,name:"applicationUrl",render:({field:b})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Package Reference"}),u.jsx($e,{children:u.jsx(ze,{type:"text",autoFocus:!0,...b})}),u.jsx(De,{})]})}),u.jsx(Me,{control:d,name:"installCommand",render:({field:b})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Install Command"}),u.jsx($e,{children:u.jsx(ze,{type:"text",placeholder:"npm install",...b})}),u.jsx(De,{})]})}),u.jsxs(be,{variant:"positiveOutline",type:"submit",className:"w-full rounded-full",disabled:a,children:[u.jsx(sa,{})," Redeploy Application"]}),u.jsx(be,{type:"button",variant:"ghostOutline",className:"w-full rounded-full",onClick:y,disabled:a,children:"Cancel"})]})})})]})})}async function K8({instanceClient:e,file:t,project:n}){const{data:r}=await e.post("/",{operation:"get_component_file",file:t,project:n});return{file:t,project:n,...r}}function Jje(e){return{queryKey:Z8(e),queryFn:()=>K8(e),enabled:!!e.file&&!!e.project,retry:!1}}function Z8(e){return[e.entityId,"get_component_file",e.file,e.project]}function Y8(){const{reloadRootEntries:e,setFocusedItem:t,setSelectedItems:n}=mi(),r=Ft();return x.useCallback(async i=>{let o=!1;const a=i.filter(y=>y.from!==y.to);if(a.length===0)return;const c=`Renaming ${Io(a.length,"File","Files")}`,d={duration:6e4,action:{label:"Cancel",onClick:()=>{o=!0}}};d.id=_e.loading(c,{...d,description:u.jsx(up,{animated:!0,width:"0%"})});const p=a.length*3;let h=0;function v(){h+=1,_e.loading(c,{...d,description:u.jsx(up,{animated:!0,width:(h===0?0:h/p*100)+"%"})})}for(const y of a){const b=y.from.split("/"),S=b.shift(),C=b.join("/"),E=y.to.split("/"),k=E.shift(),j=E.join("/"),I=await K8({...r,file:C,project:S});if(o||(v(),await H8({...r,file:j,project:k,payload:I.message}),o)||(v(),await G8({...r,file:C,project:S}),o))break;v()}h>=p?_e.success(`Renamed ${Io(a.length,"File","Files")}`,{id:d.id,description:"All done!",duration:3e3,action:{label:"OK!",onClick:()=>{}}}):_e.warning("Rename Cancelled",{id:d.id,description:`${h} of ${p} steps completed.`,duration:1e4,action:{label:"Gotcha",onClick:()=>{}}}),e(),n(y=>{const b=y.slice();for(const S of a){const C=y.indexOf(S.from);C>=0?b.splice(C,1,S.to):b.push(S.to)}return b}),t(y=>{for(const b of a)if(y===b.from)return b.to;return y})},[r,e,t,n])}function yR(...e){return e.flat(1).join("/")}function eRe(e){return yR(e.split("/").slice(0,-1))}function W8(e,t){return yR(eRe(e),t)}function tRe(){const e=Fc("ShowRenameFileModal",!1),t=ai("ShowRenameFileModal",!1),{openedEntry:n}=mi(),r=_r.object({name:_r.string().nonempty({error:"Please enter a valid name."}).regex(/^[a-zA-Z0-9_\- .]*$/,{error:"Names can only contain letters, numbers, underscores, hyphens, periods, and spaces."}).max(50,{error:"Names cannot be longer than 50 characters."}).trim().refine(p=>p!==n?.name,{error:"Please enter a new name.",path:["name"]})}),[i,o]=x.useState(!1),a=Y8(),c=Qt({resolver:ln(r)});x.useEffect(()=>{n?.name&&c.reset({name:n?.name})},[c,n?.name]);const d=x.useCallback(async p=>{n&&(o(!0),await a([{from:n.path,to:W8(n.path,p.name)}]),t(),c.reset(),o(!1))},[c,t,n,a,o]),f=x.useCallback(()=>{t(),c.reset()},[t,c]);return u.jsx(zn,{onOpenChange:t,open:e,children:u.jsx(Ln,{"aria-describedby":void 0,className:"text-white",children:u.jsx(Jt,{...c,children:u.jsxs("form",{onSubmit:c.handleSubmit(d),children:[u.jsxs(yr,{children:[u.jsx(Nn,{children:"Rename File"}),u.jsx(jr,{children:n?.path})]}),u.jsx(Me,{control:c.control,name:"name",render:({field:p})=>u.jsxs(Ae,{className:"my-2",children:[u.jsx(Oe,{children:"Name"}),u.jsx($e,{children:u.jsx(ze,{disabled:i,type:"text",autoComplete:"off",autoCapitalize:"off",...p})}),u.jsx(De,{})]})}),u.jsx(Un,{children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx(be,{type:"button",variant:"ghostOutline",className:"rounded-full",onClick:f,children:"Cancel"}),u.jsxs(be,{variant:"positiveOutline",type:"submit",className:"rounded-full",disabled:i||!c.formState.isDirty||!c.formState.isValid,children:[u.jsx(zP,{})," Rename"]})]})})]})})})})}function nRe(e,t=!1){const[n,r]=ad(e,t),i=x.useCallback(c=>{c?.preventDefault?.(),r(d=>!d)},[r]),o=x.useCallback(c=>{c?.preventDefault?.(),r(!0)},[r]),a=x.useCallback(c=>{c?.preventDefault?.(),r(!1)},[r]);return x.useMemo(()=>({toggled:n,setToggled:r,toggle:i,toggleOn:o,toggleOff:a}),[i,r,a,o,n])}function rRe(e){return e.split("/").pop()}var Ha;(function(e){e.DoubleClickItemToExpand="double-click-item-to-expand",e.ClickItemToExpand="click-item-to-expand",e.ClickArrowToExpand="click-arrow-to-expand"})(Ha||(Ha={}));var Ry=function(){return Ry=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Ry.apply(this,arguments)},iRe=function(e,t){return{mode:e.mode,createInteractiveElementProps:function(n,r,i,o){return Ry(Ry({},t.createInteractiveElementProps(n,r,i,o)),e.createInteractiveElementProps(n,r,i,o))}}},Td=function(e){return e.ctrlKey||navigator.platform.toUpperCase().indexOf("MAC")>=0&&e.metaKey},oRe=(function(){function e(t){this.mode=Ha.DoubleClickItemToExpand,this.environment=t}return e.prototype.createInteractiveElementProps=function(t,n,r,i){var o=this;return{onClick:function(a){var c=a.detail===0;r.focusItem(),a.shiftKey&&!c?r.selectUpTo(!Td(a)):Td(a)&&!c?i.isSelected?r.unselectItem():r.addToSelectedItems():r.selectItem()},onDoubleClick:function(){r.focusItem(),r.selectItem(),t.isFolder&&r.toggleExpandedState(),(!t.isFolder||o.environment.canInvokePrimaryActionOnItemContainer)&&r.primaryAction()},onFocus:function(){r.focusItem()},onDragStart:function(a){a.dataTransfer.dropEffect="move",r.startDragging()},onDragOver:function(a){a.preventDefault()},draggable:i.canDrag&&!i.isRenaming,tabIndex:i.isRenaming?void 0:i.isFocused?0:-1}},e})(),aRe=(function(){function e(t){this.mode=Ha.ClickItemToExpand,this.environment=t}return e.prototype.createInteractiveElementProps=function(t,n,r,i){var o=this;return{onClick:function(a){var c=a.detail===0;r.focusItem(),a.shiftKey&&!c?r.selectUpTo(!Td(a)):Td(a)&&!c?i.isSelected?r.unselectItem():r.addToSelectedItems():(t.isFolder&&r.toggleExpandedState(),r.selectItem(),(!t.isFolder||o.environment.canInvokePrimaryActionOnItemContainer)&&r.primaryAction())},onFocus:function(){r.focusItem()},onDragStart:function(a){a.dataTransfer.dropEffect="move",r.startDragging()},onDragOver:function(a){a.preventDefault()},draggable:i.canDrag&&!i.isRenaming,tabIndex:i.isRenaming?void 0:i.isFocused?0:-1}},e})(),sRe=(function(){function e(t){this.mode=Ha.ClickItemToExpand,this.environment=t}return e.prototype.createInteractiveElementProps=function(t,n,r,i){var o=this;return{onClick:function(a){var c=a.detail===0;r.focusItem(),a.shiftKey&&!c?r.selectUpTo(!Td(a)):Td(a)&&!c?i.isSelected?r.unselectItem():r.addToSelectedItems():(r.selectItem(),(!t.isFolder||o.environment.canInvokePrimaryActionOnItemContainer)&&r.primaryAction())},onFocus:function(){r.focusItem()},onDragStart:function(a){a.dataTransfer.dropEffect="move",r.startDragging()},onDragOver:function(a){a.preventDefault()},draggable:i.canDrag&&!i.isRenaming,tabIndex:i.isRenaming?void 0:i.isFocused?0:-1}},e})(),D$=function(e,t){switch(e){case Ha.DoubleClickItemToExpand:return new oRe(t);case Ha.ClickItemToExpand:return new aRe(t);case Ha.ClickArrowToExpand:return new sRe(t);default:throw Error("Unknown interaction mode ".concat(e))}},X8=x.createContext(null),lRe=function(){return x.useContext(X8)},cRe=function(e){var t=e.children,n=en(),r=n.defaultInteractionMode,i=x.useMemo(function(){var o;return r&&typeof r!="string"?r.extends?iRe(r,D$(r.extends,n)):r:D$((o=r)!==null&&o!==void 0?o:Ha.ClickItemToExpand,n)},[]);return x.createElement(X8.Provider,{value:i},t)},Q8=function(){var e=en();return x.useCallback(function(t,n){if(t.targetType==="between-items"){if(!e.canReorderItems)return!1}else if(t.targetType==="root"){if(!e.canDropOnFolder)return!1}else{var r=e.items[t.targetItem];if(!r||!e.canDropOnFolder&&r.isFolder||!e.canDropOnNonFolder&&!r.isFolder||n.some(function(i){return i.index===t.targetItem}))return!1}return!(e.canDropAt&&(!n||!e.canDropAt(n,t)))},[e])},J8=function(){var e=en();return x.useCallback(function(t,n){for(var r=e.linearItems[n],i=r[t].depth,o=t;r[o]&&r[o].depth!==i-1;o-=1);var a=r[o];return a||(a={item:e.trees[n].rootItem,depth:0},o=0),{parent:a,parentLinearIndex:o}},[e.linearItems,e.trees])},uRe=function(){var e=en(),t=J8(),n=Q8(),r=x.useCallback(function(i,o,a){var c=t(o,i),d=c.parent,f=c.parentLinearIndex;return a.some(function(p){return p.index===d.item})?!0:d.depth===0?!1:r(i,f,a)},[t]);return x.useCallback(function(i,o){for(var a,c,d,f,p=e.linearItems[i],h=[],v=-1,y=0;y<p.length;y++){var b=p[y],S=b.item,C=b.depth;if(!(v!==-1&&C>v)){v=-1;var E=t(y,i).parent,k=e.items[E.item].children.indexOf(S);if(r(i,y,o)){v=C+1;continue}var j={targetType:"item",parentItem:E.item,targetItem:S,linearIndex:y,depth:C,treeId:i},I={targetType:"between-items",parentItem:E.item,linePosition:"top",childIndex:k,depth:C,treeId:i,linearIndex:y},A={targetType:"between-items",parentItem:E.item,linePosition:"bottom",linearIndex:y+1,childIndex:k+1,depth:C,treeId:i},N=(c=(a=p[y-1])===null||a===void 0?void 0:a.depth)!==null&&c!==void 0?c:-1,T=(f=(d=p[y+1])===null||d===void 0?void 0:d.depth)!==null&&f!==void 0?f:-1,z=C===N,L=C===T-1;!z&&n(I,o)&&h.push(I),n(j,o)&&h.push(j),!L&&n(A,o)&&h.push(A)}}return h},[n,e.items,e.linearItems,t,r])},sv=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Iy=function(e,t,n){var r=x.useRef();x.useEffect(function(){if(!r.current)r.current=sv([],n,!0),e();else{var i=r.current.some(function(o,a){return o!==n[a]});i&&(r.current=sv([],n,!0),e())}},sv(sv([],t,!0),n,!0))},Ny=function(){return Ny=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Ny.apply(this,arguments)},e9=function(e,t){return e.map(function(n){return[n,t(n)]}).reduce(function(n,r){var i,o=r[0],a=r[1];return Ny(Ny({},n),(i={},i[o]=a,i))},{})},ao=function(){return typeof document<"u"?document:void 0};function uf(e){e===void 0&&(e=!1);var t=x.useRef(new Array);return x.useEffect(function(){if(e)return function(){};var n=t.current;return function(){return n.forEach(function(r){return cancelAnimationFrame(r)})}},[e,t]),x.useCallback(function(n){var r=requestAnimationFrame(function(){t.current.splice(t.current.indexOf(r),1),n()});t.current.push(r)},[t])}var Ty=function(e){var t=x.useRef(e);return t.current=e,t},so=function(e){var t=Ty(e);return x.useCallback((function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t.current.apply(t,n)}),[t])},t9=function(){var e=en();return so(function(t,n){return n.map(function(r){return[r,e.linearItems[t].findIndex(function(i){return i.item===r.index})]}).sort(function(r,i){r[0];var o=r[1];i[0];var a=i[1];return o-a}).map(function(r){var i=r[0];return i})})},dRe=function(e){var t,n=(t=ao())===null||t===void 0?void 0:t.querySelector('[data-rct-tree="'.concat(e,'"] [data-rct-item-container="true"]'));if(n){var r=getComputedStyle(n);return n.offsetHeight+Math.max(parseFloat(r.marginTop),parseFloat(r.marginBottom))}return 5},n9=function(e,t){return e.clientX<=t.left||e.clientX>=t.right||e.clientY<=t.top||e.clientY>=t.bottom},fRe=(function(){function e(t,n,r,i,o,a){this.env=t,this.e=n,this.treeId=r,this.linearIndex=i.linearIndex,this.offset=i.offset,this.indentation=i.indentation,this.targetItem=this.env.linearItems[this.treeId][this.linearIndex],this.getParentOfLinearItem=a,this.draggingItems=o}return e.prototype.getEmptyTreeDragPosition=function(){return{targetType:"root",treeId:this.treeId,depth:0,linearIndex:0,targetItem:this.env.trees[this.treeId].rootItem}},e.prototype.maybeRedirectToParent=function(){var t=!this.env.canReorderItems&&!this.env.canDropOnNonFolder&&!this.env.items[this.targetItem.item].isFolder;if(t){var n=this.getParentOfLinearItem(this.linearIndex,this.treeId),r=n.parentLinearIndex,i=n.parent;this.targetItem=i,this.linearIndex=r}},e.prototype.maybeReparentUpwards=function(){var t,n;if(this.indentation!==void 0){var r=this.env.linearItems[this.treeId],i=r[this.linearIndex].depth,o=i-((n=(t=r[this.linearIndex+1])===null||t===void 0?void 0:t.depth)!==null&&n!==void 0?n:0),a=this.offset==="bottom"&&o>0;if(a){for(var c=Math.max(i-o,this.indentation),d={parentLinearIndex:this.linearIndex,parent:this.targetItem},f,p=i;p>=c;p-=1)f=d,d=this.getParentOfLinearItem(d.parentLinearIndex,this.treeId);if(this.indentation!==r[this.linearIndex].depth&&f){var h=this.env.items[d.parent.item].children.indexOf(f.parent.item)+1;if(!(this.draggingItems&&this.isDescendant(this.treeId,d.parentLinearIndex+1,this.draggingItems)))return{targetType:"between-items",treeId:this.treeId,parentItem:d.parent.item,depth:c,linearIndex:this.linearIndex+1,childIndex:h,linePosition:"bottom"}}}}},e.prototype.maybeRedirectInsideOpenFolder=function(){var t=this.env.linearItems[this.treeId][this.linearIndex+1],n=!this.env.canDropBelowOpenFolders&&t&&this.targetItem.depth===t.depth-1&&this.offset==="bottom";n&&(this.targetItem=t,this.linearIndex+=1,this.offset="top")},e.prototype.maybeMapToBottomOffset=function(){var t=this.env.linearItems[this.treeId][this.linearIndex-1];if(!(!t||t?.depth===void 0)){var n=t.depth-this.targetItem.depth;this.offset==="top"&&(n===0||n>0&&this.indentation!==void 0)&&(this.offset="bottom",this.linearIndex-=1,this.targetItem=this.env.linearItems[this.treeId][this.linearIndex])}},e.prototype.canDropAtCurrentTarget=function(){var t=this,n,r=this.env.items[this.targetItem.item];return!(!this.offset&&!this.env.canDropOnNonFolder&&!r.isFolder||!this.offset&&!this.env.canDropOnFolder&&r.isFolder||this.offset&&!this.env.canReorderItems||!((n=this.draggingItems)===null||n===void 0)&&n.some(function(i){return i.index===t.targetItem.item}))},e.prototype.getDraggingPosition=function(){if(this.env.linearItems[this.treeId].length===0)return this.getEmptyTreeDragPosition();if(!(!this.draggingItems||this.linearIndex<0||this.linearIndex>=this.env.linearItems[this.treeId].length)){this.maybeRedirectToParent(),this.maybeRedirectInsideOpenFolder(),this.maybeMapToBottomOffset();var t=this.maybeReparentUpwards();if(t)return t;if(this.areDraggingItemsDescendantOfTarget()||!this.canDropAtCurrentTarget())return"invalid";var n=this.getParentOfLinearItem(this.linearIndex,this.treeId).parent,r=this.env.items[n.item].children.indexOf(this.targetItem.item)+(this.offset==="top"?0:1);return this.offset?{targetType:"between-items",treeId:this.treeId,parentItem:n.item,depth:this.targetItem.depth,linearIndex:this.linearIndex+(this.offset==="top"?0:1),childIndex:r,linePosition:this.offset}:{targetType:"item",treeId:this.treeId,parentItem:n.item,targetItem:this.targetItem.item,depth:this.targetItem.depth,linearIndex:this.linearIndex}}},e.prototype.isDescendant=function(t,n,r){var i=this.getParentOfLinearItem(n,t),o=i.parentLinearIndex,a=i.parent;return r.some(function(c){return c.index===a.item})?!0:a.depth===0?!1:this.isDescendant(t,o,r)},e.prototype.areDraggingItemsDescendantOfTarget=function(){return this.draggingItems&&this.isDescendant(this.treeId,this.linearIndex,this.draggingItems)},e})(),mRe=function(){var e=x.useRef("initial"),t=x.useState(void 0),n=t[0],r=t[1],i=x.useRef(0),o=en(),a=J8(),c=so(function(v,y,b){if(!b)return!1;var S=b.offset,C=b.linearIndex,E="".concat(y,"__").concat(C,"__").concat(S??"","__").concat(b.indentation);return E!==e.current?(e.current=E,!0):!1}),d=so(function(v,y,b){if(b.current){var S=b.current.getBoundingClientRect();if(!n9(v,S)){var C=(v.clientY-S.top)/i.current,E=o.linearItems[y],k=Math.min(Math.max(0,Math.floor(C)),E.length-1);if(E.length===0)return{linearIndex:0,offset:"bottom",indentation:0};var j=E[k],I=o.items[j.item],A=o.renderDepthOffset?Math.max(Math.floor((v.clientX-S.left)/o.renderDepthOffset),0):void 0,N,T=o.canReorderItems?I?.isFolder&&o.canDropOnFolder||o.canDropOnNonFolder?.2:.5:0;return C-.5>=E.length-1?N="bottom":C%1<T?N="top":C%1>1-T&&(N="bottom"),{linearIndex:k,offset:N,indentation:A}}}}),f=so(function(v,y,b){var S=d(v,y,b);if(c(v,y,S))return!n||!o.canDragAndDrop||!S||v.clientX<0||v.clientY<0?"invalid":new fRe(o,v,y,S,n,a).getDraggingPosition()}),p=so(function(v,y){r(y),e.current="initial",i.current=dRe(v)}),h=so(function(){r(void 0),e.current="initial",i.current=0});return{initiateDraggingPosition:p,resetDraggingPosition:h,draggingItems:n,getDraggingPosition:f,itemHeight:i}},r9=x.createContext(null),pa=function(){return x.useContext(r9)},pRe=function(e){var t=e.children,n=en(),r=x.useState(!1),i=r[0],o=r[1],a=x.useState({}),c=a[0],d=a[1],f=x.useState(0),p=f[0],h=f[1],v=x.useState(),y=v[0],b=v[1],S=uRe(),C=uf(),E=t9(),k=mRe(),j=k.initiateDraggingPosition,I=k.resetDraggingPosition,A=k.draggingItems,N=k.getDraggingPosition,T=k.itemHeight,z=x.useCallback(function(V,O){var ee;if(n.activeTreeId&&(!((ee=n.viewState[n.activeTreeId])===null||ee===void 0)&&ee.focusedItem)&&n.linearItems&&O){var ue=n.viewState[n.activeTreeId].focusedItem,pe=S(n.activeTreeId,O),B=pe.findIndex(function(ie){return ie.targetType==="item"?ie.targetItem===ue:ie.targetType==="between-items"?n.items[ie.parentItem].children[ie.childIndex]===ue:!1});h(B?Math.min(B+1,pe.length-1):0)}else h(0)},[n.activeTreeId,n.items,n.linearItems,n.viewState,S]),L=so(function(){o(!1),d({}),h(0),b(void 0),I()});Iy(function(){n.activeTreeId&&n.linearItems[n.activeTreeId]&&c[n.activeTreeId]&&z(c[n.activeTreeId],A)},[A,n.activeTreeId,n.linearItems,z,c],[n.activeTreeId]),Iy(function(){i&&n.activeTreeId&&b(c[n.activeTreeId][p])},[p,n.activeTreeId,i,c],[p,n.activeTreeId]);var G=Q8(),J=function(V){var O;A&&!G(V,A)||(b(V),n.setActiveTree(V.treeId),A&&n.activeTreeId!==V.treeId&&((O=n.onSelectItems)===null||O===void 0||O.call(n,A.map(function(ee){return ee.index}),V.treeId)))},Y=so(function(V,O,ee){if(A){var ue=N(V,O,ee);if(ue){if(ue==="invalid"){b(void 0);return}J(ue)}}}),W=so(function(V,O){O.current&&n9(V,O.current.getBoundingClientRect())&&b(void 0)}),F=so(function(){!A||!y||!n.onDrop||(n.onDrop(A,y),C(function(){var V;(V=n.onFocusItem)===null||V===void 0||V.call(n,A[0],y.treeId),L()}))}),Z=x.useCallback(function(V,O){var ee=e9(n.treeIds,function(ue){return S(ue,V)});j(O,V),d(ee),n.activeTreeId&&z(ee[n.activeTreeId],V)},[n.activeTreeId,n.treeIds,S,j,z]),M=x.useCallback(function(){var V,O,ee;if(n.canDragAndDrop&&n.activeTreeId){var ue=(O=(V=n.viewState[n.activeTreeId])===null||V===void 0?void 0:V.selectedItems)!==null&&O!==void 0?O:[(ee=n.viewState[n.activeTreeId])===null||ee===void 0?void 0:ee.focusedItem];if(ue.length===0||ue[0]===void 0)return;var pe=E(n.activeTreeId,ue.map(function(B){return n.items[B]}));if(n.canDrag&&!n.canDrag(pe))return;Z(pe,n.activeTreeId),setTimeout(function(){o(!0)})}},[n,E,Z]),K=x.useCallback(function(){L()},[L]),U=x.useCallback(function(){F(),L()},[F,L]),te=x.useCallback(function(){h(function(V){return Math.max(0,V-1)})},[]),D=x.useCallback(function(){n.activeTreeId&&h(function(V){return Math.min(c[n.activeTreeId].length-1,V+1)})},[n.activeTreeId,c]),P=x.useMemo(function(){return{onStartDraggingItems:Z,startProgrammaticDrag:M,abortProgrammaticDrag:K,completeProgrammaticDrag:U,programmaticDragUp:te,programmaticDragDown:D,draggingItems:A,draggingPosition:y,itemHeight:T.current,isProgrammaticallyDragging:i,onDragOverTreeHandler:Y,onDragLeaveContainerHandler:W,viableDragPositions:c}},[K,U,A,y,i,T,Y,W,Z,D,te,M,c]);return x.useEffect(function(){return window.addEventListener("dragend",L),window.addEventListener("drop",F),function(){window.removeEventListener("dragend",L),window.removeEventListener("drop",F)}},[F,L]),x.createElement(r9.Provider,{value:P},t)},qm=function(){return qm=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},qm.apply(this,arguments)},hRe=function(e,t){var n=en(),r=pa();x.useImperativeHandle(e,function(){return qm(qm(qm({},t),n),{treeEnvironmentContext:n,dragAndDropContext:r})})},i9=function(e,t,n){return t===void 0&&(t=50),n===void 0&&(n=1e4),new Promise(function(r){e()&&r();var i,o=setInterval(function(){e()&&i()},t),a=setTimeout(function(){i()},n);i=function(){clearInterval(o),clearTimeout(a),r()}})},uC=function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function c(p){try{f(r.next(p))}catch(h){a(h)}}function d(p){try{f(r.throw(p))}catch(h){a(h)}}function f(p){p.done?o(p.value):i(p.value).then(c,d)}f((r=r.apply(e,t||[])).next())})},dC=function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(f){return function(p){return d([f,p])}}function d(f){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(n=0)),n;)try{if(r=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,i=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){n.label=f[1];break}if(f[0]===6&&n.label<o[1]){n.label=o[1],o=f;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(f);break}o[2]&&n.ops.pop(),n.trys.pop();continue}f=t.call(e,n)}catch(p){f=[6,p],i=0}finally{r=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},$$=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},o9=x.createContext(null),gRe=function(){return x.useContext(o9)},a9=function(e,t,n){return uC(void 0,void 0,void 0,function(){var r,i,o,a,c,d,f;return dC(this,function(p){for(r=function(h){i9(function(){var v;return!!(!((v=t.current)===null||v===void 0)&&v[h])}).then(function(){var v,y=(v=t.current)===null||v===void 0?void 0:v[h];y?.isFolder&&(n(y),a9(h,t,n))})},i=0,o=(f=(d=(c=t.current)===null||c===void 0?void 0:c[e])===null||d===void 0?void 0:d.children)!==null&&f!==void 0?f:[];i<o.length;i++)a=o[i],r(a);return[2]})})},vRe=x.forwardRef(function(e,t){var n=en(),r=n.onCollapseItem,i=n.items,o=n.trees,a=n.viewState,c=n.onExpandItem,d=n.onFocusItem,f=n.setActiveTree,p=n.onRenameItem,h=n.onSelectItems,v=n.onPrimaryAction,y=n.linearItems,b=pa(),S=b.abortProgrammaticDrag,C=b.completeProgrammaticDrag,E=b.programmaticDragDown,k=b.programmaticDragUp,j=b.startProgrammaticDrag,I=Ty(i),A=x.useCallback(function(D,P){r?.(i[D],P)},[i,r]),N=x.useCallback(function(D,P){c?.(i[D],P)},[i,c]),T=x.useCallback(function(D,P,V){V===void 0&&(V=!0),d?.(i[D],P,V)},[i,d]),z=x.useCallback(function(D,P){P===void 0&&(P=!0),f(D,P)},[f]),L=x.useCallback(function(D){var P=y[D],V=P.findIndex(function(ue){var pe,B=ue.item;return B===((pe=a[D])===null||pe===void 0?void 0:pe.focusedItem)}),O=V!==void 0?Math.min(P.length-1,V+1):0,ee=i[P[O].item];d?.(ee,D)},[i,y,d,a]),G=x.useCallback(function(D){var P=y[D],V=P.findIndex(function(ue){var pe,B=ue.item;return B===((pe=a[D])===null||pe===void 0?void 0:pe.focusedItem)}),O=V!==void 0?Math.max(0,V-1):0,ee=i[P[O].item];d?.(ee,D)},[i,y,d,a]),J=x.useCallback(function(D,P,V){p?.(i[D],P,V)},[i,p]),Y=x.useCallback(function(D,P){h?.(D,P)},[h]),W=x.useCallback(function(D,P){var V,O;!((O=(V=a[P])===null||V===void 0?void 0:V.expandedItems)===null||O===void 0)&&O.includes(D)?r?.(i[D],P):c?.(i[D],P)},[i,r,c,a]),F=x.useCallback(function(D,P){var V,O,ee,ue,pe;!((O=(V=a[P])===null||V===void 0?void 0:V.selectedItems)===null||O===void 0)&&O.includes(D)?h?.((ue=(ee=a[P].selectedItems)===null||ee===void 0?void 0:ee.filter(function(B){return B!==D}))!==null&&ue!==void 0?ue:[],P):h?.($$($$([],(pe=a[P].selectedItems)!==null&&pe!==void 0?pe:[],!0),[D],!1),P)},[h,a]),Z=x.useCallback(function(D,P){v?.(i[D],P)},[i,v]),M=x.useCallback(function(D,P){return uC(void 0,void 0,void 0,function(){var V,O;return dC(this,function(ee){switch(ee.label){case 0:return V=P[0],O=P.slice(1),[4,i9(function(){var ue;return!!(!((ue=I.current)===null||ue===void 0)&&ue[V])}).then(function(){var ue=I.current[V];return ue?(c?.(ue,D),O.length>0?M(D,O):Promise.resolve()):Promise.resolve()})];case 1:return ee.sent(),[2]}})})},[I,c]),K=x.useCallback(function(D){return uC(void 0,void 0,void 0,function(){return dC(this,function(P){switch(P.label){case 0:return[4,a9(o[D].rootItem,I,function(V){return c?.(V,D)})];case 1:return P.sent(),[2]}})})},[I,c,o]),U=x.useCallback(function(D){for(var P,V,O=0,ee=(V=(P=a[D])===null||P===void 0?void 0:P.expandedItems)!==null&&V!==void 0?V:[];O<ee.length;O++){var ue=ee[O];r?.(i[ue],D)}},[i,r,a]),te=x.useMemo(function(){return{collapseItem:A,expandItem:N,focusItem:T,focusTree:z,moveFocusDown:L,moveFocusUp:G,renameItem:J,selectItems:Y,toggleItemExpandedState:W,toggleItemSelectStatus:F,invokePrimaryAction:Z,expandAll:K,expandSubsequently:M,collapseAll:U,abortProgrammaticDrag:S,completeProgrammaticDrag:C,moveProgrammaticDragPositionDown:E,moveProgrammaticDragPositionUp:k,startProgrammaticDrag:j}},[A,N,T,z,L,G,J,Y,W,F,Z,K,M,U,S,C,E,k,j]);return hRe(t,te),x.createElement(o9.Provider,{value:te},e.children)}),yRe=function(e){var t,n,r,i;if(e)if(e.scrollIntoViewIfNeeded)e.scrollIntoViewIfNeeded();else{var o=e.getBoundingClientRect(),a=o.top>=0&&o.left>=0&&o.bottom<=(window.innerHeight||!!(!((n=(t=ao())===null||t===void 0?void 0:t.documentElement)===null||n===void 0)&&n.clientHeight))&&o.right<=(window.innerWidth||!!(!((i=(r=ao())===null||r===void 0?void 0:r.documentElement)===null||i===void 0)&&i.clientWidth));a||e.scrollIntoView()}},ni=function(){return ni=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},ni.apply(this,arguments)},As=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(n){return!!n}).join(" ")},bRe=function(e,t){return{renderItemTitle:function(n){var r=n.title,i=n.context,o=n.info;if(!o.isSearching||!i.isSearchMatching)return r;var a=r.toLowerCase().indexOf(o.search.toLowerCase());return X.createElement(X.Fragment,null,a>0&&X.createElement("span",null,r.slice(0,a)),X.createElement("span",{className:"rct-tree-item-search-highlight"},r.slice(a,a+o.search.length)),a+o.search.length<r.length&&X.createElement("span",null,r.slice(a+o.search.length,r.length)))},renderItemArrow:function(n){var r=n.item,i=n.context;return X.createElement("div",ni({className:As(r.isFolder&&"rct-tree-item-arrow-isFolder",i.isExpanded&&"rct-tree-item-arrow-expanded","rct-tree-item-arrow")},i.arrowProps),r.isFolder&&(i.isExpanded?X.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 16 16",enableBackground:"new 0 0 16 16",xmlSpace:"preserve"},X.createElement("g",null,X.createElement("g",null,X.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z",className:"rct-tree-item-arrow-path"})))):X.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 16 16",enableBackground:"new 0 0 16 16",xmlSpace:"preserve"},X.createElement("g",null,X.createElement("g",null,X.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z",className:"rct-tree-item-arrow-path"}))))))},renderItem:function(n){var r=n.item,i=n.depth,o=n.children,a=n.title,c=n.context,d=n.arrow,f=c.isRenaming?"div":"button",p=c.isRenaming?void 0:"button";return X.createElement("li",ni({},c.itemContainerWithChildrenProps,{className:As("rct-tree-item-li",r.isFolder&&"rct-tree-item-li-isFolder",c.isSelected&&"rct-tree-item-li-selected",c.isExpanded&&"rct-tree-item-li-expanded",c.isFocused&&"rct-tree-item-li-focused",c.isDraggingOver&&"rct-tree-item-li-dragging-over",c.isSearchMatching&&"rct-tree-item-li-search-match")}),X.createElement("div",ni({},c.itemContainerWithoutChildrenProps,{style:{"--depthOffset":"".concat((i+1)*e,"px")},className:As("rct-tree-item-title-container",r.isFolder&&"rct-tree-item-title-container-isFolder",c.isSelected&&"rct-tree-item-title-container-selected",c.isExpanded&&"rct-tree-item-title-container-expanded",c.isFocused&&"rct-tree-item-title-container-focused",c.isDraggingOver&&"rct-tree-item-title-container-dragging-over",c.isSearchMatching&&"rct-tree-item-title-container-search-match")}),d,X.createElement(f,ni({type:p},c.interactiveElementProps,{className:As("rct-tree-item-button",r.isFolder&&"rct-tree-item-button-isFolder",c.isSelected&&"rct-tree-item-button-selected",c.isExpanded&&"rct-tree-item-button-expanded",c.isFocused&&"rct-tree-item-button-focused",c.isDraggingOver&&"rct-tree-item-button-dragging-over",c.isSearchMatching&&"rct-tree-item-button-search-match")}),a)),o)},renderRenameInput:function(n){var r=n.inputProps,i=n.inputRef,o=n.submitButtonProps,a=n.submitButtonRef,c=n.formProps;return X.createElement("form",ni({},c,{className:"rct-tree-item-renaming-form"}),X.createElement("input",ni({},r,{ref:i,className:"rct-tree-item-renaming-input"})),X.createElement("input",ni({},o,{ref:a,type:"submit",className:"rct-tree-item-renaming-submit-button",value:"🗸"})))},renderTreeContainer:function(n){var r=n.children,i=n.containerProps,o=n.info;return X.createElement("div",{className:As("rct-tree-root",o.isFocused&&"rct-tree-root-focus",o.isRenaming&&"rct-tree-root-renaming",o.areItemsSelected&&"rct-tree-root-itemsselected",t)},X.createElement("div",ni({},i,{style:ni({minHeight:"30px"},i.style)}),r))},renderItemsContainer:function(n){var r=n.children,i=n.containerProps;return X.createElement("ul",ni({},i,{className:"rct-tree-items-container"}),r)},renderDragBetweenLine:function(n){var r=n.draggingPosition,i=n.lineProps;return X.createElement("div",ni({},i,{style:{left:"".concat(r.depth*e,"px")},className:As("rct-tree-drag-between-line",r.targetType==="between-items"&&r.linePosition==="top"&&"rct-tree-drag-between-line-top",r.targetType==="between-items"&&r.linePosition==="bottom"&&"rct-tree-drag-between-line-bottom")}))},renderSearchInput:function(n){var r=n.inputProps;return X.createElement("div",{className:As("rct-tree-search-input-container")},X.createElement("span",{className:"rct-tree-input-icon"}),X.createElement("input",ni({},r,{className:As("rct-tree-search-input")})))},renderLiveDescriptorContainer:function(n){var r=n.tree,i=n.children;return X.createElement("div",{id:"rct-livedescription-".concat(r.treeId),style:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",width:"1px"}},i)},renderDepthOffset:e}},xRe=function(e){var t=e.renderItem,n=e.renderItemTitle,r=e.renderItemArrow,i=e.renderRenameInput,o=e.renderItemsContainer,a=e.renderTreeContainer,c=e.renderDragBetweenLine,d=e.renderSearchInput,f=e.renderLiveDescriptorContainer,p=e.renderDepthOffset,h=x.useMemo(function(){return bRe(p??10)},[p]),v={renderItem:t,renderItemTitle:n,renderItemArrow:r,renderRenameInput:i,renderItemsContainer:o,renderTreeContainer:a,renderDragBetweenLine:c,renderSearchInput:d,renderLiveDescriptorContainer:f,renderDepthOffset:p},y=Object.entries(h).reduce(function(b,S){var C=S[0],E=S[1],k=C;return v[k]?b[k]=v[k]:b[k]=E,b},{});return y.renderItem.displayName="RenderItem",y.renderItemTitle.displayName="RenderItemTitle",y.renderItemArrow.displayName="RenderItemArrow",y.renderRenameInput.displayName="RenderRenameInput",y.renderItemsContainer.displayName="RenderItemsContainer",y.renderTreeContainer.displayName="RenderTreeContainer",y.renderDragBetweenLine.displayName="RenderDragBetweenLine",y.renderSearchInput.displayName="RenderSearchInput",y},bR=function(e,t,n,r){var i,o,a;r===void 0&&(r=0);for(var c=[],d=0,f=(o=(i=n[e])===null||i===void 0?void 0:i.children)!==null&&o!==void 0?o:[];d<f.length;d++){var p=f[d],h=n[p];c.push({item:p,depth:r}),h&&h.isFolder&&h.children&&(!((a=t.expandedItems)===null||a===void 0)&&a.includes(p))&&c.push.apply(c,bR(p,t,n,r+1))}return c},ql=function(){return ql=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},ql.apply(this,arguments)},wRe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},SRe=function(e){var t=e.onExpandItem,n=e.onCollapseItem,r=e.onDrop,i=wRe(e,["onExpandItem","onCollapseItem","onDrop"]),o=x.useState({}),a=o[0],c=o[1],d=x.useState(),f=d[0],p=d[1],h=x.useMemo(function(){return Object.keys(a)},[a]),v=i.onFocusItem,y=i.autoFocus,b=i.onRegisterTree,S=i.onUnregisterTree,C=i.items,E=i.viewState,k=Ty(v),j=Ty(E),I=x.useMemo(function(){return e9(h,function(F){var Z;return bR(a[F].rootItem,(Z=E[F])!==null&&Z!==void 0?Z:{},C)})},[a,C,h,E]),A=x.useCallback(function(F,Z,M){var K,U,te,D,P,V,O,ee,ue;if(M===void 0&&(M=!0),(y??!0)&&M){var pe=(U=(K=ao())===null||K===void 0?void 0:K.querySelector('[data-rct-tree="'.concat(Z,'"] [data-rct-item-id="').concat(F.index,'"]')))!==null&&U!==void 0?U:(te=ao())===null||te===void 0?void 0:te.querySelector('[data-rct-tree="'.concat(Z,'"] [data-rct-item-id]'));((V=(P=(D=ao())===null||D===void 0?void 0:D.activeElement)===null||P===void 0?void 0:P.attributes.getNamedItem("data-rct-search-input"))===null||V===void 0?void 0:V.value)!=="true"?(O=pe?.focus)===null||O===void 0||O.call(pe):yRe(pe)}((ee=j.current[Z])===null||ee===void 0?void 0:ee.focusedItem)!==F.index&&((ue=k.current)===null||ue===void 0||ue.call(k,F,Z))},[y,k,j]),N=x.useCallback(function(F){c(function(Z){var M;return ql(ql({},Z),(M={},M[F.treeId]=F,M))}),b?.(F)},[b]),T=x.useCallback(function(F){S?.(a[F]),delete a[F],c(a)},[S,a]),z=x.useCallback(function(F,Z){n?.(F,Z),c(function(M){return M})},[n]),L=x.useCallback(function(F,Z){t?.(F,Z),c(function(M){return M})},[t]),G=x.useCallback(function(F,Z){r?.(F,Z),c(function(M){return M})},[r]),J=x.useCallback(function(F){var Z,M,K=(Z=ao())===null||Z===void 0?void 0:Z.querySelector('[data-rct-tree="'.concat(F,'"] [data-rct-item-focus="true"]'));(M=K?.focus)===null||M===void 0||M.call(K)},[]),Y=x.useCallback(function(F,Z){Z===void 0&&(Z=!0);var M=function(U){var te,D;Z&&(y??!0)&&U&&!(!((D=(te=ao())===null||te===void 0?void 0:te.querySelector('[data-rct-tree="'.concat(U,'"]')))===null||D===void 0)&&D.contains(document.activeElement))&&J(U)};if(typeof F=="function")p(function(U){var te=F(U);return te!==U&&M(te),te});else{var K=F;p(K),M(K)}},[y,J]),W=xRe(i);return ql(ql(ql({},W),i),{onFocusItem:A,registerTree:N,unregisterTree:T,onExpandItem:L,onCollapseItem:z,onDrop:G,setActiveTree:Y,treeIds:h,trees:a,activeTreeId:f,linearItems:I})},s9=x.createContext(null),en=function(){return x.useContext(s9)},_Re=x.forwardRef(function(e,t){var n=SRe(e),r=e.viewState,i=e.onFocusItem;return x.useEffect(function(){for(var o,a,c,d=0,f=Object.keys(n.trees);d<f.length;d++){var p=f[d],h=(a=(o=e.items[n.trees[p].rootItem])===null||o===void 0?void 0:o.children)===null||a===void 0?void 0:a[0],v=h&&e.items[h];!(!((c=r[p])===null||c===void 0)&&c.focusedItem)&&n.trees[p]&&v&&i?.(v,p,!1)}},[n.trees,i,e.items,r]),x.createElement(s9.Provider,{value:n},x.createElement(cRe,null,x.createElement(pRe,null,x.createElement(vRe,{ref:t},e.children))))}),CRe=function(e){var t,n=e.treeId,r=pa(),i=r.draggingPosition,o=r.itemHeight,a=Br().renderers,c=i&&i.targetType==="between-items"&&i.treeId===n;if(!c)return null;var d={onDragOver:function(f){return f.preventDefault()}};return x.createElement("div",{style:{position:"absolute",left:"0",right:"0",top:"".concat(((t=i?.linearIndex)!==null&&t!==void 0?t:0)*o,"px")}},a.renderDragBetweenLine({draggingPosition:i,lineProps:d}))},Ad=function(e,t,n){var r=so(n);x.useEffect(function(){return e?(e.addEventListener(t,r),function(){return e.removeEventListener(t,r)}):function(){}},[e,r,t])},ERe=function(e,t,n){var r=x.useState(!1),i=r[0],o=r[1],a=x.useRef(!1),c=uf();return Ad(e,"focusin",function(){i||(o(!0),t?.()),a.current&&(a.current=!1)}),Ad(e,"focusout",function(){a.current=!0,c(function(){a.current&&!e?.contains(document.activeElement)&&(n?.(),a.current=!1,o(!1))})}),i},lv=function(e,t,n){Ad(ao(),"keydown",function(r){n&&n&&e.toLowerCase()===r.key.toLowerCase()&&t(r)})},M$={expandSiblings:["control+*"],moveFocusToFirstItem:["home"],moveFocusToLastItem:["end"],primaryAction:["enter"],renameItem:["f2"],abortRenameItem:["escape"],toggleSelectItem:["control+ "],abortSearch:["escape","enter"],startSearch:[],selectAll:["control+a"],startProgrammaticDnd:["control+shift+d"],completeProgrammaticDnd:["enter"],abortProgrammaticDnd:["escape"]},Ay=function(){return Ay=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Ay.apply(this,arguments)},l9=function(){var e=en();return x.useMemo(function(){return e.keyboardBindings?Ay(Ay({},M$),e.keyboardBindings):M$},[e.keyboardBindings])},kRe=["input","textarea"],Ji=function(e,t,n,r){r===void 0&&(r=!1);var i=x.useRef([]),o=l9(),a=uf(),c=x.useMemo(function(){return o[e].map(function(d){return d.split("+")})},[e,o]);Ad(ao(),"keydown",function(d){var f;if(n!==!1&&!((kRe.includes((f=d.target.tagName)===null||f===void 0?void 0:f.toLowerCase())||d.target.isContentEditable)&&!r)&&!i.current.includes(d.key)){i.current.push(d.key);var p=i.current.map(function(v){return v.toLowerCase()}),h=c.map(function(v){return p.map(function(y){return v.includes(y.toLowerCase())}).reduce(function(y,b){return y&&b},!0)}).reduce(function(v,y){return v||y},!1);h&&(i.current.length>1||!/^[a-zA-Z\s]$/.test(d.key))&&d.preventDefault()}}),Ad(ao(),"keyup",function(d){if(n!==!1){var f=i.current.map(function(h){return h.toLowerCase()}),p=c.map(function(h){return h.map(function(v){return f.includes(v.toLowerCase())}).reduce(function(v,y){return v&&y},!0)}).reduce(function(h,v){return h||v},!1);p&&a(function(){return t(d)}),i.current=i.current.filter(function(h){return h!==d.key})}})},lh=function(){var e,t=Br().treeId,n=en().viewState;return(e=n[t])!==null&&e!==void 0?e:{}},jx=function(e){return en().linearItems[e]},jRe=function(){var e=Br().treeId,t=en(),n=t.onFocusItem,r=t.items,i=jx(e),o=lh();return so(function(a){var c,d=(c=i.findIndex(function(v){return v.item===o.focusedItem}))!==null&&c!==void 0?c:0,f=a(d,i),p=Math.max(0,Math.min(i.length-1,f)),h=r[i[p].item];return n?.(h,e),h})},P$=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},RRe=function(e){var t=x.useRef({target:e,previous:void 0});return t.current.target!==e&&(t.current.previous=t.current.target,t.current.target=e),t.current.previous},c9=function(e){var t=lh(),n=Br().treeId,r=jx(n),i=en().onSelectItems,o=RRe(t.focusedItem);return x.useCallback(function(a,c){var d,f;c===void 0&&(c=!1);var p=a.index,h=function(C,E){var k=P$(P$([],c?[]:C,!0),E.filter(function(j){return c||!C.includes(j)}),!0);i?.(k,n)};if(t&&t.selectedItems&&t.selectedItems.length>0){var v=t.focusedItem===p?o:t.focusedItem,y=e==="last-focus"?r.findIndex(function(C){return v===C.item}):r.findIndex(function(C){var E;return(E=t.selectedItems)===null||E===void 0?void 0:E.includes(C.item)}),b=r.findIndex(function(C){return C.item===p});if(y<b){var S=r.slice(y,b+1).map(function(C){var E=C.item;return E});h((d=t.selectedItems)!==null&&d!==void 0?d:[],S)}else{var S=r.slice(b,y+1).map(function(E){var k=E.item;return k});h((f=t.selectedItems)!==null&&f!==void 0?f:[],S)}}else i?.([p],n)},[t,i,n,e,r,o])},z$=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},IRe=function(){var e,t=en(),n=Br(),r=n.treeId,i=n.setRenamingItem,o=n.setSearch,a=n.renamingItem,c=jx(r),d=pa(),f=lh(),p=jRe(),h=c9("first-selected"),v=t.activeTreeId===r,y=!!a,b=t.disableArrowKeys,S=!b&&v&&!y;lv("arrowdown",function(C){if(C.preventDefault(),d.isProgrammaticallyDragging)d.programmaticDragDown();else{var E=p(function(k){return k+1});C.shiftKey&&h(E)}},S),lv("arrowup",function(C){if(C.preventDefault(),d.isProgrammaticallyDragging)d.programmaticDragUp();else{var E=p(function(k){return k-1});C.shiftKey&&h(E)}},S),Ji("moveFocusToFirstItem",function(C){C.preventDefault(),p(function(){return 0})},v&&!d.isProgrammaticallyDragging&&!y),Ji("moveFocusToLastItem",function(C){C.preventDefault(),p(function(E,k){return k.length-1})},v&&!d.isProgrammaticallyDragging&&!y),lv("arrowright",function(C){C.preventDefault(),p(function(E,k){var j,I,A=t.items[k[E].item];if(A.isFolder){if(!((j=f.expandedItems)===null||j===void 0)&&j.includes(A.index))return E+1;(I=t.onExpandItem)===null||I===void 0||I.call(t,A,r)}return E})},S&&!d.isProgrammaticallyDragging),lv("arrowleft",function(C){C.preventDefault(),p(function(E,k){var j,I,A=t.items[k[E].item],N=k[E].depth;if(A.isFolder&&(!((j=f.expandedItems)===null||j===void 0)&&j.includes(A.index)))(I=t.onCollapseItem)===null||I===void 0||I.call(t,A,r);else if(N>0){var T=E;for(T;k[T].depth!==N-1;T-=1);return T}return E})},S&&!d.isProgrammaticallyDragging),Ji("primaryAction",function(C){var E,k;C.preventDefault(),f.focusedItem!==void 0&&((E=t.onSelectItems)===null||E===void 0||E.call(t,[f.focusedItem],r),(k=t.onPrimaryAction)===null||k===void 0||k.call(t,t.items[f.focusedItem],r))},v&&!d.isProgrammaticallyDragging&&!y),Ji("toggleSelectItem",function(C){var E,k,j;C.preventDefault(),C.stopPropagation(),f.focusedItem!==void 0&&(f.selectedItems&&f.selectedItems.includes(f.focusedItem)?(E=t.onSelectItems)===null||E===void 0||E.call(t,f.selectedItems.filter(function(I){return I!==f.focusedItem}),r):(k=t.onSelectItems)===null||k===void 0||k.call(t,z$(z$([],(j=f.selectedItems)!==null&&j!==void 0?j:[],!0),[f.focusedItem],!1),r))},v&&!d.isProgrammaticallyDragging&&!y),Ji("selectAll",function(C){var E;C.preventDefault(),(E=t.onSelectItems)===null||E===void 0||E.call(t,c.map(function(k){var j=k.item;return j}),r)},v&&!d.isProgrammaticallyDragging&&!y),Ji("renameItem",function(C){var E;if(f.focusedItem!==void 0){C.preventDefault();var k=t.items[f.focusedItem];k.canRename!==!1&&((E=t.onStartRenamingItem)===null||E===void 0||E.call(t,k,r),i(k.index))}},v&&((e=t.canRename)!==null&&e!==void 0?e:!0)&&!y),Ji("startSearch",function(C){var E,k;C.preventDefault(),o(""),(k=(E=document.querySelector('[data-rct-search-input="true"]'))===null||E===void 0?void 0:E.focus)===null||k===void 0||k.call(E)},v&&!d.isProgrammaticallyDragging&&!y),Ji("startProgrammaticDnd",function(C){C.preventDefault(),d.startProgrammaticDrag()},v&&!y),Ji("completeProgrammaticDnd",function(C){C.preventDefault(),d.completeProgrammaticDrag()},v&&d.isProgrammaticallyDragging&&!y),Ji("abortProgrammaticDnd",function(C){C.preventDefault(),d.abortProgrammaticDrag()},v&&d.isProgrammaticallyDragging&&!y)},u9=function(e,t,n){return n.toLowerCase().includes(e.toLowerCase())},NRe=function(){var e=en(),t=e.doesSearchMatchItem,n=e.items,r=e.getItemTitle,i=e.onFocusItem,o=Br(),a=o.search,c=o.treeId,d=jx(c),f=uf();Iy(function(){a&&a.length>0&&f(function(){var p=d.find(function(h){var v=h.item;return(t??u9)(a,n[v],r(n[v]))});p&&i?.(n[p.item],c)})},[t,r,d,n,i,a,c,f],[a])},fC=function(){return fC=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},fC.apply(this,arguments)},TRe=function(e){var t,n=e.containerRef,r=Br(),i=r.search,o=r.setSearch,a=r.treeId,c=r.renderers,d=r.renamingItem,f=en();lh();var p=f.activeTreeId===a,h=uf();NRe();var v=function(){var y,b,S;if(o(null),!((y=f.autoFocus)!==null&&y!==void 0)||y){var C=(b=ao())===null||b===void 0?void 0:b.querySelector('[data-rct-tree="'.concat(a,'"] [data-rct-item-focus="true"]'));(S=C?.focus)===null||S===void 0||S.call(C)}};return Ji("abortSearch",function(){h(function(){v()})},p&&i!==null,!0),Ad(n,"keydown",function(y){var b,S,C=y.key.charCodeAt(0);(!((b=f.canSearch)!==null&&b!==void 0)||b)&&(!((S=f.canSearchByStartingTyping)!==null&&S!==void 0)||S)&&p&&i===null&&!d&&!y.ctrlKey&&!y.shiftKey&&!y.altKey&&!y.metaKey&&(C>=48&&C<=57||C>=97&&C<=122)&&o("")}),!(!((t=f.canSearch)!==null&&t!==void 0)||t)||i===null?null:c.renderSearchInput({inputProps:fC({value:i,onChange:function(y){return o(y.target.value)},onBlur:function(){v()},ref:function(y){var b;(b=y?.focus)===null||b===void 0||b.call(y)},"aria-label":"Search for items"},{"data-rct-search-input":"true"})})},ARe={introduction:`
|
|
143
|
-
<p>Accessibility guide for tree {treeLabel}.</p>
|
|
144
|
-
<p>
|
|
145
|
-
Navigate the tree with the arrow keys. Common tree hotkeys apply. Further keybindings are available:
|
|
146
|
-
</p>
|
|
147
|
-
<ul>
|
|
148
|
-
<li>{keybinding:primaryAction} to execute primary action on focused item</li>
|
|
149
|
-
<li>{keybinding:renameItem} to start renaming the focused item</li>
|
|
150
|
-
<li>{keybinding:abortRenameItem} to abort renaming an item</li>
|
|
151
|
-
<li>{keybinding:startProgrammaticDnd} to start dragging selected items</li>
|
|
152
|
-
</ul>
|
|
153
|
-
`,renamingItem:`
|
|
154
|
-
<p>Renaming the item {renamingItem}.</p>
|
|
155
|
-
<p>Use the keybinding {keybinding:abortRenameItem} to abort renaming.</p>
|
|
156
|
-
`,searching:`
|
|
157
|
-
<p>Searching</p>
|
|
158
|
-
`,programmaticallyDragging:`
|
|
159
|
-
<p>Dragging items {dragItems}.</p>
|
|
160
|
-
<p>Press the arrow keys to move the drag target.</p>
|
|
161
|
-
<p>Press {keybinding:completeProgrammaticDnd} to drop or {keybinding:abortProgrammaticDnd} to abort.</p>
|
|
162
|
-
`,programmaticallyDraggingTarget:`
|
|
163
|
-
<p>Drop target is {dropTarget}.</p>
|
|
164
|
-
`},Cm=function(e,t,n,r,i){var o=function(a){return t.getItemTitle(t.items[a])};return e.replace(/({[^\s}]+)}/g,function(a){var c,d,f,p=a.slice(1,-1);switch(p){case"treeLabel":return(c=r.treeLabel)!==null&&c!==void 0?c:"";case"renamingItem":return r.renamingItem?o(r.renamingItem):"None";case"dragItems":return(f=(d=n.draggingItems)===null||d===void 0?void 0:d.map(function(y){return t.getItemTitle(y)}).join(", "))!==null&&f!==void 0?f:"None";case"dropTarget":{if(!n.draggingPosition)return"None";if(n.draggingPosition.targetType==="item"||n.draggingPosition.targetType==="root")return"within ".concat(o(n.draggingPosition.targetItem));var h=t.items[n.draggingPosition.parentItem],v=t.getItemTitle(h);return n.draggingPosition.childIndex===0?"within ".concat(v," at the start"):"within ".concat(v," after ").concat(o(h.children[n.draggingPosition.childIndex-1]))}default:if(p.startsWith("keybinding:"))return i[p.slice(11)][0];throw Error("Unknown live descriptor variable {".concat(p,"}"))}})},Em=function(e){var t=e.children,n=e.live;return x.createElement("div",{"aria-live":n,dangerouslySetInnerHTML:{__html:t}})},ORe=function(){var e=en(),t=Br(),n=pa(),r=l9(),i=x.useMemo(function(){var a;return(a=e.liveDescriptors)!==null&&a!==void 0?a:ARe},[e.liveDescriptors]),o=t.renderers.renderLiveDescriptorContainer;return t.treeInformation.isRenaming?x.createElement(o,{tree:t},x.createElement(Em,{live:"polite"},Cm(i.renamingItem,e,n,t,r))):t.treeInformation.isSearching?x.createElement(o,{tree:t},x.createElement(Em,{live:"polite"},Cm(i.searching,e,n,t,r))):t.treeInformation.isProgrammaticallyDragging?x.createElement(o,{tree:t},x.createElement(Em,{live:"polite"},Cm(i.programmaticallyDragging,e,n,t,r)),x.createElement(Em,{live:"assertive"},Cm(i.programmaticallyDraggingTarget,e,n,t,r))):x.createElement(o,{tree:t},x.createElement(Em,{live:"off"},Cm(i.introduction,e,n,t,r)))},DRe=function(){var e,t=en();return!((e=t.showLiveDescription)!==null&&e!==void 0)||e?x.createElement(ORe,null):null},mC=function(){return mC=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},mC.apply(this,arguments)},$Re=function(){var e=Br(),t=e.treeId,n=e.rootItem,r=e.renderers,i=e.treeInformation,o=en(),a=x.useRef(),c=pa();IRe(),ERe(a.current,function(){o.setActiveTree(t)},function(){o.setActiveTree(function(h){return h===t?void 0:h})});var d=o.items[n].children,f=x.createElement(x.Fragment,null,x.createElement(DRe,null),x.createElement(f9,{depth:0,parentId:n},d??[]),x.createElement(CRe,{treeId:t}),x.createElement(TRe,{containerRef:a.current})),p=mC({onDragOver:function(h){h.preventDefault(),c.onDragOverTreeHandler(h,t,a)},onDragLeave:function(h){c.onDragLeaveContainerHandler(h,a)},onMouseDown:function(){return c.abortProgrammaticDrag()},ref:a,style:{position:"relative"},role:"tree","aria-label":i.treeLabelledBy?void 0:i.treeLabel,"aria-labelledby":i.treeLabelledBy},{"data-rct-tree":t});return r.renderTreeContainer({children:f,info:i,containerProps:p})},MRe=function(e,t,n){var r,i=en(),o=pa(),a=(r=i.viewState[e.treeId])===null||r===void 0?void 0:r.selectedItems;return x.useMemo(function(){var c,d;return{isFocused:i.activeTreeId===e.treeId,isRenaming:!!t,areItemsSelected:((c=a?.length)!==null&&c!==void 0?c:0)>0,isSearching:n!==null,search:n,isProgrammaticallyDragging:(d=o.isProgrammaticallyDragging)!==null&&d!==void 0?d:!1,treeId:e.treeId,rootItem:e.rootItem,treeLabel:e.treeLabel,treeLabelledBy:e.treeLabelledBy}},[i.activeTreeId,e.treeId,e.rootItem,e.treeLabel,e.treeLabelledBy,t,a?.length,n,o.isProgrammaticallyDragging])},Gm=function(){return Gm=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Gm.apply(this,arguments)},PRe=function(e,t){var n=en(),r=Br(),i=pa();x.useImperativeHandle(e,function(){return Gm(Gm(Gm({},t),{treeEnvironmentContext:n,dragAndDropContext:i,treeContext:r}),r.treeInformation)})},zRe=x.createContext(null),LRe=x.forwardRef(function(e,t){en();var n=Br();pa();var r=gRe(),i=x.useMemo(function(){return{abortRenamingItem:function(){n.setRenamingItem(null)},abortSearch:function(){n.setSearch(null)},collapseItem:function(o){r.collapseItem(o,n.treeId)},completeRenamingItem:function(){},expandItem:function(o){r.expandItem(o,n.treeId)},focusItem:function(o,a){a===void 0&&(a=!0),r.focusItem(o,n.treeId,a)},focusTree:function(o){o===void 0&&(o=!0),r.focusTree(n.treeId,o)},invokePrimaryAction:function(o){r.invokePrimaryAction(o,n.treeId)},moveFocusDown:function(){r.moveFocusDown(n.treeId)},moveFocusUp:function(){r.moveFocusUp(n.treeId)},renameItem:function(o,a){r.renameItem(o,a,n.treeId)},selectItems:function(o){r.selectItems(o,n.treeId)},setSearch:function(o){n.setSearch(o)},startRenamingItem:function(o){n.setRenamingItem(o)},stopRenamingItem:function(){n.setRenamingItem(null)},toggleItemExpandedState:function(o){r.toggleItemExpandedState(o,n.treeId)},toggleItemSelectStatus:function(o){r.toggleItemSelectStatus(o,n.treeId)},expandAll:function(){r.expandAll(n.treeId)},collapseAll:function(){r.collapseAll(n.treeId)},expandSubsequently:function(o){return r.expandSubsequently(n.treeId,o)}}},[r,n]);return PRe(t,i),x.createElement(zRe.Provider,{value:i},e.children)}),Oy=function(){return Oy=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Oy.apply(this,arguments)},d9=x.createContext(null),Br=function(){return x.useContext(d9)},URe=x.forwardRef(function(e,t){var n,r=en(),i=x.useMemo(function(){return Oy(Oy({},r),e)},[e,r]),o=x.useState(null),a=o[0],c=o[1],d=x.useState(null),f=d[0],p=d[1],h=r.items[e.rootItem],v=r.viewState[e.treeId];x.useEffect(function(){return r.registerTree({treeId:e.treeId,rootItem:e.rootItem}),function(){return r.unregisterTree(e.treeId)}},[e.treeId,e.rootItem]);var y=MRe(e,f,a),b=x.useMemo(function(){return{treeId:e.treeId,rootItem:e.rootItem,treeLabel:e.treeLabel,treeLabelledBy:e.treeLabelledBy,getItemsLinearly:function(){return bR(e.rootItem,v??{},r.items)},treeInformation:y,search:a,setSearch:c,renamingItem:f,setRenamingItem:p,renderers:i}},[r.items,e.rootItem,e.treeId,e.treeLabel,e.treeLabelledBy,f,i,a,y,v]);return h===void 0?((n=r.onMissingItems)===null||n===void 0||n.call(r,[e.rootItem]),null):x.createElement(d9.Provider,{value:b},x.createElement(LRe,{ref:t},x.createElement($Re,null)))}),f9=function(e){for(var t=Br(),n=t.renderers,r=t.treeInformation,i=[],o=0,a=e.children;o<a.length;o++){var c=a[o];i.push(X.createElement(BRe,{key:c,itemIndex:c,depth:e.depth}))}if(i.length===0)return null;var d={role:e.depth!==0?"group":void 0};return n.renderItemsContainer({children:i,info:r,containerProps:d,depth:e.depth,parentId:e.parentId})},Ds=function(){return Ds=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Ds.apply(this,arguments)},L$=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},FRe=function(e){var t,n,r,i,o=Br(),a=o.treeId,c=o.search,d=o.renamingItem,f=o.setRenamingItem,p=en(),h=lRe(),v=pa(),y=c9("last-focus"),b=e&&p.getItemTitle(e),S=t9(),C=x.useMemo(function(){var I;return c===null||c.length===0||!e||!b?!1:((I=p.doesSearchMatchItem)!==null&&I!==void 0?I:u9)(c,e,b)},[c,e,b,p.doesSearchMatchItem]),E=e&&((n=(t=p.viewState[a])===null||t===void 0?void 0:t.selectedItems)===null||n===void 0?void 0:n.includes(e.index)),k=e&&((i=(r=p.viewState[a])===null||r===void 0?void 0:r.expandedItems)===null||i===void 0?void 0:i.includes(e.index)),j=e&&d===e.index;return x.useMemo(function(){var I,A,N,T,z,L,G,J,Y;if(e){var W=p.viewState[a],F=((A=(I=W?.selectedItems)===null||I===void 0?void 0:I.map(function(B){return p.items[B]}))!==null&&A!==void 0?A:W?.focusedItem?[p.items[W?.focusedItem]]:[]).filter(function(B){return!!B}),Z=!!F.find(function(B){return B.index===e.index}),M=F&&((T=(N=p.canDrag)===null||N===void 0?void 0:N.call(p,F))!==null&&T!==void 0?T:!0)&&F.map(function(B){var ie;return(ie=B.canMove)!==null&&ie!==void 0?ie:!0}).reduce(function(B,ie){return B&&ie},!0),K=((L=(z=p.canDrag)===null||z===void 0?void 0:z.call(p,[e]))!==null&&L!==void 0?L:!0)&&((G=e.canMove)!==null&&G!==void 0?G:!0),U=p.canDragAndDrop&&(Z&&M||!Z&&K),te=p.canDragAndDrop&&!!(!((Y=(J=v.viableDragPositions)===null||J===void 0?void 0:J[a])===null||Y===void 0)&&Y.find(function(B){return B.targetType==="item"&&B.targetItem===e.index})),D={primaryAction:function(){var B;(B=p.onPrimaryAction)===null||B===void 0||B.call(p,p.items[e.index],a)},collapseItem:function(){var B;(B=p.onCollapseItem)===null||B===void 0||B.call(p,e,a)},expandItem:function(){var B;(B=p.onExpandItem)===null||B===void 0||B.call(p,e,a)},toggleExpandedState:function(){var B,ie;k?(B=p.onCollapseItem)===null||B===void 0||B.call(p,e,a):(ie=p.onExpandItem)===null||ie===void 0||ie.call(p,e,a)},selectItem:function(){var B;(B=p.onSelectItems)===null||B===void 0||B.call(p,[e.index],a)},addToSelectedItems:function(){var B,ie;(B=p.onSelectItems)===null||B===void 0||B.call(p,L$(L$([],(ie=W?.selectedItems)!==null&&ie!==void 0?ie:[],!0),[e.index],!1),a)},unselectItem:function(){var B,ie,Se;(B=p.onSelectItems)===null||B===void 0||B.call(p,(Se=(ie=W?.selectedItems)===null||ie===void 0?void 0:ie.filter(function(Ie){return Ie!==e.index}))!==null&&Se!==void 0?Se:[],a)},selectUpTo:function(B){y(e,B)},startRenamingItem:function(){f(e.index)},stopRenamingItem:function(){f(null)},focusItem:function(B){var ie;B===void 0&&(B=!0),(ie=p.onFocusItem)===null||ie===void 0||ie.call(p,e,a,B)},startDragging:function(){var B,ie,Se=(B=W?.selectedItems)!==null&&B!==void 0?B:[];if(Se.includes(e.index)||(Se=[e.index],(ie=p.onSelectItems)===null||ie===void 0||ie.call(p,Se,a)),U){var Ie=S(a,Se.map(function(Fe){return p.items[Fe]}));v.onStartDraggingItems(Ie,a)}}},P={isSelected:E,isExpanded:k,isFocused:W?.focusedItem===e.index,isRenaming:j,isDraggingOver:v.draggingPosition&&v.draggingPosition.targetType==="item"&&v.draggingPosition.targetItem===e.index&&v.draggingPosition.treeId===a,isDraggingOverParent:!1,isSearchMatching:C,canDrag:U,canDropOn:te},V=Ds(Ds({},h.createInteractiveElementProps(e,a,D,P,W)),{"data-rct-item-interactive":!0,"data-rct-item-focus":P.isFocused?"true":"false","data-rct-item-id":e.index}),O=Ds({},{"data-rct-item-container":"true"}),ee={role:"treeitem","aria-selected":P.isSelected,"aria-expanded":e.isFolder?P.isExpanded?"true":"false":void 0},ue={onClick:function(){e.isFolder&&D.toggleExpandedState(),D.selectItem()},onFocus:function(){D.focusItem()},onDragOver:function(B){B.preventDefault()},"aria-hidden":!0,tabIndex:-1},pe=W?Object.entries(W).reduce(function(B,ie){var Se=ie[0],Ie=ie[1];return B[Se]=Array.isArray(Ie)?Ie.includes(e.index):Ie===e.index,B},{}):{};return Ds(Ds(Ds({},D),P),{interactiveElementProps:V,itemContainerWithChildrenProps:ee,itemContainerWithoutChildrenProps:O,arrowProps:ue,viewStateFlags:pe})}},[e,p,a,v,E,k,j,C,h,y,f,S])},VRe=function(e){var t=Br(),n=t.renderers,r=t.treeInformation,i=t.setRenamingItem,o=t.treeId,a=en(),c=x.useRef(null),d=x.useRef(null),f=a.items[e.itemIndex],p=x.useState(a.getItemTitle(f)),h=p[0],v=p[1],y=uf(!0),b=function(){var j;(j=a.onAbortRenamingItem)===null||j===void 0||j.call(a,f,r.treeId),i(null),y(function(){a.setActiveTree(o)})},S=function(){var j;(j=a.onRenameItem)===null||j===void 0||j.call(a,f,h,r.treeId),i(null),y(function(){a.setActiveTree(o)})};Iy(function(){var j,I,A,N;a.setActiveTree(o),(!((j=a.autoFocus)!==null&&j!==void 0)||j)&&((I=c.current)===null||I===void 0||I.select(),(N=(A=c.current)===null||A===void 0?void 0:A.focus)===null||N===void 0||N.call(A))},[a,o],[]),Ji("abortRenameItem",function(){b()},!0,!0);var C={value:h,onChange:function(j){v(j.target.value)},onBlur:function(j){(!j.relatedTarget||j.relatedTarget!==d.current)&&b()},"aria-label":"New item name",tabIndex:0},E={onClick:function(j){j.stopPropagation(),S()}},k={onSubmit:function(j){j.preventDefault(),S()}};return n.renderRenameInput({item:f,inputRef:c,submitButtonProps:E,submitButtonRef:d,formProps:k,inputProps:C})},BRe=function(e){var t,n,r,i,o=x.useState(!1),a=o[0],c=o[1],d=Br(),f=d.renderers,p=d.treeInformation,h=d.renamingItem,v=en(),y=lh(),b=v.items[e.itemIndex],S=x.useMemo(function(){var N;return(N=y.expandedItems)===null||N===void 0?void 0:N.includes(e.itemIndex)},[e.itemIndex,y.expandedItems]),C=FRe(b);if(b===void 0||C===void 0)return a||(c(!0),(t=v.onMissingItems)===null||t===void 0||t.call(v,[e.itemIndex])),null;var E=(r=(n=v.shouldRenderChildren)===null||n===void 0?void 0:n.call(v,b,C))!==null&&r!==void 0?r:b.isFolder&&S,k=b.children&&E&&X.createElement(f9,{depth:e.depth+1,parentId:e.itemIndex},b.children),j=v.getItemTitle(b),I=h===e.itemIndex?X.createElement(VRe,{itemIndex:e.itemIndex}):f.renderItemTitle({info:p,context:C,title:j,item:b}),A=f.renderItemArrow({info:p,context:C,item:v.items[e.itemIndex]});return(i=f.renderItem({item:v.items[e.itemIndex],depth:e.depth,title:I,arrow:A,context:C,info:p,children:k}))!==null&&i!==void 0?i:null};function HRe(e){const t={},n=[],r=[],i=[];for(const o of e)Pr(o)?o.package?r.push(o.path):n.push(o.path):i.push(o.path),m9(t,o);return t[a_]={index:a_,isFolder:!0,children:[Ro,Hl,...n,...i],data:void 0,canMove:!1,canRename:!1},t[Hl]={index:Hl,isFolder:!0,children:r,data:{name:"Imported Applications",path:Hl,package:Hl,project:"",entries:[]},canMove:!1,canRename:!1},t[Ro]={index:Ro,isFolder:!1,data:{name:"New Application",path:Ro,project:""},canMove:!1,canRename:!1},{items:t,rootId:a_}}function m9(e,t){const n=t.path;if(Pr(t)){const r=t,i=[],o=[];for(const a of r.entries)Pr(a)?i.push(a.path):o.push(a.path);e[n]={index:n,isFolder:!0,children:[...i,...o],data:t,canMove:!1,canRename:!1};for(const a of r.entries)m9(e,a)}else e[n]={index:n,isFolder:!1,data:t,canMove:!t.package,canRename:!t.package}}function qRe(e){const t=e.data;return t&&"name"in t?t.name:"root"}const jn="w-6 ";function GRe({opened:e,pkg:t}){return t?e?u.jsx("i",{className:jn+"fas fa-box-open text-orange-600"}):u.jsx("i",{className:jn+"fas fa-box text-orange-600"}):e?u.jsx("i",{className:jn+"fas fa-folder-open text-orange-400"}):u.jsx("i",{className:jn+"fas fa-folder text-orange-400"})}function KRe({extension:e}){switch(e){case"js":return u.jsx("i",{className:jn+"filetype-js fab fa-js text-yellow"});case"jsx":return u.jsx("i",{className:jn+"filetype-jsx fab fa-js text-yellow"});case"cjs":return u.jsx("i",{className:jn+"filetype-cjs fab fa-js text-yellow"});case"yaml":return u.jsx("i",{className:jn+"filetype-yaml fas fa-file"});case"css":return u.jsx("i",{className:jn+"filetype-css fas fa-file text-blue"});case"html":return u.jsx("i",{className:jn+"filetype-unknown far fa-file-alt"});case"json":return u.jsx("i",{className:jn+"filetype-json fas fa-cog"});case"ts":return u.jsx("i",{className:jn+"filetype-ts fas fa-file text-blue"});case"tsx":return u.jsx("i",{className:jn+"filetype-tsx fas fa-file text-blue"});case"png":return u.jsx("i",{className:jn+"filetype-png fas fa-image"});case"jpg":return u.jsx("i",{className:jn+"filetype-jpg fas fa-image"});case"jpeg":return u.jsx("i",{className:jn+"filetype-jpeg fas fa-image"});case"gif":return u.jsx("i",{className:jn+"filetype-gif fas fa-image"});case"svg":return u.jsx("i",{className:jn+"filetype-svg fas fa-file-svg"});case"vue":return u.jsx("i",{className:jn+"filetype-vue fab fa-vuejs text-green"});default:return u.jsx("i",{className:jn+"filetype-unknown far fa-file-alt"})}}function ZRe(){return u.jsx("i",{className:jn+"fas fa-lock text-gray-400 ml-2"})}function YRe(){return u.jsx("i",{className:jn+"fas fa-plus text-green"})}function WRe({title:e,item:t,context:n}){const{content:r}=xx(t.data?.path);return u.jsxs(u.Fragment,{children:[t.data?.path===Ro?u.jsx(YRe,{}):Pr(t.data)?u.jsx(GRe,{opened:n.isExpanded,pkg:!!t.data?.package||t.data.path===Hl}):u.jsx(KRe,{extension:B8(e)}),u.jsxs("span",{className:"text-nowrap",children:[e,r?"*":""]}),t.data?.package&&u.jsx(ZRe,{})]})}function XRe(){const{rootEntries:e,openedEntry:t,setOpenedEntry:n,focusedItem:r,setFocusedItem:i,expandedItems:o,setExpandedItems:a,selectedItems:c,setSelectedItems:d}=mi(),{items:f,rootId:p}=x.useMemo(()=>HRe(e),[e]);x.useEffect(function(){if(t?.path!==r&&r){const C=f[r]?.data;C&&n(C)}},[r,f,t?.path,n]);const h=Y8(),v=x.useCallback((b,S)=>{switch(S.targetType){case"item":if(f[S.targetItem]?.data?.package)_e.error("Read-Only Imported Application",{description:'To make changes to an application, please click the "Redeploy" button and update the reference.'});else return h(b.map(C=>({from:C.index,to:yR(S.targetItem,rRe(C.index))})));break;default:_e.error(`${S.targetType} drop not yet supported`);break}},[f,h]),y=x.useCallback((b,S)=>{if(b.data)return h([{from:b.data.path,to:W8(b.data.path,S)}])},[h]);return u.jsx("div",{className:"h-full overflow-auto pr-1.5",children:u.jsx(_Re,{canDragAndDrop:!0,canDropOnFolder:!0,canDropOnNonFolder:!1,canReorderItems:!1,canSearch:!0,getItemTitle:qRe,items:f,onDrop:v,onRenameItem:y,renderItemTitle:WRe,viewState:{applicationsTree:{focusedItem:r,expandedItems:o,selectedItems:c}},onFocusItem:b=>i(b.index),onExpandItem:b=>a([...o,b.index]),onCollapseItem:b=>a(o.filter(S=>S!==b.index)),onSelectItems:b=>d(b),children:u.jsx(URe,{treeId:"applicationsTree",rootItem:p,treeLabel:"Applications file tree"})})})}function QRe(e,t,n){const r=t,i=t.replace(/:9925\/?/,"");return r&&(e=e.replaceAll(/https?:\/\/localhost:9926/g,i)),n.project&&(e=e.replaceAll("Your New Harper Fabric App",n.project)),e}function JRe({entityId:e,instanceClient:t}){return{queryKey:[e,"get_components"],queryFn:async()=>{const{data:n}=await t.post("/",{operation:"get_components"});return n},retry:!1}}function p9(e,t,n,r=[]){const i=[];for(const o of e){const a=n(o,r);i.push(a);const c=o,d=c[t];d&&(a[t]=p9(d,t,n,[...r,c]))}return i}function eIe({children:e}){const t=pn(),[n,r]=x.useState(void 0),[i,o]=x.useState(void 0),{setContent:a}=xx(n?.path),c=Ft(),d=gr(),{open:f}=vr({strict:!1}),p=x.useCallback(async()=>d.fetchQuery({queryKey:[c.entityId,"get_components"],networkMode:"online"}),[d,c]),{data:h}=Mi(JRe(c)),v=x.useMemo(()=>h?p9(h.entries,"entries",(M,K)=>{const U=Pr(M)&&M.entries.find(te=>te.name.toLowerCase()==="readme.md");return{name:M.name,path:[...K.map(te=>te.name),M.name].join("/"),project:(K[0]||M)?.name,package:(K[0]||M)?.package,overviewEntry:U&&!Pr(U)&&{name:U.name,path:[...K.map(te=>te.name),M.name,U.name].join("/"),project:(K[0]||M)?.name,package:(K[0]||M)?.package}||void 0}}):[],[h]),y=v.filter(M=>!M.package&&M.path!==Ro).map(M=>M.name);let b=y[0],S=y.slice(0,1);b||(b=Ro,S=[Ro]);const[C,E]=ad(`FileFocused/${c.entityId}`,b),[k,j]=ad(`FolderOpened/${c.entityId}`,y),[I,A]=ad(`FileSelected/${c.entityId}`,S);x.useEffect(()=>{if(f?.length){const M=f.split("/");j(K=>{const U=new Set(K);for(let te=1;te<M.length;te++)U.add(M.slice(0,te).join("/"));return[...U]}),A([f]),E(f),t({search:void 0})}},[t,f,j,E,A]);const N=n&&(Pr(n)?n.overviewEntry?.path:n.path)||"",T=n&&(Pr(n)?n.overviewEntry?.project:n.project)||"",z=n&&(Pr(n)?!!n.overviewEntry?.path:!1)||!1,L=Z8({file:N?.split("/").slice(1).join("/"),project:T,...c}),{data:G}=Mt(Jje({file:N?.split("/").slice(1).join("/"),project:T,...c}));x.useEffect(function(){const K=G?.project+"/"+G?.file;let U=G?.message;if(K===N&&U!==void 0){const te=c.instanceClient.defaults.baseURL;z&&te&&G&&(U=QRe(U,te,G)),o(U)}else o(void 0)},[G,N,z,c]);const{mutate:J,isPending:Y}=q8(),W=x.useCallback((M,K)=>{J(M,{onSuccess:()=>{n?.path===K&&M.payload!==void 0&&(a(void 0),o(M.payload||void 0),d.setQueryData(L,{...G,message:M.payload}))},onError:U=>{console.error("Error saving file:",U)}})},[L,G,n?.path,d,J,a]),F=x.useMemo(()=>n?n.package?.includes("github.com/HarperDB/status-check-fabric")||n.package?.includes("github.com/HarperFast/status-check-fabric")||n.path===Hl||n.path===Ro:!1,[n]),Z=x.useMemo(()=>({rootEntries:v,reloadRootEntries:p,focusedItem:C,setFocusedItem:E,expandedItems:k,setExpandedItems:j,selectedItems:I,setSelectedItems:A,restrictPackageModification:F,openedEntry:n,setOpenedEntry:r,openedEntryContents:i,setOpenedEntryContents:o,saveFile:W,isSavingFile:Y}),[v,p,C,E,k,j,I,A,F,n,r,i,o,W,Y]);return u.jsx($H.Provider,{value:Z,children:e})}function tIe(){const{toggle:e,toggled:t}=nRe("ApplicationsSidebarOpened",!0);return u.jsxs(eIe,{children:[u.jsx("aside",{id:"file-explorer-sidebar",className:aa("pt-[calc(theme(spacing.32))] w-56 fixed top-0 left-0 bottom-0 z-30","bg-black-dark shadow shadow-black","transition-transform -translate-x-full",t?"translate-x-0":"md:translate-x-0"),"aria-label":"Sidebar",children:u.jsx(XRe,{})}),u.jsxs("div",{className:aa("applications-content overflow-y-auto overflow-x-hidden fixed bottom-0 right-0 left-0 md:left-56 transition-[left] h-[calc(100vh-theme(spacing.32))]",t&&"sm:left-56"),children:[u.jsx(qje,{}),u.jsx(N_e,{toggledSidebar:t,toggleSidebar:e})]}),u.jsx(Gje,{}),u.jsx(Zje,{}),u.jsx(Xje,{}),u.jsx(Qje,{}),u.jsx(tRe,{})]})}function nIe(e){return[Qe({getParentRoute:()=>e,path:"/",component:tIe})]}const Us="flex items-center p-2 rounded-lg group",Fs={className:"text-white hover:bg-gray-700"},Vs={className:"text-black bg-white pointer-events-none cursor-default"};function rIe(){return u.jsxs("div",{className:"md:grid gap-4 md:grid-cols-12 min-h-[calc(100vh-theme(spacing.36))]",children:[u.jsxs("section",{className:"col-span-1 text-white md:col-span-4 lg:col-span-3 md:border-r-1 border-b md:border-b-0 md:pr-4 border-gray-700",children:[u.jsx(iIe,{}),u.jsx(oIe,{})]}),u.jsx("section",{className:"col-span-1 text-white md:col-span-8 lg:col-span-9 md:pt-4",children:u.jsx(x.Suspense,{fallback:u.jsx(Ui,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:u.jsx(ll,{})})})]})}function iIe(){const e=tt({strict:!1}),t=pE();return u.jsxs("div",{className:"hidden md:block pl-4 pt-4",children:[u.jsxs(Ge,{to:tr(e,"config"),className:Us,activeOptions:{exact:!0},inactiveProps:Fs,activeProps:Vs,children:[u.jsx(RP,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Overview"})]}),t&&u.jsxs("ul",{className:"border-t border-gray-700 pt-4 mt-4 space-y-2",children:[u.jsx("li",{children:u.jsxs(Ge,{to:tr(e,"config/users"),className:Us,inactiveProps:Fs,activeProps:Vs,children:[u.jsx(FP,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Users"})]})}),u.jsx("li",{children:u.jsxs(Ge,{to:tr(e,"config/roles"),className:Us,inactiveProps:Fs,activeProps:Vs,children:[u.jsx(DP,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Roles"})]})}),u.jsx("li",{children:u.jsxs(Ge,{to:tr(e,"config/ssh-keys"),className:Us,inactiveProps:Fs,activeProps:Vs,children:[u.jsx($P,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"SSH Keys"})]})})]})]})}function oIe(){const e=tt({strict:!1}),t=pE();return u.jsxs("ul",{className:"flex space-x-4 md:hidden py-2 px-4",children:[u.jsx("li",{children:u.jsxs(Ge,{to:tr(e,"config"),className:Us,activeOptions:{exact:!0},inactiveProps:Fs,activeProps:Vs,children:[u.jsx(RP,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Overview"})]})}),t&&u.jsxs(u.Fragment,{children:[u.jsx("li",{children:u.jsxs(Ge,{to:tr(e,"config/users"),className:Us,inactiveProps:Fs,activeProps:Vs,children:[u.jsx(FP,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Users"})]})}),u.jsx("li",{children:u.jsxs(Ge,{to:tr(e,"config/roles"),className:Us,inactiveProps:Fs,activeProps:Vs,children:[u.jsx(DP,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Roles"})]})}),u.jsx("li",{children:u.jsxs(Ge,{to:tr(e,"config/ssh-keys"),className:Us,inactiveProps:Fs,activeProps:Vs,children:[u.jsx($P,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"SSH Keys"})]})})]})]})}async function aIe({clusterId:e,instanceId:t}){return null}function sIe(e){return{queryKey:[e.clusterId,e.instanceId],queryFn:()=>aIe(e),retry:!1}}const lIe=({loadingRegistration:e,registrationInfo:t})=>u.jsxs(u.Fragment,{children:[u.jsx("dt",{className:"font-bold text-sm/6",children:"Harper Version"}),u.jsx("dd",{className:"text-sm/6 sm:mt-2",children:e?u.jsx(Er,{className:"w-10"}):t?.version||"Unknown"})]});function cIe({entityId:e,instanceClient:t}){return{queryKey:[e,"get_configuration"],queryFn:async()=>{const{data:n}=await t.post("/",{operation:"get_configuration"});return n}}}function xR({entityId:e,instanceClient:t}){return{queryKey:[e,"registration_info"],staleTime:6e4,queryFn:async()=>{const{data:n}=await t.post("/",{operation:"registration_info"});return n}}}function uIe({entityId:e,instanceClient:t}){return{queryKey:[e,"get_usage_licenses"],enabled:!Qu,queryFn:async()=>{try{const{data:n}=await t.post("/",{operation:"get_usage_licenses"});return n}catch(n){return console.error(n),null}}}}const dIe=({children:e})=>u.jsx(u.Fragment,{children:e});function fIe(){const{clusterId:e,instanceId:t}=tt({strict:!1}),{instance:n}=xp({strict:!1}),r="Instance",i=Ft(),{data:o,isLoading:a}=Mt(sIe({clusterId:e,instanceId:t})),{data:c}=Mt(uIe(i));o?.cluster,o?.instance;const{data:d,isLoading:f}=Mt(xR(i)),{data:p,isLoading:h}=Mt(cIe(i));return x.useMemo(()=>{if(e&&!t)return[];if(c&&n?.licenses){const v=of(c,"id");return n.licenses.filter(y=>!v[y.id])}return[]},[e,t,c,n]),u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsx(dIe,{children:u.jsxs("dl",{className:"grid grid-cols-1 sm:grid-cols-3",children:[u.jsx("div",{className:"px-4 pb-4 sm:col-span-2 sm:px-0",children:u.jsx(lIe,{loadingRegistration:f,registrationInfo:d})}),u.jsx("div",{className:"px-4 pb-4 text-right sm:col-span-1 sm:px-0",children:u.jsx(DH,{targetNoun:r,instanceClient:i.instanceClient,operation:"restart"})})]})}),u.jsx("h3",{className:"flex-none font-bold text-sm/6",children:"Instance Config (read only)"}),!t&&u.jsx("p",{className:"text-muted-foreground italic text-sm mb-2",children:"You are viewing the config for one instance in your cluster, based on what the load balancer selected for you."}),u.jsx("div",{className:"grow",children:h?u.jsxs(u.Fragment,{children:[u.jsx(Er,{className:"w-full"}),u.jsx(Er,{className:"w-full"}),u.jsx(Er,{className:"w-1/2"})]}):u.jsx(vx,{className:"w-full min-h-full h-96",language:"json",theme:"vs-dark",options:{readOnly:!0,scrollBeyondLastLine:!1},value:JSON.stringify(p,null,4)})})]})}const cv=cx(),mIe=[{header:"Role",accessorKey:"role",enableSorting:!1},cv.display({header:"Created",enableSorting:!1,id:"__createdtime__",cell:e=>sc((Date.now()-e.row.original.__createdtime__)/1e3,e.row.original.__createdtime__)}),cv.display({header:"Updated",id:"__updatedtime__",enableSorting:!1,cell:e=>sc((Date.now()-e.row.original.__updatedtime__)/1e3,e.row.original.__updatedtime__)}),cv.display({header:"Super User",id:"super_user",enableSorting:!1,cell:e=>e.row.original.permission.super_user?"Yes":"No"}),cv.display({header:"Structure User",id:"structure_user",enableSorting:!1,cell:e=>e.row.original.permission.structure_user?"Yes":"No"})];async function pIe(e){const{role:t,super_user:n,structure_user:r,instanceClient:i}=e,{data:o}=await i.post("/",{operation:"add_role",role:t,permission:{super_user:n,structure_user:r}});return o}function hIe(){return at({mutationFn:pIe})}const gIe=mn({role:nt().nonempty({error:"Please enter a role."}).regex(/^[a-zA-Z_]*$/,{error:"Role must contain only letters and underscores."}).max(30,{error:"Role cannot be longer than 30 characters."}),super_user:jd(),structure_user:jd()});function vIe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const r=Qt({resolver:ln(gIe),defaultValues:{role:"",super_user:!1,structure_user:!1}}),i=Ft(),{mutate:o,isPending:a}=hIe(),c=x.useCallback(async f=>{f&&o({role:f.role,super_user:f.super_user,structure_user:f.structure_user,...i},{onSuccess:()=>{r.reset(),t(f.role),_e.success("Role added successfully!"),n(!1)}})},[o,r,i,t,n]),d=x.useCallback(()=>{r.reset(),n(!1)},[r,n]);return u.jsx(zn,{onOpenChange:n,open:e,children:u.jsx(Ln,{"aria-describedby":void 0,children:u.jsx(Jt,{...r,children:u.jsxs("form",{onSubmit:r.handleSubmit(c),className:"grid gap-4 my-4 md:grid-cols-2",children:[u.jsxs(yr,{className:"md:col-span-2",children:[u.jsx(Nn,{children:"Add New Role"}),u.jsx(jr,{children:"After adding the role, you will be able to edit the per-table permissions."})]}),u.jsx(Me,{control:r.control,name:"role",render:({field:f})=>u.jsxs(Ae,{className:"md:col-span-2",children:[u.jsx(Oe,{className:"pb-1",children:"Name"}),u.jsx($e,{children:u.jsx(ze,{type:"text",...f})}),u.jsx(De,{})]})}),u.jsx(Me,{control:r.control,name:"super_user",render:({field:f})=>u.jsxs(Ae,{className:"flex",children:[u.jsx($e,{children:u.jsx(ze,{type:"checkbox",className:"w-6",checked:f.value,onChange:p=>f.onChange(p.target.checked)})}),u.jsx(Oe,{className:"pl-4 pr-8 flex-1 py-2.5",children:"Super User"}),u.jsx(De,{})]})}),u.jsx(Me,{control:r.control,name:"structure_user",render:({field:f})=>u.jsxs(Ae,{className:"flex",children:[u.jsx($e,{children:u.jsx(ze,{type:"checkbox",className:"w-6",checked:f.value,onChange:p=>f.onChange(p.target.checked)})}),u.jsx(Oe,{className:"pl-4 pr-8 flex-1 py-2.5",children:"Structure User"}),u.jsx(De,{})]})}),u.jsx(Un,{className:"md:col-span-2",children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx(be,{variant:"destructiveOutline",type:"button",className:"rounded-full",onClick:d,disabled:a,children:"Cancel"}),u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",disabled:a,children:[u.jsx(ho,{})," Add Role"]})]})})]})})})})}function wR({entityId:e,instanceClient:t}){return{queryKey:[e,"list_roles"],queryFn:()=>yIe({instanceClient:t}),refetchInterval:1e4}}async function yIe({instanceClient:e}){const{data:t}=await e.post("/",{operation:"list_roles"});return t}function bIe({instanceDatabaseMap:e,currentRolePermissions:t,version:n,showAttributes:r}){const i={...t};if(t.super_user||t.structure_user||t.cluster_user)return t;const[o,a,c]=n.split(".").map(f=>parseInt(f,10)),d=n!=="2.0.000"&&o<=2&&a<=1&&c<=2;for(const f in e){i[f]={tables:{}};for(const p in e[f]){const v=e[f][p].attributes.map(y=>y.attribute).sort();if(d){const y=t&&t[f]&&t[f].tables[p];i[f].tables[p]=xIe(y,v,r)}else{const y=t&&t[f]&&t[f].tables[p];i[f].tables[p]=wIe(y,v,r)}}}return i}function xIe(e,t,n){const r=e&&of(e.attribute_restrictions,"attribute_name");return{read:e?e.read:!0,insert:e?e.insert:!0,update:e?e.update:!0,delete:e?e.delete:!0,attribute_restrictions:t.filter(()=>n).map(i=>{const o=r?.[i];return{attribute_name:i,read:o?o.read:e?e.read:!0,insert:o?o.insert:e?e.insert:!0,update:o?o.update:e?e.update:!0,delete:o?o.delete:e?e.delete:!0}})}}function wIe(e,t,n){const r=e&&of(e.attribute_permissions||[],"attribute_name");return{read:e?e.read:!1,insert:e?e.insert:!1,update:e?e.update:!1,delete:e?e.delete:!1,attribute_permissions:n?t.map(i=>{const o=r?.[i];return{attribute_name:i,read:o?o.read:e?.attribute_permissions?.length?!1:e?.read||!1,insert:o?o.insert:e?.attribute_permissions?.length?!1:e?.insert||!1,update:o?o.update:e?.attribute_permissions?.length?!1:e?.update||!1}}):null}}async function SIe({id:e,permission:t,instanceClient:n}){const{data:r}=await n.post("/",{operation:"alter_role",id:e,permission:t});return r}function _Ie(){return at({mutationFn:SIe})}async function CIe({id:e,instanceClient:t}){const{data:n}=await t.post("/",{operation:"drop_role",id:e});return n}function EIe(){return at({mutationFn:CIe})}function h9({entityId:e,instanceClient:t}){return{queryKey:[e,"describe_all"],queryFn:async({signal:n})=>{const{data:r}=await t.post("/",{operation:"describe_all"},{signal:n});return r},staleTime:60*1e3,retry:!1}}function kIe({data:e,instanceId:t,clusterId:n,isModalOpen:r,closeModal:i,onSelectRole:o,onChangesSaved:a}){const{role:c,permission:d}=e,[f,p]=x.useState(JSON.stringify(d,null,2)),h=Ft(),[v,y]=x.useState(!0),{data:b}=Mt(h9(h)),{data:S}=Mt(xR(h)),E=Ja().user?.role?.role===e.role,[k,j]=EH(f?.includes("attribute_name")),{mutate:I,isPending:A}=_Ie(),{mutate:N}=EIe(),T=x.useCallback(W=>{y(W.length===0)},[y]),z=x.useMemo(()=>JSON.stringify(b&&S&&bIe({instanceDatabaseMap:b,currentRolePermissions:f&&Bj(f)||d,version:S.version,showAttributes:k}),null,2),[d,b,S,k,f]);x.useEffect(()=>{p(z)},[z]);const L=x.useCallback(W=>{if(W){const F=JSON.parse(W);if(F.super_user||F.structure_user||F.cluster_user)for(const Z in F)(Z!=="super_user"&&Z!=="structure_user"&&Z!=="cluster_user"||F[Z]===!1)&&delete F[Z];I({id:e.id,permission:F,...h},{onSuccess:()=>{_e.success("Role updated successfully!"),o(void 0),a()}})}},[I,e.id,h,a,o]),G=x.useCallback(()=>{N({id:e.id,...h},{onSuccess:()=>{_e.success("Role deleted successfully!"),o(void 0),a()}})},[e.id,N,h,a,o]),J=x.useCallback(()=>{f&&v&&L(f)},[f,L,v]),Y=x.useCallback(()=>{G()},[G]);return u.jsx(zn,{onOpenChange:i,open:r,children:u.jsxs(Ln,{className:"sm:max-w-[750px]",children:[u.jsxs(Nn,{children:[E?"View":"Edit",' Role "',c,'"']}),u.jsx(jr,{children:E?"You can view your own role, but you cannot edit it. Please assign yourself a different role to edit this role.":"Edit the role's permissions in JSON format or remove the role entirely."}),z?u.jsx(oh,{theme:"vs-dark",height:"400px",defaultLanguage:"json",value:f,options:E?{readOnly:!0}:void 0,onValidate:T,onChange:p,defaultValue:z}):u.jsx(Er,{}),u.jsx(Un,{children:!E&&u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx(be,{type:"button",variant:"destructiveOutline",className:"rounded-full",onClick:Y,disabled:A,children:"Delete Role"}),u.jsx("div",{className:"grow"}),u.jsxs(Pp,{className:"flex",children:[u.jsx(ze,{type:"checkbox",className:"w-6",checked:k,onChange:j}),u.jsx("span",{className:"pl-4 pr-8 flex-1 py-2.5",children:"Pick Attributes"})]}),u.jsx(be,{variant:"submit",className:"rounded-full",onClick:J,disabled:A||!v,children:"Save Changes"})]})})]})})}function U$(){const e=pn(),{clusterId:t,instanceId:n,roleId:r}=tt({strict:!1}),i=Ft(),{data:o,refetch:a,isFetching:c,isRefetching:d}=Mi(wR(i)),f=x.useMemo(()=>o?.find(j=>j.id===r),[o,r]),p=x.useCallback(j=>{const I=[r?"..":"",j].filter(Boolean);e({to:I.join("/")})},[r,e]),h=!!r&&!!f,[v,y]=x.useState(!1),b=x.useCallback(()=>{y(!0)},[y]),S=x.useCallback(j=>{a(),y(!1),p(j)},[p,a]),C=x.useCallback(j=>{p(j.original.role)},[p]),E=x.useCallback(()=>{p(void 0)},[p]),k=vl(a);return u.jsxs(x.Suspense,{fallback:u.jsx(Ui,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(sf,{columns:mIe,data:o,isFetching:c,onRowClick:C,children:[u.jsxs(be,{variant:"defaultOutline",onClick:k,accessKey:"r",disabled:c||d,children:[u.jsx(sa,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),u.jsxs(be,{variant:"positiveOutline",onClick:b,accessKey:"a",disabled:v,children:[u.jsx(po,{}),u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),u.jsx(vIe,{isModalOpen:v,onChangesSaved:S,setIsModalOpen:y}),h&&u.jsx(kIe,{instanceId:n,clusterId:t,isModalOpen:h,closeModal:E,data:f,onSelectRole:p,onChangesSaved:()=>a()})]})}async function jIe({instanceClient:e}){const{data:t}=await e.post("/",{operation:"list_ssh_keys"});return t}function RIe(e){return{queryKey:[e.entityId,"list_ssh_keys"],queryFn:()=>jIe(e)}}const IIe=[{header:"SSH Key Name",accessorKey:"name",enableSorting:!1}];function Bs({className:e,...t}){const{formDescriptionId:n}=Tb();return u.jsx("p",{"data-slot":"form-description",id:n,className:Pe("text-muted-foreground text-sm",e),...t})}function Dy({className:e,...t}){return u.jsx("textarea",{"data-slot":"input",className:Pe(`border-input file:text-foreground placeholder:text-muted-foreground selection:bg-purple
|
|
165
|
-
selection:text-primary-foreground
|
|
166
|
-
dark:aria-invalid:outline-destructive dark:aria-invalid:ring-destructive/50 ring-ring/10
|
|
167
|
-
dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 aria-invalid:outline-destructive/60
|
|
168
|
-
aria-invalid:ring-destructive/20 aria-invalid:border-destructive/60 dark:aria-invalid:border-destructive
|
|
169
|
-
flex w-full min-w-0 rounded-md border bg-grey-700 px-3 py-1 text-base text-white
|
|
170
|
-
file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium
|
|
171
|
-
focus-visible:ring-1 focus-visible:outline-none focus-visible:ring-purple disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50
|
|
172
|
-
aria-invalid:focus-visible:ring-[1px] aria-invalid:focus-visible:outline-none md:text-sm dark:aria-invalid:focus-visible:ring-1`,e),...t})}async function NIe({instanceClient:e}){const{data:t}=await e.post("/",{operation:"get_ssh_known_hosts"});return t}function TIe(e){return{queryKey:[e.entityId,"get_ssh_known_hosts"],queryFn:()=>NIe(e)}}const AIe=mn({known_hosts:nt().trim()});async function OIe(e){const{instanceClient:t,entityType:n,...r}=e,{data:i}=await t.post("/",{operation:"set_ssh_known_hosts",replicated:n==="cluster",...r});return i}function DIe(){return at({mutationFn:OIe})}function $Ie(){const e=Ft(),{data:t}=Mi(TIe(e)),n=Qt({resolver:ln(AIe),defaultValues:{known_hosts:t?.known_hosts||""}}),{mutate:r,isPending:i}=DIe(),o=x.useCallback(async a=>{const{known_hosts:c}=a;c&&r({known_hosts:c.trim()+`
|
|
173
|
-
`,...e},{onSuccess:()=>{n.reset(a),_e.success("Known hosts saved!")}})},[r,n,e]);return u.jsx(Jt,{...n,children:u.jsx("form",{onSubmit:n.handleSubmit(o),className:"grid my-4 md:grid-cols-2 overflow-x-auto rounded-md",children:u.jsx(Me,{control:n.control,name:"known_hosts",render:({field:a})=>u.jsxs(Ae,{className:"md:col-span-2 gap-0",children:[u.jsx(Oe,{className:"bg-black-dark py-3 px-2 m-0 text-left font-medium whitespace-nowrap",children:"Known Hosts"}),u.jsxs("div",{className:"border border-grey-700 p-2 pb-3",children:[u.jsx(Bs,{children:`Manage your known hosts here. When you add a SSH Key with a hostname of "github.com", we'll automatically attempt to resolve GitHub's known hosts for you.`}),u.jsx($e,{children:u.jsx(Dy,{autoComplete:"off",autoCapitalize:"off",className:"whitespace-nowrap",rows:10,...a})}),u.jsx(De,{}),u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full mt-2",disabled:i||!n.formState.isDirty||!n.formState.isValid,children:[u.jsx(ho,{})," ",i?"Saving":"Save"," Known Hosts",i?"...":""]})]})]})})})})}const MIe=mn({name:nt().trim().min(1).regex(/^[a-zA-Z0-9-_]*$/,{error:"Can only contain letters, numbers, dashes and underscores."}),key:nt().min(1).trim(),host:nt().min(1).trim(),hostname:nt().min(1).trim(),known_hosts:nt().trim().optional()});async function PIe(e){const{instanceClient:t,entityType:n,entityId:r,...i}=e,{data:o}=await t.post("/",{operation:"add_ssh_key",replicated:n==="cluster",...i});return o}function zIe(){return at({mutationFn:PIe})}function LIe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const r=Qt({resolver:ln(MIe),defaultValues:{name:"",key:"",host:"",hostname:"",known_hosts:""}}),i=Ft(),{mutate:o,isPending:a}=zIe(),c=x.useCallback(async f=>{if(f){const{name:p,key:h,host:v,hostname:y,known_hosts:b}=f;o({name:p,key:h.trim()+`
|
|
174
|
-
`,host:v,hostname:y,known_hosts:b||void 0,...i},{onSuccess:()=>{r.reset(),t(),_e.success("SSH Key added successfully!"),n(!1)}})}},[o,r,i,t,n]),d=x.useCallback(()=>{r.reset(),n(!1)},[r,n]);return u.jsx(zn,{onOpenChange:n,open:e,children:u.jsx(Ln,{"aria-describedby":void 0,children:u.jsx(Jt,{...r,children:u.jsxs("form",{onSubmit:r.handleSubmit(c),className:"grid gap-4 my-4 md:grid-cols-2",children:[u.jsxs(yr,{className:"md:col-span-2",children:[u.jsx(Nn,{children:"Add New SSH Key"}),u.jsx(jr,{children:"Enter the details of your SSH Key below."})]}),u.jsx(Me,{control:r.control,name:"name",render:({field:f})=>u.jsxs(Ae,{className:"md:col-span-2",children:[u.jsx(Oe,{className:"pb-1",children:"Name"}),u.jsx($e,{children:u.jsx(ze,{type:"text",autoComplete:"off",autoCapitalize:"off",autoFocus:!0,...f})}),u.jsx(De,{})]})}),u.jsx(Me,{control:r.control,name:"key",render:({field:f})=>u.jsxs(Ae,{className:"md:col-span-2",children:[u.jsx(Oe,{className:"pb-1",children:"Key"}),u.jsx(Bs,{children:`Your private key. Don't have one? Try out "ssh-keygen"! You'll want to add your public key to your registry, i.e. GitHub.`}),u.jsx($e,{children:u.jsx(Dy,{autoComplete:"off",autoCapitalize:"off",rows:3,...f})}),u.jsx(De,{})]})}),u.jsx(Me,{control:r.control,name:"host",render:({field:f})=>u.jsxs(Ae,{className:"md:col-span-2",children:[u.jsx(Oe,{className:"pb-1",children:"Host"}),u.jsx(Bs,{children:'A unique identifying name for the combination of this key and your hostname, i.e. "your-repo.github.com". You will use this instead of the direct hostname to pick your key when importing applications.'}),u.jsx($e,{children:u.jsx(ze,{type:"text",autoComplete:"off",autoCapitalize:"off",...f})}),u.jsx(De,{})]})}),u.jsx(Me,{control:r.control,name:"hostname",render:({field:f})=>u.jsxs(Ae,{className:"md:col-span-2",children:[u.jsx(Oe,{className:"pb-1",children:"Hostname"}),u.jsx(Bs,{children:'When making the request, the actual hostname to use, i.e. "github.com".'}),u.jsx($e,{children:u.jsx(ze,{type:"text",autoComplete:"off",autoCapitalize:"off",...f})}),u.jsx(De,{})]})}),u.jsx(Me,{control:r.control,name:"known_hosts",render:({field:f})=>u.jsxs(Ae,{className:"md:col-span-2",children:[u.jsx(Oe,{className:"pb-1",children:"Known Hosts"}),u.jsx(Bs,{children:"Optionally, append known hosts, one per line. GitHub known hosts should resolve automatically."}),u.jsx($e,{children:u.jsx(Dy,{autoComplete:"off",autoCapitalize:"off",className:"whitespace-nowrap",rows:3,...f})}),u.jsx(De,{})]})}),u.jsx(Un,{className:"md:col-span-2",children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx(be,{variant:"destructiveOutline",type:"button",className:"rounded-full",onClick:d,disabled:a,children:"Cancel"}),u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",disabled:a||!r.formState.isDirty||!r.formState.isValid,children:[u.jsx(ho,{})," Add SSH Key"]})]})})]})})})})}async function UIe(e){const{instanceClient:t,entityType:n,name:r}=e,{data:i}=await t.post("/",{operation:"delete_ssh_key",replicated:n==="cluster",name:r});return i}function FIe(){return at({mutationFn:UIe})}async function VIe({name:e,instanceClient:t}){const{data:n}=await t.post("/",{operation:"get_ssh_key",name:e});return n}function BIe(e){return{queryKey:[e.entityId,"get_ssh_key"],queryFn:()=>VIe(e),refetchInterval:1e4}}const HIe=mn({name:nt().trim(),key:nt().min(1).trim()});async function qIe(e){const{instanceClient:t,entityType:n,name:r,key:i}=e,{data:o}=await t.post("/",{operation:"update_ssh_key",replicated:n==="cluster",name:r,key:i});return o}function GIe(){return at({mutationFn:qIe})}function KIe({data:e,isModalOpen:t,closeModal:n,onSelectSSHKey:r,onChangesSaved:i}){const{name:o}=e,a=Qt({resolver:ln(HIe),defaultValues:{name:o,key:""}}),c=Ft(),{data:d}=Mt(BIe({...c,name:o})),{mutate:f,isPending:p}=GIe(),{mutate:h}=FIe(),v=x.useCallback(async({key:b})=>{b&&f({name:o,key:b.trim()+`
|
|
175
|
-
`,...c},{onSuccess:()=>{_e.success("SSH Key updated successfully!"),r(void 0),i()}})},[f,o,c,r,i]),y=x.useCallback(()=>{h({name:o,...c},{onSuccess:()=>{_e.success("SSH Key deleted successfully!"),r(void 0),i()}})},[o,h,c,i,r]);return u.jsx(zn,{onOpenChange:n,open:t,children:u.jsx(Ln,{className:"sm:max-w-[750px]","aria-describedby":void 0,children:u.jsx(Jt,{...a,children:u.jsxs("form",{onSubmit:a.handleSubmit(v),className:"grid gap-4 my-4 md:grid-cols-2",children:[u.jsx(Nn,{children:"Edit SSH Key"}),u.jsx(Me,{control:a.control,name:"name",render:({field:b})=>u.jsxs(Ae,{className:"md:col-span-2",children:[u.jsx(Oe,{className:"pb-1",children:"Name"}),u.jsx($e,{children:u.jsx(ze,{type:"text",autoComplete:"off",autoCapitalize:"off",readOnly:!0,disabled:!0,...b})}),u.jsx(De,{})]})}),u.jsx(Me,{control:a.control,name:"key",render:({field:b})=>u.jsxs(Ae,{className:"md:col-span-2",children:[u.jsx(Oe,{className:"pb-1",children:"Key"}),u.jsx(Bs,{children:`Replace your existing private key. Lost it? Try out "ssh-keygen"! You'll want to add your public key to your registry, i.e. GitHub.`}),u.jsx($e,{children:u.jsx(Dy,{autoComplete:"off",autoCapitalize:"off",autoFocus:!0,rows:3,...b})}),u.jsx(De,{})]})}),u.jsxs(Ae,{className:"md:col-span-2",children:[u.jsx(Oe,{className:"pb-1",children:"Host"}),u.jsx(Bs,{children:'A unique identifying name for the combination of this key and your hostname, i.e. "your-repo.github.com". You will use this instead of the direct hostname to pick your key when importing applications.'}),u.jsx($e,{children:u.jsx(ze,{type:"text",autoComplete:"off",autoCapitalize:"off",value:d?.host||"",disabled:!0,readOnly:!0})}),u.jsx(De,{})]}),u.jsxs(Ae,{className:"md:col-span-2",children:[u.jsx(Oe,{className:"pb-1",children:"Hostname"}),u.jsx(Bs,{children:'When making the request, the actual hostname to use, i.e. "github.com".'}),u.jsx($e,{children:u.jsx(ze,{type:"text",autoComplete:"off",autoCapitalize:"off",value:d?.hostname||"",disabled:!0,readOnly:!0})}),u.jsx(De,{})]}),u.jsxs(Un,{children:[u.jsx(be,{type:"button",variant:"destructiveOutline",className:"rounded-full",onClick:y,disabled:p,children:"Delete SSH Key"}),u.jsx("div",{className:"grow"}),u.jsx(be,{type:"submit",variant:"submit",className:"rounded-full",disabled:p||!a.formState.isValid,children:"Update SSH Key"})]})]})})})})}function F$(){const e=pn(),{keyName:t}=tt({strict:!1}),n=Ft(),{data:r,refetch:i,isFetching:o,isRefetching:a}=Mt(RIe(n)),c=x.useMemo(()=>r?.find(b=>b.name===t),[r,t]),d=x.useCallback(b=>{const S=b?.original?.name,C=[t?"..":"",S].filter(Boolean);e({to:C.join("/")})},[t,e]),f=!!t&&!!c,[p,h]=x.useState(!1),v=x.useCallback(()=>{h(!0)},[h]),y=vl(i);return u.jsxs(u.Fragment,{children:[u.jsxs(sf,{columns:IIe,data:r||[],isFetching:o,onRowClick:d,children:[u.jsx(Ge,{className:"inline-block underline text-sm text-gray-400 hover:text-white",to:"https://docs.harperdb.io/docs/developers/security/certificate-management",target:"_blank",children:"Certificate Management Docs"}),u.jsxs(be,{variant:"defaultOutline",onClick:y,accessKey:"r",disabled:o||a,children:[u.jsx(sa,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),u.jsxs(be,{variant:"positiveOutline",onClick:v,accessKey:"a",disabled:p,children:[u.jsx(po,{}),u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),p&&u.jsx(LIe,{isModalOpen:p,onChangesSaved:i,setIsModalOpen:h}),f&&u.jsx(KIe,{isModalOpen:f,closeModal:d,data:c,onSelectSSHKey:d,onChangesSaved:i}),u.jsx(x.Suspense,{fallback:u.jsx(Ui,{text:"Loading..."}),children:u.jsx($Ie,{})})]})}const V$=cx(),ZIe=[{header:"Username",accessorKey:"username",enableSorting:!1},V$.display({header:"Role",enableSorting:!1,id:"role",cell:e=>e.row.original.role.role}),{header:"Active",accessorKey:"active",enableSorting:!1},V$.display({header:"Created",enableSorting:!1,id:"__createdtime__",cell:e=>sc((Date.now()-e.row.original.__createdtime__)/1e3,e.row.original.__createdtime__)}),{header:"Updated",accessorKey:"__updatedtime__",enableSorting:!1,cell:e=>sc((Date.now()-e.row.original.__updatedtime__)/1e3,e.row.original.__updatedtime__)}];function YIe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const r=Ft(),{data:i}=Mi(wR(r)),o=Qt({resolver:ln(Xu),defaultValues:{username:"",role:"",password:"",confirmPassword:""}}),{mutate:a,isPending:c}=f_e(),d=x.useCallback(async f=>{f&&a({active:!0,password:f.password,role:f.role,username:f.username,...r},{onSuccess:()=>{const p=f.role;o.reset(),o.setValue("role",p),t(),_e.success("User added successfully!"),n(!1)}})},[a,o,r,t,n]);return u.jsx(zn,{onOpenChange:n,open:e,children:u.jsx(Ln,{"aria-describedby":void 0,children:u.jsx(Jt,{...o,children:u.jsxs("form",{onSubmit:o.handleSubmit(d),className:"grid gap-4 my-4",children:[u.jsx(yr,{children:u.jsx(Nn,{children:"Add New User"})}),u.jsx(Me,{control:o.control,name:"username",render:({field:f})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Username"}),u.jsx($e,{children:u.jsx(ze,{type:"text",enterKeyHint:"next",autoComplete:"username",...f})}),u.jsx(De,{})]})}),u.jsx(Me,{control:o.control,name:"password",render:({field:f})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Password"}),u.jsx($e,{children:u.jsx(ze,{type:"password",enterKeyHint:"next",autoComplete:"new-password",...f})}),u.jsx(De,{})]})}),u.jsx(Me,{control:o.control,name:"confirmPassword",render:({field:f})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Confirm Password"}),u.jsx($e,{children:u.jsx(ze,{type:"password",enterKeyHint:"next",autoComplete:"new-password",...f})}),u.jsx(De,{})]})}),u.jsx(Me,{control:o.control,name:"role",render:({field:f})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Role"}),u.jsx(x.Suspense,{fallback:u.jsx(Er,{}),children:u.jsx($e,{children:u.jsxs(co,{...f,onValueChange:p=>f.onChange(p),children:[u.jsx(fo,{className:"w-full",children:u.jsx(uo,{placeholder:"Choose Role"})}),u.jsx(mo,{children:u.jsxs(Lo,{children:[u.jsx(Gj,{children:"Role"}),i?.map(p=>u.jsx(Sn,{value:p.id,children:p.role},p.id))]})})]})})}),u.jsx(De,{})]})}),u.jsx(Un,{children:u.jsx("div",{className:"flex justify-between w-full",children:u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",disabled:c,children:[u.jsx(ho,{})," Add User"]})})})]})})})})}const WIe=mn({username:Xu.shape.username,role:Xu.shape.role,newPassword:Xu.shape.password.or(cy()).optional(),confirmPassword:Xu.shape.confirmPassword}).refine(e=>!e.newPassword||e.newPassword.length>=8,{error:"Password must be at least 8 characters long.",path:["password"]}).refine(e=>!e.newPassword||e.newPassword===e.confirmPassword,{error:"Passwords do not match.",path:["confirmPassword"]});function XIe({data:e,onUserUpdated:t}){const n=Ft(),{data:r}=Mi(wR(n)),{mutate:i,isPending:o}=m_e(),a=Qt({resolver:ln(WIe),defaultValues:{username:e.username,role:e.role.role,newPassword:"",confirmPassword:""}}),c=x.useCallback(d=>{const f={username:e.username,role:d.role,...n};d.newPassword&&(f.password=d.newPassword),i(f,{onSuccess:()=>{a.reset(),_e.success("User edited successfully!"),t()}})},[a,i,e.username,n,t]);return u.jsx(Jt,{...a,children:u.jsxs("form",{onSubmit:a.handleSubmit(c),className:"grid gap-4 my-4",children:[u.jsx(yr,{children:u.jsx(Nn,{children:"Edit User"})}),u.jsx(Me,{control:a.control,name:"username",render:({field:d})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Username"}),u.jsx($e,{children:u.jsx(ze,{type:"text",enterKeyHint:"next",autoComplete:"username",disabled:!0,readOnly:!0,...d})}),u.jsx(De,{})]})}),u.jsx(Me,{control:a.control,name:"newPassword",render:({field:d})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Change Password"}),u.jsx($e,{children:u.jsx(ze,{type:"password",enterKeyHint:"next",autoComplete:"new-password",...d})}),u.jsx(De,{})]})}),u.jsx(Me,{control:a.control,name:"confirmPassword",render:({field:d})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Confirm Password"}),u.jsx($e,{children:u.jsx(ze,{type:"password",enterKeyHint:"next",autoComplete:"new-password",...d})}),u.jsx(De,{})]})}),u.jsx(Me,{control:a.control,name:"role",render:({field:d})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Role"}),u.jsx(x.Suspense,{fallback:u.jsx(Er,{}),children:u.jsx($e,{children:u.jsxs(co,{...d,onValueChange:f=>d.onChange(f),children:[u.jsx(fo,{className:"w-full",children:u.jsx(uo,{placeholder:"Choose Role"})}),u.jsx(mo,{children:u.jsxs(Lo,{children:[u.jsx(Gj,{children:"Role"}),r?.map(f=>u.jsx(Sn,{value:f.id,children:f.role},f.id))]})})]})})}),u.jsx(De,{})]})}),u.jsx(Un,{children:u.jsx("div",{className:"flex justify-between w-full",children:u.jsxs(be,{variant:"submit",className:"rounded-full",disabled:o,children:[u.jsx(ho,{})," Save Changes"]})})})]})})}const QIe=mn({username:Cj,confirmUsernameForDeletion:nt().nonempty({error:"Please type the username again to confirm deletion."}).toLowerCase()}).refine(e=>e.username===e.confirmUsernameForDeletion,{error:"Username does not match.",path:["confirmUsernameForDeletion"]});function JIe({data:e,onUserDeleted:t}){const{mutate:n,isPending:r}=p_e(),i=Qt({resolver:ln(QIe),defaultValues:{username:e.username,confirmUsernameForDeletion:""}}),o=hb(),a=x.useCallback(()=>{n({username:e.username,...o},{onSuccess:()=>{i.reset(),_e.success("User deleted successfully!"),t()}})},[e.username,i,n,o,t]);return u.jsx(Jt,{...i,children:u.jsxs("form",{onSubmit:i.handleSubmit(a),className:"grid gap-4 my-4",children:[u.jsx(Me,{control:i.control,name:"confirmUsernameForDeletion",render:({field:c})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Confirm Username"}),u.jsx($e,{children:u.jsx(ze,{type:"text",enterKeyHint:"next",autoComplete:"username",...c})}),u.jsx(De,{})]})}),u.jsx(Un,{children:u.jsx("div",{className:"flex justify-between w-full",children:u.jsxs(be,{variant:"destructive",className:"rounded-full",disabled:r||!i.formState.isValid,children:[u.jsx(ts,{})," Delete User"]})})})]})})}function eNe({closeModal:e,clusterId:t,instanceId:n,data:r,isModalOpen:i,onUserDeleted:o,onUserUpdated:a}){const f=!(Ja().user?.username===r.username);return u.jsx(zn,{onOpenChange:e,open:i,children:u.jsxs(Ln,{className:"sm:max-w-[750px]",children:[u.jsx(XIe,{data:r,onUserUpdated:a}),f&&u.jsx(JIe,{data:r,onUserDeleted:o})]})})}function tNe({entityId:e,instanceClient:t}){return{queryKey:[e,"list_users"],queryFn:()=>nNe({instanceClient:t}),refetchInterval:1e4}}async function nNe({instanceClient:e}){const{data:t}=await e.post("/",{operation:"list_users"});return t}function B$(){const e=pn(),{instanceId:t,clusterId:n,username:r}=tt({strict:!1}),i=Ft(),{data:o,refetch:a,isFetching:c,isRefetching:d}=Mi(tNe(i)),f=x.useMemo(()=>o?.find(T=>T.username===r),[o,r]),p=x.useCallback(T=>{const z=[r?"..":"",T].filter(Boolean);e({to:z.join("/")})},[r,e]),h=!!r&&!!f,[v,y]=x.useState(!1),[b]=x.useState({attribute:"username",descending:!1}),S=x.useMemo(()=>[{desc:b.descending,id:b.attribute}],[b]),C=x.useCallback(()=>{y(!0)},[y]),E=x.useCallback(()=>{a(),y(!1)},[a,y]),k=x.useCallback(T=>{p(T.original.username)},[p]),j=x.useCallback(()=>{p(void 0)},[p]),I=x.useCallback(()=>{a(),p(void 0)},[p,a]),A=x.useCallback(()=>{a(),p(void 0)},[p,a]),N=vl(a);return u.jsxs(x.Suspense,{fallback:u.jsx(Ui,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(sf,{data:o,isFetching:c||d,columns:ZIe,onRowClick:k,sortingState:S,children:[u.jsxs(be,{variant:"defaultOutline",onClick:N,accessKey:"r",disabled:c||d,children:[u.jsx(sa,{})," ",u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),u.jsxs(be,{variant:"positiveOutline",onClick:C,accessKey:"a",disabled:v,children:[u.jsx(po,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),u.jsx(YIe,{isModalOpen:v,onChangesSaved:E,setIsModalOpen:y}),h&&u.jsx(eNe,{instanceId:t,clusterId:n,closeModal:j,data:f,isModalOpen:h,onUserDeleted:A,onUserUpdated:I})]})}function rNe(e){const t=Qe({getParentRoute:()=>e,path:"config",component:rIe}),n=Qe({getParentRoute:()=>t,path:"/",component:fIe}),r=Qe({getParentRoute:()=>t,path:"roles",component:U$}),i=Qe({getParentRoute:()=>t,path:"roles/$roleId",component:U$}),o=Qe({getParentRoute:()=>t,path:"users",component:B$}),a=Qe({getParentRoute:()=>t,path:"users/$username",component:B$}),c=Qe({getParentRoute:()=>t,path:"ssh-keys",component:F$}),d=Qe({getParentRoute:()=>t,path:"ssh-keys/$keyName",component:F$});return t.addChildren([n,r,i,o,a,c,d])}function pC({clusterId:e,databaseName:t,instanceId:n,organizationId:r,tableName:i}){const o=["databases",t,i].filter(fa).join("/");return tr({organizationId:r,instanceId:n,clusterId:e},o)}function iNe(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var SR="ScrollArea",[g9]=Pi(SR),[oNe,bo]=g9(SR),v9=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...a}=e,[c,d]=x.useState(null),[f,p]=x.useState(null),[h,v]=x.useState(null),[y,b]=x.useState(null),[S,C]=x.useState(null),[E,k]=x.useState(0),[j,I]=x.useState(0),[A,N]=x.useState(!1),[T,z]=x.useState(!1),L=ut(t,J=>d(J)),G=Tc(i);return u.jsx(oNe,{scope:n,type:r,dir:G,scrollHideDelay:o,scrollArea:c,viewport:f,onViewportChange:p,content:h,onContentChange:v,scrollbarX:y,onScrollbarXChange:b,scrollbarXEnabled:A,onScrollbarXEnabledChange:N,scrollbarY:S,onScrollbarYChange:C,scrollbarYEnabled:T,onScrollbarYEnabledChange:z,onCornerWidthChange:k,onCornerHeightChange:I,children:u.jsx(Ke.div,{dir:G,...a,ref:L,style:{position:"relative","--radix-scroll-area-corner-width":E+"px","--radix-scroll-area-corner-height":j+"px",...e.style}})})});v9.displayName=SR;var y9="ScrollAreaViewport",b9=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,a=bo(y9,n),c=x.useRef(null),d=ut(t,c,a.onViewportChange);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),u.jsx(Ke.div,{"data-radix-scroll-area-viewport":"",...o,ref:d,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:u.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});b9.displayName=y9;var ha="ScrollAreaScrollbar",x9=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=bo(ha,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=i,c=e.orientation==="horizontal";return x.useEffect(()=>(c?o(!0):a(!0),()=>{c?o(!1):a(!1)}),[c,o,a]),i.type==="hover"?u.jsx(aNe,{...r,ref:t,forceMount:n}):i.type==="scroll"?u.jsx(sNe,{...r,ref:t,forceMount:n}):i.type==="auto"?u.jsx(w9,{...r,ref:t,forceMount:n}):i.type==="always"?u.jsx(_R,{...r,ref:t}):null});x9.displayName=ha;var aNe=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=bo(ha,e.__scopeScrollArea),[o,a]=x.useState(!1);return x.useEffect(()=>{const c=i.scrollArea;let d=0;if(c){const f=()=>{window.clearTimeout(d),a(!0)},p=()=>{d=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return c.addEventListener("pointerenter",f),c.addEventListener("pointerleave",p),()=>{window.clearTimeout(d),c.removeEventListener("pointerenter",f),c.removeEventListener("pointerleave",p)}}},[i.scrollArea,i.scrollHideDelay]),u.jsx(Wn,{present:n||o,children:u.jsx(w9,{"data-state":o?"visible":"hidden",...r,ref:t})})}),sNe=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=bo(ha,e.__scopeScrollArea),o=e.orientation==="horizontal",a=Ix(()=>d("SCROLL_END"),100),[c,d]=iNe("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return x.useEffect(()=>{if(c==="idle"){const f=window.setTimeout(()=>d("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(f)}},[c,i.scrollHideDelay,d]),x.useEffect(()=>{const f=i.viewport,p=o?"scrollLeft":"scrollTop";if(f){let h=f[p];const v=()=>{const y=f[p];h!==y&&(d("SCROLL"),a()),h=y};return f.addEventListener("scroll",v),()=>f.removeEventListener("scroll",v)}},[i.viewport,o,d,a]),u.jsx(Wn,{present:n||c!=="hidden",children:u.jsx(_R,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:je(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:je(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),w9=x.forwardRef((e,t)=>{const n=bo(ha,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,a]=x.useState(!1),c=e.orientation==="horizontal",d=Ix(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,p=n.viewport.offsetHeight<n.viewport.scrollHeight;a(c?f:p)}},10);return Od(n.viewport,d),Od(n.content,d),u.jsx(Wn,{present:r||o,children:u.jsx(_R,{"data-state":o?"visible":"hidden",...i,ref:t})})}),_R=x.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=bo(ha,e.__scopeScrollArea),o=x.useRef(null),a=x.useRef(0),[c,d]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=k9(c.viewport,c.content),p={...r,sizes:c,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:v=>o.current=v,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:v=>a.current=v};function h(v,y){return mNe(v,a.current,c,y)}return n==="horizontal"?u.jsx(lNe,{...p,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollLeft,y=H$(v,c,i.dir);o.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:v=>{i.viewport&&(i.viewport.scrollLeft=v)},onDragScroll:v=>{i.viewport&&(i.viewport.scrollLeft=h(v,i.dir))}}):n==="vertical"?u.jsx(cNe,{...p,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollTop,y=H$(v,c);o.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:v=>{i.viewport&&(i.viewport.scrollTop=v)},onDragScroll:v=>{i.viewport&&(i.viewport.scrollTop=h(v))}}):null}),lNe=x.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=bo(ha,e.__scopeScrollArea),[a,c]=x.useState(),d=x.useRef(null),f=ut(t,d,o.onScrollbarXChange);return x.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),u.jsx(_9,{"data-orientation":"horizontal",...i,ref:f,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Rx(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,h)=>{if(o.viewport){const v=o.viewport.scrollLeft+p.deltaX;e.onWheelScroll(v),R9(v,h)&&p.preventDefault()}},onResize:()=>{d.current&&o.viewport&&a&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:My(a.paddingLeft),paddingEnd:My(a.paddingRight)}})}})}),cNe=x.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=bo(ha,e.__scopeScrollArea),[a,c]=x.useState(),d=x.useRef(null),f=ut(t,d,o.onScrollbarYChange);return x.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),u.jsx(_9,{"data-orientation":"vertical",...i,ref:f,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Rx(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,h)=>{if(o.viewport){const v=o.viewport.scrollTop+p.deltaY;e.onWheelScroll(v),R9(v,h)&&p.preventDefault()}},onResize:()=>{d.current&&o.viewport&&a&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:My(a.paddingTop),paddingEnd:My(a.paddingBottom)}})}})}),[uNe,S9]=g9(ha),_9=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:p,onResize:h,...v}=e,y=bo(ha,n),[b,S]=x.useState(null),C=ut(t,L=>S(L)),E=x.useRef(null),k=x.useRef(""),j=y.viewport,I=r.content-r.viewport,A=bn(p),N=bn(d),T=Ix(h,10);function z(L){if(E.current){const G=L.clientX-E.current.left,J=L.clientY-E.current.top;f({x:G,y:J})}}return x.useEffect(()=>{const L=G=>{const J=G.target;b?.contains(J)&&A(G,I)};return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[j,b,I,A]),x.useEffect(N,[r,N]),Od(b,T),Od(y.content,T),u.jsx(uNe,{scope:n,scrollbar:b,hasThumb:i,onThumbChange:bn(o),onThumbPointerUp:bn(a),onThumbPositionChange:N,onThumbPointerDown:bn(c),children:u.jsx(Ke.div,{...v,ref:C,style:{position:"absolute",...v.style},onPointerDown:je(e.onPointerDown,L=>{L.button===0&&(L.target.setPointerCapture(L.pointerId),E.current=b.getBoundingClientRect(),k.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),z(L))}),onPointerMove:je(e.onPointerMove,z),onPointerUp:je(e.onPointerUp,L=>{const G=L.target;G.hasPointerCapture(L.pointerId)&&G.releasePointerCapture(L.pointerId),document.body.style.webkitUserSelect=k.current,y.viewport&&(y.viewport.style.scrollBehavior=""),E.current=null})})})}),$y="ScrollAreaThumb",C9=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=S9($y,e.__scopeScrollArea);return u.jsx(Wn,{present:n||i.hasThumb,children:u.jsx(dNe,{ref:t,...r})})}),dNe=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=bo($y,n),a=S9($y,n),{onThumbPositionChange:c}=a,d=ut(t,h=>a.onThumbChange(h)),f=x.useRef(void 0),p=Ix(()=>{f.current&&(f.current(),f.current=void 0)},100);return x.useEffect(()=>{const h=o.viewport;if(h){const v=()=>{if(p(),!f.current){const y=pNe(h,c);f.current=y,c()}};return c(),h.addEventListener("scroll",v),()=>h.removeEventListener("scroll",v)}},[o.viewport,p,c]),u.jsx(Ke.div,{"data-state":a.hasThumb?"visible":"hidden",...i,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:je(e.onPointerDownCapture,h=>{const y=h.target.getBoundingClientRect(),b=h.clientX-y.left,S=h.clientY-y.top;a.onThumbPointerDown({x:b,y:S})}),onPointerUp:je(e.onPointerUp,a.onThumbPointerUp)})});C9.displayName=$y;var CR="ScrollAreaCorner",E9=x.forwardRef((e,t)=>{const n=bo(CR,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?u.jsx(fNe,{...e,ref:t}):null});E9.displayName=CR;var fNe=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=bo(CR,n),[o,a]=x.useState(0),[c,d]=x.useState(0),f=!!(o&&c);return Od(i.scrollbarX,()=>{const p=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(p),d(p)}),Od(i.scrollbarY,()=>{const p=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(p),a(p)}),f?u.jsx(Ke.div,{...r,ref:t,style:{width:o,height:c,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function My(e){return e?parseInt(e,10):0}function k9(e,t){const n=e/t;return isNaN(n)?0:n}function Rx(e){const t=k9(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function mNe(e,t,n,r="ltr"){const i=Rx(n),o=i/2,a=t||o,c=i-a,d=n.scrollbar.paddingStart+a,f=n.scrollbar.size-n.scrollbar.paddingEnd-c,p=n.content-n.viewport,h=r==="ltr"?[0,p]:[p*-1,0];return j9([d,f],h)(e)}function H$(e,t,n="ltr"){const r=Rx(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,a=t.content-t.viewport,c=o-r,d=n==="ltr"?[0,a]:[a*-1,0],f=U1(e,d);return j9([0,a],[0,c])(f)}function j9(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function R9(e,t){return e>0&&e<t}var pNe=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){const o={left:e.scrollLeft,top:e.scrollTop},a=n.left!==o.left,c=n.top!==o.top;(a||c)&&t(),n=o,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function Ix(e,t){const n=bn(e),r=x.useRef(0);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),x.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Od(e,t){const n=bn(t);Yn(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var hNe=v9,gNe=b9,vNe=E9;function yNe({className:e,children:t,...n}){return u.jsxs(hNe,{"data-slot":"scroll-area",className:Pe("relative",e),...n,children:[u.jsx(gNe,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),u.jsx(bNe,{}),u.jsx(vNe,{})]})}function bNe({className:e,orientation:t="vertical",...n}){return u.jsx(x9,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Pe("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...n,children:u.jsx(C9,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}async function xNe({databaseName:e,tableName:t,primaryKey:n,replicated:r,instanceClient:i}){const{data:o}=await i.post("/",{operation:"create_table",database:e,table:t,primary_key:n,replicated:r});return o}function wNe(){return at({mutationFn:xNe})}const x_=/^[\x20-\x2E|\x30-\x5F|\x61-\x7E]*$/,uv=mn({databaseName:nt().regex(x_,{error:"Database name cannot include backticks or forward slashes."}).max(75,{error:"Database name cannot be longer than 75 characters."}),tableName:nt().nonempty({error:"Table name is required."}).regex(x_,{error:"Table name cannot include backticks or forward slashes."}).max(250,{error:"Table name cannot be longer than 250 characters."}),primaryKey:nt().regex(x_,{error:"Primary key cannot include backticks or forward slashes."}).max(250,{error:"Primary key cannot be longer than 250 characters."})});function SNe({databaseName:e,onSelectTable:t}){const n=gr(),r=Ft(),i=an(),[o,a]=x.useState(!1),c=Qt({resolver:ln(uv),defaultValues:{databaseName:e||"",tableName:"",primaryKey:""}}),{mutate:d}=wNe(),f=async p=>{const h=p.databaseName||"data",v=p.tableName;d({databaseName:h,tableName:v,primaryKey:p.primaryKey||"id",...r,replicated:r.entityType==="cluster"},{onSuccess:async()=>{await n.invalidateQueries({queryKey:[r.entityId,"describe_all"],refetchType:"all"}),_e.success(`Table ${v} created successfully`),a(!1),c.reset(),t(h,v),await i.invalidate()}})};return u.jsxs(zn,{open:o,onOpenChange:a,children:[u.jsx(SV,{asChild:!0,children:u.jsx("div",{className:"sticky bottom-0 py-4 bg-black/70 backdrop-blur-xs",children:u.jsxs(be,{variant:"positiveOutline",className:"w-full rounded-full",size:"lg",accessKey:"t",children:[u.jsx(po,{}),u.jsxs("span",{children:["Create a ",u.jsx("u",{children:"T"}),"able"]})]})})}),u.jsxs(Ln,{className:"sm:max-w-[425px]",children:[u.jsxs(yr,{children:[u.jsx(Nn,{children:"Create a New Table"}),u.jsx(jr,{children:"What would you like to create?"})]}),u.jsx(Jt,{...c,children:u.jsxs("form",{onSubmit:c.handleSubmit(f),className:"grid gap-6 text-white",children:[u.jsx(Me,{control:c.control,name:"tableName",render:({field:p})=>u.jsxs(Ae,{className:"",children:[u.jsx(Oe,{className:"pb-1",children:"Table Name"}),u.jsx($e,{children:u.jsx(ze,{...p,type:"text",maxLength:uv.shape.tableName.maxLength,autoFocus:!0,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off"})}),u.jsx(De,{})]})}),u.jsx(Me,{control:c.control,name:"primaryKey",render:({field:p})=>u.jsxs(Ae,{className:"",children:[u.jsx(Oe,{className:"pb-1",children:"Primary Key"}),u.jsx($e,{children:u.jsx(ze,{...p,placeholder:"id",type:"text",maxLength:uv.shape.primaryKey.maxLength,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off"})}),u.jsx(De,{})]})}),u.jsx(Me,{control:c.control,name:"databaseName",render:({field:p})=>u.jsxs(Ae,{className:"",children:[u.jsx(Oe,{className:"pb-1",children:"Database Name"}),u.jsx($e,{children:u.jsx(ze,{...p,type:"text",placeholder:"data",maxLength:uv.shape.databaseName.maxLength,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off"})}),u.jsx(De,{})]})}),u.jsx(Un,{children:u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",children:[u.jsx(DQ,{}),"Create New Table"]})})]})})]})]})}function _Ne({instanceDatabaseMap:e}){const t=an(),n=!e,r=tt({strict:!1}),i=pn(),o=Yd(),{databaseNames:a,tableNames:c}=x.useMemo(()=>{const p=Object.keys(e||{}).sort(),h=r.databaseName?Object.keys(e?.[r.databaseName]||[]).sort():[];return{databaseNames:p,tableNames:h}},[e,r.databaseName]),d=x.useCallback(p=>{const h=p?Object.keys(e?.[p]||[]).sort():[];r.databaseName?i({to:pC({...r,databaseName:p,tableName:h[0]})}):t.invalidate()},[e,r,t,i]),f=x.useCallback((p,h)=>{i({to:pC({...r,databaseName:p,tableName:h})})},[i,r]);return u.jsxs("div",{className:"pl-3",children:[u.jsx("h1",{className:"pt-3 pb-3 text-3xl",children:"Databases"}),n?u.jsx(Er,{className:"w-full h-9 m-0 rounded-md bg-gray-700"}):u.jsx("div",{className:"flex space-x-2",children:u.jsxs(co,{name:"databaseSelect",value:r.databaseName||"",disabled:a.length===0,onValueChange:d,children:[u.jsx(fo,{className:"w-full",children:u.jsx(uo,{placeholder:"Select a Database"})}),u.jsx(mo,{children:u.jsx(Lo,{children:a.map(p=>u.jsx(Sn,{value:p,children:p},p))})})]})}),n?u.jsx(Er,{className:"w-full min-h-80 rounded-md bg-gray-700 mb-0"}):u.jsxs(yNe,{className:"border rounded-md min-h-80 border-grey-700 mt-4",children:[c.length===0&&r.databaseName?.length?u.jsxs("div",{className:"w-full h-full text-center",children:[u.jsx("p",{className:"py-6",children:"No tables found in this database."}),o&&u.jsx("p",{children:'Tap "Create a Table" below!'})]}):c.length===0&&!r.databaseName?.length?u.jsxs("p",{className:"pt-2 text-sm text-center",children:["Please ",a.length===0?"create":"select"," a table."]}):"",u.jsx("ul",{children:c.map(p=>u.jsx("li",{className:"flex items-center p-2 border-b hover:bg-grey-700/80 border-grey-700",children:u.jsxs(be,{onClick:()=>f(r.databaseName,p),size:"lg",className:"items-center justify-between w-full bg-transparent border-none shadow-none hover:bg-transparent",children:[p,u.jsx("span",{children:r.tableName===p&&u.jsx(ro,{})})]})},p))})]}),o&&u.jsx(SNe,{databaseName:r.databaseName,onSelectTable:f})]})}function CNe(e){if(!e)return{dataTableColumns:[],hashAttribute:""};const{hash_attribute:t,attributes:n}=e,r=[],i=[],o=[],a=[];for(let c=n.length-1;c>=0;c--){const{attribute:d,type:f,is_primary_key:p,indexed:h}=n[c],v={header:d,accessorKey:d,enableSorting:!!(p||h),enableColumnFilter:!!(p||h),size:ENe(f)};p?r.push(v):d==="__createdtime__"||d==="__updatedtime__"?a.push(v):v.enableSorting?i.push(v):o.push(v)}return{dataTableColumns:[...r,...i,...o,...a],hashAttribute:t}}function ENe(e){switch(e){case"Id":case"ID":return 1;case"Boolean":return 1;case"Int":case"Long":case"Float":case"BigInt":return 1;case"Date":case"String":default:return Math.round(window.innerWidth*.1)}}async function kNe({databaseName:e,tableName:t,records:n,instanceClient:r}){const{data:i}=await r.post("/",{operation:"insert",database:e,table:t,records:n});return i}function jNe(){return at({mutationFn:kNe})}function RNe({isModalOpen:e,instanceTable:t,setIsModalOpen:n,refreshTable:r}){const{mutate:i,isPending:o}=jNe(),a=Ft(),[c,d]=x.useState(!0),[f,p]=x.useState(),[h,v]=x.useState(!1),[y,b]=x.useState([]),S=x.useMemo(()=>{const k={};for(const j of t.attributes)j.is_primary_key||j.attribute==="__createdtime__"||j.attribute==="__updatedtime__"||(k[j.attribute]=INe(j.type));return JSON.stringify(k,null,4)},[t]),C=x.useCallback(k=>{v(!0),d(k.length===0)},[d]),E=x.useCallback(()=>{if(f&&c){const k=JSON.parse(f),j=Array.isArray(k)?k:[k],I=_e.loading(`Adding ${j.length} records...`);i({...a,databaseName:t.schema,tableName:t.name,records:j},{onSuccess:A=>{r(),A.skipped_hashes?.length||n(!1),b(A.skipped_hashes),(A.skipped_hashes?.length>0?_e.warning:_e.success)(A.skipped_hashes?.length>0?"Warning!":"Success!",{id:I,description:u.jsxs(u.Fragment,{children:[A.inserted_hashes.length>0&&u.jsxs("p",{children:["Added ",Io(A.inserted_hashes.length,"record","records")]}),A.skipped_hashes.length>0&&u.jsxs("p",{children:["Skipped ",Io(A.skipped_hashes.length,"record","records")]})]})})}})}},[f,i,a,t.name,t.schema,c,r,n]);return u.jsx(zn,{onOpenChange:n,open:e,children:u.jsxs(Ln,{"aria-describedby":void 0,onEscapeKeyDown:k=>{h&&k.preventDefault()},children:[u.jsx(yr,{children:u.jsxs(Nn,{children:["Add New ",t.name]})}),t?.hash_attribute&&u.jsxs("div",{className:"text-sm text-gray-500",children:["The primary key for this table is ",u.jsxs("strong",{children:["“",t.hash_attribute,"”"]}),", and will auto-generate. You may manually add it if you want to specify its value."]}),u.jsx(vx,{className:"w-full h-96",language:"json",theme:"vs-dark",value:S,onValidate:C,onChange:p,options:{minimap:{enabled:!1}}}),u.jsxs("div",{className:"text-sm text-gray-500",children:[u.jsx("strong",{children:"Provide an [array]"})," if you want to add more than one record at a time."]}),y.length>0&&u.jsxs(pR,{className:"mt-2",children:[u.jsx(UC,{className:"w-4 h-4"}),u.jsxs(cje,{children:["Skipped ",y.length===1?"Hash":"Hashes"," Detected"]}),u.jsx(hR,{className:"max-h-36 overflow-auto",children:u.jsx("ol",{children:y.map(k=>u.jsx("li",{children:k},k))})})]}),u.jsx(Un,{children:u.jsx("div",{className:"flex justify-between w-full",children:u.jsxs(be,{variant:"submit",className:"rounded-full",onClick:E,accessKey:"s",disabled:!f||!c||o,children:[u.jsx(ho,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"S"}),"ave Changes"]})]})})})]})})}function INe(e){switch(e){case"Date":return new Date().toISOString();case"Id":case"ID":case"String":return"";case"Boolean":return!1;case"Int":case"Long":case"Float":case"BigInt":return 0;default:return null}}async function NNe({databaseName:e,replicated:t,instanceClient:n}){const{data:r}=await n.post("/",{operation:"drop_database",database:e,replicated:t});return r}function TNe(){return at({mutationFn:NNe})}function ANe({databaseName:e,onDeleted:t}){const n=Fc("ShowDeleteDatabase",!1),r=ai("ShowDeleteDatabase",!1),i=Yd(),o=gr(),a=Ft(),c=an(),{mutate:d,isPending:f}=TNe(),p=x.useCallback(()=>{d({databaseName:e,...a,replicated:a.entityType==="cluster"},{onSuccess:async()=>{r(),await o.invalidateQueries({queryKey:[a.entityId,"describe_all"],refetchType:"all"}),await c.invalidate(),_e.success(`Database ${e} dropped successfully`),t("database")}})},[r,e,d,a,t,o,c]);return!i||!e?u.jsx(u.Fragment,{}):u.jsx(tx,{typeOfThingBeingDeleted:"database",nameOfThingBeingDeleted:e,transitiveVerb:"Drop",presentParticiple:"Dropping",isModalOpen:n,setIsModalOpen:r,deletionConfirmed:p,deletionPending:f})}async function ONe({databaseName:e,tableName:t,replicated:n,instanceClient:r}){const{data:i}=await r.post("/",{operation:"drop_table",database:e,table:t,replicated:n});return i}function DNe(){return at({mutationFn:ONe})}function $Ne({databaseName:e,tableName:t,onDeleted:n}){const r=Fc("ShowDeleteTable",!1),i=ai("ShowDeleteTable",!1),o=Yd(),a=gr(),c=Ft(),d=an(),{mutate:f,isPending:p}=DNe(),h=x.useCallback(()=>{f({databaseName:e,tableName:t,...c,replicated:c.entityType==="cluster"},{onSuccess:async()=>{i(),await a.invalidateQueries({queryKey:[c.entityId,"describe_all"],refetchType:"all"}),await d.invalidate(),_e.success(`Table ${t} dropped successfully`),n("table")}})},[i,e,f,c,n,a,d,t]);return!o||!e?u.jsx(u.Fragment,{}):u.jsx(tx,{typeOfThingBeingDeleted:"table",nameOfThingBeingDeleted:`${e} > ${t}`,transitiveVerb:"Drop",presentParticiple:"Dropping",isModalOpen:r,setIsModalOpen:i,deletionConfirmed:h,deletionPending:p})}function MNe({canEditRecords:e,canDeleteRecords:t,setIsModalOpen:n,isModalOpen:r,hashAttribute:i,data:o,onSaveChanges:a,onDeleteRecord:c,isUpdateTableRecordsPending:d,isDeleteTableRecordsPending:f}){const[p,h]=x.useState(!0),[v,y]=x.useState(!1),[b,S]=x.useState(),C=x.useMemo(()=>{const k=o?.map(({__createdtime__:j,__updatedtime__:I,...A})=>A);return JSON.stringify(k,null,4)},[o]),E=x.useCallback(k=>{y(!0),h(k.length===0)},[h]);return u.jsx(zn,{onOpenChange:n,open:r,children:u.jsxs(Ln,{"aria-describedby":void 0,onEscapeKeyDown:e?k=>{v&&k.preventDefault()}:void 0,children:[u.jsx(yr,{children:u.jsxs(Nn,{children:[e?"Edit":"View"," Row"]})}),o?u.jsx(vx,{className:"w-full h-96",language:"json",theme:"vs-dark",options:e?void 0:{readOnly:!0},value:C,onValidate:E,onChange:k=>{S(k)}}):u.jsx(Ui,{}),u.jsx(Un,{children:u.jsxs("div",{className:"flex justify-between w-full",children:[t&&u.jsxs(be,{variant:"destructive",className:"rounded-full",onClick:()=>{const k=o[0]?.[i];k&&c([k])},disabled:f,children:[u.jsx(ts,{})," Delete Row"]}),e&&u.jsxs(be,{variant:"submit",className:"rounded-full",accessKey:"s",onClick:()=>{b&&p&&a(JSON.parse(b))},disabled:!b||!p||d,children:[u.jsx(ho,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"S"}),"ave Changes"]})]})]})})]})})}async function PNe(e){const{database:t,table:n,fileData:r,instanceClient:i}=e,{data:o}=await i.post("/",{operation:"csv_data_load",database:t,action:"insert",table:n,data:r});return o}function zNe(){return at({mutationFn:PNe})}const LNe=mn({fileData:nt(),database:nt(),table:nt()});function UNe({setIsModalOpen:e,isModalOpen:t,onSaveChanges:n,database:r,table:i}){const[o,a]=x.useState(null),c=Ft(),{mutate:d,isPending:f}=zNe(),p=y=>{if(!y.target.files)return;const b=y.target.files[0];if(b){const S=new FileReader;S.onload=C=>{const E=C.target?.result;typeof E=="string"&&(a(b),h.setValue("fileData",E))},S.readAsText(b)}},h=Qt({resolver:ln(LNe),defaultValues:{database:r,table:i,fileData:""}}),v=y=>{d({fileData:y.fileData,database:r,table:i,...c},{onSuccess:({message:b})=>{h.reset(),a(null),n(b)}})};return u.jsx(zn,{onOpenChange:()=>{e(!1),h.reset()},open:t,children:u.jsxs(Ln,{children:[u.jsxs(yr,{children:[u.jsx(Nn,{children:"Import CSV"}),u.jsx(jr,{children:"Upload a CSV file to import data into the table."})]}),u.jsx(Jt,{...h,children:u.jsxs("form",{onSubmit:h.handleSubmit(v),children:[u.jsx("div",{className:"w-full",children:u.jsx(Me,{control:h.control,name:"fileData",render:({field:y})=>u.jsxs(Ae,{className:"relative",children:[u.jsx(Oe,{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center w-full h-64 border-2 border-grey border-dashed rounded-lg cursor-pointer bg-grey-700 hover:bg-grey-700/80",children:u.jsx($e,{children:u.jsxs("div",{children:[u.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[u.jsx(wX,{className:"text-white",size:48}),u.jsx("p",{className:"mb-2 text-sm text-white",children:o?o.name:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"font-semibold",children:"Click to upload"})," or drag and drop a CSV File"]})})]}),u.jsx(ze,{id:"dropzone-file",type:"file",className:"opacity-0 w-full h-full absolute left-0 top-0 cursor-pointer",accept:".csv",name:y.name,ref:y.ref,onBlur:y.onBlur,disabled:y.disabled,onChange:p})]})})}),u.jsx(De,{})]})})}),u.jsx(Un,{className:"mt-4",children:u.jsxs(be,{variant:"submit",className:"rounded-full",accessKey:"u",disabled:!o||f,children:[u.jsx(ho,{}),u.jsxs("span",{children:[u.jsx("u",{children:"U"}),"pload CSV"]})]})})]})})]})})}function hC(e=!1){const[t,n]=x.useState(e),r=x.useCallback(a=>{a?.preventDefault?.(),n(c=>!c)},[]),i=x.useCallback(a=>{a?.preventDefault?.(),n(!0)},[]),o=x.useCallback(a=>{a?.preventDefault?.(),n(!1)},[]);return x.useMemo(()=>({toggled:t,setToggled:n,toggle:r,toggleOn:i,toggleOff:o}),[r,n,o,i,t])}async function FNe({databaseName:e,tableName:t,hashValues:n,instanceClient:r}){const{data:i}=await r.post("/",{operation:"delete",database:e,table:t,hash_values:n});return i}function VNe(){return at({mutationFn:FNe})}function BNe({databaseName:e,tableName:t,entityId:n,instanceClient:r}){return{queryKey:[n,e,t,"describe_table"],queryFn:async({signal:i})=>{const{data:o}=await r.post("/",{operation:"describe_table",database:e,table:t},{signal:i});return o},staleTime:60*1e3,enabled:!!e&&!!t,retry:!1}}const HNe=["1","bet","k","ok","si","tru","true","yes","yup"];function qNe(e){const t=e.toLowerCase().trim();return HNe.includes(t)}function q$(e){return!isNaN(e)&&!isNaN(parseFloat(e))}function GNe(e){if(e.startsWith("0.")&&q$(e))return!0;const t=e.toUpperCase().includes("E");return!(e!=="0"&&e.startsWith("0"))&&!t&&q$(e)}const G$={true:!0,TRUE:!0,false:!1,FALSE:!1,undefined:null,null:null,NULL:null,NaN:NaN},KNe=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/;function ZNe(e){return e==null||e===""||typeof e!="string"?e:G$[e]!==void 0?G$[e]:GNe(e)?Number(e):KNe.test(e)?new Date(e):e}function YNe({enabled:e,entityId:t,instanceClient:n,databaseName:r,tableName:i,conditions:o,sort:a,pageIndex:c,pageSize:d,onlyIfCached:f}){return{enabled:e&&!!o,queryKey:[t,r,i,"search_by_conditions",o,a.attribute||"default",a.descending||!1,c||0,d||0,f],staleTime:6e4,retry:!1,queryFn:({signal:p})=>n.post("/",{operation:"search_by_conditions",get_attributes:["*"],database:r,table:i,conditions:o,sort:a.attribute.length?a:void 0,offset:c*d,limit:d,onlyIfCached:f,noCacheStore:f},{timeout:0,signal:p})}}function WNe(e,t,n){return t.split(/ & /).map(i=>XNe(e,i,n))}function XNe(e,t,n){t.startsWith(e)&&(t=t.substring(e.length));const{comparator:r,value:i}=JNe(t);switch(n?.type){case"ID":case"String":return{search_attribute:e,search_type:r,search_value:i};case"Int":case"BigInt":case"Long":case"Float":{const o=n.type.includes("Int")?parseInt(i,10):parseFloat(i);if(isNaN(o))throw new Error(`${i} does not appear to be a valid number.`);return{search_attribute:e,search_type:r,search_value:o}}case"Date":{const o=new Date(i).toISOString();return{search_attribute:e,search_type:r,search_value:o}}case"Boolean":return{search_attribute:e,search_type:r,search_value:qNe(i)};case"Blob":case"Bytes":return{search_attribute:e,search_type:r,search_value:i};case"Any":default:return{search_attribute:e,search_type:r,search_value:ZNe(i)}}}const K$={"=== ":"equals","== ":"eq","equals ":"equals","equal ":"equals","eq ":"eq","!== ":"not_equal","!= ":"ne","notequals ":"not_equal","notequal ":"not_equal","ne ":"ne"},QNe={">":"greater_than",g:"greater_than",gt:"greater_than","=gt":"greater_than",greater:"greater_than",greaterthan:"greater_than",">=":"greater_than_equal",ge:"greater_than_equal","=ge":"greater_than_equal",gte:"greater_than_equal",greaterorequal:"greater_than_equal",greaterthanequal:"greater_than_equal",greaterthanorequal:"greater_than_equal","<":"less_than",l:"less_than",lt:"less_than","=lt":"less_than",less:"less_than",lessthan:"less_than","<=":"less_than_equal",lte:"less_than_equal",le:"less_than_equal","=le":"less_than_equal",lessorequal:"less_than_equal",lessthanequal:"less_than_equal",lessthanorequal:"less_than_equal"};function JNe(e){const t=e.toLowerCase(),n=t.match(/^([>=<a-z_ ]+)([\d._TZ-]+)$/);if(n){const r=n[1].replace(/[_ ]+/g,"").replace(/^([a-z]+)=$/g,"$1"),i=n[2],o=QNe[r];if(o)return{comparator:o,value:i}}for(const r in K$)if(t.startsWith(r))return{comparator:K$[r],value:e.slice(r.length)};return t.endsWith("*")?{comparator:"starts_with",value:e.slice(0,-1)}:{comparator:"equals",value:e}}function eTe({enabled:e,entityId:t,instanceClient:n,databaseName:r,tableName:i,ids:o}){return{queryKey:[t,"search_by_id",r,i,o],queryFn:({signal:a})=>n.post("/",{get_attributes:["*"],ids:o,noCacheStore:!0,onlyIfCached:!0,operation:"search_by_id",database:r,table:i},{signal:a}),enabled:e&&!!o?.length,retry:!1}}function tTe({enabled:e,entityId:t,instanceClient:n,databaseName:r,tableName:i,searchAttribute:o,sort:a,pageIndex:c,pageSize:d,onlyIfCached:f}){return{enabled:e,queryKey:[t,r,i,"search_by_value",o,a.attribute||"default",a.descending||!1,c||0,d||0,f],retry:!1,staleTime:6e4,queryFn:({signal:p})=>{const h=a.attribute.length&&!(a.attribute===o&&!a.descending);return n.post("/",{operation:"search_by_value",get_attributes:["*"],database:r,table:i,search_attribute:o,search_value:"*",sort:h?a:void 0,offset:c*d,limit:d,onlyIfCached:f,noCacheStore:f},{timeout:0,signal:p})}}}async function nTe(e){const{databaseName:t,tableName:n,records:r,instanceClient:i}=e,{data:o}=await i.post("/",{operation:"update",database:t,table:n,records:r});return o}function rTe(){return at({mutationFn:nTe})}const iTe=yj(nt(),nt());function oTe({applyFilters:e,columnFiltersForm:t,headerGroups:n}){const r=x.useCallback(i=>{if(i.key==="Enter")return i.preventDefault(),e(),!1},[e]);return u.jsx(rh,{children:u.jsx(Jt,{...t,children:n.map(i=>u.jsx(Ai,{className:"border-none",children:i.headers.map(o=>u.jsx(Xa,{style:{width:`${o.column.getSize()}px`},children:o.column.columnDef.enableColumnFilter&&u.jsx(Me,{control:t.control,name:o.id,render:({field:a})=>u.jsxs(Ae,{className:"border-r-1 border-r-black",children:[u.jsx($e,{children:u.jsx(ze,{...a,type:"text",autoCapitalize:"none",autoComplete:"off",className:"rounded-none",onKeyDown:r,value:a.value??""})}),u.jsx(De,{})]})})},o.id))},i.id))})})}function aTe({columns:e,columnVisibility:t,setColumnVisibility:n}){const r=x.useMemo(()=>e.map(i=>i.header).filter(fa),[e]);return u.jsxs(eh,{children:[u.jsx(th,{asChild:!0,children:u.jsxs(be,{variant:"ghost",children:[u.jsx(_X,{className:"inline-block "}),"Columns"]})}),u.jsx(nh,{children:r.map(i=>u.jsx(sTe,{columnHeader:i,columnVisibility:t,setColumnVisibility:n},i))})]})}function sTe({columnHeader:e,columnVisibility:t,setColumnVisibility:n}){const{toggled:r,toggle:i}=hC(t[e]??!0);return x.useEffect(()=>{t[e]!==r&&n({...t,[e]:r})},[e,t,r,n]),u.jsx(ube,{checked:r,onClick:i,children:e},e)}function lTe({className:e}){return u.jsx(MP,{className:aa("animate-spin",e)})}function cTe({applyFilters:e,columns:t,columnVisibility:n,columnFiltersForm:r,data:i,isFetching:o,onColumnClick:a,onRowClick:c,pageIndex:d,pageSize:f,setPageIndex:p,setPageSize:h,filtersToggled:v,totalPages:y,totalRecords:b}){const S=fx({data:i||[],columns:t,manualPagination:!0,enableColumnResizing:!0,columnResizeMode:"onEnd",pageCount:y,defaultColumn:{minSize:1},state:{columnVisibility:n},rowCount:b,getCoreRowModel:dx(),getPaginationRowModel:lwe()}),C=x.useCallback(()=>{p(d-1)},[d,p]),E=x.useCallback(()=>{p(d+1)},[d,p]);return u.jsxs(u.Fragment,{children:[u.jsxs(mx,{containerClassName:"rounded-md bg-black-dark grow max-h-[calc(100vh-128px-16px-112px-80px)]",children:[u.jsx(rh,{children:S.getHeaderGroups().map(k=>u.jsx(Ai,{className:"border-none",children:k.headers.map(j=>u.jsx(pH,{header:j,onColumnClick:a},j.id))},k.id))}),v&&u.jsx(oTe,{applyFilters:e,columnFiltersForm:r,headerGroups:S.getHeaderGroups()}),u.jsx(px,{className:"bg-black border border-grey-700",children:S.getRowModel().rows?.length?S.getRowModel().rows.map(k=>u.jsx(Ai,{"data-state":k.getIsSelected()&&"selected",onClick:()=>c?.(k),className:Pe("hover:bg-muted/10 data-[state=selected]:bg-muted",c&&"cursor-pointer"),children:k.getVisibleCells().map(j=>u.jsx(Xa,{style:{width:`${j.column.getSize()}px`},className:"px-2 py-2 overflow-x-hidden max-w-32 text-ellipsis whitespace-nowrap",children:j.getValue()=="[object Object]"?JSON.stringify(j.getValue()):wc(j.column.columnDef.cell,j.getContext())},j.id))},k.id)):u.jsx(Ai,{children:u.jsx(Xa,{colSpan:t.length,className:"h-24 text-center",children:o||i===void 0?u.jsx(lTe,{className:"opacity-50 inline-block"}):u.jsx("span",{children:"No results."})})})})]}),u.jsxs("div",{className:"flex items-center justify-end py-4 space-x-2 pr-4",children:[u.jsxs(be,{variant:"defaultOutline",size:"sm",onClick:C,className:"select-none",disabled:d===0,children:[u.jsx(mc,{}),"Previous"]}),u.jsx("div",{className:"grow"}),u.jsxs("div",{className:"text-center",children:[u.jsx("dt",{className:"font-medium text-gray-500 text-sm/6 dark:text-gray-400",children:"Records"}),u.jsx("dd",{className:"font-semibold tracking-tight",children:b===void 0?u.jsx(Er,{}):Rv(b)})]}),b!==void 0&&b>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{children:u.jsxs(co,{defaultValue:f.toString(),onValueChange:k=>{h(Number(k))},children:[u.jsx(fo,{className:"h-10 w-[80px]",children:u.jsx(uo,{})}),u.jsx(mo,{side:"top",children:[20,50,100,250].map(k=>u.jsx(Sn,{value:`${k}`,children:k},k))})]})}),y!==void 0&&y>1&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"text-center",children:[u.jsx("dt",{className:"font-medium text-gray-500 text-sm/6 dark:text-gray-400",children:"Pages"}),u.jsx("dd",{className:"font-semibold tracking-tight",children:Rv(y)})]}),u.jsxs("div",{className:"text-center",children:[u.jsx("dt",{className:"font-medium text-gray-500 text-sm/6 dark:text-gray-400",children:"Page"}),u.jsx("dd",{className:"font-semibold tracking-tight",children:Rv(d+1)})]})]})]}),u.jsx("div",{className:"grow"}),u.jsxs(be,{variant:"defaultOutline",size:"sm",onClick:E,className:"select-none",disabled:y===void 0||d===y-1,children:["Next",u.jsx(ro,{})]})]})]})}function uTe({instanceDatabaseMap:e,databaseName:t,tableName:n}){const r=tt({strict:!1}),i=pn(),o=Ft(),{clusterId:a,instanceId:c}=r,{toggled:d,toggle:f}=hC(!0),p=ES(c??a,t,n,"insert"),h=ES(c??a,t,n,"update"),v=ES(c??a,t,n,"delete"),y=Yd(),{data:b}=Mt(BNe({...o,databaseName:t,tableName:n})),S=x.useMemo(()=>of(b?.attributes??[],"attribute"),[b]),[C,E]=Iv(null,r),[k,j]=x.useState(!1),I=x.useMemo(()=>(t?Object.keys(e?.[t]||[]).sort():[]).length===1,[e,t]),{toggled:A,toggleOn:N,toggleOff:T}=hC(!1),z=Qt({resolver:ln(iTe)}),{reset:L}=z,G=z.watch(),[J,Y]=x.useState(null),W=x.useCallback(()=>{const Ct=[];for(const yt in G)if(G[yt]?.length)try{Ct.push(...WNe(yt,G[yt],S[yt]))}catch(Hr){_e.error(String(Hr))}Y(Ct.length?Ct:null),L({...G})},[S,L,G]),F=x.useCallback(()=>{L({},{keepValues:!1,keepDirtyValues:!1,keepDefaultValues:!1}),L(),Y(null),T()},[T,L]);x.useEffect(function(){return F()},[r,F]);const{dataTableColumns:Z,hashAttribute:M}=CNe(b),[K,U]=x.useState(!1),[te,D]=x.useState(!1),[P,V]=Iv({attribute:M,descending:!1},r),[O,ee]=Iv(0,[t,n]),[ue,pe]=x.useState(20),B=b?.record_count,ie=b?.record_count?Math.ceil(b.record_count/ue):0,Se=A&&!!J,{data:Ie,isFetching:Fe}=Mt(tTe({...o,enabled:!Se&&!!M,databaseName:t,tableName:n,searchAttribute:M,sort:P,pageSize:ue,pageIndex:O,onlyIfCached:d})),{data:Ue,isFetching:Ye}=Mt(YNe({...o,enabled:Se,databaseName:t,tableName:n,conditions:J,sort:P,pageSize:ue,pageIndex:O,onlyIfCached:d})),_t=Se?Ue:Ie,{data:gn}=Mt(eTe({...o,enabled:k,databaseName:t,tableName:n,ids:C})),{mutate:Tn,isPending:Fn}=rTe(),{mutate:hi,isPending:tn}=VNe(),q=gr(),oe=x.useCallback(()=>q.invalidateQueries({queryKey:[o.entityId,t,n]}),[q,o.entityId,t,n]),de=x.useCallback(Ct=>{Tn({...o,databaseName:t,tableName:n,records:Ct},{onSuccess:()=>{oe(),j(!1),_e.success("Record updated successfully")}})},[Tn,o,t,n,oe]),we=x.useCallback(Ct=>{hi({...o,databaseName:t,tableName:n,hashValues:Ct},{onSuccess:()=>{oe(),j(!1),_e.success("Record deleted successfully")}})},[hi,o,t,n,oe]),ve=x.useCallback(Ct=>{oe(),D(!1),_e.success(`${Ct}. Please wait a few moments then refresh the table.`)},[oe]),Ee=Ct=>{E([Ct.original[M]]),j(!k)},ne=(Ct,yt)=>{V({attribute:Ct,descending:!yt})},ye=vl(oe),Te=x.useCallback(()=>{U(!0)},[U]),Ze=x.useCallback(()=>{D(!0)},[D]),st=x.useCallback(Ct=>void i({to:Ct==="table"?"../":"../../"}),[i]),[qt,Vn]=ad(`ColumnDisplayed/${t}}/${n}`,{}),xn=ai("ShowDeleteTable",!0),Yt=ai("ShowDeleteDatabase",!0);return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between space-y-3 md:space-y-0 md:space-x-3 pt-15 pb-4 pr-4",children:[u.jsxs("div",{className:"flex space-x-2",children:[p&&u.jsxs(be,{variant:"positiveOutline",onClick:Te,disabled:K,accessKey:"n",children:[u.jsx(po,{}),u.jsxs("span",{children:["Add ",u.jsx("u",{children:"N"}),"ew Record(s)"]})]}),p&&u.jsxs(be,{variant:"positiveOutline",onClick:Ze,disabled:te,accessKey:"c",children:[u.jsx(QX,{}),u.jsxs("span",{children:["Import ",u.jsx("u",{children:"C"}),"SV"]})]})]}),u.jsxs("div",{className:"flex space-x-2",children:[A&&J&&u.jsxs(be,{variant:"ghost",onClick:F,accessKey:"f",children:[u.jsx(SO,{className:"inline-block "}),u.jsxs("span",{children:["Clear ",u.jsx("u",{children:"F"}),"ilters"]})]}),A&&z.formState.isDirty&&u.jsxs(be,{variant:"default",onClick:W,children:[u.jsx(zX,{className:"inline-block "}),"Apply Filters"]}),A&&!J&&u.jsxs(be,{variant:"ghost",onClick:T,accessKey:"f",children:[u.jsx(SO,{className:"inline-block "}),u.jsxs("span",{children:["Hide ",u.jsx("u",{children:"F"}),"ilters"]})]}),!A&&u.jsxs(be,{variant:"ghost",onClick:N,accessKey:"f",children:[u.jsx(UX,{className:"inline-block "}),u.jsxs("span",{children:["Show ",u.jsx("u",{children:"F"}),"ilters"]})]}),u.jsx(be,{variant:"defaultOutline",onClick:ye,disabled:Fe||Ye,children:u.jsx(sa,{})}),u.jsx(aTe,{columns:Z,columnVisibility:qt,setColumnVisibility:Vn}),u.jsxs(eh,{children:[u.jsx(th,{disabled:!e,children:u.jsx(PC,{"aria-label":"Table options",color:e?"white":"gray"})}),u.jsxs(nh,{side:"bottom",align:"end",children:[u.jsxs(pr,{className:"focus:bg-primary/70 focus:text-white",onClick:f,children:[d?u.jsx(pX,{className:"text-green"}):u.jsx(NP,{}),"Only If Cached",u.jsx(Ge,{to:"https://docs.harperdb.io/docs/developers/applications/caching#cache-control-header",target:"_blank",rel:"noopener noreferrer",onClick:F8,children:u.jsx(TX,{})})]}),y&&!I&&u.jsxs(pr,{className:"focus:bg-red/70 focus:text-white",onClick:xn,children:[u.jsx(ts,{className:"inline-block "}),"Drop Table"]}),y&&u.jsxs(pr,{className:"focus:bg-red/70 focus:text-white",onClick:Yt,children:[u.jsx(PQ,{}),"Drop Database"]})]})]})]})]}),u.jsx(cTe,{data:_t?.data,isFetching:Fe||Ye,filtersToggled:A,columns:Z,columnVisibility:qt,onRowClick:Ee,onColumnClick:ne,totalPages:ie,totalRecords:B,pageIndex:O,pageSize:ue,columnFiltersForm:z,applyFilters:W,setPageIndex:ee,setPageSize:pe}),p&&b&&K&&u.jsx(RNe,{instanceTable:b,isModalOpen:K,refreshTable:oe,setIsModalOpen:U}),u.jsx(MNe,{canEditRecords:h,canDeleteRecords:v,setIsModalOpen:j,isModalOpen:k,hashAttribute:M,data:gn?.data,onSaveChanges:de,onDeleteRecord:we,isUpdateTableRecordsPending:Fn,isDeleteTableRecordsPending:tn}),u.jsx(ANe,{databaseName:t,onDeleted:st}),u.jsx($Ne,{databaseName:t,tableName:n,onDeleted:st}),u.jsx(UNe,{isModalOpen:te,setIsModalOpen:D,onSaveChanges:ve,database:t,table:n})]})}function dTe(){const e=tt({strict:!1}),t=Ft(),{data:n}=Mt(h9(t));let r,i;if(n){e.databaseName||(r=Object.keys(n).sort()[0]);const o=e.databaseName??r;!e.tableName&&o&&n[o]&&(i=Object.keys(n[o]).sort()[0])}return r||i?u.jsx(ic,{to:pC({...e,databaseName:r??e.databaseName,tableName:i}),replace:!0}):u.jsxs("main",{className:"grid grid-cols-1 gap-4 md:grid-cols-12 min-h-[calc(100vh-theme(spacing.36))]",children:[u.jsx("section",{className:"col-span-1 text-white md:col-span-4 lg:col-span-3",children:u.jsx(_Ne,{instanceDatabaseMap:n})}),u.jsx("section",{className:"col-span-1 text-white md:col-span-8 lg:col-span-9 flex flex-col",children:e.databaseName&&e.tableName&&u.jsx(uTe,{instanceDatabaseMap:n,databaseName:e.databaseName,tableName:e.tableName})})]})}function fTe(e){return Qe({getParentRoute:()=>e,path:"/databases/{-$databaseName}/{-$tableName}",component:dTe})}function mTe({entityId:e,instanceClient:t}){return{queryKey:[e,"get_status"],staleTime:9e3,refetchInterval:1e4,retryDelay:1e4,throwOnError:!1,queryFn:async()=>{const{data:n}=await t.post("/",{operation:"get_status"});return n}}}function Z$(e,t){const n=Y$(e),r=Y$(t);return!n||!r?!1:hTe(r,n)>=0}function Y$(e){if(typeof e!="string")return null;const[t]=e.split("+",1).concat(""),n=t.indexOf("-"),r=n===-1?t:t.slice(0,n),i=n===-1?"":t.slice(n+1),o=r.split(".");if(o.length===0)return null;const a=w_(o[0]),c=w_(o[1]??"0"),d=w_(o[2]??"0");if(a==null||c==null||d==null)return null;const f=i?i.split(".").map(p=>pTe(p)?Number(p):p):[];return{major:a,minor:c,patch:d,pre:f}}function w_(e){return e==null||e===""||!/^\d+$/.test(e)?null:Number(e)}function pTe(e){return/^\d+$/.test(e)}function hTe(e,t){if(e.major!==t.major)return e.major<t.major?-1:1;if(e.minor!==t.minor)return e.minor<t.minor?-1:1;if(e.patch!==t.patch)return e.patch<t.patch?-1:1;const n=e.pre.length>0,r=t.pre.length>0;if(!n&&!r)return 0;if(!n&&r)return 1;if(n&&!r)return-1;const i=Math.min(e.pre.length,t.pre.length);for(let o=0;o<i;o++){const a=e.pre[o],c=t.pre[o],d=typeof a=="number",f=typeof c=="number";if(d&&f){if(a!==c)return a<c?-1:1;continue}if(d&&!f)return-1;if(!d&&f)return 1;if(a!==c)return String(a)<String(c)?-1:1}return e.pre.length!==t.pre.length?e.pre.length<t.pre.length?-1:1:0}const I9={className:"text-white"};function gTe(){const e=pE(),t=tt({strict:!1}),n=Ft(),{data:r}=Mt(mTe(n)),i=r?.restartRequired??!1,{version:o}=Ky({strict:!1}),a=Z$("4.7.0-beta.7",o),c=Z$("4.6.0",o),d=x.useMemo(()=>[{to:tr(t),activeOptions:{exact:!0},name:"Applications",shortName:"Apps",icon:u.jsx(LC,{className:"inline-block"})},{to:tr(t,"databases"),icon:u.jsx(jX,{className:"inline-block"}),name:"Databases"},e&&a&&{to:tr(t,"apis"),name:"APIs",icon:u.jsx(NQ,{className:"inline-block"})},e&&c&&{to:tr(t,"status"),icon:u.jsx(VX,{className:"inline-block"}),name:"Status"},e&&{to:tr(t,"logs"),icon:u.jsx(mQ,{className:"inline-block"}),name:"Logs"},e&&{to:tr(t,"config"),icon:u.jsx(AQ,{className:"inline-block"}),name:"Config"}].filter(fa),[e,t,a,c]);return u.jsxs(u.Fragment,{children:[u.jsx(vTe,{links:d,restartRequired:i}),u.jsx(yTe,{links:d,restartRequired:i})]})}function vTe({links:e,restartRequired:t}){return u.jsxs("div",{className:"hidden md:flex items-center justify-between h-full text-sm text-white",children:[u.jsx(jb,{restartRequired:t}),u.jsx("div",{className:"flex space-x-2",children:e.map(({shortName:n,...r})=>u.jsxs(Ge,{className:"p-2 text-center text-gray-400 hover:text-white",activeProps:I9,...r,children:[r.icon,u.jsx("span",{className:"hidden xl:inline-block ml-1",children:r.name}),n&&u.jsxs("span",{className:"visible xl:hidden ml-1",children:[" ",n]})]},r.to))})]})}function yTe({links:e,restartRequired:t}){return u.jsx(u.Fragment,{children:u.jsxs("div",{className:"flex md:hidden items-center justify-between p-2 text-white",children:[u.jsx(jb,{restartRequired:t}),u.jsxs(eh,{children:[u.jsx(th,{asChild:!0,children:u.jsx(be,{variant:"ghost",className:"p-0",children:u.jsx(PP,{className:"h-8 w-8"})})}),u.jsxs(nh,{children:[u.jsx(gy,{children:"Instance Menu"}),u.jsx(vy,{}),e.map(n=>u.jsx(pr,{asChild:!0,children:u.jsx(Ge,{to:n.to,activeProps:I9,children:n.name})},n.to))]})]})]})})}function S_(){return u.jsxs(u.Fragment,{children:[u.jsx("nav",{className:"fixed top-20 w-full z-39 md:px-12 md:py-1 bg-grey-700",children:u.jsx(gTe,{})}),u.jsx("div",{className:"mt-32 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx(ll,{})})]})}function bTe(e){switch(e){case"local":return Qe({getParentRoute:()=>yx,id:"_instanceLayout",component:S_,loader:__});case"cluster":return Qe({getParentRoute:()=>Qa,id:"_instanceLayout",component:S_,beforeLoad:W$,loader:__});case"instance":return Qe({getParentRoute:()=>Qa,path:"instance/$instanceId",component:S_,beforeLoad:W$,loader:__})}}async function W$({context:e,params:t}){const n=e.authentication[t.instanceId||t.clusterId];if(n?.isLoading||n?.user)return;const r=e.authentication[_n];if(r?.isLoading)return;const{update:i}=t.instanceId?gL(r.user,t.organizationId,t.clusterId):hL(r.user,t.organizationId,t.clusterId);if(i){const a=t.instanceId||t.clusterId,c=Va({id:a,forceFabricConnect:!0});try{const d=await qs({instanceClient:c});Tt.setUserForIdAndKey(a,c.defaults.baseURL,d),Tt.flagForFabricConnect(a,!0);return}catch(d){console.error("Fabric Connect not established",d)}}const o=`/${t.organizationId}/${t.clusterId}/`+(t.instanceId?`instance/${t.instanceId}`:"")+"/sign-in";throw Sc({to:o,search:RH()})}function __({context:e,params:t}){const n=pL(t);return e.queryClient.ensureQueryData(xR(n))}const xTe=Zy(`inline-flex
|
|
176
|
-
items-center
|
|
177
|
-
justify-center
|
|
178
|
-
gap-2
|
|
179
|
-
whitespace-nowrap
|
|
180
|
-
rounded-lg
|
|
181
|
-
text-sm
|
|
182
|
-
transition-[color,box-shadow]
|
|
183
|
-
disabled:pointer-events-none
|
|
184
|
-
disabled:opacity-50
|
|
185
|
-
[&_svg]:pointer-events-none
|
|
186
|
-
[&_svg:not([class*='size-'])]:size-4
|
|
187
|
-
[&_svg]:shrink-0
|
|
188
|
-
ring-ring/10
|
|
189
|
-
dark:ring-ring/20
|
|
190
|
-
dark:outline-ring/40
|
|
191
|
-
outline-ring/50
|
|
192
|
-
focus-visible:ring-1
|
|
193
|
-
focus-visible:outline-1
|
|
194
|
-
focus-visible:ring-purple-200
|
|
195
|
-
aria-invalid:focus-visible:ring-0`,{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",outline:"border bg-default border-primary border-2 text-white shadow-xs hover:-translate-y-1 transition duration-200 hover:bg-grey-700/40"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});var N9="Toggle",T9=x.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:i,...o}=e,[a,c]=Do({prop:n,onChange:i,defaultProp:r??!1,caller:N9});return u.jsx(Ke.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:je(e.onClick,()=>{e.disabled||c(!a)})})});T9.displayName=N9;var wTe=T9;function STe({className:e,variant:t,size:n,...r}){return u.jsx(wTe,{"data-slot":"toggle",className:Pe(xTe({variant:t,size:n,className:e})),...r})}function A9(e){switch(e){case"warn":return"warning";case"notify":return"success";case"info":case"debug":case"trace":case void 0:case"stdout":return"secondary";case"stderr":case"error":return"destructive";default:return e}}const X$=["secondary","default","warning","outline","success","destructive"];let Q$=0;const C_=new Map,O9=e=>{if(C_.has(e))return C_.get(e);Q$++;const t=Q$%X$.length,n=X$[t];return C_.set(e,n),n};function _Te({columns:e,data:t,onRowClick:n}){const r=fx({data:t,columns:e,getCoreRowModel:dx()});return u.jsx("div",{className:"rounded-md bg-black-dark logsTable",children:u.jsxs(mx,{className:"text-xs",children:[u.jsx(rh,{children:r.getHeaderGroups().map(i=>u.jsx(Ai,{className:"border-none",children:i.headers.map(o=>u.jsx(Xj,{className:"p-4 max-w-96",children:o.isPlaceholder?null:wc(o.column.columnDef.header,o.getContext())},o.id))},i.id))}),u.jsx(px,{className:"bg-black",children:r.getRowModel().rows?.length?r.getRowModel().rows.map(i=>u.jsx(Ai,{"data-state":i.getIsSelected()&&"selected",className:Pe("hover:bg-muted/10 data-[state=selected]:bg-muted max-w-full",n&&"cursor-pointer"),onClick:()=>n?.(i),children:i.getVisibleCells().map(o=>u.jsx(Xa,{className:"p-1",children:wc(o.column.columnDef.cell,o.getContext())},o.id))},i.id)):u.jsx(Ai,{children:u.jsx(Xa,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})})}function CTe(e){try{JSON.parse(e)}catch{return!1}return!0}function ETe({setIsModalOpen:e,isModalOpen:t,data:n}){const r=n?O9(n.node):"default";return u.jsx(zn,{onOpenChange:e,open:t,children:u.jsxs(Ln,{"aria-describedby":void 0,children:[u.jsx(yr,{children:u.jsx(Nn,{children:"Edit Row"})}),n?u.jsxs("div",{className:"flex flex-col gap-3 text-white",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"inline-block pr-2",children:"Level:"}),u.jsx(zo,{variant:A9(n.level),children:Eo(n.level)})]}),u.jsxs("div",{children:[u.jsx("h3",{children:"Timestamp:"}),u.jsx("p",{className:"text-sm",children:n.timestamp})]}),u.jsxs("div",{children:[u.jsx("h3",{children:"Thread:"}),u.jsx("p",{className:"text-sm",children:n.thread})]}),u.jsxs("div",{children:[u.jsx("h3",{children:"Node:"}),u.jsx(zo,{variant:r,children:n.node})]}),u.jsxs("div",{children:[u.jsx("h3",{children:"Tags:"}),u.jsx("p",{className:"text-sm",children:n.tags&&n.tags.length>0?u.jsx("span",{children:n.tags}):"N/A"})]}),u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-bold",children:"Message"}),u.jsx(vx,{className:"w-full h-72",language:CTe(n.message)?"json":"text",theme:"vs-dark",value:n.message,options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1}})]})]}):u.jsx(Ui,{}),u.jsx(Un,{children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsxs(be,{type:"button",variant:"destructive",className:"rounded-full",children:[u.jsx(ts,{})," Delete Row"]}),u.jsxs(be,{variant:"submit",className:"rounded-full",children:[u.jsx(ho,{})," Save Changes"]})]})})]})})}function kTe({entityId:e,instanceClient:t,logFilters:n,replicated:r,isAutoRefreshEnabled:i}){return{queryKey:[e,"read_log",n.limit,n.level,n.from,n.until,r],queryFn:async()=>{const{data:o}=await t.post("/",{operation:"read_log",start:0,replicated:r,limit:n.limit?parseInt(n.limit,10):void 0,level:n.level!=="undefined"?n.level:void 0,from:n.from?new Date(n.from).toISOString():void 0,until:n.until?new Date(n.until).toISOString():void 0,order:"desc"});return o},retry:!1,refetchInterval:i?5e3:!1}}const jTe=mn({limit:nt().optional(),level:ef(["notify","error","warn","info","debug","trace","undefined"]).optional(),from:nt().or(cy()).optional(),until:nt().or(cy()).optional()});function RTe({form:e,resetFilters:t,submitFilters:n}){return u.jsx("div",{children:u.jsx(Jt,{...e,children:u.jsxs("form",{onSubmit:e.handleSubmit(n),className:"flex-col space-y-5",children:[u.jsx(Me,{control:e.control,name:"limit",render:({field:r})=>u.jsxs(Ae,{children:[u.jsx(Oe,{children:"Log Limit:"}),u.jsxs(co,{onValueChange:r.onChange,value:r.value,children:[u.jsx(fo,{className:"w-full",children:u.jsx(uo,{placeholder:"Select log limit"})}),u.jsx(mo,{children:u.jsxs(Lo,{children:[u.jsx(Sn,{value:"1000",children:"1000"}),u.jsx(Sn,{value:"500",children:"500"}),u.jsx(Sn,{value:"250",children:"250"}),u.jsx(Sn,{value:"100",children:"100"}),u.jsx(Sn,{value:"10",children:"10"})]})})]}),u.jsx(De,{})]})}),u.jsx(Me,{control:e.control,name:"level",render:({field:r})=>u.jsxs(Ae,{children:[u.jsx(Oe,{children:"Log Level:"}),u.jsxs(co,{onValueChange:r.onChange,value:r.value,children:[u.jsx(fo,{className:"w-full",children:u.jsx(uo,{placeholder:"Select log level"})}),u.jsx(mo,{children:u.jsxs(Lo,{children:[u.jsx(Sn,{value:"undefined",children:"All"}),u.jsx(Sn,{value:"notify",children:"Notify"}),u.jsx(Sn,{value:"error",children:"Error"}),u.jsx(Sn,{value:"warn",children:"Warn"}),u.jsx(Sn,{value:"info",children:"Info"}),u.jsx(Sn,{value:"debug",children:"Debug"}),u.jsx(Sn,{value:"trace",children:"Trace"})]})})]}),u.jsx(De,{})]})}),u.jsx(Me,{control:e.control,name:"from",render:({field:r})=>u.jsxs(Ae,{children:[u.jsx(Oe,{children:"Start Date:"}),u.jsx($e,{children:u.jsx(ze,{type:"datetime-local",value:r.value,onChange:r.onChange})}),u.jsx(De,{})]})}),u.jsx(Me,{control:e.control,name:"until",render:({field:r})=>u.jsxs(Ae,{children:[u.jsx(Oe,{children:"End Date:"}),u.jsx($e,{children:u.jsx(ze,{type:"datetime-local",value:r.value,onChange:r.onChange})}),u.jsx(De,{})]})}),u.jsxs("div",{className:"flex items-center justify-between space-x-2 mt-2",children:[u.jsx(be,{type:"submit",variant:"positiveOutline",className:"grow",children:"Apply Filters"}),u.jsx(be,{type:"reset",variant:"destructiveOutline",onClick:()=>t(),children:"Clear Filters"})]})]})})})}const E_={limit:"100",level:"undefined",from:"",until:""},ITe=[{accessorKey:"level",header:"Status",cell:({row:e})=>{const{level:t}=e.original;return u.jsx(zo,{variant:A9(t),children:Eo(t)})}},{accessorKey:"timestamp",header:"Date",cell:({row:e})=>{const{timestamp:t}=e.original;return u.jsx("span",{children:new Date(t).toLocaleDateString()})}},{accessorKey:"time",header:"Time",cell:({row:e})=>{const{timestamp:t}=e.original;return u.jsx("span",{children:new Date(t).toLocaleTimeString()})}},{accessorKey:"thread",header:"Thread"},{accessorKey:"node",header:"Node",cell:({row:e})=>{const{node:t}=e.original,n=O9(t);return u.jsx(u.Fragment,{children:t?u.jsxs(Cb,{children:[u.jsx(Eb,{asChild:!0,children:u.jsxs(zo,{variant:n,children:[t.split(".")[0],"..."]})}),u.jsx(kb,{className:"bg-grey-700",arrowClassName:"bg-grey-700 fill-grey-700",children:t})]}):null})}},{accessorKey:"tags",header:"Tags"},{accessorKey:"message",header:"Message",cell:({row:e})=>{const{message:t}=e.original;return e.getIsSelected(),u.jsx("pre",{children:u.jsx("code",{children:t})})}}],NTe=(e,t)=>{if(!e&&!t||!e||!t)return!0;const n=new Date(e),r=new Date(t);return n<=r};function TTe(){const[e,t]=x.useState(E_),[n,r]=x.useState(!1),[i,o]=x.useState(),[a,c]=x.useState(!1),d=Ft(),{data:f,isLoading:p,refetch:h,isFetching:v}=Mt(kTe({logFilters:e,...d,replicated:d.entityType==="cluster",isAutoRefreshEnabled:a})),y=Qt({resolver:ln(jTe),defaultValues:E_,mode:"onChange"}),b=k=>{o(k.original),r(!0)},S=async k=>{if(!NTe(k.from,k.until)){y.setError("from",{type:"onChange",message:"Start date must be before end date"}),y.setError("until",{type:"onChange",message:"End date must be after start date"});return}t(k)},C=async()=>{y.reset(),t(E_)},E=vl(h);return u.jsxs("div",{className:"grid grid-cols-1 gap-4 text-white md:grid-cols-12",children:[u.jsxs("section",{className:"col-span-1 md:col-span-4 lg:col-span-3 px-2 pt-4 md:pt-12",children:[u.jsx(RTe,{form:y,resetFilters:C,submitFilters:S}),u.jsxs("div",{className:"flex items-center justify-between space-x-2 mt-2",children:[u.jsxs(be,{variant:"defaultOutline",onClick:E,disabled:v||p||a,className:"grow",children:[u.jsx(sa,{}),"Refresh"]}),u.jsxs(STe,{variant:"outline","aria-label":"Toggle Auto Refresh",onPressedChange:c,children:[u.jsx(sa,{}),"Auto Refresh ",a?"On":"Off"]})]})]}),u.jsx("section",{className:"col-span-1 md:col-span-8 lg:col-span-9",children:p?u.jsx("div",{children:"Loading..."}):u.jsx("div",{children:u.jsx(_Te,{columns:ITe,data:f||[],onRowClick:b})})}),u.jsx(ETe,{isModalOpen:n,setIsModalOpen:r,data:i})]})}function ATe(e){return Qe({getParentRoute:()=>e,path:"logs",component:TTe})}function OTe(e){return Qe({getParentRoute:()=>e,path:"status",component:lP(async()=>Np(()=>import("./index-BedIpyD2.js"),__vite__mapDeps([3,1])),"StatusIndex")})}function DTe(e){const t=bTe(e),n=[ATe(t),...nIe(t),C_e(t),OTe(t),rNe(t),fTe(t)];return t.addChildren(n)}Qe({getParentRoute:()=>yx,path:"profile",component:lP(async()=>Np(()=>import("./index-B_cFV1Ze.js"),[]),"ProfileIndex")});const $Te=mb.addChildren([...Cge,yx.addChildren([DTe("local")])]);function MTe({routeTree:e=$Te,authentication:t}){const n=mZ();return ZY({routeTree:e,history:n,defaultNotFoundComponent:qQ,defaultErrorComponent:Fv,defaultPreload:GQ()?!1:"intent",trailingSlash:"never",defaultPreloadStaleTime:0,scrollRestoration:!0,context:{queryClient:Vv,authentication:t||{}}})}function PTe(){const e=JY(),t=MTe({authentication:e});return u.jsxs(u.Fragment,{children:[u.jsx(XY,{router:t,context:{authentication:e}}),!1]})}const zTe=({...e})=>u.jsx(bJ,{className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground font-medium",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground font-medium"}},...e});var LTe=function(){return null};function UTe(){return ece(),qse(),u.jsxs(u.Fragment,{children:[u.jsxs(YK,{client:Vv,children:[u.jsx(PTe,{}),u.jsx(LTe,{buttonPosition:"bottom-right"})]}),u.jsx(zTe,{richColors:!0})]})}var k_={exports:{}},km={},j_={exports:{}},R_={};var J$;function FTe(){return J$||(J$=1,(function(e){function t(M,K){var U=M.length;M.push(K);e:for(;0<U;){var te=U-1>>>1,D=M[te];if(0<i(D,K))M[te]=K,M[U]=D,U=te;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var K=M[0],U=M.pop();if(U!==K){M[0]=U;e:for(var te=0,D=M.length,P=D>>>1;te<P;){var V=2*(te+1)-1,O=M[V],ee=V+1,ue=M[ee];if(0>i(O,U))ee<D&&0>i(ue,O)?(M[te]=ue,M[ee]=U,te=ee):(M[te]=O,M[V]=U,te=V);else if(ee<D&&0>i(ue,U))M[te]=ue,M[ee]=U,te=ee;else break e}}return K}function i(M,K){var U=M.sortIndex-K.sortIndex;return U!==0?U:M.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var d=[],f=[],p=1,h=null,v=3,y=!1,b=!1,S=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function I(M){for(var K=n(f);K!==null;){if(K.callback===null)r(f);else if(K.startTime<=M)r(f),K.sortIndex=K.expirationTime,t(d,K);else break;K=n(f)}}function A(M){if(S=!1,I(M),!b)if(n(d)!==null)b=!0,N||(N=!0,Y());else{var K=n(f);K!==null&&Z(A,K.startTime-M)}}var N=!1,T=-1,z=5,L=-1;function G(){return C?!0:!(e.unstable_now()-L<z)}function J(){if(C=!1,N){var M=e.unstable_now();L=M;var K=!0;try{e:{b=!1,S&&(S=!1,k(T),T=-1),y=!0;var U=v;try{t:{for(I(M),h=n(d);h!==null&&!(h.expirationTime>M&&G());){var te=h.callback;if(typeof te=="function"){h.callback=null,v=h.priorityLevel;var D=te(h.expirationTime<=M);if(M=e.unstable_now(),typeof D=="function"){h.callback=D,I(M),K=!0;break t}h===n(d)&&r(d),I(M)}else r(d);h=n(d)}if(h!==null)K=!0;else{var P=n(f);P!==null&&Z(A,P.startTime-M),K=!1}}break e}finally{h=null,v=U,y=!1}K=void 0}}finally{K?Y():N=!1}}}var Y;if(typeof j=="function")Y=function(){j(J)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,F=W.port2;W.port1.onmessage=J,Y=function(){F.postMessage(null)}}else Y=function(){E(J,0)};function Z(M,K){T=E(function(){M(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(M){switch(v){case 1:case 2:case 3:var K=3;break;default:K=v}var U=v;v=K;try{return M()}finally{v=U}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(M,K){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var U=v;v=M;try{return K()}finally{v=U}},e.unstable_scheduleCallback=function(M,K,U){var te=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?te+U:te):U=te,M){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=U+D,M={id:p++,callback:K,priorityLevel:M,startTime:U,expirationTime:D,sortIndex:-1},U>te?(M.sortIndex=U,t(f,M),n(d)===null&&M===n(f)&&(S?(k(T),T=-1):S=!0,Z(A,U-te))):(M.sortIndex=D,t(d,M),b||y||(b=!0,N||(N=!0,Y()))),M},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(M){var K=v;return function(){var U=v;v=K;try{return M.apply(this,arguments)}finally{v=U}}}})(R_)),R_}var eM;function VTe(){return eM||(eM=1,j_.exports=FTe()),j_.exports}var tM;function BTe(){if(tM)return km;tM=1;var e=VTe(),t=yp(),n=sP();function r(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)l+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function o(s){var l=s,m=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(m=l.return),s=l.return;while(s)}return l.tag===3?m:null}function a(s){if(s.tag===13){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function c(s){if(s.tag===31){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function d(s){if(o(s)!==s)throw Error(r(188))}function f(s){var l=s.alternate;if(!l){if(l=o(s),l===null)throw Error(r(188));return l!==s?null:s}for(var m=s,g=l;;){var w=m.return;if(w===null)break;var _=w.alternate;if(_===null){if(g=w.return,g!==null){m=g;continue}break}if(w.child===_.child){for(_=w.child;_;){if(_===m)return d(w),s;if(_===g)return d(w),l;_=_.sibling}throw Error(r(188))}if(m.return!==g.return)m=w,g=_;else{for(var R=!1,$=w.child;$;){if($===m){R=!0,m=w,g=_;break}if($===g){R=!0,g=w,m=_;break}$=$.sibling}if(!R){for($=_.child;$;){if($===m){R=!0,m=_,g=w;break}if($===g){R=!0,g=_,m=w;break}$=$.sibling}if(!R)throw Error(r(189))}}if(m.alternate!==g)throw Error(r(190))}if(m.tag!==3)throw Error(r(188));return m.stateNode.current===m?s:l}function p(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s;for(s=s.child;s!==null;){if(l=p(s),l!==null)return l;s=s.sibling}return null}var h=Object.assign,v=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),j=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),G=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function Y(s){return s===null||typeof s!="object"?null:(s=J&&s[J]||s["@@iterator"],typeof s=="function"?s:null)}var W=Symbol.for("react.client.reference");function F(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===W?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case S:return"Fragment";case E:return"Profiler";case C:return"StrictMode";case A:return"Suspense";case N:return"SuspenseList";case L:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case b:return"Portal";case j:return s.displayName||"Context";case k:return(s._context.displayName||"Context")+".Consumer";case I:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case T:return l=s.displayName||null,l!==null?l:F(s.type)||"Memo";case z:l=s._payload,s=s._init;try{return F(s(l))}catch{}}return null}var Z=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},te=[],D=-1;function P(s){return{current:s}}function V(s){0>D||(s.current=te[D],te[D]=null,D--)}function O(s,l){D++,te[D]=s.current,s.current=l}var ee=P(null),ue=P(null),pe=P(null),B=P(null);function ie(s,l){switch(O(pe,l),O(ue,s),O(ee,null),l.nodeType){case 9:case 11:s=(s=l.documentElement)&&(s=s.namespaceURI)?LT(s):0;break;default:if(s=l.tagName,l=l.namespaceURI)l=LT(l),s=UT(l,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}V(ee),O(ee,s)}function Se(){V(ee),V(ue),V(pe)}function Ie(s){s.memoizedState!==null&&O(B,s);var l=ee.current,m=UT(l,s.type);l!==m&&(O(ue,s),O(ee,m))}function Fe(s){ue.current===s&&(V(ee),V(ue)),B.current===s&&(V(B),Wf._currentValue=U)}var Ue,Ye;function _t(s){if(Ue===void 0)try{throw Error()}catch(m){var l=m.stack.trim().match(/\n( *(at )?)/);Ue=l&&l[1]||"",Ye=-1<m.stack.indexOf(`
|
|
196
|
-
at`)?" (<anonymous>)":-1<m.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
197
|
-
`+Ue+s+Ye}var gn=!1;function Tn(s,l){if(!s||gn)return"";gn=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(l){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(me){var ce=me}Reflect.construct(s,[],xe)}else{try{xe.call()}catch(me){ce=me}s.call(xe.prototype)}}else{try{throw Error()}catch(me){ce=me}(xe=s())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(me){if(me&&ce&&typeof me.stack=="string")return[me.stack,ce.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var w=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");w&&w.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=g.DetermineComponentFrameRoot(),R=_[0],$=_[1];if(R&&$){var H=R.split(`
|
|
198
|
-
`),le=$.split(`
|
|
199
|
-
`);for(w=g=0;g<H.length&&!H[g].includes("DetermineComponentFrameRoot");)g++;for(;w<le.length&&!le[w].includes("DetermineComponentFrameRoot");)w++;if(g===H.length||w===le.length)for(g=H.length-1,w=le.length-1;1<=g&&0<=w&&H[g]!==le[w];)w--;for(;1<=g&&0<=w;g--,w--)if(H[g]!==le[w]){if(g!==1||w!==1)do if(g--,w--,0>w||H[g]!==le[w]){var he=`
|
|
200
|
-
`+H[g].replace(" at new "," at ");return s.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",s.displayName)),he}while(1<=g&&0<=w);break}}}finally{gn=!1,Error.prepareStackTrace=m}return(m=s?s.displayName||s.name:"")?_t(m):""}function Fn(s,l){switch(s.tag){case 26:case 27:case 5:return _t(s.type);case 16:return _t("Lazy");case 13:return s.child!==l&&l!==null?_t("Suspense Fallback"):_t("Suspense");case 19:return _t("SuspenseList");case 0:case 15:return Tn(s.type,!1);case 11:return Tn(s.type.render,!1);case 1:return Tn(s.type,!0);case 31:return _t("Activity");default:return""}}function hi(s){try{var l="",m=null;do l+=Fn(s,m),m=s,s=s.return;while(s);return l}catch(g){return`
|
|
201
|
-
Error generating stack: `+g.message+`
|
|
202
|
-
`+g.stack}}var tn=Object.prototype.hasOwnProperty,q=e.unstable_scheduleCallback,oe=e.unstable_cancelCallback,de=e.unstable_shouldYield,we=e.unstable_requestPaint,ve=e.unstable_now,Ee=e.unstable_getCurrentPriorityLevel,ne=e.unstable_ImmediatePriority,ye=e.unstable_UserBlockingPriority,Te=e.unstable_NormalPriority,Ze=e.unstable_LowPriority,st=e.unstable_IdlePriority,qt=e.log,Vn=e.unstable_setDisableYieldValue,xn=null,Yt=null;function Ct(s){if(typeof qt=="function"&&Vn(s),Yt&&typeof Yt.setStrictMode=="function")try{Yt.setStrictMode(xn,s)}catch{}}var yt=Math.clz32?Math.clz32:Vo,Hr=Math.log,rr=Math.LN2;function Vo(s){return s>>>=0,s===0?32:31-(Hr(s)/rr|0)|0}var Bc=256,Hc=262144,bl=4194304;function Bo(s){var l=s&42;if(l!==0)return l;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function ot(s,l,m){var g=s.pendingLanes;if(g===0)return 0;var w=0,_=s.suspendedLanes,R=s.pingedLanes;s=s.warmLanes;var $=g&134217727;return $!==0?(g=$&~_,g!==0?w=Bo(g):(R&=$,R!==0?w=Bo(R):m||(m=$&~s,m!==0&&(w=Bo(m))))):($=g&~_,$!==0?w=Bo($):R!==0?w=Bo(R):m||(m=g&~s,m!==0&&(w=Bo(m)))),w===0?0:l!==0&&l!==w&&(l&_)===0&&(_=w&-w,m=l&-l,_>=m||_===32&&(m&4194048)!==0)?l:w}function vn(s,l){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&l)===0}function ir(s,l){switch(s){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function br(){var s=bl;return bl<<=1,(bl&62914560)===0&&(bl=4194304),s}function is(s){for(var l=[],m=0;31>m;m++)l.push(s);return l}function wn(s,l){s.pendingLanes|=l,l!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function qr(s,l,m,g,w,_){var R=s.pendingLanes;s.pendingLanes=m,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=m,s.entangledLanes&=m,s.errorRecoveryDisabledLanes&=m,s.shellSuspendCounter=0;var $=s.entanglements,H=s.expirationTimes,le=s.hiddenUpdates;for(m=R&~m;0<m;){var he=31-yt(m),xe=1<<he;$[he]=0,H[he]=-1;var ce=le[he];if(ce!==null)for(le[he]=null,he=0;he<ce.length;he++){var me=ce[he];me!==null&&(me.lane&=-536870913)}m&=~xe}g!==0&&xl(s,g,0),_!==0&&w===0&&s.tag!==0&&(s.suspendedLanes|=_&~(R&~l))}function xl(s,l,m){s.pendingLanes|=l,s.suspendedLanes&=~l;var g=31-yt(l);s.entangledLanes|=l,s.entanglements[g]=s.entanglements[g]|1073741824|m&261930}function Gr(s,l){var m=s.entangledLanes|=l;for(s=s.entanglements;m;){var g=31-yt(m),w=1<<g;w&l|s[g]&l&&(s[g]|=l),m&=~w}}function Kr(s,l){var m=l&-l;return m=(m&42)!==0?1:qc(m),(m&(s.suspendedLanes|l))!==0?0:m}function qc(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function xo(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function Nx(){var s=K.p;return s!==0?s:(s=window.event,s===void 0?32:cA(s.type))}function ER(s,l){var m=K.p;try{return K.p=s,l()}finally{K.p=m}}var os=Math.random().toString(36).slice(2),cr="__reactFiber$"+os,Zr="__reactProps$"+os,Gc="__reactContainer$"+os,Tx="__reactEvents$"+os,D9="__reactListeners$"+os,$9="__reactHandles$"+os,kR="__reactResources$"+os,df="__reactMarker$"+os;function Ax(s){delete s[cr],delete s[Zr],delete s[Tx],delete s[D9],delete s[$9]}function Kc(s){var l=s[cr];if(l)return l;for(var m=s.parentNode;m;){if(l=m[Gc]||m[cr]){if(m=l.alternate,l.child!==null||m!==null&&m.child!==null)for(s=KT(s);s!==null;){if(m=s[cr])return m;s=KT(s)}return l}s=m,m=s.parentNode}return null}function Zc(s){if(s=s[cr]||s[Gc]){var l=s.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return s}return null}function ff(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s.stateNode;throw Error(r(33))}function Yc(s){var l=s[kR];return l||(l=s[kR]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function or(s){s[df]=!0}var jR=new Set,RR={};function wl(s,l){Wc(s,l),Wc(s+"Capture",l)}function Wc(s,l){for(RR[s]=l,s=0;s<l.length;s++)jR.add(l[s])}var M9=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),IR={},NR={};function P9(s){return tn.call(NR,s)?!0:tn.call(IR,s)?!1:M9.test(s)?NR[s]=!0:(IR[s]=!0,!1)}function ch(s,l,m){if(P9(l))if(m===null)s.removeAttribute(l);else{switch(typeof m){case"undefined":case"function":case"symbol":s.removeAttribute(l);return;case"boolean":var g=l.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){s.removeAttribute(l);return}}s.setAttribute(l,""+m)}}function uh(s,l,m){if(m===null)s.removeAttribute(l);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(l);return}s.setAttribute(l,""+m)}}function ga(s,l,m,g){if(g===null)s.removeAttribute(m);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(m);return}s.setAttributeNS(l,m,""+g)}}function Fi(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function TR(s){var l=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function z9(s,l,m){var g=Object.getOwnPropertyDescriptor(s.constructor.prototype,l);if(!s.hasOwnProperty(l)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var w=g.get,_=g.set;return Object.defineProperty(s,l,{configurable:!0,get:function(){return w.call(this)},set:function(R){m=""+R,_.call(this,R)}}),Object.defineProperty(s,l,{enumerable:g.enumerable}),{getValue:function(){return m},setValue:function(R){m=""+R},stopTracking:function(){s._valueTracker=null,delete s[l]}}}}function Ox(s){if(!s._valueTracker){var l=TR(s)?"checked":"value";s._valueTracker=z9(s,l,""+s[l])}}function AR(s){if(!s)return!1;var l=s._valueTracker;if(!l)return!0;var m=l.getValue(),g="";return s&&(g=TR(s)?s.checked?"true":"false":s.value),s=g,s!==m?(l.setValue(s),!0):!1}function dh(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var L9=/[\n"\\]/g;function Vi(s){return s.replace(L9,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Dx(s,l,m,g,w,_,R,$){s.name="",R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?s.type=R:s.removeAttribute("type"),l!=null?R==="number"?(l===0&&s.value===""||s.value!=l)&&(s.value=""+Fi(l)):s.value!==""+Fi(l)&&(s.value=""+Fi(l)):R!=="submit"&&R!=="reset"||s.removeAttribute("value"),l!=null?$x(s,R,Fi(l)):m!=null?$x(s,R,Fi(m)):g!=null&&s.removeAttribute("value"),w==null&&_!=null&&(s.defaultChecked=!!_),w!=null&&(s.checked=w&&typeof w!="function"&&typeof w!="symbol"),$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?s.name=""+Fi($):s.removeAttribute("name")}function OR(s,l,m,g,w,_,R,$){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(s.type=_),l!=null||m!=null){if(!(_!=="submit"&&_!=="reset"||l!=null)){Ox(s);return}m=m!=null?""+Fi(m):"",l=l!=null?""+Fi(l):m,$||l===s.value||(s.value=l),s.defaultValue=l}g=g??w,g=typeof g!="function"&&typeof g!="symbol"&&!!g,s.checked=$?s.checked:!!g,s.defaultChecked=!!g,R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(s.name=R),Ox(s)}function $x(s,l,m){l==="number"&&dh(s.ownerDocument)===s||s.defaultValue===""+m||(s.defaultValue=""+m)}function Xc(s,l,m,g){if(s=s.options,l){l={};for(var w=0;w<m.length;w++)l["$"+m[w]]=!0;for(m=0;m<s.length;m++)w=l.hasOwnProperty("$"+s[m].value),s[m].selected!==w&&(s[m].selected=w),w&&g&&(s[m].defaultSelected=!0)}else{for(m=""+Fi(m),l=null,w=0;w<s.length;w++){if(s[w].value===m){s[w].selected=!0,g&&(s[w].defaultSelected=!0);return}l!==null||s[w].disabled||(l=s[w])}l!==null&&(l.selected=!0)}}function DR(s,l,m){if(l!=null&&(l=""+Fi(l),l!==s.value&&(s.value=l),m==null)){s.defaultValue!==l&&(s.defaultValue=l);return}s.defaultValue=m!=null?""+Fi(m):""}function $R(s,l,m,g){if(l==null){if(g!=null){if(m!=null)throw Error(r(92));if(Z(g)){if(1<g.length)throw Error(r(93));g=g[0]}m=g}m==null&&(m=""),l=m}m=Fi(l),s.defaultValue=m,g=s.textContent,g===m&&g!==""&&g!==null&&(s.value=g),Ox(s)}function Qc(s,l){if(l){var m=s.firstChild;if(m&&m===s.lastChild&&m.nodeType===3){m.nodeValue=l;return}}s.textContent=l}var U9=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function MR(s,l,m){var g=l.indexOf("--")===0;m==null||typeof m=="boolean"||m===""?g?s.setProperty(l,""):l==="float"?s.cssFloat="":s[l]="":g?s.setProperty(l,m):typeof m!="number"||m===0||U9.has(l)?l==="float"?s.cssFloat=m:s[l]=(""+m).trim():s[l]=m+"px"}function PR(s,l,m){if(l!=null&&typeof l!="object")throw Error(r(62));if(s=s.style,m!=null){for(var g in m)!m.hasOwnProperty(g)||l!=null&&l.hasOwnProperty(g)||(g.indexOf("--")===0?s.setProperty(g,""):g==="float"?s.cssFloat="":s[g]="");for(var w in l)g=l[w],l.hasOwnProperty(w)&&m[w]!==g&&MR(s,w,g)}else for(var _ in l)l.hasOwnProperty(_)&&MR(s,_,l[_])}function Mx(s){if(s.indexOf("-")===-1)return!1;switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var F9=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),V9=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function fh(s){return V9.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function va(){}var Px=null;function zx(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Jc=null,eu=null;function zR(s){var l=Zc(s);if(l&&(s=l.stateNode)){var m=s[Zr]||null;e:switch(s=l.stateNode,l.type){case"input":if(Dx(s,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name),l=m.name,m.type==="radio"&&l!=null){for(m=s;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll('input[name="'+Vi(""+l)+'"][type="radio"]'),l=0;l<m.length;l++){var g=m[l];if(g!==s&&g.form===s.form){var w=g[Zr]||null;if(!w)throw Error(r(90));Dx(g,w.value,w.defaultValue,w.defaultValue,w.checked,w.defaultChecked,w.type,w.name)}}for(l=0;l<m.length;l++)g=m[l],g.form===s.form&&AR(g)}break e;case"textarea":DR(s,m.value,m.defaultValue);break e;case"select":l=m.value,l!=null&&Xc(s,!!m.multiple,l,!1)}}}var Lx=!1;function LR(s,l,m){if(Lx)return s(l,m);Lx=!0;try{var g=s(l);return g}finally{if(Lx=!1,(Jc!==null||eu!==null)&&(Jh(),Jc&&(l=Jc,s=eu,eu=Jc=null,zR(l),s)))for(l=0;l<s.length;l++)zR(s[l])}}function mf(s,l){var m=s.stateNode;if(m===null)return null;var g=m[Zr]||null;if(g===null)return null;m=g[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(s=s.type,g=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!g;break e;default:s=!1}if(s)return null;if(m&&typeof m!="function")throw Error(r(231,l,typeof m));return m}var ya=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ux=!1;if(ya)try{var pf={};Object.defineProperty(pf,"passive",{get:function(){Ux=!0}}),window.addEventListener("test",pf,pf),window.removeEventListener("test",pf,pf)}catch{Ux=!1}var as=null,Fx=null,mh=null;function UR(){if(mh)return mh;var s,l=Fx,m=l.length,g,w="value"in as?as.value:as.textContent,_=w.length;for(s=0;s<m&&l[s]===w[s];s++);var R=m-s;for(g=1;g<=R&&l[m-g]===w[_-g];g++);return mh=w.slice(s,1<g?1-g:void 0)}function ph(s){var l=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&l===13&&(s=13)):s=l,s===10&&(s=13),32<=s||s===13?s:0}function hh(){return!0}function FR(){return!1}function Yr(s){function l(m,g,w,_,R){this._reactName=m,this._targetInst=w,this.type=g,this.nativeEvent=_,this.target=R,this.currentTarget=null;for(var $ in s)s.hasOwnProperty($)&&(m=s[$],this[$]=m?m(_):_[$]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?hh:FR,this.isPropagationStopped=FR,this}return h(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=hh)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=hh)},persist:function(){},isPersistent:hh}),l}var Sl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gh=Yr(Sl),hf=h({},Sl,{view:0,detail:0}),B9=Yr(hf),Vx,Bx,gf,vh=h({},hf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qx,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==gf&&(gf&&s.type==="mousemove"?(Vx=s.screenX-gf.screenX,Bx=s.screenY-gf.screenY):Bx=Vx=0,gf=s),Vx)},movementY:function(s){return"movementY"in s?s.movementY:Bx}}),VR=Yr(vh),H9=h({},vh,{dataTransfer:0}),q9=Yr(H9),G9=h({},hf,{relatedTarget:0}),Hx=Yr(G9),K9=h({},Sl,{animationName:0,elapsedTime:0,pseudoElement:0}),Z9=Yr(K9),Y9=h({},Sl,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),W9=Yr(Y9),X9=h({},Sl,{data:0}),BR=Yr(X9),Q9={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},J9={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},e7={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function t7(s){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(s):(s=e7[s])?!!l[s]:!1}function qx(){return t7}var n7=h({},hf,{key:function(s){if(s.key){var l=Q9[s.key]||s.key;if(l!=="Unidentified")return l}return s.type==="keypress"?(s=ph(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?J9[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qx,charCode:function(s){return s.type==="keypress"?ph(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?ph(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),r7=Yr(n7),i7=h({},vh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),HR=Yr(i7),o7=h({},hf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qx}),a7=Yr(o7),s7=h({},Sl,{propertyName:0,elapsedTime:0,pseudoElement:0}),l7=Yr(s7),c7=h({},vh,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),u7=Yr(c7),d7=h({},Sl,{newState:0,oldState:0}),f7=Yr(d7),m7=[9,13,27,32],Gx=ya&&"CompositionEvent"in window,vf=null;ya&&"documentMode"in document&&(vf=document.documentMode);var p7=ya&&"TextEvent"in window&&!vf,qR=ya&&(!Gx||vf&&8<vf&&11>=vf),GR=" ",KR=!1;function ZR(s,l){switch(s){case"keyup":return m7.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function YR(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var tu=!1;function h7(s,l){switch(s){case"compositionend":return YR(l);case"keypress":return l.which!==32?null:(KR=!0,GR);case"textInput":return s=l.data,s===GR&&KR?null:s;default:return null}}function g7(s,l){if(tu)return s==="compositionend"||!Gx&&ZR(s,l)?(s=UR(),mh=Fx=as=null,tu=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return qR&&l.locale!=="ko"?null:l.data;default:return null}}var v7={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function WR(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l==="input"?!!v7[s.type]:l==="textarea"}function XR(s,l,m,g){Jc?eu?eu.push(g):eu=[g]:Jc=g,l=ag(l,"onChange"),0<l.length&&(m=new gh("onChange","change",null,m,g),s.push({event:m,listeners:l}))}var yf=null,bf=null;function y7(s){OT(s,0)}function yh(s){var l=ff(s);if(AR(l))return s}function QR(s,l){if(s==="change")return l}var JR=!1;if(ya){var Kx;if(ya){var Zx="oninput"in document;if(!Zx){var eI=document.createElement("div");eI.setAttribute("oninput","return;"),Zx=typeof eI.oninput=="function"}Kx=Zx}else Kx=!1;JR=Kx&&(!document.documentMode||9<document.documentMode)}function tI(){yf&&(yf.detachEvent("onpropertychange",nI),bf=yf=null)}function nI(s){if(s.propertyName==="value"&&yh(bf)){var l=[];XR(l,bf,s,zx(s)),LR(y7,l)}}function b7(s,l,m){s==="focusin"?(tI(),yf=l,bf=m,yf.attachEvent("onpropertychange",nI)):s==="focusout"&&tI()}function x7(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return yh(bf)}function w7(s,l){if(s==="click")return yh(l)}function S7(s,l){if(s==="input"||s==="change")return yh(l)}function _7(s,l){return s===l&&(s!==0||1/s===1/l)||s!==s&&l!==l}var gi=typeof Object.is=="function"?Object.is:_7;function xf(s,l){if(gi(s,l))return!0;if(typeof s!="object"||s===null||typeof l!="object"||l===null)return!1;var m=Object.keys(s),g=Object.keys(l);if(m.length!==g.length)return!1;for(g=0;g<m.length;g++){var w=m[g];if(!tn.call(l,w)||!gi(s[w],l[w]))return!1}return!0}function rI(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function iI(s,l){var m=rI(s);s=0;for(var g;m;){if(m.nodeType===3){if(g=s+m.textContent.length,s<=l&&g>=l)return{node:m,offset:l-s};s=g}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=rI(m)}}function oI(s,l){return s&&l?s===l?!0:s&&s.nodeType===3?!1:l&&l.nodeType===3?oI(s,l.parentNode):"contains"in s?s.contains(l):s.compareDocumentPosition?!!(s.compareDocumentPosition(l)&16):!1:!1}function aI(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var l=dh(s.document);l instanceof s.HTMLIFrameElement;){try{var m=typeof l.contentWindow.location.href=="string"}catch{m=!1}if(m)s=l.contentWindow;else break;l=dh(s.document)}return l}function Yx(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l&&(l==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||l==="textarea"||s.contentEditable==="true")}var C7=ya&&"documentMode"in document&&11>=document.documentMode,nu=null,Wx=null,wf=null,Xx=!1;function sI(s,l,m){var g=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;Xx||nu==null||nu!==dh(g)||(g=nu,"selectionStart"in g&&Yx(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),wf&&xf(wf,g)||(wf=g,g=ag(Wx,"onSelect"),0<g.length&&(l=new gh("onSelect","select",null,l,m),s.push({event:l,listeners:g}),l.target=nu)))}function _l(s,l){var m={};return m[s.toLowerCase()]=l.toLowerCase(),m["Webkit"+s]="webkit"+l,m["Moz"+s]="moz"+l,m}var ru={animationend:_l("Animation","AnimationEnd"),animationiteration:_l("Animation","AnimationIteration"),animationstart:_l("Animation","AnimationStart"),transitionrun:_l("Transition","TransitionRun"),transitionstart:_l("Transition","TransitionStart"),transitioncancel:_l("Transition","TransitionCancel"),transitionend:_l("Transition","TransitionEnd")},Qx={},lI={};ya&&(lI=document.createElement("div").style,"AnimationEvent"in window||(delete ru.animationend.animation,delete ru.animationiteration.animation,delete ru.animationstart.animation),"TransitionEvent"in window||delete ru.transitionend.transition);function Cl(s){if(Qx[s])return Qx[s];if(!ru[s])return s;var l=ru[s],m;for(m in l)if(l.hasOwnProperty(m)&&m in lI)return Qx[s]=l[m];return s}var cI=Cl("animationend"),uI=Cl("animationiteration"),dI=Cl("animationstart"),E7=Cl("transitionrun"),k7=Cl("transitionstart"),j7=Cl("transitioncancel"),fI=Cl("transitionend"),mI=new Map,Jx="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Jx.push("scrollEnd");function wo(s,l){mI.set(s,l),wl(l,[s])}var bh=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Bi=[],iu=0,e0=0;function xh(){for(var s=iu,l=e0=iu=0;l<s;){var m=Bi[l];Bi[l++]=null;var g=Bi[l];Bi[l++]=null;var w=Bi[l];Bi[l++]=null;var _=Bi[l];if(Bi[l++]=null,g!==null&&w!==null){var R=g.pending;R===null?w.next=w:(w.next=R.next,R.next=w),g.pending=w}_!==0&&pI(m,w,_)}}function wh(s,l,m,g){Bi[iu++]=s,Bi[iu++]=l,Bi[iu++]=m,Bi[iu++]=g,e0|=g,s.lanes|=g,s=s.alternate,s!==null&&(s.lanes|=g)}function t0(s,l,m,g){return wh(s,l,m,g),Sh(s)}function El(s,l){return wh(s,null,null,l),Sh(s)}function pI(s,l,m){s.lanes|=m;var g=s.alternate;g!==null&&(g.lanes|=m);for(var w=!1,_=s.return;_!==null;)_.childLanes|=m,g=_.alternate,g!==null&&(g.childLanes|=m),_.tag===22&&(s=_.stateNode,s===null||s._visibility&1||(w=!0)),s=_,_=_.return;return s.tag===3?(_=s.stateNode,w&&l!==null&&(w=31-yt(m),s=_.hiddenUpdates,g=s[w],g===null?s[w]=[l]:g.push(l),l.lane=m|536870912),_):null}function Sh(s){if(50<Bf)throw Bf=0,uw=null,Error(r(185));for(var l=s.return;l!==null;)s=l,l=s.return;return s.tag===3?s.stateNode:null}var ou={};function R7(s,l,m,g){this.tag=s,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vi(s,l,m,g){return new R7(s,l,m,g)}function n0(s){return s=s.prototype,!(!s||!s.isReactComponent)}function ba(s,l){var m=s.alternate;return m===null?(m=vi(s.tag,l,s.key,s.mode),m.elementType=s.elementType,m.type=s.type,m.stateNode=s.stateNode,m.alternate=s,s.alternate=m):(m.pendingProps=l,m.type=s.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=s.flags&65011712,m.childLanes=s.childLanes,m.lanes=s.lanes,m.child=s.child,m.memoizedProps=s.memoizedProps,m.memoizedState=s.memoizedState,m.updateQueue=s.updateQueue,l=s.dependencies,m.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},m.sibling=s.sibling,m.index=s.index,m.ref=s.ref,m.refCleanup=s.refCleanup,m}function hI(s,l){s.flags&=65011714;var m=s.alternate;return m===null?(s.childLanes=0,s.lanes=l,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=m.childLanes,s.lanes=m.lanes,s.child=m.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=m.memoizedProps,s.memoizedState=m.memoizedState,s.updateQueue=m.updateQueue,s.type=m.type,l=m.dependencies,s.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),s}function _h(s,l,m,g,w,_){var R=0;if(g=s,typeof s=="function")n0(s)&&(R=1);else if(typeof s=="string")R=Oq(s,m,ee.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case L:return s=vi(31,m,l,w),s.elementType=L,s.lanes=_,s;case S:return kl(m.children,w,_,l);case C:R=8,w|=24;break;case E:return s=vi(12,m,l,w|2),s.elementType=E,s.lanes=_,s;case A:return s=vi(13,m,l,w),s.elementType=A,s.lanes=_,s;case N:return s=vi(19,m,l,w),s.elementType=N,s.lanes=_,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case j:R=10;break e;case k:R=9;break e;case I:R=11;break e;case T:R=14;break e;case z:R=16,g=null;break e}R=29,m=Error(r(130,s===null?"null":typeof s,"")),g=null}return l=vi(R,m,l,w),l.elementType=s,l.type=g,l.lanes=_,l}function kl(s,l,m,g){return s=vi(7,s,g,l),s.lanes=m,s}function r0(s,l,m){return s=vi(6,s,null,l),s.lanes=m,s}function gI(s){var l=vi(18,null,null,0);return l.stateNode=s,l}function i0(s,l,m){return l=vi(4,s.children!==null?s.children:[],s.key,l),l.lanes=m,l.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},l}var vI=new WeakMap;function Hi(s,l){if(typeof s=="object"&&s!==null){var m=vI.get(s);return m!==void 0?m:(l={value:s,source:l,stack:hi(l)},vI.set(s,l),l)}return{value:s,source:l,stack:hi(l)}}var au=[],su=0,Ch=null,Sf=0,qi=[],Gi=0,ss=null,Ho=1,qo="";function xa(s,l){au[su++]=Sf,au[su++]=Ch,Ch=s,Sf=l}function yI(s,l,m){qi[Gi++]=Ho,qi[Gi++]=qo,qi[Gi++]=ss,ss=s;var g=Ho;s=qo;var w=32-yt(g)-1;g&=~(1<<w),m+=1;var _=32-yt(l)+w;if(30<_){var R=w-w%5;_=(g&(1<<R)-1).toString(32),g>>=R,w-=R,Ho=1<<32-yt(l)+w|m<<w|g,qo=_+s}else Ho=1<<_|m<<w|g,qo=s}function o0(s){s.return!==null&&(xa(s,1),yI(s,1,0))}function a0(s){for(;s===Ch;)Ch=au[--su],au[su]=null,Sf=au[--su],au[su]=null;for(;s===ss;)ss=qi[--Gi],qi[Gi]=null,qo=qi[--Gi],qi[Gi]=null,Ho=qi[--Gi],qi[Gi]=null}function bI(s,l){qi[Gi++]=Ho,qi[Gi++]=qo,qi[Gi++]=ss,Ho=l.id,qo=l.overflow,ss=s}var ur=null,cn=null,Nt=!1,ls=null,Ki=!1,s0=Error(r(519));function cs(s){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw _f(Hi(l,s)),s0}function xI(s){var l=s.stateNode,m=s.type,g=s.memoizedProps;switch(l[cr]=s,l[Zr]=g,m){case"dialog":kt("cancel",l),kt("close",l);break;case"iframe":case"object":case"embed":kt("load",l);break;case"video":case"audio":for(m=0;m<qf.length;m++)kt(qf[m],l);break;case"source":kt("error",l);break;case"img":case"image":case"link":kt("error",l),kt("load",l);break;case"details":kt("toggle",l);break;case"input":kt("invalid",l),OR(l,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":kt("invalid",l);break;case"textarea":kt("invalid",l),$R(l,g.value,g.defaultValue,g.children)}m=g.children,typeof m!="string"&&typeof m!="number"&&typeof m!="bigint"||l.textContent===""+m||g.suppressHydrationWarning===!0||PT(l.textContent,m)?(g.popover!=null&&(kt("beforetoggle",l),kt("toggle",l)),g.onScroll!=null&&kt("scroll",l),g.onScrollEnd!=null&&kt("scrollend",l),g.onClick!=null&&(l.onclick=va),l=!0):l=!1,l||cs(s,!0)}function wI(s){for(ur=s.return;ur;)switch(ur.tag){case 5:case 31:case 13:Ki=!1;return;case 27:case 3:Ki=!0;return;default:ur=ur.return}}function lu(s){if(s!==ur)return!1;if(!Nt)return wI(s),Nt=!0,!1;var l=s.tag,m;if((m=l!==3&&l!==27)&&((m=l===5)&&(m=s.type,m=!(m!=="form"&&m!=="button")||Ew(s.type,s.memoizedProps)),m=!m),m&&cn&&cs(s),wI(s),l===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));cn=GT(s)}else if(l===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));cn=GT(s)}else l===27?(l=cn,_s(s.type)?(s=Nw,Nw=null,cn=s):cn=l):cn=ur?Yi(s.stateNode.nextSibling):null;return!0}function jl(){cn=ur=null,Nt=!1}function l0(){var s=ls;return s!==null&&(Jr===null?Jr=s:Jr.push.apply(Jr,s),ls=null),s}function _f(s){ls===null?ls=[s]:ls.push(s)}var c0=P(null),Rl=null,wa=null;function us(s,l,m){O(c0,l._currentValue),l._currentValue=m}function Sa(s){s._currentValue=c0.current,V(c0)}function u0(s,l,m){for(;s!==null;){var g=s.alternate;if((s.childLanes&l)!==l?(s.childLanes|=l,g!==null&&(g.childLanes|=l)):g!==null&&(g.childLanes&l)!==l&&(g.childLanes|=l),s===m)break;s=s.return}}function d0(s,l,m,g){var w=s.child;for(w!==null&&(w.return=s);w!==null;){var _=w.dependencies;if(_!==null){var R=w.child;_=_.firstContext;e:for(;_!==null;){var $=_;_=w;for(var H=0;H<l.length;H++)if($.context===l[H]){_.lanes|=m,$=_.alternate,$!==null&&($.lanes|=m),u0(_.return,m,s),g||(R=null);break e}_=$.next}}else if(w.tag===18){if(R=w.return,R===null)throw Error(r(341));R.lanes|=m,_=R.alternate,_!==null&&(_.lanes|=m),u0(R,m,s),R=null}else R=w.child;if(R!==null)R.return=w;else for(R=w;R!==null;){if(R===s){R=null;break}if(w=R.sibling,w!==null){w.return=R.return,R=w;break}R=R.return}w=R}}function cu(s,l,m,g){s=null;for(var w=l,_=!1;w!==null;){if(!_){if((w.flags&524288)!==0)_=!0;else if((w.flags&262144)!==0)break}if(w.tag===10){var R=w.alternate;if(R===null)throw Error(r(387));if(R=R.memoizedProps,R!==null){var $=w.type;gi(w.pendingProps.value,R.value)||(s!==null?s.push($):s=[$])}}else if(w===B.current){if(R=w.alternate,R===null)throw Error(r(387));R.memoizedState.memoizedState!==w.memoizedState.memoizedState&&(s!==null?s.push(Wf):s=[Wf])}w=w.return}s!==null&&d0(l,s,m,g),l.flags|=262144}function Eh(s){for(s=s.firstContext;s!==null;){if(!gi(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Il(s){Rl=s,wa=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function dr(s){return SI(Rl,s)}function kh(s,l){return Rl===null&&Il(s),SI(s,l)}function SI(s,l){var m=l._currentValue;if(l={context:l,memoizedValue:m,next:null},wa===null){if(s===null)throw Error(r(308));wa=l,s.dependencies={lanes:0,firstContext:l},s.flags|=524288}else wa=wa.next=l;return m}var I7=typeof AbortController<"u"?AbortController:function(){var s=[],l=this.signal={aborted:!1,addEventListener:function(m,g){s.push(g)}};this.abort=function(){l.aborted=!0,s.forEach(function(m){return m()})}},N7=e.unstable_scheduleCallback,T7=e.unstable_NormalPriority,Bn={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function f0(){return{controller:new I7,data:new Map,refCount:0}}function Cf(s){s.refCount--,s.refCount===0&&N7(T7,function(){s.controller.abort()})}var Ef=null,m0=0,uu=0,du=null;function A7(s,l){if(Ef===null){var m=Ef=[];m0=0,uu=gw(),du={status:"pending",value:void 0,then:function(g){m.push(g)}}}return m0++,l.then(_I,_I),l}function _I(){if(--m0===0&&Ef!==null){du!==null&&(du.status="fulfilled");var s=Ef;Ef=null,uu=0,du=null;for(var l=0;l<s.length;l++)(0,s[l])()}}function O7(s,l){var m=[],g={status:"pending",value:null,reason:null,then:function(w){m.push(w)}};return s.then(function(){g.status="fulfilled",g.value=l;for(var w=0;w<m.length;w++)(0,m[w])(l)},function(w){for(g.status="rejected",g.reason=w,w=0;w<m.length;w++)(0,m[w])(void 0)}),g}var CI=M.S;M.S=function(s,l){sT=ve(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&A7(s,l),CI!==null&&CI(s,l)};var Nl=P(null);function p0(){var s=Nl.current;return s!==null?s:Wt.pooledCache}function jh(s,l){l===null?O(Nl,Nl.current):O(Nl,l.pool)}function EI(){var s=p0();return s===null?null:{parent:Bn._currentValue,pool:s}}var fu=Error(r(460)),h0=Error(r(474)),Rh=Error(r(542)),Ih={then:function(){}};function kI(s){return s=s.status,s==="fulfilled"||s==="rejected"}function jI(s,l,m){switch(m=s[m],m===void 0?s.push(l):m!==l&&(l.then(va,va),l=m),l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,II(s),s;default:if(typeof l.status=="string")l.then(va,va);else{if(s=Wt,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=l,s.status="pending",s.then(function(g){if(l.status==="pending"){var w=l;w.status="fulfilled",w.value=g}},function(g){if(l.status==="pending"){var w=l;w.status="rejected",w.reason=g}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,II(s),s}throw Al=l,fu}}function Tl(s){try{var l=s._init;return l(s._payload)}catch(m){throw m!==null&&typeof m=="object"&&typeof m.then=="function"?(Al=m,fu):m}}var Al=null;function RI(){if(Al===null)throw Error(r(459));var s=Al;return Al=null,s}function II(s){if(s===fu||s===Rh)throw Error(r(483))}var mu=null,kf=0;function Nh(s){var l=kf;return kf+=1,mu===null&&(mu=[]),jI(mu,s,l)}function jf(s,l){l=l.props.ref,s.ref=l!==void 0?l:null}function Th(s,l){throw l.$$typeof===v?Error(r(525)):(s=Object.prototype.toString.call(l),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":s)))}function NI(s){function l(re,Q){if(s){var se=re.deletions;se===null?(re.deletions=[Q],re.flags|=16):se.push(Q)}}function m(re,Q){if(!s)return null;for(;Q!==null;)l(re,Q),Q=Q.sibling;return null}function g(re){for(var Q=new Map;re!==null;)re.key!==null?Q.set(re.key,re):Q.set(re.index,re),re=re.sibling;return Q}function w(re,Q){return re=ba(re,Q),re.index=0,re.sibling=null,re}function _(re,Q,se){return re.index=se,s?(se=re.alternate,se!==null?(se=se.index,se<Q?(re.flags|=67108866,Q):se):(re.flags|=67108866,Q)):(re.flags|=1048576,Q)}function R(re){return s&&re.alternate===null&&(re.flags|=67108866),re}function $(re,Q,se,ge){return Q===null||Q.tag!==6?(Q=r0(se,re.mode,ge),Q.return=re,Q):(Q=w(Q,se),Q.return=re,Q)}function H(re,Q,se,ge){var We=se.type;return We===S?he(re,Q,se.props.children,ge,se.key):Q!==null&&(Q.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===z&&Tl(We)===Q.type)?(Q=w(Q,se.props),jf(Q,se),Q.return=re,Q):(Q=_h(se.type,se.key,se.props,null,re.mode,ge),jf(Q,se),Q.return=re,Q)}function le(re,Q,se,ge){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==se.containerInfo||Q.stateNode.implementation!==se.implementation?(Q=i0(se,re.mode,ge),Q.return=re,Q):(Q=w(Q,se.children||[]),Q.return=re,Q)}function he(re,Q,se,ge,We){return Q===null||Q.tag!==7?(Q=kl(se,re.mode,ge,We),Q.return=re,Q):(Q=w(Q,se),Q.return=re,Q)}function xe(re,Q,se){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=r0(""+Q,re.mode,se),Q.return=re,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case y:return se=_h(Q.type,Q.key,Q.props,null,re.mode,se),jf(se,Q),se.return=re,se;case b:return Q=i0(Q,re.mode,se),Q.return=re,Q;case z:return Q=Tl(Q),xe(re,Q,se)}if(Z(Q)||Y(Q))return Q=kl(Q,re.mode,se,null),Q.return=re,Q;if(typeof Q.then=="function")return xe(re,Nh(Q),se);if(Q.$$typeof===j)return xe(re,kh(re,Q),se);Th(re,Q)}return null}function ce(re,Q,se,ge){var We=Q!==null?Q.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return We!==null?null:$(re,Q,""+se,ge);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case y:return se.key===We?H(re,Q,se,ge):null;case b:return se.key===We?le(re,Q,se,ge):null;case z:return se=Tl(se),ce(re,Q,se,ge)}if(Z(se)||Y(se))return We!==null?null:he(re,Q,se,ge,null);if(typeof se.then=="function")return ce(re,Q,Nh(se),ge);if(se.$$typeof===j)return ce(re,Q,kh(re,se),ge);Th(re,se)}return null}function me(re,Q,se,ge,We){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return re=re.get(se)||null,$(Q,re,""+ge,We);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case y:return re=re.get(ge.key===null?se:ge.key)||null,H(Q,re,ge,We);case b:return re=re.get(ge.key===null?se:ge.key)||null,le(Q,re,ge,We);case z:return ge=Tl(ge),me(re,Q,se,ge,We)}if(Z(ge)||Y(ge))return re=re.get(se)||null,he(Q,re,ge,We,null);if(typeof ge.then=="function")return me(re,Q,se,Nh(ge),We);if(ge.$$typeof===j)return me(re,Q,se,kh(Q,ge),We);Th(Q,ge)}return null}function Ve(re,Q,se,ge){for(var We=null,Ot=null,qe=Q,pt=Q=0,It=null;qe!==null&&pt<se.length;pt++){qe.index>pt?(It=qe,qe=null):It=qe.sibling;var Dt=ce(re,qe,se[pt],ge);if(Dt===null){qe===null&&(qe=It);break}s&&qe&&Dt.alternate===null&&l(re,qe),Q=_(Dt,Q,pt),Ot===null?We=Dt:Ot.sibling=Dt,Ot=Dt,qe=It}if(pt===se.length)return m(re,qe),Nt&&xa(re,pt),We;if(qe===null){for(;pt<se.length;pt++)qe=xe(re,se[pt],ge),qe!==null&&(Q=_(qe,Q,pt),Ot===null?We=qe:Ot.sibling=qe,Ot=qe);return Nt&&xa(re,pt),We}for(qe=g(qe);pt<se.length;pt++)It=me(qe,re,pt,se[pt],ge),It!==null&&(s&&It.alternate!==null&&qe.delete(It.key===null?pt:It.key),Q=_(It,Q,pt),Ot===null?We=It:Ot.sibling=It,Ot=It);return s&&qe.forEach(function(Rs){return l(re,Rs)}),Nt&&xa(re,pt),We}function Xe(re,Q,se,ge){if(se==null)throw Error(r(151));for(var We=null,Ot=null,qe=Q,pt=Q=0,It=null,Dt=se.next();qe!==null&&!Dt.done;pt++,Dt=se.next()){qe.index>pt?(It=qe,qe=null):It=qe.sibling;var Rs=ce(re,qe,Dt.value,ge);if(Rs===null){qe===null&&(qe=It);break}s&&qe&&Rs.alternate===null&&l(re,qe),Q=_(Rs,Q,pt),Ot===null?We=Rs:Ot.sibling=Rs,Ot=Rs,qe=It}if(Dt.done)return m(re,qe),Nt&&xa(re,pt),We;if(qe===null){for(;!Dt.done;pt++,Dt=se.next())Dt=xe(re,Dt.value,ge),Dt!==null&&(Q=_(Dt,Q,pt),Ot===null?We=Dt:Ot.sibling=Dt,Ot=Dt);return Nt&&xa(re,pt),We}for(qe=g(qe);!Dt.done;pt++,Dt=se.next())Dt=me(qe,re,pt,Dt.value,ge),Dt!==null&&(s&&Dt.alternate!==null&&qe.delete(Dt.key===null?pt:Dt.key),Q=_(Dt,Q,pt),Ot===null?We=Dt:Ot.sibling=Dt,Ot=Dt);return s&&qe.forEach(function(Hq){return l(re,Hq)}),Nt&&xa(re,pt),We}function Zt(re,Q,se,ge){if(typeof se=="object"&&se!==null&&se.type===S&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case y:e:{for(var We=se.key;Q!==null;){if(Q.key===We){if(We=se.type,We===S){if(Q.tag===7){m(re,Q.sibling),ge=w(Q,se.props.children),ge.return=re,re=ge;break e}}else if(Q.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===z&&Tl(We)===Q.type){m(re,Q.sibling),ge=w(Q,se.props),jf(ge,se),ge.return=re,re=ge;break e}m(re,Q);break}else l(re,Q);Q=Q.sibling}se.type===S?(ge=kl(se.props.children,re.mode,ge,se.key),ge.return=re,re=ge):(ge=_h(se.type,se.key,se.props,null,re.mode,ge),jf(ge,se),ge.return=re,re=ge)}return R(re);case b:e:{for(We=se.key;Q!==null;){if(Q.key===We)if(Q.tag===4&&Q.stateNode.containerInfo===se.containerInfo&&Q.stateNode.implementation===se.implementation){m(re,Q.sibling),ge=w(Q,se.children||[]),ge.return=re,re=ge;break e}else{m(re,Q);break}else l(re,Q);Q=Q.sibling}ge=i0(se,re.mode,ge),ge.return=re,re=ge}return R(re);case z:return se=Tl(se),Zt(re,Q,se,ge)}if(Z(se))return Ve(re,Q,se,ge);if(Y(se)){if(We=Y(se),typeof We!="function")throw Error(r(150));return se=We.call(se),Xe(re,Q,se,ge)}if(typeof se.then=="function")return Zt(re,Q,Nh(se),ge);if(se.$$typeof===j)return Zt(re,Q,kh(re,se),ge);Th(re,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,Q!==null&&Q.tag===6?(m(re,Q.sibling),ge=w(Q,se),ge.return=re,re=ge):(m(re,Q),ge=r0(se,re.mode,ge),ge.return=re,re=ge),R(re)):m(re,Q)}return function(re,Q,se,ge){try{kf=0;var We=Zt(re,Q,se,ge);return mu=null,We}catch(qe){if(qe===fu||qe===Rh)throw qe;var Ot=vi(29,qe,null,re.mode);return Ot.lanes=ge,Ot.return=re,Ot}finally{}}}var Ol=NI(!0),TI=NI(!1),ds=!1;function g0(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function v0(s,l){s=s.updateQueue,l.updateQueue===s&&(l.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function fs(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function ms(s,l,m){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,(Pt&2)!==0){var w=g.pending;return w===null?l.next=l:(l.next=w.next,w.next=l),g.pending=l,l=Sh(s),pI(s,null,m),l}return wh(s,g,l,m),Sh(s)}function Rf(s,l,m){if(l=l.updateQueue,l!==null&&(l=l.shared,(m&4194048)!==0)){var g=l.lanes;g&=s.pendingLanes,m|=g,l.lanes=m,Gr(s,m)}}function y0(s,l){var m=s.updateQueue,g=s.alternate;if(g!==null&&(g=g.updateQueue,m===g)){var w=null,_=null;if(m=m.firstBaseUpdate,m!==null){do{var R={lane:m.lane,tag:m.tag,payload:m.payload,callback:null,next:null};_===null?w=_=R:_=_.next=R,m=m.next}while(m!==null);_===null?w=_=l:_=_.next=l}else w=_=l;m={baseState:g.baseState,firstBaseUpdate:w,lastBaseUpdate:_,shared:g.shared,callbacks:g.callbacks},s.updateQueue=m;return}s=m.lastBaseUpdate,s===null?m.firstBaseUpdate=l:s.next=l,m.lastBaseUpdate=l}var b0=!1;function If(){if(b0){var s=du;if(s!==null)throw s}}function Nf(s,l,m,g){b0=!1;var w=s.updateQueue;ds=!1;var _=w.firstBaseUpdate,R=w.lastBaseUpdate,$=w.shared.pending;if($!==null){w.shared.pending=null;var H=$,le=H.next;H.next=null,R===null?_=le:R.next=le,R=H;var he=s.alternate;he!==null&&(he=he.updateQueue,$=he.lastBaseUpdate,$!==R&&($===null?he.firstBaseUpdate=le:$.next=le,he.lastBaseUpdate=H))}if(_!==null){var xe=w.baseState;R=0,he=le=H=null,$=_;do{var ce=$.lane&-536870913,me=ce!==$.lane;if(me?(Rt&ce)===ce:(g&ce)===ce){ce!==0&&ce===uu&&(b0=!0),he!==null&&(he=he.next={lane:0,tag:$.tag,payload:$.payload,callback:null,next:null});e:{var Ve=s,Xe=$;ce=l;var Zt=m;switch(Xe.tag){case 1:if(Ve=Xe.payload,typeof Ve=="function"){xe=Ve.call(Zt,xe,ce);break e}xe=Ve;break e;case 3:Ve.flags=Ve.flags&-65537|128;case 0:if(Ve=Xe.payload,ce=typeof Ve=="function"?Ve.call(Zt,xe,ce):Ve,ce==null)break e;xe=h({},xe,ce);break e;case 2:ds=!0}}ce=$.callback,ce!==null&&(s.flags|=64,me&&(s.flags|=8192),me=w.callbacks,me===null?w.callbacks=[ce]:me.push(ce))}else me={lane:ce,tag:$.tag,payload:$.payload,callback:$.callback,next:null},he===null?(le=he=me,H=xe):he=he.next=me,R|=ce;if($=$.next,$===null){if($=w.shared.pending,$===null)break;me=$,$=me.next,me.next=null,w.lastBaseUpdate=me,w.shared.pending=null}}while(!0);he===null&&(H=xe),w.baseState=H,w.firstBaseUpdate=le,w.lastBaseUpdate=he,_===null&&(w.shared.lanes=0),ys|=R,s.lanes=R,s.memoizedState=xe}}function AI(s,l){if(typeof s!="function")throw Error(r(191,s));s.call(l)}function OI(s,l){var m=s.callbacks;if(m!==null)for(s.callbacks=null,s=0;s<m.length;s++)AI(m[s],l)}var pu=P(null),Ah=P(0);function DI(s,l){s=Ta,O(Ah,s),O(pu,l),Ta=s|l.baseLanes}function x0(){O(Ah,Ta),O(pu,pu.current)}function w0(){Ta=Ah.current,V(pu),V(Ah)}var yi=P(null),Zi=null;function ps(s){var l=s.alternate;O(An,An.current&1),O(yi,s),Zi===null&&(l===null||pu.current!==null||l.memoizedState!==null)&&(Zi=s)}function S0(s){O(An,An.current),O(yi,s),Zi===null&&(Zi=s)}function $I(s){s.tag===22?(O(An,An.current),O(yi,s),Zi===null&&(Zi=s)):hs()}function hs(){O(An,An.current),O(yi,yi.current)}function bi(s){V(yi),Zi===s&&(Zi=null),V(An)}var An=P(0);function Oh(s){for(var l=s;l!==null;){if(l.tag===13){var m=l.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||Rw(m)||Iw(m)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var _a=0,dt=null,Gt=null,Hn=null,Dh=!1,hu=!1,Dl=!1,$h=0,Tf=0,gu=null,D7=0;function En(){throw Error(r(321))}function _0(s,l){if(l===null)return!1;for(var m=0;m<l.length&&m<s.length;m++)if(!gi(s[m],l[m]))return!1;return!0}function C0(s,l,m,g,w,_){return _a=_,dt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,M.H=s===null||s.memoizedState===null?yN:L0,Dl=!1,_=m(g,w),Dl=!1,hu&&(_=PI(l,m,g,w)),MI(s),_}function MI(s){M.H=Df;var l=Gt!==null&&Gt.next!==null;if(_a=0,Hn=Gt=dt=null,Dh=!1,Tf=0,gu=null,l)throw Error(r(300));s===null||qn||(s=s.dependencies,s!==null&&Eh(s)&&(qn=!0))}function PI(s,l,m,g){dt=s;var w=0;do{if(hu&&(gu=null),Tf=0,hu=!1,25<=w)throw Error(r(301));if(w+=1,Hn=Gt=null,s.updateQueue!=null){var _=s.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}M.H=bN,_=l(m,g)}while(hu);return _}function $7(){var s=M.H,l=s.useState()[0];return l=typeof l.then=="function"?Af(l):l,s=s.useState()[0],(Gt!==null?Gt.memoizedState:null)!==s&&(dt.flags|=1024),l}function E0(){var s=$h!==0;return $h=0,s}function k0(s,l,m){l.updateQueue=s.updateQueue,l.flags&=-2053,s.lanes&=~m}function j0(s){if(Dh){for(s=s.memoizedState;s!==null;){var l=s.queue;l!==null&&(l.pending=null),s=s.next}Dh=!1}_a=0,Hn=Gt=dt=null,hu=!1,Tf=$h=0,gu=null}function Nr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Hn===null?dt.memoizedState=Hn=s:Hn=Hn.next=s,Hn}function On(){if(Gt===null){var s=dt.alternate;s=s!==null?s.memoizedState:null}else s=Gt.next;var l=Hn===null?dt.memoizedState:Hn.next;if(l!==null)Hn=l,Gt=s;else{if(s===null)throw dt.alternate===null?Error(r(467)):Error(r(310));Gt=s,s={memoizedState:Gt.memoizedState,baseState:Gt.baseState,baseQueue:Gt.baseQueue,queue:Gt.queue,next:null},Hn===null?dt.memoizedState=Hn=s:Hn=Hn.next=s}return Hn}function Mh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Af(s){var l=Tf;return Tf+=1,gu===null&&(gu=[]),s=jI(gu,s,l),l=dt,(Hn===null?l.memoizedState:Hn.next)===null&&(l=l.alternate,M.H=l===null||l.memoizedState===null?yN:L0),s}function Ph(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Af(s);if(s.$$typeof===j)return dr(s)}throw Error(r(438,String(s)))}function R0(s){var l=null,m=dt.updateQueue;if(m!==null&&(l=m.memoCache),l==null){var g=dt.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(l={data:g.data.map(function(w){return w.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),m===null&&(m=Mh(),dt.updateQueue=m),m.memoCache=l,m=l.data[l.index],m===void 0)for(m=l.data[l.index]=Array(s),g=0;g<s;g++)m[g]=G;return l.index++,m}function Ca(s,l){return typeof l=="function"?l(s):l}function zh(s){var l=On();return I0(l,Gt,s)}function I0(s,l,m){var g=s.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=m;var w=s.baseQueue,_=g.pending;if(_!==null){if(w!==null){var R=w.next;w.next=_.next,_.next=R}l.baseQueue=w=_,g.pending=null}if(_=s.baseState,w===null)s.memoizedState=_;else{l=w.next;var $=R=null,H=null,le=l,he=!1;do{var xe=le.lane&-536870913;if(xe!==le.lane?(Rt&xe)===xe:(_a&xe)===xe){var ce=le.revertLane;if(ce===0)H!==null&&(H=H.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),xe===uu&&(he=!0);else if((_a&ce)===ce){le=le.next,ce===uu&&(he=!0);continue}else xe={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},H===null?($=H=xe,R=_):H=H.next=xe,dt.lanes|=ce,ys|=ce;xe=le.action,Dl&&m(_,xe),_=le.hasEagerState?le.eagerState:m(_,xe)}else ce={lane:xe,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},H===null?($=H=ce,R=_):H=H.next=ce,dt.lanes|=xe,ys|=xe;le=le.next}while(le!==null&&le!==l);if(H===null?R=_:H.next=$,!gi(_,s.memoizedState)&&(qn=!0,he&&(m=du,m!==null)))throw m;s.memoizedState=_,s.baseState=R,s.baseQueue=H,g.lastRenderedState=_}return w===null&&(g.lanes=0),[s.memoizedState,g.dispatch]}function N0(s){var l=On(),m=l.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=s;var g=m.dispatch,w=m.pending,_=l.memoizedState;if(w!==null){m.pending=null;var R=w=w.next;do _=s(_,R.action),R=R.next;while(R!==w);gi(_,l.memoizedState)||(qn=!0),l.memoizedState=_,l.baseQueue===null&&(l.baseState=_),m.lastRenderedState=_}return[_,g]}function zI(s,l,m){var g=dt,w=On(),_=Nt;if(_){if(m===void 0)throw Error(r(407));m=m()}else m=l();var R=!gi((Gt||w).memoizedState,m);if(R&&(w.memoizedState=m,qn=!0),w=w.queue,O0(FI.bind(null,g,w,s),[s]),w.getSnapshot!==l||R||Hn!==null&&Hn.memoizedState.tag&1){if(g.flags|=2048,vu(9,{destroy:void 0},UI.bind(null,g,w,m,l),null),Wt===null)throw Error(r(349));_||(_a&127)!==0||LI(g,l,m)}return m}function LI(s,l,m){s.flags|=16384,s={getSnapshot:l,value:m},l=dt.updateQueue,l===null?(l=Mh(),dt.updateQueue=l,l.stores=[s]):(m=l.stores,m===null?l.stores=[s]:m.push(s))}function UI(s,l,m,g){l.value=m,l.getSnapshot=g,VI(l)&&BI(s)}function FI(s,l,m){return m(function(){VI(l)&&BI(s)})}function VI(s){var l=s.getSnapshot;s=s.value;try{var m=l();return!gi(s,m)}catch{return!0}}function BI(s){var l=El(s,2);l!==null&&ei(l,s,2)}function T0(s){var l=Nr();if(typeof s=="function"){var m=s;if(s=m(),Dl){Ct(!0);try{m()}finally{Ct(!1)}}}return l.memoizedState=l.baseState=s,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ca,lastRenderedState:s},l}function HI(s,l,m,g){return s.baseState=m,I0(s,Gt,typeof g=="function"?g:Ca)}function M7(s,l,m,g,w){if(Fh(s))throw Error(r(485));if(s=l.action,s!==null){var _={payload:w,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(R){_.listeners.push(R)}};M.T!==null?m(!0):_.isTransition=!1,g(_),m=l.pending,m===null?(_.next=l.pending=_,qI(l,_)):(_.next=m.next,l.pending=m.next=_)}}function qI(s,l){var m=l.action,g=l.payload,w=s.state;if(l.isTransition){var _=M.T,R={};M.T=R;try{var $=m(w,g),H=M.S;H!==null&&H(R,$),GI(s,l,$)}catch(le){A0(s,l,le)}finally{_!==null&&R.types!==null&&(_.types=R.types),M.T=_}}else try{_=m(w,g),GI(s,l,_)}catch(le){A0(s,l,le)}}function GI(s,l,m){m!==null&&typeof m=="object"&&typeof m.then=="function"?m.then(function(g){KI(s,l,g)},function(g){return A0(s,l,g)}):KI(s,l,m)}function KI(s,l,m){l.status="fulfilled",l.value=m,ZI(l),s.state=m,l=s.pending,l!==null&&(m=l.next,m===l?s.pending=null:(m=m.next,l.next=m,qI(s,m)))}function A0(s,l,m){var g=s.pending;if(s.pending=null,g!==null){g=g.next;do l.status="rejected",l.reason=m,ZI(l),l=l.next;while(l!==g)}s.action=null}function ZI(s){s=s.listeners;for(var l=0;l<s.length;l++)(0,s[l])()}function YI(s,l){return l}function WI(s,l){if(Nt){var m=Wt.formState;if(m!==null){e:{var g=dt;if(Nt){if(cn){t:{for(var w=cn,_=Ki;w.nodeType!==8;){if(!_){w=null;break t}if(w=Yi(w.nextSibling),w===null){w=null;break t}}_=w.data,w=_==="F!"||_==="F"?w:null}if(w){cn=Yi(w.nextSibling),g=w.data==="F!";break e}}cs(g)}g=!1}g&&(l=m[0])}}return m=Nr(),m.memoizedState=m.baseState=l,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:YI,lastRenderedState:l},m.queue=g,m=hN.bind(null,dt,g),g.dispatch=m,g=T0(!1),_=z0.bind(null,dt,!1,g.queue),g=Nr(),w={state:l,dispatch:null,action:s,pending:null},g.queue=w,m=M7.bind(null,dt,w,_,m),w.dispatch=m,g.memoizedState=s,[l,m,!1]}function XI(s){var l=On();return QI(l,Gt,s)}function QI(s,l,m){if(l=I0(s,l,YI)[0],s=zh(Ca)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var g=Af(l)}catch(R){throw R===fu?Rh:R}else g=l;l=On();var w=l.queue,_=w.dispatch;return m!==l.memoizedState&&(dt.flags|=2048,vu(9,{destroy:void 0},P7.bind(null,w,m),null)),[g,_,s]}function P7(s,l){s.action=l}function JI(s){var l=On(),m=Gt;if(m!==null)return QI(l,m,s);On(),l=l.memoizedState,m=On();var g=m.queue.dispatch;return m.memoizedState=s,[l,g,!1]}function vu(s,l,m,g){return s={tag:s,create:m,deps:g,inst:l,next:null},l=dt.updateQueue,l===null&&(l=Mh(),dt.updateQueue=l),m=l.lastEffect,m===null?l.lastEffect=s.next=s:(g=m.next,m.next=s,s.next=g,l.lastEffect=s),s}function eN(){return On().memoizedState}function Lh(s,l,m,g){var w=Nr();dt.flags|=s,w.memoizedState=vu(1|l,{destroy:void 0},m,g===void 0?null:g)}function Uh(s,l,m,g){var w=On();g=g===void 0?null:g;var _=w.memoizedState.inst;Gt!==null&&g!==null&&_0(g,Gt.memoizedState.deps)?w.memoizedState=vu(l,_,m,g):(dt.flags|=s,w.memoizedState=vu(1|l,_,m,g))}function tN(s,l){Lh(8390656,8,s,l)}function O0(s,l){Uh(2048,8,s,l)}function z7(s){dt.flags|=4;var l=dt.updateQueue;if(l===null)l=Mh(),dt.updateQueue=l,l.events=[s];else{var m=l.events;m===null?l.events=[s]:m.push(s)}}function nN(s){var l=On().memoizedState;return z7({ref:l,nextImpl:s}),function(){if((Pt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function rN(s,l){return Uh(4,2,s,l)}function iN(s,l){return Uh(4,4,s,l)}function oN(s,l){if(typeof l=="function"){s=s();var m=l(s);return function(){typeof m=="function"?m():l(null)}}if(l!=null)return s=s(),l.current=s,function(){l.current=null}}function aN(s,l,m){m=m!=null?m.concat([s]):null,Uh(4,4,oN.bind(null,l,s),m)}function D0(){}function sN(s,l){var m=On();l=l===void 0?null:l;var g=m.memoizedState;return l!==null&&_0(l,g[1])?g[0]:(m.memoizedState=[s,l],s)}function lN(s,l){var m=On();l=l===void 0?null:l;var g=m.memoizedState;if(l!==null&&_0(l,g[1]))return g[0];if(g=s(),Dl){Ct(!0);try{s()}finally{Ct(!1)}}return m.memoizedState=[g,l],g}function $0(s,l,m){return m===void 0||(_a&1073741824)!==0&&(Rt&261930)===0?s.memoizedState=l:(s.memoizedState=m,s=cT(),dt.lanes|=s,ys|=s,m)}function cN(s,l,m,g){return gi(m,l)?m:pu.current!==null?(s=$0(s,m,g),gi(s,l)||(qn=!0),s):(_a&42)===0||(_a&1073741824)!==0&&(Rt&261930)===0?(qn=!0,s.memoizedState=m):(s=cT(),dt.lanes|=s,ys|=s,l)}function uN(s,l,m,g,w){var _=K.p;K.p=_!==0&&8>_?_:8;var R=M.T,$={};M.T=$,z0(s,!1,l,m);try{var H=w(),le=M.S;if(le!==null&&le($,H),H!==null&&typeof H=="object"&&typeof H.then=="function"){var he=O7(H,g);Of(s,l,he,Si(s))}else Of(s,l,g,Si(s))}catch(xe){Of(s,l,{then:function(){},status:"rejected",reason:xe},Si())}finally{K.p=_,R!==null&&$.types!==null&&(R.types=$.types),M.T=R}}function L7(){}function M0(s,l,m,g){if(s.tag!==5)throw Error(r(476));var w=dN(s).queue;uN(s,w,l,U,m===null?L7:function(){return fN(s),m(g)})}function dN(s){var l=s.memoizedState;if(l!==null)return l;l={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ca,lastRenderedState:U},next:null};var m={};return l.next={memoizedState:m,baseState:m,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ca,lastRenderedState:m},next:null},s.memoizedState=l,s=s.alternate,s!==null&&(s.memoizedState=l),l}function fN(s){var l=dN(s);l.next===null&&(l=s.alternate.memoizedState),Of(s,l.next.queue,{},Si())}function P0(){return dr(Wf)}function mN(){return On().memoizedState}function pN(){return On().memoizedState}function U7(s){for(var l=s.return;l!==null;){switch(l.tag){case 24:case 3:var m=Si();s=fs(m);var g=ms(l,s,m);g!==null&&(ei(g,l,m),Rf(g,l,m)),l={cache:f0()},s.payload=l;return}l=l.return}}function F7(s,l,m){var g=Si();m={lane:g,revertLane:0,gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Fh(s)?gN(l,m):(m=t0(s,l,m,g),m!==null&&(ei(m,s,g),vN(m,l,g)))}function hN(s,l,m){var g=Si();Of(s,l,m,g)}function Of(s,l,m,g){var w={lane:g,revertLane:0,gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null};if(Fh(s))gN(l,w);else{var _=s.alternate;if(s.lanes===0&&(_===null||_.lanes===0)&&(_=l.lastRenderedReducer,_!==null))try{var R=l.lastRenderedState,$=_(R,m);if(w.hasEagerState=!0,w.eagerState=$,gi($,R))return wh(s,l,w,0),Wt===null&&xh(),!1}catch{}finally{}if(m=t0(s,l,w,g),m!==null)return ei(m,s,g),vN(m,l,g),!0}return!1}function z0(s,l,m,g){if(g={lane:2,revertLane:gw(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Fh(s)){if(l)throw Error(r(479))}else l=t0(s,m,g,2),l!==null&&ei(l,s,2)}function Fh(s){var l=s.alternate;return s===dt||l!==null&&l===dt}function gN(s,l){hu=Dh=!0;var m=s.pending;m===null?l.next=l:(l.next=m.next,m.next=l),s.pending=l}function vN(s,l,m){if((m&4194048)!==0){var g=l.lanes;g&=s.pendingLanes,m|=g,l.lanes=m,Gr(s,m)}}var Df={readContext:dr,use:Ph,useCallback:En,useContext:En,useEffect:En,useImperativeHandle:En,useLayoutEffect:En,useInsertionEffect:En,useMemo:En,useReducer:En,useRef:En,useState:En,useDebugValue:En,useDeferredValue:En,useTransition:En,useSyncExternalStore:En,useId:En,useHostTransitionStatus:En,useFormState:En,useActionState:En,useOptimistic:En,useMemoCache:En,useCacheRefresh:En};Df.useEffectEvent=En;var yN={readContext:dr,use:Ph,useCallback:function(s,l){return Nr().memoizedState=[s,l===void 0?null:l],s},useContext:dr,useEffect:tN,useImperativeHandle:function(s,l,m){m=m!=null?m.concat([s]):null,Lh(4194308,4,oN.bind(null,l,s),m)},useLayoutEffect:function(s,l){return Lh(4194308,4,s,l)},useInsertionEffect:function(s,l){Lh(4,2,s,l)},useMemo:function(s,l){var m=Nr();l=l===void 0?null:l;var g=s();if(Dl){Ct(!0);try{s()}finally{Ct(!1)}}return m.memoizedState=[g,l],g},useReducer:function(s,l,m){var g=Nr();if(m!==void 0){var w=m(l);if(Dl){Ct(!0);try{m(l)}finally{Ct(!1)}}}else w=l;return g.memoizedState=g.baseState=w,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:w},g.queue=s,s=s.dispatch=F7.bind(null,dt,s),[g.memoizedState,s]},useRef:function(s){var l=Nr();return s={current:s},l.memoizedState=s},useState:function(s){s=T0(s);var l=s.queue,m=hN.bind(null,dt,l);return l.dispatch=m,[s.memoizedState,m]},useDebugValue:D0,useDeferredValue:function(s,l){var m=Nr();return $0(m,s,l)},useTransition:function(){var s=T0(!1);return s=uN.bind(null,dt,s.queue,!0,!1),Nr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,l,m){var g=dt,w=Nr();if(Nt){if(m===void 0)throw Error(r(407));m=m()}else{if(m=l(),Wt===null)throw Error(r(349));(Rt&127)!==0||LI(g,l,m)}w.memoizedState=m;var _={value:m,getSnapshot:l};return w.queue=_,tN(FI.bind(null,g,_,s),[s]),g.flags|=2048,vu(9,{destroy:void 0},UI.bind(null,g,_,m,l),null),m},useId:function(){var s=Nr(),l=Wt.identifierPrefix;if(Nt){var m=qo,g=Ho;m=(g&~(1<<32-yt(g)-1)).toString(32)+m,l="_"+l+"R_"+m,m=$h++,0<m&&(l+="H"+m.toString(32)),l+="_"}else m=D7++,l="_"+l+"r_"+m.toString(32)+"_";return s.memoizedState=l},useHostTransitionStatus:P0,useFormState:WI,useActionState:WI,useOptimistic:function(s){var l=Nr();l.memoizedState=l.baseState=s;var m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=m,l=z0.bind(null,dt,!0,m),m.dispatch=l,[s,l]},useMemoCache:R0,useCacheRefresh:function(){return Nr().memoizedState=U7.bind(null,dt)},useEffectEvent:function(s){var l=Nr(),m={impl:s};return l.memoizedState=m,function(){if((Pt&2)!==0)throw Error(r(440));return m.impl.apply(void 0,arguments)}}},L0={readContext:dr,use:Ph,useCallback:sN,useContext:dr,useEffect:O0,useImperativeHandle:aN,useInsertionEffect:rN,useLayoutEffect:iN,useMemo:lN,useReducer:zh,useRef:eN,useState:function(){return zh(Ca)},useDebugValue:D0,useDeferredValue:function(s,l){var m=On();return cN(m,Gt.memoizedState,s,l)},useTransition:function(){var s=zh(Ca)[0],l=On().memoizedState;return[typeof s=="boolean"?s:Af(s),l]},useSyncExternalStore:zI,useId:mN,useHostTransitionStatus:P0,useFormState:XI,useActionState:XI,useOptimistic:function(s,l){var m=On();return HI(m,Gt,s,l)},useMemoCache:R0,useCacheRefresh:pN};L0.useEffectEvent=nN;var bN={readContext:dr,use:Ph,useCallback:sN,useContext:dr,useEffect:O0,useImperativeHandle:aN,useInsertionEffect:rN,useLayoutEffect:iN,useMemo:lN,useReducer:N0,useRef:eN,useState:function(){return N0(Ca)},useDebugValue:D0,useDeferredValue:function(s,l){var m=On();return Gt===null?$0(m,s,l):cN(m,Gt.memoizedState,s,l)},useTransition:function(){var s=N0(Ca)[0],l=On().memoizedState;return[typeof s=="boolean"?s:Af(s),l]},useSyncExternalStore:zI,useId:mN,useHostTransitionStatus:P0,useFormState:JI,useActionState:JI,useOptimistic:function(s,l){var m=On();return Gt!==null?HI(m,Gt,s,l):(m.baseState=s,[s,m.queue.dispatch])},useMemoCache:R0,useCacheRefresh:pN};bN.useEffectEvent=nN;function U0(s,l,m,g){l=s.memoizedState,m=m(g,l),m=m==null?l:h({},l,m),s.memoizedState=m,s.lanes===0&&(s.updateQueue.baseState=m)}var F0={enqueueSetState:function(s,l,m){s=s._reactInternals;var g=Si(),w=fs(g);w.payload=l,m!=null&&(w.callback=m),l=ms(s,w,g),l!==null&&(ei(l,s,g),Rf(l,s,g))},enqueueReplaceState:function(s,l,m){s=s._reactInternals;var g=Si(),w=fs(g);w.tag=1,w.payload=l,m!=null&&(w.callback=m),l=ms(s,w,g),l!==null&&(ei(l,s,g),Rf(l,s,g))},enqueueForceUpdate:function(s,l){s=s._reactInternals;var m=Si(),g=fs(m);g.tag=2,l!=null&&(g.callback=l),l=ms(s,g,m),l!==null&&(ei(l,s,m),Rf(l,s,m))}};function xN(s,l,m,g,w,_,R){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,_,R):l.prototype&&l.prototype.isPureReactComponent?!xf(m,g)||!xf(w,_):!0}function wN(s,l,m,g){s=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(m,g),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(m,g),l.state!==s&&F0.enqueueReplaceState(l,l.state,null)}function $l(s,l){var m=l;if("ref"in l){m={};for(var g in l)g!=="ref"&&(m[g]=l[g])}if(s=s.defaultProps){m===l&&(m=h({},m));for(var w in s)m[w]===void 0&&(m[w]=s[w])}return m}function SN(s){bh(s)}function _N(s){console.error(s)}function CN(s){bh(s)}function Vh(s,l){try{var m=s.onUncaughtError;m(l.value,{componentStack:l.stack})}catch(g){setTimeout(function(){throw g})}}function EN(s,l,m){try{var g=s.onCaughtError;g(m.value,{componentStack:m.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(w){setTimeout(function(){throw w})}}function V0(s,l,m){return m=fs(m),m.tag=3,m.payload={element:null},m.callback=function(){Vh(s,l)},m}function kN(s){return s=fs(s),s.tag=3,s}function jN(s,l,m,g){var w=m.type.getDerivedStateFromError;if(typeof w=="function"){var _=g.value;s.payload=function(){return w(_)},s.callback=function(){EN(l,m,g)}}var R=m.stateNode;R!==null&&typeof R.componentDidCatch=="function"&&(s.callback=function(){EN(l,m,g),typeof w!="function"&&(bs===null?bs=new Set([this]):bs.add(this));var $=g.stack;this.componentDidCatch(g.value,{componentStack:$!==null?$:""})})}function V7(s,l,m,g,w){if(m.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(l=m.alternate,l!==null&&cu(l,m,w,!0),m=yi.current,m!==null){switch(m.tag){case 31:case 13:return Zi===null?eg():m.alternate===null&&kn===0&&(kn=3),m.flags&=-257,m.flags|=65536,m.lanes=w,g===Ih?m.flags|=16384:(l=m.updateQueue,l===null?m.updateQueue=new Set([g]):l.add(g),mw(s,g,w)),!1;case 22:return m.flags|=65536,g===Ih?m.flags|=16384:(l=m.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([g])},m.updateQueue=l):(m=l.retryQueue,m===null?l.retryQueue=new Set([g]):m.add(g)),mw(s,g,w)),!1}throw Error(r(435,m.tag))}return mw(s,g,w),eg(),!1}if(Nt)return l=yi.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=w,g!==s0&&(s=Error(r(422),{cause:g}),_f(Hi(s,m)))):(g!==s0&&(l=Error(r(423),{cause:g}),_f(Hi(l,m))),s=s.current.alternate,s.flags|=65536,w&=-w,s.lanes|=w,g=Hi(g,m),w=V0(s.stateNode,g,w),y0(s,w),kn!==4&&(kn=2)),!1;var _=Error(r(520),{cause:g});if(_=Hi(_,m),Vf===null?Vf=[_]:Vf.push(_),kn!==4&&(kn=2),l===null)return!0;g=Hi(g,m),m=l;do{switch(m.tag){case 3:return m.flags|=65536,s=w&-w,m.lanes|=s,s=V0(m.stateNode,g,s),y0(m,s),!1;case 1:if(l=m.type,_=m.stateNode,(m.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(bs===null||!bs.has(_))))return m.flags|=65536,w&=-w,m.lanes|=w,w=kN(w),jN(w,s,m,g),y0(m,w),!1}m=m.return}while(m!==null);return!1}var B0=Error(r(461)),qn=!1;function fr(s,l,m,g){l.child=s===null?TI(l,null,m,g):Ol(l,s.child,m,g)}function RN(s,l,m,g,w){m=m.render;var _=l.ref;if("ref"in g){var R={};for(var $ in g)$!=="ref"&&(R[$]=g[$])}else R=g;return Il(l),g=C0(s,l,m,R,_,w),$=E0(),s!==null&&!qn?(k0(s,l,w),Ea(s,l,w)):(Nt&&$&&o0(l),l.flags|=1,fr(s,l,g,w),l.child)}function IN(s,l,m,g,w){if(s===null){var _=m.type;return typeof _=="function"&&!n0(_)&&_.defaultProps===void 0&&m.compare===null?(l.tag=15,l.type=_,NN(s,l,_,g,w)):(s=_h(m.type,null,g,l,l.mode,w),s.ref=l.ref,s.return=l,l.child=s)}if(_=s.child,!X0(s,w)){var R=_.memoizedProps;if(m=m.compare,m=m!==null?m:xf,m(R,g)&&s.ref===l.ref)return Ea(s,l,w)}return l.flags|=1,s=ba(_,g),s.ref=l.ref,s.return=l,l.child=s}function NN(s,l,m,g,w){if(s!==null){var _=s.memoizedProps;if(xf(_,g)&&s.ref===l.ref)if(qn=!1,l.pendingProps=g=_,X0(s,w))(s.flags&131072)!==0&&(qn=!0);else return l.lanes=s.lanes,Ea(s,l,w)}return H0(s,l,m,g,w)}function TN(s,l,m,g){var w=g.children,_=s!==null?s.memoizedState:null;if(s===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((l.flags&128)!==0){if(_=_!==null?_.baseLanes|m:m,s!==null){for(g=l.child=s.child,w=0;g!==null;)w=w|g.lanes|g.childLanes,g=g.sibling;g=w&~_}else g=0,l.child=null;return AN(s,l,_,m,g)}if((m&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},s!==null&&jh(l,_!==null?_.cachePool:null),_!==null?DI(l,_):x0(),$I(l);else return g=l.lanes=536870912,AN(s,l,_!==null?_.baseLanes|m:m,m,g)}else _!==null?(jh(l,_.cachePool),DI(l,_),hs(),l.memoizedState=null):(s!==null&&jh(l,null),x0(),hs());return fr(s,l,w,m),l.child}function $f(s,l){return s!==null&&s.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function AN(s,l,m,g,w){var _=p0();return _=_===null?null:{parent:Bn._currentValue,pool:_},l.memoizedState={baseLanes:m,cachePool:_},s!==null&&jh(l,null),x0(),$I(l),s!==null&&cu(s,l,g,!0),l.childLanes=w,null}function Bh(s,l){return l=qh({mode:l.mode,children:l.children},s.mode),l.ref=s.ref,s.child=l,l.return=s,l}function ON(s,l,m){return Ol(l,s.child,null,m),s=Bh(l,l.pendingProps),s.flags|=2,bi(l),l.memoizedState=null,s}function B7(s,l,m){var g=l.pendingProps,w=(l.flags&128)!==0;if(l.flags&=-129,s===null){if(Nt){if(g.mode==="hidden")return s=Bh(l,g),l.lanes=536870912,$f(null,s);if(S0(l),(s=cn)?(s=qT(s,Ki),s=s!==null&&s.data==="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:ss!==null?{id:Ho,overflow:qo}:null,retryLane:536870912,hydrationErrors:null},m=gI(s),m.return=l,l.child=m,ur=l,cn=null)):s=null,s===null)throw cs(l);return l.lanes=536870912,null}return Bh(l,g)}var _=s.memoizedState;if(_!==null){var R=_.dehydrated;if(S0(l),w)if(l.flags&256)l.flags&=-257,l=ON(s,l,m);else if(l.memoizedState!==null)l.child=s.child,l.flags|=128,l=null;else throw Error(r(558));else if(qn||cu(s,l,m,!1),w=(m&s.childLanes)!==0,qn||w){if(g=Wt,g!==null&&(R=Kr(g,m),R!==0&&R!==_.retryLane))throw _.retryLane=R,El(s,R),ei(g,s,R),B0;eg(),l=ON(s,l,m)}else s=_.treeContext,cn=Yi(R.nextSibling),ur=l,Nt=!0,ls=null,Ki=!1,s!==null&&bI(l,s),l=Bh(l,g),l.flags|=4096;return l}return s=ba(s.child,{mode:g.mode,children:g.children}),s.ref=l.ref,l.child=s,s.return=l,s}function Hh(s,l){var m=l.ref;if(m===null)s!==null&&s.ref!==null&&(l.flags|=4194816);else{if(typeof m!="function"&&typeof m!="object")throw Error(r(284));(s===null||s.ref!==m)&&(l.flags|=4194816)}}function H0(s,l,m,g,w){return Il(l),m=C0(s,l,m,g,void 0,w),g=E0(),s!==null&&!qn?(k0(s,l,w),Ea(s,l,w)):(Nt&&g&&o0(l),l.flags|=1,fr(s,l,m,w),l.child)}function DN(s,l,m,g,w,_){return Il(l),l.updateQueue=null,m=PI(l,g,m,w),MI(s),g=E0(),s!==null&&!qn?(k0(s,l,_),Ea(s,l,_)):(Nt&&g&&o0(l),l.flags|=1,fr(s,l,m,_),l.child)}function $N(s,l,m,g,w){if(Il(l),l.stateNode===null){var _=ou,R=m.contextType;typeof R=="object"&&R!==null&&(_=dr(R)),_=new m(g,_),l.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=F0,l.stateNode=_,_._reactInternals=l,_=l.stateNode,_.props=g,_.state=l.memoizedState,_.refs={},g0(l),R=m.contextType,_.context=typeof R=="object"&&R!==null?dr(R):ou,_.state=l.memoizedState,R=m.getDerivedStateFromProps,typeof R=="function"&&(U0(l,m,R,g),_.state=l.memoizedState),typeof m.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(R=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),R!==_.state&&F0.enqueueReplaceState(_,_.state,null),Nf(l,g,_,w),If(),_.state=l.memoizedState),typeof _.componentDidMount=="function"&&(l.flags|=4194308),g=!0}else if(s===null){_=l.stateNode;var $=l.memoizedProps,H=$l(m,$);_.props=H;var le=_.context,he=m.contextType;R=ou,typeof he=="object"&&he!==null&&(R=dr(he));var xe=m.getDerivedStateFromProps;he=typeof xe=="function"||typeof _.getSnapshotBeforeUpdate=="function",$=l.pendingProps!==$,he||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||($||le!==R)&&wN(l,_,g,R),ds=!1;var ce=l.memoizedState;_.state=ce,Nf(l,g,_,w),If(),le=l.memoizedState,$||ce!==le||ds?(typeof xe=="function"&&(U0(l,m,xe,g),le=l.memoizedState),(H=ds||xN(l,m,H,g,ce,le,R))?(he||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(l.flags|=4194308)):(typeof _.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=g,l.memoizedState=le),_.props=g,_.state=le,_.context=R,g=H):(typeof _.componentDidMount=="function"&&(l.flags|=4194308),g=!1)}else{_=l.stateNode,v0(s,l),R=l.memoizedProps,he=$l(m,R),_.props=he,xe=l.pendingProps,ce=_.context,le=m.contextType,H=ou,typeof le=="object"&&le!==null&&(H=dr(le)),$=m.getDerivedStateFromProps,(le=typeof $=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(R!==xe||ce!==H)&&wN(l,_,g,H),ds=!1,ce=l.memoizedState,_.state=ce,Nf(l,g,_,w),If();var me=l.memoizedState;R!==xe||ce!==me||ds||s!==null&&s.dependencies!==null&&Eh(s.dependencies)?(typeof $=="function"&&(U0(l,m,$,g),me=l.memoizedState),(he=ds||xN(l,m,he,g,ce,me,H)||s!==null&&s.dependencies!==null&&Eh(s.dependencies))?(le||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(g,me,H),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(g,me,H)),typeof _.componentDidUpdate=="function"&&(l.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof _.componentDidUpdate!="function"||R===s.memoizedProps&&ce===s.memoizedState||(l.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||R===s.memoizedProps&&ce===s.memoizedState||(l.flags|=1024),l.memoizedProps=g,l.memoizedState=me),_.props=g,_.state=me,_.context=H,g=he):(typeof _.componentDidUpdate!="function"||R===s.memoizedProps&&ce===s.memoizedState||(l.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||R===s.memoizedProps&&ce===s.memoizedState||(l.flags|=1024),g=!1)}return _=g,Hh(s,l),g=(l.flags&128)!==0,_||g?(_=l.stateNode,m=g&&typeof m.getDerivedStateFromError!="function"?null:_.render(),l.flags|=1,s!==null&&g?(l.child=Ol(l,s.child,null,w),l.child=Ol(l,null,m,w)):fr(s,l,m,w),l.memoizedState=_.state,s=l.child):s=Ea(s,l,w),s}function MN(s,l,m,g){return jl(),l.flags|=256,fr(s,l,m,g),l.child}var q0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function G0(s){return{baseLanes:s,cachePool:EI()}}function K0(s,l,m){return s=s!==null?s.childLanes&~m:0,l&&(s|=wi),s}function PN(s,l,m){var g=l.pendingProps,w=!1,_=(l.flags&128)!==0,R;if((R=_)||(R=s!==null&&s.memoizedState===null?!1:(An.current&2)!==0),R&&(w=!0,l.flags&=-129),R=(l.flags&32)!==0,l.flags&=-33,s===null){if(Nt){if(w?ps(l):hs(),(s=cn)?(s=qT(s,Ki),s=s!==null&&s.data!=="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:ss!==null?{id:Ho,overflow:qo}:null,retryLane:536870912,hydrationErrors:null},m=gI(s),m.return=l,l.child=m,ur=l,cn=null)):s=null,s===null)throw cs(l);return Iw(s)?l.lanes=32:l.lanes=536870912,null}var $=g.children;return g=g.fallback,w?(hs(),w=l.mode,$=qh({mode:"hidden",children:$},w),g=kl(g,w,m,null),$.return=l,g.return=l,$.sibling=g,l.child=$,g=l.child,g.memoizedState=G0(m),g.childLanes=K0(s,R,m),l.memoizedState=q0,$f(null,g)):(ps(l),Z0(l,$))}var H=s.memoizedState;if(H!==null&&($=H.dehydrated,$!==null)){if(_)l.flags&256?(ps(l),l.flags&=-257,l=Y0(s,l,m)):l.memoizedState!==null?(hs(),l.child=s.child,l.flags|=128,l=null):(hs(),$=g.fallback,w=l.mode,g=qh({mode:"visible",children:g.children},w),$=kl($,w,m,null),$.flags|=2,g.return=l,$.return=l,g.sibling=$,l.child=g,Ol(l,s.child,null,m),g=l.child,g.memoizedState=G0(m),g.childLanes=K0(s,R,m),l.memoizedState=q0,l=$f(null,g));else if(ps(l),Iw($)){if(R=$.nextSibling&&$.nextSibling.dataset,R)var le=R.dgst;R=le,g=Error(r(419)),g.stack="",g.digest=R,_f({value:g,source:null,stack:null}),l=Y0(s,l,m)}else if(qn||cu(s,l,m,!1),R=(m&s.childLanes)!==0,qn||R){if(R=Wt,R!==null&&(g=Kr(R,m),g!==0&&g!==H.retryLane))throw H.retryLane=g,El(s,g),ei(R,s,g),B0;Rw($)||eg(),l=Y0(s,l,m)}else Rw($)?(l.flags|=192,l.child=s.child,l=null):(s=H.treeContext,cn=Yi($.nextSibling),ur=l,Nt=!0,ls=null,Ki=!1,s!==null&&bI(l,s),l=Z0(l,g.children),l.flags|=4096);return l}return w?(hs(),$=g.fallback,w=l.mode,H=s.child,le=H.sibling,g=ba(H,{mode:"hidden",children:g.children}),g.subtreeFlags=H.subtreeFlags&65011712,le!==null?$=ba(le,$):($=kl($,w,m,null),$.flags|=2),$.return=l,g.return=l,g.sibling=$,l.child=g,$f(null,g),g=l.child,$=s.child.memoizedState,$===null?$=G0(m):(w=$.cachePool,w!==null?(H=Bn._currentValue,w=w.parent!==H?{parent:H,pool:H}:w):w=EI(),$={baseLanes:$.baseLanes|m,cachePool:w}),g.memoizedState=$,g.childLanes=K0(s,R,m),l.memoizedState=q0,$f(s.child,g)):(ps(l),m=s.child,s=m.sibling,m=ba(m,{mode:"visible",children:g.children}),m.return=l,m.sibling=null,s!==null&&(R=l.deletions,R===null?(l.deletions=[s],l.flags|=16):R.push(s)),l.child=m,l.memoizedState=null,m)}function Z0(s,l){return l=qh({mode:"visible",children:l},s.mode),l.return=s,s.child=l}function qh(s,l){return s=vi(22,s,null,l),s.lanes=0,s}function Y0(s,l,m){return Ol(l,s.child,null,m),s=Z0(l,l.pendingProps.children),s.flags|=2,l.memoizedState=null,s}function zN(s,l,m){s.lanes|=l;var g=s.alternate;g!==null&&(g.lanes|=l),u0(s.return,l,m)}function W0(s,l,m,g,w,_){var R=s.memoizedState;R===null?s.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:g,tail:m,tailMode:w,treeForkCount:_}:(R.isBackwards=l,R.rendering=null,R.renderingStartTime=0,R.last=g,R.tail=m,R.tailMode=w,R.treeForkCount=_)}function LN(s,l,m){var g=l.pendingProps,w=g.revealOrder,_=g.tail;g=g.children;var R=An.current,$=(R&2)!==0;if($?(R=R&1|2,l.flags|=128):R&=1,O(An,R),fr(s,l,g,m),g=Nt?Sf:0,!$&&s!==null&&(s.flags&128)!==0)e:for(s=l.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&zN(s,m,l);else if(s.tag===19)zN(s,m,l);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===l)break e;for(;s.sibling===null;){if(s.return===null||s.return===l)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(w){case"forwards":for(m=l.child,w=null;m!==null;)s=m.alternate,s!==null&&Oh(s)===null&&(w=m),m=m.sibling;m=w,m===null?(w=l.child,l.child=null):(w=m.sibling,m.sibling=null),W0(l,!1,w,m,_,g);break;case"backwards":case"unstable_legacy-backwards":for(m=null,w=l.child,l.child=null;w!==null;){if(s=w.alternate,s!==null&&Oh(s)===null){l.child=w;break}s=w.sibling,w.sibling=m,m=w,w=s}W0(l,!0,m,null,_,g);break;case"together":W0(l,!1,null,null,void 0,g);break;default:l.memoizedState=null}return l.child}function Ea(s,l,m){if(s!==null&&(l.dependencies=s.dependencies),ys|=l.lanes,(m&l.childLanes)===0)if(s!==null){if(cu(s,l,m,!1),(m&l.childLanes)===0)return null}else return null;if(s!==null&&l.child!==s.child)throw Error(r(153));if(l.child!==null){for(s=l.child,m=ba(s,s.pendingProps),l.child=m,m.return=l;s.sibling!==null;)s=s.sibling,m=m.sibling=ba(s,s.pendingProps),m.return=l;m.sibling=null}return l.child}function X0(s,l){return(s.lanes&l)!==0?!0:(s=s.dependencies,!!(s!==null&&Eh(s)))}function H7(s,l,m){switch(l.tag){case 3:ie(l,l.stateNode.containerInfo),us(l,Bn,s.memoizedState.cache),jl();break;case 27:case 5:Ie(l);break;case 4:ie(l,l.stateNode.containerInfo);break;case 10:us(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,S0(l),null;break;case 13:var g=l.memoizedState;if(g!==null)return g.dehydrated!==null?(ps(l),l.flags|=128,null):(m&l.child.childLanes)!==0?PN(s,l,m):(ps(l),s=Ea(s,l,m),s!==null?s.sibling:null);ps(l);break;case 19:var w=(s.flags&128)!==0;if(g=(m&l.childLanes)!==0,g||(cu(s,l,m,!1),g=(m&l.childLanes)!==0),w){if(g)return LN(s,l,m);l.flags|=128}if(w=l.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),O(An,An.current),g)break;return null;case 22:return l.lanes=0,TN(s,l,m,l.pendingProps);case 24:us(l,Bn,s.memoizedState.cache)}return Ea(s,l,m)}function UN(s,l,m){if(s!==null)if(s.memoizedProps!==l.pendingProps)qn=!0;else{if(!X0(s,m)&&(l.flags&128)===0)return qn=!1,H7(s,l,m);qn=(s.flags&131072)!==0}else qn=!1,Nt&&(l.flags&1048576)!==0&&yI(l,Sf,l.index);switch(l.lanes=0,l.tag){case 16:e:{var g=l.pendingProps;if(s=Tl(l.elementType),l.type=s,typeof s=="function")n0(s)?(g=$l(s,g),l.tag=1,l=$N(null,l,s,g,m)):(l.tag=0,l=H0(null,l,s,g,m));else{if(s!=null){var w=s.$$typeof;if(w===I){l.tag=11,l=RN(null,l,s,g,m);break e}else if(w===T){l.tag=14,l=IN(null,l,s,g,m);break e}}throw l=F(s)||s,Error(r(306,l,""))}}return l;case 0:return H0(s,l,l.type,l.pendingProps,m);case 1:return g=l.type,w=$l(g,l.pendingProps),$N(s,l,g,w,m);case 3:e:{if(ie(l,l.stateNode.containerInfo),s===null)throw Error(r(387));g=l.pendingProps;var _=l.memoizedState;w=_.element,v0(s,l),Nf(l,g,null,m);var R=l.memoizedState;if(g=R.cache,us(l,Bn,g),g!==_.cache&&d0(l,[Bn],m,!0),If(),g=R.element,_.isDehydrated)if(_={element:g,isDehydrated:!1,cache:R.cache},l.updateQueue.baseState=_,l.memoizedState=_,l.flags&256){l=MN(s,l,g,m);break e}else if(g!==w){w=Hi(Error(r(424)),l),_f(w),l=MN(s,l,g,m);break e}else{switch(s=l.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(cn=Yi(s.firstChild),ur=l,Nt=!0,ls=null,Ki=!0,m=TI(l,null,g,m),l.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling}else{if(jl(),g===w){l=Ea(s,l,m);break e}fr(s,l,g,m)}l=l.child}return l;case 26:return Hh(s,l),s===null?(m=XT(l.type,null,l.pendingProps,null))?l.memoizedState=m:Nt||(m=l.type,s=l.pendingProps,g=sg(pe.current).createElement(m),g[cr]=l,g[Zr]=s,mr(g,m,s),or(g),l.stateNode=g):l.memoizedState=XT(l.type,s.memoizedProps,l.pendingProps,s.memoizedState),null;case 27:return Ie(l),s===null&&Nt&&(g=l.stateNode=ZT(l.type,l.pendingProps,pe.current),ur=l,Ki=!0,w=cn,_s(l.type)?(Nw=w,cn=Yi(g.firstChild)):cn=w),fr(s,l,l.pendingProps.children,m),Hh(s,l),s===null&&(l.flags|=4194304),l.child;case 5:return s===null&&Nt&&((w=g=cn)&&(g=xq(g,l.type,l.pendingProps,Ki),g!==null?(l.stateNode=g,ur=l,cn=Yi(g.firstChild),Ki=!1,w=!0):w=!1),w||cs(l)),Ie(l),w=l.type,_=l.pendingProps,R=s!==null?s.memoizedProps:null,g=_.children,Ew(w,_)?g=null:R!==null&&Ew(w,R)&&(l.flags|=32),l.memoizedState!==null&&(w=C0(s,l,$7,null,null,m),Wf._currentValue=w),Hh(s,l),fr(s,l,g,m),l.child;case 6:return s===null&&Nt&&((s=m=cn)&&(m=wq(m,l.pendingProps,Ki),m!==null?(l.stateNode=m,ur=l,cn=null,s=!0):s=!1),s||cs(l)),null;case 13:return PN(s,l,m);case 4:return ie(l,l.stateNode.containerInfo),g=l.pendingProps,s===null?l.child=Ol(l,null,g,m):fr(s,l,g,m),l.child;case 11:return RN(s,l,l.type,l.pendingProps,m);case 7:return fr(s,l,l.pendingProps,m),l.child;case 8:return fr(s,l,l.pendingProps.children,m),l.child;case 12:return fr(s,l,l.pendingProps.children,m),l.child;case 10:return g=l.pendingProps,us(l,l.type,g.value),fr(s,l,g.children,m),l.child;case 9:return w=l.type._context,g=l.pendingProps.children,Il(l),w=dr(w),g=g(w),l.flags|=1,fr(s,l,g,m),l.child;case 14:return IN(s,l,l.type,l.pendingProps,m);case 15:return NN(s,l,l.type,l.pendingProps,m);case 19:return LN(s,l,m);case 31:return B7(s,l,m);case 22:return TN(s,l,m,l.pendingProps);case 24:return Il(l),g=dr(Bn),s===null?(w=p0(),w===null&&(w=Wt,_=f0(),w.pooledCache=_,_.refCount++,_!==null&&(w.pooledCacheLanes|=m),w=_),l.memoizedState={parent:g,cache:w},g0(l),us(l,Bn,w)):((s.lanes&m)!==0&&(v0(s,l),Nf(l,null,null,m),If()),w=s.memoizedState,_=l.memoizedState,w.parent!==g?(w={parent:g,cache:g},l.memoizedState=w,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=w),us(l,Bn,g)):(g=_.cache,us(l,Bn,g),g!==w.cache&&d0(l,[Bn],m,!0))),fr(s,l,l.pendingProps.children,m),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function ka(s){s.flags|=4}function Q0(s,l,m,g,w){if((l=(s.mode&32)!==0)&&(l=!1),l){if(s.flags|=16777216,(w&335544128)===w)if(s.stateNode.complete)s.flags|=8192;else if(mT())s.flags|=8192;else throw Al=Ih,h0}else s.flags&=-16777217}function FN(s,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!nA(l))if(mT())s.flags|=8192;else throw Al=Ih,h0}function Gh(s,l){l!==null&&(s.flags|=4),s.flags&16384&&(l=s.tag!==22?br():536870912,s.lanes|=l,wu|=l)}function Mf(s,l){if(!Nt)switch(s.tailMode){case"hidden":l=s.tail;for(var m=null;l!==null;)l.alternate!==null&&(m=l),l=l.sibling;m===null?s.tail=null:m.sibling=null;break;case"collapsed":m=s.tail;for(var g=null;m!==null;)m.alternate!==null&&(g=m),m=m.sibling;g===null?l||s.tail===null?s.tail=null:s.tail.sibling=null:g.sibling=null}}function un(s){var l=s.alternate!==null&&s.alternate.child===s.child,m=0,g=0;if(l)for(var w=s.child;w!==null;)m|=w.lanes|w.childLanes,g|=w.subtreeFlags&65011712,g|=w.flags&65011712,w.return=s,w=w.sibling;else for(w=s.child;w!==null;)m|=w.lanes|w.childLanes,g|=w.subtreeFlags,g|=w.flags,w.return=s,w=w.sibling;return s.subtreeFlags|=g,s.childLanes=m,l}function q7(s,l,m){var g=l.pendingProps;switch(a0(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return un(l),null;case 1:return un(l),null;case 3:return m=l.stateNode,g=null,s!==null&&(g=s.memoizedState.cache),l.memoizedState.cache!==g&&(l.flags|=2048),Sa(Bn),Se(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(s===null||s.child===null)&&(lu(l)?ka(l):s===null||s.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,l0())),un(l),null;case 26:var w=l.type,_=l.memoizedState;return s===null?(ka(l),_!==null?(un(l),FN(l,_)):(un(l),Q0(l,w,null,g,m))):_?_!==s.memoizedState?(ka(l),un(l),FN(l,_)):(un(l),l.flags&=-16777217):(s=s.memoizedProps,s!==g&&ka(l),un(l),Q0(l,w,s,g,m)),null;case 27:if(Fe(l),m=pe.current,w=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==g&&ka(l);else{if(!g){if(l.stateNode===null)throw Error(r(166));return un(l),null}s=ee.current,lu(l)?xI(l):(s=ZT(w,g,m),l.stateNode=s,ka(l))}return un(l),null;case 5:if(Fe(l),w=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==g&&ka(l);else{if(!g){if(l.stateNode===null)throw Error(r(166));return un(l),null}if(_=ee.current,lu(l))xI(l);else{var R=sg(pe.current);switch(_){case 1:_=R.createElementNS("http://www.w3.org/2000/svg",w);break;case 2:_=R.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;default:switch(w){case"svg":_=R.createElementNS("http://www.w3.org/2000/svg",w);break;case"math":_=R.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;case"script":_=R.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof g.is=="string"?R.createElement("select",{is:g.is}):R.createElement("select"),g.multiple?_.multiple=!0:g.size&&(_.size=g.size);break;default:_=typeof g.is=="string"?R.createElement(w,{is:g.is}):R.createElement(w)}}_[cr]=l,_[Zr]=g;e:for(R=l.child;R!==null;){if(R.tag===5||R.tag===6)_.appendChild(R.stateNode);else if(R.tag!==4&&R.tag!==27&&R.child!==null){R.child.return=R,R=R.child;continue}if(R===l)break e;for(;R.sibling===null;){if(R.return===null||R.return===l)break e;R=R.return}R.sibling.return=R.return,R=R.sibling}l.stateNode=_;e:switch(mr(_,w,g),w){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&ka(l)}}return un(l),Q0(l,l.type,s===null?null:s.memoizedProps,l.pendingProps,m),null;case 6:if(s&&l.stateNode!=null)s.memoizedProps!==g&&ka(l);else{if(typeof g!="string"&&l.stateNode===null)throw Error(r(166));if(s=pe.current,lu(l)){if(s=l.stateNode,m=l.memoizedProps,g=null,w=ur,w!==null)switch(w.tag){case 27:case 5:g=w.memoizedProps}s[cr]=l,s=!!(s.nodeValue===m||g!==null&&g.suppressHydrationWarning===!0||PT(s.nodeValue,m)),s||cs(l,!0)}else s=sg(s).createTextNode(g),s[cr]=l,l.stateNode=s}return un(l),null;case 31:if(m=l.memoizedState,s===null||s.memoizedState!==null){if(g=lu(l),m!==null){if(s===null){if(!g)throw Error(r(318));if(s=l.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[cr]=l}else jl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;un(l),s=!1}else m=l0(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=m),s=!0;if(!s)return l.flags&256?(bi(l),l):(bi(l),null);if((l.flags&128)!==0)throw Error(r(558))}return un(l),null;case 13:if(g=l.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(w=lu(l),g!==null&&g.dehydrated!==null){if(s===null){if(!w)throw Error(r(318));if(w=l.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(r(317));w[cr]=l}else jl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;un(l),w=!1}else w=l0(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=w),w=!0;if(!w)return l.flags&256?(bi(l),l):(bi(l),null)}return bi(l),(l.flags&128)!==0?(l.lanes=m,l):(m=g!==null,s=s!==null&&s.memoizedState!==null,m&&(g=l.child,w=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(w=g.alternate.memoizedState.cachePool.pool),_=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(_=g.memoizedState.cachePool.pool),_!==w&&(g.flags|=2048)),m!==s&&m&&(l.child.flags|=8192),Gh(l,l.updateQueue),un(l),null);case 4:return Se(),s===null&&xw(l.stateNode.containerInfo),un(l),null;case 10:return Sa(l.type),un(l),null;case 19:if(V(An),g=l.memoizedState,g===null)return un(l),null;if(w=(l.flags&128)!==0,_=g.rendering,_===null)if(w)Mf(g,!1);else{if(kn!==0||s!==null&&(s.flags&128)!==0)for(s=l.child;s!==null;){if(_=Oh(s),_!==null){for(l.flags|=128,Mf(g,!1),s=_.updateQueue,l.updateQueue=s,Gh(l,s),l.subtreeFlags=0,s=m,m=l.child;m!==null;)hI(m,s),m=m.sibling;return O(An,An.current&1|2),Nt&&xa(l,g.treeForkCount),l.child}s=s.sibling}g.tail!==null&&ve()>Xh&&(l.flags|=128,w=!0,Mf(g,!1),l.lanes=4194304)}else{if(!w)if(s=Oh(_),s!==null){if(l.flags|=128,w=!0,s=s.updateQueue,l.updateQueue=s,Gh(l,s),Mf(g,!0),g.tail===null&&g.tailMode==="hidden"&&!_.alternate&&!Nt)return un(l),null}else 2*ve()-g.renderingStartTime>Xh&&m!==536870912&&(l.flags|=128,w=!0,Mf(g,!1),l.lanes=4194304);g.isBackwards?(_.sibling=l.child,l.child=_):(s=g.last,s!==null?s.sibling=_:l.child=_,g.last=_)}return g.tail!==null?(s=g.tail,g.rendering=s,g.tail=s.sibling,g.renderingStartTime=ve(),s.sibling=null,m=An.current,O(An,w?m&1|2:m&1),Nt&&xa(l,g.treeForkCount),s):(un(l),null);case 22:case 23:return bi(l),w0(),g=l.memoizedState!==null,s!==null?s.memoizedState!==null!==g&&(l.flags|=8192):g&&(l.flags|=8192),g?(m&536870912)!==0&&(l.flags&128)===0&&(un(l),l.subtreeFlags&6&&(l.flags|=8192)):un(l),m=l.updateQueue,m!==null&&Gh(l,m.retryQueue),m=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(m=s.memoizedState.cachePool.pool),g=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),g!==m&&(l.flags|=2048),s!==null&&V(Nl),null;case 24:return m=null,s!==null&&(m=s.memoizedState.cache),l.memoizedState.cache!==m&&(l.flags|=2048),Sa(Bn),un(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function G7(s,l){switch(a0(l),l.tag){case 1:return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 3:return Sa(Bn),Se(),s=l.flags,(s&65536)!==0&&(s&128)===0?(l.flags=s&-65537|128,l):null;case 26:case 27:case 5:return Fe(l),null;case 31:if(l.memoizedState!==null){if(bi(l),l.alternate===null)throw Error(r(340));jl()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 13:if(bi(l),s=l.memoizedState,s!==null&&s.dehydrated!==null){if(l.alternate===null)throw Error(r(340));jl()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 19:return V(An),null;case 4:return Se(),null;case 10:return Sa(l.type),null;case 22:case 23:return bi(l),w0(),s!==null&&V(Nl),s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 24:return Sa(Bn),null;case 25:return null;default:return null}}function VN(s,l){switch(a0(l),l.tag){case 3:Sa(Bn),Se();break;case 26:case 27:case 5:Fe(l);break;case 4:Se();break;case 31:l.memoizedState!==null&&bi(l);break;case 13:bi(l);break;case 19:V(An);break;case 10:Sa(l.type);break;case 22:case 23:bi(l),w0(),s!==null&&V(Nl);break;case 24:Sa(Bn)}}function Pf(s,l){try{var m=l.updateQueue,g=m!==null?m.lastEffect:null;if(g!==null){var w=g.next;m=w;do{if((m.tag&s)===s){g=void 0;var _=m.create,R=m.inst;g=_(),R.destroy=g}m=m.next}while(m!==w)}}catch($){Bt(l,l.return,$)}}function gs(s,l,m){try{var g=l.updateQueue,w=g!==null?g.lastEffect:null;if(w!==null){var _=w.next;g=_;do{if((g.tag&s)===s){var R=g.inst,$=R.destroy;if($!==void 0){R.destroy=void 0,w=l;var H=m,le=$;try{le()}catch(he){Bt(w,H,he)}}}g=g.next}while(g!==_)}}catch(he){Bt(l,l.return,he)}}function BN(s){var l=s.updateQueue;if(l!==null){var m=s.stateNode;try{OI(l,m)}catch(g){Bt(s,s.return,g)}}}function HN(s,l,m){m.props=$l(s.type,s.memoizedProps),m.state=s.memoizedState;try{m.componentWillUnmount()}catch(g){Bt(s,l,g)}}function zf(s,l){try{var m=s.ref;if(m!==null){switch(s.tag){case 26:case 27:case 5:var g=s.stateNode;break;case 30:g=s.stateNode;break;default:g=s.stateNode}typeof m=="function"?s.refCleanup=m(g):m.current=g}}catch(w){Bt(s,l,w)}}function Go(s,l){var m=s.ref,g=s.refCleanup;if(m!==null)if(typeof g=="function")try{g()}catch(w){Bt(s,l,w)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof m=="function")try{m(null)}catch(w){Bt(s,l,w)}else m.current=null}function qN(s){var l=s.type,m=s.memoizedProps,g=s.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":m.autoFocus&&g.focus();break e;case"img":m.src?g.src=m.src:m.srcSet&&(g.srcset=m.srcSet)}}catch(w){Bt(s,s.return,w)}}function J0(s,l,m){try{var g=s.stateNode;pq(g,s.type,m,l),g[Zr]=l}catch(w){Bt(s,s.return,w)}}function GN(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&_s(s.type)||s.tag===4}function ew(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||GN(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&_s(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function tw(s,l,m){var g=s.tag;if(g===5||g===6)s=s.stateNode,l?(m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m).insertBefore(s,l):(l=m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m,l.appendChild(s),m=m._reactRootContainer,m!=null||l.onclick!==null||(l.onclick=va));else if(g!==4&&(g===27&&_s(s.type)&&(m=s.stateNode,l=null),s=s.child,s!==null))for(tw(s,l,m),s=s.sibling;s!==null;)tw(s,l,m),s=s.sibling}function Kh(s,l,m){var g=s.tag;if(g===5||g===6)s=s.stateNode,l?m.insertBefore(s,l):m.appendChild(s);else if(g!==4&&(g===27&&_s(s.type)&&(m=s.stateNode),s=s.child,s!==null))for(Kh(s,l,m),s=s.sibling;s!==null;)Kh(s,l,m),s=s.sibling}function KN(s){var l=s.stateNode,m=s.memoizedProps;try{for(var g=s.type,w=l.attributes;w.length;)l.removeAttributeNode(w[0]);mr(l,g,m),l[cr]=s,l[Zr]=m}catch(_){Bt(s,s.return,_)}}var ja=!1,Gn=!1,nw=!1,ZN=typeof WeakSet=="function"?WeakSet:Set,ar=null;function K7(s,l){if(s=s.containerInfo,_w=pg,s=aI(s),Yx(s)){if("selectionStart"in s)var m={start:s.selectionStart,end:s.selectionEnd};else e:{m=(m=s.ownerDocument)&&m.defaultView||window;var g=m.getSelection&&m.getSelection();if(g&&g.rangeCount!==0){m=g.anchorNode;var w=g.anchorOffset,_=g.focusNode;g=g.focusOffset;try{m.nodeType,_.nodeType}catch{m=null;break e}var R=0,$=-1,H=-1,le=0,he=0,xe=s,ce=null;t:for(;;){for(var me;xe!==m||w!==0&&xe.nodeType!==3||($=R+w),xe!==_||g!==0&&xe.nodeType!==3||(H=R+g),xe.nodeType===3&&(R+=xe.nodeValue.length),(me=xe.firstChild)!==null;)ce=xe,xe=me;for(;;){if(xe===s)break t;if(ce===m&&++le===w&&($=R),ce===_&&++he===g&&(H=R),(me=xe.nextSibling)!==null)break;xe=ce,ce=xe.parentNode}xe=me}m=$===-1||H===-1?null:{start:$,end:H}}else m=null}m=m||{start:0,end:0}}else m=null;for(Cw={focusedElem:s,selectionRange:m},pg=!1,ar=l;ar!==null;)if(l=ar,s=l.child,(l.subtreeFlags&1028)!==0&&s!==null)s.return=l,ar=s;else for(;ar!==null;){switch(l=ar,_=l.alternate,s=l.flags,l.tag){case 0:if((s&4)!==0&&(s=l.updateQueue,s=s!==null?s.events:null,s!==null))for(m=0;m<s.length;m++)w=s[m],w.ref.impl=w.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&_!==null){s=void 0,m=l,w=_.memoizedProps,_=_.memoizedState,g=m.stateNode;try{var Ve=$l(m.type,w);s=g.getSnapshotBeforeUpdate(Ve,_),g.__reactInternalSnapshotBeforeUpdate=s}catch(Xe){Bt(m,m.return,Xe)}}break;case 3:if((s&1024)!==0){if(s=l.stateNode.containerInfo,m=s.nodeType,m===9)jw(s);else if(m===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":jw(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=l.sibling,s!==null){s.return=l.return,ar=s;break}ar=l.return}}function YN(s,l,m){var g=m.flags;switch(m.tag){case 0:case 11:case 15:Ia(s,m),g&4&&Pf(5,m);break;case 1:if(Ia(s,m),g&4)if(s=m.stateNode,l===null)try{s.componentDidMount()}catch(R){Bt(m,m.return,R)}else{var w=$l(m.type,l.memoizedProps);l=l.memoizedState;try{s.componentDidUpdate(w,l,s.__reactInternalSnapshotBeforeUpdate)}catch(R){Bt(m,m.return,R)}}g&64&&BN(m),g&512&&zf(m,m.return);break;case 3:if(Ia(s,m),g&64&&(s=m.updateQueue,s!==null)){if(l=null,m.child!==null)switch(m.child.tag){case 27:case 5:l=m.child.stateNode;break;case 1:l=m.child.stateNode}try{OI(s,l)}catch(R){Bt(m,m.return,R)}}break;case 27:l===null&&g&4&&KN(m);case 26:case 5:Ia(s,m),l===null&&g&4&&qN(m),g&512&&zf(m,m.return);break;case 12:Ia(s,m);break;case 31:Ia(s,m),g&4&&QN(s,m);break;case 13:Ia(s,m),g&4&&JN(s,m),g&64&&(s=m.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(m=nq.bind(null,m),Sq(s,m))));break;case 22:if(g=m.memoizedState!==null||ja,!g){l=l!==null&&l.memoizedState!==null||Gn,w=ja;var _=Gn;ja=g,(Gn=l)&&!_?Na(s,m,(m.subtreeFlags&8772)!==0):Ia(s,m),ja=w,Gn=_}break;case 30:break;default:Ia(s,m)}}function WN(s){var l=s.alternate;l!==null&&(s.alternate=null,WN(l)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(l=s.stateNode,l!==null&&Ax(l)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var yn=null,Wr=!1;function Ra(s,l,m){for(m=m.child;m!==null;)XN(s,l,m),m=m.sibling}function XN(s,l,m){if(Yt&&typeof Yt.onCommitFiberUnmount=="function")try{Yt.onCommitFiberUnmount(xn,m)}catch{}switch(m.tag){case 26:Gn||Go(m,l),Ra(s,l,m),m.memoizedState?m.memoizedState.count--:m.stateNode&&(m=m.stateNode,m.parentNode.removeChild(m));break;case 27:Gn||Go(m,l);var g=yn,w=Wr;_s(m.type)&&(yn=m.stateNode,Wr=!1),Ra(s,l,m),Kf(m.stateNode),yn=g,Wr=w;break;case 5:Gn||Go(m,l);case 6:if(g=yn,w=Wr,yn=null,Ra(s,l,m),yn=g,Wr=w,yn!==null)if(Wr)try{(yn.nodeType===9?yn.body:yn.nodeName==="HTML"?yn.ownerDocument.body:yn).removeChild(m.stateNode)}catch(_){Bt(m,l,_)}else try{yn.removeChild(m.stateNode)}catch(_){Bt(m,l,_)}break;case 18:yn!==null&&(Wr?(s=yn,BT(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,m.stateNode),Iu(s)):BT(yn,m.stateNode));break;case 4:g=yn,w=Wr,yn=m.stateNode.containerInfo,Wr=!0,Ra(s,l,m),yn=g,Wr=w;break;case 0:case 11:case 14:case 15:gs(2,m,l),Gn||gs(4,m,l),Ra(s,l,m);break;case 1:Gn||(Go(m,l),g=m.stateNode,typeof g.componentWillUnmount=="function"&&HN(m,l,g)),Ra(s,l,m);break;case 21:Ra(s,l,m);break;case 22:Gn=(g=Gn)||m.memoizedState!==null,Ra(s,l,m),Gn=g;break;default:Ra(s,l,m)}}function QN(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Iu(s)}catch(m){Bt(l,l.return,m)}}}function JN(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Iu(s)}catch(m){Bt(l,l.return,m)}}function Z7(s){switch(s.tag){case 31:case 13:case 19:var l=s.stateNode;return l===null&&(l=s.stateNode=new ZN),l;case 22:return s=s.stateNode,l=s._retryCache,l===null&&(l=s._retryCache=new ZN),l;default:throw Error(r(435,s.tag))}}function Zh(s,l){var m=Z7(s);l.forEach(function(g){if(!m.has(g)){m.add(g);var w=rq.bind(null,s,g);g.then(w,w)}})}function Xr(s,l){var m=l.deletions;if(m!==null)for(var g=0;g<m.length;g++){var w=m[g],_=s,R=l,$=R;e:for(;$!==null;){switch($.tag){case 27:if(_s($.type)){yn=$.stateNode,Wr=!1;break e}break;case 5:yn=$.stateNode,Wr=!1;break e;case 3:case 4:yn=$.stateNode.containerInfo,Wr=!0;break e}$=$.return}if(yn===null)throw Error(r(160));XN(_,R,w),yn=null,Wr=!1,_=w.alternate,_!==null&&(_.return=null),w.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)eT(l,s),l=l.sibling}var So=null;function eT(s,l){var m=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:Xr(l,s),Qr(s),g&4&&(gs(3,s,s.return),Pf(3,s),gs(5,s,s.return));break;case 1:Xr(l,s),Qr(s),g&512&&(Gn||m===null||Go(m,m.return)),g&64&&ja&&(s=s.updateQueue,s!==null&&(g=s.callbacks,g!==null&&(m=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=m===null?g:m.concat(g))));break;case 26:var w=So;if(Xr(l,s),Qr(s),g&512&&(Gn||m===null||Go(m,m.return)),g&4){var _=m!==null?m.memoizedState:null;if(g=s.memoizedState,m===null)if(g===null)if(s.stateNode===null){e:{g=s.type,m=s.memoizedProps,w=w.ownerDocument||w;t:switch(g){case"title":_=w.getElementsByTagName("title")[0],(!_||_[df]||_[cr]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=w.createElement(g),w.head.insertBefore(_,w.querySelector("head > title"))),mr(_,g,m),_[cr]=s,or(_),g=_;break e;case"link":var R=eA("link","href",w).get(g+(m.href||""));if(R){for(var $=0;$<R.length;$++)if(_=R[$],_.getAttribute("href")===(m.href==null||m.href===""?null:m.href)&&_.getAttribute("rel")===(m.rel==null?null:m.rel)&&_.getAttribute("title")===(m.title==null?null:m.title)&&_.getAttribute("crossorigin")===(m.crossOrigin==null?null:m.crossOrigin)){R.splice($,1);break t}}_=w.createElement(g),mr(_,g,m),w.head.appendChild(_);break;case"meta":if(R=eA("meta","content",w).get(g+(m.content||""))){for($=0;$<R.length;$++)if(_=R[$],_.getAttribute("content")===(m.content==null?null:""+m.content)&&_.getAttribute("name")===(m.name==null?null:m.name)&&_.getAttribute("property")===(m.property==null?null:m.property)&&_.getAttribute("http-equiv")===(m.httpEquiv==null?null:m.httpEquiv)&&_.getAttribute("charset")===(m.charSet==null?null:m.charSet)){R.splice($,1);break t}}_=w.createElement(g),mr(_,g,m),w.head.appendChild(_);break;default:throw Error(r(468,g))}_[cr]=s,or(_),g=_}s.stateNode=g}else tA(w,s.type,s.stateNode);else s.stateNode=JT(w,g,s.memoizedProps);else _!==g?(_===null?m.stateNode!==null&&(m=m.stateNode,m.parentNode.removeChild(m)):_.count--,g===null?tA(w,s.type,s.stateNode):JT(w,g,s.memoizedProps)):g===null&&s.stateNode!==null&&J0(s,s.memoizedProps,m.memoizedProps)}break;case 27:Xr(l,s),Qr(s),g&512&&(Gn||m===null||Go(m,m.return)),m!==null&&g&4&&J0(s,s.memoizedProps,m.memoizedProps);break;case 5:if(Xr(l,s),Qr(s),g&512&&(Gn||m===null||Go(m,m.return)),s.flags&32){w=s.stateNode;try{Qc(w,"")}catch(Ve){Bt(s,s.return,Ve)}}g&4&&s.stateNode!=null&&(w=s.memoizedProps,J0(s,w,m!==null?m.memoizedProps:w)),g&1024&&(nw=!0);break;case 6:if(Xr(l,s),Qr(s),g&4){if(s.stateNode===null)throw Error(r(162));g=s.memoizedProps,m=s.stateNode;try{m.nodeValue=g}catch(Ve){Bt(s,s.return,Ve)}}break;case 3:if(ug=null,w=So,So=lg(l.containerInfo),Xr(l,s),So=w,Qr(s),g&4&&m!==null&&m.memoizedState.isDehydrated)try{Iu(l.containerInfo)}catch(Ve){Bt(s,s.return,Ve)}nw&&(nw=!1,tT(s));break;case 4:g=So,So=lg(s.stateNode.containerInfo),Xr(l,s),Qr(s),So=g;break;case 12:Xr(l,s),Qr(s);break;case 31:Xr(l,s),Qr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Zh(s,g)));break;case 13:Xr(l,s),Qr(s),s.child.flags&8192&&s.memoizedState!==null!=(m!==null&&m.memoizedState!==null)&&(Wh=ve()),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Zh(s,g)));break;case 22:w=s.memoizedState!==null;var H=m!==null&&m.memoizedState!==null,le=ja,he=Gn;if(ja=le||w,Gn=he||H,Xr(l,s),Gn=he,ja=le,Qr(s),g&8192)e:for(l=s.stateNode,l._visibility=w?l._visibility&-2:l._visibility|1,w&&(m===null||H||ja||Gn||Ml(s)),m=null,l=s;;){if(l.tag===5||l.tag===26){if(m===null){H=m=l;try{if(_=H.stateNode,w)R=_.style,typeof R.setProperty=="function"?R.setProperty("display","none","important"):R.display="none";else{$=H.stateNode;var xe=H.memoizedProps.style,ce=xe!=null&&xe.hasOwnProperty("display")?xe.display:null;$.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(Ve){Bt(H,H.return,Ve)}}}else if(l.tag===6){if(m===null){H=l;try{H.stateNode.nodeValue=w?"":H.memoizedProps}catch(Ve){Bt(H,H.return,Ve)}}}else if(l.tag===18){if(m===null){H=l;try{var me=H.stateNode;w?HT(me,!0):HT(H.stateNode,!1)}catch(Ve){Bt(H,H.return,Ve)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===s)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break e;for(;l.sibling===null;){if(l.return===null||l.return===s)break e;m===l&&(m=null),l=l.return}m===l&&(m=null),l.sibling.return=l.return,l=l.sibling}g&4&&(g=s.updateQueue,g!==null&&(m=g.retryQueue,m!==null&&(g.retryQueue=null,Zh(s,m))));break;case 19:Xr(l,s),Qr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Zh(s,g)));break;case 30:break;case 21:break;default:Xr(l,s),Qr(s)}}function Qr(s){var l=s.flags;if(l&2){try{for(var m,g=s.return;g!==null;){if(GN(g)){m=g;break}g=g.return}if(m==null)throw Error(r(160));switch(m.tag){case 27:var w=m.stateNode,_=ew(s);Kh(s,_,w);break;case 5:var R=m.stateNode;m.flags&32&&(Qc(R,""),m.flags&=-33);var $=ew(s);Kh(s,$,R);break;case 3:case 4:var H=m.stateNode.containerInfo,le=ew(s);tw(s,le,H);break;default:throw Error(r(161))}}catch(he){Bt(s,s.return,he)}s.flags&=-3}l&4096&&(s.flags&=-4097)}function tT(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var l=s;tT(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),s=s.sibling}}function Ia(s,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)YN(s,l.alternate,l),l=l.sibling}function Ml(s){for(s=s.child;s!==null;){var l=s;switch(l.tag){case 0:case 11:case 14:case 15:gs(4,l,l.return),Ml(l);break;case 1:Go(l,l.return);var m=l.stateNode;typeof m.componentWillUnmount=="function"&&HN(l,l.return,m),Ml(l);break;case 27:Kf(l.stateNode);case 26:case 5:Go(l,l.return),Ml(l);break;case 22:l.memoizedState===null&&Ml(l);break;case 30:Ml(l);break;default:Ml(l)}s=s.sibling}}function Na(s,l,m){for(m=m&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var g=l.alternate,w=s,_=l,R=_.flags;switch(_.tag){case 0:case 11:case 15:Na(w,_,m),Pf(4,_);break;case 1:if(Na(w,_,m),g=_,w=g.stateNode,typeof w.componentDidMount=="function")try{w.componentDidMount()}catch(le){Bt(g,g.return,le)}if(g=_,w=g.updateQueue,w!==null){var $=g.stateNode;try{var H=w.shared.hiddenCallbacks;if(H!==null)for(w.shared.hiddenCallbacks=null,w=0;w<H.length;w++)AI(H[w],$)}catch(le){Bt(g,g.return,le)}}m&&R&64&&BN(_),zf(_,_.return);break;case 27:KN(_);case 26:case 5:Na(w,_,m),m&&g===null&&R&4&&qN(_),zf(_,_.return);break;case 12:Na(w,_,m);break;case 31:Na(w,_,m),m&&R&4&&QN(w,_);break;case 13:Na(w,_,m),m&&R&4&&JN(w,_);break;case 22:_.memoizedState===null&&Na(w,_,m),zf(_,_.return);break;case 30:break;default:Na(w,_,m)}l=l.sibling}}function rw(s,l){var m=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(m=s.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==m&&(s!=null&&s.refCount++,m!=null&&Cf(m))}function iw(s,l){s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&Cf(s))}function _o(s,l,m,g){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)nT(s,l,m,g),l=l.sibling}function nT(s,l,m,g){var w=l.flags;switch(l.tag){case 0:case 11:case 15:_o(s,l,m,g),w&2048&&Pf(9,l);break;case 1:_o(s,l,m,g);break;case 3:_o(s,l,m,g),w&2048&&(s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&Cf(s)));break;case 12:if(w&2048){_o(s,l,m,g),s=l.stateNode;try{var _=l.memoizedProps,R=_.id,$=_.onPostCommit;typeof $=="function"&&$(R,l.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(H){Bt(l,l.return,H)}}else _o(s,l,m,g);break;case 31:_o(s,l,m,g);break;case 13:_o(s,l,m,g);break;case 23:break;case 22:_=l.stateNode,R=l.alternate,l.memoizedState!==null?_._visibility&2?_o(s,l,m,g):Lf(s,l):_._visibility&2?_o(s,l,m,g):(_._visibility|=2,yu(s,l,m,g,(l.subtreeFlags&10256)!==0||!1)),w&2048&&rw(R,l);break;case 24:_o(s,l,m,g),w&2048&&iw(l.alternate,l);break;default:_o(s,l,m,g)}}function yu(s,l,m,g,w){for(w=w&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var _=s,R=l,$=m,H=g,le=R.flags;switch(R.tag){case 0:case 11:case 15:yu(_,R,$,H,w),Pf(8,R);break;case 23:break;case 22:var he=R.stateNode;R.memoizedState!==null?he._visibility&2?yu(_,R,$,H,w):Lf(_,R):(he._visibility|=2,yu(_,R,$,H,w)),w&&le&2048&&rw(R.alternate,R);break;case 24:yu(_,R,$,H,w),w&&le&2048&&iw(R.alternate,R);break;default:yu(_,R,$,H,w)}l=l.sibling}}function Lf(s,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var m=s,g=l,w=g.flags;switch(g.tag){case 22:Lf(m,g),w&2048&&rw(g.alternate,g);break;case 24:Lf(m,g),w&2048&&iw(g.alternate,g);break;default:Lf(m,g)}l=l.sibling}}var Uf=8192;function bu(s,l,m){if(s.subtreeFlags&Uf)for(s=s.child;s!==null;)rT(s,l,m),s=s.sibling}function rT(s,l,m){switch(s.tag){case 26:bu(s,l,m),s.flags&Uf&&s.memoizedState!==null&&Dq(m,So,s.memoizedState,s.memoizedProps);break;case 5:bu(s,l,m);break;case 3:case 4:var g=So;So=lg(s.stateNode.containerInfo),bu(s,l,m),So=g;break;case 22:s.memoizedState===null&&(g=s.alternate,g!==null&&g.memoizedState!==null?(g=Uf,Uf=16777216,bu(s,l,m),Uf=g):bu(s,l,m));break;default:bu(s,l,m)}}function iT(s){var l=s.alternate;if(l!==null&&(s=l.child,s!==null)){l.child=null;do l=s.sibling,s.sibling=null,s=l;while(s!==null)}}function Ff(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var m=0;m<l.length;m++){var g=l[m];ar=g,aT(g,s)}iT(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)oT(s),s=s.sibling}function oT(s){switch(s.tag){case 0:case 11:case 15:Ff(s),s.flags&2048&&gs(9,s,s.return);break;case 3:Ff(s);break;case 12:Ff(s);break;case 22:var l=s.stateNode;s.memoizedState!==null&&l._visibility&2&&(s.return===null||s.return.tag!==13)?(l._visibility&=-3,Yh(s)):Ff(s);break;default:Ff(s)}}function Yh(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var m=0;m<l.length;m++){var g=l[m];ar=g,aT(g,s)}iT(s)}for(s=s.child;s!==null;){switch(l=s,l.tag){case 0:case 11:case 15:gs(8,l,l.return),Yh(l);break;case 22:m=l.stateNode,m._visibility&2&&(m._visibility&=-3,Yh(l));break;default:Yh(l)}s=s.sibling}}function aT(s,l){for(;ar!==null;){var m=ar;switch(m.tag){case 0:case 11:case 15:gs(8,m,l);break;case 23:case 22:if(m.memoizedState!==null&&m.memoizedState.cachePool!==null){var g=m.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:Cf(m.memoizedState.cache)}if(g=m.child,g!==null)g.return=m,ar=g;else e:for(m=s;ar!==null;){g=ar;var w=g.sibling,_=g.return;if(WN(g),g===m){ar=null;break e}if(w!==null){w.return=_,ar=w;break e}ar=_}}}var Y7={getCacheForType:function(s){var l=dr(Bn),m=l.data.get(s);return m===void 0&&(m=s(),l.data.set(s,m)),m},cacheSignal:function(){return dr(Bn).controller.signal}},W7=typeof WeakMap=="function"?WeakMap:Map,Pt=0,Wt=null,Et=null,Rt=0,Vt=0,xi=null,vs=!1,xu=!1,ow=!1,Ta=0,kn=0,ys=0,Pl=0,aw=0,wi=0,wu=0,Vf=null,Jr=null,sw=!1,Wh=0,sT=0,Xh=1/0,Qh=null,bs=null,Xn=0,xs=null,Su=null,Aa=0,lw=0,cw=null,lT=null,Bf=0,uw=null;function Si(){return(Pt&2)!==0&&Rt!==0?Rt&-Rt:M.T!==null?gw():Nx()}function cT(){if(wi===0)if((Rt&536870912)===0||Nt){var s=Hc;Hc<<=1,(Hc&3932160)===0&&(Hc=262144),wi=s}else wi=536870912;return s=yi.current,s!==null&&(s.flags|=32),wi}function ei(s,l,m){(s===Wt&&(Vt===2||Vt===9)||s.cancelPendingCommit!==null)&&(_u(s,0),ws(s,Rt,wi,!1)),wn(s,m),((Pt&2)===0||s!==Wt)&&(s===Wt&&((Pt&2)===0&&(Pl|=m),kn===4&&ws(s,Rt,wi,!1)),Ko(s))}function uT(s,l,m){if((Pt&6)!==0)throw Error(r(327));var g=!m&&(l&127)===0&&(l&s.expiredLanes)===0||vn(s,l),w=g?J7(s,l):fw(s,l,!0),_=g;do{if(w===0){xu&&!g&&ws(s,l,0,!1);break}else{if(m=s.current.alternate,_&&!X7(m)){w=fw(s,l,!1),_=!1;continue}if(w===2){if(_=l,s.errorRecoveryDisabledLanes&_)var R=0;else R=s.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){l=R;e:{var $=s;w=Vf;var H=$.current.memoizedState.isDehydrated;if(H&&(_u($,R).flags|=256),R=fw($,R,!1),R!==2){if(ow&&!H){$.errorRecoveryDisabledLanes|=_,Pl|=_,w=4;break e}_=Jr,Jr=w,_!==null&&(Jr===null?Jr=_:Jr.push.apply(Jr,_))}w=R}if(_=!1,w!==2)continue}}if(w===1){_u(s,0),ws(s,l,0,!0);break}e:{switch(g=s,_=w,_){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:ws(g,l,wi,!vs);break e;case 2:Jr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(w=Wh+300-ve(),10<w)){if(ws(g,l,wi,!vs),ot(g,0,!0)!==0)break e;Aa=l,g.timeoutHandle=FT(dT.bind(null,g,m,Jr,Qh,sw,l,wi,Pl,wu,vs,_,"Throttled",-0,0),w);break e}dT(g,m,Jr,Qh,sw,l,wi,Pl,wu,vs,_,null,-0,0)}}break}while(!0);Ko(s)}function dT(s,l,m,g,w,_,R,$,H,le,he,xe,ce,me){if(s.timeoutHandle=-1,xe=l.subtreeFlags,xe&8192||(xe&16785408)===16785408){xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:va},rT(l,_,xe);var Ve=(_&62914560)===_?Wh-ve():(_&4194048)===_?sT-ve():0;if(Ve=$q(xe,Ve),Ve!==null){Aa=_,s.cancelPendingCommit=Ve(bT.bind(null,s,l,_,m,g,w,R,$,H,he,xe,null,ce,me)),ws(s,_,R,!le);return}}bT(s,l,_,m,g,w,R,$,H)}function X7(s){for(var l=s;;){var m=l.tag;if((m===0||m===11||m===15)&&l.flags&16384&&(m=l.updateQueue,m!==null&&(m=m.stores,m!==null)))for(var g=0;g<m.length;g++){var w=m[g],_=w.getSnapshot;w=w.value;try{if(!gi(_(),w))return!1}catch{return!1}}if(m=l.child,l.subtreeFlags&16384&&m!==null)m.return=l,l=m;else{if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function ws(s,l,m,g){l&=~aw,l&=~Pl,s.suspendedLanes|=l,s.pingedLanes&=~l,g&&(s.warmLanes|=l),g=s.expirationTimes;for(var w=l;0<w;){var _=31-yt(w),R=1<<_;g[_]=-1,w&=~R}m!==0&&xl(s,m,l)}function Jh(){return(Pt&6)===0?(Hf(0),!1):!0}function dw(){if(Et!==null){if(Vt===0)var s=Et.return;else s=Et,wa=Rl=null,j0(s),mu=null,kf=0,s=Et;for(;s!==null;)VN(s.alternate,s),s=s.return;Et=null}}function _u(s,l){var m=s.timeoutHandle;m!==-1&&(s.timeoutHandle=-1,vq(m)),m=s.cancelPendingCommit,m!==null&&(s.cancelPendingCommit=null,m()),Aa=0,dw(),Wt=s,Et=m=ba(s.current,null),Rt=l,Vt=0,xi=null,vs=!1,xu=vn(s,l),ow=!1,wu=wi=aw=Pl=ys=kn=0,Jr=Vf=null,sw=!1,(l&8)!==0&&(l|=l&32);var g=s.entangledLanes;if(g!==0)for(s=s.entanglements,g&=l;0<g;){var w=31-yt(g),_=1<<w;l|=s[w],g&=~_}return Ta=l,xh(),m}function fT(s,l){dt=null,M.H=Df,l===fu||l===Rh?(l=RI(),Vt=3):l===h0?(l=RI(),Vt=4):Vt=l===B0?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,xi=l,Et===null&&(kn=1,Vh(s,Hi(l,s.current)))}function mT(){var s=yi.current;return s===null?!0:(Rt&4194048)===Rt?Zi===null:(Rt&62914560)===Rt||(Rt&536870912)!==0?s===Zi:!1}function pT(){var s=M.H;return M.H=Df,s===null?Df:s}function hT(){var s=M.A;return M.A=Y7,s}function eg(){kn=4,vs||(Rt&4194048)!==Rt&&yi.current!==null||(xu=!0),(ys&134217727)===0&&(Pl&134217727)===0||Wt===null||ws(Wt,Rt,wi,!1)}function fw(s,l,m){var g=Pt;Pt|=2;var w=pT(),_=hT();(Wt!==s||Rt!==l)&&(Qh=null,_u(s,l)),l=!1;var R=kn;e:do try{if(Vt!==0&&Et!==null){var $=Et,H=xi;switch(Vt){case 8:dw(),R=6;break e;case 3:case 2:case 9:case 6:yi.current===null&&(l=!0);var le=Vt;if(Vt=0,xi=null,Cu(s,$,H,le),m&&xu){R=0;break e}break;default:le=Vt,Vt=0,xi=null,Cu(s,$,H,le)}}Q7(),R=kn;break}catch(he){fT(s,he)}while(!0);return l&&s.shellSuspendCounter++,wa=Rl=null,Pt=g,M.H=w,M.A=_,Et===null&&(Wt=null,Rt=0,xh()),R}function Q7(){for(;Et!==null;)gT(Et)}function J7(s,l){var m=Pt;Pt|=2;var g=pT(),w=hT();Wt!==s||Rt!==l?(Qh=null,Xh=ve()+500,_u(s,l)):xu=vn(s,l);e:do try{if(Vt!==0&&Et!==null){l=Et;var _=xi;t:switch(Vt){case 1:Vt=0,xi=null,Cu(s,l,_,1);break;case 2:case 9:if(kI(_)){Vt=0,xi=null,vT(l);break}l=function(){Vt!==2&&Vt!==9||Wt!==s||(Vt=7),Ko(s)},_.then(l,l);break e;case 3:Vt=7;break e;case 4:Vt=5;break e;case 7:kI(_)?(Vt=0,xi=null,vT(l)):(Vt=0,xi=null,Cu(s,l,_,7));break;case 5:var R=null;switch(Et.tag){case 26:R=Et.memoizedState;case 5:case 27:var $=Et;if(R?nA(R):$.stateNode.complete){Vt=0,xi=null;var H=$.sibling;if(H!==null)Et=H;else{var le=$.return;le!==null?(Et=le,tg(le)):Et=null}break t}}Vt=0,xi=null,Cu(s,l,_,5);break;case 6:Vt=0,xi=null,Cu(s,l,_,6);break;case 8:dw(),kn=6;break e;default:throw Error(r(462))}}eq();break}catch(he){fT(s,he)}while(!0);return wa=Rl=null,M.H=g,M.A=w,Pt=m,Et!==null?0:(Wt=null,Rt=0,xh(),kn)}function eq(){for(;Et!==null&&!de();)gT(Et)}function gT(s){var l=UN(s.alternate,s,Ta);s.memoizedProps=s.pendingProps,l===null?tg(s):Et=l}function vT(s){var l=s,m=l.alternate;switch(l.tag){case 15:case 0:l=DN(m,l,l.pendingProps,l.type,void 0,Rt);break;case 11:l=DN(m,l,l.pendingProps,l.type.render,l.ref,Rt);break;case 5:j0(l);default:VN(m,l),l=Et=hI(l,Ta),l=UN(m,l,Ta)}s.memoizedProps=s.pendingProps,l===null?tg(s):Et=l}function Cu(s,l,m,g){wa=Rl=null,j0(l),mu=null,kf=0;var w=l.return;try{if(V7(s,w,l,m,Rt)){kn=1,Vh(s,Hi(m,s.current)),Et=null;return}}catch(_){if(w!==null)throw Et=w,_;kn=1,Vh(s,Hi(m,s.current)),Et=null;return}l.flags&32768?(Nt||g===1?s=!0:xu||(Rt&536870912)!==0?s=!1:(vs=s=!0,(g===2||g===9||g===3||g===6)&&(g=yi.current,g!==null&&g.tag===13&&(g.flags|=16384))),yT(l,s)):tg(l)}function tg(s){var l=s;do{if((l.flags&32768)!==0){yT(l,vs);return}s=l.return;var m=q7(l.alternate,l,Ta);if(m!==null){Et=m;return}if(l=l.sibling,l!==null){Et=l;return}Et=l=s}while(l!==null);kn===0&&(kn=5)}function yT(s,l){do{var m=G7(s.alternate,s);if(m!==null){m.flags&=32767,Et=m;return}if(m=s.return,m!==null&&(m.flags|=32768,m.subtreeFlags=0,m.deletions=null),!l&&(s=s.sibling,s!==null)){Et=s;return}Et=s=m}while(s!==null);kn=6,Et=null}function bT(s,l,m,g,w,_,R,$,H){s.cancelPendingCommit=null;do ng();while(Xn!==0);if((Pt&6)!==0)throw Error(r(327));if(l!==null){if(l===s.current)throw Error(r(177));if(_=l.lanes|l.childLanes,_|=e0,qr(s,m,_,R,$,H),s===Wt&&(Et=Wt=null,Rt=0),Su=l,xs=s,Aa=m,lw=_,cw=w,lT=g,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,iq(Te,function(){return CT(),null})):(s.callbackNode=null,s.callbackPriority=0),g=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||g){g=M.T,M.T=null,w=K.p,K.p=2,R=Pt,Pt|=4;try{K7(s,l,m)}finally{Pt=R,K.p=w,M.T=g}}Xn=1,xT(),wT(),ST()}}function xT(){if(Xn===1){Xn=0;var s=xs,l=Su,m=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||m){m=M.T,M.T=null;var g=K.p;K.p=2;var w=Pt;Pt|=4;try{eT(l,s);var _=Cw,R=aI(s.containerInfo),$=_.focusedElem,H=_.selectionRange;if(R!==$&&$&&$.ownerDocument&&oI($.ownerDocument.documentElement,$)){if(H!==null&&Yx($)){var le=H.start,he=H.end;if(he===void 0&&(he=le),"selectionStart"in $)$.selectionStart=le,$.selectionEnd=Math.min(he,$.value.length);else{var xe=$.ownerDocument||document,ce=xe&&xe.defaultView||window;if(ce.getSelection){var me=ce.getSelection(),Ve=$.textContent.length,Xe=Math.min(H.start,Ve),Zt=H.end===void 0?Xe:Math.min(H.end,Ve);!me.extend&&Xe>Zt&&(R=Zt,Zt=Xe,Xe=R);var re=iI($,Xe),Q=iI($,Zt);if(re&&Q&&(me.rangeCount!==1||me.anchorNode!==re.node||me.anchorOffset!==re.offset||me.focusNode!==Q.node||me.focusOffset!==Q.offset)){var se=xe.createRange();se.setStart(re.node,re.offset),me.removeAllRanges(),Xe>Zt?(me.addRange(se),me.extend(Q.node,Q.offset)):(se.setEnd(Q.node,Q.offset),me.addRange(se))}}}}for(xe=[],me=$;me=me.parentNode;)me.nodeType===1&&xe.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof $.focus=="function"&&$.focus(),$=0;$<xe.length;$++){var ge=xe[$];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}pg=!!_w,Cw=_w=null}finally{Pt=w,K.p=g,M.T=m}}s.current=l,Xn=2}}function wT(){if(Xn===2){Xn=0;var s=xs,l=Su,m=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||m){m=M.T,M.T=null;var g=K.p;K.p=2;var w=Pt;Pt|=4;try{YN(s,l.alternate,l)}finally{Pt=w,K.p=g,M.T=m}}Xn=3}}function ST(){if(Xn===4||Xn===3){Xn=0,we();var s=xs,l=Su,m=Aa,g=lT;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?Xn=5:(Xn=0,Su=xs=null,_T(s,s.pendingLanes));var w=s.pendingLanes;if(w===0&&(bs=null),xo(m),l=l.stateNode,Yt&&typeof Yt.onCommitFiberRoot=="function")try{Yt.onCommitFiberRoot(xn,l,void 0,(l.current.flags&128)===128)}catch{}if(g!==null){l=M.T,w=K.p,K.p=2,M.T=null;try{for(var _=s.onRecoverableError,R=0;R<g.length;R++){var $=g[R];_($.value,{componentStack:$.stack})}}finally{M.T=l,K.p=w}}(Aa&3)!==0&&ng(),Ko(s),w=s.pendingLanes,(m&261930)!==0&&(w&42)!==0?s===uw?Bf++:(Bf=0,uw=s):Bf=0,Hf(0)}}function _T(s,l){(s.pooledCacheLanes&=l)===0&&(l=s.pooledCache,l!=null&&(s.pooledCache=null,Cf(l)))}function ng(){return xT(),wT(),ST(),CT()}function CT(){if(Xn!==5)return!1;var s=xs,l=lw;lw=0;var m=xo(Aa),g=M.T,w=K.p;try{K.p=32>m?32:m,M.T=null,m=cw,cw=null;var _=xs,R=Aa;if(Xn=0,Su=xs=null,Aa=0,(Pt&6)!==0)throw Error(r(331));var $=Pt;if(Pt|=4,oT(_.current),nT(_,_.current,R,m),Pt=$,Hf(0,!1),Yt&&typeof Yt.onPostCommitFiberRoot=="function")try{Yt.onPostCommitFiberRoot(xn,_)}catch{}return!0}finally{K.p=w,M.T=g,_T(s,l)}}function ET(s,l,m){l=Hi(m,l),l=V0(s.stateNode,l,2),s=ms(s,l,2),s!==null&&(wn(s,2),Ko(s))}function Bt(s,l,m){if(s.tag===3)ET(s,s,m);else for(;l!==null;){if(l.tag===3){ET(l,s,m);break}else if(l.tag===1){var g=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(bs===null||!bs.has(g))){s=Hi(m,s),m=kN(2),g=ms(l,m,2),g!==null&&(jN(m,g,l,s),wn(g,2),Ko(g));break}}l=l.return}}function mw(s,l,m){var g=s.pingCache;if(g===null){g=s.pingCache=new W7;var w=new Set;g.set(l,w)}else w=g.get(l),w===void 0&&(w=new Set,g.set(l,w));w.has(m)||(ow=!0,w.add(m),s=tq.bind(null,s,l,m),l.then(s,s))}function tq(s,l,m){var g=s.pingCache;g!==null&&g.delete(l),s.pingedLanes|=s.suspendedLanes&m,s.warmLanes&=~m,Wt===s&&(Rt&m)===m&&(kn===4||kn===3&&(Rt&62914560)===Rt&&300>ve()-Wh?(Pt&2)===0&&_u(s,0):aw|=m,wu===Rt&&(wu=0)),Ko(s)}function kT(s,l){l===0&&(l=br()),s=El(s,l),s!==null&&(wn(s,l),Ko(s))}function nq(s){var l=s.memoizedState,m=0;l!==null&&(m=l.retryLane),kT(s,m)}function rq(s,l){var m=0;switch(s.tag){case 31:case 13:var g=s.stateNode,w=s.memoizedState;w!==null&&(m=w.retryLane);break;case 19:g=s.stateNode;break;case 22:g=s.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(l),kT(s,m)}function iq(s,l){return q(s,l)}var rg=null,Eu=null,pw=!1,ig=!1,hw=!1,Ss=0;function Ko(s){s!==Eu&&s.next===null&&(Eu===null?rg=Eu=s:Eu=Eu.next=s),ig=!0,pw||(pw=!0,aq())}function Hf(s,l){if(!hw&&ig){hw=!0;do for(var m=!1,g=rg;g!==null;){if(s!==0){var w=g.pendingLanes;if(w===0)var _=0;else{var R=g.suspendedLanes,$=g.pingedLanes;_=(1<<31-yt(42|s)+1)-1,_&=w&~(R&~$),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(m=!0,NT(g,_))}else _=Rt,_=ot(g,g===Wt?_:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(_&3)===0||vn(g,_)||(m=!0,NT(g,_));g=g.next}while(m);hw=!1}}function oq(){jT()}function jT(){ig=pw=!1;var s=0;Ss!==0&&gq()&&(s=Ss);for(var l=ve(),m=null,g=rg;g!==null;){var w=g.next,_=RT(g,l);_===0?(g.next=null,m===null?rg=w:m.next=w,w===null&&(Eu=m)):(m=g,(s!==0||(_&3)!==0)&&(ig=!0)),g=w}Xn!==0&&Xn!==5||Hf(s),Ss!==0&&(Ss=0)}function RT(s,l){for(var m=s.suspendedLanes,g=s.pingedLanes,w=s.expirationTimes,_=s.pendingLanes&-62914561;0<_;){var R=31-yt(_),$=1<<R,H=w[R];H===-1?(($&m)===0||($&g)!==0)&&(w[R]=ir($,l)):H<=l&&(s.expiredLanes|=$),_&=~$}if(l=Wt,m=Rt,m=ot(s,s===l?m:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g=s.callbackNode,m===0||s===l&&(Vt===2||Vt===9)||s.cancelPendingCommit!==null)return g!==null&&g!==null&&oe(g),s.callbackNode=null,s.callbackPriority=0;if((m&3)===0||vn(s,m)){if(l=m&-m,l===s.callbackPriority)return l;switch(g!==null&&oe(g),xo(m)){case 2:case 8:m=ye;break;case 32:m=Te;break;case 268435456:m=st;break;default:m=Te}return g=IT.bind(null,s),m=q(m,g),s.callbackPriority=l,s.callbackNode=m,l}return g!==null&&g!==null&&oe(g),s.callbackPriority=2,s.callbackNode=null,2}function IT(s,l){if(Xn!==0&&Xn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var m=s.callbackNode;if(ng()&&s.callbackNode!==m)return null;var g=Rt;return g=ot(s,s===Wt?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g===0?null:(uT(s,g,l),RT(s,ve()),s.callbackNode!=null&&s.callbackNode===m?IT.bind(null,s):null)}function NT(s,l){if(ng())return null;uT(s,l,!0)}function aq(){yq(function(){(Pt&6)!==0?q(ne,oq):jT()})}function gw(){if(Ss===0){var s=uu;s===0&&(s=Bc,Bc<<=1,(Bc&261888)===0&&(Bc=256)),Ss=s}return Ss}function TT(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:fh(""+s)}function AT(s,l){var m=l.ownerDocument.createElement("input");return m.name=l.name,m.value=l.value,s.id&&m.setAttribute("form",s.id),l.parentNode.insertBefore(m,l),s=new FormData(s),m.parentNode.removeChild(m),s}function sq(s,l,m,g,w){if(l==="submit"&&m&&m.stateNode===w){var _=TT((w[Zr]||null).action),R=g.submitter;R&&(l=(l=R[Zr]||null)?TT(l.formAction):R.getAttribute("formAction"),l!==null&&(_=l,R=null));var $=new gh("action","action",null,g,w);s.push({event:$,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(Ss!==0){var H=R?AT(w,R):new FormData(w);M0(m,{pending:!0,data:H,method:w.method,action:_},null,H)}}else typeof _=="function"&&($.preventDefault(),H=R?AT(w,R):new FormData(w),M0(m,{pending:!0,data:H,method:w.method,action:_},_,H))},currentTarget:w}]})}}for(var vw=0;vw<Jx.length;vw++){var yw=Jx[vw],lq=yw.toLowerCase(),cq=yw[0].toUpperCase()+yw.slice(1);wo(lq,"on"+cq)}wo(cI,"onAnimationEnd"),wo(uI,"onAnimationIteration"),wo(dI,"onAnimationStart"),wo("dblclick","onDoubleClick"),wo("focusin","onFocus"),wo("focusout","onBlur"),wo(E7,"onTransitionRun"),wo(k7,"onTransitionStart"),wo(j7,"onTransitionCancel"),wo(fI,"onTransitionEnd"),Wc("onMouseEnter",["mouseout","mouseover"]),Wc("onMouseLeave",["mouseout","mouseover"]),Wc("onPointerEnter",["pointerout","pointerover"]),Wc("onPointerLeave",["pointerout","pointerover"]),wl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),wl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),wl("onBeforeInput",["compositionend","keypress","textInput","paste"]),wl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),wl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),wl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qf="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),uq=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(qf));function OT(s,l){l=(l&4)!==0;for(var m=0;m<s.length;m++){var g=s[m],w=g.event;g=g.listeners;e:{var _=void 0;if(l)for(var R=g.length-1;0<=R;R--){var $=g[R],H=$.instance,le=$.currentTarget;if($=$.listener,H!==_&&w.isPropagationStopped())break e;_=$,w.currentTarget=le;try{_(w)}catch(he){bh(he)}w.currentTarget=null,_=H}else for(R=0;R<g.length;R++){if($=g[R],H=$.instance,le=$.currentTarget,$=$.listener,H!==_&&w.isPropagationStopped())break e;_=$,w.currentTarget=le;try{_(w)}catch(he){bh(he)}w.currentTarget=null,_=H}}}}function kt(s,l){var m=l[Tx];m===void 0&&(m=l[Tx]=new Set);var g=s+"__bubble";m.has(g)||(DT(l,s,2,!1),m.add(g))}function bw(s,l,m){var g=0;l&&(g|=4),DT(m,s,g,l)}var og="_reactListening"+Math.random().toString(36).slice(2);function xw(s){if(!s[og]){s[og]=!0,jR.forEach(function(m){m!=="selectionchange"&&(uq.has(m)||bw(m,!1,s),bw(m,!0,s))});var l=s.nodeType===9?s:s.ownerDocument;l===null||l[og]||(l[og]=!0,bw("selectionchange",!1,l))}}function DT(s,l,m,g){switch(cA(l)){case 2:var w=zq;break;case 8:w=Lq;break;default:w=$w}m=w.bind(null,l,m,s),w=void 0,!Ux||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(w=!0),g?w!==void 0?s.addEventListener(l,m,{capture:!0,passive:w}):s.addEventListener(l,m,!0):w!==void 0?s.addEventListener(l,m,{passive:w}):s.addEventListener(l,m,!1)}function ww(s,l,m,g,w){var _=g;if((l&1)===0&&(l&2)===0&&g!==null)e:for(;;){if(g===null)return;var R=g.tag;if(R===3||R===4){var $=g.stateNode.containerInfo;if($===w)break;if(R===4)for(R=g.return;R!==null;){var H=R.tag;if((H===3||H===4)&&R.stateNode.containerInfo===w)return;R=R.return}for(;$!==null;){if(R=Kc($),R===null)return;if(H=R.tag,H===5||H===6||H===26||H===27){g=_=R;continue e}$=$.parentNode}}g=g.return}LR(function(){var le=_,he=zx(m),xe=[];e:{var ce=mI.get(s);if(ce!==void 0){var me=gh,Ve=s;switch(s){case"keypress":if(ph(m)===0)break e;case"keydown":case"keyup":me=r7;break;case"focusin":Ve="focus",me=Hx;break;case"focusout":Ve="blur",me=Hx;break;case"beforeblur":case"afterblur":me=Hx;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=VR;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=q9;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=a7;break;case cI:case uI:case dI:me=Z9;break;case fI:me=l7;break;case"scroll":case"scrollend":me=B9;break;case"wheel":me=u7;break;case"copy":case"cut":case"paste":me=W9;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=HR;break;case"toggle":case"beforetoggle":me=f7}var Xe=(l&4)!==0,Zt=!Xe&&(s==="scroll"||s==="scrollend"),re=Xe?ce!==null?ce+"Capture":null:ce;Xe=[];for(var Q=le,se;Q!==null;){var ge=Q;if(se=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||se===null||re===null||(ge=mf(Q,re),ge!=null&&Xe.push(Gf(Q,ge,se))),Zt)break;Q=Q.return}0<Xe.length&&(ce=new me(ce,Ve,null,m,he),xe.push({event:ce,listeners:Xe}))}}if((l&7)===0){e:{if(ce=s==="mouseover"||s==="pointerover",me=s==="mouseout"||s==="pointerout",ce&&m!==Px&&(Ve=m.relatedTarget||m.fromElement)&&(Kc(Ve)||Ve[Gc]))break e;if((me||ce)&&(ce=he.window===he?he:(ce=he.ownerDocument)?ce.defaultView||ce.parentWindow:window,me?(Ve=m.relatedTarget||m.toElement,me=le,Ve=Ve?Kc(Ve):null,Ve!==null&&(Zt=o(Ve),Xe=Ve.tag,Ve!==Zt||Xe!==5&&Xe!==27&&Xe!==6)&&(Ve=null)):(me=null,Ve=le),me!==Ve)){if(Xe=VR,ge="onMouseLeave",re="onMouseEnter",Q="mouse",(s==="pointerout"||s==="pointerover")&&(Xe=HR,ge="onPointerLeave",re="onPointerEnter",Q="pointer"),Zt=me==null?ce:ff(me),se=Ve==null?ce:ff(Ve),ce=new Xe(ge,Q+"leave",me,m,he),ce.target=Zt,ce.relatedTarget=se,ge=null,Kc(he)===le&&(Xe=new Xe(re,Q+"enter",Ve,m,he),Xe.target=se,Xe.relatedTarget=Zt,ge=Xe),Zt=ge,me&&Ve)t:{for(Xe=dq,re=me,Q=Ve,se=0,ge=re;ge;ge=Xe(ge))se++;ge=0;for(var We=Q;We;We=Xe(We))ge++;for(;0<se-ge;)re=Xe(re),se--;for(;0<ge-se;)Q=Xe(Q),ge--;for(;se--;){if(re===Q||Q!==null&&re===Q.alternate){Xe=re;break t}re=Xe(re),Q=Xe(Q)}Xe=null}else Xe=null;me!==null&&$T(xe,ce,me,Xe,!1),Ve!==null&&Zt!==null&&$T(xe,Zt,Ve,Xe,!0)}}e:{if(ce=le?ff(le):window,me=ce.nodeName&&ce.nodeName.toLowerCase(),me==="select"||me==="input"&&ce.type==="file")var Ot=QR;else if(WR(ce))if(JR)Ot=S7;else{Ot=x7;var qe=b7}else me=ce.nodeName,!me||me.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?le&&Mx(le.elementType)&&(Ot=QR):Ot=w7;if(Ot&&(Ot=Ot(s,le))){XR(xe,Ot,m,he);break e}qe&&qe(s,ce,le),s==="focusout"&&le&&ce.type==="number"&&le.memoizedProps.value!=null&&$x(ce,"number",ce.value)}switch(qe=le?ff(le):window,s){case"focusin":(WR(qe)||qe.contentEditable==="true")&&(nu=qe,Wx=le,wf=null);break;case"focusout":wf=Wx=nu=null;break;case"mousedown":Xx=!0;break;case"contextmenu":case"mouseup":case"dragend":Xx=!1,sI(xe,m,he);break;case"selectionchange":if(C7)break;case"keydown":case"keyup":sI(xe,m,he)}var pt;if(Gx)e:{switch(s){case"compositionstart":var It="onCompositionStart";break e;case"compositionend":It="onCompositionEnd";break e;case"compositionupdate":It="onCompositionUpdate";break e}It=void 0}else tu?ZR(s,m)&&(It="onCompositionEnd"):s==="keydown"&&m.keyCode===229&&(It="onCompositionStart");It&&(qR&&m.locale!=="ko"&&(tu||It!=="onCompositionStart"?It==="onCompositionEnd"&&tu&&(pt=UR()):(as=he,Fx="value"in as?as.value:as.textContent,tu=!0)),qe=ag(le,It),0<qe.length&&(It=new BR(It,s,null,m,he),xe.push({event:It,listeners:qe}),pt?It.data=pt:(pt=YR(m),pt!==null&&(It.data=pt)))),(pt=p7?h7(s,m):g7(s,m))&&(It=ag(le,"onBeforeInput"),0<It.length&&(qe=new BR("onBeforeInput","beforeinput",null,m,he),xe.push({event:qe,listeners:It}),qe.data=pt)),sq(xe,s,le,m,he)}OT(xe,l)})}function Gf(s,l,m){return{instance:s,listener:l,currentTarget:m}}function ag(s,l){for(var m=l+"Capture",g=[];s!==null;){var w=s,_=w.stateNode;if(w=w.tag,w!==5&&w!==26&&w!==27||_===null||(w=mf(s,m),w!=null&&g.unshift(Gf(s,w,_)),w=mf(s,l),w!=null&&g.push(Gf(s,w,_))),s.tag===3)return g;s=s.return}return[]}function dq(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function $T(s,l,m,g,w){for(var _=l._reactName,R=[];m!==null&&m!==g;){var $=m,H=$.alternate,le=$.stateNode;if($=$.tag,H!==null&&H===g)break;$!==5&&$!==26&&$!==27||le===null||(H=le,w?(le=mf(m,_),le!=null&&R.unshift(Gf(m,le,H))):w||(le=mf(m,_),le!=null&&R.push(Gf(m,le,H)))),m=m.return}R.length!==0&&s.push({event:l,listeners:R})}var fq=/\r\n?/g,mq=/\u0000|\uFFFD/g;function MT(s){return(typeof s=="string"?s:""+s).replace(fq,`
|
|
203
|
-
`).replace(mq,"")}function PT(s,l){return l=MT(l),MT(s)===l}function Kt(s,l,m,g,w,_){switch(m){case"children":typeof g=="string"?l==="body"||l==="textarea"&&g===""||Qc(s,g):(typeof g=="number"||typeof g=="bigint")&&l!=="body"&&Qc(s,""+g);break;case"className":uh(s,"class",g);break;case"tabIndex":uh(s,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":uh(s,m,g);break;case"style":PR(s,g,_);break;case"data":if(l!=="object"){uh(s,"data",g);break}case"src":case"href":if(g===""&&(l!=="a"||m!=="href")){s.removeAttribute(m);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(m);break}g=fh(""+g),s.setAttribute(m,g);break;case"action":case"formAction":if(typeof g=="function"){s.setAttribute(m,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof _=="function"&&(m==="formAction"?(l!=="input"&&Kt(s,l,"name",w.name,w,null),Kt(s,l,"formEncType",w.formEncType,w,null),Kt(s,l,"formMethod",w.formMethod,w,null),Kt(s,l,"formTarget",w.formTarget,w,null)):(Kt(s,l,"encType",w.encType,w,null),Kt(s,l,"method",w.method,w,null),Kt(s,l,"target",w.target,w,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(m);break}g=fh(""+g),s.setAttribute(m,g);break;case"onClick":g!=null&&(s.onclick=va);break;case"onScroll":g!=null&&kt("scroll",s);break;case"onScrollEnd":g!=null&&kt("scrollend",s);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(m=g.__html,m!=null){if(w.children!=null)throw Error(r(60));s.innerHTML=m}}break;case"multiple":s.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":s.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){s.removeAttribute("xlink:href");break}m=fh(""+g),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",m);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(m,""+g):s.removeAttribute(m);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(m,""):s.removeAttribute(m);break;case"capture":case"download":g===!0?s.setAttribute(m,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(m,g):s.removeAttribute(m);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?s.setAttribute(m,g):s.removeAttribute(m);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?s.removeAttribute(m):s.setAttribute(m,g);break;case"popover":kt("beforetoggle",s),kt("toggle",s),ch(s,"popover",g);break;case"xlinkActuate":ga(s,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":ga(s,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":ga(s,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":ga(s,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":ga(s,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":ga(s,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":ga(s,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":ga(s,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":ga(s,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":ch(s,"is",g);break;case"innerText":case"textContent":break;default:(!(2<m.length)||m[0]!=="o"&&m[0]!=="O"||m[1]!=="n"&&m[1]!=="N")&&(m=F9.get(m)||m,ch(s,m,g))}}function Sw(s,l,m,g,w,_){switch(m){case"style":PR(s,g,_);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(m=g.__html,m!=null){if(w.children!=null)throw Error(r(60));s.innerHTML=m}}break;case"children":typeof g=="string"?Qc(s,g):(typeof g=="number"||typeof g=="bigint")&&Qc(s,""+g);break;case"onScroll":g!=null&&kt("scroll",s);break;case"onScrollEnd":g!=null&&kt("scrollend",s);break;case"onClick":g!=null&&(s.onclick=va);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!RR.hasOwnProperty(m))e:{if(m[0]==="o"&&m[1]==="n"&&(w=m.endsWith("Capture"),l=m.slice(2,w?m.length-7:void 0),_=s[Zr]||null,_=_!=null?_[m]:null,typeof _=="function"&&s.removeEventListener(l,_,w),typeof g=="function")){typeof _!="function"&&_!==null&&(m in s?s[m]=null:s.hasAttribute(m)&&s.removeAttribute(m)),s.addEventListener(l,g,w);break e}m in s?s[m]=g:g===!0?s.setAttribute(m,""):ch(s,m,g)}}}function mr(s,l,m){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":kt("error",s),kt("load",s);var g=!1,w=!1,_;for(_ in m)if(m.hasOwnProperty(_)){var R=m[_];if(R!=null)switch(_){case"src":g=!0;break;case"srcSet":w=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Kt(s,l,_,R,m,null)}}w&&Kt(s,l,"srcSet",m.srcSet,m,null),g&&Kt(s,l,"src",m.src,m,null);return;case"input":kt("invalid",s);var $=_=R=w=null,H=null,le=null;for(g in m)if(m.hasOwnProperty(g)){var he=m[g];if(he!=null)switch(g){case"name":w=he;break;case"type":R=he;break;case"checked":H=he;break;case"defaultChecked":le=he;break;case"value":_=he;break;case"defaultValue":$=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,l));break;default:Kt(s,l,g,he,m,null)}}OR(s,_,$,H,le,R,w,!1);return;case"select":kt("invalid",s),g=R=_=null;for(w in m)if(m.hasOwnProperty(w)&&($=m[w],$!=null))switch(w){case"value":_=$;break;case"defaultValue":R=$;break;case"multiple":g=$;default:Kt(s,l,w,$,m,null)}l=_,m=R,s.multiple=!!g,l!=null?Xc(s,!!g,l,!1):m!=null&&Xc(s,!!g,m,!0);return;case"textarea":kt("invalid",s),_=w=g=null;for(R in m)if(m.hasOwnProperty(R)&&($=m[R],$!=null))switch(R){case"value":g=$;break;case"defaultValue":w=$;break;case"children":_=$;break;case"dangerouslySetInnerHTML":if($!=null)throw Error(r(91));break;default:Kt(s,l,R,$,m,null)}$R(s,g,w,_);return;case"option":for(H in m)if(m.hasOwnProperty(H)&&(g=m[H],g!=null))switch(H){case"selected":s.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:Kt(s,l,H,g,m,null)}return;case"dialog":kt("beforetoggle",s),kt("toggle",s),kt("cancel",s),kt("close",s);break;case"iframe":case"object":kt("load",s);break;case"video":case"audio":for(g=0;g<qf.length;g++)kt(qf[g],s);break;case"image":kt("error",s),kt("load",s);break;case"details":kt("toggle",s);break;case"embed":case"source":case"link":kt("error",s),kt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(le in m)if(m.hasOwnProperty(le)&&(g=m[le],g!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Kt(s,l,le,g,m,null)}return;default:if(Mx(l)){for(he in m)m.hasOwnProperty(he)&&(g=m[he],g!==void 0&&Sw(s,l,he,g,m,void 0));return}}for($ in m)m.hasOwnProperty($)&&(g=m[$],g!=null&&Kt(s,l,$,g,m,null))}function pq(s,l,m,g){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var w=null,_=null,R=null,$=null,H=null,le=null,he=null;for(me in m){var xe=m[me];if(m.hasOwnProperty(me)&&xe!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":H=xe;default:g.hasOwnProperty(me)||Kt(s,l,me,null,g,xe)}}for(var ce in g){var me=g[ce];if(xe=m[ce],g.hasOwnProperty(ce)&&(me!=null||xe!=null))switch(ce){case"type":_=me;break;case"name":w=me;break;case"checked":le=me;break;case"defaultChecked":he=me;break;case"value":R=me;break;case"defaultValue":$=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,l));break;default:me!==xe&&Kt(s,l,ce,me,g,xe)}}Dx(s,R,$,H,le,he,_,w);return;case"select":me=R=$=ce=null;for(_ in m)if(H=m[_],m.hasOwnProperty(_)&&H!=null)switch(_){case"value":break;case"multiple":me=H;default:g.hasOwnProperty(_)||Kt(s,l,_,null,g,H)}for(w in g)if(_=g[w],H=m[w],g.hasOwnProperty(w)&&(_!=null||H!=null))switch(w){case"value":ce=_;break;case"defaultValue":$=_;break;case"multiple":R=_;default:_!==H&&Kt(s,l,w,_,g,H)}l=$,m=R,g=me,ce!=null?Xc(s,!!m,ce,!1):!!g!=!!m&&(l!=null?Xc(s,!!m,l,!0):Xc(s,!!m,m?[]:"",!1));return;case"textarea":me=ce=null;for($ in m)if(w=m[$],m.hasOwnProperty($)&&w!=null&&!g.hasOwnProperty($))switch($){case"value":break;case"children":break;default:Kt(s,l,$,null,g,w)}for(R in g)if(w=g[R],_=m[R],g.hasOwnProperty(R)&&(w!=null||_!=null))switch(R){case"value":ce=w;break;case"defaultValue":me=w;break;case"children":break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(r(91));break;default:w!==_&&Kt(s,l,R,w,g,_)}DR(s,ce,me);return;case"option":for(var Ve in m)if(ce=m[Ve],m.hasOwnProperty(Ve)&&ce!=null&&!g.hasOwnProperty(Ve))switch(Ve){case"selected":s.selected=!1;break;default:Kt(s,l,Ve,null,g,ce)}for(H in g)if(ce=g[H],me=m[H],g.hasOwnProperty(H)&&ce!==me&&(ce!=null||me!=null))switch(H){case"selected":s.selected=ce&&typeof ce!="function"&&typeof ce!="symbol";break;default:Kt(s,l,H,ce,g,me)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Xe in m)ce=m[Xe],m.hasOwnProperty(Xe)&&ce!=null&&!g.hasOwnProperty(Xe)&&Kt(s,l,Xe,null,g,ce);for(le in g)if(ce=g[le],me=m[le],g.hasOwnProperty(le)&&ce!==me&&(ce!=null||me!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,l));break;default:Kt(s,l,le,ce,g,me)}return;default:if(Mx(l)){for(var Zt in m)ce=m[Zt],m.hasOwnProperty(Zt)&&ce!==void 0&&!g.hasOwnProperty(Zt)&&Sw(s,l,Zt,void 0,g,ce);for(he in g)ce=g[he],me=m[he],!g.hasOwnProperty(he)||ce===me||ce===void 0&&me===void 0||Sw(s,l,he,ce,g,me);return}}for(var re in m)ce=m[re],m.hasOwnProperty(re)&&ce!=null&&!g.hasOwnProperty(re)&&Kt(s,l,re,null,g,ce);for(xe in g)ce=g[xe],me=m[xe],!g.hasOwnProperty(xe)||ce===me||ce==null&&me==null||Kt(s,l,xe,ce,g,me)}function zT(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function hq(){if(typeof performance.getEntriesByType=="function"){for(var s=0,l=0,m=performance.getEntriesByType("resource"),g=0;g<m.length;g++){var w=m[g],_=w.transferSize,R=w.initiatorType,$=w.duration;if(_&&$&&zT(R)){for(R=0,$=w.responseEnd,g+=1;g<m.length;g++){var H=m[g],le=H.startTime;if(le>$)break;var he=H.transferSize,xe=H.initiatorType;he&&zT(xe)&&(H=H.responseEnd,R+=he*(H<$?1:($-le)/(H-le)))}if(--g,l+=8*(_+R)/(w.duration/1e3),s++,10<s)break}}if(0<s)return l/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var _w=null,Cw=null;function sg(s){return s.nodeType===9?s:s.ownerDocument}function LT(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function UT(s,l){if(s===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&l==="foreignObject"?0:s}function Ew(s,l){return s==="textarea"||s==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var kw=null;function gq(){var s=window.event;return s&&s.type==="popstate"?s===kw?!1:(kw=s,!0):(kw=null,!1)}var FT=typeof setTimeout=="function"?setTimeout:void 0,vq=typeof clearTimeout=="function"?clearTimeout:void 0,VT=typeof Promise=="function"?Promise:void 0,yq=typeof queueMicrotask=="function"?queueMicrotask:typeof VT<"u"?function(s){return VT.resolve(null).then(s).catch(bq)}:FT;function bq(s){setTimeout(function(){throw s})}function _s(s){return s==="head"}function BT(s,l){var m=l,g=0;do{var w=m.nextSibling;if(s.removeChild(m),w&&w.nodeType===8)if(m=w.data,m==="/$"||m==="/&"){if(g===0){s.removeChild(w),Iu(l);return}g--}else if(m==="$"||m==="$?"||m==="$~"||m==="$!"||m==="&")g++;else if(m==="html")Kf(s.ownerDocument.documentElement);else if(m==="head"){m=s.ownerDocument.head,Kf(m);for(var _=m.firstChild;_;){var R=_.nextSibling,$=_.nodeName;_[df]||$==="SCRIPT"||$==="STYLE"||$==="LINK"&&_.rel.toLowerCase()==="stylesheet"||m.removeChild(_),_=R}}else m==="body"&&Kf(s.ownerDocument.body);m=w}while(m);Iu(l)}function HT(s,l){var m=s;s=0;do{var g=m.nextSibling;if(m.nodeType===1?l?(m._stashedDisplay=m.style.display,m.style.display="none"):(m.style.display=m._stashedDisplay||"",m.getAttribute("style")===""&&m.removeAttribute("style")):m.nodeType===3&&(l?(m._stashedText=m.nodeValue,m.nodeValue=""):m.nodeValue=m._stashedText||""),g&&g.nodeType===8)if(m=g.data,m==="/$"){if(s===0)break;s--}else m!=="$"&&m!=="$?"&&m!=="$~"&&m!=="$!"||s++;m=g}while(m)}function jw(s){var l=s.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var m=l;switch(l=l.nextSibling,m.nodeName){case"HTML":case"HEAD":case"BODY":jw(m),Ax(m);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(m.rel.toLowerCase()==="stylesheet")continue}s.removeChild(m)}}function xq(s,l,m,g){for(;s.nodeType===1;){var w=m;if(s.nodeName.toLowerCase()!==l.toLowerCase()){if(!g&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(g){if(!s[df])switch(l){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(_=s.getAttribute("rel"),_==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(_!==w.rel||s.getAttribute("href")!==(w.href==null||w.href===""?null:w.href)||s.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin)||s.getAttribute("title")!==(w.title==null?null:w.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(_=s.getAttribute("src"),(_!==(w.src==null?null:w.src)||s.getAttribute("type")!==(w.type==null?null:w.type)||s.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin))&&_&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(l==="input"&&s.type==="hidden"){var _=w.name==null?null:""+w.name;if(w.type==="hidden"&&s.getAttribute("name")===_)return s}else return s;if(s=Yi(s.nextSibling),s===null)break}return null}function wq(s,l,m){if(l==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!m||(s=Yi(s.nextSibling),s===null))return null;return s}function qT(s,l){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!l||(s=Yi(s.nextSibling),s===null))return null;return s}function Rw(s){return s.data==="$?"||s.data==="$~"}function Iw(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function Sq(s,l){var m=s.ownerDocument;if(s.data==="$~")s._reactRetry=l;else if(s.data!=="$?"||m.readyState!=="loading")l();else{var g=function(){l(),m.removeEventListener("DOMContentLoaded",g)};m.addEventListener("DOMContentLoaded",g),s._reactRetry=g}}function Yi(s){for(;s!=null;s=s.nextSibling){var l=s.nodeType;if(l===1||l===3)break;if(l===8){if(l=s.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return s}var Nw=null;function GT(s){s=s.nextSibling;for(var l=0;s;){if(s.nodeType===8){var m=s.data;if(m==="/$"||m==="/&"){if(l===0)return Yi(s.nextSibling);l--}else m!=="$"&&m!=="$!"&&m!=="$?"&&m!=="$~"&&m!=="&"||l++}s=s.nextSibling}return null}function KT(s){s=s.previousSibling;for(var l=0;s;){if(s.nodeType===8){var m=s.data;if(m==="$"||m==="$!"||m==="$?"||m==="$~"||m==="&"){if(l===0)return s;l--}else m!=="/$"&&m!=="/&"||l++}s=s.previousSibling}return null}function ZT(s,l,m){switch(l=sg(m),s){case"html":if(s=l.documentElement,!s)throw Error(r(452));return s;case"head":if(s=l.head,!s)throw Error(r(453));return s;case"body":if(s=l.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function Kf(s){for(var l=s.attributes;l.length;)s.removeAttributeNode(l[0]);Ax(s)}var Wi=new Map,YT=new Set;function lg(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Oa=K.d;K.d={f:_q,r:Cq,D:Eq,C:kq,L:jq,m:Rq,X:Nq,S:Iq,M:Tq};function _q(){var s=Oa.f(),l=Jh();return s||l}function Cq(s){var l=Zc(s);l!==null&&l.tag===5&&l.type==="form"?fN(l):Oa.r(s)}var ku=typeof document>"u"?null:document;function WT(s,l,m){var g=ku;if(g&&typeof l=="string"&&l){var w=Vi(l);w='link[rel="'+s+'"][href="'+w+'"]',typeof m=="string"&&(w+='[crossorigin="'+m+'"]'),YT.has(w)||(YT.add(w),s={rel:s,crossOrigin:m,href:l},g.querySelector(w)===null&&(l=g.createElement("link"),mr(l,"link",s),or(l),g.head.appendChild(l)))}}function Eq(s){Oa.D(s),WT("dns-prefetch",s,null)}function kq(s,l){Oa.C(s,l),WT("preconnect",s,l)}function jq(s,l,m){Oa.L(s,l,m);var g=ku;if(g&&s&&l){var w='link[rel="preload"][as="'+Vi(l)+'"]';l==="image"&&m&&m.imageSrcSet?(w+='[imagesrcset="'+Vi(m.imageSrcSet)+'"]',typeof m.imageSizes=="string"&&(w+='[imagesizes="'+Vi(m.imageSizes)+'"]')):w+='[href="'+Vi(s)+'"]';var _=w;switch(l){case"style":_=ju(s);break;case"script":_=Ru(s)}Wi.has(_)||(s=h({rel:"preload",href:l==="image"&&m&&m.imageSrcSet?void 0:s,as:l},m),Wi.set(_,s),g.querySelector(w)!==null||l==="style"&&g.querySelector(Zf(_))||l==="script"&&g.querySelector(Yf(_))||(l=g.createElement("link"),mr(l,"link",s),or(l),g.head.appendChild(l)))}}function Rq(s,l){Oa.m(s,l);var m=ku;if(m&&s){var g=l&&typeof l.as=="string"?l.as:"script",w='link[rel="modulepreload"][as="'+Vi(g)+'"][href="'+Vi(s)+'"]',_=w;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=Ru(s)}if(!Wi.has(_)&&(s=h({rel:"modulepreload",href:s},l),Wi.set(_,s),m.querySelector(w)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(m.querySelector(Yf(_)))return}g=m.createElement("link"),mr(g,"link",s),or(g),m.head.appendChild(g)}}}function Iq(s,l,m){Oa.S(s,l,m);var g=ku;if(g&&s){var w=Yc(g).hoistableStyles,_=ju(s);l=l||"default";var R=w.get(_);if(!R){var $={loading:0,preload:null};if(R=g.querySelector(Zf(_)))$.loading=5;else{s=h({rel:"stylesheet",href:s,"data-precedence":l},m),(m=Wi.get(_))&&Tw(s,m);var H=R=g.createElement("link");or(H),mr(H,"link",s),H._p=new Promise(function(le,he){H.onload=le,H.onerror=he}),H.addEventListener("load",function(){$.loading|=1}),H.addEventListener("error",function(){$.loading|=2}),$.loading|=4,cg(R,l,g)}R={type:"stylesheet",instance:R,count:1,state:$},w.set(_,R)}}}function Nq(s,l){Oa.X(s,l);var m=ku;if(m&&s){var g=Yc(m).hoistableScripts,w=Ru(s),_=g.get(w);_||(_=m.querySelector(Yf(w)),_||(s=h({src:s,async:!0},l),(l=Wi.get(w))&&Aw(s,l),_=m.createElement("script"),or(_),mr(_,"link",s),m.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},g.set(w,_))}}function Tq(s,l){Oa.M(s,l);var m=ku;if(m&&s){var g=Yc(m).hoistableScripts,w=Ru(s),_=g.get(w);_||(_=m.querySelector(Yf(w)),_||(s=h({src:s,async:!0,type:"module"},l),(l=Wi.get(w))&&Aw(s,l),_=m.createElement("script"),or(_),mr(_,"link",s),m.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},g.set(w,_))}}function XT(s,l,m,g){var w=(w=pe.current)?lg(w):null;if(!w)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof m.precedence=="string"&&typeof m.href=="string"?(l=ju(m.href),m=Yc(w).hoistableStyles,g=m.get(l),g||(g={type:"style",instance:null,count:0,state:null},m.set(l,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(m.rel==="stylesheet"&&typeof m.href=="string"&&typeof m.precedence=="string"){s=ju(m.href);var _=Yc(w).hoistableStyles,R=_.get(s);if(R||(w=w.ownerDocument||w,R={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(s,R),(_=w.querySelector(Zf(s)))&&!_._p&&(R.instance=_,R.state.loading=5),Wi.has(s)||(m={rel:"preload",as:"style",href:m.href,crossOrigin:m.crossOrigin,integrity:m.integrity,media:m.media,hrefLang:m.hrefLang,referrerPolicy:m.referrerPolicy},Wi.set(s,m),_||Aq(w,s,m,R.state))),l&&g===null)throw Error(r(528,""));return R}if(l&&g!==null)throw Error(r(529,""));return null;case"script":return l=m.async,m=m.src,typeof m=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Ru(m),m=Yc(w).hoistableScripts,g=m.get(l),g||(g={type:"script",instance:null,count:0,state:null},m.set(l,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function ju(s){return'href="'+Vi(s)+'"'}function Zf(s){return'link[rel="stylesheet"]['+s+"]"}function QT(s){return h({},s,{"data-precedence":s.precedence,precedence:null})}function Aq(s,l,m,g){s.querySelector('link[rel="preload"][as="style"]['+l+"]")?g.loading=1:(l=s.createElement("link"),g.preload=l,l.addEventListener("load",function(){return g.loading|=1}),l.addEventListener("error",function(){return g.loading|=2}),mr(l,"link",m),or(l),s.head.appendChild(l))}function Ru(s){return'[src="'+Vi(s)+'"]'}function Yf(s){return"script[async]"+s}function JT(s,l,m){if(l.count++,l.instance===null)switch(l.type){case"style":var g=s.querySelector('style[data-href~="'+Vi(m.href)+'"]');if(g)return l.instance=g,or(g),g;var w=h({},m,{"data-href":m.href,"data-precedence":m.precedence,href:null,precedence:null});return g=(s.ownerDocument||s).createElement("style"),or(g),mr(g,"style",w),cg(g,m.precedence,s),l.instance=g;case"stylesheet":w=ju(m.href);var _=s.querySelector(Zf(w));if(_)return l.state.loading|=4,l.instance=_,or(_),_;g=QT(m),(w=Wi.get(w))&&Tw(g,w),_=(s.ownerDocument||s).createElement("link"),or(_);var R=_;return R._p=new Promise(function($,H){R.onload=$,R.onerror=H}),mr(_,"link",g),l.state.loading|=4,cg(_,m.precedence,s),l.instance=_;case"script":return _=Ru(m.src),(w=s.querySelector(Yf(_)))?(l.instance=w,or(w),w):(g=m,(w=Wi.get(_))&&(g=h({},m),Aw(g,w)),s=s.ownerDocument||s,w=s.createElement("script"),or(w),mr(w,"link",g),s.head.appendChild(w),l.instance=w);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(g=l.instance,l.state.loading|=4,cg(g,m.precedence,s));return l.instance}function cg(s,l,m){for(var g=m.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),w=g.length?g[g.length-1]:null,_=w,R=0;R<g.length;R++){var $=g[R];if($.dataset.precedence===l)_=$;else if(_!==w)break}_?_.parentNode.insertBefore(s,_.nextSibling):(l=m.nodeType===9?m.head:m,l.insertBefore(s,l.firstChild))}function Tw(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.title==null&&(s.title=l.title)}function Aw(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.integrity==null&&(s.integrity=l.integrity)}var ug=null;function eA(s,l,m){if(ug===null){var g=new Map,w=ug=new Map;w.set(m,g)}else w=ug,g=w.get(m),g||(g=new Map,w.set(m,g));if(g.has(s))return g;for(g.set(s,null),m=m.getElementsByTagName(s),w=0;w<m.length;w++){var _=m[w];if(!(_[df]||_[cr]||s==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var R=_.getAttribute(l)||"";R=s+R;var $=g.get(R);$?$.push(_):g.set(R,[_])}}return g}function tA(s,l,m){s=s.ownerDocument||s,s.head.insertBefore(m,l==="title"?s.querySelector("head > title"):null)}function Oq(s,l,m){if(m===1||l.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return s=l.disabled,typeof l.precedence=="string"&&s==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function nA(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function Dq(s,l,m,g){if(m.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(m.state.loading&4)===0){if(m.instance===null){var w=ju(g.href),_=l.querySelector(Zf(w));if(_){l=_._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(s.count++,s=dg.bind(s),l.then(s,s)),m.state.loading|=4,m.instance=_,or(_);return}_=l.ownerDocument||l,g=QT(g),(w=Wi.get(w))&&Tw(g,w),_=_.createElement("link"),or(_);var R=_;R._p=new Promise(function($,H){R.onload=$,R.onerror=H}),mr(_,"link",g),m.instance=_}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(m,l),(l=m.state.preload)&&(m.state.loading&3)===0&&(s.count++,m=dg.bind(s),l.addEventListener("load",m),l.addEventListener("error",m))}}var Ow=0;function $q(s,l){return s.stylesheets&&s.count===0&&mg(s,s.stylesheets),0<s.count||0<s.imgCount?function(m){var g=setTimeout(function(){if(s.stylesheets&&mg(s,s.stylesheets),s.unsuspend){var _=s.unsuspend;s.unsuspend=null,_()}},6e4+l);0<s.imgBytes&&Ow===0&&(Ow=62500*hq());var w=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&mg(s,s.stylesheets),s.unsuspend)){var _=s.unsuspend;s.unsuspend=null,_()}},(s.imgBytes>Ow?50:800)+l);return s.unsuspend=m,function(){s.unsuspend=null,clearTimeout(g),clearTimeout(w)}}:null}function dg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)mg(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var fg=null;function mg(s,l){s.stylesheets=null,s.unsuspend!==null&&(s.count++,fg=new Map,l.forEach(Mq,s),fg=null,dg.call(s))}function Mq(s,l){if(!(l.state.loading&4)){var m=fg.get(s);if(m)var g=m.get(null);else{m=new Map,fg.set(s,m);for(var w=s.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<w.length;_++){var R=w[_];(R.nodeName==="LINK"||R.getAttribute("media")!=="not all")&&(m.set(R.dataset.precedence,R),g=R)}g&&m.set(null,g)}w=l.instance,R=w.getAttribute("data-precedence"),_=m.get(R)||g,_===g&&m.set(null,w),m.set(R,w),this.count++,g=dg.bind(this),w.addEventListener("load",g),w.addEventListener("error",g),_?_.parentNode.insertBefore(w,_.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(w,s.firstChild)),l.state.loading|=4}}var Wf={$$typeof:j,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function Pq(s,l,m,g,w,_,R,$,H){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=is(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=is(0),this.hiddenUpdates=is(null),this.identifierPrefix=g,this.onUncaughtError=w,this.onCaughtError=_,this.onRecoverableError=R,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.incompleteTransitions=new Map}function rA(s,l,m,g,w,_,R,$,H,le,he,xe){return s=new Pq(s,l,m,R,H,le,he,xe,$),l=1,_===!0&&(l|=24),_=vi(3,null,null,l),s.current=_,_.stateNode=s,l=f0(),l.refCount++,s.pooledCache=l,l.refCount++,_.memoizedState={element:g,isDehydrated:m,cache:l},g0(_),s}function iA(s){return s?(s=ou,s):ou}function oA(s,l,m,g,w,_){w=iA(w),g.context===null?g.context=w:g.pendingContext=w,g=fs(l),g.payload={element:m},_=_===void 0?null:_,_!==null&&(g.callback=_),m=ms(s,g,l),m!==null&&(ei(m,s,l),Rf(m,s,l))}function aA(s,l){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var m=s.retryLane;s.retryLane=m!==0&&m<l?m:l}}function Dw(s,l){aA(s,l),(s=s.alternate)&&aA(s,l)}function sA(s){if(s.tag===13||s.tag===31){var l=El(s,67108864);l!==null&&ei(l,s,67108864),Dw(s,67108864)}}function lA(s){if(s.tag===13||s.tag===31){var l=Si();l=qc(l);var m=El(s,l);m!==null&&ei(m,s,l),Dw(s,l)}}var pg=!0;function zq(s,l,m,g){var w=M.T;M.T=null;var _=K.p;try{K.p=2,$w(s,l,m,g)}finally{K.p=_,M.T=w}}function Lq(s,l,m,g){var w=M.T;M.T=null;var _=K.p;try{K.p=8,$w(s,l,m,g)}finally{K.p=_,M.T=w}}function $w(s,l,m,g){if(pg){var w=Mw(g);if(w===null)ww(s,l,g,hg,m),uA(s,g);else if(Fq(w,s,l,m,g))g.stopPropagation();else if(uA(s,g),l&4&&-1<Uq.indexOf(s)){for(;w!==null;){var _=Zc(w);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var R=Bo(_.pendingLanes);if(R!==0){var $=_;for($.pendingLanes|=2,$.entangledLanes|=2;R;){var H=1<<31-yt(R);$.entanglements[1]|=H,R&=~H}Ko(_),(Pt&6)===0&&(Xh=ve()+500,Hf(0))}}break;case 31:case 13:$=El(_,2),$!==null&&ei($,_,2),Jh(),Dw(_,2)}if(_=Mw(g),_===null&&ww(s,l,g,hg,m),_===w)break;w=_}w!==null&&g.stopPropagation()}else ww(s,l,g,null,m)}}function Mw(s){return s=zx(s),Pw(s)}var hg=null;function Pw(s){if(hg=null,s=Kc(s),s!==null){var l=o(s);if(l===null)s=null;else{var m=l.tag;if(m===13){if(s=a(l),s!==null)return s;s=null}else if(m===31){if(s=c(l),s!==null)return s;s=null}else if(m===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;s=null}else l!==s&&(s=null)}}return hg=s,null}function cA(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ee()){case ne:return 2;case ye:return 8;case Te:case Ze:return 32;case st:return 268435456;default:return 32}default:return 32}}var zw=!1,Cs=null,Es=null,ks=null,Xf=new Map,Qf=new Map,js=[],Uq="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function uA(s,l){switch(s){case"focusin":case"focusout":Cs=null;break;case"dragenter":case"dragleave":Es=null;break;case"mouseover":case"mouseout":ks=null;break;case"pointerover":case"pointerout":Xf.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qf.delete(l.pointerId)}}function Jf(s,l,m,g,w,_){return s===null||s.nativeEvent!==_?(s={blockedOn:l,domEventName:m,eventSystemFlags:g,nativeEvent:_,targetContainers:[w]},l!==null&&(l=Zc(l),l!==null&&sA(l)),s):(s.eventSystemFlags|=g,l=s.targetContainers,w!==null&&l.indexOf(w)===-1&&l.push(w),s)}function Fq(s,l,m,g,w){switch(l){case"focusin":return Cs=Jf(Cs,s,l,m,g,w),!0;case"dragenter":return Es=Jf(Es,s,l,m,g,w),!0;case"mouseover":return ks=Jf(ks,s,l,m,g,w),!0;case"pointerover":var _=w.pointerId;return Xf.set(_,Jf(Xf.get(_)||null,s,l,m,g,w)),!0;case"gotpointercapture":return _=w.pointerId,Qf.set(_,Jf(Qf.get(_)||null,s,l,m,g,w)),!0}return!1}function dA(s){var l=Kc(s.target);if(l!==null){var m=o(l);if(m!==null){if(l=m.tag,l===13){if(l=a(m),l!==null){s.blockedOn=l,ER(s.priority,function(){lA(m)});return}}else if(l===31){if(l=c(m),l!==null){s.blockedOn=l,ER(s.priority,function(){lA(m)});return}}else if(l===3&&m.stateNode.current.memoizedState.isDehydrated){s.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}s.blockedOn=null}function gg(s){if(s.blockedOn!==null)return!1;for(var l=s.targetContainers;0<l.length;){var m=Mw(s.nativeEvent);if(m===null){m=s.nativeEvent;var g=new m.constructor(m.type,m);Px=g,m.target.dispatchEvent(g),Px=null}else return l=Zc(m),l!==null&&sA(l),s.blockedOn=m,!1;l.shift()}return!0}function fA(s,l,m){gg(s)&&m.delete(l)}function Vq(){zw=!1,Cs!==null&&gg(Cs)&&(Cs=null),Es!==null&&gg(Es)&&(Es=null),ks!==null&&gg(ks)&&(ks=null),Xf.forEach(fA),Qf.forEach(fA)}function vg(s,l){s.blockedOn===l&&(s.blockedOn=null,zw||(zw=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Vq)))}var yg=null;function mA(s){yg!==s&&(yg=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){yg===s&&(yg=null);for(var l=0;l<s.length;l+=3){var m=s[l],g=s[l+1],w=s[l+2];if(typeof g!="function"){if(Pw(g||m)===null)continue;break}var _=Zc(m);_!==null&&(s.splice(l,3),l-=3,M0(_,{pending:!0,data:w,method:m.method,action:g},g,w))}}))}function Iu(s){function l(H){return vg(H,s)}Cs!==null&&vg(Cs,s),Es!==null&&vg(Es,s),ks!==null&&vg(ks,s),Xf.forEach(l),Qf.forEach(l);for(var m=0;m<js.length;m++){var g=js[m];g.blockedOn===s&&(g.blockedOn=null)}for(;0<js.length&&(m=js[0],m.blockedOn===null);)dA(m),m.blockedOn===null&&js.shift();if(m=(s.ownerDocument||s).$$reactFormReplay,m!=null)for(g=0;g<m.length;g+=3){var w=m[g],_=m[g+1],R=w[Zr]||null;if(typeof _=="function")R||mA(m);else if(R){var $=null;if(_&&_.hasAttribute("formAction")){if(w=_,R=_[Zr]||null)$=R.formAction;else if(Pw(w)!==null)continue}else $=R.action;typeof $=="function"?m[g+1]=$:(m.splice(g,3),g-=3),mA(m)}}}function pA(){function s(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(R){return w=R})},focusReset:"manual",scroll:"manual"})}function l(){w!==null&&(w(),w=null),g||setTimeout(m,20)}function m(){if(!g&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,w=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(m,100),function(){g=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),w!==null&&(w(),w=null)}}}function Lw(s){this._internalRoot=s}bg.prototype.render=Lw.prototype.render=function(s){var l=this._internalRoot;if(l===null)throw Error(r(409));var m=l.current,g=Si();oA(m,g,s,l,null,null)},bg.prototype.unmount=Lw.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var l=s.containerInfo;oA(s.current,2,null,s,null,null),Jh(),l[Gc]=null}};function bg(s){this._internalRoot=s}bg.prototype.unstable_scheduleHydration=function(s){if(s){var l=Nx();s={blockedOn:null,target:s,priority:l};for(var m=0;m<js.length&&l!==0&&l<js[m].priority;m++);js.splice(m,0,s),m===0&&dA(s)}};var hA=t.version;if(hA!=="19.2.0")throw Error(r(527,hA,"19.2.0"));K.findDOMNode=function(s){var l=s._reactInternals;if(l===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=f(l),s=s!==null?p(s):null,s=s===null?null:s.stateNode,s};var Bq={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var xg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xg.isDisabled&&xg.supportsFiber)try{xn=xg.inject(Bq),Yt=xg}catch{}}return km.createRoot=function(s,l){if(!i(s))throw Error(r(299));var m=!1,g="",w=SN,_=_N,R=CN;return l!=null&&(l.unstable_strictMode===!0&&(m=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onUncaughtError!==void 0&&(w=l.onUncaughtError),l.onCaughtError!==void 0&&(_=l.onCaughtError),l.onRecoverableError!==void 0&&(R=l.onRecoverableError)),l=rA(s,1,!1,null,null,m,g,null,w,_,R,pA),s[Gc]=l.current,xw(s),new Lw(l)},km.hydrateRoot=function(s,l,m){if(!i(s))throw Error(r(299));var g=!1,w="",_=SN,R=_N,$=CN,H=null;return m!=null&&(m.unstable_strictMode===!0&&(g=!0),m.identifierPrefix!==void 0&&(w=m.identifierPrefix),m.onUncaughtError!==void 0&&(_=m.onUncaughtError),m.onCaughtError!==void 0&&(R=m.onCaughtError),m.onRecoverableError!==void 0&&($=m.onRecoverableError),m.formState!==void 0&&(H=m.formState)),l=rA(s,1,!0,l,m??null,g,w,H,_,R,$,pA),l.context=iA(null),m=l.current,g=Si(),g=qc(g),w=fs(g),w.callback=null,ms(m,w,g),m=g,l.current.lanes=m,wn(l,m),Ko(l),s[Gc]=l.current,xw(s),new bg(l)},km.version="19.2.0",km}var nM;function HTe(){if(nM)return k_.exports;nM=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),k_.exports=BTe(),k_.exports}var qTe=HTe();qTe.createRoot(document.getElementById("root"),{onUncaughtError:(e,t)=>{Sv(),console.error("Uncaught error:",e,t)},onCaughtError:(e,t)=>{Sv(),console.error("Caught error:",e,t)},onRecoverableError:(e,t)=>{Sv(),console.warn("Recoverable error:",e,t)}}).render(u.jsx(x.StrictMode,{children:u.jsx(UTe,{})}));export{nt as $,eE as A,_ne as B,bS as C,Dre as D,bt as E,fie as F,rE as G,kz as H,CAe as I,SAe as J,_Ae as K,EAe as L,$te as M,St as N,io as O,yAe as P,Cr as Q,vt as R,Rr as S,ab as T,jp as U,$z as V,yd as W,Rp as X,at as Y,Ut as Z,mn as _,eb as a,Pe as a$,an as a0,pn as a1,cl as a2,Qt as a3,ln as a4,x as a5,Tt as a6,_n as a7,_e as a8,Gle as a9,Va as aA,jC as aB,qs as aC,OH as aD,Md as aE,Io as aF,fa as aG,fAe as aH,mp as aI,GTe as aJ,yp as aK,X as aL,jAe as aM,Xo as aN,Xt as aO,OC as aP,tt as aQ,Mt as aR,cIe as aS,xR as aT,Ui as aU,Z$ as aV,Fv as aW,po as aX,mAe as aY,sc as aZ,Ma as a_,u as aa,Jt as ab,Me as ac,Ae as ad,Oe as ae,$e as af,ze as ag,De as ah,be as ai,ho as aj,kp as ak,qC as al,Ez as am,jJ as an,Nc as ao,$t as ap,nr as aq,go as ar,Js as as,mt as at,WP as au,Jy as av,Ft as aw,gr as ax,up as ay,LE as az,tl as b,fP as b0,zd as b1,EC as b2,r0e as b3,n0e as b4,Pp as b5,co as b6,fo as b7,uo as b8,mo as b9,Lo as ba,Sn as bb,Mi as bc,Er as bd,Cn as c,wAe as d,Qoe as e,Joe as f,db as g,ra as h,m4 as i,tb as j,Nie as k,bAe as l,Wre as m,Ht as n,pAe as o,xAe as p,Iie as q,Rie as r,x4 as s,hr as t,b4 as u,gAe as v,die as w,vAe as x,Pn as y,hAe as z};
|