harperdb 4.7.18 → 4.7.20

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.
Files changed (36) hide show
  1. package/README.md +1 -1
  2. package/bin/harperdb.js +57 -57
  3. package/bin/lite.js +54 -54
  4. package/components/EntryHandler.d.ts +2 -1
  5. package/components/Logger.d.ts +12 -0
  6. package/components/OptionsWatcher.d.ts +2 -1
  7. package/components/Scope.d.ts +16 -5
  8. package/index.d.ts +20 -9
  9. package/index.js +3 -0
  10. package/launchServiceScripts/launchNatsIngestService.js +54 -54
  11. package/launchServiceScripts/launchNatsReplyService.js +54 -54
  12. package/launchServiceScripts/launchUpdateNodes4-0-0.js +54 -54
  13. package/npm-shrinkwrap.json +346 -335
  14. package/package.json +1 -1
  15. package/resources/Table.d.ts +10 -4
  16. package/resources/databases.d.ts +12 -2
  17. package/server/jobs/jobProcess.js +54 -54
  18. package/server/threads/threadServer.js +54 -54
  19. package/studio/web/assets/{index-reMfz-PE.js → index-D-fcKyYx.js} +1 -1
  20. package/studio/web/assets/{index-C7BE1t1i.js → index-JYy8fJSs.js} +1 -1
  21. package/studio/web/assets/index-Zl65hD8K.css +1 -0
  22. package/studio/web/assets/index-oKJ2dNTo.js +234 -0
  23. package/studio/web/assets/{index.lazy-DG7DUk1C.js → index.lazy-C7Y8KaC7.js} +1 -1
  24. package/studio/web/assets/profiler-CxDJoqcP.js +1 -0
  25. package/studio/web/assets/{react-redux-4JeOy3fU.js → react-redux-LHAYowSO.js} +1 -1
  26. package/studio/web/assets/startRecording-CTUOSIln.js +2 -0
  27. package/studio/web/index.html +2 -2
  28. package/utility/scripts/restartHdb.js +54 -54
  29. package/v1.d.ts +8 -16
  30. package/v1.js +3 -0
  31. package/v2.d.ts +8 -16
  32. package/v2.js +41 -0
  33. package/studio/web/assets/index-BZ1HpJ7A.css +0 -1
  34. package/studio/web/assets/index-Bu-PphJh.js +0 -234
  35. package/studio/web/assets/profiler-B4vE9rPH.js +0 -1
  36. package/studio/web/assets/startRecording-B3i2VhSx.js +0 -2
@@ -1,234 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.lazy-DG7DUk1C.js","assets/react-redux-4JeOy3fU.js","assets/index-CVjGhoEG.css","assets/index-C7BE1t1i.js"])))=>i.map(i=>d[i]);
2
- function _Y(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 t2e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var s_={exports:{}},Sp={};var e$;function CY(){if(e$)return Sp;e$=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 l in i)l!=="key"&&(o[l]=i[l])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:a,ref:i!==void 0?i:null,props:o}}return Sp.Fragment=t,Sp.jsx=n,Sp.jsxs=n,Sp}var t$;function kY(){return t$||(t$=1,s_.exports=CY()),s_.exports}var u=kY();const xd=!0,EY="/",Td=9925,X1="HDB_ADMIN",ba="/",Fk="../",jY=1024*1024*1024,RY=100*1024*1024;function sz(e,t){return function(){return e.apply(t,arguments)}}const{toString:IY}=Object.prototype,{getPrototypeOf:Uk}=Object,{iterator:Cb,toStringTag:lz}=Symbol,kb=(e=>t=>{const n=IY.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Xo=e=>(e=e.toLowerCase(),t=>kb(t)===e),Eb=e=>t=>typeof t===e,{isArray:of}=Array,Nd=Eb("undefined");function Lm(e){return e!==null&&!Nd(e)&&e.constructor!==null&&!Nd(e.constructor)&&_i(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const cz=Xo("ArrayBuffer");function TY(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&cz(e.buffer),t}const NY=Eb("string"),_i=Eb("function"),uz=Eb("number"),Fm=e=>e!==null&&typeof e=="object",AY=e=>e===!0||e===!1,Yv=e=>{if(kb(e)!=="object")return!1;const t=Uk(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(lz in e)&&!(Cb in e)},OY=e=>{if(!Fm(e)||Lm(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},$Y=Xo("Date"),DY=Xo("File"),PY=Xo("Blob"),MY=Xo("FileList"),zY=e=>Fm(e)&&_i(e.pipe),LY=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||_i(e.append)&&((t=kb(e))==="formdata"||t==="object"&&_i(e.toString)&&e.toString()==="[object FormData]"))},FY=Xo("URLSearchParams"),[UY,VY,BY,HY]=["ReadableStream","Request","Response","Headers"].map(Xo),qY=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Um(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),of(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(Lm(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let l;for(r=0;r<a;r++)l=o[r],t.call(null,e[l],l,e)}}function dz(e,t){if(Lm(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 gc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,fz=e=>!Nd(e)&&e!==gc;function J1(){const{caseless:e,skipUndefined:t}=fz(this)&&this||{},n={},r=(i,o)=>{const a=e&&dz(n,o)||o;Yv(n[a])&&Yv(i)?n[a]=J1(n[a],i):Yv(i)?n[a]=J1({},i):of(i)?n[a]=i.slice():(!t||!Nd(i))&&(n[a]=i)};for(let i=0,o=arguments.length;i<o;i++)arguments[i]&&Um(arguments[i],r);return n}const KY=(e,t,n,{allOwnKeys:r}={})=>(Um(t,(i,o)=>{n&&_i(i)?e[o]=sz(i,n):e[o]=i},{allOwnKeys:r}),e),GY=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ZY=(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)},YY=(e,t,n,r)=>{let i,o,a;const l={};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))&&!l[a]&&(t[a]=e[a],l[a]=!0);e=n!==!1&&Uk(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},WY=(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},XY=e=>{if(!e)return null;if(of(e))return e;let t=e.length;if(!uz(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},JY=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Uk(Uint8Array)),QY=(e,t)=>{const r=(e&&e[Cb]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},eW=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},tW=Xo("HTMLFormElement"),nW=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),n$=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),rW=Xo("RegExp"),pz=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Um(n,(i,o)=>{let a;(a=t(i,o,e))!==!1&&(r[o]=a||i)}),Object.defineProperties(e,r)},iW=e=>{pz(e,(t,n)=>{if(_i(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(_i(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+"'")})}})},oW=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return of(e)?r(e):r(String(e).split(t)),n},aW=()=>{},sW=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function lW(e){return!!(e&&_i(e.append)&&e[lz]==="FormData"&&e[Cb])}const cW=e=>{const t=new Array(10),n=(r,i)=>{if(Fm(r)){if(t.indexOf(r)>=0)return;if(Lm(r))return r;if(!("toJSON"in r)){t[i]=r;const o=of(r)?[]:{};return Um(r,(a,l)=>{const d=n(a,i+1);!Nd(d)&&(o[l]=d)}),t[i]=void 0,o}}return r};return n(e,0)},uW=Xo("AsyncFunction"),dW=e=>e&&(Fm(e)||_i(e))&&_i(e.then)&&_i(e.catch),mz=((e,t)=>e?setImmediate:t?((n,r)=>(gc.addEventListener("message",({source:i,data:o})=>{i===gc&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),gc.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",_i(gc.postMessage)),fW=typeof queueMicrotask<"u"?queueMicrotask.bind(gc):typeof process<"u"&&process.nextTick||mz,pW=e=>e!=null&&_i(e[Cb]),me={isArray:of,isArrayBuffer:cz,isBuffer:Lm,isFormData:LY,isArrayBufferView:TY,isString:NY,isNumber:uz,isBoolean:AY,isObject:Fm,isPlainObject:Yv,isEmptyObject:OY,isReadableStream:UY,isRequest:VY,isResponse:BY,isHeaders:HY,isUndefined:Nd,isDate:$Y,isFile:DY,isBlob:PY,isRegExp:rW,isFunction:_i,isStream:zY,isURLSearchParams:FY,isTypedArray:JY,isFileList:MY,forEach:Um,merge:J1,extend:KY,trim:qY,stripBOM:GY,inherits:ZY,toFlatObject:YY,kindOf:kb,kindOfTest:Xo,endsWith:WY,toArray:XY,forEachEntry:QY,matchAll:eW,isHTMLForm:tW,hasOwnProperty:n$,hasOwnProp:n$,reduceDescriptors:pz,freezeMethods:iW,toObjectSet:oW,toCamelCase:nW,noop:aW,toFiniteNumber:sW,findKey:dz,global:gc,isContextDefined:fz,isSpecCompliantForm:lW,toJSONObject:cW,isAsyncFn:uW,isThenable:dW,setImmediate:mz,asap:fW,isIterable:pW};function ht(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)}me.inherits(ht,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:me.toJSONObject(this.config),code:this.code,status:this.status}}});const hz=ht.prototype,gz={};["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=>{gz[e]={value:e}});Object.defineProperties(ht,gz);Object.defineProperty(hz,"isAxiosError",{value:!0});ht.from=(e,t,n,r,i,o)=>{const a=Object.create(hz);me.toFlatObject(e,a,function(m){return m!==Error.prototype},f=>f!=="isAxiosError");const l=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return ht.call(a,l,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 mW=null;function Q1(e){return me.isPlainObject(e)||me.isArray(e)}function vz(e){return me.endsWith(e,"[]")?e.slice(0,-2):e}function r$(e,t,n){return e?e.concat(t).map(function(i,o){return i=vz(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function hW(e){return me.isArray(e)&&!e.some(Q1)}const gW=me.toFlatObject(me,{},null,function(t){return/^is[A-Z]/.test(t)});function jb(e,t,n){if(!me.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=me.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,C){return!me.isUndefined(C[S])});const r=n.metaTokens,i=n.visitor||m,o=n.dots,a=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&me.isSpecCompliantForm(t);if(!me.isFunction(i))throw new TypeError("visitor must be a function");function f(x){if(x===null)return"";if(me.isDate(x))return x.toISOString();if(me.isBoolean(x))return x.toString();if(!d&&me.isBlob(x))throw new ht("Blob is not supported. Use a Buffer instead.");return me.isArrayBuffer(x)||me.isTypedArray(x)?d&&typeof Blob=="function"?new Blob([x]):Buffer.from(x):x}function m(x,S,C){let k=x;if(x&&!C&&typeof x=="object"){if(me.endsWith(S,"{}"))S=r?S:S.slice(0,-2),x=JSON.stringify(x);else if(me.isArray(x)&&hW(x)||(me.isFileList(x)||me.endsWith(S,"[]"))&&(k=me.toArray(x)))return S=vz(S),k.forEach(function(j,R){!(me.isUndefined(j)||j===null)&&t.append(a===!0?r$([S],R,o):a===null?S:S+"[]",f(j))}),!1}return Q1(x)?!0:(t.append(r$(C,S,o),f(x)),!1)}const h=[],v=Object.assign(gW,{defaultVisitor:m,convertValue:f,isVisitable:Q1});function y(x,S){if(!me.isUndefined(x)){if(h.indexOf(x)!==-1)throw Error("Circular reference detected in "+S.join("."));h.push(x),me.forEach(x,function(k,E){(!(me.isUndefined(k)||k===null)&&i.call(t,k,me.isString(E)?E.trim():E,S,v))===!0&&y(k,S?S.concat(E):[E])}),h.pop()}}if(!me.isObject(e))throw new TypeError("data must be an object");return y(e),t}function i$(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Vk(e,t){this._pairs=[],e&&jb(e,this,t)}const yz=Vk.prototype;yz.append=function(t,n){this._pairs.push([t,n])};yz.toString=function(t){const n=t?function(r){return t.call(this,r,i$)}:i$;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function vW(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function bz(e,t,n){if(!t)return e;const r=n&&n.encode||vW;me.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(i?o=i(t,n):o=me.isURLSearchParams(t)?t.toString():new Vk(t,n).toString(r),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class o${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){me.forEach(this.handlers,function(r){r!==null&&t(r)})}}const xz={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},yW=typeof URLSearchParams<"u"?URLSearchParams:Vk,bW=typeof FormData<"u"?FormData:null,xW=typeof Blob<"u"?Blob:null,wW={isBrowser:!0,classes:{URLSearchParams:yW,FormData:bW,Blob:xW},protocols:["http","https","file","blob","url","data"]},Bk=typeof window<"u"&&typeof document<"u",eC=typeof navigator=="object"&&navigator||void 0,SW=Bk&&(!eC||["ReactNative","NativeScript","NS"].indexOf(eC.product)<0),_W=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",CW=Bk&&window.location.href||"http://localhost",kW=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Bk,hasStandardBrowserEnv:SW,hasStandardBrowserWebWorkerEnv:_W,navigator:eC,origin:CW},Symbol.toStringTag,{value:"Module"})),Dr={...kW,...wW};function EW(e,t){return jb(e,new Dr.classes.URLSearchParams,{visitor:function(n,r,i,o){return Dr.isNode&&me.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function jW(e){return me.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function RW(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 wz(e){function t(n,r,i,o){let a=n[o++];if(a==="__proto__")return!0;const l=Number.isFinite(+a),d=o>=n.length;return a=!a&&me.isArray(i)?i.length:a,d?(me.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!l):((!i[a]||!me.isObject(i[a]))&&(i[a]=[]),t(n,r,i[a],o)&&me.isArray(i[a])&&(i[a]=RW(i[a])),!l)}if(me.isFormData(e)&&me.isFunction(e.entries)){const n={};return me.forEachEntry(e,(r,i)=>{t(jW(r),i,n,0)}),n}return null}function IW(e,t,n){if(me.isString(e))try{return(t||JSON.parse)(e),me.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Vm={transitional:xz,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=me.isObject(t);if(o&&me.isHTMLForm(t)&&(t=new FormData(t)),me.isFormData(t))return i?JSON.stringify(wz(t)):t;if(me.isArrayBuffer(t)||me.isBuffer(t)||me.isStream(t)||me.isFile(t)||me.isBlob(t)||me.isReadableStream(t))return t;if(me.isArrayBufferView(t))return t.buffer;if(me.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return EW(t,this.formSerializer).toString();if((l=me.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return jb(l?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),IW(t)):t}],transformResponse:[function(t){const n=this.transitional||Vm.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(me.isResponse(t)||me.isReadableStream(t))return t;if(t&&me.isString(t)&&(r&&!this.responseType||i)){const a=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(l){if(a)throw l.name==="SyntaxError"?ht.from(l,ht.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Dr.classes.FormData,Blob:Dr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};me.forEach(["delete","get","head","post","put","patch"],e=>{Vm.headers[e]={}});const TW=me.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"]),NW=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]&&TW[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},a$=Symbol("internals");function _p(e){return e&&String(e).trim().toLowerCase()}function Wv(e){return e===!1||e==null?e:me.isArray(e)?e.map(Wv):String(e)}function AW(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 OW=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function l_(e,t,n,r,i){if(me.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!me.isString(t)){if(me.isString(r))return t.indexOf(r)!==-1;if(me.isRegExp(r))return r.test(t)}}function $W(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function DW(e,t){const n=me.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(l,d,f){const m=_p(d);if(!m)throw new Error("header name must be a non-empty string");const h=me.findKey(i,m);(!h||i[h]===void 0||f===!0||f===void 0&&i[h]!==!1)&&(i[h||d]=Wv(l))}const a=(l,d)=>me.forEach(l,(f,m)=>o(f,m,d));if(me.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(me.isString(t)&&(t=t.trim())&&!OW(t))a(NW(t),n);else if(me.isObject(t)&&me.isIterable(t)){let l={},d,f;for(const m of t){if(!me.isArray(m))throw TypeError("Object iterator must return a key-value pair");l[f=m[0]]=(d=l[f])?me.isArray(d)?[...d,m[1]]:[d,m[1]]:m[1]}a(l,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=_p(t),t){const r=me.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return AW(i);if(me.isFunction(n))return n.call(this,i,r);if(me.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=_p(t),t){const r=me.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||l_(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(a){if(a=_p(a),a){const l=me.findKey(r,a);l&&(!n||l_(r,r[l],l,n))&&(delete r[l],i=!0)}}return me.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||l_(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return me.forEach(this,(i,o)=>{const a=me.findKey(r,o);if(a){n[a]=Wv(i),delete n[o];return}const l=t?$W(o):String(o).trim();l!==o&&delete n[o],n[l]=Wv(i),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return me.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&me.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[a$]=this[a$]={accessors:{}}).accessors,i=this.prototype;function o(a){const l=_p(a);r[l]||(DW(i,a),r[l]=!0)}return me.isArray(t)?t.forEach(o):o(t),this}};Ci.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);me.reduceDescriptors(Ci.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});me.freezeMethods(Ci);function c_(e,t){const n=this||Vm,r=t||n,i=Ci.from(r.headers);let o=r.data;return me.forEach(e,function(l){o=l.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function Sz(e){return!!(e&&e.__CANCEL__)}function af(e,t,n){ht.call(this,e??"canceled",ht.ERR_CANCELED,t,n),this.name="CanceledError"}me.inherits(af,ht,{__CANCEL__:!0});function _z(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ht("Request failed with status code "+n.status,[ht.ERR_BAD_REQUEST,ht.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function PW(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function MW(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(),m=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=m&&f-m;return y?Math.round(v*1e3/y):void 0}}function zW(e,t){let n=0,r=1e3/t,i,o;const a=(f,m=Date.now())=>{n=m,i=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const m=Date.now(),h=m-n;h>=r?a(f,m):(i=f,o||(o=setTimeout(()=>{o=null,a(i)},r-h)))},()=>i&&a(i)]}const hy=(e,t,n=3)=>{let r=0;const i=MW(50,250);return zW(o=>{const a=o.loaded,l=o.lengthComputable?o.total:void 0,d=a-r,f=i(d),m=a<=l;r=a;const h={loaded:a,total:l,progress:l?a/l:void 0,bytes:d,rate:f||void 0,estimated:f&&l&&m?(l-a)/f:void 0,event:o,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(h)},n)},s$=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},l$=e=>(...t)=>me.asap(()=>e(...t)),LW=Dr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Dr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Dr.origin),Dr.navigator&&/(msie|trident)/i.test(Dr.navigator.userAgent)):()=>!0,FW=Dr.hasStandardBrowserEnv?{write(e,t,n,r,i,o,a){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];me.isNumber(n)&&l.push(`expires=${new Date(n).toUTCString()}`),me.isString(r)&&l.push(`path=${r}`),me.isString(i)&&l.push(`domain=${i}`),o===!0&&l.push("secure"),me.isString(a)&&l.push(`SameSite=${a}`),document.cookie=l.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 UW(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function VW(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Cz(e,t,n){let r=!UW(t);return e&&(r||n==!1)?VW(e,t):t}const c$=e=>e instanceof Ci?{...e}:e;function Nc(e,t){t=t||{};const n={};function r(f,m,h,v){return me.isPlainObject(f)&&me.isPlainObject(m)?me.merge.call({caseless:v},f,m):me.isPlainObject(m)?me.merge({},m):me.isArray(m)?m.slice():m}function i(f,m,h,v){if(me.isUndefined(m)){if(!me.isUndefined(f))return r(void 0,f,h,v)}else return r(f,m,h,v)}function o(f,m){if(!me.isUndefined(m))return r(void 0,m)}function a(f,m){if(me.isUndefined(m)){if(!me.isUndefined(f))return r(void 0,f)}else return r(void 0,m)}function l(f,m,h){if(h in t)return r(f,m);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:l,headers:(f,m,h)=>i(c$(f),c$(m),h,!0)};return me.forEach(Object.keys({...e,...t}),function(m){const h=d[m]||i,v=h(e[m],t[m],m);me.isUndefined(v)&&h!==l||(n[m]=v)}),n}const kz=e=>{const t=Nc({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:a,auth:l}=t;if(t.headers=a=Ci.from(a),t.url=bz(Cz(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),me.isFormData(n)){if(Dr.hasStandardBrowserEnv||Dr.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(me.isFunction(n.getHeaders)){const d=n.getHeaders(),f=["content-type","content-length"];Object.entries(d).forEach(([m,h])=>{f.includes(m.toLowerCase())&&a.set(m,h)})}}if(Dr.hasStandardBrowserEnv&&(r&&me.isFunction(r)&&(r=r(t)),r||r!==!1&&LW(t.url))){const d=i&&o&&FW.read(o);d&&a.set(i,d)}return t},BW=typeof XMLHttpRequest<"u",HW=BW&&function(e){return new Promise(function(n,r){const i=kz(e);let o=i.data;const a=Ci.from(i.headers).normalize();let{responseType:l,onUploadProgress:d,onDownloadProgress:f}=i,m,h,v,y,x;function S(){y&&y(),x&&x(),i.cancelToken&&i.cancelToken.unsubscribe(m),i.signal&&i.signal.removeEventListener("abort",m)}let C=new XMLHttpRequest;C.open(i.method.toUpperCase(),i.url,!0),C.timeout=i.timeout;function k(){if(!C)return;const j=Ci.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),N={data:!l||l==="text"||l==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:j,config:e,request:C};_z(function(A){n(A),S()},function(A){r(A),S()},N),C=null}"onloadend"in C?C.onloadend=k:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(k)},C.onabort=function(){C&&(r(new ht("Request aborted",ht.ECONNABORTED,e,C)),C=null)},C.onerror=function(R){const N=R&&R.message?R.message:"Network Error",T=new ht(N,ht.ERR_NETWORK,e,C);T.event=R||null,r(T),C=null},C.ontimeout=function(){let R=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const N=i.transitional||xz;i.timeoutErrorMessage&&(R=i.timeoutErrorMessage),r(new ht(R,N.clarifyTimeoutError?ht.ETIMEDOUT:ht.ECONNABORTED,e,C)),C=null},o===void 0&&a.setContentType(null),"setRequestHeader"in C&&me.forEach(a.toJSON(),function(R,N){C.setRequestHeader(N,R)}),me.isUndefined(i.withCredentials)||(C.withCredentials=!!i.withCredentials),l&&l!=="json"&&(C.responseType=i.responseType),f&&([v,x]=hy(f,!0),C.addEventListener("progress",v)),d&&C.upload&&([h,y]=hy(d),C.upload.addEventListener("progress",h),C.upload.addEventListener("loadend",y)),(i.cancelToken||i.signal)&&(m=j=>{C&&(r(!j||j.type?new af(null,e,C):j),C.abort(),C=null)},i.cancelToken&&i.cancelToken.subscribe(m),i.signal&&(i.signal.aborted?m():i.signal.addEventListener("abort",m)));const E=PW(i.url);if(E&&Dr.protocols.indexOf(E)===-1){r(new ht("Unsupported protocol "+E+":",ht.ERR_BAD_REQUEST,e));return}C.send(o||null)})},qW=(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,l();const m=f instanceof Error?f:this.reason;r.abort(m instanceof ht?m:new af(m instanceof Error?m.message:m))}};let a=t&&setTimeout(()=>{a=null,o(new ht(`timeout ${t} of ms exceeded`,ht.ETIMEDOUT))},t);const l=()=>{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=()=>me.asap(l),d}},KW=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},GW=async function*(e,t){for await(const n of ZW(e))yield*KW(n,t)},ZW=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()}},u$=(e,t,n,r)=>{const i=GW(e,t);let o=0,a,l=d=>{a||(a=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:f,value:m}=await i.next();if(f){l(),d.close();return}let h=m.byteLength;if(n){let v=o+=h;n(v)}d.enqueue(new Uint8Array(m))}catch(f){throw l(f),f}},cancel(d){return l(d),i.return()}},{highWaterMark:2})},d$=64*1024,{isFunction:iv}=me,YW=(({Request:e,Response:t})=>({Request:e,Response:t}))(me.global),{ReadableStream:f$,TextEncoder:p$}=me.global,m$=(e,...t)=>{try{return!!e(...t)}catch{return!1}},WW=e=>{e=me.merge.call({skipUndefined:!0},YW,e);const{fetch:t,Request:n,Response:r}=e,i=t?iv(t):typeof fetch=="function",o=iv(n),a=iv(r);if(!i)return!1;const l=i&&iv(f$),d=i&&(typeof p$=="function"?(x=>S=>x.encode(S))(new p$):async x=>new Uint8Array(await new n(x).arrayBuffer())),f=o&&l&&m$(()=>{let x=!1;const S=new n(Dr.origin,{body:new f$,method:"POST",get duplex(){return x=!0,"half"}}).headers.has("Content-Type");return x&&!S}),m=a&&l&&m$(()=>me.isReadableStream(new r("").body)),h={stream:m&&(x=>x.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(x=>{!h[x]&&(h[x]=(S,C)=>{let k=S&&S[x];if(k)return k.call(S);throw new ht(`Response type '${x}' is not supported`,ht.ERR_NOT_SUPPORT,C)})});const v=async x=>{if(x==null)return 0;if(me.isBlob(x))return x.size;if(me.isSpecCompliantForm(x))return(await new n(Dr.origin,{method:"POST",body:x}).arrayBuffer()).byteLength;if(me.isArrayBufferView(x)||me.isArrayBuffer(x))return x.byteLength;if(me.isURLSearchParams(x)&&(x=x+""),me.isString(x))return(await d(x)).byteLength},y=async(x,S)=>{const C=me.toFiniteNumber(x.getContentLength());return C??v(S)};return async x=>{let{url:S,method:C,data:k,signal:E,cancelToken:j,timeout:R,onDownloadProgress:N,onUploadProgress:T,responseType:A,headers:D,withCredentials:F="same-origin",fetchOptions:K}=kz(x),te=t||fetch;A=A?(A+"").toLowerCase():"text";let G=qW([E,j&&j.toAbortSignal()],R),q=null;const V=G&&G.unsubscribe&&(()=>{G.unsubscribe()});let H;try{if(T&&f&&C!=="get"&&C!=="head"&&(H=await y(D,k))!==0){let P=new n(S,{method:"POST",body:k,duplex:"half"}),U;if(me.isFormData(k)&&(U=P.headers.get("content-type"))&&D.setContentType(U),P.body){const[O,J]=s$(H,hy(l$(T)));k=u$(P.body,d$,O,J)}}me.isString(F)||(F=F?"include":"omit");const z=o&&"credentials"in n.prototype,W={...K,signal:G,method:C.toUpperCase(),headers:D.normalize().toJSON(),body:k,duplex:"half",credentials:z?F:void 0};q=o&&new n(S,W);let L=await(o?te(q,K):te(S,W));const ne=m&&(A==="stream"||A==="response");if(m&&(N||ne&&V)){const P={};["status","statusText","headers"].forEach(pe=>{P[pe]=L[pe]});const U=me.toFiniteNumber(L.headers.get("content-length")),[O,J]=N&&s$(U,hy(l$(N),!0))||[];L=new r(u$(L.body,d$,O,()=>{J&&J(),V&&V()}),P)}A=A||"text";let $=await h[me.findKey(h,A)||"text"](L,x);return!ne&&V&&V(),await new Promise((P,U)=>{_z(P,U,{data:$,headers:Ci.from(L.headers),status:L.status,statusText:L.statusText,config:x,request:q})})}catch(z){throw V&&V(),z&&z.name==="TypeError"&&/Load failed|fetch/i.test(z.message)?Object.assign(new ht("Network Error",ht.ERR_NETWORK,x,q),{cause:z.cause||z}):ht.from(z,z&&z.code,x,q)}}},XW=new Map,Ez=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let a=o.length,l=a,d,f,m=XW;for(;l--;)d=o[l],f=m.get(d),f===void 0&&m.set(d,f=l?new Map:WW(t)),m=f;return f};Ez();const Hk={http:mW,xhr:HW,fetch:{get:Ez}};me.forEach(Hk,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const h$=e=>`- ${e}`,JW=e=>me.isFunction(e)||e===null||e===!1;function QW(e,t){e=me.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let a=0;a<n;a++){r=e[a];let l;if(i=r,!JW(r)&&(i=Hk[(l=String(r)).toLowerCase()],i===void 0))throw new ht(`Unknown adapter '${l}'`);if(i&&(me.isFunction(i)||(i=i.get(t))))break;o[l||"#"+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 l=n?a.length>1?`since :
5
- `+a.map(h$).join(`
6
- `):" "+h$(a[0]):"as no adapter specified";throw new ht("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return i}const jz={getAdapter:QW,adapters:Hk};function u_(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new af(null,e)}function g$(e){return u_(e),e.headers=Ci.from(e.headers),e.data=c_.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),jz.getAdapter(e.adapter||Vm.adapter,e)(e).then(function(r){return u_(e),r.data=c_.call(e,e.transformResponse,r),r.headers=Ci.from(r.headers),r},function(r){return Sz(r)||(u_(e),r&&r.response&&(r.response.data=c_.call(e,e.transformResponse,r.response),r.response.headers=Ci.from(r.response.headers))),Promise.reject(r)})}const Rz="1.13.2",Rb={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Rb[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const v$={};Rb.transitional=function(t,n,r){function i(o,a){return"[Axios v"+Rz+"] Transitional option '"+o+"'"+a+(r?". "+r:"")}return(o,a,l)=>{if(t===!1)throw new ht(i(a," has been removed"+(n?" in "+n:"")),ht.ERR_DEPRECATED);return n&&!v$[a]&&(v$[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,a,l):!0}};Rb.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function eX(e,t,n){if(typeof e!="object")throw new ht("options must be an object",ht.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 l=e[o],d=l===void 0||a(l,o,e);if(d!==!0)throw new ht("option "+o+" must be "+d,ht.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ht("Unknown option "+o,ht.ERR_BAD_OPTION)}}const Xv={assertOptions:eX,validators:Rb},oa=Xv.validators;let _c=class{constructor(t){this.defaults=t||{},this.interceptors={request:new o$,response:new o$}}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=Nc(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&Xv.assertOptions(r,{silentJSONParsing:oa.transitional(oa.boolean),forcedJSONParsing:oa.transitional(oa.boolean),clarifyTimeoutError:oa.transitional(oa.boolean)},!1),i!=null&&(me.isFunction(i)?n.paramsSerializer={serialize:i}:Xv.assertOptions(i,{encode:oa.function,serialize:oa.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Xv.assertOptions(n,{baseUrl:oa.spelling("baseURL"),withXsrfToken:oa.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&me.merge(o.common,o[n.method]);o&&me.forEach(["delete","get","head","post","put","patch","common"],x=>{delete o[x]}),n.headers=Ci.concat(a,o);const l=[];let d=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(d=d&&S.synchronous,l.unshift(S.fulfilled,S.rejected))});const f=[];this.interceptors.response.forEach(function(S){f.push(S.fulfilled,S.rejected)});let m,h=0,v;if(!d){const x=[g$.bind(this),void 0];for(x.unshift(...l),x.push(...f),v=x.length,m=Promise.resolve(n);h<v;)m=m.then(x[h++],x[h++]);return m}v=l.length;let y=n;for(;h<v;){const x=l[h++],S=l[h++];try{y=x(y)}catch(C){S.call(this,C);break}}try{m=g$.call(this,y)}catch(x){return Promise.reject(x)}for(h=0,v=f.length;h<v;)m=m.then(f[h++],f[h++]);return m}getUri(t){t=Nc(this.defaults,t);const n=Cz(t.baseURL,t.url,t.allowAbsoluteUrls);return bz(n,t.params,t.paramsSerializer)}};me.forEach(["delete","get","head","options"],function(t){_c.prototype[t]=function(n,r){return this.request(Nc(r||{},{method:t,url:n,data:(r||{}).data}))}});me.forEach(["post","put","patch"],function(t){function n(r){return function(o,a,l){return this.request(Nc(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}_c.prototype[t]=n(),_c.prototype[t+"Form"]=n(!0)});let tX=class Iz{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(l=>{r.subscribe(l),o=l}).then(i);return a.cancel=function(){r.unsubscribe(o)},a},t(function(o,a,l){r.reason||(r.reason=new af(o,a,l),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 Iz(function(i){t=i}),cancel:t}}};function nX(e){return function(n){return e.apply(null,n)}}function rX(e){return me.isObject(e)&&e.isAxiosError===!0}const tC={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(tC).forEach(([e,t])=>{tC[t]=e});function Tz(e){const t=new _c(e),n=sz(_c.prototype.request,t);return me.extend(n,_c.prototype,t,{allOwnKeys:!0}),me.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Tz(Nc(e,i))},n}const Fn=Tz(Vm);Fn.Axios=_c;Fn.CanceledError=af;Fn.CancelToken=tX;Fn.isCancel=Sz;Fn.VERSION=Rz;Fn.toFormData=jb;Fn.AxiosError=ht;Fn.Cancel=Fn.CanceledError;Fn.all=function(t){return Promise.all(t)};Fn.spread=nX;Fn.isAxiosError=rX;Fn.mergeConfig=Nc;Fn.AxiosHeaders=Ci;Fn.formToJSON=e=>wz(me.isHTMLForm(e)?new FormData(e):e);Fn.getAdapter=jz.getAdapter;Fn.HttpStatusCode=tC;Fn.default=Fn;const{Axios:i2e,AxiosError:o2e,CanceledError:a2e,isCancel:s2e,CancelToken:l2e,VERSION:c2e,all:u2e,Cancel:d2e,isAxiosError:f2e,spread:p2e,toFormData:m2e,AxiosHeaders:h2e,HttpStatusCode:g2e,formToJSON:v2e,getAdapter:y2e,mergeConfig:b2e}=Fn,Yt=Fn.create({withCredentials:!0,baseURL:"/",timeout:15e3,headers:{"Content-Type":"application/json"}});function Wr(e,t,n){return e===1||e==="1"?`${e} ${t}`:`${e} ${n}`}function iX(e){return e.replicated?.some(t=>Nz(t))??!1}function oX(e){return e.status!=="failed"}function Nz(e){return e.status==="failed"}function aX(e){if(iX(e.data)){const t=e.data.replicated.filter(oX),n=e.data.replicated.filter(Nz),r=t.length?`The operation partially succeeded, but ${Wr(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 qc(e=1e3){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}function sX(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 l=5e3*Math.pow(2,r.__retryCount-1);return await qc(l),e.request(r)}}function es({id:e=$n,operationsUrl:t,port:n,secure:r,forceFabricConnect:i}={}){let o=t||kt.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||kt.checkForFabricConnect(e);a&&(e.startsWith("clu-")?o=Yt.defaults.baseURL+`/Cluster/${e}/operation`:e.startsWith("ins-")&&(o=Yt.defaults.baseURL+`/HDBInstance/${e}/operation`));const l=kt.checkForBasicAuth(e),d=Fn.create({auth:a?void 0:l,withCredentials:a||!l,timeout:15e3,headers:{"Content-Type":"application/json"},baseURL:o});return d.interceptors.response.use(aX,sX(d)),d}var sf=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(){}},lX={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},cX=class{#e=lX;#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)}},vc=new cX;function uX(e){setTimeout(e,0)}var Ac=typeof window>"u"||"Deno"in globalThis;function Zr(){}function dX(e,t){return typeof e=="function"?e(t):e}function nC(e){return typeof e=="number"&&e>=0&&e!==1/0}function Az(e,t){return Math.max(e+(t||0)-Date.now(),0)}function al(e,t){return typeof e=="function"?e(t):e}function vo(e,t){return typeof e=="function"?e(t):e}function y$(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:l}=e;if(a){if(r){if(t.queryHash!==qk(a,t.options))return!1}else if(!mm(t.queryKey,a))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||o&&!o(t))}function b$(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Oc(t.options.mutationKey)!==Oc(o))return!1}else if(!mm(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function qk(e,t){return(t?.queryKeyHashFn||Oc)(e)}function Oc(e){return JSON.stringify(e,(t,n)=>rC(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function mm(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>mm(e[n],t[n])):!1}var fX=Object.prototype.hasOwnProperty;function Oz(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=x$(e)&&x$(t);if(!r&&!(rC(e)&&rC(t)))return t;const o=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),l=a.length,d=r?new Array(l):{};let f=0;for(let m=0;m<l;m++){const h=r?m:a[m],v=e[h],y=t[h];if(v===y){d[h]=v,(r?m<o:fX.call(e,h))&&f++;continue}if(v===null||y===null||typeof v!="object"||typeof y!="object"){d[h]=y;continue}const x=Oz(v,y,n+1);d[h]=x,x===v&&f++}return o===l&&f===o?e:d}function gy(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 x$(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function rC(e){if(!w$(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!w$(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function w$(e){return Object.prototype.toString.call(e)==="[object Object]"}function pX(e){return new Promise(t=>{vc.setTimeout(t,e)})}function iC(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Oz(e,t):t}function mX(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function hX(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Kk=Symbol();function $z(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Kk?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Gk(e,t){return typeof e=="function"?e(...t):!!e}function gX(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var vX=class extends sf{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Ac&&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"}},Zk=new vX;function oC(){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 yX=uX;function bX(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=yX;const o=l=>{t?e.push(l):i(()=>{n(l)})},a=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(d=>{n(d)})})})};return{batch:l=>{let d;t++;try{d=l()}finally{t--,t||a()}return d},batchCalls:l=>(...d)=>{o(()=>{l(...d)})},schedule:o,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var cr=bX(),xX=class extends sf{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Ac&&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}},vy=new xX;function wX(e){return Math.min(1e3*2**e,3e4)}function Dz(e){return(e??"online")==="online"?vy.isOnline():!0}var aC=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Pz(e){let t=!1,n=0,r;const i=oC(),o=()=>i.status!=="pending",a=S=>{if(!o()){const C=new aC(S);v(C),e.onCancel?.(C)}},l=()=>{t=!0},d=()=>{t=!1},f=()=>Zk.isFocused()&&(e.networkMode==="always"||vy.isOnline())&&e.canRun(),m=()=>Dz(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?.()}),x=()=>{if(o())return;let S;const C=n===0?e.initialPromise:void 0;try{S=C??e.fn()}catch(k){S=Promise.reject(k)}Promise.resolve(S).then(h).catch(k=>{if(o())return;const E=e.retry??(Ac?0:3),j=e.retryDelay??wX,R=typeof j=="function"?j(n,k):j,N=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,k);if(t||!N){v(k);return}n++,e.onFail?.(n,k),pX(R).then(()=>f()?void 0:y()).then(()=>{t?v(k):x()})})};return{promise:i,status:()=>i.status,cancel:a,continue:()=>(r?.(),i),cancelRetry:l,continueRetry:d,canStart:m,start:()=>(m()?x():y().then(x),i)}}var Mz=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nC(this.gcTime)&&(this.#e=vc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ac?1/0:300*1e3))}clearGcTimeout(){this.#e&&(vc.clearTimeout(this.#e),this.#e=void 0)}},SX=class extends Mz{#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=_$(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=_$(this.options);t.data!==void 0&&(this.setState(S$(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=iC(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(Zr).catch(Zr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>vo(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Kk||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>al(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:!Az(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 l=this.observers.find(d=>d.options.queryFn);l&&this.setOptions(l.options)}const n=new AbortController,r=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{const l=$z(this.options,t),f=(()=>{const m={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(m),m})();return this.#s=!1,this.options.persister?this.options.persister(l,f,this):l(f)},a=(()=>{const l={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(l),l})();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=Pz({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:l=>{l instanceof aC&&l.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(l,d)=>{this.#o({type:"failed",failureCount:l,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 l=await this.#r.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#n.config.onSuccess?.(l,this),this.#n.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof aC){if(l.silent)return this.#r.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#o({type:"error",error:l}),this.#n.config.onError?.(l,this),this.#n.config.onSettled?.(this.state.data,l,this),l}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,...zz(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...S$(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",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),cr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function zz(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Dz(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function S$(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function _$(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 Lz=class extends sf{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#s=oC(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#i=void 0;#r;#a;#s;#o;#h;#f;#p;#c;#u;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),C$(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return sC(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return sC(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 vo(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&&!gy(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&k$(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||vo(this.options.enabled,this.#t)!==vo(t.enabled,this.#t)||al(this.options.staleTime,this.#t)!==al(t.staleTime,this.#t))&&this.#g();const i=this.#v();r&&(this.#t!==n||vo(this.options.enabled,this.#t)!==vo(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 CX(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.#m.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(Zr)),t}#g(){this.#x();const e=al(this.options.staleTime,this.#t);if(Ac||this.#i.isStale||!nC(e))return;const n=Az(this.#i.dataUpdatedAt,e)+1;this.#c=vc.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,!(Ac||vo(this.options.enabled,this.#t)===!1||!nC(this.#l)||this.#l===0)&&(this.#u=vc.setInterval(()=>{(this.options.refetchIntervalInBackground||Zk.isFocused())&&this.#d()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#c&&(vc.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(vc.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 m={...f},h=!1,v;if(t._optimisticResults){const D=this.hasListeners(),F=!D&&C$(e,t),K=D&&k$(e,n,t,r);(F||K)&&(m={...m,...zz(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:y,errorUpdatedAt:x,status:S}=m;v=m.data;let C=!1;if(t.placeholderData!==void 0&&v===void 0&&S==="pending"){let D;i?.isPlaceholderData&&t.placeholderData===a?.placeholderData?(D=i.data,C=!0):D=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,D!==void 0&&(S="success",v=iC(i?.data,D,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=iC(i?.data,v,t),this.#f=v,this.#o=null}catch(D){this.#o=D}this.#o&&(y=this.#o,v=this.#f,x=Date.now(),S="error");const k=m.fetchStatus==="fetching",E=S==="pending",j=S==="error",R=E&&k,N=v!==void 0,A={status:S,fetchStatus:m.fetchStatus,isPending:E,isSuccess:S==="success",isError:j,isInitialLoading:R,isLoading:R,data:v,dataUpdatedAt:m.dataUpdatedAt,error:y,errorUpdatedAt:x,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>d.dataUpdateCount||m.errorUpdateCount>d.errorUpdateCount,isFetching:k,isRefetching:k&&!E,isLoadingError:j&&!N,isPaused:m.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:j&&N,isStale:Yk(e,t),refetch:this.refetch,promise:this.#s,isEnabled:vo(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const D=A.data!==void 0,F=A.status==="error"&&!D,K=q=>{F?q.reject(A.error):D&&q.resolve(A.data)},te=()=>{const q=this.#s=A.promise=oC();K(q)},G=this.#s;switch(G.status){case"pending":e.queryHash===n.queryHash&&K(G);break;case"fulfilled":(F||A.data!==G.value)&&te();break;case"rejected":(!F||A.error!==G.reason)&&te();break}}return A}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.#p=this.#t),gy(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.#m.size)return!0;const o=new Set(i??this.#m);return this.options.throwOnError&&o.add("error"),Object.keys(this.#i).some(a=>{const l=a;return this.#i[l]!==e[l]&&o.has(l)})};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){cr.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function _X(e,t){return vo(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function C$(e,t){return _X(e,t)||e.state.data!==void 0&&sC(e,t,t.refetchOnMount)}function sC(e,t,n){if(vo(t.enabled,e)!==!1&&al(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Yk(e,t)}return!1}function k$(e,t,n,r){return(e!==t||vo(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Yk(e,n)}function Yk(e,t){return vo(t.enabled,e)!==!1&&e.isStaleByTime(al(t.staleTime,e))}function CX(e,t){return!gy(e.getCurrentResult(),t)}function E$(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 l={pages:[],pageParams:[]},d=0;const f=async()=>{let m=!1;const h=x=>{gX(x,()=>t.signal,()=>m=!0)},v=$z(t.options,t.fetchOptions),y=async(x,S,C)=>{if(m)return Promise.reject();if(S==null&&x.pages.length)return Promise.resolve(x);const E=(()=>{const T={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return h(T),T})(),j=await v(E),{maxPages:R}=t.options,N=C?hX:mX;return{pages:N(x.pages,j,R),pageParams:N(x.pageParams,S,R)}};if(i&&o.length){const x=i==="backward",S=x?kX:j$,C={pages:o,pageParams:a},k=S(r,C);l=await y(C,k,x)}else{const x=e??o.length;do{const S=d===0?a[0]??r.initialPageParam:j$(r,l);if(d>0&&S==null)break;l=await y(l,S),d++}while(d<x)}return l};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 j$(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 kX(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var EX=class extends Mz{#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||Fz(),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=Pz({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}),this.#n.config.onMutate&&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{await this.#n.config.onError?.(o,e,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onError?.(o,e,this.state.context,n)}catch(a){Promise.reject(a)}try{await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onSettled?.(void 0,o,e,this.state.context,n)}catch(a){Promise.reject(a)}throw this.#r({type:"error",error:o}),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),cr.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Fz(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Uz=class extends sf{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 EX({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=ov(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=ov(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=ov(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=ov(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){cr.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=>b$(t,n))}findAll(e={}){return this.getAll().filter(t=>b$(e,t))}notify(e){cr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return cr.batch(()=>Promise.all(e.map(t=>t.continue().catch(Zr))))}};function ov(e){return e.options.scope?.id}var jX=class extends sf{#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),gy(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Oc(n.mutationKey)!==Oc(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??Fz();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){cr.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};if(t?.type==="success"){try{this.#i.onSuccess?.(t.data,n,r,i)}catch(o){Promise.reject(o)}try{this.#i.onSettled?.(t.data,null,n,r,i)}catch(o){Promise.reject(o)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,n,r,i)}catch(o){Promise.reject(o)}try{this.#i.onSettled?.(void 0,t.error,n,r,i)}catch(o){Promise.reject(o)}}}this.listeners.forEach(n=>{n(this.#t)})})}},Vz=class extends sf{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??qk(r,t);let o=this.get(i);return o||(o=new SX({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(){cr.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=>y$(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>y$(e,n)):t}notify(e){cr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){cr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){cr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},RX=class{#e;#t;#n;#i;#r;#a;#s;#o;constructor(e={}){this.#e=e.queryCache||new Vz,this.#t=e.mutationCache||new Uz,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#s=Zk.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=vy.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(al(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=dX(t,o);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return cr.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;cr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return cr.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=cr.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Zr).catch(Zr)}invalidateQueries(e,t={}){return cr.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=cr.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(Zr)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Zr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(al(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Zr).catch(Zr)}fetchInfiniteQuery(e){return e.behavior=E$(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Zr).catch(Zr)}ensureInfiniteQueryData(e){return e.behavior=E$(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return vy.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(Oc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{mm(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Oc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{mm(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=qk(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===Kk&&(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()}},d_={exports:{}},dt={};var R$;function IX(){if(R$)return dt;R$=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"),l=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=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 x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function k(P,U,O){this.props=P,this.context=U,this.refs=C,this.updater=O||x}k.prototype.isReactComponent={},k.prototype.setState=function(P,U){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,U,"setState")},k.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function E(){}E.prototype=k.prototype;function j(P,U,O){this.props=P,this.context=U,this.refs=C,this.updater=O||x}var R=j.prototype=new E;R.constructor=j,S(R,k.prototype),R.isPureReactComponent=!0;var N=Array.isArray;function T(){}var A={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function F(P,U,O){var J=O.ref;return{$$typeof:e,type:P,key:U,ref:J!==void 0?J:null,props:O}}function K(P,U){return F(P.type,U,P.props)}function te(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function G(P){var U={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(O){return U[O]})}var q=/\/+/g;function V(P,U){return typeof P=="object"&&P!==null&&P.key!=null?G(""+P.key):U.toString(36)}function H(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(T,T):(P.status="pending",P.then(function(U){P.status==="pending"&&(P.status="fulfilled",P.value=U)},function(U){P.status==="pending"&&(P.status="rejected",P.reason=U)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function z(P,U,O,J,pe){var ge=typeof P;(ge==="undefined"||ge==="boolean")&&(P=null);var Q=!1;if(P===null)Q=!0;else switch(ge){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(P.$$typeof){case e:case t:Q=!0;break;case m:return Q=P._init,z(Q(P._payload),U,O,J,pe)}}if(Q)return pe=pe(P),Q=J===""?"."+V(P,0):J,N(pe)?(O="",Q!=null&&(O=Q.replace(q,"$&/")+"/"),z(pe,U,O,"",function(ke){return ke})):pe!=null&&(te(pe)&&(pe=K(pe,O+(pe.key==null||P&&P.key===pe.key?"":(""+pe.key).replace(q,"$&/")+"/")+Q)),U.push(pe)),1;Q=0;var ve=J===""?".":J+":";if(N(P))for(var be=0;be<P.length;be++)J=P[be],ge=ve+V(J,be),Q+=z(J,U,O,ge,pe);else if(be=y(P),typeof be=="function")for(P=be.call(P),be=0;!(J=P.next()).done;)J=J.value,ge=ve+V(J,be++),Q+=z(J,U,O,ge,pe);else if(ge==="object"){if(typeof P.then=="function")return z(H(P),U,O,J,pe);throw U=String(P),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return Q}function W(P,U,O){if(P==null)return P;var J=[],pe=0;return z(P,J,"","",function(ge){return U.call(O,ge,pe++)}),J}function L(P){if(P._status===-1){var U=P._result;U=U(),U.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=U)}if(P._status===1)return P._result.default;throw P._result}var ne=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=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(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},$={map:W,forEach:function(P,U,O){W(P,function(){U.apply(this,arguments)},O)},count:function(P){var U=0;return W(P,function(){U++}),U},toArray:function(P){return W(P,function(U){return U})||[]},only:function(P){if(!te(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return dt.Activity=h,dt.Children=$,dt.Component=k,dt.Fragment=n,dt.Profiler=i,dt.PureComponent=j,dt.StrictMode=r,dt.Suspense=d,dt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,dt.__COMPILER_RUNTIME={__proto__:null,c:function(P){return A.H.useMemoCache(P)}},dt.cache=function(P){return function(){return P.apply(null,arguments)}},dt.cacheSignal=function(){return null},dt.cloneElement=function(P,U,O){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var J=S({},P.props),pe=P.key;if(U!=null)for(ge in U.key!==void 0&&(pe=""+U.key),U)!D.call(U,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&U.ref===void 0||(J[ge]=U[ge]);var ge=arguments.length-2;if(ge===1)J.children=O;else if(1<ge){for(var Q=Array(ge),ve=0;ve<ge;ve++)Q[ve]=arguments[ve+2];J.children=Q}return F(P.type,pe,J)},dt.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},dt.createElement=function(P,U,O){var J,pe={},ge=null;if(U!=null)for(J in U.key!==void 0&&(ge=""+U.key),U)D.call(U,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(pe[J]=U[J]);var Q=arguments.length-2;if(Q===1)pe.children=O;else if(1<Q){for(var ve=Array(Q),be=0;be<Q;be++)ve[be]=arguments[be+2];pe.children=ve}if(P&&P.defaultProps)for(J in Q=P.defaultProps,Q)pe[J]===void 0&&(pe[J]=Q[J]);return F(P,ge,pe)},dt.createRef=function(){return{current:null}},dt.forwardRef=function(P){return{$$typeof:l,render:P}},dt.isValidElement=te,dt.lazy=function(P){return{$$typeof:m,_payload:{_status:-1,_result:P},_init:L}},dt.memo=function(P,U){return{$$typeof:f,type:P,compare:U===void 0?null:U}},dt.startTransition=function(P){var U=A.T,O={};A.T=O;try{var J=P(),pe=A.S;pe!==null&&pe(O,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(T,ne)}catch(ge){ne(ge)}finally{U!==null&&O.types!==null&&(U.types=O.types),A.T=U}},dt.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},dt.use=function(P){return A.H.use(P)},dt.useActionState=function(P,U,O){return A.H.useActionState(P,U,O)},dt.useCallback=function(P,U){return A.H.useCallback(P,U)},dt.useContext=function(P){return A.H.useContext(P)},dt.useDebugValue=function(){},dt.useDeferredValue=function(P,U){return A.H.useDeferredValue(P,U)},dt.useEffect=function(P,U){return A.H.useEffect(P,U)},dt.useEffectEvent=function(P){return A.H.useEffectEvent(P)},dt.useId=function(){return A.H.useId()},dt.useImperativeHandle=function(P,U,O){return A.H.useImperativeHandle(P,U,O)},dt.useInsertionEffect=function(P,U){return A.H.useInsertionEffect(P,U)},dt.useLayoutEffect=function(P,U){return A.H.useLayoutEffect(P,U)},dt.useMemo=function(P,U){return A.H.useMemo(P,U)},dt.useOptimistic=function(P,U){return A.H.useOptimistic(P,U)},dt.useReducer=function(P,U,O){return A.H.useReducer(P,U,O)},dt.useRef=function(P){return A.H.useRef(P)},dt.useState=function(P){return A.H.useState(P)},dt.useSyncExternalStore=function(P,U,O){return A.H.useSyncExternalStore(P,U,O)},dt.useTransition=function(){return A.H.useTransition()},dt.version="19.2.3",dt}var I$;function Bm(){return I$||(I$=1,d_.exports=IX()),d_.exports}var b=Bm();const X=rf(b),Wk=_Y({__proto__:null,default:X},[b]);var Bz=b.createContext(void 0),ir=e=>{const t=b.useContext(Bz);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},TX=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(Bz.Provider,{value:e,children:t})),Hz=b.createContext(!1),NX=()=>b.useContext(Hz);Hz.Provider;function AX(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var OX=b.createContext(AX()),$X=()=>b.useContext(OX),DX=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?Gk(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},PX=e=>{b.useEffect(()=>{e.clearReset()},[e])},MX=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Gk(n,[e.error,r])),zX=(e,t)=>t.state.data===void 0,LX=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))}},FX=(e,t)=>e.isLoading&&e.isFetching&&!t,UX=(e,t)=>e?.suspense&&t.isPending,T$=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function qz(e,t,n){const r=NX(),i=$X(),o=ir(),a=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(a);const l=o.getQueryCache().get(a.queryHash);a._optimisticResults=r?"isRestoring":"optimistic",LX(a),DX(a,i,l),PX(i);const d=!o.getQueryCache().get(a.queryHash),[f]=b.useState(()=>new t(o,a)),m=f.getOptimisticResult(a),h=!r&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(v=>{const y=h?f.subscribe(cr.batchCalls(v)):Zr;return f.updateResult(),y},[f,h]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),b.useEffect(()=>{f.setOptions(a)},[a,f]),UX(a,m))throw T$(a,f,i);if(MX({result:m,errorResetBoundary:i,throwOnError:a.throwOnError,query:l,suspense:a.suspense}))throw m.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(a,m),a.experimental_prefetchInRender&&!Ac&&FX(m,r)&&(d?T$(a,f,i):l?.promise)?.catch(Zr).finally(()=>{f.updateResult()}),a.notifyOnChangeProps?m:f.trackResult(m)}function Mt(e,t){return qz(e,Lz)}function Ji(e,t){return qz({...e,enabled:!0,suspense:!0,throwOnError:zX,placeholderData:void 0},Lz)}function w2e(e){return e}function ut(e,t){const n=ir(),[r]=b.useState(()=>new jX(n,e));b.useEffect(()=>{r.setOptions(e)},[r,e]);const i=b.useSyncExternalStore(b.useCallback(a=>r.subscribe(cr.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=b.useCallback((a,l)=>{r.mutate(a,l).catch(Zr)},[r]);if(i.error&&Gk(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}async function Kz(){const{data:e}=await Yt.get("/User/current");return e}const Ib=["current-user"];function VX(){return{queryKey:Ib,queryFn:Kz,retry:!1}}async function Hm({instanceClient:e,entityId:t}){const{data:n}=await e.post("/",{operation:"logout"});if(kt.flagForBasicAuth(t,null),n)return n;throw new Error("Something went wrong")}async function sl({instanceClient:e,...t}){const{data:n}=await e.post("/",{operation:"user_info"},t);return n}function Xk(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(Td)),t.includes("://")||(n.protocol="https:"),n.toString()}function Jk(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 BX{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=es({id:t});await Hm({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 qc(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 EY}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?xd&&(r=await sl({instanceClient:es()})):t&&(r=await sl({instanceClient:es({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 kt=new BX,wd=new WeakMap,Jv=new WeakMap,yy={current:[]};let f_=!1,em=0;const Zp=new Set,av=new Map;function Gz(e){const t=Array.from(e).sort((n,r)=>n instanceof Sd&&n.options.deps.includes(r)?1:r instanceof Sd&&r.options.deps.includes(n)?-1:0);for(const n of t){if(yy.current.includes(n))continue;yy.current.push(n),n.recompute();const r=Jv.get(n);if(r)for(const i of r){const o=wd.get(i);o&&Gz(o)}}}function HX(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function qX(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Zz(e){if(em>0&&!av.has(e)&&av.set(e,e.prevState),Zp.add(e),!(em>0)&&!f_)try{for(f_=!0;Zp.size>0;){const t=Array.from(Zp);Zp.clear();for(const n of t){const r=av.get(n)??n.prevState;n.prevState=r,HX(n)}for(const n of t){const r=wd.get(n);r&&(yy.current.push(n),Gz(r))}for(const n of t){const r=wd.get(n);if(r)for(const i of r)qX(i)}}}finally{f_=!1,yy.current=[],av.clear()}}function tm(e){em++;try{e()}finally{if(em--,em===0){const t=Zp.values().next().value;t&&Zz(t)}}}function KX(e){return typeof e=="function"}class lC{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):KX(t)?this.state=t(this.prevState):this.state=t,(i=(r=this.options)==null?void 0:r.onUpdate)==null||i.call(r),Zz(this)}}class Sd{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 Sd&&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 Sd)n.registerOnGraph(),this.registerOnGraph(n.options.deps);else if(n instanceof lC){let r=wd.get(n);r||(r=new Set,wd.set(n,r)),r.add(this);let i=Jv.get(this);i||(i=new Set,Jv.set(this,i)),i.add(n)}}unregisterFromGraph(t=this.options.deps){for(const n of t)if(n instanceof Sd)this.unregisterFromGraph(n.options.deps);else if(n instanceof lC){const r=wd.get(n);r&&r.delete(this);const i=Jv.get(this);i&&i.delete(n)}}}const ll="__TSR_index",N$="popstate",A$="beforeunload";function GX(e){let t=e.getLocation();const n=new Set,r=a=>{t=e.getLocation(),n.forEach(l=>l({location:t,action:a}))},i=a=>{e.notifyOnIndexChange??!0?r(a):t=e.getLocation()},o=async({task:a,navigateOpts:l,...d})=>{if(l?.ignoreBlocker??!1){a();return}const m=e.getBlockers?.()??[],h=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&m.length&&h)for(const v of m){const y=hm(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,l,d)=>{const f=t.state[ll];l=O$(f+1,l),o({task:()=>{e.pushState(a,l),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:a,state:l})},replace:(a,l,d)=>{const f=t.state[ll];l=O$(f,l),o({task:()=>{e.replaceState(a,l),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:a,state:l})},go:(a,l)=>{o({task:()=>{e.go(a),i({type:"GO",index:a})},navigateOpts:l,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[ll]!==0,createHref:a=>e.createHref(a),block:a=>{if(!e.setBlockers)return()=>{};const l=e.getBlockers?.()??[];return e.setBlockers([...l,a]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==a))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function O$(e,t){t||(t={});const n=Qk();return{...t,key:n,__TSR_key:n,[ll]:e}}function Yz(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=D=>i=D,l=e?.createHref??(D=>D),d=e?.parseLocation??(()=>hm(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const D=Qk();t.history.replaceState({[ll]:0,key:D,__TSR_key:D},"")}let f=d(),m,h=!1,v=!1,y=!1,x=!1;const S=()=>f;let C,k;const E=()=>{C&&(A._ignoreSubscribers=!0,(C.isPush?t.history.pushState:t.history.replaceState)(C.state,"",C.href),A._ignoreSubscribers=!1,C=void 0,k=void 0,m=void 0)},j=(D,F,K)=>{const te=l(F);k||(m=f),f=hm(F,K),C={href:te,state:K,isPush:C?.isPush||D==="push"},k||(k=Promise.resolve().then(()=>E()))},R=D=>{f=d(),A.notify({type:D})},N=async()=>{if(v){v=!1;return}const D=d(),F=D.state[ll]-f.state[ll],K=F===1,te=F===-1,G=!K&&!te||h;h=!1;const q=G?"GO":te?"BACK":"FORWARD",V=G?{type:"GO",index:F}:{type:te?"BACK":"FORWARD"};if(y)y=!1;else{const H=o();if(typeof document<"u"&&H.length){for(const z of H)if(await z.blockerFn({currentLocation:f,nextLocation:D,action:q})){v=!0,t.history.go(1),A.notify(V);return}}}f=d(),A.notify(V)},T=D=>{if(x){x=!1;return}let F=!1;const K=o();if(typeof document<"u"&&K.length)for(const te of K){const G=te.enableBeforeUnload??!0;if(G===!0){F=!0;break}if(typeof G=="function"&&G()===!0){F=!0;break}}if(F)return D.preventDefault(),D.returnValue=""},A=GX({getLocation:S,getLength:()=>t.history.length,pushState:(D,F)=>j("push",D,F),replaceState:(D,F)=>j("replace",D,F),back:D=>(D&&(y=!0),x=!0,t.history.back()),forward:D=>{D&&(y=!0),x=!0,t.history.forward()},go:D=>{h=!0,t.history.go(D)},createHref:D=>l(D),flush:E,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(A$,T,{capture:!0}),t.removeEventListener(N$,N)},onBlocked:()=>{m&&f!==m&&(f=m)},getBlockers:o,setBlockers:a,notifyOnIndexChange:!1});return t.addEventListener(A$,T,{capture:!0}),t.addEventListener(N$,N),t.history.pushState=function(...D){const F=n.apply(t.history,D);return A._ignoreSubscribers||R("PUSH"),F},t.history.replaceState=function(...D){const F=r.apply(t.history,D);return A._ignoreSubscribers||R("REPLACE"),F},A}function ZX(e){const t=typeof document<"u"?window:void 0;return Yz({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("#")}`,l=`${r}${i}${a}`;return hm(l,t.history.state)},createHref:n=>`${t.location.pathname}${t.location.search}#${n}`})}function hm(e,t){const n=e.indexOf("#"),r=e.indexOf("?"),i=Qk();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||{[ll]:0,key:i,__TSR_key:i}}}function Qk(){return(Math.random()+1).toString(36).substring(7)}function cC(e){return e[e.length-1]}function YX(e){return typeof e=="function"}function Cc(e,t){return YX(e)?e(t):e}const WX=Object.prototype.hasOwnProperty;function ho(e,t){if(e===t)return e;const n=t,r=P$(e)&&P$(n);if(!r&&!(by(e)&&by(n)))return n;const i=r?e:$$(e);if(!i)return n;const o=r?n:$$(n);if(!o)return n;const a=i.length,l=o.length,d=r?new Array(l):{};let f=0;for(let m=0;m<l;m++){const h=r?m:o[m],v=e[h],y=n[h];if(v===y){d[h]=v,(r?m<a:WX.call(e,h))&&f++;continue}if(v===null||y===null||typeof v!="object"||typeof y!="object"){d[h]=y;continue}const x=ho(v,y);d[h]=x,x===v&&f++}return a===l&&f===a?e:d}function $$(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 by(e){if(!D$(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!D$(n)||!n.hasOwnProperty("isPrototypeOf"))}function D$(e){return Object.prototype.toString.call(e)==="[object Object]"}function P$(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function kc(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(!kc(e[r],t[r],n))return!1;return!0}if(by(e)&&by(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const a in t)if((!r||t[a]!==void 0)&&!kc(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||!kc(e[a],t[a],n)))return!1;return i===o}return!1}function Ad(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 XX(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 cl(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}var JX="Invariant failed";function rs(e,t){if(!e)throw new Error(JX)}const bi="__root__",ga=0,$c=1,Od=2,$d=3;function ts(e){return eE(e.filter(t=>t!==void 0).join("/"))}function eE(e){return e.replace(/\/{2,}/g,"/")}function tE(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function ul(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Qv(e){return ul(tE(e))}function xy(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function QX(e,t,n){return xy(e,n)===xy(t,n)}function eJ(e){const{type:t,value:n}=e;if(t===ga)return n;const{prefixSegment:r,suffixSegment:i}=e;if(t===$c){const o=n.substring(1);if(r&&i)return`${r}{$${o}}${i}`;if(r)return`${r}{$${o}}`;if(i)return`{$${o}}${i}`}if(t===$d){const o=n.substring(1);return r&&i?`${r}{-$${o}}${i}`:r?`${r}{-$${o}}`:i?`{-$${o}}${i}`:`{-$${o}}`}if(t===Od){if(r&&i)return`${r}{$}${i}`;if(r)return`${r}{$}`;if(i)return`{$}${i}`}return n}function tJ({base:e,to:t,trailingSlash:n="never",parseCache:r}){let i=Wz(e,r).slice();const o=Tb(t,r);i.length>1&&cC(i)?.value==="/"&&i.pop();for(let d=0,f=o.length;d<f;d++){const m=o[d],h=m.value;h==="/"?d?d===f-1&&i.push(m):i=[m]:h===".."?i.pop():h==="."||i.push(m)}i.length>1&&(cC(i).value==="/"?n==="never"&&i.pop():n==="always"&&i.push({type:ga,value:"/"}));const a=i.map(eJ);return ts(a)}const Wz=(e,t)=>Xz(e,t,!0),Tb=(e,t)=>Xz(e,t,!1),Xz=(e,t,n)=>{if(!e)return[];const r=t?.get(e);if(r)return r;const i=sJ(e,n);return t?.set(e,i),i},nJ=/^\$.{1,}$/,rJ=/^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,iJ=/^(.*?)\{-(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,oJ=/^\$$/,aJ=/^(.*?)\{\$\}(.*)$/;function sJ(e,t){e=eE(e);const n=[];if(e.slice(0,1)==="/"&&(e=e.substring(1),n.push({type:ga,value:"/"})),!e)return n;const r=e.split("/").filter(Boolean);return n.push(...r.map(i=>{const o=!t&&i!==bi&&i.slice(-1)==="_"?i.slice(0,-1):i,a=o.match(aJ);if(a){const f=a[1],m=a[2];return{type:Od,value:"$",prefixSegment:f||void 0,suffixSegment:m||void 0}}const l=o.match(iJ);if(l){const f=l[1],m=l[2],h=l[3];return{type:$d,value:m,prefixSegment:f||void 0,suffixSegment:h||void 0}}const d=o.match(rJ);if(d){const f=d[1],m=d[2],h=d[3];return{type:$c,value:""+m,prefixSegment:f||void 0,suffixSegment:h||void 0}}if(nJ.test(o)){const f=o.substring(1);return{type:$c,value:"$"+f,prefixSegment:void 0,suffixSegment:void 0}}return oJ.test(o)?{type:Od,value:"$",prefixSegment:void 0,suffixSegment:void 0}:{type:ga,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:ga,value:"/"})),n}function sv({path:e,params:t,leaveWildcards:n,leaveParams:r,decodeCharMap:i,parseCache:o}){const a=Tb(e,o);function l(h){const v=t[h],y=typeof v=="string";return h==="*"||h==="_splat"?y?encodeURI(v):v:y?lJ(v,i):v}let d=!1;const f={},m=ts(a.map(h=>{if(h.type===ga)return h.value;if(h.type===Od){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 x=l("_splat");return n?`${v}${h.value}${x??""}${y}`:`${v}${x}${y}`}if(h.type===$c){const v=h.value.substring(1);!d&&!(v in t)&&(d=!0),f[v]=t[v];const y=h.prefixSegment||"",x=h.suffixSegment||"";if(r){const S=l(h.value);return`${y}${h.value}${S??""}${x}`}return`${y}${l(v)??"undefined"}${x}`}if(h.type===$d){const v=h.value.substring(1),y=h.prefixSegment||"",x=h.suffixSegment||"";if(!(v in t)||t[v]==null)return n?`${y}${v}${x}`:y||x?`${y}${x}`:void 0;if(f[v]=t[v],r){const S=l(h.value);return`${y}${h.value}${S??""}${x}`}return n?`${y}${v}${l(v)??""}${x}`:`${y}${l(v)??""}${x}`}return h.value}));return{usedParams:f,interpolatedPath:m,isMissingParams:d}}function lJ(e,t){let n=encodeURIComponent(e);if(t)for(const[r,i]of t)n=n.replaceAll(r,i);return n}function uC(e,t,n){const r=cJ(e,t,n);if(!(t.to&&!r))return r??{}}function cJ(e,{to:t,fuzzy:n,caseSensitive:r},i){const o=t,a=Wz(e.startsWith("/")?e:`/${e}`,i),l=Tb(o.startsWith("/")?o:`/${o}`,i),d={};return uJ(a,l,d,n,r)?d:void 0}function uJ(e,t,n,r,i){let o=0,a=0;for(;o<e.length||a<t.length;){const l=e[o],d=t[a];if(d){if(d.type===Od){const f=e.slice(o);let m;if(d.prefixSegment||d.suffixSegment){if(!l)return!1;const h=d.prefixSegment||"",v=d.suffixSegment||"",y=l.value;if("prefixSegment"in d&&!y.startsWith(h)||"suffixSegment"in d&&!e[e.length-1]?.value.endsWith(v))return!1;let x=decodeURI(ts(f.map(S=>S.value)));h&&x.startsWith(h)&&(x=x.slice(h.length)),v&&x.endsWith(v)&&(x=x.slice(0,x.length-v.length)),m=x}else m=decodeURI(ts(f.map(h=>h.value)));return n["*"]=m,n._splat=m,!0}if(d.type===ga){if(d.value==="/"&&!l?.value){a++;continue}if(l){if(i){if(d.value!==l.value)return!1}else if(d.value.toLowerCase()!==l.value.toLowerCase())return!1;o++,a++;continue}else return!1}if(d.type===$c){if(!l||l.value==="/")return!1;let f="",m=!1;if(d.prefixSegment||d.suffixSegment){const h=d.prefixSegment||"",v=d.suffixSegment||"",y=l.value;if(h&&!y.startsWith(h)||v&&!y.endsWith(v))return!1;let x=y;h&&x.startsWith(h)&&(x=x.slice(h.length)),v&&x.endsWith(v)&&(x=x.slice(0,x.length-v.length)),f=decodeURIComponent(x),m=!0}else f=decodeURIComponent(l.value),m=!0;m&&(n[d.value.substring(1)]=f,o++),a++;continue}if(d.type===$d){if(!l){a++;continue}if(l.value==="/"){a++;continue}let f="",m=!1;if(d.prefixSegment||d.suffixSegment){const h=d.prefixSegment||"",v=d.suffixSegment||"",y=l.value;if((!h||y.startsWith(h))&&(!v||y.endsWith(v))){let x=y;h&&x.startsWith(h)&&(x=x.slice(h.length)),v&&x.endsWith(v)&&(x=x.slice(0,x.length-v.length)),f=decodeURIComponent(x),m=!0}}else{let h=!0;for(let v=a+1;v<t.length;v++){const y=t[v];if(y?.type===ga&&y.value===l.value){h=!1;break}if(y?.type===$c||y?.type===Od){e.length<t.length&&(h=!1);break}}h&&(f=decodeURIComponent(l.value),m=!0)}m&&(n[d.value.substring(1)]=f,o++),a++;continue}}if(o<e.length&&a>=t.length)return n["**"]=ts(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!==$d)return!1;break}break}return!0}const dJ=.75,fJ=1,pJ=.5,mJ=.4,hJ=.25,gJ=.2,vJ=.05,yJ=.02,bJ=.01,M$=2e-4,z$=1e-4;function L$(e,t){return e.prefixSegment&&e.suffixSegment?t+vJ+M$*e.prefixSegment.length+z$*e.suffixSegment.length:e.prefixSegment?t+yJ+M$*e.prefixSegment.length:e.suffixSegment?t+bJ+z$*e.suffixSegment.length:t}function xJ(e){const t=[];return e.forEach((r,i)=>{if(r.isRoot||!r.path)return;const o=tE(r.fullPath);let a=Tb(o),l=0;for(;a.length>l+1&&a[l]?.value==="/";)l++;l>0&&(a=a.slice(l));let d=0,f=!1;const m=a.map((h,v)=>{if(h.value==="/")return dJ;if(h.type===ga)return fJ;let y;h.type===$c?y=pJ:h.type===$d?(y=mJ,d++):y=hJ;for(let x=v+1;x<a.length;x++){const S=a[x];if(S.type===ga&&S.value!=="/")return f=!0,L$(h,y+gJ)}return L$(h,y)});t.push({child:r,trimmed:o,parsed:a,index:i,scores:m,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 wJ({routeTree:e,initRoute:t}){const n={},r={},i=a=>{a.forEach((l,d)=>{t?.(l,d);const f=n[l.id];if(rs(!f,`Duplicate routes found with id: ${String(l.id)}`),n[l.id]=l,!l.isRoot&&l.path){const h=ul(l.fullPath);(!r[h]||l.fullPath.endsWith("/"))&&(r[h]=l)}const m=l.children;m?.length&&i(m)})};i([e]);const o=xJ(Object.values(n));return{routesById:n,routesByPath:r,flatRoutes:o}}function Ho(e){return!!e?.isNotFound}function SJ(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const wy="tsr-scroll-restoration-v1_3",_J=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function CJ(){const e=SJ();if(!e)return null;const t=e.getItem(wy);let n=t?JSON.parse(t):{};return{state:n,set:r=>(n=Cc(r,n)||n,e.setItem(wy,JSON.stringify(n)))}}const lv=CJ(),dC=e=>e.state.__TSR_key||e.href;function kJ(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 Sy=!1;function Jz({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 l=t||window.history.state?.__TSR_key,d=a[l];Sy=!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 m={top:0,left:0,behavior:n};if(window.scrollTo(m),i)for(const h of i){if(h==="window")continue;const v=typeof h=="function"?h():document.querySelector(h);v&&v.scrollTo(m)}}Sy=!1}function EJ(e,t){if(!lv&&!e.isServer||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isServer||e.isScrollRestorationSetup||!lv))return;e.isScrollRestorationSetup=!0,Sy=!1;const r=e.options.getScrollRestorationKey||dC;window.history.scrollRestoration="manual";const i=o=>{if(Sy||!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=kJ(o.target)}const l=r(e.state.location);lv.set(d=>{const f=d[l]||={},m=f[a]||={};if(a==="window")m.scrollX=window.scrollX||0,m.scrollY=window.scrollY||0;else if(a){const h=document.querySelector(a);h&&(m.scrollX=h.scrollLeft||0,m.scrollY=h.scrollTop||0)}return d})};typeof document<"u"&&document.addEventListener("scroll",_J(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})||(Jz({storageKey:wy,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&lv.set(l=>(l[a]||={},l)))})}function jJ(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 RJ(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 p_(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function IJ(e){const t=new URLSearchParams(e),n={};for(const[r,i]of t.entries()){const o=n[r];o==null?n[r]=p_(i):Array.isArray(o)?o.push(p_(i)):n[r]=[o,p_(i)]}return n}const TJ=AJ(JSON.parse),NJ=OJ(JSON.stringify,JSON.parse);function AJ(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=IJ(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function OJ(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=RJ(i,r);return o?`?${o}`:""}}function Kc(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 da(e){return e instanceof Response&&!!e.options}function $J(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 l=t.get(o);if(l)l.value=a,i(l);else{const d={key:o,value:a,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(o,d)}}}}const ey=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Nb=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Qz=(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),rs(n.options.notFoundComponent);const r=e.matches.find(i=>i.routeId===n.id);rs(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,Qz(e,t))},el=(e,t,n)=>{if(!(!da(n)&&!Ho(n))){if(da(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=da(n)?"redirected":"notFound";e.updateMatch(t.id,i=>({...i,status:r,isFetching:!1,error:n})),Ho(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw da(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(Qz(e,n),n)}},e4=(e,t)=>{const n=e.router.getMatch(t);return!!(!e.router.isServer&&n._nonReactive.dehydrated||e.router.isServer&&n.ssr===!1)},Cp=(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,el(e,e.router.getMatch(i),n);try{a.options.onError?.(n)}catch(l){n=l,el(e,e.router.getMatch(i),n)}e.updateMatch(i,l=>(l._nonReactive.beforeLoadPromise?.resolve(),l._nonReactive.beforeLoadPromise=void 0,l._nonReactive.loadPromise?.resolve(),{...l,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},DJ=(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===bi;return}if(a?.ssr===!1){i.ssr=!1;return}const l=y=>y===!0&&a?.ssr==="data-only"?"data-only":y,d=e.router.options.defaultSsr??!0;if(r.options.ssr===void 0){i.ssr=l(d);return}if(typeof r.options.ssr!="function"){i.ssr=l(r.options.ssr);return}const{search:f,params:m}=i,h={search:cv(f,i.searchError),params:cv(m,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:cv(y.search,y.searchError),params:cv(y.params,y.paramsError),ssr:y.ssr}))},v=r.options.ssr(h);if(cl(v))return v.then(y=>{i.ssr=l(y??d)});i.ssr=l(v??d)},t4=(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&&!Nb(e,t)&&(n.options.loader||n.options.beforeLoad||i4(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const a=setTimeout(()=>{ey(e)},i);r._nonReactive.pendingTimeout=a}},PJ=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;t4(e,t,n,r);const i=()=>{const o=e.router.getMatch(t);o.preload&&(o.status==="redirected"||o.status==="notFound")&&el(e,o,o.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},MJ=(e,t,n,r)=>{const i=e.router.getMatch(t),o=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Ad(()=>{o?.resolve()});const{paramsError:a,searchError:l}=i;a&&Cp(e,n,a,"PARSE_PARAMS"),l&&Cp(e,n,l,"VALIDATE_SEARCH"),t4(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 x=()=>{y||(y=!0,e.updateMatch(t,A=>({...A,isFetching:"beforeLoad",fetchCount:A.fetchCount+1,abortController:d,context:v})))},S=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,A=>({...A,isFetching:!1}))};if(!r.options.beforeLoad){tm(()=>{x(),S()});return}i._nonReactive.beforeLoadPromise=Ad();const{search:C,params:k,cause:E}=i,j=Nb(e,t),R={search:C,abortController:d,params:k,preload:j,context:v,location:e.location,navigate:A=>e.router.navigate({...A,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:j?"preload":E,matches:e.matches,...e.router.options.additionalContext},N=A=>{if(A===void 0){tm(()=>{x(),S()});return}(da(A)||Ho(A))&&(x(),Cp(e,n,A,"BEFORE_LOAD")),tm(()=>{x(),e.updateMatch(t,D=>({...D,__beforeLoadContext:A,context:{...D.context,...A}})),S()})};let T;try{if(T=r.options.beforeLoad(R),cl(T))return x(),T.catch(A=>{Cp(e,n,A,"BEFORE_LOAD")}).then(N)}catch(A){x(),Cp(e,n,A,"BEFORE_LOAD")}N(T)},zJ=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],o=()=>{if(e.router.isServer){const d=DJ(e,n,t,i);if(cl(d))return d.then(l)}return l()},a=()=>MJ(e,n,t,i),l=()=>{if(e4(e,n))return;const d=PJ(e,n,i);return cl(d)?d.then(a):a()};return o()},nm=(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,l])=>{const d=o?.meta,f=o?.links,m=o?.scripts,h=o?.styles;return{meta:d,links:f,headScripts:m,headers:l,scripts:a,styles:h}})},n4=(e,t,n,r)=>{const i=e.matchPromises[n-1],{params:o,loaderDeps:a,abortController:l,context:d,cause:f}=e.router.getMatch(t),m=Nb(e,t);return{params:o,deps:a,preload:!!m,parentMatchPromise:i,abortController:l,context:d,location:e.location,navigate:h=>e.router.navigate({...h,_fromLocation:e.location}),cause:m?"preload":f,route:r,...e.router.options.additionalContext}},F$=async(e,t,n,r)=>{try{const i=e.router.getMatch(t);try{(!e.router.isServer||i.ssr===!0)&&r4(r);const o=r.options.loader?.(n4(e,t,n,r)),a=r.options.loader&&cl(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;el(e,e.router.getMatch(t),h),h!==void 0&&e.updateMatch(t,v=>({...v,loaderData:h}))}r._lazyPromise&&await r._lazyPromise;const d=nm(e,t,r),f=d?await d:void 0,m=i._nonReactive.minPendingPromise;m&&await m,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 l=i._nonReactive.minPendingPromise;l&&await l,Ho(o)&&await r.options.notFoundComponent?.preload?.(),el(e,e.router.getMatch(t),o);try{r.options.onError?.(o)}catch(m){a=m,el(e,e.router.getMatch(t),m)}const d=nm(e,t,r),f=d?await d:void 0;e.updateMatch(t,m=>({...m,error:a,status:"error",isFetching:!1,...f}))}}catch(i){const o=e.router.getMatch(t);if(o){const a=nm(e,t,r);if(a){const l=await a;e.updateMatch(t,d=>({...d,...l}))}o._nonReactive.loaderPromise=void 0}el(e,o,i)}},LJ=async(e,t)=>{const{id:n,routeId:r}=e.matches[t];let i=!1,o=!1;const a=e.router.looseRoutesById[r];if(e4(e,n)){if(e.router.isServer){const f=nm(e,n,a);if(f){const m=await f;e.updateMatch(n,h=>({...h,...m}))}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 m=e.router.getMatch(n);m.error&&el(e,m,m.error)}else{const m=Date.now()-f.updatedAt,h=Nb(e,n),v=h?a.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:a.options.staleTime??e.router.options.defaultStaleTime??0,y=a.options.shouldReload,x=typeof y=="function"?y(n4(e,n,t,a)):y,S=!!h&&!e.router.state.matches.some(j=>j.id===n),C=e.router.getMatch(n);C._nonReactive.loaderPromise=Ad(),S!==C.preload&&e.updateMatch(n,j=>({...j,preload:S}));const{status:k,invalid:E}=C;if(i=k==="success"&&(E||(x??m>v)),!(h&&a.options.preload===!1))if(i&&!e.sync)o=!0,(async()=>{try{await F$(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){da(j)&&await e.router.navigate(j.options)}})();else if(k!=="success"||i&&e.sync)await F$(e,n,t,a);else{const j=nm(e,n,a);if(j){const R=await j;e.updateMatch(n,N=>({...N,...R}))}}}}const l=e.router.getMatch(n);o||(l._nonReactive.loaderPromise?.resolve(),l._nonReactive.loadPromise?.resolve()),clearTimeout(l._nonReactive.pendingTimeout),l._nonReactive.pendingTimeout=void 0,o||(l._nonReactive.loaderPromise=void 0),l._nonReactive.dehydrated=void 0;const d=o?l.isFetching:!1;return d!==l.isFetching||l.invalid!==!1?(e.updateMatch(n,f=>({...f,isFetching:d,invalid:!1})),e.router.getMatch(n)):l};async function U$(e){const t=Object.assign(e,{matchPromises:[]});!t.router.isServer&&t.router.state.matches.some(n=>n._forcePending)&&ey(t);try{for(let i=0;i<t.matches.length;i++){const o=zJ(t,i);cl(o)&&await o}const n=t.firstBadMatchIndex??t.matches.length;for(let i=0;i<n;i++)t.matchPromises.push(LJ(t,i));await Promise.all(t.matchPromises);const r=ey(t);cl(r)&&await r}catch(n){if(Ho(n)&&!t.preload){const r=ey(t);throw cl(r)&&await r,n}if(da(n))throw n}return t.matches}async function r4(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 o4){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 cv(e,t){return t?{status:"error",error:t}:{status:"success",value:e}}function i4(e){for(const t of o4)if(e.options[t]?.preload)return!0;return!1}const o4=["component","errorComponent","pendingComponent","notFoundComponent"];function FJ(e){return{input:({url:t})=>{for(const n of e)t=a4(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=s4(e[n],t);return t}}}function UJ(e){const t=Qv(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),o=e.caseSensitive?r:r.toLowerCase();return{input:({url:a})=>{const l=e.caseSensitive?a.pathname:a.pathname.toLowerCase();return l===i?a.pathname="/":l.startsWith(o)&&(a.pathname=a.pathname.slice(n.length)),a},output:({url:a})=>(a.pathname=ts(["/",t,a.pathname]),a)}}function a4(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 s4(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 Ec(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 VJ{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=Yz())),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 lC(HJ(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(v=>!["redirected"].includes(v.status))}}}),EJ(this));let l=!1;const d=this.options.basepath??"/",f=this.options.rewrite;if(o||i!==d||a!==f){this.basepath=d;const v=[];Qv(d)!==""&&v.push(UJ({basepath:d})),f&&v.push(f),this.rewrite=v.length===0?void 0:v.length===1?v[0]:FJ(v),this.history&&this.updateLatestLocation(),l=!0}l&&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}=wJ({routeTree:this.routeTree,initRoute:(a,l)=>{a.init({originalIndex:l})}});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 m=new URL(d,this.origin),h=a4(this.rewrite,m),v=this.options.parseSearch(h.search),y=this.options.stringifySearch(v);h.search=y;const x=h.href.replace(h.origin,""),{pathname:S,hash:C}=h;return{href:x,publicHref:d,url:h.href,pathname:S,searchStr:y,search:ho(r?.search,v),hash:C.split("#").reverse()[0]??"",state:ho(r?.state,f)}},o=i(n),{__tempLocation:a,__tempKey:l}=o.state;if(a&&(!l||l===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)=>tJ({base:n,to:eE(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=$J(1e3),this.getMatchedRoutes=(n,r)=>qJ({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,l=this.matchRoutes(a,{_buildLocation:!0}),d=cC(l);o.from;const f=o.unsafeRelative==="path"?a.pathname:o.from??d.fullPath,m=this.resolvePathWithBase(f,"."),h=d.search,v={...d.params},y=o.to?this.resolvePathWithBase(m,`${o.to}`):this.resolvePathWithBase(m,"."),x=o.params===!1||o.params===null?{}:(o.params??!0)===!0?v:Object.assign(v,Cc(o.params,v)),S=sv({path:y,params:x,parseCache:this.parsePathnameCache}).interpolatedPath,C=this.matchRoutes(S,void 0,{_buildLocation:!0}).map(K=>this.looseRoutesById[K.routeId]);if(Object.keys(x).length>0)for(const K of C){const te=K.options.params?.stringify??K.options.stringifyParams;te&&Object.assign(x,te(x))}const k=sv({path:y,params:x,leaveWildcards:!1,leaveParams:n.leaveParams,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath;let E=h;if(n._includeValidateSearch&&this.options.search?.strict){const K={};C.forEach(te=>{if(te.options.validateSearch)try{Object.assign(K,fC(te.options.validateSearch,{...K,...E}))}catch{}}),E=K}E=KJ({search:E,dest:o,destRoutes:C,_includeValidateSearch:n._includeValidateSearch}),E=ho(h,E);const j=this.options.stringifySearch(E),R=o.hash===!0?a.hash:o.hash?Cc(o.hash,a.hash):void 0,N=R?`#${R}`:"";let T=o.state===!0?a.state:o.state?Cc(o.state,a.state):{};T=ho(a.state,T);const A=`${k}${j}${N}`,D=new URL(A,this.origin),F=s4(this.rewrite,D);return{publicHref:F.pathname+F.search+F.hash,href:A,url:F.href,pathname:k,search:E,searchStr:j,state:T,hash:R??"",unmaskOnReload:o.unmaskOnReload}},i=(o={},a)=>{const l=r(o);let d=a?r(a):void 0;if(!d){let f={};const m=this.options.routeMasks?.find(h=>{const v=uC(l.pathname,{to:h.from,caseSensitive:!1,fuzzy:!1},this.parsePathnameCache);return v?(f=v,!0):!1});if(m){const{from:h,...v}=m;a={from:n.from,...v,params:f},d=r(a)}}return d&&(l.maskedLocation=d),l};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(m=>{i.state[m]=this.latestLocation.state[m]});const f=kc(i.state,this.latestLocation.state);return d.forEach(m=>{delete i.state[m]}),f},a=ul(this.latestLocation.href)===ul(i.href),l=this.commitLocationPromise;if(this.commitLocationPromise=Ad(()=>{l?.resolve()}),a&&o())this.load();else{let{maskedLocation:d,hashScrollIntoView:f,...m}=i;d&&(m={...d,state:{...d.state,__tempKey:void 0,__tempLocation:{...m,search:m.searchStr,state:{...m.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(m.unmaskOnReload??this.options.unmaskOnReload??!1)&&(m.state.__tempKey=this.tempLocationKey)),m.state.__hashScrollIntoViewOptions=f??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[i.replace?"replace":"push"](m.publicHref,m.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:l,...d}={})=>{if(l){const m=this.history.location.state.__TSR_index,h=hm(l,{__TSR_index:n?m:m+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(Qv(i(this.latestLocation.href))!==Qv(i(r.href))){let o=r.url;throw this.origin&&o.startsWith(this.origin)&&(o=o.replace(this.origin,"")||"/"),Kc({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(l=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,f=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Ec({resolvedLocation:f,location:d})}),this.emit({type:"onBeforeLoad",...Ec({resolvedLocation:f,location:d})}),await U$({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startViewTransition(async()=>{let m,h,v;tm(()=>{this.__store.setState(y=>{const x=y.matches,S=y.pendingMatches||y.matches;return m=x.filter(C=>!S.some(k=>k.id===C.id)),h=S.filter(C=>!x.some(k=>k.id===C.id)),v=x.filter(C=>S.some(k=>k.id===C.id)),{...y,isLoading:!1,loadedAt:Date.now(),matches:S,pendingMatches:void 0,cachedMatches:[...y.cachedMatches,...m.filter(C=>C.status!=="error")]}}),this.clearExpiredCache()}),[[m,"onLeave"],[h,"onEnter"],[v,"onStay"]].forEach(([y,x])=>{y.forEach(S=>{this.looseRoutesById[S.routeId].options[x]?.(S)})})})}})}catch(d){da(d)?(r=d,this.isServer||this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):Ho(d)&&(i=d),this.__store.setState(f=>({...f,statusCode:r?r.status:i?404:f.matches.some(m=>m.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===o&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),l()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.__store.state.matches.some(l=>l.status==="error")&&(a=500),a!==void 0&&this.__store.setState(l=>({...l,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,l=typeof r.types=="function"?r.types(Ec({resolvedLocation:a,location:o})):r.types;if(l===!1){n();return}i={update:n,types:l}}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=r4,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(l=>l.id)),a=new Set([...o,...this.state.cachedMatches.map(l=>l.id)]);tm(()=>{i.forEach(l=>{a.has(l.id)||this.__store.setState(d=>({...d,cachedMatches:[...d.cachedMatches,l]}))})});try{return i=await U$({router:this,matches:i,location:r,preload:!0,updateMatch:(l,d)=>{o.has(l)?i=i.map(f=>f.id===l?d(f):f):this.updateMatch(l,d)}}),i}catch(l){if(da(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:r});Ho(l)||console.error(l);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 l=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=uC(l.pathname,{...r,to:o.pathname},this.parsePathnameCache);return!d||n.params&&!kc(d,n.params,{partial:!0})?!1:d&&(r?.includeSearch??!0)?kc(l.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??NJ,parseSearch:t.parseSearch??TJ}),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["**"]:ul(t.pathname))&&(this.options.notFoundRoute?i.push(this.options.notFoundRoute):a=!0);const l=(()=>{if(a){if(this.options.notFoundMode!=="root")for(let m=i.length-1;m>=0;m--){const h=i[m];if(h.children)return h.id}return bi}})(),d=[],f=m=>m?.id?m.context??this.options.context??void 0:this.options.context??void 0;return i.forEach((m,h)=>{const v=d[h-1],[y,x,S]=(()=>{const G=v?.search??t.search,q=v?._strictSearch??void 0;try{const V=fC(m.options.validateSearch,{...G})??void 0;return[{...G,...V},{...q,...V},void 0]}catch(V){let H=V;if(V instanceof _y||(H=new _y(V.message,{cause:V})),n?.throwOnError)throw H;return[G,{},H]}})(),C=m.options.loaderDeps?.({search:y})??"",k=C?JSON.stringify(C):"",{interpolatedPath:E,usedParams:j}=sv({path:m.fullPath,params:o,decodeCharMap:this.pathParamsDecodeCharMap}),R=sv({path:m.id,params:o,leaveWildcards:!0,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath+k,N=this.getMatch(R),T=this.state.matches.find(G=>G.routeId===m.id),A=N?._strictParams??j;let D;if(!N){const G=m.options.params?.parse??m.options.parseParams;if(G)try{Object.assign(A,G(A))}catch(q){if(D=new BJ(q.message,{cause:q}),n?.throwOnError)throw D}}Object.assign(o,A);const F=T?"stay":"enter";let K;if(N)K={...N,cause:F,params:T?ho(T.params,o):o,_strictParams:A,search:ho(T?T.search:N.search,y),_strictSearch:x};else{const G=m.options.loader||m.options.beforeLoad||m.lazyFn||i4(m)?"pending":"success";K={id:R,index:h,routeId:m.id,params:T?ho(T.params,o):o,_strictParams:A,pathname:E,updatedAt:Date.now(),search:T?ho(T.search,y):y,_strictSearch:x,searchError:void 0,status:G,isFetching:!1,error:void 0,paramsError:D,__routeContext:void 0,_nonReactive:{loadPromise:Ad()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:F,loaderDeps:T?ho(T.loaderDeps,C):C,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}n?.preload||(K.globalNotFound=l===m.id),K.searchError=S;const te=f(v);K.context={...te,...K.__routeContext,...K.__beforeLoadContext},d.push(K)}),d.forEach((m,h)=>{const v=this.looseRoutesById[m.routeId];if(!this.getMatch(m.id)&&n?._buildLocation!==!0){const x=d[h-1],S=f(x);if(v.options.context){const C={deps:m.loaderDeps,params:m.params,context:S??{},location:t,navigate:k=>this.navigate({...k,_fromLocation:t}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:d};m.__routeContext=v.options.context(C)??void 0}m.context={...S,...m.__routeContext,...m.__beforeLoadContext}}}),d}}class _y extends Error{}class BJ extends Error{}function HJ(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function fC(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new _y("Async validation not supported");if(n.issues)throw new _y(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 qJ({pathname:e,routePathname:t,caseSensitive:n,routesByPath:r,routesById:i,flatRoutes:o,parseCache:a}){let l={};const d=ul(e),f=y=>uC(d,{to:y.fullPath,caseSensitive:y.options?.caseSensitive??n,fuzzy:!0},a);let m=t!==void 0?r[t]:void 0;if(m)l=f(m);else{let y;for(const x of o){const S=f(x);if(S)if(x.path!=="/"&&S["**"])y||(y={foundRoute:x,routeParams:S});else{m=x,l=S;break}}!m&&y&&(m=y.foundRoute,l=y.routeParams)}let h=m||i[bi];const v=[h];for(;h.parentRoute;)h=h.parentRoute,v.push(h);return v.reverse(),{matchedRoutes:v,routeParams:l,foundRoute:m}}function KJ({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){const i=n.reduce((l,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 m=({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 x=v(y);return"postSearchFilters"in d.options&&d.options.postSearchFilters?d.options.postSearchFilters.reduce((S,C)=>C(S),x):x};f.push(m)}if(r&&d.options.validateSearch){const m=({search:h,next:v})=>{const y=v(h);try{return{...y,...fC(d.options.validateSearch,y)??void 0}}catch{return y}};f.push(m)}return l.concat(f)},[])??[],o=({search:l})=>t.search?t.search===!0?l:Cc(t.search,l):{};i.push(o);const a=(l,d)=>{if(l>=i.length)return d;const f=i[l];return f({search:d,next:h=>a(l+1,h)})};return a(0,e)}const GJ="Error preloading route! ☝️";class l4{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=bi:this.parentRoute||rs(!1);let o=i?bi:r?.path;o&&o!=="/"&&(o=tE(o));const a=r?.id||o;let l=i?bi:ts([this.parentRoute.id===bi?"":this.parentRoute.id,a]);o===bi&&(o="/"),l!==bi&&(l=ts(["/",l]));const d=l===bi?"/":ts([this.parentRoute.fullPath,o]);this._path=o,this._id=l,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 ZJ extends l4{constructor(t){super(t)}}function nE(e){const t=e.errorComponent??Ab;return u.jsx(YJ,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?b.createElement(t,{error:n,reset:r}):e.children})}class YJ extends b.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 Ab({error:e}){const[t,n]=b.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 WJ({children:e,fallback:t=null}){return XJ()?u.jsx(X.Fragment,{children:e}):u.jsx(X.Fragment,{children:t})}function XJ(){return X.useSyncExternalStore(JJ,()=>!0,()=>!1)}function JJ(){return()=>{}}var m_={exports:{}},h_={},g_={exports:{}},v_={};var V$;function QJ(){if(V$)return v_;V$=1;var e=Bm();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 l(h,v){var y=v(),x=r({inst:{value:y,getSnapshot:v}}),S=x[0].inst,C=x[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 m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:l;return v_.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,v_}var B$;function eQ(){return B$||(B$=1,g_.exports=QJ()),g_.exports}var H$;function tQ(){if(H$)return h_;H$=1;var e=Bm(),t=eQ();function n(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,l=e.useMemo,d=e.useDebugValue;return h_.useSyncExternalStoreWithSelector=function(f,m,h,v,y){var x=o(null);if(x.current===null){var S={hasValue:!1,value:null};x.current=S}else S=x.current;x=l(function(){function k(T){if(!E){if(E=!0,j=T,T=v(T),y!==void 0&&S.hasValue){var A=S.value;if(y(A,T))return R=A}return R=T}if(A=R,r(j,T))return A;var D=v(T);return y!==void 0&&y(A,D)?(j=T,A):(j=T,R=D)}var E=!1,j,R,N=h===void 0?null:h;return[function(){return k(m())},N===null?void 0:function(){return k(N())}]},[m,h,v,y]);var C=i(f,x[0],x[1]);return a(function(){S.hasValue=!0,S.value=C},[C]),d(C),C},h_}var q$;function nQ(){return q$||(q$=1,m_.exports=tQ()),m_.exports}var rQ=nQ();function iQ(e,t=n=>n){return rQ.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,oQ)}function oQ(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=K$(e);if(n.length!==K$(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 K$(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const y_=b.createContext(null);function c4(){return typeof document>"u"?y_:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=y_,y_)}function _n(e){const t=b.useContext(c4());return e?.warn,t}function Xr(e){const t=_n({warn:e?.router===void 0}),n=e?.router||t,r=b.useRef(void 0);return iQ(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const o=ho(r.current,e.select(i));return r.current=o,o}return e.select(i)}return i})}const Ob=b.createContext(void 0),aQ=b.createContext(void 0);function qo(e){const t=b.useContext(e.from?aQ:Ob);return Xr({select:r=>{const i=r.matches.find(o=>e.from?e.from===o.routeId:o.id===t);if(rs(!((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 qm(e){return qo({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function rE(e){const{select:t,...n}=e;return qo({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function rt(e){return qo({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 Tr(e){return qo({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function jn(e){const t=_n();return b.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function jc(e){const t=_n(),n=jn(),r=b.useRef(null);return b.useEffect(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}var b_={exports:{}},Nr={};var G$;function sQ(){if(G$)return Nr;G$=1;var e=Bm();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)f+="&args[]="+encodeURIComponent(arguments[m])}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,m){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:m}}var a=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Nr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Nr.createPortal=function(d,f){var m=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,m)},Nr.flushSync=function(d){var f=a.T,m=r.p;try{if(a.T=null,r.p=2,d)return d()}finally{a.T=f,r.p=m,r.d.f()}},Nr.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))},Nr.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},Nr.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var m=f.as,h=l(m,f.crossOrigin),v=typeof f.integrity=="string"?f.integrity:void 0,y=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;m==="style"?r.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:h,integrity:v,fetchPriority:y}):m==="script"&&r.d.X(d,{crossOrigin:h,integrity:v,fetchPriority:y,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Nr.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var m=l(f.as,f.crossOrigin);r.d.M(d,{crossOrigin:m,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)},Nr.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var m=f.as,h=l(m,f.crossOrigin);r.d.L(d,m,{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})}},Nr.preloadModule=function(d,f){if(typeof d=="string")if(f){var m=l(f.as,f.crossOrigin);r.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(d)},Nr.requestFormReset=function(d){r.d.r(d)},Nr.unstable_batchedUpdates=function(d,f){return d(f)},Nr.useFormState=function(d,f,m){return a.H.useFormState(d,f,m)},Nr.useFormStatus=function(){return a.H.useHostTransitionStatus()},Nr.version="19.2.3",Nr}var Z$;function u4(){if(Z$)return b_.exports;Z$=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(),b_.exports=sQ(),b_.exports}var lf=u4();const iE=rf(lf),uv=typeof window<"u"?b.useLayoutEffect:b.useEffect;function x_(e){const t=b.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function lQ(e,t,n={},r={}){b.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 cQ(e){const t=b.useRef(null);return b.useImperativeHandle(e,()=>t.current,[]),t}function uQ(e,t){const n=_n(),[r,i]=b.useState(!1),o=b.useRef(!1),a=cQ(t),{activeProps:l,inactiveProps:d,activeOptions:f,to:m,preload:h,preloadDelay:v,hashScrollIntoView:y,replace:x,startTransition:S,resetScroll:C,viewTransition:k,children:E,target:j,disabled:R,style:N,className:T,onClick:A,onFocus:D,onMouseEnter:F,onMouseLeave:K,onTouchStart:te,ignoreBlocker:G,params:q,search:V,hash:H,state:z,mask:W,reloadDocument:L,unsafeRelative:ne,from:$,_fromLocation:P,...U}=e,O=Xr({select:se=>se.location.search,structuralSharing:!0}),J=e.from,pe=b.useMemo(()=>({...e,from:J}),[n,O,J,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ge=b.useMemo(()=>n.buildLocation({...pe}),[n,pe]),Q=b.useMemo(()=>{if(R)return;let se=ge.maskedLocation?ge.maskedLocation.url:ge.url,ie=!1;return n.origin&&(se.startsWith(n.origin)?se=n.history.createHref(se.replace(n.origin,""))||"/":ie=!0),{href:se,external:ie}},[R,ge.maskedLocation,ge.url,n.origin,n.history]),ve=b.useMemo(()=>{if(Q?.external)return Q.href;try{return new URL(m),m}catch{}},[m,Q]),be=e.reloadDocument||ve?!1:h??n.options.defaultPreload,ke=v??n.options.defaultPreloadDelay??0,$e=Xr({select:se=>{if(ve)return!1;if(f?.exact){if(!QX(se.location.pathname,ge.pathname,n.basepath))return!1}else{const ie=xy(se.location.pathname,n.basepath),fe=xy(ge.pathname,n.basepath);if(!(ie.startsWith(fe)&&(ie.length===fe.length||ie[fe.length]==="/")))return!1}return(f?.includeSearch??!0)&&!kc(se.location.search,ge.search,{partial:!f?.exact,ignoreUndefined:!f?.explicitUndefined})?!1:f?.includeHash?se.location.hash===ge.hash:!0}}),Le=b.useCallback(()=>{n.preloadRoute({...pe}).catch(se=>{console.warn(se),console.warn(GJ)})},[n,pe]),St=b.useCallback(se=>{se?.isIntersecting&&Le()},[Le]);lQ(a,St,hQ,{disabled:!!R||be!=="viewport"}),b.useEffect(()=>{o.current||!R&&be==="render"&&(Le(),o.current=!0)},[R,Le,be]);const ct=se=>{const ie=se.currentTarget.target,fe=j!==void 0?j:ie;if(!R&&!gQ(se)&&!se.defaultPrevented&&(!fe||fe==="_self")&&se.button===0){se.preventDefault(),lf.flushSync(()=>{i(!0)});const B=n.subscribe("onResolved",()=>{B(),i(!1)});n.navigate({...pe,replace:x,resetScroll:C,hashScrollIntoView:y,startTransition:S,viewTransition:k,ignoreBlocker:G})}};if(ve)return{...U,ref:a,href:ve,...E&&{children:E},...j&&{target:j},...R&&{disabled:R},...N&&{style:N},...T&&{className:T},...A&&{onClick:A},...D&&{onFocus:D},...F&&{onMouseEnter:F},...K&&{onMouseLeave:K},...te&&{onTouchStart:te}};const Qe=se=>{R||be&&Le()},zt=Qe,Bt=se=>{if(!(R||!be))if(!ke)Le();else{const ie=se.target;if(kp.has(ie))return;const fe=setTimeout(()=>{kp.delete(ie),Le()},ke);kp.set(ie,fe)}},dr=se=>{if(R||!be||!ke)return;const ie=se.target,fe=kp.get(ie);fe&&(clearTimeout(fe),kp.delete(ie))},Xt=$e?Cc(l,{})??dQ:w_,An=$e?w_:Cc(d,{})??w_,Z=[T,Xt.className,An.className].filter(Boolean).join(" "),re=(N||Xt.style||An.style)&&{...N,...Xt.style,...An.style};return{...U,...Xt,...An,href:Q?.href,ref:a,onClick:Ep([A,ct]),onFocus:Ep([D,Qe]),onMouseEnter:Ep([F,Bt]),onMouseLeave:Ep([K,dr]),onTouchStart:Ep([te,zt]),disabled:!!R,target:j,...re&&{style:re},...Z&&{className:Z},...R&&fQ,...$e&&pQ,...r&&mQ}}const w_={},dQ={className:"active"},fQ={role:"link","aria-disabled":!0},pQ={"data-status":"active","aria-current":"page"},mQ={"data-transitioning":"transitioning"},kp=new WeakMap,hQ={rootMargin:"100px"},Ep=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}},Ze=b.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,ref:o,...a}=uQ(r,t),l=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;return n===void 0&&delete a.disabled,b.createElement(n||"a",{...a,ref:o},l)});function gQ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class vQ extends l4{constructor(t){super(t),this.useMatch=n=>qo({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>qo({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>Tr({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>rt({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>rE({...n,from:this.id}),this.useLoaderData=n=>qm({...n,from:this.id}),this.useNavigate=()=>jn({from:this.fullPath}),this.Link=X.forwardRef((n,r)=>u.jsx(Ze,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function nt(e){return new vQ(e)}function yQ(){return e=>xQ(e)}class bQ extends ZJ{constructor(t){super(t),this.useMatch=n=>qo({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>qo({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>Tr({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>rt({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>rE({...n,from:this.id}),this.useLoaderData=n=>qm({...n,from:this.id}),this.useNavigate=()=>jn({from:this.fullPath}),this.Link=X.forwardRef((n,r)=>u.jsx(Ze,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function xQ(e){return new bQ(e)}function Y$(e){return typeof e=="object"?new W$(e,{silent:!0}).createRoute(e):new W$(e,{silent:!0}).createRoute}class W${constructor(t,n){this.path=t,this.createRoute=r=>{this.silent;const i=nt(r);return i.isRoot=!1,i},this.silent=n?.silent}}class pC{constructor(t){this.useMatch=n=>qo({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>qo({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>Tr({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>rt({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>rE({...n,from:this.options.id}),this.useLoaderData=n=>qm({...n,from:this.options.id}),this.useNavigate=()=>{const n=_n();return jn({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function S2e(e){return t=>new pC({id:e,...t})}function X$(e){return typeof e=="object"?new pC(e):t=>new pC({id:e,...t})}function d4(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,XX(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),l=function(f){if(o)throw window.location.reload(),new Promise(()=>{});if(i)throw i;if(!r)throw a();return b.createElement(r,f)};return l.preload=a,l}function wQ(){const e=_n(),t=b.useRef({router:e,mounted:!1}),[n,r]=b.useState(!1),{hasPendingMatches:i,isLoading:o}=Xr({select:h=>({isLoading:h.isLoading,hasPendingMatches:h.matches.some(v=>v.status==="pending")}),structuralSharing:!0}),a=x_(o),l=o||n||i,d=x_(l),f=o||i,m=x_(f);return e.startTransition=h=>{r(!0),b.startTransition(()=>{h(),r(!1)})},b.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 ul(e.latestLocation.href)!==ul(v.href)&&e.commitLocation({...v,replace:!0}),()=>{h()}},[e,e.history]),uv(()=>{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]),uv(()=>{a&&!o&&e.emit({type:"onLoad",...Ec(e.state)})},[a,e,o]),uv(()=>{m&&!f&&e.emit({type:"onBeforeRouteMount",...Ec(e.state)})},[f,m,e]),uv(()=>{d&&!l&&(e.emit({type:"onResolved",...Ec(e.state)}),e.__store.setState(h=>({...h,status:"idle",resolvedLocation:h.location})),jJ(e))},[l,d,e]),null}function SQ(e){const t=Xr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return u.jsx(nE,{getResetKey:()=>t,onCatch:(n,r)=>{if(Ho(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(Ho(n))return e.fallback?.(n);throw n},children:e.children})}function _Q(){return u.jsx("p",{children:"Not Found"})}function cd(e){return u.jsx(u.Fragment,{children:e.children})}function f4(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(_Q,{})}function CQ({children:e}){const t=_n();return t.isServer?u.jsx("script",{nonce:t.options.ssr?.nonce,className:"$tsr",dangerouslySetInnerHTML:{__html:[e].filter(Boolean).join(`
10
- `)+";$_TSR.c()"}}):null}function kQ(){const e=_n();if(!e.isScrollRestoring||!e.isServer||typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return null;const n=(e.options.getScrollRestorationKey||dC)(e.latestLocation),r=n!==dC(e.latestLocation)?n:void 0,i={storageKey:wy,shouldScrollRestoration:!0};return r&&(i.key=r),u.jsx(CQ,{children:`(${Jz.toString()})(${JSON.stringify(i)})`})}const p4=b.memo(function({matchId:t}){const n=_n(),r=Xr({select:k=>{const E=k.matches.find(j=>j.id===t);return rs(E),{routeId:E.routeId,ssr:E.ssr,_displayPending:E._displayPending}},structuralSharing:!0}),i=n.routesById[r.routeId],o=i.options.pendingComponent??n.options.defaultPendingComponent,a=o?u.jsx(o,{}):null,l=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,m=r.ssr===!1||r.ssr==="data-only",h=(!i.isRoot||i.options.wrapInSuspense||m)&&(i.options.wrapInSuspense??o??(i.options.errorComponent?.preload||m))?b.Suspense:cd,v=l?nE:cd,y=f?SQ:cd,x=Xr({select:k=>k.loadedAt}),S=Xr({select:k=>{const E=k.matches.findIndex(j=>j.id===t);return k.matches[E-1]?.routeId}}),C=i.isRoot?i.options.shellComponent??cd:cd;return u.jsxs(C,{children:[u.jsx(Ob.Provider,{value:t,children:u.jsx(h,{fallback:a,children:u.jsx(v,{getResetKey:()=>x,errorComponent:l||Ab,onCatch:(k,E)=>{if(Ho(k))throw k;d?.(k,E)},children:u.jsx(y,{fallback:k=>{if(!f||k.routeId&&k.routeId!==r.routeId||!k.routeId&&!i.isRoot)throw k;return b.createElement(f,k)},children:m||r._displayPending?u.jsx(WJ,{fallback:a,children:u.jsx(J$,{matchId:t})}):u.jsx(J$,{matchId:t})})})})}),S===bi&&n.options.scrollRestoration?u.jsxs(u.Fragment,{children:[u.jsx(EQ,{}),u.jsx(kQ,{})]}):null]})});function EQ(){const e=_n(),t=b.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",...Ec(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const J$=b.memo(function({matchId:t}){const n=_n(),{match:r,key:i,routeId:o}=Xr({select:d=>{const f=d.matches.find(x=>x.id===t),m=f.routeId,v=(n.routesById[m].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:m,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch});return{key:v?JSON.stringify(v):void 0,routeId:m,match:{id:f.id,status:f.status,error:f.error,_forcePending:f._forcePending,_displayPending:f._displayPending}}},structuralSharing:!0}),a=n.routesById[o],l=b.useMemo(()=>{const d=a.options.component??n.options.defaultComponent;return d?u.jsx(d,{},i):u.jsx(jl,{})},[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 m=Ad();f._nonReactive.minPendingPromise=m,setTimeout(()=>{m.resolve(),f._nonReactive.minPendingPromise=void 0},d)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return rs(Ho(r.error)),f4(n,a,r.error);if(r.status==="redirected")throw rs(da(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error"){if(n.isServer){const d=(a.options.errorComponent??n.options.defaultErrorComponent)||Ab;return u.jsx(d,{error:r.error,reset:void 0,info:{componentStack:""}})}throw r.error}return l}),jl=b.memo(function(){const t=_n(),n=b.useContext(Ob),r=Xr({select:f=>f.matches.find(m=>m.id===n)?.routeId}),i=t.routesById[r],o=Xr({select:f=>{const h=f.matches.find(v=>v.id===n);return rs(h),h.globalNotFound}}),a=Xr({select:f=>{const m=f.matches,h=m.findIndex(v=>v.id===n);return m[h+1]?.id}}),l=t.options.defaultPendingComponent?u.jsx(t.options.defaultPendingComponent,{}):null;if(o)return f4(t,i,void 0);if(!a)return null;const d=u.jsx(p4,{matchId:a});return n===bi?u.jsx(b.Suspense,{fallback:l,children:d}):d});function jQ(){const e=_n(),n=e.routesById[bi].options.pendingComponent??e.options.defaultPendingComponent,r=n?u.jsx(n,{}):null,i=e.isServer||typeof document<"u"&&e.ssr?cd:b.Suspense,o=u.jsxs(i,{fallback:r,children:[!e.isServer&&u.jsx(wQ,{}),u.jsx(RQ,{})]});return e.options.InnerWrap?u.jsx(e.options.InnerWrap,{children:o}):o}function RQ(){const e=_n(),t=Xr({select:i=>i.matches[0]?.id}),n=Xr({select:i=>i.loadedAt}),r=t?u.jsx(p4,{matchId:t}):null;return u.jsx(Ob.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:u.jsx(nE,{getResetKey:()=>n,errorComponent:Ab,onCatch:i=>{i.message||i.toString()},children:r})})}const IQ=e=>new TQ(e);class TQ extends VJ{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=Y$,globalThis.createLazyFileRoute=X$):typeof window<"u"&&(window.createFileRoute=Y$,window.createLazyFileRoute=X$);function NQ({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=c4(),i=u.jsx(r.Provider,{value:e,children:t});return e.options.Wrap?u.jsx(e.options.Wrap,{children:i}):i}function AQ({router:e,...t}){return u.jsx(NQ,{router:e,...t,children:u.jsx(jQ,{})})}function $b(e){return qo({...e,select:t=>e.select?e.select(t.context):t.context})}function OQ(e){return Xr({select:t=>t.location})}function $Q(){const[e,t]=b.useState(kt.getAllConnections());return b.useEffect(()=>kt.listenToAllEntities((n,r)=>{t({...e,[r]:n})}),[e]),e}function Gc(){const e=kt.calculateIdFromEntity($n),[t,n]=b.useState(kt.getConnectionById($n));return b.useEffect(()=>kt.listenToEntity(e,n),[e]),t}function Rl(){return Gc()}function ms(e){const t=$n,{clusterId:n,instanceId:r}=rt({strict:!1}),[i,o]=b.useState(kt.getConnectionById(t));return b.useEffect(()=>kt.listenToEntity(t,o),[t]),i}function m4(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=m4(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function h4(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=m4(e))&&(r&&(r+=" "),r+=t);return r}const Q$=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,yr=h4,Db=(e,t)=>n=>{var r;if(t?.variants==null)return yr(e,n?.class,n?.className);const{variants:i,defaultVariants:o}=t,a=Object.keys(i).map(f=>{const m=n?.[f],h=o?.[f];if(m===null)return null;const v=Q$(m)||Q$(h);return i[f][v]}),l=n&&Object.entries(n).reduce((f,m)=>{let[h,v]=m;return v===void 0||(f[h]=v),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,m)=>{let{class:h,className:v,...y}=m;return Object.entries(y).every(x=>{let[S,C]=x;return Array.isArray(C)?C.includes({...o,...l}[S]):{...o,...l}[S]===C})?[...f,h,v]:f},[]);return yr(e,a,d,n?.class,n?.className)},jp="hover:-translate-y-1 transition duration-200",Rp="border bg-transparent border-2 text-white shadow-xs hover:bg-grey-700/40",DQ=Db(`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:`${Rp} ${jp}`,ghostOutline:`${Rp} ${jp} border-none`,positiveOutline:`${Rp} ${jp} border-green`,destructiveOutline:`${Rp} ${jp} border-destructive`,defaultOutline:`${Rp} ${jp} 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"}}),PQ=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},MQ=(e,t)=>({classGroupId:e,validator:t}),g4=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Cy="-",eD=[],zQ="arbitrary..",LQ=e=>{const t=UQ(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return FQ(a);const l=a.split(Cy),d=l[0]===""&&l.length>1?1:0;return v4(l,d,t)},getConflictingClassGroupIds:(a,l)=>{if(l){const d=r[a],f=n[a];return d?f?PQ(f,d):d:f||eD}return n[a]||eD}}},v4=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],o=n.nextPart.get(i);if(o){const f=v4(e,t+1,o);if(f)return f}const a=n.validators;if(a===null)return;const l=t===0?e.join(Cy):e.slice(t).join(Cy),d=a.length;for(let f=0;f<d;f++){const m=a[f];if(m.validator(l))return m.classGroupId}},FQ=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?zQ+r:void 0})(),UQ=e=>{const{theme:t,classGroups:n}=e;return VQ(n,t)},VQ=(e,t)=>{const n=g4();for(const r in e){const i=e[r];oE(i,n,r,t)}return n},oE=(e,t,n,r)=>{const i=e.length;for(let o=0;o<i;o++){const a=e[o];BQ(a,t,n,r)}},BQ=(e,t,n,r)=>{if(typeof e=="string"){HQ(e,t,n);return}if(typeof e=="function"){qQ(e,t,n,r);return}KQ(e,t,n,r)},HQ=(e,t,n)=>{const r=e===""?t:y4(t,e);r.classGroupId=n},qQ=(e,t,n,r)=>{if(GQ(e)){oE(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(MQ(n,e))},KQ=(e,t,n,r)=>{const i=Object.entries(e),o=i.length;for(let a=0;a<o;a++){const[l,d]=i[a];oE(d,y4(t,l),n,r)}},y4=(e,t)=>{let n=e;const r=t.split(Cy),i=r.length;for(let o=0;o<i;o++){const a=r[o];let l=n.nextPart.get(a);l||(l=g4(),n.nextPart.set(a,l)),n=l}return n},GQ=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,ZQ=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(o,a)=>{n[o]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let a=n[o];if(a!==void 0)return a;if((a=r[o])!==void 0)return i(o,a),a},set(o,a){o in n?n[o]=a:i(o,a)}}},mC="!",tD=":",YQ=[],nD=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),WQ=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let a=0,l=0,d=0,f;const m=i.length;for(let S=0;S<m;S++){const C=i[S];if(a===0&&l===0){if(C===tD){o.push(i.slice(d,S)),d=S+1;continue}if(C==="/"){f=S;continue}}C==="["?a++:C==="]"?a--:C==="("?l++:C===")"&&l--}const h=o.length===0?i:i.slice(d);let v=h,y=!1;h.endsWith(mC)?(v=h.slice(0,-1),y=!0):h.startsWith(mC)&&(v=h.slice(1),y=!0);const x=f&&f>d?f-d:void 0;return nD(o,y,v,x)};if(t){const i=t+tD,o=r;r=a=>a.startsWith(i)?o(a.slice(i.length)):nD(YQ,!1,a,void 0,!0)}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},XQ=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let o=0;o<n.length;o++){const a=n[o],l=a[0]==="[",d=t.has(a);l||d?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(a)):i.push(a)}return i.length>0&&(i.sort(),r.push(...i)),r}},JQ=e=>({cache:ZQ(e.cacheSize),parseClassName:WQ(e),sortModifiers:XQ(e),...LQ(e)}),QQ=/\s+/,eee=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,a=[],l=e.trim().split(QQ);let d="";for(let f=l.length-1;f>=0;f-=1){const m=l[f],{isExternal:h,modifiers:v,hasImportantModifier:y,baseClassName:x,maybePostfixModifierPosition:S}=n(m);if(h){d=m+(d.length>0?" "+d:d);continue}let C=!!S,k=r(C?x.substring(0,S):x);if(!k){if(!C){d=m+(d.length>0?" "+d:d);continue}if(k=r(x),!k){d=m+(d.length>0?" "+d:d);continue}C=!1}const E=v.length===0?"":v.length===1?v[0]:o(v).join(":"),j=y?E+mC:E,R=j+k;if(a.indexOf(R)>-1)continue;a.push(R);const N=i(k,C);for(let T=0;T<N.length;++T){const A=N[T];a.push(j+A)}d=m+(d.length>0?" "+d:d)}return d},tee=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=b4(n))&&(i&&(i+=" "),i+=r);return i},b4=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=b4(e[r]))&&(n&&(n+=" "),n+=t);return n},nee=(e,...t)=>{let n,r,i,o;const a=d=>{const f=t.reduce((m,h)=>h(m),e());return n=JQ(f),r=n.cache.get,i=n.cache.set,o=l,l(d)},l=d=>{const f=r(d);if(f)return f;const m=eee(d,n);return i(d,m),m};return o=a,(...d)=>o(tee(...d))},ree=[],lr=e=>{const t=n=>n[e]||ree;return t.isThemeGetter=!0,t},x4=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,w4=/^\((?:(\w[\w-]*):)?(.+)\)$/i,iee=/^\d+\/\d+$/,oee=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,aee=/\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$/,see=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lee=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cee=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Wu=e=>iee.test(e),Et=e=>!!e&&!Number.isNaN(Number(e)),Hs=e=>!!e&&Number.isInteger(Number(e)),S_=e=>e.endsWith("%")&&Et(e.slice(0,-1)),Za=e=>oee.test(e),uee=()=>!0,dee=e=>aee.test(e)&&!see.test(e),S4=()=>!1,fee=e=>lee.test(e),pee=e=>cee.test(e),mee=e=>!He(e)&&!qe(e),hee=e=>cf(e,k4,S4),He=e=>x4.test(e),cc=e=>cf(e,E4,dee),__=e=>cf(e,xee,Et),rD=e=>cf(e,_4,S4),gee=e=>cf(e,C4,pee),dv=e=>cf(e,j4,fee),qe=e=>w4.test(e),Ip=e=>uf(e,E4),vee=e=>uf(e,wee),iD=e=>uf(e,_4),yee=e=>uf(e,k4),bee=e=>uf(e,C4),fv=e=>uf(e,j4,!0),cf=(e,t,n)=>{const r=x4.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},uf=(e,t,n=!1)=>{const r=w4.exec(e);return r?r[1]?t(r[1]):n:!1},_4=e=>e==="position"||e==="percentage",C4=e=>e==="image"||e==="url",k4=e=>e==="length"||e==="size"||e==="bg-size",E4=e=>e==="length",xee=e=>e==="number",wee=e=>e==="family-name",j4=e=>e==="shadow",See=()=>{const e=lr("color"),t=lr("font"),n=lr("text"),r=lr("font-weight"),i=lr("tracking"),o=lr("leading"),a=lr("breakpoint"),l=lr("container"),d=lr("spacing"),f=lr("radius"),m=lr("shadow"),h=lr("inset-shadow"),v=lr("text-shadow"),y=lr("drop-shadow"),x=lr("blur"),S=lr("perspective"),C=lr("aspect"),k=lr("ease"),E=lr("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...R(),qe,He],T=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],D=()=>[qe,He,d],F=()=>[Wu,"full","auto",...D()],K=()=>[Hs,"none","subgrid",qe,He],te=()=>["auto",{span:["full",Hs,qe,He]},Hs,qe,He],G=()=>[Hs,"auto",qe,He],q=()=>["auto","min","max","fr",qe,He],V=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...D()],W=()=>[Wu,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],L=()=>[e,qe,He],ne=()=>[...R(),iD,rD,{position:[qe,He]}],$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],P=()=>["auto","cover","contain",yee,hee,{size:[qe,He]}],U=()=>[S_,Ip,cc],O=()=>["","none","full",f,qe,He],J=()=>["",Et,Ip,cc],pe=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[Et,S_,iD,rD],ve=()=>["","none",x,qe,He],be=()=>["none",Et,qe,He],ke=()=>["none",Et,qe,He],$e=()=>[Et,qe,He],Le=()=>[Wu,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Za],breakpoint:[Za],color:[uee],container:[Za],"drop-shadow":[Za],ease:["in","out","in-out"],font:[mee],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Za],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Za],shadow:[Za],spacing:["px",Et],text:[Za],"text-shadow":[Za],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Wu,He,qe,C]}],container:["container"],columns:[{columns:[Et,He,qe,l]}],"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:N()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{start:F()}],end:[{end:F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[Hs,"auto",qe,He]}],basis:[{basis:[Wu,"full","auto",l,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Et,Wu,"auto","initial","none",He]}],grow:[{grow:["",Et,qe,He]}],shrink:[{shrink:["",Et,qe,He]}],order:[{order:[Hs,"first","last","none",qe,He]}],"grid-cols":[{"grid-cols":K()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":K()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...V(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...V()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":V()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],w:[{w:[l,"screen",...W()]}],"min-w":[{"min-w":[l,"screen","none",...W()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[a]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",n,Ip,cc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,qe,__]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",S_,He]}],"font-family":[{font:[vee,He,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,qe,He]}],"line-clamp":[{"line-clamp":[Et,"none",qe,__]}],leading:[{leading:[o,...D()]}],"list-image":[{"list-image":["none",qe,He]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",qe,He]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...pe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Et,"from-font","auto",qe,cc]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[Et,"auto",qe,He]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",qe,He]}],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",qe,He]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:$()}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Hs,qe,He],radial:["",qe,He],conic:[Hs,qe,He]},bee,gee]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:U()}],"gradient-via-pos":[{via:U()}],"gradient-to-pos":[{to:U()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],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:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...pe(),"hidden","none"]}],"divide-style":[{divide:[...pe(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...pe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Et,qe,He]}],"outline-w":[{outline:["",Et,Ip,cc]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",m,fv,dv]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",h,fv,dv]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[Et,cc]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",v,fv,dv]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[Et,qe,He]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"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":[Et]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[qe,He]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":R()}],"mask-image-conic-pos":[{"mask-conic":[Et]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:$()}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",qe,He]}],filter:[{filter:["","none",qe,He]}],blur:[{blur:ve()}],brightness:[{brightness:[Et,qe,He]}],contrast:[{contrast:[Et,qe,He]}],"drop-shadow":[{"drop-shadow":["","none",y,fv,dv]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",Et,qe,He]}],"hue-rotate":[{"hue-rotate":[Et,qe,He]}],invert:[{invert:["",Et,qe,He]}],saturate:[{saturate:[Et,qe,He]}],sepia:[{sepia:["",Et,qe,He]}],"backdrop-filter":[{"backdrop-filter":["","none",qe,He]}],"backdrop-blur":[{"backdrop-blur":ve()}],"backdrop-brightness":[{"backdrop-brightness":[Et,qe,He]}],"backdrop-contrast":[{"backdrop-contrast":[Et,qe,He]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Et,qe,He]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Et,qe,He]}],"backdrop-invert":[{"backdrop-invert":["",Et,qe,He]}],"backdrop-opacity":[{"backdrop-opacity":[Et,qe,He]}],"backdrop-saturate":[{"backdrop-saturate":[Et,qe,He]}],"backdrop-sepia":[{"backdrop-sepia":["",Et,qe,He]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",qe,He]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Et,"initial",qe,He]}],ease:[{ease:["linear","initial",k,qe,He]}],delay:[{delay:[Et,qe,He]}],animate:[{animate:["none",E,qe,He]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,qe,He]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:be()}],"rotate-x":[{"rotate-x":be()}],"rotate-y":[{"rotate-y":be()}],"rotate-z":[{"rotate-z":be()}],scale:[{scale:ke()}],"scale-x":[{"scale-x":ke()}],"scale-y":[{"scale-y":ke()}],"scale-z":[{"scale-z":ke()}],"scale-3d":["scale-3d"],skew:[{skew:$e()}],"skew-x":[{"skew-x":$e()}],"skew-y":[{"skew-y":$e()}],transform:[{transform:[qe,He,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Le()}],"translate-x":[{"translate-x":Le()}],"translate-y":[{"translate-y":Le()}],"translate-z":[{"translate-z":Le()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",qe,He]}],"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":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",qe,He]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[Et,Ip,cc,__]}],stroke:[{stroke:["none",...L()]}],"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"]}},_ee=nee(See);function Ue(...e){return _ee(h4(e))}function oD(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function df(...e){return t=>{let n=!1;const r=e.map(i=>{const o=oD(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():oD(e[i],null)}}}}function pt(...e){return b.useCallback(df(...e),e)}var Cee=Symbol.for("react.lazy"),ky=Wk[" use ".trim().toString()];function kee(e){return typeof e=="object"&&e!==null&&"then"in e}function R4(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Cee&&"_payload"in e&&kee(e._payload)}function I4(e){const t=Eee(e),n=b.forwardRef((r,i)=>{let{children:o,...a}=r;R4(o)&&typeof ky=="function"&&(o=ky(o._payload));const l=b.Children.toArray(o),d=l.find(Ree);if(d){const f=d.props.children,m=l.map(h=>h===d?b.Children.count(f)>1?b.Children.only(null):b.isValidElement(f)?f.props.children:null:h);return u.jsx(t,{...a,ref:i,children:b.isValidElement(f)?b.cloneElement(f,void 0,m):null})}return u.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var aE=I4("Slot");function Eee(e){const t=b.forwardRef((n,r)=>{let{children:i,...o}=n;if(R4(i)&&typeof ky=="function"&&(i=ky(i._payload)),b.isValidElement(i)){const a=Tee(i),l=Iee(o,i.props);return i.type!==b.Fragment&&(l.ref=r?df(r,a):a),b.cloneElement(i,l)}return b.Children.count(i)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var jee=Symbol("radix.slottable");function Ree(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===jee}function Iee(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]=(...l)=>{const d=o(...l);return i(...l),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Tee(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 xe({className:e,variant:t,size:n,asChild:r=!1,...i}){const o=r?aE:"button";return u.jsx(o,{"data-slot":"button",className:Ue(DQ({variant:t,size:n,className:e})),...i})}function Dc({className:e,...t}){return u.jsx("div",{"data-slot":"card",className:Ue("bg-card text-card-foreground flex flex-col gap-6 rounded-xl py-4 shadow-deep",e),...t})}function Il({className:e,...t}){return u.jsx("div",{"data-slot":"card-header",className:Ue("flex flex-col gap-1.5 px-6",e),...t})}function Tl({className:e,...t}){return u.jsx("div",{"data-slot":"card-title",className:Ue("leading-none text-lg",e),...t})}function Zc({className:e,...t}){return u.jsx("div",{"data-slot":"card-description",className:Ue("text-muted-foreground text-xs",e),...t})}function hs({className:e,...t}){return u.jsx("div",{"data-slot":"card-content",className:Ue("px-6",e),...t})}function Nee(e){return e!==null&&!!e.username}function Yc(e){if(e&&!Nee(e)){const t=Object.keys(e.roles);if(t.length===1)return`/${t[0]}`}return"/"}const T4=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const Aee=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Oee=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const aD=e=>{const t=Oee(e);return t.charAt(0).toUpperCase()+t.slice(1)};var $ee={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 Dee=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const Pee=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...l},d)=>b.createElement("svg",{ref:d,...$ee,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:T4("lucide",i),...!o&&!Dee(l)&&{"aria-hidden":"true"},...l},[...a.map(([f,m])=>b.createElement(f,m)),...Array.isArray(o)?o:[o]]));const Ve=(e,t)=>{const n=b.forwardRef(({className:r,...i},o)=>b.createElement(Pee,{ref:o,iconNode:t,className:T4(`lucide-${Aee(aD(e))}`,`lucide-${e}`,r),...i}));return n.displayName=aD(e),n};const Mee=[["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"}]],zee=Ve("activity",Mee);const Lee=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Pb=Ve("arrow-down",Lee);const Fee=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Pc=Ve("arrow-left",Fee);const Uee=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],xi=Ve("arrow-right",Uee);const Vee=[["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"}]],Bee=Ve("arrow-up-down",Vee);const Hee=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],qee=Ve("arrow-up",Hee);const Kee=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Gee=Ve("ban",Kee);const Zee=[["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"}]],N4=Ve("book-open-text",Zee);const Yee=[["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"}]],Wee=Ve("boxes",Yee);const Xee=[["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"}]],Jee=Ve("bug",Xee);const Qee=[["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"}]],A4=Ve("chart-pie",Qee);const ete=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],sE=Ve("check",ete);const tte=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],O4=Ve("chevron-down",tte);const nte=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],rte=Ve("chevron-up",nte);const ite=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],ote=Ve("circle-check-big",ite);const ate=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],$4=Ve("circle",ate);const ste=[["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"}]],lte=Ve("clipboard-check",ste);const cte=[["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"}]],ute=Ve("cloud-alert",cte);const dte=[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]],fte=Ve("cloud-download",dte);const pte=[["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"}]],D4=Ve("cloud-upload",pte);const mte=[["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"}]],hte=Ve("columns-3-cog",mte);const gte=[["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"}]],P4=Ve("copy",gte);const vte=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],M4=Ve("credit-card",vte);const yte=[["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"}]],bte=Ve("database",yte);const xte=[["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"}]],z4=Ve("download",xte);const wte=[["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"}]],lE=Ve("ellipsis",wte);const Ste=[["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"}]],_te=Ve("external-link",Ste);const Cte=[["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"}]],kte=Ve("file",Cte);const Ete=[["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"}]],jte=Ve("folder",Ete);const Rte=[["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"}]],Ite=Ve("funnel-plus",Rte);const Tte=[["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"}]],sD=Ve("funnel-x",Tte);const Nte=[["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"}]],Ate=Ve("funnel",Nte);const Ote=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],$te=Ve("gauge",Ote);const Dte=[["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"}]],Pte=Ve("git-branch",Dte);const Mte=[["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"}]],cE=Ve("github",Mte);const zte=[["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"}]],Lte=Ve("grip-vertical",zte);const Fte=[["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"}]],L4=Ve("handshake",Fte);const Ute=[["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"}]],Vte=Ve("house",Ute);const Bte=[["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"}]],F4=Ve("key",Bte);const Hte=[["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"}]],qte=Ve("link",Hte);const Kte=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],U4=Ve("loader-circle",Kte);const Gte=[["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"}]],Zte=Ve("lock",Gte);const Yte=[["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"}]],Wte=Ve("log-in",Yte);const Xte=[["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"}]],Jte=Ve("log-out",Xte);const Qte=[["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"}]],ene=Ve("mail-warning",Qte);const tne=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],V4=Ve("menu",tne);const nne=[["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"}]],rne=Ve("notepad-text",nne);const ine=[["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"}]],uE=Ve("package",ine);const one=[["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"}]],ane=Ve("panel-right-close",one);const sne=[["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"}]],lne=Ve("panel-right-open",sne);const cne=[["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"}]],B4=Ve("pencil",cne);const une=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Qr=Ve("plus",une);const dne=[["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"}]],H4=Ve("receipt-text",dne);const fne=[["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"}]],pne=Ve("receipt",fne);const mne=[["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"}]],xa=Ve("refresh-cw",mne);const hne=[["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"}]],q4=Ve("rocket",hne);const gne=[["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"}]],vne=Ve("rotate-ccw",gne);const yne=[["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"}]],To=Ve("save",yne);const bne=[["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"}]],xne=Ve("server",bne);const wne=[["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"}]],Sne=Ve("settings",wne);const _ne=[["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"}]],Cne=Ve("table",_ne);const kne=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],dE=Ve("terminal",kne);const Ene=[["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"}]],jne=Ve("trash-2",Ene);const Rne=[["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"}]],Ca=Ve("trash",Rne);const Ine=[["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"}]],Tne=Ve("triangle-alert",Ine);const Nne=[["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"}]],Ane=Ve("undo-2",Nne);const One=[["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"}]],K4=Ve("users",One);const $ne=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],G4=Ve("x",$ne);function Ey({className:e,error:t,title:n,showReturnToHome:r,children:i}){const{user:o,isLoading:a}=Gc();return Yc(o),u.jsxs(Dc,{className:Ue("text-red p-5 border border-red rounded-md m-12 mt-36",e),children:[u.jsxs(Il,{children:[u.jsx(Tl,{className:"text-2xl",children:u.jsx("h2",{children:n??"Component Error"})}),u.jsx(Zc,{children:t.message})]}),u.jsxs(hs,{children:[i,r!==!1&&(o&&!a?u.jsx(Ze,{to:ba,children:u.jsxs(xe,{children:[" ",u.jsx(Pc,{})," Return to Home"]})}):u.jsx(Ze,{to:"/sign-in",children:u.jsxs(xe,{children:[" ",u.jsx(Pc,{})," Go to Sign In Page"]})}))]})]})}function Dne(){const{user:e,isLoading:t}=Gc();return Yc(e),u.jsx("div",{className:"flex items-center justify-center h-screen px-3",children:u.jsxs(Dc,{className:"text-red p-5 border border-red rounded-md w-full max-w-md",children:[u.jsx(Il,{children:u.jsx(Tl,{className:"text-2xl",children:u.jsx("h2",{children:"Sorry, Page Not Found"})})}),u.jsx(hs,{children:e&&!t?u.jsx(Ze,{to:ba,children:u.jsxs(xe,{children:[" ",u.jsx(Pc,{})," Return to Home"]})}):u.jsx(Ze,{to:"/sign-in",children:u.jsxs(xe,{children:[" ",u.jsx(Pc,{})," Go Sign In Page"]})})})]})})}function Pne(){return"ontouchstart"in window||navigator.maxTouchPoints>0}function Mne(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 zne=e=>{switch(e){case"success":return Une;case"info":return Bne;case"warning":return Vne;case"error":return Hne;default:return null}},Lne=Array(12).fill(0),Fne=({visible:e,className:t})=>X.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},X.createElement("div",{className:"sonner-spinner"},Lne.map((n,r)=>X.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Une=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"})),Vne=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"})),Bne=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"})),Hne=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"})),qne=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"})),Kne=()=>{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 hC=1;class Gne{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:hC++,a=this.toasts.find(d=>d.id===o),l=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:l,title:r}):d):this.addToast({title:r,...i,dismissible:l,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 l=i.then(async f=>{if(a=["resolve",f],X.isValidElement(f))o=!1,this.create({id:r,type:"default",message:f});else if(Yne(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,x=typeof h=="object"&&!X.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:v,...x})}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,x=typeof h=="object"&&!X.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:v,...x})}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,x=typeof h=="object"&&!X.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:v,...x})}}).catch(async f=>{if(a=["reject",f],n.error!==void 0){o=!1;const m=typeof n.error=="function"?await n.error(f):n.error,h=typeof n.description=="function"?await n.description(f):n.description,y=typeof m=="object"&&!X.isValidElement(m)?m:{message:m};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,m)=>l.then(()=>a[0]==="reject"?m(a[1]):f(a[1])).catch(m));return typeof r!="string"&&typeof r!="number"?{unwrap:d}:Object.assign(r,{unwrap:d})},this.custom=(t,n)=>{const r=n?.id||hC++;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 vi=new Gne,Zne=(e,t)=>{const n=t?.id||hC++;return vi.addToast({title:e,...t,id:n}),n},Yne=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Wne=Zne,Xne=()=>vi.toasts,Jne=()=>vi.getActiveToasts(),Se=Object.assign(Wne,{success:vi.success,info:vi.info,warning:vi.warning,error:vi.error,custom:vi.custom,message:vi.message,promise:vi.promise,dismiss:vi.dismiss,loading:vi.loading},{getHistory:Xne,getToasts:Jne});Mne("[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 pv(e){return e.label!==void 0}const Qne=3,ere="24px",tre="16px",lD=4e3,nre=356,rre=14,ire=45,ore=200;function aa(...e){return e.filter(Boolean).join(" ")}function are(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const sre=e=>{var t,n,r,i,o,a,l,d,f;const{invert:m,toast:h,unstyled:v,interacting:y,setHeights:x,visibleToasts:S,heights:C,index:k,toasts:E,expanded:j,removeToast:R,defaultRichColors:N,closeButton:T,style:A,cancelButtonStyle:D,actionButtonStyle:F,className:K="",descriptionClassName:te="",duration:G,position:q,gap:V,expandByDefault:H,classNames:z,icons:W,closeButtonAriaLabel:L="Close toast"}=e,[ne,$]=X.useState(null),[P,U]=X.useState(null),[O,J]=X.useState(!1),[pe,ge]=X.useState(!1),[Q,ve]=X.useState(!1),[be,ke]=X.useState(!1),[$e,Le]=X.useState(!1),[St,ct]=X.useState(0),[Qe,zt]=X.useState(0),Bt=X.useRef(h.duration||G||lD),dr=X.useRef(null),Xt=X.useRef(null),An=k===0,Z=k+1<=S,re=h.type,se=h.dismissible!==!1,ie=h.className||"",fe=h.descriptionClassName||"",B=X.useMemo(()=>C.findIndex(We=>We.toastId===h.id)||0,[C,h.id]),le=X.useMemo(()=>{var We;return(We=h.closeButton)!=null?We:T},[h.closeButton,T]),Ee=X.useMemo(()=>h.duration||G||lD,[h.duration,G]),Me=X.useRef(0),Ke=X.useRef(0),Jt=X.useRef(0),Ht=X.useRef(null),[Cn,Lt]=q.split("-"),fn=X.useMemo(()=>C.reduce((We,rn,Wn)=>Wn>=B?We:We+rn.height,0),[C,B]),jt=Kne(),ar=h.invert||m,Rn=re==="loading";Ke.current=X.useMemo(()=>B*V+fn,[B,fn]),X.useEffect(()=>{Bt.current=Ee},[Ee]),X.useEffect(()=>{J(!0)},[]),X.useEffect(()=>{const We=Xt.current;if(We){const rn=We.getBoundingClientRect().height;return zt(rn),x(Wn=>[{toastId:h.id,height:rn,position:h.position},...Wn]),()=>x(Wn=>Wn.filter(pr=>pr.toastId!==h.id))}},[x,h.id]),X.useLayoutEffect(()=>{if(!O)return;const We=Xt.current,rn=We.style.height;We.style.height="auto";const Wn=We.getBoundingClientRect().height;We.style.height=rn,zt(Wn),x(pr=>pr.find(pn=>pn.toastId===h.id)?pr.map(pn=>pn.toastId===h.id?{...pn,height:Wn}:pn):[{toastId:h.id,height:Wn,position:h.position},...pr])},[O,h.title,h.description,x,h.id,h.jsx,h.action,h.cancel]);const fr=X.useCallback(()=>{ge(!0),ct(Ke.current),x(We=>We.filter(rn=>rn.toastId!==h.id)),setTimeout(()=>{R(h)},ore)},[h,R,x,Ke]);X.useEffect(()=>{if(h.promise&&re==="loading"||h.duration===1/0||h.type==="loading")return;let We;return j||y||jt?(()=>{if(Jt.current<Me.current){const pr=new Date().getTime()-Me.current;Bt.current=Bt.current-pr}Jt.current=new Date().getTime()})():Bt.current!==1/0&&(Me.current=new Date().getTime(),We=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),fr()},Bt.current)),()=>clearTimeout(We)},[j,y,h,re,jt,fr]),X.useEffect(()=>{h.delete&&(fr(),h.onDismiss==null||h.onDismiss.call(h,h))},[fr,h.delete]);function ys(){var We;if(W?.loading){var rn;return X.createElement("div",{className:aa(z?.loader,h==null||(rn=h.classNames)==null?void 0:rn.loader,"sonner-loader"),"data-visible":re==="loading"},W.loading)}return X.createElement(Fne,{className:aa(z?.loader,h==null||(We=h.classNames)==null?void 0:We.loader),visible:re==="loading"})}const bs=h.icon||W?.[re]||zne(re);var Ia,qt;return X.createElement("li",{tabIndex:0,ref:Xt,className:aa(K,ie,z?.toast,h==null||(t=h.classNames)==null?void 0:t.toast,z?.default,z?.[re],h==null||(n=h.classNames)==null?void 0:n[re]),"data-sonner-toast":"","data-rich-colors":(Ia=h.richColors)!=null?Ia:N,"data-styled":!(h.jsx||h.unstyled||v),"data-mounted":O,"data-promise":!!h.promise,"data-swiped":$e,"data-removed":pe,"data-visible":Z,"data-y-position":Cn,"data-x-position":Lt,"data-index":k,"data-front":An,"data-swiping":Q,"data-dismissible":se,"data-type":re,"data-invert":ar,"data-swipe-out":be,"data-swipe-direction":P,"data-expanded":!!(j||H&&O),"data-testid":h.testId,style:{"--index":k,"--toasts-before":k,"--z-index":E.length-k,"--offset":`${pe?St:Ke.current}px`,"--initial-height":H?"auto":`${Qe}px`,...A,...h.style},onDragEnd:()=>{ve(!1),$(null),Ht.current=null},onPointerDown:We=>{We.button!==2&&(Rn||!se||(dr.current=new Date,ct(Ke.current),We.target.setPointerCapture(We.pointerId),We.target.tagName!=="BUTTON"&&(ve(!0),Ht.current={x:We.clientX,y:We.clientY})))},onPointerUp:()=>{var We,rn,Wn;if(be||!se)return;Ht.current=null;const pr=Number(((We=Xt.current)==null?void 0:We.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ea=Number(((rn=Xt.current)==null?void 0:rn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),pn=new Date().getTime()-((Wn=dr.current)==null?void 0:Wn.getTime()),oi=ne==="x"?pr:ea,ql=Math.abs(oi)/pn;if(Math.abs(oi)>=ire||ql>.11){ct(Ke.current),h.onDismiss==null||h.onDismiss.call(h,h),U(ne==="x"?pr>0?"right":"left":ea>0?"down":"up"),fr(),ke(!0);return}else{var ai,si;(ai=Xt.current)==null||ai.style.setProperty("--swipe-amount-x","0px"),(si=Xt.current)==null||si.style.setProperty("--swipe-amount-y","0px")}Le(!1),ve(!1),$(null)},onPointerMove:We=>{var rn,Wn,pr;if(!Ht.current||!se||((rn=window.getSelection())==null?void 0:rn.toString().length)>0)return;const pn=We.clientY-Ht.current.y,oi=We.clientX-Ht.current.x;var ql;const ai=(ql=e.swipeDirections)!=null?ql:are(q);!ne&&(Math.abs(oi)>1||Math.abs(pn)>1)&&$(Math.abs(oi)>Math.abs(pn)?"x":"y");let si={x:0,y:0};const du=Do=>1/(1.5+Math.abs(Do)/20);if(ne==="y"){if(ai.includes("top")||ai.includes("bottom"))if(ai.includes("top")&&pn<0||ai.includes("bottom")&&pn>0)si.y=pn;else{const Do=pn*du(pn);si.y=Math.abs(Do)<Math.abs(pn)?Do:pn}}else if(ne==="x"&&(ai.includes("left")||ai.includes("right")))if(ai.includes("left")&&oi<0||ai.includes("right")&&oi>0)si.x=oi;else{const Do=oi*du(oi);si.x=Math.abs(Do)<Math.abs(oi)?Do:oi}(Math.abs(si.x)>0||Math.abs(si.y)>0)&&Le(!0),(Wn=Xt.current)==null||Wn.style.setProperty("--swipe-amount-x",`${si.x}px`),(pr=Xt.current)==null||pr.style.setProperty("--swipe-amount-y",`${si.y}px`)}},le&&!h.jsx&&re!=="loading"?X.createElement("button",{"aria-label":L,"data-disabled":Rn,"data-close-button":!0,onClick:Rn||!se?()=>{}:()=>{fr(),h.onDismiss==null||h.onDismiss.call(h,h)},className:aa(z?.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(qt=W?.close)!=null?qt:qne):null,(re||h.icon||h.promise)&&h.icon!==null&&(W?.[re]!==null||h.icon)?X.createElement("div",{"data-icon":"",className:aa(z?.icon,h==null||(i=h.classNames)==null?void 0:i.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||ys():null,h.type!=="loading"?bs:null):null,X.createElement("div",{"data-content":"",className:aa(z?.content,h==null||(o=h.classNames)==null?void 0:o.content)},X.createElement("div",{"data-title":"",className:aa(z?.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:aa(te,fe,z?.description,h==null||(l=h.classNames)==null?void 0:l.description)},typeof h.description=="function"?h.description():h.description):null),X.isValidElement(h.cancel)?h.cancel:h.cancel&&pv(h.cancel)?X.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||D,onClick:We=>{pv(h.cancel)&&se&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,We),fr())},className:aa(z?.cancelButton,h==null||(d=h.classNames)==null?void 0:d.cancelButton)},h.cancel.label):null,X.isValidElement(h.action)?h.action:h.action&&pv(h.action)?X.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||F,onClick:We=>{pv(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,We),!We.defaultPrevented&&fr())},className:aa(z?.actionButton,h==null||(f=h.classNames)==null?void 0:f.actionButton)},h.action.label):null)};function cD(){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 lre(e,t){const n={};return[e,t].forEach((r,i)=>{const o=i===1,a=o?"--mobile-offset":"--offset",l=o?tre:ere;function d(f){["top","right","bottom","left"].forEach(m=>{n[`${a}-${m}`]=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}`]=l:n[`${a}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):d(l)}),n}const cre=X.forwardRef(function(t,n){const{id:r,invert:i,position:o="bottom-right",hotkey:a=["altKey","KeyT"],expand:l,closeButton:d,className:f,offset:m,mobileOffset:h,theme:v="light",richColors:y,duration:x,style:S,visibleToasts:C=Qne,toastOptions:k,dir:E=cD(),gap:j=rre,icons:R,containerAriaLabel:N="Notifications"}=t,[T,A]=X.useState([]),D=X.useMemo(()=>r?T.filter(O=>O.toasterId===r):T.filter(O=>!O.toasterId),[T,r]),F=X.useMemo(()=>Array.from(new Set([o].concat(D.filter(O=>O.position).map(O=>O.position)))),[D,o]),[K,te]=X.useState([]),[G,q]=X.useState(!1),[V,H]=X.useState(!1),[z,W]=X.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),L=X.useRef(null),ne=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),$=X.useRef(null),P=X.useRef(!1),U=X.useCallback(O=>{A(J=>{var pe;return(pe=J.find(ge=>ge.id===O.id))!=null&&pe.delete||vi.dismiss(O.id),J.filter(({id:ge})=>ge!==O.id)})},[]);return X.useEffect(()=>vi.subscribe(O=>{if(O.dismiss){requestAnimationFrame(()=>{A(J=>J.map(pe=>pe.id===O.id?{...pe,delete:!0}:pe))});return}setTimeout(()=>{iE.flushSync(()=>{A(J=>{const pe=J.findIndex(ge=>ge.id===O.id);return pe!==-1?[...J.slice(0,pe),{...J[pe],...O},...J.slice(pe+1)]:[O,...J]})})})}),[T]),X.useEffect(()=>{if(v!=="system"){W(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window>"u")return;const O=window.matchMedia("(prefers-color-scheme: dark)");try{O.addEventListener("change",({matches:J})=>{W(J?"dark":"light")})}catch{O.addListener(({matches:pe})=>{try{W(pe?"dark":"light")}catch(ge){console.error(ge)}})}},[v]),X.useEffect(()=>{T.length<=1&&q(!1)},[T]),X.useEffect(()=>{const O=J=>{var pe;if(a.every(ve=>J[ve]||J.code===ve)){var Q;q(!0),(Q=L.current)==null||Q.focus()}J.code==="Escape"&&(document.activeElement===L.current||(pe=L.current)!=null&&pe.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[a]),X.useEffect(()=>{if(L.current)return()=>{$.current&&($.current.focus({preventScroll:!0}),$.current=null,P.current=!1)}},[L.current]),X.createElement("section",{ref:n,"aria-label":`${N} ${ne}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},F.map((O,J)=>{var pe;const[ge,Q]=O.split("-");return D.length?X.createElement("ol",{key:O,dir:E==="auto"?cD():E,tabIndex:-1,ref:L,className:f,"data-sonner-toaster":!0,"data-sonner-theme":z,"data-y-position":ge,"data-x-position":Q,style:{"--front-toast-height":`${((pe=K[0])==null?void 0:pe.height)||0}px`,"--width":`${nre}px`,"--gap":`${j}px`,...S,...lre(m,h)},onBlur:ve=>{P.current&&!ve.currentTarget.contains(ve.relatedTarget)&&(P.current=!1,$.current&&($.current.focus({preventScroll:!0}),$.current=null))},onFocus:ve=>{ve.target instanceof HTMLElement&&ve.target.dataset.dismissible==="false"||P.current||(P.current=!0,$.current=ve.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{V||q(!1)},onDragEnd:()=>q(!1),onPointerDown:ve=>{ve.target instanceof HTMLElement&&ve.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},D.filter(ve=>!ve.position&&J===0||ve.position===O).map((ve,be)=>{var ke,$e;return X.createElement(sre,{key:ve.id,icons:R,index:be,toast:ve,defaultRichColors:y,duration:(ke=k?.duration)!=null?ke:x,className:k?.className,descriptionClassName:k?.descriptionClassName,invert:i,visibleToasts:C,closeButton:($e=k?.closeButton)!=null?$e:d,interacting:V,position:O,style:k?.style,unstyled:k?.unstyled,classNames:k?.classNames,cancelButtonStyle:k?.cancelButtonStyle,actionButtonStyle:k?.actionButtonStyle,closeButtonAriaLabel:k?.closeButtonAriaLabel,removeToast:U,toasts:D.filter(Le=>Le.position==ve.position),heights:K.filter(Le=>Le.position==ve.position),setHeights:te,expandByDefault:l,gap:j,expanded:G,swipeDirections:t.swipeDirections})})):null}))});function uD(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(":")}Se.error(t,{description:n,action:{label:"Dismiss",onClick:()=>Se.dismiss()}})}const jy=new RX({queryCache:new Vz({onError:uD}),mutationCache:new Uz({onError:uD})});function Jo(e){return!!e}const Mb={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},Ja=console,ud={};Object.keys(Mb).forEach(e=>{ud[e]=Ja[e]});const Tp="Datadog Browser SDK:",gt={debug:ud.debug.bind(Ja,Tp),log:ud.log.bind(Ja,Tp),info:ud.info.bind(Ja,Tp),warn:ud.warn.bind(Ja,Tp),error:ud.error.bind(Ja,Tp)},zb="https://docs.datadoghq.com",ure=`${zb}/real_user_monitoring/browser/troubleshooting`,fE="More details:";function Z4(e,t){return(...n)=>{try{return e(...n)}catch(r){gt.error(t,r)}}}function yc(e){return e!==0&&Math.random()*100<=e}function pd(e,t){return+e.toFixed(t)}function dre(e){return Km(e)&&e>=0&&e<=100}function Km(e){return typeof e=="number"}function gm(e){return{...e}}function Ry(e,t){return Object.keys(e).some(n=>e[n]===t)}function Nl(e){return Object.keys(e).length===0}function Y4(e,t){const n={};for(const r of Object.keys(e))n[r]=t(e[r]);return n}function No(){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 wa=No(),Lb="WorkerGlobalScope"in wa;function ml(e,t){const n=No();let r;return n.Zone&&typeof n.Zone.__symbol__=="function"&&(r=e[n.Zone.__symbol__(t)]),r||(r=e[t]),r}let gC,W4=!1;function fre(e){gC=e}function pre(e){W4=e}function _t(e){return function(...t){return dl(e,this,t)}}function dl(e,t,n){try{return e.apply(t,n)}catch(r){hl(r)}}function hl(e){if(vC(e),gC)try{gC(e)}catch(t){vC(t)}}function vC(...e){W4&&gt.error("[MONITOR]",...e)}function Pr(e,t){return ml(No(),"setTimeout")(_t(e),t)}function xo(e){ml(No(),"clearTimeout")(e)}function ff(e,t){return ml(No(),"setInterval")(_t(e),t)}function Fb(e){ml(No(),"clearInterval")(e)}function dD(e){var t;const n=(t=wa.queueMicrotask)===null||t===void 0?void 0:t.bind(wa);typeof n=="function"?n(_t(e)):Promise.resolve().then(_t(e))}class Pt{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 X4(...e){return new Pt(t=>{const n=e.map(r=>r.subscribe(i=>t.notify(i)));return()=>n.forEach(r=>r.unsubscribe())})}class J4 extends Pt{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 dD(()=>{for(const i of this.buffer){if(n)return;t(i)}n||this.addObserver(t)}),r}unbuffer(){dD(()=>{this.maxBufferSize=this.buffer.length=0})}}const Lr=1e3,ti=60*Lr,Q4=60*ti,mre=24*Q4,eL=365*mre;function Ub(e){return{relative:e,timeStamp:gre(e)}}function hre(e){return{relative:pE(e),timeStamp:e}}function gre(e){const t=Jr()-performance.now();return t>Gm()?Math.round(Al(t,e)):yre(e)}function vre(){return Math.round(Jr()-Al(Gm(),performance.now()))}function xt(e){return Km(e)?pd(e*1e6,0):e}function Jr(){return new Date().getTime()}function br(){return Jr()}function qi(){return performance.now()}function xr(){return{relative:qi(),timeStamp:br()}}function tL(){return{relative:0,timeStamp:Gm()}}function Zn(e,t){return t-e}function Al(e,t){return e+t}function pE(e){return e-Gm()}function yre(e){return Math.round(Al(Gm(),e))}function bre(e){return e<eL}let C_;function Gm(){var e,t;return C_===void 0&&(C_=(t=(e=performance.timing)===null||e===void 0?void 0:e.navigationStart)!==null&&t!==void 0?t:performance.timeOrigin),C_}function Vb(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,l;return{throttled:(...d)=>{if(o){a=d;return}r?e(...d):a=d,o=!0,l=Pr(()=>{i&&a&&e(...a),o=!1,a=void 0},t)},cancel:()=>{xo(l),o=!1,a=void 0}}}function nn(){}function ei(e){return e?(parseInt(e,10)^Math.random()*16>>parseInt(e,10)/4).toString(16):`10000000-1000-4000-8000-${1e11}`.replace(/[018]/g,ei)}const Dd=/(\S+?)\s*=\s*(.+?)(?:;|$)/g;function vm(e,t){for(Dd.lastIndex=0;;){const n=Dd.exec(e);if(n){if(n[1]===t)return n[2]}else break}}function xre(e){const t=new Map;for(Dd.lastIndex=0;;){const n=Dd.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 wre(e){const t=new Map;for(Dd.lastIndex=0;;){const n=Dd.exec(e);if(n)t.set(n[1],n[2]);else break}return t}function mE(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 Sre(){return nL()===0}function _2e(){return nL()===1}let mv;function nL(){return mv??(mv=_re())}function _re(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 hE(e){return Bb(e,location.href).href}function Cre(e){try{return!!Bb(e)}catch{return!1}}function kre(e){const t=Bb(e).pathname;return t[0]==="/"?t:`/${t}`}function Bb(e,t){const{URL:n}=Ere();try{return t!==void 0?new n(e,t):new n(e)}catch(r){throw new Error(`Failed to construct URL: ${String(r)}`)}}let k_;function Ere(){if(!k_){let e,t;try{e=document.createElement("iframe"),e.style.display="none",document.body.appendChild(e),t=e.contentWindow}catch{t=wa}k_={URL:t.URL},e?.remove()}return k_}function Hb(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",l=r&&r.domain?`;domain=${r.domain}`:"",d=r&&r.secure?";secure":"",f=r&&r.partitioned?";partitioned":"";document.cookie=`${e}=${t};${o};path=/;samesite=${a}${l}${d}${f}`}function qb(e){return vm(document.cookie,e)}function jre(e){return xre(document.cookie).get(e)||[]}let E_;function tl(e){return E_||(E_=wre(document.cookie)),E_.get(e)}function rL(e,t){Hb(e,"",0,t)}function Rre(e){if(document.cookie===void 0||document.cookie===null)return!1;try{const t=`dd_cookie_test_${ei()}`,n="test";Hb(t,n,ti,e);const r=qb(t)===n;return rL(t,e),r}catch(t){return gt.error(t),!1}}let j_;function iL(e=location.hostname,t=document.referrer){if(j_===void 0){const n=Ire(e,t);if(n){const r=`dd_site_test_${ei()}`,i="test",o=n.split(".");let a=o.pop();for(;o.length&&!qb(r);)a=`${o.pop()}.${a}`,Hb(r,i,Lr,{domain:a});rL(r,{domain:a}),j_=a}}return j_}function Ire(e,t){try{return e||Bb(t).hostname}catch{}}const is="_dd_s";function oL(e,t){for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(t(r,n,e))return r}}function aL(e){return Object.values(e)}function gE(e){return Object.entries(e)}const Ol=4*Q4,sL=15*ti,Tre=eL,lL="0",Pd={COOKIE:"cookie",LOCAL_STORAGE:"local-storage"},cL=/^([a-zA-Z]+)=([a-z0-9-]+)$/,vE="&";function Nre(e){return!!e&&(e.indexOf(vE)!==-1||cL.test(e))}const Are="1";function dc(e,t){const n={isExpired:Are};return t.trackAnonymousUser&&e?.anonymousId&&(n.anonymousId=e?.anonymousId),n}function ty(e){return Nl(e)}function uL(e){return!ty(e)}function rm(e){return e.isExpired!==void 0||!Ore(e)}function Ore(e){return(e.created===void 0||Jr()-Number(e.created)<Ol)&&(e.expire===void 0||Jr()<Number(e.expire))}function dL(e){e.expire=String(Jr()+sL)}function yC(e){return gE(e).map(([t,n])=>t==="anonymousId"?`aid=${n}`:`${t}=${n}`).join(vE)}function Kb(e){const t={};return Nre(e)&&e.split(vE).forEach(n=>{const r=cL.exec(n);if(r!==null){const[,i,o]=r;i==="aid"?t.anonymousId=o:t[i]=o}}),t}const $re="_dd",Dre="_dd_r",Pre="_dd_l",Mre="rum",zre="logs";function Lre(e){if(!tl(is)){const n=tl($re),r=tl(Dre),i=tl(Pre),o={};n&&(o.id=n),i&&/^[01]$/.test(i)&&(o[zre]=i),r&&/^[012]$/.test(r)&&(o[Mre]=r),uL(o)&&(dL(o),e.persistSession(o))}}const Fre=0;function fD(e){const t=Vre(e);return t&&Rre(t)?{type:Pd.COOKIE,cookieOptions:t}:void 0}function Ure(e,t){const n={isLockEnabled:Sre(),persistSession:r=>pD(t,e,r,sL),retrieveSession:()=>fL(t,e),expireSession:r=>pD(t,e,dc(r,e),Ol)};return Lre(n),n}function pD(e,t,n,r){let i=yC(n);t.betaEncodeCookieOptions&&(i=yC({...n,...Nl(n)?{}:{c:pL(e)}})),Hb(is,i,t.trackAnonymousUser?Tre:r,e)}function fL(e,t){if(t.betaEncodeCookieOptions)return Bre(e);const n=qb(is);return Kb(n)}function Vre(e){const t={};if(t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains){const n=iL();if(!n)return;t.domain=n}return t}function pL(e){const t=e.domain?e.domain.split(".").length-1:0;let n=0;return n|=Fre<<5,n|=t<<1,n|=e.crossSite?1:0,n.toString(16)}function Bre(e){const t=jre(is),n=pL(e);let r;for(const i of t.reverse())if(r=Kb(i),r.c===n)break;return r==null||delete r.c,r??{}}const Hre="_dd_test_";function mD(){try{const e=ei(),t=`${Hre}${e}`;localStorage.setItem(t,e);const n=localStorage.getItem(t);return localStorage.removeItem(t),e===n?{type:Pd.LOCAL_STORAGE}:void 0}catch{return}}function qre(e){return{isLockEnabled:!1,persistSession:mL,retrieveSession:hL,expireSession:t=>Kre(t,e)}}function mL(e){localStorage.setItem(is,yC(e))}function hL(){const e=localStorage.getItem(is);return Kb(e)}function Kre(e,t){mL(dc(e,t))}const Gre=10,Zre=100,Yre=Lr,gL="--",vL=[];let ny;function fc(e,t,n=0){var r;const{isLockEnabled:i,persistSession:o,expireSession:a}=t,l=v=>o({...v,lock:f}),d=()=>{const{lock:v,...y}=t.retrieveSession();return{session:y,lock:v&&!Xre(v)?v:void 0}};if(ny||(ny=e),e!==ny){vL.push(e);return}if(i&&n>=Zre){hD(t);return}let f,m=d();if(i){if(m.lock){hv(e,t,n);return}if(f=Wre(),l(m.session),m=d(),m.lock!==f){hv(e,t,n);return}}let h=e.process(m.session);if(i&&(m=d(),m.lock!==f)){hv(e,t,n);return}if(h&&(rm(h)?a(h):(dL(h),i?l(h):o(h))),i&&!(h&&rm(h))){if(m=d(),m.lock!==f){hv(e,t,n);return}o(m.session),h=m.session}(r=e.after)===null||r===void 0||r.call(e,h||m.session),hD(t)}function hv(e,t,n){Pr(()=>{fc(e,t,n+1)},Gre)}function hD(e){ny=void 0;const t=vL.shift();t&&fc(t,e)}function Wre(){return ei()+gL+br()}function Xre(e){const[,t]=e.split(gL);return!t||Zn(Number(t),br())>Yre}const gD=Lr;function Jre(e){switch(e.sessionPersistence){case Pd.COOKIE:return fD(e);case Pd.LOCAL_STORAGE:return mD();case void 0:{let t=fD(e);return!t&&e.allowFallbackToLocalStorage&&(t=mD()),t}default:gt.error(`Invalid session persistence '${String(e.sessionPersistence)}'`)}}function Qre(e,t){return e.type===Pd.COOKIE?Ure(t,e.cookieOptions):qre(t)}function eie(e,t,n,r,i=Qre(e,t)){const o=new Pt,a=new Pt,l=new Pt,d=ff(y,gD);let f;S();const{throttled:m,cancel:h}=Vb(()=>{fc({process:T=>{if(ty(T))return;const A=x(T);return C(A),A},after:T=>{uL(T)&&!k()&&R(T),f=T}},i)},gD);function v(){fc({process:T=>k()?x(T):void 0},i)}function y(){const T=i.retrieveSession();rm(T)?fc({process:A=>rm(A)?dc(A,t):void 0,after:x},i):x(T)}function x(T){return rm(T)&&(T=dc(T,t)),k()&&(E(T)?j():(l.notify({previousState:f,newState:T}),f=T)),T}function S(){fc({process:T=>{if(ty(T))return T.anonymousId=ei(),dc(T,t)},after:T=>{f=T}},i)}function C(T){if(ty(T))return!1;const A=r(T[n]);T[n]=A,delete T.isExpired,A!==lL&&!T.id&&(T.id=ei(),T.created=String(Jr()))}function k(){return f?.[n]!==void 0}function E(T){return f.id!==T.id||f[n]!==T[n]}function j(){f=dc(f,t),a.notify()}function R(T){f=T,o.notify()}function N(T){fc({process:A=>({...A,...T}),after:x},i)}return{expandOrRenewSession:m,expandSession:v,getSession:()=>f,renewObservable:o,expireObservable:a,sessionStateUpdateObservable:l,restartSession:S,expire:T=>{h(),T===!1&&f&&delete f.anonymousId,i.expireSession(f),x(dc(f,t))},stop:()=>{Fb(d)},updateSessionState:N}}const bC={GRANTED:"granted",NOT_GRANTED:"not-granted"};function tie(e){const t=new Pt;return{tryToInit(n){e||(e=n)},update(n){e=n,t.notify()},isGranted(){return e===bC.GRANTED},observable:t}}function pf(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function Wc(e){return pf(e)==="object"}function Iy(e){const t=pf(e);return t==="string"||t==="function"||e instanceof RegExp}function Gb(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){gt.error(i)}return!1})}const nie=["chrome-extension://","moz-extension://"];function vD(e){return nie.some(t=>e.includes(t))}function rie(e,t=""){if(vD(e))return!1;const r=t.split(`
31
- `).filter(i=>{const o=i.trim();return o.length&&/^at\s+|@/.test(o)})[1]||"";return vD(r)}const iie="Running the Browser SDK in a Web extension content script is forbidden unless the `allowedTrackingOrigins` option is provided.",oie="SDK initialized on a non-allowed domain.";function aie(e,t,n=typeof location<"u"?location.origin:""){const r=e.allowedTrackingOrigins;if(!r)return rie(n,t)?(gt.error(iie),!1):!0;const i=Gb(r,n);return i||gt.error(oie),i}const yL="datad0g.com",sie="dd0g-gov.com",bc="datadoghq.com",lie="datadoghq.eu",cie="ddog-gov.com",uie="pci.browser-intake-datadoghq.com",die=["ddsource","dd-api-key","dd-request-id"];function Ys(e,t,n){const r=fie(e,t);return{build(i,o){const a=pie(e,t,i,o,n);return r(a)},trackType:t}}function fie(e,t){const n=`/api/v2/${t}`,r=e.proxy;if(typeof r=="string"){const o=hE(r);return a=>`${o}?ddforward=${encodeURIComponent(`${n}?${a}`)}`}if(typeof r=="function")return o=>r({path:n,parameters:o});const i=bL(t,e);return o=>`https://${i}${n}?${o}`}function bL(e,t){const{site:n=bc,internalAnalyticsSubdomain:r}=t;if(e==="logs"&&t.usePciIntake&&n===bc)return uie;if(r&&n===bc)return`${r}.${bc}`;if(n===sie)return`http-intake.logs.${n}`;const i=n.split("."),o=i.pop();return`browser-intake-${i.join("-")}.${o}`}function pie({clientToken:e,internalAnalyticsSubdomain:t,source:n="browser"},r,i,{retry:o,encoding:a},l=[]){const d=[`ddsource=${n}`,`dd-api-key=${e}`,`dd-evp-origin-version=${encodeURIComponent("6.25.4")}`,"dd-evp-origin=browser",`dd-request-id=${ei()}`].concat(l);return a&&d.push(`dd-evp-encoding=${a}`),r==="rum"&&(d.push(`batch_time=${br()}`,`_dd.api=${i}`),o&&d.push(`_dd.retry_count=${o.count}`,`_dd.retry_after=${o.lastFailureStatus}`)),t&&d.reverse(),d.join("&")}function mie(e){const t=e.site||bc,n=hie(e.source),r=gie({...e,site:t,source:n});return{replica:vie({...e,site:t,source:n}),site:t,source:n,...r}}function hie(e){return e==="flutter"||e==="unity"?e:"browser"}function gie(e){return{logsEndpointBuilder:Ys(e,"logs"),rumEndpointBuilder:Ys(e,"rum"),profilingEndpointBuilder:Ys(e,"profile"),sessionReplayEndpointBuilder:Ys(e,"replay"),exposuresEndpointBuilder:Ys(e,"exposures"),flagEvaluationEndpointBuilder:Ys(e,"flagevaluation")}}function vie(e){if(!e.replica)return;const t={...e,site:bc,clientToken:e.replica.clientToken};return{logsEndpointBuilder:Ys(t,"logs"),rumEndpointBuilder:Ys(t,"rum",[`application.id=${e.replica.applicationId}`])}}function yie(e){return die.every(t=>e.includes(t))}const md={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input",MASK_UNLESS_ALLOWLISTED:"mask-unless-allowlisted"},xC={ALL:"all",SAMPLED:"sampled"};function R_(e,t){return e!=null&&typeof e!="string"?(gt.error(`${t} must be defined as a string`),!1):!0}function bie(e){return e&&typeof e=="string"&&!/(datadog|ddog|datad0g|dd0g)/.test(e)?(gt.error(`Site should be a valid Datadog site. ${fE} ${zb}/getting_started/site/.`),!1):!0}function hd(e,t){return e!==void 0&&!dre(e)?(gt.error(`${t} Sample Rate should be a number between 0 and 100`),!1):!0}function xie(e,t){var n,r,i,o,a,l,d,f,m,h;if(!e||!e.clientToken){gt.error("Client Token is not configured, we will not send any data.");return}if(e.allowedTrackingOrigins!==void 0&&!Array.isArray(e.allowedTrackingOrigins)){gt.error("Allowed Tracking Origins must be an array");return}if(!(!bie(e.site)||!hd(e.sessionSampleRate,"Session")||!hd(e.telemetrySampleRate,"Telemetry")||!hd(e.telemetryConfigurationSampleRate,"Telemetry Configuration")||!hd(e.telemetryUsageSampleRate,"Telemetry Usage")||!R_(e.version,"Version")||!R_(e.env,"Env")||!R_(e.service,"Service")||!aie(e,t??""))){if(e.trackingConsent!==void 0&&!Ry(bC,e.trackingConsent)){gt.error('Tracking Consent should be either "granted" or "not-granted"');return}return{beforeSend:e.beforeSend&&Z4(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Lb?void 0:Jre(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:(l=e.env)!==null&&l!==void 0?l: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:(m=e.trackingConsent)!==null&&m!==void 0?m:bC.GRANTED,trackAnonymousUser:(h=e.trackAnonymousUser)!==null&&h!==void 0?h:!0,storeContextsAcrossPages:!!e.storeContextsAcrossPages,betaEncodeCookieOptions:!!e.betaEncodeCookieOptions,variant:e.variant,sdkVersion:e.sdkVersion,...mie(e)}}}function wie(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 gl;(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",e.USE_CHANGE_RECORDS="use_change_records"})(gl||(gl={}));const yE=new Set;function Sie(e){Array.isArray(e)&&_ie(e.filter(t=>Ry(gl,t)))}function _ie(e){e.forEach(t=>{yE.add(t)})}function Zm(e){return yE.has(e)}function Cie(){return yE}const Md="?";function Zb(e){var t,n;const r=[];let i=I_(e,"stack");const o=String(e);if(i&&i.startsWith(o)&&(i=i.slice(o.length)),i&&i.split(`
32
- `).forEach(a=>{const l=jie(a)||Iie(a)||Nie(a)||$ie(a);l&&(!l.func&&l.line&&(l.func=Md),r.push(l))}),r.length>0&&zie()&&e instanceof Error){const a=[];let l=e;for(;(l=Object.getPrototypeOf(l))&&wL(l);){const d=((t=l.constructor)===null||t===void 0?void 0:t.name)||Md;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:I_(e,"message"),name:I_(e,"name"),stack:r}}const xL="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",zd="(?::(\\d+))",kie=new RegExp(`^\\s*at (.*?) ?\\(${xL}${zd}?${zd}?\\)?\\s*$`,"i"),Eie=new RegExp(`\\((\\S*)${zd}${zd}\\)`);function jie(e){const t=kie.exec(e);if(!t)return;const n=t[2]&&t[2].indexOf("native")===0,r=t[2]&&t[2].indexOf("eval")===0,i=Eie.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]||Md,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}const Rie=new RegExp(`^\\s*at ?${xL}${zd}?${zd}??\\s*$`,"i");function Iie(e){const t=Rie.exec(e);if(t)return{args:[],column:t[3]?+t[3]:void 0,func:Md,line:t[2]?+t[2]:void 0,url:t[1]}}const Tie=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Nie(e){const t=Tie.exec(e);if(t)return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||Md,line:+t[3],url:t[2]}}const Aie=/^\s*(.*?)(?:\((.*?)\))?(?:(?:(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle|\[wasm code\])(?::(\d+))?(?::(\d+))?)|@)\s*$/i,Oie=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function $ie(e){const t=Aie.exec(e);if(!t)return;const n=t[3]&&t[3].indexOf(" > eval")>-1,r=Oie.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]||Md,line:t[4]?+t[4]:void 0,url:t[3]}}function I_(e,t){return Wc(e)&&typeof e[t]=="string"?e[t]:void 0}function Die(e,t,n,r){if(t===void 0)return;const{name:i,message:o}=Mie(e);return{name:i,message:o,stack:[{url:t,column:r,line:n}]}}const Pie=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function Mie(e){let t,n;return{}.toString.call(e)==="[object String]"&&([,t,n]=Pie.exec(e)),{name:t,message:n}}function wL(e){return String(e.constructor).startsWith("class ")}let gv;function zie(){if(gv!==void 0)return gv;class e extends Error{constructor(){super(),this.name="Error"}}const[t,n]=[e,Error].map(r=>new r);return gv=wL(Object.getPrototypeOf(t))&&n.stack!==t.stack,gv}function ym(e){const n=new Error(e);n.name="HandlingStack";let r;return dl(()=>{const i=Zb(n);i.stack=i.stack.slice(2),r=Yb(i)}),r}function Yb(e){let t=SL(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 SL(e){return`${e.name||"Error"}: ${e.message}`}function va(e,t,n,{computeHandlingStack:r}={}){let i=e[t];if(typeof i!="function")if(t in e&&typeof t=="string"&&t.startsWith("on"))i=nn;else return{stop:nn};let o=!1;const a=function(){if(o)return i.apply(this,arguments);const l=Array.from(arguments);let d;dl(n,null,[{target:this,parameters:l,onPostCall:m=>{d=m},handlingStack:r?ym("instrumented method"):void 0}]);const f=i.apply(this,l);return d&&dl(d,null,[f]),f};return e[t]=a,{stop:()=>{o=!0,e[t]===a&&(e[t]=i)}}}function C2e(e,t,n){const r=Object.getOwnPropertyDescriptor(e,t);if(!r||!r.set||!r.configurable)return{stop:nn};const i=nn;let o=(l,d)=>{Pr(()=>{o!==i&&n(l,d)},0)};const a=function(l){r.set.call(this,l),o(this,l)};return Object.defineProperty(e,t,{set:a}),{stop:()=>{var l;((l=Object.getOwnPropertyDescriptor(e,t))===null||l===void 0?void 0:l.set)===a&&Object.defineProperty(e,t,r),o=i}}}const Xc=1024,_L=1024*Xc,Lie=/[^\u0000-\u007F]/;function CL(e){return Lie.test(e)?window.TextEncoder!==void 0?new TextEncoder().encode(e).length:new Blob([e]).size:e.length}function kL(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 Ld(e,t,n){if(typeof e!="object"||e===null)return JSON.stringify(e);const r=gd(Object.prototype),i=gd(Array.prototype),o=gd(Object.getPrototypeOf(e)),a=gd(e);try{return JSON.stringify(e,t,n)}catch{return"<error: unable to serialize object>"}finally{r(),i(),o(),a()}}function gd(e){const t=e,n=t.toJSON;return n?(delete t.toJSON,()=>{t.toJSON=n}):nn}const Fie=220*Xc,Uie="$",Vie=3;function wn(e,t=Fie){const n=gd(Object.prototype),r=gd(Array.prototype),i=[],o=new WeakMap,a=T_(e,Uie,void 0,i,o),l=JSON.stringify(a);let d=l?l.length:0;if(d>t){N_(t,"discarded",e);return}for(;i.length>0&&d<t;){const f=i.shift();let m=0;if(Array.isArray(f.source))for(let h=0;h<f.source.length;h++){const v=T_(f.source[h],f.path,h,i,o);if(v!==void 0?d+=JSON.stringify(v).length:d+=4,d+=m,m=1,d>t){N_(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=T_(f.source[h],f.path,h,i,o);if(v!==void 0&&(d+=JSON.stringify(v).length+m+h.length+Vie,m=1),d>t){N_(t,"truncated",e);break}f.target[h]=v}}return n(),r(),a}function T_(e,t,n,r,i){const o=qie(e);if(!o||typeof o!="object")return Bie(o);const a=wC(o);if(a!=="[Object]"&&a!=="[Array]"&&a!=="[Error]")return a;const l=e;if(i.has(l))return`[Reference seen at ${i.get(l)}]`;const d=n!==void 0?`${t}.${n}`:t,f=Array.isArray(o)?[]:{};return i.set(l,d),r.push({source:o,target:f,path:d}),f}function Bie(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 wC(e){try{if(e instanceof Event)return Hie(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 Hie(e){return{type:e.type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?wC(e.currentTarget):null,target:e.target?wC(e.target):null}}function qie(e){const t=e;if(t&&typeof t.toJSON=="function")try{return t.toJSON()}catch{}return e}function N_(e,t,n){gt.warn(`The data provided has been ${t} as it is over the limit of ${e} characters:`,n)}const EL="No stack, consider using an instance of Error";function jL({originalError:e,stackTrace:t,source:n,useFallbackStack:r=!0,nonErrorPrefix:i}){const o=$l(e);return!t&&o&&(t=Zb(e)),{source:n,type:t?t.name:void 0,message:Kie(t,o,i,e),stack:t?Yb(t):r?EL:void 0}}function bE({stackTrace:e,originalError:t,handlingStack:n,componentStack:r,startClocks:i,nonErrorPrefix:o,useFallbackStack:a=!0,source:l,handling:d}){const f=jL({originalError:t,stackTrace:e,source:l,useFallbackStack:a,nonErrorPrefix:o});return{startClocks:i,handling:d,handlingStack:n,componentStack:r,originalError:t,...f,causes:$l(t)?Yie(t,l):void 0,fingerprint:Gie(t),context:Zie(t)}}function Kie(e,t,n,r){return e?.message&&e?.name?e.message:t?"Empty message":n?`${n} ${Ld(wn(r))}`:Ld(wn(r))}function Gie(e){return $l(e)&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function Zie(e){if(Wc(e))return e.dd_context}function $l(e){return e instanceof Error||Object.prototype.toString.call(e)==="[object Error]"}function Yie(e,t){const n=[];let r=e.cause;for(;r!=null&&n.length<10;){const i=jL({originalError:r,source:t,useFallbackStack:!1});n.push(i),r=$l(r)?r.cause:void 0}return n.length?n:void 0}const mf={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};function Wie(){return new Pt(e=>{const t=(i,o)=>{const a=bE({stackTrace:o,originalError:i,startClocks:xr(),nonErrorPrefix:"Uncaught",source:mf.SOURCE,handling:"unhandled"});e.notify(a)},{stop:n}=Xie(t),{stop:r}=Jie(t);return()=>{n(),r()}})}function Xie(e){return va(No(),"onerror",({parameters:[t,n,r,i,o]})=>{let a;$l(o)||(a=Die(t,n,r,i)),e(o??t,a)})}function Jie(e){return va(No(),"onunhandledrejection",({parameters:[t]})=>{e(t.reason||"Empty reason")})}function Qie(e){const t={version:"6.25.4",onReady(n){n()},...e};return Object.defineProperty(t,"_setDebug",{get(){return pre},enumerable:!1}),t}function eoe(e,t,n){const r=e[t];r&&!r.q&&r.version&&gt.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=>Z4(i,"onReady callback threw an error:")())}function RL(e,t){t.silentMultipleInit||gt.error(`${e} is already initialized.`)}function Dn(e,t,n,r,i){return vl(e,t,[n],r,i)}function vl(e,t,n,r,{once:i,capture:o,passive:a}={}){const l=_t(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,m=ml(f,"addEventListener");n.forEach(v=>m.call(t,v,l,d));function h(){const v=ml(f,"removeEventListener");n.forEach(y=>v.call(t,y,l,d))}return{stop:h}}const bm={intervention:"intervention",cspViolation:"csp_violation"};function toe(e,t){const n=[];t.includes(bm.cspViolation)&&n.push(roe(e));const r=t.filter(i=>i!==bm.cspViolation);return r.length&&n.push(noe(r)),X4(...n)}function noe(e){return new Pt(t=>{if(!window.ReportingObserver)return;const n=_t((i,o)=>i.forEach(a=>t.notify(ioe(a)))),r=new window.ReportingObserver(n,{types:e,buffered:!0});return r.observe(),()=>{r.disconnect()}})}function roe(e){return new Pt(t=>{const{stop:n}=Dn(e,document,"securitypolicyviolation",r=>{t.notify(ooe(r))});return n})}function ioe(e){const{type:t,body:n}=e;return IL({type:n.id,message:`${t}: ${n.message}`,originalError:e,stack:TL(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}function ooe(e){const t=`'${e.blockedURI}' blocked by '${e.effectiveDirective}' directive`;return IL({type:e.effectiveDirective,message:`${bm.cspViolation}: ${t}`,originalError:e,csp:{disposition:e.disposition},stack:TL(e.effectiveDirective,e.originalPolicy?`${t} of the policy "${mE(e.originalPolicy,100,"...")}"`:"no policy",e.sourceFile,e.lineNumber,e.columnNumber)})}function IL(e){return{startClocks:xr(),source:mf.REPORT,handling:"unhandled",...e}}function TL(e,t,n,r,i){return n?Yb({name:e,message:t,stack:[{func:"?",url:n,line:r??void 0,column:i??void 0}]}):void 0}const aoe=200;function NL(e){const{env:t,service:n,version:r,datacenter:i,sdkVersion:o,variant:a}=e,l=[Xu("sdk_version",o??"6.25.4")];return t&&l.push(Xu("env",t)),n&&l.push(Xu("service",n)),r&&l.push(Xu("version",r)),i&&l.push(Xu("datacenter",i)),a&&l.push(Xu("variant",a)),l}function Xu(e,t){const n=t?`${e}:${t}`:e;return(n.length>aoe||loe(n))&&gt.warn(`Tag ${n} doesn't meet tag requirements and will be sanitized. ${fE} ${zb}/getting_started/tagging/#defining-tags`),soe(n)}function soe(e){return e.replace(/,/g,"_")}function loe(e){return coe()?new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(e):!1}function coe(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch{return!1}}function AL(e,t){const n=wa.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}function Ty(e,t,n=uoe()){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]=Ty(i[o],t[o],n);return i}const r=pf(e)==="object"?e:{};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=Ty(r[i],t[i],n));return r}function xE(e){return Ty(void 0,e)}function os(...e){let t;for(const n of e)n!=null&&(t=Ty(t,n));return t}function uoe(){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 OL(){var e;const t=wa.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 doe(e){return e>=500}function foe(e){try{return e.clone()}catch{return}}const poe=80*Xc,moe=32,$L=20*_L,hoe=ti,DL=Lr;function PL(e,t,n,r,i,o){t.transportStatus===0&&t.queuedPayloads.size()===0&&t.bandwidthMonitor.canHandle(e)?zL(e,t,n,o,{onSuccess:()=>LL(0,t,n,r,i,o),onFailure:()=>{t.queuedPayloads.enqueue(e)||o.notify({type:"queue-full",bandwidth:t.bandwidthMonitor.stats(),payload:e}),ML(t,n,r,i,o)}}):t.queuedPayloads.enqueue(e)||o.notify({type:"queue-full",bandwidth:t.bandwidthMonitor.stats(),payload:e})}function ML(e,t,n,r,i){e.transportStatus===2&&Pr(()=>{const o=e.queuedPayloads.first();zL(o,e,t,i,{onSuccess:()=>{e.queuedPayloads.dequeue(),e.currentBackoffTime=DL,LL(1,e,t,n,r,i)},onFailure:()=>{e.currentBackoffTime=Math.min(hoe,e.currentBackoffTime*2),ML(e,t,n,r,i)}})},e.currentBackoffTime)}function zL(e,t,n,r,{onSuccess:i,onFailure:o}){t.bandwidthMonitor.add(e),n(e,a=>{t.bandwidthMonitor.remove(e),goe(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 LL(e,t,n,r,i,o){e===0&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(i({message:`Reached max ${r} events size queued for upload: ${$L/_L}MiB`,source:mf.AGENT,startClocks:xr()}),t.queueFullReported=!0);const a=t.queuedPayloads;for(t.queuedPayloads=FL();a.size()>0;)PL(a.dequeue(),t,n,r,i,o)}function goe(e){return e.type!=="opaque"&&(e.status===0&&!navigator.onLine||e.status===408||e.status===429||doe(e.status))}function voe(){return{transportStatus:0,currentBackoffTime:DL,bandwidthMonitor:yoe(),queuedPayloads:FL(),queueFullReported:!1}}function FL(){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>=$L}}}function yoe(){return{ongoingRequestCount:0,ongoingByteCount:0,canHandle(e){return this.ongoingRequestCount===0||this.ongoingByteCount+e.bytesCount<=poe&&this.ongoingRequestCount<moe},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 SC=16*Xc;function UL(e,t,n=SC){const r=new Pt,i=voe();return{observable:r,send:o=>{for(const a of e)PL(o,i,(l,d)=>{Zm(gl.AVOID_FETCH_KEEPALIVE)?Ny(a,l,d):woe(a,n,l,d)},a.trackType,t,r)},sendOnExit:o=>{for(const a of e)boe(a,n,o)}}}function boe(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){xoe(i)}Ny(e,n)}let yD=!1;function xoe(e){yD||(yD=!0,hl(e))}function woe(e,t,n,r){if(Soe()&&n.bytesCount<t){const o=e.build("fetch-keepalive",n);fetch(o,{method:"POST",body:n.data,keepalive:!0,mode:"cors"}).then(_t(a=>r?.({status:a.status,type:a.type}))).catch(_t(()=>Ny(e,n,r)))}else Ny(e,n,r)}function Ny(e,t,n){const r=e.build("fetch",t);fetch(r,{method:"POST",body:t.data,mode:"cors"}).then(_t(i=>n?.({status:i.status,type:i.type}))).catch(_t(()=>n?.({status:0})))}function Soe(){try{return window.Request&&"keepalive"in new Request("http://a")}catch{return!1}}function Ym(){const e=_oe();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 VL(e){const t=Ym();return!!t&&t.getCapabilities().includes(e)}function Fd(e){var t;e===void 0&&(e=(t=No().location)===null||t===void 0?void 0:t.hostname);const n=Ym();return!!n&&n.getAllowedWebViewHosts().some(r=>e===r||e.endsWith(`.${r}`))}function _oe(){return No().DatadogEventBridge}const im={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function Coe(e){return new Pt(t=>{const{stop:n}=vl(e,window,["visibilitychange","freeze"],i=>{i.type==="visibilitychange"&&document.visibilityState==="hidden"?t.notify({reason:im.HIDDEN}):i.type==="freeze"&&t.notify({reason:im.FROZEN})},{capture:!0}),r=Dn(e,window,"beforeunload",()=>{t.notify({reason:im.UNLOADING})}).stop;return()=>{n(),r()}})}function koe(e){return aL(im).includes(e)}const bD=256*Xc;function BL({encoder:e,request:t,flushController:n}){let r={};const i=n.flushObservable.subscribe(m=>f(m));function o(m,h,v){n.notifyBeforeAddMessage(h),v!==void 0?(r[v]=m,n.notifyAfterAddMessage()):e.write(e.isEmpty?m:`
34
- ${m}`,y=>{n.notifyAfterAddMessage(y-h)})}function a(m){return m!==void 0&&r[m]!==void 0}function l(m){const h=r[m];delete r[m];const v=e.estimateEncodedBytesCount(h);n.notifyAfterRemoveMessage(v)}function d(m,h){const v=Ld(m),y=e.estimateEncodedBytesCount(v);if(y>=bD){gt.warn(`Discarded a message whose size was bigger than the maximum allowed size ${bD/Xc}KiB. ${fE} ${ure}/#technical-limitations`);return}a(h)&&l(h),o(v,y,h)}function f(m){const h=aL(r).join(`
35
- `);r={};const v=koe(m.reason),y=v?t.sendOnExit:t.send;if(v&&e.isAsync){const x=e.finishSync();x.outputBytesCount&&y(xD(x));const S=[x.pendingData,h].filter(Boolean).join(`
36
- `);S&&y({data:S,bytesCount:CL(S)})}else h&&e.write(e.isEmpty?h:`
37
- ${h}`),e.finish(x=>{y(xD(x))})}return{flushController:n,add:d,upsert:d,stop:i.unsubscribe}}function xD(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 Eoe=30*Lr,joe=Lb?1:50;function HL({pageMayExitObservable:e,sessionExpireObservable:t}){const n=e.subscribe(h=>l(h.reason)),r=t.subscribe(()=>l("session_expire")),i=new Pt(()=>()=>{n.unsubscribe(),r.unsubscribe()});let o=0,a=0;function l(h){if(a===0)return;const v=a,y=o;a=0,o=0,m(),i.notify({reason:h,messagesCount:v,bytesCount:y})}let d;function f(){d===void 0&&(d=Pr(()=>{l("duration_limit")},Eoe))}function m(){xo(d),d=void 0}return{flushObservable:i,get messagesCount(){return a},notifyBeforeAddMessage(h){o+h>=SC&&l("bytes_limit"),a+=1,o+=h,f()},notifyAfterAddMessage(h=0){o+=h,a>=joe?l("messages_limit"):o>=SC&&l("bytes_limit")},notifyAfterRemoveMessage(h){o-=h,a-=1,a===0&&m()}}}const yl="DISCARDED",Ki="SKIPPED";function Roe(){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===yl)return yl;a!==Ki&&i.push(a)}return os(...i)}}}const fl={LOG:"log",CONFIGURATION:"configuration",USAGE:"usage"},Ioe=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],Toe=1,Noe=[cie],Aoe=15;let A_;function hf(){return A_||(A_=new J4(100)),A_}function Ooe(e,t,n,r,i,o){const a=new Pt,{stop:l}=Doe(t,r,i,o,a),{enabled:d,metricsEnabled:f}=$oe(e,t,n,a);return{stop:l,enabled:d,metricsEnabled:f}}function $oe(e,t,n,r,i=Toe,o=Aoe){const a={},l=!Noe.includes(t.site)&&yc(t.telemetrySampleRate),d={[fl.LOG]:l,[fl.CONFIGURATION]:l&&yc(t.telemetryConfigurationSampleRate),[fl.USAGE]:l&&yc(t.telemetryUsageSampleRate),metric:l&&yc(i)},f=Poe(),m=hf();return m.subscribe(({rawEvent:v,metricName:y})=>{if(y&&!d.metric||!d[v.type])return;const x=y||v.status||v.type;let S=a[x];if(S||(S=a[x]=new Set),S.size>=o)return;const C=Ld(v);if(S.has(C))return;const k=n.triggerHook(1,{startTime:xr().relative});if(k===yl)return;const E=h(k,e,v,f);r.notify(E),AL("telemetry",E),S.add(C)}),m.unbuffer(),fre(wE),{enabled:l,metricsEnabled:d.metric};function h(v,y,x,S){const k={type:"telemetry",date:xr().timeStamp,service:y,version:"6.25.4",source:"browser",_dd:{format_version:2},telemetry:os(x,{runtime_env:S,connectivity:OL(),sdk_setup:"npm"}),ddtags:NL(t).join(","),experimental_features:Array.from(Cie())};return os(k,v)}}function Doe(e,t,n,r,i){const o=[];if(Fd()){const a=Ym(),l=i.subscribe(d=>a.send("internal_telemetry",d));o.push(l.unsubscribe)}else{const a=[e.rumEndpointBuilder];e.replica&&Moe(e)&&a.push(e.replica.rumEndpointBuilder);const l=BL({encoder:r(4),request:UL(a,t),flushController:HL({pageMayExitObservable:n,sessionExpireObservable:new Pt})});o.push(l.stop);const d=i.subscribe(l.add);o.push(d.unsubscribe)}return{stop:()=>o.forEach(a=>a())}}function Poe(){var e;return{is_local_file:((e=wa.location)===null||e===void 0?void 0:e.protocol)==="file:",is_worker:Lb}}function Moe(e){return e.site===yL}function Wm(e,t){vC(Mb.debug,e,t),hf().notify({rawEvent:{type:fl.LOG,message:e,status:"debug",...t}})}function wE(e,t){hf().notify({rawEvent:{type:fl.LOG,status:"error",...Loe(e),...t}})}function zoe(e){hf().notify({rawEvent:{type:fl.CONFIGURATION,configuration:e}})}function Wb(e,t){hf().notify({rawEvent:{type:fl.LOG,message:e,status:"debug",...t},metricName:e})}function gr(e){hf().notify({rawEvent:{type:fl.USAGE,usage:e}})}function Loe(e){if($l(e)){const t=Zb(e);return{error:{kind:t.name,stack:Yb(Foe(t))},message:t.message}}return{error:{stack:EL},message:`Uncaught ${Ld(e)}`}}function Foe(e){return e.stack=e.stack.filter(t=>!t.url||Ioe.some(n=>t.url.startsWith(n))),e}function qL(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}function Rc(e){return Array.isArray(e)&&e.length>0}const vv=1/0,Uoe=ti;let Np=null;const ry=new Set;function Voe(){ry.forEach(e=>e())}function Jc({expireDelay:e,maxEntries:t}){let n=[];Np||(Np=ff(()=>Voe(),Uoe));const r=()=>{const m=qi()-e;for(;n.length>0&&n[n.length-1].endTime<m;)n.pop()};ry.add(r);function i(m,h){const v={value:m,startTime:h,endTime:vv,remove:()=>{qL(n,v)},close:y=>{v.endTime=y}};return t&&n.length>=t&&n.pop(),n.unshift(v),v}function o(m=vv,h={returnInactive:!1}){for(const v of n)if(v.startTime<=m){if(h.returnInactive||m<=v.endTime)return v.value;break}}function a(m){const h=n[0];h&&h.endTime===vv&&h.close(m)}function l(m=vv,h=0){const v=Al(m,h);return n.filter(y=>y.startTime<=v&&m<=y.endTime).map(y=>y.value)}function d(){n=[]}function f(){ry.delete(r),ry.size===0&&Np&&(Fb(Np),Np=null)}return{add:i,find:o,closeActive:a,findAll:l,reset:d,stop:f}}const Boe="datadog-synthetics-public-id",Hoe="datadog-synthetics-result-id",qoe="datadog-synthetics-injects-rum";function KL(){return Lb?!1:!!(wa._DATADOG_SYNTHETICS_INJECTS_RUM||tl(qoe))}function GL(){const e=window._DATADOG_SYNTHETICS_PUBLIC_ID||tl(Boe);return typeof e=="string"?e:void 0}function ZL(){const e=window._DATADOG_SYNTHETICS_RESULT_ID||tl(Hoe);return typeof e=="string"?e:void 0}function YL(){return!!(GL()&&ZL())}const Koe=ti,Goe=Ol;function Zoe(e,t,n,r){const i=new Pt,o=new Pt,a=eie(e.sessionStoreStrategyType,e,t,n),l=Jc({expireDelay:Goe});if(a.renewObservable.subscribe(()=>{l.add(d(),qi()),i.notify()}),a.expireObservable.subscribe(()=>{o.notify(),l.closeActive(qi())}),a.expandOrRenewSession(),l.add(d(),tL().relative),Zm(gl.SHORT_SESSION_INVESTIGATION)){const f=a.getSession();f&&Qoe(e,f)}r.observable.subscribe(()=>{r.isGranted()?a.expandOrRenewSession():a.expire(!1)}),Yoe(e,()=>{r.isGranted()&&a.expandOrRenewSession()}),Woe(e,()=>a.expandSession()),Xoe(e,()=>a.restartSession());function d(){const f=a.getSession();return f?{id:f.id,trackingType:f[t],isReplayForced:!!f.forcedReplay,anonymousId:f.anonymousId}:(Joe(e).catch(()=>{}),{id:"invalid",trackingType:lL,isReplayForced:!1,anonymousId:void 0})}return{findSession:(f,m)=>l.find(f,m),renewObservable:i,expireObservable:o,sessionStateUpdateObservable:a.sessionStateUpdateObservable,expire:a.expire,updateSessionState:a.updateSessionState}}function Yoe(e,t){const{stop:n}=vl(e,window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0})}function Woe(e,t){const n=()=>{document.visibilityState==="visible"&&t()},{stop:r}=Dn(e,document,"visibilitychange",n);ff(n,Koe)}function Xoe(e,t){const{stop:n}=Dn(e,window,"resume",t,{capture:!0})}async function Joe(e){const t=e.sessionStoreStrategyType;if(!t)return;let n,r;t.type===Pd.COOKIE?(n=fL(t.cookieOptions,e),r={cookie:await WL(),currentDomain:`${window.location.protocol}//${window.location.hostname}`}):n=hL(),Wm("Unexpected session state",{sessionStoreStrategyType:t.type,session:n,isSyntheticsTest:YL(),createdTimestamp:n?.created,expireTimestamp:n?.expire,...r})}function Qoe(e,t){if(!window.cookieStore||!t.created)return;const n=Number(t.created),r=Jr(),{stop:i}=Dn(e,cookieStore,"change",o);function o(a){const l=oL(a.changed,f=>f.name===is);if(!l)return;const d=Jr()-n;if(d>14*ti)i();else{const f=Kb(l.value);if(f.id&&f.id!==t.id){i();const m=Jr()-r;WL().then(h=>{Wm("Session cookie changed",{time:m,session_age:d,old:t,new:f,cookie:h})}).catch(hl)}}}}async function WL(){let e;return"cookieStore"in window?e=await window.cookieStore.getAll(is):e=document.cookie.split(/\s*;\s*/).filter(t=>t.startsWith(is)),{count:e.length,domain:iL()||"undefined",...e}}function eae(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(n,r){const i=CL(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 tae{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 nae=3e3;function O_(e,t,n=nae){let r=0,i=!1;return{isLimitReached(){if(r===0&&Pr(()=>{r=0},ti),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:mf.AGENT,startClocks:xr()})}finally{i=!1}}return!0}}}function SE(e,t,n){return document.readyState===t||document.readyState==="complete"?(n(),{stop:nn}):Dn(e,window,t==="complete"?"load":"DOMContentLoaded",n,{once:!0})}function rae(e,t){return new Promise(n=>{SE(e,t,n)})}let $_;const _E=new WeakMap;function iae(e){return $_||($_=oae(e)),$_}function oae(e){return new Pt(t=>{const{stop:n}=va(XMLHttpRequest.prototype,"open",aae),{stop:r}=va(XMLHttpRequest.prototype,"send",o=>{sae(o,e,t)},{computeHandlingStack:!0}),{stop:i}=va(XMLHttpRequest.prototype,"abort",lae);return()=>{n(),r(),i()}})}function aae({target:e,parameters:[t,n]}){_E.set(e,{state:"open",method:String(t).toUpperCase(),url:hE(String(n))})}function sae({target:e,parameters:[t],handlingStack:n},r,i){const o=_E.get(e);if(!o)return;const a=o;a.state="start",a.startClocks=xr(),a.isAborted=!1,a.xhr=e,a.handlingStack=n,a.requestBody=t;let l=!1;const{stop:d}=va(e,"onreadystatechange",()=>{e.readyState===XMLHttpRequest.DONE&&f()}),f=()=>{if(m(),d(),l)return;l=!0;const h=o;h.state="complete",h.duration=Zn(a.startClocks.timeStamp,br()),h.status=e.status,typeof e.response=="string"&&(h.responseBody=e.response),i.notify(gm(h))},{stop:m}=Dn(r,e,"loadend",f);i.notify(a)}function lae({target:e}){const t=_E.get(e);t&&(t.isAborted=!0)}async function cae(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(nn),t.collectStreamBody?kL(r):void 0}let D_;const XL=[];function JL({responseBodyAction:e}={}){return e&&XL.push(e),D_||(D_=uae()),D_}function uae(){return new Pt(e=>{if(!wa.fetch)return;const{stop:t}=va(wa,"fetch",n=>dae(n,e),{computeHandlingStack:!0});return t})}function dae({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 l=a!==void 0?String(a).toUpperCase():"GET",d=i instanceof Request?i.url:hE(String(i)),f=xr(),m={state:"start",init:o,input:i,method:l,startClocks:f,url:d,handlingStack:n};r.notify(m),e[0]=m.input,e[1]=m.init,t(h=>{fae(r,h,m).catch(hl)})}async function fae(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 l=XL.reduce((d,f)=>Math.max(d,f(o)),0);if(l!==0){const d=foe(a);if(d&&d.body)try{const f=await cae(d.body,{collectStreamBody:l===2});o.responseBody=f&&new TextDecoder().decode(f)}catch{}}e.notify(o)}function pae(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){const n=window.requestIdleCallback(_t(e),t);return()=>window.cancelIdleCallback(n)}return hae(e)}const mae=50;function hae(e){const t=Jr(),n=Pr(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,mae-(Jr()-t))})},0);return()=>xo(n)}const gae=Lr,vae=30;function yae(){const e=[];function t(r){let i;if(r.didTimeout){const o=performance.now();i=()=>vae-(performance.now()-o)}else i=r.timeRemaining.bind(r);for(;i()>0&&e.length;)e.shift()();e.length&&n()}function n(){pae(t,{timeout:gae})}return{push(r){e.push(r)===1&&n()},stop(){e.length=0}}}let P_={};function bae(e){const t=e.map(n=>(P_[n]||(P_[n]=xae(n)),P_[n]));return X4(...t)}function xae(e){return new Pt(t=>{const n=Ja[e];return Ja[e]=(...r)=>{n.apply(console,r);const i=ym("console error");dl(()=>{t.notify(wae(r,e,i))})},()=>{Ja[e]=n}})}function wae(e,t,n){const r=e.map(i=>Sae(i)).join(" ");if(t===Mb.error){const i=e.find($l),o=bE({originalError:i,handlingStack:n,startClocks:xr(),source:mf.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 Sae(e){return typeof e=="string"?wn(e):$l(e)?SL(Zb(e)):Ld(wn(e),void 0,2)}const _ae=500;function Cae(){const e=[];return{add:i=>{e.push(i)>_ae&&e.splice(0,1)},remove:i=>{qL(e,i)},drain:i=>{e.forEach(o=>o(i)),e.length=0}}}function kae(e){const t=pf(e)==="object";return t||gt.error("Unsupported context:",e),t}function M_(e,t,n){const r={...e};for(const[i,{required:o,type:a}]of Object.entries(t))a==="string"&&!wD(r[i])&&(r[i]=String(r[i])),o&&wD(r[i])&&gt.warn(`The property ${i} of ${n} is required; context will not be sent to the intake.`);return r}function wD(e){return e==null||e===""}function Xb(e="",{propertiesConfig:t={}}={}){let n={};const r=new Pt,i={getContext:()=>xE(n),setContext:o=>{kae(o)?n=wn(M_(o,t,e)):i.clearContext(),r.notify()},setContextProperty:(o,a)=>{n=wn(M_({...n,[o]:a},t,e)),r.notify()},removeContextProperty:o=>{delete n[o],M_(n,t,e),r.notify()},clearContext:()=>{n={},r.notify()},changeObservable:r};return i}function Br(e,t,n,r){return _t((...i)=>(r&&gr({feature:r}),e()[t][n](...i)))}const Eae="_dd_c",jae=[];function CE(e,t,n,r){const i=Rae(n,r);jae.push(Dn(e,window,"storage",({key:f})=>{i===f&&a()})),t.changeObservable.subscribe(l);const o=os(d(),t.getContext());Nl(o)||t.setContext(o);function a(){t.setContext(d())}function l(){localStorage.setItem(i,JSON.stringify(t.getContext()))}function d(){const f=localStorage.getItem(i);return f?JSON.parse(f):{}}}function Rae(e,t){return`${Eae}_${e}_${t}`}function Iae(e,t,n){const r=QL();return t.storeContextsAcrossPages&&CE(t,r,n,4),e.register(0,()=>{const i=r.getContext();return Nl(i)||!i.id?Ki:{account:i}}),r}function QL(){return Xb("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function Tae(e,t,n,r){const i=eF();return t.storeContextsAcrossPages&&CE(t,i,n,2),e.register(0,()=>({context:i.getContext()})),i}function eF(){return Xb("global context")}function Nae(e,t,n,r){const i=tF();return t.storeContextsAcrossPages&&CE(t,i,r,1),e.register(0,({eventType:o,startTime:a})=>{const l=i.getContext(),d=n.findTrackedSession(a);return d&&d.anonymousId&&!l.anonymous_id&&t.trackAnonymousUser&&(l.anonymous_id=d.anonymousId),Nl(l)?Ki:{type:o,usr:l}}),e.register(1,({startTime:o})=>{var a;return{anonymous_id:(a=n.findTrackedSession(o))===null||a===void 0?void 0:a.anonymousId}}),i}function tF(){return Xb("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}const vr={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},Hr={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"},Gr={DOCUMENT:"document",XHR:"xhr",BEACON:"beacon",FETCH:"fetch",CSS:"css",JS:"js",IMAGE:"image",FONT:"font",MEDIA:"media",OTHER:"other"},Jb={FETCH:Gr.FETCH,XHR:Gr.XHR},Aae=500;function Oae(e=Wie){const t=new J4(Aae),n=e().subscribe(r=>{t.notify({type:0,error:r})});return{observable:t,stop:()=>{n.unsubscribe()}}}function $ae(){try{return new Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const wt={ACTION:"action",ERROR:"error",LONG_TASK:"long_task",VIEW:"view",RESOURCE:"resource",VITAL:"vital"},SD={LONG_TASK:"long-task",LONG_ANIMATION_FRAME:"long-animation-frame"},Qa={INITIAL_LOAD:"initial_load",ROUTE_CHANGE:"route_change",BF_CACHE:"bf_cache"},kE={CLICK:"click",CUSTOM:"custom"},Ap={RAGE_CLICK:"rage_click",ERROR_CLICK:"error_click",DEAD_CLICK:"dead_click"},xm={DURATION:"duration",OPERATION_STEP:"operation_step"};function Dae(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}function Pae(e,t,n){function r(a){return!t.wasInPageStateDuringPeriod("frozen",a.startClocks.relative,a.duration)}function i(a){r(a)&&e.notify(12,_D(a))}function o(a,l,d,f){if(!Zm(gl.FEATURE_OPERATION_VITAL))return;const{operationKey:m,context:h,description:v}=d||{},y={name:a,type:xm.OPERATION_STEP,operationKey:m,failureReason:f,stepType:l,startClocks:xr(),context:wn(h),description:v};e.notify(12,_D(y))}return{addOperationStepVital:o,addDurationVital:i,startDurationVital:(a,l={})=>nF(n,a,l),stopDurationVital:(a,l={})=>{rF(i,n,a,l)}}}function nF({vitalsByName:e,vitalsByReference:t},n,r={}){const i={name:n,startClocks:xr(),...r},o={__dd_vital_reference:!0};return e.set(n,i),t.set(o,i),o}function rF(e,{vitalsByName:t,vitalsByReference:n},r,i={}){const o=typeof r=="string"?t.get(r):n.get(r);o&&(e(Mae(o,o.startClocks,i,xr())),typeof r=="string"?t.delete(r):n.delete(r))}function Mae(e,t,n,r){var i;return{name:e.name,type:xm.DURATION,startClocks:t,duration:Zn(t.timeStamp,r.timeStamp),context:os(e.context,n.context),description:(i=n.description)!==null&&i!==void 0?i:e.description}}function _D(e){const{startClocks:t,type:n,name:r,description:i,context:o}=e,a={id:ei(),type:n,name:r,description:i,...n===xm.DURATION?{duration:xt(e.duration)}:{step_type:e.stepType,operation_key:e.operationKey,failure_reason:e.failureReason}};return{rawRumEvent:{date:t.timeStamp,vital:a,type:wt.VITAL,context:o},startTime:t.relative,duration:n===xm.DURATION?e.duration:void 0,domainContext:{}}}function iF(e,t,n){if(e)for(const r of e){const i=r[t];i&&i(n)}}const CD=["tracecontext","datadog"];function zae(e,t){var n,r,i,o,a,l,d;if(e.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(e.trackFeatureFlagsForEvents)&&gt.warn("trackFeatureFlagsForEvents should be an array"),!e.applicationId){gt.error("Application ID is not configured, no RUM data will be collected.");return}if(!hd(e.sessionReplaySampleRate,"Session Replay")||!hd(e.traceSampleRate,"Trace"))return;if(e.excludedActivityUrls!==void 0&&!Array.isArray(e.excludedActivityUrls)){gt.error("Excluded Activity Urls should be an array");return}const f=Lae(e);if(!f)return;const m=xie(e,t),h=Uae(e);if(!m)return;const v=(n=e.sessionReplaySampleRate)!==null&&n!==void 0?n:0;return{applicationId:e.applicationId,actionNameAttribute:e.actionNameAttribute,betaTrackActionsInShadowDom:!!e.betaTrackActionsInShadowDom,sessionReplaySampleRate:v,startSessionReplayRecordingManually:e.startSessionReplayRecordingManually!==void 0?!!e.startSessionReplayRecordingManually:v===0,traceSampleRate:(r=e.traceSampleRate)!==null&&r!==void 0?r:100,rulePsr:Km(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:!!(!((l=e.trackLongTasks)!==null&&l!==void 0)||l),trackBfcacheViews:!!e.trackBfcacheViews,trackEarlyRequests:!!e.trackEarlyRequests,subdomain:e.subdomain,defaultPrivacyLevel:Ry(md,e.defaultPrivacyLevel)?e.defaultPrivacyLevel:md.MASK,enablePrivacyForActionName:!!e.enablePrivacyForActionName,traceContextInjection:Ry(xC,e.traceContextInjection)?e.traceContextInjection:xC.SAMPLED,plugins:e.plugins||[],trackFeatureFlagsForEvents:e.trackFeatureFlagsForEvents||[],profilingSampleRate:(d=e.profilingSampleRate)!==null&&d!==void 0?d:0,propagateTraceBaggage:!!e.propagateTraceBaggage,allowedGraphQlUrls:h,...m}}function Lae(e){if(e.allowedTracingUrls===void 0)return[];if(!Array.isArray(e.allowedTracingUrls)){gt.error("Allowed Tracing URLs should be an array");return}if(e.allowedTracingUrls.length!==0&&e.service===void 0){gt.error("Service needs to be configured when tracing is enabled");return}const t=[];return e.allowedTracingUrls.forEach(n=>{const r=oF(n);r?t.push(r):gt.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",n)}),t}function Fae(e){const t=new Set;return Rc(e.allowedTracingUrls)&&e.allowedTracingUrls.forEach(n=>{var r;(r=oF(n))===null||r===void 0||r.propagatorTypes.forEach(i=>t.add(i))}),Array.from(t)}function oF(e){if(Iy(e))return{match:e,propagatorTypes:CD};if(Wc(e)&&Iy(e.match)&&(e.propagatorTypes===null||e.propagatorTypes===void 0||Array.isArray(e.propagatorTypes)))return{match:e.match,propagatorTypes:e.propagatorTypes||CD}}function Uae(e){if(!e.allowedGraphQlUrls)return[];if(!Array.isArray(e.allowedGraphQlUrls))return gt.warn("allowedGraphQlUrls should be an array"),[];const t=[];return e.allowedGraphQlUrls.forEach(n=>{Iy(n)?t.push({match:n,trackPayload:!1,trackResponseErrors:!1}):Wc(n)&&Iy(n.match)&&t.push({match:n.match,trackPayload:!!n.trackPayload,trackResponseErrors:!!n.trackResponseErrors})}),t}function Vae(e){return Rc(e)&&e.some(t=>Wc(t)&&t.trackPayload)}function Bae(e){return Rc(e)&&e.some(t=>Wc(t)&&t.trackResponseErrors)}function Hae(e){var t;const n=wie(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:Rc(e.allowedTracingUrls),use_allowed_graph_ql_urls:Rc(e.allowedGraphQlUrls),use_track_graph_ql_payload:Vae(e.allowedGraphQlUrls),use_track_graph_ql_response_errors:Bae(e.allowedGraphQlUrls),selected_tracing_propagators:Fae(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:Rc(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 qae(e){const t=[];let n=0,r;const i={quote:void 0,escapeSequence:void 0};let o="";for(const a of e){if(r=kD[n].find(l=>Xae[l](a,i)),!r)return[];if(i.escapeSequence!==void 0&&r!==12){if(!ese(i.escapeSequence))return[];o+=nse(i.escapeSequence),i.escapeSequence=void 0}Jae.includes(r)?o+=a:Qae.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 kD[n].includes(1)?(o!==""&&t.push(o),t):[]}const Kae=/[a-zA-Z_$]/,Gae=/[a-zA-Z0-9_$]/,Zae=/[0-9]/,Yae=/[a-fA-F0-9]/,Wae=`'"`,Xae={0:()=>!1,1:()=>!1,2:e=>Kae.test(e),3:e=>Gae.test(e),4:e=>e===".",5:e=>e==="[",6:e=>e==="]",7:e=>Zae.test(e),8:e=>Wae.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?Yae.test(e):!1},kD={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]},Jae=[2,3,7,10],Qae=[4,5,6];function ese(e){return`"'/\\bfnrt`.includes(e)||e.startsWith("u")&&e.length===5}const tse={'"':'"',"'":"'","/":"/","\\":"\\",b:"\b",f:"\f",n:`
38
- `,r:"\r",t:" "};function nse(e){return e.startsWith("u")?String.fromCharCode(parseInt(e.slice(1),16)):tse[e]}const rse="v1",ise=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function ose(e,t){let n;const r=sse(),i=await use(e);return i.ok?(r.increment("fetch","success"),n=ase(e,i.value,t,r)):(r.increment("fetch","failure"),gt.error(i.error)),Wb("remote configuration metrics",{metrics:r.get()}),n}function ase(e,t,n,r){const i={...e};return ise.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(Wc(v)){if(lse(v)){const y=v.rcSerializedType;switch(y){case"string":return v.value;case"regex":return aF(v.value);case"dynamic":return l(v);default:gt.error(`Unsupported remote configuration: "rcSerializedType": "${y}"`);return}}return Y4(v,o)}return v}function a(v,y){y.forEach(({key:x,value:S})=>{v.setContextProperty(x,o(S))})}function l(v){const y=v.strategy;let x;switch(y){case"cookie":x=d(v);break;case"dom":x=f(v);break;case"js":x=h(v);break;default:gt.error(`Unsupported remote configuration: "strategy": "${y}"`);return}const S=v.extractor;return S!==void 0&&typeof x=="string"?cse(S,x):x}function d({name:v}){const y=qb(v);return r.increment("cookie",y!==void 0?"success":"missing"),y}function f({selector:v,attribute:y}){let x;try{x=document.querySelector(v)}catch{gt.error(`Invalid selector in the remote configuration: '${v}'`),r.increment("dom","failure");return}if(!x){r.increment("dom","missing");return}if(m(x,y)){gt.error(`Forbidden element selected by the remote configuration: '${v}'`),r.increment("dom","failure");return}const S=y!==void 0?x.getAttribute(y):x.textContent;if(S===null){r.increment("dom","missing");return}return r.increment("dom","success"),S}function m(v,y){return v.getAttribute("type")==="password"&&y==="value"}function h({path:v}){let y=window;const x=qae(v);if(x.length===0){gt.error(`Invalid JSON path in the remote configuration: '${v}'`),r.increment("js","failure");return}for(const S of x){if(!(S in y)){r.increment("js","missing");return}try{y=y[S]}catch(C){gt.error(`Error accessing: '${v}'`,C),r.increment("js","failure");return}}return r.increment("js","success"),y}}function sse(){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 lse(e){return"rcSerializedType"in e}function aF(e){try{return new RegExp(e)}catch{gt.error(`Invalid regex in the remote configuration: '${e}'`)}}function cse(e,t){const n=aF(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 use(e){let t;try{t=await fetch(dse(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 dse(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${bL("rum",e)}/${rse}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function fse({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},n,r,i){const o=Cae(),a=eF();z_(a,vr.globalContext,o);const l=tF();z_(l,vr.userContext,o);const d=QL();z_(d,vr.accountContext,o);let f,m,h,v;const y=n.observable.subscribe(S),x={};function S(){if(!h||!v||!n.isGranted())return;y.unsubscribe();let R;if(v.trackViewsManually){if(!f)return;o.remove(f.callback),R=f.options}const N=i(v,m,R);o.drain(N)}function C(R,N){const T=Fd();if(T&&(R=pse(R)),h=R,zoe(Hae(R)),v){RL("DD_RUM",R);return}const A=zae(R,N);if(A){if(!T&&!A.sessionStoreStrategyType){gt.warn("No storage available for session. We will not send any data.");return}A.compressIntakeRequests&&!T&&t&&(m=t(A,"Datadog RUM",nn),!m)||(v=A,JL().subscribe(nn),n.tryToInit(A.trackingConsent),S())}}const k=R=>{o.add(N=>N.addDurationVital(R))};return{init(R,N,T){if(!R){gt.error("Missing configuration");return}Sie(R.enableExperimentalFeatures),h=R,!(e&&KL())&&(iF(R.plugins,"onInit",{initConfiguration:R,publicApi:N}),R.remoteConfigurationId?ose(R,{user:l,context:a}).then(A=>{A&&C(A,T)}).catch(hl):C(R,T))},get initConfiguration(){return h},getInternalContext:nn,stopSession:nn,addTiming(R,N=br()){o.add(T=>T.addTiming(R,N))},startView(R,N=xr()){const T=A=>{A.startView(R,N)};o.add(T),f||(f={options:R,callback:T},S())},setViewName(R){o.add(N=>N.setViewName(R))},setViewContext(R){o.add(N=>N.setViewContext(R))},setViewContextProperty(R,N){o.add(T=>T.setViewContextProperty(R,N))},getViewContext:()=>x,globalContext:a,userContext:l,accountContext:d,addAction(R){o.add(N=>N.addAction(R))},addError(R){o.add(N=>N.addError(R))},addFeatureFlagEvaluation(R,N){o.add(T=>T.addFeatureFlagEvaluation(R,N))},startDurationVital(R,N){return nF(r,R,N)},stopDurationVital(R,N){rF(k,r,R,N)},addDurationVital:k,addOperationStepVital:(R,N,T,A)=>{o.add(D=>D.addOperationStepVital(wn(R),N,wn(T),wn(A)))}}}function pse(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=Ym())===null||n===void 0?void 0:n.getPrivacyLevel()}}function z_(e,t,n){e.changeObservable.subscribe(()=>{const r=e.getContext();n.add(i=>i[t].setContext(r))})}function mse(e,t,n,r={}){const i=tie(),o=Dae(),a=Oae().observable;let l=fse(r,i,o,(h,v,y)=>{const x=v&&r.createDeflateEncoder?C=>r.createDeflateEncoder(h,v,C):eae,S=e(h,t,n,y,x,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,S.longTaskContexts,x),l=hse(l,S),iF(h.plugins,"onRumStart",{strategy:l,addEvent:S.addEvent}),S});const d=()=>l,f=_t(h=>{const v=typeof h=="object"?h:{name:h};l.startView(v),gr({feature:"start-view"})}),m=Qie({init:h=>{const v=new Error().stack;dl(()=>l.init(h,m,v))},setTrackingConsent:_t(h=>{i.update(h),gr({feature:"set-tracking-consent",tracking_consent:h})}),setViewName:_t(h=>{l.setViewName(h),gr({feature:"set-view-name"})}),setViewContext:_t(h=>{l.setViewContext(h),gr({feature:"set-view-context"})}),setViewContextProperty:_t((h,v)=>{l.setViewContextProperty(h,v),gr({feature:"set-view-context-property"})}),getViewContext:_t(()=>(gr({feature:"set-view-context-property"}),l.getViewContext())),getInternalContext:_t(h=>l.getInternalContext(h)),getInitConfiguration:_t(()=>xE(l.initConfiguration)),addAction:(h,v)=>{const y=ym("action");dl(()=>{l.addAction({name:wn(h),context:wn(v),startClocks:xr(),type:kE.CUSTOM,handlingStack:y}),gr({feature:"add-action"})})},addError:(h,v)=>{const y=ym("error");dl(()=>{l.addError({error:h,handlingStack:y,context:wn(v),startClocks:xr()}),gr({feature:"add-error"})})},addTiming:_t((h,v)=>{l.addTiming(wn(h),v)}),setGlobalContext:Br(d,vr.globalContext,Hr.setContext,"set-global-context"),getGlobalContext:Br(d,vr.globalContext,Hr.getContext,"get-global-context"),setGlobalContextProperty:Br(d,vr.globalContext,Hr.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:Br(d,vr.globalContext,Hr.removeContextProperty,"remove-global-context-property"),clearGlobalContext:Br(d,vr.globalContext,Hr.clearContext,"clear-global-context"),setUser:Br(d,vr.userContext,Hr.setContext,"set-user"),getUser:Br(d,vr.userContext,Hr.getContext,"get-user"),setUserProperty:Br(d,vr.userContext,Hr.setContextProperty,"set-user-property"),removeUserProperty:Br(d,vr.userContext,Hr.removeContextProperty,"remove-user-property"),clearUser:Br(d,vr.userContext,Hr.clearContext,"clear-user"),setAccount:Br(d,vr.accountContext,Hr.setContext,"set-account"),getAccount:Br(d,vr.accountContext,Hr.getContext,"get-account"),setAccountProperty:Br(d,vr.accountContext,Hr.setContextProperty,"set-account-property"),removeAccountProperty:Br(d,vr.accountContext,Hr.removeContextProperty,"remove-account-property"),clearAccount:Br(d,vr.accountContext,Hr.clearContext,"clear-account"),startView:f,stopSession:_t(()=>{l.stopSession(),gr({feature:"stop-session"})}),addFeatureFlagEvaluation:_t((h,v)=>{l.addFeatureFlagEvaluation(wn(h),wn(v)),gr({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:_t(()=>t.getSessionReplayLink()),startSessionReplayRecording:_t(h=>{t.start(h),gr({feature:"start-session-replay-recording",force:h&&h.force})}),stopSessionReplayRecording:_t(()=>t.stop()),addDurationVital:_t((h,v)=>{gr({feature:"add-duration-vital"}),l.addDurationVital({name:wn(h),type:xm.DURATION,startClocks:hre(v.startTime),duration:v.duration,context:wn(v&&v.context),description:wn(v&&v.description)})}),startDurationVital:_t((h,v)=>(gr({feature:"start-duration-vital"}),l.startDurationVital(wn(h),{context:wn(v&&v.context),description:wn(v&&v.description)}))),stopDurationVital:_t((h,v)=>{gr({feature:"stop-duration-vital"}),l.stopDurationVital(typeof h=="string"?wn(h):h,{context:wn(v&&v.context),description:wn(v&&v.description)})}),startFeatureOperation:_t((h,v)=>{gr({feature:"add-operation-step-vital",action_type:"start"}),l.addOperationStepVital(h,"start",v)}),succeedFeatureOperation:_t((h,v)=>{gr({feature:"add-operation-step-vital",action_type:"succeed"}),l.addOperationStepVital(h,"end",v)}),failFeatureOperation:_t((h,v,y)=>{gr({feature:"add-operation-step-vital",action_type:"fail"}),l.addOperationStepVital(h,"end",y,v)})});return m}function hse(e,t){return{init:n=>{RL("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function gse(){const e=vse();return new Pt(t=>{if(!e)return;const n=new e(_t(r=>t.notify(r)));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function vse(){let e;const t=window;if(t.Zone&&(e=ml(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(nn),r=ml(n,"originalInstance");e=r&&r.constructor}return e||(e=t.MutationObserver),e}function yse(){const e=new Pt,{stop:t}=va(window,"open",()=>e.notify());return{observable:e,stop:t}}function bse(e,t,n,r,i){return{get:o=>{const a=n.findView(o),l=i.findUrl(o),d=t.findTrackedSession(o);if(d&&a&&l){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:l.referrer,url:l.url}}}}}}const xse=tae,wse=Ol;function Sse(e){const t=Jc({expireDelay:wse});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 sF="initial_document",_se=[[Gr.DOCUMENT,e=>sF===e],[Gr.XHR,e=>e==="xmlhttprequest"],[Gr.FETCH,e=>e==="fetch"],[Gr.BEACON,e=>e==="beacon"],[Gr.CSS,(e,t)=>/\.css$/i.test(t)],[Gr.JS,(e,t)=>/\.js$/i.test(t)],[Gr.IMAGE,(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],[Gr.FONT,(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],[Gr.MEDIA,(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function Cse(e){const t=e.name;if(!Cre(t))return Gr.OTHER;const n=kre(t);for(const[r,i]of _se)if(i(e.initiatorType,n))return r;return Gr.OTHER}function ED(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function lF(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function kse(e){const{duration:t,startTime:n,responseEnd:r}=e;return t===0&&n<r?Zn(n,r):t}function Ese(e){if(!uF(e))return;const{startTime:t,fetchStart:n,workerStart:r,redirectStart:i,redirectEnd:o,domainLookupStart:a,domainLookupEnd:l,connectStart:d,secureConnectionStart:f,connectEnd:m,requestStart:h,responseStart:v,responseEnd:y}=e,x={download:uc(t,v,y),first_byte:uc(t,h,v)};return 0<r&&r<n&&(x.worker=uc(t,r,n)),n<m&&(x.connect=uc(t,d,m),d<=f&&f<=m&&(x.ssl=uc(t,f,m))),n<l&&(x.dns=uc(t,a,l)),t<o&&(x.redirect=uc(t,i,o)),x}function cF(e){return e.duration>=0}function uF(e){const t=ED(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=jse(e)?ED(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function jse(e){return e.redirectEnd>e.startTime}function uc(e,t,n){if(e<=t&&t<=n)return{duration:xt(Zn(t,n)),start:xt(Zn(e,t))}}function Rse(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function Ise(e){return e.deliveryType===""?"other":e.deliveryType}function Tse(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 EE(e){return e&&(!yie(e)||Zm(gl.TRACK_INTAKE_REQUESTS))}const Nse=/data:(.+)?(;base64)?,/g,Ase=24e3;function Ose(e,t=Ase){if(e.length<=t||!e.startsWith("data:"))return e;const n=e.substring(0,100).match(Nse);return n?`${n[0]}[...]`:e}const jD=new Map;function dF(e,t){if(t===100)return!0;if(t===0)return!1;const n=jD.get(t);if(n&&e===n.sessionId)return n.decision;let r;return window.BigInt?r=$se(BigInt(`0x${e.split("-")[4]}`),t):r=yc(t),jD.set(t,{sessionId:e,decision:r}),r}function $se(e,t){const n=BigInt("1111111111111111111"),r=BigInt("0x10000000000000000"),i=e*n%r;return Number(i)<=t/100*Number(r)}function Dse(){return pF(64)}function fF(){return pF(63)}function pF(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 Ju(e){return e.toString(16).padStart(16,"0")}function Pse(e){e.status===0&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function Mse(e,t,n,r){return{clearTracingIfNeeded:Pse,traceFetch:i=>RD(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(l=>{i.input.headers.append(l,o[l])});else{i.init=gm(i.init);const l=[];i.init.headers instanceof Headers?i.init.headers.forEach((d,f)=>{l.push([f,d])}):Array.isArray(i.init.headers)?i.init.headers.forEach(d=>{l.push(d)}):i.init.headers&&Object.keys(i.init.headers).forEach(d=>{l.push([d,i.init.headers[d]])}),i.init.headers=l.concat(gE(o))}}),traceXhr:(i,o)=>RD(e,i,t,n,r,a=>{Object.keys(a).forEach(l=>{o.setRequestHeader(l,a[l])})})}}function RD(e,t,n,r,i,o){const a=n.findTrackedSession();if(!a)return;const l=e.allowedTracingUrls.find(m=>Gb([m.match],t.url,!0));if(!l)return;const d=dF(a.id,e.traceSampleRate);(d||e.traceContextInjection===xC.ALL)&&(t.traceSampled=d,t.traceId=Dse(),t.spanId=fF(),o(zse(t.traceId,t.spanId,t.traceSampled,a.id,l.propagatorTypes,r,i,e)))}function zse(e,t,n,r,i,o,a,l){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${Ju(e)}-${Ju(t)}-0${n?"1":"0"}`,tracestate:`dd=s:${n?"1":"0"};o:rum`});break}case"b3":{Object.assign(d,{b3:`${Ju(e)}-${Ju(t)}-${n?"1":"0"}`});break}case"b3multi":{Object.assign(d,{"X-B3-TraceId":Ju(e),"X-B3-SpanId":Ju(t),"X-B3-Sampled":n?"1":"0"});break}}}),l.propagateTraceBaggage){const f={"session.id":r},m=o.getContext().id;typeof m=="string"&&(f["user.id"]=m);const h=a.getContext().id;typeof h=="string"&&(f["account.id"]=h);const v=Object.entries(f).map(([y,x])=>`${y}=${encodeURIComponent(x)}`).join(",");v&&(d.baggage=v)}return d}const Lse=32*Xc;function Fse(e,t){const n=Vse(e.requestBody,t.trackPayload);if(n){if(t.trackResponseErrors&&e.responseBody){const r=Use(e.responseBody);r&&(n.error_count=r.length,n.errors=r)}return n}}function Use(e){let t;try{t=JSON.parse(e)}catch{return}if(!t||typeof t!="object")return;const n=t;return Rc(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 mF(e,t){return t.allowedGraphQlUrls.find(n=>Gb([n.match],e))}function Vse(e,t=!1){if(!e||typeof e!="string")return;let n;try{n=JSON.parse(e)}catch{return}if(!n)return;let r,i;if(n.query){const l=n.query.trim();r=Bse(l),t&&(i=mE(l,Lse,"..."))}const o=n.operationName;let a;return n.variables&&(a=JSON.stringify(n.variables)),{operationType:r,operationName:o,variables:a,payload:i}}function Bse(e){var t;return(t=e.match(/^\s*(query|mutation|subscription)\b/i))===null||t===void 0?void 0:t[1]}let ID=1;function Hse(e,t,n,r,i){const o=Mse(t,n,r,i);qse(e,t,o),Kse(e,t,o)}function qse(e,t,n){const r=iae(t).subscribe(i=>{const o=i;if(EE(o.url))switch(o.state){case"start":n.traceXhr(o,o.xhr),o.requestIndex=hF(),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:Jb.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 Kse(e,t,n){const r=JL({responseBodyAction:i=>{var o;return!((o=mF(i.url,t))===null||o===void 0)&&o.trackResponseErrors?2:1}}).subscribe(i=>{var o;const a=i;if(EE(a.url))switch(a.state){case"start":n.traceFetch(a),a.requestIndex=hF(),e.notify(7,{requestIndex:a.requestIndex,url:a.url});break;case"resolve":n.clearTracingIfNeeded(a),e.notify(8,{duration:Zn(a.startClocks.timeStamp,br()),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:Jb.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 hF(){const e=ID;return ID+=1,e}function gF(e){return Km(e)&&e<0?void 0:e}function _C(e){return e.nodeType===Node.TEXT_NODE}function Gse(e){return e.nodeType===Node.COMMENT_NODE}function as(e){return e.nodeType===Node.ELEMENT_NODE}function jE(e){return as(e)&&!!e.shadowRoot}function vF(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&as(t.host)}function k2e(e){return e.childNodes.length>0||jE(e)}function E2e(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;jE(e)&&t(e.shadowRoot)}function Zse(e){return vF(e)?e.host:e.parentNode}function yF(e){if(e.parentElement)return e.parentElement;const t=e.parentNode;return t&&vF(t)?t.host:null}function bF({lifeCycle:e,isChildEvent:t,onChange:n=nn}){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 wt.ERROR:r.errorCount+=1,n();break;case wt.ACTION:r.actionCount+=1,o.action.frustration&&(r.frustrationCount+=o.action.frustration.type.length),n();break;case wt.LONG_TASK:r.longTaskCount+=1,n();break;case wt.RESOURCE:!((a=o._dd)===null||a===void 0)&&a.discarded||(r.resourceCount+=1,n());break}});return{stop:()=>{i.unsubscribe()},eventCounts:r}}function Yse(e,t){const n=Jr();let r=!1;const{stop:i}=vl(e,window,["click","mousedown","keydown","touchstart","pointerdown"],l=>{if(!l.cancelable)return;const d={entryType:"first-input",processingStart:qi(),processingEnd:qi(),startTime:l.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};l.type==="pointerdown"?o(e,d):a(d)},{passive:!0,capture:!0});return{stop:i};function o(l,d){vl(l,window,["pointerup","pointercancel"],f=>{f.type==="pointerup"&&a(d)},{once:!0})}function a(l){if(!r){r=!0,i();const d=l.processingStart-l.startTime;d>=0&&d<Jr()-n&&t(l)}}}var Vt;(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"})(Vt||(Vt={}));function ss(e,t){return new Pt(n=>{if(!window.PerformanceObserver)return;const r=d=>{const f=Jse(d);f.length>0&&n.notify(f)};let i,o=!0;const a=new PerformanceObserver(_t(d=>{o?i=Pr(()=>r(d.getEntries())):r(d.getEntries())}));try{a.observe(t)}catch{if([Vt.RESOURCE,Vt.NAVIGATION,Vt.LONG_TASK,Vt.PAINT].includes(t.type)){t.buffered&&(i=Pr(()=>r(performance.getEntriesByType(t.type))));try{a.observe({entryTypes:[t.type]})}catch{return}}}o=!1,Wse(e);let l;return!Qc(Vt.FIRST_INPUT)&&t.type===Vt.FIRST_INPUT&&({stop:l}=Yse(e,d=>{r([d])})),()=>{a.disconnect(),l&&l(),xo(i)}})}let Op;function Wse(e){return!Op&&Xse()&&"addEventListener"in performance&&(Op=Dn(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{Op?.stop()}}function Xse(){return window.performance!==void 0&&"getEntries"in performance}function Qc(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function Jse(e){return e.filter(t=>!Qse(t))}function Qse(e){return e.entryType===Vt.RESOURCE&&(!EE(e.name)||!cF(e))}const xF=100,ele=100,TD="data-dd-excluded-activity-mutations";function RE(e,t,n,r,i,o){const a=nle(e,t,n,r);return tle(a,i,o)}function tle(e,t,n){let r,i=!1;const o=Pr(_t(()=>f({hadActivity:!1})),xF),a=n!==void 0?Pr(_t(()=>f({hadActivity:!0,end:br()})),n):void 0,l=e.subscribe(({isBusy:m})=>{xo(o),xo(r);const h=br();m||(r=Pr(_t(()=>f({hadActivity:!0,end:h})),ele))}),d=()=>{i=!0,xo(o),xo(r),xo(a),l.unsubscribe()};function f(m){i||(d(),t(m))}return{stop:d}}function nle(e,t,n,r){return new Pt(i=>{const o=[];let a,l=0;return o.push(t.subscribe(f=>{f.every(rle)||d()}),n.subscribe(d),ss(r,{type:Vt.RESOURCE}).subscribe(f=>{f.some(m=>!L_(r,m.name))&&d()}),e.subscribe(7,f=>{L_(r,f.url)||(a===void 0&&(a=f.requestIndex),l+=1,d())}),e.subscribe(8,f=>{L_(r,f.url)||a===void 0||f.requestIndex<a||(l-=1,d())})),()=>{o.forEach(f=>f.unsubscribe())};function d(){i.notify({isBusy:l>0})}})}function L_(e,t){return Gb(e.excludedActivityUrls,t)}function rle(e){const t=e.type==="characterData"?e.target.parentElement:e.target;return!!(t&&as(t)&&t.matches(`[${TD}], [${TD}] *`))}const Qb="data-dd-action-name",wF="Masked Element",SF=[Qb,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],ile=[CF,ale],ole=[CF,sle,lle];function Xm(e,t){if(!e.isConnected)return;let n,r=e;for(;r&&r.nodeName!=="HTML";){const i=ND(r,ile,ule,t,n);if(i)return i;n=ND(r,ole,dle,t,n)||ex(cle(r),n),r=r.parentElement}return n}function _F(e){return/[0-9]/.test(e)}function ale(e){if(e.id&&!_F(e.id))return`#${CSS.escape(e.id)}`}function sle(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const r=t[n];if(!_F(r))return`${CSS.escape(e.tagName)}.${CSS.escape(r)}`}}function lle(e){return CSS.escape(e.tagName)}function CF(e,t){if(t){const r=n(t);if(r)return r}for(const r of SF){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 cle(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 ND(e,t,n,r,i){for(const o of t){const a=o(e,r);if(a&&n(e,a,i))return ex(a,i)}}function ule(e,t,n){return e.ownerDocument.querySelectorAll(ex(t,n)).length===1}function dle(e,t,n){let r;if(n===void 0)r=a=>a.matches(t);else{const a=ex(`${t}:scope`,n);r=l=>l.querySelector(a)!==null}let o=e.parentElement.firstElementChild;for(;o;){if(o!==e&&r(o))return!1;o=o.nextElementSibling}return!0}function ex(e,t){return t?`${e}>${t}`:e}const Rt={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:md.ALLOW,MASK:md.MASK,MASK_USER_INPUT:md.MASK_USER_INPUT,MASK_UNLESS_ALLOWLISTED:md.MASK_UNLESS_ALLOWLISTED},kF="data-dd-privacy",j2e="hidden",fle="dd-privacy-",F_="***",R2e="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",ple={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},mle="x";function pc(e){return`[${kF}="${e}"], .${fle}${e}`}function tx(e,t,n){if(n&&n.has(e))return n.get(e);const r=Zse(e),i=r?tx(r,t,n):t,o=gle(e),a=hle(o,i);return n&&n.set(e,a),a}function hle(e,t){switch(t){case Rt.HIDDEN:case Rt.IGNORE:return t}switch(e){case Rt.ALLOW:case Rt.MASK:case Rt.MASK_USER_INPUT:case Rt.MASK_UNLESS_ALLOWLISTED:case Rt.HIDDEN:case Rt.IGNORE:return e;default:return t}}function gle(e){if(as(e)){if(e.tagName==="BASE")return Rt.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return Rt.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return Rt.MASK}if(e.matches(pc(Rt.HIDDEN)))return Rt.HIDDEN;if(e.matches(pc(Rt.MASK)))return Rt.MASK;if(e.matches(pc(Rt.MASK_UNLESS_ALLOWLISTED)))return Rt.MASK_UNLESS_ALLOWLISTED;if(e.matches(pc(Rt.MASK_USER_INPUT)))return Rt.MASK_USER_INPUT;if(e.matches(pc(Rt.ALLOW)))return Rt.ALLOW;if(yle(e))return Rt.IGNORE}}function EF(e,t){switch(t){case Rt.MASK:case Rt.HIDDEN:case Rt.IGNORE:return!0;case Rt.MASK_UNLESS_ALLOWLISTED:return _C(e)?yv(e.parentNode)?!0:!RF(e.textContent||""):yv(e);case Rt.MASK_USER_INPUT:return _C(e)?yv(e.parentNode):yv(e);default:return!1}}function vle(e,t,n,r,i){if(r!==Rt.MASK&&r!==Rt.MASK_UNLESS_ALLOWLISTED||t===kF||SF.includes(t)||t===i.actionNameAttribute)return!1;switch(t){case"title":case"alt":case"placeholder":case"aria-label":case"name":return!0}return!!(e==="A"&&t==="href"||e==="IFRAME"&&t==="srcdoc"||n&&t.startsWith("data-")||(e==="IMG"||e==="SOURCE")&&(t==="src"||t==="srcset"))}function yv(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!!ple[t.tagName]}const jF=e=>e.replace(/\S/g,mle);function I2e(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=F_;else if(a===Rt.HIDDEN)i=F_;else if(EF(e,a))if(r==="DATALIST"||r==="SELECT"||r==="OPTGROUP"){if(!i.trim())return}else r==="OPTION"?i=F_:a===Rt.MASK_UNLESS_ALLOWLISTED?i=IF(i):i=jF(i);return i}function yle(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 RF(e){var t;return!e||!e.trim()?!0:((t=window.$DD_ALLOW)===null||t===void 0?void 0:t.has(e.toLocaleLowerCase()))||!1}function IF(e,t){return RF(e)?e:t||jF(e)}const TF=Lr,ble=100;function xle(e,t){const n=[];let r=0,i;o(e);function o(d){d.stopObservable.subscribe(a),n.push(d),xo(i),i=Pr(l,TF)}function a(){r===1&&n.every(d=>d.isStopped())&&(r=2,t(n))}function l(){xo(i),r===0&&(r=1,a())}return{tryAppend:d=>r!==0?!1:n.length>0&&!wle(n[n.length-1].event,d.event)?(l(),!1):(o(d),!0),stop:()=>{l()}}}function wle(e,t){return e.target===t.target&&Sle(e,t)<=ble&&e.timeStamp-t.timeStamp<=TF}function Sle(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function _le(e,t,n=Rt.ALLOW){const r=new Map,{actionNameAttribute:i}=t,o=AD(e,Qb)||i&&AD(e,i);return o?{name:o,nameSource:"custom_attribute"}:n===Rt.MASK?{name:wF,nameSource:"mask_placeholder"}:OD(e,kle,t,r)||OD(e,Ele,t,r)||{name:"",nameSource:"blank"}}function AD(e,t){const n=Cle(e,`[${t}]`);if(!n)return;const r=n.getAttribute(t);return AF(NF(r.trim()))}function Cle(e,t){let n=e;for(;n;){if(n.matches(t))return n;n=yF(n)}return null}const kle=[(e,t,n)=>{if("labels"in e&&e.labels&&e.labels.length>0)return iy(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 iy(e,t,n)},(e,t,n)=>$p(e,"aria-label",t,n),(e,t,n)=>{const r=e.getAttribute("aria-labelledby");if(r)return{name:r.split(/\s+/).map(i=>Rle(e,i)).filter(i=>!!i).map(i=>OF(i,t,n)).join(" "),nameSource:"text_content"}},(e,t,n)=>$p(e,"alt",t,n),(e,t,n)=>$p(e,"name",t,n),(e,t,n)=>$p(e,"title",t,n),(e,t,n)=>$p(e,"placeholder",t,n),(e,t,n)=>{if("options"in e&&e.options.length>0)return iy(e.options[0],t,n)}],Ele=[(e,t,n)=>iy(e,t,n)],jle=10;function OD(e,t,n,r){let i=e,o=0;for(;o<=jle&&i&&i.nodeName!=="BODY"&&i.nodeName!=="HTML"&&i.nodeName!=="HEAD";){for(const a of t){const l=a(i,n,r);if(l){const{name:d,nameSource:f}=l,m=d&&d.trim();if(m)return{name:AF(NF(m)),nameSource:f}}}if(i.nodeName==="FORM")break;i=yF(i),o+=1}}function NF(e){return e.replace(/\s+/g," ")}function AF(e){return e.length>100?`${mE(e,100)} [...]`:e}function Rle(e,t){const n=e.getRootNode();if(n instanceof ShadowRoot){const r=n.getElementById(t);if(r)return r}return e.ownerDocument?e.ownerDocument.getElementById(t):null}function $p(e,t,n,r){const{enablePrivacyForActionName:i,defaultPrivacyLevel:o}=n;let a=e.getAttribute(t);if(a&&i){const l=tx(e,o,r);vle(e.tagName,t,a,l,n)&&(a=IF(a,wF))}else a||(a="");return{name:a,nameSource:"standard_attribute"}}function iy(e,t,n){return{name:OF(e,t,n)||"",nameSource:"text_content"}}function OF(e,t,n){if(e.isContentEditable)return;const{enablePrivacyForActionName:r,actionNameAttribute:i,defaultPrivacyLevel:o}=t;if(Zm(gl.USE_TREE_WALKER_FOR_ACTION_NAME))return Ile(e,i,r,o,n);if("innerText"in e){let a=e.innerText;const l=d=>{const f=e.querySelectorAll(d);for(let m=0;m<f.length;m+=1){const h=f[m];if("innerText"in h){const v=h.innerText;v&&v.trim().length>0&&(a=a.replace(v,""))}}};return l(`[${Qb}]`),i&&l(`[${i}]`),r&&l(`${pc(Rt.HIDDEN)}, ${pc(Rt.MASK)}`),a}return e.textContent}function Ile(e,t,n,r,i){const o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,l);let a="";for(;o.nextNode();){const d=o.currentNode;if(as(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 l(d){const f=tx(d,r,i);if(n&&f&&EF(d,f))return NodeFilter.FILTER_REJECT;if(as(d)){if(d.hasAttribute(Qb)||t&&d.hasAttribute(t))return NodeFilter.FILTER_REJECT;const m=getComputedStyle(d);if(m.visibility!=="visible"||m.display==="none"||m.contentVisibility&&m.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}function Tle(e,{onPointerDown:t,onPointerUp:n}){let r,i={selection:!1,input:!1,scroll:!1},o;const a=[Dn(e,window,"pointerdown",l=>{DD(l)&&(r=$D(),i={selection:!1,input:!1,scroll:!1},o=t(l))},{capture:!0}),Dn(e,window,"selectionchange",()=>{(!r||!$D())&&(i.selection=!0)},{capture:!0}),Dn(e,window,"scroll",()=>{i.scroll=!0},{capture:!0,passive:!0}),Dn(e,window,"pointerup",l=>{if(DD(l)&&o){const d=i;n(o,l,()=>d),o=void 0}},{capture:!0}),Dn(e,window,"input",()=>{i.input=!0},{capture:!0})];return{stop:()=>{a.forEach(l=>l.stop())}}}function $D(){const e=window.getSelection();return!e||e.isCollapsed}function DD(e){return e.target instanceof Element&&e.isPrimary!==!1}const PD=3;function Nle(e,t){if(Ale(e))return t.addFrustration(Ap.RAGE_CLICK),e.some(MD)&&t.addFrustration(Ap.DEAD_CLICK),t.hasError&&t.addFrustration(Ap.ERROR_CLICK),{isRage:!0};const n=e.some(r=>r.getUserActivity().selection);return e.forEach(r=>{r.hasError&&r.addFrustration(Ap.ERROR_CLICK),MD(r)&&!n&&r.addFrustration(Ap.DEAD_CLICK)}),{isRage:!1}}function Ale(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(PD-1);t+=1)if(e[t+PD-1].event.timeStamp-e[t].event.timeStamp<=Lr)return!0;return!1}const Ole='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 MD(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(Ole)}const $F=10*Lr,om=new Map;function $le(e){const t=om.get(e);return om.delete(e),t}function DF(e,t){om.set(e,t),om.forEach((n,r)=>{Zn(r,qi())>$F&&om.delete(r)})}const Dle=5*ti;function Ple(e,t,n,r){const i=Jc({expireDelay:Dle}),o=new Pt;let a;e.subscribe(10,()=>{i.reset()}),e.subscribe(5,m),e.subscribe(11,m);const{stop:l}=Tle(r,{onPointerDown:h=>Mle(r,e,t,h,n),onPointerUp:({clickActionBase:h,hadActivityOnPointerDown:v},y,x)=>{zle(r,e,t,n,i,o,f,h,y,x,v)}});return{stop:()=>{m(),o.notify(),l()},actionContexts:{findActionId:h=>i.findAll(h)}};function f(h){if(!a||!a.tryAppend(h)){const v=h.clone();a=xle(h,y=>{Fle(y,v),a=void 0})}}function m(){a&&a.stop()}}function Mle(e,t,n,r,i){const o=e.betaTrackActionsInShadowDom?PF(r):r.target;let a;if(e.enablePrivacyForActionName?a=tx(o,e.defaultPrivacyLevel):a=Rt.ALLOW,a===Rt.HIDDEN)return;const l=Lle(r,a,e);let d=!1;return RE(t,n,i,e,f=>{d=f.hadActivity},xF),{clickActionBase:l,hadActivityOnPointerDown:()=>d}}function zle(e,t,n,r,i,o,a,l,d,f,m){var h;const v=MF(t,i,f,l,d);a(v);const y=(h=l?.target)===null||h===void 0?void 0:h.selector;y&&DF(d.timeStamp,y);const{stop:x}=RE(t,n,r,e,E=>{E.hadActivity&&E.end<v.startClocks.timeStamp?v.discard():E.hadActivity?v.stop(E.end):m()?v.stop(v.startClocks.timeStamp):v.stop()},$F),S=t.subscribe(5,({endClocks:E})=>{v.stop(E.timeStamp)}),C=t.subscribe(11,()=>{v.stop(br())}),k=o.subscribe(()=>{v.stop()});v.stopObservable.subscribe(()=>{C.unsubscribe(),S.unsubscribe(),x(),k.unsubscribe()})}function Lle(e,t,n){const r=e.target,i=r.getBoundingClientRect(),o=Xm(r,n.actionNameAttribute);o&&DF(e.timeStamp,o);const a=n.betaTrackActionsInShadowDom?PF(e):e.target,{name:l,nameSource:d}=_le(a,n,t);return{type:kE.CLICK,target:{width:Math.round(i.width),height:Math.round(i.height),selector:o},position:{x:Math.round(e.clientX-i.left),y:Math.round(e.clientY-i.top)},name:l,nameSource:d}}function PF(e){if(e.composed&&jE(e.target)&&typeof e.composedPath=="function"){const t=e.composedPath();if(t.length>0&&t[0]instanceof Element)return t[0]}return e.target}function MF(e,t,n,r,i){const o=ei(),a=Ub(i.timeStamp),l=t.add(o,a.relative),d=bF({lifeCycle:e,isChildEvent:x=>x.action!==void 0&&(Array.isArray(x.action.id)?x.action.id.includes(o):x.action.id===o)});let f=0,m;const h=[],v=new Pt;function y(x){f===0&&(m=x,f=1,m?l.close(pE(m)):l.remove(),d.stop(),v.notify())}return{event:i,stop:y,stopObservable:v,get hasError(){return d.eventCounts.errorCount>0},get hasPageActivity(){return m!==void 0},getUserActivity:n,addFrustration:x=>{h.push(x)},startClocks:a,isStopped:()=>f===1||f===2,clone:()=>MF(e,t,n,r,i),validate:x=>{if(y(),f!==1)return;const{resourceCount:S,errorCount:C,longTaskCount:k}=d.eventCounts,E={duration:m&&Zn(a.timeStamp,m),startClocks:a,id:o,frustrationTypes:h,counts:{resourceCount:S,errorCount:C,longTaskCount:k},events:x??[i],event:i,...r};e.notify(0,E),f=2},discard:()=>{y(),f=2}}}function Fle(e,t){const{isRage:n}=Nle(e,t);n?(e.forEach(r=>r.discard()),t.stop(br()),t.validate(e.map(r=>r.event))):(t.discard(),e.forEach(r=>r.validate()))}const Ule=1;function Vle(e,t,n,r,i){const{unsubscribe:o}=e.subscribe(0,d=>{e.notify(12,zD(d))});t.register(0,({startTime:d,eventType:f})=>{if(f!==wt.ERROR&&f!==wt.RESOURCE&&f!==wt.LONG_TASK)return Ki;const m=f===wt.LONG_TASK?Al(d,Ule):d,h=a.findActionId(m);return h?{type:f,action:{id:h}}:Ki}),t.register(1,({startTime:d})=>({action:{id:a.findActionId(d)}}));let a={findActionId:nn},l=nn;return i.trackUserInteractions&&({actionContexts:a,stop:l}=Ple(e,n,r,i)),{addAction:d=>{e.notify(12,zD(d))},actionContexts:a,stop:()=>{o(),l()}}}function zD(e){const t=U_(e)?{action:{id:e.id,loading_time:gF(xt(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=os({action:{id:ei(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:wt.ACTION},t),r=U_(e)?e.duration:void 0,i=U_(e)?{events:e.events}:{handlingStack:e.handlingStack};return{rawRumEvent:n,duration:r,startTime:e.startClocks.relative,domainContext:i}}function U_(e){return e.type!==kE.CUSTOM}function Ble(e){const t=bae([Mb.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function Hle(e,t){const n=toe(e,[bm.cspViolation,bm.intervention]).subscribe(r=>t.notify(r));return{stop:()=>{n.unsubscribe()}}}function qle(e,t,n){const r=new Pt;return n.subscribe(i=>{i.type===0&&r.notify(i.error)}),Ble(r),Hle(t,r),r.subscribe(i=>e.notify(14,{error:i})),Kle(e)}function Kle(e){return e.subscribe(14,({error:t})=>{e.notify(12,Gle(t))}),{addError:({error:t,handlingStack:n,componentStack:r,startClocks:i,context:o})=>{const a=bE({originalError:t,handlingStack:n,componentStack:r,startClocks:i,nonErrorPrefix:"Provided",source:mf.CUSTOM,handling:"handled"});a.context=os(a.context,o),e.notify(14,{error:a})}}}function Gle(e){const t={date:e.startClocks.timeStamp,error:{id:ei(),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:wt.ERROR,context:e.context},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const LD=new WeakSet;function Zle(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=>!LD.has(r)).filter(r=>cF(r)&&uF(r)).filter(r=>Yle(r,e.startClocks.relative,zF({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return LD.add(n[0]),n[0].toJSON()}function zF(e){return Al(e.startTime,e.duration)}function Yle(e,t,n){return e.startTime>=t-1&&zF(e)<=Al(n,1)}const Wle=2*ti;function Xle(e){const t=Jle(e)||Qle(e);if(!(!t||t.traceTime<=Jr()-Wle))return t.traceId}function Jle(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return LF(t&&t.content,n&&n.content)}function Qle(e){const t=ece(e);if(t)return LF(vm(t,"trace-id"),vm(t,"trace-time"))}function LF(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function ece(e){for(let t=0;t<e.childNodes.length;t+=1){const n=FD(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=FD(n);if(r)return r;if(!_C(n))break}}function FD(e){if(e&&Gse(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function FF(){if(Qc(Vt.NAVIGATION)){const n=performance.getEntriesByType(Vt.NAVIGATION)[0];if(n)return n}const e=tce(),t={entryType:Vt.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 tce(){const e={},t=performance.timing;for(const n in t)if(Km(t[n])){const r=n,i=t[r];e[r]=i===0?0:pE(i)}return e}function nce(e,t,n=FF){SE(e,"interactive",()=>{const r=n(),i=Object.assign(r.toJSON(),{entryType:Vt.RESOURCE,initiatorType:sF,duration:r.responseEnd,traceId:Xle(document),toJSON:()=>({...i,toJSON:void 0})});t(i)})}const rce=1e3;function ice(e){const t=new Set,n=e.subscribe(8,r=>{t.add(r),t.size>rce&&(Wm("Too many requests"),t.delete(t.values().next().value))});return{getMatchingRequest(r){let i=1/0,o;for(const a of t){const l=r.startTime-a.startClocks.relative;0<=l&&l<i&&a.url===r.name&&(i=Math.abs(l),o=a)}return o&&t.delete(o),o},stop(){n.unsubscribe()}}}function oce(e,t,n,r=yae(),i=nce){let o;const a=t.trackEarlyRequests;a?o=ice(e):e.subscribe(8,f=>{d(()=>ace(f,t,n))});const l=ss(t,{type:Vt.RESOURCE,buffered:!0}).subscribe(f=>{for(const m of f)(a||!lF(m))&&d(()=>UD(m,t,n,o))});i(t,f=>{d(()=>UD(f,t,n,o))});function d(f){r.push(()=>{const m=f();m&&e.notify(12,m)})}return{stop:()=>{r.stop(),l.unsubscribe()}}}function ace(e,t,n){const r=Zle(e);return UF(r,e,n,t)}function UD(e,t,n,r){const i=lF(e)&&r?r.getMatchingRequest(e):void 0;return UF(e,i,n,t)}function UF(e,t,n,r){if(!e&&!t)return;const i=t?uce(t,r):dce(e,r);if(!r.trackResources&&!i)return;const o=e?Ub(e.startTime):t.startClocks,a=e?kse(e):fce(n,o,t.duration),l=t&&sce(t,r),d=os({date:o.timeStamp,resource:{id:ei(),duration:xt(a),type:t?t.type===Jb.XHR?Gr.XHR:Gr.FETCH:Cse(e),method:t?t.method:void 0,status_code:t?t.status:pce(e.responseStatus),url:t?Ose(t.url):e.name,protocol:e&&Rse(e),delivery_type:e&&Ise(e),graphql:l},type:wt.RESOURCE,_dd:{discarded:!r.trackResources}},i,e&&cce(e));return{startTime:o.relative,duration:a,rawRumEvent:d,domainContext:lce(e,t)}}function sce(e,t){const n=mF(e.url,t);if(n)return Fse(e,n)}function lce(e,t){if(t){const n={performanceEntry:e,isAborted:t.isAborted,handlingStack:t.handlingStack};return t.type===Jb.XHR?{xhr:t.xhr,...n}:{requestInput:t.input,requestInit:t.init,response:t.response,error:t.error,...n}}return{performanceEntry:e}}function cce(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...Tse(e),...Ese(e)}}}function uce(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 dce(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:fF().toString(),rule_psr:t.rulePsr}}}function fce(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function pce(e){return e===0?void 0:e}function mce(e,t,n){const{stop:r,eventCounts:i}=bF({lifeCycle:e,isChildEvent:o=>o.view.id===t,onChange:n});return{stop:r,eventCounts:i}}const hce=10*ti;function gce(e,t,n){return{stop:ss(e,{type:Vt.PAINT,buffered:!0}).subscribe(i=>{const o=i.find(a=>a.name==="first-contentful-paint"&&a.startTime<t.timeStamp&&a.startTime<hce);o&&n(o.startTime)}).unsubscribe}}function vce(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(Zn(e,qi()))})})}function yce(e,t,n){const r=ss(e,{type:Vt.FIRST_INPUT,buffered:!0}).subscribe(i=>{const o=i.find(a=>a.startTime<t.timeStamp);if(o){const a=Zn(o.startTime,o.processingStart);let l;o.target&&as(o.target)&&(l=Xm(o.target,e.actionNameAttribute)),n({delay:a>=0?a:0,time:o.startTime,targetSelector:l})}});return{stop:()=>{r.unsubscribe()}}}function bce(e,t,n=FF){return Sce(e,()=>{const r=n();wce(r)||t(xce(r))})}function xce(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=qi()?e.responseStart:void 0}}function wce(e){return e.loadEventEnd<=0}function Sce(e,t){let n;const{stop:r}=SE(e,"complete",()=>{n=Pr(()=>t())});return{stop:()=>{r(),xo(n)}}}const _ce=10*ti;function Cce(e,t,n,r){let i=1/0;const{stop:o}=vl(e,n,["pointerdown","keydown"],d=>{i=d.timeStamp},{capture:!0,once:!0});let a=0;const l=ss(e,{type:Vt.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(d=>{const f=oL(d,m=>m.entryType===Vt.LARGEST_CONTENTFUL_PAINT&&m.startTime<i&&m.startTime<t.timeStamp&&m.startTime<_ce&&m.size>a);if(f){let m;f.element&&(m=Xm(f.element,e.actionNameAttribute)),r({value:f.startTime,targetSelector:m,resourceUrl:kce(f)}),a=f.size}});return{stop:()=>{o(),l.unsubscribe()}}}function kce(e){return e.url===""?void 0:e.url}function VF(e,t,n=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:nn};if(Qc(Vt.VISIBILITY_STATE)){const o=performance.getEntriesByType(Vt.VISIBILITY_STATE).filter(a=>a.name==="hidden").find(a=>a.startTime>=t.relative);if(o)return{timeStamp:o.startTime,stop:nn}}let r=1/0;const{stop:i}=vl(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 Ece(e,t,n,r){const i={},{stop:o}=bce(e,h=>{n(h.loadEvent),i.navigationTimings=h,r()}),a=VF(e,t),{stop:l}=gce(e,a,h=>{i.firstContentfulPaint=h,r()}),{stop:d}=Cce(e,a,window,h=>{i.largestContentfulPaint=h,r()}),{stop:f}=yce(e,a,h=>{i.firstInput=h,r()});function m(){o(),l(),d(),f(),a.stop()}return{stop:m,initialViewMetrics:i}}const CC=(e,t)=>e*t,jce=(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:CC(i-n,o-r)},VD=e=>{const t=CC(e.previousRect.width,e.previousRect.height),n=CC(e.currentRect.width,e.currentRect.height),r=jce(e.previousRect,e.currentRect);return t+n-r};function Rce(e,t,n){if(!Oce())return{stop:nn};let r=0,i;n({value:0});const o=Ace(),a=ss(e,{type:Vt.LAYOUT_SHIFT,buffered:!0}).subscribe(l=>{var d;for(const f of l){if(f.hadRecentInput||f.startTime<t)continue;const{cumulatedValue:m,isMaxValue:h}=o.update(f);if(h){const v=Ice(f.sources);i={target:v?.node?new WeakRef(v.node):void 0,time:Zn(t,f.startTime),previousRect:v?.previousRect,currentRect:v?.currentRect,devicePixelRatio:window.devicePixelRatio}}if(m>r){r=m;const v=(d=i?.target)===null||d===void 0?void 0:d.deref();n({value:pd(r,4),targetSelector:v&&Xm(v,e.actionNameAttribute),time:i?.time,previousRect:i?.previousRect?BD(i.previousRect):void 0,currentRect:i?.currentRect?BD(i.currentRect):void 0,devicePixelRatio:i?.devicePixelRatio})}}});return{stop:()=>{a.unsubscribe()}}}function Ice(e){let t;for(const n of e)if(n.node&&as(n.node)){const r=VD(n);(!t||VD(t)<r)&&(t=n)}return t}function BD({x:e,y:t,width:n,height:r}){return{x:e,y:t,width:n,height:r}}const Tce=5*Lr,Nce=Lr;function Ace(){let e=0,t,n,r=0;return{update:i=>{const o=t===void 0||i.startTime-n>=Nce||i.startTime-t>=Tce;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 Oce(){return Qc(Vt.LAYOUT_SHIFT)&&"WeakRef"in window}let oy,BF=0,V_=1/0,B_=0;function $ce(){"interactionCount"in performance||oy||(oy=new window.PerformanceObserver(_t(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(V_=Math.min(V_,n.interactionId),B_=Math.max(B_,n.interactionId),BF=(B_-V_)/7+1)})})),oy.observe({type:"event",buffered:!0,durationThreshold:0}))}const HD=()=>oy?BF:window.performance.interactionCount||0,qD=10,Dce=1*ti;function Pce(e,t,n){if(!Lce())return{getInteractionToNextPaint:()=>{},setViewEnd:nn,stop:nn};const{getViewInteractionCount:r,stopViewInteractionCount:i}=zce(n);let o=1/0;const a=Mce(r);let l=-1,d,f;function m(y){for(const S of y)S.interactionId&&S.startTime>=t&&S.startTime<=o&&a.process(S);const x=a.estimateP98Interaction();x&&x.duration!==l&&(l=x.duration,f=Zn(t,x.startTime),d=$le(x.startTime),!d&&x.target&&as(x.target)&&(d=Xm(x.target,e.actionNameAttribute)))}const h=ss(e,{type:Vt.FIRST_INPUT,buffered:!0}).subscribe(m),v=ss(e,{type:Vt.EVENT,durationThreshold:40,buffered:!0}).subscribe(m);return{getInteractionToNextPaint:()=>{if(l>=0)return{value:Math.min(l,Dce),targetSelector:d,time:f};if(r())return{value:0}},setViewEnd:y=>{o=y,i()},stop:()=>{v.unsubscribe(),h.unsubscribe()}}}function Mce(e){const t=[];function n(){t.sort((r,i)=>i.duration-r.duration).splice(qD)}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<qD||r.duration>o.duration)&&(t.push(r),n())},estimateP98Interaction(){const r=Math.min(t.length-1,Math.floor(e()/50));return t[r]}}}function zce(e){$ce();const t=e===Qa.INITIAL_LOAD?0:HD();let n={stopped:!1};function r(){return HD()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:r(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:r()}}}}function Lce(){return Qc(Vt.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function Fce(e,t,n,r,i,o,a){let l=i===Qa.INITIAL_LOAD,d=!0;const f=[],m=VF(r,o);function h(){if(!d&&!l&&f.length>0){const y=Math.max(...f);y<m.timeStamp-o.relative&&a(y)}}const{stop:v}=RE(e,t,n,r,y=>{d&&(d=!1,y.hadActivity&&f.push(Zn(o.timeStamp,y.end)),h())});return{stop:()=>{v(),m.stop()},setLoadEvent:y=>{l&&(l=!1,f.push(y),h())}}}function T2e(){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 Uce(){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 H_;function Vce(e){return H_||(H_=Bce(e)),H_}function Bce(e){return new Pt(t=>{const{throttled:n}=Vb(()=>{t.notify(IE())},200);return Dn(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function IE(){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 Hce=Lr;function qce(e,t,n,r=Gce(e)){let i=0,o=0,a=0;const l=r.subscribe(({scrollDepth:d,scrollTop:f,scrollHeight:m})=>{let h=!1;if(d>i&&(i=d,h=!0),m>o){o=m;const v=qi();a=Zn(t.relative,v),h=!0}h&&n({maxDepth:Math.min(i,o),maxDepthScrollTop:f,maxScrollHeight:o,maxScrollHeightTime:a})});return{stop:()=>l.unsubscribe()}}function Kce(){const e=Uce(),{height:t}=IE(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),r=Math.round(t+e);return{scrollHeight:n,scrollDepth:r,scrollTop:e}}function Gce(e,t=Hce){return new Pt(n=>{function r(){n.notify(Kce())}if(window.ResizeObserver){const i=Vb(r,t,{leading:!1,trailing:!0}),o=document.scrollingElement||document.documentElement,a=new ResizeObserver(_t(i.throttled));o&&a.observe(o);const l=Dn(e,window,"scroll",i.throttled,{passive:!0});return()=>{i.cancel(),a.disconnect(),l.stop()}}})}function Zce(e,t,n,r,i,o,a){const l={},{stop:d,setLoadEvent:f}=Fce(e,t,n,r,o,a,S=>{l.loadingTime=S,i()}),{stop:m}=qce(r,a,S=>{l.scroll=S}),{stop:h}=Rce(r,a.relative,S=>{l.cumulativeLayoutShift=S,i()}),{stop:v,getInteractionToNextPaint:y,setViewEnd:x}=Pce(r,a.relative,o);return{stop:()=>{d(),h(),m()},stopINPTracking:v,setLoadEvent:f,setViewEnd:x,getCommonViewMetrics:()=>(l.interactionToNextPaint=y(),l)}}function Yce(e,t){const{stop:n}=Dn(e,window,"pageshow",r=>{r.persisted&&t(r)},{capture:!0});return n}function Wce(e,t,n){vce(e.relative,r=>{t.firstContentfulPaint=r,t.largestContentfulPaint={value:r},n()})}const Xce=3e3,Jce=5*ti,Qce=5*ti;function eue(e,t,n,r,i,o,a,l){const d=new Set;let f=v(Qa.INITIAL_LOAD,tL(),l),m;y();let h;a&&(h=x(o),i.trackBfcacheViews&&(m=Yce(i,S=>{f.end();const C=Ub(S.timeStamp);f=v(Qa.BF_CACHE,C,void 0)})));function v(S,C,k){const E=tue(t,n,r,i,e,S,C,k);return d.add(E),E.stopObservable.subscribe(()=>{d.delete(E)}),E}function y(){t.subscribe(10,()=>{f=v(Qa.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 x(S){return S.subscribe(({oldLocation:C,newLocation:k})=>{rue(C,k)&&(f.end(),f=v(Qa.ROUTE_CHANGE))})}return{addTiming:(S,C=br())=>{f.addTiming(S,C)},startView:(S,C)=>{f.end({endClocks:C}),f=v(Qa.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(),m&&m(),f.end(),d.forEach(S=>S.stop())}}}function tue(e,t,n,r,i,o,a=xr(),l){const d=ei(),f=new Pt,m={};let h=0,v;const y=gm(i),x=Xb();let S=!0,C=l?.name;const k=l?.service||r.service,E=l?.version||r.version,j=l?.context;j&&x.setContext(j);const R={id:d,name:C,startClocks:a,service:k,version:E,context:j};e.notify(1,R),e.notify(2,R);const{throttled:N,cancel:T}=Vb($,Xce,{leading:!1}),{setLoadEvent:A,setViewEnd:D,stop:F,stopINPTracking:K,getCommonViewMetrics:te}=Zce(e,t,n,r,ne,o,a),{stop:G,initialViewMetrics:q}=o===Qa.INITIAL_LOAD?Ece(r,a,A,ne):{stop:nn,initialViewMetrics:{}};o===Qa.BF_CACHE&&Wce(a,q,ne);const{stop:V,eventCounts:H}=mce(e,d,ne),z=ff($,Jce),W=e.subscribe(11,P=>{P.reason===im.UNLOADING&&$()});$(),x.changeObservable.subscribe(ne);function L(){e.notify(3,{id:d,name:C,context:x.getContext(),startClocks:a,sessionIsActive:S})}function ne(){L(),N()}function $(){T(),L(),h+=1;const P=v===void 0?br():v.timeStamp;e.notify(4,{customTimings:m,documentVersion:h,id:d,name:C,service:k,version:E,context:x.getContext(),loadingType:o,location:y,startClocks:a,commonViewMetrics:te(),initialViewMetrics:q,duration:Zn(a.timeStamp,P),isActive:v===void 0,sessionIsActive:S,eventCounts:H})}return{get name(){return C},service:k,version:E,contextManager:x,stopObservable:f,end(P={}){var U,O;v||(v=(U=P.endClocks)!==null&&U!==void 0?U:xr(),S=(O=P.sessionIsActive)!==null&&O!==void 0?O:!0,e.notify(5,{endClocks:v}),e.notify(6,{endClocks:v}),Fb(z),D(v.relative),F(),W.unsubscribe(),$(),Pr(()=>{this.stop()},Qce))},stop(){G(),V(),K(),f.notify()},addTiming(P,U){if(v)return;const O=bre(U)?U:Zn(a.timeStamp,U);m[nue(P)]=O,ne()},setViewName(P){C=P,$()}}}function nue(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&gt.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function rue(e,t){return e.pathname!==t.pathname||!iue(t.hash)&&KD(t.hash)!==KD(e.hash)}function iue(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function KD(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function oue(e,t,n,r,i,o,a,l,d,f){return e.subscribe(4,m=>e.notify(12,aue(m,n,l))),t.register(0,({startTime:m,eventType:h})=>{const v=d.findView(m);return v?{type:h,service:v.service,version:v.version,context:v.context,view:{id:v.id,name:v.name}}:yl}),t.register(1,({startTime:m})=>{var h;return{view:{id:(h=d.findView(m))===null||h===void 0?void 0:h.id}}}),eue(r,e,i,o,n,a,!n.trackViewsManually,f)}function aue(e,t,n){var r,i,o,a,l,d,f,m,h,v,y,x,S,C,k,E,j,R;const N=n.getReplayStats(e.id),T=(i=(r=e.commonViewMetrics)===null||r===void 0?void 0:r.cumulativeLayoutShift)===null||i===void 0?void 0:i.devicePixelRatio,A={_dd:{document_version:e.documentVersion,replay_stats:N,cls:T?{device_pixel_ratio:T}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:wt.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:xt((a=e.commonViewMetrics.cumulativeLayoutShift)===null||a===void 0?void 0:a.time),cumulative_layout_shift_target_selector:(l=e.commonViewMetrics.cumulativeLayoutShift)===null||l===void 0?void 0:l.targetSelector,first_byte:xt((d=e.initialViewMetrics.navigationTimings)===null||d===void 0?void 0:d.firstByte),dom_complete:xt((f=e.initialViewMetrics.navigationTimings)===null||f===void 0?void 0:f.domComplete),dom_content_loaded:xt((m=e.initialViewMetrics.navigationTimings)===null||m===void 0?void 0:m.domContentLoaded),dom_interactive:xt((h=e.initialViewMetrics.navigationTimings)===null||h===void 0?void 0:h.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:xt(e.initialViewMetrics.firstContentfulPaint),first_input_delay:xt((v=e.initialViewMetrics.firstInput)===null||v===void 0?void 0:v.delay),first_input_time:xt((y=e.initialViewMetrics.firstInput)===null||y===void 0?void 0:y.time),first_input_target_selector:(x=e.initialViewMetrics.firstInput)===null||x===void 0?void 0:x.targetSelector,interaction_to_next_paint:xt((S=e.commonViewMetrics.interactionToNextPaint)===null||S===void 0?void 0:S.value),interaction_to_next_paint_time:xt((C=e.commonViewMetrics.interactionToNextPaint)===null||C===void 0?void 0:C.time),interaction_to_next_paint_target_selector:(k=e.commonViewMetrics.interactionToNextPaint)===null||k===void 0?void 0:k.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:xt((E=e.initialViewMetrics.largestContentfulPaint)===null||E===void 0?void 0:E.value),largest_contentful_paint_target_selector:(j=e.initialViewMetrics.largestContentfulPaint)===null||j===void 0?void 0:j.targetSelector,load_event:xt((R=e.initialViewMetrics.navigationTimings)===null||R===void 0?void 0:R.loadEvent),loading_time:gF(xt(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:sue(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:xt(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:xt(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:$ae()}};return Nl(e.customTimings)||(A.view.custom_timings=Y4(e.customTimings,xt)),{rawRumEvent:A,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function sue({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:r,largestContentfulPaint:i}){return{cls:e&&{score:e.value,timestamp:xt(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:xt(n)},fid:r&&{duration:xt(r.delay),timestamp:xt(r.time),target_selector:r.targetSelector},inp:t&&{duration:xt(t.value),timestamp:xt(t.time),target_selector:t.targetSelector},lcp:i&&{timestamp:xt(i.value),target_selector:i.targetSelector,resource_url:i.resourceUrl}}}const lue="rum";function cue(e,t,n){const r=Zoe(e,lue,i=>due(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 uue(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:VL("records")?1:0};return{findTrackedSession:()=>e,expire:nn,expireObservable:new Pt,setForcedReplay:nn}}function due(e,t){return fue(t)?t:yc(e.sessionSampleRate)?yc(e.sessionReplaySampleRate)?"1":"2":"0"}function fue(e){return e==="0"||e==="1"||e==="2"}function pue(e,t,n,r,i,o){const a=[e.rumEndpointBuilder];e.replica&&a.push(e.replica.rumEndpointBuilder);const l=BL({encoder:o(2),request:UL(a,n),flushController:HL({pageMayExitObservable:r,sessionExpireObservable:i})});return t.subscribe(13,d=>{d.type===wt.VIEW?l.upsert(d,d.view.id):l.add(d)}),l}function mue(e){const t=Ym();e.subscribe(13,n=>{t.send("rum",n)})}const hue=Ol;function gue(e,t,n,r){const i=Jc({expireDelay:hue});let o;e.subscribe(1,({startClocks:d})=>{const f=r.href;i.add(l({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 m=qi();i.closeActive(m),i.add(l({url:d.href,referrer:f.referrer}),m)}});function l({url:d,referrer:f}){return{url:d,referrer:f}}return t.register(0,({startTime:d,eventType:f})=>{const m=i.find(d);return m?{type:f,view:{url:m.url,referrer:m.referrer}}:yl}),{findUrl:d=>i.find(d),stop:()=>{a.unsubscribe(),i.stop()}}}function vue(e,t){let n=gm(t);return new Pt(r=>{const{stop:i}=yue(e,a),{stop:o}=bue(e,a);function a(){if(n.href===t.href)return;const l=gm(t);r.notify({newLocation:l,oldLocation:n}),n=l}return()=>{i(),o()}})}function yue(e,t){const{stop:n}=va(GD("pushState"),"pushState",({onPostCall:o})=>{o(t)}),{stop:r}=va(GD("replaceState"),"replaceState",({onPostCall:o})=>{o(t)}),{stop:i}=Dn(e,window,"popstate",t);return{stop:()=>{n(),r(),i()}}}function bue(e,t){return Dn(e,window,"hashchange",t)}function GD(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const xue=Ol;function wue(e,t,n){const r=Jc({expireDelay:xue});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([wt.VIEW,wt.ERROR]).includes(o))return Ki;const l=r.find(i);return!l||Nl(l)?Ki:{type:o,feature_flags:l}}),{addFeatureFlagEvaluation:(i,o)=>{const a=r.find();a&&(a[i]=o)}}}const Sue=10*Lr;let _d,bv;function _ue(e,t,n){e.metricsEnabled&&(HF(),bv=!1,t.subscribe(13,()=>{bv=!0}),n.subscribe(({bytesCount:r,messagesCount:i})=>{bv&&(bv=!1,_d.batchCount+=1,YD(_d.batchBytesCount,r),YD(_d.batchMessagesCount,i))}),ff(Cue,Sue))}function Cue(){_d.batchCount!==0&&(Wb("Customer data measures",_d),HF())}function ZD(){return{min:1/0,max:0,sum:0}}function YD(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function HF(){_d={batchCount:0,batchBytesCount:ZD(),batchMessagesCount:ZD()}}const kue=4e3,Eue=500,jue=Ol;function Rue(e,t,n=Eue){const r=Jc({expireDelay:jue,maxEntries:kue});let i;Qc(Vt.VISIBILITY_STATE)&&performance.getEntriesByType(Vt.VISIBILITY_STATE).forEach(f=>{const m=f.name==="hidden"?"hidden":"active";a(m,f.startTime)}),a(qF(),qi());const{stop:o}=vl(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],d=>{a(Tue(d),d.timeStamp)},{capture:!0});function a(d,f=qi()){d!==i&&(i=d,r.closeActive(f),r.add({state:i,startTime:f},f))}function l(d,f,m){return r.findAll(f,m).some(h=>h.state===d)}return e.register(0,({startTime:d,duration:f=0,eventType:m})=>{if(m===wt.VIEW){const h=r.findAll(d,f);return{type:m,_dd:{page_states:Iue(h,d,n)}}}return m===wt.ACTION||m===wt.ERROR?{type:m,view:{in_foreground:l("active",d,0)}}:Ki}),{wasInPageStateDuringPeriod:l,addPageState:a,stop:()=>{o(),r.stop()}}}function Iue(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:r,startTime:i})=>({state:r,start:xt(Zn(t,i))}))}function Tue(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":qF()}function qF(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function Nue(e,t){let n;const r=requestAnimationFrame(_t(()=>{n=IE()})),i=Vce(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 Aue(e,t){const n=window.cookieStore?Oue(e):Due;return new Pt(r=>n(t,i=>r.notify(i)))}function Oue(e){return(t,n)=>Dn(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 $ue=Lr;function Due(e,t){const n=vm(document.cookie,e),r=ff(()=>{const i=vm(document.cookie,e);i!==n&&t(i)},$ue);return()=>{Fb(r)}}const WD="datadog-ci-visibility-test-execution-id";function Pue(e,t,n=Aue(e,WD)){var r;let i=tl(WD)||((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"?Ki:{type:a,session:{type:"ci_test"},ci_test:{test_execution_id:i}}),{stop:()=>{o.unsubscribe()}}}const Mue=Ol;function zue(e,t){const n=Jc({expireDelay:Mue}),r=Qc(Vt.LONG_ANIMATION_FRAME)?Vt.LONG_ANIMATION_FRAME:Vt.LONG_TASK,i=ss(t,{type:r,buffered:!0}).subscribe(a=>{for(const l of a){if(!t.trackLongTasks)break;const d=Ub(l.startTime),f=ei(),m=Lue(l,d,f);e.notify(12,{rawRumEvent:m,startTime:d.relative,duration:l.duration,domainContext:{performanceEntry:l}}),n.add({id:f,startClocks:d,duration:l.duration,entryType:r},d.relative),n.closeActive(Al(d.relative,l.duration))}});return{stop:()=>{i.unsubscribe(),n.stop()},longTaskContexts:{findLongTasks:(a,l)=>n.findAll(a,l)}}}function Lue(e,t,n){const r={date:t.timeStamp,type:wt.LONG_TASK,_dd:{discarded:!1}};return e.entryType===Vt.LONG_TASK?{...r,long_task:{id:n,entry_type:SD.LONG_TASK,duration:xt(e.duration)}}:{...r,long_task:{id:n,entry_type:SD.LONG_ANIMATION_FRAME,duration:xt(e.duration),blocking_duration:xt(e.blockingDuration),first_ui_event_timestamp:xt(e.firstUIEventTimestamp),render_start:xt(e.renderStart),style_and_layout_start:xt(e.styleAndLayoutStart),start_time:xt(e.startTime),scripts:e.scripts.map(i=>({duration:xt(i.duration),pause_duration:xt(i.pauseDuration),forced_style_and_layout_duration:xt(i.forcedStyleAndLayoutDuration),start_time:xt(i.startTime),execution_start:xt(i.executionStart),source_url:i.sourceURL,source_function_name:i.sourceFunctionName,source_char_position:i.sourceCharPosition,invoker:i.invoker,invoker_type:i.invokerType,window_attribution:i.windowAttribution}))}}}function Fue(e){e.register(0,({eventType:t})=>{if(!YL())return Ki;const n=GL(),r=ZL();return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:r,injected:KL()}}})}function Uue(e,t,n){const r=xE(e),i=n(r);return gE(t).forEach(([o,a])=>kC(e,r,o.split(/\.|(?=\[\])/),a)),i}function kC(e,t,n,r){const[i,...o]=n;if(i==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((a,l)=>kC(a,t[l],o,r));return}if(!(!XD(e)||!XD(t))){if(o.length>0)return kC(e[i],t[i],o,r);Vue(e,i,t[i],r)}}function Vue(e,t,n,r){const i=pf(n);i===r?e[t]=wn(n):r==="object"&&(i==="undefined"||i==="null")&&(e[t]={})}function XD(e){return pf(e)==="object"}const Qu={"view.name":"string","view.url":"string","view.referrer":"string"},ed={context:"object"},td={service:"string",version:"string"};let KF;function Bue(e,t,n,r,i){KF={[wt.VIEW]:{"view.performance.lcp.resource_url":"string",...ed,...Qu,...td},[wt.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...ed,...Qu,...td},[wt.RESOURCE]:{"resource.url":"string","resource.graphql.variables":"string",...ed,...Qu,...td},[wt.ACTION]:{"action.target.name":"string",...ed,...Qu,...td},[wt.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...ed,...Qu,...td},[wt.VITAL]:{...ed,...Qu,...td}};const o={[wt.ERROR]:O_(wt.ERROR,r,i),[wt.ACTION]:O_(wt.ACTION,r,i),[wt.VITAL]:O_(wt.VITAL,r,i)};t.subscribe(12,({startTime:a,duration:l,rawRumEvent:d,domainContext:f})=>{const m=n.triggerHook(0,{eventType:d.type,startTime:a,duration:l});if(m===yl)return;const h=os(m,d,{ddtags:NL(e).join(",")});Hue(h,e.beforeSend,f,o)&&(Nl(h.context)&&delete h.context,t.notify(13,h))})}function Hue(e,t,n,r){var i;if(t){const a=Uue(e,KF[e.type],l=>t(l,n));if(a===!1&&e.type!==wt.VIEW)return!1;a===!1&&gt.warn("Can't dismiss view events using beforeSend!")}return!((i=r[e.type])===null||i===void 0?void 0:i.isLimitReached())}function que(e,t,n,r){e.register(0,({eventType:i,startTime:o})=>{const a=t.findTrackedSession(o),l=r.findView(o);if(!a||!l)return yl;let d,f,m;return i===wt.VIEW?(d=n.getReplayStats(l.id)?!0:void 0,f=a.sessionReplay===1,m=l.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:m}}}),e.register(1,({startTime:i})=>{const o=t.findTrackedSession(i);return o?{session:{id:o.id}}:Ki})}function Kue(e){e.register(0,({eventType:t})=>({type:t,connectivity:OL()}))}function Gue(e,t,n){e.register(0,({eventType:r})=>{const i=t.source;return{type:r,_dd:{format_version:2,drift:vre(),configuration:{session_sample_rate:pd(t.sessionSampleRate,3),session_replay_sample_rate:pd(t.sessionReplaySampleRate,3),profiling_sample_rate:pd(t.profilingSampleRate,3),trace_sample_rate:pd(t.traceSampleRate,3),beta_encode_cookie_options:t.betaEncodeCookieOptions},browser_sdk_version:Fd()?"6.25.4":void 0,sdk_name:n},application:{id:t.applicationId},date:br(),source:i}}),e.register(1,()=>({application:{id:t.applicationId}}))}function Zue(e,t){e.register(1,()=>t.isGranted()?Ki:yl)}const Yue=Roe,Wue=[wt.ACTION,wt.ERROR,wt.LONG_TASK,wt.RESOURCE,wt.VITAL];function Xue(e){return{addEvent:(t,n,r,i)=>{Wue.includes(n.type)&&e.notify(12,{startTime:t,rawRumEvent:n,domainContext:r,duration:i})}}}function Jue(e,t){if(!t.metricsEnabled)return{stop:nn};const{unsubscribe:n}=e.subscribe(4,({initialViewMetrics:r})=>{!r.largestContentfulPaint||!r.navigationTimings||(Wb("Initial view metrics",{metrics:Que(r.largestContentfulPaint,r.navigationTimings)}),n())});return{stop:n}}function Que(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function ede(e,t,n,r,i,o,a,l,d){const f=[],m=new xse,h=Yue();m.subscribe(13,R=>AL("rum",R));const v=R=>{m.notify(14,{error:R}),Wm("Error reported to customer",{"error.message":R.message})},y=Coe(e),x=y.subscribe(R=>{m.notify(11,R)});f.push(()=>x.unsubscribe());const S=Ooe("browser-rum-sdk",e,h,v,y,i);f.push(S.stop);const C=Fd()?uue():cue(e,m,o);if(Fd())mue(m);else{const R=pue(e,m,v,y,C.expireObservable,i);f.push(()=>R.stop()),_ue(S,m,R.flushController.flushObservable)}Zue(h,o);const{stop:k}=Jue(m,S);f.push(k);const{stop:E,...j}=tde(m,h,e,C,t,r,a,l,d,v);return f.push(E),l.unbuffer(),f.push(()=>n.stop()),{...j,lifeCycle:m,session:C,stopSession:()=>C.expire(),telemetry:S,stop:()=>{f.forEach(R=>R())},hooks:h}}function tde(e,t,n,r,i,o,a,l,d,f){const m=[],h=gse(),v=vue(n,location),{observable:y,stop:x}=yse();m.push(x),Gue(t,n,d);const S=Rue(t,n);m.push(()=>S.stop());const C=Sse(e);m.push(()=>C.stop());const k=gue(e,t,v,location);m.push(()=>k.stop());const E=wue(e,t,n);que(t,r,i,C),Kue(t);const j=Tae(t,n,"rum"),R=Nae(t,n,r,"rum"),N=Iae(t,n,"rum"),T=Vle(e,t,h,y,n);m.push(T.stop);const A=Xue(e),D=Nue(t,n);m.push(D.stop);const F=Pue(n,t);m.push(F.stop),Fue(t),Bue(n,e,t,f);const{addTiming:K,startView:te,setViewName:G,setViewContext:q,setViewContextProperty:V,getViewContext:H,stop:z}=oue(e,t,n,location,h,y,v,i,C,o);m.push(z);const{stop:W}=oce(e,n,S);m.push(W);const{stop:L,longTaskContexts:ne}=zue(e,n);m.push(L);const{addError:$}=qle(e,n,l);Hse(e,n,r,R,N);const P=Pae(e,S,a),U=bse(n.applicationId,r,C,T.actionContexts,k);return{addAction:T.addAction,addEvent:A.addEvent,addError:$,addTiming:K,addFeatureFlagEvaluation:E.addFeatureFlagEvaluation,startView:te,setViewContext:q,setViewContextProperty:V,getViewContext:H,setViewName:G,viewHistory:C,getInternalContext:U.get,startDurationVital:P.startDurationVital,stopDurationVital:P.stopDurationVital,addDurationVital:P.addDurationVital,addOperationStepVital:P.addOperationStepVital,globalContext:j,userContext:R,accountContext:N,longTaskContexts:ne,stop:()=>m.forEach(O=>O())}}function nde(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=rde(e),l=`/rum/replay/sessions/${i}`;return`${a}${l}?${o.join("&")}`}function rde(e){const t=e.site,n=e.subdomain||ide(e);return`https://${n?`${n}.`:""}${t}`}function ide(e){switch(e.site){case bc:case lie:return"app";case yL:return"dd";default:return}}const ode=1e3;let yo;function N2e(e){return nx(e).segments_count}function A2e(e){nx(e).segments_count+=1}function O2e(e){nx(e).records_count+=1}function $2e(e,t){nx(e).segments_total_raw_size+=t}function ade(e){return yo?.get(e)}function nx(e){yo||(yo=new Map);let t;return yo.has(e)?t=yo.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},yo.set(e,t),yo.size>ode&&sde()),t}function sde(){if(!yo)return;const e=yo.keys().next().value;e&&yo.delete(e)}function GF(e,t,n){let r=0,i=[],o,a=!0,l=0;const d=[],{stop:f}=Dn(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 m(){const v=i.length===0?new Uint8Array(0):kL(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:l,data:v,streamId:n}),d.push({id:l,writeCallback:y,data:v}),a=!1,l+=1},finish(v){h(),d.length?(d.forEach(y=>{delete y.writeCallback}),d[d.length-1].finishCallback=()=>v(m())):v(m())},finishSync(){h();const v=d.map(y=>y.data).join("");return d.length=0,{...m(),pendingData:v}},estimateEncodedBytesCount(v){return v.length/8},stop(){f()}}}function TE({configuredUrl:e,error:t,source:n,scriptType:r}){if(gt.error(`${n} failed to start: an error occurred while initializing the ${r}:`,t),t instanceof Event||t instanceof Error&&lde(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.",gt.error(`${i} See documentation at ${zb}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else r==="worker"&&wE(t)}function lde(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const cde=30*Lr;function ZF(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.25.4"};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 Gn={status:0};function YF(e,t,n,r=ZF){switch(Gn.status===0&&ude(e,t,r),Gn.status){case 1:return Gn.initializationFailureCallbacks.push(n),Gn.worker;case 3:return Gn.worker}}function JD(){return Gn.status}function ude(e,t,n=ZF){try{const r=n(e),{stop:i}=Dn(e,r,"error",l=>{q_(e,t,l)}),{stop:o}=Dn(e,r,"message",({data:l})=>{l.type==="errored"?q_(e,t,l.error,l.streamId):l.type==="initialized"&&fde(l.version)});r.postMessage({action:"init"}),Pr(()=>dde(t),cde),Gn={status:1,worker:r,stop:()=>{i(),o()},initializationFailureCallbacks:[]}}catch(r){q_(e,t,r)}}function dde(e){Gn.status===1&&(gt.error(`${e} failed to start: a timeout occurred while initializing the Worker`),Gn.initializationFailureCallbacks.forEach(t=>t()),Gn={status:2})}function fde(e){Gn.status===1&&(Gn={status:3,worker:Gn.worker,stop:Gn.stop,version:e})}function q_(e,t,n,r){Gn.status===1||Gn.status===0?(TE({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),Gn.status===1&&Gn.initializationFailureCallbacks.forEach(i=>i()),Gn={status:2}):wE(n,{worker_version:Gn.status===3&&Gn.version,stream_id:r})}function WF(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function pde(e,t,n,r){const i=t.findTrackedSession(),o=mde(i,r),a=n.findView();return nde(e,{viewContext:a,errorType:o,session:i})}function mde(e,t){if(!WF())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 hde(e,t){if(!e.metricsEnabled)return{stop:nn};let n,r,i;const{unsubscribe:o}=t.subscribe(a=>{switch(a.type){case"start":n={forced:a.forced,timestamp:br()},r=void 0,i=void 0;break;case"document-ready":n&&(r=Zn(n.timestamp,br()));break;case"recorder-settled":n&&(i=Zn(n.timestamp,br()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":o(),n&&Wb("Recorder init metrics",{metrics:gde(n.forced,i,Zn(n.timestamp,br()),a.type,r)});break}});return{stop:o}}function gde(e,t,n,r,i){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:n,result:r,waitForDocReadyDuration:i}}function vde(e,t,n,r,i,o,a){let l=0,d;t.subscribe(9,()=>{(l===2||l===3)&&(v(),l=1)}),t.subscribe(10,()=>{l===1&&h()});const f=new Pt;hde(a,f);const m=async y=>{f.notify({type:"start",forced:y});const[x]=await Promise.all([QD(f,{type:"recorder-settled"},i()),QD(f,{type:"document-ready"},rae(e,"interactive"))]);if(l!==2){f.notify({type:"aborted"});return}if(!x){l=0,f.notify({type:"recorder-load-failed"});return}const S=o();if(!S){l=0,f.notify({type:"deflate-encoder-load-failed"});return}({stop:d}=x(t,e,n,r,S,a)),l=3,f.notify({type:"succeeded"})};function h(y){const x=n.findTrackedSession();if(yde(x,y)){l=1;return}if(bde(l))return;l=2;const S=xde(x,y)||!1;m(S).catch(hl),S&&n.setForcedReplay()}function v(){l===3&&d?.(),l=0}return{start:h,stop:v,getSessionReplayLink(){return pde(e,n,r,l!==0)},isRecording:()=>l===3}}function yde(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function bde(e){return e===2||e===3}function xde(e,t){return t&&t.force&&e.sessionReplay===0}async function QD(e,t,n){try{return await n}finally{e.notify(t)}}function wde(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:nn},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function Sde(e,t){if(Fd()&&!VL("records")||!WF())return{start:nn,stop:nn,getReplayStats:()=>{},onRumStart:nn,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:r}=wde();return{start:o=>n.start(o),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:i,isRecording:()=>JD()===3&&n.isRecording(),getReplayStats:o=>JD()===3?ade(o):void 0};function i(o,a,l,d,f,m){let h;function v(){return h||(f??(f=YF(a,"Datadog Session Replay",()=>{n.stop()},t)),f&&(h=GF(a,f,1))),h}n=vde(a,o,l,d,e,v,m),r(a)&&n.start()}}const _de="modulepreload",Cde=function(e){return"/"+e},e2={},Jm=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let d=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");i=d(n.map(f=>{if(f=Cde(f),f in e2)return;e2[f]=!0;const m=f.endsWith(".css"),h=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${h}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":_de,m||(v.as="script"),v.crossOrigin="",v.href=f,l&&v.setAttribute("nonce",l),document.head.appendChild(v),m)return new Promise((y,x)=>{v.addEventListener("load",y),v.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return i.then(a=>{for(const l of a||[])l.status==="rejected"&&o(l.reason);return t().catch(o)})};async function kde(e=Ede){try{return await e()}catch(t){TE({error:t,source:"Recorder",scriptType:"module"})}}async function Ede(){return(await Jm(()=>import("./startRecording-B3i2VhSx.js"),[])).startRecording}function jde(){return No().Profiler!==void 0}function Rde(e){let t={status:"starting"};return e.register(0,({eventType:n})=>n!==wt.VIEW&&n!==wt.LONG_TASK?Ki:{type:n,_dd:{profiling:t}}),{get:()=>t,set:n=>{t=n}}}async function Ide(e=Tde){try{return await e()}catch(t){TE({error:t,source:"Profiler",scriptType:"module"})}}async function Tde(){return(await Jm(()=>import("./profiler-B4vE9rPH.js"),[])).createRumProfiler}function Nde(){let e;function t(n,r,i,o,a,l,d){const f=o.findTrackedSession();if(!f||!dF(f.id,i.profilingSampleRate))return;const m=Rde(r);if(!jde()){m.set({status:"error",error_reason:"not-supported-by-browser"});return}Ide().then(h=>{if(!h){Wm("[DD_RUM] Failed to lazy load the RUM Profiler"),m.set({status:"error",error_reason:"failed-to-lazy-load"});return}e=h(i,n,o,m,l,d,a,void 0),e.start()}).catch(hl)}return{onRumStart:t,stop:()=>{e?.stop().catch(hl)}}}const Ade=Sde(kde),Ode=Nde(),$de=mse(ede,Ade,Ode,{startDeflateWorker:YF,createDeflateEncoder:GF,sdkName:"rum"});eoe(No(),"DD_RUM",$de);function ay(e,t){ym("react error"),xr()}const t2={didCatch:!1,error:null};class D2e extends X.Component{constructor(t){super(t),this.resetError=()=>{this.setState(t2)},this.state=t2}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}componentDidCatch(t,n){ay()}render(){return this.state.didCatch?X.createElement(this.props.fallback,{error:this.state.error,resetError:this.resetError}):this.props.children}}let n2=!1;function Dde(){b.useEffect(()=>{n2||(n2=!0)},[])}function Pde(){return u.jsx(u.Fragment,{children:u.jsx(jl,{})})}const rx=yQ()({component:Pde});function Mde(){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 NE(){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 zde(e,t){const n=b.createContext(t),r=o=>{const{children:a,...l}=o,d=b.useMemo(()=>l,Object.values(l));return u.jsx(n.Provider,{value:d,children:a})};r.displayName=e+"Provider";function i(o){const a=b.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 Qi(e,t=[]){let n=[];function r(o,a){const l=b.createContext(a),d=n.length;n=[...n,a];const f=h=>{const{scope:v,children:y,...x}=h,S=v?.[e]?.[d]||l,C=b.useMemo(()=>x,Object.values(x));return u.jsx(S.Provider,{value:C,children:y})};f.displayName=o+"Provider";function m(h,v){const y=v?.[e]?.[d]||l,x=b.useContext(y);if(x)return x;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,m]}const i=()=>{const o=n.map(a=>b.createContext(a));return function(l){const d=l?.[e]||o;return b.useMemo(()=>({[`__scope${e}`]:{...l,[e]:d}}),[l,d])}};return i.scopeName=e,[r,Lde(i,...t)]}function Lde(...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((l,{useScope:d,scopeName:f})=>{const h=d(o)[`__scope${f}`];return{...l,...h}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Ie(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function Ud(e){const t=Fde(e),n=b.forwardRef((r,i)=>{const{children:o,...a}=r,l=b.Children.toArray(o),d=l.find(Vde);if(d){const f=d.props.children,m=l.map(h=>h===d?b.Children.count(f)>1?b.Children.only(null):b.isValidElement(f)?f.props.children:null:h);return u.jsx(t,{...a,ref:i,children:b.isValidElement(f)?b.cloneElement(f,void 0,m):null})}return u.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function Fde(e){const t=b.forwardRef((n,r)=>{const{children:i,...o}=n;if(b.isValidElement(i)){const a=Hde(i),l=Bde(o,i.props);return i.type!==b.Fragment&&(l.ref=r?df(r,a):a),b.cloneElement(i,l)}return b.Children.count(i)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var XF=Symbol("radix.slottable");function Ude(e){const t=({children:n})=>u.jsx(u.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=XF,t}function Vde(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===XF}function Bde(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]=(...l)=>{const d=o(...l);return i(...l),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Hde(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 qde=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ye=qde.reduce((e,t)=>{const n=Ud(`Primitive.${t}`),r=b.forwardRef((i,o)=>{const{asChild:a,...l}=i,d=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(d,{...l,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ay(e,t){e&&lf.flushSync(()=>e.dispatchEvent(t))}var rr=globalThis?.document?b.useLayoutEffect:()=>{},Kde=Wk[" useInsertionEffect ".trim().toString()]||rr;function Ko({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=Gde({defaultProp:t,onChange:n}),l=e!==void 0,d=l?e:i;{const m=b.useRef(e!==void 0);b.useEffect(()=>{const h=m.current;h!==l&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${l?"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.`),m.current=l},[l,r])}const f=b.useCallback(m=>{if(l){const h=Zde(m)?m(e):m;h!==e&&a.current?.(h)}else o(m)},[l,e,o,a]);return[d,f]}function Gde({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),i=b.useRef(n),o=b.useRef(t);return Kde(()=>{o.current=t},[t]),b.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function Zde(e){return typeof e=="function"}var Yde=b.createContext(void 0);function eu(e){const t=b.useContext(Yde);return e||t||"ltr"}function Wde(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var or=e=>{const{present:t,children:n}=e,r=Xde(t),i=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),o=pt(r.ref,Jde(i));return typeof n=="function"||r.isPresent?b.cloneElement(i,{ref:o}):null};or.displayName="Presence";function Xde(e){const[t,n]=b.useState(),r=b.useRef(null),i=b.useRef(e),o=b.useRef("none"),a=e?"mounted":"unmounted",[l,d]=Wde(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const f=xv(r.current);o.current=l==="mounted"?f:"none"},[l]),rr(()=>{const f=r.current,m=i.current;if(m!==e){const v=o.current,y=xv(f);e?d("MOUNT"):y==="none"||f?.display==="none"?d("UNMOUNT"):d(m&&v!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),rr(()=>{if(t){let f;const m=t.ownerDocument.defaultView??window,h=y=>{const S=xv(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=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},v=y=>{y.target===t&&(o.current=xv(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{m.clearTimeout(f),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:b.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function xv(e){return e?.animationName||"none"}function Jde(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 Qde=Wk[" useId ".trim().toString()]||(()=>{}),efe=0;function Vi(e){const[t,n]=b.useState(Qde());return rr(()=>{n(r=>r??String(efe++))},[e]),t?`radix-${t}`:""}function Qm(e){const t=e+"CollectionProvider",[n,r]=Qi(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=S=>{const{scope:C,children:k}=S,E=X.useRef(null),j=X.useRef(new Map).current;return u.jsx(i,{scope:C,itemMap:j,collectionRef:E,children:k})};a.displayName=t;const l=e+"CollectionSlot",d=Ud(l),f=X.forwardRef((S,C)=>{const{scope:k,children:E}=S,j=o(l,k),R=pt(C,j.collectionRef);return u.jsx(d,{ref:R,children:E})});f.displayName=l;const m=e+"CollectionItemSlot",h="data-radix-collection-item",v=Ud(m),y=X.forwardRef((S,C)=>{const{scope:k,children:E,...j}=S,R=X.useRef(null),N=pt(C,R),T=o(m,k);return X.useEffect(()=>(T.itemMap.set(R,{ref:R,...j}),()=>{T.itemMap.delete(R)})),u.jsx(v,{[h]:"",ref:N,children:E})});y.displayName=m;function x(S){const C=o(e+"CollectionConsumer",S);return X.useCallback(()=>{const E=C.collectionRef.current;if(!E)return[];const j=Array.from(E.querySelectorAll(`[${h}]`));return Array.from(C.itemMap.values()).sort((T,A)=>j.indexOf(T.ref.current)-j.indexOf(A.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:a,Slot:f,ItemSlot:y},x,r]}function Tn(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>t.current?.(...n),[])}function tfe(e,t=globalThis?.document){const n=Tn(e);b.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 nfe="DismissableLayer",EC="dismissableLayer.update",rfe="dismissableLayer.pointerDownOutside",ife="dismissableLayer.focusOutside",r2,JF=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gf=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...d}=e,f=b.useContext(JF),[m,h]=b.useState(null),v=m?.ownerDocument??globalThis?.document,[,y]=b.useState({}),x=pt(t,A=>h(A)),S=Array.from(f.layers),[C]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),k=S.indexOf(C),E=m?S.indexOf(m):-1,j=f.layersWithOutsidePointerEventsDisabled.size>0,R=E>=k,N=sfe(A=>{const D=A.target,F=[...f.branches].some(K=>K.contains(D));!R||F||(i?.(A),a?.(A),A.defaultPrevented||l?.())},v),T=lfe(A=>{const D=A.target;[...f.branches].some(K=>K.contains(D))||(o?.(A),a?.(A),A.defaultPrevented||l?.())},v);return tfe(A=>{E===f.layers.size-1&&(r?.(A),!A.defaultPrevented&&l&&(A.preventDefault(),l()))},v),b.useEffect(()=>{if(m)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(r2=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),i2(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=r2)}},[m,v,n,f]),b.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),i2())},[m,f]),b.useEffect(()=>{const A=()=>y({});return document.addEventListener(EC,A),()=>document.removeEventListener(EC,A)},[]),u.jsx(Ye.div,{...d,ref:x,style:{pointerEvents:j?R?"auto":"none":void 0,...e.style},onFocusCapture:Ie(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Ie(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Ie(e.onPointerDownCapture,N.onPointerDownCapture)})});gf.displayName=nfe;var ofe="DismissableLayerBranch",afe=b.forwardRef((e,t)=>{const n=b.useContext(JF),r=b.useRef(null),i=pt(t,r);return b.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(Ye.div,{...e,ref:i})});afe.displayName=ofe;function sfe(e,t=globalThis?.document){const n=Tn(e),r=b.useRef(!1),i=b.useRef(()=>{});return b.useEffect(()=>{const o=l=>{if(l.target&&!r.current){let d=function(){QF(rfe,n,f,{discrete:!0})};const f={originalEvent:l};l.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 lfe(e,t=globalThis?.document){const n=Tn(e),r=b.useRef(!1);return b.useEffect(()=>{const i=o=>{o.target&&!r.current&&QF(ife,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 i2(){const e=new CustomEvent(EC);document.dispatchEvent(e)}function QF(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?Ay(i,o):i.dispatchEvent(o)}function AE(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var eU=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"}),cfe="VisuallyHidden",tU=b.forwardRef((e,t)=>u.jsx(Ye.span,{...e,ref:t,style:{...eU,...e.style}}));tU.displayName=cfe;var nU=tU,tu="NavigationMenu",[OE,rU,ufe]=Qm(tu),[jC,dfe,ffe]=Qm(tu),[$E]=Qi(tu,[ufe,ffe]),[pfe,Ao]=$E(tu),[mfe,hfe]=$E(tu),iU=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:o,delayDuration:a=200,skipDelayDuration:l=300,orientation:d="horizontal",dir:f,...m}=e,[h,v]=b.useState(null),y=pt(t,F=>v(F)),x=eu(f),S=b.useRef(0),C=b.useRef(0),k=b.useRef(0),[E,j]=b.useState(!0),[R,N]=Ko({prop:r,onChange:F=>{const K=F!=="",te=l>0;K?(window.clearTimeout(k.current),te&&j(!1)):(window.clearTimeout(k.current),k.current=window.setTimeout(()=>j(!0),l)),i?.(F)},defaultProp:o??"",caller:tu}),T=b.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>N(""),150)},[N]),A=b.useCallback(F=>{window.clearTimeout(C.current),N(F)},[N]),D=b.useCallback(F=>{R===F?window.clearTimeout(C.current):S.current=window.setTimeout(()=>{window.clearTimeout(C.current),N(F)},a)},[R,N,a]);return b.useEffect(()=>()=>{window.clearTimeout(S.current),window.clearTimeout(C.current),window.clearTimeout(k.current)},[]),u.jsx(oU,{scope:n,isRootMenu:!0,value:R,dir:x,orientation:d,rootNavigationMenu:h,onTriggerEnter:F=>{window.clearTimeout(S.current),E?D(F):A(F)},onTriggerLeave:()=>{window.clearTimeout(S.current),T()},onContentEnter:()=>window.clearTimeout(C.current),onContentLeave:T,onItemSelect:F=>{N(K=>K===F?"":F)},onItemDismiss:()=>N(""),children:u.jsx(Ye.nav,{"aria-label":"Main","data-orientation":d,dir:x,...m,ref:y})})});iU.displayName=tu;var RC="NavigationMenuSub",gfe=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",...l}=e,d=Ao(RC,n),[f,m]=Ko({prop:r,onChange:i,defaultProp:o??"",caller:RC});return u.jsx(oU,{scope:n,isRootMenu:!1,value:f,dir:d.dir,orientation:a,rootNavigationMenu:d.rootNavigationMenu,onTriggerEnter:h=>m(h),onItemSelect:h=>m(h),onItemDismiss:()=>m(""),children:u.jsx(Ye.div,{"data-orientation":a,...l,ref:t})})});gfe.displayName=RC;var oU=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:i,orientation:o,children:a,value:l,onItemSelect:d,onItemDismiss:f,onTriggerEnter:m,onTriggerLeave:h,onContentEnter:v,onContentLeave:y}=e,[x,S]=b.useState(null),[C,k]=b.useState(new Map),[E,j]=b.useState(null);return u.jsx(pfe,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:l,previousValue:AE(l),baseId:Vi(),dir:i,orientation:o,viewport:x,onViewportChange:S,indicatorTrack:E,onIndicatorTrackChange:j,onTriggerEnter:Tn(m),onTriggerLeave:Tn(h),onContentEnter:Tn(v),onContentLeave:Tn(y),onItemSelect:Tn(d),onItemDismiss:Tn(f),onViewportContentChange:b.useCallback((R,N)=>{k(T=>(T.set(R,N),new Map(T)))},[]),onViewportContentRemove:b.useCallback(R=>{k(N=>N.has(R)?(N.delete(R),new Map(N)):N)},[]),children:u.jsx(OE.Provider,{scope:t,children:u.jsx(mfe,{scope:t,items:C,children:a})})})},aU="NavigationMenuList",sU=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Ao(aU,n),o=u.jsx(Ye.ul,{"data-orientation":i.orientation,...r,ref:t});return u.jsx(Ye.div,{style:{position:"relative"},ref:i.onIndicatorTrackChange,children:u.jsx(OE.Slot,{scope:n,children:i.isRootMenu?u.jsx(mU,{asChild:!0,children:o}):o})})});sU.displayName=aU;var lU="NavigationMenuItem",[vfe,cU]=$E(lU),uU=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...i}=e,o=Vi(),a=r||o||"LEGACY_REACT_AUTO_VALUE",l=b.useRef(null),d=b.useRef(null),f=b.useRef(null),m=b.useRef(()=>{}),h=b.useRef(!1),v=b.useCallback((x="start")=>{if(l.current){m.current();const S=TC(l.current);S.length&&ME(x==="start"?S:S.reverse())}},[]),y=b.useCallback(()=>{if(l.current){const x=TC(l.current);x.length&&(m.current=jfe(x))}},[]);return u.jsx(vfe,{scope:n,value:a,triggerRef:d,contentRef:l,focusProxyRef:f,wasEscapeCloseRef:h,onEntryKeyDown:v,onFocusProxyEnter:v,onRootContentClose:y,onContentFocusOutside:y,children:u.jsx(Ye.li,{...i,ref:t})})});uU.displayName=lU;var IC="NavigationMenuTrigger",yfe=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...i}=e,o=Ao(IC,e.__scopeNavigationMenu),a=cU(IC,e.__scopeNavigationMenu),l=b.useRef(null),d=pt(l,a.triggerRef,t),f=gU(o.baseId,a.value),m=vU(o.baseId,a.value),h=b.useRef(!1),v=b.useRef(!1),y=a.value===o.value;return u.jsxs(u.Fragment,{children:[u.jsx(OE.ItemSlot,{scope:n,value:a.value,children:u.jsx(hU,{asChild:!0,children:u.jsx(Ye.button,{id:f,disabled:r,"data-disabled":r?"":void 0,"data-state":zE(y),"aria-expanded":y,"aria-controls":m,...i,ref:d,onPointerEnter:Ie(e.onPointerEnter,()=>{v.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:Ie(e.onPointerMove,Oy(()=>{r||v.current||a.wasEscapeCloseRef.current||h.current||(o.onTriggerEnter(a.value),h.current=!0)})),onPointerLeave:Ie(e.onPointerLeave,Oy(()=>{r||(o.onTriggerLeave(),h.current=!1)})),onClick:Ie(e.onClick,()=>{o.onItemSelect(a.value),v.current=y}),onKeyDown:Ie(e.onKeyDown,x=>{const C={horizontal:"ArrowDown",vertical:o.dir==="rtl"?"ArrowLeft":"ArrowRight"}[o.orientation];y&&x.key===C&&(a.onEntryKeyDown(),x.preventDefault())})})})}),y&&u.jsxs(u.Fragment,{children:[u.jsx(nU,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:x=>{const S=a.contentRef.current,C=x.relatedTarget,k=C===l.current,E=S?.contains(C);(k||!E)&&a.onFocusProxyEnter(k?"start":"end")}}),o.viewport&&u.jsx("span",{"aria-owns":m})]})]})});yfe.displayName=IC;var bfe="NavigationMenuLink",o2="navigationMenu.linkSelect",dU=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:i,...o}=e;return u.jsx(hU,{asChild:!0,children:u.jsx(Ye.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...o,ref:t,onClick:Ie(e.onClick,a=>{const l=a.target,d=new CustomEvent(o2,{bubbles:!0,cancelable:!0});if(l.addEventListener(o2,f=>i?.(f),{once:!0}),Ay(l,d),!d.defaultPrevented&&!a.metaKey){const f=new CustomEvent(sy,{bubbles:!0,cancelable:!0});Ay(l,f)}},{checkForDefaultPrevented:!1})})})});dU.displayName=bfe;var DE="NavigationMenuIndicator",xfe=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ao(DE,e.__scopeNavigationMenu),o=!!i.value;return i.indicatorTrack?iE.createPortal(u.jsx(or,{present:n||o,children:u.jsx(wfe,{...r,ref:t})}),i.indicatorTrack):null});xfe.displayName=DE;var wfe=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Ao(DE,n),o=rU(n),[a,l]=b.useState(null),[d,f]=b.useState(null),m=i.orientation==="horizontal",h=!!i.value;b.useEffect(()=>{const x=o().find(S=>S.value===i.value)?.ref.current;x&&l(x)},[o,i.value]);const v=()=>{a&&f({size:m?a.offsetWidth:a.offsetHeight,offset:m?a.offsetLeft:a.offsetTop})};return NC(a,v),NC(i.indicatorTrack,v),d?u.jsx(Ye.div,{"aria-hidden":!0,"data-state":h?"visible":"hidden","data-orientation":i.orientation,...r,ref:t,style:{position:"absolute",...m?{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}),Vd="NavigationMenuContent",Sfe=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ao(Vd,e.__scopeNavigationMenu),o=cU(Vd,e.__scopeNavigationMenu),a=pt(o.contentRef,t),l=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(_fe,{forceMount:n,...d,ref:a}):u.jsx(or,{present:n||l,children:u.jsx(fU,{"data-state":zE(l),...d,ref:a,onPointerEnter:Ie(e.onPointerEnter,i.onContentEnter),onPointerLeave:Ie(e.onPointerLeave,Oy(i.onContentLeave)),style:{pointerEvents:!l&&i.isRootMenu?"none":void 0,...d.style}})})});Sfe.displayName=Vd;var _fe=b.forwardRef((e,t)=>{const n=Ao(Vd,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:i}=n;return rr(()=>{r(e.value,{ref:t,...e})},[e,t,r]),rr(()=>()=>i(e.value),[e.value,i]),null}),sy="navigationMenu.rootContentDismiss",fU=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:i,focusProxyRef:o,wasEscapeCloseRef:a,onRootContentClose:l,onContentFocusOutside:d,...f}=e,m=Ao(Vd,n),h=b.useRef(null),v=pt(h,t),y=gU(m.baseId,r),x=vU(m.baseId,r),S=rU(n),C=b.useRef(null),{onItemDismiss:k}=m;b.useEffect(()=>{const j=h.current;if(m.isRootMenu&&j){const R=()=>{k(),l(),j.contains(document.activeElement)&&i.current?.focus()};return j.addEventListener(sy,R),()=>j.removeEventListener(sy,R)}},[m.isRootMenu,e.value,i,k,l]);const E=b.useMemo(()=>{const R=S().map(K=>K.value);m.dir==="rtl"&&R.reverse();const N=R.indexOf(m.value),T=R.indexOf(m.previousValue),A=r===m.value,D=T===R.indexOf(r);if(!A&&!D)return C.current;const F=(()=>{if(N!==T){if(A&&T!==-1)return N>T?"from-end":"from-start";if(D&&N!==-1)return N>T?"to-start":"to-end"}return null})();return C.current=F,F},[m.previousValue,m.value,m.dir,S,r]);return u.jsx(mU,{asChild:!0,children:u.jsx(gf,{id:x,"aria-labelledby":y,"data-motion":E,"data-orientation":m.orientation,...f,ref:v,disableOutsidePointerEvents:!1,onDismiss:()=>{const j=new Event(sy,{bubbles:!0,cancelable:!0});h.current?.dispatchEvent(j)},onFocusOutside:Ie(e.onFocusOutside,j=>{d();const R=j.target;m.rootNavigationMenu?.contains(R)&&j.preventDefault()}),onPointerDownOutside:Ie(e.onPointerDownOutside,j=>{const R=j.target,N=S().some(A=>A.ref.current?.contains(R)),T=m.isRootMenu&&m.viewport?.contains(R);(N||T||!m.isRootMenu)&&j.preventDefault()}),onKeyDown:Ie(e.onKeyDown,j=>{const R=j.altKey||j.ctrlKey||j.metaKey;if(j.key==="Tab"&&!R){const T=TC(j.currentTarget),A=document.activeElement,D=T.findIndex(te=>te===A),K=j.shiftKey?T.slice(0,D).reverse():T.slice(D+1,T.length);ME(K)?j.preventDefault():o.current?.focus()}}),onEscapeKeyDown:Ie(e.onEscapeKeyDown,j=>{a.current=!0})})})}),PE="NavigationMenuViewport",pU=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=!!Ao(PE,e.__scopeNavigationMenu).value;return u.jsx(or,{present:n||o,children:u.jsx(Cfe,{...r,ref:t})})});pU.displayName=PE;var Cfe=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...i}=e,o=Ao(PE,n),a=pt(t,o.onViewportChange),l=hfe(Vd,e.__scopeNavigationMenu),[d,f]=b.useState(null),[m,h]=b.useState(null),v=d?d?.width+"px":void 0,y=d?d?.height+"px":void 0,x=!!o.value,S=x?o.value:o.previousValue;return NC(m,()=>{m&&f({width:m.offsetWidth,height:m.offsetHeight})}),u.jsx(Ye.div,{"data-state":zE(x),"data-orientation":o.orientation,...i,ref:a,style:{pointerEvents:!x&&o.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":v,"--radix-navigation-menu-viewport-height":y,...i.style},onPointerEnter:Ie(e.onPointerEnter,o.onContentEnter),onPointerLeave:Ie(e.onPointerLeave,Oy(o.onContentLeave)),children:Array.from(l.items).map(([k,{ref:E,forceMount:j,...R}])=>{const N=S===k;return u.jsx(or,{present:j||N,children:u.jsx(fU,{...R,ref:df(E,T=>{N&&T&&h(T)})})},k)})})}),kfe="FocusGroup",mU=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Ao(kfe,n);return u.jsx(jC.Provider,{scope:n,children:u.jsx(jC.Slot,{scope:n,children:u.jsx(Ye.div,{dir:i.dir,...r,ref:t})})})}),a2=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],Efe="FocusGroupItem",hU=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=dfe(n),o=Ao(Efe,n);return u.jsx(jC.ItemSlot,{scope:n,children:u.jsx(Ye.button,{...r,ref:t,onKeyDown:Ie(e.onKeyDown,a=>{if(["Home","End",...a2].includes(a.key)){let d=i().map(h=>h.ref.current);if([o.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&d.reverse(),a2.includes(a.key)){const h=d.indexOf(a.currentTarget);d=d.slice(h+1)}setTimeout(()=>ME(d)),a.preventDefault()}})})})});function TC(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 ME(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function jfe(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 NC(e,t){const n=Tn(t);rr(()=>{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 zE(e){return e?"open":"closed"}function gU(e,t){return`${e}-trigger-${t}`}function vU(e,t){return`${e}-content-${t}`}function Oy(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Rfe=iU,Ife=sU,Tfe=uU,Nfe=dU,Afe=pU;function Ofe({className:e,...t}){return u.jsx("div",{className:Ue("absolute top-full left-0 isolate z-50 flex justify-center"),children:u.jsx(Afe,{"data-slot":"navigation-menu-viewport",className:Ue("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 yU({className:e,children:t,viewport:n=!0,...r}){return u.jsxs(Rfe,{"data-slot":"navigation-menu","data-viewport":n,className:Ue("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",e),...r,children:[t,n&&u.jsx(Ofe,{})]})}function AC({className:e,...t}){return u.jsx(Tfe,{"data-slot":"navigation-menu-item",className:Ue("relative",e),...t})}function OC({className:e,...t}){return u.jsx(Nfe,{"data-slot":"navigation-menu-link",className:Ue("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 bU({className:e,...t}){return u.jsx(Ife,{"data-slot":"navigation-menu-list",className:Ue("group flex flex-1 list-none items-center justify-center gap-1",e),...t})}const xU=Db("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 LE(){return u.jsx("a",{href:"https://github.com/HarperFast/studio/releases",target:"_blank",rel:"noopener noreferrer",children:u.jsxs("span",{className:Ue(xU({variant:"default"}),"text-xs inline-block ml-2 align-text-top"),children:["v4.7.18"," BETA"]})})}function eh(e,t,n){const{instanceId:r,clusterId:i}=rt({strict:!1});return es({id:$n,operationsUrl:e,port:t,secure:n})}function ix(e,t,n){const{instanceId:r,clusterId:i}=rt({strict:!1});return{instanceClient:es({id:$n,operationsUrl:e,port:t,secure:n}),entityType:"instance"}}function Wt(e,t,n){const r=rt({strict:!1});return b.useMemo(()=>wU({...r,operationsUrl:e,port:t,secure:n}),[r,e,t,n])}function wU({instanceId:e,clusterId:t,operationsUrl:n,port:r,secure:i}){const o=$n;return{instanceClient:es({id:o,operationsUrl:n,port:r,secure:i}),entityId:o,entityType:"instance"}}function $fe(){localStorage.clear()}function Dfe(){sessionStorage.clear()}async function Pfe(){kt.setUserForEntity($n,null),jy.getQueryCache().clear(),$fe(),Dfe(),await jy.invalidateQueries({refetchType:"none"})}async function Mfe(e){await kt.signOutFromPotentiallyAuthenticatedInstances(),await Hm({...e,entityId:$n})}function zfe(){const e=eh();return ut({mutationFn:()=>Mfe({instanceClient:e}),onSuccess:Pfe})}function ox(e){const{user:t}=Rl(),{organizationId:n}=rt({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 vf(e){const{user:t}=Rl(),{organizationId:n}=rt({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 ax(e,t){const{user:n}=Rl(),{organizationId:r,clusterId:i}=rt({strict:!1});return SU(n,e??r,t??i)}function SU(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 Lfe(e,t){const{user:n}=Rl(),{organizationId:r,clusterId:i}=rt({strict:!1});return _U(n,r,i)}function _U(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 FE(e){const{clusterId:t,instanceId:n}=rt({strict:!1}),{user:r}=ms(),i=r?.role?.permission;return i?i.super_user===!0:!1}function yf(e){const{clusterId:t,instanceId:n}=rt({strict:!1}),{user:r}=ms(),i=r?.role?.permission;return i?i.super_user===!0||i.structure_user===!0:!1}function K_(e,t,n,r){const{clusterId:i,instanceId:o}=rt({strict:!1}),{user:a}=ms(),l=a?.role?.permission;return l?l.super_user===!0||l.structure_user===!0?!0:l[t]?.tables?.[n][r]===!0:!1}const UE={className:"text-white"};function CU(){const{mutate:e}=zfe(),t=jn(),{user:n}=Gc(),r=_n(),{organizationId:i}=rt({strict:!1}),{update:o}=ox(i),{view:a}=vf(i),l=o,d=b.useCallback(()=>{e(void 0,{onSuccess:async()=>{Se.success("Success",{description:"You have been signed out successfully.",action:{label:"Dismiss",onClick:()=>Se.dismiss()}}),t({to:"/sign-in"}),r.invalidate()}})},[e,r,t]),f=b.useMemo(()=>[!xd,!xd,!xd,{to:"https://docs.harperdb.io/docs",target:"_blank",icon:u.jsx(N4,{}),text:"Docs",textBreakpoint:"md"},{to:"https://github.com/HarperFast/studio/issues",target:"_blank",icon:u.jsx(Jee,{}),text:"Report an Issue",textBreakpoint:"lg"},{to:"https://discord.gg/VzZuaw3Xay",target:"_blank",icon:u.jsx(Mde,{}),text:"Discord",textBreakpoint:"lg"},{onClick:d,icon:u.jsx(Jte,{}),text:"Sign Out",textBreakpoint:"md"}].filter(Jo),[i,l,a,d]);return n?u.jsxs(u.Fragment,{children:[u.jsx(Vfe,{menuItems:f}),u.jsx(Ufe,{menuItems:f})]}):u.jsx(Ffe,{})}function kU(e){return e.items!==void 0}function Ffe(){return u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"inline-block",children:[u.jsx(Ze,{to:"/sign-in",children:u.jsx(NE,{})}),u.jsx(LE,{})]}),u.jsx(yU,{children:u.jsxs(bU,{className:"text-grey-400",children:[u.jsx(AC,{children:u.jsx(OC,{asChild:!0,children:u.jsxs(Ze,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[u.jsx(N4,{})," ",u.jsx("span",{className:"hidden md:inline-block",children:"Docs"})]})})}),u.jsx(AC,{children:u.jsx(OC,{asChild:!0,children:u.jsxs(Ze,{to:"/sign-in",className:"flex-row items-center",activeProps:UE,children:[u.jsx(Wte,{})," Sign In"]})})})]})})]})}function Ufe({menuItems:e}){const{user:t}=Gc();return Yc(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(Ze,{to:ba,children:u.jsx(NE,{})}),u.jsx(LE,{})]}),u.jsx(yU,{children:u.jsx(bU,{className:"text-grey-400",children:e.map(n=>kU(n)?!!n.items.length&&u.jsx("div",{className:"bg-black rounded-2xl flex",children:n.items.map(r=>u.jsx(s2,{menuItem:r},r.text))},n.text):u.jsx(s2,{menuItem:n},n.text))})})]})})}function s2({menuItem:e}){return u.jsx(AC,{className:"text-gray-400 hover:text-white",children:u.jsx(OC,{asChild:!0,children:u.jsxs(Ze,{to:e.to,onClick:e.onClick,className:"flex-row items-center",target:e.target,activeProps:e.to?UE: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 Vfe({menuItems:e}){const{user:t}=Gc();Yc(t);const[n,r]=b.useState(!1),i=b.useCallback(()=>r(a=>!a),[]),o=b.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(Ze,{to:ba,children:u.jsx(NE,{})}),u.jsx(LE,{}),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(G4,{}):u.jsx(V4,{})]})]}),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=>kU(a)?!!a.items.length&&u.jsx("div",{className:"bg-black pl-10 pr-2 py-2",children:a.items.map(l=>u.jsx(l2,{menuItem:l,onClick:o},l.text))},a.text):u.jsx(l2,{menuItem:a,onClick:o},a.text))})]})}function l2({menuItem:e,onClick:t}){const n=b.useCallback(()=>{e.onClick?.(),t()},[e,t]);return u.jsxs(Ze,{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?UE:void 0,children:[e.icon,u.jsx("span",{className:"ml-4",children:e.text})]})}function Bfe(){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(CU,{})}),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 px-6 fabricSignupTextContainer",children:u.jsx("img",{className:"object-scale-down max-h-[calc(100vh-80px-40px)] min-h-115",src:"/fabric-signup-text.png",alt:"One Runtime: App, database, Cache and Messaging. Distributed by design, free to deploy, and live in minutes. Deploy!"})}),u.jsx("section",{className:"flex items-center justify-center px-6 bg-linear-(--purple-gradient) dark:bg-linear-(--black-dark-gradient)",children:u.jsx(jl,{})})]})]})}function Hfe(){b.useEffect(()=>{},[])}const qfe=["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 VE(e){if(!e||!e.includes("@"))return null;const t=e.split("@").pop()||"";if(!t)return null;for(const n of qfe)if(t===n||t.endsWith("."+n))return null;return t}let G_=null;function Kfe(){const e=jn(),t=_n(),n=ir(),{redirect:r}=Tr({strict:!1});return b.useEffect(()=>{G_||(G_=(async function(){const i=await Kz().catch(()=>null);if(!i)Se.error("We were not able to verify your sign-in. Please try signing in again.",{duration:1e4}),await e({to:"/sign-in"});else{kt.setUserForEntity($n,i);const o=Yc(i);VE(i.email),await n.invalidateQueries({queryKey:Ib,refetchType:"none"}),await t.invalidate(),await e({to:r?.startsWith("/")?r:o})}G_=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(Ze,{className:"text-sm opacity-50 hover:text-blue-300",to:"/sign-in",children:"Try signing in again"})})]})}const Gfe=["top","right","bottom","left"],bl=Math.min,Li=Math.max,$y=Math.round,wv=Math.floor,ya=e=>({x:e,y:e}),Zfe={left:"right",right:"left",bottom:"top",top:"bottom"},Yfe={start:"end",end:"start"};function $C(e,t,n){return Li(e,bl(t,n))}function ls(e,t){return typeof e=="function"?e(t):e}function cs(e){return e.split("-")[0]}function bf(e){return e.split("-")[1]}function BE(e){return e==="x"?"y":"x"}function HE(e){return e==="y"?"height":"width"}const Wfe=new Set(["top","bottom"]);function fa(e){return Wfe.has(cs(e))?"y":"x"}function qE(e){return BE(fa(e))}function Xfe(e,t,n){n===void 0&&(n=!1);const r=bf(e),i=qE(e),o=HE(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Dy(a)),[a,Dy(a)]}function Jfe(e){const t=Dy(e);return[DC(e),t,DC(t)]}function DC(e){return e.replace(/start|end/g,t=>Yfe[t])}const c2=["left","right"],u2=["right","left"],Qfe=["top","bottom"],epe=["bottom","top"];function tpe(e,t,n){switch(e){case"top":case"bottom":return n?t?u2:c2:t?c2:u2;case"left":case"right":return t?Qfe:epe;default:return[]}}function npe(e,t,n,r){const i=bf(e);let o=tpe(cs(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(DC)))),o}function Dy(e){return e.replace(/left|right|bottom|top/g,t=>Zfe[t])}function rpe(e){return{top:0,right:0,bottom:0,left:0,...e}}function EU(e){return typeof e!="number"?rpe(e):{top:e,right:e,bottom:e,left:e}}function Py(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 d2(e,t,n){let{reference:r,floating:i}=e;const o=fa(t),a=qE(t),l=HE(a),d=cs(t),f=o==="y",m=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,v=r[l]/2-i[l]/2;let y;switch(d){case"top":y={x:m,y:r.y-i.height};break;case"bottom":y={x:m,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(bf(t)){case"start":y[a]-=v*(n&&f?-1:1);break;case"end":y[a]+=v*(n&&f?-1:1);break}return y}const ipe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,l=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:m,y:h}=d2(f,r,d),v=r,y={},x=0;for(let S=0;S<l.length;S++){const{name:C,fn:k}=l[S],{x:E,y:j,data:R,reset:N}=await k({x:m,y:h,initialPlacement:r,placement:v,strategy:i,middlewareData:y,rects:f,platform:a,elements:{reference:e,floating:t}});m=E??m,h=j??h,y={...y,[C]:{...y[C],...R}},N&&x<=50&&(x++,typeof N=="object"&&(N.placement&&(v=N.placement),N.rects&&(f=N.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):N.rects),{x:m,y:h}=d2(f,v,d)),S=-1)}return{x:m,y:h,placement:v,strategy:i,middlewareData:y}};async function wm(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:l,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:v=!1,padding:y=0}=ls(t,e),x=EU(y),C=l[v?h==="floating"?"reference":"floating":h],k=Py(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(l.floating)),boundary:f,rootBoundary:m,strategy:d})),E=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(l.floating)),R=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},N=Py(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:E,offsetParent:j,strategy:d}):E);return{top:(k.top-N.top+x.top)/R.y,bottom:(N.bottom-k.bottom+x.bottom)/R.y,left:(k.left-N.left+x.left)/R.x,right:(N.right-k.right+x.right)/R.x}}const ope=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:l,middlewareData:d}=t,{element:f,padding:m=0}=ls(e,t)||{};if(f==null)return{};const h=EU(m),v={x:n,y:r},y=qE(i),x=HE(y),S=await a.getDimensions(f),C=y==="y",k=C?"top":"left",E=C?"bottom":"right",j=C?"clientHeight":"clientWidth",R=o.reference[x]+o.reference[y]-v[y]-o.floating[x],N=v[y]-o.reference[y],T=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let A=T?T[j]:0;(!A||!await(a.isElement==null?void 0:a.isElement(T)))&&(A=l.floating[j]||o.floating[x]);const D=R/2-N/2,F=A/2-S[x]/2-1,K=bl(h[k],F),te=bl(h[E],F),G=K,q=A-S[x]-te,V=A/2-S[x]/2+D,H=$C(G,V,q),z=!d.arrow&&bf(i)!=null&&V!==H&&o.reference[x]/2-(V<G?K:te)-S[x]/2<0,W=z?V<G?V-G:V-q:0;return{[y]:v[y]+W,data:{[y]:H,centerOffset:V-H-W,...z&&{alignmentOffset:W}},reset:z}}}),ape=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:l,platform:d,elements:f}=t,{mainAxis:m=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:S=!0,...C}=ls(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const k=cs(i),E=fa(l),j=cs(l)===l,R=await(d.isRTL==null?void 0:d.isRTL(f.floating)),N=v||(j||!S?[Dy(l)]:Jfe(l)),T=x!=="none";!v&&T&&N.push(...npe(l,S,x,R));const A=[l,...N],D=await wm(t,C),F=[];let K=((r=o.flip)==null?void 0:r.overflows)||[];if(m&&F.push(D[k]),h){const V=Xfe(i,a,R);F.push(D[V[0]],D[V[1]])}if(K=[...K,{placement:i,overflows:F}],!F.every(V=>V<=0)){var te,G;const V=(((te=o.flip)==null?void 0:te.index)||0)+1,H=A[V];if(H&&(!(h==="alignment"?E!==fa(H):!1)||K.every(L=>fa(L.placement)===E?L.overflows[0]>0:!0)))return{data:{index:V,overflows:K},reset:{placement:H}};let z=(G=K.filter(W=>W.overflows[0]<=0).sort((W,L)=>W.overflows[1]-L.overflows[1])[0])==null?void 0:G.placement;if(!z)switch(y){case"bestFit":{var q;const W=(q=K.filter(L=>{if(T){const ne=fa(L.placement);return ne===E||ne==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(ne=>ne>0).reduce((ne,$)=>ne+$,0)]).sort((L,ne)=>L[1]-ne[1])[0])==null?void 0:q[0];W&&(z=W);break}case"initialPlacement":z=l;break}if(i!==z)return{reset:{placement:z}}}return{}}}};function f2(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function p2(e){return Gfe.some(t=>e[t]>=0)}const spe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=ls(e,t);switch(r){case"referenceHidden":{const o=await wm(t,{...i,elementContext:"reference"}),a=f2(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:p2(a)}}}case"escaped":{const o=await wm(t,{...i,altBoundary:!0}),a=f2(o,n.floating);return{data:{escapedOffsets:a,escaped:p2(a)}}}default:return{}}}}},jU=new Set(["left","top"]);async function lpe(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=cs(n),l=bf(n),d=fa(n)==="y",f=jU.has(a)?-1:1,m=o&&d?-1:1,h=ls(t,e);let{mainAxis:v,crossAxis:y,alignmentAxis:x}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof x=="number"&&(y=l==="end"?x*-1:x),d?{x:y*m,y:v*f}:{x:v*f,y:y*m}}const cpe=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:l}=t,d=await lpe(t,e);return a===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+d.x,y:o+d.y,data:{...d,placement:a}}}}},upe=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:l={fn:C=>{let{x:k,y:E}=C;return{x:k,y:E}}},...d}=ls(e,t),f={x:n,y:r},m=await wm(t,d),h=fa(cs(i)),v=BE(h);let y=f[v],x=f[h];if(o){const C=v==="y"?"top":"left",k=v==="y"?"bottom":"right",E=y+m[C],j=y-m[k];y=$C(E,y,j)}if(a){const C=h==="y"?"top":"left",k=h==="y"?"bottom":"right",E=x+m[C],j=x-m[k];x=$C(E,x,j)}const S=l.fn({...t,[v]:y,[h]:x});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[v]:o,[h]:a}}}}}},dpe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:l=0,mainAxis:d=!0,crossAxis:f=!0}=ls(e,t),m={x:n,y:r},h=fa(i),v=BE(h);let y=m[v],x=m[h];const S=ls(l,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(d){const j=v==="y"?"height":"width",R=o.reference[v]-o.floating[j]+C.mainAxis,N=o.reference[v]+o.reference[j]-C.mainAxis;y<R?y=R:y>N&&(y=N)}if(f){var k,E;const j=v==="y"?"width":"height",R=jU.has(cs(i)),N=o.reference[h]-o.floating[j]+(R&&((k=a.offset)==null?void 0:k[h])||0)+(R?0:C.crossAxis),T=o.reference[h]+o.reference[j]+(R?0:((E=a.offset)==null?void 0:E[h])||0)-(R?C.crossAxis:0);x<N?x=N:x>T&&(x=T)}return{[v]:y,[h]:x}}}},fpe=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:l}=t,{apply:d=()=>{},...f}=ls(e,t),m=await wm(t,f),h=cs(i),v=bf(i),y=fa(i)==="y",{width:x,height:S}=o.floating;let C,k;h==="top"||h==="bottom"?(C=h,k=v===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(k=h,C=v==="end"?"top":"bottom");const E=S-m.top-m.bottom,j=x-m.left-m.right,R=bl(S-m[C],E),N=bl(x-m[k],j),T=!t.middlewareData.shift;let A=R,D=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=j),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=E),T&&!v){const K=Li(m.left,0),te=Li(m.right,0),G=Li(m.top,0),q=Li(m.bottom,0);y?D=x-2*(K!==0||te!==0?K+te:Li(m.left,m.right)):A=S-2*(G!==0||q!==0?G+q:Li(m.top,m.bottom))}await d({...t,availableWidth:D,availableHeight:A});const F=await a.getDimensions(l.floating);return x!==F.width||S!==F.height?{reset:{rects:!0}}:{}}}};function sx(){return typeof window<"u"}function xf(e){return RU(e)?(e.nodeName||"").toLowerCase():"#document"}function Bi(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ka(e){var t;return(t=(RU(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function RU(e){return sx()?e instanceof Node||e instanceof Bi(e).Node:!1}function Go(e){return sx()?e instanceof Element||e instanceof Bi(e).Element:!1}function Sa(e){return sx()?e instanceof HTMLElement||e instanceof Bi(e).HTMLElement:!1}function m2(e){return!sx()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Bi(e).ShadowRoot}const ppe=new Set(["inline","contents"]);function th(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Zo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ppe.has(i)}const mpe=new Set(["table","td","th"]);function hpe(e){return mpe.has(xf(e))}const gpe=[":popover-open",":modal"];function lx(e){return gpe.some(t=>{try{return e.matches(t)}catch{return!1}})}const vpe=["transform","translate","scale","rotate","perspective"],ype=["transform","translate","scale","rotate","perspective","filter"],bpe=["paint","layout","strict","content"];function KE(e){const t=GE(),n=Go(e)?Zo(e):e;return vpe.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)||ype.some(r=>(n.willChange||"").includes(r))||bpe.some(r=>(n.contain||"").includes(r))}function xpe(e){let t=xl(e);for(;Sa(t)&&!Bd(t);){if(KE(t))return t;if(lx(t))return null;t=xl(t)}return null}function GE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const wpe=new Set(["html","body","#document"]);function Bd(e){return wpe.has(xf(e))}function Zo(e){return Bi(e).getComputedStyle(e)}function cx(e){return Go(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xl(e){if(xf(e)==="html")return e;const t=e.assignedSlot||e.parentNode||m2(e)&&e.host||ka(e);return m2(t)?t.host:t}function IU(e){const t=xl(e);return Bd(t)?e.ownerDocument?e.ownerDocument.body:e.body:Sa(t)&&th(t)?t:IU(t)}function Sm(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=IU(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=Bi(i);if(o){const l=PC(a);return t.concat(a,a.visualViewport||[],th(i)?i:[],l&&n?Sm(l):[])}return t.concat(i,Sm(i,[],n))}function PC(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function TU(e){const t=Zo(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Sa(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,l=$y(n)!==o||$y(r)!==a;return l&&(n=o,r=a),{width:n,height:r,$:l}}function ZE(e){return Go(e)?e:e.contextElement}function Cd(e){const t=ZE(e);if(!Sa(t))return ya(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=TU(t);let a=(o?$y(n.width):n.width)/r,l=(o?$y(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const Spe=ya(0);function NU(e){const t=Bi(e);return!GE()||!t.visualViewport?Spe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _pe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Bi(e)?!1:t}function Mc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=ZE(e);let a=ya(1);t&&(r?Go(r)&&(a=Cd(r)):a=Cd(e));const l=_pe(o,n,r)?NU(o):ya(0);let d=(i.left+l.x)/a.x,f=(i.top+l.y)/a.y,m=i.width/a.x,h=i.height/a.y;if(o){const v=Bi(o),y=r&&Go(r)?Bi(r):r;let x=v,S=PC(x);for(;S&&r&&y!==x;){const C=Cd(S),k=S.getBoundingClientRect(),E=Zo(S),j=k.left+(S.clientLeft+parseFloat(E.paddingLeft))*C.x,R=k.top+(S.clientTop+parseFloat(E.paddingTop))*C.y;d*=C.x,f*=C.y,m*=C.x,h*=C.y,d+=j,f+=R,x=Bi(S),S=PC(x)}}return Py({width:m,height:h,x:d,y:f})}function ux(e,t){const n=cx(e).scrollLeft;return t?t.left+n:Mc(ka(e)).left+n}function AU(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ux(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Cpe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=ka(r),l=t?lx(t.floating):!1;if(r===a||l&&o)return n;let d={scrollLeft:0,scrollTop:0},f=ya(1);const m=ya(0),h=Sa(r);if((h||!h&&!o)&&((xf(r)!=="body"||th(a))&&(d=cx(r)),Sa(r))){const y=Mc(r);f=Cd(r),m.x=y.x+r.clientLeft,m.y=y.y+r.clientTop}const v=a&&!h&&!o?AU(a,d):ya(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+m.x+v.x,y:n.y*f.y-d.scrollTop*f.y+m.y+v.y}}function kpe(e){return Array.from(e.getClientRects())}function Epe(e){const t=ka(e),n=cx(e),r=e.ownerDocument.body,i=Li(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Li(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ux(e);const l=-n.scrollTop;return Zo(r).direction==="rtl"&&(a+=Li(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:l}}const h2=25;function jpe(e,t){const n=Bi(e),r=ka(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,l=0,d=0;if(i){o=i.width,a=i.height;const m=GE();(!m||m&&t==="fixed")&&(l=i.offsetLeft,d=i.offsetTop)}const f=ux(r);if(f<=0){const m=r.ownerDocument,h=m.body,v=getComputedStyle(h),y=m.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,x=Math.abs(r.clientWidth-h.clientWidth-y);x<=h2&&(o-=x)}else f<=h2&&(o+=f);return{width:o,height:a,x:l,y:d}}const Rpe=new Set(["absolute","fixed"]);function Ipe(e,t){const n=Mc(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Sa(e)?Cd(e):ya(1),a=e.clientWidth*o.x,l=e.clientHeight*o.y,d=i*o.x,f=r*o.y;return{width:a,height:l,x:d,y:f}}function g2(e,t,n){let r;if(t==="viewport")r=jpe(e,n);else if(t==="document")r=Epe(ka(e));else if(Go(t))r=Ipe(t,n);else{const i=NU(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Py(r)}function OU(e,t){const n=xl(e);return n===t||!Go(n)||Bd(n)?!1:Zo(n).position==="fixed"||OU(n,t)}function Tpe(e,t){const n=t.get(e);if(n)return n;let r=Sm(e,[],!1).filter(l=>Go(l)&&xf(l)!=="body"),i=null;const o=Zo(e).position==="fixed";let a=o?xl(e):e;for(;Go(a)&&!Bd(a);){const l=Zo(a),d=KE(a);!d&&l.position==="fixed"&&(i=null),(o?!d&&!i:!d&&l.position==="static"&&!!i&&Rpe.has(i.position)||th(a)&&!d&&OU(e,a))?r=r.filter(m=>m!==a):i=l,a=xl(a)}return t.set(e,r),r}function Npe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?lx(t)?[]:Tpe(t,this._c):[].concat(n),r],l=a[0],d=a.reduce((f,m)=>{const h=g2(t,m,i);return f.top=Li(h.top,f.top),f.right=bl(h.right,f.right),f.bottom=bl(h.bottom,f.bottom),f.left=Li(h.left,f.left),f},g2(t,l,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Ape(e){const{width:t,height:n}=TU(e);return{width:t,height:n}}function Ope(e,t,n){const r=Sa(t),i=ka(t),o=n==="fixed",a=Mc(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const d=ya(0);function f(){d.x=ux(i)}if(r||!r&&!o)if((xf(t)!=="body"||th(i))&&(l=cx(t)),r){const y=Mc(t,!0,o,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}else i&&f();o&&!r&&i&&f();const m=i&&!r&&!o?AU(i,l):ya(0),h=a.left+l.scrollLeft-d.x-m.x,v=a.top+l.scrollTop-d.y-m.y;return{x:h,y:v,width:a.width,height:a.height}}function Z_(e){return Zo(e).position==="static"}function v2(e,t){if(!Sa(e)||Zo(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ka(e)===n&&(n=n.ownerDocument.body),n}function $U(e,t){const n=Bi(e);if(lx(e))return n;if(!Sa(e)){let i=xl(e);for(;i&&!Bd(i);){if(Go(i)&&!Z_(i))return i;i=xl(i)}return n}let r=v2(e,t);for(;r&&hpe(r)&&Z_(r);)r=v2(r,t);return r&&Bd(r)&&Z_(r)&&!KE(r)?n:r||xpe(e)||n}const $pe=async function(e){const t=this.getOffsetParent||$U,n=this.getDimensions,r=await n(e.floating);return{reference:Ope(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Dpe(e){return Zo(e).direction==="rtl"}const Ppe={convertOffsetParentRelativeRectToViewportRelativeRect:Cpe,getDocumentElement:ka,getClippingRect:Npe,getOffsetParent:$U,getElementRects:$pe,getClientRects:kpe,getDimensions:Ape,getScale:Cd,isElement:Go,isRTL:Dpe};function DU(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Mpe(e,t){let n=null,r;const i=ka(e);function o(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function a(l,d){l===void 0&&(l=!1),d===void 0&&(d=1),o();const f=e.getBoundingClientRect(),{left:m,top:h,width:v,height:y}=f;if(l||t(),!v||!y)return;const x=wv(h),S=wv(i.clientWidth-(m+v)),C=wv(i.clientHeight-(h+y)),k=wv(m),j={rootMargin:-x+"px "+-S+"px "+-C+"px "+-k+"px",threshold:Li(0,bl(1,d))||1};let R=!0;function N(T){const A=T[0].intersectionRatio;if(A!==d){if(!R)return a();A?a(!1,A):r=setTimeout(()=>{a(!1,1e-7)},1e3)}A===1&&!DU(f,e.getBoundingClientRect())&&a(),R=!1}try{n=new IntersectionObserver(N,{...j,root:i.ownerDocument})}catch{n=new IntersectionObserver(N,j)}n.observe(e)}return a(!0),o}function zpe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=ZE(e),m=i||o?[...f?Sm(f):[],...Sm(t)]:[];m.forEach(k=>{i&&k.addEventListener("scroll",n,{passive:!0}),o&&k.addEventListener("resize",n)});const h=f&&l?Mpe(f,n):null;let v=-1,y=null;a&&(y=new ResizeObserver(k=>{let[E]=k;E&&E.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 x,S=d?Mc(e):null;d&&C();function C(){const k=Mc(e);S&&!DU(S,k)&&n(),S=k,x=requestAnimationFrame(C)}return n(),()=>{var k;m.forEach(E=>{i&&E.removeEventListener("scroll",n),o&&E.removeEventListener("resize",n)}),h?.(),(k=y)==null||k.disconnect(),y=null,d&&cancelAnimationFrame(x)}}const Lpe=cpe,Fpe=upe,Upe=ape,Vpe=fpe,Bpe=spe,y2=ope,Hpe=dpe,qpe=(e,t,n)=>{const r=new Map,i={platform:Ppe,...n},o={...i.platform,_c:r};return ipe(e,t,{...i,platform:o})};var Kpe=typeof document<"u",Gpe=function(){},ly=Kpe?b.useLayoutEffect:Gpe;function My(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(!My(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)&&!My(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function PU(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function b2(e,t){const n=PU(e);return Math.round(t*n)/n}function Y_(e){const t=b.useRef(e);return ly(()=>{t.current=e}),t}function Zpe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:l=!0,whileElementsMounted:d,open:f}=e,[m,h]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,y]=b.useState(r);My(v,r)||y(r);const[x,S]=b.useState(null),[C,k]=b.useState(null),E=b.useCallback(L=>{L!==T.current&&(T.current=L,S(L))},[]),j=b.useCallback(L=>{L!==A.current&&(A.current=L,k(L))},[]),R=o||x,N=a||C,T=b.useRef(null),A=b.useRef(null),D=b.useRef(m),F=d!=null,K=Y_(d),te=Y_(i),G=Y_(f),q=b.useCallback(()=>{if(!T.current||!A.current)return;const L={placement:t,strategy:n,middleware:v};te.current&&(L.platform=te.current),qpe(T.current,A.current,L).then(ne=>{const $={...ne,isPositioned:G.current!==!1};V.current&&!My(D.current,$)&&(D.current=$,lf.flushSync(()=>{h($)}))})},[v,t,n,te,G]);ly(()=>{f===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,h(L=>({...L,isPositioned:!1})))},[f]);const V=b.useRef(!1);ly(()=>(V.current=!0,()=>{V.current=!1}),[]),ly(()=>{if(R&&(T.current=R),N&&(A.current=N),R&&N){if(K.current)return K.current(R,N,q);q()}},[R,N,q,K,F]);const H=b.useMemo(()=>({reference:T,floating:A,setReference:E,setFloating:j}),[E,j]),z=b.useMemo(()=>({reference:R,floating:N}),[R,N]),W=b.useMemo(()=>{const L={position:n,left:0,top:0};if(!z.floating)return L;const ne=b2(z.floating,m.x),$=b2(z.floating,m.y);return l?{...L,transform:"translate("+ne+"px, "+$+"px)",...PU(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ne,top:$}},[n,l,z.floating,m.x,m.y]);return b.useMemo(()=>({...m,update:q,refs:H,elements:z,floatingStyles:W}),[m,q,H,z,W])}const Ype=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?y2({element:r.current,padding:i}).fn(n):{}:r?y2({element:r,padding:i}).fn(n):{}}}},Wpe=(e,t)=>({...Lpe(e),options:[e,t]}),Xpe=(e,t)=>({...Fpe(e),options:[e,t]}),Jpe=(e,t)=>({...Hpe(e),options:[e,t]}),Qpe=(e,t)=>({...Upe(e),options:[e,t]}),eme=(e,t)=>({...Vpe(e),options:[e,t]}),tme=(e,t)=>({...Bpe(e),options:[e,t]}),nme=(e,t)=>({...Ype(e),options:[e,t]});var rme="Arrow",MU=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return u.jsx(Ye.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"})})});MU.displayName=rme;var ime=MU;function zU(e){const[t,n]=b.useState(void 0);return rr(()=>{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,l;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;a=f.inlineSize,l=f.blockSize}else a=e.offsetWidth,l=e.offsetHeight;n({width:a,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var YE="Popper",[LU,wf]=Qi(YE),[ome,FU]=LU(YE),UU=e=>{const{__scopePopper:t,children:n}=e,[r,i]=b.useState(null);return u.jsx(ome,{scope:t,anchor:r,onAnchorChange:i,children:n})};UU.displayName=YE;var VU="PopperAnchor",BU=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=FU(VU,n),a=b.useRef(null),l=pt(t,a),d=b.useRef(null);return b.useEffect(()=>{const f=d.current;d.current=r?.current||a.current,f!==d.current&&o.onAnchorChange(d.current)}),r?null:u.jsx(Ye.div,{...i,ref:l})});BU.displayName=VU;var WE="PopperContent",[ame,sme]=LU(WE),HU=b.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:l=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:h="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:x,...S}=e,C=FU(WE,n),[k,E]=b.useState(null),j=pt(t,Q=>E(Q)),[R,N]=b.useState(null),T=zU(R),A=T?.width??0,D=T?.height??0,F=r+(o!=="center"?"-"+o:""),K=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},te=Array.isArray(f)?f:[f],G=te.length>0,q={padding:K,boundary:te.filter(cme),altBoundary:G},{refs:V,floatingStyles:H,placement:z,isPositioned:W,middlewareData:L}=Zpe({strategy:"fixed",placement:F,whileElementsMounted:(...Q)=>zpe(...Q,{animationFrame:y==="always"}),elements:{reference:C.anchor},middleware:[Wpe({mainAxis:i+D,alignmentAxis:a}),d&&Xpe({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Jpe():void 0,...q}),d&&Qpe({...q}),eme({...q,apply:({elements:Q,rects:ve,availableWidth:be,availableHeight:ke})=>{const{width:$e,height:Le}=ve.reference,St=Q.floating.style;St.setProperty("--radix-popper-available-width",`${be}px`),St.setProperty("--radix-popper-available-height",`${ke}px`),St.setProperty("--radix-popper-anchor-width",`${$e}px`),St.setProperty("--radix-popper-anchor-height",`${Le}px`)}}),R&&nme({element:R,padding:l}),ume({arrowWidth:A,arrowHeight:D}),v&&tme({strategy:"referenceHidden",...q})]}),[ne,$]=GU(z),P=Tn(x);rr(()=>{W&&P?.()},[W,P]);const U=L.arrow?.x,O=L.arrow?.y,J=L.arrow?.centerOffset!==0,[pe,ge]=b.useState();return rr(()=>{k&&ge(window.getComputedStyle(k).zIndex)},[k]),u.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:W?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:pe,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(ame,{scope:n,placedSide:ne,onArrowChange:N,arrowX:U,arrowY:O,shouldHideArrow:J,children:u.jsx(Ye.div,{"data-side":ne,"data-align":$,...S,ref:j,style:{...S.style,animation:W?void 0:"none"}})})})});HU.displayName=WE;var qU="PopperArrow",lme={top:"bottom",right:"left",bottom:"top",left:"right"},KU=b.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=sme(qU,r),a=lme[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(ime,{...i,ref:n,style:{...i.style,display:"block"}})})});KU.displayName=qU;function cme(e){return e!==null}var ume=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,l=a?0:e.arrowWidth,d=a?0:e.arrowHeight,[f,m]=GU(n),h={start:"0%",center:"50%",end:"100%"}[m],v=(i.arrow?.x??0)+l/2,y=(i.arrow?.y??0)+d/2;let x="",S="";return f==="bottom"?(x=a?h:`${v}px`,S=`${-d}px`):f==="top"?(x=a?h:`${v}px`,S=`${r.floating.height+d}px`):f==="right"?(x=`${-d}px`,S=a?h:`${y}px`):f==="left"&&(x=`${r.floating.width+d}px`,S=a?h:`${y}px`),{data:{x,y:S}}}});function GU(e){const[t,n="center"]=e.split("-");return[t,n]}var XE=UU,JE=BU,QE=HU,ej=KU,dme="Portal",nh=b.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=b.useState(!1);rr(()=>o(!0),[]);const a=n||i&&globalThis?.document?.body;return a?iE.createPortal(u.jsx(Ye.div,{...r,ref:t}),a):null});nh.displayName=dme;var[dx]=Qi("Tooltip",[wf]),fx=wf(),ZU="TooltipProvider",fme=700,MC="tooltip.open",[pme,tj]=dx(ZU),YU=e=>{const{__scopeTooltip:t,delayDuration:n=fme,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,a=b.useRef(!0),l=b.useRef(!1),d=b.useRef(0);return b.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),u.jsx(pme,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(d.current),a.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:b.useCallback(f=>{l.current=f},[]),disableHoverableContent:i,children:o})};YU.displayName=ZU;var _m="Tooltip",[mme,rh]=dx(_m),WU=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:a,delayDuration:l}=e,d=tj(_m,e.__scopeTooltip),f=fx(t),[m,h]=b.useState(null),v=Vi(),y=b.useRef(0),x=a??d.disableHoverableContent,S=l??d.delayDuration,C=b.useRef(!1),[k,E]=Ko({prop:r,defaultProp:i??!1,onChange:A=>{A?(d.onOpen(),document.dispatchEvent(new CustomEvent(MC))):d.onClose(),o?.(A)},caller:_m}),j=b.useMemo(()=>k?C.current?"delayed-open":"instant-open":"closed",[k]),R=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C.current=!1,E(!0)},[E]),N=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,E(!1)},[E]),T=b.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{C.current=!0,E(!0),y.current=0},S)},[S,E]);return b.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),u.jsx(XE,{...f,children:u.jsx(mme,{scope:t,contentId:v,open:k,stateAttribute:j,trigger:m,onTriggerChange:h,onTriggerEnter:b.useCallback(()=>{d.isOpenDelayedRef.current?T():R()},[d.isOpenDelayedRef,T,R]),onTriggerLeave:b.useCallback(()=>{x?N():(window.clearTimeout(y.current),y.current=0)},[N,x]),onOpen:R,onClose:N,disableHoverableContent:x,children:n})})};WU.displayName=_m;var zC="TooltipTrigger",XU=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=rh(zC,n),o=tj(zC,n),a=fx(n),l=b.useRef(null),d=pt(t,l,i.onTriggerChange),f=b.useRef(!1),m=b.useRef(!1),h=b.useCallback(()=>f.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),u.jsx(JE,{asChild:!0,...a,children:u.jsx(Ye.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:d,onPointerMove:Ie(e.onPointerMove,v=>{v.pointerType!=="touch"&&!m.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),m.current=!0)}),onPointerLeave:Ie(e.onPointerLeave,()=>{i.onTriggerLeave(),m.current=!1}),onPointerDown:Ie(e.onPointerDown,()=>{i.open&&i.onClose(),f.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Ie(e.onFocus,()=>{f.current||i.onOpen()}),onBlur:Ie(e.onBlur,i.onClose),onClick:Ie(e.onClick,i.onClose)})})});XU.displayName=zC;var nj="TooltipPortal",[hme,gme]=dx(nj,{forceMount:void 0}),JU=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=rh(nj,t);return u.jsx(hme,{scope:t,forceMount:n,children:u.jsx(or,{present:n||o.open,children:u.jsx(nh,{asChild:!0,container:i,children:r})})})};JU.displayName=nj;var Hd="TooltipContent",QU=b.forwardRef((e,t)=>{const n=gme(Hd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=rh(Hd,e.__scopeTooltip);return u.jsx(or,{present:r||a.open,children:a.disableHoverableContent?u.jsx(e6,{side:i,...o,ref:t}):u.jsx(vme,{side:i,...o,ref:t})})}),vme=b.forwardRef((e,t)=>{const n=rh(Hd,e.__scopeTooltip),r=tj(Hd,e.__scopeTooltip),i=b.useRef(null),o=pt(t,i),[a,l]=b.useState(null),{trigger:d,onClose:f}=n,m=i.current,{onPointerInTransitChange:h}=r,v=b.useCallback(()=>{l(null),h(!1)},[h]),y=b.useCallback((x,S)=>{const C=x.currentTarget,k={x:x.clientX,y:x.clientY},E=wme(k,C.getBoundingClientRect()),j=Sme(k,E),R=_me(S.getBoundingClientRect()),N=kme([...j,...R]);l(N),h(!0)},[h]);return b.useEffect(()=>()=>v(),[v]),b.useEffect(()=>{if(d&&m){const x=C=>y(C,m),S=C=>y(C,d);return d.addEventListener("pointerleave",x),m.addEventListener("pointerleave",S),()=>{d.removeEventListener("pointerleave",x),m.removeEventListener("pointerleave",S)}}},[d,m,y,v]),b.useEffect(()=>{if(a){const x=S=>{const C=S.target,k={x:S.clientX,y:S.clientY},E=d?.contains(C)||m?.contains(C),j=!Cme(k,a);E?v():j&&(v(),f())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[d,m,a,f,v]),u.jsx(e6,{...e,ref:o})}),[yme,bme]=dx(_m,{isInside:!1}),xme=Ude("TooltipContent"),e6=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...l}=e,d=rh(Hd,n),f=fx(n),{onClose:m}=d;return b.useEffect(()=>(document.addEventListener(MC,m),()=>document.removeEventListener(MC,m)),[m]),b.useEffect(()=>{if(d.trigger){const h=v=>{v.target?.contains(d.trigger)&&m()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[d.trigger,m]),u.jsx(gf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:m,children:u.jsxs(QE,{"data-state":d.stateAttribute,...f,...l,ref:t,style:{...l.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(xme,{children:r}),u.jsx(yme,{scope:n,isInside:!0,children:u.jsx(nU,{id:d.contentId,role:"tooltip",children:i||r})})]})})});QU.displayName=Hd;var t6="TooltipArrow",n6=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=fx(n);return bme(t6,n).isInside?null:u.jsx(ej,{...i,...r,ref:t})});n6.displayName=t6;function wme(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 Sme(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 _me(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 Cme(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 l=t[o],d=t[a],f=l.x,m=l.y,h=d.x,v=d.y;m>r!=v>r&&n<(h-f)*(r-m)/(v-m)+f&&(i=!i)}return i}function kme(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),Eme(t)}function Eme(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 jme=YU,Rme=WU,Ime=XU,Tme=JU,Nme=QU,Ame=n6;function Ome({delayDuration:e=0,...t}){return u.jsx(jme,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function px({...e}){return u.jsx(Ome,{children:u.jsx(Rme,{"data-slot":"tooltip",...e})})}function mx({...e}){return u.jsx(Ime,{"data-slot":"tooltip-trigger",...e})}function hx({className:e,sideOffset:t=0,arrowClassName:n,children:r,...i}){return u.jsx(Tme,{children:u.jsxs(Nme,{"data-slot":"tooltip-content",sideOffset:t,className:Ue("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(Ame,{className:Ue("bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",n)})]})})}const Dp=new Map;function wo(e){if(!e)return"";if(Dp.has(e))return Dp.get(e);const t=e.replace(/[-_]+/g," ").replace(/\s+/g," ").trim();if(!t)return Dp.set(e,""),"";const n=t.match(/([A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+|[0-9]+)/g);if(!n)return Dp.set(e,""),"";const r=[];for(let a=0;a<n.length;a++){const l=n[a],d=a+1<n.length?n[a+1]:void 0;/^[A-Z]{2,}$/.test(l)&&d&&/[A-Z]*s$/.test(d)||/^[A-Z]$/.test(l)&&d!==void 0&&/^[A-Z]s$/.test(d)?(r.push(l+d),a++):r.push(l)}const o=r.map($me).join(" ");return Dp.set(e,o),o}function $me(e){return/^[A-Z]{2,3}s?$/.test(e)||/^[0-9]+$/.test(e)?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function gx({restartRequired:e}){const t=OQ(),{organization:n,instance:r,cluster:i}=$b({strict:!1}),o="Instance",a=b.useMemo(()=>{const l=t.pathname.split("/").filter(f=>f&&f.length>0),d=[u.jsxs(Ze,{to:"/",children:[u.jsx(Vte,{"aria-hidden":"true",className:"size-5 shrink-0"}),u.jsx("span",{className:"sr-only",children:"Home"})]},"home")];for(let f=0;f<l.length;f++){const m=l[f];if(m==="instance")continue;let h=`/${l.slice(0,f+1).join("/")}`,v=wo(m),y;m==="databases"&&l.length===f+3?(v=l[f+2],f+=2):v.startsWith("Org ")?v=n?.name||"Org":v.startsWith("Clu ")?(v=i?.name||"Cluster",l[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(Ze,{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(px,{children:[u.jsx(mx,{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(hx,{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 ih=e=>e.type==="checkbox",xc=e=>e instanceof Date,yi=e=>e==null;const r6=e=>typeof e=="object";var nr=e=>!yi(e)&&!Array.isArray(e)&&r6(e)&&!xc(e),i6=e=>nr(e)&&e.target?ih(e.target)?e.target.checked:e.target.value:e,Dme=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,o6=(e,t)=>e.has(Dme(t)),Pme=e=>{const t=e.constructor&&e.constructor.prototype;return nr(t)&&t.hasOwnProperty("isPrototypeOf")},rj=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function bn(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(rj&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&!(nr(e)&&Pme(e)))return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=bn(e[i]));return r}var vx=e=>/^\w*$/.test(e),ln=e=>e===void 0,yx=e=>Array.isArray(e)?e.filter(Boolean):[],ij=e=>yx(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Pe=(e,t,n)=>{if(!t||!nr(e))return n;const r=(vx(t)?[t]:ij(t)).reduce((i,o)=>yi(i)?i:i[o],e);return ln(r)||r===e?ln(e[t])?n:e[t]:r},Mi=e=>typeof e=="boolean",Yr=e=>typeof e=="function",Gt=(e,t,n)=>{let r=-1;const i=vx(t)?[t]:ij(t),o=i.length,a=o-1;for(;++r<o;){const l=i[r];let d=n;if(r!==a){const f=e[l];d=nr(f)||Array.isArray(f)?f:isNaN(+i[r+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;e[l]=d,e=e[l]}};const zy={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},So={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Ya={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},oj=X.createContext(null);oj.displayName="HookFormControlContext";const bx=()=>X.useContext(oj);var a6=(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]!==So.all&&(t._proxyFormState[a]=!r||So.all),n&&(n[a]=!0),e[a]}});return i};const xx=typeof window<"u"?X.useLayoutEffect:X.useEffect;function aj(e){const t=bx(),{control:n=t,disabled:r,name:i,exact:o}=e||{},[a,l]=X.useState(n._formState),d=X.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return xx(()=>n._subscribe({name:i,formState:d.current,exact:o,callback:f=>{!r&&l({...n._formState,...f})}}),[i,r,o]),X.useEffect(()=>{d.current.isValid&&n._setValid(!0)},[n]),X.useMemo(()=>a6(a,n,d.current,!1),[a,n])}var Fi=e=>typeof e=="string",LC=(e,t,n,r,i)=>Fi(e)?(r&&t.watch.add(e),Pe(n,e,i)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),Pe(n,o))):(r&&(t.watchAll=!0),n),FC=e=>yi(e)||!r6(e);function Uo(e,t,n=new WeakSet){if(FC(e)||FC(t))return Object.is(e,t);if(xc(e)&&xc(t))return Object.is(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 l=t[o];if(xc(a)&&xc(l)||nr(a)&&nr(l)||Array.isArray(a)&&Array.isArray(l)?!Uo(a,l,n):!Object.is(a,l))return!1}}return!0}function Mme(e){const t=bx(),{control:n=t,name:r,defaultValue:i,disabled:o,exact:a,compute:l}=e||{},d=X.useRef(i),f=X.useRef(l),m=X.useRef(void 0),h=X.useRef(n),v=X.useRef(r);f.current=l;const[y,x]=X.useState(()=>{const R=n._getWatch(r,d.current);return f.current?f.current(R):R}),S=X.useCallback(R=>{const N=LC(r,n._names,R||n._formValues,!1,d.current);return f.current?f.current(N):N},[n._formValues,n._names,r]),C=X.useCallback(R=>{if(!o){const N=LC(r,n._names,R||n._formValues,!1,d.current);if(f.current){const T=f.current(N);Uo(T,m.current)||(x(T),m.current=T)}else x(N)}},[n._formValues,n._names,o,r]);xx(()=>((h.current!==n||!Uo(v.current,r))&&(h.current=n,v.current=r,C()),n._subscribe({name:r,formState:{values:!0},exact:a,callback:R=>{C(R.values)}})),[n,a,r,C]),X.useEffect(()=>n._removeUnmounted());const k=h.current!==n,E=v.current,j=X.useMemo(()=>{if(o)return null;const R=!k&&!Uo(E,r);return k||R?S():null},[o,k,r,E,S]);return j!==null?j:y}function zme(e){const t=bx(),{name:n,disabled:r,control:i=t,shouldUnregister:o,defaultValue:a,exact:l=!0}=e,d=o6(i._names.array,n),f=X.useMemo(()=>Pe(i._formValues,n,Pe(i._defaultValues,n,a)),[i,n,a]),m=Mme({control:i,name:n,defaultValue:f,exact:l}),h=aj({control:i,name:n,exact:l}),v=X.useRef(e),y=X.useRef(void 0),x=X.useRef(i.register(n,{...e.rules,value:m,...Mi(e.disabled)?{disabled:e.disabled}:{}}));v.current=e;const S=X.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Pe(h.errors,n)},isDirty:{enumerable:!0,get:()=>!!Pe(h.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Pe(h.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Pe(h.validatingFields,n)},error:{enumerable:!0,get:()=>Pe(h.errors,n)}}),[h,n]),C=X.useCallback(R=>x.current.onChange({target:{value:i6(R),name:n},type:zy.CHANGE}),[n]),k=X.useCallback(()=>x.current.onBlur({target:{value:Pe(i._formValues,n),name:n},type:zy.BLUR}),[n,i._formValues]),E=X.useCallback(R=>{const N=Pe(i._fields,n);N&&N._f&&R&&(N._f.ref={focus:()=>Yr(R.focus)&&R.focus(),select:()=>Yr(R.select)&&R.select(),setCustomValidity:T=>Yr(R.setCustomValidity)&&R.setCustomValidity(T),reportValidity:()=>Yr(R.reportValidity)&&R.reportValidity()})},[i._fields,n]),j=X.useMemo(()=>({name:n,value:m,...Mi(r)||h.disabled?{disabled:h.disabled||r}:{},onChange:C,onBlur:k,ref:E}),[n,r,h.disabled,C,k,E,m]);return X.useEffect(()=>{const R=i._options.shouldUnregister||o,N=y.current;N&&N!==n&&!d&&i.unregister(N),i.register(n,{...v.current.rules,...Mi(v.current.disabled)?{disabled:v.current.disabled}:{}});const T=(A,D)=>{const F=Pe(i._fields,A);F&&F._f&&(F._f.mount=D)};if(T(n,!0),R){const A=bn(Pe(i._options.defaultValues,n,v.current.defaultValue));Gt(i._defaultValues,n,A),ln(Pe(i._formValues,n))&&Gt(i._formValues,n,A)}return!d&&i.register(n),y.current=n,()=>{(d?R&&!i._state.action:R)?i.unregister(n):T(n,!1)}},[n,i,d,o]),X.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),X.useMemo(()=>({field:j,formState:h,fieldState:S}),[j,h,S])}const Lme=e=>e.render(zme(e)),sj=X.createContext(null);sj.displayName="HookFormContext";const Fme=()=>X.useContext(sj),Ume=e=>{const{children:t,watch:n,getValues:r,getFieldState:i,setError:o,clearErrors:a,setValue:l,trigger:d,formState:f,resetField:m,reset:h,handleSubmit:v,unregister:y,control:x,register:S,setFocus:C,subscribe:k}=e;return X.createElement(sj.Provider,{value:X.useMemo(()=>({watch:n,getValues:r,getFieldState:i,setError:o,clearErrors:a,setValue:l,trigger:d,formState:f,resetField:m,reset:h,handleSubmit:v,unregister:y,control:x,register:S,setFocus:C,subscribe:k}),[a,x,f,i,r,v,S,h,m,o,C,l,k,d,y,n])},X.createElement(oj.Provider,{value:x},t))};var lj=(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],x2=()=>{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 s6(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const i=e[r],o=t[r];if(i&&nr(i)&&o){const a=s6(i,o);nr(a)&&(n[r]=a)}else e[r]&&(n[r]=o)}return n}var Or=e=>nr(e)&&!Object.keys(e).length,cj=e=>e.type==="file",Ly=e=>{if(!rj)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},l6=e=>e.type==="select-multiple",uj=e=>e.type==="radio",Vme=e=>uj(e)||ih(e),W_=e=>Ly(e)&&e.isConnected;function Bme(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=ln(e)?r++:e[t[r++]];return e}function Hme(e){for(const t in e)if(e.hasOwnProperty(t)&&!ln(e[t]))return!1;return!0}function Kn(e,t){const n=Array.isArray(t)?t:vx(t)?[t]:ij(t),r=n.length===1?e:Bme(e,n),i=n.length-1,o=n[i];return r&&delete r[o],i!==0&&(nr(r)&&Or(r)||Array.isArray(r)&&Hme(r))&&Kn(e,n.slice(0,-1)),e}var qme=e=>{for(const t in e)if(Yr(e[t]))return!0;return!1};function c6(e){return Array.isArray(e)||nr(e)&&!qme(e)}function UC(e,t={}){for(const n in e){const r=e[n];c6(r)?(t[n]=Array.isArray(r)?[]:{},UC(r,t[n])):ln(r)||(t[n]=!0)}return t}function dd(e,t,n){n||(n=UC(t));for(const r in e){const i=e[r];if(c6(i))ln(t)||FC(n[r])?n[r]=UC(i,Array.isArray(i)?[]:{}):dd(i,yi(t)?{}:t[r],n[r]);else{const o=t[r];n[r]=!Uo(i,o)}}return n}const w2={value:!1,isValid:!1},S2={value:!0,isValid:!0};var u6=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&&!ln(e[0].attributes.value)?ln(e[0].value)||e[0].value===""?S2:{value:e[0].value,isValid:!0}:S2:w2}return w2},d6=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>ln(e)?e:t?e===""?NaN:e&&+e:n&&Fi(e)?new Date(e):r?r(e):e;const _2={isValid:!1,value:null};var f6=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,_2):_2;function C2(e){const t=e.ref;return cj(t)?t.files:uj(t)?f6(e.refs).value:l6(t)?[...t.selectedOptions].map(({value:n})=>n):ih(t)?u6(e.refs).value:d6(ln(t.value)?e.ref.value:t.value,e)}var Kme=(e,t,n,r)=>{const i={};for(const o of e){const a=Pe(t,o);a&&Gt(i,o,a._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},Fy=e=>e instanceof RegExp,Pp=e=>ln(e)?e:Fy(e)?e.source:nr(e)?Fy(e.value)?e.value.source:e.value:e,vd=e=>({isOnSubmit:!e||e===So.onSubmit,isOnBlur:e===So.onBlur,isOnChange:e===So.onChange,isOnAll:e===So.all,isOnTouch:e===So.onTouched});const k2="AsyncFunction";var Gme=e=>!!e&&!!e.validate&&!!(Yr(e.validate)&&e.validate.constructor.name===k2||nr(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===k2)),Zme=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),VC=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const kd=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const o=Pe(e,i);if(o){const{_f:a,...l}=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(kd(l,t))break}else if(nr(l)&&kd(l,t))break}}};function E2(e,t,n){const r=Pe(e,n);if(r||vx(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),a=Pe(t,o),l=Pe(e,o);if(a&&!Array.isArray(a)&&n!==o)return{name:n};if(l&&l.type)return{name:o,error:l};if(l&&l.root&&l.root.type)return{name:`${o}.root`,error:l.root};i.pop()}return{name:n}}var Yme=(e,t,n,r)=>{n(e);const{name:i,...o}=e;return Or(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!r||So.all))},Wme=(e,t,n)=>!e||!t||e===t||Si(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),Xme=(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,Jme=(e,t)=>!yx(Pe(e,t)).length&&Kn(e,t),p6=(e,t,n)=>{const r=Si(Pe(e,n));return Gt(r,"root",t[n]),Gt(e,n,r),e};function j2(e,t,n="validate"){if(Fi(e)||Array.isArray(e)&&e.every(Fi)||Mi(e)&&!e)return{type:n,message:Fi(e)?e:"",ref:t}}var nd=e=>nr(e)&&!Fy(e)?e:{value:e,message:""},BC=async(e,t,n,r,i,o)=>{const{ref:a,refs:l,required:d,maxLength:f,minLength:m,min:h,max:v,pattern:y,validate:x,name:S,valueAsNumber:C,mount:k}=e._f,E=Pe(n,S);if(!k||t.has(S))return{};const j=l?l[0]:a,R=G=>{i&&j.reportValidity&&(j.setCustomValidity(Mi(G)?"":G||""),j.reportValidity())},N={},T=uj(a),A=ih(a),D=T||A,F=(C||cj(a))&&ln(a.value)&&ln(E)||Ly(a)&&a.value===""||E===""||Array.isArray(E)&&!E.length,K=lj.bind(null,S,r,N),te=(G,q,V,H=Ya.maxLength,z=Ya.minLength)=>{const W=G?q:V;N[S]={type:G?H:z,message:W,ref:a,...K(G?H:z,W)}};if(o?!Array.isArray(E)||!E.length:d&&(!D&&(F||yi(E))||Mi(E)&&!E||A&&!u6(l).isValid||T&&!f6(l).isValid)){const{value:G,message:q}=Fi(d)?{value:!!d,message:d}:nd(d);if(G&&(N[S]={type:Ya.required,message:q,ref:j,...K(Ya.required,q)},!r))return R(q),N}if(!F&&(!yi(h)||!yi(v))){let G,q;const V=nd(v),H=nd(h);if(!yi(E)&&!isNaN(E)){const z=a.valueAsNumber||E&&+E;yi(V.value)||(G=z>V.value),yi(H.value)||(q=z<H.value)}else{const z=a.valueAsDate||new Date(E),W=$=>new Date(new Date().toDateString()+" "+$),L=a.type=="time",ne=a.type=="week";Fi(V.value)&&E&&(G=L?W(E)>W(V.value):ne?E>V.value:z>new Date(V.value)),Fi(H.value)&&E&&(q=L?W(E)<W(H.value):ne?E<H.value:z<new Date(H.value))}if((G||q)&&(te(!!G,V.message,H.message,Ya.max,Ya.min),!r))return R(N[S].message),N}if((f||m)&&!F&&(Fi(E)||o&&Array.isArray(E))){const G=nd(f),q=nd(m),V=!yi(G.value)&&E.length>+G.value,H=!yi(q.value)&&E.length<+q.value;if((V||H)&&(te(V,G.message,q.message),!r))return R(N[S].message),N}if(y&&!F&&Fi(E)){const{value:G,message:q}=nd(y);if(Fy(G)&&!E.match(G)&&(N[S]={type:Ya.pattern,message:q,ref:a,...K(Ya.pattern,q)},!r))return R(q),N}if(x){if(Yr(x)){const G=await x(E,n),q=j2(G,j);if(q&&(N[S]={...q,...K(Ya.validate,q.message)},!r))return R(q.message),N}else if(nr(x)){let G={};for(const q in x){if(!Or(G)&&!r)break;const V=j2(await x[q](E,n),j,q);V&&(G={...V,...K(q,V.message)},R(V.message),r&&(N[S]=G))}if(!Or(G)&&(N[S]={ref:j,...G},!r))return N}}return R(!0),N};const Qme={mode:So.onSubmit,reValidateMode:So.onChange,shouldFocusError:!0};function ehe(e={}){let t={...Qme,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Yr(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=nr(t.defaultValues)||nr(t.values)?bn(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:bn(i),a={action:!1,mount:!1,watch:!1,keepIsValid:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},d,f=0;const m={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},h={...m};let v={...h};const y={array:x2(),state:x2()},x=t.criteriaMode===So.all,S=Z=>re=>{clearTimeout(f),f=setTimeout(Z,re)},C=async Z=>{if(!a.keepIsValid&&!t.disabled&&(h.isValid||v.isValid||Z)){let re;t.resolver?(re=Or((await D()).errors),k()):re=await K(r,!0),re!==n.isValid&&y.state.next({isValid:re})}},k=(Z,re)=>{!t.disabled&&(h.isValidating||h.validatingFields||v.isValidating||v.validatingFields)&&((Z||Array.from(l.mount)).forEach(se=>{se&&(re?Gt(n.validatingFields,se,re):Kn(n.validatingFields,se))}),y.state.next({validatingFields:n.validatingFields,isValidating:!Or(n.validatingFields)}))},E=(Z,re=[],se,ie,fe=!0,B=!0)=>{if(ie&&se&&!t.disabled){if(a.action=!0,B&&Array.isArray(Pe(r,Z))){const le=se(Pe(r,Z),ie.argA,ie.argB);fe&&Gt(r,Z,le)}if(B&&Array.isArray(Pe(n.errors,Z))){const le=se(Pe(n.errors,Z),ie.argA,ie.argB);fe&&Gt(n.errors,Z,le),Jme(n.errors,Z)}if((h.touchedFields||v.touchedFields)&&B&&Array.isArray(Pe(n.touchedFields,Z))){const le=se(Pe(n.touchedFields,Z),ie.argA,ie.argB);fe&&Gt(n.touchedFields,Z,le)}(h.dirtyFields||v.dirtyFields)&&(n.dirtyFields=dd(i,o)),y.state.next({name:Z,isDirty:G(Z,re),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Gt(o,Z,re)},j=(Z,re)=>{Gt(n.errors,Z,re),y.state.next({errors:n.errors})},R=Z=>{n.errors=Z,y.state.next({errors:n.errors,isValid:!1})},N=(Z,re,se,ie)=>{const fe=Pe(r,Z);if(fe){const B=Pe(o,Z,ln(se)?Pe(i,Z):se);ln(B)||ie&&ie.defaultChecked||re?Gt(o,Z,re?B:C2(fe._f)):H(Z,B),a.mount&&!a.action&&C()}},T=(Z,re,se,ie,fe)=>{let B=!1,le=!1;const Ee={name:Z};if(!t.disabled){if(!se||ie){(h.isDirty||v.isDirty)&&(le=n.isDirty,n.isDirty=Ee.isDirty=G(),B=le!==Ee.isDirty);const Me=Uo(Pe(i,Z),re);le=!!Pe(n.dirtyFields,Z),Me?Kn(n.dirtyFields,Z):Gt(n.dirtyFields,Z,!0),Ee.dirtyFields=n.dirtyFields,B=B||(h.dirtyFields||v.dirtyFields)&&le!==!Me}if(se){const Me=Pe(n.touchedFields,Z);Me||(Gt(n.touchedFields,Z,se),Ee.touchedFields=n.touchedFields,B=B||(h.touchedFields||v.touchedFields)&&Me!==se)}B&&fe&&y.state.next(Ee)}return B?Ee:{}},A=(Z,re,se,ie)=>{const fe=Pe(n.errors,Z),B=(h.isValid||v.isValid)&&Mi(re)&&n.isValid!==re;if(t.delayError&&se?(d=S(()=>j(Z,se)),d(t.delayError)):(clearTimeout(f),d=null,se?Gt(n.errors,Z,se):Kn(n.errors,Z)),(se?!Uo(fe,se):fe)||!Or(ie)||B){const le={...ie,...B&&Mi(re)?{isValid:re}:{},errors:n.errors,name:Z};n={...n,...le},y.state.next(le)}},D=async Z=>(k(Z,!0),await t.resolver(o,t.context,Kme(Z||l.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),F=async Z=>{const{errors:re}=await D(Z);if(k(Z),Z)for(const se of Z){const ie=Pe(re,se);ie?Gt(n.errors,se,ie):Kn(n.errors,se)}else n.errors=re;return re},K=async(Z,re,se={valid:!0})=>{for(const ie in Z){const fe=Z[ie];if(fe){const{_f:B,...le}=fe;if(B){const Ee=l.array.has(B.name),Me=fe._f&&Gme(fe._f);Me&&h.validatingFields&&k([B.name],!0);const Ke=await BC(fe,l.disabled,o,x,t.shouldUseNativeValidation&&!re,Ee);if(Me&&h.validatingFields&&k([B.name]),Ke[B.name]&&(se.valid=!1,re||e.shouldUseNativeValidation))break;!re&&(Pe(Ke,B.name)?Ee?p6(n.errors,Ke,B.name):Gt(n.errors,B.name,Ke[B.name]):Kn(n.errors,B.name))}!Or(le)&&await K(le,re,se)}}return se.valid},te=()=>{for(const Z of l.unMount){const re=Pe(r,Z);re&&(re._f.refs?re._f.refs.every(se=>!W_(se)):!W_(re._f.ref))&&ve(Z)}l.unMount=new Set},G=(Z,re)=>!t.disabled&&(Z&&re&&Gt(o,Z,re),!Uo(P(),i)),q=(Z,re,se)=>LC(Z,l,{...a.mount?o:ln(re)?i:Fi(Z)?{[Z]:re}:re},se,re),V=Z=>yx(Pe(a.mount?o:i,Z,t.shouldUnregister?Pe(i,Z,[]):[])),H=(Z,re,se={})=>{const ie=Pe(r,Z);let fe=re;if(ie){const B=ie._f;B&&(!B.disabled&&Gt(o,Z,d6(re,B)),fe=Ly(B.ref)&&yi(re)?"":re,l6(B.ref)?[...B.ref.options].forEach(le=>le.selected=fe.includes(le.value)):B.refs?ih(B.ref)?B.refs.forEach(le=>{(!le.defaultChecked||!le.disabled)&&(Array.isArray(fe)?le.checked=!!fe.find(Ee=>Ee===le.value):le.checked=fe===le.value||!!fe)}):B.refs.forEach(le=>le.checked=le.value===fe):cj(B.ref)?B.ref.value="":(B.ref.value=fe,B.ref.type||y.state.next({name:Z,values:bn(o)})))}(se.shouldDirty||se.shouldTouch)&&T(Z,fe,se.shouldTouch,se.shouldDirty,!0),se.shouldValidate&&$(Z)},z=(Z,re,se)=>{for(const ie in re){if(!re.hasOwnProperty(ie))return;const fe=re[ie],B=Z+"."+ie,le=Pe(r,B);(l.array.has(Z)||nr(fe)||le&&!le._f)&&!xc(fe)?z(B,fe,se):H(B,fe,se)}},W=(Z,re,se={})=>{const ie=Pe(r,Z),fe=l.array.has(Z),B=bn(re);Gt(o,Z,B),fe?(y.array.next({name:Z,values:bn(o)}),(h.isDirty||h.dirtyFields||v.isDirty||v.dirtyFields)&&se.shouldDirty&&y.state.next({name:Z,dirtyFields:dd(i,o),isDirty:G(Z,B)})):ie&&!ie._f&&!yi(B)?z(Z,B,se):H(Z,B,se),VC(Z,l)?y.state.next({...n,name:Z,values:bn(o)}):y.state.next({name:a.mount?Z:void 0,values:bn(o)})},L=async Z=>{a.mount=!0;const re=Z.target;let se=re.name,ie=!0;const fe=Pe(r,se),B=Me=>{ie=Number.isNaN(Me)||xc(Me)&&isNaN(Me.getTime())||Uo(Me,Pe(o,se,Me))},le=vd(t.mode),Ee=vd(t.reValidateMode);if(fe){let Me,Ke;const Jt=re.type?C2(fe._f):i6(Z),Ht=Z.type===zy.BLUR||Z.type===zy.FOCUS_OUT,Cn=!Zme(fe._f)&&!t.resolver&&!Pe(n.errors,se)&&!fe._f.deps||Xme(Ht,Pe(n.touchedFields,se),n.isSubmitted,Ee,le),Lt=VC(se,l,Ht);Gt(o,se,Jt),Ht?(!re||!re.readOnly)&&(fe._f.onBlur&&fe._f.onBlur(Z),d&&d(0)):fe._f.onChange&&fe._f.onChange(Z);const fn=T(se,Jt,Ht),jt=!Or(fn)||Lt;if(!Ht&&y.state.next({name:se,type:Z.type,values:bn(o)}),Cn)return(h.isValid||v.isValid)&&(t.mode==="onBlur"?Ht&&C():Ht||C()),jt&&y.state.next({name:se,...Lt?{}:fn});if(!Ht&&Lt&&y.state.next({...n}),t.resolver){const{errors:ar}=await D([se]);if(k([se]),B(Jt),ie){const Rn=E2(n.errors,r,se),fr=E2(ar,r,Rn.name||se);Me=fr.error,se=fr.name,Ke=Or(ar)}}else k([se],!0),Me=(await BC(fe,l.disabled,o,x,t.shouldUseNativeValidation))[se],k([se]),B(Jt),ie&&(Me?Ke=!1:(h.isValid||v.isValid)&&(Ke=await K(r,!0)));ie&&(fe._f.deps&&(!Array.isArray(fe._f.deps)||fe._f.deps.length>0)&&$(fe._f.deps),A(se,Ke,Me,fn))}},ne=(Z,re)=>{if(Pe(n.errors,re)&&Z.focus)return Z.focus(),1},$=async(Z,re={})=>{let se,ie;const fe=Si(Z);if(t.resolver){const B=await F(ln(Z)?Z:fe);se=Or(B),ie=Z?!fe.some(le=>Pe(B,le)):se}else Z?(ie=(await Promise.all(fe.map(async B=>{const le=Pe(r,B);return await K(le&&le._f?{[B]:le}:le)}))).every(Boolean),!(!ie&&!n.isValid)&&C()):ie=se=await K(r);return y.state.next({...!Fi(Z)||(h.isValid||v.isValid)&&se!==n.isValid?{}:{name:Z},...t.resolver||!Z?{isValid:se}:{},errors:n.errors}),re.shouldFocus&&!ie&&kd(r,ne,Z?fe:l.mount),ie},P=(Z,re)=>{let se={...a.mount?o:i};return re&&(se=s6(re.dirtyFields?n.dirtyFields:n.touchedFields,se)),ln(Z)?se:Fi(Z)?Pe(se,Z):Z.map(ie=>Pe(se,ie))},U=(Z,re)=>({invalid:!!Pe((re||n).errors,Z),isDirty:!!Pe((re||n).dirtyFields,Z),error:Pe((re||n).errors,Z),isValidating:!!Pe(n.validatingFields,Z),isTouched:!!Pe((re||n).touchedFields,Z)}),O=Z=>{Z&&Si(Z).forEach(re=>Kn(n.errors,re)),y.state.next({errors:Z?n.errors:{}})},J=(Z,re,se)=>{const ie=(Pe(r,Z,{_f:{}})._f||{}).ref,fe=Pe(n.errors,Z)||{},{ref:B,message:le,type:Ee,...Me}=fe;Gt(n.errors,Z,{...Me,...re,ref:ie}),y.state.next({name:Z,errors:n.errors,isValid:!1}),se&&se.shouldFocus&&ie&&ie.focus&&ie.focus()},pe=(Z,re)=>Yr(Z)?y.state.subscribe({next:se=>"values"in se&&Z(q(void 0,re),se)}):q(Z,re,!0),ge=Z=>y.state.subscribe({next:re=>{Wme(Z.name,re.name,Z.exact)&&Yme(re,Z.formState||h,dr,Z.reRenderRoot)&&Z.callback({values:{...o},...n,...re,defaultValues:i})}}).unsubscribe,Q=Z=>(a.mount=!0,v={...v,...Z.formState},ge({...Z,formState:{...m,...Z.formState}})),ve=(Z,re={})=>{for(const se of Z?Si(Z):l.mount)l.mount.delete(se),l.array.delete(se),re.keepValue||(Kn(r,se),Kn(o,se)),!re.keepError&&Kn(n.errors,se),!re.keepDirty&&Kn(n.dirtyFields,se),!re.keepTouched&&Kn(n.touchedFields,se),!re.keepIsValidating&&Kn(n.validatingFields,se),!t.shouldUnregister&&!re.keepDefaultValue&&Kn(i,se);y.state.next({values:bn(o)}),y.state.next({...n,...re.keepDirty?{isDirty:G()}:{}}),!re.keepIsValid&&C()},be=({disabled:Z,name:re})=>{if(Mi(Z)&&a.mount||Z||l.disabled.has(re)){const fe=l.disabled.has(re)!==!!Z;Z?l.disabled.add(re):l.disabled.delete(re),fe&&a.mount&&!a.action&&C()}},ke=(Z,re={})=>{let se=Pe(r,Z);const ie=Mi(re.disabled)||Mi(t.disabled);return Gt(r,Z,{...se||{},_f:{...se&&se._f?se._f:{ref:{name:Z}},name:Z,mount:!0,...re}}),l.mount.add(Z),se?be({disabled:Mi(re.disabled)?re.disabled:t.disabled,name:Z}):N(Z,!0,re.value),{...ie?{disabled:re.disabled||t.disabled}:{},...t.progressive?{required:!!re.required,min:Pp(re.min),max:Pp(re.max),minLength:Pp(re.minLength),maxLength:Pp(re.maxLength),pattern:Pp(re.pattern)}:{},name:Z,onChange:L,onBlur:L,ref:fe=>{if(fe){ke(Z,re),se=Pe(r,Z);const B=ln(fe.value)&&fe.querySelectorAll&&fe.querySelectorAll("input,select,textarea")[0]||fe,le=Vme(B),Ee=se._f.refs||[];if(le?Ee.find(Me=>Me===B):B===se._f.ref)return;Gt(r,Z,{_f:{...se._f,...le?{refs:[...Ee.filter(W_),B,...Array.isArray(Pe(i,Z))?[{}]:[]],ref:{type:B.type,name:Z}}:{ref:B}}}),N(Z,!1,void 0,B)}else se=Pe(r,Z,{}),se._f&&(se._f.mount=!1),(t.shouldUnregister||re.shouldUnregister)&&!(o6(l.array,Z)&&a.action)&&l.unMount.add(Z)}}},$e=()=>t.shouldFocusError&&kd(r,ne,l.mount),Le=Z=>{Mi(Z)&&(y.state.next({disabled:Z}),kd(r,(re,se)=>{const ie=Pe(r,se);ie&&(re.disabled=ie._f.disabled||Z,Array.isArray(ie._f.refs)&&ie._f.refs.forEach(fe=>{fe.disabled=ie._f.disabled||Z}))},0,!1))},St=(Z,re)=>async se=>{let ie;se&&(se.preventDefault&&se.preventDefault(),se.persist&&se.persist());let fe=bn(o);if(y.state.next({isSubmitting:!0}),t.resolver){const{errors:B,values:le}=await D();k(),n.errors=B,fe=bn(le)}else await K(r);if(l.disabled.size)for(const B of l.disabled)Kn(fe,B);if(Kn(n.errors,"root"),Or(n.errors)){y.state.next({errors:{}});try{await Z(fe,se)}catch(B){ie=B}}else re&&await re({...n.errors},se),$e(),setTimeout($e);if(y.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Or(n.errors)&&!ie,submitCount:n.submitCount+1,errors:n.errors}),ie)throw ie},ct=(Z,re={})=>{Pe(r,Z)&&(ln(re.defaultValue)?W(Z,bn(Pe(i,Z))):(W(Z,re.defaultValue),Gt(i,Z,bn(re.defaultValue))),re.keepTouched||Kn(n.touchedFields,Z),re.keepDirty||(Kn(n.dirtyFields,Z),n.isDirty=re.defaultValue?G(Z,bn(Pe(i,Z))):G()),re.keepError||(Kn(n.errors,Z),h.isValid&&C()),y.state.next({...n}))},Qe=(Z,re={})=>{const se=Z?bn(Z):i,ie=bn(se),fe=Or(Z),B=fe?i:ie;if(re.keepDefaultValues||(i=se),!re.keepValues){if(re.keepDirtyValues){const le=new Set([...l.mount,...Object.keys(dd(i,o))]);for(const Ee of Array.from(le)){const Me=Pe(n.dirtyFields,Ee),Ke=Pe(o,Ee),Jt=Pe(B,Ee);Me&&!ln(Ke)?Gt(B,Ee,Ke):!Me&&!ln(Jt)&&W(Ee,Jt)}}else{if(rj&&ln(Z))for(const le of l.mount){const Ee=Pe(r,le);if(Ee&&Ee._f){const Me=Array.isArray(Ee._f.refs)?Ee._f.refs[0]:Ee._f.ref;if(Ly(Me)){const Ke=Me.closest("form");if(Ke){Ke.reset();break}}}}if(re.keepFieldsRef)for(const le of l.mount)W(le,Pe(B,le));else r={}}o=t.shouldUnregister?re.keepDefaultValues?bn(i):{}:bn(B),y.array.next({values:{...B}}),y.state.next({values:{...B}})}l={mount:re.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!h.isValid||!!re.keepIsValid||!!re.keepDirtyValues||!t.shouldUnregister&&!Or(B),a.watch=!!t.shouldUnregister,a.keepIsValid=!!re.keepIsValid,a.action=!1,re.keepErrors||(n.errors={}),y.state.next({submitCount:re.keepSubmitCount?n.submitCount:0,isDirty:fe?!1:re.keepDirty?n.isDirty:!!(re.keepDefaultValues&&!Uo(Z,i)),isSubmitted:re.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:fe?{}:re.keepDirtyValues?re.keepDefaultValues&&o?dd(i,o):n.dirtyFields:re.keepDefaultValues&&Z?dd(i,Z):re.keepDirty?n.dirtyFields:{},touchedFields:re.keepTouched?n.touchedFields:{},errors:re.keepErrors?n.errors:{},isSubmitSuccessful:re.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},zt=(Z,re)=>Qe(Yr(Z)?Z(o):Z,{...t.resetOptions,...re}),Bt=(Z,re={})=>{const se=Pe(r,Z),ie=se&&se._f;if(ie){const fe=ie.refs?ie.refs[0]:ie.ref;fe.focus&&setTimeout(()=>{fe.focus(),re.shouldSelect&&Yr(fe.select)&&fe.select()})}},dr=Z=>{n={...n,...Z}},An={control:{register:ke,unregister:ve,getFieldState:U,handleSubmit:St,setError:J,_subscribe:ge,_runSchema:D,_updateIsValidating:k,_focusError:$e,_getWatch:q,_getDirty:G,_setValid:C,_setFieldArray:E,_setDisabledField:be,_setErrors:R,_getFieldArray:V,_reset:Qe,_resetDefaultValues:()=>Yr(t.defaultValues)&&t.defaultValues().then(Z=>{zt(Z,t.resetOptions),y.state.next({isLoading:!1})}),_removeUnmounted:te,_disableForm:Le,_subjects:y,_proxyFormState:h,get _fields(){return r},get _formValues(){return o},get _state(){return a},set _state(Z){a=Z},get _defaultValues(){return i},get _names(){return l},set _names(Z){l=Z},get _formState(){return n},get _options(){return t},set _options(Z){t={...t,...Z}}},subscribe:Q,trigger:$,register:ke,handleSubmit:St,watch:pe,setValue:W,getValues:P,reset:zt,resetField:ct,clearErrors:O,unregister:ve,setError:J,setFocus:Bt,getFieldState:U};return{...An,formControl:An}}var qs=()=>{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)})},X_=(e,t,n={})=>n.shouldFocus||ln(n.shouldFocus)?n.focusName||`${e}.${ln(n.focusIndex)?t:n.focusIndex}.`:"",J_=(e,t)=>[...e,...Si(t)],Q_=e=>Array.isArray(e)?e.map(()=>{}):void 0;function e1(e,t,n){return[...e.slice(0,t),...Si(n),...e.slice(t)]}var t1=(e,t,n)=>Array.isArray(e)?(ln(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],n1=(e,t)=>[...Si(t),...Si(e)];function the(e,t){let n=0;const r=[...e];for(const i of t)r.splice(i-n,1),n++;return yx(r).length?r:[]}var r1=(e,t)=>ln(t)?[]:the(e,Si(t).sort((n,r)=>n-r)),i1=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},R2=(e,t,n)=>(e[t]=n,e);function dj(e){const t=bx(),{control:n=t,name:r,keyName:i="id",shouldUnregister:o,rules:a}=e,[l,d]=X.useState(n._getFieldArray(r)),f=X.useRef(n._getFieldArray(r).map(qs)),m=X.useRef(!1);n._names.array.add(r),X.useMemo(()=>a&&l.length>=0&&n.register(r,a),[n,r,l.length,a]),xx(()=>n._subjects.array.subscribe({next:({values:R,name:N})=>{if(N===r||!N){const T=Pe(R,r);Array.isArray(T)&&(d(T),f.current=T.map(qs))}}}).unsubscribe,[n,r]);const h=X.useCallback(R=>{m.current=!0,n._setFieldArray(r,R)},[n,r]),v=(R,N)=>{const T=Si(bn(R)),A=J_(n._getFieldArray(r),T);n._names.focus=X_(r,A.length-1,N),f.current=J_(f.current,T.map(qs)),h(A),d(A),n._setFieldArray(r,A,J_,{argA:Q_(R)})},y=(R,N)=>{const T=Si(bn(R)),A=n1(n._getFieldArray(r),T);n._names.focus=X_(r,0,N),f.current=n1(f.current,T.map(qs)),h(A),d(A),n._setFieldArray(r,A,n1,{argA:Q_(R)})},x=R=>{const N=r1(n._getFieldArray(r),R);f.current=r1(f.current,R),h(N),d(N),!Array.isArray(Pe(n._fields,r))&&Gt(n._fields,r,void 0),n._setFieldArray(r,N,r1,{argA:R})},S=(R,N,T)=>{const A=Si(bn(N)),D=e1(n._getFieldArray(r),R,A);n._names.focus=X_(r,R,T),f.current=e1(f.current,R,A.map(qs)),h(D),d(D),n._setFieldArray(r,D,e1,{argA:R,argB:Q_(N)})},C=(R,N)=>{const T=n._getFieldArray(r);i1(T,R,N),i1(f.current,R,N),h(T),d(T),n._setFieldArray(r,T,i1,{argA:R,argB:N},!1)},k=(R,N)=>{const T=n._getFieldArray(r);t1(T,R,N),t1(f.current,R,N),h(T),d(T),n._setFieldArray(r,T,t1,{argA:R,argB:N},!1)},E=(R,N)=>{const T=bn(N),A=R2(n._getFieldArray(r),R,T);f.current=[...A].map((D,F)=>!D||F===R?qs():f.current[F]),h(A),d([...A]),n._setFieldArray(r,A,R2,{argA:R,argB:T},!0,!1)},j=R=>{const N=Si(bn(R));f.current=N.map(qs),h([...N]),d([...N]),n._setFieldArray(r,[...N],T=>T,{},!0,!1)};return X.useEffect(()=>{if(n._state.action=!1,VC(r,n._names)&&n._subjects.state.next({...n._formState}),m.current&&(!vd(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!vd(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([r]).then(R=>{n._updateIsValidating([r]);const N=Pe(R.errors,r),T=Pe(n._formState.errors,r);(T?!N&&T.type||N&&(T.type!==N.type||T.message!==N.message):N&&N.type)&&(N?Gt(n._formState.errors,r,N):Kn(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const R=Pe(n._fields,r);R&&R._f&&!(vd(n._options.reValidateMode).isOnSubmit&&vd(n._options.mode).isOnSubmit)&&BC(R,n._names.disabled,n._formValues,n._options.criteriaMode===So.all,n._options.shouldUseNativeValidation,!0).then(N=>!Or(N)&&n._subjects.state.next({errors:p6(n._formState.errors,N,r)}))}n._subjects.state.next({name:r,values:bn(n._formValues)}),n._names.focus&&kd(n._fields,(R,N)=>{if(n._names.focus&&N.startsWith(n._names.focus)&&R.focus)return R.focus(),1}),n._names.focus="",n._setValid(),m.current=!1},[l,r,n]),X.useEffect(()=>(!Pe(n._formValues,r)&&n._setFieldArray(r),()=>{const R=(N,T)=>{const A=Pe(n._fields,N);A&&A._f&&(A._f.mount=T)};n._options.shouldUnregister||o?n.unregister(r):R(r,!1)}),[r,n,i,o]),{swap:X.useCallback(C,[h,r,n]),move:X.useCallback(k,[h,r,n]),prepend:X.useCallback(y,[h,r,n]),append:X.useCallback(v,[h,r,n]),remove:X.useCallback(x,[h,r,n]),insert:X.useCallback(S,[h,r,n]),update:X.useCallback(E,[h,r,n]),replace:X.useCallback(j,[h,r,n]),fields:X.useMemo(()=>l.map((R,N)=>({...R,[i]:f.current[N]||qs()})),[l,i])}}function un(e={}){const t=X.useRef(void 0),n=X.useRef(void 0),[r,i]=X.useState({isDirty:!1,isValidating:!1,isLoading:Yr(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:Yr(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Yr(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...l}=ehe(e);t.current={...l,formState:r}}const o=t.current.control;return o._options=e,xx(()=>{const a=o._subscribe({formState:o._proxyFormState,callback:()=>i({...o._formState}),reRenderRoot:!0});return i(l=>({...l,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(()=>{var a;e.values&&!Uo(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((a=o._options.resetOptions)===null||a===void 0)&&a.keepIsValid||o._setValid(),n.current=e.values,i(l=>({...l}))):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=X.useMemo(()=>a6(r,o),[o,r]),t.current}const dn=Ume,m6=b.createContext({}),h6=b.createContext({});function wx(){const e=b.useContext(m6),t=b.useContext(h6),{getFieldState:n}=Fme(),r=aj({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 Oe({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:i}=wx();return u.jsx(aE,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${i}`:`${r}`,"aria-invalid":!!t,...e})}function De({...e}){return u.jsx(m6,{value:{name:e.name},children:u.jsx(Lme,{...e})})}function Te({className:e,...t}){const n=b.useId();return u.jsx(h6,{value:{id:n},children:u.jsx("div",{"data-slot":"form-item",className:Ue("grid gap-2",e),...t})})}var nhe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],g6=nhe.reduce((e,t)=>{const n=I4(`Primitive.${t}`),r=b.forwardRef((i,o)=>{const{asChild:a,...l}=i,d=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(d,{...l,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),rhe="Label",v6=b.forwardRef((e,t)=>u.jsx(g6.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));v6.displayName=rhe;var ihe=v6;function oh({className:e,...t}){return u.jsx(ihe,{"data-slot":"label",className:Ue("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 Ne({className:e,...t}){const{error:n,formItemId:r}=wx();return u.jsx(oh,{"data-slot":"form-label","data-error":!!n,className:Ue("data-[error=true]:text-destructive",e),htmlFor:r,...t})}function Ae({className:e,...t}){const{error:n,formMessageId:r}=wx(),i=n?String(n?.message):t.children;return i?u.jsx("p",{"data-slot":"form-message",id:r,className:Ue("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:Ue(`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 Sx=["RUNNING"],fj=["TERMINATING","TERMINATED","REMOVED"];function ohe(){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 HC({username:e,password:t,instanceClient:n,entityId:r}){const i={username:e,password:t};kt.checkForBasicAuth(r)&&(n.defaults.auth=i,n.defaults.withCredentials=!1);const{data:{message:o}}=await n.post("/",{operation:"login",username:e,password:t});if(!kt.checkForBasicAuth(r))try{const d=await sl({instanceClient:n});return{message:o,user:d}}catch(d){console.error("Failed to get user after login, trying basic auth",d)}try{n.defaults.auth=i,n.defaults.withCredentials=!1;const d=await sl({instanceClient:n,auth:i});return kt.flagForBasicAuth(r,i),{message:o,user:d}}catch(d){throw n.defaults.auth=void 0,n.defaults.withCredentials=!0,d}const a=es({id:r,forceFabricConnect:!0}),l=await sl({instanceClient:a});return kt.flagForFabricConnect(r,!0),{message:o,user:l,instanceClient:a}}function ahe(){return ut({mutationFn:HC})}function she({cluster:e,instance:t,instanceParams:n}){const r=jn(),i=_n(),{redirect:o}=Tr({strict:!1}),{mutate:a,isPending:l}=ahe(),d=b.useCallback(async f=>{a({...f,...n},{onSuccess:async({message:m,user:h})=>{if(Se.success(m),e?.instances?.length&&!t)for(const y of e.instances)kt.setUserForEntity(y,h);const v=$n;kt.setUserForEntity(v,h),i.invalidate(),await r({to:o?.startsWith("/")?o:ba})}})},[e,t,n,r,o,i,a]);return{isPending:l,submitForm:d}}async function pj(e){const{data:t}=await Yt.get(`/Cluster/${e}`);return t}function Dl(e,t){return{queryKey:[e],queryFn:()=>pj(e),retry:!1,staleTime:1900,enabled:!!e,refetchInterval:t?t===!0?1e4:t:void 0}}const y6=Object.freeze({status:"aborted"});function ae(e,t,n){function r(l,d){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:d,constr:a,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,d);const f=a.prototype,m=Object.keys(f);for(let h=0;h<m.length;h++){const v=m[h];v in l||(l[v]=f[v].bind(l))}}const i=n?.Parent??Object;class o extends i{}Object.defineProperty(o,"name",{value:e});function a(l){var d;const f=n?.Parent?new o:this;r(f,l),(d=f._zod).deferred??(d.deferred=[]);for(const m of f._zod.deferred)m();return f}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:l=>n?.Parent&&l instanceof n.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}const b6=Symbol("zod_brand");class Ic extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class _x extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Uy={};function zr(e){return e&&Object.assign(Uy,e),Uy}function lhe(e){return e}function che(e){return e}function uhe(e){}function dhe(e){throw new Error("Unexpected value in exhaustive check")}function fhe(e){}function mj(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 je(e,t="|"){return e.map(n=>it(n)).join(t)}function Vy(e,t){return typeof t=="bigint"?t.toString():t}function ah(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function nu(e){return e==null}function Cx(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function x6(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(".","")),l=Number.parseInt(t.toFixed(o).replace(".",""));return a%l/10**o}const I2=Symbol("evaluating");function Ct(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==I2)return r===void 0&&(r=I2,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function phe(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Pl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ea(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function mhe(e){return Ea(e._zod.def)}function hhe(e,t){return t?t.reduce((n,r)=>n?.[r],e):e}function ghe(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 vhe(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 qC(e){return JSON.stringify(e)}function w6(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const hj="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function qd(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const S6=ah(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function zc(e){if(qd(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(qd(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function kx(e){return zc(e)?{...e}:Array.isArray(e)?[...e]:e}function yhe(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}const bhe=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}`)}},By=new Set(["string","number","symbol"]),_6=new Set(["string","number","bigint","boolean","symbol","undefined"]);function us(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Oo(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 xhe(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 C6(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const k6={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]},E6={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function j6(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=Ea(e._zod.def,{get shape(){const a={};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(a[l]=n.shape[l])}return Pl(this,"shape",a),a},checks:[]});return Oo(e,o)}function R6(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=Ea(e._zod.def,{get shape(){const a={...e._zod.def.shape};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete a[l]}return Pl(this,"shape",a),a},checks:[]});return Oo(e,o)}function I6(e,t){if(!zc(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=e._zod.def.shape;for(const a in t)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=Ea(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return Pl(this,"shape",o),o}});return Oo(e,i)}function T6(e,t){if(!zc(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ea(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Pl(this,"shape",r),r}});return Oo(e,n)}function N6(e,t){const n=Ea(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Pl(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Oo(e,n)}function A6(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=Ea(t._zod.def,{get shape(){const l=t._zod.def.shape,d={...l};if(n)for(const f in n){if(!(f in l))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(d[f]=e?new e({type:"optional",innerType:l[f]}):l[f])}else for(const f in l)d[f]=e?new e({type:"optional",innerType:l[f]}):l[f];return Pl(this,"shape",d),d},checks:[]});return Oo(t,a)}function O6(e,t,n){const r=Ea(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 Pl(this,"shape",o),o}});return Oo(t,r)}function wc(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 Vo(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Yp(e){return typeof e=="string"?e:e?.message}function Io(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=Yp(e.inst?._zod.def?.error?.(e))??Yp(t?.error?.(e))??Yp(n.customError?.(e))??Yp(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Ex(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function jx(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function st(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";const n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function Kd(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function whe(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function $6(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 D6(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function She(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return $6(t+n)}function _he(e){return D6(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Che(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 khe(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}class Ehe{constructor(...t){}}const P6=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:E6,Class:Ehe,NUMBER_FORMAT_RANGES:k6,aborted:wc,allowsEval:S6,assert:fhe,assertEqual:lhe,assertIs:uhe,assertNever:dhe,assertNotEqual:che,assignProp:Pl,base64ToUint8Array:$6,base64urlToUint8Array:She,cached:ah,captureStackTrace:hj,cleanEnum:whe,cleanRegex:Cx,clone:Oo,cloneDef:mhe,createTransparentProxy:xhe,defineLazy:Ct,esc:qC,escapeRegex:us,extend:I6,finalizeIssue:Io,floatSafeRemainder:x6,getElementAtPath:hhe,getEnumValues:mj,getLengthableOrigin:jx,getParsedType:bhe,getSizableOrigin:Ex,hexToUint8Array:Che,isObject:qd,isPlainObject:zc,issue:Kd,joinValues:je,jsonStringifyReplacer:Vy,merge:N6,mergeDefs:Ea,normalizeParams:Ce,nullish:nu,numKeys:yhe,objectClone:phe,omit:R6,optionalKeys:C6,parsedType:st,partial:A6,pick:j6,prefixIssues:Vo,primitiveTypes:_6,promiseAllObject:ghe,propertyKeyTypes:By,randomString:vhe,required:O6,safeExtend:T6,shallowClone:kx,slugify:w6,stringifyPrimitive:it,uint8ArrayToBase64:D6,uint8ArrayToBase64url:_he,uint8ArrayToHex:khe,unwrapMessage:Yp},Symbol.toStringTag,{value:"Module"})),M6=(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,Vy,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Rx=ae("$ZodError",M6),eo=ae("$ZodError",M6,{Parent:Error});function gj(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 vj(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,l=0;for(;l<o.path.length;){const d=o.path[l];l===o.path.length-1?(a[d]=a[d]||{_errors:[]},a[d]._errors.push(t(o))):a[d]=a[d]||{_errors:[]},a=a[d],l++}}};return r(e),n}function z6(e,t=n=>n.message){const n={errors:[]},r=(i,o=[])=>{var a,l;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 m=n,h=0;for(;h<f.length;){const v=f[h],y=h===f.length-1;typeof v=="string"?(m.properties??(m.properties={}),(a=m.properties)[v]??(a[v]={errors:[]}),m=m.properties[v]):(m.items??(m.items=[]),(l=m.items)[v]??(l[v]={errors:[]}),m=m.items[v]),y&&m.errors.push(t(d)),h++}}};return r(e),n}function L6(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 F6(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 ${L6(r.path)}`);return t.join(`
47
- `)}const sh=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 Ic;if(a.issues.length){const l=new(i?.Err??e)(a.issues.map(d=>Io(d,o,zr())));throw hj(l,i?.callee),l}return a.value},Hy=sh(eo),lh=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 l=new(i?.Err??e)(a.issues.map(d=>Io(d,o,zr())));throw hj(l,i?.callee),l}return a.value},qy=lh(eo),ch=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 Ic;return o.issues.length?{success:!1,error:new(e??Rx)(o.issues.map(a=>Io(a,i,zr())))}:{success:!0,data:o.value}},U6=ch(eo),uh=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=>Io(a,i,zr())))}:{success:!0,data:o.value}},V6=uh(eo),yj=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return sh(e)(t,n,i)},jhe=yj(eo),bj=e=>(t,n,r)=>sh(e)(t,n,r),Rhe=bj(eo),xj=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return lh(e)(t,n,i)},Ihe=xj(eo),wj=e=>async(t,n,r)=>lh(e)(t,n,r),The=wj(eo),Sj=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ch(e)(t,n,i)},Nhe=Sj(eo),_j=e=>(t,n,r)=>ch(e)(t,n,r),Ahe=_j(eo),Cj=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return uh(e)(t,n,i)},Ohe=Cj(eo),kj=e=>async(t,n,r)=>uh(e)(t,n,r),$he=kj(eo),B6=/^[cC][^\s-]{8,}$/,H6=/^[0-9a-z]+$/,q6=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,K6=/^[0-9a-vA-V]{20}$/,G6=/^[A-Za-z0-9]{27}$/,Z6=/^[a-zA-Z0-9_-]{21}$/,Y6=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Dhe=/^[-+]?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)?)??$/,W6=/^([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})$/,Gd=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)$/,Phe=Gd(4),Mhe=Gd(6),zhe=Gd(7),X6=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Lhe=/^[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])?)*$/,Fhe=/^(([^<>()\[\]\\.,;:\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,}))$/,J6=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Uhe=J6,Vhe=/^[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])?)*$/,Bhe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Q6(){return new RegExp(Bhe,"u")}const e3=/^(?:(?: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])$/,t3=/^(([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}|:))$/,n3=e=>{const t=us(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},r3=/^((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])$/,i3=/^(([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])$/,o3=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ej=/^[A-Za-z0-9_-]*$/,a3=/^(?=.{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])?)*\.?$/,s3=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,l3=/^\+[1-9]\d{6,14}$/,c3="(?:(?:\\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])))",u3=new RegExp(`^${c3}$`);function d3(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 f3(e){return new RegExp(`^${d3(e)}$`)}function p3(e){const t=d3({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(`^${c3}T(?:${r})$`)}const m3=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},h3=/^-?\d+n?$/,g3=/^-?\d+$/,jj=/^-?\d+(?:\.\d+)?$/,v3=/^(?:true|false)$/i,y3=/^null$/i,b3=/^undefined$/i,x3=/^[^A-Z]*$/,w3=/^[^a-z]*$/,S3=/^[0-9a-fA-F]*$/;function dh(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function fh(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const Hhe=/^[0-9a-fA-F]{32}$/,qhe=dh(22,"=="),Khe=fh(22),Ghe=/^[0-9a-fA-F]{40}$/,Zhe=dh(27,"="),Yhe=fh(27),Whe=/^[0-9a-fA-F]{64}$/,Xhe=dh(43,"="),Jhe=fh(43),Qhe=/^[0-9a-fA-F]{96}$/,ege=dh(64,""),tge=fh(64),nge=/^[0-9a-fA-F]{128}$/,rge=dh(86,"=="),ige=fh(86),Rj=Object.freeze(Object.defineProperty({__proto__:null,base64:o3,base64url:Ej,bigint:h3,boolean:v3,browserEmail:Vhe,cidrv4:r3,cidrv6:i3,cuid:B6,cuid2:H6,date:u3,datetime:p3,domain:s3,duration:Y6,e164:l3,email:X6,emoji:Q6,extendedDuration:Dhe,guid:W6,hex:S3,hostname:a3,html5Email:Lhe,idnEmail:Uhe,integer:g3,ipv4:e3,ipv6:t3,ksuid:G6,lowercase:x3,mac:n3,md5_base64:qhe,md5_base64url:Khe,md5_hex:Hhe,nanoid:Z6,null:y3,number:jj,rfc5322Email:Fhe,sha1_base64:Zhe,sha1_base64url:Yhe,sha1_hex:Ghe,sha256_base64:Xhe,sha256_base64url:Jhe,sha256_hex:Whe,sha384_base64:ege,sha384_base64url:tge,sha384_hex:Qhe,sha512_base64:rge,sha512_base64url:ige,sha512_hex:nge,string:m3,time:f3,ulid:q6,undefined:b3,unicodeEmail:J6,uppercase:w3,uuid:Gd,uuid4:Phe,uuid6:Mhe,uuid7:zhe,xid:K6},Symbol.toStringTag,{value:"Module"})),Nn=ae("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),_3={number:"number",bigint:"bigint",object:"date"},Ij=ae("$ZodCheckLessThan",(e,t)=>{Nn.init(e,t);const n=_3[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:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Tj=ae("$ZodCheckGreaterThan",(e,t)=>{Nn.init(e,t);const n=_3[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:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),C3=ae("$ZodCheckMultipleOf",(e,t)=>{Nn.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):x6(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})}}),k3=ae("$ZodCheckNumberFormat",(e,t)=>{Nn.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,o]=k6[t.format];e._zod.onattach.push(a=>{const l=a._zod.bag;l.format=t.format,l.minimum=i,l.maximum=o,n&&(l.pattern=g3)}),e._zod.check=a=>{const l=a.value;if(n){if(!Number.isInteger(l)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}l<i&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),l>o&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),E3=ae("$ZodCheckBigIntFormat",(e,t)=>{Nn.init(e,t);const[n,r]=E6[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,inclusive:!0,inst:e,continue:!t.abort})}}),j3=ae("$ZodCheckMaxSize",(e,t)=>{var n;Nn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!nu(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:Ex(i),code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),R3=ae("$ZodCheckMinSize",(e,t)=>{var n;Nn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!nu(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:Ex(i),code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),I3=ae("$ZodCheckSizeEquals",(e,t)=>{var n;Nn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!nu(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:Ex(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})}}),T3=ae("$ZodCheckMaxLength",(e,t)=>{var n;Nn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!nu(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=jx(i);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),N3=ae("$ZodCheckMinLength",(e,t)=>{var n;Nn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!nu(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=jx(i);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),A3=ae("$ZodCheckLengthEquals",(e,t)=>{var n;Nn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!nu(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=jx(i),l=o>t.length;r.issues.push({origin:a,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),ph=ae("$ZodCheckStringFormat",(e,t)=>{var n,r;Nn.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=()=>{})}),O3=ae("$ZodCheckRegex",(e,t)=>{ph.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})}}),$3=ae("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=x3),ph.init(e,t)}),D3=ae("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=w3),ph.init(e,t)}),P3=ae("$ZodCheckIncludes",(e,t)=>{Nn.init(e,t);const n=us(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})}}),M3=ae("$ZodCheckStartsWith",(e,t)=>{Nn.init(e,t);const n=new RegExp(`^${us(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})}}),z3=ae("$ZodCheckEndsWith",(e,t)=>{Nn.init(e,t);const n=new RegExp(`.*${us(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 T2(e,t,n){e.issues.length&&t.issues.push(...Vo(n,e.issues))}const L3=ae("$ZodCheckProperty",(e,t)=>{Nn.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=>T2(i,n,t.property));T2(r,n,t.property)}}),F3=ae("$ZodCheckMimeType",(e,t)=>{Nn.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})}}),U3=ae("$ZodCheckOverwrite",(e,t)=>{Nn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class V3{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 B3={major:4,minor:3,patch:6},ft=ae("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=B3;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,l,d)=>{let f=wc(a),m;for(const h of l){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 Ic;if(m||y instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await y,a.issues.length!==v&&(f||(f=wc(a,v)))});else{if(a.issues.length===v)continue;f||(f=wc(a,v))}}return m?m.then(()=>a):a},o=(a,l,d)=>{if(wc(a))return a.aborted=!0,a;const f=i(l,r,d);if(f instanceof Promise){if(d.async===!1)throw new Ic;return f.then(m=>e._zod.parse(m,d))}return e._zod.parse(f,d)};e._zod.run=(a,l)=>{if(l.skipChecks)return e._zod.parse(a,l);if(l.direction==="backward"){const f=e._zod.parse({value:a.value,issues:[]},{...l,skipChecks:!0});return f instanceof Promise?f.then(m=>o(m,a,l)):o(f,a,l)}const d=e._zod.parse(a,l);if(d instanceof Promise){if(l.async===!1)throw new Ic;return d.then(f=>i(f,r,l))}return i(d,r,l)}}Ct(e,"~standard",()=>({validate:i=>{try{const o=U6(e,i);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return V6(e,i).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),mh=ae("$ZodString",(e,t)=>{ft.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??m3(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}}),hn=ae("$ZodStringFormat",(e,t)=>{ph.init(e,t),mh.init(e,t)}),H3=ae("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=W6),hn.init(e,t)}),q3=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=Gd(r))}else t.pattern??(t.pattern=Gd());hn.init(e,t)}),K3=ae("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=X6),hn.init(e,t)}),G3=ae("$ZodURL",(e,t)=>{hn.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:t.hostname.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})}}}),Z3=ae("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Q6()),hn.init(e,t)}),Y3=ae("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Z6),hn.init(e,t)}),W3=ae("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=B6),hn.init(e,t)}),X3=ae("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=H6),hn.init(e,t)}),J3=ae("$ZodULID",(e,t)=>{t.pattern??(t.pattern=q6),hn.init(e,t)}),Q3=ae("$ZodXID",(e,t)=>{t.pattern??(t.pattern=K6),hn.init(e,t)}),e5=ae("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=G6),hn.init(e,t)}),t5=ae("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=p3(t)),hn.init(e,t)}),n5=ae("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=u3),hn.init(e,t)}),r5=ae("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=f3(t)),hn.init(e,t)}),i5=ae("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Y6),hn.init(e,t)}),o5=ae("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=e3),hn.init(e,t),e._zod.bag.format="ipv4"}),a5=ae("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=t3),hn.init(e,t),e._zod.bag.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})}}}),s5=ae("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=n3(t.delimiter)),hn.init(e,t),e._zod.bag.format="mac"}),l5=ae("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=r3),hn.init(e,t)}),c5=ae("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=i3),hn.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 Nj(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const u5=ae("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=o3),hn.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Nj(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function d5(e){if(!Ej.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Nj(n)}const f5=ae("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ej),hn.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{d5(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),p5=ae("$ZodE164",(e,t)=>{t.pattern??(t.pattern=l3),hn.init(e,t)});function m5(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 h5=ae("$ZodJWT",(e,t)=>{hn.init(e,t),e._zod.check=n=>{m5(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),g5=ae("$ZodCustomStringFormat",(e,t)=>{hn.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})}}),Aj=ae("$ZodNumber",(e,t)=>{ft.init(e,t),e._zod.pattern=e._zod.bag.pattern??jj,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}}),v5=ae("$ZodNumberFormat",(e,t)=>{k3.init(e,t),Aj.init(e,t)}),Oj=ae("$ZodBoolean",(e,t)=>{ft.init(e,t),e._zod.pattern=v3,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}}),$j=ae("$ZodBigInt",(e,t)=>{ft.init(e,t),e._zod.pattern=h3,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}}),y5=ae("$ZodBigIntFormat",(e,t)=>{E3.init(e,t),$j.init(e,t)}),b5=ae("$ZodSymbol",(e,t)=>{ft.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}}),x5=ae("$ZodUndefined",(e,t)=>{ft.init(e,t),e._zod.pattern=b3,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}}),w5=ae("$ZodNull",(e,t)=>{ft.init(e,t),e._zod.pattern=y3,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}}),S5=ae("$ZodAny",(e,t)=>{ft.init(e,t),e._zod.parse=n=>n}),_5=ae("$ZodUnknown",(e,t)=>{ft.init(e,t),e._zod.parse=n=>n}),C5=ae("$ZodNever",(e,t)=>{ft.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),k5=ae("$ZodVoid",(e,t)=>{ft.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}}),E5=ae("$ZodDate",(e,t)=>{ft.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 N2(e,t,n){e.issues.length&&t.issues.push(...Vo(n,e.issues)),t.value[n]=e.value}const j5=ae("$ZodArray",(e,t)=>{ft.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 l=i[a],d=t.element._zod.run({value:l,issues:[]},r);d instanceof Promise?o.push(d.then(f=>N2(f,n,a))):N2(d,n,a)}return o.length?Promise.all(o).then(()=>n):n}});function Ky(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...Vo(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function R5(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=C6(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function I5(e,t,n,r,i,o){const a=[],l=i.keySet,d=i.catchall._zod,f=d.def.type,m=d.optout==="optional";for(const h in t){if(l.has(h))continue;if(f==="never"){a.push(h);continue}const v=d.run({value:t[h],issues:[]},r);v instanceof Promise?e.push(v.then(y=>Ky(y,n,h,t,m))):Ky(v,n,h,t,m)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const T5=ae("$ZodObject",(e,t)=>{if(ft.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const d={...l};return Object.defineProperty(t,"shape",{value:d}),d}})}const r=ah(()=>R5(t));Ct(e._zod,"propValues",()=>{const l=t.shape,d={};for(const f in l){const m=l[f]._zod;if(m.values){d[f]??(d[f]=new Set);for(const h of m.values)d[f].add(h)}}return d});const i=qd,o=t.catchall;let a;e._zod.parse=(l,d)=>{a??(a=r.value);const f=l.value;if(!i(f))return l.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),l;l.value={};const m=[],h=a.shape;for(const v of a.keys){const y=h[v],x=y._zod.optout==="optional",S=y._zod.run({value:f[v],issues:[]},d);S instanceof Promise?m.push(S.then(C=>Ky(C,l,v,f,x))):Ky(S,l,v,f,x)}return o?I5(m,f,l,d,r.value,e):m.length?Promise.all(m).then(()=>l):l}}),N5=ae("$ZodObjectJIT",(e,t)=>{T5.init(e,t);const n=e._zod.parse,r=ah(()=>R5(t)),i=v=>{const y=new V3(["shape","payload","ctx"]),x=r.value,S=j=>{const R=qC(j);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};y.write("const input = payload.value;");const C=Object.create(null);let k=0;for(const j of x.keys)C[j]=`key_${k++}`;y.write("const newResult = {};");for(const j of x.keys){const R=C[j],N=qC(j),A=v[j]?._zod?.optout==="optional";y.write(`const ${R} = ${S(j)};`),A?y.write(`
50
- if (${R}.issues.length) {
51
- if (${N} in input) {
52
- payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
53
- ...iss,
54
- path: iss.path ? [${N}, ...iss.path] : [${N}]
55
- })));
56
- }
57
- }
58
-
59
- if (${R}.value === undefined) {
60
- if (${N} in input) {
61
- newResult[${N}] = undefined;
62
- }
63
- } else {
64
- newResult[${N}] = ${R}.value;
65
- }
66
-
67
- `):y.write(`
68
- if (${R}.issues.length) {
69
- payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
70
- ...iss,
71
- path: iss.path ? [${N}, ...iss.path] : [${N}]
72
- })));
73
- }
74
-
75
- if (${R}.value === undefined) {
76
- if (${N} in input) {
77
- newResult[${N}] = undefined;
78
- }
79
- } else {
80
- newResult[${N}] = ${R}.value;
81
- }
82
-
83
- `)}y.write("payload.value = newResult;"),y.write("return payload;");const E=y.compile();return(j,R)=>E(v,j,R)};let o;const a=qd,l=!Uy.jitless,f=l&&S6.value,m=t.catchall;let h;e._zod.parse=(v,y)=>{h??(h=r.value);const x=v.value;return a(x)?l&&f&&y?.async===!1&&y.jitless!==!0?(o||(o=i(t.shape)),v=o(v,y),m?I5([],x,v,y,h,e):v):n(v,y):(v.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),v)}});function A2(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=>!wc(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=>Io(a,r,zr())))}),t)}const Ix=ae("$ZodUnion",(e,t)=>{ft.init(e,t),Ct(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Ct(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Ct(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Ct(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=>Cx(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 l=[];for(const d of t.options){const f=d._zod.run({value:i.value,issues:[]},o);if(f instanceof Promise)l.push(f),a=!0;else{if(f.issues.length===0)return f;l.push(f)}}return a?Promise.all(l).then(d=>A2(d,i,e,o)):A2(l,i,e,o)}});function O2(e,t,n,r){const i=e.filter(o=>o.issues.length===0);return i.length===1?(t.value=i[0].value,t):(i.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(a=>Io(a,r,zr())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1}),t)}const A5=ae("$ZodXor",(e,t)=>{Ix.init(e,t),t.inclusive=!1;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 l=[];for(const d of t.options){const f=d._zod.run({value:i.value,issues:[]},o);f instanceof Promise?(l.push(f),a=!0):l.push(f)}return a?Promise.all(l).then(d=>O2(d,i,e,o)):O2(l,i,e,o)}}),O5=ae("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ix.init(e,t);const n=e._zod.parse;Ct(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[l,d]of Object.entries(a)){i[l]||(i[l]=new Set);for(const f of d)i[l].add(f)}}return i});const r=ah(()=>{const i=t.options,o=new Map;for(const a of i){const l=a._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const d of l){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(!qd(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),i;const l=r.value.get(a?.[t.discriminator]);return l?l._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)}}),$5=ae("$ZodIntersection",(e,t)=>{ft.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])=>$2(n,d,f)):$2(n,o,a)}});function KC(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(zc(e)&&zc(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=KC(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=KC(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 $2(e,t,n){const r=new Map;let i;for(const l of t.issues)if(l.code==="unrecognized_keys"){i??(i=l);for(const d of l.keys)r.has(d)||r.set(d,{}),r.get(d).l=!0}else e.issues.push(l);for(const l of n.issues)if(l.code==="unrecognized_keys")for(const d of l.keys)r.has(d)||r.set(d,{}),r.get(d).r=!0;else e.issues.push(l);const o=[...r].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(o.length&&i&&e.issues.push({...i,keys:o}),wc(e))return e;const a=KC(t.value,n.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const Dj=ae("$ZodTuple",(e,t)=>{ft.init(e,t);const n=t.items;e._zod.parse=(r,i)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];const a=[],l=[...n].reverse().findIndex(m=>m._zod.optin!=="optional"),d=l===-1?0:n.length-l;if(!t.rest){const m=o.length>n.length,h=o.length<d-1;if(m||h)return r.issues.push({...m?{code:"too_big",maximum:n.length,inclusive:!0}:{code:"too_small",minimum:n.length},input:o,inst:e,origin:"array"}),r}let f=-1;for(const m of n){if(f++,f>=o.length&&f>=d)continue;const h=m._zod.run({value:o[f],issues:[]},i);h instanceof Promise?a.push(h.then(v=>Sv(v,r,f))):Sv(h,r,f)}if(t.rest){const m=o.slice(n.length);for(const h of m){f++;const v=t.rest._zod.run({value:h,issues:[]},i);v instanceof Promise?a.push(v.then(y=>Sv(y,r,f))):Sv(v,r,f)}}return a.length?Promise.all(a).then(()=>r):r}});function Sv(e,t,n){e.issues.length&&t.issues.push(...Vo(n,e.issues)),t.value[n]=e.value}const D5=ae("$ZodRecord",(e,t)=>{ft.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!zc(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const o=[],a=t.keyType._zod.values;if(a){n.value={};const l=new Set;for(const f of a)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){l.add(typeof f=="number"?f.toString():f);const m=t.valueType._zod.run({value:i[f],issues:[]},r);m instanceof Promise?o.push(m.then(h=>{h.issues.length&&n.issues.push(...Vo(f,h.issues)),n.value[f]=h.value})):(m.issues.length&&n.issues.push(...Vo(f,m.issues)),n.value[f]=m.value)}let d;for(const f in i)l.has(f)||(d=d??[],d.push(f));d&&d.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:d})}else{n.value={};for(const l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let d=t.keyType._zod.run({value:l,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&jj.test(l)&&d.issues.length){const h=t.keyType._zod.run({value:Number(l),issues:[]},r);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(d=h)}if(d.issues.length){t.mode==="loose"?n.value[l]=i[l]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(h=>Io(h,r,zr())),input:l,path:[l],inst:e});continue}const m=t.valueType._zod.run({value:i[l],issues:[]},r);m instanceof Promise?o.push(m.then(h=>{h.issues.length&&n.issues.push(...Vo(l,h.issues)),n.value[d.value]=h.value})):(m.issues.length&&n.issues.push(...Vo(l,m.issues)),n.value[d.value]=m.value)}}return o.length?Promise.all(o).then(()=>n):n}}),P5=ae("$ZodMap",(e,t)=>{ft.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,l]of i){const d=t.keyType._zod.run({value:a,issues:[]},r),f=t.valueType._zod.run({value:l,issues:[]},r);d instanceof Promise||f instanceof Promise?o.push(Promise.all([d,f]).then(([m,h])=>{D2(m,h,n,a,i,e,r)})):D2(d,f,n,a,i,e,r)}return o.length?Promise.all(o).then(()=>n):n}});function D2(e,t,n,r,i,o,a){e.issues.length&&(By.has(typeof r)?n.issues.push(...Vo(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:i,inst:o,issues:e.issues.map(l=>Io(l,a,zr()))})),t.issues.length&&(By.has(typeof r)?n.issues.push(...Vo(r,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:i,inst:o,key:r,issues:t.issues.map(l=>Io(l,a,zr()))})),n.value.set(e.value,t.value)}const M5=ae("$ZodSet",(e,t)=>{ft.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 l=t.valueType._zod.run({value:a,issues:[]},r);l instanceof Promise?o.push(l.then(d=>P2(d,n))):P2(l,n)}return o.length?Promise.all(o).then(()=>n):n}});function P2(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const z5=ae("$ZodEnum",(e,t)=>{ft.init(e,t);const n=mj(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>By.has(typeof i)).map(i=>typeof i=="string"?us(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}}),L5=ae("$ZodLiteral",(e,t)=>{if(ft.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?us(r):r?us(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,i)=>{const o=r.value;return n.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),F5=ae("$ZodFile",(e,t)=>{ft.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}}),U5=ae("$ZodTransform",(e,t)=>{ft.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new _x(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 Ic;return n.value=i,n}});function M2(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Pj=ae("$ZodOptional",(e,t)=>{ft.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ct(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ct(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Cx(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=>M2(o,n.value)):M2(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),V5=ae("$ZodExactOptional",(e,t)=>{Pj.init(e,t),Ct(e._zod,"values",()=>t.innerType._zod.values),Ct(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),B5=ae("$ZodNullable",(e,t)=>{ft.init(e,t),Ct(e._zod,"optin",()=>t.innerType._zod.optin),Ct(e._zod,"optout",()=>t.innerType._zod.optout),Ct(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Cx(n.source)}|null)$`):void 0}),Ct(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)}),H5=ae("$ZodDefault",(e,t)=>{ft.init(e,t),e._zod.optin="optional",Ct(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=>z2(o,t)):z2(i,t)}});function z2(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const q5=ae("$ZodPrefault",(e,t)=>{ft.init(e,t),e._zod.optin="optional",Ct(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))}),K5=ae("$ZodNonOptional",(e,t)=>{ft.init(e,t),Ct(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=>L2(o,e)):L2(i,e)}});function L2(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 G5=ae("$ZodSuccess",(e,t)=>{ft.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new _x("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)}}),Z5=ae("$ZodCatch",(e,t)=>{ft.init(e,t),Ct(e._zod,"optin",()=>t.innerType._zod.optin),Ct(e._zod,"optout",()=>t.innerType._zod.optout),Ct(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=>Io(a,r,zr()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(o=>Io(o,r,zr()))},input:n.value}),n.issues=[]),n)}}),Y5=ae("$ZodNaN",(e,t)=>{ft.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)}),W5=ae("$ZodPipe",(e,t)=>{ft.init(e,t),Ct(e._zod,"values",()=>t.in._zod.values),Ct(e._zod,"optin",()=>t.in._zod.optin),Ct(e._zod,"optout",()=>t.out._zod.optout),Ct(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=>_v(a,t.in,r)):_v(o,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(o=>_v(o,t.out,r)):_v(i,t.out,r)}});function _v(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Mj=ae("$ZodCodec",(e,t)=>{ft.init(e,t),Ct(e._zod,"values",()=>t.in._zod.values),Ct(e._zod,"optin",()=>t.in._zod.optin),Ct(e._zod,"optout",()=>t.out._zod.optout),Ct(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=>Cv(a,t,r)):Cv(o,t,r)}else{const o=t.out._zod.run(n,r);return o instanceof Promise?o.then(a=>Cv(a,t,r)):Cv(o,t,r)}}});function Cv(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=>kv(e,o,t.out,n)):kv(e,i,t.out,n)}else{const i=t.reverseTransform(e.value,e);return i instanceof Promise?i.then(o=>kv(e,o,t.in,n)):kv(e,i,t.in,n)}}function kv(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}const X5=ae("$ZodReadonly",(e,t)=>{ft.init(e,t),Ct(e._zod,"propValues",()=>t.innerType._zod.propValues),Ct(e._zod,"values",()=>t.innerType._zod.values),Ct(e._zod,"optin",()=>t.innerType?._zod?.optin),Ct(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(F2):F2(i)}});function F2(e){return e.value=Object.freeze(e.value),e}const J5=ae("$ZodTemplateLiteral",(e,t)=>{ft.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||_6.has(typeof r))n.push(us(`${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:"string",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)}),Q5=ae("$ZodFunction",(e,t)=>(ft.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?Hy(e._def.input,r):r,o=Reflect.apply(n,this,i);return e._def.output?Hy(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 qy(e._def.input,r):r,o=await Reflect.apply(n,this,i);return e._def.output?await qy(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 Dj({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)),eV=ae("$ZodPromise",(e,t)=>{ft.init(e,t),e._zod.parse=(n,r)=>Promise.resolve(n.value).then(i=>t.innerType._zod.run({value:i,issues:[]},r))}),tV=ae("$ZodLazy",(e,t)=>{ft.init(e,t),Ct(e._zod,"innerType",()=>t.getter()),Ct(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Ct(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Ct(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Ct(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),nV=ae("$ZodCustom",(e,t)=>{Nn.init(e,t),ft.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=>U2(o,n,r,e));U2(i,n,r,e)}});function U2(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(Kd(i))}}const oge=()=>{const e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(i){return e[i]??null}const n={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:"مدخل"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`مدخلات غير مقبولة: يفترض إدخال instanceof ${i.expected}، ولكن تم إدخال ${l}`:`مدخلات غير مقبولة: يفترض إدخال ${o}، ولكن تم إدخال ${l}`}case"invalid_value":return i.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${it(i.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${je(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}`:`${n[o.format]??i.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${i.divisor}`;case"unrecognized_keys":return`معرف${i.keys.length>1?"ات":""} غريب${i.keys.length>1?"ة":""}: ${je(i.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${i.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${i.origin}`;default:return"مدخل غير مقبول"}}};function age(){return{localeError:oge()}}const sge=()=>{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={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"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Yanlış dəyər: gözlənilən instanceof ${i.expected}, daxil olan ${l}`:`Yanlış dəyər: gözlənilən ${o}, daxil olan ${l}`}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: ${je(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ış ${n[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":""}: ${je(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 lge(){return{localeError:sge()}}function V2(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 cge=()=>{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={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:"увод"},r={nan:"NaN",number:"лік",array:"масіў"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Няправільны ўвод: чакаўся instanceof ${i.expected}, атрымана ${l}`:`Няправільны ўвод: чакаўся ${o}, атрымана ${l}`}case"invalid_value":return i.values.length===1?`Няправільны ўвод: чакалася ${it(i.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);if(a){const l=Number(i.maximum),d=V2(l,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 l=Number(i.minimum),d=V2(l,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}`:`Няправільны ${n[o.format]??i.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${i.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${i.keys.length>1?"ключы":"ключ"}: ${je(i.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${i.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${i.origin}`;default:return"Няправільны ўвод"}}};function uge(){return{localeError:cge()}}const dge=()=>{const e={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function t(i){return e[i]??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:"вход"},r={nan:"NaN",number:"число",array:"масив"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Невалиден вход: очакван instanceof ${i.expected}, получен ${l}`:`Невалиден вход: очакван ${o}, получен ${l}`}case"invalid_value":return i.values.length===1?`Невалиден вход: очакван ${it(i.values[0])}`:`Невалидна опция: очаквано едно от ${je(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;if(o.format==="starts_with")return`Невалиден низ: трябва да започва с "${o.prefix}"`;if(o.format==="ends_with")return`Невалиден низ: трябва да завършва с "${o.suffix}"`;if(o.format==="includes")return`Невалиден низ: трябва да включва "${o.includes}"`;if(o.format==="regex")return`Невалиден низ: трябва да съвпада с ${o.pattern}`;let a="Невалиден";return o.format==="emoji"&&(a="Невалидно"),o.format==="datetime"&&(a="Невалидно"),o.format==="date"&&(a="Невалидна"),o.format==="time"&&(a="Невалидно"),o.format==="duration"&&(a="Невалидна"),`${a} ${n[o.format]??i.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${i.divisor}`;case"unrecognized_keys":return`Неразпознат${i.keys.length>1?"и":""} ключ${i.keys.length>1?"ове":""}: ${je(i.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${i.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${i.origin}`;default:return"Невалиден вход"}}};function fge(){return{localeError:dge()}}const pge=()=>{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={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"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Tipus invàlid: s'esperava instanceof ${i.expected}, s'ha rebut ${l}`:`Tipus invàlid: s'esperava ${o}, s'ha rebut ${l}`}case"invalid_value":return i.values.length===1?`Valor invàlid: s'esperava ${it(i.values[0])}`:`Opció invàlida: s'esperava una de ${je(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 ${n[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":""}: ${je(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 mge(){return{localeError:pge()}}const hge=()=>{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={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"},r={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Neplatný vstup: očekáváno instanceof ${i.expected}, obdrženo ${l}`:`Neplatný vstup: očekáváno ${o}, obdrženo ${l}`}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 ${je(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 ${n[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: ${je(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 gge(){return{localeError:hge()}}const vge=()=>{const e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(i){return e[i]??null}const n={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"},r={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Ugyldigt input: forventede instanceof ${i.expected}, fik ${l}`:`Ugyldigt input: forventede ${o}, fik ${l}`}case"invalid_value":return i.values.length===1?`Ugyldig værdi: forventede ${it(i.values[0])}`:`Ugyldigt valg: forventede en af følgende ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin),l=r[i.origin]??i.origin;return a?`For stor: forventede ${l??"value"} ${a.verb} ${o} ${i.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${l??"value"} havde ${o} ${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin),l=r[i.origin]??i.origin;return a?`For lille: forventede ${l} ${a.verb} ${o} ${i.minimum.toString()} ${a.unit}`:`For lille: forventede ${l} havde ${o} ${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche mønsteret ${o.pattern}`:`Ugyldig ${n[o.format]??i.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${je(i.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${i.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${i.origin}`;default:return"Ugyldigt input"}}};function yge(){return{localeError:vge()}}const bge=()=>{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={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"},r={nan:"NaN",number:"Zahl",array:"Array"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Ungültige Eingabe: erwartet instanceof ${i.expected}, erhalten ${l}`:`Ungültige Eingabe: erwartet ${o}, erhalten ${l}`}case"invalid_value":return i.values.length===1?`Ungültige Eingabe: erwartet ${it(i.values[0])}`:`Ungültige Option: erwartet eine von ${je(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: ${n[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"}: ${je(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 xge(){return{localeError:bge()}}const wge=()=>{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"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??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",mac:"MAC 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"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return`Invalid input: expected ${o}, received ${l}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${it(i.values[0])}`:`Invalid option: expected one of ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Too big: expected ${i.origin??"value"} to have ${o}${i.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Too small: expected ${i.origin} to have ${o}${i.minimum.toString()} ${a.unit}`:`Too small: expected ${i.origin} to be ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${n[o.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${je(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function rV(){return{localeError:wge()}}const Sge=()=>{const e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(i){return e[i]??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"},r={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Nevalida enigo: atendiĝis instanceof ${i.expected}, riceviĝis ${l}`:`Nevalida enigo: atendiĝis ${o}, riceviĝis ${l}`}case"invalid_value":return i.values.length===1?`Nevalida enigo: atendiĝis ${it(i.values[0])}`:`Nevalida opcio: atendiĝis unu el ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Tro granda: atendiĝis ke ${i.origin??"valoro"} havu ${o}${i.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendiĝis ke ${i.origin??"valoro"} havu ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Tro malgranda: atendiĝis ke ${i.origin} havu ${o}${i.minimum.toString()} ${a.unit}`:`Tro malgranda: atendiĝis ke ${i.origin} estu ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Nevalida karaktraro: devas komenciĝi per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas finiĝi per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${n[o.format]??i.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} ŝlosilo${i.keys.length>1?"j":""}: ${je(i.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${i.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${i.origin}`;default:return"Nevalida enigo"}}};function _ge(){return{localeError:Sge()}}const Cge=()=>{const e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(i){return e[i]??null}const n={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"},r={nan:"NaN",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"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Entrada inválida: se esperaba instanceof ${i.expected}, recibido ${l}`:`Entrada inválida: se esperaba ${o}, recibido ${l}`}case"invalid_value":return i.values.length===1?`Entrada inválida: se esperaba ${it(i.values[0])}`:`Opción inválida: se esperaba una de ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin),l=r[i.origin]??i.origin;return a?`Demasiado grande: se esperaba que ${l??"valor"} tuviera ${o}${i.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${l??"valor"} fuera ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin),l=r[i.origin]??i.origin;return a?`Demasiado pequeño: se esperaba que ${l} tuviera ${o}${i.minimum.toString()} ${a.unit}`:`Demasiado pequeño: se esperaba que ${l} fuera ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Cadena inválida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inválida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inválida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${o.pattern}`:`Inválido ${n[o.format]??i.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${i.divisor}`;case"unrecognized_keys":return`Llave${i.keys.length>1?"s":""} desconocida${i.keys.length>1?"s":""}: ${je(i.keys,", ")}`;case"invalid_key":return`Llave inválida en ${r[i.origin]??i.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${r[i.origin]??i.origin}`;default:return"Entrada inválida"}}};function kge(){return{localeError:Cge()}}const Ege=()=>{const e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(i){return e[i]??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-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},r={nan:"NaN",number:"عدد",array:"آرایه"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`ورودی نامعتبر: می‌بایست instanceof ${i.expected} می‌بود، ${l} دریافت شد`:`ورودی نامعتبر: می‌بایست ${o} می‌بود، ${l} دریافت شد`}case"invalid_value":return i.values.length===1?`ورودی نامعتبر: می‌بایست ${it(i.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${je(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} مطابقت داشته باشد`:`${n[o.format]??i.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${i.divisor} باشد`;case"unrecognized_keys":return`کلید${i.keys.length>1?"های":""} ناشناس: ${je(i.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${i.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${i.origin}`;default:return"ورودی نامعتبر"}}};function jge(){return{localeError:Ege()}}const Rge=()=>{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={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"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Virheellinen tyyppi: odotettiin instanceof ${i.expected}, oli ${l}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${l}`}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: ${je(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 ${n[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"}: ${je(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 Ige(){return{localeError:Rge()}}const Tge=()=>{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={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"},r={nan:"NaN",number:"nombre",array:"tableau"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Entrée invalide : instanceof ${i.expected} attendu, ${l} reçu`:`Entrée invalide : ${o} attendu, ${l} reçu`}case"invalid_value":return i.values.length===1?`Entrée invalide : ${it(i.values[0])} attendu`:`Option invalide : une valeur parmi ${je(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}`:`${n[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":""} : ${je(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 Nge(){return{localeError:Tge()}}const Age=()=>{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={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"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Entrée invalide : attendu instanceof ${i.expected}, reçu ${l}`:`Entrée invalide : attendu ${o}, reçu ${l}`}case"invalid_value":return i.values.length===1?`Entrée invalide : attendu ${it(i.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${je(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}`:`${n[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":""} : ${je(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 Oge(){return{localeError:Age()}}const $ge=()=>{const e={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},t={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},n=f=>f?e[f]:void 0,r=f=>{const m=n(f);return m?m.label:f??e.unknown.label},i=f=>`ה${r(f)}`,o=f=>(n(f)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות",a=f=>f?t[f]??null:null,l={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},d={nan:"NaN"};return f=>{switch(f.code){case"invalid_type":{const m=f.expected,h=d[m??""]??r(m),v=st(f.input),y=d[v]??e[v]?.label??v;return/^[A-Z]/.test(f.expected)?`קלט לא תקין: צריך להיות instanceof ${f.expected}, התקבל ${y}`:`קלט לא תקין: צריך להיות ${h}, התקבל ${y}`}case"invalid_value":{if(f.values.length===1)return`ערך לא תקין: הערך חייב להיות ${it(f.values[0])}`;const m=f.values.map(y=>it(y));if(f.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${m[0]} או ${m[1]}`;const h=m[m.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${m.slice(0,-1).join(", ")} או ${h}`}case"too_big":{const m=a(f.origin),h=i(f.origin??"value");if(f.origin==="string")return`${m?.longLabel??"ארוך"} מדי: ${h} צריכה להכיל ${f.maximum.toString()} ${m?.unit??""} ${f.inclusive?"או פחות":"לכל היותר"}`.trim();if(f.origin==="number"){const x=f.inclusive?`קטן או שווה ל-${f.maximum}`:`קטן מ-${f.maximum}`;return`גדול מדי: ${h} צריך להיות ${x}`}if(f.origin==="array"||f.origin==="set"){const x=f.origin==="set"?"צריכה":"צריך",S=f.inclusive?`${f.maximum} ${m?.unit??""} או פחות`:`פחות מ-${f.maximum} ${m?.unit??""}`;return`גדול מדי: ${h} ${x} להכיל ${S}`.trim()}const v=f.inclusive?"<=":"<",y=o(f.origin??"value");return m?.unit?`${m.longLabel} מדי: ${h} ${y} ${v}${f.maximum.toString()} ${m.unit}`:`${m?.longLabel??"גדול"} מדי: ${h} ${y} ${v}${f.maximum.toString()}`}case"too_small":{const m=a(f.origin),h=i(f.origin??"value");if(f.origin==="string")return`${m?.shortLabel??"קצר"} מדי: ${h} צריכה להכיל ${f.minimum.toString()} ${m?.unit??""} ${f.inclusive?"או יותר":"לפחות"}`.trim();if(f.origin==="number"){const x=f.inclusive?`גדול או שווה ל-${f.minimum}`:`גדול מ-${f.minimum}`;return`קטן מדי: ${h} צריך להיות ${x}`}if(f.origin==="array"||f.origin==="set"){const x=f.origin==="set"?"צריכה":"צריך";if(f.minimum===1&&f.inclusive){const C=(f.origin==="set","לפחות פריט אחד");return`קטן מדי: ${h} ${x} להכיל ${C}`}const S=f.inclusive?`${f.minimum} ${m?.unit??""} או יותר`:`יותר מ-${f.minimum} ${m?.unit??""}`;return`קטן מדי: ${h} ${x} להכיל ${S}`.trim()}const v=f.inclusive?">=":">",y=o(f.origin??"value");return m?.unit?`${m.shortLabel} מדי: ${h} ${y} ${v}${f.minimum.toString()} ${m.unit}`:`${m?.shortLabel??"קטן"} מדי: ${h} ${y} ${v}${f.minimum.toString()}`}case"invalid_format":{const m=f;if(m.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${m.prefix}"`;if(m.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${m.suffix}"`;if(m.format==="includes")return`המחרוזת חייבת לכלול "${m.includes}"`;if(m.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${m.pattern}`;const h=l[m.format],v=h?.label??m.format,x=(h?.gender??"m")==="f"?"תקינה":"תקין";return`${v} לא ${x}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${f.divisor}`;case"unrecognized_keys":return`מפתח${f.keys.length>1?"ות":""} לא מזוה${f.keys.length>1?"ים":"ה"}: ${je(f.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${i(f.origin??"array")}`;default:return"קלט לא תקין"}}};function Dge(){return{localeError:$ge()}}const Pge=()=>{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={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"},r={nan:"NaN",number:"szám",array:"tömb"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Érvénytelen bemenet: a várt érték instanceof ${i.expected}, a kapott érték ${l}`:`Érvénytelen bemenet: a várt érték ${o}, a kapott érték ${l}`}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 ${je(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 ${n[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":""}: ${je(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 Mge(){return{localeError:Pge()}}function B2(e,t,n){return Math.abs(e)===1?t:n}function rd(e){if(!e)return"";const t=["ա","ե","ը","ի","ո","ու","օ"],n=e[e.length-1];return e+(t.includes(n)?"ն":"ը")}const zge=()=>{const e={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function t(i){return e[i]??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:"մուտք"},r={nan:"NaN",number:"թիվ",array:"զանգված"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Սխալ մուտքագրում․ սպասվում էր instanceof ${i.expected}, ստացվել է ${l}`:`Սխալ մուտքագրում․ սպասվում էր ${o}, ստացվել է ${l}`}case"invalid_value":return i.values.length===1?`Սխալ մուտքագրում․ սպասվում էր ${it(i.values[1])}`:`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);if(a){const l=Number(i.maximum),d=B2(l,a.unit.one,a.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${rd(i.origin??"արժեք")} կունենա ${o}${i.maximum.toString()} ${d}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${rd(i.origin??"արժեք")} լինի ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);if(a){const l=Number(i.minimum),d=B2(l,a.unit.one,a.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${rd(i.origin)} կունենա ${o}${i.minimum.toString()} ${d}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${rd(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} ձևաչափին`:`Սխալ ${n[o.format]??i.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${i.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${i.keys.length>1?"ներ":""}. ${je(i.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${rd(i.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${rd(i.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function Lge(){return{localeError:zge()}}const Fge=()=>{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={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"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Input tidak valid: diharapkan instanceof ${i.expected}, diterima ${l}`:`Input tidak valid: diharapkan ${o}, diterima ${l}`}case"invalid_value":return i.values.length===1?`Input tidak valid: diharapkan ${it(i.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${je(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}`:`${n[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":""}: ${je(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 Uge(){return{localeError:Fge()}}const Vge=()=>{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(i){return e[i]??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"},r={nan:"NaN",number:"númer",array:"fylki"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Rangt gildi: Þú slóst inn ${l} þar sem á að vera instanceof ${i.expected}`:`Rangt gildi: Þú slóst inn ${l} þar sem á að vera ${o}`}case"invalid_value":return i.values.length===1?`Rangt gildi: gert ráð fyrir ${it(i.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Of stórt: gert er ráð fyrir að ${i.origin??"gildi"} hafi ${o}${i.maximum.toString()} ${a.unit??"hluti"}`:`Of stórt: gert er ráð fyrir að ${i.origin??"gildi"} sé ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Of lítið: gert er ráð fyrir að ${i.origin} hafi ${o}${i.minimum.toString()} ${a.unit}`:`Of lítið: gert er ráð fyrir að ${i.origin} sé ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Ógildur strengur: verður að byrja á "${o.prefix}"`:o.format==="ends_with"?`Ógildur strengur: verður að enda á "${o.suffix}"`:o.format==="includes"?`Ógildur strengur: verður að innihalda "${o.includes}"`:o.format==="regex"?`Ógildur strengur: verður að fylgja mynstri ${o.pattern}`:`Rangt ${n[o.format]??i.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${i.divisor}`;case"unrecognized_keys":return`Óþekkt ${i.keys.length>1?"ir lyklar":"ur lykill"}: ${je(i.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${i.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${i.origin}`;default:return"Rangt gildi"}}};function Bge(){return{localeError:Vge()}}const Hge=()=>{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={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"},r={nan:"NaN",number:"numero",array:"vettore"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Input non valido: atteso instanceof ${i.expected}, ricevuto ${l}`:`Input non valido: atteso ${o}, ricevuto ${l}`}case"invalid_value":return i.values.length===1?`Input non valido: atteso ${it(i.values[0])}`:`Opzione non valida: atteso uno tra ${je(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 ${n[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"}: ${je(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 qge(){return{localeError:Hge()}}const Kge=()=>{const e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(i){return e[i]??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:"入力値"},r={nan:"NaN",number:"数値",array:"配列"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`無効な入力: instanceof ${i.expected}が期待されましたが、${l}が入力されました`:`無効な入力: ${o}が期待されましたが、${l}が入力されました`}case"invalid_value":return i.values.length===1?`無効な入力: ${it(i.values[0])}が期待されました`:`無効な選択: ${je(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}に一致する必要があります`:`無効な${n[o.format]??i.format}`}case"not_multiple_of":return`無効な数値: ${i.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${i.keys.length>1?"群":""}: ${je(i.keys,"、")}`;case"invalid_key":return`${i.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${i.origin}内の無効な値`;default:return"無効な入力"}}};function Gge(){return{localeError:Kge()}}const Zge=()=>{const e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function t(i){return e[i]??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:"შეყვანა"},r={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`არასწორი შეყვანა: მოსალოდნელი instanceof ${i.expected}, მიღებული ${l}`:`არასწორი შეყვანა: მოსალოდნელი ${o}, მიღებული ${l}`}case"invalid_value":return i.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${it(i.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${je(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}`:`არასწორი ${n[o.format]??i.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${i.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${i.keys.length>1?"ები":"ი"}: ${je(i.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${i.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${i.origin}-ში`;default:return"არასწორი შეყვანა"}}};function Yge(){return{localeError:Zge()}}const Wge=()=>{const e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(i){return e[i]??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:"ទិន្នន័យបញ្ចូល"},r={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${i.expected} ប៉ុន្តែទទួលបាន ${l}`:`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${o} ប៉ុន្តែទទួលបាន ${l}`}case"invalid_value":return i.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${it(i.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${je(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}`:`មិនត្រឹមត្រូវ៖ ${n[o.format]??i.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${i.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${je(i.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${i.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${i.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function iV(){return{localeError:Wge()}}function Xge(){return iV()}const Jge=()=>{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={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:"입력"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`잘못된 입력: 예상 타입은 instanceof ${i.expected}, 받은 타입은 ${l}입니다`:`잘못된 입력: 예상 타입은 ${o}, 받은 타입은 ${l}입니다`}case"invalid_value":return i.values.length===1?`잘못된 입력: 값은 ${it(i.values[0])} 이어야 합니다`:`잘못된 옵션: ${je(i.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{const o=i.inclusive?"이하":"미만",a=o==="미만"?"이어야 합니다":"여야 합니다",l=t(i.origin),d=l?.unit??"요소";return l?`${i.origin??"값"}이 너무 큽니다: ${i.maximum.toString()}${d} ${o}${a}`:`${i.origin??"값"}이 너무 큽니다: ${i.maximum.toString()} ${o}${a}`}case"too_small":{const o=i.inclusive?"이상":"초과",a=o==="이상"?"이어야 합니다":"여야 합니다",l=t(i.origin),d=l?.unit??"요소";return l?`${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} 패턴과 일치해야 합니다`:`잘못된 ${n[o.format]??i.format}`}case"not_multiple_of":return`잘못된 숫자: ${i.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${je(i.keys,", ")}`;case"invalid_key":return`잘못된 키: ${i.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${i.origin}`;default:return"잘못된 입력"}}};function Qge(){return{localeError:Jge()}}const Mp=e=>e.charAt(0).toUpperCase()+e.slice(1);function H2(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 eve=()=>{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(i,o,a,l){const d=e[i]??null;return d===null?d:{unit:d.unit[o],verb:d.verb[l][a?"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"},r={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Gautas tipas ${l}, o tikėtasi - instanceof ${i.expected}`:`Gautas tipas ${l}, o tikėtasi - ${o}`}case"invalid_value":return i.values.length===1?`Privalo būti ${it(i.values[0])}`:`Privalo būti vienas iš ${je(i.values,"|")} pasirinkimų`;case"too_big":{const o=r[i.origin]??i.origin,a=t(i.origin,H2(Number(i.maximum)),i.inclusive??!1,"smaller");if(a?.verb)return`${Mp(o??i.origin??"reikšmė")} ${a.verb} ${i.maximum.toString()} ${a.unit??"elementų"}`;const l=i.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${Mp(o??i.origin??"reikšmė")} turi būti ${l} ${i.maximum.toString()} ${a?.unit}`}case"too_small":{const o=r[i.origin]??i.origin,a=t(i.origin,H2(Number(i.minimum)),i.inclusive??!1,"bigger");if(a?.verb)return`${Mp(o??i.origin??"reikšmė")} ${a.verb} ${i.minimum.toString()} ${a.unit??"elementų"}`;const l=i.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${Mp(o??i.origin??"reikšmė")} turi būti ${l} ${i.minimum.toString()} ${a?.unit}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Eilutė privalo prasidėti "${o.prefix}"`:o.format==="ends_with"?`Eilutė privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilutė privalo įtraukti "${o.includes}"`:o.format==="regex"?`Eilutė privalo atitikti ${o.pattern}`:`Neteisingas ${n[o.format]??i.format}`}case"not_multiple_of":return`Skaičius privalo būti ${i.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${i.keys.length>1?"i":"as"} rakt${i.keys.length>1?"ai":"as"}: ${je(i.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{const o=r[i.origin]??i.origin;return`${Mp(o??i.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function tve(){return{localeError:eve()}}const nve=()=>{const e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(i){return e[i]??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:"внес"},r={nan:"NaN",number:"број",array:"низа"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Грешен внес: се очекува instanceof ${i.expected}, примено ${l}`:`Грешен внес: се очекува ${o}, примено ${l}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${it(i.values[0])}`:`Грешана опција: се очекува една ${je(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 ${n[o.format]??i.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${je(i.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${i.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${i.origin}`;default:return"Грешен внес"}}};function rve(){return{localeError:nve()}}const ive=()=>{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={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"},r={nan:"NaN",number:"nombor"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Input tidak sah: dijangka instanceof ${i.expected}, diterima ${l}`:`Input tidak sah: dijangka ${o}, diterima ${l}`}case"invalid_value":return i.values.length===1?`Input tidak sah: dijangka ${it(i.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${je(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}`:`${n[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: ${je(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 ove(){return{localeError:ive()}}const ave=()=>{const e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(i){return e[i]??null}const n={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"},r={nan:"NaN",number:"getal"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Ongeldige invoer: verwacht instanceof ${i.expected}, ontving ${l}`:`Ongeldige invoer: verwacht ${o}, ontving ${l}`}case"invalid_value":return i.values.length===1?`Ongeldige invoer: verwacht ${it(i.values[0])}`:`Ongeldige optie: verwacht één van ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin),l=i.origin==="date"?"laat":i.origin==="string"?"lang":"groot";return a?`Te ${l}: verwacht dat ${i.origin??"waarde"} ${o}${i.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${l}: verwacht dat ${i.origin??"waarde"} ${o}${i.maximum.toString()} is`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin),l=i.origin==="date"?"vroeg":i.origin==="string"?"kort":"klein";return a?`Te ${l}: verwacht dat ${i.origin} ${o}${i.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${l}: 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: ${n[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":""}: ${je(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 sve(){return{localeError:ave()}}const lve=()=>{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={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"},r={nan:"NaN",number:"tall",array:"liste"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Ugyldig input: forventet instanceof ${i.expected}, fikk ${l}`:`Ugyldig input: forventet ${o}, fikk ${l}`}case"invalid_value":return i.values.length===1?`Ugyldig verdi: forventet ${it(i.values[0])}`:`Ugyldig valg: forventet en av ${je(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 ${n[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"}: ${je(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 cve(){return{localeError:lve()}}const uve=()=>{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={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"},r={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Fâsit giren: umulan instanceof ${i.expected}, alınan ${l}`:`Fâsit giren: umulan ${o}, alınan ${l}`}case"invalid_value":return i.values.length===1?`Fâsit giren: umulan ${it(i.values[0])}`:`Fâsit tercih: mûteberler ${je(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 ${n[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":""}: ${je(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 dve(){return{localeError:uve()}}const fve=()=>{const e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(i){return e[i]??null}const n={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:"ورودي"},r={nan:"NaN",number:"عدد",array:"ارې"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`ناسم ورودي: باید instanceof ${i.expected} وای, مګر ${l} ترلاسه شو`:`ناسم ورودي: باید ${o} وای, مګر ${l} ترلاسه شو`}case"invalid_value":return i.values.length===1?`ناسم ورودي: باید ${it(i.values[0])} وای`:`ناسم انتخاب: باید یو له ${je(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} سره مطابقت ولري`:`${n[o.format]??i.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${i.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${i.keys.length>1?"کلیډونه":"کلیډ"}: ${je(i.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${i.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${i.origin} کې`;default:return"ناسمه ورودي"}}};function pve(){return{localeError:fve()}}const mve=()=>{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={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"},r={nan:"NaN",number:"liczba",array:"tablica"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${i.expected}, otrzymano ${l}`:`Nieprawidłowe dane wejściowe: oczekiwano ${o}, otrzymano ${l}`}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 ${je(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) ${n[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":""}: ${je(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 hve(){return{localeError:mve()}}const gve=()=>{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={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"},r={nan:"NaN",number:"número",null:"nulo"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Tipo inválido: esperado instanceof ${i.expected}, recebido ${l}`:`Tipo inválido: esperado ${o}, recebido ${l}`}case"invalid_value":return i.values.length===1?`Entrada inválida: esperado ${it(i.values[0])}`:`Opção inválida: esperada uma das ${je(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}`:`${n[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":""}: ${je(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 vve(){return{localeError:gve()}}function q2(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 yve=()=>{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={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:"ввод"},r={nan:"NaN",number:"число",array:"массив"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Неверный ввод: ожидалось instanceof ${i.expected}, получено ${l}`:`Неверный ввод: ожидалось ${o}, получено ${l}`}case"invalid_value":return i.values.length===1?`Неверный ввод: ожидалось ${it(i.values[0])}`:`Неверный вариант: ожидалось одно из ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);if(a){const l=Number(i.maximum),d=q2(l,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 l=Number(i.minimum),d=q2(l,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}`:`Неверный ${n[o.format]??i.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${i.divisor}`;case"unrecognized_keys":return`Нераспознанн${i.keys.length>1?"ые":"ый"} ключ${i.keys.length>1?"и":""}: ${je(i.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${i.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${i.origin}`;default:return"Неверные входные данные"}}};function bve(){return{localeError:yve()}}const xve=()=>{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={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"},r={nan:"NaN",number:"število",array:"tabela"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Neveljaven vnos: pričakovano instanceof ${i.expected}, prejeto ${l}`:`Neveljaven vnos: pričakovano ${o}, prejeto ${l}`}case"invalid_value":return i.values.length===1?`Neveljaven vnos: pričakovano ${it(i.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${je(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 ${n[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č"}: ${je(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 wve(){return{localeError:xve()}}const Sve=()=>{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={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"},r={nan:"NaN",number:"antal",array:"lista"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Ogiltig inmatning: förväntat instanceof ${i.expected}, fick ${l}`:`Ogiltig inmatning: förväntat ${o}, fick ${l}`}case"invalid_value":return i.values.length===1?`Ogiltig inmatning: förväntat ${it(i.values[0])}`:`Ogiltigt val: förväntade en av ${je(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) ${n[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"}: ${je(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 _ve(){return{localeError:Sve()}}const Cve=()=>{const e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(i){return e[i]??null}const n={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"},r={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${i.expected}, பெறப்பட்டது ${l}`:`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${o}, பெறப்பட்டது ${l}`}case"invalid_value":return i.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${it(i.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${je(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} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${n[o.format]??i.format}`}case"not_multiple_of":return`தவறான எண்: ${i.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${i.keys.length>1?"கள்":""}: ${je(i.keys,", ")}`;case"invalid_key":return`${i.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${i.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function kve(){return{localeError:Cve()}}const Eve=()=>{const e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(i){return e[i]??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:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},r={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${i.expected} แต่ได้รับ ${l}`:`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${o} แต่ได้รับ ${l}`}case"invalid_value":return i.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${it(i.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${je(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}`:`รูปแบบไม่ถูกต้อง: ${n[o.format]??i.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${i.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${je(i.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${i.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${i.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function jve(){return{localeError:Eve()}}const Rve=()=>{const e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(i){return e[i]??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"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Geçersiz değer: beklenen instanceof ${i.expected}, alınan ${l}`:`Geçersiz değer: beklenen ${o}, alınan ${l}`}case"invalid_value":return i.values.length===1?`Geçersiz değer: beklenen ${it(i.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Çok büyük: beklenen ${i.origin??"değer"} ${o}${i.maximum.toString()} ${a.unit??"öğe"}`:`Çok büyük: beklenen ${i.origin??"değer"} ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Çok küçük: beklenen ${i.origin} ${o}${i.minimum.toString()} ${a.unit}`:`Çok küçük: beklenen ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Geçersiz metin: "${o.prefix}" ile başlamalı`:o.format==="ends_with"?`Geçersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Geçersiz metin: "${o.includes}" içermeli`:o.format==="regex"?`Geçersiz metin: ${o.pattern} desenine uymalı`:`Geçersiz ${n[o.format]??i.format}`}case"not_multiple_of":return`Geçersiz sayı: ${i.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${i.keys.length>1?"lar":""}: ${je(i.keys,", ")}`;case"invalid_key":return`${i.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${i.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function Ive(){return{localeError:Rve()}}const Tve=()=>{const e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(i){return e[i]??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:"вхідні дані"},r={nan:"NaN",number:"число",array:"масив"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Неправильні вхідні дані: очікується instanceof ${i.expected}, отримано ${l}`:`Неправильні вхідні дані: очікується ${o}, отримано ${l}`}case"invalid_value":return i.values.length===1?`Неправильні вхідні дані: очікується ${it(i.values[0])}`:`Неправильна опція: очікується одне з ${je(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}`:`Неправильний ${n[o.format]??i.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${i.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${i.keys.length>1?"і":""}: ${je(i.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${i.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${i.origin}`;default:return"Неправильні вхідні дані"}}};function oV(){return{localeError:Tve()}}function Nve(){return oV()}const Ave=()=>{const e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(i){return e[i]??null}const n={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:"ان پٹ"},r={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`غلط ان پٹ: instanceof ${i.expected} متوقع تھا، ${l} موصول ہوا`:`غلط ان پٹ: ${o} متوقع تھا، ${l} موصول ہوا`}case"invalid_value":return i.values.length===1?`غلط ان پٹ: ${it(i.values[0])} متوقع تھا`:`غلط آپشن: ${je(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} سے میچ ہونا چاہیے`:`غلط ${n[o.format]??i.format}`}case"not_multiple_of":return`غلط نمبر: ${i.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${i.keys.length>1?"ز":""}: ${je(i.keys,"، ")}`;case"invalid_key":return`${i.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${i.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function Ove(){return{localeError:Ave()}}const $ve=()=>{const e={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function t(i){return e[i]??null}const n={regex:"kirish",email:"elektron pochta manzili",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 sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},r={nan:"NaN",number:"raqam",array:"massiv"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Noto‘g‘ri kirish: kutilgan instanceof ${i.expected}, qabul qilingan ${l}`:`Noto‘g‘ri kirish: kutilgan ${o}, qabul qilingan ${l}`}case"invalid_value":return i.values.length===1?`Noto‘g‘ri kirish: kutilgan ${it(i.values[0])}`:`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Juda katta: kutilgan ${i.origin??"qiymat"} ${o}${i.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${i.origin??"qiymat"} ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Juda kichik: kutilgan ${i.origin} ${o}${i.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Noto‘g‘ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto‘g‘ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto‘g‘ri satr: "${o.includes}" ni o‘z ichiga olishi kerak`:o.format==="regex"?`Noto‘g‘ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto‘g‘ri ${n[o.format]??i.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${i.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${i.keys.length>1?"lar":""}: ${je(i.keys,", ")}`;case"invalid_key":return`${i.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${i.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function Dve(){return{localeError:$ve()}}const Pve=()=>{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={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"},r={nan:"NaN",number:"số",array:"mảng"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Đầu vào không hợp lệ: mong đợi instanceof ${i.expected}, nhận được ${l}`:`Đầu vào không hợp lệ: mong đợi ${o}, nhận được ${l}`}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ị ${je(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}`:`${n[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: ${je(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 Mve(){return{localeError:Pve()}}const zve=()=>{const e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(i){return e[i]??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:"输入"},r={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`无效输入:期望 instanceof ${i.expected},实际接收 ${l}`:`无效输入:期望 ${o},实际接收 ${l}`}case"invalid_value":return i.values.length===1?`无效输入:期望 ${it(i.values[0])}`:`无效选项:期望以下之一 ${je(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}`:`无效${n[o.format]??i.format}`}case"not_multiple_of":return`无效数字:必须是 ${i.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${je(i.keys,", ")}`;case"invalid_key":return`${i.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${i.origin} 中包含无效值(value)`;default:return"无效输入"}}};function Lve(){return{localeError:zve()}}const Fve=()=>{const e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(i){return e[i]??null}const n={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:"輸入"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`無效的輸入值:預期為 instanceof ${i.expected},但收到 ${l}`:`無效的輸入值:預期為 ${o},但收到 ${l}`}case"invalid_value":return i.values.length===1?`無效的輸入值:預期為 ${it(i.values[0])}`:`無效的選項:預期為以下其中之一 ${je(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}`:`無效的 ${n[o.format]??i.format}`}case"not_multiple_of":return`無效的數字:必須為 ${i.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${i.keys.length>1?"們":""}:${je(i.keys,"、")}`;case"invalid_key":return`${i.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${i.origin} 中有無效的值`;default:return"無效的輸入值"}}};function Uve(){return{localeError:Fve()}}const Vve=()=>{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={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é"},r={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${i.expected}, àmọ̀ a rí ${l}`:`Ìbáwọlé aṣìṣe: a ní láti fi ${o}, àmọ̀ a rí ${l}`}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 ${je(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: ${n[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ọ̀: ${je(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 Bve(){return{localeError:Vve()}}const aV=Object.freeze(Object.defineProperty({__proto__:null,ar:age,az:lge,be:uge,bg:fge,ca:mge,cs:gge,da:yge,de:xge,en:rV,eo:_ge,es:kge,fa:jge,fi:Ige,fr:Nge,frCA:Oge,he:Dge,hu:Mge,hy:Lge,id:Uge,is:Bge,it:qge,ja:Gge,ka:Yge,kh:Xge,km:iV,ko:Qge,lt:tve,mk:rve,ms:ove,nl:sve,no:cve,ota:dve,pl:hve,ps:pve,pt:vve,ru:bve,sl:wve,sv:_ve,ta:kve,th:jve,tr:Ive,ua:Nve,uk:oV,ur:Ove,uz:Dve,vi:Mve,yo:Bve,zhCN:Lve,zhTW:Uve},Symbol.toStringTag,{value:"Module"}));var K2;const sV=Symbol("ZodOutput"),lV=Symbol("ZodInput");class cV{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),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 zj(){return new cV}(K2=globalThis).__zod_globalRegistry??(K2.__zod_globalRegistry=zj());const ko=globalThis.__zod_globalRegistry;function uV(e,t){return new e({type:"string",...Ce(t)})}function dV(e,t){return new e({type:"string",coerce:!0,...Ce(t)})}function Lj(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ce(t)})}function Gy(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ce(t)})}function Fj(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ce(t)})}function Uj(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ce(t)})}function Vj(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ce(t)})}function Bj(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ce(t)})}function Tx(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ce(t)})}function Hj(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ce(t)})}function qj(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ce(t)})}function Kj(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ce(t)})}function Gj(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ce(t)})}function Zj(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ce(t)})}function Yj(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ce(t)})}function Wj(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ce(t)})}function Xj(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ce(t)})}function Jj(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ce(t)})}function fV(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...Ce(t)})}function Qj(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ce(t)})}function eR(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ce(t)})}function tR(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ce(t)})}function nR(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ce(t)})}function rR(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ce(t)})}function iR(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ce(t)})}const pV={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function mV(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ce(t)})}function hV(e,t){return new e({type:"string",format:"date",check:"string_format",...Ce(t)})}function gV(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ce(t)})}function vV(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ce(t)})}function yV(e,t){return new e({type:"number",checks:[],...Ce(t)})}function bV(e,t){return new e({type:"number",coerce:!0,checks:[],...Ce(t)})}function xV(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ce(t)})}function wV(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...Ce(t)})}function SV(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...Ce(t)})}function _V(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...Ce(t)})}function CV(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...Ce(t)})}function kV(e,t){return new e({type:"boolean",...Ce(t)})}function EV(e,t){return new e({type:"boolean",coerce:!0,...Ce(t)})}function jV(e,t){return new e({type:"bigint",...Ce(t)})}function RV(e,t){return new e({type:"bigint",coerce:!0,...Ce(t)})}function IV(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Ce(t)})}function TV(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Ce(t)})}function NV(e,t){return new e({type:"symbol",...Ce(t)})}function AV(e,t){return new e({type:"undefined",...Ce(t)})}function OV(e,t){return new e({type:"null",...Ce(t)})}function $V(e){return new e({type:"any"})}function DV(e){return new e({type:"unknown"})}function PV(e,t){return new e({type:"never",...Ce(t)})}function MV(e,t){return new e({type:"void",...Ce(t)})}function zV(e,t){return new e({type:"date",...Ce(t)})}function LV(e,t){return new e({type:"date",coerce:!0,...Ce(t)})}function FV(e,t){return new e({type:"nan",...Ce(t)})}function wl(e,t){return new Ij({check:"less_than",...Ce(t),value:e,inclusive:!1})}function jo(e,t){return new Ij({check:"less_than",...Ce(t),value:e,inclusive:!0})}function Sl(e,t){return new Tj({check:"greater_than",...Ce(t),value:e,inclusive:!1})}function wi(e,t){return new Tj({check:"greater_than",...Ce(t),value:e,inclusive:!0})}function oR(e){return Sl(0,e)}function aR(e){return wl(0,e)}function sR(e){return jo(0,e)}function lR(e){return wi(0,e)}function Zd(e,t){return new C3({check:"multiple_of",...Ce(t),value:e})}function Sf(e,t){return new j3({check:"max_size",...Ce(t),maximum:e})}function _l(e,t){return new R3({check:"min_size",...Ce(t),minimum:e})}function hh(e,t){return new I3({check:"size_equals",...Ce(t),size:e})}function gh(e,t){return new T3({check:"max_length",...Ce(t),maximum:e})}function Lc(e,t){return new N3({check:"min_length",...Ce(t),minimum:e})}function vh(e,t){return new A3({check:"length_equals",...Ce(t),length:e})}function Nx(e,t){return new O3({check:"string_format",format:"regex",...Ce(t),pattern:e})}function Ax(e){return new $3({check:"string_format",format:"lowercase",...Ce(e)})}function Ox(e){return new D3({check:"string_format",format:"uppercase",...Ce(e)})}function $x(e,t){return new P3({check:"string_format",format:"includes",...Ce(t),includes:e})}function Dx(e,t){return new M3({check:"string_format",format:"starts_with",...Ce(t),prefix:e})}function Px(e,t){return new z3({check:"string_format",format:"ends_with",...Ce(t),suffix:e})}function cR(e,t,n){return new L3({check:"property",property:e,schema:t,...Ce(n)})}function Mx(e,t){return new F3({check:"mime_type",mime:e,...Ce(t)})}function gs(e){return new U3({check:"overwrite",tx:e})}function zx(e){return gs(t=>t.normalize(e))}function Lx(){return gs(e=>e.trim())}function Fx(){return gs(e=>e.toLowerCase())}function Ux(){return gs(e=>e.toUpperCase())}function Vx(){return gs(e=>w6(e))}function UV(e,t,n){return new e({type:"array",element:t,...Ce(n)})}function Hve(e,t,n){return new e({type:"union",options:t,...Ce(n)})}function qve(e,t,n){return new e({type:"union",options:t,inclusive:!1,...Ce(n)})}function Kve(e,t,n,r){return new e({type:"union",options:n,discriminator:t,...Ce(r)})}function Gve(e,t,n){return new e({type:"intersection",left:t,right:n})}function Zve(e,t,n,r){const i=n instanceof ft,o=i?r:n,a=i?n:null;return new e({type:"tuple",items:t,rest:a,...Ce(o)})}function Yve(e,t,n,r){return new e({type:"record",keyType:t,valueType:n,...Ce(r)})}function Wve(e,t,n,r){return new e({type:"map",keyType:t,valueType:n,...Ce(r)})}function Xve(e,t,n){return new e({type:"set",valueType:t,...Ce(n)})}function Jve(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 Qve(e,t,n){return new e({type:"enum",entries:t,...Ce(n)})}function eye(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...Ce(n)})}function VV(e,t){return new e({type:"file",...Ce(t)})}function tye(e,t){return new e({type:"transform",transform:t})}function nye(e,t){return new e({type:"optional",innerType:t})}function rye(e,t){return new e({type:"nullable",innerType:t})}function iye(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():kx(n)}})}function oye(e,t,n){return new e({type:"nonoptional",innerType:t,...Ce(n)})}function aye(e,t){return new e({type:"success",innerType:t})}function sye(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:()=>n})}function lye(e,t,n){return new e({type:"pipe",in:t,out:n})}function cye(e,t){return new e({type:"readonly",innerType:t})}function uye(e,t,n){return new e({type:"template_literal",parts:t,...Ce(n)})}function dye(e,t){return new e({type:"lazy",getter:t})}function fye(e,t){return new e({type:"promise",innerType:t})}function BV(e,t,n){const r=Ce(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function HV(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ce(n)})}function qV(e){const t=KV(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Kd(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(Kd(i))}},e(n.value,n)));return t}function KV(e,t){const n=new Nn({check:"custom",...Ce(t)});return n._zod.check=e,n}function GV(e){const t=new Nn({check:"describe"});return t._zod.onattach=[n=>{const r=ko.get(n)??{};ko.add(n,{...r,description:e})}],t._zod.check=()=>{},t}function ZV(e){const t=new Nn({check:"meta"});return t._zod.onattach=[n=>{const r=ko.get(n)??{};ko.add(n,{...r,...e})}],t._zod.check=()=>{},t}function YV(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),l=e.Codec??Mj,d=e.Boolean??Oj,f=e.String??mh,m=new f({type:"string",error:n.error}),h=new d({type:"boolean",error:n.error}),v=new l({type:"pipe",in:m,out:h,transform:((y,x)=>{let S=y;return n.case!=="sensitive"&&(S=S.toLowerCase()),o.has(S)?!0:a.has(S)?!1:(x.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:x.value,inst:v,continue:!1}),{})}),reverseTransform:((y,x)=>y===!0?r[0]||"true":i[0]||"false"),error:n.error});return v}function yh(e,t,n,r={}){const i=Ce(r),o={...Ce(r),check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:l=>n.test(l),...i};return n instanceof RegExp&&(o.pattern=n),new e(o)}function Yd(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ko,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function cn(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;const a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a);const l=e._zod.toJSONSchema?.();if(l)a.schema=l;else{const m={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,m);else{const v=a.schema,y=t.processors[i.type];if(!y)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);y(e,t,v,m)}const h=e._zod.parent;h&&(a.ref||(a.ref=h),cn(h,t,m),t.seen.get(h).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(a.schema,d),t.io==="input"&&Kr(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function Wd(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const a of e.seen.entries()){const l=e.metadataRegistry.get(a[0])?.id;if(l){const d=r.get(l);if(d&&d!==a[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(l,a[0])}}const i=a=>{const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const h=e.external.registry.get(a[0])?.id,v=e.external.uri??(x=>x);if(h)return{ref:v(h)};const y=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=y,{defId:y,ref:`${v("__shared")}#/${l}/${y}`}}if(a[1]===n)return{ref:"#"};const f=`#/${l}/`,m=a[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:f+m}},o=a=>{if(a[1].schema.$ref)return;const l=a[1],{ref:d,defId:f}=i(a);l.def={...l.schema},f&&(l.defId=f);const m=l.schema;for(const h in m)delete m[h];m.$ref=d};if(e.cycles==="throw")for(const a of e.seen.entries()){const l=a[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/<root>
84
-
85
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of e.seen.entries()){const l=a[1];if(t===a[0]){o(a);continue}if(e.external){const f=e.external.registry.get(a[0])?.id;if(t!==a[0]&&f){o(a);continue}}if(e.metadataRegistry.get(a[0])?.id){o(a);continue}if(l.cycle){o(a);continue}if(l.count>1&&e.reused==="ref"){o(a);continue}}}function Xd(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=a=>{const l=e.seen.get(a);if(l.ref===null)return;const d=l.def??l.schema,f={...d},m=l.ref;if(l.ref=null,m){r(m);const v=e.seen.get(m),y=v.schema;if(y.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(y)):Object.assign(d,y),Object.assign(d,f),a._zod.parent===m)for(const S in d)S==="$ref"||S==="allOf"||S in f||delete d[S];if(y.$ref&&v.def)for(const S in d)S==="$ref"||S==="allOf"||S in v.def&&JSON.stringify(d[S])===JSON.stringify(v.def[S])&&delete d[S]}const h=a._zod.parent;if(h&&h!==m){r(h);const v=e.seen.get(h);if(v?.schema.$ref&&(d.$ref=v.schema.$ref,v.def))for(const y in d)y==="$ref"||y==="allOf"||y in v.def&&JSON.stringify(d[y])===JSON.stringify(v.def[y])&&delete d[y]}e.override({zodSchema:a,jsonSchema:d,path:l.path??[]})};for(const a of[...e.seen.entries()].reverse())r(a[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(a)}Object.assign(i,n.def??n.schema);const o=e.external?.defs??{};for(const a of e.seen.entries()){const l=a[1];l.def&&l.defId&&(o[l.defId]=l.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{const a=JSON.parse(JSON.stringify(i));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Cm(t,"input",e.processors),output:Cm(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Kr(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Kr(r.element,n);if(r.type==="set")return Kr(r.valueType,n);if(r.type==="lazy")return Kr(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Kr(r.innerType,n);if(r.type==="intersection")return Kr(r.left,n)||Kr(r.right,n);if(r.type==="record"||r.type==="map")return Kr(r.keyType,n)||Kr(r.valueType,n);if(r.type==="pipe")return Kr(r.in,n)||Kr(r.out,n);if(r.type==="object"){for(const i in r.shape)if(Kr(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(Kr(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(Kr(i,n))return!0;return!!(r.rest&&Kr(r.rest,n))}return!1}const WV=(e,t={})=>n=>{const r=Yd({...n,processors:t});return cn(e,r),Wd(r,e),Xd(r,e)},Cm=(e,t,n={})=>r=>{const{libraryOptions:i,target:o}=r??{},a=Yd({...i??{},target:o,io:t,processors:n});return cn(e,a),Wd(a,e),Xd(a,e)},pye={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},XV=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:o,maximum:a,format:l,patterns:d,contentEncoding:f}=e._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof a=="number"&&(i.maxLength=a),l&&(i.format=pye[l]??l,i.format===""&&delete i.format,l==="time"&&delete i.format),f&&(i.contentEncoding=f),d&&d.size>0){const m=[...d];m.length===1?i.pattern=m[0].source:m.length>1&&(i.allOf=[...m.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},JV=(e,t,n,r)=>{const i=n,{minimum:o,maximum:a,format:l,multipleOf:d,exclusiveMaximum:f,exclusiveMinimum:m}=e._zod.bag;typeof l=="string"&&l.includes("int")?i.type="integer":i.type="number",typeof m=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=m,i.exclusiveMinimum=!0):i.exclusiveMinimum=m),typeof o=="number"&&(i.minimum=o,typeof m=="number"&&t.target!=="draft-04"&&(m>=o?delete i.minimum:delete i.exclusiveMinimum)),typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=f,i.exclusiveMaximum=!0):i.exclusiveMaximum=f),typeof a=="number"&&(i.maximum=a,typeof f=="number"&&t.target!=="draft-04"&&(f<=a?delete i.maximum:delete i.exclusiveMaximum)),typeof d=="number"&&(i.multipleOf=d)},QV=(e,t,n,r)=>{n.type="boolean"},eB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},tB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},nB=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},rB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},iB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},oB=(e,t,n,r)=>{n.not={}},aB=(e,t,n,r)=>{},sB=(e,t,n,r)=>{},lB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},cB=(e,t,n,r)=>{const i=e._zod.def,o=mj(i.entries);o.every(a=>typeof a=="number")&&(n.type="number"),o.every(a=>typeof a=="string")&&(n.type="string"),n.enum=o},uB=(e,t,n,r)=>{const i=e._zod.def,o=[];for(const a of i.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(a))}else o.push(a);if(o.length!==0)if(o.length===1){const a=o[0];n.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[a]:n.const=a}else o.every(a=>typeof a=="number")&&(n.type="number"),o.every(a=>typeof a=="string")&&(n.type="string"),o.every(a=>typeof a=="boolean")&&(n.type="boolean"),o.every(a=>a===null)&&(n.type="null"),n.enum=o},dB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},fB=(e,t,n,r)=>{const i=n,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=o.source},pB=(e,t,n,r)=>{const i=n,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:l,mime:d}=e._zod.bag;a!==void 0&&(o.minLength=a),l!==void 0&&(o.maxLength=l),d?d.length===1?(o.contentMediaType=d[0],Object.assign(i,o)):(Object.assign(i,o),i.anyOf=d.map(f=>({contentMediaType:f}))):Object.assign(i,o)},mB=(e,t,n,r)=>{n.type="boolean"},hB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},gB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},vB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},yB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},bB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},xB=(e,t,n,r)=>{const i=n,o=e._zod.def,{minimum:a,maximum:l}=e._zod.bag;typeof a=="number"&&(i.minItems=a),typeof l=="number"&&(i.maxItems=l),i.type="array",i.items=cn(o.element,t,{...r,path:[...r.path,"items"]})},wB=(e,t,n,r)=>{const i=n,o=e._zod.def;i.type="object",i.properties={};const a=o.shape;for(const f in a)i.properties[f]=cn(a[f],t,{...r,path:[...r.path,"properties",f]});const l=new Set(Object.keys(a)),d=new Set([...l].filter(f=>{const m=o.shape[f]._zod;return t.io==="input"?m.optin===void 0:m.optout===void 0}));d.size>0&&(i.required=Array.from(d)),o.catchall?._zod.def.type==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=cn(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},uR=(e,t,n,r)=>{const i=e._zod.def,o=i.inclusive===!1,a=i.options.map((l,d)=>cn(l,t,{...r,path:[...r.path,o?"oneOf":"anyOf",d]}));o?n.oneOf=a:n.anyOf=a},SB=(e,t,n,r)=>{const i=e._zod.def,o=cn(i.left,t,{...r,path:[...r.path,"allOf",0]}),a=cn(i.right,t,{...r,path:[...r.path,"allOf",1]}),l=f=>"allOf"in f&&Object.keys(f).length===1,d=[...l(o)?o.allOf:[o],...l(a)?a.allOf:[a]];n.allOf=d},_B=(e,t,n,r)=>{const i=n,o=e._zod.def;i.type="array";const a=t.target==="draft-2020-12"?"prefixItems":"items",l=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",d=o.items.map((v,y)=>cn(v,t,{...r,path:[...r.path,a,y]})),f=o.rest?cn(o.rest,t,{...r,path:[...r.path,l,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null;t.target==="draft-2020-12"?(i.prefixItems=d,f&&(i.items=f)):t.target==="openapi-3.0"?(i.items={anyOf:d},f&&i.items.anyOf.push(f),i.minItems=d.length,f||(i.maxItems=d.length)):(i.items=d,f&&(i.additionalItems=f));const{minimum:m,maximum:h}=e._zod.bag;typeof m=="number"&&(i.minItems=m),typeof h=="number"&&(i.maxItems=h)},CB=(e,t,n,r)=>{const i=n,o=e._zod.def;i.type="object";const a=o.keyType,d=a._zod.bag?.patterns;if(o.mode==="loose"&&d&&d.size>0){const m=cn(o.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const h of d)i.patternProperties[h.source]=m}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=cn(o.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=cn(o.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const f=a._zod.values;if(f){const m=[...f].filter(h=>typeof h=="string"||typeof h=="number");m.length>0&&(i.required=m)}},kB=(e,t,n,r)=>{const i=e._zod.def,o=cn(i.innerType,t,r),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=i.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},EB=(e,t,n,r)=>{const i=e._zod.def;cn(i.innerType,t,r);const o=t.seen.get(e);o.ref=i.innerType},jB=(e,t,n,r)=>{const i=e._zod.def;cn(i.innerType,t,r);const o=t.seen.get(e);o.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},RB=(e,t,n,r)=>{const i=e._zod.def;cn(i.innerType,t,r);const o=t.seen.get(e);o.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},IB=(e,t,n,r)=>{const i=e._zod.def;cn(i.innerType,t,r);const o=t.seen.get(e);o.ref=i.innerType;let a;try{a=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=a},TB=(e,t,n,r)=>{const i=e._zod.def,o=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;cn(o,t,r);const a=t.seen.get(e);a.ref=o},NB=(e,t,n,r)=>{const i=e._zod.def;cn(i.innerType,t,r);const o=t.seen.get(e);o.ref=i.innerType,n.readOnly=!0},AB=(e,t,n,r)=>{const i=e._zod.def;cn(i.innerType,t,r);const o=t.seen.get(e);o.ref=i.innerType},dR=(e,t,n,r)=>{const i=e._zod.def;cn(i.innerType,t,r);const o=t.seen.get(e);o.ref=i.innerType},OB=(e,t,n,r)=>{const i=e._zod.innerType;cn(i,t,r);const o=t.seen.get(e);o.ref=i},GC={string:XV,number:JV,boolean:QV,bigint:eB,symbol:tB,null:nB,undefined:rB,void:iB,never:oB,any:aB,unknown:sB,date:lB,enum:cB,literal:uB,nan:dB,template_literal:fB,file:pB,success:mB,custom:hB,function:gB,transform:vB,map:yB,set:bB,array:xB,object:wB,union:uR,intersection:SB,tuple:_B,record:CB,nullable:kB,nonoptional:EB,default:jB,prefault:RB,catch:IB,pipe:TB,readonly:NB,promise:AB,optional:dR,lazy:OB};function $B(e,t){if("_idmap"in e){const r=e,i=Yd({...t,processors:GC}),o={};for(const d of r._idmap.entries()){const[f,m]=d;cn(m,i)}const a={},l={registry:r,uri:t?.uri,defs:o};i.external=l;for(const d of r._idmap.entries()){const[f,m]=d;Wd(i,m),a[f]=Xd(i,m)}if(Object.keys(o).length>0){const d=i.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[d]:o}}return{schemas:a}}const n=Yd({...t,processors:GC});return cn(e,n),Wd(n,e),Xd(n,e)}class mye{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=Yd({processors:GC,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return cn(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),Wd(this.ctx,t);const r=Xd(this.ctx,t),{"~standard":i,...o}=r;return o}}const hye=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),gye=Object.freeze(Object.defineProperty({__proto__:null,$ZodAny:S5,$ZodArray:j5,$ZodAsyncError:Ic,$ZodBase64:u5,$ZodBase64URL:f5,$ZodBigInt:$j,$ZodBigIntFormat:y5,$ZodBoolean:Oj,$ZodCIDRv4:l5,$ZodCIDRv6:c5,$ZodCUID:W3,$ZodCUID2:X3,$ZodCatch:Z5,$ZodCheck:Nn,$ZodCheckBigIntFormat:E3,$ZodCheckEndsWith:z3,$ZodCheckGreaterThan:Tj,$ZodCheckIncludes:P3,$ZodCheckLengthEquals:A3,$ZodCheckLessThan:Ij,$ZodCheckLowerCase:$3,$ZodCheckMaxLength:T3,$ZodCheckMaxSize:j3,$ZodCheckMimeType:F3,$ZodCheckMinLength:N3,$ZodCheckMinSize:R3,$ZodCheckMultipleOf:C3,$ZodCheckNumberFormat:k3,$ZodCheckOverwrite:U3,$ZodCheckProperty:L3,$ZodCheckRegex:O3,$ZodCheckSizeEquals:I3,$ZodCheckStartsWith:M3,$ZodCheckStringFormat:ph,$ZodCheckUpperCase:D3,$ZodCodec:Mj,$ZodCustom:nV,$ZodCustomStringFormat:g5,$ZodDate:E5,$ZodDefault:H5,$ZodDiscriminatedUnion:O5,$ZodE164:p5,$ZodEmail:K3,$ZodEmoji:Z3,$ZodEncodeError:_x,$ZodEnum:z5,$ZodError:Rx,$ZodExactOptional:V5,$ZodFile:F5,$ZodFunction:Q5,$ZodGUID:H3,$ZodIPv4:o5,$ZodIPv6:a5,$ZodISODate:n5,$ZodISODateTime:t5,$ZodISODuration:i5,$ZodISOTime:r5,$ZodIntersection:$5,$ZodJWT:h5,$ZodKSUID:e5,$ZodLazy:tV,$ZodLiteral:L5,$ZodMAC:s5,$ZodMap:P5,$ZodNaN:Y5,$ZodNanoID:Y3,$ZodNever:C5,$ZodNonOptional:K5,$ZodNull:w5,$ZodNullable:B5,$ZodNumber:Aj,$ZodNumberFormat:v5,$ZodObject:T5,$ZodObjectJIT:N5,$ZodOptional:Pj,$ZodPipe:W5,$ZodPrefault:q5,$ZodPromise:eV,$ZodReadonly:X5,$ZodRealError:eo,$ZodRecord:D5,$ZodRegistry:cV,$ZodSet:M5,$ZodString:mh,$ZodStringFormat:hn,$ZodSuccess:G5,$ZodSymbol:b5,$ZodTemplateLiteral:J5,$ZodTransform:U5,$ZodTuple:Dj,$ZodType:ft,$ZodULID:J3,$ZodURL:G3,$ZodUUID:q3,$ZodUndefined:x5,$ZodUnion:Ix,$ZodUnknown:_5,$ZodVoid:k5,$ZodXID:Q3,$ZodXor:A5,$brand:b6,$constructor:ae,$input:lV,$output:sV,Doc:V3,JSONSchema:hye,JSONSchemaGenerator:mye,NEVER:y6,TimePrecision:pV,_any:$V,_array:UV,_base64:tR,_base64url:nR,_bigint:jV,_boolean:kV,_catch:sye,_check:KV,_cidrv4:Qj,_cidrv6:eR,_coercedBigint:RV,_coercedBoolean:EV,_coercedDate:LV,_coercedNumber:bV,_coercedString:dV,_cuid:Kj,_cuid2:Gj,_custom:BV,_date:zV,_decode:bj,_decodeAsync:wj,_default:iye,_discriminatedUnion:Kve,_e164:rR,_email:Lj,_emoji:Hj,_encode:yj,_encodeAsync:xj,_endsWith:Px,_enum:Jve,_file:VV,_float32:wV,_float64:SV,_gt:Sl,_gte:wi,_guid:Gy,_includes:$x,_int:xV,_int32:_V,_int64:IV,_intersection:Gve,_ipv4:Xj,_ipv6:Jj,_isoDate:hV,_isoDateTime:mV,_isoDuration:vV,_isoTime:gV,_jwt:iR,_ksuid:Wj,_lazy:dye,_length:vh,_literal:eye,_lowercase:Ax,_lt:wl,_lte:jo,_mac:fV,_map:Wve,_max:jo,_maxLength:gh,_maxSize:Sf,_mime:Mx,_min:wi,_minLength:Lc,_minSize:_l,_multipleOf:Zd,_nan:FV,_nanoid:qj,_nativeEnum:Qve,_negative:aR,_never:PV,_nonnegative:lR,_nonoptional:oye,_nonpositive:sR,_normalize:zx,_null:OV,_nullable:rye,_number:yV,_optional:nye,_overwrite:gs,_parse:sh,_parseAsync:lh,_pipe:lye,_positive:oR,_promise:fye,_property:cR,_readonly:cye,_record:Yve,_refine:HV,_regex:Nx,_safeDecode:_j,_safeDecodeAsync:kj,_safeEncode:Sj,_safeEncodeAsync:Cj,_safeParse:ch,_safeParseAsync:uh,_set:Xve,_size:hh,_slugify:Vx,_startsWith:Dx,_string:uV,_stringFormat:yh,_stringbool:YV,_success:aye,_superRefine:qV,_symbol:NV,_templateLiteral:uye,_toLowerCase:Fx,_toUpperCase:Ux,_transform:tye,_trim:Lx,_tuple:Zve,_uint32:CV,_uint64:TV,_ulid:Zj,_undefined:AV,_union:Hve,_unknown:DV,_uppercase:Ox,_url:Tx,_uuid:Fj,_uuidv4:Uj,_uuidv6:Vj,_uuidv7:Bj,_void:MV,_xid:Yj,_xor:qve,clone:Oo,config:zr,createStandardJSONSchemaMethod:Cm,createToJSONSchemaMethod:WV,decode:Rhe,decodeAsync:The,describe:GV,encode:jhe,encodeAsync:Ihe,extractDefs:Wd,finalize:Xd,flattenError:gj,formatError:vj,globalConfig:Uy,globalRegistry:ko,initializeContext:Yd,isValidBase64:Nj,isValidBase64URL:d5,isValidJWT:m5,locales:aV,meta:ZV,parse:Hy,parseAsync:qy,prettifyError:F6,process:cn,regexes:Rj,registry:zj,safeDecode:Ahe,safeDecodeAsync:$he,safeEncode:Nhe,safeEncodeAsync:Ohe,safeParse:U6,safeParseAsync:V6,toDotPath:L6,toJSONSchema:$B,treeifyError:z6,util:P6,version:B3},Symbol.toStringTag,{value:"Module"})),vye=Object.freeze(Object.defineProperty({__proto__:null,endsWith:Px,gt:Sl,gte:wi,includes:$x,length:vh,lowercase:Ax,lt:wl,lte:jo,maxLength:gh,maxSize:Sf,mime:Mx,minLength:Lc,minSize:_l,multipleOf:Zd,negative:aR,nonnegative:lR,nonpositive:sR,normalize:zx,overwrite:gs,positive:oR,property:cR,regex:Nx,size:hh,slugify:Vx,startsWith:Dx,toLowerCase:Fx,toUpperCase:Ux,trim:Lx,uppercase:Ox},Symbol.toStringTag,{value:"Module"})),fR=ae("ZodISODateTime",(e,t)=>{t5.init(e,t),gn.init(e,t)});function DB(e){return mV(fR,e)}const pR=ae("ZodISODate",(e,t)=>{n5.init(e,t),gn.init(e,t)});function PB(e){return hV(pR,e)}const mR=ae("ZodISOTime",(e,t)=>{r5.init(e,t),gn.init(e,t)});function MB(e){return gV(mR,e)}const hR=ae("ZodISODuration",(e,t)=>{i5.init(e,t),gn.init(e,t)});function zB(e){return vV(hR,e)}const LB=Object.freeze(Object.defineProperty({__proto__:null,ZodISODate:pR,ZodISODateTime:fR,ZodISODuration:hR,ZodISOTime:mR,date:PB,datetime:DB,duration:zB,time:MB},Symbol.toStringTag,{value:"Module"})),FB=(e,t)=>{Rx.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>vj(e,n)},flatten:{value:n=>gj(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Vy,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Vy,2)}},isEmpty:{get(){return e.issues.length===0}}})},yye=ae("ZodError",FB),to=ae("ZodError",FB,{Parent:Error}),UB=sh(to),VB=lh(to),BB=ch(to),HB=uh(to),qB=yj(to),KB=bj(to),GB=xj(to),ZB=wj(to),YB=Sj(to),WB=_j(to),XB=Cj(to),JB=kj(to),vt=ae("ZodType",(e,t)=>(ft.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Cm(e,"input"),output:Cm(e,"output")}}),e.toJSONSchema=WV(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ea(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>Oo(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>UB(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>BB(e,n,r),e.parseAsync=async(n,r)=>VB(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>HB(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>qB(e,n,r),e.decode=(n,r)=>KB(e,n,r),e.encodeAsync=async(n,r)=>GB(e,n,r),e.decodeAsync=async(n,r)=>ZB(e,n,r),e.safeEncode=(n,r)=>YB(e,n,r),e.safeDecode=(n,r)=>WB(e,n,r),e.safeEncodeAsync=async(n,r)=>XB(e,n,r),e.safeDecodeAsync=async(n,r)=>JB(e,n,r),e.refine=(n,r)=>e.check(oI(n,r)),e.superRefine=n=>e.check(aI(n)),e.overwrite=n=>e.check(gs(n)),e.optional=()=>jm(e),e.exactOptional=()=>UR(e),e.nullable=()=>Rm(e),e.nullish=()=>jm(Rm(e)),e.nonoptional=n=>GR(e,n),e.array=()=>ds(e),e.or=n=>u0([e,n]),e.and=n=>AR(e,n),e.transform=n=>Im(e,f0(n)),e.default=n=>HR(e,n),e.prefault=n=>KR(e,n),e.catch=n=>WR(e,n),e.pipe=n=>Im(e,n),e.readonly=()=>QR(e),e.describe=n=>{const r=e.clone();return ko.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return ko.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return ko.get(e);const r=e.clone();return ko.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Bx=ae("_ZodString",(e,t)=>{mh.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(r,i,o)=>XV(e,r,i);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(Nx(...r)),e.includes=(...r)=>e.check($x(...r)),e.startsWith=(...r)=>e.check(Dx(...r)),e.endsWith=(...r)=>e.check(Px(...r)),e.min=(...r)=>e.check(Lc(...r)),e.max=(...r)=>e.check(gh(...r)),e.length=(...r)=>e.check(vh(...r)),e.nonempty=(...r)=>e.check(Lc(1,...r)),e.lowercase=r=>e.check(Ax(r)),e.uppercase=r=>e.check(Ox(r)),e.trim=()=>e.check(Lx()),e.normalize=(...r)=>e.check(zx(...r)),e.toLowerCase=()=>e.check(Fx()),e.toUpperCase=()=>e.check(Ux()),e.slugify=()=>e.check(Vx())}),bh=ae("ZodString",(e,t)=>{mh.init(e,t),Bx.init(e,t),e.email=n=>e.check(Lj(Hx,n)),e.url=n=>e.check(Tx(xh,n)),e.jwt=n=>e.check(iR(o0,n)),e.emoji=n=>e.check(Hj(qx,n)),e.guid=n=>e.check(Gy(km,n)),e.uuid=n=>e.check(Fj(pa,n)),e.uuidv4=n=>e.check(Uj(pa,n)),e.uuidv6=n=>e.check(Vj(pa,n)),e.uuidv7=n=>e.check(Bj(pa,n)),e.nanoid=n=>e.check(qj(Kx,n)),e.guid=n=>e.check(Gy(km,n)),e.cuid=n=>e.check(Kj(Gx,n)),e.cuid2=n=>e.check(Gj(Zx,n)),e.ulid=n=>e.check(Zj(Yx,n)),e.base64=n=>e.check(tR(n0,n)),e.base64url=n=>e.check(nR(r0,n)),e.xid=n=>e.check(Yj(Wx,n)),e.ksuid=n=>e.check(Wj(Xx,n)),e.ipv4=n=>e.check(Xj(Jx,n)),e.ipv6=n=>e.check(Jj(Qx,n)),e.cidrv4=n=>e.check(Qj(e0,n)),e.cidrv6=n=>e.check(eR(t0,n)),e.e164=n=>e.check(rR(i0,n)),e.datetime=n=>e.check(DB(n)),e.date=n=>e.check(PB(n)),e.time=n=>e.check(MB(n)),e.duration=n=>e.check(zB(n))});function tt(e){return uV(bh,e)}const gn=ae("ZodStringFormat",(e,t)=>{hn.init(e,t),Bx.init(e,t)}),Hx=ae("ZodEmail",(e,t)=>{K3.init(e,t),gn.init(e,t)});function gR(e){return Lj(Hx,e)}const km=ae("ZodGUID",(e,t)=>{H3.init(e,t),gn.init(e,t)});function QB(e){return Gy(km,e)}const pa=ae("ZodUUID",(e,t)=>{q3.init(e,t),gn.init(e,t)});function eH(e){return Fj(pa,e)}function tH(e){return Uj(pa,e)}function nH(e){return Vj(pa,e)}function rH(e){return Bj(pa,e)}const xh=ae("ZodURL",(e,t)=>{G3.init(e,t),gn.init(e,t)});function iH(e){return Tx(xh,e)}function oH(e){return Tx(xh,{protocol:/^https?$/,hostname:s3,...Ce(e)})}const qx=ae("ZodEmoji",(e,t)=>{Z3.init(e,t),gn.init(e,t)});function aH(e){return Hj(qx,e)}const Kx=ae("ZodNanoID",(e,t)=>{Y3.init(e,t),gn.init(e,t)});function sH(e){return qj(Kx,e)}const Gx=ae("ZodCUID",(e,t)=>{W3.init(e,t),gn.init(e,t)});function lH(e){return Kj(Gx,e)}const Zx=ae("ZodCUID2",(e,t)=>{X3.init(e,t),gn.init(e,t)});function cH(e){return Gj(Zx,e)}const Yx=ae("ZodULID",(e,t)=>{J3.init(e,t),gn.init(e,t)});function uH(e){return Zj(Yx,e)}const Wx=ae("ZodXID",(e,t)=>{Q3.init(e,t),gn.init(e,t)});function dH(e){return Yj(Wx,e)}const Xx=ae("ZodKSUID",(e,t)=>{e5.init(e,t),gn.init(e,t)});function fH(e){return Wj(Xx,e)}const Jx=ae("ZodIPv4",(e,t)=>{o5.init(e,t),gn.init(e,t)});function pH(e){return Xj(Jx,e)}const vR=ae("ZodMAC",(e,t)=>{s5.init(e,t),gn.init(e,t)});function mH(e){return fV(vR,e)}const Qx=ae("ZodIPv6",(e,t)=>{a5.init(e,t),gn.init(e,t)});function hH(e){return Jj(Qx,e)}const e0=ae("ZodCIDRv4",(e,t)=>{l5.init(e,t),gn.init(e,t)});function gH(e){return Qj(e0,e)}const t0=ae("ZodCIDRv6",(e,t)=>{c5.init(e,t),gn.init(e,t)});function vH(e){return eR(t0,e)}const n0=ae("ZodBase64",(e,t)=>{u5.init(e,t),gn.init(e,t)});function yH(e){return tR(n0,e)}const r0=ae("ZodBase64URL",(e,t)=>{f5.init(e,t),gn.init(e,t)});function bH(e){return nR(r0,e)}const i0=ae("ZodE164",(e,t)=>{p5.init(e,t),gn.init(e,t)});function xH(e){return rR(i0,e)}const o0=ae("ZodJWT",(e,t)=>{h5.init(e,t),gn.init(e,t)});function wH(e){return iR(o0,e)}const _f=ae("ZodCustomStringFormat",(e,t)=>{g5.init(e,t),gn.init(e,t)});function SH(e,t,n={}){return yh(_f,e,t,n)}function _H(e){return yh(_f,"hostname",a3,e)}function CH(e){return yh(_f,"hex",S3,e)}function kH(e,t){const n=t?.enc??"hex",r=`${e}_${n}`,i=Rj[r];if(!i)throw new Error(`Unrecognized hash format: ${r}`);return yh(_f,r,i,t)}const wh=ae("ZodNumber",(e,t)=>{Aj.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(r,i,o)=>JV(e,r,i),e.gt=(r,i)=>e.check(Sl(r,i)),e.gte=(r,i)=>e.check(wi(r,i)),e.min=(r,i)=>e.check(wi(r,i)),e.lt=(r,i)=>e.check(wl(r,i)),e.lte=(r,i)=>e.check(jo(r,i)),e.max=(r,i)=>e.check(jo(r,i)),e.int=r=>e.check(Zy(r)),e.safe=r=>e.check(Zy(r)),e.positive=r=>e.check(Sl(0,r)),e.nonnegative=r=>e.check(wi(0,r)),e.negative=r=>e.check(wl(0,r)),e.nonpositive=r=>e.check(jo(0,r)),e.multipleOf=(r,i)=>e.check(Zd(r,i)),e.step=(r,i)=>e.check(Zd(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 a0(e){return yV(wh,e)}const ru=ae("ZodNumberFormat",(e,t)=>{v5.init(e,t),wh.init(e,t)});function Zy(e){return xV(ru,e)}function EH(e){return wV(ru,e)}function jH(e){return SV(ru,e)}function yR(e){return _V(ru,e)}function RH(e){return CV(ru,e)}const Sh=ae("ZodBoolean",(e,t)=>{Oj.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>QV(e,n,r)});function Qt(e){return kV(Sh,e)}const _h=ae("ZodBigInt",(e,t)=>{$j.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(r,i,o)=>eB(e,r),e.gte=(r,i)=>e.check(wi(r,i)),e.min=(r,i)=>e.check(wi(r,i)),e.gt=(r,i)=>e.check(Sl(r,i)),e.gte=(r,i)=>e.check(wi(r,i)),e.min=(r,i)=>e.check(wi(r,i)),e.lt=(r,i)=>e.check(wl(r,i)),e.lte=(r,i)=>e.check(jo(r,i)),e.max=(r,i)=>e.check(jo(r,i)),e.positive=r=>e.check(Sl(BigInt(0),r)),e.negative=r=>e.check(wl(BigInt(0),r)),e.nonpositive=r=>e.check(jo(BigInt(0),r)),e.nonnegative=r=>e.check(wi(BigInt(0),r)),e.multipleOf=(r,i)=>e.check(Zd(r,i));const n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function IH(e){return jV(_h,e)}const s0=ae("ZodBigIntFormat",(e,t)=>{y5.init(e,t),_h.init(e,t)});function TH(e){return IV(s0,e)}function NH(e){return TV(s0,e)}const bR=ae("ZodSymbol",(e,t)=>{b5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>tB(e,n)});function AH(e){return NV(bR,e)}const xR=ae("ZodUndefined",(e,t)=>{x5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>rB(e,n)});function Em(e){return AV(xR,e)}const wR=ae("ZodNull",(e,t)=>{w5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>nB(e,n,r)});function SR(e){return OV(wR,e)}const _R=ae("ZodAny",(e,t)=>{S5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>aB()});function OH(){return $V(_R)}const CR=ae("ZodUnknown",(e,t)=>{_5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>sB()});function Fc(){return DV(CR)}const kR=ae("ZodNever",(e,t)=>{C5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>oB(e,n,r)});function l0(e){return PV(kR,e)}const ER=ae("ZodVoid",(e,t)=>{k5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>iB(e,n)});function $H(e){return MV(ER,e)}const c0=ae("ZodDate",(e,t)=>{E5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(r,i,o)=>lB(e,r),e.min=(r,i)=>e.check(wi(r,i)),e.max=(r,i)=>e.check(jo(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 DH(e){return zV(c0,e)}const jR=ae("ZodArray",(e,t)=>{j5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>xB(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(Lc(n,r)),e.nonempty=n=>e.check(Lc(1,n)),e.max=(n,r)=>e.check(gh(n,r)),e.length=(n,r)=>e.check(vh(n,r)),e.unwrap=()=>e.element});function ds(e,t){return UV(jR,e,t)}function PH(e){const t=e._zod.def.shape;return Ml(Object.keys(t))}const Ch=ae("ZodObject",(e,t)=>{N5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>wB(e,n,r,i),Ct(e,"shape",()=>t.shape),e.keyof=()=>Ml(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Fc()}),e.loose=()=>e.clone({...e._zod.def,catchall:Fc()}),e.strict=()=>e.clone({...e._zod.def,catchall:l0()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>I6(e,n),e.safeExtend=n=>T6(e,n),e.merge=n=>N6(e,n),e.pick=n=>j6(e,n),e.omit=n=>R6(e,n),e.partial=(...n)=>A6(p0,e,n[0]),e.required=(...n)=>O6(m0,e,n[0])});function Dt(e,t){const n={type:"object",shape:e??{},...Ce(t)};return new Ch(n)}function MH(e,t){return new Ch({type:"object",shape:e,catchall:l0(),...Ce(t)})}function zH(e,t){return new Ch({type:"object",shape:e,catchall:Fc(),...Ce(t)})}const kh=ae("ZodUnion",(e,t)=>{Ix.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>uR(e,n,r,i),e.options=t.options});function u0(e,t){return new kh({type:"union",options:e,...Ce(t)})}const RR=ae("ZodXor",(e,t)=>{kh.init(e,t),A5.init(e,t),e._zod.processJSONSchema=(n,r,i)=>uR(e,n,r,i),e.options=t.options});function LH(e,t){return new RR({type:"union",options:e,inclusive:!1,...Ce(t)})}const IR=ae("ZodDiscriminatedUnion",(e,t)=>{kh.init(e,t),O5.init(e,t)});function TR(e,t,n){return new IR({type:"union",options:t,discriminator:e,...Ce(n)})}const NR=ae("ZodIntersection",(e,t)=>{$5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>SB(e,n,r,i)});function AR(e,t){return new NR({type:"intersection",left:e,right:t})}const OR=ae("ZodTuple",(e,t)=>{Dj.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>_B(e,n,r,i),e.rest=n=>e.clone({...e._zod.def,rest:n})});function $R(e,t,n){const r=t instanceof ft,i=r?n:t,o=r?t:null;return new OR({type:"tuple",items:e,rest:o,...Ce(i)})}const Eh=ae("ZodRecord",(e,t)=>{D5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>CB(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function d0(e,t,n){return new Eh({type:"record",keyType:e,valueType:t,...Ce(n)})}function FH(e,t,n){const r=Oo(e);return r._zod.values=void 0,new Eh({type:"record",keyType:r,valueType:t,...Ce(n)})}function UH(e,t,n){return new Eh({type:"record",keyType:e,valueType:t,mode:"loose",...Ce(n)})}const DR=ae("ZodMap",(e,t)=>{P5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>yB(e,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(_l(...n)),e.nonempty=n=>e.check(_l(1,n)),e.max=(...n)=>e.check(Sf(...n)),e.size=(...n)=>e.check(hh(...n))});function VH(e,t,n){return new DR({type:"map",keyType:e,valueType:t,...Ce(n)})}const PR=ae("ZodSet",(e,t)=>{M5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>bB(e,n),e.min=(...n)=>e.check(_l(...n)),e.nonempty=n=>e.check(_l(1,n)),e.max=(...n)=>e.check(Sf(...n)),e.size=(...n)=>e.check(hh(...n))});function BH(e,t){return new PR({type:"set",valueType:e,...Ce(t)})}const Jd=ae("ZodEnum",(e,t)=>{z5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(r,i,o)=>cB(e,r,i),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 Jd({...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 Jd({...t,checks:[],...Ce(i),entries:o})}});function Ml(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Jd({type:"enum",entries:n,...Ce(t)})}function HH(e,t){return new Jd({type:"enum",entries:e,...Ce(t)})}const MR=ae("ZodLiteral",(e,t)=>{L5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>uB(e,n,r),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 Cf(e,t){return new MR({type:"literal",values:Array.isArray(e)?e:[e],...Ce(t)})}const zR=ae("ZodFile",(e,t)=>{F5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>pB(e,n,r),e.min=(n,r)=>e.check(_l(n,r)),e.max=(n,r)=>e.check(Sf(n,r)),e.mime=(n,r)=>e.check(Mx(Array.isArray(n)?n:[n],r))});function qH(e){return VV(zR,e)}const LR=ae("ZodTransform",(e,t)=>{U5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>vB(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new _x(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(Kd(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(Kd(a))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(o=>(n.value=o,n)):(n.value=i,n)}});function f0(e){return new LR({type:"transform",transform:e})}const p0=ae("ZodOptional",(e,t)=>{Pj.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>dR(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function jm(e){return new p0({type:"optional",innerType:e})}const FR=ae("ZodExactOptional",(e,t)=>{V5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>dR(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function UR(e){return new FR({type:"optional",innerType:e})}const VR=ae("ZodNullable",(e,t)=>{B5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>kB(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Rm(e){return new VR({type:"nullable",innerType:e})}function KH(e){return jm(Rm(e))}const BR=ae("ZodDefault",(e,t)=>{H5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>jB(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function HR(e,t){return new BR({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():kx(t)}})}const qR=ae("ZodPrefault",(e,t)=>{q5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>RB(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function KR(e,t){return new qR({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():kx(t)}})}const m0=ae("ZodNonOptional",(e,t)=>{K5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>EB(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function GR(e,t){return new m0({type:"nonoptional",innerType:e,...Ce(t)})}const ZR=ae("ZodSuccess",(e,t)=>{G5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>mB(e,n,r),e.unwrap=()=>e._zod.def.innerType});function GH(e){return new ZR({type:"success",innerType:e})}const YR=ae("ZodCatch",(e,t)=>{Z5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>IB(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function WR(e,t){return new YR({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const XR=ae("ZodNaN",(e,t)=>{Y5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>dB(e,n)});function ZH(e){return FV(XR,e)}const h0=ae("ZodPipe",(e,t)=>{W5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>TB(e,n,r,i),e.in=t.in,e.out=t.out});function Im(e,t){return new h0({type:"pipe",in:e,out:t})}const g0=ae("ZodCodec",(e,t)=>{h0.init(e,t),Mj.init(e,t)});function YH(e,t,n){return new g0({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}const JR=ae("ZodReadonly",(e,t)=>{X5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>NB(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function QR(e){return new JR({type:"readonly",innerType:e})}const eI=ae("ZodTemplateLiteral",(e,t)=>{J5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>fB(e,n,r)});function WH(e,t){return new eI({type:"template_literal",parts:e,...Ce(t)})}const tI=ae("ZodLazy",(e,t)=>{tV.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>OB(e,n,r,i),e.unwrap=()=>e._zod.def.getter()});function nI(e){return new tI({type:"lazy",getter:e})}const rI=ae("ZodPromise",(e,t)=>{eV.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>AB(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function XH(e){return new rI({type:"promise",innerType:e})}const iI=ae("ZodFunction",(e,t)=>{Q5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gB(e,n)});function Yy(e){return new iI({type:"function",input:Array.isArray(e?.input)?$R(e?.input):e?.input??ds(Fc()),output:e?.output??Fc()})}const jh=ae("ZodCustom",(e,t)=>{nV.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>hB(e,n)});function JH(e){const t=new Nn({check:"custom"});return t._zod.check=e,t}function QH(e,t){return BV(jh,e??(()=>!0),t)}function oI(e,t={}){return HV(jh,e,t)}function aI(e){return qV(e)}const e8=GV,t8=ZV;function n8(e,t={}){const n=new jh({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...Ce(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}const r8=(...e)=>YV({Codec:g0,Boolean:Sh,String:bh},...e);function i8(e){const t=nI(()=>u0([tt(e),a0(),Qt(),SR(),ds(t),d0(tt(),t)]));return t}function o8(e,t){return Im(f0(e),t)}const bye=Object.freeze(Object.defineProperty({__proto__:null,ZodAny:_R,ZodArray:jR,ZodBase64:n0,ZodBase64URL:r0,ZodBigInt:_h,ZodBigIntFormat:s0,ZodBoolean:Sh,ZodCIDRv4:e0,ZodCIDRv6:t0,ZodCUID:Gx,ZodCUID2:Zx,ZodCatch:YR,ZodCodec:g0,ZodCustom:jh,ZodCustomStringFormat:_f,ZodDate:c0,ZodDefault:BR,ZodDiscriminatedUnion:IR,ZodE164:i0,ZodEmail:Hx,ZodEmoji:qx,ZodEnum:Jd,ZodExactOptional:FR,ZodFile:zR,ZodFunction:iI,ZodGUID:km,ZodIPv4:Jx,ZodIPv6:Qx,ZodIntersection:NR,ZodJWT:o0,ZodKSUID:Xx,ZodLazy:tI,ZodLiteral:MR,ZodMAC:vR,ZodMap:DR,ZodNaN:XR,ZodNanoID:Kx,ZodNever:kR,ZodNonOptional:m0,ZodNull:wR,ZodNullable:VR,ZodNumber:wh,ZodNumberFormat:ru,ZodObject:Ch,ZodOptional:p0,ZodPipe:h0,ZodPrefault:qR,ZodPromise:rI,ZodReadonly:JR,ZodRecord:Eh,ZodSet:PR,ZodString:bh,ZodStringFormat:gn,ZodSuccess:ZR,ZodSymbol:bR,ZodTemplateLiteral:eI,ZodTransform:LR,ZodTuple:OR,ZodType:vt,ZodULID:Yx,ZodURL:xh,ZodUUID:pa,ZodUndefined:xR,ZodUnion:kh,ZodUnknown:CR,ZodVoid:ER,ZodXID:Wx,ZodXor:RR,_ZodString:Bx,_default:HR,_function:Yy,any:OH,array:ds,base64:yH,base64url:bH,bigint:IH,boolean:Qt,catch:WR,check:JH,cidrv4:gH,cidrv6:vH,codec:YH,cuid:lH,cuid2:cH,custom:QH,date:DH,describe:e8,discriminatedUnion:TR,e164:xH,email:gR,emoji:aH,enum:Ml,exactOptional:UR,file:qH,float32:EH,float64:jH,function:Yy,guid:QB,hash:kH,hex:CH,hostname:_H,httpUrl:oH,instanceof:n8,int:Zy,int32:yR,int64:TH,intersection:AR,ipv4:pH,ipv6:hH,json:i8,jwt:wH,keyof:PH,ksuid:fH,lazy:nI,literal:Cf,looseObject:zH,looseRecord:UH,mac:mH,map:VH,meta:t8,nan:ZH,nanoid:sH,nativeEnum:HH,never:l0,nonoptional:GR,null:SR,nullable:Rm,nullish:KH,number:a0,object:Dt,optional:jm,partialRecord:FH,pipe:Im,prefault:KR,preprocess:o8,promise:XH,readonly:QR,record:d0,refine:oI,set:BH,strictObject:MH,string:tt,stringFormat:SH,stringbool:r8,success:GH,superRefine:aI,symbol:AH,templateLiteral:WH,transform:f0,tuple:$R,uint32:RH,uint64:NH,ulid:uH,undefined:Em,union:u0,unknown:Fc,url:iH,uuid:eH,uuidv4:tH,uuidv6:nH,uuidv7:rH,void:$H,xid:dH,xor:LH},Symbol.toStringTag,{value:"Module"})),xye={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 wye(e){zr({customError:e})}function Sye(){return zr().customError}var ZC;ZC||(ZC={});const Fe={...bye,...vye,iso:LB},_ye=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function Cye(e,t){const n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function kye(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");const n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;const r=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===r){const i=n[1];if(!i||!t.defs[i])throw new Error(`Reference not found: ${e}`);return t.defs[i]}throw new Error(`Reference not found: ${e}`)}function a8(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return Fe.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){const i=e.$ref;if(t.refs.has(i))return t.refs.get(i);if(t.processing.has(i))return Fe.lazy(()=>{if(!t.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return t.refs.get(i)});t.processing.add(i);const o=kye(i,t),a=$r(o,t);return t.refs.set(i,a),t.processing.delete(i),a}if(e.enum!==void 0){const i=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&i.length===1&&i[0]===null)return Fe.null();if(i.length===0)return Fe.never();if(i.length===1)return Fe.literal(i[0]);if(i.every(a=>typeof a=="string"))return Fe.enum(i);const o=i.map(a=>Fe.literal(a));return o.length<2?o[0]:Fe.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return Fe.literal(e.const);const n=e.type;if(Array.isArray(n)){const i=n.map(o=>{const a={...e,type:o};return a8(a,t)});return i.length===0?Fe.never():i.length===1?i[0]:Fe.union(i)}if(!n)return Fe.any();let r;switch(n){case"string":{let i=Fe.string();if(e.format){const o=e.format;o==="email"?i=i.check(Fe.email()):o==="uri"||o==="uri-reference"?i=i.check(Fe.url()):o==="uuid"||o==="guid"?i=i.check(Fe.uuid()):o==="date-time"?i=i.check(Fe.iso.datetime()):o==="date"?i=i.check(Fe.iso.date()):o==="time"?i=i.check(Fe.iso.time()):o==="duration"?i=i.check(Fe.iso.duration()):o==="ipv4"?i=i.check(Fe.ipv4()):o==="ipv6"?i=i.check(Fe.ipv6()):o==="mac"?i=i.check(Fe.mac()):o==="cidr"?i=i.check(Fe.cidrv4()):o==="cidr-v6"?i=i.check(Fe.cidrv6()):o==="base64"?i=i.check(Fe.base64()):o==="base64url"?i=i.check(Fe.base64url()):o==="e164"?i=i.check(Fe.e164()):o==="jwt"?i=i.check(Fe.jwt()):o==="emoji"?i=i.check(Fe.emoji()):o==="nanoid"?i=i.check(Fe.nanoid()):o==="cuid"?i=i.check(Fe.cuid()):o==="cuid2"?i=i.check(Fe.cuid2()):o==="ulid"?i=i.check(Fe.ulid()):o==="xid"?i=i.check(Fe.xid()):o==="ksuid"&&(i=i.check(Fe.ksuid()))}typeof e.minLength=="number"&&(i=i.min(e.minLength)),typeof e.maxLength=="number"&&(i=i.max(e.maxLength)),e.pattern&&(i=i.regex(new RegExp(e.pattern))),r=i;break}case"number":case"integer":{let i=n==="integer"?Fe.number().int():Fe.number();typeof e.minimum=="number"&&(i=i.min(e.minimum)),typeof e.maximum=="number"&&(i=i.max(e.maximum)),typeof e.exclusiveMinimum=="number"?i=i.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(i=i.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?i=i.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(i=i.lt(e.maximum)),typeof e.multipleOf=="number"&&(i=i.multipleOf(e.multipleOf)),r=i;break}case"boolean":{r=Fe.boolean();break}case"null":{r=Fe.null();break}case"object":{const i={},o=e.properties||{},a=new Set(e.required||[]);for(const[d,f]of Object.entries(o)){const m=$r(f,t);i[d]=a.has(d)?m:m.optional()}if(e.propertyNames){const d=$r(e.propertyNames,t),f=e.additionalProperties&&typeof e.additionalProperties=="object"?$r(e.additionalProperties,t):Fe.any();if(Object.keys(i).length===0){r=Fe.record(d,f);break}const m=Fe.object(i).passthrough(),h=Fe.looseRecord(d,f);r=Fe.intersection(m,h);break}if(e.patternProperties){const d=e.patternProperties,f=Object.keys(d),m=[];for(const v of f){const y=$r(d[v],t),x=Fe.string().regex(new RegExp(v));m.push(Fe.looseRecord(x,y))}const h=[];if(Object.keys(i).length>0&&h.push(Fe.object(i).passthrough()),h.push(...m),h.length===0)r=Fe.object({}).passthrough();else if(h.length===1)r=h[0];else{let v=Fe.intersection(h[0],h[1]);for(let y=2;y<h.length;y++)v=Fe.intersection(v,h[y]);r=v}break}const l=Fe.object(i);e.additionalProperties===!1?r=l.strict():typeof e.additionalProperties=="object"?r=l.catchall($r(e.additionalProperties,t)):r=l.passthrough();break}case"array":{const i=e.prefixItems,o=e.items;if(i&&Array.isArray(i)){const a=i.map(d=>$r(d,t)),l=o&&typeof o=="object"&&!Array.isArray(o)?$r(o,t):void 0;l?r=Fe.tuple(a).rest(l):r=Fe.tuple(a),typeof e.minItems=="number"&&(r=r.check(Fe.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(Fe.maxLength(e.maxItems)))}else if(Array.isArray(o)){const a=o.map(d=>$r(d,t)),l=e.additionalItems&&typeof e.additionalItems=="object"?$r(e.additionalItems,t):void 0;l?r=Fe.tuple(a).rest(l):r=Fe.tuple(a),typeof e.minItems=="number"&&(r=r.check(Fe.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(Fe.maxLength(e.maxItems)))}else if(o!==void 0){const a=$r(o,t);let l=Fe.array(a);typeof e.minItems=="number"&&(l=l.min(e.minItems)),typeof e.maxItems=="number"&&(l=l.max(e.maxItems)),r=l}else r=Fe.array(Fe.any());break}default:throw new Error(`Unsupported type: ${n}`)}return e.description&&(r=r.describe(e.description)),e.default!==void 0&&(r=r.default(e.default)),r}function $r(e,t){if(typeof e=="boolean")return e?Fe.any():Fe.never();let n=a8(e,t);const r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){const l=e.anyOf.map(f=>$r(f,t)),d=Fe.union(l);n=r?Fe.intersection(n,d):d}if(e.oneOf&&Array.isArray(e.oneOf)){const l=e.oneOf.map(f=>$r(f,t)),d=Fe.xor(l);n=r?Fe.intersection(n,d):d}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:Fe.any();else{let l=r?n:$r(e.allOf[0],t);const d=r?0:1;for(let f=d;f<e.allOf.length;f++)l=Fe.intersection(l,$r(e.allOf[f],t));n=l}e.nullable===!0&&t.version==="openapi-3.0"&&(n=Fe.nullable(n)),e.readOnly===!0&&(n=Fe.readonly(n));const i={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(const l of o)l in e&&(i[l]=e[l]);const a=["contentEncoding","contentMediaType","contentSchema"];for(const l of a)l in e&&(i[l]=e[l]);for(const l of Object.keys(e))_ye.has(l)||(i[l]=e[l]);return Object.keys(i).length>0&&t.registry.add(n,i),n}function Eye(e,t){if(typeof e=="boolean")return e?Fe.any():Fe.never();const n=Cye(e,t?.defaultTarget),r=e.$defs||e.definitions||{},i={version:n,defs:r,refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??ko};return $r(e,i)}function jye(e){return dV(bh,e)}function Rye(e){return bV(wh,e)}function Iye(e){return EV(Sh,e)}function Tye(e){return RV(_h,e)}function Nye(e){return LV(c0,e)}const Aye=Object.freeze(Object.defineProperty({__proto__:null,bigint:Tye,boolean:Iye,date:Nye,number:Rye,string:jye},Symbol.toStringTag,{value:"Module"}));zr(rV());const Cl=Object.freeze(Object.defineProperty({__proto__:null,$brand:b6,$input:lV,$output:sV,NEVER:y6,TimePrecision:pV,ZodAny:_R,ZodArray:jR,ZodBase64:n0,ZodBase64URL:r0,ZodBigInt:_h,ZodBigIntFormat:s0,ZodBoolean:Sh,ZodCIDRv4:e0,ZodCIDRv6:t0,ZodCUID:Gx,ZodCUID2:Zx,ZodCatch:YR,ZodCodec:g0,ZodCustom:jh,ZodCustomStringFormat:_f,ZodDate:c0,ZodDefault:BR,ZodDiscriminatedUnion:IR,ZodE164:i0,ZodEmail:Hx,ZodEmoji:qx,ZodEnum:Jd,ZodError:yye,ZodExactOptional:FR,ZodFile:zR,get ZodFirstPartyTypeKind(){return ZC},ZodFunction:iI,ZodGUID:km,ZodIPv4:Jx,ZodIPv6:Qx,ZodISODate:pR,ZodISODateTime:fR,ZodISODuration:hR,ZodISOTime:mR,ZodIntersection:NR,ZodIssueCode:xye,ZodJWT:o0,ZodKSUID:Xx,ZodLazy:tI,ZodLiteral:MR,ZodMAC:vR,ZodMap:DR,ZodNaN:XR,ZodNanoID:Kx,ZodNever:kR,ZodNonOptional:m0,ZodNull:wR,ZodNullable:VR,ZodNumber:wh,ZodNumberFormat:ru,ZodObject:Ch,ZodOptional:p0,ZodPipe:h0,ZodPrefault:qR,ZodPromise:rI,ZodReadonly:JR,ZodRealError:to,ZodRecord:Eh,ZodSet:PR,ZodString:bh,ZodStringFormat:gn,ZodSuccess:ZR,ZodSymbol:bR,ZodTemplateLiteral:eI,ZodTransform:LR,ZodTuple:OR,ZodType:vt,ZodULID:Yx,ZodURL:xh,ZodUUID:pa,ZodUndefined:xR,ZodUnion:kh,ZodUnknown:CR,ZodVoid:ER,ZodXID:Wx,ZodXor:RR,_ZodString:Bx,_default:HR,_function:Yy,any:OH,array:ds,base64:yH,base64url:bH,bigint:IH,boolean:Qt,catch:WR,check:JH,cidrv4:gH,cidrv6:vH,clone:Oo,codec:YH,coerce:Aye,config:zr,core:gye,cuid:lH,cuid2:cH,custom:QH,date:DH,decode:KB,decodeAsync:ZB,describe:e8,discriminatedUnion:TR,e164:xH,email:gR,emoji:aH,encode:qB,encodeAsync:GB,endsWith:Px,enum:Ml,exactOptional:UR,file:qH,flattenError:gj,float32:EH,float64:jH,formatError:vj,fromJSONSchema:Eye,function:Yy,getErrorMap:Sye,globalRegistry:ko,gt:Sl,gte:wi,guid:QB,hash:kH,hex:CH,hostname:_H,httpUrl:oH,includes:$x,instanceof:n8,int:Zy,int32:yR,int64:TH,intersection:AR,ipv4:pH,ipv6:hH,iso:LB,json:i8,jwt:wH,keyof:PH,ksuid:fH,lazy:nI,length:vh,literal:Cf,locales:aV,looseObject:zH,looseRecord:UH,lowercase:Ax,lt:wl,lte:jo,mac:mH,map:VH,maxLength:gh,maxSize:Sf,meta:t8,mime:Mx,minLength:Lc,minSize:_l,multipleOf:Zd,nan:ZH,nanoid:sH,nativeEnum:HH,negative:aR,never:l0,nonnegative:lR,nonoptional:GR,nonpositive:sR,normalize:zx,null:SR,nullable:Rm,nullish:KH,number:a0,object:Dt,optional:jm,overwrite:gs,parse:UB,parseAsync:VB,partialRecord:FH,pipe:Im,positive:oR,prefault:KR,preprocess:o8,prettifyError:F6,promise:XH,property:cR,readonly:QR,record:d0,refine:oI,regex:Nx,regexes:Rj,registry:zj,safeDecode:WB,safeDecodeAsync:JB,safeEncode:YB,safeEncodeAsync:XB,safeParse:BB,safeParseAsync:HB,set:BH,setErrorMap:wye,size:hh,slugify:Vx,startsWith:Dx,strictObject:MH,string:tt,stringFormat:SH,stringbool:r8,success:GH,superRefine:aI,symbol:AH,templateLiteral:WH,toJSONSchema:$B,toLowerCase:Fx,toUpperCase:Ux,transform:f0,treeifyError:z6,trim:Lx,tuple:$R,uint32:RH,uint64:NH,ulid:uH,undefined:Em,union:u0,unknown:Fc,uppercase:Ox,url:iH,util:P6,uuid:eH,uuidv4:tH,uuidv6:nH,uuidv7:rH,void:$H,xid:dH,xor:LH},Symbol.toStringTag,{value:"Module"})),kf=gR({error:"Please enter a valid email address."}).toLowerCase().trim(),Rh=tt().nonempty({error:"Please enter your password."}),sI=tt().nonempty({error:"Please enter a username."}),Oye=Dt({username:sI,password:Rh}),$ye=Dt({email:kf,password:Rh});function Dye({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 G2=["localhost","127.0.0.1"];var YC=(e=>(e.MixedLoopback="MixedLoopback",e.InsecureCookieOutsideChromeAndFirefox="InsecureCookieOutsideChromeAndFirefox",e))(YC||{});function Pye(e,t,n){if(!n||!t||!e)return null;const r=new URL(n).hostname,i=G2.includes(t),o=G2.includes(r);if(i&&o&&r!==t)return"MixedLoopback";if(!i&&o){const a=e.indexOf("Chrome")>=0,l=e.indexOf("Firefox")>=0;if(!a&&!l)return"InsecureCookieOutsideChromeAndFirefox"}return null}const Z2=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Pe(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},WC=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?Z2(r.ref,n,e):r&&r.refs&&r.refs.forEach(i=>Z2(i,n,e))}},Y2=(e,t)=>{t.shouldUseNativeValidation&&WC(e,t);const n={};for(const r in e){const i=Pe(t.fields,r),o=Object.assign(e[r]||{},{ref:i&&i.ref});if(Mye(t.names||Object.keys(e),r)){const a=Object.assign({},Pe(n,r));Gt(a,"root",o),Gt(n,r,a)}else Gt(n,r,o)}return n},Mye=(e,t)=>{const n=W2(t);return e.some(r=>W2(r).match(`^${n}\\.\\d+`))};function W2(e){return e.replace(/\]|\[/g,"")}function X2(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function zye(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 l=r.unionErrors[0].errors[0];n[a]={message:l.message,type:l.code}}else n[a]={message:o,type:i};if("unionErrors"in r&&r.unionErrors.forEach(function(m){return m.errors.forEach(function(h){return e.push(h)})}),t){var d=n[a].types,f=d&&d[r.code];n[a]=lj(a,t,n,i,f?[].concat(f,r.message):r.message)}e.shift()}return n}function Lye(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 l=r.errors[0][0];n[a]={message:l.message,type:l.code}}else n[a]={message:o,type:i};if(r.code==="invalid_union"&&r.errors.forEach(function(m){return m.forEach(function(h){return e.push(h)})}),t){var d=n[a].types,f=d&&d[r.code];n[a]=lj(a,t,n,i,f?[].concat(f,r.message):r.message)}e.shift()}return n}function vn(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(X2(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(a){return o.shouldUseNativeValidation&&WC({},o),{errors:{},values:n.raw?Object.assign({},r):a}})},function(a){if((function(l){return Array.isArray(l?.issues)})(a))return{values:{},errors:Y2(zye(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(X2(function(){return Promise.resolve((n.mode==="sync"?Hy:qy)(e,r,t)).then(function(a){return o.shouldUseNativeValidation&&WC({},o),{errors:{},values:n.raw?Object.assign({},r):a}})},function(a){if((function(l){return l instanceof Rx})(a))return{values:{},errors:Y2(Lye(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 lI(){const{clusterId:e,instanceId:t}=rt({strict:!1}),{data:n}=Mt(Dl(e,!0)),r=b.useMemo(()=>t&&n&&n?.instances?.find(k=>k.id===t)||void 0,[n,t]),i=b.useMemo(()=>n?.status&&Sx.includes(n.status),[n?.status]),o="Local",a="instance",l=b.useMemo(()=>n?r?(kt.flagForFabricConnect(r.id,!1),Jk(r)):(kt.flagForFabricConnect(n.id,!1),Xk(n)):null,[n,r]),d=Wt(l),f=b.useMemo(()=>l?.includes("localhost")||l?.includes("127.0.0.1"),[l]),m=b.useMemo(()=>Pye(navigator.userAgent,location.hostname,l),[l]),{data:h}=Mt(Dye(d)),v=un({resolver:vn(Oye),defaultValues:{username:"",password:""}}),{control:y,handleSubmit:x}=v,{submitForm:S,isPending:C}=she({cluster:n,instance:r,instanceParams:d});return!t&&n&&!n?.fqdn?u.jsx(jc,{to:"../instances",replace:!0}):i&&n?.resetPassword?u.jsx(jc,{to:`/${n.organizationId}/${n.id}/finish-setup`,replace:!0}):!i&&n?.resetPassword?u.jsx(jc,{to:`/${n.organizationId}/${n.id}/starting-up`,replace:!0}):u.jsxs(u.Fragment,{children:[!xd,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(dn,{...v,children:u.jsxs("form",{onSubmit:x(S),className:"my-4",children:[u.jsx(De,{control:y,name:"username",render:({field:k})=>u.jsxs(Te,{className:"my-4",children:[u.jsx(Ne,{children:"Username"}),u.jsx(Oe,{children:u.jsx(ze,{autoComplete:"username",autoFocus:!0,type:"text",...k})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:y,name:"password",render:({field:k})=>u.jsxs(Te,{className:"my-4",children:[u.jsx(Ne,{children:"Password"}),u.jsx(Oe,{children:u.jsx(ze,{type:"password",...k})}),u.jsx(Ae,{})]})}),u.jsx(xe,{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:`${l}health`,className:"underline",target:"_blank",children:[l,"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",rel:"noreferrer",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",rel:"noreferrer",children:"local network access"})," ","in your browser?"]})]})]}),m===YC.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."]}),m===YC.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(Ze,{to:ohe(),target:"_blank",children:u.jsx(xe,{type:"button",variant:"positive",children:"Connect to Harper Fabric"})})})]})]})})]})})]})}async function Fye({email:e}){const{data:t}=await Yt.post("/ForgotPassword/",{email:e});if(t)return t;throw new Error("Something went wrong")}function Uye(){return ut({mutationFn:e=>Fye(e)})}const Vye=Dt({email:kf});function Bye(){const e=jn(),{me:t}=Tr({strict:!1}),n=un({resolver:vn(Vye),defaultValues:{email:t||""}}),r=n.watch("email"),{setFocus:i,control:o,handleSubmit:a}=n;b.useEffect(()=>{i("email")},[i]);const{mutate:l,isPending:d}=Uye(),f=async m=>{l(m,{onSuccess:h=>{Se.success("Success",{description:`${h}`,action:{label:"Dismiss",onClick:()=>Se.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(dn,{...n,children:u.jsxs("form",{onSubmit:a(f),className:"my-4",children:[u.jsx(De,{control:o,name:"email",render:({field:m})=>u.jsxs(Te,{className:"my-2",children:[u.jsx(Ne,{children:"Email"}),u.jsx(Oe,{children:u.jsx(ze,{disabled:d,type:"email",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...m})}),u.jsx(Ae,{})]})}),u.jsx(xe,{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(Ze,{className:"text-sm hover:text-blue-300",to:"/sign-in",search:{me:r},children:"Sign in to your account"}),u.jsx(Ze,{className:"text-sm hover:text-blue-300",to:"/sign-up",search:{me:r},children:"Sign up for free"})]})]})}const Hye=async({token:e,password:t})=>{const{data:n}=await Yt.put("/ResetPassword/",{token:e,newPassword:t});return n};function qye(){return ut({mutationFn:e=>Hye(e)})}const Kye=Dt({password:Rh.min(8,{error:"Password must be at least 8 characters long."}).max(50,{error:"Password cannot be longer than 50 characters."}),confirmPassword:tt()}).refine(e=>e.password===e.confirmPassword,{error:"Passwords do not match.",path:["confirmPassword"]});function Gye(){const{token:e}=Tr({strict:!1}),t=jn();b.useEffect(()=>{e||t({to:"/sign-in"})},[e,t]);const n=un({resolver:vn(Kye),defaultValues:{password:"",confirmPassword:""}}),{setFocus:r,control:i,handleSubmit:o}=n;b.useEffect(()=>{r("password")},[r]);const{mutate:a,isPending:l}=qye(),d=b.useCallback(async f=>{a({token:e,password:f.password},{onSuccess:()=>{Se.success("Success",{description:"Your password has been reset successfully.",action:{label:"Dismiss",onClick:()=>Se.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(dn,{...n,children:u.jsxs("form",{className:"my-4",onSubmit:o(d),children:[u.jsx(De,{control:i,name:"password",render:({field:f})=>u.jsxs(Te,{className:"my-2",children:[u.jsx(Ne,{children:"New Password"}),u.jsx(Oe,{children:u.jsx(ze,{disabled:l,type:"password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...f})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:i,name:"confirmPassword",render:({field:f})=>u.jsxs(Te,{className:"my-2",children:[u.jsx(Ne,{children:"Confirm Password"}),u.jsx(Oe,{children:u.jsx(ze,{disabled:l,type:"password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...f})}),u.jsx(Ae,{})]})}),u.jsx(xe,{variant:"submit",type:"submit",disabled:l,className:"w-full my-2 rounded-full",children:"Submit New Password"})]})})]})}function s8({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(cE,{className:"github-icon"}),e]})})}function l8({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 Zye(){const e=jn(),t=ir(),n=_n(),{redirect:r}=Tr({strict:!1}),{mutate:i,isPending:o}=Yye(),a=b.useCallback(l=>{i(l,{onSuccess:async d=>{kt.setUserForEntity($n,d);const f=Yc(d);VE(d.email),await t.invalidateQueries({queryKey:Ib,refetchType:"none"}),n.invalidate(),await e({to:r?.startsWith("/")?r:f})}})},[e,t,r,n,i]);return{isPending:o,submitForm:a}}function Yye(){return ut({mutationFn:e=>Wye(e)})}async function Wye({email:e,password:t}){const{data:n}=await Yt.post("/Login/",{email:e,password:t});if(n)return n;throw new Error("Something went wrong")}function Xye(){const{me:e}=Tr({strict:!1}),t=un({resolver:vn($ye),defaultValues:{email:e||"",password:""}}),{handleSubmit:n,control:r}=t,i=t.watch("email"),{submitForm:o,isPending:a}=Zye();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(dn,{...t,children:u.jsxs("form",{onSubmit:n(o),className:"my-4",children:[u.jsx(De,{control:r,name:"email",render:({field:l})=>u.jsxs(Te,{className:"my-4",children:[u.jsx(Ne,{children:"Email"}),u.jsx(Oe,{children:u.jsx(ze,{type:"email",autoFocus:!0,className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...l})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:r,name:"password",render:({field:l})=>u.jsxs(Te,{className:"my-4",children:[u.jsx(Ne,{children:"Password"}),u.jsx(Oe,{children:u.jsx(ze,{type:"password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...l})}),u.jsx(Ae,{})]})}),u.jsx(xe,{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(Ze,{className:"text-sm hover:text-blue-300",to:"/sign-up",search:{me:i},children:"Sign up for free"}),u.jsx(Ze,{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(l8,{text:"Sign in with Google"}),u.jsx(s8,{text:"Sign in with GitHub"})]})]})}const J2=/^[a-zA-ZàáâäãåąčćęèéêëėįìíîïłńòóôöõøùúûüųūÿýżźñçčšžæÀÁÂÄÃÅĄĆČĖĘÈÉÊËÌÍÎÏĮŁŃÒÓÔÖÕØÙÚÛÜŲŪŸÝŻŹÑßÇŒÆČŠŽ∂ð ,'-]+$/u;async function Jye(e){const{data:t}=await Yt.post("/User/",e);if(t)return t;throw new Error("Something went wrong")}function Qye(){return ut({mutationFn:e=>Jye(e)})}const ebe=Dt({email:kf.max(80,{error:"Email cannot be longer than 80 characters."}),firstname:tt().trim().min(2,{error:"Please enter your first name."}).regex(J2,{error:"First name can only contain letters, spaces, and hyphens."}).max(40,{error:"First name cannot be longer than 40 characters."}),lastname:tt().trim().min(2,{error:"Please enter your last name."}).regex(J2,{error:"Last name can only contain letters, spaces, and hyphens."}).max(80,{error:"Last name cannot be longer than 80 characters."}),password:Rh.min(8,{error:"Password must be at least 8 characters long."}),confirmPassword:tt()}).refine(e=>e.password===e.confirmPassword,{error:"Passwords do not match.",path:["confirmPassword"]});function tbe(){const e=jn(),{email:t,me:n}=Tr({strict:!1}),r=un({resolver:vn(ebe),defaultValues:{firstname:"",lastname:"",email:n||t||"",password:"",confirmPassword:""}}),i=r.watch("email"),{setFocus:o,control:a,handleSubmit:l}=r;b.useEffect(()=>{o("firstname")},[o]);const{mutate:d}=Qye(),f=b.useCallback(async m=>{const{confirmPassword:h,...v}=m;d(v,{onSuccess:()=>{VE(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(l8,{text:"Sign up with Google"}),u.jsx(s8,{text:"Sign up with GitHub"})]}),u.jsx("hr",{className:"border-gray-600"}),u.jsx(dn,{...r,children:u.jsxs("form",{onSubmit:l(f),className:"grid gap-4 my-4",children:[u.jsx(De,{control:a,name:"firstname",render:({field:m})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"First Name"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",autoCapitalize:"words",...m})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:a,name:"lastname",render:({field:m})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Last Name"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",autoCapitalize:"words",...m})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:a,name:"email",render:({field:m})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Email"}),u.jsx(Oe,{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",...m})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:a,name:"password",render:({field:m})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Password"}),u.jsx(Oe,{children:u.jsx(ze,{type:"password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...m})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:a,name:"confirmPassword",render:({field:m})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Confirm Password"}),u.jsx(Oe,{children:u.jsx(ze,{type:"password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...m})}),u.jsx(Ae,{})]})}),u.jsxs("p",{className:"text-xs",children:["By creating an account, you agree to the"," ",u.jsx("a",{href:"https://www.harper.fast/resources/privacy-policy",target:"_blank",rel:"noreferrer",className:"underline hover:text-blue-300",children:"Privacy Policy"})," ","and"," ",u.jsx("a",{href:"https://www.harper.fast/resources/paas-terms-of-service",target:"_blank",rel:"noreferrer",className:"underline hover:text-blue-300",children:"Terms of Service"})]}),u.jsx(xe,{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(Ze,{className:"m-auto text-sm hover:text-blue-300",to:"/sign-in",search:{me:i},children:"Already have an account? Sign in instead."})})]})}const nbe=async({email:e})=>{const{data:t}=await Yt.post("/ResendVerificationEmail/",{email:e});return t};function c8(){return ut({mutationFn:e=>nbe(e)})}const rbe=async e=>{const{data:t}=await Yt.put("/VerifyEmail/",{token:e.toString()});return t};function ibe(){return ut({mutationFn:e=>rbe(e)})}const obe=Dt({email:kf});function abe(){const e=jn(),{mutate:t,isPending:n}=c8(),r=un({resolver:vn(obe),defaultValues:{email:""}}),i=r.watch("email"),{setFocus:o,control:a,handleSubmit:l}=r;b.useEffect(()=>{o("email")},[o]);const d=b.useCallback(async f=>{t(f,{onSuccess:m=>{Se.success("Success",{description:`${m}`,action:{label:"Dismiss",onClick:()=>Se.dismiss()}}),e({to:"/sign-in",search:{me:i}})}})},[i,e,t]);return u.jsxs(dn,{...r,children:[u.jsx("p",{className:"text-sm py-2",children:"Please Enter an Email"}),u.jsxs("form",{onSubmit:l(d),className:"my-4",children:[u.jsx(De,{control:a,name:"email",render:({field:f})=>u.jsxs(Te,{className:"my-2",children:[u.jsx(Ne,{children:"Email"}),u.jsx(Oe,{children:u.jsx(ze,{disabled:n,type:"email",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...f})}),u.jsx(Ae,{})]})}),u.jsx(xe,{type:"submit",variant:"submit",disabled:n,className:"w-full my-2 rounded-full",children:"Send Verification Email"})]})]})}function sbe(){const{token:e}=Tr({strict:!1}),t=jn(),{mutate:n,isPending:r}=ibe(),i=b.useCallback(o=>{n(o,{onSuccess:()=>{Se.success("Success",{description:"Email verified successfully",action:{label:"Dismiss",onClick:()=>Se.dismiss()}}),t({to:"/sign-in"})}})},[n,t]);return b.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(abe,{})]})}function lbe(){const{email:e}=Tr({strict:!1}),{mutate:t,isPending:n}=c8(),r=b.useCallback(i=>(i.preventDefault(),e&&t({email:e},{onSuccess:o=>{Se.success("Code Sent",{description:`${o}`,action:{label:"Dismiss",onClick:()=>Se.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(Ze,{className:"text-sm hover:text-blue-300",to:"/sign-in",search:{me:e},children:"I did it, let me sign in!"}),u.jsx(Ze,{className:"text-sm opacity-50 hover:text-blue-300",to:void 0,onClick:r,disabled:n,children:"Send me another code, please."})]})]})}const zl=nt({getParentRoute:()=>rx,id:"_authLayout",component:Bfe}),cbe=nt({getParentRoute:()=>zl,path:"sign-in",component:Xye,beforeLoad:({context:e,location:t})=>{const n=e.authentication[$n]?.user;if(n){const r=t?.search,i=Yc(n);throw Kc({to:r?.redirect?.startsWith("/")?r.redirect:i})}}}),ube=nt({getParentRoute:()=>rx,path:"sign-in",component:lI,beforeLoad:({context:e,location:t})=>{if(e.authentication[$n]?.user){const n=t?.search;throw Kc({to:n?.redirect?.startsWith("/")?n.redirect:ba})}}}),dbe=nt({getParentRoute:()=>zl,path:"sign-up",component:tbe}),fbe=nt({getParentRoute:()=>zl,path:"forgot-password",component:Bye}),pbe=nt({getParentRoute:()=>zl,path:"verify-email",component:sbe}),mbe=nt({getParentRoute:()=>zl,path:"verifying",component:lbe}),hbe=nt({getParentRoute:()=>zl,path:"check-oauth",component:Kfe}),gbe=nt({getParentRoute:()=>zl,path:"reset-password",component:Gye});zl.addChildren([cbe,dbe,hbe,fbe,pbe,mbe,gbe]);const vbe=[ube];function vs({children:e}){return u.jsx("nav",{className:"fixed top-20 w-full h-12 z-39 py-2 px-4 md:px-12 bg-grey-700",children:u.jsxs("div",{className:"flex items-center h-full space-x-2",children:[u.jsx(gx,{}),e]})})}function u8(e){if(XC(e)||JC(e))return"warning";if(d8(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 d8(e){switch(e){case"RUNNING":case"UPDATED":return!0;default:return!1}}function Ih(e){return e==="FAILED"}function cI(e){return e==="TERMINATED"}function XC(e){return e==="CLONE_PENDING"}function JC(e){switch(e){case"PROVISIONING":case"CLONING":case"CLONE_READY":case"UPDATING_HDB_NODES":case"UPDATING":return!0;default:return!1}}var o1="focusScope.autoFocusOnMount",a1="focusScope.autoFocusOnUnmount",Q2={bubbles:!1,cancelable:!0},ybe="FocusScope",v0=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[l,d]=b.useState(null),f=Tn(i),m=Tn(o),h=b.useRef(null),v=pt(t,S=>d(S)),y=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let S=function(j){if(y.paused||!l)return;const R=j.target;l.contains(R)?h.current=R:Zs(h.current,{select:!0})},C=function(j){if(y.paused||!l)return;const R=j.relatedTarget;R!==null&&(l.contains(R)||Zs(h.current,{select:!0}))},k=function(j){if(document.activeElement===document.body)for(const N of j)N.removedNodes.length>0&&Zs(l)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const E=new MutationObserver(k);return l&&E.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),E.disconnect()}}},[r,l,y.paused]),b.useEffect(()=>{if(l){tP.add(y);const S=document.activeElement;if(!l.contains(S)){const k=new CustomEvent(o1,Q2);l.addEventListener(o1,f),l.dispatchEvent(k),k.defaultPrevented||(bbe(Cbe(f8(l)),{select:!0}),document.activeElement===S&&Zs(l))}return()=>{l.removeEventListener(o1,f),setTimeout(()=>{const k=new CustomEvent(a1,Q2);l.addEventListener(a1,m),l.dispatchEvent(k),k.defaultPrevented||Zs(S??document.body,{select:!0}),l.removeEventListener(a1,m),tP.remove(y)},0)}}},[l,f,m,y]);const x=b.useCallback(S=>{if(!n&&!r||y.paused)return;const C=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,k=document.activeElement;if(C&&k){const E=S.currentTarget,[j,R]=xbe(E);j&&R?!S.shiftKey&&k===R?(S.preventDefault(),n&&Zs(j,{select:!0})):S.shiftKey&&k===j&&(S.preventDefault(),n&&Zs(R,{select:!0})):k===E&&S.preventDefault()}},[n,r,y.paused]);return u.jsx(Ye.div,{tabIndex:-1,...a,ref:v,onKeyDown:x})});v0.displayName=ybe;function bbe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Zs(r,{select:t}),document.activeElement!==n)return}function xbe(e){const t=f8(e),n=eP(t,e),r=eP(t.reverse(),e);return[n,r]}function f8(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 eP(e,t){for(const n of e)if(!wbe(n,{upTo:t}))return n}function wbe(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 Sbe(e){return e instanceof HTMLInputElement&&"select"in e}function Zs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Sbe(e)&&t&&e.select()}}var tP=_be();function _be(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=nP(e,t),e.unshift(t)},remove(t){e=nP(e,t),e[0]?.resume()}}}function nP(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Cbe(e){return e.filter(t=>t.tagName!=="A")}var s1=0;function uI(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??rP()),document.body.insertAdjacentElement("beforeend",e[1]??rP()),s1++,()=>{s1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),s1--}},[])}function rP(){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 QC=function(e,t){return QC=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])},QC(e,t)};function P2e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");QC(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ca=function(){return ca=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},ca.apply(this,arguments)};function p8(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 iu(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 l(m){try{f(r.next(m))}catch(h){a(h)}}function d(m){try{f(r.throw(m))}catch(h){a(h)}}function f(m){m.done?o(m.value):i(m.value).then(l,d)}f((r=r.apply(e,t||[])).next())})}function kbe(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 cy="right-scroll-bar-position",uy="width-before-scroll-bar",Ebe="with-scroll-bars-hidden",jbe="--removed-body-scroll-bar-size";function l1(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Rbe(e,t){var n=b.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 Ibe=typeof window<"u"?b.useLayoutEffect:b.useEffect,iP=new WeakMap;function Tbe(e,t){var n=Rbe(null,function(r){return e.forEach(function(i){return l1(i,r)})});return Ibe(function(){var r=iP.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(l){o.has(l)||l1(l,null)}),o.forEach(function(l){i.has(l)||l1(l,a)})}iP.set(n,e)},[e]),n}function Nbe(e){return e}function Abe(e,t){t===void 0&&(t=Nbe);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(l){return l!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(l){return o(l)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(o),a=n}var d=function(){var m=a;a=[],m.forEach(o)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(m){a.push(m),f()},filter:function(m){return a=a.filter(m),n}}}};return i}function Obe(e){e===void 0&&(e={});var t=Abe(null);return t.options=ca({async:!0,ssr:!1},e),t}var m8=function(e){var t=e.sideCar,n=p8(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 b.createElement(r,ca({},n))};m8.isSideCarExport=!0;function $be(e,t){return e.useMedium(t),m8}var h8=Obe(),c1=function(){},y0=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:c1,onWheelCapture:c1,onTouchMoveCapture:c1}),i=r[0],o=r[1],a=e.forwardProps,l=e.children,d=e.className,f=e.removeScrollBar,m=e.enabled,h=e.shards,v=e.sideCar,y=e.noRelative,x=e.noIsolation,S=e.inert,C=e.allowPinchZoom,k=e.as,E=k===void 0?"div":k,j=e.gapMode,R=p8(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=v,T=Tbe([n,t]),A=ca(ca({},R),i);return b.createElement(b.Fragment,null,m&&b.createElement(N,{sideCar:h8,removeScrollBar:f,shards:h,noRelative:y,noIsolation:x,inert:S,setCallbacks:o,allowPinchZoom:!!C,lockRef:n,gapMode:j}),a?b.cloneElement(b.Children.only(l),ca(ca({},A),{ref:T})):b.createElement(E,ca({},A,{className:d,ref:T}),l))});y0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};y0.classNames={fullWidth:uy,zeroRight:cy};var Dbe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Pbe(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Dbe();return t&&e.setAttribute("nonce",t),e}function Mbe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function zbe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Lbe=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Pbe())&&(Mbe(t,n),zbe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Fbe=function(){var e=Lbe();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},g8=function(){var e=Fbe(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Ube={left:0,top:0,right:0,gap:0},u1=function(e){return parseInt(e||"",10)||0},Vbe=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[u1(n),u1(r),u1(i)]},Bbe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Ube;var t=Vbe(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])}},Hbe=g8(),Ed="data-scroll-locked",qbe=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),`
86
- .`.concat(Ebe,` {
87
- overflow: hidden `).concat(r,`;
88
- padding-right: `).concat(l,"px ").concat(r,`;
89
- }
90
- body[`).concat(Ed,`] {
91
- overflow: hidden `).concat(r,`;
92
- overscroll-behavior: contain;
93
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
94
- padding-left: `.concat(i,`px;
95
- padding-top: `).concat(o,`px;
96
- padding-right: `).concat(a,`px;
97
- margin-left:0;
98
- margin-top:0;
99
- margin-right: `).concat(l,"px ").concat(r,`;
100
- `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
101
- }
102
-
103
- .`).concat(cy,` {
104
- right: `).concat(l,"px ").concat(r,`;
105
- }
106
-
107
- .`).concat(uy,` {
108
- margin-right: `).concat(l,"px ").concat(r,`;
109
- }
110
-
111
- .`).concat(cy," .").concat(cy,` {
112
- right: 0 `).concat(r,`;
113
- }
114
-
115
- .`).concat(uy," .").concat(uy,` {
116
- margin-right: 0 `).concat(r,`;
117
- }
118
-
119
- body[`).concat(Ed,`] {
120
- `).concat(jbe,": ").concat(l,`px;
121
- }
122
- `)},oP=function(){var e=parseInt(document.body.getAttribute(Ed)||"0",10);return isFinite(e)?e:0},Kbe=function(){b.useEffect(function(){return document.body.setAttribute(Ed,(oP()+1).toString()),function(){var e=oP()-1;e<=0?document.body.removeAttribute(Ed):document.body.setAttribute(Ed,e.toString())}},[])},Gbe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Kbe();var o=b.useMemo(function(){return Bbe(i)},[i]);return b.createElement(Hbe,{styles:qbe(o,!t,i,n?"":"!important")})},ek=!1;if(typeof window<"u")try{var Ev=Object.defineProperty({},"passive",{get:function(){return ek=!0,!0}});window.addEventListener("test",Ev,Ev),window.removeEventListener("test",Ev,Ev)}catch{ek=!1}var id=ek?{passive:!1}:!1,Zbe=function(e){return e.tagName==="TEXTAREA"},v8=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Zbe(e)&&n[t]==="visible")},Ybe=function(e){return v8(e,"overflowY")},Wbe=function(e){return v8(e,"overflowX")},aP=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=y8(e,r);if(i){var o=b8(e,r),a=o[1],l=o[2];if(a>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Xbe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Jbe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},y8=function(e,t){return e==="v"?Ybe(t):Wbe(t)},b8=function(e,t){return e==="v"?Xbe(t):Jbe(t)},Qbe=function(e,t){return e==="h"&&t==="rtl"?-1:1},exe=function(e,t,n,r,i){var o=Qbe(e,window.getComputedStyle(t).direction),a=o*r,l=n.target,d=t.contains(l),f=!1,m=a>0,h=0,v=0;do{if(!l)break;var y=b8(e,l),x=y[0],S=y[1],C=y[2],k=S-C-o*x;(x||k)&&y8(e,l)&&(h+=k,v+=x);var E=l.parentNode;l=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!d&&l!==document.body||d&&(t.contains(l)||t===l));return(m&&Math.abs(h)<1||!m&&Math.abs(v)<1)&&(f=!0),f},jv=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sP=function(e){return[e.deltaX,e.deltaY]},lP=function(e){return e&&"current"in e?e.current:e},txe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},nxe=function(e){return`
123
- .block-interactivity-`.concat(e,` {pointer-events: none;}
124
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
125
- `)},rxe=0,od=[];function ixe(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),i=b.useState(rxe++)[0],o=b.useState(g8)[0],a=b.useRef(e);b.useEffect(function(){a.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var S=kbe([e.lockRef.current],(e.shards||[]).map(lP),!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 l=b.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!a.current.allowPinchZoom;var k=jv(S),E=n.current,j="deltaX"in S?S.deltaX:E[0]-k[0],R="deltaY"in S?S.deltaY:E[1]-k[1],N,T=S.target,A=Math.abs(j)>Math.abs(R)?"h":"v";if("touches"in S&&A==="h"&&T.type==="range")return!1;var D=aP(A,T);if(!D)return!0;if(D?N=A:(N=A==="v"?"h":"v",D=aP(A,T)),!D)return!1;if(!r.current&&"changedTouches"in S&&(j||R)&&(r.current=N),!N)return!0;var F=r.current||N;return exe(F,C,S,F==="h"?j:R)},[]),d=b.useCallback(function(S){var C=S;if(!(!od.length||od[od.length-1]!==o)){var k="deltaY"in C?sP(C):jv(C),E=t.current.filter(function(N){return N.name===C.type&&(N.target===C.target||C.target===N.shadowParent)&&txe(N.delta,k)})[0];if(E&&E.should){C.cancelable&&C.preventDefault();return}if(!E){var j=(a.current.shards||[]).map(lP).filter(Boolean).filter(function(N){return N.contains(C.target)}),R=j.length>0?l(C,j[0]):!a.current.noIsolation;R&&C.cancelable&&C.preventDefault()}}},[]),f=b.useCallback(function(S,C,k,E){var j={name:S,delta:C,target:k,should:E,shadowParent:oxe(k)};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(R){return R!==j})},1)},[]),m=b.useCallback(function(S){n.current=jv(S),r.current=void 0},[]),h=b.useCallback(function(S){f(S.type,sP(S),S.target,l(S,e.lockRef.current))},[]),v=b.useCallback(function(S){f(S.type,jv(S),S.target,l(S,e.lockRef.current))},[]);b.useEffect(function(){return od.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:v}),document.addEventListener("wheel",d,id),document.addEventListener("touchmove",d,id),document.addEventListener("touchstart",m,id),function(){od=od.filter(function(S){return S!==o}),document.removeEventListener("wheel",d,id),document.removeEventListener("touchmove",d,id),document.removeEventListener("touchstart",m,id)}},[]);var y=e.removeScrollBar,x=e.inert;return b.createElement(b.Fragment,null,x?b.createElement(o,{styles:nxe(i)}):null,y?b.createElement(Gbe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function oxe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const axe=$be(h8,ixe);var b0=b.forwardRef(function(e,t){return b.createElement(y0,ca({},e,{ref:t,sideCar:axe}))});b0.classNames=y0.classNames;var sxe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ad=new WeakMap,Rv=new WeakMap,Iv={},d1=0,x8=function(e){return e&&(e.host||x8(e.parentNode))},lxe=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=x8(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})},cxe=function(e,t,n,r){var i=lxe(t,Array.isArray(e)?e:[e]);Iv[n]||(Iv[n]=new WeakMap);var o=Iv[n],a=[],l=new Set,d=new Set(i),f=function(h){!h||l.has(h)||(l.add(h),f(h.parentNode))};i.forEach(f);var m=function(h){!h||d.has(h)||Array.prototype.forEach.call(h.children,function(v){if(l.has(v))m(v);else try{var y=v.getAttribute(r),x=y!==null&&y!=="false",S=(ad.get(v)||0)+1,C=(o.get(v)||0)+1;ad.set(v,S),o.set(v,C),a.push(v),S===1&&x&&Rv.set(v,!0),C===1&&v.setAttribute(n,"true"),x||v.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",v,k)}})};return m(t),l.clear(),d1++,function(){a.forEach(function(h){var v=ad.get(h)-1,y=o.get(h)-1;ad.set(h,v),o.set(h,y),v||(Rv.has(h)||h.removeAttribute(r),Rv.delete(h)),y||h.removeAttribute(n)}),d1--,d1||(ad=new WeakMap,ad=new WeakMap,Rv=new WeakMap,Iv={})}},dI=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=sxe(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),cxe(r,i,n,"aria-hidden")):function(){return null}},x0="Dialog",[w8]=Qi(x0),[uxe,Qo]=w8(x0),S8=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,l=b.useRef(null),d=b.useRef(null),[f,m]=Ko({prop:r,defaultProp:i??!1,onChange:o,caller:x0});return u.jsx(uxe,{scope:t,triggerRef:l,contentRef:d,contentId:Vi(),titleId:Vi(),descriptionId:Vi(),open:f,onOpenChange:m,onOpenToggle:b.useCallback(()=>m(h=>!h),[m]),modal:a,children:n})};S8.displayName=x0;var _8="DialogTrigger",C8=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Qo(_8,n),o=pt(t,i.triggerRef);return u.jsx(Ye.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":mI(i.open),...r,ref:o,onClick:Ie(e.onClick,i.onOpenToggle)})});C8.displayName=_8;var fI="DialogPortal",[dxe,k8]=w8(fI,{forceMount:void 0}),E8=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Qo(fI,t);return u.jsx(dxe,{scope:t,forceMount:n,children:b.Children.map(r,a=>u.jsx(or,{present:n||o.open,children:u.jsx(nh,{asChild:!0,container:i,children:a})}))})};E8.displayName=fI;var Wy="DialogOverlay",j8=b.forwardRef((e,t)=>{const n=k8(Wy,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Qo(Wy,e.__scopeDialog);return o.modal?u.jsx(or,{present:r||o.open,children:u.jsx(pxe,{...i,ref:t})}):null});j8.displayName=Wy;var fxe=Ud("DialogOverlay.RemoveScroll"),pxe=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Qo(Wy,n);return u.jsx(b0,{as:fxe,allowPinchZoom:!0,shards:[i.contentRef],children:u.jsx(Ye.div,{"data-state":mI(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Uc="DialogContent",R8=b.forwardRef((e,t)=>{const n=k8(Uc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Qo(Uc,e.__scopeDialog);return u.jsx(or,{present:r||o.open,children:o.modal?u.jsx(mxe,{...i,ref:t}):u.jsx(hxe,{...i,ref:t})})});R8.displayName=Uc;var mxe=b.forwardRef((e,t)=>{const n=Qo(Uc,e.__scopeDialog),r=b.useRef(null),i=pt(t,n.contentRef,r);return b.useEffect(()=>{const o=r.current;if(o)return dI(o)},[]),u.jsx(I8,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ie(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Ie(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0;(a.button===2||l)&&o.preventDefault()}),onFocusOutside:Ie(e.onFocusOutside,o=>o.preventDefault())})}),hxe=b.forwardRef((e,t)=>{const n=Qo(Uc,e.__scopeDialog),r=b.useRef(!1),i=b.useRef(!1);return u.jsx(I8,{...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()}})}),I8=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,l=Qo(Uc,n),d=b.useRef(null),f=pt(t,d);return uI(),u.jsxs(u.Fragment,{children:[u.jsx(v0,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:u.jsx(gf,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":mI(l.open),...a,ref:f,onDismiss:()=>l.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(gxe,{titleId:l.titleId}),u.jsx(yxe,{contentRef:d,descriptionId:l.descriptionId})]})]})}),pI="DialogTitle",T8=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Qo(pI,n);return u.jsx(Ye.h2,{id:i.titleId,...r,ref:t})});T8.displayName=pI;var N8="DialogDescription",A8=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Qo(N8,n);return u.jsx(Ye.p,{id:i.descriptionId,...r,ref:t})});A8.displayName=N8;var O8="DialogClose",$8=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Qo(O8,n);return u.jsx(Ye.button,{type:"button",...r,ref:t,onClick:Ie(e.onClick,()=>i.onOpenChange(!1))})});$8.displayName=O8;function mI(e){return e?"open":"closed"}var D8="DialogTitleWarning",[M2e,P8]=zde(D8,{contentName:Uc,titleName:pI,docsSlug:"dialog"}),gxe=({titleId:e})=>{const t=P8(D8),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
126
-
127
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
128
-
129
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},vxe="DialogDescriptionWarning",yxe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${P8(vxe).contentName}}.`;return b.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},bxe=S8,xxe=C8,wxe=E8,Sxe=j8,_xe=R8,Cxe=T8,kxe=A8,Exe=$8;function Un({...e}){return u.jsx(bxe,{"data-slot":"dialog",...e})}function M8({...e}){return u.jsx(xxe,{"data-slot":"dialog-trigger",...e})}function jxe({...e}){return u.jsx(wxe,{"data-slot":"dialog-portal",...e})}function Rxe({className:e,...t}){return u.jsx(Sxe,{"data-slot":"dialog-overlay",className:Ue("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 Vn({className:e,children:t,...n}){return u.jsxs(jxe,{"data-slot":"dialog-portal",children:[u.jsx(Rxe,{}),u.jsxs(_xe,{"data-slot":"dialog-content",className:Ue("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(Exe,{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(G4,{className:"text-white"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function wr({className:e,...t}){return u.jsx("div",{"data-slot":"dialog-header",className:Ue("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Yn({className:e,...t}){return u.jsx("div",{"data-slot":"dialog-footer",className:Ue("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Pn({className:e,...t}){return u.jsx(Cxe,{"data-slot":"dialog-title",className:Ue("text-lg leading-none text-white font-semibold",e),...t})}function Ir({className:e,...t}){return u.jsx(kxe,{"data-slot":"dialog-description",className:Ue("text-muted-foreground text-sm",e),...t})}function w0({typeOfThingBeingDeleted:e,nameOfThingBeingDeleted:t,isModalOpen:n,hideDataLossWarning:r,setIsModalOpen:i,deletionConfirmed:o,deletionPending:a,trigger:l,presentParticiple:d="Deleting",transitiveVerb:f="Delete"}){return u.jsxs(Un,{open:n,onOpenChange:i,children:[l&&u.jsx(M8,{asChild:!0,children:l}),u.jsxs(Vn,{className:"sm:max-w-[750px]",children:[u.jsxs(wr,{children:[u.jsxs(Pn,{children:["Are you sure you want to ",f.toLowerCase()," this ",e,"?"]}),u.jsx(Ir,{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(Tne,{className:"inline-block size-5"})," ",u.jsx("span",{children:"Warning"})]}),u.jsxs("p",{className:"pt-2 text-base",children:["By ",d.toLowerCase()," ",e," ",u.jsx("span",{className:"font-semibold",children:t})," ","you will lose the data stored in it permanently."]})]}),u.jsx(Yn,{children:u.jsxs("div",{className:"flex justify-center space-x-5",children:[u.jsxs(xe,{className:"rounded-full",onClick:()=>i(!1),children:[u.jsx(Pc,{})," Cancel"]}),u.jsxs(xe,{variant:"destructive",className:"rounded-full",onClick:o,disabled:a,children:[u.jsx(Ca,{})," ",f]})]})})]})]})}function Yo({className:e,variant:t,asChild:n=!1,...r}){const i=n?aE:"span";return u.jsx(i,{"data-slot":"badge",className:Ue(xU({variant:t}),e),...r})}var f1="rovingFocusGroup.onEntryFocus",Ixe={bubbles:!1,cancelable:!0},Th="RovingFocusGroup",[tk,z8,Txe]=Qm(Th),[Nxe,Ef]=Qi(Th,[Txe]),[Axe,Oxe]=Nxe(Th),L8=b.forwardRef((e,t)=>u.jsx(tk.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(tk.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx($xe,{...e,ref:t})})}));L8.displayName=Th;var $xe=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:m=!1,...h}=e,v=b.useRef(null),y=pt(t,v),x=eu(o),[S,C]=Ko({prop:a,defaultProp:l??null,onChange:d,caller:Th}),[k,E]=b.useState(!1),j=Tn(f),R=z8(n),N=b.useRef(!1),[T,A]=b.useState(0);return b.useEffect(()=>{const D=v.current;if(D)return D.addEventListener(f1,j),()=>D.removeEventListener(f1,j)},[j]),u.jsx(Axe,{scope:n,orientation:r,dir:x,loop:i,currentTabStopId:S,onItemFocus:b.useCallback(D=>C(D),[C]),onItemShiftTab:b.useCallback(()=>E(!0),[]),onFocusableItemAdd:b.useCallback(()=>A(D=>D+1),[]),onFocusableItemRemove:b.useCallback(()=>A(D=>D-1),[]),children:u.jsx(Ye.div,{tabIndex:k||T===0?-1:0,"data-orientation":r,...h,ref:y,style:{outline:"none",...e.style},onMouseDown:Ie(e.onMouseDown,()=>{N.current=!0}),onFocus:Ie(e.onFocus,D=>{const F=!N.current;if(D.target===D.currentTarget&&F&&!k){const K=new CustomEvent(f1,Ixe);if(D.currentTarget.dispatchEvent(K),!K.defaultPrevented){const te=R().filter(z=>z.focusable),G=te.find(z=>z.active),q=te.find(z=>z.id===S),H=[G,q,...te].filter(Boolean).map(z=>z.ref.current);V8(H,m)}}N.current=!1}),onBlur:Ie(e.onBlur,()=>E(!1))})})}),F8="RovingFocusGroupItem",U8=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:a,...l}=e,d=Vi(),f=o||d,m=Oxe(F8,n),h=m.currentTabStopId===f,v=z8(n),{onFocusableItemAdd:y,onFocusableItemRemove:x,currentTabStopId:S}=m;return b.useEffect(()=>{if(r)return y(),()=>x()},[r,y,x]),u.jsx(tk.ItemSlot,{scope:n,id:f,focusable:r,active:i,children:u.jsx(Ye.span,{tabIndex:h?0:-1,"data-orientation":m.orientation,...l,ref:t,onMouseDown:Ie(e.onMouseDown,C=>{r?m.onItemFocus(f):C.preventDefault()}),onFocus:Ie(e.onFocus,()=>m.onItemFocus(f)),onKeyDown:Ie(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){m.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const k=Mxe(C,m.orientation,m.dir);if(k!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let j=v().filter(R=>R.focusable).map(R=>R.ref.current);if(k==="last")j.reverse();else if(k==="prev"||k==="next"){k==="prev"&&j.reverse();const R=j.indexOf(C.currentTarget);j=m.loop?zxe(j,R+1):j.slice(R+1)}setTimeout(()=>V8(j))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:S!=null}):a})})});U8.displayName=F8;var Dxe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Pxe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Mxe(e,t,n){const r=Pxe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Dxe[r]}function V8(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function zxe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var hI=L8,gI=U8,nk=["Enter"," "],Lxe=["ArrowDown","PageUp","Home"],B8=["ArrowUp","PageDown","End"],Fxe=[...Lxe,...B8],Uxe={ltr:[...nk,"ArrowRight"],rtl:[...nk,"ArrowLeft"]},Vxe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Nh="Menu",[Tm,Bxe,Hxe]=Qm(Nh),[ou,H8]=Qi(Nh,[Hxe,wf,Ef]),S0=wf(),q8=Ef(),[qxe,au]=ou(Nh),[Kxe,Ah]=ou(Nh),K8=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,l=S0(t),[d,f]=b.useState(null),m=b.useRef(!1),h=Tn(o),v=eu(i);return b.useEffect(()=>{const y=()=>{m.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>m.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),u.jsx(XE,{...l,children:u.jsx(qxe,{scope:t,open:n,onOpenChange:h,content:d,onContentChange:f,children:u.jsx(Kxe,{scope:t,onClose:b.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:m,dir:v,modal:a,children:r})})})};K8.displayName=Nh;var Gxe="MenuAnchor",vI=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=S0(n);return u.jsx(JE,{...i,...r,ref:t})});vI.displayName=Gxe;var yI="MenuPortal",[Zxe,G8]=ou(yI,{forceMount:void 0}),Z8=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=au(yI,t);return u.jsx(Zxe,{scope:t,forceMount:n,children:u.jsx(or,{present:n||o.open,children:u.jsx(nh,{asChild:!0,container:i,children:r})})})};Z8.displayName=yI;var Ro="MenuContent",[Yxe,bI]=ou(Ro),Y8=b.forwardRef((e,t)=>{const n=G8(Ro,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=au(Ro,e.__scopeMenu),a=Ah(Ro,e.__scopeMenu);return u.jsx(Tm.Provider,{scope:e.__scopeMenu,children:u.jsx(or,{present:r||o.open,children:u.jsx(Tm.Slot,{scope:e.__scopeMenu,children:a.modal?u.jsx(Wxe,{...i,ref:t}):u.jsx(Xxe,{...i,ref:t})})})})}),Wxe=b.forwardRef((e,t)=>{const n=au(Ro,e.__scopeMenu),r=b.useRef(null),i=pt(t,r);return b.useEffect(()=>{const o=r.current;if(o)return dI(o)},[]),u.jsx(xI,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ie(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Xxe=b.forwardRef((e,t)=>{const n=au(Ro,e.__scopeMenu);return u.jsx(xI,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Jxe=Ud("MenuContent.ScrollLock"),xI=b.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:v,onDismiss:y,disableOutsideScroll:x,...S}=e,C=au(Ro,n),k=Ah(Ro,n),E=S0(n),j=q8(n),R=Bxe(n),[N,T]=b.useState(null),A=b.useRef(null),D=pt(t,A,C.onContentChange),F=b.useRef(0),K=b.useRef(""),te=b.useRef(0),G=b.useRef(null),q=b.useRef("right"),V=b.useRef(0),H=x?b0:b.Fragment,z=x?{as:Jxe,allowPinchZoom:!0}:void 0,W=ne=>{const $=K.current+ne,P=R().filter(Q=>!Q.disabled),U=document.activeElement,O=P.find(Q=>Q.ref.current===U)?.textValue,J=P.map(Q=>Q.textValue),pe=u0e(J,$,O),ge=P.find(Q=>Q.textValue===pe)?.ref.current;(function Q(ve){K.current=ve,window.clearTimeout(F.current),ve!==""&&(F.current=window.setTimeout(()=>Q(""),1e3))})($),ge&&setTimeout(()=>ge.focus())};b.useEffect(()=>()=>window.clearTimeout(F.current),[]),uI();const L=b.useCallback(ne=>q.current===G.current?.side&&f0e(ne,G.current?.area),[]);return u.jsx(Yxe,{scope:n,searchRef:K,onItemEnter:b.useCallback(ne=>{L(ne)&&ne.preventDefault()},[L]),onItemLeave:b.useCallback(ne=>{L(ne)||(A.current?.focus(),T(null))},[L]),onTriggerLeave:b.useCallback(ne=>{L(ne)&&ne.preventDefault()},[L]),pointerGraceTimerRef:te,onPointerGraceIntentChange:b.useCallback(ne=>{G.current=ne},[]),children:u.jsx(H,{...z,children:u.jsx(v0,{asChild:!0,trapped:i,onMountAutoFocus:Ie(o,ne=>{ne.preventDefault(),A.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:u.jsx(gf,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:v,onDismiss:y,children:u.jsx(hI,{asChild:!0,...j,dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:N,onCurrentTabStopIdChange:T,onEntryFocus:Ie(d,ne=>{k.isUsingKeyboardRef.current||ne.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(QE,{role:"menu","aria-orientation":"vertical","data-state":d9(C.open),"data-radix-menu-content":"",dir:k.dir,...E,...S,ref:D,style:{outline:"none",...S.style},onKeyDown:Ie(S.onKeyDown,ne=>{const P=ne.target.closest("[data-radix-menu-content]")===ne.currentTarget,U=ne.ctrlKey||ne.altKey||ne.metaKey,O=ne.key.length===1;P&&(ne.key==="Tab"&&ne.preventDefault(),!U&&O&&W(ne.key));const J=A.current;if(ne.target!==J||!Fxe.includes(ne.key))return;ne.preventDefault();const ge=R().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);B8.includes(ne.key)&&ge.reverse(),l0e(ge)}),onBlur:Ie(e.onBlur,ne=>{ne.currentTarget.contains(ne.target)||(window.clearTimeout(F.current),K.current="")}),onPointerMove:Ie(e.onPointerMove,Nm(ne=>{const $=ne.target,P=V.current!==ne.clientX;if(ne.currentTarget.contains($)&&P){const U=ne.clientX>V.current?"right":"left";q.current=U,V.current=ne.clientX}}))})})})})})})});Y8.displayName=Ro;var Qxe="MenuGroup",wI=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Ye.div,{role:"group",...r,ref:t})});wI.displayName=Qxe;var e0e="MenuLabel",W8=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Ye.div,{...r,ref:t})});W8.displayName=e0e;var Xy="MenuItem",cP="menu.itemSelect",_0=b.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=b.useRef(null),a=Ah(Xy,e.__scopeMenu),l=bI(Xy,e.__scopeMenu),d=pt(t,o),f=b.useRef(!1),m=()=>{const h=o.current;if(!n&&h){const v=new CustomEvent(cP,{bubbles:!0,cancelable:!0});h.addEventListener(cP,y=>r?.(y),{once:!0}),Ay(h,v),v.defaultPrevented?f.current=!1:a.onClose()}};return u.jsx(X8,{...i,ref:d,disabled:n,onClick:Ie(e.onClick,m),onPointerDown:h=>{e.onPointerDown?.(h),f.current=!0},onPointerUp:Ie(e.onPointerUp,h=>{f.current||h.currentTarget?.click()}),onKeyDown:Ie(e.onKeyDown,h=>{const v=l.searchRef.current!=="";n||v&&h.key===" "||nk.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});_0.displayName=Xy;var X8=b.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=bI(Xy,n),l=q8(n),d=b.useRef(null),f=pt(t,d),[m,h]=b.useState(!1),[v,y]=b.useState("");return b.useEffect(()=>{const x=d.current;x&&y((x.textContent??"").trim())},[o.children]),u.jsx(Tm.ItemSlot,{scope:n,disabled:r,textValue:i??v,children:u.jsx(gI,{asChild:!0,...l,focusable:!r,children:u.jsx(Ye.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:f,onPointerMove:Ie(e.onPointerMove,Nm(x=>{r?a.onItemLeave(x):(a.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ie(e.onPointerLeave,Nm(x=>a.onItemLeave(x))),onFocus:Ie(e.onFocus,()=>h(!0)),onBlur:Ie(e.onBlur,()=>h(!1))})})})}),t0e="MenuCheckboxItem",J8=b.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return u.jsx(r9,{scope:e.__scopeMenu,checked:n,children:u.jsx(_0,{role:"menuitemcheckbox","aria-checked":Jy(n)?"mixed":n,...i,ref:t,"data-state":_I(n),onSelect:Ie(i.onSelect,()=>r?.(Jy(n)?!0:!n),{checkForDefaultPrevented:!1})})})});J8.displayName=t0e;var Q8="MenuRadioGroup",[n0e,r0e]=ou(Q8,{value:void 0,onValueChange:()=>{}}),e9=b.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=Tn(r);return u.jsx(n0e,{scope:e.__scopeMenu,value:n,onValueChange:o,children:u.jsx(wI,{...i,ref:t})})});e9.displayName=Q8;var t9="MenuRadioItem",n9=b.forwardRef((e,t)=>{const{value:n,...r}=e,i=r0e(t9,e.__scopeMenu),o=n===i.value;return u.jsx(r9,{scope:e.__scopeMenu,checked:o,children:u.jsx(_0,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":_I(o),onSelect:Ie(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});n9.displayName=t9;var SI="MenuItemIndicator",[r9,i0e]=ou(SI,{checked:!1}),i9=b.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=i0e(SI,n);return u.jsx(or,{present:r||Jy(o.checked)||o.checked===!0,children:u.jsx(Ye.span,{...i,ref:t,"data-state":_I(o.checked)})})});i9.displayName=SI;var o0e="MenuSeparator",o9=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Ye.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});o9.displayName=o0e;var a0e="MenuArrow",a9=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=S0(n);return u.jsx(ej,{...i,...r,ref:t})});a9.displayName=a0e;var s0e="MenuSub",[z2e,s9]=ou(s0e),Wp="MenuSubTrigger",l9=b.forwardRef((e,t)=>{const n=au(Wp,e.__scopeMenu),r=Ah(Wp,e.__scopeMenu),i=s9(Wp,e.__scopeMenu),o=bI(Wp,e.__scopeMenu),a=b.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:d}=o,f={__scopeMenu:e.__scopeMenu},m=b.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return b.useEffect(()=>m,[m]),b.useEffect(()=>{const h=l.current;return()=>{window.clearTimeout(h),d(null)}},[l,d]),u.jsx(vI,{asChild:!0,...f,children:u.jsx(X8,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":d9(n.open),...e,ref:df(t,i.onTriggerChange),onClick:h=>{e.onClick?.(h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ie(e.onPointerMove,Nm(h=>{o.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:Ie(e.onPointerLeave,Nm(h=>{m();const v=n.content?.getBoundingClientRect();if(v){const y=n.content?.dataset.side,x=y==="right",S=x?-5:5,C=v[x?"left":"right"],k=v[x?"right":"left"];o.onPointerGraceIntentChange({area:[{x:h.clientX+S,y:h.clientY},{x:C,y:v.top},{x:k,y:v.top},{x:k,y:v.bottom},{x:C,y:v.bottom}],side:y}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(h),h.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Ie(e.onKeyDown,h=>{const v=o.searchRef.current!=="";e.disabled||v&&h.key===" "||Uxe[r.dir].includes(h.key)&&(n.onOpenChange(!0),n.content?.focus(),h.preventDefault())})})})});l9.displayName=Wp;var c9="MenuSubContent",u9=b.forwardRef((e,t)=>{const n=G8(Ro,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=au(Ro,e.__scopeMenu),a=Ah(Ro,e.__scopeMenu),l=s9(c9,e.__scopeMenu),d=b.useRef(null),f=pt(t,d);return u.jsx(Tm.Provider,{scope:e.__scopeMenu,children:u.jsx(or,{present:r||o.open,children:u.jsx(Tm.Slot,{scope:e.__scopeMenu,children:u.jsx(xI,{id:l.contentId,"aria-labelledby":l.triggerId,...i,ref:f,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{a.isUsingKeyboardRef.current&&d.current?.focus(),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Ie(e.onFocusOutside,m=>{m.target!==l.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Ie(e.onEscapeKeyDown,m=>{a.onClose(),m.preventDefault()}),onKeyDown:Ie(e.onKeyDown,m=>{const h=m.currentTarget.contains(m.target),v=Vxe[a.dir].includes(m.key);h&&v&&(o.onOpenChange(!1),l.trigger?.focus(),m.preventDefault())})})})})})});u9.displayName=c9;function d9(e){return e?"open":"closed"}function Jy(e){return e==="indeterminate"}function _I(e){return Jy(e)?"indeterminate":e?"checked":"unchecked"}function l0e(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function c0e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function u0e(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=c0e(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 d0e(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 l=t[o],d=t[a],f=l.x,m=l.y,h=d.x,v=d.y;m>r!=v>r&&n<(h-f)*(r-m)/(v-m)+f&&(i=!i)}return i}function f0e(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return d0e(n,t)}function Nm(e){return t=>t.pointerType==="mouse"?e(t):void 0}var p0e=K8,m0e=vI,h0e=Z8,g0e=Y8,v0e=wI,y0e=W8,b0e=_0,x0e=J8,w0e=e9,S0e=n9,_0e=i9,C0e=o9,k0e=a9,E0e=l9,j0e=u9,C0="DropdownMenu",[R0e]=Qi(C0,[H8]),ni=H8(),[I0e,f9]=R0e(C0),p9=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:a,modal:l=!0}=e,d=ni(t),f=b.useRef(null),[m,h]=Ko({prop:i,defaultProp:o??!1,onChange:a,caller:C0});return u.jsx(I0e,{scope:t,triggerId:Vi(),triggerRef:f,contentId:Vi(),open:m,onOpenChange:h,onOpenToggle:b.useCallback(()=>h(v=>!v),[h]),modal:l,children:u.jsx(p0e,{...d,open:m,onOpenChange:h,dir:r,modal:l,children:n})})};p9.displayName=C0;var m9="DropdownMenuTrigger",h9=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=f9(m9,n),a=ni(n);return u.jsx(m0e,{asChild:!0,...a,children:u.jsx(Ye.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:df(t,o.triggerRef),onPointerDown:Ie(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(o.onOpenToggle(),o.open||l.preventDefault())}),onKeyDown:Ie(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&o.onOpenToggle(),l.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});h9.displayName=m9;var T0e="DropdownMenuPortal",g9=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ni(t);return u.jsx(h0e,{...r,...n})};g9.displayName=T0e;var v9="DropdownMenuContent",y9=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=f9(v9,n),o=ni(n),a=b.useRef(!1);return u.jsx(g0e,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:t,onCloseAutoFocus:Ie(e.onCloseAutoFocus,l=>{a.current||i.triggerRef.current?.focus(),a.current=!1,l.preventDefault()}),onInteractOutside:Ie(e.onInteractOutside,l=>{const d=l.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,m=d.button===2||f;(!i.modal||m)&&(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)"}})});y9.displayName=v9;var N0e="DropdownMenuGroup",A0e=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ni(n);return u.jsx(v0e,{...i,...r,ref:t})});A0e.displayName=N0e;var O0e="DropdownMenuLabel",b9=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ni(n);return u.jsx(y0e,{...i,...r,ref:t})});b9.displayName=O0e;var $0e="DropdownMenuItem",x9=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ni(n);return u.jsx(b0e,{...i,...r,ref:t})});x9.displayName=$0e;var D0e="DropdownMenuCheckboxItem",w9=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ni(n);return u.jsx(x0e,{...i,...r,ref:t})});w9.displayName=D0e;var P0e="DropdownMenuRadioGroup",M0e=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ni(n);return u.jsx(w0e,{...i,...r,ref:t})});M0e.displayName=P0e;var z0e="DropdownMenuRadioItem",L0e=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ni(n);return u.jsx(S0e,{...i,...r,ref:t})});L0e.displayName=z0e;var F0e="DropdownMenuItemIndicator",S9=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ni(n);return u.jsx(_0e,{...i,...r,ref:t})});S9.displayName=F0e;var U0e="DropdownMenuSeparator",_9=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ni(n);return u.jsx(C0e,{...i,...r,ref:t})});_9.displayName=U0e;var V0e="DropdownMenuArrow",B0e=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ni(n);return u.jsx(k0e,{...i,...r,ref:t})});B0e.displayName=V0e;var H0e="DropdownMenuSubTrigger",q0e=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ni(n);return u.jsx(E0e,{...i,...r,ref:t})});q0e.displayName=H0e;var K0e="DropdownMenuSubContent",G0e=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ni(n);return u.jsx(j0e,{...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)"}})});G0e.displayName=K0e;var Z0e=p9,Y0e=h9,W0e=g9,X0e=y9,J0e=b9,Q0e=x9,ewe=w9,twe=S9,nwe=_9;function Oh({...e}){return u.jsx(Z0e,{"data-slot":"dropdown-menu",...e})}function $h({...e}){return u.jsx(Y0e,{"data-slot":"dropdown-menu-trigger",...e})}function Dh({className:e,sideOffset:t=4,...n}){return u.jsx(W0e,{children:u.jsx(X0e,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Ue("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 jr({className:e,inset:t,variant:n="default",...r}){return u.jsx(Q0e,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Ue("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 rwe({className:e,children:t,checked:n,...r}){return u.jsxs(ewe,{"data-slot":"dropdown-menu-checkbox-item",className:Ue("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(twe,{children:u.jsx(sE,{className:"size-4"})})}),t]})}function Qy({className:e,inset:t,...n}){return u.jsx(J0e,{"data-slot":"dropdown-menu-label","data-inset":t,className:Ue("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function eb({className:e,...t}){return u.jsx(nwe,{"data-slot":"dropdown-menu-separator",className:Ue("bg-grey-700 -mx-1 my-1 h-px",e),...t})}function CI(e){return!!e?.plans?.[0]?.planId?.startsWith("self-hosted")}function kI({cluster:e}){const t=ms(e.id),{view:n,update:r}=ax(e.organizationId,e.id),o=!kt.checkForFabricConnect(e.id)&&!!t.user;if(n){if(!e.fqdn)return u.jsx(Ze,{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(xi,{className:"inline-block"})]})});if(e.resetPassword)return r?u.jsx(Ze,{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(xe,{variant:"positive",className:"py-2 hover:border-b-2 animate-glow-pulse",children:["Finish Setup ",u.jsx(xi,{className:"inline-block"})]})}):u.jsx("span",{className:"py-2 text-nowrap",children:"Pending Owner Setup"});if(!t.isLoading)return o?u.jsx(Ze,{to:`/${e.organizationId}/${e.id}${ba}`,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(xi,{className:"inline-block"})]})}):r&&!CI(e)?u.jsx(Ze,{to:`/${e.organizationId}/${e.id}${ba}`,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(xi,{className:"inline-block"})]})}):u.jsx(Ze,{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(xi,{className:"inline-block"})]})})}}function iwe(e,t){const n=[];if(e)for(const r of e)n.push(r[t]);return n}function Am({cluster:e,forceProgressBarVisible:t}){const[n,r]=b.useState(t||!1),{data:i}=Mt(Dl(n&&e.id,2e3));b.useEffect(function(){(XC(e.status)||JC(e.status))&&r(!0)},[n,e.status,i?.instances]);const o=b.useMemo(()=>{const a=iwe(i?.plans??[],"planId"),l=i?.instances??[];let d=0;const f={};let m=0;const h={};let v=0;const y={};let x=0;const S={};for(const k of l){const E=k.status;!E||cI(E)||(XC(E)?(d+=1,f[E]=`${d} ${wo(E)}`):JC(E)?(m+=1,h[E]=`${m} ${wo(E)}`):Ih(E)?(x+=1,S[E]=`${x} ${wo(E)}`):!k.planId||!a.includes(k.planId)?(m+=1,h.DRAINING_TRAFFIC=`${m} ${wo("Draining Traffic")}`):d8(E)&&(v+=1,y[E]=`${v} ${wo(E)}`))}const C=d+m+v;return{pendingWidth:`${C===0?100:d===0?0:d/C*100}%`,updatingWidth:`${m===0?0:m/C*100}%`,failedWidth:`${x===0?0:x/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 C9(e){const{data:t}=await Yt.delete(`/Cluster/${e}`,{timeout:0});return t}function owe(){return ut({mutationFn:e=>C9(e)})}function k9(...e){return b.useMemo(()=>e.map(t=>(()=>{navigator.clipboard.writeText(t),Se.info("Copied to clipboard!",{icon:u.jsx(lte,{}),duration:1e3})})),e)}function Ph(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 awe(e,t){return Ph(localStorage.getItem(e))??t}function swe(e,t){t==null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(t))}function jf(e,t){const n=b.useState(awe(e,t)),[r]=n;return b.useEffect(()=>swe(e,r),[e,r]),n}var su=(e=>(e.SavedClusterState="SavedClusterState",e))(su||{});function lwe({cluster:e}){const t=_n(),n=ir(),r=b.useMemo(()=>Xk(e),[e]),i=eh(r),o=ms(e.id),[,a]=jf(su.SavedClusterState,null),{view:l,update:d,remove:f,create:m}=ax(e.organizationId,e.id),{mutate:h,isPending:v}=owe(),[y,x]=b.useState(!1),[S,C]=b.useState(!1),k=b.useMemo(()=>e.status&&Sx.includes(e.status),[e.status]),E=CI(e),j=kt.checkForFabricConnect(e.id),R=!j&&!!o.user,N=b.useMemo(()=>e.status&&fj.includes(e.status),[e.status]),T=b.useMemo(()=>e.status&&Ih(e.status),[e.status]),A=b.useCallback(async()=>{x(!0);const V=await pj(e.id).catch(H=>(console.error("Failed to lookup cluster details, proceeding without checking instances.",H),null));if(await Hm({entityId:e.id,instanceClient:i}),V?.instances?.length)for(const H of V.instances)kt.setUserForEntity(H,null);kt.setUserForEntity(e,null)},[e,i]),D=b.useCallback(()=>{a(e),t.navigate({to:`/${e.organizationId}/new-cluster`})},[e,t,a]),F=b.useCallback(()=>C(!0),[]),K=b.useCallback(()=>{const V=e.organizationId;h(e.id,{onSuccess:async()=>{await n.invalidateQueries({queryKey:[V],refetchType:"active"}),await t.invalidate(),Se.success("Success",{description:E?"Cluster successfully removed.":"Cluster successfully terminated.",duration:5e3,action:{label:"Dismiss",onClick:()=>Se.dismiss()}}),C(!1)},onError:()=>{Se.error("Error",{description:E?`Failed to remove cluster: ${e.name}`:`Failed to terminate cluster: ${e.name}.`,duration:5e3,action:{label:"Dismiss",onClick:()=>Se.dismiss()}}),C(!1)}})},[t,e.organizationId,e.id,e.name,h,E,n]),[te,G]=k9(`${e.fqdn}`,`https://${e.fqdn}`),q=[k&&d&&!o.isLoading&&(!R||j)&&u.jsx(Ze,{to:`${e.id}/sign-in`,disabled:y,children:u.jsx(jr,{children:"Direct Sign In"})},"sign-in"),k&&d&&u.jsx(Ze,{to:`${e.id}/edit`,disabled:y,children:u.jsx(jr,{children:"Edit"})},"edit"),k&&l&&u.jsx(Ze,{to:`${e.id}/instances`,disabled:y,children:u.jsx(jr,{children:"Instances"})},"instances"),k&&l&&e.fqdn&&u.jsx(jr,{onClick:te,disabled:y,children:"Copy Host Name"},"copy-host-name"),k&&l&&e.fqdn&&u.jsx(jr,{onClick:G,disabled:y,children:"Copy API URL"},"copy-api-url"),k&&l&&!!r&&!o.isLoading&&R&&u.jsx(jr,{onClick:A,disabled:y,children:"Direct Sign Out"},"direct-sign-out"),T&&m&&u.jsx(jr,{className:"focus:bg-green/70 focus:text-white",onClick:D,children:"Try Again"},"try-again"),!N&&f&&u.jsx(jr,{className:"focus:bg-red/70 focus:text-white",onClick:F,children:E?"Remove":"Terminate"},"remove")].filter(Jo);return u.jsxs(Dc,{className:"relative h-full justify-between",children:[u.jsxs(Il,{children:[u.jsxs(Zc,{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(P4,{onClick:te,size:16,className:"cursor-pointer"}),u.jsx("span",{className:"grow"})]}):u.jsx("span",{children:"Self-Hosted"}),!N&&u.jsxs(Oh,{children:[u.jsx($h,{children:u.jsx(lE,{"aria-label":"Cluster options"})}),u.jsxs(Dh,{children:[!T&&u.jsxs(u.Fragment,{children:[u.jsx(Qy,{className:"text-gray-600 text-xs",children:"Plans"}),e.plans?.map(V=>u.jsxs(Qy,{children:[V.planId," / ",V.regionId,u.jsx("br",{}),"Auto Renewal ",u.jsx(Yo,{variant:"success",children:"ON"})]},V.planId+V.regionId)),q.length>0&&u.jsx(eb,{})]}),...q]})]})]}),u.jsx(Tl,{children:u.jsx("h2",{children:e.name})})]}),u.jsxs(hs,{className:"flex items-center justify-between gap-2",children:[u.jsx(Am,{cluster:e}),k&&l&&u.jsx(kI,{cluster:e}),T&&e.status&&u.jsxs(u.Fragment,{children:[u.jsx(Yo,{variant:u8(e.status),children:wo(e.status)}),u.jsx("span",{className:"text-xs",children:'Click "..." to choose how to proceed.'})]})]}),u.jsx(w0,{typeOfThingBeingDeleted:"cluster",transitiveVerb:E?"Remove":"Terminate",presentParticiple:E?"Removing":"Terminating",nameOfThingBeingDeleted:e.name,isModalOpen:S,hideDataLossWarning:E,setIsModalOpen:V=>C(V),deletionConfirmed:K,deletionPending:v})]})}function kl({overEmail:e}){return u.jsx("a",{href:e?"mailto:support@harperdb.io":"https://discord.com/channels/1415002037439041710/1415002038286286994",target:"_blank",rel:"noreferrer",className:"underline",children:"Contact us"})}function no({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 Tv({children:e}){return u.jsxs(u.Fragment,{children:[u.jsx(vs,{}),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 cwe(e){const{data:t}=await Yt.get("/Plan/",{params:{organizationId:e}});return t}function uwe(e){return{queryKey:[e,"instancePlan"],queryFn:()=>cwe(e),retry:!1}}async function dwe({organizationId:e,availableHosts:t}={}){const{data:n}=await Yt.get("/Region/",{params:{availableHosts:t,organizationId:e}});return n}function uP({organizationId:e,availableHosts:t}={}){return{queryKey:[e,"regionLocations",t],queryFn:()=>dwe({organizationId:e,availableHosts:t}),retry:!1}}function rk(e){return(t,n)=>t[e]===n[e]?0:t[e]>n[e]?1:-1}function dP(e){const t=e.split(".").map(Number);return(t[0]<<24|t[1]<<16|t[2]<<8|t[3])>>>0}function fP(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 E9(e,t){return e.instanceFqdn===t.instanceFqdn?e.operationsApiPort-t.operationsApiPort:fP(e.instanceFqdn)&&fP(t.instanceFqdn)?dP(e.instanceFqdn)-dP(t.instanceFqdn):e.instanceFqdn>t.instanceFqdn?1:-1}function fwe(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 Mh(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 ik(e,t,n){const r=fwe(e,t),i={};for(const o in r)i[o]=Mh(r[o],n);return i}function Om({width:e,className:t,animated:n,placeholder:r}){return u.jsxs("div",{className:yr("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:yr("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 pwe({duration:e,message:t,lateMessage:n}){const r=b.useRef(0),i=b.useRef(0),[o,a]=b.useState(!1),l=5,[d,f]=b.useState(`${l}%`),m=b.useCallback(function h(v){i.current||(i.current=v);const y=v-i.current,x=Math.min(y/e,1);f(Math.max(l,x*100)+"%"),x<1?r.current=requestAnimationFrame(h):a(!0)},[e]);return b.useEffect(()=>(r.current=requestAnimationFrame(m),()=>cancelAnimationFrame(r.current)),[m]),u.jsxs(u.Fragment,{children:[o?n:t,u.jsx(Om,{width:d,animated:!1})]})}async function mwe(e){const{data:t}=await Yt.post("/Cluster/",e,{timeout:0});return t}function hwe(){return ut({mutationFn:e=>mwe(e)})}async function gwe(e){const{data:t}=await Yt.put(`/Cluster/${e.id}`,{regionPlans:e.regionPlans},{timeout:0});return t}function vwe(){return ut({mutationFn:e=>gwe(e)})}async function j9(e){const{data:t}=await Yt.get(`/Organization/${e}`);return t}function lu(e){return{queryKey:[e],queryFn:()=>j9(e),retry:!1,refetchInterval:1e4}}const $m="ENTERPRISE";function R9(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,l=t-o-a;if(l>0)return r[0]=r[0].slice(0,l),r.join("-");{const d=[];let f=0;t>0&&(d.push(n[0].charAt(0)),f=1);for(let m=1;m<r.length&&f+2<=t;m++)d.push(r[m]),f+=2;return d.join("-")}}function ywe(e,t,n="-"){const r=t.split(n)[0];return e.findIndex(i=>i.startsWith(r))!==-1}function k0(e){return e.replace(/[^a-zA-Z0-9]/g,"-").replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().replace(/-+/g,"-").replace(/^-+|-+$/g,"")}async function bwe(e){await Yt.put("/Payment/",e)}function xwe(){return ut({mutationFn:e=>bwe(e)})}function I9(e){const{mutate:t}=xwe();return b.useCallback((n,r)=>{t({paymentMethodId:typeof n=="string"?n:n.id,organizationId:e},{onSuccess:()=>{Se.success("Success! Your payment method has been saved."),r(!0)},onError:()=>{Se.error("Failed to process payment method details. Please try another payment method."),r(!1)}})},[t,e])}const wwe=b.createContext(null);function Swe(){return b.useContext(wwe)}var p1={exports:{}},m1,pP;function _we(){if(pP)return m1;pP=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return m1=e,m1}var h1,mP;function Cwe(){if(mP)return h1;mP=1;var e=_we();function t(){}function n(){}return n.resetWarningCache=t,h1=function(){function r(a,l,d,f,m,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},h1}var hP;function kwe(){return hP||(hP=1,p1.exports=Cwe()()),p1.exports}var Ewe=kwe();const Je=rf(Ewe);function gP(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 vP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gP(Object(n),!0).forEach(function(r){T9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dy(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?dy=function(t){return typeof t}:dy=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dy(e)}function T9(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jwe(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 Rwe(e,t){if(e==null)return{};var n=jwe(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 Iwe(e,t){return Twe(e)||Nwe(e,t)||Awe(e,t)||Owe()}function Twe(e){if(Array.isArray(e))return e}function Nwe(e,t){var n=e&&(typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"]);if(n!=null){var r=[],i=!0,o=!1,a,l;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,l=d}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw l}}return r}}function Awe(e,t){if(e){if(typeof e=="string")return yP(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 yP(e,t)}}function yP(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 Owe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
130
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var qr=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])},$we=function(t){var n=X.useRef(t);return X.useEffect(function(){n.current=t},[t]),n.current},tb=function(t){return t!==null&&dy(t)==="object"},bP="[object Object]",Dwe=function e(t,n){if(!tb(t)||!tb(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)===bP,a=Object.prototype.toString.call(n)===bP;if(o!==a)return!1;if(!o&&!r)return t===n;var l=Object.keys(t),d=Object.keys(n);if(l.length!==d.length)return!1;for(var f={},m=0;m<l.length;m+=1)f[l[m]]=!0;for(var h=0;h<d.length;h+=1)f[d[h]]=!0;var v=Object.keys(f);if(v.length!==l.length)return!1;var y=t,x=n,S=function(k){return e(y[k],x[k])};return v.every(S)},Pwe=function(t,n,r){return tb(t)?Object.keys(t).reduce(function(i,o){var a=!tb(n)||!Dwe(t[o],n[o]);return r.includes(o)?(a&&console.warn("Unsupported prop change: options.".concat(o," is not a mutable property.")),i):a?vP(vP({},i||{}),{},T9({},o,t[o])):i},null):null},EI=X.createContext(null);EI.displayName="ElementsContext";var N9=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};Je.any,Je.object;var Mwe=function(t){var n=X.useContext(EI);return N9(n,t)},zwe=function(){var t=Mwe("calls useElements()"),n=t.elements;return n};Je.func.isRequired;var A9=X.createContext(null);A9.displayName="CheckoutContext";Je.any,Je.shape({clientSecret:Je.oneOfType([Je.string,Je.instanceOf(Promise)]).isRequired,elementsOptions:Je.object}).isRequired;var ok=function(t){var n=X.useContext(A9),r=X.useContext(EI);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 N9(r,t)},Lwe=["mode"],Fwe=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},Ei=function(t,n){var r="".concat(Fwe(t),"Element"),i=function(d){var f=d.id,m=d.className,h=d.options,v=h===void 0?{}:h,y=d.onBlur,x=d.onFocus,S=d.onReady,C=d.onChange,k=d.onEscape,E=d.onClick,j=d.onLoadError,R=d.onLoaderStart,N=d.onNetworksChange,T=d.onConfirm,A=d.onCancel,D=d.onShippingAddressChange,F=d.onShippingRateChange,K=d.onSavedPaymentMethodRemove,te=d.onSavedPaymentMethodUpdate,G=ok("mounts <".concat(r,">")),q="elements"in G?G.elements:null,V="checkoutState"in G?G.checkoutState:null,H=V?.type==="success"||V?.type==="loading"?V.sdk:null,z=X.useState(null),W=Iwe(z,2),L=W[0],ne=W[1],$=X.useRef(null),P=X.useRef(null);qr(L,"blur",y),qr(L,"focus",x),qr(L,"escape",k),qr(L,"click",E),qr(L,"loaderror",j),qr(L,"loaderstart",R),qr(L,"networkschange",N),qr(L,"confirm",T),qr(L,"cancel",A),qr(L,"shippingaddresschange",D),qr(L,"shippingratechange",F),qr(L,"savedpaymentmethodremove",K),qr(L,"savedpaymentmethodupdate",te),qr(L,"change",C);var U;S&&(t==="expressCheckout"?U=S:U=function(){S(L)}),qr(L,"ready",U),X.useLayoutEffect(function(){if($.current===null&&P.current!==null&&(q||H)){var J=null;if(H)switch(t){case"paymentForm":J=H.createPaymentFormElement();break;case"payment":J=H.createPaymentElement(v);break;case"address":if("mode"in v){var pe=v.mode,ge=Rwe(v,Lwe);if(pe==="shipping")J=H.createShippingAddressElement(ge);else if(pe==="billing")J=H.createBillingAddressElement(ge);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":J=H.createExpressCheckoutElement(v);break;case"currencySelector":J=H.createCurrencySelectorElement();break;case"taxId":J=H.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 q&&(J=q.create(t,v));$.current=J,ne(J),J&&J.mount(P.current)}},[q,H,v]);var O=$we(v);return X.useEffect(function(){if($.current){var J=Pwe(v,O,["paymentRequest"]);J&&"update"in $.current&&$.current.update(J)}},[v,O]),X.useLayoutEffect(function(){return function(){if($.current&&typeof $.current.destroy=="function")try{$.current.destroy(),$.current=null}catch{}}},[]),X.createElement("div",{id:f,className:m,ref:P})},o=function(d){ok("mounts <".concat(r,">"));var f=d.id,m=d.className;return X.createElement("div",{id:f,className:m})},a=n?o:i;return a.propTypes={id:Je.string,className:Je.string,onChange:Je.func,onBlur:Je.func,onFocus:Je.func,onReady:Je.func,onEscape:Je.func,onClick:Je.func,onLoadError:Je.func,onLoaderStart:Je.func,onNetworksChange:Je.func,onConfirm:Je.func,onCancel:Je.func,onShippingAddressChange:Je.func,onShippingRateChange:Je.func,onSavedPaymentMethodRemove:Je.func,onSavedPaymentMethodUpdate:Je.func,options:Je.object},a.displayName=r,a.__elementType=t,a},ji=typeof window>"u",Uwe=X.createContext(null);Uwe.displayName="EmbeddedCheckoutProviderContext";var O9=function(){var t=ok("calls useStripe()"),n=t.stripe;return n};Ei("auBankAccount",ji);Ei("card",ji);Ei("cardNumber",ji);Ei("cardExpiry",ji);Ei("cardCvc",ji);Ei("iban",ji);var Vwe=Ei("payment",ji);Ei("expressCheckout",ji);Ei("paymentRequestButton",ji);Ei("linkAuthentication",ji);var Bwe=Ei("address",ji);Ei("shippingAddress",ji);Ei("paymentMethodMessaging",ji);Ei("taxId",ji);function Hwe({hasExistingBilling:e,onPaymentAdded:t,onSaveStateForBillingRedirect:n}){const{organizationId:r}=rt({strict:!1}),i=O9(),o=Swe(),a=zwe(),[l,d]=b.useState(!1),f=I9(r),m=b.useCallback(()=>{t(!1)},[t]),h=b.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),Se.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(Vwe,{}),u.jsx(Bwe,{options:{mode:"billing"}}),u.jsxs("div",{className:"mt-4 flex gap-8 items-center",children:[u.jsxs(xe,{disabled:!i||!a||l,variant:"submit",className:"rounded-full",children:[u.jsx(To,{})," 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(xe,{variant:"defaultOutline",type:"button",onClick:m,children:"Cancel"})]})]})]})}var qwe="clover",$9="https://js.stripe.com",Kwe="".concat($9,"/").concat(qwe,"/stripe.js"),Gwe=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,Zwe=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/;var Ywe=function(t){return Gwe.test(t)||Zwe.test(t)},Wwe=function(){for(var t=document.querySelectorAll('script[src^="'.concat($9,'"]')),n=0;n<t.length;n++){var r=t[n];if(Ywe(r.src))return r}return null},xP=function(t){var n="",r=document.createElement("script");r.src="".concat(Kwe).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},zp=null,Nv=null,Av=null,Xwe=function(t){return function(n){t(new Error("Failed to load Stripe.js",{cause:n}))}},Jwe=function(t,n){return function(){window.Stripe?t(window.Stripe):n(new Error("Stripe.js not available"))}},Qwe=function(t){return zp!==null?zp:(zp=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=Wwe();if(!(i&&t)){if(!i)i=xP(t);else if(i&&Av!==null&&Nv!==null){var o;i.removeEventListener("load",Av),i.removeEventListener("error",Nv),(o=i.parentNode)===null||o===void 0||o.removeChild(i),i=xP(t)}}Av=Jwe(n,r),Nv=Xwe(r),i.addEventListener("load",Av),i.addEventListener("error",Nv)}catch(a){r(a);return}}),zp.catch(function(n){return zp=null,Promise.reject(n)}))},Lp,eSe=function(){return Lp||(Lp=Qwe(null).catch(function(t){return Lp=null,Promise.reject(t)}),Lp)};Promise.resolve().then(function(){return eSe()}).catch(function(e){console.warn(e)});async function tSe(e){const{data:t}=await Yt.post("/StripeAccount/",e);return t}function nSe(){return ut({mutationFn:e=>tSe(e)})}async function rSe(e){const{data:t}=await Yt.post("/Payment/",{organizationId:e.organizationId});return t}function iSe(){return ut({mutationFn:e=>rSe(e)})}function oSe(e){const{enabled:t,existingStripeId:n,organizationId:r}=e,{mutate:i}=nSe(),{mutate:o}=iSe(),[a,l]=b.useState(void 0),d=b.useCallback(f=>{l(f.clientSecret)},[]);return b.useEffect(()=>{},[i,t,n,o,d,r]),a}function D9({children:e}){const{organizationId:t}=rt({strict:!1}),{data:n}=Mt(lu(t)),r=oSe({organizationId:t,enabled:!!n,existingStripeId:n?.stripeId});return b.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 aSe({onPaymentAdded:e,onSaveStateForBillingRedirect:t}){const{organizationId:n}=rt({strict:!1}),{data:r}=Mt(lu(n)),i=r?.billing,o=i?.paymentMethod;return u.jsxs(D9,{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(Hwe,{hasExistingBilling:!!i,onSaveStateForBillingRedirect:t,onPaymentAdded:e})]})}var ma=(e=>(e.PASS="pass",e.FAIL="fail",e.PENDING="pending",e.ERROR="error",e))(ma||{});function sSe(e){switch(e){case ma.PASS:return"success";case ma.FAIL:case ma.ERROR:return"destructive";case ma.PENDING:default:return"default"}}function lSe(e){switch(e){case ma.PASS:return"READY";case ma.FAIL:case ma.ERROR:case ma.PENDING:default:return e.toUpperCase()}}function cSe(e,t){const n=String(e).padStart(2,"0"),r=String(t%100).padStart(2,"0");return`${n}/${r}`}function P9(e){const{onSaveStateForBillingRedirect:t,onReplacingPaymentMethod:n}=e??{},{organizationId:r}=rt({strict:!1}),{update:i}=ox(r),{data:o,refetch:a}=Mt(lu(r)),d=o?.billing?.paymentMethod,[f,m]=b.useState(!1),h=b.useCallback(()=>{m(!f),n?.(!f)},[n,f]),v=b.useCallback(y=>{m(!1),n?.(!1),y&&a()},[n,a]);return o?.type===$m?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(kl,{}),", 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 ",cSe(d.expMonth,d.expYear),")"]}):null,d.status?u.jsxs(u.Fragment,{children:["—"," ",u.jsx(Yo,{variant:sSe(d.status),children:lSe(d.status)})]}):null]}),i&&u.jsx("div",{className:"mt-2 mb-6",children:u.jsx(xe,{variant:"defaultOutline",type:"button",onClick:h,children:"Replace Payment Method"})})]}):i?u.jsx(aSe,{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 qn(e){return e!==void 0&&e>0}function uSe({clusterId:e,isPending:t,onGoBackToDetails:n,onSaveStateForBillingRedirect:r,onSubmit:i,organizationId:o,selectedPlan:a}){const{data:l}=Mt(lu(o)),d=l?.billing,f=l?.type===$m,m=f||d?.paymentMethod?.status===ma.PASS,[h,v]=b.useState(!1),y=qn(a?.planLimits?.expirationMonths)&&a.planLimits.expirationMonths<1e3&&a.planLimits.expirationMonths,x=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(xe,{type:"button",variant:"defaultOutline",className:"rounded-full",disabled:t,onClick:n,children:[u.jsx(Pc,{})," Back to Details"]}),u.jsxs(xe,{disabled:t||!m||h,type:"submit",variant:"submit",className:"rounded-full",onClick:i,children:[e?"Edit Cluster":"Create New Cluster"," ",u.jsx(xi,{})]})]})});if(f)return u.jsxs(u.Fragment,{children:[u.jsxs("ul",{className:"list-disc ml-6 max-w-lg",children:[u.jsx("li",{children:"Reminder: you will be billed at your contracted rate for any additional infrastructure."}),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(kl,{overEmail:!0}),", we are here to help."]})]}),x]});const S=y&&`, or ${Wr(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(kl,{overEmail:!0}),", we are here to help."]})]}),u.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:"Payment method:"}),u.jsx(P9,{onSaveStateForBillingRedirect:r,onReplacingPaymentMethod:v}),x]})}function Mr({className:e}={}){const t=b.useMemo(()=>yr("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 ak(e,[t,n]){return Math.min(n,Math.max(t,e))}var dSe=[" ","Enter","ArrowUp","ArrowDown"],fSe=[" ","Enter"],Vc="Select",[E0,j0,pSe]=Qm(Vc),[Rf]=Qi(Vc,[pSe,wf]),R0=wf(),[mSe,Ll]=Rf(Vc),[hSe,gSe]=Rf(Vc),M9=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:l,onValueChange:d,dir:f,name:m,autoComplete:h,disabled:v,required:y,form:x}=e,S=R0(t),[C,k]=b.useState(null),[E,j]=b.useState(null),[R,N]=b.useState(!1),T=eu(f),[A,D]=Ko({prop:r,defaultProp:i??!1,onChange:o,caller:Vc}),[F,K]=Ko({prop:a,defaultProp:l,onChange:d,caller:Vc}),te=b.useRef(null),G=C?x||!!C.closest("form"):!0,[q,V]=b.useState(new Set),H=Array.from(q).map(z=>z.props.value).join(";");return u.jsx(XE,{...S,children:u.jsxs(mSe,{required:y,scope:t,trigger:C,onTriggerChange:k,valueNode:E,onValueNodeChange:j,valueNodeHasChildren:R,onValueNodeHasChildrenChange:N,contentId:Vi(),value:F,onValueChange:K,open:A,onOpenChange:D,dir:T,triggerPointerDownPosRef:te,disabled:v,children:[u.jsx(E0.Provider,{scope:t,children:u.jsx(hSe,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(z=>{V(W=>new Set(W).add(z))},[]),onNativeOptionRemove:b.useCallback(z=>{V(W=>{const L=new Set(W);return L.delete(z),L})},[]),children:n})}),G?u.jsxs(sq,{"aria-hidden":!0,required:y,tabIndex:-1,name:m,autoComplete:h,value:F,onChange:z=>K(z.target.value),disabled:v,form:x,children:[F===void 0?u.jsx("option",{value:""}):null,Array.from(q)]},H):null]})})};M9.displayName=Vc;var z9="SelectTrigger",L9=b.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=R0(n),a=Ll(z9,n),l=a.disabled||r,d=pt(t,a.onTriggerChange),f=j0(n),m=b.useRef("touch"),[h,v,y]=cq(S=>{const C=f().filter(j=>!j.disabled),k=C.find(j=>j.value===a.value),E=uq(C,S,k);E!==void 0&&a.onValueChange(E.value)}),x=S=>{l||(a.onOpenChange(!0),y()),S&&(a.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return u.jsx(JE,{asChild:!0,...o,children:u.jsx(Ye.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:l,"data-disabled":l?"":void 0,"data-placeholder":lq(a.value)?"":void 0,...i,ref:d,onClick:Ie(i.onClick,S=>{S.currentTarget.focus(),m.current!=="mouse"&&x(S)}),onPointerDown:Ie(i.onPointerDown,S=>{m.current=S.pointerType;const C=S.target;C.hasPointerCapture(S.pointerId)&&C.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(x(S),S.preventDefault())}),onKeyDown:Ie(i.onKeyDown,S=>{const C=h.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&v(S.key),!(C&&S.key===" ")&&dSe.includes(S.key)&&(x(),S.preventDefault())})})})});L9.displayName=z9;var F9="SelectValue",U9=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...l}=e,d=Ll(F9,n),{onValueNodeHasChildrenChange:f}=d,m=o!==void 0,h=pt(t,d.onValueNodeChange);return rr(()=>{f(m)},[f,m]),u.jsx(Ye.span,{...l,ref:h,style:{pointerEvents:"none"},children:lq(d.value)?u.jsx(u.Fragment,{children:a}):o})});U9.displayName=F9;var vSe="SelectIcon",V9=b.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return u.jsx(Ye.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});V9.displayName=vSe;var ySe="SelectPortal",B9=e=>u.jsx(nh,{asChild:!0,...e});B9.displayName=ySe;var Bc="SelectContent",H9=b.forwardRef((e,t)=>{const n=Ll(Bc,e.__scopeSelect),[r,i]=b.useState();if(rr(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?lf.createPortal(u.jsx(q9,{scope:e.__scopeSelect,children:u.jsx(E0.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),o):null}return u.jsx(K9,{...e,ref:t})});H9.displayName=Bc;var Lo=10,[q9,Fl]=Rf(Bc),bSe="SelectContentImpl",xSe=Ud("SelectContent.RemoveScroll"),K9=b.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:l,sideOffset:d,align:f,alignOffset:m,arrowPadding:h,collisionBoundary:v,collisionPadding:y,sticky:x,hideWhenDetached:S,avoidCollisions:C,...k}=e,E=Ll(Bc,n),[j,R]=b.useState(null),[N,T]=b.useState(null),A=pt(t,Q=>R(Q)),[D,F]=b.useState(null),[K,te]=b.useState(null),G=j0(n),[q,V]=b.useState(!1),H=b.useRef(!1);b.useEffect(()=>{if(j)return dI(j)},[j]),uI();const z=b.useCallback(Q=>{const[ve,...be]=G().map(Le=>Le.ref.current),[ke]=be.slice(-1),$e=document.activeElement;for(const Le of Q)if(Le===$e||(Le?.scrollIntoView({block:"nearest"}),Le===ve&&N&&(N.scrollTop=0),Le===ke&&N&&(N.scrollTop=N.scrollHeight),Le?.focus(),document.activeElement!==$e))return},[G,N]),W=b.useCallback(()=>z([D,j]),[z,D,j]);b.useEffect(()=>{q&&W()},[q,W]);const{onOpenChange:L,triggerPointerDownPosRef:ne}=E;b.useEffect(()=>{if(j){let Q={x:0,y:0};const ve=ke=>{Q={x:Math.abs(Math.round(ke.pageX)-(ne.current?.x??0)),y:Math.abs(Math.round(ke.pageY)-(ne.current?.y??0))}},be=ke=>{Q.x<=10&&Q.y<=10?ke.preventDefault():j.contains(ke.target)||L(!1),document.removeEventListener("pointermove",ve),ne.current=null};return ne.current!==null&&(document.addEventListener("pointermove",ve),document.addEventListener("pointerup",be,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ve),document.removeEventListener("pointerup",be,{capture:!0})}}},[j,L,ne]),b.useEffect(()=>{const Q=()=>L(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[L]);const[$,P]=cq(Q=>{const ve=G().filter($e=>!$e.disabled),be=ve.find($e=>$e.ref.current===document.activeElement),ke=uq(ve,Q,be);ke&&setTimeout(()=>ke.ref.current.focus())}),U=b.useCallback((Q,ve,be)=>{const ke=!H.current&&!be;(E.value!==void 0&&E.value===ve||ke)&&(F(Q),ke&&(H.current=!0))},[E.value]),O=b.useCallback(()=>j?.focus(),[j]),J=b.useCallback((Q,ve,be)=>{const ke=!H.current&&!be;(E.value!==void 0&&E.value===ve||ke)&&te(Q)},[E.value]),pe=r==="popper"?sk:G9,ge=pe===sk?{side:l,sideOffset:d,align:f,alignOffset:m,arrowPadding:h,collisionBoundary:v,collisionPadding:y,sticky:x,hideWhenDetached:S,avoidCollisions:C}:{};return u.jsx(q9,{scope:n,content:j,viewport:N,onViewportChange:T,itemRefCallback:U,selectedItem:D,onItemLeave:O,itemTextRefCallback:J,focusSelectedItem:W,selectedItemText:K,position:r,isPositioned:q,searchRef:$,children:u.jsx(b0,{as:xSe,allowPinchZoom:!0,children:u.jsx(v0,{asChild:!0,trapped:E.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:Ie(i,Q=>{E.trigger?.focus({preventScroll:!0}),Q.preventDefault()}),children:u.jsx(gf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:u.jsx(pe,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:Q=>Q.preventDefault(),...k,...ge,onPlaced:()=>V(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:Ie(k.onKeyDown,Q=>{const ve=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!ve&&Q.key.length===1&&P(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let ke=G().filter($e=>!$e.disabled).map($e=>$e.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(ke=ke.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const $e=Q.target,Le=ke.indexOf($e);ke=ke.slice(Le+1)}setTimeout(()=>z(ke)),Q.preventDefault()}})})})})})})});K9.displayName=bSe;var wSe="SelectItemAlignedPosition",G9=b.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Ll(Bc,n),a=Fl(Bc,n),[l,d]=b.useState(null),[f,m]=b.useState(null),h=pt(t,A=>m(A)),v=j0(n),y=b.useRef(!1),x=b.useRef(!0),{viewport:S,selectedItem:C,selectedItemText:k,focusSelectedItem:E}=a,j=b.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&f&&S&&C&&k){const A=o.trigger.getBoundingClientRect(),D=f.getBoundingClientRect(),F=o.valueNode.getBoundingClientRect(),K=k.getBoundingClientRect();if(o.dir!=="rtl"){const $e=K.left-D.left,Le=F.left-$e,St=A.left-Le,ct=A.width+St,Qe=Math.max(ct,D.width),zt=window.innerWidth-Lo,Bt=ak(Le,[Lo,Math.max(Lo,zt-Qe)]);l.style.minWidth=ct+"px",l.style.left=Bt+"px"}else{const $e=D.right-K.right,Le=window.innerWidth-F.right-$e,St=window.innerWidth-A.right-Le,ct=A.width+St,Qe=Math.max(ct,D.width),zt=window.innerWidth-Lo,Bt=ak(Le,[Lo,Math.max(Lo,zt-Qe)]);l.style.minWidth=ct+"px",l.style.right=Bt+"px"}const te=v(),G=window.innerHeight-Lo*2,q=S.scrollHeight,V=window.getComputedStyle(f),H=parseInt(V.borderTopWidth,10),z=parseInt(V.paddingTop,10),W=parseInt(V.borderBottomWidth,10),L=parseInt(V.paddingBottom,10),ne=H+z+q+L+W,$=Math.min(C.offsetHeight*5,ne),P=window.getComputedStyle(S),U=parseInt(P.paddingTop,10),O=parseInt(P.paddingBottom,10),J=A.top+A.height/2-Lo,pe=G-J,ge=C.offsetHeight/2,Q=C.offsetTop+ge,ve=H+z+Q,be=ne-ve;if(ve<=J){const $e=te.length>0&&C===te[te.length-1].ref.current;l.style.bottom="0px";const Le=f.clientHeight-S.offsetTop-S.offsetHeight,St=Math.max(pe,ge+($e?O:0)+Le+W),ct=ve+St;l.style.height=ct+"px"}else{const $e=te.length>0&&C===te[0].ref.current;l.style.top="0px";const St=Math.max(J,H+S.offsetTop+($e?U:0)+ge)+be;l.style.height=St+"px",S.scrollTop=ve-J+S.offsetTop}l.style.margin=`${Lo}px 0`,l.style.minHeight=$+"px",l.style.maxHeight=G+"px",r?.(),requestAnimationFrame(()=>y.current=!0)}},[v,o.trigger,o.valueNode,l,f,S,C,k,o.dir,r]);rr(()=>j(),[j]);const[R,N]=b.useState();rr(()=>{f&&N(window.getComputedStyle(f).zIndex)},[f]);const T=b.useCallback(A=>{A&&x.current===!0&&(j(),E?.(),x.current=!1)},[j,E]);return u.jsx(_Se,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:T,children:u.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:u.jsx(Ye.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});G9.displayName=wSe;var SSe="SelectPopperPosition",sk=b.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Lo,...o}=e,a=R0(n);return u.jsx(QE,{...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)"}})});sk.displayName=SSe;var[_Se,jI]=Rf(Bc,{}),lk="SelectViewport",Z9=b.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=Fl(lk,n),a=jI(lk,n),l=pt(t,o.onViewportChange),d=b.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(E0.Slot,{scope:n,children:u.jsx(Ye.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Ie(i.onScroll,f=>{const m=f.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:v}=a;if(v?.current&&h){const y=Math.abs(d.current-m.scrollTop);if(y>0){const x=window.innerHeight-Lo*2,S=parseFloat(h.style.minHeight),C=parseFloat(h.style.height),k=Math.max(S,C);if(k<x){const E=k+y,j=Math.min(x,E),R=E-j;h.style.height=j+"px",h.style.bottom==="0px"&&(m.scrollTop=R>0?R:0,h.style.justifyContent="flex-end")}}}d.current=m.scrollTop})})})]})});Z9.displayName=lk;var Y9="SelectGroup",[CSe,kSe]=Rf(Y9),W9=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Vi();return u.jsx(CSe,{scope:n,id:i,children:u.jsx(Ye.div,{role:"group","aria-labelledby":i,...r,ref:t})})});W9.displayName=Y9;var X9="SelectLabel",J9=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=kSe(X9,n);return u.jsx(Ye.div,{id:i.id,...r,ref:t})});J9.displayName=X9;var nb="SelectItem",[ESe,Q9]=Rf(nb),eq=b.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=e,l=Ll(nb,n),d=Fl(nb,n),f=l.value===r,[m,h]=b.useState(o??""),[v,y]=b.useState(!1),x=pt(t,E=>d.itemRefCallback?.(E,r,i)),S=Vi(),C=b.useRef("touch"),k=()=>{i||(l.onValueChange(r),l.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(ESe,{scope:n,value:r,disabled:i,textId:S,isSelected:f,onItemTextChange:b.useCallback(E=>{h(j=>j||(E?.textContent??"").trim())},[]),children:u.jsx(E0.ItemSlot,{scope:n,value:r,disabled:i,textValue:m,children:u.jsx(Ye.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:x,onFocus:Ie(a.onFocus,()=>y(!0)),onBlur:Ie(a.onBlur,()=>y(!1)),onClick:Ie(a.onClick,()=>{C.current!=="mouse"&&k()}),onPointerUp:Ie(a.onPointerUp,()=>{C.current==="mouse"&&k()}),onPointerDown:Ie(a.onPointerDown,E=>{C.current=E.pointerType}),onPointerMove:Ie(a.onPointerMove,E=>{C.current=E.pointerType,i?d.onItemLeave?.():C.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ie(a.onPointerLeave,E=>{E.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Ie(a.onKeyDown,E=>{d.searchRef?.current!==""&&E.key===" "||(fSe.includes(E.key)&&k(),E.key===" "&&E.preventDefault())})})})})});eq.displayName=nb;var Xp="SelectItemText",tq=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,a=Ll(Xp,n),l=Fl(Xp,n),d=Q9(Xp,n),f=gSe(Xp,n),[m,h]=b.useState(null),v=pt(t,k=>h(k),d.onItemTextChange,k=>l.itemTextRefCallback?.(k,d.value,d.disabled)),y=m?.textContent,x=b.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 rr(()=>(S(x),()=>C(x)),[S,C,x]),u.jsxs(u.Fragment,{children:[u.jsx(Ye.span,{id:d.textId,...o,ref:v}),d.isSelected&&a.valueNode&&!a.valueNodeHasChildren?lf.createPortal(o.children,a.valueNode):null]})});tq.displayName=Xp;var nq="SelectItemIndicator",rq=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Q9(nq,n).isSelected?u.jsx(Ye.span,{"aria-hidden":!0,...r,ref:t}):null});rq.displayName=nq;var ck="SelectScrollUpButton",iq=b.forwardRef((e,t)=>{const n=Fl(ck,e.__scopeSelect),r=jI(ck,e.__scopeSelect),[i,o]=b.useState(!1),a=pt(t,r.onScrollButtonChange);return rr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const f=d.scrollTop>0;o(f)};const d=n.viewport;return l(),d.addEventListener("scroll",l),()=>d.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?u.jsx(aq,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:d}=n;l&&d&&(l.scrollTop=l.scrollTop-d.offsetHeight)}}):null});iq.displayName=ck;var uk="SelectScrollDownButton",oq=b.forwardRef((e,t)=>{const n=Fl(uk,e.__scopeSelect),r=jI(uk,e.__scopeSelect),[i,o]=b.useState(!1),a=pt(t,r.onScrollButtonChange);return rr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const f=d.scrollHeight-d.clientHeight,m=Math.ceil(d.scrollTop)<f;o(m)};const d=n.viewport;return l(),d.addEventListener("scroll",l),()=>d.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?u.jsx(aq,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:d}=n;l&&d&&(l.scrollTop=l.scrollTop+d.offsetHeight)}}):null});oq.displayName=uk;var aq=b.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=Fl("SelectScrollButton",n),a=b.useRef(null),l=j0(n),d=b.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return b.useEffect(()=>()=>d(),[d]),rr(()=>{l().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),u.jsx(Ye.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Ie(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Ie(i.onPointerMove,()=>{o.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Ie(i.onPointerLeave,()=>{d()})})}),jSe="SelectSeparator",RSe=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return u.jsx(Ye.div,{"aria-hidden":!0,...r,ref:t})});RSe.displayName=jSe;var dk="SelectArrow",ISe=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=R0(n),o=Ll(dk,n),a=Fl(dk,n);return o.open&&a.position==="popper"?u.jsx(ej,{...i,...r,ref:t}):null});ISe.displayName=dk;var TSe="SelectBubbleInput",sq=b.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=b.useRef(null),o=pt(r,i),a=AE(t);return b.useEffect(()=>{const l=i.current;if(!l)return;const d=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(d,"value").set;if(a!==t&&m){const h=new Event("change",{bubbles:!0});m.call(l,t),l.dispatchEvent(h)}},[a,t]),u.jsx(Ye.select,{...n,style:{...eU,...n.style},ref:o,defaultValue:t})});sq.displayName=TSe;function lq(e){return e===""||e===void 0}function cq(e){const t=Tn(e),n=b.useRef(""),r=b.useRef(0),i=b.useCallback(a=>{const l=n.current+a;t(l),(function d(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(l)},[t]),o=b.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function uq(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=NSe(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 NSe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ASe=M9,OSe=L9,$Se=U9,DSe=V9,PSe=B9,MSe=H9,zSe=Z9,LSe=W9,FSe=J9,USe=eq,VSe=tq,BSe=rq,HSe=iq,qSe=oq;function Gi({...e}){return u.jsx(ASe,{"data-slot":"select",...e})}function Wo({...e}){return u.jsx(LSe,{"data-slot":"select-group",...e})}function Zi({...e}){return u.jsx($Se,{"data-slot":"select-value",...e})}function Yi({className:e,children:t,...n}){return u.jsxs(OSe,{"data-slot":"select-trigger",className:Ue("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(DSe,{asChild:!0,children:u.jsx(O4,{className:"opacity-50 size-4"})})]})}function Wi({className:e,children:t,position:n="popper",...r}){return u.jsx(PSe,{children:u.jsxs(MSe,{"data-slot":"select-content",className:Ue("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(KSe,{}),u.jsx(zSe,{className:Ue("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(GSe,{})]})})}function RI({className:e,...t}){return u.jsx(FSe,{"data-slot":"select-label",className:Ue("px-2 py-1.5 text-sm font-medium",e),...t})}function $t({className:e,children:t,...n}){return u.jsxs(USe,{"data-slot":"select-item",className:Ue("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(VSe,{children:t}),u.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:u.jsx(BSe,{children:u.jsx(sE,{className:"size-4"})})})]})}function KSe({className:e,...t}){return u.jsx(HSe,{"data-slot":"select-scroll-up-button",className:Ue("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(rte,{className:"size-4"})})}function GSe({className:e,...t}){return u.jsx(qSe,{"data-slot":"select-scroll-down-button",className:Ue("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(O4,{className:"size-4"})})}const wP=new RegExp(/^\d+/);function ZSe(e,t){const n=parseInt(e.match(wP)?.[0]||"0",10),r=parseInt(t.match(wP)?.[0]||"0",10);return n===r?0:n>r?1:-1}const dq=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],fq=["secs","mins","hrs"],rb={bytes:1e3,secs:60};function YSe(e,t,n){let r,i;switch(t){case"bytes":{r=dq,i=rb.bytes;break}case"secs":{r=fq,i=rb.secs;break}default:return e}const o=r.indexOf(n);if(o===-1)return e;const a=i**o;return e/a}function WSe(e,t){let n,r;switch(e){case"bytes":n=dq,r=rb.bytes;break;case"secs":n=fq,r=rb.secs;break;default:return e}let i=0;for(;t>=r&&i<n.length-1;)t/=r,i++;return n[i]}function Fo(e,t=1){const n=e*t,r=WSe("bytes",n),i=YSe(n,"bytes",r);return`${new Intl.NumberFormat().format(Math.round(i))} ${r}`}function fy(e){return new Intl.NumberFormat().format(e)}const SP=["K","M","B","T","Qa","Qi","Sx","Sp","Oc","No","Dc"];function mo(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<SP.length-1);return`${fy(Math.round(n))} ${SP[r]}`}function XSe({planLimits:e,resourcesPerInstance:t,selectedRegion:n,isEnterprise:r}){const[i,o]=b.useState(!1),a=b.useCallback(()=>{o(!i)},[i,o]),l=qn(e?.expirationMonths)&&e.expirationMonths<1e3&&e.expirationMonths,d=n?.purchasedBlockMultiplier??1,f=b.useMemo(()=>e?[qn(e.totalReadCount)&&{label:"Total Reads",value:`${mo(e.totalReadCount*d)} reads`},qn(e.totalReadsBytes)&&{label:"Total Read Transfer",value:`${Fo(e.totalReadsBytes*d)}`},qn(e.readsPerMinuteCount)&&{label:"Read Rate",value:`${mo(e.readsPerMinuteCount*60*d)}/min`},qn(e.readsPerMinuteBytes)&&{label:"Read Bandwidth",value:`${Fo(e.readsPerMinuteBytes*60*d)}/min`},qn(e.totalWriteCount)&&{label:"Total Writes",value:`${mo(e.totalWriteCount)} reads`},qn(e.totalWritesBytes)&&{label:"Total Write Transfer",value:`${Fo(e.totalWritesBytes)}`},qn(e.writesPerMinuteCount)&&{label:"Write Rate",value:`${mo(e.writesPerMinuteCount*60)}/min`},qn(e.writesPerMinuteBytes)&&{label:"Write Bandwidth",value:`${Fo(e.writesPerMinuteBytes*60)}/min`},qn(e.totalRealTimeMessageDeliveries)&&{label:"Total Real-Time Messages",value:`${mo(e.totalRealTimeMessageDeliveries*d)} messages`},qn(e.totalRealTimeMessageDeliveryBytes)&&{label:"Total Real-Time Message Transfer",value:`${Fo(e.totalRealTimeMessageDeliveryBytes*d)}`},qn(e.realTimeMessageDeliveriesPerMinute)&&{label:"Real-Time Message Rate",value:`${mo(e.realTimeMessageDeliveriesPerMinute*60*d)}/min`},qn(e.realTimeMessageDeliveryBytesPerMinute)&&{label:"Real-Time Message Bandwidth",value:`${Fo(e.realTimeMessageDeliveryBytesPerMinute*60*d)}/min`},qn(e.tlsHandshakes)&&{label:"TLS Handshakes",value:`${mo(e.tlsHandshakes*60*d)}`},qn(e.applicationComputeHours)&&{label:"Application Compute Hours",value:`${mo(e.applicationComputeHours*60*d)}`},t&&qn(t.storageGb)&&{label:"Storage",value:`${Fo(t.storageGb*1e9)}`},l&&{label:"Expiration",value:Wr(l,"month","months")}].filter(Jo):[],[l,e,t,d]);if(!e)return"";if(!qn(e.totalReadCount))return"This plan has no usage limits.";const m=r?" Pricing subject to contracted rate.":" Beta pricing subject to change.",h=qn(e.readsPerMinuteCount)?`${mo(e.readsPerMinuteCount*d)} reads/min & `:"",v=qn(e.writesPerMinuteCount)?` ${mo(e.writesPerMinuteCount)} writes/min & `:" ",y=qn(e.readsPerMinuteCount)?"in "+(n?.region??"")+" region":"per server",x=l?`, for ${Wr(l,"month","months")}`:"",S=r?"for the contracted rate":"for the price listed above",C=l?` in ${Wr(l,"month","months")} or`:"";return u.jsxs(Te,{className:"basis-full",children:[u.jsxs(Ne,{onClick:a,children:["Purchasing usage block for ",h,mo(e.totalReadCount*d)," total reads ",y,",",u.jsx("br",{className:"hidden sm:block"}),v," ",mo(e.totalWriteCount)," total writes",x,".",m,u.jsx("br",{className:"block sm:hidden"}),u.jsxs(xe,{type:"button",variant:"link",className:"text-white",children:["Learn More ",i?u.jsx(Pb,{}):u.jsx(xi,{})]})]}),u.jsx(Oe,{children:u.jsxs("dl",{className:Ue("divide-y divide-black overflow-hidden transition-[max-height] duration-200 ease-in",i?"max-h-fit":"max-h-0"),children:[u.jsxs("div",{className:"text-sm mb-3 max-w-lg",children:["This plan licenses Harper for the usage limits below, ",S,". The usage license expires",C," ","when any usage limit is reached. New usage blocks are automatically purchased/billed as blocks are consumed."]}),f.map((k,E)=>u.jsxs("div",{className:Ue("px-4 py-1 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-3",E%2===0&&"bg-gray-700"),children:[u.jsx("dt",{className:"text-sm/6 font-medium text-gray-300",children:k.label}),u.jsx("dd",{className:"mt-1 text-sm/6 sm:col-span-2 sm:mt-0",children:k.value})]},k.label))]})}),u.jsx(Ae,{})]})}function JSe({control:e,fieldArray:t,form:n,index:r,regionNameToLatencyToRegion:i,selectedPlan:o,isEnterprise:a}){const l=b.useMemo(()=>Object.keys(i).sort(),[i]),d=n.watch("deploymentDescription")?.startsWith("Dedicated"),f=n.watch(`regionPlans.${r}.regionName`),m=n.watch(`regionPlans.${r}.latencyDescription`),h=b.useMemo(()=>Object.keys(i[f]||{}).sort(ZSe).reverse(),[i,f]);b.useEffect(function(){if(f&&h?.length&&!h?.includes(m)){const x=m?.split(" ")[0].toLowerCase(),S=h.find(C=>x?C.split(" ")[0].toLowerCase()===x:!0)||h[0];n.setValue(`regionPlans.${r}.latencyDescription`,S),n.trigger()}},[h,n,r,m,f]);const v=b.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(De,{control:e,name:`regionPlans.${r}.regionName`,render:({field:y})=>u.jsxs(Te,{className:"flex-1",children:[u.jsxs(Ne,{children:["Region ",t.fields.length>1?r+1:""]}),u.jsx(Oe,{children:u.jsxs(Gi,{onValueChange:x=>{y.onChange(x),n.trigger()},...y,children:[u.jsx(Yi,{className:"w-full",children:u.jsx(Zi,{placeholder:"Choose Region"})}),u.jsx(Wi,{children:u.jsx(Wo,{children:l.map(x=>u.jsx($t,{value:x,children:x},x))})})]})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:e,name:`regionPlans.${r}.latencyDescription`,render:({field:y})=>u.jsxs(Te,{className:"flex-1",children:[u.jsxs(Ne,{children:["Estimated ",d?"P95":"P90"," Latency, Distribution"]}),u.jsx(Oe,{children:u.jsxs(Gi,{onValueChange:x=>{y.onChange(x),n.trigger()},...y,disabled:!h?.length,children:[u.jsx(Yi,{className:"w-full",children:u.jsx(Zi,{placeholder:"Choose Latency Tier"})}),u.jsx(Wi,{children:u.jsx(Wo,{children:h.map(x=>u.jsx($t,{value:x,children:x},x))})})]})}),u.jsx(Ae,{})]})}),t?.fields?.length&&t?.fields?.length>1&&u.jsx("div",{className:"flex-none mt-6",children:u.jsxs(xe,{type:"button",variant:"destructiveOutline",size:"sm",onClick:v,children:[u.jsx(Ca,{})," ",u.jsx("span",{className:"sr-only",children:"Remove"})]})}),u.jsx(XSe,{planLimits:o?.planLimits,resourcesPerInstance:o?.resourcesPerInstance,selectedRegion:i[f]?.[m],isEnterprise:a})]})}function QSe({form:e,regionLocations:t,regionNameToLatencyToRegion:n,selectedPlan:r,totalPrice:i,isEnterprise:o}){const a=e.watch("regionPlans"),l=dj({control:e.control,name:"regionPlans"}),d=b.useMemo(()=>{const m=a.map(h=>n?.[h.regionName]?.[h.latencyDescription]?.region);return i?t?.find(h=>!m.includes(h.region)):null},[t,n,a,i]),f=b.useCallback(()=>{d&&(l.append({regionName:d.region,latencyDescription:d.latencyDescription}),e.trigger())},[e,d,l]);return t?.length?u.jsxs(u.Fragment,{children:[l.fields.map((m,h)=>u.jsx(JSe,{control:e.control,fieldArray:l,form:e,index:h,regionNameToLatencyToRegion:n,selectedPlan:r,isEnterprise:o},m.id)),d&&u.jsx("div",{className:"md:col-span-6 col-span-3",children:u.jsxs(xe,{type:"button",variant:"positiveOutline",className:"rounded-full",onClick:f,children:[u.jsx(Qr,{}),"Add Additional Region Usage"]})})]}):u.jsx("div",{className:"md:col-span-6 col-span-3",children:u.jsx(Ey,{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(kl,{}),"."]})}})})}const pq=0,mq=65535;function e_e({control:e,fieldArray:t,form:n,index:r}){const i=b.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(De,{control:e,name:`instances.${r}.secure`,render:({field:o})=>u.jsxs(Te,{children:[u.jsxs(Ne,{children:["Instance ",t.fields.length>1?r+1:""]}),u.jsx(Oe,{children:u.jsxs(Gi,{...o,onValueChange:a=>{o.onChange(a),n.trigger()},children:[u.jsx(Yi,{className:"w-full",children:u.jsx(Zi,{placeholder:"https://"})}),u.jsx(Wi,{children:u.jsxs(Wo,{children:[u.jsx($t,{value:"true",children:"https://"}),u.jsx($t,{value:"false",children:"http://"})]})})]})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:e,name:`instances.${r}.fqdn`,render:({field:o})=>u.jsxs(Te,{className:"flex-3",children:[u.jsx(Ne,{children:"Host Name"}),u.jsx(Oe,{children:u.jsx(ze,{...o,type:"text",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off"})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:e,name:`instances.${r}.port`,render:({field:o})=>u.jsxs(Te,{children:[u.jsx(Ne,{children:"Operations API Port"}),u.jsx(Oe,{children:u.jsx(ze,{...o,type:"number",min:pq,max:mq,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:String(Td),onChange:a=>{o.onChange(a.target.value?parseInt(a.target.value,10):void 0),n.trigger()}})}),u.jsx(Ae,{})]})}),t?.fields?.length&&t?.fields?.length>1&&u.jsx("div",{className:"flex-none mt-6",children:u.jsxs(xe,{type:"button",variant:"destructiveOutline",size:"sm",onClick:i,children:[u.jsx(Ca,{})," ",u.jsx("span",{className:"sr-only",children:"Remove"})]})})]})}function t_e({form:e}){const t=dj({control:e.control,name:"instances"}),n=b.useCallback(()=>{t.append({secure:"true",fqdn:"",port:Td})},[t]);return u.jsxs(u.Fragment,{children:[t.fields.map((r,i)=>u.jsx(e_e,{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(xe,{type:"button",variant:"positiveOutline",className:"rounded-full",onClick:n,children:[u.jsx(Qr,{}),"Add Instance"]})})]})}const _P=/(^$|^(?: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,ib=Dt({clusterName:tt().nonempty("Please enter a cluster name.").max(255,"Cluster name cannot be longer than 255 characters long."),abbreviatedName:tt().max(20,"Must be at most 20 characters long.").regex(/^[a-z0-9-]*$/,"Can only contain lowercase letters, numbers and dashes").optional(),fqdn:tt().regex(_P,"Please enter a valid host name without the port or any path.").optional(),deploymentDescription:tt().nonempty("Please select a deployment tier."),performanceDescription:tt().nonempty("Please select a performance tier."),regionPlans:ds(Dt({regionName:tt().nonempty("Please select a region."),latencyDescription:tt().nonempty("Please select a latency tier.")})).max(50,{error:"A maximum of 50 regions can be selected for each cluster. "}),instances:ds(Dt({secure:Ml(["true","false"]),fqdn:tt().nonempty("Please enter the host name of your instance.").regex(_P,"Please enter a valid host name without the port or any path."),port:a0().min(pq,"Positive thinking only, please.").max(mq,"That port number is too high.").optional()})).max(100,{error:"A maximum of 100 instances can be added to each cluster."}),skipToBilling:Qt().optional(),sourceClusterId:tt().optional()}),CP={Colocated:"Shared infrastructure for optimized value",Dedicated:"Dedicated infrastructure for consistent performance","Self-Hosted":"Your own infrastructure"};function n_e({calculatedNames:e,clusterId:t,deploymentToPerformanceToPlan:n,form:r,isPending:i,regionLocations:o,regionNameToLatencyToRegion:a,selectedDeployment:l,selectedPerformance:d,selectedPlan:f,totalPrice:m,isEnterprise:h}){const{isDirty:v,isValid:y}=aj(),x=b.useMemo(()=>Object.keys(n[l]||{}).map(k=>{const E=k.slice(0,-1).split("(");if(E.length>1)return{performanceTier:k,name:E[0],description:E[1]};const j=k.split(" for ");return j.length>1?{performanceTier:k,name:j[0],description:"For "+j[1]}:{performanceTier:k,name:k,description:""}}),[n,l]),S=b.useMemo(()=>Object.keys(n).sort(),[n]);b.useEffect(function(){x?.length&&!x.find(E=>E.performanceTier===d)&&(r.setValue("performanceDescription",x[0].performanceTier),r.trigger())},[l,d,x,r]);const C=l==="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(De,{control:r.control,name:"clusterName",render:({field:k})=>u.jsxs(Te,{className:"col-span-3 md:col-span-6",children:[u.jsx(Ne,{className:"pb-1",children:"Cluster Name"}),u.jsx(Oe,{children:u.jsx(ze,{autoFocus:!0,type:"text",maxLength:ib.shape.clusterName.maxLength,autoCapitalize:"words",disabled:!!t,...k})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:r.control,name:"deploymentDescription",render:({field:k})=>u.jsxs(Te,{className:"col-span-3",children:[u.jsx(Ne,{className:"pb-1",children:"Harper Deployment"}),u.jsx(b.Suspense,{fallback:u.jsx(Mr,{}),children:u.jsx(Oe,{children:u.jsxs(Gi,{...k,disabled:!!t,onValueChange:E=>{k.onChange(E),r.trigger()},children:[u.jsx(Yi,{className:"w-full h-auto",children:u.jsx(Zi,{placeholder:"Choose Tier"})}),u.jsx(Wi,{children:u.jsx(Wo,{children:S.map(E=>u.jsxs($t,{value:E,children:[u.jsx("dt",{className:"text-left font-bold text-sm/6",children:E}),CP[E]&&u.jsx("dd",{className:"font-light",children:CP[E]})]},E))})})]})})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:r.control,name:"performanceDescription",render:({field:k})=>u.jsxs(Te,{className:"col-span-3",children:[u.jsxs(Ne,{className:"pb-1",children:[l.startsWith("Self")?"Support":"Performance"," & Usage"]}),u.jsx(b.Suspense,{fallback:u.jsx(Mr,{}),children:u.jsx(Oe,{children:u.jsxs(Gi,{...k,onValueChange:E=>{k.onChange(E),r.trigger()},disabled:!x?.length,children:[u.jsx(Yi,{className:"w-full h-auto",children:u.jsx(Zi,{placeholder:"Choose Tier"})}),u.jsx(Wi,{children:u.jsx(Wo,{children:x.map(E=>u.jsxs($t,{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(Ae,{})]})}),C?u.jsx(u.Fragment,{children:u.jsx(De,{control:r.control,name:"fqdn",render:({field:k})=>u.jsxs(Te,{className:"md:col-span-6 col-span-3",children:[u.jsx(Ne,{className:"pb-1",children:"Optional Cluster Load Balancer Host Name"}),u.jsx(Oe,{children:u.jsx(ze,{...k,type:"text",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:"example.your-company.com",disabled:!!t})}),u.jsx(Ae,{})]})})}):u.jsxs(u.Fragment,{children:[u.jsx(De,{control:r.control,name:"abbreviatedName",render:({field:k})=>u.jsxs(Te,{className:"col-span-3",children:[u.jsx(Ne,{className:"pb-1",children:"Host Name"}),u.jsx(Oe,{children:u.jsx(ze,{...k,type:"text",maxLength:ib.shape.abbreviatedName.unwrap().maxLength,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:e.suggestedAbbreviatedName,disabled:!!t})}),u.jsx(Ae,{})]})}),u.jsxs(Te,{className:"col-span-3 ",children:[u.jsx(Ne,{className:"pb-1",children:"Full Host Name"}),u.jsx(Oe,{children:u.jsx("span",{children:e.fullHostName})}),u.jsx(Ae,{})]})]}),C?u.jsx(t_e,{form:r}):u.jsx(QSe,{form:r,regionLocations:o,regionNameToLatencyToRegion:a,selectedPlan:f,totalPrice:m,isEnterprise:h})]}),u.jsx(Yn,{className:"mt-3 mb-12",children:u.jsxs(xe,{type:"submit",variant:"submit",className:"rounded-full",disabled:i||t&&!v||!y,children:[m>0?"Confirm Payment Details":t?"Edit Cluster":"Create New Cluster",u.jsx(xi,{})]})})]})}function hq(e){const{fqdn:t}=e;let{secure:n,port:r}=e;return r||(r=Td),r===443&&n==="false"&&(n="true"),r===80&&n==="true"&&(n="false"),`${n==="true"?"https":"http"}://${t}${r===443||r===80?"":":"+r}`.toLowerCase()}function gq(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(l=>i.includes(l.id)):t,a=o.find(l=>l.region==="US")||o[0];if(a)return{deploymentDescription:r.deploymentDescription,performanceDescription:r.performanceDescription,regionPlans:[{regionName:a.region,latencyDescription:a.latencyDescription}]}}return null}function r_e(e,t,n){if(t&&n){const r=e.getValues();if(!r.deploymentDescription||!r.performanceDescription||!r.regionPlans.length){const i=gq(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 i_e({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(o_e,{type:r.type,value:r.value},i))})}function o_e({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 a_e({alreadyUsingFree:e,clusterId:t,defaultValues:n,deploymentToPerformanceToPlan:r,organization:i,organizationId:o,planTypes:a,regionLocationsColocated:l,regionLocationsDedicated:d,setSavedClusterState:f,startOffOnBilling:m}){const h=jn(),v=_n(),y=i?.type===$m,x=ir(),{mutate:S,isPending:C}=hwe(),{mutate:k,isPending:E}=vwe(),[j,R]=b.useState(m),N=b.useMemo(()=>ik(l?.sort(rk("latencyDescription"))||[],"region","latencyDescription"),[l]),T=b.useMemo(()=>ik(d?.sort(rk("latencyDescription"))||[],"region","latencyDescription"),[d]),A=b.useCallback((be,ke)=>{const $e=new Set,Le=r?.[be.deploymentDescription]?.[be.performanceDescription];if(be.deploymentDescription==="Self-Hosted")for(let ct=0;ct<be.instances.length;ct++){const Qe=hq(be.instances[ct]);$e.has(Qe)?ke.addIssue({code:"custom",path:[`instances.${ct}.fqdn`],message:"Every instance url must be unique!"}):$e.add(Qe)}else{Le?.priceUsd===0&&e&&ke.addIssue({code:"custom",path:["performanceDescription"],message:"Only one free cluster is allowed per organization."});const ct=Le?.deploymentDescription!=="Dedicated"?N:T;for(let Qe=0;Qe<be.regionPlans.length;Qe++){const zt=be.regionPlans[Qe],Bt=ct[zt.regionName]?.[zt.latencyDescription];$e.has(zt.regionName)?ke.addIssue({code:"custom",path:[`regionPlans.${Qe}.regionName`],message:"You can only select a region once!"}):$e.add(zt.regionName),Le?.allowedRegionIds?.length&&Bt?.id&&(Le.allowedRegionIds.includes(Bt.id)?Qe>=1&&ke.addIssue({code:"custom",path:[`regionPlans.${Qe}.regionName`],message:"You can only select one region with this performance tier!"}):ywe(Le.allowedRegionIds,Bt.id)?ke.addIssue({code:"custom",path:[`regionPlans.${Qe}.latencyDescription`],message:"This latency is not available with the selected performance tier!"}):ke.addIssue({code:"custom",path:[`regionPlans.${Qe}.regionName`],message:"This region is not available with the selected performance tier!"}))}}},[e,N,T,r]),D=un({mode:"onChange",resolver:vn(ib.superRefine(A)),defaultValues:n}),[F,K]=b.useState(!0);b.useEffect(()=>{F&&n&&(f(null),K(!1))},[n,F,f]);const te=D.watch("clusterName"),G=D.watch("abbreviatedName"),q=D.watch("deploymentDescription"),V=D.watch("performanceDescription"),H=D.watch("regionPlans"),z=D.watch("instances"),W=q!=="Dedicated"?N:T,L=q!=="Dedicated"?l:d;b.useEffect(function(){const ke=D.getValues(),$e=q==="Self-Hosted";q&&($e?(ke.abbreviatedName&&D.setValue("abbreviatedName",""),ke.regionPlans.length&&D.setValue("regionPlans",[]),ke.instances.length||D.setValue("instances",[{secure:"true",fqdn:"",port:Td}])):(ke.fqdn&&D.setValue("fqdn",""),ke.instances.length&&D.setValue("instances",[]),ke.regionPlans.length||r_e(D,a,L)))},[D,a,L,q]);const ne=b.useMemo(()=>{const be=R9(k0(te),ib.shape.abbreviatedName.unwrap().maxLength);return{suggestedAbbreviatedName:be,fullHostName:`${G||be}.${i.subdomain||"your-org"}.harperfabric.com`}},[te,G,i]),$=b.useMemo(()=>r?.[q]?.[V],[r,q,V]);b.useEffect(function(){const ke=$?.allowedRegionIds;if(ke?.length&&H?.length===1){const $e=H[0],Le=W?.[$e.regionName]?.[$e.latencyDescription];if(!ke.includes(Le?.id)){const St=L?.filter(Qe=>ke.includes(Qe.id)),ct=St?.find(Qe=>Qe.region==="US")||St?.[0];ct&&(D.setValue("regionPlans.0.regionName",ct.region),D.setValue("regionPlans.0.latencyDescription",ct.latencyDescription),D.trigger())}}},[$,H,D,W,L]),b.useEffect(function(){if(!(q==="Self-Hosted")&&Object.keys(W).length&&H.length)for(let $e=0;$e<H.length;$e++){const Le=H[$e];W[Le.regionName]||D.setValue(`regionPlans.${$e}.regionName`,"")}},[D,W,q,H]);const P=$?.priceUsd?q==="Self-Hosted"?z.length*$.priceUsd:H.reduce((be,ke)=>{const $e=W?.[ke.regionName]?.[ke.latencyDescription];return be+($e?$.priceUsd*$e.instanceCount/2:0)},0):0,U=b.useCallback(({creating:be,deploymentDescription:ke})=>Se.message(be?"Creating Cluster":"Updating Cluster",{description:u.jsx(pwe,{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:ke==="Dedicated"?6e4:5e3}),duration:12e4}),[]),O=b.useCallback(async({clusterId:be,sourceClusterId:ke,creating:$e,toastId:Le,isSelfManaged:St})=>{if(ke){const Qe=(await j9(o)).clusters?.find(zt=>zt.id===ke);Ih(Qe?.status)&&await C9(ke)}x.invalidateQueries({queryKey:[o],refetchType:"active"}),$e||x.invalidateQueries({queryKey:[be],refetchType:"active"}),v.invalidate(),h(St?{to:`/${o}/${be}/instances`}:$e?{to:`/${o}/${be}/starting-up`}:{to:`/${o}/${be}/scaling`}),D.reset(),Se.success($e?"Cluster Created":"Cluster Updated",{id:Le,description:St?void 0:$e?"It is being provisioned now.":"The updates are being provisioned now.",duration:5e3})},[x,v,h,o,D]),J=b.useCallback(async()=>{const be=D.getValues(),ke=[],$e=r[be.deploymentDescription][be.performanceDescription],Le=be.deploymentDescription==="Self-Hosted";if(Le)for(const Qe of be.instances)ke.push({autoRenew:!0,instanceFqdn:Qe.fqdn,operationsApiPort:Qe.port||Td,operationsApiSecure:Qe.secure==="true",planId:$e.id});else for(const Qe of be.regionPlans){const zt=W[Qe.regionName][Qe.latencyDescription];ke.push({autoRenew:!0,planId:$e.id,regionId:zt.id})}f(null);const St=U({creating:!t,deploymentDescription:be.deploymentDescription}),ct=()=>Se.dismiss(St);t?k({id:t,regionPlans:ke},{onSuccess:Qe=>O({clusterId:Qe.id,sourceClusterId:be.sourceClusterId,isSelfManaged:Le,creating:!1,toastId:St}),onError:ct}):S({abbreviatedName:Le?void 0:be.abbreviatedName||ne.suggestedAbbreviatedName,autoRenew:!0,fqdn:Le&&be.fqdn||void 0,name:be.clusterName,organizationId:o,regionPlans:ke},{onSuccess:Qe=>O({clusterId:Qe.id,sourceClusterId:be.sourceClusterId,isSelfManaged:Le,creating:!0,toastId:St}),onError:ct})},[ne.suggestedAbbreviatedName,t,r,D,O,U,o,W,f,k,S]),pe=b.useCallback(()=>{if(P>0){R(!0);return}return J()},[J,P]),ge=b.useCallback(be=>{f(be?{clusterId:t,...D.getValues(),skipToBilling:!0}:null)},[t,D,f]),Q=b.useCallback(()=>{R(!1)},[]),ve=!y&&"mr-37.5";return u.jsxs(u.Fragment,{children:[!y&&u.jsxs("div",{className:"absolute top-3 right-4 md:right-12 text-right",children:[u.jsx("dt",{className:"font-light",children:"Total Price"}),u.jsx("dd",{className:"font-bold",children:u.jsx(i_e,{price:P})})]}),u.jsx(dn,{...D,children:j?u.jsxs(u.Fragment,{children:[u.jsx("h1",{className:yr("text-lg leading-none text-white font-semibold mb-4",ve),children:"Cluster Billing"}),u.jsx("p",{className:yr("text-muted-foreground text-sm mb-2",ve),children:"Please confirm the following billing details:"}),u.jsx(uSe,{clusterId:t,isPending:C||E,onGoBackToDetails:Q,onSaveStateForBillingRedirect:ge,onSubmit:J,organizationId:o,selectedPlan:$})]}):u.jsxs(u.Fragment,{children:[u.jsx("h1",{className:yr("text-lg leading-none text-white font-semibold mb-4",ve),children:"Cluster Configuration"}),u.jsx("p",{className:yr("text-muted-foreground text-sm mb-6",ve),children:"Configure your Harper cluster and define deployment plans."}),u.jsx("form",{onSubmit:D.handleSubmit(pe),children:u.jsx(n_e,{calculatedNames:ne,clusterId:t,deploymentToPerformanceToPlan:r,form:D,isPending:C||E,regionLocations:L,regionNameToLatencyToRegion:W,selectedDeployment:q,selectedPerformance:V,selectedPlan:$,totalPrice:P,isEnterprise:y})})]})})]})}function kP(e){return e?.clusterName!==void 0}function II(){const{organizationId:e,clusterId:t}=rt({strict:!1}),{create:n,update:r}=ax(e),{organization:i,cluster:o}=$b({strict:!1}),[a,l]=jf(su.SavedClusterState,null),{data:d}=Mt(uwe(e)),{data:f}=Mt(uP({availableHosts:!0,organizationId:e})),{data:m}=Mt(uP({organizationId:e})),h=b.useMemo(()=>{for(const S of i?.clusters??[])if(S.id!==o?.id&&d&&!cI(S.status)&&!Ih(S.status)&&S.plans)for(const C of S.plans){const k=d.find(E=>E.id===C.planId);if(k?.priceUsd===0&&!k.id.startsWith("self-hosted"))return!0}return!1},[o?.id,i?.clusters,d]),v=b.useMemo(()=>ik(d?.sort(rk("priceUsd"))||[],"deploymentDescription","performanceDescription"),[d]),y=b.useMemo(()=>{if(!d||!f||!m||t&&!o)return null;let S=o;if(a){if(kP(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(T=>T.id===o?.plans?.[0].planId),k=[],E=[],j=C?.deploymentDescription!=="Dedicated"?f:m,R=gq(d,j,h);let N=!1;if(S){if(S.plans){for(const T of S.plans)if(T.regionId){const A=j.find(D=>D.id===T.regionId);A&&k.push({regionName:A.region,latencyDescription:A.latencyDescription})}}if(!k.length&&S.instances){const T=S.instances.filter(A=>A.status&&!fj.includes(A.status)).sort(E9);for(const A of T)N=!0,E.push({fqdn:A.instanceFqdn,port:A.operationsApiPort,secure:A.operationsApiSecure?"true":"false"})}}else R&&k.push(...R.regionPlans);return!N&&!k.length&&k.push({regionName:"",latencyDescription:""}),{sourceClusterId:S?.id,autoRenew:S?.plans?.[0]?.autoRenew??!0,clusterName:S?.name??"",abbreviatedName:S?.abbreviatedName??"",deploymentDescription:C?.deploymentDescription??R?.deploymentDescription??"",performanceDescription:C?.performanceDescription??R?.performanceDescription??"",fqdn:N?S?.fqdn??"":"",instances:E,regionPlans:k}},[h,o,t,d,f,m,a]);return!y||!i||!d||!f||!m?u.jsx(Tv,{children:u.jsx(no,{centered:!0,text:"Loading..."})}):(o?.id?!r:!n)?u.jsx(Tv,{children:u.jsx(Ey,{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(Tv,{children:u.jsx(Ey,{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(kl,{}),"."]})}})}):u.jsx(Tv,{children:u.jsx(a_e,{alreadyUsingFree:h,clusterId:t,defaultValues:y,deploymentToPerformanceToPlan:v,organization:i,organizationId:e,planTypes:d,regionLocationsColocated:f,regionLocationsDedicated:m,setSavedClusterState:l,startOffOnBilling:kP(a)&&a.skipToBilling===!0})})}const fk={FAILED:0,UPDATING:1,PROVISIONING:2,RUNNING:3,TERMINATED:4},Ov=fk.RUNNING;function s_e(e,t){if(e.status===t.status)return e.name.localeCompare(t.name);const n=e.status?fk[e.status]??Ov:Ov,r=t.status?fk[t.status]??Ov:Ov;return n-r}function vq(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 l_e(){const{organizationId:e}=rt({strict:!1}),{create:t}=ax(e),{data:n,isSuccess:r}=Ji(lu(e)),[i]=jf(su.SavedClusterState,null),[o,a]=b.useState(""),l=b.useCallback(()=>a(""),[]),d=b.useCallback(h=>{a(h.currentTarget.value?.toLowerCase()||"")},[]),f=b.useMemo(()=>n?.clusters?.slice().filter(h=>!cI(h.status)).sort(s_e)||[],[n?.clusters]),m=b.useMemo(()=>f.filter(vq(["id","name"],o))||[],[o,f]);return n&&f.length===0&&t?u.jsx(II,{}):i?u.jsx(jc,{to:`/${e}/new-cluster`}):u.jsxs(u.Fragment,{children:[u.jsx(vs,{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-full text-xs",value:o,onChange:d}),t&&u.jsx(Ze,{to:"new-cluster",children:u.jsxs(xe,{variant:"positive",accessKey:"n",children:[u.jsx(Qr,{})," ",u.jsxs("span",{className:"hidden sm:inline-block",children:[u.jsx("u",{children:"N"}),"ew ",u.jsx("span",{className:"hidden md:inline-block",children:"Cluster"})]})]})})]}):null}),u.jsx("section",{className:"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:[m.map(h=>u.jsx("div",{className:"col-span-1 md:col-span-4 lg:col-span-3 2xl:col-span-2",children:u.jsx(lwe,{cluster:h})},h.id)),!m.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(xe,{variant:"outline",onClick:l,children:"Clear Filters"})]})]})})]})}function yq(){const e=URL.parse(location.href);return e?.hash?e.hash.startsWith("#/")?e.hash.slice(1):e.hash:"/"}function bq(){return"/#"+yq()}function c_e(){const{organizationId:e}=rt({strict:!1}),t=jn(),r=new URLSearchParams(window.location.search).get("setup_intent_client_secret"),{setup_intent_client_secret:i}=Tr({strict:!1}),[o]=jf(su.SavedClusterState,null),a=r||i,l=O9(),d=I9(e),f=b.useCallback(()=>{const m=o?o.clusterId?`../../${o.clusterId}/edit`:"../../new-cluster":"../";window.history.replaceState(null,"",bq()),t({search:void 0,to:m})},[t,o]);return b.useEffect(()=>{!l||!a||!d||!e||!f||(async function(){try{const{setupIntent:m}=await l.retrieveSetupIntent(a);switch(m?.status){case"succeeded":m.payment_method!==null?d(m.payment_method,f):(Se.error("Failed to process payment method details. Please try another payment method."),f());break;case"processing":Se.warning("Processing payment method. Please check back later."),f();break;case"requires_payment_method":Se.error("Failed to process payment method details. Please try another payment method."),f();break;default:Se.error("Failed to process payment method details. Please try another payment method."),f();break}}catch(m){console.error(m),Se.error("Failed to process payment method details. Please try another payment method."),f()}})()},[a,f,e,d,l]),u.jsx(no,{centered:!0})}function u_e(){return u.jsx(D9,{children:u.jsx(c_e,{})})}function ur({clusterId:e,instanceId:t,organizationId:n},r){return"/"+[n,e,t&&"instance",t,r].filter(Jo).join("/")}const am="flex items-center p-2 rounded-lg group",ob={className:"text-white hover:bg-gray-700"},ab={className:"text-black bg-white pointer-events-none cursor-default"};function d_e(){const{organizationId:e}=rt({strict:!1}),{update:t}=ox(e);return t?u.jsxs(u.Fragment,{children:[u.jsx(vs,{}),u.jsx("div",{className:"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(f_e,{}),u.jsx(p_e,{})]}),u.jsx("section",{className:"col-span-1 text-white md:col-span-8 lg:col-span-9",children:u.jsx(jl,{})})]})})]}):u.jsx("div",{className:"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 f_e(){const e=rt({strict:!1});return u.jsxs("div",{className:"hidden md:block",children:[u.jsxs("span",{className:am,children:[u.jsx(pne,{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(Ze,{to:ur(e,"billing"),className:am,activeOptions:{exact:!0},inactiveProps:ob,activeProps:ab,children:[u.jsx(M4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Payment Method"})]})}),u.jsx("li",{children:u.jsxs(Ze,{to:ur(e,"billing/invoices"),className:am,inactiveProps:ob,activeProps:ab,children:[u.jsx(H4,{className:"inline-block"}),u.jsx("span",{className:"ms-3",children:"Invoices & Payments"})]})})]})]})}function p_e(){const e=rt({strict:!1});return u.jsxs("ul",{className:"flex space-x-4 md:hidden py-2",children:[u.jsx("li",{children:u.jsxs(Ze,{to:ur(e,"billing"),className:am,activeOptions:{exact:!0},inactiveProps:ob,activeProps:ab,children:[u.jsx(M4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Payment Method"})]})}),u.jsx("li",{children:u.jsxs(Ze,{to:ur(e,"billing/invoices"),className:am,inactiveProps:ob,activeProps:ab,children:[u.jsx(H4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Invoices & Payments"})]})})]})}function I0(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function nl(e,t){return typeof e=="function"?e(t):e}function Xi(e,t){return n=>{t.setState(r=>({...r,[e]:nl(n,r[e])}))}}function T0(e){return e instanceof Function}function m_e(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function h_e(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 ot(e,t,n){let r=[],i;return o=>{let a;n.key&&n.debug&&(a=Date.now());const l=e(o);if(!(l.length!==r.length||l.some((m,h)=>r[h]!==m)))return i;r=l;let f;if(n.key&&n.debug&&(f=Date.now()),i=t(...l),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const m=Math.round((Date.now()-a)*100)/100,h=Math.round((Date.now()-f)*100)/100,v=h/16,y=(x,S)=>{for(x=String(x);x.length<S;)x=" "+x;return x};console.info(`%c⏱ ${y(h,5)} /${y(m,5)} ms`,`
131
- font-size: .6rem;
132
- font-weight: bold;
133
- color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,n?.key)}return i}}function at(e,t,n,r){return{debug:()=>{var i;return(i=e?.debugAll)!=null?i:e[t]},key:!1,onChange:r}}function g_e(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:ot(()=>[e,n,t,o],(a,l,d,f)=>({table:a,column:l,row:d,cell:f,getValue:f.getValue,renderValue:f.renderValue}),at(e.options,"debugCells"))};return e._features.forEach(a=>{a.createCell==null||a.createCell(o,n,t,e)},{}),o}function v_e(e,t,n,r){var i,o;const l={...e._getDefaultColumnDef(),...t},d=l.accessorKey;let f=(i=(o=l.id)!=null?o:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?i:typeof l.header=="string"?l.header:void 0,m;if(l.accessorFn?m=l.accessorFn:d&&(d.includes(".")?m=v=>{let y=v;for(const S of d.split(".")){var x;y=(x=y)==null?void 0:x[S]}return y}:m=v=>v[l.accessorKey]),!f)throw new Error;let h={id:`${String(f)}`,accessorFn:m,parent:r,depth:n,columnDef:l,columns:[],getFlatColumns:ot(()=>[!0],()=>{var v;return[h,...(v=h.columns)==null?void 0:v.flatMap(y=>y.getFlatColumns())]},at(e.options,"debugColumns")),getLeafColumns:ot(()=>[e._getOrderColumnsFn()],v=>{var y;if((y=h.columns)!=null&&y.length){let x=h.columns.flatMap(S=>S.getLeafColumns());return v(x)}return[h]},at(e.options,"debugColumns"))};for(const v of e._features)v.createColumn==null||v.createColumn(h,e);return h}const Ar="debugHeaders";function EP(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=[],l=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(l),a.push(d)};return l(o),a},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(o,e)}),o}const y_e={createTable:e=>{e.getHeaderGroups=ot(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{var o,a;const l=(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 $v(t,[...l,...f,...d],e)},at(e.options,Ar)),e.getCenterHeaderGroups=ot(()=>[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))),$v(t,n,e,"center")),at(e.options,Ar)),e.getLeftHeaderGroups=ot(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var i;const o=(i=r?.map(a=>n.find(l=>l.id===a)).filter(Boolean))!=null?i:[];return $v(t,o,e,"left")},at(e.options,Ar)),e.getRightHeaderGroups=ot(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var i;const o=(i=r?.map(a=>n.find(l=>l.id===a)).filter(Boolean))!=null?i:[];return $v(t,o,e,"right")},at(e.options,Ar)),e.getFooterGroups=ot(()=>[e.getHeaderGroups()],t=>[...t].reverse(),at(e.options,Ar)),e.getLeftFooterGroups=ot(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),at(e.options,Ar)),e.getCenterFooterGroups=ot(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),at(e.options,Ar)),e.getRightFooterGroups=ot(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),at(e.options,Ar)),e.getFlatHeaders=ot(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Ar)),e.getLeftFlatHeaders=ot(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Ar)),e.getCenterFlatHeaders=ot(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Ar)),e.getRightFlatHeaders=ot(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Ar)),e.getCenterLeafHeaders=ot(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,Ar)),e.getLeftLeafHeaders=ot(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,Ar)),e.getRightLeafHeaders=ot(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,Ar)),e.getLeafHeaders=ot(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var i,o,a,l,d,f;return[...(i=(o=t[0])==null?void 0:o.headers)!=null?i:[],...(a=(l=n[0])==null?void 0:l.headers)!=null?a:[],...(d=(f=r[0])==null?void 0:f.headers)!=null?d:[]].map(m=>m.getLeafHeaders()).flat()},at(e.options,Ar))}};function $v(e,t,n,r){var i,o;let a=0;const l=function(v,y){y===void 0&&(y=1),a=Math.max(a,y),v.filter(x=>x.getIsVisible()).forEach(x=>{var S;(S=x.columns)!=null&&S.length&&l(x.columns,y+1)},0)};l(e);let d=[];const f=(v,y)=>{const x={depth:y,id:[r,`${y}`].filter(Boolean).join("_"),headers:[]},S=[];v.forEach(C=>{const k=[...S].reverse()[0],E=C.column.depth===x.depth;let j,R=!1;if(E&&C.column.parent?j=C.column.parent:(j=C.column,R=!0),k&&k?.column===j)k.subHeaders.push(C);else{const N=EP(n,j,{id:[r,y,j.id,C?.id].filter(Boolean).join("_"),isPlaceholder:R,placeholderId:R?`${S.filter(T=>T.column===j).length}`:void 0,depth:y,index:S.length});N.subHeaders.push(C),S.push(N)}x.headers.push(C),C.headerGroup=x}),d.push(x),y>0&&f(S,y-1)},m=t.map((v,y)=>EP(n,v,{depth:a,index:y}));f(m,a-1),d.reverse();const h=v=>v.filter(x=>x.column.getIsVisible()).map(x=>{let S=0,C=0,k=[0];x.subHeaders&&x.subHeaders.length?(k=[],h(x.subHeaders).forEach(j=>{let{colSpan:R,rowSpan:N}=j;S+=R,k.push(N)})):S=1;const E=Math.min(...k);return C=C+E,x.colSpan=S,x.rowSpan=C,{colSpan:S,rowSpan:C}});return h((i=(o=d[0])==null?void 0:o.headers)!=null?i:[]),d}const b_e=(e,t,n,r,i,o,a)=>{let l={id:t,index:r,original:n,depth:i,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(l._valuesCache.hasOwnProperty(d))return l._valuesCache[d];const f=e.getColumn(d);if(f!=null&&f.accessorFn)return l._valuesCache[d]=f.accessorFn(l.original,r),l._valuesCache[d]},getUniqueValues:d=>{if(l._uniqueValuesCache.hasOwnProperty(d))return l._uniqueValuesCache[d];const f=e.getColumn(d);if(f!=null&&f.accessorFn)return f.columnDef.getUniqueValues?(l._uniqueValuesCache[d]=f.columnDef.getUniqueValues(l.original,r),l._uniqueValuesCache[d]):(l._uniqueValuesCache[d]=[l.getValue(d)],l._uniqueValuesCache[d])},renderValue:d=>{var f;return(f=l.getValue(d))!=null?f:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>h_e(l.subRows,d=>d.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let d=[],f=l;for(;;){const m=f.getParentRow();if(!m)break;d.push(m),f=m}return d.reverse()},getAllCells:ot(()=>[e.getAllLeafColumns()],d=>d.map(f=>g_e(e,l,f,f.id)),at(e.options,"debugRows")),_getAllCellsByColumnId:ot(()=>[l.getAllCells()],d=>d.reduce((f,m)=>(f[m.column.id]=m,f),{}),at(e.options,"debugRows"))};for(let d=0;d<e._features.length;d++){const f=e._features[d];f==null||f.createRow==null||f.createRow(l,e)}return l},x_e={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()}}},xq=(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))};xq.autoRemove=e=>Bo(e);const wq=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};wq.autoRemove=e=>Bo(e);const Sq=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};Sq.autoRemove=e=>Bo(e);const _q=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};_q.autoRemove=e=>Bo(e);const Cq=(e,t,n)=>!n.some(r=>{var i;return!((i=e.getValue(t))!=null&&i.includes(r))});Cq.autoRemove=e=>Bo(e)||!(e!=null&&e.length);const kq=(e,t,n)=>n.some(r=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(r)});kq.autoRemove=e=>Bo(e)||!(e!=null&&e.length);const Eq=(e,t,n)=>e.getValue(t)===n;Eq.autoRemove=e=>Bo(e);const jq=(e,t,n)=>e.getValue(t)==n;jq.autoRemove=e=>Bo(e);const TI=(e,t,n)=>{let[r,i]=n;const o=e.getValue(t);return o>=r&&o<=i};TI.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 l=o;o=a,a=l}return[o,a]};TI.autoRemove=e=>Bo(e)||Bo(e[0])&&Bo(e[1]);const Wa={includesString:xq,includesStringSensitive:wq,equalsString:Sq,arrIncludes:_q,arrIncludesAll:Cq,arrIncludesSome:kq,equals:Eq,weakEquals:jq,inNumberRange:TI};function Bo(e){return e==null||e===""}const w_e={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Xi("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"?Wa.includesString:typeof r=="number"?Wa.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Wa.equals:Array.isArray(r)?Wa.arrIncludes:Wa.weakEquals},e.getFilterFn=()=>{var n,r;return T0(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:Wa[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(m=>m.id===e.id),a=nl(n,o?o.value:void 0);if(jP(i,a,e)){var l;return(l=r?.filter(m=>m.id!==e.id))!=null?l:[]}const d={id:e.id,value:a};if(o){var f;return(f=r?.map(m=>m.id===e.id?d:m))!=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=nl(t,i))==null?void 0:o.filter(a=>{const l=n.find(d=>d.id===a.id);if(l){const d=l.getFilterFn();if(jP(d,a.value,l))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 jP(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const S_e=(e,t,n)=>n.reduce((r,i)=>{const o=i.getValue(e);return r+(typeof o=="number"?o:0)},0),__e=(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},C_e=(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},k_e=(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]},E_e=(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},j_e=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!m_e(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},R_e=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),I_e=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,T_e=(e,t)=>t.length,g1={sum:S_e,min:__e,max:C_e,extent:k_e,mean:E_e,median:j_e,unique:R_e,uniqueCount:I_e,count:T_e},N_e={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:Xi("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 g1.sum;if(Object.prototype.toString.call(r)==="[object Date]")return g1.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return T0(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:g1[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 A_e(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 O_e={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Xi("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ot(n=>[sm(t,n)],n=>n.findIndex(r=>r.id===e.id),at(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=sm(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const i=sm(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=ot(()=>[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],l=[...i];for(;l.length&&a.length;){const d=a.shift(),f=l.findIndex(m=>m.id===d);f>-1&&o.push(l.splice(f,1)[0])}o=[...o,...l]}return A_e(o,n,r)},at(e.options,"debugTable"))}},v1=()=>({left:[],right:[]}),$_e={getInitialState:e=>({columnPinning:v1(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Xi("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 l,d;return{left:((l=i?.left)!=null?l:[]).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,m;return{left:[...((f=i?.left)!=null?f:[]).filter(h=>!(r!=null&&r.includes(h))),...r],right:((m=i?.right)!=null?m:[]).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(l=>l.id),{left:r,right:i}=t.getState().columnPinning,o=n.some(l=>r?.includes(l)),a=n.some(l=>i?.includes(l));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=ot(()=>[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))},at(t.options,"debugRows")),e.getLeftVisibleCells=ot(()=>[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"})),at(t.options,"debugRows")),e.getRightVisibleCells=ot(()=>[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"})),at(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?v1():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:v1())},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=ot(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),at(e.options,"debugColumns")),e.getRightLeafColumns=ot(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),at(e.options,"debugColumns")),e.getCenterLeafColumns=ot(()=>[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))},at(e.options,"debugColumns"))}};function D_e(e){return e||(typeof document<"u"?document:null)}const Dv={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},y1=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),P_e={getDefaultColumnDef:()=>Dv,getInitialState:e=>({columnSizing:{},columnSizingInfo:y1(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Xi("columnSizing",e),onColumnSizingInfoChange:Xi("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:Dv.minSize,(r=o??e.columnDef.size)!=null?r:Dv.size),(i=e.columnDef.maxSize)!=null?i:Dv.maxSize)},e.getStart=ot(n=>[n,sm(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((i,o)=>i+o.getSize(),0),at(t.options,"debugColumns")),e.getAfter=ot(n=>[n,sm(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((i,o)=>i+o.getSize(),0),at(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(),b1(o)&&o.touches&&o.touches.length>1))return;const a=e.getSize(),l=e?e.getLeafHeaders().map(k=>[k.column.id,k.column.getSize()]):[[r.id,r.getSize()]],d=b1(o)?Math.round(o.touches[0].clientX):o.clientX,f={},m=(k,E)=>{typeof E=="number"&&(t.setColumnSizingInfo(j=>{var R,N;const T=t.options.columnResizeDirection==="rtl"?-1:1,A=(E-((R=j?.startOffset)!=null?R:0))*T,D=Math.max(A/((N=j?.startSize)!=null?N:0),-.999999);return j.columnSizingStart.forEach(F=>{let[K,te]=F;f[K]=Math.round(Math.max(te+te*D,0)*100)/100}),{...j,deltaOffset:A,deltaPercentage:D}}),(t.options.columnResizeMode==="onChange"||k==="end")&&t.setColumnSizing(j=>({...j,...f})))},h=k=>m("move",k),v=k=>{m("end",k),t.setColumnSizingInfo(E=>({...E,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},y=D_e(n),x={moveHandler:k=>h(k.clientX),upHandler:k=>{y?.removeEventListener("mousemove",x.moveHandler),y?.removeEventListener("mouseup",x.upHandler),v(k.clientX)}},S={moveHandler:k=>(k.cancelable&&(k.preventDefault(),k.stopPropagation()),h(k.touches[0].clientX),!1),upHandler:k=>{var E;y?.removeEventListener("touchmove",S.moveHandler),y?.removeEventListener("touchend",S.upHandler),k.cancelable&&(k.preventDefault(),k.stopPropagation()),v((E=k.touches[0])==null?void 0:E.clientX)}},C=M_e()?{passive:!1}:!1;b1(o)?(y?.addEventListener("touchmove",S.moveHandler,C),y?.addEventListener("touchend",S.upHandler,C)):(y?.addEventListener("mousemove",x.moveHandler,C),y?.addEventListener("mouseup",x.upHandler,C)),t.setColumnSizingInfo(k=>({...k,startOffset:d,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,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?y1():(n=e.initialState.columnSizingInfo)!=null?n:y1())},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 Pv=null;function M_e(){if(typeof Pv=="boolean")return Pv;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 Pv=e,Pv}function b1(e){return e.type==="touchstart"}const z_e={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Xi("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=ot(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),at(t.options,"debugRows")),e.getVisibleCells=ot(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,i)=>[...n,...r,...i],at(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>ot(()=>[r(),r().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),at(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 sm(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const L_e={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()}}},F_e={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Xi("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=()=>Wa.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return T0(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Wa[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},U_e={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Xi("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(l=>{a[l]=!0}):a=r,n=(i=n)!=null?i:!o,!o&&n)return{...a,[e.id]:!0};if(o&&!n){const{[e.id]:l,...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()}}}},pk=0,mk=10,x1=()=>({pageIndex:pk,pageSize:mk}),V_e={getInitialState:e=>({...e,pagination:{...x1(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Xi("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=>nl(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},e.resetPagination=r=>{var i;e.setPagination(r?x1():(i=e.initialState.pagination)!=null?i:x1())},e.setPageIndex=r=>{e.setPagination(i=>{let o=nl(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?pk:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?i:pk)},e.resetPageSize=r=>{var i,o;e.setPageSize(r?mk:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?i:mk)},e.setPageSize=r=>{e.setPagination(i=>{const o=Math.max(1,nl(r,i.pageSize)),a=i.pageSize*i.pageIndex,l=Math.floor(a/o);return{...i,pageIndex:l,pageSize:o}})},e.setPageCount=r=>e.setPagination(i=>{var o;let a=nl(r,(o=e.options.pageCount)!=null?o:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...i,pageCount:a}}),e.getPageOptions=ot(()=>[e.getPageCount()],r=>{let i=[];return r&&r>0&&(i=[...new Array(r)].fill(null).map((o,a)=>a)),i},at(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}}},w1=()=>({top:[],bottom:[]}),B_e={getInitialState:e=>({rowPinning:w1(),...e}),getDefaultOptions:e=>({onRowPinningChange:Xi("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}):[],l=new Set([...a,e.id,...o]);t.setRowPinning(d=>{var f,m;if(n==="bottom"){var h,v;return{top:((h=d?.top)!=null?h:[]).filter(S=>!(l!=null&&l.has(S))),bottom:[...((v=d?.bottom)!=null?v:[]).filter(S=>!(l!=null&&l.has(S))),...Array.from(l)]}}if(n==="top"){var y,x;return{top:[...((y=d?.top)!=null?y:[]).filter(S=>!(l!=null&&l.has(S))),...Array.from(l)],bottom:((x=d?.bottom)!=null?x:[]).filter(S=>!(l!=null&&l.has(S)))}}return{top:((f=d?.top)!=null?f:[]).filter(S=>!(l!=null&&l.has(S))),bottom:((m=d?.bottom)!=null?m:[]).filter(S=>!(l!=null&&l.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(l=>r?.includes(l)),a=n.some(l=>i?.includes(l));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:l}=a;return l});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?w1():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:w1())},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 l=e.getRow(a,!0);return l.getIsAllParentsExpanded()?l:null}):(n??[]).map(a=>t.find(l=>l.id===a))).filter(Boolean).map(a=>({...a,position:r}))},e.getTopRows=ot(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),at(e.options,"debugRows")),e.getBottomRows=ot(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),at(e.options,"debugRows")),e.getCenterRows=ot(()=>[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))},at(e.options,"debugRows"))}},H_e={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Xi("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=>{hk(i,o.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ot(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?S1(e,n):{rows:[],flatRows:[],rowsById:{}},at(e.options,"debugTable")),e.getFilteredSelectedRowModel=ot(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?S1(e,n):{rows:[],flatRows:[],rowsById:{}},at(e.options,"debugTable")),e.getGroupedSelectedRowModel=ot(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?S1(e,n):{rows:[],flatRows:[],rowsById:{}},at(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 l={...o};return hk(l,e.id,n,(a=r?.selectChildren)!=null?a:!0,t),l})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return NI(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return gk(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return gk(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)}}}},hk=(e,t,n,r,i)=>{var o;const a=i.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),a.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=a.subRows)!=null&&o.length&&a.getCanSelectSubRows()&&a.subRows.forEach(l=>hk(e,l.id,n,r,i))};function S1(e,t){const n=e.getState().rowSelection,r=[],i={},o=function(a,l){return a.map(d=>{var f;const m=NI(d,n);if(m&&(r.push(d),i[d.id]=d),(f=d.subRows)!=null&&f.length&&(d={...d,subRows:o(d.subRows)}),m)return d}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:i}}function NI(e,t){var n;return(n=t[e.id])!=null?n:!1}function gk(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()&&(NI(a,t)?o=!0:i=!1),a.subRows&&a.subRows.length)){const l=gk(a,t);l==="all"?o=!0:(l==="some"&&(o=!0),i=!1)}}),i?"all":o?"some":!1}const vk=/([0-9]+)/gm,q_e=(e,t,n)=>Rq(El(e.getValue(n)).toLowerCase(),El(t.getValue(n)).toLowerCase()),K_e=(e,t,n)=>Rq(El(e.getValue(n)),El(t.getValue(n))),G_e=(e,t,n)=>AI(El(e.getValue(n)).toLowerCase(),El(t.getValue(n)).toLowerCase()),Z_e=(e,t,n)=>AI(El(e.getValue(n)),El(t.getValue(n))),Y_e=(e,t,n)=>{const r=e.getValue(n),i=t.getValue(n);return r>i?1:r<i?-1:0},W_e=(e,t,n)=>AI(e.getValue(n),t.getValue(n));function AI(e,t){return e===t?0:e>t?1:-1}function El(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Rq(e,t){const n=e.split(vk).filter(Boolean),r=t.split(vk).filter(Boolean);for(;n.length&&r.length;){const i=n.shift(),o=r.shift(),a=parseInt(i,10),l=parseInt(o,10),d=[a,l].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>l)return 1;if(l>a)return-1}return n.length-r.length}const Fp={alphanumeric:q_e,alphanumericCaseSensitive:K_e,text:G_e,textCaseSensitive:Z_e,datetime:Y_e,basic:W_e},X_e={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Xi("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 Fp.datetime;if(typeof o=="string"&&(r=!0,o.split(vk).length>1))return Fp.alphanumeric}return r?Fp.text:Fp.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 T0(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:Fp[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const i=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(a=>{const l=a?.find(y=>y.id===e.id),d=a?.findIndex(y=>y.id===e.id);let f=[],m,h=o?n:i==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&r?l?m="toggle":m="add":a!=null&&a.length&&d!==a.length-1?m="replace":l?m="toggle":m="replace",m==="toggle"&&(o||i||(m="remove")),m==="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 m==="toggle"?f=a.map(y=>y.id===e.id?{...y,desc:h}:y):m==="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())}},J_e=[y_e,z_e,O_e,$_e,x_e,w_e,L_e,F_e,X_e,N_e,U_e,V_e,B_e,H_e,P_e];function Q_e(e){var t,n;const r=[...J_e,...(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 m=!1;const h={_features:r,options:{...o,...e},initialState:d,_queue:v=>{f.push(v),m||(m=!0,Promise.resolve().then(()=>{for(;f.length;)f.shift()();m=!1}).catch(y=>setTimeout(()=>{throw y})))},reset:()=>{i.setState(i.initialState)},setOptions:v=>{const y=nl(v,i.options);i.options=a(y)},getState:()=>i.options.state,setState:v=>{i.options.onStateChange==null||i.options.onStateChange(v)},_getRowId:(v,y,x)=>{var S;return(S=i.options.getRowId==null?void 0:i.options.getRowId(v,y,x))!=null?S:`${x?[x.id,y].join("."):y}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(v,y)=>{let x=(y?i.getPrePaginationRowModel():i.getRowModel()).rowsById[v];if(!x&&(x=i.getCoreRowModel().rowsById[v],!x))throw new Error;return x},_getDefaultColumnDef:ot(()=>[i.options.defaultColumn],v=>{var y;return v=(y=v)!=null?y:{},{header:x=>{const S=x.header.column.columnDef;return S.accessorKey?S.accessorKey:S.accessorFn?S.id:null},cell:x=>{var S,C;return(S=(C=x.renderValue())==null||C.toString==null?void 0:C.toString())!=null?S:null},...i._features.reduce((x,S)=>Object.assign(x,S.getDefaultColumnDef==null?void 0:S.getDefaultColumnDef()),{}),...v}},at(e,"debugColumns")),_getColumnDefs:()=>i.options.columns,getAllColumns:ot(()=>[i._getColumnDefs()],v=>{const y=function(x,S,C){return C===void 0&&(C=0),x.map(k=>{const E=v_e(i,k,C,S),j=k;return E.columns=j.columns?y(j.columns,E,C+1):[],E})};return y(v)},at(e,"debugColumns")),getAllFlatColumns:ot(()=>[i.getAllColumns()],v=>v.flatMap(y=>y.getFlatColumns()),at(e,"debugColumns")),_getAllFlatColumnsById:ot(()=>[i.getAllFlatColumns()],v=>v.reduce((y,x)=>(y[x.id]=x,y),{}),at(e,"debugColumns")),getAllLeafColumns:ot(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(v,y)=>{let x=v.flatMap(S=>S.getLeafColumns());return y(x)},at(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 N0(){return e=>ot(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(i,o,a){o===void 0&&(o=0);const l=[];for(let f=0;f<i.length;f++){const m=b_e(e,e._getRowId(i[f],f,a),i[f],f,o,void 0,a?.id);if(n.flatRows.push(m),n.rowsById[m.id]=m,l.push(m),e.options.getSubRows){var d;m.originalSubRows=e.options.getSubRows(i[f],f),(d=m.originalSubRows)!=null&&d.length&&(m.subRows=r(m.originalSubRows,o+1,m))}}return l};return n.rows=r(t),n},at(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function e1e(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 t1e(e){return t=>ot(()=>[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:l,rowsById:d}=r;const f=i*o,m=f+i;a=a.slice(f,m);let h;t.options.paginateExpandedRows?h={rows:a,flatRows:l,rowsById:d}:h=e1e({rows:a,flatRows:l,rowsById:d}),h.flatRows=[];const v=y=>{h.flatRows.push(y),y.subRows.length&&y.subRows.forEach(v)};return h.rows.forEach(v),h},at(t.options,"debugTable"))}function n1e(){return e=>ot(()=>[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 l=d=>{const f=d.map(m=>({...m}));return f.sort((m,h)=>{for(let y=0;y<o.length;y+=1){var v;const x=o[y],S=a[x.id],C=S.sortUndefined,k=(v=x?.desc)!=null?v:!1;let E=0;if(C){const j=m.getValue(x.id),R=h.getValue(x.id),N=j===void 0,T=R===void 0;if(N||T){if(C==="first")return N?-1:1;if(C==="last")return N?1:-1;E=N&&T?0:N?C:-C}}if(E===0&&(E=S.sortingFn(m,h,x.id)),E!==0)return k&&(E*=-1),S.invertSorting&&(E*=-1),E}return m.index-h.index}),f.forEach(m=>{var h;i.push(m),(h=m.subRows)!=null&&h.length&&(m.subRows=l(m.subRows))}),f};return{rows:l(n.rows),flatRows:i,rowsById:n.rowsById}},at(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function Hc(e,t){return e?r1e(e)?b.createElement(e,t):e:null}function r1e(e){return i1e(e)||typeof e=="function"||o1e(e)}function i1e(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function o1e(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function A0(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=b.useState(()=>({current:Q_e(t)})),[r,i]=b.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 O0({className:e,containerClassName:t,...n}){return u.jsx("div",{"data-slot":"table-container",className:Ue("relative w-full overflow-x-auto",t),children:u.jsx("table",{"data-slot":"table",className:Ue("w-full caption-bottom text-sm",e),...n})})}function zh({className:e,...t}){return u.jsx("thead",{"data-slot":"table-header",className:Ue("[&_tr]:border-b",e),...t})}function $0({className:e,...t}){return u.jsx("tbody",{"data-slot":"table-body",className:Ue("[&_tr:last-child]:border-0",e),...t})}function Hi({className:e,...t}){return u.jsx("tr",{"data-slot":"table-row",className:Ue("border-b border-grey-700 transition-colors",e),...t})}function OI({className:e,...t}){return u.jsx("th",{"data-slot":"table-head",className:Ue("h-10 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function Iq({header:e,onColumnClick:t,...n}){const r=b.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:Hc(e.column.columnDef.header,e.getContext()),l=b.useCallback(()=>{e.column.resetSize()},[e]);return u.jsx(OI,{...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(xe,{type:"button",variant:"ghost",className:Ue("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(qee,{}):e.column.getIsSorted()==="desc"?u.jsx(Pb,{}):u.jsx(Bee,{className:"text-gray-600"})]}):a,o&&u.jsx(xe,{type:"button",variant:"ghost",className:"cursor-col-resize",onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),onDoubleClick:l,style:{transform:e.column.getIsResizing()?`translateX(${e.getContext().table.getState().columnSizingInfo.deltaOffset}px)`:""},children:u.jsx(Lte,{})})]})})}function fs({className:e,...t}){return u.jsx("td",{"data-slot":"table-cell",className:Ue("align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function If({columns:e,data:t,isFetching:n,onRowClick:r,onColumnClick:i,sortingState:o,children:a}){const l=A0({data:t,columns:e,getCoreRowModel:N0(),getSortedRowModel:n1e(),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(O0,{containerClassName:"rounded-md bg-black-dark",children:[u.jsx(zh,{children:l.getHeaderGroups().map(d=>u.jsx(Hi,{className:"border-none",children:d.headers.map(f=>u.jsx(Iq,{header:f,onColumnClick:i},f.id))},d.id))}),u.jsx($0,{className:"bg-black border border-grey-700",children:l.getRowModel().rows?.length?l.getRowModel().rows.map(d=>u.jsx(Hi,{"data-state":d.getIsSelected()&&"selected",onClick:()=>r?.(d),className:Ue("hover:bg-muted/10 data-[state=selected]:bg-muted",r&&"cursor-pointer"),children:d.getVisibleCells().map(f=>u.jsx(fs,{className:"py-2 px-2 overflow-x-hidden max-w-32 text-ellipsis whitespace-nowrap",children:Hc(f.column.columnDef.cell,f.getContext())},f.id))},d.id)):u.jsx(Hi,{children:u.jsx(fs,{colSpan:e.length,className:"h-24 text-center",children:n?u.jsx("div",{children:u.jsx(no,{className:"p-12"})}):u.jsx("span",{children:"No results."})})})})]})]})}function a1e(e){switch(e){case"paid":return"success";case"void":case"uncollectible":return"destructive";default:return"default"}}function _1(e){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(e)}function Tc(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 s1e=[{header:"Invoice Id",accessorKey:"id",enableSorting:!1},{header:"Status",accessorKey:"status",enableSorting:!1,cell:({cell:e})=>u.jsx(Yo,{variant:a1e(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?Tc(r,t):[t?Tc(r,t):"-",n?Tc(i,n):"-"].join(" to ")}},{header:"Amount Due",accessorKey:"amountDue",enableSorting:!1,cell:({cell:e})=>_1(e.getValue()?e.getValue()/100:0)},{header:"Amount Paid",accessorKey:"amountPaid",enableSorting:!1,cell:({cell:e})=>_1(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} @ ${_1(r.amount/100)}`);return n.join(`
134
- `)}}];function Ul(e){return b.useCallback(async()=>{const t=Se.loading("Refreshing..."),n=Date.now();await e(),Date.now()-n<500&&await qc(500),Se.dismiss(t),Se.success("Refreshed!")},[e])}async function l1e(e){const{data:t}=await Yt.get(`/Invoice/${e}`);return t}function c1e(e,t){return{queryKey:[e,"invoices"],queryFn:()=>l1e(e),retry:!1,enabled:!!e,refetchInterval:void 0}}function u1e(){const{organizationId:e}=rt({strict:!1}),{data:t}=Mt(lu(e)),{data:n,refetch:r,isLoading:i,isFetching:o,isRefetching:a}=Mt(c1e(t?.type!==$m&&t?.id)),l=Ul(r);return t?.type===$m?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(kl,{}),", we would love to talk!"]}):i?u.jsx(no,{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(kl,{overEmail:!0}),", we would love to talk!"]}):u.jsx(If,{data:n,columns:s1e,children:u.jsxs(xe,{variant:"defaultOutline",onClick:l,accessKey:"r",disabled:o||a,children:[u.jsx(xa,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]})})}function d1e(e){const t=nt({getParentRoute:()=>e,path:"billing",component:d_e}),n=nt({getParentRoute:()=>t,path:"/",component:P9}),r=nt({getParentRoute:()=>t,path:"invoices",component:u1e}),i=nt({getParentRoute:()=>t,path:"confirm",component:u_e});return t.addChildren([n,r,i])}async function f1e(e){const{data:t}=await Yt.get(`/OrganizationRole/${e}`);return t}function D0(e){return{queryKey:[e,"roles"],queryFn:()=>f1e(e),retry:!1,refetchInterval:10*1e3}}const p1e=I0(),m1e=[{header:"Role Name",accessorKey:"roleName",enableSorting:!1},p1e.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})];async function h1e(e){const{data:t}=await Yt.post("/Role/",e);return t}function g1e(){return ut({mutationFn:h1e})}const Tq=Dt({name:tt().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."}),update:Qt(),delete:Qt()});Dt({roles:Dt({create:Qt(),delete:Qt(),update:Qt(),view:Qt()}),clusters:Dt({create:Qt(),delete:Qt(),update:Qt(),view:Qt(),resources:ds(Dt({id:tt(),delete:Qt(),update:Qt(),view:Qt(),instances:Dt({create:Qt(),delete:Qt(),update:Qt(),view:Qt()})}))})});function v1e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RP(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 IP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RP(Object(n),!0).forEach(function(r){v1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function y1e(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 b1e(e,t){if(e==null)return{};var n=y1e(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 x1e(e,t){return w1e(e)||S1e(e,t)||_1e(e,t)||C1e()}function w1e(e){if(Array.isArray(e))return e}function S1e(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](),l;!(r=(l=a.next()).done)&&(n.push(l.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 _1e(e,t){if(e){if(typeof e=="string")return TP(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 TP(e,t)}}function TP(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 C1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
135
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function k1e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NP(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 AP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NP(Object(n),!0).forEach(function(r){k1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function E1e(){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 Jp(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,l=new Array(a),d=0;d<a;d++)l[d]=arguments[d];return t.apply(n,[].concat(i,l))}}}function sb(e){return{}.toString.call(e).includes("Object")}function j1e(e){return!Object.keys(e).length}function Dm(e){return typeof e=="function"}function R1e(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function I1e(e,t){return sb(t)||pl("changeType"),Object.keys(t).some(function(n){return!R1e(e,n)})&&pl("changeField"),t}function T1e(e){Dm(e)||pl("selectorType")}function N1e(e){Dm(e)||sb(e)||pl("handlerType"),sb(e)&&Object.values(e).some(function(t){return!Dm(t)})&&pl("handlersType")}function A1e(e){e||pl("initialIsRequired"),sb(e)||pl("initialType"),j1e(e)&&pl("initialContent")}function O1e(e,t){throw new Error(e[t]||e.default)}var $1e={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"},pl=Jp(O1e)($1e),Mv={changes:I1e,selector:T1e,handler:N1e,initial:A1e};function D1e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Mv.initial(e),Mv.handler(t);var n={current:e},r=Jp(z1e)(n,t),i=Jp(M1e)(n),o=Jp(Mv.changes)(e),a=Jp(P1e)(n);function l(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(m){return m};return Mv.selector(f),f(n.current)}function d(f){E1e(r,i,o,a)(f)}return[l,d]}function P1e(e,t){return Dm(t)?t(e.current):t}function M1e(e,t){return e.current=AP(AP({},e.current),t),t}function z1e(e,t,n){return Dm(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 L1e={create:D1e},F1e={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"}};function U1e(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,l=new Array(a),d=0;d<a;d++)l[d]=arguments[d];return t.apply(n,[].concat(i,l))}}}function V1e(e){return{}.toString.call(e).includes("Object")}function B1e(e){return e||OP("configIsRequired"),V1e(e)||OP("configType"),e.urls?(H1e(),{paths:{vs:e.urls.monacoBase}}):e}function H1e(){console.warn(Nq.deprecation)}function q1e(e,t){throw new Error(e[t]||e.default)}var Nq={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!
136
- You are using deprecated way of configuration.
137
-
138
- Instead of using
139
- monaco.config({ urls: { monacoBase: '...' } })
140
- use
141
- monaco.config({ paths: { vs: '...' } })
142
-
143
- For more please check the link https://github.com/suren-atoyan/monaco-loader#config
144
- `},OP=U1e(q1e)(Nq),K1e={config:B1e},G1e=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 Aq(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],Aq(e[n],t[n]))}),IP(IP({},e),t)}var Z1e={type:"cancelation",msg:"operation is manually canceled"};function C1(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(Z1e):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var Y1e=L1e.create({config:F1e,isInitialized:!1,resolve:null,reject:null,monaco:null}),Oq=x1e(Y1e,2),Lh=Oq[0],P0=Oq[1];function W1e(e){var t=K1e.config(e),n=t.monaco,r=b1e(t,["monaco"]);P0(function(i){return{config:Aq(i.config,r),monaco:n}})}function X1e(){var e=Lh(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(P0({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),C1(k1);if(window.monaco&&window.monaco.editor)return $q(window.monaco),e.resolve(window.monaco),C1(k1);G1e(J1e,eCe)(tCe)}return C1(k1)}function J1e(e){return document.body.appendChild(e)}function Q1e(e){var t=document.createElement("script");return e&&(t.src=e),t}function eCe(e){var t=Lh(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=Q1e("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function tCe(){var e=Lh(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){$q(n),e.resolve(n)},function(n){e.reject(n)})}function $q(e){Lh().monaco||P0({monaco:e})}function nCe(){return Lh(function(e){var t=e.monaco;return t})}var k1=new Promise(function(e,t){return P0({resolve:e,reject:t})}),Dq={config:W1e,init:X1e,__getMonacoInstance:nCe},rCe={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},E1=rCe,iCe={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},oCe=iCe;function aCe({children:e}){return X.createElement("div",{style:oCe.container},e)}var sCe=aCe,lCe=sCe;function cCe({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:a}){return X.createElement("section",{style:{...E1.wrapper,width:e,height:t},...a},!n&&X.createElement(lCe,null,r),X.createElement("div",{ref:i,style:{...E1.fullWidth,...!n&&E1.hide},className:o}))}var uCe=cCe,Pq=b.memo(uCe);function dCe(e){b.useEffect(e,[])}var Mq=dCe;function fCe(e,t,n=!0){let r=b.useRef(!0);b.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var zi=fCe;function lm(){}function yd(e,t,n,r){return pCe(e,r)||mCe(e,t,n,r)}function pCe(e,t){return e.editor.getModel(zq(e,t))}function mCe(e,t,n,r){return e.editor.createModel(t,n,r?zq(e,r):void 0)}function zq(e,t){return e.Uri.parse(t)}function hCe({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:a,keepCurrentOriginalModel:l=!1,keepCurrentModifiedModel:d=!1,theme:f="light",loading:m="Loading...",options:h={},height:v="100%",width:y="100%",className:x,wrapperProps:S={},beforeMount:C=lm,onMount:k=lm}){let[E,j]=b.useState(!1),[R,N]=b.useState(!0),T=b.useRef(null),A=b.useRef(null),D=b.useRef(null),F=b.useRef(k),K=b.useRef(C),te=b.useRef(!1);Mq(()=>{let H=Dq.init();return H.then(z=>(A.current=z)&&N(!1)).catch(z=>z?.type!=="cancelation"&&console.error("Monaco initialization: error:",z)),()=>T.current?V():H.cancel()}),zi(()=>{if(T.current&&A.current){let H=T.current.getOriginalEditor(),z=yd(A.current,e||"",r||n||"text",o||"");z!==H.getModel()&&H.setModel(z)}},[o],E),zi(()=>{if(T.current&&A.current){let H=T.current.getModifiedEditor(),z=yd(A.current,t||"",i||n||"text",a||"");z!==H.getModel()&&H.setModel(z)}},[a],E),zi(()=>{let H=T.current.getModifiedEditor();H.getOption(A.current.editor.EditorOption.readOnly)?H.setValue(t||""):t!==H.getValue()&&(H.executeEdits("",[{range:H.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),H.pushUndoStop())},[t],E),zi(()=>{T.current?.getModel()?.original.setValue(e||"")},[e],E),zi(()=>{let{original:H,modified:z}=T.current.getModel();A.current.editor.setModelLanguage(H,r||n||"text"),A.current.editor.setModelLanguage(z,i||n||"text")},[n,r,i],E),zi(()=>{A.current?.editor.setTheme(f)},[f],E),zi(()=>{T.current?.updateOptions(h)},[h],E);let G=b.useCallback(()=>{if(!A.current)return;K.current(A.current);let H=yd(A.current,e||"",r||n||"text",o||""),z=yd(A.current,t||"",i||n||"text",a||"");T.current?.setModel({original:H,modified:z})},[n,t,i,e,r,o,a]),q=b.useCallback(()=>{!te.current&&D.current&&(T.current=A.current.editor.createDiffEditor(D.current,{automaticLayout:!0,...h}),G(),A.current?.editor.setTheme(f),j(!0),te.current=!0)},[h,f,G]);b.useEffect(()=>{E&&F.current(T.current,A.current)},[E]),b.useEffect(()=>{!R&&!E&&q()},[R,E,q]);function V(){let H=T.current?.getModel();l||H?.original?.dispose(),d||H?.modified?.dispose(),T.current?.dispose()}return X.createElement(Pq,{width:y,height:v,isEditorReady:E,loading:m,_ref:D,className:x,wrapperProps:S})}var gCe=hCe;b.memo(gCe);function vCe(e){let t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current}var yCe=vCe,zv=new Map;function bCe({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:o,theme:a="light",line:l,loading:d="Loading...",options:f={},overrideServices:m={},saveViewState:h=!0,keepCurrentModel:v=!1,width:y="100%",height:x="100%",className:S,wrapperProps:C={},beforeMount:k=lm,onMount:E=lm,onChange:j,onValidate:R=lm}){let[N,T]=b.useState(!1),[A,D]=b.useState(!0),F=b.useRef(null),K=b.useRef(null),te=b.useRef(null),G=b.useRef(E),q=b.useRef(k),V=b.useRef(),H=b.useRef(r),z=yCe(o),W=b.useRef(!1),L=b.useRef(!1);Mq(()=>{let P=Dq.init();return P.then(U=>(F.current=U)&&D(!1)).catch(U=>U?.type!=="cancelation"&&console.error("Monaco initialization: error:",U)),()=>K.current?$():P.cancel()}),zi(()=>{let P=yd(F.current,e||r||"",t||i||"",o||n||"");P!==K.current?.getModel()&&(h&&zv.set(z,K.current?.saveViewState()),K.current?.setModel(P),h&&K.current?.restoreViewState(zv.get(o)))},[o],N),zi(()=>{K.current?.updateOptions(f)},[f],N),zi(()=>{!K.current||r===void 0||(K.current.getOption(F.current.editor.EditorOption.readOnly)?K.current.setValue(r):r!==K.current.getValue()&&(L.current=!0,K.current.executeEdits("",[{range:K.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),K.current.pushUndoStop(),L.current=!1))},[r],N),zi(()=>{let P=K.current?.getModel();P&&i&&F.current?.editor.setModelLanguage(P,i)},[i],N),zi(()=>{l!==void 0&&K.current?.revealLine(l)},[l],N),zi(()=>{F.current?.editor.setTheme(a)},[a],N);let ne=b.useCallback(()=>{if(!(!te.current||!F.current)&&!W.current){q.current(F.current);let P=o||n,U=yd(F.current,r||e||"",t||i||"",P||"");K.current=F.current?.editor.create(te.current,{model:U,automaticLayout:!0,...f},m),h&&K.current.restoreViewState(zv.get(P)),F.current.editor.setTheme(a),l!==void 0&&K.current.revealLine(l),T(!0),W.current=!0}},[e,t,n,r,i,o,f,m,h,a,l]);b.useEffect(()=>{N&&G.current(K.current,F.current)},[N]),b.useEffect(()=>{!A&&!N&&ne()},[A,N,ne]),H.current=r,b.useEffect(()=>{N&&j&&(V.current?.dispose(),V.current=K.current?.onDidChangeModelContent(P=>{L.current||j(K.current.getValue(),P)}))},[N,j]),b.useEffect(()=>{if(N){let P=F.current.editor.onDidChangeMarkers(U=>{let O=K.current.getModel()?.uri;if(O&&U.find(J=>J.path===O.path)){let J=F.current.editor.getModelMarkers({resource:O});R?.(J)}});return()=>{P?.dispose()}}return()=>{}},[N,R]);function $(){V.current?.dispose(),v?h&&zv.set(o,K.current.saveViewState()):K.current.getModel()?.dispose(),K.current.dispose()}return X.createElement(Pq,{width:y,height:x,isEditorReady:N,loading:d,_ref:te,className:S,wrapperProps:C})}var xCe=bCe,Fh=b.memo(xCe),M0=Fh;const $P={roles:{create:!0,view:!0,update:!0,delete:!0},clusters:{create:!0,view:!0,update:!0,delete:!0,resources:[]}};function wCe({isModalOpen:e,setIsModalOpen:t}){const n=ir(),{organizationId:r}=rt({strict:!1}),[i,o]=b.useState(!0),[a,l]=b.useState(JSON.stringify($P,null,2)),{mutate:d,isPending:f}=g1e(),m=un({resolver:vn(Tq),defaultValues:{name:"",update:!1,delete:!1}}),h=b.useCallback(y=>{o(y.length===0)},[o]),v=b.useCallback(async y=>{const x=Ph(a);if(!x)return;const S={...y,...x,organizationId:r};y&&i&&d(S,{onSuccess:()=>{Se.success("Organization role added successfully!"),t(!1),n.invalidateQueries({queryKey:[r,"roles"],refetchType:"active"}),m.reset()},onError:C=>{Se.error(`Failed to add organization role: ${C.message}`)}})},[i,a,d,m,n,t,r]);return u.jsx(Un,{onOpenChange:t,open:e,children:u.jsxs(Vn,{children:[u.jsx(Pn,{children:"Add New Organization Role"}),u.jsx(Ir,{children:"Set the new organization role permissions."}),u.jsx(dn,{...m,children:u.jsxs("form",{className:"grid grid-cols-2 gap-4 my-4",onSubmit:m.handleSubmit(v),children:[u.jsx(De,{control:m.control,name:"name",render:({field:y})=>u.jsxs(Te,{className:"col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Role Name"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",className:"",...y})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:m.control,name:"update",render:({field:y})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Can Update Organization"}),u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-6 ml-2",checked:y.value,onChange:x=>y.onChange(x.target.checked)})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:m.control,name:"delete",render:({field:y})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Can Delete Organization"}),u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-6 ml-2",checked:y.value,onChange:x=>y.onChange(x.target.checked)})}),u.jsx(Ae,{})]})}),u.jsx("div",{className:"col-span-2",children:u.jsx(Fh,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate:h,onChange:y=>{y&&l(y)},defaultValue:JSON.stringify($P,null,2)})}),u.jsx(Yn,{className:"col-span-2",children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx(xe,{variant:"destructiveOutline",className:"rounded-full",type:"button",onClick:()=>t(!1),disabled:f,children:"Cancel"}),u.jsx(xe,{variant:"submit",className:"rounded-full",disabled:f||!i||!m.formState.isValid,children:"Save Changes"})]})})]})})]})})}async function SCe({roleId:e}){const{data:t}=await Yt.delete(`/Role/${e}`,{id:e,deleted:!0});return t}function _Ce(){return ut({mutationFn:({roleId:e})=>SCe({roleId:e})})}async function CCe({roleId:e,updatedRoleInfo:t}){const{data:n}=await Yt.put(`/Role/${e}`,t);return n}function kCe(){return ut({mutationFn:({roleId:e,updatedRoleInfo:t})=>CCe({roleId:e,updatedRoleInfo:t})})}function ECe({organizationId:e,roleId:t}){return{queryKey:[e,"roles",t],queryFn:()=>jCe(t),refetchInterval:10*1e3}}async function jCe(e){const{data:t}=await Yt.get(`/Role/${e}`);return t}function RCe({onRoleDeleteClick:e,setIsConfirmingRoleDeletion:t,isRoleDeletionPending:n}){return u.jsxs(u.Fragment,{children:[u.jsx(Pn,{children:"Confirm Role Deletion"}),u.jsx(Ir,{children:"Are you sure you want to delete this role? This action cannot be undone."}),u.jsxs(Yn,{children:[u.jsx(xe,{type:"button",variant:"defaultOutline",className:"rounded-full",onClick:()=>t(!1),children:"Cancel"}),u.jsx(xe,{variant:"destructiveOutline",className:"rounded-full",onClick:e,disabled:n,children:n?"Deleting...":"Delete Role"})]})]})}function ICe({data:e,isModalOpen:t,closeModal:n}){const r=ir(),{data:i}=Ji(ECe({roleId:e.id,organizationId:e.organizationId})),o=Rl(),a=o.user&&o.user?.roles?.[e.organizationId]?.role===e.roleName,{update:l,remove:d}=vf(e.organizationId),{mutate:f,isPending:m}=kCe(),{mutate:h,isPending:v}=_Ce(),[y,x]=b.useState(!1),S=un({resolver:vn(Tq),defaultValues:{name:e.roleName,update:i.organization.update||!1,delete:i.organization.delete||!1}}),C=b.useCallback(()=>{h({roleId:e.id},{onSuccess:()=>{Se.success("Role deleted successfully!"),n(!0),S.reset()},onError:D=>{Se.error("Error",{description:`Failed to delete role: ${D instanceof Error?D.message:String(D)}.`,action:{label:"Dismiss",onClick:()=>Se.dismiss()}})}})},[e.id,h,S,n]),[k,E]=b.useState(!0),[j,R]=b.useState(JSON.stringify({roles:{...i.organization.roles},clusters:{...i.organization.clusters}},null,2)),N=b.useCallback(D=>{E(D.length===0)},[E]),T=b.useCallback(async D=>{if(!l)return;const F=Ph(j);if(!F)return;const K={...D,...F,organizationId:e.organizationId};j&&k&&f({roleId:e.id,updatedRoleInfo:K},{onSuccess:async()=>{Se.success("Role updated successfully!"),await r.invalidateQueries({queryKey:[e.organizationId,"roles",e.id]}),n(!1),S.reset()},onError:te=>{Se.error("Error",{description:`Failed to update role: ${te instanceof Error?te.message:String(te)}.`,action:{label:"Dismiss",onClick:()=>Se.dismiss()}})}})},[n,e.id,e.organizationId,S,k,r,i,l,j,f]),A=b.useCallback(()=>n(!1),[n]);return u.jsx(Un,{onOpenChange:A,open:t,children:u.jsx(Vn,{children:y?u.jsx(RCe,{onRoleDeleteClick:C,setIsConfirmingRoleDeletion:x,isRoleDeletionPending:v}):u.jsxs(u.Fragment,{children:[u.jsxs(Pn,{children:[a||!l?"View":"Edit",' Organization Role "',e.roleName,'"']}),u.jsx(dn,{...S,children:u.jsxs("form",{className:"grid grid-cols-2 gap-4 my-4",onSubmit:S.handleSubmit(T),children:[u.jsx(De,{control:S.control,name:"name",render:({field:D})=>u.jsxs(Te,{className:"col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Role Name"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",className:"",...D,disabled:!0,readOnly:!0})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:S.control,name:"update",render:({field:D})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Can Update Organization"}),u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-6 ml-2",disabled:a||!l,readOnly:a||!l,checked:D.value,onChange:F=>D.onChange(F.target.checked)})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:S.control,name:"delete",render:({field:D})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Can Delete Organization"}),u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-6 ml-2",disabled:a||!l,readOnly:a||!l,checked:D.value,onChange:F=>D.onChange(F.target.checked)})}),u.jsx(Ae,{})]})}),u.jsx("div",{className:"col-span-2",children:u.jsx(Fh,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate:N,onChange:D=>{D&&R(D)},options:a||!l?{readOnly:!0}:void 0,defaultValue:j})}),!a&&(d||l)&&u.jsx(Yn,{className:"col-span-2",children:u.jsxs("div",{className:"flex justify-between w-full",children:[d&&u.jsx(xe,{type:"button",variant:"destructiveOutline",className:"rounded-full",onClick:()=>x(!0),disabled:m,children:"Delete Role"}),l&&u.jsx(xe,{variant:"submit",className:"rounded-full",disabled:!k||m||!S.formState.isValid||!S.formState.isDirty,children:"Save Changes"})]})})]})})]})})})}function Lq(){const e=jn(),t=ir(),{organizationId:n,orgRoleId:r}=rt({strict:!1}),{create:i}=vf(n),{data:o,refetch:a,isFetching:l,isRefetching:d}=Ji(D0(n)),f=b.useMemo(()=>o&&o?.find(E=>E.id===r),[o,r]),m=!!r&&!!f,[h,v]=b.useState(!1),y=b.useCallback(async(E,j)=>{const R=[r?"..":"",E].filter(Boolean);await e({to:R.join("/")}),j&&await t.invalidateQueries({queryKey:[n,"roles"],refetchType:"active"})},[r,e,t]),x=b.useCallback(()=>{v(!0)},[v]),S=b.useCallback(E=>y(E.original.id,!1),[y]),C=b.useCallback(E=>y(void 0,E),[y]),k=Ul(a);return u.jsxs(u.Fragment,{children:[u.jsx(vs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-(--spacing(32)))]",children:u.jsxs(b.Suspense,{fallback:u.jsx(no,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(If,{data:o,columns:m1e,onRowClick:S,children:[u.jsxs(xe,{variant:"defaultOutline",onClick:k,accessKey:"r",disabled:l||d,children:[u.jsx(xa,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),i&&u.jsxs(xe,{variant:"positiveOutline",onClick:x,accessKey:"a",disabled:h,children:[u.jsx(Qr,{}),u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),i&&u.jsx(wCe,{isModalOpen:h,setIsModalOpen:v}),m&&u.jsx(ICe,{data:f,isModalOpen:m,closeModal:C})]})})]})}const TCe=I0(),NCe=[{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},TCe.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}],ACe=Cl.object({email:kf.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:Cl.string().nonempty({error:"Please select a role."})});async function OCe(e){const{data:t}=await Yt.post("/OrganizationRole/",e);return t}function Fq(){return ut({mutationFn:e=>OCe(e)})}Cl.object({email:kf.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:Cl.string().nonempty({error:"Please select a role."})});async function $Ce(e){const{data:t}=await Yt.post("/UserInvite/",e);return t}function DCe(){return ut({mutationFn:e=>$Ce(e)})}function PCe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const{organizationId:r}=rt({strict:!1}),{data:i}=Ji(D0(r)),[o,a]=b.useState(!1),l=un({resolver:vn(ACe),defaultValues:{email:"",roleId:""}}),{mutate:d,isPending:f}=Fq(),{mutate:m,isPending:h}=DCe(),v=b.useCallback(async y=>{y&&(o?m:d)(y,{onSuccess:()=>{const x=y.roleId;l.reset(),l.setValue("roleId",x),t(),Se.success("User invited successfully!"),n(!1),a(!1)},onError:x=>{x?.status===404&&a(!0)}})},[d,l,m,t,n,o]);return u.jsx(Un,{onOpenChange:()=>{n(!1),a(!1),l.reset()},open:e,children:u.jsx(Vn,{"aria-describedby":void 0,children:u.jsx(dn,{...l,children:u.jsxs("form",{onSubmit:l.handleSubmit(v),className:"grid gap-4 my-4",children:[u.jsx(wr,{children:u.jsx(Pn,{children:o?"Invite User":"Add User"})}),u.jsx(De,{control:l.control,name:"email",render:({field:y})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Email"}),u.jsx(Oe,{children:u.jsx(ze,{type:"email",enterKeyHint:"next",autoComplete:"email",...y})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:l.control,name:"roleId",render:({field:y})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Roles"}),u.jsx(b.Suspense,{fallback:u.jsx(Mr,{}),children:u.jsx(Oe,{children:u.jsxs(Gi,{...y,onValueChange:x=>y.onChange(x),children:[u.jsx(Yi,{className:"w-full",children:u.jsx(Zi,{placeholder:"Choose Role"})}),u.jsx(Wi,{children:u.jsxs(Wo,{children:[u.jsx(RI,{children:"Role"}),i?.map(x=>u.jsx($t,{value:x.id,children:x.roleName},x.id))]})})]})})}),u.jsx(Ae,{})]})}),o&&u.jsxs(Ir,{className:"p-3 my-5 text-white rounded-md bg-amber-600 flex",children:[u.jsx(ene,{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(Yn,{children:u.jsx("div",{className:"flex justify-between w-full",children:u.jsxs(xe,{type:"submit",variant:"submit",className:"rounded-full",disabled:f||h,children:[u.jsx(To,{})," ",o?"Invite User":"Add User"]})})})]})})})})}async function MCe({roleId:e,userId:t}){const{data:n}=await Yt.delete(`/OrganizationRole/role/${e}/user/${t}`);return n}function zCe(){return ut({mutationFn:({roleId:e,userId:t})=>MCe({roleId:e,userId:t})})}function Uq(e){const[t,n]=b.useState(e||!1),r=b.useCallback(i=>{n(i.target.checked)},[]);return[t,r]}function LCe({data:e,readOnly:t,canRemove:n,orgRole:r,selectedRoles:i,setChangesMade:o}){const{mutate:a,isPending:l}=Fq(),{mutate:d,isPending:f}=zCe(),m=!!i[r.roleName],[h,v]=b.useState(m),[y,x]=Uq(m);return b.useEffect(()=>{y!==h&&(y?a({email:e.email,roleId:r.id},{onSuccess:()=>{v(y),o(!0),Se.success("Role added successfully")}}):d({userId:e.id,roleId:r.id},{onSuccess:()=>{v(y),o(!0),Se.success("Role removed successfully")}}))},[a,e.email,e.id,y,r.id,d,o,h]),u.jsxs(oh,{className:"flex",children:[u.jsx(ze,{type:"checkbox",className:"w-6",disabled:t||l||f||!n&&y,checked:y,onChange:x}),u.jsx("span",{className:"pl-4 pr-8 flex-1 py-2.5",children:r.roleName})]},r.id)}function FCe({closeModal:e,data:t,isModalOpen:n,onUserUpdated:r}){const{organizationId:i}=rt({strict:!1}),o=Rl(),{update:a,remove:l}=vf(i),d=o.user?.email===t.email,{data:f}=Ji(D0(i)),m=b.useMemo(()=>t.roles?Mh(t.roles,"roleName"):{},[t]),[h,v]=b.useState(!1);return u.jsx(Un,{onOpenChange:h?r:e,open:n,children:u.jsxs(Vn,{className:"sm:max-w-[750px]",children:[u.jsx(wr,{children:u.jsxs(Pn,{children:[a?"Edit ":"View "," ",t.email," ",d?"(yourself)":""]})}),a&&u.jsxs(Ir,{children:["To remove ",d?"your self":"this user"," from the organization, uncheck all of the boxes below."]}),f.map(y=>u.jsx(LCe,{readOnly:!a,canRemove:l,data:t,orgRole:y,selectedRoles:m,setChangesMade:v},y.id))]})})}function UCe(e,t){return e.email>t.email?1:-1}function Vq(){const e=jn(),{organizationId:t,orgUserId:n}=rt({strict:!1}),{update:r}=vf(t),{data:i,refetch:o,isFetching:a,isRefetching:l}=Ji(D0(t)),d=b.useMemo(()=>{const T={};for(const A of i)if(A.users)for(const D of A.users)T[D.id]||(T[D.id]={...D,roles:[]}),T[D.id].roles.push(A);return Object.values(T).sort(UCe)},[i]),f=b.useMemo(()=>d?.find(T=>T.id===n),[d,n]),m=b.useCallback(T=>{const A=[n?"..":"",T].filter(Boolean);e({to:A.join("/")})},[n,e]),h=!!n&&!!f,[v,y]=b.useState(!1),[x]=b.useState({attribute:"email",descending:!1}),S=b.useMemo(()=>[{desc:x.descending,id:x.attribute}],[x]),C=b.useCallback(()=>{y(!0)},[y]),k=b.useCallback(()=>{o(),y(!1)},[o,y]),E=b.useCallback(T=>{m(T.original.id)},[m]),j=b.useCallback(()=>{m(void 0)},[m]),R=b.useCallback(()=>{o(),m(void 0)},[m,o]),N=Ul(o);return u.jsxs(u.Fragment,{children:[u.jsx(vs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs(b.Suspense,{fallback:u.jsx(no,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(If,{data:d,isFetching:a||l,columns:NCe,onRowClick:E,sortingState:S,children:[u.jsxs(xe,{variant:"defaultOutline",onClick:N,accessKey:"r",disabled:a||l,children:[u.jsx(xa,{})," ",u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),r&&u.jsxs(xe,{variant:"positiveOutline",onClick:C,accessKey:"a",disabled:v,children:[u.jsx(Qr,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),r&&u.jsx(PCe,{isModalOpen:v,onChangesSaved:k,setIsModalOpen:y}),h&&u.jsx(FCe,{closeModal:j,data:f,isModalOpen:h,onUserUpdated:R})]})})]})}function VCe({organizationRole:e,onDeleteOrgModal:t}){const{organizationId:n,organizationName:r,roleName:i}=e,{remove:o,update:a}=ox(n),l=a,{view:d}=vf(n),f=b.useCallback(()=>{t(e)},[t,e]);return u.jsxs(Dc,{className:"relative h-full justify-between",children:[u.jsxs(Il,{children:[u.jsxs(Zc,{className:"flex items-center justify-between",children:[u.jsx("span",{className:"truncate",children:n}),o&&u.jsxs(Oh,{children:[u.jsx($h,{className:"p-4 -m-4 -mr-6 hover:text-white",children:u.jsx(lE,{"aria-label":"Options"})}),u.jsxs(Dh,{children:[u.jsx(Qy,{className:"text-gray-600 text-xs",children:"Options"}),u.jsx(eb,{}),u.jsx(Ze,{to:`${n}`,children:u.jsx(jr,{children:"Clusters"})}),d&&u.jsx(Ze,{to:`${n}/roles`,children:u.jsx(jr,{children:"Roles"})}),d&&u.jsx(Ze,{to:`${n}/users`,children:u.jsx(jr,{children:"Users"})}),l&&u.jsx(Ze,{to:`${n}/billing`,children:u.jsx(jr,{children:"Billing"})}),u.jsx(eb,{}),o&&u.jsx(jr,{className:"focus:bg-red/70 focus:text-white",onClick:f,children:"Delete"})]})]})]}),u.jsx(Tl,{children:u.jsx("h2",{children:r})})]}),u.jsxs(hs,{className:"flex justify-between",children:[u.jsx(Yo,{children:wo(i)}),u.jsx(Ze,{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(xi,{className:"inline-block"})]})})]})]})}async function BCe(e){const{data:t}=await Yt.delete(`/Organization/${e}`);return t}function HCe(){return ut({mutationFn:e=>BCe(e)})}async function qCe(e){const{data:t}=await Yt.post("/Organization/",{...e});return t}function KCe(){return ut({mutationFn:e=>qCe(e)})}const Lv=Dt({name:tt().max(255,{error:"Name cannot be longer than 255 characters."}),subdomain:tt().max(62,{error:"The subdomain cannot be longer than 62 characters."}).regex(/^[a-z0-9-]*$/,{error:"Please only use lowercase letters, digits and dashes (-) in the subdomain."})});function GCe(){const{user:e}=Rl(),t=jn(),n=un({resolver:vn(Lv),defaultValues:{name:"",subdomain:""}}),{setFocus:r,watch:i}=n;b.useEffect(()=>{r("name")},[r]);const o=`${e?.firstname} ${e?.lastname} Org`,a=i("name")||o,l=i("subdomain"),d=b.useMemo(()=>{const y=R9(k0(a),Lv.shape.subdomain.maxLength);return{suggestedSubdomain:y,fullHostName:`future-cluster-names.${l||y}.harperfabric.com`}},[a,l]),{mutate:f,isPending:m}=KCe(),h=ir(),v=b.useCallback(async y=>{f({name:y.name||o,subdomain:y.subdomain||d.suggestedSubdomain},{onSuccess:x=>{h.invalidateQueries({queryKey:Ib,refetchType:"active"}),kt.reloadUser($n),t({to:`/${x.id}`})}})},[d.suggestedSubdomain,h,f,o,t]);return u.jsx(u.Fragment,{children:u.jsx(dn,{...n,children:u.jsxs("form",{onSubmit:n.handleSubmit(v),className:"grid gap-6 text-white max-w-xl",children:[u.jsx(De,{control:n.control,name:"name",render:({field:y})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Name"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",maxLength:Lv.shape.name.maxLength,autoCapitalize:"words",placeholder:o,...y})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:n.control,name:"subdomain",render:({field:y})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Subdomain"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",maxLength:Lv.shape.subdomain.maxLength,autoCapitalize:"none",placeholder:d.suggestedSubdomain,...y})}),u.jsx(Ae,{})]})}),u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Full Host Name"}),u.jsx(Oe,{children:u.jsx("span",{children:d.fullHostName})}),u.jsx(Ae,{})]}),u.jsx(Yn,{children:u.jsxs(xe,{type:"submit",variant:"submit",className:"rounded-full",disabled:m,children:["Create New Organization ",u.jsx(xi,{})]})})]})})})}function Bq(){return u.jsxs(u.Fragment,{children:[u.jsx(vs,{}),u.jsx("section",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx(GCe,{})})]})}function ZCe(){const e=ir(),{data:t}=Ji(VX()),{mutate:n,isPending:r}=HCe(),[i,o]=b.useState(!1),[a,l]=b.useState(null),[d,f]=b.useState(""),m=b.useCallback(()=>f(""),[]),h=b.useMemo(()=>{const C=t?.roles||{},k=Object.values(C);return Object.keys(C).map((j,R)=>({organizationId:j,organizationName:k[R].organizationName,roleName:k[R].role})).filter(vq(["organizationId","organizationName"],d)).sort((j,R)=>(j.organizationName||"")>(R.organizationName||"")?1:-1)||[]},[d,t?.roles]),v=b.useCallback(C=>{f(C.currentTarget.value?.toLowerCase()||"")},[]),y=b.useCallback(C=>{C?.organizationId&&n(C.organizationId,{onSuccess:()=>{Se.success("Success",{description:"Organization successfully deleted.",duration:5e3,action:{label:"Dismiss",onClick:()=>Se.dismiss()}}),e.invalidateQueries({queryKey:[]}),o(!1)},onError:()=>o(!1)})},[n,e,o]),x=b.useCallback(C=>{l(C),o(!0)},[]),{createCluster:S}=Tr({strict:!1});return h.length===1&&!d.length&&S?u.jsx(jc,{to:`/${h[0].organizationId}/new-cluster`,replace:!0}):!h.length&&!d.length?u.jsx(Bq,{}):u.jsxs(u.Fragment,{children:[u.jsx(vs,{children:u.jsxs("div",{className:"flex w-full justify-end gap-2",children:[u.jsx(ze,{placeholder:"Filter by name",className:"inline-block w-full text-xs",value:d,onChange:v}),u.jsx(Ze,{to:"/new-org",children:u.jsxs(xe,{variant:"positive",accessKey:"n",children:[u.jsx(Qr,{}),u.jsxs("span",{className:"hidden sm:inline-block",children:[u.jsx("u",{children:"N"}),"ew ",u.jsx("span",{className:"hidden md:inline-block",children:"Organization"})]})]})})]})}),u.jsx("section",{className:"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(VCe,{organizationRole:C,onDeleteOrgModal:x})},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(xe,{variant:"outline",onClick:m,children:"Clear Filters"})]})]})}),a&&u.jsx(w0,{typeOfThingBeingDeleted:"organization",nameOfThingBeingDeleted:a.organizationName,isModalOpen:i,setIsModalOpen:()=>o(!1),deletionConfirmed:()=>y(a),deletionPending:r})]})}function YCe(){const{isLoading:e}=Gc(),{createCluster:t}=Tr({strict:!1}),[,n]=jf(su.SavedClusterState,null);return b.useEffect(()=>{t&&n(t)},[t,n]),e?u.jsx(no,{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(CU,{})}),u.jsx("main",{children:u.jsx(jl,{})})]})}const WCe=["/","/forgot-password","/reset-password","/sign-in","/sign-up","/verify-email"];function Hq(){const e=yq();return!WCe.includes(e)&&{redirect:e}}const z0=nt({getParentRoute:()=>rx,id:"_dashboardLayout",component:YCe,beforeLoad:({context:e})=>{const t=e.authentication[$n];if(t&&!t.isLoading&&!t.user)throw Kc({to:"/sign-in",search:Hq()})}}),$I=nt({getParentRoute:()=>z0,id:"_orgsLayout"});nt({getParentRoute:()=>$I,path:"/",component:ZCe});nt({getParentRoute:()=>$I,path:"/new-org",component:Bq});const cu=nt({getParentRoute:()=>$I,path:"$organizationId",beforeLoad:async e=>({organization:await e.context.queryClient.ensureQueryData(lu(e.params.organizationId))})}),XCe=nt({getParentRoute:()=>cu,path:"/roles",component:Lq}),JCe=nt({getParentRoute:()=>cu,path:"/roles/$orgRoleId",component:Lq}),QCe=nt({getParentRoute:()=>cu,path:"/users",component:Vq}),eke=nt({getParentRoute:()=>cu,path:"/users/$orgUserId",component:Vq});d1e(cu);const qq=nt({getParentRoute:()=>cu,id:"_clusterLayout"});nt({getParentRoute:()=>qq,path:"/",component:l_e});nt({getParentRoute:()=>cu,path:"/new-cluster",component:II});nt({getParentRoute:()=>ps,path:"/edit",component:II});function tke(){return u.jsx(jl,{})}const ps=nt({getParentRoute:()=>qq,path:"$clusterId",component:tke,beforeLoad:async({context:e,params:t})=>({cluster:await e.queryClient.ensureQueryData(Dl(t.clusterId))})}),bd=Dt({username:sI,role:tt().nonempty({error:"Please select a role."}),password:Rh.min(8,{error:"Password must be at least 8 characters long."}),confirmPassword:tt()}).refine(e=>e.password===e.confirmPassword,{error:"Passwords do not match.",path:["confirmPassword"]});async function nke(e){await Yt.patch(`/ResetPasswordUpdater/${e}`)}async function Kq(e){const{instanceClient:t,...n}=e,{data:r}=await t.post("/",{operation:"add_user",...n});return r}function rke(){return ut({mutationFn:Kq})}async function Gq({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 ike(){return ut({mutationFn:Gq})}async function Zq({username:e,instanceClient:t}){const{data:n}=await t.post("/",{operation:"drop_user",username:e});return n}function oke(){return ut({mutationFn:Zq})}async function ake({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 l=await HC({username:t,password:i,instanceClient:a,entityId:e});return l.instanceClient&&(a=l.instanceClient),n===X1?await Gq({username:n,password:r,instanceClient:a}):(await Kq({username:n,password:r,role:"super_user",active:!0,instanceClient:a}),await HC({username:n,password:r,instanceClient:a,entityId:e}),await Zq({username:X1,instanceClient:a})),await nke(e),l}catch(l){throw await Hm({entityId:e,instanceClient:a}),l}}function ske(){return ut({mutationFn:ake})}function lke(){const{user:e}=Rl(),{clusterId:t}=rt({strict:!1}),{data:n}=Mt(Dl(t,!0)),r=jn(),i=b.useMemo(()=>Xk(n),[n]),o=eh(i),{redirect:a}=Tr({strict:!1}),l=_n(),d=un({resolver:vn(bd),defaultValues:{confirmPassword:"",password:"",role:"super_user",username:e?.email??""}}),{setFocus:f,control:m,handleSubmit:h}=d;b.useEffect(()=>{f("password")},[f]);const v=n?.instances?.find(C=>C.tempPassword)?.tempPassword,{mutate:y,isPending:x}=ske(),S=b.useCallback(async C=>{if(!i){Se.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:X1,desiredUsername:C.username},{onSuccess:async({message:k,user:E})=>{Se.success(k),kt.setUserForEntity(n,E),l.invalidate(),await r({to:a?.startsWith("/")?a:Fk})}})},[n,t,o,r,i,a,l,y,v]);return n&&!n.resetPassword?u.jsx(jc,{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(gx,{})}),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(dn,{...d,children:u.jsxs("form",{onSubmit:h(S),className:"my-4",children:[u.jsx(De,{control:m,name:"username",render:({field:C})=>u.jsxs(Te,{className:"my-4",children:[u.jsx(Ne,{children:"Username"}),u.jsx(Oe,{children:u.jsx(ze,{autoComplete:"username",type:"text",...C})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:m,name:"password",render:({field:C})=>u.jsxs(Te,{className:"my-4",children:[u.jsx(Ne,{children:"Password"}),u.jsx(Oe,{children:u.jsx(ze,{type:"password",...C})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:m,name:"confirmPassword",render:({field:C})=>u.jsxs(Te,{className:"my-4",children:[u.jsx(Ne,{children:"Confirm Password"}),u.jsx(Oe,{children:u.jsx(ze,{type:"password",...C})}),u.jsx(Ae,{})]})}),u.jsx(xe,{disabled:x,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(zee,{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 cke({columns:e,data:t}){const n=A0({data:t,columns:e,getCoreRowModel:N0()});return u.jsx("div",{className:"bg-black-dark rounded-md",children:u.jsxs(O0,{children:[u.jsx(zh,{children:n.getHeaderGroups().map(r=>u.jsx(Hi,{className:"border-none",children:r.headers.map(i=>u.jsx(OI,{className:"p-4",style:{width:`${i.getSize()}%`},children:i.isPlaceholder?null:Hc(i.column.columnDef.header,i.getContext())},i.id))},r.id))}),u.jsx($0,{className:"bg-black",children:n.getRowModel().rows?.length?n.getRowModel().rows.map(r=>u.jsx(Hi,{"data-state":r.getIsSelected()&&"selected",className:"hover:bg-muted/10 data-[state=selected]:bg-muted",children:r.getVisibleCells().map(i=>u.jsx(fs,{className:"p-4",style:{width:`${i.column.getSize()}%`},children:Hc(i.column.columnDef.cell,i.getContext())},i.id))},r.id)):u.jsx(Hi,{children:u.jsx(fs,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})})}function uke(){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 dke({isSelfManaged:e,instance:t}){const{user:n,isLoading:r}=ms(t.id),i=b.useMemo(()=>Jk(t),[t]),o=eh(i),{update:a}=Lfe(),l=kt.checkForFabricConnect(t.id),d=b.useCallback(async()=>{await Hm({instanceClient:o,entityId:t.id}),kt.setUserForEntity(t,null)},[t,o]);return r||!["CLONE_READY","RUNNING","UPDATED"].includes(t.status)?u.jsx(U4,{className:"animate-spin",color:"gray"}):!n||l?u.jsxs("span",{className:"flex gap-4",children:[a&&!e&&u.jsx(Ze,{to:`../instance/${t.id}${ba}`,className:"text-sm","aria-label":`Connect to ${t.name} instance`,title:`Connect to ${t.name} instance`,children:u.jsx(xe,{variant:"positiveOutline",children:"Fabric Connect"})}),u.jsx(Ze,{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(xe,{variant:a?"defaultOutline":"positiveOutline",children:"Direct Sign In"})})]}):u.jsxs("span",{className:"flex gap-4",children:[u.jsx(Ze,{to:`../instance/${t.id}${ba}`,className:"text-sm","aria-label":`Go to ${t.name} instance`,title:`Go to ${t.name} instance`,children:u.jsx(xe,{variant:"positiveOutline",children:"Direct Connect"})}),u.jsx(xe,{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 fke(){const{clusterId:e}=rt({strict:!1}),{data:t,isLoading:n}=Mt(Dl(e,!0)),r=CI(t),i=b.useMemo(()=>[{id:"instanceActions",size:1,minSize:1,cell:a=>u.jsx("div",{className:"flex justify-end",children:u.jsx(dke,{isSelfManaged:r,instance:a.row.original})})},r&&{accessorKey:"instanceFqdn",size:90,header:"URL",cell:a=>hq({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 l=a.getValue();return u.jsx(Yo,{variant:u8(l),children:wo(l)})}},!r&&{accessorKey:"version",size:1,minSize:1,header:"Version"},!r&&{accessorKey:"storageGb",size:1,minSize:1,header:"Storage",cell:a=>{const l=a.getValue();return Fo(l,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 l=a.getValue();return Fo(l,Math.pow(1024,2))}}].filter(Jo),[r]),o=b.useMemo(()=>t?.instances?t.instances.filter(a=>a.status&&!fj.includes(a.status)).sort(E9):[],[t]);return u.jsxs(u.Fragment,{children:[u.jsx(vs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx(Dc,{className:"p-0 mt-4 min-h-96",children:u.jsx(hs,{className:"p-0 min-h-96",children:n?u.jsx(Mr,{}):o.length?u.jsx(cke,{data:o,columns:i}):u.jsx(uke,{})})})})]})}function Sc({children:e,className:t}){return u.jsxs(u.Fragment,{children:[u.jsx(vs,{}),u.jsx("div",{className:yr("mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))] flex justify-center",t),children:e})]})}function pke(){const{clusterId:e}=rt({strict:!1}),{data:t,isLoading:n}=Mt(Dl(e,2e3)),r=t?.status,i=b.useMemo(()=>r&&Sx.includes(r),[r]);return n||!t?u.jsx(Sc,{className:"flex justify-center",children:u.jsx(Mr,{})}):i?u.jsx(Sc,{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(Am,{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(kI,{cluster:t})})]})}):u.jsx(Sc,{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(Am,{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",rel:"noreferrer",children:"Discord"}),"! Get real-time help from our engineers, see feature drops early, and connect with others building on Fabric."]})]})]})})}function mke(){const e=_n(),{clusterId:t}=rt({strict:!1}),{data:n,isLoading:r}=Mt(Dl(t,2e3)),i=n?.status,o=b.useMemo(()=>i&&Sx.includes(i),[i]),a=Ih(i),[,l]=jf(su.SavedClusterState,null),d=b.useCallback(()=>{l(n),e.navigate({to:`/${n.organizationId}/new-cluster`})},[n,e,l]);return r||!n?u.jsx(Sc,{className:"flex justify-center",children:u.jsx(Mr,{})}):a?u.jsx(Sc,{className:"flex justify-center",children:u.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4 items-center",children:[u.jsx(ute,{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(kl,{})," if you want more help."]}),u.jsx(xe,{type:"button",variant:"positiveOutline",onClick:d,children:"Try Again"})]})}):o?u.jsx(Sc,{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(Am,{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(kI,{cluster:n})})]})}):u.jsx(Sc,{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(Am,{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",rel:"noreferrer",children:"Discord"}),"! Get real-time help from our engineers, see feature drops early, and connect with others building on Fabric."]})]})]})})}nt({getParentRoute:()=>ps,path:"instances",component:fke});nt({getParentRoute:()=>ps,path:"starting-up",component:mke});nt({getParentRoute:()=>ps,path:"scaling",component:pke});nt({getParentRoute:()=>ps,path:"sign-in",component:lI,beforeLoad:({context:e,location:t,params:n})=>{const r=kt.checkForFabricConnect(n.clusterId);if(e.authentication[n.clusterId]?.user&&!r){const i=t?.search;throw Kc({to:i?.redirect?.startsWith("/")?i.redirect:Fk})}}});nt({getParentRoute:()=>ps,path:"instance/$instanceId/sign-in",component:lI,beforeLoad:({context:e,location:t,params:n})=>{if(!(kt.checkForFabricConnect(n.clusterId)||kt.checkForFabricConnect(n.instanceId))&&e.authentication[n.instanceId]?.user){const i=t?.search;throw Kc({to:i?.redirect?.startsWith("/")?i.redirect:Fk})}}});nt({getParentRoute:()=>ps,path:"finish-setup",component:lke});function hke(e){return nt({getParentRoute:()=>e,path:"apis"}).lazy(()=>Jm(()=>import("./index.lazy-DG7DUk1C.js"),__vite__mapDeps([0,1,2])).then(t=>t.route))}function DP(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 Qp(e,t){const[n,r]=b.useState(t),[i,o]=b.useState(e);return b.useEffect(()=>{DP(n,t)||(r(t),o(e))},[n,t,e]),DP(n,t)?[i,o]:[e,o]}const fd={};function lb(e,t,n){const r=b.useCallback((i,o)=>t(i,o),[n]);b.useEffect(()=>(fd[e]||(fd[e]=[]),fd[e].push(r),function(){const o=fd[e].indexOf(r);o>=0&&fd[e].splice(o,1)}),[e,t,r])}function Uh(e,t,n){const r=fd[e];if(r)for(const i of r)i(t,n)}function Yq(e,t,n){return r=>Uh(e,t,r)}function j1(e,t,n){return b.useCallback(r=>Uh(e,t,r),[e,t,n])}function PP(e,t){return Ph(sessionStorage.getItem(String(e)))??t}function gke(e,t){t==null?sessionStorage.removeItem(String(e)):sessionStorage.setItem(String(e),JSON.stringify(t))}function jd(e,t){const n=Qp(PP(e,t),[e]),[r,i]=n;return b.useEffect(()=>{gke(e,r),Uh(`Session:${e}`,r)},[e,r]),lb(`Session:${e}`,function(a){r!==a&&i(a)},[r,e,t]),b.useEffect(function(){const a=l=>{l.key===e&&i(PP(e,t))};return window.addEventListener("storage",a),()=>{window.removeEventListener("storage",a)}},[e,i,t]),n}function vke(e,t=!1){const[n,r]=jd(e,t),i=b.useCallback(l=>{l?.preventDefault?.(),r(d=>!d)},[r]),o=b.useCallback(l=>{l?.preventDefault?.(),r(!0)},[r]),a=b.useCallback(l=>{l?.preventDefault?.(),r(!1)},[r]);return b.useMemo(()=>({toggled:n,setToggled:r,toggle:i,toggleOn:o,toggleOff:a}),[i,r,a,o,n])}const Wq=b.createContext(null);function Fr(){return b.useContext(Wq)}async function Xq({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 L0(e){const t=(e||"")?.split(".");return t.length>1?t.slice(-1)[0]:""}function Jq(e){switch(L0(e).toLowerCase()){case"jpg":case"jpeg":case"gif":case"png":case"pneg":case"webp":return!0;default:return!1}}async function Qq({instanceClient:e,file:t,project:n,encoding:r}){const{data:i}=await e.post("/",{operation:"get_component_file",file:t,project:n,encoding:r??(Jq(t)?"base64":"utf8")});return{file:t,project:n,...i}}function yke(e){return{queryKey:e7(e),queryFn:()=>Qq(e),enabled:!!e.file&&!!e.project,retry:!1}}function e7(e){return[e.entityId,"get_component_file",e.file,e.project,e.encoding]}async function DI({file:e,payload:t,project:n,entityType:r,instanceClient:i,encoding:o}){const{data:a}=await i.post("/",{operation:"set_component_file",file:e,payload:t,project:n,encoding:o,replicated:r==="cluster"},{timeout:3e5});return a}function t7(){return ut({mutationFn:DI})}function n7(){const{reloadRootEntries:e,setFocusedItem:t,setSelectedItems:n}=Fr(),r=Wt();return b.useCallback(async i=>{let o=!1;const a=i.filter(y=>y.from!==y.to);if(a.length===0)return;const l=`Renaming ${Wr(a.length,"File","Files")}`,d={duration:6e4,action:{label:"Cancel",onClick:()=>{o=!0}}};d.id=Se.loading(l,{...d,description:u.jsx(Om,{animated:!0,width:"0%"})});const m=a.length*3;let h=0;function v(){h+=1,Se.loading(l,{...d,description:u.jsx(Om,{animated:!0,width:(h===0?0:h/m*100)+"%"})})}for(const y of a){const x=y.from.split("/"),S=x.shift(),C=x.join("/"),k=y.to.split("/"),E=k.shift(),j=k.join("/"),R=await Qq({...r,file:C,project:S,encoding:"base64"});if(o||(v(),await DI({...r,file:j,project:E,encoding:"base64",payload:R.message}),o)||(v(),await Xq({...r,file:C,project:S}),o))break;v()}h>=m?Se.success(`Renamed ${Wr(a.length,"File","Files")}`,{id:d.id,description:"All done!",duration:3e3,action:{label:"OK",onClick:()=>{}}}):Se.warning("Rename Cancelled",{id:d.id,description:`${h} of ${m} steps completed.`,duration:1e4,action:{label:"OK",onClick:()=>{}}}),e(),n(y=>{const x=y.slice();for(const S of a){const C=x.indexOf(S.from);C>=0?x.splice(C,1,S.to):x.push(S.to)}return x}),t(y=>{for(const x of a)if(y===x.from)return x.to;return y})},[r,e,t,n])}function bke(e,t){return e[t]!==void 0}function r7(e){return t=>bke(t,e)}function Vl(e,t){const[n,r]=b.useState({value:t});return lb(e,(i,o)=>r({value:i,trigger:o}),[r]),n}function ri(e,t,n){Uh(e,t,n)}function F0(e,t,n){return r=>ri(e,t,r)}function Xa(e,t,n){return b.useCallback(r=>{ri(e,t,r)},[e,t,n])}const xke={handleGlobal(e,t){if((t.cmd||t.ctrl)&&e==="Delete")return ri("ShowDeleteDirectoryOrFileModal",!0),!0},addEditorAction(e){return{id:"delete-file",label:"Delete File",keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.Delete],run:F0("ShowDeleteDirectoryOrFileModal",!0)}}},wke={handleGlobal(e,t){if(t.ctrl&&t.alt&&t.shift&&e==="˜")return ri("ShowAddDirectoryOrFileModalType","directory"),!0},addEditorAction(e){return{id:"new-directory",label:"New Directory",keybindings:[e.KeyMod.WinCtrl|e.KeyMod.Alt|e.KeyMod.Shift|e.KeyCode.KeyN],run:F0("ShowAddDirectoryOrFileModalType","directory")}}},Ske={handleGlobal(e,t){if(t.ctrl&&e==="n")return ri("ShowAddDirectoryOrFileModalType","file"),!0},addEditorAction(e){return{id:"new-file",label:"New File",keybindings:[e.KeyMod.WinCtrl|e.KeyCode.KeyN],run:F0("ShowAddDirectoryOrFileModalType","file")}}},_ke={handleGlobal(e){if(e==="F2")return ri("ShowRenameFileModal","file"),!0},addEditorAction(e){return{id:"rename-file",label:"Rename File",keybindings:[e.KeyMod.WinCtrl|e.KeyMod.Alt|e.KeyCode.KeyR,e.KeyCode.F2],run:F0("ShowRenameFileModal",!0)}}},Cke={addEditorAction(){return{id:"revert-file",label:"Revert File",run:Yq("RevertChanges",!0)}}},kke={handleGlobal(e,t){if(t.cmd&&e==="s")return Uh("SaveFile",!0),!0},addEditorAction(e){return{id:"save-file",label:"Save Changes",keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.KeyS],run:Yq("SaveFile",!0)}}},i7=[xke,wke,Ske,_ke,Cke,kke],Eke=i7.filter(r7("addEditorAction")),jke=i7.filter(r7("handleGlobal"));function Rke(e){const[t,n]=e,r=Eke.map(i=>t.addAction(i.addEditorAction(n)));return()=>{for(const i of r)i?.dispose()}}function Ike(){b.useEffect(()=>(document.addEventListener("keydown",MP),()=>{document.removeEventListener("keydown",MP)}),[])}function MP(e){const t=e.getModifierState("Meta"),n=e.getModifierState("Alt"),r=e.getModifierState("Shift"),i=e.getModifierState("Control"),o={cmd:t,alt:n,shift:r,ctrl:i};for(const a of jke)if(a.handleGlobal(e.key,o)){e.preventDefault();return}}function Tke(e){return e.split("/").pop()}function PI(...e){return e.flat(1).join("/")}var ns;(function(e){e.DoubleClickItemToExpand="double-click-item-to-expand",e.ClickItemToExpand="click-item-to-expand",e.ClickArrowToExpand="click-arrow-to-expand"})(ns||(ns={}));var cb=function(){return cb=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},cb.apply(this,arguments)},Nke=function(e,t){return{mode:e.mode,createInteractiveElementProps:function(n,r,i,o){return cb(cb({},t.createInteractiveElementProps(n,r,i,o)),e.createInteractiveElementProps(n,r,i,o))}}},Qd=function(e){return e.ctrlKey||navigator.platform.toUpperCase().indexOf("MAC")>=0&&e.metaKey},Ake=(function(){function e(t){this.mode=ns.DoubleClickItemToExpand,this.environment=t}return e.prototype.createInteractiveElementProps=function(t,n,r,i){var o=this;return{onClick:function(a){var l=a.detail===0;r.focusItem(),a.shiftKey&&!l?r.selectUpTo(!Qd(a)):Qd(a)&&!l?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})(),Oke=(function(){function e(t){this.mode=ns.ClickItemToExpand,this.environment=t}return e.prototype.createInteractiveElementProps=function(t,n,r,i){var o=this;return{onClick:function(a){var l=a.detail===0;r.focusItem(),a.shiftKey&&!l?r.selectUpTo(!Qd(a)):Qd(a)&&!l?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})(),$ke=(function(){function e(t){this.mode=ns.ClickItemToExpand,this.environment=t}return e.prototype.createInteractiveElementProps=function(t,n,r,i){var o=this;return{onClick:function(a){var l=a.detail===0;r.focusItem(),a.shiftKey&&!l?r.selectUpTo(!Qd(a)):Qd(a)&&!l?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})(),zP=function(e,t){switch(e){case ns.DoubleClickItemToExpand:return new Ake(t);case ns.ClickItemToExpand:return new Oke(t);case ns.ClickArrowToExpand:return new $ke(t);default:throw Error("Unknown interaction mode ".concat(e))}},o7=b.createContext(null),Dke=function(){return b.useContext(o7)},Pke=function(e){var t=e.children,n=yn(),r=n.defaultInteractionMode,i=b.useMemo(function(){var o;return r&&typeof r!="string"?r.extends?Nke(r,zP(r.extends,n)):r:zP((o=r)!==null&&o!==void 0?o:ns.ClickItemToExpand,n)},[]);return b.createElement(o7.Provider,{value:i},t)},a7=function(){var e=yn();return b.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])},s7=function(){var e=yn();return b.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])},Mke=function(){var e=yn(),t=s7(),n=a7(),r=b.useCallback(function(i,o,a){var l=t(o,i),d=l.parent,f=l.parentLinearIndex;return a.some(function(m){return m.index===d.item})?!0:d.depth===0?!1:r(i,f,a)},[t]);return b.useCallback(function(i,o){for(var a,l,d,f,m=e.linearItems[i],h=[],v=-1,y=0;y<m.length;y++){var x=m[y],S=x.item,C=x.depth;if(!(v!==-1&&C>v)){v=-1;var k=t(y,i).parent,E=e.items[k.item].children.indexOf(S);if(r(i,y,o)){v=C+1;continue}var j={targetType:"item",parentItem:k.item,targetItem:S,linearIndex:y,depth:C,treeId:i},R={targetType:"between-items",parentItem:k.item,linePosition:"top",childIndex:E,depth:C,treeId:i,linearIndex:y},N={targetType:"between-items",parentItem:k.item,linePosition:"bottom",linearIndex:y+1,childIndex:E+1,depth:C,treeId:i},T=(l=(a=m[y-1])===null||a===void 0?void 0:a.depth)!==null&&l!==void 0?l:-1,A=(f=(d=m[y+1])===null||d===void 0?void 0:d.depth)!==null&&f!==void 0?f:-1,D=C===T,F=C===A-1;!D&&n(R,o)&&h.push(R),n(j,o)&&h.push(j),!F&&n(N,o)&&h.push(N)}}return h},[n,e.items,e.linearItems,t,r])},Fv=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))},ub=function(e,t,n){var r=b.useRef();b.useEffect(function(){if(!r.current)r.current=Fv([],n,!0),e();else{var i=r.current.some(function(o,a){return o!==n[a]});i&&(r.current=Fv([],n,!0),e())}},Fv(Fv([],t,!0),n,!0))},db=function(){return db=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},db.apply(this,arguments)},l7=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 db(db({},n),(i={},i[o]=a,i))},{})},_o=function(){return typeof document<"u"?document:void 0};function Tf(e){e===void 0&&(e=!1);var t=b.useRef(new Array);return b.useEffect(function(){if(e)return function(){};var n=t.current;return function(){return n.forEach(function(r){return cancelAnimationFrame(r)})}},[e,t]),b.useCallback(function(n){var r=requestAnimationFrame(function(){t.current.splice(t.current.indexOf(r),1),n()});t.current.push(r)},[t])}var fb=function(e){var t=b.useRef(e);return t.current=e,t},Co=function(e){var t=fb(e);return b.useCallback((function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t.current.apply(t,n)}),[t])},c7=function(){var e=yn();return Co(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})})},zke=function(e){var t,n=(t=_o())===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},u7=function(e,t){return e.clientX<=t.left||e.clientX>=t.right||e.clientY<=t.top||e.clientY>=t.bottom},Lke=(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 l=Math.max(i-o,this.indentation),d={parentLinearIndex:this.linearIndex,parent:this.targetItem},f,m=i;m>=l;m-=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:l,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(l){return l.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})(),Fke=function(){var e=b.useRef("initial"),t=b.useState(void 0),n=t[0],r=t[1],i=b.useRef(0),o=yn(),a=s7(),l=Co(function(v,y,x){if(!x)return!1;var S=x.offset,C=x.linearIndex,k="".concat(y,"__").concat(C,"__").concat(S??"","__").concat(x.indentation);return k!==e.current?(e.current=k,!0):!1}),d=Co(function(v,y,x){if(x.current){var S=x.current.getBoundingClientRect();if(!u7(v,S)){var C=(v.clientY-S.top)/i.current,k=o.linearItems[y],E=Math.min(Math.max(0,Math.floor(C)),k.length-1);if(k.length===0)return{linearIndex:0,offset:"bottom",indentation:0};var j=k[E],R=o.items[j.item],N=o.renderDepthOffset?Math.max(Math.floor((v.clientX-S.left)/o.renderDepthOffset),0):void 0,T,A=o.canReorderItems?R?.isFolder&&o.canDropOnFolder||o.canDropOnNonFolder?.2:.5:0;return C-.5>=k.length-1?T="bottom":C%1<A?T="top":C%1>1-A&&(T="bottom"),{linearIndex:E,offset:T,indentation:N}}}}),f=Co(function(v,y,x){var S=d(v,y,x);if(l(v,y,S))return!n||!o.canDragAndDrop||!S||v.clientX<0||v.clientY<0?"invalid":new Lke(o,v,y,S,n,a).getDraggingPosition()}),m=Co(function(v,y){r(y),e.current="initial",i.current=zke(v)}),h=Co(function(){r(void 0),e.current="initial",i.current=0});return{initiateDraggingPosition:m,resetDraggingPosition:h,draggingItems:n,getDraggingPosition:f,itemHeight:i}},d7=b.createContext(null),ja=function(){return b.useContext(d7)},Uke=function(e){var t=e.children,n=yn(),r=b.useState(!1),i=r[0],o=r[1],a=b.useState({}),l=a[0],d=a[1],f=b.useState(0),m=f[0],h=f[1],v=b.useState(),y=v[0],x=v[1],S=Mke(),C=Tf(),k=c7(),E=Fke(),j=E.initiateDraggingPosition,R=E.resetDraggingPosition,N=E.draggingItems,T=E.getDraggingPosition,A=E.itemHeight,D=b.useCallback(function(U,O){var J;if(n.activeTreeId&&(!((J=n.viewState[n.activeTreeId])===null||J===void 0)&&J.focusedItem)&&n.linearItems&&O){var pe=n.viewState[n.activeTreeId].focusedItem,ge=S(n.activeTreeId,O),Q=ge.findIndex(function(ve){return ve.targetType==="item"?ve.targetItem===pe:ve.targetType==="between-items"?n.items[ve.parentItem].children[ve.childIndex]===pe:!1});h(Q?Math.min(Q+1,ge.length-1):0)}else h(0)},[n.activeTreeId,n.items,n.linearItems,n.viewState,S]),F=Co(function(){o(!1),d({}),h(0),x(void 0),R()});ub(function(){n.activeTreeId&&n.linearItems[n.activeTreeId]&&l[n.activeTreeId]&&D(l[n.activeTreeId],N)},[N,n.activeTreeId,n.linearItems,D,l],[n.activeTreeId]),ub(function(){i&&n.activeTreeId&&x(l[n.activeTreeId][m])},[m,n.activeTreeId,i,l],[m,n.activeTreeId]);var K=a7(),te=function(U){var O;N&&!K(U,N)||(x(U),n.setActiveTree(U.treeId),N&&n.activeTreeId!==U.treeId&&((O=n.onSelectItems)===null||O===void 0||O.call(n,N.map(function(J){return J.index}),U.treeId)))},G=Co(function(U,O,J){if(N){var pe=T(U,O,J);if(pe){if(pe==="invalid"){x(void 0);return}te(pe)}}}),q=Co(function(U,O){O.current&&u7(U,O.current.getBoundingClientRect())&&x(void 0)}),V=Co(function(){!N||!y||!n.onDrop||(n.onDrop(N,y),C(function(){var U;(U=n.onFocusItem)===null||U===void 0||U.call(n,N[0],y.treeId),F()}))}),H=b.useCallback(function(U,O){var J=l7(n.treeIds,function(pe){return S(pe,U)});j(O,U),d(J),n.activeTreeId&&D(J[n.activeTreeId],U)},[n.activeTreeId,n.treeIds,S,j,D]),z=b.useCallback(function(){var U,O,J;if(n.canDragAndDrop&&n.activeTreeId){var pe=(O=(U=n.viewState[n.activeTreeId])===null||U===void 0?void 0:U.selectedItems)!==null&&O!==void 0?O:[(J=n.viewState[n.activeTreeId])===null||J===void 0?void 0:J.focusedItem];if(pe.length===0||pe[0]===void 0)return;var ge=k(n.activeTreeId,pe.map(function(Q){return n.items[Q]}));if(n.canDrag&&!n.canDrag(ge))return;H(ge,n.activeTreeId),setTimeout(function(){o(!0)})}},[n,k,H]),W=b.useCallback(function(){F()},[F]),L=b.useCallback(function(){V(),F()},[V,F]),ne=b.useCallback(function(){h(function(U){return Math.max(0,U-1)})},[]),$=b.useCallback(function(){n.activeTreeId&&h(function(U){return Math.min(l[n.activeTreeId].length-1,U+1)})},[n.activeTreeId,l]),P=b.useMemo(function(){return{onStartDraggingItems:H,startProgrammaticDrag:z,abortProgrammaticDrag:W,completeProgrammaticDrag:L,programmaticDragUp:ne,programmaticDragDown:$,draggingItems:N,draggingPosition:y,itemHeight:A.current,isProgrammaticallyDragging:i,onDragOverTreeHandler:G,onDragLeaveContainerHandler:q,viableDragPositions:l}},[W,L,N,y,i,A,G,q,H,$,ne,z,l]);return b.useEffect(function(){return window.addEventListener("dragend",F),window.addEventListener("drop",V),function(){window.removeEventListener("dragend",F),window.removeEventListener("drop",V)}},[V,F]),b.createElement(d7.Provider,{value:P},t)},cm=function(){return cm=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},cm.apply(this,arguments)},Vke=function(e,t){var n=yn(),r=ja();b.useImperativeHandle(e,function(){return cm(cm(cm({},t),n),{treeEnvironmentContext:n,dragAndDropContext:r})})},f7=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()}})},yk=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 l(m){try{f(r.next(m))}catch(h){a(h)}}function d(m){try{f(r.throw(m))}catch(h){a(h)}}function f(m){m.done?o(m.value):i(m.value).then(l,d)}f((r=r.apply(e,t||[])).next())})},bk=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:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(f){return function(m){return d([f,m])}}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(m){f=[6,m],i=0}finally{r=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},LP=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))},p7=b.createContext(null),Bke=function(){return b.useContext(p7)},m7=function(e,t,n){return yk(void 0,void 0,void 0,function(){var r,i,o,a,l,d,f;return bk(this,function(m){for(r=function(h){f7(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),m7(h,t,n))})},i=0,o=(f=(d=(l=t.current)===null||l===void 0?void 0:l[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]})})},Hke=b.forwardRef(function(e,t){var n=yn(),r=n.onCollapseItem,i=n.items,o=n.trees,a=n.viewState,l=n.onExpandItem,d=n.onFocusItem,f=n.setActiveTree,m=n.onRenameItem,h=n.onSelectItems,v=n.onPrimaryAction,y=n.linearItems,x=ja(),S=x.abortProgrammaticDrag,C=x.completeProgrammaticDrag,k=x.programmaticDragDown,E=x.programmaticDragUp,j=x.startProgrammaticDrag,R=fb(i),N=b.useCallback(function($,P){r?.(i[$],P)},[i,r]),T=b.useCallback(function($,P){l?.(i[$],P)},[i,l]),A=b.useCallback(function($,P,U){U===void 0&&(U=!0),d?.(i[$],P,U)},[i,d]),D=b.useCallback(function($,P){P===void 0&&(P=!0),f($,P)},[f]),F=b.useCallback(function($){var P=y[$],U=P.findIndex(function(pe){var ge,Q=pe.item;return Q===((ge=a[$])===null||ge===void 0?void 0:ge.focusedItem)}),O=U!==void 0?Math.min(P.length-1,U+1):0,J=i[P[O].item];d?.(J,$)},[i,y,d,a]),K=b.useCallback(function($){var P=y[$],U=P.findIndex(function(pe){var ge,Q=pe.item;return Q===((ge=a[$])===null||ge===void 0?void 0:ge.focusedItem)}),O=U!==void 0?Math.max(0,U-1):0,J=i[P[O].item];d?.(J,$)},[i,y,d,a]),te=b.useCallback(function($,P,U){m?.(i[$],P,U)},[i,m]),G=b.useCallback(function($,P){h?.($,P)},[h]),q=b.useCallback(function($,P){var U,O;!((O=(U=a[P])===null||U===void 0?void 0:U.expandedItems)===null||O===void 0)&&O.includes($)?r?.(i[$],P):l?.(i[$],P)},[i,r,l,a]),V=b.useCallback(function($,P){var U,O,J,pe,ge;!((O=(U=a[P])===null||U===void 0?void 0:U.selectedItems)===null||O===void 0)&&O.includes($)?h?.((pe=(J=a[P].selectedItems)===null||J===void 0?void 0:J.filter(function(Q){return Q!==$}))!==null&&pe!==void 0?pe:[],P):h?.(LP(LP([],(ge=a[P].selectedItems)!==null&&ge!==void 0?ge:[],!0),[$],!1),P)},[h,a]),H=b.useCallback(function($,P){v?.(i[$],P)},[i,v]),z=b.useCallback(function($,P){return yk(void 0,void 0,void 0,function(){var U,O;return bk(this,function(J){switch(J.label){case 0:return U=P[0],O=P.slice(1),[4,f7(function(){var pe;return!!(!((pe=R.current)===null||pe===void 0)&&pe[U])}).then(function(){var pe=R.current[U];return pe?(l?.(pe,$),O.length>0?z($,O):Promise.resolve()):Promise.resolve()})];case 1:return J.sent(),[2]}})})},[R,l]),W=b.useCallback(function($){return yk(void 0,void 0,void 0,function(){return bk(this,function(P){switch(P.label){case 0:return[4,m7(o[$].rootItem,R,function(U){return l?.(U,$)})];case 1:return P.sent(),[2]}})})},[R,l,o]),L=b.useCallback(function($){for(var P,U,O=0,J=(U=(P=a[$])===null||P===void 0?void 0:P.expandedItems)!==null&&U!==void 0?U:[];O<J.length;O++){var pe=J[O];r?.(i[pe],$)}},[i,r,a]),ne=b.useMemo(function(){return{collapseItem:N,expandItem:T,focusItem:A,focusTree:D,moveFocusDown:F,moveFocusUp:K,renameItem:te,selectItems:G,toggleItemExpandedState:q,toggleItemSelectStatus:V,invokePrimaryAction:H,expandAll:W,expandSubsequently:z,collapseAll:L,abortProgrammaticDrag:S,completeProgrammaticDrag:C,moveProgrammaticDragPositionDown:k,moveProgrammaticDragPositionUp:E,startProgrammaticDrag:j}},[N,T,A,D,F,K,te,G,q,V,H,W,z,L,S,C,k,E,j]);return Vke(t,ne),b.createElement(p7.Provider,{value:ne},e.children)}),qke=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=_o())===null||t===void 0?void 0:t.documentElement)===null||n===void 0)&&n.clientHeight))&&o.right<=(window.innerWidth||!!(!((i=(r=_o())===null||r===void 0?void 0:r.documentElement)===null||i===void 0)&&i.clientWidth));a||e.scrollIntoView()}},gi=function(){return gi=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},gi.apply(this,arguments)},Ks=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(n){return!!n}).join(" ")},Kke=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",gi({className:Ks(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,l=n.context,d=n.arrow,f=l.isRenaming?"div":"button",m=l.isRenaming?void 0:"button";return X.createElement("li",gi({},l.itemContainerWithChildrenProps,{className:Ks("rct-tree-item-li",r.isFolder&&"rct-tree-item-li-isFolder",l.isSelected&&"rct-tree-item-li-selected",l.isExpanded&&"rct-tree-item-li-expanded",l.isFocused&&"rct-tree-item-li-focused",l.isDraggingOver&&"rct-tree-item-li-dragging-over",l.isSearchMatching&&"rct-tree-item-li-search-match")}),X.createElement("div",gi({},l.itemContainerWithoutChildrenProps,{style:{"--depthOffset":"".concat((i+1)*e,"px")},className:Ks("rct-tree-item-title-container",r.isFolder&&"rct-tree-item-title-container-isFolder",l.isSelected&&"rct-tree-item-title-container-selected",l.isExpanded&&"rct-tree-item-title-container-expanded",l.isFocused&&"rct-tree-item-title-container-focused",l.isDraggingOver&&"rct-tree-item-title-container-dragging-over",l.isSearchMatching&&"rct-tree-item-title-container-search-match")}),d,X.createElement(f,gi({type:m},l.interactiveElementProps,{className:Ks("rct-tree-item-button",r.isFolder&&"rct-tree-item-button-isFolder",l.isSelected&&"rct-tree-item-button-selected",l.isExpanded&&"rct-tree-item-button-expanded",l.isFocused&&"rct-tree-item-button-focused",l.isDraggingOver&&"rct-tree-item-button-dragging-over",l.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,l=n.formProps;return X.createElement("form",gi({},l,{className:"rct-tree-item-renaming-form"}),X.createElement("input",gi({},r,{ref:i,className:"rct-tree-item-renaming-input"})),X.createElement("input",gi({},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:Ks("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",gi({},i,{style:gi({minHeight:"30px"},i.style)}),r))},renderItemsContainer:function(n){var r=n.children,i=n.containerProps;return X.createElement("ul",gi({},i,{className:"rct-tree-items-container"}),r)},renderDragBetweenLine:function(n){var r=n.draggingPosition,i=n.lineProps;return X.createElement("div",gi({},i,{style:{left:"".concat(r.depth*e,"px")},className:Ks("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:Ks("rct-tree-search-input-container")},X.createElement("span",{className:"rct-tree-input-icon"}),X.createElement("input",gi({},r,{className:Ks("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}},Gke=function(e){var t=e.renderItem,n=e.renderItemTitle,r=e.renderItemArrow,i=e.renderRenameInput,o=e.renderItemsContainer,a=e.renderTreeContainer,l=e.renderDragBetweenLine,d=e.renderSearchInput,f=e.renderLiveDescriptorContainer,m=e.renderDepthOffset,h=b.useMemo(function(){return Kke(m??10)},[m]),v={renderItem:t,renderItemTitle:n,renderItemArrow:r,renderRenameInput:i,renderItemsContainer:o,renderTreeContainer:a,renderDragBetweenLine:l,renderSearchInput:d,renderLiveDescriptorContainer:f,renderDepthOffset:m},y=Object.entries(h).reduce(function(x,S){var C=S[0],k=S[1],E=C;return v[E]?x[E]=v[E]:x[E]=k,x},{});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},MI=function(e,t,n,r){var i,o,a;r===void 0&&(r=0);for(var l=[],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 m=f[d],h=n[m];l.push({item:m,depth:r}),h&&h.isFolder&&h.children&&(!((a=t.expandedItems)===null||a===void 0)&&a.includes(m))&&l.push.apply(l,MI(m,t,n,r+1))}return l},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)},Zke=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},Yke=function(e){var t=e.onExpandItem,n=e.onCollapseItem,r=e.onDrop,i=Zke(e,["onExpandItem","onCollapseItem","onDrop"]),o=b.useState({}),a=o[0],l=o[1],d=b.useState(),f=d[0],m=d[1],h=b.useMemo(function(){return Object.keys(a)},[a]),v=i.onFocusItem,y=i.autoFocus,x=i.onRegisterTree,S=i.onUnregisterTree,C=i.items,k=i.viewState,E=fb(v),j=fb(k),R=b.useMemo(function(){return l7(h,function(V){var H;return MI(a[V].rootItem,(H=k[V])!==null&&H!==void 0?H:{},C)})},[a,C,h,k]),N=b.useCallback(function(V,H,z){var W,L,ne,$,P,U,O,J,pe;if(z===void 0&&(z=!0),(y??!0)&&z){var ge=(L=(W=_o())===null||W===void 0?void 0:W.querySelector('[data-rct-tree="'.concat(H,'"] [data-rct-item-id="').concat(V.index,'"]')))!==null&&L!==void 0?L:(ne=_o())===null||ne===void 0?void 0:ne.querySelector('[data-rct-tree="'.concat(H,'"] [data-rct-item-id]'));((U=(P=($=_o())===null||$===void 0?void 0:$.activeElement)===null||P===void 0?void 0:P.attributes.getNamedItem("data-rct-search-input"))===null||U===void 0?void 0:U.value)!=="true"?(O=ge?.focus)===null||O===void 0||O.call(ge):qke(ge)}((J=j.current[H])===null||J===void 0?void 0:J.focusedItem)!==V.index&&((pe=E.current)===null||pe===void 0||pe.call(E,V,H))},[y,E,j]),T=b.useCallback(function(V){l(function(H){var z;return mc(mc({},H),(z={},z[V.treeId]=V,z))}),x?.(V)},[x]),A=b.useCallback(function(V){S?.(a[V]),delete a[V],l(a)},[S,a]),D=b.useCallback(function(V,H){n?.(V,H),l(function(z){return z})},[n]),F=b.useCallback(function(V,H){t?.(V,H),l(function(z){return z})},[t]),K=b.useCallback(function(V,H){r?.(V,H),l(function(z){return z})},[r]),te=b.useCallback(function(V){var H,z,W=(H=_o())===null||H===void 0?void 0:H.querySelector('[data-rct-tree="'.concat(V,'"] [data-rct-item-focus="true"]'));(z=W?.focus)===null||z===void 0||z.call(W)},[]),G=b.useCallback(function(V,H){H===void 0&&(H=!0);var z=function(L){var ne,$;H&&(y??!0)&&L&&!(!(($=(ne=_o())===null||ne===void 0?void 0:ne.querySelector('[data-rct-tree="'.concat(L,'"]')))===null||$===void 0)&&$.contains(document.activeElement))&&te(L)};if(typeof V=="function")m(function(L){var ne=V(L);return ne!==L&&z(ne),ne});else{var W=V;m(W),z(W)}},[y,te]),q=Gke(i);return mc(mc(mc({},q),i),{onFocusItem:N,registerTree:T,unregisterTree:A,onExpandItem:F,onCollapseItem:D,onDrop:K,setActiveTree:G,treeIds:h,trees:a,activeTreeId:f,linearItems:R})},h7=b.createContext(null),yn=function(){return b.useContext(h7)},Wke=b.forwardRef(function(e,t){var n=Yke(e),r=e.viewState,i=e.onFocusItem;return b.useEffect(function(){for(var o,a,l,d=0,f=Object.keys(n.trees);d<f.length;d++){var m=f[d],h=(a=(o=e.items[n.trees[m].rootItem])===null||o===void 0?void 0:o.children)===null||a===void 0?void 0:a[0],v=h&&e.items[h];!(!((l=r[m])===null||l===void 0)&&l.focusedItem)&&n.trees[m]&&v&&i?.(v,m,!1)}},[n.trees,i,e.items,r]),b.createElement(h7.Provider,{value:n},b.createElement(Pke,null,b.createElement(Uke,null,b.createElement(Hke,{ref:t},e.children))))}),Xke=function(e){var t,n=e.treeId,r=ja(),i=r.draggingPosition,o=r.itemHeight,a=ii().renderers,l=i&&i.targetType==="between-items"&&i.treeId===n;if(!l)return null;var d={onDragOver:function(f){return f.preventDefault()}};return b.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}))},ef=function(e,t,n){var r=Co(n);b.useEffect(function(){return e?(e.addEventListener(t,r),function(){return e.removeEventListener(t,r)}):function(){}},[e,r,t])},Jke=function(e,t,n){var r=b.useState(!1),i=r[0],o=r[1],a=b.useRef(!1),l=Tf();return ef(e,"focusin",function(){i||(o(!0),t?.()),a.current&&(a.current=!1)}),ef(e,"focusout",function(){a.current=!0,l(function(){a.current&&!e?.contains(document.activeElement)&&(n?.(),a.current=!1,o(!1))})}),i},Uv=function(e,t,n){ef(_o(),"keydown",function(r){n&&n&&e.toLowerCase()===r.key.toLowerCase()&&t(r)})},FP={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"]},pb=function(){return pb=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},pb.apply(this,arguments)},g7=function(){var e=yn();return b.useMemo(function(){return e.keyboardBindings?pb(pb({},FP),e.keyboardBindings):FP},[e.keyboardBindings])},Qke=["input","textarea"],go=function(e,t,n,r){r===void 0&&(r=!1);var i=b.useRef([]),o=g7(),a=Tf(),l=b.useMemo(function(){return o[e].map(function(d){return d.split("+")})},[e,o]);ef(_o(),"keydown",function(d){var f;if(n!==!1&&!((Qke.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 m=i.current.map(function(v){return v.toLowerCase()}),h=l.map(function(v){return m.map(function(y){return v.includes(y.toLowerCase())}).reduce(function(y,x){return y&&x},!0)}).reduce(function(v,y){return v||y},!1);h&&(i.current.length>1||!/^[a-zA-Z\s]$/.test(d.key))&&d.preventDefault()}}),ef(_o(),"keyup",function(d){if(n!==!1){var f=i.current.map(function(h){return h.toLowerCase()}),m=l.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);m&&a(function(){return t(d)}),i.current=i.current.filter(function(h){return h!==d.key})}})},Vh=function(){var e,t=ii().treeId,n=yn().viewState;return(e=n[t])!==null&&e!==void 0?e:{}},U0=function(e){return yn().linearItems[e]},eEe=function(){var e=ii().treeId,t=yn(),n=t.onFocusItem,r=t.items,i=U0(e),o=Vh();return Co(function(a){var l,d=(l=i.findIndex(function(v){return v.item===o.focusedItem}))!==null&&l!==void 0?l:0,f=a(d,i),m=Math.max(0,Math.min(i.length-1,f)),h=r[i[m].item];return n?.(h,e),h})},UP=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))},tEe=function(e){var t=b.useRef({target:e,previous:void 0});return t.current.target!==e&&(t.current.previous=t.current.target,t.current.target=e),t.current.previous},v7=function(e){var t=Vh(),n=ii().treeId,r=U0(n),i=yn().onSelectItems,o=tEe(t.focusedItem);return b.useCallback(function(a,l){var d,f;l===void 0&&(l=!1);var m=a.index,h=function(C,k){var E=UP(UP([],l?[]:C,!0),k.filter(function(j){return l||!C.includes(j)}),!0);i?.(E,n)};if(t&&t.selectedItems&&t.selectedItems.length>0){var v=t.focusedItem===m?o:t.focusedItem,y=e==="last-focus"?r.findIndex(function(C){return v===C.item}):r.findIndex(function(C){var k;return(k=t.selectedItems)===null||k===void 0?void 0:k.includes(C.item)}),x=r.findIndex(function(C){return C.item===m});if(y<x){var S=r.slice(y,x+1).map(function(C){var k=C.item;return k});h((d=t.selectedItems)!==null&&d!==void 0?d:[],S)}else{var S=r.slice(x,y+1).map(function(k){var E=k.item;return E});h((f=t.selectedItems)!==null&&f!==void 0?f:[],S)}}else i?.([m],n)},[t,i,n,e,r,o])},VP=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))},nEe=function(){var e,t=yn(),n=ii(),r=n.treeId,i=n.setRenamingItem,o=n.setSearch,a=n.renamingItem,l=U0(r),d=ja(),f=Vh(),m=eEe(),h=v7("first-selected"),v=t.activeTreeId===r,y=!!a,x=t.disableArrowKeys,S=!x&&v&&!y;Uv("arrowdown",function(C){if(C.preventDefault(),d.isProgrammaticallyDragging)d.programmaticDragDown();else{var k=m(function(E){return E+1});C.shiftKey&&h(k)}},S),Uv("arrowup",function(C){if(C.preventDefault(),d.isProgrammaticallyDragging)d.programmaticDragUp();else{var k=m(function(E){return E-1});C.shiftKey&&h(k)}},S),go("moveFocusToFirstItem",function(C){C.preventDefault(),m(function(){return 0})},v&&!d.isProgrammaticallyDragging&&!y),go("moveFocusToLastItem",function(C){C.preventDefault(),m(function(k,E){return E.length-1})},v&&!d.isProgrammaticallyDragging&&!y),Uv("arrowright",function(C){C.preventDefault(),m(function(k,E){var j,R,N=t.items[E[k].item];if(N.isFolder){if(!((j=f.expandedItems)===null||j===void 0)&&j.includes(N.index))return k+1;(R=t.onExpandItem)===null||R===void 0||R.call(t,N,r)}return k})},S&&!d.isProgrammaticallyDragging),Uv("arrowleft",function(C){C.preventDefault(),m(function(k,E){var j,R,N=t.items[E[k].item],T=E[k].depth;if(N.isFolder&&(!((j=f.expandedItems)===null||j===void 0)&&j.includes(N.index)))(R=t.onCollapseItem)===null||R===void 0||R.call(t,N,r);else if(T>0){var A=k;for(A;E[A].depth!==T-1;A-=1);return A}return k})},S&&!d.isProgrammaticallyDragging),go("primaryAction",function(C){var k,E;C.preventDefault(),f.focusedItem!==void 0&&((k=t.onSelectItems)===null||k===void 0||k.call(t,[f.focusedItem],r),(E=t.onPrimaryAction)===null||E===void 0||E.call(t,t.items[f.focusedItem],r))},v&&!d.isProgrammaticallyDragging&&!y),go("toggleSelectItem",function(C){var k,E,j;C.preventDefault(),C.stopPropagation(),f.focusedItem!==void 0&&(f.selectedItems&&f.selectedItems.includes(f.focusedItem)?(k=t.onSelectItems)===null||k===void 0||k.call(t,f.selectedItems.filter(function(R){return R!==f.focusedItem}),r):(E=t.onSelectItems)===null||E===void 0||E.call(t,VP(VP([],(j=f.selectedItems)!==null&&j!==void 0?j:[],!0),[f.focusedItem],!1),r))},v&&!d.isProgrammaticallyDragging&&!y),go("selectAll",function(C){var k;C.preventDefault(),(k=t.onSelectItems)===null||k===void 0||k.call(t,l.map(function(E){var j=E.item;return j}),r)},v&&!d.isProgrammaticallyDragging&&!y),go("renameItem",function(C){var k;if(f.focusedItem!==void 0){C.preventDefault();var E=t.items[f.focusedItem];E.canRename!==!1&&((k=t.onStartRenamingItem)===null||k===void 0||k.call(t,E,r),i(E.index))}},v&&((e=t.canRename)!==null&&e!==void 0?e:!0)&&!y),go("startSearch",function(C){var k,E;C.preventDefault(),o(""),(E=(k=document.querySelector('[data-rct-search-input="true"]'))===null||k===void 0?void 0:k.focus)===null||E===void 0||E.call(k)},v&&!d.isProgrammaticallyDragging&&!y),go("startProgrammaticDnd",function(C){C.preventDefault(),d.startProgrammaticDrag()},v&&!y),go("completeProgrammaticDnd",function(C){C.preventDefault(),d.completeProgrammaticDrag()},v&&d.isProgrammaticallyDragging&&!y),go("abortProgrammaticDnd",function(C){C.preventDefault(),d.abortProgrammaticDrag()},v&&d.isProgrammaticallyDragging&&!y)},y7=function(e,t,n){return n.toLowerCase().includes(e.toLowerCase())},rEe=function(){var e=yn(),t=e.doesSearchMatchItem,n=e.items,r=e.getItemTitle,i=e.onFocusItem,o=ii(),a=o.search,l=o.treeId,d=U0(l),f=Tf();ub(function(){a&&a.length>0&&f(function(){var m=d.find(function(h){var v=h.item;return(t??y7)(a,n[v],r(n[v]))});m&&i?.(n[m.item],l)})},[t,r,d,n,i,a,l,f],[a])},xk=function(){return xk=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},xk.apply(this,arguments)},iEe=function(e){var t,n=e.containerRef,r=ii(),i=r.search,o=r.setSearch,a=r.treeId,l=r.renderers,d=r.renamingItem,f=yn();Vh();var m=f.activeTreeId===a,h=Tf();rEe();var v=function(){var y,x,S;if(o(null),!((y=f.autoFocus)!==null&&y!==void 0)||y){var C=(x=_o())===null||x===void 0?void 0:x.querySelector('[data-rct-tree="'.concat(a,'"] [data-rct-item-focus="true"]'));(S=C?.focus)===null||S===void 0||S.call(C)}};return go("abortSearch",function(){h(function(){v()})},m&&i!==null,!0),ef(n,"keydown",function(y){var x,S,C=y.key.charCodeAt(0);(!((x=f.canSearch)!==null&&x!==void 0)||x)&&(!((S=f.canSearchByStartingTyping)!==null&&S!==void 0)||S)&&m&&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:l.renderSearchInput({inputProps:xk({value:i,onChange:function(y){return o(y.target.value)},onBlur:function(){v()},ref:function(y){var x;(x=y?.focus)===null||x===void 0||x.call(y)},"aria-label":"Search for items"},{"data-rct-search-input":"true"})})},oEe={introduction:`
145
- <p>Accessibility guide for tree {treeLabel}.</p>
146
- <p>
147
- Navigate the tree with the arrow keys. Common tree hotkeys apply. Further keybindings are available:
148
- </p>
149
- <ul>
150
- <li>{keybinding:primaryAction} to execute primary action on focused item</li>
151
- <li>{keybinding:renameItem} to start renaming the focused item</li>
152
- <li>{keybinding:abortRenameItem} to abort renaming an item</li>
153
- <li>{keybinding:startProgrammaticDnd} to start dragging selected items</li>
154
- </ul>
155
- `,renamingItem:`
156
- <p>Renaming the item {renamingItem}.</p>
157
- <p>Use the keybinding {keybinding:abortRenameItem} to abort renaming.</p>
158
- `,searching:`
159
- <p>Searching</p>
160
- `,programmaticallyDragging:`
161
- <p>Dragging items {dragItems}.</p>
162
- <p>Press the arrow keys to move the drag target.</p>
163
- <p>Press {keybinding:completeProgrammaticDnd} to drop or {keybinding:abortProgrammaticDnd} to abort.</p>
164
- `,programmaticallyDraggingTarget:`
165
- <p>Drop target is {dropTarget}.</p>
166
- `},Up=function(e,t,n,r,i){var o=function(a){return t.getItemTitle(t.items[a])};return e.replace(/({[^\s}]+)}/g,function(a){var l,d,f,m=a.slice(1,-1);switch(m){case"treeLabel":return(l=r.treeLabel)!==null&&l!==void 0?l:"";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(m.startsWith("keybinding:"))return i[m.slice(11)][0];throw Error("Unknown live descriptor variable {".concat(m,"}"))}})},Vp=function(e){var t=e.children,n=e.live;return b.createElement("div",{"aria-live":n,dangerouslySetInnerHTML:{__html:t}})},aEe=function(){var e=yn(),t=ii(),n=ja(),r=g7(),i=b.useMemo(function(){var a;return(a=e.liveDescriptors)!==null&&a!==void 0?a:oEe},[e.liveDescriptors]),o=t.renderers.renderLiveDescriptorContainer;return t.treeInformation.isRenaming?b.createElement(o,{tree:t},b.createElement(Vp,{live:"polite"},Up(i.renamingItem,e,n,t,r))):t.treeInformation.isSearching?b.createElement(o,{tree:t},b.createElement(Vp,{live:"polite"},Up(i.searching,e,n,t,r))):t.treeInformation.isProgrammaticallyDragging?b.createElement(o,{tree:t},b.createElement(Vp,{live:"polite"},Up(i.programmaticallyDragging,e,n,t,r)),b.createElement(Vp,{live:"assertive"},Up(i.programmaticallyDraggingTarget,e,n,t,r))):b.createElement(o,{tree:t},b.createElement(Vp,{live:"off"},Up(i.introduction,e,n,t,r)))},sEe=function(){var e,t=yn();return!((e=t.showLiveDescription)!==null&&e!==void 0)||e?b.createElement(aEe,null):null},wk=function(){return wk=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},wk.apply(this,arguments)},lEe=function(){var e=ii(),t=e.treeId,n=e.rootItem,r=e.renderers,i=e.treeInformation,o=yn(),a=b.useRef(),l=ja();nEe(),Jke(a.current,function(){o.setActiveTree(t)},function(){o.setActiveTree(function(h){return h===t?void 0:h})});var d=o.items[n].children,f=b.createElement(b.Fragment,null,b.createElement(sEe,null),b.createElement(x7,{depth:0,parentId:n},d??[]),b.createElement(Xke,{treeId:t}),b.createElement(iEe,{containerRef:a.current})),m=wk({onDragOver:function(h){h.preventDefault(),l.onDragOverTreeHandler(h,t,a)},onDragLeave:function(h){l.onDragLeaveContainerHandler(h,a)},onMouseDown:function(){return l.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:m})},cEe=function(e,t,n){var r,i=yn(),o=ja(),a=(r=i.viewState[e.treeId])===null||r===void 0?void 0:r.selectedItems;return b.useMemo(function(){var l,d;return{isFocused:i.activeTreeId===e.treeId,isRenaming:!!t,areItemsSelected:((l=a?.length)!==null&&l!==void 0?l: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])},um=function(){return um=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},um.apply(this,arguments)},uEe=function(e,t){var n=yn(),r=ii(),i=ja();b.useImperativeHandle(e,function(){return um(um(um({},t),{treeEnvironmentContext:n,dragAndDropContext:i,treeContext:r}),r.treeInformation)})},dEe=b.createContext(null),fEe=b.forwardRef(function(e,t){yn();var n=ii();ja();var r=Bke(),i=b.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 uEe(t,i),b.createElement(dEe.Provider,{value:i},e.children)}),mb=function(){return mb=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},mb.apply(this,arguments)},b7=b.createContext(null),ii=function(){return b.useContext(b7)},pEe=b.forwardRef(function(e,t){var n,r=yn(),i=b.useMemo(function(){return mb(mb({},r),e)},[e,r]),o=b.useState(null),a=o[0],l=o[1],d=b.useState(null),f=d[0],m=d[1],h=r.items[e.rootItem],v=r.viewState[e.treeId];b.useEffect(function(){return r.registerTree({treeId:e.treeId,rootItem:e.rootItem}),function(){return r.unregisterTree(e.treeId)}},[e.treeId,e.rootItem]);var y=cEe(e,f,a),x=b.useMemo(function(){return{treeId:e.treeId,rootItem:e.rootItem,treeLabel:e.treeLabel,treeLabelledBy:e.treeLabelledBy,getItemsLinearly:function(){return MI(e.rootItem,v??{},r.items)},treeInformation:y,search:a,setSearch:l,renamingItem:f,setRenamingItem:m,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):b.createElement(b7.Provider,{value:x},b.createElement(fEe,{ref:t},b.createElement(lEe,null)))}),x7=function(e){for(var t=ii(),n=t.renderers,r=t.treeInformation,i=[],o=0,a=e.children;o<a.length;o++){var l=a[o];i.push(X.createElement(gEe,{key:l,itemIndex:l,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})},Ws=function(){return Ws=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},Ws.apply(this,arguments)},BP=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))},mEe=function(e){var t,n,r,i,o=ii(),a=o.treeId,l=o.search,d=o.renamingItem,f=o.setRenamingItem,m=yn(),h=Dke(),v=ja(),y=v7("last-focus"),x=e&&m.getItemTitle(e),S=c7(),C=b.useMemo(function(){var R;return l===null||l.length===0||!e||!x?!1:((R=m.doesSearchMatchItem)!==null&&R!==void 0?R:y7)(l,e,x)},[l,e,x,m.doesSearchMatchItem]),k=e&&((n=(t=m.viewState[a])===null||t===void 0?void 0:t.selectedItems)===null||n===void 0?void 0:n.includes(e.index)),E=e&&((i=(r=m.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 b.useMemo(function(){var R,N,T,A,D,F,K,te,G;if(e){var q=m.viewState[a],V=((N=(R=q?.selectedItems)===null||R===void 0?void 0:R.map(function(Q){return m.items[Q]}))!==null&&N!==void 0?N:q?.focusedItem?[m.items[q?.focusedItem]]:[]).filter(function(Q){return!!Q}),H=!!V.find(function(Q){return Q.index===e.index}),z=V&&((A=(T=m.canDrag)===null||T===void 0?void 0:T.call(m,V))!==null&&A!==void 0?A:!0)&&V.map(function(Q){var ve;return(ve=Q.canMove)!==null&&ve!==void 0?ve:!0}).reduce(function(Q,ve){return Q&&ve},!0),W=((F=(D=m.canDrag)===null||D===void 0?void 0:D.call(m,[e]))!==null&&F!==void 0?F:!0)&&((K=e.canMove)!==null&&K!==void 0?K:!0),L=m.canDragAndDrop&&(H&&z||!H&&W),ne=m.canDragAndDrop&&!!(!((G=(te=v.viableDragPositions)===null||te===void 0?void 0:te[a])===null||G===void 0)&&G.find(function(Q){return Q.targetType==="item"&&Q.targetItem===e.index})),$={primaryAction:function(){var Q;(Q=m.onPrimaryAction)===null||Q===void 0||Q.call(m,m.items[e.index],a)},collapseItem:function(){var Q;(Q=m.onCollapseItem)===null||Q===void 0||Q.call(m,e,a)},expandItem:function(){var Q;(Q=m.onExpandItem)===null||Q===void 0||Q.call(m,e,a)},toggleExpandedState:function(){var Q,ve;E?(Q=m.onCollapseItem)===null||Q===void 0||Q.call(m,e,a):(ve=m.onExpandItem)===null||ve===void 0||ve.call(m,e,a)},selectItem:function(){var Q;(Q=m.onSelectItems)===null||Q===void 0||Q.call(m,[e.index],a)},addToSelectedItems:function(){var Q,ve;(Q=m.onSelectItems)===null||Q===void 0||Q.call(m,BP(BP([],(ve=q?.selectedItems)!==null&&ve!==void 0?ve:[],!0),[e.index],!1),a)},unselectItem:function(){var Q,ve,be;(Q=m.onSelectItems)===null||Q===void 0||Q.call(m,(be=(ve=q?.selectedItems)===null||ve===void 0?void 0:ve.filter(function(ke){return ke!==e.index}))!==null&&be!==void 0?be:[],a)},selectUpTo:function(Q){y(e,Q)},startRenamingItem:function(){f(e.index)},stopRenamingItem:function(){f(null)},focusItem:function(Q){var ve;Q===void 0&&(Q=!0),(ve=m.onFocusItem)===null||ve===void 0||ve.call(m,e,a,Q)},startDragging:function(){var Q,ve,be=(Q=q?.selectedItems)!==null&&Q!==void 0?Q:[];if(be.includes(e.index)||(be=[e.index],(ve=m.onSelectItems)===null||ve===void 0||ve.call(m,be,a)),L){var ke=S(a,be.map(function($e){return m.items[$e]}));v.onStartDraggingItems(ke,a)}}},P={isSelected:k,isExpanded:E,isFocused:q?.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:L,canDropOn:ne},U=Ws(Ws({},h.createInteractiveElementProps(e,a,$,P,q)),{"data-rct-item-interactive":!0,"data-rct-item-focus":P.isFocused?"true":"false","data-rct-item-id":e.index}),O=Ws({},{"data-rct-item-container":"true"}),J={role:"treeitem","aria-selected":P.isSelected,"aria-expanded":e.isFolder?P.isExpanded?"true":"false":void 0},pe={onClick:function(){e.isFolder&&$.toggleExpandedState(),$.selectItem()},onFocus:function(){$.focusItem()},onDragOver:function(Q){Q.preventDefault()},"aria-hidden":!0,tabIndex:-1},ge=q?Object.entries(q).reduce(function(Q,ve){var be=ve[0],ke=ve[1];return Q[be]=Array.isArray(ke)?ke.includes(e.index):ke===e.index,Q},{}):{};return Ws(Ws(Ws({},$),P),{interactiveElementProps:U,itemContainerWithChildrenProps:J,itemContainerWithoutChildrenProps:O,arrowProps:pe,viewStateFlags:ge})}},[e,m,a,v,k,E,j,C,h,y,f,S])},hEe=function(e){var t=ii(),n=t.renderers,r=t.treeInformation,i=t.setRenamingItem,o=t.treeId,a=yn(),l=b.useRef(null),d=b.useRef(null),f=a.items[e.itemIndex],m=b.useState(a.getItemTitle(f)),h=m[0],v=m[1],y=Tf(!0),x=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)})};ub(function(){var j,R,N,T;a.setActiveTree(o),(!((j=a.autoFocus)!==null&&j!==void 0)||j)&&((R=l.current)===null||R===void 0||R.select(),(T=(N=l.current)===null||N===void 0?void 0:N.focus)===null||T===void 0||T.call(N))},[a,o],[]),go("abortRenameItem",function(){x()},!0,!0);var C={value:h,onChange:function(j){v(j.target.value)},onBlur:function(j){(!j.relatedTarget||j.relatedTarget!==d.current)&&x()},"aria-label":"New item name",tabIndex:0},k={onClick:function(j){j.stopPropagation(),S()}},E={onSubmit:function(j){j.preventDefault(),S()}};return n.renderRenameInput({item:f,inputRef:l,submitButtonProps:k,submitButtonRef:d,formProps:E,inputProps:C})},gEe=function(e){var t,n,r,i,o=b.useState(!1),a=o[0],l=o[1],d=ii(),f=d.renderers,m=d.treeInformation,h=d.renamingItem,v=yn(),y=Vh(),x=v.items[e.itemIndex],S=b.useMemo(function(){var T;return(T=y.expandedItems)===null||T===void 0?void 0:T.includes(e.itemIndex)},[e.itemIndex,y.expandedItems]),C=mEe(x);if(x===void 0||C===void 0)return a||(l(!0),(t=v.onMissingItems)===null||t===void 0||t.call(v,[e.itemIndex])),null;var k=(r=(n=v.shouldRenderChildren)===null||n===void 0?void 0:n.call(v,x,C))!==null&&r!==void 0?r:x.isFolder&&S,E=x.children&&k&&X.createElement(x7,{depth:e.depth+1,parentId:e.itemIndex},x.children),j=v.getItemTitle(x),R=h===e.itemIndex?X.createElement(hEe,{itemIndex:e.itemIndex}):f.renderItemTitle({info:m,context:C,title:j,item:x}),N=f.renderItemArrow({info:m,context:C,item:v.items[e.itemIndex]});return(i=f.renderItem({item:v.items[e.itemIndex],depth:e.depth,title:R,arrow:N,context:C,info:m,children:E}))!==null&&i!==void 0?i:null};function Rr(e){return!!e?.entries}const R1="__root__",Xs="importedApplications",Eo="newApplication";function vEe(e){const t={},n=[],r=[],i=[];for(const o of e)Rr(o)?o.package?r.push(o.path):n.push(o.path):i.push(o.path),w7(t,o);return t[R1]={index:R1,isFolder:!0,children:[Eo,Xs,...n,...i],data:void 0,canMove:!1,canRename:!1},t[Xs]={index:Xs,isFolder:!0,children:r,data:{name:"Imported Applications",path:Xs,package:Xs,project:"",entries:[]},canMove:!1,canRename:!1},t[Eo]={index:Eo,isFolder:!1,data:{name:"New Application",path:Eo,project:""},canMove:!1,canRename:!1},{items:t,rootId:R1}}function w7(e,t){const n=t.path;if(Rr(t)){const r=t,i=[],o=[];for(const a of r.entries)Rr(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)w7(e,a)}else e[n]={index:n,isFolder:!1,data:t,canMove:!t.package,canRename:!t.package}}function yEe(){const[e,t]=b.useState(!1),[n,r]=b.useState(void 0),i=b.useCallback(l=>{if(!l.dataTransfer?.types?.includes("Files"))return;const f=l.target;if(f instanceof Element&&f.classList.contains("rct-tree-item-button-isFolder")){const m=f.getAttribute("data-rct-item-id");!f.querySelector(".packageIsLocked")&&m&&m!==Xs&&m!==Eo&&r(v=>v!==f?(v?.classList?.remove?.("rct-tree-item-title-container-dragging-over"),f.classList.add("rct-tree-item-title-container-dragging-over"),f):v)}t(!0)},[]),o=b.useCallback(()=>{t(!1),r(l=>{l&&l.classList.remove("rct-tree-item-title-container-dragging-over")})},[]),a=b.useCallback(l=>{if(!l.dataTransfer?.types?.includes("Files")||l.detail===1337)return;t(!1),n&&(n.classList.remove("rct-tree-item-title-container-dragging-over"),r(void 0));const f=document.getElementById("dropTarget");return f?f.dispatchEvent(new DragEvent("drop",{bubbles:!0,detail:1337,cancelable:!0,dataTransfer:l.dataTransfer})):!1},[n]);return b.useEffect(()=>(document.addEventListener("dragenter",i),document.addEventListener("dragover",i),document.addEventListener("dragleave",o),document.addEventListener("drop",a),()=>{document.removeEventListener("dragenter",i),document.removeEventListener("dragover",i),document.removeEventListener("dragleave",o),document.removeEventListener("drop",a)}),[i,a,o]),b.useMemo(()=>({dragging:e,dragTarget:n}),[e,n])}function bEe(e){return new Promise((t,n)=>{const r=new FileReader;r.onabort=n,r.onerror=n,r.onload=t,r.readAsDataURL(e)})}const xEe=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function tf(e,t,n){const r=wEe(e),{webkitRelativePath:i}=e,o=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&HP(r,"path",o),HP(r,"relativePath",o),r}function wEe(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=xEe.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function HP(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const SEe=[".DS_Store","Thumbs.db"];function _Ee(e){return iu(this,void 0,void 0,function*(){return hb(e)&&CEe(e.dataTransfer)?REe(e.dataTransfer,e.type):kEe(e)?EEe(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?jEe(e):[]})}function CEe(e){return hb(e)}function kEe(e){return hb(e)&&hb(e.target)}function hb(e){return typeof e=="object"&&e!==null}function EEe(e){return Sk(e.target.files).map(t=>tf(t))}function jEe(e){return iu(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>tf(n))})}function REe(e,t){return iu(this,void 0,void 0,function*(){if(e.items){const n=Sk(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(IEe));return qP(S7(r))}return qP(Sk(e.files).map(n=>tf(n)))})}function qP(e){return e.filter(t=>SEe.indexOf(t.name)===-1)}function Sk(e){if(e===null)return[];const t=[];for(let n=0;n<e.length;n++){const r=e[n];t.push(r)}return t}function IEe(e){if(typeof e.webkitGetAsEntry!="function")return KP(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?_7(t):KP(e,t)}function S7(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?S7(n):[n]],[])}function KP(e,t){return iu(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const o=yield e.getAsFileSystemHandle();if(o===null)throw new Error(`${e} is not a File`);if(o!==void 0){const a=yield o.getFile();return a.handle=o,tf(a)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return tf(r,(n=t?.fullPath)!==null&&n!==void 0?n:void 0)})}function TEe(e){return iu(this,void 0,void 0,function*(){return e.isDirectory?_7(e):NEe(e)})}function _7(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function o(){t.readEntries(a=>iu(this,void 0,void 0,function*(){if(a.length){const l=Promise.all(a.map(TEe));i.push(l),o()}else try{const l=yield Promise.all(i);n(l)}catch(l){r(l)}}),a=>{r(a)})}o()})}function NEe(e){return iu(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const i=tf(r,e.fullPath);t(i)},r=>{n(r)})})})}var Vv={},GP;function AEe(){return GP||(GP=1,Vv.__esModule=!0,Vv.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(a){var l=a.trim().toLowerCase();return l.charAt(0)==="."?r.toLowerCase().endsWith(l):l.endsWith("/*")?o===l.replace(/\/.*$/,""):i===l})}return!0}),Vv}var OEe=AEe();const I1=rf(OEe);function ZP(e){return PEe(e)||DEe(e)||k7(e)||$Ee()}function $Ee(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
167
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DEe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function PEe(e){if(Array.isArray(e))return _k(e)}function YP(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 WP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YP(Object(n),!0).forEach(function(r){C7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function C7(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pm(e,t){return LEe(e)||zEe(e,t)||k7(e,t)||MEe()}function MEe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
168
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function k7(e,t){if(e){if(typeof e=="string")return _k(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 _k(e,t)}}function _k(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 zEe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,l;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,l=d}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw l}}return r}}function LEe(e){if(Array.isArray(e))return e}var FEe=typeof I1=="function"?I1:I1.default,UEe="file-invalid-type",VEe="file-too-large",BEe="file-too-small",HEe="too-many-files",qEe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:UEe,message:"File type must be ".concat(r)}},XP=function(t){return{code:VEe,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},JP=function(t){return{code:BEe,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},KEe={code:HEe,message:"Too many files"};function E7(e,t){var n=e.type==="application/x-moz-file"||FEe(e,t);return[n,n?null:qEe(t)]}function j7(e,t,n){if(hc(e.size))if(hc(t)&&hc(n)){if(e.size>n)return[!1,XP(n)];if(e.size<t)return[!1,JP(t)]}else{if(hc(t)&&e.size<t)return[!1,JP(t)];if(hc(n)&&e.size>n)return[!1,XP(n)]}return[!0,null]}function hc(e){return e!=null}function GEe(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles,l=e.validator;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(d){var f=E7(d,n),m=Pm(f,1),h=m[0],v=j7(d,r,i),y=Pm(v,1),x=y[0],S=l?l(d):null;return h&&x&&!S})}function gb(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Bv(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function QP(e){e.preventDefault()}function ZEe(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function YEe(e){return e.indexOf("Edge/")!==-1}function WEe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return ZEe(e)||YEe(e)}function sa(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];return t.some(function(l){return!gb(r)&&l&&l.apply(void 0,[r].concat(o)),gb(r)})}}function XEe(){return"showOpenFilePicker"in window}function JEe(e){if(hc(e)){var t=Object.entries(e).filter(function(n){var r=Pm(n,2),i=r[0],o=r[1],a=!0;return R7(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),a=!1),(!Array.isArray(o)||!o.every(I7))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),a=!1),a}).reduce(function(n,r){var i=Pm(r,2),o=i[0],a=i[1];return WP(WP({},n),{},C7({},o,a))},{});return[{description:"Files",accept:t}]}return e}function QEe(e){if(hc(e))return Object.entries(e).reduce(function(t,n){var r=Pm(n,2),i=r[0],o=r[1];return[].concat(ZP(t),[i],ZP(o))},[]).filter(function(t){return R7(t)||I7(t)}).join(",")}function eje(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function tje(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function R7(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function I7(e){return/^.*\.[\w]+$/.test(e)}var nje=["children"],rje=["open"],ije=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],oje=["refKey","onChange","onClick"];function aje(e){return cje(e)||lje(e)||T7(e)||sje()}function sje(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
169
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lje(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cje(e){if(Array.isArray(e))return Ck(e)}function T1(e,t){return fje(e)||dje(e,t)||T7(e,t)||uje()}function uje(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
170
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T7(e,t){if(e){if(typeof e=="string")return Ck(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 Ck(e,t)}}function Ck(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 dje(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,l;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,l=d}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw l}}return r}}function fje(e){if(Array.isArray(e))return e}function eM(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 On(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eM(Object(n),!0).forEach(function(r){kk(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kk(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vb(e,t){if(e==null)return{};var n=pje(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 pje(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}var zI=b.forwardRef(function(e,t){var n=e.children,r=vb(e,nje),i=A7(r),o=i.open,a=vb(i,rje);return b.useImperativeHandle(t,function(){return{open:o}},[o]),X.createElement(b.Fragment,null,n(On(On({},a),{},{open:o})))});zI.displayName="Dropzone";var N7={disabled:!1,getFilesFromEvent:_Ee,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};zI.defaultProps=N7;zI.propTypes={children:Je.func,accept:Je.objectOf(Je.arrayOf(Je.string)),multiple:Je.bool,preventDropOnDocument:Je.bool,noClick:Je.bool,noKeyboard:Je.bool,noDrag:Je.bool,noDragEventsBubbling:Je.bool,minSize:Je.number,maxSize:Je.number,maxFiles:Je.number,disabled:Je.bool,getFilesFromEvent:Je.func,onFileDialogCancel:Je.func,onFileDialogOpen:Je.func,useFsAccessApi:Je.bool,autoFocus:Je.bool,onDragEnter:Je.func,onDragLeave:Je.func,onDragOver:Je.func,onDrop:Je.func,onDropAccepted:Je.func,onDropRejected:Je.func,onError:Je.func,validator:Je.func};var Ek={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function A7(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=On(On({},N7),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,l=t.multiple,d=t.maxFiles,f=t.onDragEnter,m=t.onDragLeave,h=t.onDragOver,v=t.onDrop,y=t.onDropAccepted,x=t.onDropRejected,S=t.onFileDialogCancel,C=t.onFileDialogOpen,k=t.useFsAccessApi,E=t.autoFocus,j=t.preventDropOnDocument,R=t.noClick,N=t.noKeyboard,T=t.noDrag,A=t.noDragEventsBubbling,D=t.onError,F=t.validator,K=b.useMemo(function(){return QEe(n)},[n]),te=b.useMemo(function(){return JEe(n)},[n]),G=b.useMemo(function(){return typeof C=="function"?C:tM},[C]),q=b.useMemo(function(){return typeof S=="function"?S:tM},[S]),V=b.useRef(null),H=b.useRef(null),z=b.useReducer(mje,Ek),W=T1(z,2),L=W[0],ne=W[1],$=L.isFocused,P=L.isFileDialogActive,U=b.useRef(typeof window<"u"&&window.isSecureContext&&k&&XEe()),O=function(){!U.current&&P&&setTimeout(function(){if(H.current){var fe=H.current.files;fe.length||(ne({type:"closeDialog"}),q())}},300)};b.useEffect(function(){return window.addEventListener("focus",O,!1),function(){window.removeEventListener("focus",O,!1)}},[H,P,q,U]);var J=b.useRef([]),pe=function(fe){V.current&&V.current.contains(fe.target)||(fe.preventDefault(),J.current=[])};b.useEffect(function(){return j&&(document.addEventListener("dragover",QP,!1),document.addEventListener("drop",pe,!1)),function(){j&&(document.removeEventListener("dragover",QP),document.removeEventListener("drop",pe))}},[V,j]),b.useEffect(function(){return!r&&E&&V.current&&V.current.focus(),function(){}},[V,E,r]);var ge=b.useCallback(function(ie){D?D(ie):console.error(ie)},[D]),Q=b.useCallback(function(ie){ie.preventDefault(),ie.persist(),An(ie),J.current=[].concat(aje(J.current),[ie.target]),Bv(ie)&&Promise.resolve(i(ie)).then(function(fe){if(!(gb(ie)&&!A)){var B=fe.length,le=B>0&&GEe({files:fe,accept:K,minSize:a,maxSize:o,multiple:l,maxFiles:d,validator:F}),Ee=B>0&&!le;ne({isDragAccept:le,isDragReject:Ee,isDragActive:!0,type:"setDraggedFiles"}),f&&f(ie)}}).catch(function(fe){return ge(fe)})},[i,f,ge,A,K,a,o,l,d,F]),ve=b.useCallback(function(ie){ie.preventDefault(),ie.persist(),An(ie);var fe=Bv(ie);if(fe&&ie.dataTransfer)try{ie.dataTransfer.dropEffect="copy"}catch{}return fe&&h&&h(ie),!1},[h,A]),be=b.useCallback(function(ie){ie.preventDefault(),ie.persist(),An(ie);var fe=J.current.filter(function(le){return V.current&&V.current.contains(le)}),B=fe.indexOf(ie.target);B!==-1&&fe.splice(B,1),J.current=fe,!(fe.length>0)&&(ne({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Bv(ie)&&m&&m(ie))},[V,m,A]),ke=b.useCallback(function(ie,fe){var B=[],le=[];ie.forEach(function(Ee){var Me=E7(Ee,K),Ke=T1(Me,2),Jt=Ke[0],Ht=Ke[1],Cn=j7(Ee,a,o),Lt=T1(Cn,2),fn=Lt[0],jt=Lt[1],ar=F?F(Ee):null;if(Jt&&fn&&!ar)B.push(Ee);else{var Rn=[Ht,jt];ar&&(Rn=Rn.concat(ar)),le.push({file:Ee,errors:Rn.filter(function(fr){return fr})})}}),(!l&&B.length>1||l&&d>=1&&B.length>d)&&(B.forEach(function(Ee){le.push({file:Ee,errors:[KEe]})}),B.splice(0)),ne({acceptedFiles:B,fileRejections:le,isDragReject:le.length>0,type:"setFiles"}),v&&v(B,le,fe),le.length>0&&x&&x(le,fe),B.length>0&&y&&y(B,fe)},[ne,l,K,a,o,d,v,y,x,F]),$e=b.useCallback(function(ie){ie.preventDefault(),ie.persist(),An(ie),J.current=[],Bv(ie)&&Promise.resolve(i(ie)).then(function(fe){gb(ie)&&!A||ke(fe,ie)}).catch(function(fe){return ge(fe)}),ne({type:"reset"})},[i,ke,ge,A]),Le=b.useCallback(function(){if(U.current){ne({type:"openDialog"}),G();var ie={multiple:l,types:te};window.showOpenFilePicker(ie).then(function(fe){return i(fe)}).then(function(fe){ke(fe,null),ne({type:"closeDialog"})}).catch(function(fe){eje(fe)?(q(fe),ne({type:"closeDialog"})):tje(fe)?(U.current=!1,H.current?(H.current.value=null,H.current.click()):ge(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ge(fe)});return}H.current&&(ne({type:"openDialog"}),G(),H.current.value=null,H.current.click())},[ne,G,q,k,ke,ge,te,l]),St=b.useCallback(function(ie){!V.current||!V.current.isEqualNode(ie.target)||(ie.key===" "||ie.key==="Enter"||ie.keyCode===32||ie.keyCode===13)&&(ie.preventDefault(),Le())},[V,Le]),ct=b.useCallback(function(){ne({type:"focus"})},[]),Qe=b.useCallback(function(){ne({type:"blur"})},[]),zt=b.useCallback(function(){R||(WEe()?setTimeout(Le,0):Le())},[R,Le]),Bt=function(fe){return r?null:fe},dr=function(fe){return N?null:Bt(fe)},Xt=function(fe){return T?null:Bt(fe)},An=function(fe){A&&fe.stopPropagation()},Z=b.useMemo(function(){return function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},fe=ie.refKey,B=fe===void 0?"ref":fe,le=ie.role,Ee=ie.onKeyDown,Me=ie.onFocus,Ke=ie.onBlur,Jt=ie.onClick,Ht=ie.onDragEnter,Cn=ie.onDragOver,Lt=ie.onDragLeave,fn=ie.onDrop,jt=vb(ie,ije);return On(On(kk({onKeyDown:dr(sa(Ee,St)),onFocus:dr(sa(Me,ct)),onBlur:dr(sa(Ke,Qe)),onClick:Bt(sa(Jt,zt)),onDragEnter:Xt(sa(Ht,Q)),onDragOver:Xt(sa(Cn,ve)),onDragLeave:Xt(sa(Lt,be)),onDrop:Xt(sa(fn,$e)),role:typeof le=="string"&&le!==""?le:"presentation"},B,V),!r&&!N?{tabIndex:0}:{}),jt)}},[V,St,ct,Qe,zt,Q,ve,be,$e,N,T,r]),re=b.useCallback(function(ie){ie.stopPropagation()},[]),se=b.useMemo(function(){return function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},fe=ie.refKey,B=fe===void 0?"ref":fe,le=ie.onChange,Ee=ie.onClick,Me=vb(ie,oje),Ke=kk({accept:K,multiple:l,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:Bt(sa(le,$e)),onClick:Bt(sa(Ee,re)),tabIndex:-1},B,H);return On(On({},Ke),Me)}},[H,n,l,$e,r]);return On(On({},L),{},{isFocused:$&&!r,getRootProps:Z,getInputProps:se,rootRef:V,inputRef:H,open:Bt(Le)})}function mje(e,t){switch(t.type){case"focus":return On(On({},e),{},{isFocused:!0});case"blur":return On(On({},e),{},{isFocused:!1});case"openDialog":return On(On({},Ek),{},{isFileDialogActive:!0});case"closeDialog":return On(On({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return On(On({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return On(On({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return On({},Ek);default:return e}}function tM(){}function hje(){const[e,t]=b.useState(""),{clusterId:n}=rt({strict:!1}),{openedEntry:r,restrictPackageModification:i,reloadRootEntries:o,entryExists:a}=Fr(),l=!!r&&!r.package&&!i,d=Wt(),{dragging:f,dragTarget:m}=yEe(),v=m?.getAttribute?.("data-rct-item-id")?.split?.("/")?.pop?.(),y=r?.project;let x=!1,S;if(r?.path){const R=r.path.split("/"),N=Rr(r);x=l&&(N?R.slice(1):R.slice(1,-1)).join("/"),S=R[R.length-(N?1:2)]}const C=b.useCallback(async(R,N)=>{const T=m?.getAttribute?.("data-rct-item-id")?.split?.("/"),A=T?.length?T[0]:l?y:!1,D=T?.length?T.slice(1).join("/"):l?x:!1;if(A===!1||A===void 0||D===!1||D===void 0)return;const F=[],K=N.slice();for(const L of R){const ne=nM(D,L);L.name.startsWith(".")||L.relativePath?.includes("/.")?K.push({file:L,errors:[{message:"Sensitive files and folders starting with . are skipped.",code:"dot-ignored"}]}):a(`${A}/${ne}`)?K.push({file:L,errors:[{message:`${ne} already exists`,code:"duplicate"}]}):F.push(L)}let te=!1;const G="uploading-files",q={label:"Cancel",onClick:()=>{te=!0}},V={label:"OK",onClick:()=>{}};t(`Uploading ${Wr(F.length,"file","files")}...`);const H=F.reduce((L,ne)=>L+ne.size,0);let z=0,W=0;for(const L of F){W+=1,Se.loading("Upload in progress...",{id:G,descriptionClassName:"whitespace-pre",description:`${W} of ${Wr(F.length,"file","files")}
171
- ${L.name}
172
- ${Fo(z)} of ${Fo(H)}`,action:q});const ne=nM(D,L),P=(await bEe(L)).target.result,U="base64,",O=P.indexOf(U);te?K.push({file:L,errors:[{message:`${ne} cancelled`,code:"cancelled"}]}):(await DI({...d,file:ne,project:A,encoding:"base64",payload:P.slice(O+U.length)}),z+=L.size)}Se.loading("Reloading sidebar...",{id:te?void 0:G,action:V,description:""}),await o(),K.length===0?R.length>0&&Se.success(`Uploaded ${Wr(F.length,"file","files")}!`,{id:G,action:V,description:""}):(console.log(K),Se.error(te?"Cancelled uploads":"Rejected uploads",{id:te?void 0:G,action:V,descriptionClassName:"whitespace-pre overflow-y-auto",description:K.slice(0,5).map(L=>L.errors.map(ne=>ne.message).join(`
173
- `)).join(`
174
- `)+(K?.length>5?`
175
- Check the console for the full list.`:"")})),t("")},[m,l,y,x,a,d,o]),k=!!n&&kt.checkForFabricConnect(n),{getRootProps:E,getInputProps:j}=A7({multiple:!0,maxSize:k?RY:jY,onDrop:C});return!l&&!m?f?u.jsxs("div",{className:yr("border-3 border-dashed","pointer-events-auto","cursor-copy text-sm text-center","p-2 w-full fixed bottom-0 h-16","flex flex-col items-center justify-center","bg-red-950 border-red-600"),children:["You cannot upload into",u.jsx("br",{}),u.jsx("strong",{children:S})]}):null:u.jsxs("div",{...E(),className:f?"fixed top-0 bottom-0 w-full pointer-events-none":"",children:[u.jsx("input",{id:"dropTarget",...j()}),u.jsx("div",{className:yr("border-3 border-dashed","pointer-events-auto","cursor-copy text-sm text-center","p-2 w-full fixed bottom-0 h-16","flex flex-col items-center justify-center",f?"animate-glow-pulse bg-green-950 border-green-600":"bg-purple-950 border-purple-600"),children:e||(m?u.jsxs(u.Fragment,{children:["Drop to upload into",u.jsx("br",{}),u.jsx("strong",{children:v})]}):f?u.jsxs(u.Fragment,{children:["Drop to upload into",u.jsx("br",{}),u.jsx("strong",{children:S})]}):u.jsxs(u.Fragment,{children:["Drag and drop to upload",u.jsx("br",{}),"or click to select files."]}))})]})}function nM(e,t){const n=t.relativePath??t.name,r=n.indexOf("/"),i=r===0||r===1?n.slice(r+1):n;return e?`${e}/${i}`:i}function gje(e){const t=e.data;return t&&"name"in t?t.name:"root"}function Bh(e){const{instanceId:t,clusterId:n}=rt({strict:!1}),r=$n,[i,o]=jd(`EditorFileContent/${r}}/${e}`,void 0);return b.useMemo(()=>({content:e?i:void 0,setContent:o}),[e,i,o])}const Ln="w-6 pointer-events-none ";function vje({opened:e,pkg:t}){return t?e?u.jsx("i",{className:Ln+"fas fa-box-open text-orange-600"}):u.jsx("i",{className:Ln+"fas fa-box text-orange-600"}):e?u.jsx("i",{className:Ln+"fas fa-folder-open text-orange-400"}):u.jsx("i",{className:Ln+"fas fa-folder text-orange-400"})}function yje({extension:e}){switch(e){case"js":return u.jsx("i",{className:Ln+"filetype-js fab fa-js text-yellow"});case"jsx":return u.jsx("i",{className:Ln+"filetype-jsx fab fa-js text-yellow"});case"cjs":return u.jsx("i",{className:Ln+"filetype-cjs fab fa-js text-yellow"});case"yaml":return u.jsx("i",{className:Ln+"filetype-yaml fas fa-file"});case"css":return u.jsx("i",{className:Ln+"filetype-css fas fa-file text-blue"});case"html":return u.jsx("i",{className:Ln+"filetype-unknown far fa-file-alt"});case"json":return u.jsx("i",{className:Ln+"filetype-json fas fa-cog"});case"ts":return u.jsx("i",{className:Ln+"filetype-ts fas fa-file text-blue"});case"tsx":return u.jsx("i",{className:Ln+"filetype-tsx fas fa-file text-blue"});case"png":return u.jsx("i",{className:Ln+"filetype-png fas fa-image"});case"jpg":return u.jsx("i",{className:Ln+"filetype-jpg fas fa-image"});case"jpeg":return u.jsx("i",{className:Ln+"filetype-jpeg fas fa-image"});case"gif":return u.jsx("i",{className:Ln+"filetype-gif fas fa-image"});case"svg":return u.jsx("i",{className:Ln+"filetype-svg fas fa-file-svg"});case"vue":return u.jsx("i",{className:Ln+"filetype-vue fab fa-vuejs text-green"});default:return u.jsx("i",{className:Ln+"filetype-unknown far fa-file-alt"})}}function bje(){return u.jsx("i",{className:Ln+"fas fa-lock text-gray-400 ml-2 packageIsLocked"})}function xje(){return u.jsx("i",{className:Ln+"fas fa-plus text-green"})}function wje({title:e,item:t,context:n}){const{content:r}=Bh(t.data?.path);return u.jsxs(u.Fragment,{children:[t.data?.path===Eo?u.jsx(xje,{}):Rr(t.data)?u.jsx(vje,{opened:n.isExpanded,pkg:!!t.data?.package||t.data.path===Xs}):u.jsx(yje,{extension:L0(e)}),u.jsxs("span",{className:"text-nowrap pointer-events-none",children:[e,r?"*":""]}),t.data?.package&&u.jsx(bje,{})]})}function Sje(){const{rootEntries:e,openedEntry:t,setOpenedEntry:n,focusedItem:r,setFocusedItem:i,expandedItems:o,setExpandedItems:a,selectedItems:l,setSelectedItems:d}=Fr(),{items:f,rootId:m}=b.useMemo(()=>vEe(e),[e]);Ike(),b.useEffect(function(){if(t?.path!==r&&r){const S=f[r]?.data;S&&n(S)}},[r,f,t?.path,n]);const h=n7(),v=b.useCallback((y,x)=>{switch(x.targetType){case"item":if(f[x.targetItem]?.data?.package)Se.error("Read-Only Imported Application",{description:'To make changes to an application, please click the "Redeploy" button and update the reference.'});else return h(y.map(S=>({from:S.index,to:PI(x.targetItem,Tke(S.index))})));break;default:Se.error(`${x.targetType} drop not yet supported`);break}},[f,h]);return u.jsxs("div",{className:"h-full overflow-auto pr-1.5 pb-18",children:[u.jsx(Wke,{canDragAndDrop:!0,canDropOnFolder:!0,canDropOnNonFolder:!1,canReorderItems:!1,canSearch:!0,canRename:!1,getItemTitle:gje,items:f,onDrop:v,renderItemTitle:wje,viewState:{applicationsTree:{focusedItem:r,expandedItems:o,selectedItems:l}},onFocusItem:y=>i(y.index),onExpandItem:y=>a([...o,y.index]),onCollapseItem:y=>a(o.filter(x=>x!==y.index)),onSelectItems:y=>d(y),children:u.jsx(pEe,{treeId:"applicationsTree",rootItem:m,treeLabel:"Applications file tree"})}),u.jsx(hje,{})]})}async function _je(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 qc(n)}throw i}async function O7({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 qc(1e4),await _je(()=>sl({instanceClient:n,timeout:3e3}),12,15e3),r}function Cje(){return ut({mutationFn:O7})}function kje({onRestartedSuccessfully:e}={}){const{clusterId:t}=rt({strict:!1}),n=ir(),[r,i]=b.useState(!1);return{onRestartClick:b.useCallback(async()=>{if(!t)throw new Error("clusterId must be set in the route to invoke useRestartClusterClick");i(!0);let a=!1;const l={duration:6e4,action:{label:"Cancel",onClick:()=>{a=!0}}},d=Se.loading("Restarting",{...l,description:u.jsx(Om,{animated:!0,width:"0%"})}),f=await pj(t),m=kt.checkForFabricConnect(f.id),h=f?.instances??[],v=h.filter(x=>x.status==="RUNNING").map(x=>es({id:x.id,forceFabricConnect:m,operationsUrl:Jk(x)})).reverse();let y=0;if(v.length)for(let x=0;x<v.length;x++){const S=v[x];if(!a){Se.loading(`Restarting Instance ${x+1} of ${v.length}`,{...l,id:d,description:u.jsx(Om,{animated:!0,width:(x===0?0:x/v.length*100)+"%"})});try{await sl({instanceClient:S}),await O7({operation:"restart",replicated:!1,instanceClient:S}),y+=1}catch{x+1!==v.length&&(Se.loading(`Failed Restarting Instance ${x+1} of ${v.length}`,{...l,id:d,description:"We will carry on momentarily."}),await qc(3e3))}}}if(i(!1),n.invalidateQueries({queryKey:[t]}),a)Se.error("Cancelled",{id:d,description:"The restart was partially cancelled.",duration:1e4,action:{label:"Dismiss",onClick:()=>Se.dismiss()}});else if(h.length===y)e?.(),Se.success("Success",{id:d,description:"Cluster fully restarted!",duration:1e4,action:{label:"Dismiss",onClick:()=>Se.dismiss()}});else{const x=Wr(h.length,"instance","instances"),S=Wr(y,'"RUNNING" instance was','"RUNNING" instances were');Se.error("Error",{id:d,description:`Failed to fully restart cluster.
176
- `+([h.length===0&&"No instances were found within the cluster to restart.",y===0&&`No instances were in a "RUNNING" state of ${x}.`,h.length!==y&&`Only ${S} restarted of ${x}.`].filter(Jo).shift()||""),duration:1e4,action:{label:"Dismiss",onClick:()=>Se.dismiss()}})}},[t,e,n]),isRestartPending:r}}function Eje({operation:e,instanceClient:t,onRestartedSuccessfully:n}){const{clusterId:r,instanceId:i}=rt({strict:!1}),o="Instance",{mutate:a,isPending:l}=Cje(),d=ir();return{onRestartClick:b.useCallback(()=>{const m=Se.loading("Restarting",{description:`Restarting ${o.toLowerCase()}. This may take up to 60 seconds.`,duration:18e4,action:{label:"Dismiss",onClick:()=>Se.dismiss()}});a({operation:e,replicated:e==="restart_service"&&o==="Cluster",instanceClient:t},{onSuccess:()=>{d.invalidateQueries({queryKey:[r]}),d.invalidateQueries({queryKey:[i]}),Se.dismiss(m),Se.success("Success",{description:`${o} restarted!`,action:{label:"Dismiss",onClick:()=>Se.dismiss()}}),n?.()},onError:()=>{Se.dismiss(m),Se.error("Error",{description:`Failed to restart ${o.toLowerCase()}.`,action:{label:"Dismiss",onClick:()=>Se.dismiss()}})}})},[r,t,i,n,e,d,a,o]),isRestartPending:l}}function $7({className:e,disabled:t,hideText:n,instanceClient:r,operation:i,targetNoun:o,tooltip:a,variant:l}){const{onRestartClick:d,isRestartPending:f}=kje(),{onRestartClick:m,isRestartPending:h}=Eje({operation:i,instanceClient:r});return u.jsxs(px,{children:[u.jsx(mx,{asChild:!0,children:u.jsxs(xe,{variant:l||"positiveOutline",className:yr("mx-0 md:mx-4 rounded-full",e),onClick:o==="Cluster"&&i==="restart"?d:m,disabled:t||h||f,title:`Restart ${o}`,children:[u.jsx(vne,{className:"pointer-events-none"}),n!==!0&&u.jsxs("span",{className:"hidden md:inline-block pointer-events-none",children:["Restart ",u.jsx("span",{className:"hidden 2xl:inline-block",children:o})]})]})}),u.jsx(hx,{side:"bottom",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.")})]})}function jje({toggledSidebar:e,toggleSidebar:t}){const n=Wt(),{openedEntryContents:r,openedEntry:i,isSavingFile:o,restrictPackageModification:a}=Fr(),{content:l}=Bh(i?.path),d=yf(),f=n.entityType==="instance"?"Instance":"Cluster",m=Xa("ShowAddDirectoryOrFileModalType","file"),h=Xa("ShowAddDirectoryOrFileModalType","directory"),v=Xa("ShowDownloadApplicationModal",!0),y=Xa("ShowRenameFileModal",!0),x=Xa("ShowDeleteDirectoryOrFileModal",!0),S=Xa("ShowRedeployApplicationModal",!0),C=j1("SaveFile",!0),k=j1("RevertChanges",!0),E=j1("ShowNewTableModal",!0),j=l===void 0||l===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(xe,{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(lne,{}):u.jsx(ane,{})]}),i&&i?.path!==Eo&&u.jsxs(u.Fragment,{children:[i.package&&u.jsxs(px,{children:[u.jsx(mx,{asChild:!0,children:u.jsxs(xe,{variant:"ghost",type:"button",className:"cursor-help",children:[u.jsx(Zte,{width:16,height:16}),u.jsx("span",{className:"hidden md:inline-block",children:"Imported applications are read-only"})]})}),u.jsx(hx,{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."})})]}),!Rr(i)&&!i.package&&d&&u.jsxs(xe,{variant:"default",className:"rounded-none",onClick:C,disabled:j||o,title:"Save",children:[u.jsx(To,{className:"pointer-events-none"}),u.jsxs("span",{className:"hidden lg:inline-block pointer-events-none",children:[u.jsx("u",{children:"S"}),"ave"]})]}),!Rr(i)&&!i.package&&d&&u.jsxs(xe,{variant:"ghost",className:"rounded-none",onClick:y,disabled:!j||o,title:"Rename",children:[u.jsx(B4,{className:"pointer-events-none"}),u.jsxs("span",{className:"hidden lg:inline-block pointer-events-none",children:[u.jsx("u",{children:"R"}),"ename"]})]}),!i.package&&d&&u.jsxs(xe,{variant:"ghost",className:"rounded-none",onClick:m,title:"New File",children:[u.jsx(kte,{className:"pointer-events-none"}),u.jsxs("span",{className:"pointer-events-none hidden lg:inline-block",children:[u.jsx("u",{children:"N"}),"ew",u.jsx("span",{className:"hidden lg:inline-block",children:" File"})]})]}),!i.package&&d&&u.jsxs(xe,{variant:"ghost",className:"rounded-none",onClick:h,title:"Add Directory",children:[u.jsx(jte,{className:"pointer-events-none"}),u.jsxs("span",{className:"pointer-events-none hidden lg:inline-block",children:[u.jsx("u",{children:"A"}),"dd",u.jsx("span",{className:"hidden xl:inline-block",children:" Directory"})]})]}),i.path.endsWith(".graphql")&&d&&u.jsxs(xe,{variant:"ghost",className:"rounded-none",onClick:E,title:"New Table",children:[u.jsx(Qr,{className:"pointer-events-none"}),u.jsxs("span",{className:"hidden lg:inline-block pointer-events-none",children:[u.jsx("span",{className:"hidden xl:inline-block",children:"New"})," Table"]})]}),i.project&&u.jsxs(xe,{variant:"ghost",className:"rounded-none",onClick:v,title:"Download Application",children:[u.jsx(z4,{className:"pointer-events-none"}),u.jsxs("span",{className:"hidden lg:inline-block pointer-events-none",children:["Download",u.jsx("span",{className:"hidden 2xl:inline-block",children:" Application"})]})]}),!!i.package&&d&&!a&&u.jsxs(xe,{variant:"ghost",className:"rounded-none",onClick:S,title:"Redeploy Package",children:[u.jsx(uE,{className:"pointer-events-none"}),u.jsxs("span",{className:"pointer-events-none",children:["Redeploy ",u.jsx("u",{children:"P"}),"ackage"]})]}),u.jsx("div",{className:"grow"}),d&&u.jsx($7,{targetNoun:f,instanceClient:n.instanceClient,operation:"restart_service",variant:"ghost",className:"rounded-none mx-0 md:mx-0",disabled:!j||o}),!Rr(i)&&!i.package&&d&&u.jsxs(xe,{variant:"ghost",className:"rounded-none",onClick:k,disabled:j||o,title:"Revert Changes",children:[u.jsx(Ane,{className:"pointer-events-none"}),u.jsxs("span",{className:"hidden xl:inline-block pointer-events-none",children:["Revert ",u.jsx("span",{className:"hidden 2xl:inline-block",children:"Changes"})]})]}),!a&&d&&u.jsxs(xe,{variant:"destructiveGhost",className:"rounded-none",onClick:x,title:"Delete",children:[u.jsx(Ca,{className:"pointer-events-none"}),u.jsxs("span",{className:"hidden xl:inline-block pointer-events-none",children:[u.jsx("u",{children:"D"}),"elete"]})]})]})]})}function Rje(e){return b.useCallback((t,n,r)=>{if(n!=="href")return t;if(t.startsWith("http"))return r.properties.target="_blank",t;{const i=bq().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 Ije(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Tje=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Nje=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Aje={};function rM(e,t){return(Aje.jsx?Nje:Tje).test(e)}const Oje=/[ \t\n\f\r]/g;function $je(e){return typeof e=="object"?e.type==="text"?iM(e.value):!1:iM(e)}function iM(e){return e.replace(Oje,"")===""}class Hh{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Hh.prototype.normal={};Hh.prototype.property={};Hh.prototype.space=void 0;function D7(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Hh(n,r,t)}function jk(e){return e.toLowerCase()}class Ri{constructor(t,n){this.attribute=n,this.property=t}}Ri.prototype.attribute="";Ri.prototype.booleanish=!1;Ri.prototype.boolean=!1;Ri.prototype.commaOrSpaceSeparated=!1;Ri.prototype.commaSeparated=!1;Ri.prototype.defined=!1;Ri.prototype.mustUseProperty=!1;Ri.prototype.number=!1;Ri.prototype.overloadedBoolean=!1;Ri.prototype.property="";Ri.prototype.spaceSeparated=!1;Ri.prototype.space=void 0;let Dje=0;const bt=uu(),tr=uu(),Rk=uu(),Re=uu(),xn=uu(),Rd=uu(),Pi=uu();function uu(){return 2**++Dje}const Ik=Object.freeze(Object.defineProperty({__proto__:null,boolean:bt,booleanish:tr,commaOrSpaceSeparated:Pi,commaSeparated:Rd,number:Re,overloadedBoolean:Rk,spaceSeparated:xn},Symbol.toStringTag,{value:"Module"})),N1=Object.keys(Ik);class LI extends Ri{constructor(t,n,r,i){let o=-1;if(super(t,n),oM(this,"space",i),typeof r=="number")for(;++o<N1.length;){const a=N1[o];oM(this,N1[o],(r&Ik[a])===Ik[a])}}}LI.prototype.defined=!0;function oM(e,t,n){n&&(e[t]=n)}function Nf(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new LI(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[jk(r)]=r,n[jk(o.attribute)]=r}return new Hh(t,n,e.space)}const P7=Nf({properties:{ariaActiveDescendant:null,ariaAtomic:tr,ariaAutoComplete:null,ariaBusy:tr,ariaChecked:tr,ariaColCount:Re,ariaColIndex:Re,ariaColSpan:Re,ariaControls:xn,ariaCurrent:null,ariaDescribedBy:xn,ariaDetails:null,ariaDisabled:tr,ariaDropEffect:xn,ariaErrorMessage:null,ariaExpanded:tr,ariaFlowTo:xn,ariaGrabbed:tr,ariaHasPopup:null,ariaHidden:tr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xn,ariaLevel:Re,ariaLive:null,ariaModal:tr,ariaMultiLine:tr,ariaMultiSelectable:tr,ariaOrientation:null,ariaOwns:xn,ariaPlaceholder:null,ariaPosInSet:Re,ariaPressed:tr,ariaReadOnly:tr,ariaRelevant:null,ariaRequired:tr,ariaRoleDescription:xn,ariaRowCount:Re,ariaRowIndex:Re,ariaRowSpan:Re,ariaSelected:tr,ariaSetSize:Re,ariaSort:null,ariaValueMax:Re,ariaValueMin:Re,ariaValueNow:Re,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function M7(e,t){return t in e?e[t]:t}function z7(e,t){return M7(e,t.toLowerCase())}const Pje=Nf({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Rd,acceptCharset:xn,accessKey:xn,action:null,allow:null,allowFullScreen:bt,allowPaymentRequest:bt,allowUserMedia:bt,alt:null,as:null,async:bt,autoCapitalize:null,autoComplete:xn,autoFocus:bt,autoPlay:bt,blocking:xn,capture:null,charSet:null,checked:bt,cite:null,className:xn,cols:Re,colSpan:null,content:null,contentEditable:tr,controls:bt,controlsList:xn,coords:Re|Rd,crossOrigin:null,data:null,dateTime:null,decoding:null,default:bt,defer:bt,dir:null,dirName:null,disabled:bt,download:Rk,draggable:tr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:bt,formTarget:null,headers:xn,height:Re,hidden:Rk,high:Re,href:null,hrefLang:null,htmlFor:xn,httpEquiv:xn,id:null,imageSizes:null,imageSrcSet:null,inert:bt,inputMode:null,integrity:null,is:null,isMap:bt,itemId:null,itemProp:xn,itemRef:xn,itemScope:bt,itemType:xn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:bt,low:Re,manifest:null,max:null,maxLength:Re,media:null,method:null,min:null,minLength:Re,multiple:bt,muted:bt,name:null,nonce:null,noModule:bt,noValidate:bt,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:bt,optimum:Re,pattern:null,ping:xn,placeholder:null,playsInline:bt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:bt,referrerPolicy:null,rel:xn,required:bt,reversed:bt,rows:Re,rowSpan:Re,sandbox:xn,scope:null,scoped:bt,seamless:bt,selected:bt,shadowRootClonable:bt,shadowRootDelegatesFocus:bt,shadowRootMode:null,shape:null,size:Re,sizes:null,slot:null,span:Re,spellCheck:tr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Re,step:null,style:null,tabIndex:Re,target:null,title:null,translate:null,type:null,typeMustMatch:bt,useMap:null,value:tr,width:Re,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:xn,axis:null,background:null,bgColor:null,border:Re,borderColor:null,bottomMargin:Re,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:bt,declare:bt,event:null,face:null,frame:null,frameBorder:null,hSpace:Re,leftMargin:Re,link:null,longDesc:null,lowSrc:null,marginHeight:Re,marginWidth:Re,noResize:bt,noHref:bt,noShade:bt,noWrap:bt,object:null,profile:null,prompt:null,rev:null,rightMargin:Re,rules:null,scheme:null,scrolling:tr,standby:null,summary:null,text:null,topMargin:Re,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Re,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:bt,disableRemotePlayback:bt,prefix:null,property:null,results:Re,security:null,unselectable:null},space:"html",transform:z7}),Mje=Nf({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:Pi,accentHeight:Re,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Re,amplitude:Re,arabicForm:null,ascent:Re,attributeName:null,attributeType:null,azimuth:Re,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Re,by:null,calcMode:null,capHeight:Re,className:xn,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:Re,diffuseConstant:Re,direction:null,display:null,dur:null,divisor:Re,dominantBaseline:null,download:bt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Re,enableBackground:null,end:null,event:null,exponent:Re,externalResourcesRequired:null,fill:null,fillOpacity:Re,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:Rd,g2:Rd,glyphName:Rd,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Re,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Re,horizOriginX:Re,horizOriginY:Re,id:null,ideographic:Re,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Re,k:Re,k1:Re,k2:Re,k3:Re,k4:Re,kernelMatrix:Pi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Re,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:Re,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:Re,overlineThickness:Re,paintOrder:null,panose1:null,path:null,pathLength:Re,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:xn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Re,pointsAtY:Re,pointsAtZ:Re,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Pi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Pi,rev:Pi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Pi,requiredFeatures:Pi,requiredFonts:Pi,requiredFormats:Pi,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:Re,specularExponent:Re,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Re,strikethroughThickness:Re,string:null,stroke:null,strokeDashArray:Pi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Re,strokeOpacity:Re,strokeWidth:null,style:null,surfaceScale:Re,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Pi,tabIndex:Re,tableValues:null,target:null,targetX:Re,targetY:Re,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Pi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Re,underlineThickness:Re,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Re,values:null,vAlphabetic:Re,vMathematical:Re,vectorEffect:null,vHanging:Re,vIdeographic:Re,version:null,vertAdvY:Re,vertOriginX:Re,vertOriginY:Re,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Re,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:M7}),L7=Nf({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()}}),F7=Nf({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:z7}),U7=Nf({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),zje={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"},Lje=/[A-Z]/g,aM=/-[a-z]/g,Fje=/^data[-\w.:]+$/i;function Uje(e,t){const n=jk(t);let r=t,i=Ri;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Fje.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(aM,Bje);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!aM.test(o)){let a=o.replace(Lje,Vje);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=LI}return new i(r,t)}function Vje(e){return"-"+e.toLowerCase()}function Bje(e){return e.charAt(1).toUpperCase()}const Hje=D7([P7,Pje,L7,F7,U7],"html"),FI=D7([P7,Mje,L7,F7,U7],"svg");function qje(e){return e.join(" ").trim()}var sd={},A1,sM;function Kje(){if(sM)return A1;sM=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,l=/^\s+|\s+$/g,d=`
177
- `,f="/",m="*",h="",v="comment",y="declaration";A1=function(S,C){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];C=C||{};var k=1,E=1;function j(q){var V=q.match(t);V&&(k+=V.length);var H=q.lastIndexOf(d);E=~H?q.length-H:E+q.length}function R(){var q={line:k,column:E};return function(V){return V.position=new N(q),D(),V}}function N(q){this.start=q,this.end={line:k,column:E},this.source=C.source}N.prototype.content=S;function T(q){var V=new Error(C.source+":"+k+":"+E+": "+q);if(V.reason=q,V.filename=C.source,V.line=k,V.column=E,V.source=S,!C.silent)throw V}function A(q){var V=q.exec(S);if(V){var H=V[0];return j(H),S=S.slice(H.length),V}}function D(){A(n)}function F(q){var V;for(q=q||[];V=K();)V!==!1&&q.push(V);return q}function K(){var q=R();if(!(f!=S.charAt(0)||m!=S.charAt(1))){for(var V=2;h!=S.charAt(V)&&(m!=S.charAt(V)||f!=S.charAt(V+1));)++V;if(V+=2,h===S.charAt(V-1))return T("End of comment missing");var H=S.slice(2,V-2);return E+=2,j(H),S=S.slice(V),E+=2,q({type:v,comment:H})}}function te(){var q=R(),V=A(r);if(V){if(K(),!A(i))return T("property missing ':'");var H=A(o),z=q({type:y,property:x(V[0].replace(e,h)),value:H?x(H[0].replace(e,h)):h});return A(a),z}}function G(){var q=[];F(q);for(var V;V=te();)V!==!1&&(q.push(V),F(q));return q}return D(),G()};function x(S){return S?S.replace(l,h):h}return A1}var lM;function Gje(){if(lM)return sd;lM=1;var e=sd&&sd.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(sd,"__esModule",{value:!0}),sd.default=n;const t=e(Kje());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const a=(0,t.default)(r),l=typeof i=="function";return a.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:m}=d;l?i(f,m,d):m&&(o=o||{},o[f]=m)}),o}return sd}var Bp={},cM;function Zje(){if(cM)return Bp;cM=1,Object.defineProperty(Bp,"__esModule",{value:!0}),Bp.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,m){return m.toUpperCase()},l=function(f,m){return"".concat(m,"-")},d=function(f,m){return m===void 0&&(m={}),o(f)?f:(f=f.toLowerCase(),m.reactCompat?f=f.replace(i,l):f=f.replace(r,l),f.replace(t,a))};return Bp.camelCase=d,Bp}var Hp,uM;function Yje(){if(uM)return Hp;uM=1;var e=Hp&&Hp.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Gje()),n=Zje();function r(i,o){var a={};return!i||typeof i!="string"||(0,t.default)(i,function(l,d){l&&d&&(a[(0,n.camelCase)(l,o)]=d)}),a}return r.default=r,Hp=r,Hp}var Wje=Yje();const Xje=rf(Wje),V7=B7("end"),UI=B7("start");function B7(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 Jje(e){const t=UI(e),n=V7(e);if(t&&n)return{start:t,end:n}}function dm(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?dM(e.position):"start"in e||"end"in e?dM(e):"line"in e||"column"in e?Tk(e):""}function Tk(e){return fM(e&&e.line)+":"+fM(e&&e.column)}function dM(e){return Tk(e&&e.start)+"-"+Tk(e&&e.end)}function fM(e){return e&&typeof e=="number"?e:1}class Ur 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 l=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=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=dm(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}}Ur.prototype.file="";Ur.prototype.name="";Ur.prototype.reason="";Ur.prototype.message="";Ur.prototype.stack="";Ur.prototype.column=void 0;Ur.prototype.line=void 0;Ur.prototype.ancestors=void 0;Ur.prototype.cause=void 0;Ur.prototype.fatal=void 0;Ur.prototype.place=void 0;Ur.prototype.ruleId=void 0;Ur.prototype.source=void 0;const VI={}.hasOwnProperty,Qje=new Map,eRe=/[A-Z]/g,tRe=new Set(["table","tbody","thead","tfoot","tr"]),nRe=new Set(["td","th"]),H7="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function rRe(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=dRe(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=uRe(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"?FI:Hje,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=q7(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function q7(e,t,n){if(t.type==="element")return iRe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return oRe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return sRe(e,t,n);if(t.type==="mdxjsEsm")return aRe(e,t);if(t.type==="root")return lRe(e,t,n);if(t.type==="text")return cRe(e,t)}function iRe(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=FI,e.schema=i),e.ancestors.push(t);const o=G7(e,t.tagName,!1),a=fRe(e,t);let l=HI(e,t);return tRe.has(t.tagName)&&(l=l.filter(function(d){return typeof d=="string"?!$je(d):!0})),K7(e,a,o,t),BI(a,l),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function oRe(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)}Mm(e,t.position)}function aRe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Mm(e,t.position)}function sRe(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=FI,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:G7(e,t.name,!0),a=pRe(e,t),l=HI(e,t);return K7(e,a,o,t),BI(a,l),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function lRe(e,t,n){const r={};return BI(r,HI(e,t)),e.create(t,e.Fragment,r,n)}function cRe(e,t){return t.value}function K7(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function BI(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function uRe(e,t,n){return r;function r(i,o,a,l){const f=Array.isArray(a.children)?n:t;return l?f(o,a,l):f(o,a)}}function dRe(e,t){return n;function n(r,i,o,a){const l=Array.isArray(o.children),d=UI(r);return t(i,o,a,l,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function fRe(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&VI.call(t.properties,i)){const o=mRe(e,i,t.properties[i]);if(o){const[a,l]=o;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&nRe.has(t.tagName)?r=l:n[a]=l}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function pRe(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 l=a.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Mm(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 l=r.value.data.estree.body[0];l.type,o=e.evaluater.evaluateExpression(l.expression)}else Mm(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function HI(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Qje;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 l=q7(e,o,a);l!==void 0&&n.push(l)}return n}function mRe(e,t,n){const r=Uje(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Ije(n):qje(n)),r.property==="style"){let i=typeof n=="object"?n:hRe(e,String(n));return e.stylePropertyNameCase==="css"&&(i=gRe(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?zje[r.property]||r.property:r.attribute,n]}}function hRe(e,t){try{return Xje(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Ur("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=H7+"#cannot-parse-style-attribute",i}}function G7(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 l=rM(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:l,computed:!!(o&&l.type==="Literal"),optional:!1}:l}r=a}else r=rM(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return VI.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Mm(e)}function Mm(e,t){const n=new Ur("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=H7+"#cannot-handle-mdx-estrees-without-createevaluater",n}function gRe(e){const t={};let n;for(n in e)VI.call(e,n)&&(t[vRe(n)]=e[n]);return t}function vRe(e){let t=e.replace(eRe,yRe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function yRe(e){return"-"+e.toLowerCase()}const O1={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"]},bRe={};function xRe(e,t){const n=bRe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Z7(e,r,i)}function Z7(e,t,n){if(wRe(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 pM(e.children,t,n)}return Array.isArray(e)?pM(e,t,n):""}function pM(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Z7(e[i],t,n);return r.join("")}function wRe(e){return!!(e&&typeof e=="object")}const mM=document.createElement("i");function qI(e){const t="&"+e+";";mM.innerHTML=t;const n=mM.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function _a(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 bo(e,t){return e.length>0?(_a(e,e.length,0,t),e):t}const hM={}.hasOwnProperty;function SRe(e){const t={};let n=-1;for(;++n<e.length;)_Re(t,e[n]);return t}function _Re(e,t){let n;for(n in t){const i=(hM.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){hM.call(i,a)||(i[a]=[]);const l=o[a];CRe(i[a],Array.isArray(l)?l:l?[l]:[])}}}function CRe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);_a(e,0,0,r)}function Y7(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 Id(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ua=Bl(/[A-Za-z]/),Ui=Bl(/[\dA-Za-z]/),kRe=Bl(/[#-'*+\--9=?A-Z^-~]/);function Nk(e){return e!==null&&(e<32||e===127)}const Ak=Bl(/\d/),ERe=Bl(/[\dA-Fa-f]/),jRe=Bl(/[!-/:-@[-`{-~]/);function lt(e){return e!==null&&e<-2}function ki(e){return e!==null&&(e<0||e===32)}function Zt(e){return e===-2||e===-1||e===32}const RRe=Bl(new RegExp("\\p{P}|\\p{S}","u")),IRe=Bl(/\s/);function Bl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Af(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&&Ui(e.charCodeAt(n+1))&&Ui(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 l=e.charCodeAt(n+1);o<56320&&l>56319&&l<57344?(a=String.fromCharCode(o,l),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 Sn(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(d){return Zt(d)?(e.enter(n),l(d)):t(d)}function l(d){return Zt(d)&&o++<i?(e.consume(d),l):(e.exit(n),t(d))}}const TRe={tokenize:NRe};function NRe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Sn(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),o(l)}function o(l){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,a(l)}function a(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return lt(l)?(e.consume(l),e.exit("chunkText"),o):(e.consume(l),a)}}const ARe={tokenize:ORe},gM={tokenize:$Re};function ORe(e){const t=this,n=[];let r=0,i,o,a;return l;function l(j){if(r<n.length){const R=n[r];return t.containerState=R[1],e.attempt(R[0].continuation,d,f)(j)}return f(j)}function d(j){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&E();const R=t.events.length;let N=R,T;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){T=t.events[N][1].end;break}k(r);let A=R;for(;A<t.events.length;)t.events[A][1].end={...T},A++;return _a(t.events,N+1,0,t.events.slice(R)),t.events.length=A,f(j)}return l(j)}function f(j){if(r===n.length){if(!i)return v(j);if(i.currentConstruct&&i.currentConstruct.concrete)return x(j);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(gM,m,h)(j)}function m(j){return i&&E(),k(r),v(j)}function h(j){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,x(j)}function v(j){return t.containerState={},e.attempt(gM,y,x)(j)}function y(j){return r++,n.push([t.currentConstruct,t.containerState]),v(j)}function x(j){if(j===null){i&&E(),k(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),k(0),e.consume(j);return}return lt(j)?(e.consume(j),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(j),S)}function C(j,R){const N=t.sliceStream(j);if(R&&N.push(null),j.previous=o,o&&(o.next=j),o=j,i.defineSkip(j.start),i.write(N),t.parser.lazy[j.start.line]){let T=i.events.length;for(;T--;)if(i.events[T][1].start.offset<a&&(!i.events[T][1].end||i.events[T][1].end.offset>a))return;const A=t.events.length;let D=A,F,K;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(F){K=t.events[D][1].end;break}F=!0}for(k(r),T=A;T<t.events.length;)t.events[T][1].end={...K},T++;_a(t.events,D+1,0,t.events.slice(A)),t.events.length=T}}function k(j){let R=n.length;for(;R-- >j;){const N=n[R];t.containerState=N[1],N[0].exit.call(t,e)}n.length=j}function E(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function $Re(e,t,n){return Sn(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function vM(e){if(e===null||ki(e)||IRe(e))return 1;if(RRe(e))return 2}function KI(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 Ok={name:"attention",resolveAll:DRe,tokenize:PRe};function DRe(e,t){let n=-1,r,i,o,a,l,d,f,m;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};yM(h,-d),yM(v,d),a={type:d>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},l={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:{...l.end}},e[r][1].end={...a.start},e[n][1].start={...l.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=bo(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=bo(f,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),f=bo(f,KI(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=bo(f,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,f=bo(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,_a(e,r-1,n-r+3,f),n=r+f.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function PRe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=vM(r);let o;return a;function a(d){return o=d,e.enter("attentionSequence"),l(d)}function l(d){if(d===o)return e.consume(d),l;const f=e.exit("attentionSequence"),m=vM(d),h=!m||m===2&&i||n.includes(d),v=!i||i===2&&m||n.includes(r);return f._open=!!(o===42?h:h&&(i||!v)),f._close=!!(o===42?v:v&&(m||!h)),t(d)}}function yM(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const MRe={name:"autolink",tokenize:zRe};function zRe(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 ua(y)?(e.consume(y),a):y===64?n(y):f(y)}function a(y){return y===43||y===45||y===46||Ui(y)?(r=1,l(y)):f(y)}function l(y){return y===58?(e.consume(y),r=0,d):(y===43||y===45||y===46||Ui(y))&&r++<32?(e.consume(y),l):(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||Nk(y)?n(y):(e.consume(y),d)}function f(y){return y===64?(e.consume(y),m):kRe(y)?(e.consume(y),f):n(y)}function m(y){return Ui(y)?h(y):n(y)}function h(y){return y===46?(e.consume(y),r=0,m):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||Ui(y))&&r++<63){const x=y===45?v:h;return e.consume(y),x}return n(y)}}const V0={partial:!0,tokenize:LRe};function LRe(e,t,n){return r;function r(o){return Zt(o)?Sn(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||lt(o)?t(o):n(o)}}const W7={continuation:{tokenize:URe},exit:VRe,name:"blockQuote",tokenize:FRe};function FRe(e,t,n){const r=this;return i;function i(a){if(a===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return n(a)}function o(a){return Zt(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function URe(e,t,n){const r=this;return i;function i(a){return Zt(a)?Sn(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(W7,t,n)(a)}}function VRe(e){e.exit("blockQuote")}const X7={name:"characterEscape",tokenize:BRe};function BRe(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 jRe(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const J7={name:"characterReference",tokenize:HRe};function HRe(e,t,n){const r=this;let i=0,o,a;return l;function l(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=Ui,m(h))}function f(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=ERe,m):(e.enter("characterReferenceValue"),o=7,a=Ak,m(h))}function m(h){if(h===59&&i){const v=e.exit("characterReferenceValue");return a===Ui&&!qI(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),m):n(h)}}const bM={partial:!0,tokenize:KRe},xM={concrete:!0,name:"codeFenced",tokenize:qRe};function qRe(e,t,n){const r=this,i={partial:!0,tokenize:N};let o=0,a=0,l;return d;function d(T){return f(T)}function f(T){const A=r.events[r.events.length-1];return o=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,l=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(T)}function m(T){return T===l?(a++,e.consume(T),m):a<3?n(T):(e.exit("codeFencedFenceSequence"),Zt(T)?Sn(e,h,"whitespace")(T):h(T))}function h(T){return T===null||lt(T)?(e.exit("codeFencedFence"),r.interrupt?t(T):e.check(bM,S,R)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(T))}function v(T){return T===null||lt(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(T)):Zt(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Sn(e,y,"whitespace")(T)):T===96&&T===l?n(T):(e.consume(T),v)}function y(T){return T===null||lt(T)?h(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(T))}function x(T){return T===null||lt(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(T)):T===96&&T===l?n(T):(e.consume(T),x)}function S(T){return e.attempt(i,R,C)(T)}function C(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),k}function k(T){return o>0&&Zt(T)?Sn(e,E,"linePrefix",o+1)(T):E(T)}function E(T){return T===null||lt(T)?e.check(bM,S,R)(T):(e.enter("codeFlowValue"),j(T))}function j(T){return T===null||lt(T)?(e.exit("codeFlowValue"),E(T)):(e.consume(T),j)}function R(T){return e.exit("codeFenced"),t(T)}function N(T,A,D){let F=0;return K;function K(H){return T.enter("lineEnding"),T.consume(H),T.exit("lineEnding"),te}function te(H){return T.enter("codeFencedFence"),Zt(H)?Sn(T,G,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):G(H)}function G(H){return H===l?(T.enter("codeFencedFenceSequence"),q(H)):D(H)}function q(H){return H===l?(F++,T.consume(H),q):F>=a?(T.exit("codeFencedFenceSequence"),Zt(H)?Sn(T,V,"whitespace")(H):V(H)):D(H)}function V(H){return H===null||lt(H)?(T.exit("codeFencedFence"),A(H)):D(H)}}}function KRe(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 $1={name:"codeIndented",tokenize:ZRe},GRe={partial:!0,tokenize:YRe};function ZRe(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),Sn(e,o,"linePrefix",5)(f)}function o(f){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?a(f):n(f)}function a(f){return f===null?d(f):lt(f)?e.attempt(GRe,a,d)(f):(e.enter("codeFlowValue"),l(f))}function l(f){return f===null||lt(f)?(e.exit("codeFlowValue"),a(f)):(e.consume(f),l)}function d(f){return e.exit("codeIndented"),t(f)}}function YRe(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):lt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Sn(e,o,"linePrefix",5)(a)}function o(a){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):lt(a)?i(a):n(a)}}const WRe={name:"codeText",previous:JRe,resolve:XRe,tokenize:QRe};function XRe(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 JRe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function QRe(e,t,n){let r=0,i,o;return a;function a(h){return e.enter("codeText"),e.enter("codeTextSequence"),l(h)}function l(h){return h===96?(e.consume(h),r++,l):(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,m(h)):lt(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||lt(h)?(e.exit("codeTextData"),d(h)):(e.consume(h),f)}function m(h){return h===96?(e.consume(h),i++,m):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(o.type="codeTextData",f(h))}}class eIe{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&&qp(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),qp(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),qp(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);qp(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);qp(this.left,n.reverse())}}}function qp(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 Q7(e){const t={};let n=-1,r,i,o,a,l,d,f;const m=new eIe(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.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,tIe(m,n)),n=t[n],f=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(a=m.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(m.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={...m.get(i)[1].start},l=m.slice(i,n),l.unshift(r),m.splice(i,n-i+1,l))}}return _a(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!f}function tIe(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 l=a.events,d=[],f={};let m,h,v=-1,y=n,x=0,S=0;const C=[S];for(;y;){for(;e.get(++i)[1]!==y;);o.push(i),y._tokenizer||(m=r.sliceStream(y),y.next||m.push(null),h&&a.defineSkip(y.start),y._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(m),y._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=y,y=y.next}for(y=n;++v<l.length;)l[v][0]==="exit"&&l[v-1][0]==="enter"&&l[v][1].type===l[v-1][1].type&&l[v][1].start.line!==l[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 k=l.slice(C[v],C[v+1]),E=o.pop();d.push([E,E+k.length-1]),e.splice(E,2,k)}for(d.reverse(),v=-1;++v<d.length;)f[x+d[v][0]]=x+d[v][1],x+=d[v][1]-d[v][0]-1;return f}const nIe={resolve:iIe,tokenize:oIe},rIe={partial:!0,tokenize:aIe};function iIe(e){return Q7(e),e}function oIe(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?o(l):lt(l)?e.check(rIe,a,o)(l):(e.consume(l),i)}function o(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function a(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function aIe(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Sn(e,o,"linePrefix")}function o(a){if(a===null||lt(a))return n(a);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function eK(e,t,n,r,i,o,a,l,d){const f=d||Number.POSITIVE_INFINITY;let m=0;return h;function h(k){return k===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(k),e.exit(o),v):k===null||k===32||k===41||Nk(k)?n(k):(e.enter(r),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),S(k))}function v(k){return k===62?(e.enter(o),e.consume(k),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),y(k))}function y(k){return k===62?(e.exit("chunkString"),e.exit(l),v(k)):k===null||k===60||lt(k)?n(k):(e.consume(k),k===92?x:y)}function x(k){return k===60||k===62||k===92?(e.consume(k),y):y(k)}function S(k){return!m&&(k===null||k===41||ki(k))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(r),t(k)):m<f&&k===40?(e.consume(k),m++,S):k===41?(e.consume(k),m--,S):k===null||k===32||k===40||Nk(k)?n(k):(e.consume(k),k===92?C:S)}function C(k){return k===40||k===41||k===92?(e.consume(k),S):S(k)}}function tK(e,t,n,r,i,o){const a=this;let l=0,d;return f;function f(y){return e.enter(r),e.enter(i),e.consume(y),e.exit(i),e.enter(o),m}function m(y){return l>999||y===null||y===91||y===93&&!d||y===94&&!l&&"_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):lt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===null||y===91||y===93||lt(y)||l++>999?(e.exit("chunkString"),m(y)):(e.consume(y),d||(d=!Zt(y)),y===92?v:h)}function v(y){return y===91||y===92||y===93?(e.consume(y),l++,h):h(y)}}function nK(e,t,n,r,i,o){let a;return l;function l(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):lt(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),Sn(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===a||v===null||lt(v)?(e.exit("chunkString"),f(v)):(e.consume(v),v===92?h:m)}function h(v){return v===a||v===92?(e.consume(v),m):m(v)}}function fm(e,t){let n;return r;function r(i){return lt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Zt(i)?Sn(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const sIe={name:"definition",tokenize:cIe},lIe={partial:!0,tokenize:uIe};function cIe(e,t,n){const r=this;let i;return o;function o(y){return e.enter("definition"),a(y)}function a(y){return tK.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function l(y){return i=Id(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 ki(y)?fm(e,f)(y):f(y)}function f(y){return eK(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function m(y){return e.attempt(lIe,h,h)(y)}function h(y){return Zt(y)?Sn(e,v,"whitespace")(y):v(y)}function v(y){return y===null||lt(y)?(e.exit("definition"),r.parser.defined.push(i),t(y)):n(y)}}function uIe(e,t,n){return r;function r(l){return ki(l)?fm(e,i)(l):n(l)}function i(l){return nK(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return Zt(l)?Sn(e,a,"whitespace")(l):a(l)}function a(l){return l===null||lt(l)?t(l):n(l)}}const dIe={name:"hardBreakEscape",tokenize:fIe};function fIe(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return lt(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const pIe={name:"headingAtx",resolve:mIe,tokenize:hIe};function mIe(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"},_a(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function hIe(e,t,n){let r=0;return i;function i(m){return e.enter("atxHeading"),o(m)}function o(m){return e.enter("atxHeadingSequence"),a(m)}function a(m){return m===35&&r++<6?(e.consume(m),a):m===null||ki(m)?(e.exit("atxHeadingSequence"),l(m)):n(m)}function l(m){return m===35?(e.enter("atxHeadingSequence"),d(m)):m===null||lt(m)?(e.exit("atxHeading"),t(m)):Zt(m)?Sn(e,l,"whitespace")(m):(e.enter("atxHeadingText"),f(m))}function d(m){return m===35?(e.consume(m),d):(e.exit("atxHeadingSequence"),l(m))}function f(m){return m===null||m===35||ki(m)?(e.exit("atxHeadingText"),l(m)):(e.consume(m),f)}}const gIe=["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"],wM=["pre","script","style","textarea"],vIe={concrete:!0,name:"htmlFlow",resolveTo:xIe,tokenize:wIe},yIe={partial:!0,tokenize:_Ie},bIe={partial:!0,tokenize:SIe};function xIe(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 wIe(e,t,n){const r=this;let i,o,a,l,d;return f;function f(O){return m(O)}function m(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:$):ua(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,l=0,x):ua(O)?(e.consume(O),i=4,r.interrupt?t:$):n(O)}function y(O){return O===45?(e.consume(O),r.interrupt?t:$):n(O)}function x(O){const J="CDATA[";return O===J.charCodeAt(l++)?(e.consume(O),l===J.length?r.interrupt?t:G:x):n(O)}function S(O){return ua(O)?(e.consume(O),a=String.fromCharCode(O),C):n(O)}function C(O){if(O===null||O===47||O===62||ki(O)){const J=O===47,pe=a.toLowerCase();return!J&&!o&&wM.includes(pe)?(i=1,r.interrupt?t(O):G(O)):gIe.includes(a.toLowerCase())?(i=6,J?(e.consume(O),k):r.interrupt?t(O):G(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):o?E(O):j(O))}return O===45||Ui(O)?(e.consume(O),a+=String.fromCharCode(O),C):n(O)}function k(O){return O===62?(e.consume(O),r.interrupt?t:G):n(O)}function E(O){return Zt(O)?(e.consume(O),E):K(O)}function j(O){return O===47?(e.consume(O),K):O===58||O===95||ua(O)?(e.consume(O),R):Zt(O)?(e.consume(O),j):K(O)}function R(O){return O===45||O===46||O===58||O===95||Ui(O)?(e.consume(O),R):N(O)}function N(O){return O===61?(e.consume(O),T):Zt(O)?(e.consume(O),N):j(O)}function T(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),d=O,A):Zt(O)?(e.consume(O),T):D(O)}function A(O){return O===d?(e.consume(O),d=null,F):O===null||lt(O)?n(O):(e.consume(O),A)}function D(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||ki(O)?N(O):(e.consume(O),D)}function F(O){return O===47||O===62||Zt(O)?j(O):n(O)}function K(O){return O===62?(e.consume(O),te):n(O)}function te(O){return O===null||lt(O)?G(O):Zt(O)?(e.consume(O),te):n(O)}function G(O){return O===45&&i===2?(e.consume(O),z):O===60&&i===1?(e.consume(O),W):O===62&&i===4?(e.consume(O),P):O===63&&i===3?(e.consume(O),$):O===93&&i===5?(e.consume(O),ne):lt(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(yIe,U,q)(O)):O===null||lt(O)?(e.exit("htmlFlowData"),q(O)):(e.consume(O),G)}function q(O){return e.check(bIe,V,U)(O)}function V(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),H}function H(O){return O===null||lt(O)?q(O):(e.enter("htmlFlowData"),G(O))}function z(O){return O===45?(e.consume(O),$):G(O)}function W(O){return O===47?(e.consume(O),a="",L):G(O)}function L(O){if(O===62){const J=a.toLowerCase();return wM.includes(J)?(e.consume(O),P):G(O)}return ua(O)&&a.length<8?(e.consume(O),a+=String.fromCharCode(O),L):G(O)}function ne(O){return O===93?(e.consume(O),$):G(O)}function $(O){return O===62?(e.consume(O),P):O===45&&i===2?(e.consume(O),$):G(O)}function P(O){return O===null||lt(O)?(e.exit("htmlFlowData"),U(O)):(e.consume(O),P)}function U(O){return e.exit("htmlFlow"),t(O)}}function SIe(e,t,n){const r=this;return i;function i(a){return lt(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 _Ie(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(V0,t,n)}}const CIe={name:"htmlText",tokenize:kIe};function kIe(e,t,n){const r=this;let i,o,a;return l;function l($){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume($),d}function d($){return $===33?(e.consume($),f):$===47?(e.consume($),N):$===63?(e.consume($),j):ua($)?(e.consume($),D):n($)}function f($){return $===45?(e.consume($),m):$===91?(e.consume($),o=0,x):ua($)?(e.consume($),E):n($)}function m($){return $===45?(e.consume($),y):n($)}function h($){return $===null?n($):$===45?(e.consume($),v):lt($)?(a=h,W($)):(e.consume($),h)}function v($){return $===45?(e.consume($),y):h($)}function y($){return $===62?z($):$===45?v($):h($)}function x($){const P="CDATA[";return $===P.charCodeAt(o++)?(e.consume($),o===P.length?S:x):n($)}function S($){return $===null?n($):$===93?(e.consume($),C):lt($)?(a=S,W($)):(e.consume($),S)}function C($){return $===93?(e.consume($),k):S($)}function k($){return $===62?z($):$===93?(e.consume($),k):S($)}function E($){return $===null||$===62?z($):lt($)?(a=E,W($)):(e.consume($),E)}function j($){return $===null?n($):$===63?(e.consume($),R):lt($)?(a=j,W($)):(e.consume($),j)}function R($){return $===62?z($):j($)}function N($){return ua($)?(e.consume($),T):n($)}function T($){return $===45||Ui($)?(e.consume($),T):A($)}function A($){return lt($)?(a=A,W($)):Zt($)?(e.consume($),A):z($)}function D($){return $===45||Ui($)?(e.consume($),D):$===47||$===62||ki($)?F($):n($)}function F($){return $===47?(e.consume($),z):$===58||$===95||ua($)?(e.consume($),K):lt($)?(a=F,W($)):Zt($)?(e.consume($),F):z($)}function K($){return $===45||$===46||$===58||$===95||Ui($)?(e.consume($),K):te($)}function te($){return $===61?(e.consume($),G):lt($)?(a=te,W($)):Zt($)?(e.consume($),te):F($)}function G($){return $===null||$===60||$===61||$===62||$===96?n($):$===34||$===39?(e.consume($),i=$,q):lt($)?(a=G,W($)):Zt($)?(e.consume($),G):(e.consume($),V)}function q($){return $===i?(e.consume($),i=void 0,H):$===null?n($):lt($)?(a=q,W($)):(e.consume($),q)}function V($){return $===null||$===34||$===39||$===60||$===61||$===96?n($):$===47||$===62||ki($)?F($):(e.consume($),V)}function H($){return $===47||$===62||ki($)?F($):n($)}function z($){return $===62?(e.consume($),e.exit("htmlTextData"),e.exit("htmlText"),t):n($)}function W($){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),L}function L($){return Zt($)?Sn(e,ne,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):ne($)}function ne($){return e.enter("htmlTextData"),a($)}}const GI={name:"labelEnd",resolveAll:IIe,resolveTo:TIe,tokenize:NIe},EIe={tokenize:AIe},jIe={tokenize:OIe},RIe={tokenize:$Ie};function IIe(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&&_a(e,0,e.length,n),e}function TIe(e,t){let n=e.length,r=0,i,o,a,l;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}},m={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return l=[["enter",d,t],["enter",f,t]],l=bo(l,e.slice(o+1,o+r+3)),l=bo(l,[["enter",m,t]]),l=bo(l,KI(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),l=bo(l,[["exit",m,t],e[a-2],e[a-1],["exit",f,t]]),l=bo(l,e.slice(a+1)),l=bo(l,[["exit",d,t]]),_a(e,o,e.length,l),e}function NIe(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 l;function l(v){return o?o._inactive?h(v):(a=r.parser.defined.includes(Id(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(EIe,m,a?m:h)(v):v===91?e.attempt(jIe,m,a?f:h)(v):a?m(v):h(v)}function f(v){return e.attempt(RIe,m,h)(v)}function m(v){return t(v)}function h(v){return o._balanced=!0,n(v)}}function AIe(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 ki(h)?fm(e,o)(h):o(h)}function o(h){return h===41?m(h):eK(e,a,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return ki(h)?fm(e,d)(h):m(h)}function l(h){return n(h)}function d(h){return h===34||h===39||h===40?nK(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):m(h)}function f(h){return ki(h)?fm(e,m)(h):m(h)}function m(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function OIe(e,t,n){const r=this;return i;function i(l){return tK.call(r,e,o,a,"reference","referenceMarker","referenceString")(l)}function o(l){return r.parser.defined.includes(Id(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function a(l){return n(l)}}function $Ie(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 DIe={name:"labelStartImage",resolveAll:GI.resolveAll,tokenize:PIe};function PIe(e,t,n){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),o}function o(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),a):n(l)}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const MIe={name:"labelStartLink",resolveAll:GI.resolveAll,tokenize:zIe};function zIe(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 D1={name:"lineEnding",tokenize:LIe};function LIe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Sn(e,t,"linePrefix")}}const py={name:"thematicBreak",tokenize:FIe};function FIe(e,t,n){let r=0,i;return o;function o(f){return e.enter("thematicBreak"),a(f)}function a(f){return i=f,l(f)}function l(f){return f===i?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||lt(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===i?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),Zt(f)?Sn(e,l,"whitespace")(f):l(f))}}const hi={continuation:{tokenize:HIe},exit:KIe,name:"list",tokenize:BIe},UIe={partial:!0,tokenize:GIe},VIe={partial:!0,tokenize:qIe};function BIe(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 l;function l(y){const x=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:Ak(y)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(py,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 Ak(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(V0,r.interrupt?n:m,e.attempt(UIe,v,h))}function m(y){return r.containerState.initialBlankLine=!0,o++,v(y)}function h(y){return Zt(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 HIe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(V0,i,o);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Sn(e,t,"listItemIndent",r.containerState.size+1)(l)}function o(l){return r.containerState.furtherBlankLines||!Zt(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(VIe,t,a)(l))}function a(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Sn(e,e.attempt(hi,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function qIe(e,t,n){const r=this;return Sn(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 KIe(e){e.exit(this.containerState.type)}function GIe(e,t,n){const r=this;return Sn(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!Zt(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const SM={name:"setextUnderline",resolveTo:ZIe,tokenize:YIe};function ZIe(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 YIe(e,t,n){const r=this;let i;return o;function o(f){let m=r.events.length,h;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){h=r.events[m][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"),l(f)}function l(f){return f===i?(e.consume(f),l):(e.exit("setextHeadingLineSequence"),Zt(f)?Sn(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||lt(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const WIe={tokenize:XIe};function XIe(e){const t=this,n=e.attempt(V0,r,e.attempt(this.parser.constructs.flowInitial,i,Sn(e,e.attempt(this.parser.constructs.flow,i,e.attempt(nIe,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 JIe={resolveAll:iK()},QIe=rK("string"),eTe=rK("text");function rK(e){return{resolveAll:iK(e==="text"?tTe:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,l);return a;function a(m){return f(m)?o(m):l(m)}function l(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),d}function d(m){return f(m)?(n.exit("data"),o(m)):(n.consume(m),d)}function f(m){if(m===null)return!0;const h=i[m];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 iK(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 tTe(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,l=0,d;for(;o--;){const f=i[o];if(typeof f=="string"){for(a=f.length;f.charCodeAt(a-1)===32;)l++,a--;if(a)break;a=-1}else if(f===-2)d=!0,l++;else if(f!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const f={type:n===e.length||d||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},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 nTe={42:hi,43:hi,45:hi,48:hi,49:hi,50:hi,51:hi,52:hi,53:hi,54:hi,55:hi,56:hi,57:hi,62:W7},rTe={91:sIe},iTe={[-2]:$1,[-1]:$1,32:$1},oTe={35:pIe,42:py,45:[SM,py],60:vIe,61:SM,95:py,96:xM,126:xM},aTe={38:J7,92:X7},sTe={[-5]:D1,[-4]:D1,[-3]:D1,33:DIe,38:J7,42:Ok,60:[MRe,CIe],91:MIe,92:[dIe,X7],93:GI,95:Ok,96:WRe},lTe={null:[Ok,JIe]},cTe={null:[42,95]},uTe={null:[]},dTe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:cTe,contentInitial:rTe,disable:uTe,document:nTe,flow:oTe,flowInitial:iTe,insideSpan:lTe,string:aTe,text:sTe},Symbol.toStringTag,{value:"Module"}));function fTe(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=[],l=[];const d={attempt:A(N),check:A(T),consume:E,enter:j,exit:R,interrupt:A(T,{interrupt:!0})},f={code:null,containerState:{},defineSkip:S,events:[],now:x,parser:e,previous:null,sliceSerialize:v,sliceStream:y,write:h};let m=t.tokenize.call(f,d);return t.resolveAll&&o.push(t),f;function h(te){return a=bo(a,te),C(),a[a.length-1]!==null?[]:(D(t,0),f.events=KI(o,f.events,f),f.events)}function v(te,G){return mTe(y(te),G)}function y(te){return pTe(a,te)}function x(){const{_bufferIndex:te,_index:G,line:q,column:V,offset:H}=r;return{_bufferIndex:te,_index:G,line:q,column:V,offset:H}}function S(te){i[te.line]=te.column,K()}function C(){let te;for(;r._index<a.length;){const G=a[r._index];if(typeof G=="string")for(te=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===te&&r._bufferIndex<G.length;)k(G.charCodeAt(r._bufferIndex));else k(G)}}function k(te){m=m(te)}function E(te){lt(te)?(r.line++,r.column=1,r.offset+=te===-3?2:1,K()):te!==-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=te}function j(te,G){const q=G||{};return q.type=te,q.start=x(),f.events.push(["enter",q,f]),l.push(q),q}function R(te){const G=l.pop();return G.end=x(),f.events.push(["exit",G,f]),G}function N(te,G){D(te,G.from)}function T(te,G){G.restore()}function A(te,G){return q;function q(V,H,z){let W,L,ne,$;return Array.isArray(V)?U(V):"tokenize"in V?U([V]):P(V);function P(ge){return Q;function Q(ve){const be=ve!==null&&ge[ve],ke=ve!==null&&ge.null,$e=[...Array.isArray(be)?be:be?[be]:[],...Array.isArray(ke)?ke:ke?[ke]:[]];return U($e)(ve)}}function U(ge){return W=ge,L=0,ge.length===0?z:O(ge[L])}function O(ge){return Q;function Q(ve){return $=F(),ne=ge,ge.partial||(f.currentConstruct=ge),ge.name&&f.parser.constructs.disable.null.includes(ge.name)?pe():ge.tokenize.call(G?Object.assign(Object.create(f),G):f,d,J,pe)(ve)}}function J(ge){return te(ne,$),H}function pe(ge){return $.restore(),++L<W.length?O(W[L]):z}}}function D(te,G){te.resolveAll&&!o.includes(te)&&o.push(te),te.resolve&&_a(f.events,G,f.events.length-G,te.resolve(f.events.slice(G),f)),te.resolveTo&&(f.events=te.resolveTo(f.events,f))}function F(){const te=x(),G=f.previous,q=f.currentConstruct,V=f.events.length,H=Array.from(l);return{from:V,restore:z};function z(){r=te,f.previous=G,f.currentConstruct=q,f.events.length=V,l=H,K()}}function K(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function pTe(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 l=a[0];typeof l=="string"?a[0]=l.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function mTe(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=`
178
- `;break}case-3:{a=`\r
179
- `;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 hTe(e){const r={constructs:SRe([dTe,...(e||{}).extensions||[]]),content:i(TRe),defined:[],document:i(ARe),flow:i(WIe),lazy:{},string:i(QIe),text:i(eTe)};return r;function i(o){return a;function a(l){return fTe(r,o,l)}}}function gTe(e){for(;!Q7(e););return e}const _M=/[\0\t\n\r]/g;function vTe(){let e=1,t="",n=!0,r;return i;function i(o,a,l){const d=[];let f,m,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(_M.lastIndex=h,f=_M.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(m=Math.ceil(e/4)*4,d.push(-2);e++<m;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}h=v+1}return l&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const yTe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function bTe(e){return e.replace(yTe,xTe)}function xTe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Y7(n.slice(o?2:1),o?16:10)}return qI(n)||e}const oK={}.hasOwnProperty;function wTe(e,t,n){return typeof t!="string"&&(n=t,t=void 0),STe(n)(gTe(hTe(n).document().write(vTe()(e,t,!0))))}function STe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Xt),autolinkProtocol:F,autolinkEmail:F,atxHeading:o(Qe),blockQuote:o(ke),characterEscape:F,characterReference:F,codeFenced:o($e),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o($e,a),codeText:o(Le,a),codeTextData:F,data:F,codeFlowValue:F,definition:o(St),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(ct),hardBreakEscape:o(zt),hardBreakTrailing:o(zt),htmlFlow:o(Bt,a),htmlFlowData:F,htmlText:o(Bt,a),htmlTextData:F,image:o(dr),label:a,link:o(Xt),listItem:o(Z),listItemValue:v,listOrdered:o(An,h),listUnordered:o(An),paragraph:o(re),reference:O,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(Qe),strong:o(se),thematicBreak:o(fe)},exit:{atxHeading:d(),atxHeadingSequence:N,autolink:d(),autolinkEmail:be,autolinkProtocol:ve,blockQuote:d(),characterEscapeValue:K,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:ge,characterReference:Q,codeFenced:d(C),codeFencedFence:S,codeFencedFenceInfo:y,codeFencedFenceMeta:x,codeFlowValue:K,codeIndented:d(k),codeText:d(H),codeTextData:K,data:K,definition:d(),definitionDestinationString:R,definitionLabelString:E,definitionTitleString:j,emphasis:d(),hardBreakEscape:d(G),hardBreakTrailing:d(G),htmlFlow:d(q),htmlFlowData:K,htmlText:d(V),htmlTextData:K,image:d(W),label:ne,labelText:L,lineEnding:te,link:d(z),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:J,resourceDestinationString:$,resourceTitleString:P,resource:U,setextHeading:d(D),setextHeadingLineSequence:A,setextHeadingText:T,strong:d(),thematicBreak:d()}};aK(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(B){let le={type:"root",children:[]};const Ee={stack:[le],tokenStack:[],config:t,enter:l,exit:f,buffer:a,resume:m,data:n},Me=[];let Ke=-1;for(;++Ke<B.length;)if(B[Ke][1].type==="listOrdered"||B[Ke][1].type==="listUnordered")if(B[Ke][0]==="enter")Me.push(Ke);else{const Jt=Me.pop();Ke=i(B,Jt,Ke)}for(Ke=-1;++Ke<B.length;){const Jt=t[B[Ke][0]];oK.call(Jt,B[Ke][1].type)&&Jt[B[Ke][1].type].call(Object.assign({sliceSerialize:B[Ke][2].sliceSerialize},Ee),B[Ke][1])}if(Ee.tokenStack.length>0){const Jt=Ee.tokenStack[Ee.tokenStack.length-1];(Jt[1]||CM).call(Ee,void 0,Jt[0])}for(le.position={start:Gs(B.length>0?B[0][1].start:{line:1,column:1,offset:0}),end:Gs(B.length>0?B[B.length-2][1].end:{line:1,column:1,offset:0})},Ke=-1;++Ke<t.transforms.length;)le=t.transforms[Ke](le)||le;return le}function i(B,le,Ee){let Me=le-1,Ke=-1,Jt=!1,Ht,Cn,Lt,fn;for(;++Me<=Ee;){const jt=B[Me];switch(jt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{jt[0]==="enter"?Ke++:Ke--,fn=void 0;break}case"lineEndingBlank":{jt[0]==="enter"&&(Ht&&!fn&&!Ke&&!Lt&&(Lt=Me),fn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:fn=void 0}if(!Ke&&jt[0]==="enter"&&jt[1].type==="listItemPrefix"||Ke===-1&&jt[0]==="exit"&&(jt[1].type==="listUnordered"||jt[1].type==="listOrdered")){if(Ht){let ar=Me;for(Cn=void 0;ar--;){const Rn=B[ar];if(Rn[1].type==="lineEnding"||Rn[1].type==="lineEndingBlank"){if(Rn[0]==="exit")continue;Cn&&(B[Cn][1].type="lineEndingBlank",Jt=!0),Rn[1].type="lineEnding",Cn=ar}else if(!(Rn[1].type==="linePrefix"||Rn[1].type==="blockQuotePrefix"||Rn[1].type==="blockQuotePrefixWhitespace"||Rn[1].type==="blockQuoteMarker"||Rn[1].type==="listItemIndent"))break}Lt&&(!Cn||Lt<Cn)&&(Ht._spread=!0),Ht.end=Object.assign({},Cn?B[Cn][1].start:jt[1].end),B.splice(Cn||Me,0,["exit",Ht,jt[2]]),Me++,Ee++}if(jt[1].type==="listItemPrefix"){const ar={type:"listItem",_spread:!1,start:Object.assign({},jt[1].start),end:void 0};Ht=ar,B.splice(Me,0,["enter",ar,jt[2]]),Me++,Ee++,Lt=void 0,fn=!0}}}return B[le][1]._spread=Jt,Ee}function o(B,le){return Ee;function Ee(Me){l.call(this,B(Me),Me),le&&le.call(this,Me)}}function a(){this.stack.push({type:"fragment",children:[]})}function l(B,le,Ee){this.stack[this.stack.length-1].children.push(B),this.stack.push(B),this.tokenStack.push([le,Ee||void 0]),B.position={start:Gs(le.start),end:void 0}}function d(B){return le;function le(Ee){B&&B.call(this,Ee),f.call(this,Ee)}}function f(B,le){const Ee=this.stack.pop(),Me=this.tokenStack.pop();if(Me)Me[0].type!==B.type&&(le?le.call(this,B,Me[0]):(Me[1]||CM).call(this,B,Me[0]));else throw new Error("Cannot close `"+B.type+"` ("+dm({start:B.start,end:B.end})+"): it’s not open");Ee.position.end=Gs(B.end)}function m(){return xRe(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function v(B){if(this.data.expectingFirstListItemValue){const le=this.stack[this.stack.length-2];le.start=Number.parseInt(this.sliceSerialize(B),10),this.data.expectingFirstListItemValue=void 0}}function y(){const B=this.resume(),le=this.stack[this.stack.length-1];le.lang=B}function x(){const B=this.resume(),le=this.stack[this.stack.length-1];le.meta=B}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const B=this.resume(),le=this.stack[this.stack.length-1];le.value=B.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const B=this.resume(),le=this.stack[this.stack.length-1];le.value=B.replace(/(\r?\n|\r)$/g,"")}function E(B){const le=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=le,Ee.identifier=Id(this.sliceSerialize(B)).toLowerCase()}function j(){const B=this.resume(),le=this.stack[this.stack.length-1];le.title=B}function R(){const B=this.resume(),le=this.stack[this.stack.length-1];le.url=B}function N(B){const le=this.stack[this.stack.length-1];if(!le.depth){const Ee=this.sliceSerialize(B).length;le.depth=Ee}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function A(B){const le=this.stack[this.stack.length-1];le.depth=this.sliceSerialize(B).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function F(B){const Ee=this.stack[this.stack.length-1].children;let Me=Ee[Ee.length-1];(!Me||Me.type!=="text")&&(Me=ie(),Me.position={start:Gs(B.start),end:void 0},Ee.push(Me)),this.stack.push(Me)}function K(B){const le=this.stack.pop();le.value+=this.sliceSerialize(B),le.position.end=Gs(B.end)}function te(B){const le=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=le.children[le.children.length-1];Ee.position.end=Gs(B.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(le.type)&&(F.call(this,B),K.call(this,B))}function G(){this.data.atHardBreak=!0}function q(){const B=this.resume(),le=this.stack[this.stack.length-1];le.value=B}function V(){const B=this.resume(),le=this.stack[this.stack.length-1];le.value=B}function H(){const B=this.resume(),le=this.stack[this.stack.length-1];le.value=B}function z(){const B=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";B.type+="Reference",B.referenceType=le,delete B.url,delete B.title}else delete B.identifier,delete B.label;this.data.referenceType=void 0}function W(){const B=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";B.type+="Reference",B.referenceType=le,delete B.url,delete B.title}else delete B.identifier,delete B.label;this.data.referenceType=void 0}function L(B){const le=this.sliceSerialize(B),Ee=this.stack[this.stack.length-2];Ee.label=bTe(le),Ee.identifier=Id(le).toLowerCase()}function ne(){const B=this.stack[this.stack.length-1],le=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const Me=B.children;Ee.children=Me}else Ee.alt=le}function $(){const B=this.resume(),le=this.stack[this.stack.length-1];le.url=B}function P(){const B=this.resume(),le=this.stack[this.stack.length-1];le.title=B}function U(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function J(B){const le=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=le,Ee.identifier=Id(this.sliceSerialize(B)).toLowerCase(),this.data.referenceType="full"}function pe(B){this.data.characterReferenceType=B.type}function ge(B){const le=this.sliceSerialize(B),Ee=this.data.characterReferenceType;let Me;Ee?(Me=Y7(le,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Me=qI(le);const Ke=this.stack[this.stack.length-1];Ke.value+=Me}function Q(B){const le=this.stack.pop();le.position.end=Gs(B.end)}function ve(B){K.call(this,B);const le=this.stack[this.stack.length-1];le.url=this.sliceSerialize(B)}function be(B){K.call(this,B);const le=this.stack[this.stack.length-1];le.url="mailto:"+this.sliceSerialize(B)}function ke(){return{type:"blockquote",children:[]}}function $e(){return{type:"code",lang:null,meta:null,value:""}}function Le(){return{type:"inlineCode",value:""}}function St(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ct(){return{type:"emphasis",children:[]}}function Qe(){return{type:"heading",depth:0,children:[]}}function zt(){return{type:"break"}}function Bt(){return{type:"html",value:""}}function dr(){return{type:"image",title:null,url:"",alt:null}}function Xt(){return{type:"link",title:null,url:"",children:[]}}function An(B){return{type:"list",ordered:B.type==="listOrdered",start:null,spread:B._spread,children:[]}}function Z(B){return{type:"listItem",spread:B._spread,checked:null,children:[]}}function re(){return{type:"paragraph",children:[]}}function se(){return{type:"strong",children:[]}}function ie(){return{type:"text",value:""}}function fe(){return{type:"thematicBreak"}}}function Gs(e){return{line:e.line,column:e.column,offset:e.offset}}function aK(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?aK(e,r):_Te(e,r)}}function _Te(e,t){let n;for(n in t)if(oK.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 CM(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+dm({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+dm({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+dm({start:t.start,end:t.end})+") is still open")}function CTe(e){const t=this;t.parser=n;function n(r){return wTe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function kTe(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 ETe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
180
- `}]}function jTe(e,t){const n=t.value?t.value+`
181
- `:"",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 RTe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ITe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function TTe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Af(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+1,l+=1,e.footnoteCounts.set(r,l);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),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 NTe(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 ATe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function sK(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 OTe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return sK(e,t);const i={src:Af(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 $Te(e,t){const n={src:Af(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 DTe(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 PTe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return sK(e,t);const i={href:Af(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 MTe(e,t){const n={href:Af(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 zTe(e,t,n){const r=e.all(t),i=n?LTe(n):lK(t),o={},a=[];if(typeof t.checked=="boolean"){const m=r[0];let h;m&&m.type==="element"&&m.tagName==="p"?h=m:(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 l=-1;for(;++l<r.length;){const m=r[l];(i||l!==0||m.type!=="element"||m.tagName!=="p")&&a.push({type:"text",value:`
182
- `}),m.type==="element"&&m.tagName==="p"&&!i?a.push(...m.children):a.push(m)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
183
- `});const f={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,f),e.applyData(t,f)}function LTe(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=lK(n[r])}return t}function lK(e){const t=e.spread;return t??e.children.length>1}function FTe(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 UTe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function VTe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function BTe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function HTe(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)},l=UI(t.children[1]),d=V7(t.children[t.children.length-1]);l&&d&&(a.position={start:l,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 qTe(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,l=a?a.length:t.children.length;let d=-1;const f=[];for(;++d<l;){const h=t.children[d],v={},y=a?a[d]:void 0;y&&(v.align=y);let x={type:"element",tagName:o,properties:v,children:[]};h&&(x.children=e.all(h),e.patch(h,x),x=e.applyData(h,x)),f.push(x)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,m),e.applyData(t,m)}function KTe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const kM=9,EM=32;function GTe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(jM(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(jM(t.slice(i),i>0,!1)),o.join("")}function jM(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===kM||o===EM;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===kM||o===EM;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function ZTe(e,t){const n={type:"text",value:GTe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function YTe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const WTe={blockquote:kTe,break:ETe,code:jTe,delete:RTe,emphasis:ITe,footnoteReference:TTe,heading:NTe,html:ATe,imageReference:OTe,image:$Te,inlineCode:DTe,linkReference:PTe,link:MTe,listItem:zTe,list:FTe,paragraph:UTe,root:VTe,strong:BTe,table:HTe,tableCell:KTe,tableRow:qTe,text:ZTe,thematicBreak:YTe,toml:Hv,yaml:Hv,definition:Hv,footnoteDefinition:Hv};function Hv(){}const cK=-1,B0=0,pm=1,yb=2,ZI=3,YI=4,WI=5,XI=6,uK=7,dK=8,RM=typeof self=="object"?self:globalThis,XTe=(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 B0:case cK:return n(a,i);case pm:{const l=n([],i);for(const d of a)l.push(r(d));return l}case yb:{const l=n({},i);for(const[d,f]of a)l[r(d)]=r(f);return l}case ZI:return n(new Date(a),i);case YI:{const{source:l,flags:d}=a;return n(new RegExp(l,d),i)}case WI:{const l=n(new Map,i);for(const[d,f]of a)l.set(r(d),r(f));return l}case XI:{const l=n(new Set,i);for(const d of a)l.add(r(d));return l}case uK:{const{name:l,message:d}=a;return n(new RM[l](d),i)}case dK: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:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(new RM[o](a),i)};return r},IM=e=>XTe(new Map,e)(0),ld="",{toString:JTe}={},{keys:QTe}=Object,Kp=e=>{const t=typeof e;if(t!=="object"||!e)return[B0,t];const n=JTe.call(e).slice(8,-1);switch(n){case"Array":return[pm,ld];case"Object":return[yb,ld];case"Date":return[ZI,ld];case"RegExp":return[YI,ld];case"Map":return[WI,ld];case"Set":return[XI,ld];case"DataView":return[pm,n]}return n.includes("Array")?[pm,n]:n.includes("Error")?[uK,n]:[yb,n]},qv=([e,t])=>e===B0&&(t==="function"||t==="symbol"),eNe=(e,t,n,r)=>{const i=(a,l)=>{const d=r.push(a)-1;return n.set(l,d),d},o=a=>{if(n.has(a))return n.get(a);let[l,d]=Kp(a);switch(l){case B0:{let m=a;switch(d){case"bigint":l=dK,m=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);m=null;break;case"undefined":return i([cK],a)}return i([l,m],a)}case pm:{if(d){let v=a;return d==="DataView"?v=new Uint8Array(a.buffer):d==="ArrayBuffer"&&(v=new Uint8Array(a)),i([d,[...v]],a)}const m=[],h=i([l,m],a);for(const v of a)m.push(o(v));return h}case yb:{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 m=[],h=i([l,m],a);for(const v of QTe(a))(e||!qv(Kp(a[v])))&&m.push([o(v),o(a[v])]);return h}case ZI:return i([l,a.toISOString()],a);case YI:{const{source:m,flags:h}=a;return i([l,{source:m,flags:h}],a)}case WI:{const m=[],h=i([l,m],a);for(const[v,y]of a)(e||!(qv(Kp(v))||qv(Kp(y))))&&m.push([o(v),o(y)]);return h}case XI:{const m=[],h=i([l,m],a);for(const v of a)(e||!qv(Kp(v)))&&m.push(o(v));return h}}const{message:f}=a;return i([l,{name:d,message:f}],a)};return o},TM=(e,{json:t,lossy:n}={})=>{const r=[];return eNe(!(t||n),!!t,new Map,r)(e),r},bb=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?IM(TM(e,t)):structuredClone(e):(e,t)=>IM(TM(e,t));function tNe(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 nNe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function rNe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||tNe,r=e.options.footnoteBackLabel||nNe,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let d=-1;for(;++d<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[d]);if(!f)continue;const m=e.all(f),h=String(f.identifier).toUpperCase(),v=Af(h.toLowerCase());let y=0;const x=[],S=e.footnoteCounts.get(h);for(;S!==void 0&&++y<=S;){x.length>0&&x.push({type:"text",value:" "});let E=typeof n=="string"?n:n(d,y);typeof E=="string"&&(E={type:"text",value:E}),x.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(E)?E:[E]})}const C=m[m.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const E=C.children[C.children.length-1];E&&E.type==="text"?E.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...x)}else m.push(...x);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(m,!0)};e.patch(f,k),l.push(k)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...bb(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
184
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
185
- `}]}}const fK=(function(e){if(e==null)return sNe;if(typeof e=="function")return H0(e);if(typeof e=="object")return Array.isArray(e)?iNe(e):oNe(e);if(typeof e=="string")return aNe(e);throw new Error("Expected function, string, or object as test")});function iNe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=fK(e[n]);return H0(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function oNe(e){const t=e;return H0(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function aNe(e){return H0(t);function t(n){return n&&n.type===e}}function H0(e){return t;function t(n,r,i){return!!(lNe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function sNe(){return!0}function lNe(e){return e!==null&&typeof e=="object"&&"type"in e}const pK=[],cNe=!0,NM=!1,uNe="skip";function dNe(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=fK(i),a=r?-1:1;l(e,void 0,[])();function l(d,f,m){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=pK,x,S,C;if((!t||o(d,f,m[m.length-1]||void 0))&&(y=fNe(n(d,m)),y[0]===NM))return y;if("children"in d&&d.children){const k=d;if(k.children&&y[0]!==uNe)for(S=(r?k.children.length:-1)+a,C=m.concat(k);S>-1&&S<k.children.length;){const E=k.children[S];if(x=l(E,S,C)(),x[0]===NM)return x;S=typeof x[1]=="number"?x[1]:S+a}}return y}}}function fNe(e){return Array.isArray(e)?e:typeof e=="number"?[cNe,e]:e==null?pK:[e]}function mK(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),dNe(e,o,l,i);function l(d,f){const m=f[f.length-1],h=m?m.children.indexOf(d):void 0;return a(d,h,m)}}const $k={}.hasOwnProperty,pNe={};function mNe(e,t){const n=t||pNe,r=new Map,i=new Map,o=new Map,a={...WTe,...n.handlers},l={all:f,applyData:gNe,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:d,options:n,patch:hNe,wrap:yNe};return mK(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const h=m.type==="definition"?r:i,v=String(m.identifier).toUpperCase();h.has(v)||h.set(v,m)}}),l;function d(m,h){const v=m.type,y=l.handlers[v];if($k.call(l.handlers,v)&&y)return y(l,m,h);if(l.options.passThrough&&l.options.passThrough.includes(v)){if("children"in m){const{children:S,...C}=m,k=bb(C);return k.children=l.all(m),k}return bb(m)}return(l.options.unknownHandler||vNe)(l,m,h)}function f(m){const h=[];if("children"in m){const v=m.children;let y=-1;for(;++y<v.length;){const x=l.one(v[y],m);if(x){if(y&&v[y-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=AM(x.value)),!Array.isArray(x)&&x.type==="element")){const S=x.children[0];S&&S.type==="text"&&(S.value=AM(S.value))}Array.isArray(x)?h.push(...x):h.push(x)}}}return h}}function hNe(e,t){e.position&&(t.position=Jje(e))}function gNe(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,bb(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function vNe(e,t){const n=t.data||{},r="value"in t&&!($k.call(n,"hProperties")||$k.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 yNe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
186
- `});++r<e.length;)r&&n.push({type:"text",value:`
187
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
188
- `}),n}function AM(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function OM(e,t){const n=mNe(e,t),r=n.one(e,void 0),i=rNe(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
189
- `},i),o}function bNe(e,t){return e&&"run"in e?async function(n,r){const i=OM(n,{file:r,...t});await e.run(i,r)}:function(n,r){return OM(n,{file:r,...e||t})}}function $M(e){if(e)throw e}var P1,DM;function xNe(){if(DM)return P1;DM=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 m=e.call(f,"constructor"),h=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!m&&!h)return!1;var v;for(v in f);return typeof v>"u"||e.call(f,v)},a=function(f,m){n&&m.name==="__proto__"?n(f,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):f[m.name]=m.newValue},l=function(f,m){if(m==="__proto__")if(e.call(f,m)){if(r)return r(f,m).value}else return;return f[m]};return P1=function d(){var f,m,h,v,y,x,S=arguments[0],C=1,k=arguments.length,E=!1;for(typeof S=="boolean"&&(E=S,S=arguments[1]||{},C=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});C<k;++C)if(f=arguments[C],f!=null)for(m in f)h=l(S,m),v=l(f,m),S!==v&&(E&&v&&(o(v)||(y=i(v)))?(y?(y=!1,x=h&&i(h)?h:[]):x=h&&o(h)?h:{},a(S,{name:m,newValue:d(E,x,v)})):typeof v<"u"&&a(S,{name:m,newValue:v}));return S},P1}var wNe=xNe();const M1=rf(wNe);function Dk(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 SNe(){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);l(null,...i);function l(d,...f){const m=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,m?_Ne(m,l)(...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 _Ne(e,t){let n;return r;function r(...a){const l=e.length>a.length;let d;l&&a.push(i);try{d=e.apply(this,a)}catch(f){const m=f;if(l&&n)throw m;return i(m)}l||(d&&d.then&&typeof d.then=="function"?d.then(o,i):d instanceof Error?i(d):o(d))}function i(a,...l){n||(n=!0,t(a,...l))}function o(a){i(null,a)}}const la={basename:CNe,dirname:kNe,extname:ENe,join:jNe,sep:"/"};function CNe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');qh(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,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function kNe(e){if(qh(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 ENe(e){qh(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const l=e.codePointAt(t);if(l===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),l===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 jNe(...e){let t=-1,n;for(;++t<e.length;)qh(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":RNe(n)}function RNe(e){qh(e);const t=e.codePointAt(0)===47;let n=INe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function INe(e,t){let n="",r=0,i=-1,o=0,a=-1,l,d;for(;++a<=e.length;){if(a<e.length)l=e.codePointAt(a);else{if(l===47)break;l=47}if(l===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 l===46&&o>-1?o++:o=-1}return n}function qh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const TNe={cwd:NNe};function NNe(){return"/"}function Pk(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ANe(e){if(typeof e=="string")e=new URL(e);else if(!Pk(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 ONe(e)}function ONe(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 z1=["history","path","basename","stem","extname","dirname"];class hK{constructor(t){let n;t?Pk(t)?n={path:t}:typeof t=="string"||$Ne(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":TNe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<z1.length;){const o=z1[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)z1.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?la.basename(this.path):void 0}set basename(t){F1(t,"basename"),L1(t,"basename"),this.path=la.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?la.dirname(this.path):void 0}set dirname(t){PM(this.basename,"dirname"),this.path=la.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?la.extname(this.path):void 0}set extname(t){if(L1(t,"extname"),PM(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=la.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Pk(t)&&(t=ANe(t)),F1(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?la.basename(this.path,this.extname):void 0}set stem(t){F1(t,"stem"),L1(t,"stem"),this.path=la.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 Ur(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 L1(e,t){if(e&&e.includes(la.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+la.sep+"`")}function F1(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function PM(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function $Ne(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const DNe=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),PNe={}.hasOwnProperty;class JI extends DNe{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=SNe()}copy(){const t=new JI;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(M1(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(B1("data",this.frozen),this.namespace[t]=n,this):PNe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(B1("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=Kv(t),r=this.parser||this.Parser;return U1("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),U1("process",this.parser||this.Parser),V1("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,a){const l=Kv(t),d=r.parse(l);r.run(d,l,function(m,h,v){if(m||!h||!v)return f(m);const y=h,x=r.stringify(y,v);LNe(x)?v.value=x:v.result=x,f(m,v)});function f(m,h){m||!h?a(m):o?o(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),U1("processSync",this.parser||this.Parser),V1("processSync",this.compiler||this.Compiler),this.process(t,i),zM("processSync","process",n),r;function i(o,a){n=!0,$M(o),r=a}}run(t,n,r){MM(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,l){const d=Kv(n);i.run(t,d,f);function f(m,h,v){const y=h||t;m?l(m):a?a(y):r(void 0,y,v)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),zM("runSync","run",r),i;function o(a,l){$M(a),i=l,r=!0}}stringify(t,n){this.freeze();const r=Kv(n),i=this.compiler||this.Compiler;return V1("stringify",i),MM(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(B1("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?l(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[m,...h]=f;d(m,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");l(f.plugins),f.settings&&(i.settings=M1(!0,i.settings,f.settings))}function l(f){let m=-1;if(f!=null)if(Array.isArray(f))for(;++m<f.length;){const h=f[m];o(h)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,m){let h=-1,v=-1;for(;++h<r.length;)if(r[h][0]===f){v=h;break}if(v===-1)r.push([f,...m]);else if(m.length>0){let[y,...x]=m;const S=r[v][1];Dk(S)&&Dk(y)&&(y=M1(!0,S,y)),r[v]=[f,y,...x]}}}}const MNe=new JI().freeze();function U1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function V1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function B1(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 MM(e){if(!Dk(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function zM(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Kv(e){return zNe(e)?e:new hK(e)}function zNe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function LNe(e){return typeof e=="string"||FNe(e)}function FNe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const UNe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",LM=[],FM={allowDangerousHtml:!0},VNe=/^(https?|ircs?|mailto|xmpp)$/i,BNe=[{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 HNe(e){const t=qNe(e),n=KNe(e);return GNe(t.runSync(t.parse(n),n),e)}function qNe(e){const t=e.rehypePlugins||LM,n=e.remarkPlugins||LM,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...FM}:FM;return MNe().use(CTe).use(n).use(bNe,r).use(t)}function KNe(e){const t=e.children||"",n=new hK;return typeof t=="string"&&(n.value=t),n}function GNe(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,a=t.skipHtml,l=t.unwrapDisallowed,d=t.urlTransform||ZNe;for(const m of BNe)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+UNe+m.id,void 0);return mK(e,f),rRe(e,{Fragment:u.Fragment,components:i,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function f(m,h,v){if(m.type==="raw"&&v&&typeof h=="number")return a?v.children.splice(h,1):v.children[h]={type:"text",value:m.value},h;if(m.type==="element"){let y;for(y in O1)if(Object.hasOwn(O1,y)&&Object.hasOwn(m.properties,y)){const x=m.properties[y],S=O1[y];(S===null||S.includes(m.tagName))&&(m.properties[y]=d(String(x||""),y,m))}}if(m.type==="element"){let y=n?!n.includes(m.tagName):o?o.includes(m.tagName):!1;if(!y&&r&&typeof h=="number"&&(y=!r(m,h,v)),y&&v&&typeof h=="number")return l&&m.children?v.children.splice(h,1,...m.children):v.children.splice(h,1),h}}}function ZNe(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||VNe.test(e.slice(0,t))?e:""}var YNe="Separator",UM="horizontal",WNe=["horizontal","vertical"],gK=b.forwardRef((e,t)=>{const{decorative:n,orientation:r=UM,...i}=e,o=XNe(r)?r:UM,l=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return u.jsx(g6.div,{"data-orientation":o,...l,...i,ref:t})});gK.displayName=YNe;function XNe(e){return WNe.includes(e)}var JNe=gK;function q0({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return u.jsx(JNe,{"data-slot":"separator-root",decorative:n,orientation:t,className:Ue("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 K0="Tabs",[QNe]=Qi(K0,[Ef]),vK=Ef(),[eAe,QI]=QNe(K0),yK=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",dir:l,activationMode:d="automatic",...f}=e,m=eu(l),[h,v]=Ko({prop:r,onChange:i,defaultProp:o??"",caller:K0});return u.jsx(eAe,{scope:n,baseId:Vi(),value:h,onValueChange:v,orientation:a,dir:m,activationMode:d,children:u.jsx(Ye.div,{dir:m,"data-orientation":a,...f,ref:t})})});yK.displayName=K0;var bK="TabsList",xK=b.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=QI(bK,n),a=vK(n);return u.jsx(hI,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:u.jsx(Ye.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});xK.displayName=bK;var wK="TabsTrigger",SK=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,a=QI(wK,n),l=vK(n),d=kK(a.baseId,r),f=EK(a.baseId,r),m=r===a.value;return u.jsx(gI,{asChild:!0,...l,focusable:!i,active:m,children:u.jsx(Ye.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":f,"data-state":m?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:d,...o,ref:t,onMouseDown:Ie(e.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?a.onValueChange(r):h.preventDefault()}),onKeyDown:Ie(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&a.onValueChange(r)}),onFocus:Ie(e.onFocus,()=>{const h=a.activationMode!=="manual";!m&&!i&&h&&a.onValueChange(r)})})})});SK.displayName=wK;var _K="TabsContent",CK=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...a}=e,l=QI(_K,n),d=kK(l.baseId,r),f=EK(l.baseId,r),m=r===l.value,h=b.useRef(m);return b.useEffect(()=>{const v=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(v)},[]),u.jsx(or,{present:i||m,children:({present:v})=>u.jsx(Ye.div,{"data-state":m?"active":"inactive","data-orientation":l.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})})});CK.displayName=_K;function kK(e,t){return`${e}-trigger-${t}`}function EK(e,t){return`${e}-content-${t}`}var tAe=yK,nAe=xK,rAe=SK,iAe=CK;function Mk({className:e,...t}){return u.jsx(tAe,{"data-slot":"tabs",className:Ue("flex flex-col gap-2",e),...t})}function zk({className:e,...t}){return u.jsx(nAe,{"data-slot":"tabs-list",className:Ue("text-muted-foreground inline-flex w-fit items-center justify-center rounded-full bg-gray-950 p-1",e),...t})}function Js({className:e,...t}){return u.jsx(rAe,{"data-slot":"tabs-trigger",className:Ue("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 Qs({className:e,...t}){return u.jsx(iAe,{"data-slot":"tabs-content",className:Ue("flex-1 outline-none",e),...t})}function jK(e,t,n){for(const r of e)if(r[t]===n)return r}const oAe=Db("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 eT({className:e,variant:t,...n}){return u.jsx("div",{"data-slot":"alert",role:"alert",className:Ue(oAe({variant:t}),e),...n})}function aAe({className:e,...t}){return u.jsx("div",{"data-slot":"alert-title",className:Ue("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function tT({className:e,...t}){return u.jsx("div",{"data-slot":"alert-description",className:Ue("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function sAe(e){const{user:t}=ms(),n=ix(),{instance:r,cluster:i}=$b({strict:!1}),o=n.instanceClient.defaults.baseURL;return b.useMemo(()=>{const a=k0(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}
190
- 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 lAe({defaultApplicationName:e,formState:t,watch:n}){const r=n("applicationName")||e,i=sAe(r),o=k9(...i.map(a=>a.code));return u.jsxs(u.Fragment,{children:[u.jsxs(Il,{children:[u.jsx(Tl,{children:"Deploy with Harper CLI"}),u.jsx(Zc,{children:"Follow these steps to deploy your application using the Harper CLI"})]}),u.jsxs(hs,{className:"space-y-6",children:[i.map((a,l)=>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:l+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 overflow-auto pl-8 -indent-8 wrap-anywhere",children:a.code}),u.jsx(xe,{type:"button",variant:"default",size:"sm",onClick:o[l],children:u.jsx(P4,{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(eT,{className:"mt-2",children:[u.jsx(dE,{className:"w-4 h-4"}),u.jsx(tT,{children:a.alert})]})]}),u.jsx(q0,{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(xe,{className:"w-full",variant:"secondary",disabled:!t.isValid,children:[u.jsx(sE,{className:"w-4 h-4 mr-2"}),"I Have Completed These Steps"]})]})]})}function cAe({control:e,defaultApplicationName:t}){return u.jsxs(u.Fragment,{children:[u.jsxs(Il,{children:[u.jsx(Tl,{children:"Application Name"}),u.jsx(Zc,{children:"Choose a name for your new API application"})]}),u.jsx(hs,{children:u.jsxs("div",{className:"space-y-2",children:[u.jsx(De,{control:e,name:"applicationName",render:({field:n})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Name"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",autoCapitalize:"words",autoComplete:"off",autoFocus:!0,placeholder:t,...n})}),u.jsx(Ae,{})]})}),u.jsx("p",{className:"text-muted-foreground text-sm",children:"Use lowercase letters, numbers, underscores, and hyphens"})]})})]})}function uAe({control:e,formState:t,isImportingApplication:n,setValue:r,watch:i}){const o=i("contents.source"),a=b.useCallback(l=>{r("contents.source",l)},[r]);return u.jsxs(u.Fragment,{children:[u.jsxs(Il,{children:[u.jsx(Tl,{children:"Import Existing Application"}),u.jsx(Zc,{children:"Import from Git, NPM, or a tarball URL"})]}),u.jsxs(hs,{className:"space-y-6",children:[u.jsxs(Mk,{value:o,onValueChange:a,children:[u.jsxs(zk,{className:"grid w-full grid-cols-3",children:[u.jsxs(Js,{value:"git",children:[u.jsx(cE,{className:"w-4 h-4 mr-2"}),"Git"]}),u.jsxs(Js,{value:"npm",children:[u.jsx(uE,{className:"w-4 h-4 mr-2"}),"NPM"]}),u.jsxs(Js,{value:"tarball",children:[u.jsx(qte,{className:"w-4 h-4 mr-2"}),"Tarball"]})]}),u.jsx(Qs,{value:"git",className:"space-y-4 mt-4",children:u.jsx("div",{className:"space-y-2",children:u.jsx(De,{control:e,name:"contents.ref",render:({field:l})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Git Repository URL"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",autoCapitalize:"none",autoComplete:"off",autoFocus:!0,...l})}),u.jsx(Ae,{})]})})})}),u.jsx(Qs,{value:"npm",className:"space-y-4 mt-4",children:u.jsx("div",{className:"space-y-2",children:u.jsx(De,{control:e,name:"contents.ref",render:({field:l})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"NPM Package Reference"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",autoCapitalize:"none",autoComplete:"off",autoFocus:!0,...l})}),u.jsx(Ae,{})]})})})}),u.jsx(Qs,{value:"tarball",className:"space-y-4 mt-4",children:u.jsx("div",{className:"space-y-2",children:u.jsx(De,{control:e,name:"contents.ref",render:({field:l})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Tarball URL"}),u.jsx(Oe,{children:u.jsx(ze,{type:"url",autoCapitalize:"none",autoComplete:"off",autoFocus:!0,...l})}),u.jsx(Ae,{})]})})})})]}),u.jsx(De,{control:e,name:"contents.installCommand",render:({field:l})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Install Command"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",autoCapitalize:"none",autoComplete:"off",placeholder:"npm install",...l})}),u.jsx(Ae,{})]})}),u.jsx(Ne,{children:"Authorization"}),u.jsx(De,{control:e,name:"contents.requiresAuth",render:({field:l})=>u.jsxs(Mk,{className:"w-full pt-2 pb-0 mb-0",value:String(l.value),onValueChange:d=>l.onChange(d==="true"),children:[u.jsxs(zk,{className:"grid w-full grid-cols-2",children:[u.jsx(Js,{value:"false",children:"Public Access"}),u.jsx(Js,{value:"true",children:"Requires Auth"})]}),u.jsx(Qs,{value:"false",className:"space-y-4 mt-4"}),u.jsx(Qs,{value:"true",className:"space-y-4 mt-4",children:u.jsx(eT,{children:u.jsx(tT,{children:u.jsxs("span",{children:["You can manage your certificates over in"," ",u.jsx(Ze,{to:"config",className:"underline",children:"Config"})," ",">"," ",u.jsx(Ze,{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",rel:"noreferrer",className:"underline",children:"git@github.com:HarperFast/studio.git"}),". If you have more than one key, make sure to utilize unique hostnames!"]})})})})]})}),u.jsx(q0,{className:"bg-black"}),u.jsxs(xe,{className:"w-full",disabled:!t.isValid||n,children:[u.jsx(q4,{className:"w-4 h-4 mr-2"}),"Import Application"]})]})]})}const nT=[{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"}],dAe=Dt({type:Cf("template"),id:tt("Please select a template.")}),fAe={type:"template",id:nT[0].id},pAe=Dt({type:Cf("import"),source:Ml(["git","npm","tarball"]),ref:tt().nonempty("Please enter a URL or package reference."),installCommand:tt(),requiresAuth:Qt()}),mAe={type:"import",source:"git",ref:"",requiresAuth:!1,installCommand:""},hAe=Dt({type:Cf("cli")}),gAe={type:"cli"},vAe=Dt({applicationName:tt().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:TR("type",[dAe,pAe,hAe])});var rT="Radio",[yAe,RK]=Qi(rT),[bAe,xAe]=yAe(rT),IK=b.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:o,disabled:a,value:l="on",onCheck:d,form:f,...m}=e,[h,v]=b.useState(null),y=pt(t,C=>v(C)),x=b.useRef(!1),S=h?f||!!h.closest("form"):!0;return u.jsxs(bAe,{scope:n,checked:i,disabled:a,children:[u.jsx(Ye.button,{type:"button",role:"radio","aria-checked":i,"data-state":OK(i),"data-disabled":a?"":void 0,disabled:a,value:l,...m,ref:y,onClick:Ie(e.onClick,C=>{i||d?.(),S&&(x.current=C.isPropagationStopped(),x.current||C.stopPropagation())})}),S&&u.jsx(AK,{control:h,bubbles:!x.current,name:r,value:l,checked:i,required:o,disabled:a,form:f,style:{transform:"translateX(-100%)"}})]})});IK.displayName=rT;var TK="RadioIndicator",NK=b.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...i}=e,o=xAe(TK,n);return u.jsx(or,{present:r||o.checked,children:u.jsx(Ye.span,{"data-state":OK(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:t})})});NK.displayName=TK;var wAe="RadioBubbleInput",AK=b.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...i},o)=>{const a=b.useRef(null),l=pt(a,o),d=AE(n),f=zU(t);return b.useEffect(()=>{const m=a.current;if(!m)return;const h=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(h,"checked").set;if(d!==n&&y){const x=new Event("click",{bubbles:r});y.call(m,n),m.dispatchEvent(x)}},[d,n,r]),u.jsx(Ye.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});AK.displayName=wAe;function OK(e){return e?"checked":"unchecked"}var SAe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],G0="RadioGroup",[_Ae]=Qi(G0,[Ef,RK]),$K=Ef(),DK=RK(),[CAe,kAe]=_Ae(G0),PK=b.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:o,required:a=!1,disabled:l=!1,orientation:d,dir:f,loop:m=!0,onValueChange:h,...v}=e,y=$K(n),x=eu(f),[S,C]=Ko({prop:o,defaultProp:i??null,onChange:h,caller:G0});return u.jsx(CAe,{scope:n,name:r,required:a,disabled:l,value:S,onValueChange:C,children:u.jsx(hI,{asChild:!0,...y,orientation:d,dir:x,loop:m,children:u.jsx(Ye.div,{role:"radiogroup","aria-required":a,"aria-orientation":d,"data-disabled":l?"":void 0,dir:x,...v,ref:t})})})});PK.displayName=G0;var MK="RadioGroupItem",zK=b.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...i}=e,o=kAe(MK,n),a=o.disabled||r,l=$K(n),d=DK(n),f=b.useRef(null),m=pt(t,f),h=o.value===i.value,v=b.useRef(!1);return b.useEffect(()=>{const y=S=>{SAe.includes(S.key)&&(v.current=!0)},x=()=>v.current=!1;return document.addEventListener("keydown",y),document.addEventListener("keyup",x),()=>{document.removeEventListener("keydown",y),document.removeEventListener("keyup",x)}},[]),u.jsx(gI,{asChild:!0,...l,focusable:!a,active:h,children:u.jsx(IK,{disabled:a,required:o.required,checked:h,...d,...i,name:o.name,ref:m,onCheck:()=>o.onValueChange(i.value),onKeyDown:Ie(y=>{y.key==="Enter"&&y.preventDefault()}),onFocus:Ie(i.onFocus,()=>{v.current&&f.current?.click()})})})});zK.displayName=MK;var EAe="RadioGroupIndicator",LK=b.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,i=DK(n);return u.jsx(NK,{...i,...r,ref:t})});LK.displayName=EAe;var jAe=PK,RAe=zK,IAe=LK;function TAe({className:e,...t}){return u.jsx(jAe,{"data-slot":"radio-group",className:Ue("grid gap-3",e),...t})}function NAe({className:e,...t}){return u.jsx(RAe,{"data-slot":"radio-group-item",className:Ue("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(IAe,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:u.jsx($4,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function FK(e){e.stopPropagation()}function AAe({control:e,formState:t,isCreatingFromTemplate:n}){return u.jsxs(u.Fragment,{children:[u.jsxs(Il,{children:[u.jsx(Tl,{children:"Choose a Template"}),u.jsx(Zc,{children:"Start with a pre-configured template for common use cases"})]}),u.jsxs(hs,{children:[u.jsx(De,{control:e,name:"contents.id",render:({field:r})=>u.jsx(TAe,{value:r.value,onValueChange:r.onChange,children:u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:nT.map(i=>u.jsxs("div",{className:"relative",children:[u.jsx(NAe,{value:i.id,id:i.id,className:"peer sr-only"}),u.jsxs(oh,{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:FK,className:"text-muted-foreground hover:text-white transition-colors -m-4 p-4",children:u.jsx(cE,{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(Yo,{variant:"outline",children:o},o))})]})]},i.id))})})}),u.jsx(q0,{className:"my-6 bg-black"}),u.jsxs(xe,{className:"w-full",disabled:!t.isValid||n,children:[u.jsx(q4,{className:"w-4 h-4 mr-2"}),"Create from Template"]})]})]})}function OAe(e){const t=ix(),{reloadRootEntries:n,setFocusedItem:r,setExpandedItems:i,setSelectedItems:o}=Fr(),a=b.useCallback(({project:l})=>{const d=Se.loading("Looking for application...",{description:"This may take a bit.",duration:3e5});e(!0),n().then(f=>{const m=f?.entries||[];for(const h of m)if(h.name.toLowerCase()===l.toLowerCase()){r(h.name),o([h.name]),i([h.name]),e(!1),Se.success("Imported successfully",{description:`${l} is now available in your ${t.entityType}!`,id:d,duration:5e3});return}Se.warning("Deployment Not Detected",{description:`I searched for ${l} 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 b.useMemo(()=>({checkCLI:a}),[a])}async function $Ae({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 DAe(){return ut({mutationFn:$Ae})}function PAe(e){const{mutate:t,isPending:n}=DAe(),r=ix(),{reloadRootEntries:i,setFocusedItem:o,setExpandedItems:a,setSelectedItems:l}=Fr(),d=b.useCallback(({contents:f,project:m})=>{const h=Se.loading("Creating from template...",{description:"This may take a bit.",duration:3e5}),v=jK(nT,"id",f.id);if(!v)return Se.error("Template Not Found",{description:"Please select a template",duration:1e4,id:h});t({project:m,template:v.githubUrl,...r},{onSuccess:()=>{Se.success("Created successfully!",{description:`${m} will be available once you restart your ${r.entityType}!`,id:h,duration:5e3}),e(!0),i(),o(m),l([m]),a([m])}})},[t,r,e,i,o,a,l]);return b.useMemo(()=>({isCreatingFromTemplate:n,createFromTemplate:d}),[n,d])}async function MAe({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 UK(){return ut({mutationFn:MAe})}function zAe(e){const{mutate:t,isPending:n}=UK(),r=ir(),i=Wt(),{reloadRootEntries:o,setFocusedItem:a,setExpandedItems:l,setSelectedItems:d}=Fr(),f=b.useCallback(({contents:m,project:h})=>{const v=Se.loading("Importing application...",{description:"This may take a bit.",duration:3e5});t({applicationName:h,applicationUrl:m.ref,installCommand:m.installCommand,...i},{onSuccess:()=>{Se.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]),l([h])},onError:()=>{Se.dismiss(v)}})},[t,r,i,e,o,a,l,d]);return b.useMemo(()=>({isImportingApplication:n,importApplication:f}),[n,f])}function LAe(){const{rootEntries:e}=Fr(),{organization:t,instance:n,cluster:r}=$b({strict:!1}),i=b.useMemo(()=>{const A=k0(r?.name||n?.name||t?.name||"");if(A==="")return A;let D=A,F=1;for(;jK(e,"name",D);)F+=1,D=`${A}-${F}`;return D},[e,r,n,t]),o=b.useCallback((A,D)=>{!A.applicationName&&!i?D.addIssue({code:"custom",path:["applicationName"],message:"Please name your application!"}):e.find(F=>F.name===A.applicationName)&&D.addIssue({code:"custom",path:["applicationName"],message:"That application name is already in use!"})},[i,e]),a=un({resolver:vn(vAe.superRefine(o)),defaultValues:{applicationName:"",contents:{...mAe,...gAe,...fAe}}}),{watch:l,handleSubmit:d,control:f,setValue:m,formState:h,trigger:v}=a,[y,x]=b.useState(!1),{isCreatingFromTemplate:S,createFromTemplate:C}=PAe(x),{isImportingApplication:k,importApplication:E}=zAe(x),{checkCLI:j}=OAe(x),R=b.useCallback(A=>{const D=A.applicationName||i;switch(A.contents.type){case"template":{C({contents:A.contents,project:D});break}case"import":{E({contents:A.contents,project:D});break}case"cli":{j({contents:A.contents,project:D});break}}},[j,C,i,E]),N=l("contents.type"),T=b.useCallback(A=>{const D=h.isValid;m("contents.type",A),D||v()},[m,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(dn,{...a,children:u.jsx("form",{onSubmit:d(R),className:"flex flex-col gap-4 p-4",children:u.jsxs("fieldset",{disabled:k||S||y,children:[u.jsx(Dc,{className:"bg-black-dark",children:u.jsx(cAe,{control:f,defaultApplicationName:i})}),u.jsx(Dc,{className:"bg-black-dark mt-4 pt-0",children:u.jsxs(Mk,{defaultValue:N,onValueChange:T,children:[u.jsxs(zk,{className:"w-full grid grid-cols-3 mt-0",children:[u.jsxs(Js,{value:"template",children:[u.jsx(Wee,{}),u.jsx("span",{className:"hidden sm:inline-block",children:"Templates"})]}),u.jsxs(Js,{value:"import",children:[u.jsx(Pte,{}),"Import"]}),u.jsxs(Js,{value:"cli",children:[u.jsx(dE,{}),u.jsx("span",{className:"hidden md:inline-block",children:"Harper"})," CLI"]})]}),u.jsx("div",{className:"mx-6 mt-1",children:u.jsx(q0,{className:"bg-black"})}),u.jsx(Qs,{value:"template",className:"space-y-4",children:u.jsx(AAe,{control:f,formState:h,isCreatingFromTemplate:S})}),u.jsx(Qs,{value:"import",className:"space-y-4",children:u.jsx(uAe,{control:f,formState:h,isImportingApplication:k,setValue:m,watch:l})}),u.jsx(Qs,{value:"cli",className:"space-y-4",children:u.jsx(lAe,{defaultApplicationName:i,formState:h,watch:l})})]})})]})})})]})}const FAe={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 UAe(){const e=Wt(),{openedEntryContents:t,openedEntry:n,restrictPackageModification:r,isSavingFile:i,saveFile:o}=Fr(),{content:a,setContent:l}=Bh(!!n&&!n.package&&n.path),d=b.useCallback(C=>{l(C!==t?C:void 0)},[t,l]),f=yf(),[m,h]=b.useState(null),v=L0(n?.path),y=FAe[v]||"plaintext",x=b.useCallback((C,k)=>{h([C,k])},[]);if(b.useEffect(()=>{if(m&&f&&!n?.package&&!r)return Rke(m)},[m,f,n,r]),lb("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]),lb("RevertChanges",()=>{if(t!==void 0&&m){const[C]=m;d(void 0),C.setValue(t)}},[t,m]),!n)return null;const S=i||!!n.package||!f;return u.jsx(Fh,{className:"w-full min-h-full h-80",language:y,theme:"vs-dark",value:a??t,onMount:x,onChange:S?void 0:d,options:{automaticLayout:!0,minimap:{enabled:!1},readOnly:S,padding:{top:48}}})}function VAe(){const{openedEntry:e,openedEntryContents:t}=Fr(),n=Rje(e?.project);return e?.path===Eo?u.jsx(LAe,{}):Rr(e)?u.jsx("div",{className:"directoryReadMe max-w-3xl",children:u.jsx(HNe,{urlTransform:n,children:t})}):Jq(e?.name)?u.jsx("div",{className:"mt-9 absolute top-0 right-0 bottom-0 left-0",children:u.jsx("img",{className:"w-full h-full object-contain p-20",alt:e?.name,src:`data:image/${L0(e?.name)};base64,${t}`})}):u.jsx(UAe,{})}function BAe(e){let t=e?.fqdn;return t?(t.match(/^https?:\/\//i)||(t=`https://${t}`),new URL(t).toString()):null}function HAe(){const{clusterId:e,instanceId:t}=rt({strict:!1}),n=eh(),{data:r}=Mt(Dl(e));return!!e&&kt.checkForFabricConnect(e)||!!t&&kt.checkForFabricConnect(t)?BAe(r):n.defaults.baseURL?n.defaults.baseURL.replace(/:9925\/?/,""):null}function qAe(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 KAe({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 VK(e,t,n,r=[]){const i=[];for(const o of e){const a=n(o,r);i.push(a);const l=o,d=l[t];d&&(a[t]=VK(d,t,n,[...r,l]))}return i}function GAe({children:e}){const t=jn(),[n,r]=b.useState(void 0),[i,o]=b.useState(void 0),{setContent:a}=Bh(n?.path),l=Wt(),d=HAe(),f=ir(),{open:m}=Tr({strict:!1}),{data:h}=Ji(KAe(l)),v=b.useMemo(()=>{const L=new Set;return{rootEntries:VK(h.entries||[],"entries",($,P)=>{const U=Rr($)&&$.entries.find(J=>J.name.toLowerCase()==="readme.md"),O=[...P.map(J=>J.name),$.name].join("/");return L.add(O),{name:$.name,path:O,project:(P[0]||$)?.name,package:(P[0]||$)?.package,overviewEntry:U&&!Rr(U)&&{name:U.name,path:[...P.map(J=>J.name),$.name,U.name].join("/"),project:(P[0]||$)?.name,package:(P[0]||$)?.package}||void 0}}),pathsRegistry:L}},[h]),y=b.useCallback(async()=>f.fetchQuery({queryKey:[l.entityId,"get_components"],networkMode:"online"}),[f,l]),x=b.useCallback(L=>v.pathsRegistry.has(L),[v.pathsRegistry]),S=v.rootEntries.filter(L=>!L.package&&L.path!==Eo).map(L=>L.name);let C=S[0],k=S.slice(0,1);C||(C=Eo,k=[Eo]);const[E,j]=jd(`FileFocused/${l.entityId}`,C),[R,N]=jd(`FolderOpened/${l.entityId}`,S),[T,A]=jd(`FileSelected/${l.entityId}`,k);b.useEffect(()=>{if(m?.length){const L=m.split("?"),ne=L[0],$=L[1],P=ne.split("/");if($){const U=$.split("=");ri(U[0],U[1]==="true"?!0:U[1]==="false"?!1:U[1])}N(U=>{const O=new Set(U);for(let J=1;J<P.length;J++)O.add(P.slice(0,J).join("/"));return[...O]}),A([ne]),j(ne),t({search:void 0})}},[t,m,N,j,A]);const D=n&&(Rr(n)?n.overviewEntry?.path:n.path)||"",F=n&&(Rr(n)?n.overviewEntry?.project:n.project)||"",K=n&&(Rr(n)?!!n.overviewEntry?.path:!1)||!1,te=e7({file:D?.split("/").slice(1).join("/"),project:F,...l}),{data:G}=Mt(yke({file:D?.split("/").slice(1).join("/"),project:F,...l}));b.useEffect(function(){const ne=G?.project+"/"+G?.file;let $=G?.message;ne===D&&$!==void 0?(K&&d&&G&&($=qAe($,d,G)),o($)):o(void 0)},[G,D,K,l]);const{mutate:q,isPending:V}=t7(),H=b.useCallback((L,ne)=>{q(L,{onSuccess:()=>{n?.path===ne&&L.payload!==void 0&&(a(void 0),o(L.payload||void 0),f.setQueryData(te,{...G,message:L.payload}))},onError:$=>{console.error("Error saving file:",$)}})},[te,G,n?.path,f,q,a]),z=b.useMemo(()=>n?n.package?.includes("github.com/HarperDB/status-check-fabric")||n.package?.includes("github.com/HarperFast/status-check-fabric")||n.path===Xs||n.path===Eo:!1,[n]),W=b.useMemo(()=>({rootEntries:v.rootEntries,reloadRootEntries:y,entryExists:x,focusedItem:E,setFocusedItem:j,expandedItems:R,setExpandedItems:N,selectedItems:T,setSelectedItems:A,restrictPackageModification:z,openedEntry:n,setOpenedEntry:r,openedEntryContents:i,setOpenedEntryContents:o,saveFile:H,isSavingFile:V}),[v.rootEntries,y,x,E,j,R,N,T,A,z,n,r,i,o,H,V]);return u.jsx(Wq.Provider,{value:W,children:e})}function Hl(e){const t=e;if(t?.focus)VM(t);else{const n=e;n?.target?.focus&&VM(n.target)}}function VM(e){qc(1).then(()=>{e.focus?.()})}function ZAe(){const{value:e,trigger:t}=Vl("ShowAddDirectoryOrFileModalType",!1),n=b.useCallback(()=>{ri("ShowAddDirectoryOrFileModalType",!1),Hl(t)},[t]),{openedEntry:r,entryExists:i,reloadRootEntries:o,setFocusedItem:a,setSelectedItems:l,setExpandedItems:d}=Fr(),f=Wt(),{mutate:m,isPending:h}=t7(),v=Cl.object({name:Cl.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()}),y=un({resolver:vn(v),defaultValues:{name:""}}),x=b.useCallback(C=>{if(!r||!e)return;const k=r.path.split("/"),E=(Rr(r)?k.slice(1):k.slice(1,-1)).join("/"),j=E?`${E}/${C.name}`:C.name;if(i(r.project+"/"+j)){Se.error(`${wo(e)} already exists!`,{description:j});return}m({file:j,project:r.project,payload:e==="directory"?void 0:"",...f},{onSuccess:()=>{o(),n(),y.reset();const R=[r.project,E,C.name].filter(Jo).join("/");a(R),l([R]),e==="directory"&&d(N=>[...N,R])}})},[m,y,n,f,r,i,o,d,a,l,e]),S=b.useCallback(()=>{n(),y.reset()},[n,y]);return u.jsx(Un,{onOpenChange:n,open:!!e,children:u.jsx(Vn,{"aria-describedby":void 0,className:"text-white",children:u.jsx(dn,{...y,children:u.jsxs("form",{onSubmit:y.handleSubmit(x),children:[u.jsxs(wr,{children:[u.jsxs(Pn,{children:["Add ",e]}),u.jsxs(Ir,{children:["Enter the name of the ",e," you want to add:"]})]}),u.jsx(De,{control:y.control,name:"name",render:({field:C})=>u.jsxs(Te,{className:"my-2",children:[u.jsx(Ne,{children:"Name"}),u.jsx(Oe,{children:u.jsx(ze,{disabled:h,type:"text",autoComplete:"off",autoCapitalize:"off",...C})}),u.jsx(Ae,{})]})}),u.jsx(Yn,{children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx(xe,{type:"button",variant:"ghostOutline",className:"rounded-full",onClick:S,children:"Cancel"}),u.jsxs(xe,{variant:"positiveOutline",type:"submit",className:"rounded-full",disabled:h,children:[u.jsx(Qr,{})," Add ",e]})]})})]})})})})}function YAe(){const{value:e,trigger:t}=Vl("ShowDeleteDirectoryOrFileModal",!1),n=Wt(),{openedEntry:r,reloadRootEntries:i,setFocusedItem:o,setSelectedItems:a,selectedItems:l}=Fr(),d=l.length>1,f=Rr(r),m=f&&r.path===r.project,h=!!r?.package,v=h?"Remove":"Delete",y=h?"Imported Application":m?"Application":f?"Directory":"File",x=b.useCallback(()=>{ri("ShowDeleteDirectoryOrFileModal",!1),Hl(t)},[t]),S=b.useCallback(async()=>{x();let k=[],E=0,j=!1;const R={label:"Cancel",onClick:()=>{j=!0}},N={label:"OK",onClick:()=>{}},T="deleting-files";for(const A of l.reverse()){k=A.split("/");const D=k[0],F=k.length>1?k.slice(1).join("/"):void 0;if(Se.loading(`${v} in progress...`,{id:T,description:`${E} of ${Wr(l.length,"item","items")}`,action:R}),await Xq({file:F,project:D,...n}),j)break;E+=1}if(j?Se.warning(`${v} canceled!`,{id:T,description:"",action:N}):Se.success(`${v} completed!`,{id:T,description:"",action:N}),k.length){const A=k.slice(0,-1).join("/");o(A||void 0),a(A?[A]:[]),i()}},[v,x,n,i,l,o,a]),C=b.useCallback(k=>{k.preventDefault(),S()},[S]);return u.jsx(Un,{onOpenChange:x,open:e,children:u.jsxs(Vn,{"aria-describedby":void 0,className:"text-white",children:[u.jsxs(wr,{children:[u.jsxs(Pn,{children:[v," ",y]}),u.jsxs(Ir,{children:["Are you sure you want to ",v.toLowerCase()," ",d?`these ${l.length} items`:`this ${y.toLowerCase()}`,"?"]}),!h&&u.jsx(Ir,{className:"whitespace-pre",children:d?l.join(`
191
- `):r?.path})]}),u.jsxs("div",{className:"flex w-full gap-4",children:[u.jsx(xe,{variant:"ghostOutline",className:"w-full rounded-full",onClick:x,children:"Cancel"}),u.jsxs(xe,{variant:"destructiveOutline",type:"button",className:"w-full rounded-full",autoFocus:!0,onClick:C,children:[u.jsx(Ca,{})," ",v," ",d?"items":y]})]})]})})}async function WAe({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 XAe(){return ut({mutationFn:WAe})}function JAe(){const{value:e,trigger:t}=Vl("ShowDownloadApplicationModal",!1),n=Wt(),{openedEntry:r}=Fr(),{mutate:i,isPending:o,isSuccess:a}=XAe(),l=a?"Downloaded":o?"Downloading":"Download",[d,f]=b.useState(!1),m=b.useCallback(y=>{f(y.target.checked)},[]),h=b.useCallback(()=>{ri("ShowDownloadApplicationModal",!1),Hl(t)},[t]),v=b.useCallback(y=>{if(y.preventDefault(),!r)return;h();const x=Se.loading("Packaging...");i({packageName:r.package,project:r.project,skipNodeModules:!d,...n},{onSuccess:S=>{Se.success("Download ready!",{id:x});const C=document.createElement("a");C.setAttribute("class","invisible absolute top-0");const k=Uint8Array.from(atob(S.payload),j=>j.charCodeAt(0)),E=new Blob([k],{type:"application/gzip"});C.href=URL.createObjectURL(E),C.download=`${r.project}.gz`,document.body.appendChild(C),C.click(),document.body.removeChild(C)}})},[r,i,d,n,h]);return u.jsx(Un,{onOpenChange:h,open:e,children:u.jsxs(Vn,{"aria-describedby":void 0,className:"text-white",children:[u.jsxs(wr,{children:[u.jsx(Pn,{children:"Download Application"}),u.jsxs(Ir,{children:["This will package up the contents of ",u.jsx("strong",{children:r?.project})," into a gzipped file."]})]}),u.jsxs(oh,{className:"flex",children:[u.jsx(ze,{type:"checkbox",className:"w-6",disabled:o,checked:d,onChange:m}),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(xe,{variant:"ghostOutline",className:"w-full rounded-full",onClick:h,children:"Cancel"}),u.jsxs(xe,{variant:"positive",type:"button",className:"w-full rounded-full",disabled:o,autoFocus:!0,onClick:v,children:[u.jsx(z4,{})," ",l,o?"...":""]})]})]})})}function ha({className:e,...t}){const{formDescriptionId:n}=wx();return u.jsx("p",{"data-slot":"form-description",id:n,className:Ue("text-muted-foreground text-sm",e),...t})}function zm(e=!1){const[t,n]=b.useState(e),r=b.useCallback(a=>{a?.preventDefault?.(),n(l=>!l)},[]),i=b.useCallback(a=>{a?.preventDefault?.(),n(!0)},[]),o=b.useCallback(a=>{a?.preventDefault?.(),n(!1)},[]);return b.useMemo(()=>({toggled:t,setToggled:n,toggle:r,toggleOn:i,toggleOff:o}),[r,n,o,i,t])}function QAe({field:e}){const{toggled:t,toggle:n}=zm(!1);return u.jsxs(Te,{className:"my-4",children:[u.jsxs(Ne,{onClick:n,className:yr("flex items-center gap-2",t?"":"text-muted-foreground italic"),children:[t?u.jsx(Pb,{}):u.jsx(xi,{})," Optional Database Name"]}),u.jsx(ha,{className:t?"":"hidden",children:'"data" is the default recommended name'}),u.jsx(Oe,{className:t?"":"hidden",children:u.jsx(ze,{type:"text",className:"my-1",...e})}),u.jsx(Ae,{})]})}var xb=(e=>(e.Any="Any",e.BigInt="BigInt",e.Blob="Blob",e.Boolean="Boolean",e.Bytes="Bytes",e.Date="Date",e.Float="Float",e.ID="ID",e.Int="Int",e.Long="Long",e.String="String",e))(xb||{});const Z0=/^[\x20-\x2E|\x30-\x5F|\x61-\x7E]*$/,BK=tt().regex(Z0,{error:"Database name cannot include backticks or forward slashes."}).max(75,{error:"Database name cannot be longer than 75 characters."}),eOe=tt().nonempty({error:"Field name is required."}).regex(Z0,{error:"Field name cannot include backticks or forward slashes."}).max(250,{error:"Field name cannot be longer than 250 characters."}),HK=tt().nonempty({error:"Table name is required."}).regex(Z0,{error:"Table name cannot include backticks or forward slashes."}).max(250,{error:"Table name cannot be longer than 250 characters."}),tOe=Dt({tableName:HK,databaseName:BK,expiration:yR().or(Cf("")),enableRest:Qt(),sealed:Qt(),tableFields:ds(Dt({fieldName:eOe,fieldType:Ml(xb),primaryKey:Qt(),nullable:Qt(),indexed:Qt(),array:Qt()})).min(1,{error:"Please add at least one field."})});function nOe({field:e}){const{toggled:t,toggle:n}=zm(!1),r=b.useCallback(i=>e.onChange(i.target.value?parseInt(i.target.value,10):i.target.value),[]);return u.jsxs(Te,{className:"my-4",children:[u.jsxs(Ne,{onClick:n,className:yr("flex items-center gap-2",t?"":"text-muted-foreground italic"),children:[t?u.jsx(Pb,{}):u.jsx(xi,{})," Optional Expiration"]}),u.jsx(ha,{className:t?"":"hidden",children:"After how many seconds should records be automatically evicted? Leave blank or set to 0 to skip this feature. (It can be useful for cache records.)"}),u.jsx(Oe,{className:t?"":"hidden",children:u.jsx(ze,{...e,type:"number",min:0,step:1,className:"my-1",onChange:r})}),u.jsx(Ae,{})]})}function rOe(){const e=Xa("ShowNewTableModal",!1),{openedEntry:t,openedEntryContents:n}=Fr(),{setContent:r}=Bh(!!t&&!t.package&&t.path),i=un({resolver:vn(tOe),defaultValues:{tableName:"",databaseName:"data",expiration:"",enableRest:!0,sealed:!0,tableFields:[{fieldName:"id",fieldType:xb.ID,primaryKey:!0,nullable:!0,indexed:!1,array:!1}]}}),{control:o,handleSubmit:a,formState:l}=i,{fields:d,append:f,remove:m}=dj({name:"tableFields",control:o}),h=b.useCallback(()=>{f({fieldName:"",fieldType:xb.String,primaryKey:!1,nullable:!1,indexed:!1,array:!1})},[f]),v=b.useCallback(async y=>{r(x=>{const S=x||n||"",C=[!!y.databaseName&&y.databaseName!=="data"&&`database: "${y.databaseName}"`,!!y.expiration&&y.expiration>0&&`expiration: ${y.expiration}`].filter(Jo),k=C.length?`(${C.join(", ")})`:"",E=y.enableRest?" @export":"",j=y.sealed?" @sealed":"",R=y.tableFields.map(N=>{const T=N.array?`[${N.fieldType}]`:N.fieldType,A=N.nullable?"":"!",D=N.primaryKey?" @primaryKey":"",F=N.indexed?" @indexed":"";return`
192
- ${N.fieldName}: ${T}${A}${D}${F}`}).join("");return`${S}
193
- type ${y.tableName} @table${k}${E}${j} {${R}
194
- }
195
- `}),e()},[r,e,n]);return u.jsx(dn,{...i,children:u.jsxs("form",{onSubmit:a(v),children:[u.jsx(De,{control:o,name:"tableName",render:({field:y})=>u.jsxs(Te,{className:"my-4",children:[u.jsx(Ne,{children:"Table Name"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",className:"my-1",...y})}),u.jsx(Ae,{})]})}),u.jsx("h3",{className:"text-lg",children:"Table Fields"}),d.map((y,x)=>u.jsxs("div",{className:"p-4 my-2 border rounded-lg",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsx(De,{control:o,name:`tableFields.${x}.fieldName`,render:({field:S})=>u.jsxs(Te,{children:[u.jsx(Ne,{children:"Field Name"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",...S})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:o,name:`tableFields.${x}.fieldType`,render:({field:S})=>u.jsxs(Te,{children:[u.jsx(Ne,{children:"Type"}),u.jsx(Oe,{children:u.jsxs(Gi,{...S,onValueChange:S.onChange,defaultValue:S.value,children:[u.jsx(Yi,{className:"w-full",children:u.jsx(Zi,{})}),u.jsxs(Wi,{children:[u.jsx($t,{value:"Any",children:"Any"}),u.jsx($t,{value:"BigInt",children:"BigInt"}),u.jsx($t,{value:"Blob",children:"Blob"}),u.jsx($t,{value:"Boolean",children:"Boolean"}),u.jsx($t,{value:"Bytes",children:"Bytes"}),u.jsx($t,{value:"Date",children:"Date"}),u.jsx($t,{value:"Float",children:"Float"}),u.jsx($t,{value:"ID",children:"ID"}),u.jsx($t,{value:"Int",children:"Int"}),u.jsx($t,{value:"Long",children:"Long"}),u.jsx($t,{value:"String",children:"String"})]})]})}),u.jsx(Ae,{})]})})]}),u.jsxs("div",{className:"flex flex-wrap items-center mt-2 gap-x-2 md:gap-x-4",children:[u.jsx(De,{control:o,name:`tableFields.${x}.indexed`,render:({field:S})=>u.jsxs(Te,{className:"inline-flex",children:[u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-5",checked:S.value,onChange:C=>S.onChange(C.target.checked)})}),u.jsx(Ne,{className:"flex-1 py-2.5",children:"Indexed"}),u.jsx(Ae,{})]})}),u.jsx(De,{control:o,name:`tableFields.${x}.primaryKey`,render:({field:S})=>u.jsxs(Te,{className:"inline-flex",children:[u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-5",checked:S.value,onChange:C=>S.onChange(C.target.checked)})}),u.jsx(Ne,{className:"flex-1 py-2.5",children:"Primary Key"}),u.jsx(Ae,{})]})}),u.jsx(De,{control:o,name:`tableFields.${x}.nullable`,render:({field:S})=>u.jsxs(Te,{className:"inline-flex",children:[u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-5",checked:S.value,onChange:C=>S.onChange(C.target.checked)})}),u.jsx(Ne,{className:"flex-1 py-2.5",children:"Nullable"}),u.jsx(Ae,{})]})}),u.jsx(De,{control:o,name:`tableFields.${x}.array`,render:({field:S})=>u.jsxs(Te,{className:"inline-flex",children:[u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-5",checked:S.value,onChange:C=>S.onChange(C.target.checked)})}),u.jsx(Ne,{className:"flex-1 py-2.5",children:"Array"}),u.jsx(Ae,{})]})}),u.jsx("div",{className:"grow"}),u.jsxs(xe,{type:"button",variant:"destructiveGhost",className:"rounded-full",onClick:()=>m(x),children:[u.jsx(Ca,{})," Remove Field"]})]})]},y.id)),u.jsxs(xe,{variant:"ghost",type:"button",className:"w-full",onClick:h,children:[u.jsx(Qr,{})," Add Another Field"]}),u.jsx("hr",{className:"my-6 border-gray-600"}),u.jsx(De,{control:o,name:"databaseName",render:({field:y})=>u.jsx(QAe,{field:y})}),u.jsx(De,{control:o,name:"expiration",render:({field:y})=>u.jsx(nOe,{field:y})}),u.jsx(De,{control:o,name:"enableRest",render:({field:y})=>u.jsxs(Te,{className:"flex",children:[u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-5",checked:y.value,onChange:x=>y.onChange(x.target.checked)})}),u.jsxs(Ne,{className:"flex-1 py-2.5",children:["Make available as a REST endpoint (add"," ",u.jsx("code",{className:"text-muted-foreground italic ml-1",children:"@export"}),")"]}),u.jsx(Ae,{})]})}),u.jsx(De,{control:o,name:"sealed",render:({field:y})=>u.jsxs(Te,{className:"flex",children:[u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-5",checked:y.value,onChange:x=>y.onChange(x.target.checked)})}),u.jsxs(Ne,{className:"flex-1 py-2.5",children:["Sealed (add",u.jsx("code",{className:"text-muted-foreground italic ml-1",children:"@sealed"})," to ignore unspecified properties)"]}),u.jsx(Ae,{})]})}),u.jsxs("div",{className:"text-muted-foreground italic text-sm pb-2",children:["There are even more directives available to you when editing your schema.graphql by hand! You can read more about them"," ",u.jsx("a",{className:"underline",target:"_blank",rel:"noreferrer",href:"https://docs.harperdb.io/docs/developers/applications/defining-schemas",children:"in our documentation"}),"."]}),u.jsxs("div",{className:"flex w-full gap-4 sticky -bottom-6 pb-6 pt-4 bg-black",children:[u.jsxs(xe,{variant:"ghost",className:"w-full rounded-full",onClick:e,children:[u.jsx(Gee,{})," Cancel"]}),u.jsxs(xe,{variant:"positive",type:"submit",className:"w-full rounded-full",disabled:!l.isValid,children:[u.jsx(Qr,{})," New Table"]})]})]})})}function iOe(){const{value:e,trigger:t}=Vl("ShowNewTableModal",!1),n=b.useCallback(()=>{ri("ShowNewTableModal",!1),Hl(t)},[t]);return u.jsx(Un,{onOpenChange:n,open:e,children:u.jsxs(Vn,{"aria-describedby":void 0,className:"text-white",children:[u.jsxs(wr,{children:[u.jsx(Pn,{children:"New Table"}),u.jsx(Ir,{children:"Creating a table is the basis of a data-driven application and can immediately be used as RESTful endpoints. This can also be configured as a caching table and extended and customized for specific endpoint behavior."})]}),u.jsx(rOe,{})]})})}function oOe(){const{value:e,trigger:t}=Vl("ShowRedeployApplicationModal",!1),n=ir(),r=Wt(),{openedEntry:i}=Fr(),o=i?.package,{mutate:a,isPending:l}=UK(),d=un({defaultValues:{applicationUrl:o,installCommand:""}}),{control:f,handleSubmit:m,reset:h}=d;b.useEffect(()=>{h({applicationUrl:o})},[h,o]);const v=b.useCallback(()=>{ri("ShowRedeployApplicationModal",!1),Hl(t),h({applicationUrl:o})},[h,o,t]),y=b.useCallback((S,C)=>{if(!i)return;v();const k=Se.loading("Redeploying...");a({applicationName:i.project,applicationUrl:S,installCommand:C,...r},{onSuccess:()=>{Se.success(`Application ${i.project} redeployed successfully`,{id:k}),n.invalidateQueries({queryKey:[r.entityId,"get_components"],refetchType:"active"})},onError:()=>{Se.dismiss(k)}})},[a,i,r,n,v]),x=({applicationUrl:S,installCommand:C})=>{S&&y(S,C)};return u.jsx(Un,{onOpenChange:v,open:e,children:u.jsxs(Vn,{"aria-describedby":void 0,className:"text-white",children:[u.jsxs(wr,{children:[u.jsx(Pn,{children:"Redeploy Package"}),u.jsx(Ir,{children:"Redeploy this package?"})]}),u.jsx("div",{children:u.jsx(dn,{...d,children:u.jsxs("form",{className:"flex flex-col w-full gap-4",onSubmit:m(x),children:[u.jsx(De,{control:f,name:"applicationUrl",render:({field:S})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Package Reference"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",autoFocus:!0,...S})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:f,name:"installCommand",render:({field:S})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Install Command"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",placeholder:"npm install",...S})}),u.jsx(Ae,{})]})}),u.jsxs(xe,{variant:"positiveOutline",type:"submit",className:"w-full rounded-full",disabled:l,children:[u.jsx(xa,{})," Redeploy Application"]}),u.jsx(xe,{type:"button",variant:"ghostOutline",className:"w-full rounded-full",onClick:v,disabled:l,children:"Cancel"})]})})})]})})}function aOe(e){return PI(e.split("/").slice(0,-1))}function sOe(e,t){return PI(aOe(e),t)}function lOe(){const{value:e,trigger:t}=Vl("ShowRenameFileModal",!1),n=b.useCallback(()=>{ri("ShowRenameFileModal",!1),Hl(t)},[t]),{openedEntry:r,entryExists:i}=Fr(),o=Cl.object({name:Cl.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(v=>v!==r?.name,{error:"Please enter a new name."})}),[a,l]=b.useState(!1),d=n7(),f=un({resolver:vn(o)});b.useEffect(()=>{r?.name&&f.reset({name:r?.name})},[f,r?.name]);const m=b.useCallback(async v=>{if(!r)return;const y=sOe(r.path,v.name);if(i(y)){Se.error(`${Rr(r)?"Directory":"File"} already exists!`,{description:y});return}l(!0),await d([{from:r.path,to:y}]),n(),f.reset(),l(!1)},[n,i,f,r,d,l]),h=b.useCallback(()=>{n(),f.reset()},[n,f]);return u.jsx(Un,{onOpenChange:n,open:e,children:u.jsx(Vn,{"aria-describedby":void 0,className:"text-white",children:u.jsx(dn,{...f,children:u.jsxs("form",{onSubmit:f.handleSubmit(m),children:[u.jsxs(wr,{children:[u.jsx(Pn,{children:"Rename File"}),u.jsx(Ir,{children:r?.path})]}),u.jsx(De,{control:f.control,name:"name",render:({field:v})=>u.jsxs(Te,{className:"my-2",children:[u.jsx(Ne,{children:"Name"}),u.jsx(Oe,{children:u.jsx(ze,{disabled:a,type:"text",autoComplete:"off",autoCapitalize:"off",...v})}),u.jsx(Ae,{})]})}),u.jsx(Yn,{children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx(xe,{type:"button",variant:"ghostOutline",className:"rounded-full",onClick:h,children:"Cancel"}),u.jsxs(xe,{variant:"positiveOutline",type:"submit",className:"rounded-full",disabled:a||!f.formState.isDirty||!f.formState.isValid,children:[u.jsx(B4,{})," Rename"]})]})})]})})})})}function cOe(){const{toggle:e,toggled:t}=vke("ApplicationsSidebarOpened",!0);return u.jsxs(GAe,{children:[u.jsx("aside",{id:"file-explorer-sidebar",className:yr("pt-[calc(--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(Sje,{})}),u.jsxs("div",{className:yr("applications-content","overflow-y-auto overflow-x-hidden","fixed top-32 right-0 bottom-0 left-0","transition-[left]","md:left-56",t&&"sm:left-56"),children:[u.jsx(VAe,{}),u.jsx(jje,{toggledSidebar:t,toggleSidebar:e})]}),u.jsx(ZAe,{}),u.jsx(iOe,{}),u.jsx(YAe,{}),u.jsx(JAe,{}),u.jsx(oOe,{}),u.jsx(lOe,{})]})}function uOe(e){return[nt({getParentRoute:()=>e,path:"/",component:cOe})]}const rl="flex items-center p-2 rounded-lg group",il={className:"text-white hover:bg-gray-700"},ol={className:"text-black bg-white pointer-events-none cursor-default"};function dOe(){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(fOe,{}),u.jsx(pOe,{})]}),u.jsx("section",{className:"col-span-1 text-white md:col-span-8 lg:col-span-9 md:pt-4",children:u.jsx(b.Suspense,{fallback:u.jsx(no,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:u.jsx(jl,{})})})]})}function fOe(){const e=rt({strict:!1}),t=FE();return u.jsxs("div",{className:"hidden md:block pl-4 pt-4",children:[u.jsxs(Ze,{to:ur(e,"config"),className:rl,activeOptions:{exact:!0},inactiveProps:il,activeProps:ol,children:[u.jsx(A4,{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(Ze,{to:ur(e,"config/users"),className:rl,inactiveProps:il,activeProps:ol,children:[u.jsx(K4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Users"})]})}),u.jsx("li",{children:u.jsxs(Ze,{to:ur(e,"config/roles"),className:rl,inactiveProps:il,activeProps:ol,children:[u.jsx(L4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Roles"})]})}),u.jsx("li",{children:u.jsxs(Ze,{to:ur(e,"config/ssh-keys"),className:rl,inactiveProps:il,activeProps:ol,children:[u.jsx(F4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"SSH Keys"})]})})]})]})}function pOe(){const e=rt({strict:!1}),t=FE();return u.jsxs("ul",{className:"flex space-x-4 md:hidden py-2 px-4",children:[u.jsx("li",{children:u.jsxs(Ze,{to:ur(e,"config"),className:rl,activeOptions:{exact:!0},inactiveProps:il,activeProps:ol,children:[u.jsx(A4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Overview"})]})}),t&&u.jsxs(u.Fragment,{children:[u.jsx("li",{children:u.jsxs(Ze,{to:ur(e,"config/users"),className:rl,inactiveProps:il,activeProps:ol,children:[u.jsx(K4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Users"})]})}),u.jsx("li",{children:u.jsxs(Ze,{to:ur(e,"config/roles"),className:rl,inactiveProps:il,activeProps:ol,children:[u.jsx(L4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Roles"})]})}),u.jsx("li",{children:u.jsxs(Ze,{to:ur(e,"config/ssh-keys"),className:rl,inactiveProps:il,activeProps:ol,children:[u.jsx(F4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"SSH Keys"})]})})]})]})}async function mOe({clusterId:e,instanceId:t}){return null}function hOe(e){return{queryKey:[e.clusterId,e.instanceId],queryFn:()=>mOe(e),retry:!1}}const gOe=({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(Mr,{className:"w-10"}):t?.version||"Unknown"})]});function vOe({entityId:e,instanceClient:t}){return{queryKey:[e,"get_configuration"],queryFn:async()=>{const{data:n}=await t.post("/",{operation:"get_configuration"});return n}}}function iT({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 yOe({entityId:e,instanceClient:t},n){return{queryKey:[e,"get_usage_licenses"],enabled:n,queryFn:async()=>{try{const{data:r}=await t.post("/",{operation:"get_usage_licenses"});return r}catch(r){return console.error(r),null}}}}function BM(e,t){const n=HM(e),r=HM(t);return!n||!r?!1:xOe(r,n)>=0}function HM(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=H1(o[0]),l=H1(o[1]??"0"),d=H1(o[2]??"0");if(a==null||l==null||d==null)return null;const f=i?i.split(".").map(m=>bOe(m)?Number(m):m):[];return{major:a,minor:l,patch:d,pre:f}}function H1(e){return e==null||e===""||!/^\d+$/.test(e)?null:Number(e)}function bOe(e){return/^\d+$/.test(e)}function xOe(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],l=t.pre[o],d=typeof a=="number",f=typeof l=="number";if(d&&f){if(a!==l)return a<l?-1:1;continue}if(d&&!f)return-1;if(!d&&f)return 1;if(a!==l)return String(a)<String(l)?-1:1}return e.pre.length!==t.pre.length?e.pre.length<t.pre.length?-1:1:0}const wOe=({children:e})=>u.jsx(u.Fragment,{children:e});function SOe(){const{clusterId:e,instanceId:t}=rt({strict:!1}),{data:n,isLoading:r}=Mt(hOe({clusterId:e,instanceId:t})),i="Instance",o=Wt(),{version:a}=qm({strict:!1}),l=!xd,{data:d}=Mt(yOe(o,l));n?.cluster;const f=n?.instance,{data:m,isLoading:h}=Mt(iT(o)),{data:v,isLoading:y}=Mt(vOe(o));return b.useMemo(()=>[],[e,t,d,f]),u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsx(wOe,{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(gOe,{loadingRegistration:h,registrationInfo:m})}),u.jsx("div",{className:"px-4 pb-4 text-right sm:col-span-1 sm:px-0",children:u.jsx($7,{targetNoun:i,instanceClient:o.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:y?u.jsxs(u.Fragment,{children:[u.jsx(Mr,{className:"w-full"}),u.jsx(Mr,{className:"w-full"}),u.jsx(Mr,{className:"w-1/2"})]}):u.jsx(M0,{className:"w-full min-h-full h-96",language:"json",theme:"vs-dark",options:{readOnly:!0,scrollBeyondLastLine:!1},value:JSON.stringify(v,null,4)})})]})}const Gv=I0(),_Oe=[{header:"Role",accessorKey:"role",enableSorting:!1},Gv.display({header:"Created",enableSorting:!1,id:"__createdtime__",cell:e=>Tc((Date.now()-e.row.original.__createdtime__)/1e3,e.row.original.__createdtime__)}),Gv.display({header:"Updated",id:"__updatedtime__",enableSorting:!1,cell:e=>Tc((Date.now()-e.row.original.__updatedtime__)/1e3,e.row.original.__updatedtime__)}),Gv.display({header:"Super User",id:"super_user",enableSorting:!1,cell:e=>e.row.original.permission.super_user?"Yes":"No"}),Gv.display({header:"Structure User",id:"structure_user",enableSorting:!1,cell:e=>e.row.original.permission.structure_user?"Yes":"No"})];async function COe(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 kOe(){return ut({mutationFn:COe})}const EOe=Dt({role:tt().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:Qt(),structure_user:Qt()});function jOe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const r=un({resolver:vn(EOe),defaultValues:{role:"",super_user:!1,structure_user:!1}}),i=Wt(),{mutate:o,isPending:a}=kOe(),l=b.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),Se.success("Role added successfully!"),n(!1)}})},[o,r,i,t,n]),d=b.useCallback(()=>{r.reset(),n(!1)},[r,n]);return u.jsx(Un,{onOpenChange:n,open:e,children:u.jsx(Vn,{"aria-describedby":void 0,children:u.jsx(dn,{...r,children:u.jsxs("form",{onSubmit:r.handleSubmit(l),className:"grid gap-4 my-4 md:grid-cols-2",children:[u.jsxs(wr,{className:"md:col-span-2",children:[u.jsx(Pn,{children:"Add New Role"}),u.jsx(Ir,{children:"After adding the role, you will be able to edit the per-table permissions."})]}),u.jsx(De,{control:r.control,name:"role",render:({field:f})=>u.jsxs(Te,{className:"md:col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Name"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",...f})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:r.control,name:"super_user",render:({field:f})=>u.jsxs(Te,{className:"flex",children:[u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-6",checked:f.value,onChange:m=>f.onChange(m.target.checked)})}),u.jsx(Ne,{className:"pl-4 pr-8 flex-1 py-2.5",children:"Super User"}),u.jsx(Ae,{})]})}),u.jsx(De,{control:r.control,name:"structure_user",render:({field:f})=>u.jsxs(Te,{className:"flex",children:[u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-6",checked:f.value,onChange:m=>f.onChange(m.target.checked)})}),u.jsx(Ne,{className:"pl-4 pr-8 flex-1 py-2.5",children:"Structure User"}),u.jsx(Ae,{})]})}),u.jsx(Yn,{className:"md:col-span-2",children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx(xe,{variant:"destructiveOutline",type:"button",className:"rounded-full",onClick:d,disabled:a,children:"Cancel"}),u.jsxs(xe,{type:"submit",variant:"submit",className:"rounded-full",disabled:a,children:[u.jsx(To,{})," Add Role"]})]})})]})})})})}function oT({entityId:e,instanceClient:t}){return{queryKey:[e,"list_roles"],queryFn:()=>ROe({instanceClient:t}),refetchInterval:1e4}}async function ROe({instanceClient:e}){const{data:t}=await e.post("/",{operation:"list_roles"});return t}function IOe({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,l]=n.split(".").map(f=>parseInt(f,10)),d=n!=="2.0.000"&&o<=2&&a<=1&&l<=2;for(const f in e){i[f]={tables:{}};for(const m in e[f]){const v=e[f][m].attributes.map(y=>y.attribute).sort();if(d){const y=t&&t[f]&&t[f].tables[m];i[f].tables[m]=TOe(y,v,r)}else{const y=t&&t[f]&&t[f].tables[m];i[f].tables[m]=NOe(y,v,r)}}}return i}function TOe(e,t,n){const r=e&&Mh(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 NOe(e,t,n){const r=e&&Mh(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 AOe({id:e,permission:t,instanceClient:n}){const{data:r}=await n.post("/",{operation:"alter_role",id:e,permission:t});return r}function OOe(){return ut({mutationFn:AOe})}async function $Oe({id:e,instanceClient:t}){const{data:n}=await t.post("/",{operation:"drop_role",id:e});return n}function DOe(){return ut({mutationFn:$Oe})}function qK({entityId:e,instanceClient:t}){return{queryKey:[e,"describe_all"],queryFn:async()=>{const{data:n}=await t.post("/",{operation:"describe_all"});return n},staleTime:6e4,gcTime:5e3,retry:!1}}function POe({data:e,instanceId:t,clusterId:n,isModalOpen:r,closeModal:i,onSelectRole:o,onChangesSaved:a}){const{role:l,permission:d}=e,[f,m]=b.useState(JSON.stringify(d,null,2)),h=Wt(),[v,y]=b.useState(!0),{data:x}=Mt(qK(h)),{data:S}=Mt(iT(h)),k=ms().user?.role?.role===e.role,[E,j]=Uq(f?.includes("attribute_name")),{mutate:R,isPending:N}=OOe(),{mutate:T}=DOe(),A=b.useCallback(q=>{y(q.length===0)},[y]),D=b.useMemo(()=>JSON.stringify(x&&S&&IOe({instanceDatabaseMap:x,currentRolePermissions:f&&Ph(f)||d,version:S.version,showAttributes:E}),null,2),[d,x,S,E,f]);b.useEffect(()=>{m(D)},[D]);const F=b.useCallback(q=>{if(q){const V=JSON.parse(q);if(V.super_user||V.structure_user||V.cluster_user)for(const H in V)(H!=="super_user"&&H!=="structure_user"&&H!=="cluster_user"||V[H]===!1)&&delete V[H];R({id:e.id,permission:V,...h},{onSuccess:()=>{Se.success("Role updated successfully!"),o(void 0),a()}})}},[R,e.id,h,a,o]),K=b.useCallback(()=>{T({id:e.id,...h},{onSuccess:()=>{Se.success("Role deleted successfully!"),o(void 0),a()}})},[e.id,T,h,a,o]),te=b.useCallback(()=>{f&&v&&F(f)},[f,F,v]),G=b.useCallback(()=>{K()},[K]);return u.jsx(Un,{onOpenChange:i,open:r,children:u.jsxs(Vn,{className:"sm:max-w-[750px]",children:[u.jsxs(Pn,{children:[k?"View":"Edit",' Role "',l,'"']}),u.jsx(Ir,{children:k?"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."}),D?u.jsx(Fh,{theme:"vs-dark",height:"400px",defaultLanguage:"json",value:f,options:k?{readOnly:!0}:void 0,onValidate:A,onChange:m,defaultValue:D}):u.jsx(Mr,{}),u.jsx(Yn,{children:!k&&u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx(xe,{type:"button",variant:"destructiveOutline",className:"rounded-full",onClick:G,disabled:N,children:"Delete Role"}),u.jsx("div",{className:"grow"}),u.jsxs(oh,{className:"flex",children:[u.jsx(ze,{type:"checkbox",className:"w-6",checked:E,onChange:j}),u.jsx("span",{className:"pl-4 pr-8 flex-1 py-2.5",children:"Pick Attributes"})]}),u.jsx(xe,{variant:"submit",className:"rounded-full",onClick:te,disabled:N||!v,children:"Save Changes"})]})})]})})}function qM(){const e=jn(),{clusterId:t,instanceId:n,roleId:r}=rt({strict:!1}),i=Wt(),{data:o,refetch:a,isFetching:l,isRefetching:d}=Ji(oT(i)),f=b.useMemo(()=>o?.find(j=>j.id===r),[o,r]),m=b.useCallback(j=>{const R=[r?"..":"",j].filter(Boolean);e({to:R.join("/")})},[r,e]),h=!!r&&!!f,[v,y]=b.useState(!1),x=b.useCallback(()=>{y(!0)},[y]),S=b.useCallback(j=>{a(),y(!1),m(j)},[m,a]),C=b.useCallback(j=>{m(j.original.role)},[m]),k=b.useCallback(()=>{m(void 0)},[m]),E=Ul(a);return u.jsxs(b.Suspense,{fallback:u.jsx(no,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(If,{columns:_Oe,data:o,isFetching:l,onRowClick:C,children:[u.jsxs(xe,{variant:"defaultOutline",onClick:E,accessKey:"r",disabled:l||d,children:[u.jsx(xa,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),u.jsxs(xe,{variant:"positiveOutline",onClick:x,accessKey:"a",disabled:v,children:[u.jsx(Qr,{}),u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),u.jsx(jOe,{isModalOpen:v,onChangesSaved:S,setIsModalOpen:y}),h&&u.jsx(POe,{instanceId:n,clusterId:t,isModalOpen:h,closeModal:k,data:f,onSelectRole:m,onChangesSaved:()=>a()})]})}async function MOe({instanceClient:e}){const{data:t}=await e.post("/",{operation:"list_ssh_keys"});return t}function zOe(e){return{queryKey:[e.entityId,"list_ssh_keys"],queryFn:()=>MOe(e)}}const LOe=[{header:"SSH Key Name",accessorKey:"name",enableSorting:!1}];function wb({className:e,...t}){return u.jsx("textarea",{"data-slot":"input",className:Ue(`border-input file:text-foreground placeholder:text-muted-foreground selection:bg-purple
196
- selection:text-primary-foreground
197
- dark:aria-invalid:outline-destructive dark:aria-invalid:ring-destructive/50 ring-ring/10
198
- dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 aria-invalid:outline-destructive/60
199
- aria-invalid:ring-destructive/20 aria-invalid:border-destructive/60 dark:aria-invalid:border-destructive
200
- flex w-full min-w-0 rounded-md border bg-grey-700 px-3 py-1 text-base text-white
201
- file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium
202
- focus-visible:ring-1 focus-visible:outline-none focus-visible:ring-purple disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50
203
- 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 FOe({instanceClient:e}){const{data:t}=await e.post("/",{operation:"get_ssh_known_hosts"});return t}function UOe(e){return{queryKey:[e.entityId,"get_ssh_known_hosts"],queryFn:()=>FOe(e)}}const VOe=Dt({known_hosts:tt().trim()});async function BOe(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 HOe(){return ut({mutationFn:BOe})}function qOe(){const e=Wt(),{data:t}=Ji(UOe(e)),n=un({resolver:vn(VOe),defaultValues:{known_hosts:t?.known_hosts||""}}),{mutate:r,isPending:i}=HOe(),o=b.useCallback(async a=>{const{known_hosts:l}=a;l&&r({known_hosts:l.trim()+`
204
- `,...e},{onSuccess:()=>{n.reset(a),Se.success("Known hosts saved!")}})},[r,n,e]);return u.jsx(dn,{...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(De,{control:n.control,name:"known_hosts",render:({field:a})=>u.jsxs(Te,{className:"md:col-span-2 gap-0",children:[u.jsx(Ne,{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(ha,{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(Oe,{children:u.jsx(wb,{autoComplete:"off",autoCapitalize:"off",className:"whitespace-nowrap",rows:10,...a})}),u.jsx(Ae,{}),u.jsxs(xe,{type:"submit",variant:"submit",className:"rounded-full mt-2",disabled:i||!n.formState.isDirty||!n.formState.isValid,children:[u.jsx(To,{})," ",i?"Saving":"Save"," Known Hosts",i?"...":""]})]})]})})})})}const KOe=Dt({name:tt().trim().min(1).regex(/^[a-zA-Z0-9-_]*$/,{error:"Can only contain letters, numbers, dashes and underscores."}),key:tt().min(1).trim(),host:tt().min(1).trim(),hostname:tt().min(1).trim(),known_hosts:tt().trim().optional()});async function GOe(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 ZOe(){return ut({mutationFn:GOe})}function YOe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const r=un({resolver:vn(KOe),defaultValues:{name:"",key:"",host:"",hostname:"",known_hosts:""}}),i=Wt(),{mutate:o,isPending:a}=ZOe(),l=b.useCallback(async f=>{if(f){const{name:m,key:h,host:v,hostname:y,known_hosts:x}=f;o({name:m,key:h.trim()+`
205
- `,host:v,hostname:y,known_hosts:x||void 0,...i},{onSuccess:()=>{r.reset(),t(),Se.success("SSH Key added successfully!"),n(!1)}})}},[o,r,i,t,n]),d=b.useCallback(()=>{r.reset(),n(!1)},[r,n]);return u.jsx(Un,{onOpenChange:n,open:e,children:u.jsx(Vn,{"aria-describedby":void 0,children:u.jsx(dn,{...r,children:u.jsxs("form",{onSubmit:r.handleSubmit(l),className:"grid gap-4 my-4 md:grid-cols-2",children:[u.jsxs(wr,{className:"md:col-span-2",children:[u.jsx(Pn,{children:"Add New SSH Key"}),u.jsx(Ir,{children:"Enter the details of your SSH Key below."})]}),u.jsx(De,{control:r.control,name:"name",render:({field:f})=>u.jsxs(Te,{className:"md:col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Name"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",autoComplete:"off",autoCapitalize:"off",autoFocus:!0,...f})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:r.control,name:"key",render:({field:f})=>u.jsxs(Te,{className:"md:col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Key"}),u.jsx(ha,{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(Oe,{children:u.jsx(wb,{autoComplete:"off",autoCapitalize:"off",rows:3,...f})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:r.control,name:"host",render:({field:f})=>u.jsxs(Te,{className:"md:col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Host"}),u.jsx(ha,{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(Oe,{children:u.jsx(ze,{type:"text",autoComplete:"off",autoCapitalize:"off",...f})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:r.control,name:"hostname",render:({field:f})=>u.jsxs(Te,{className:"md:col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Hostname"}),u.jsx(ha,{children:'When making the request, the actual hostname to use, i.e. "github.com".'}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",autoComplete:"off",autoCapitalize:"off",...f})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:r.control,name:"known_hosts",render:({field:f})=>u.jsxs(Te,{className:"md:col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Known Hosts"}),u.jsx(ha,{children:"Optionally, append known hosts, one per line. GitHub known hosts should resolve automatically."}),u.jsx(Oe,{children:u.jsx(wb,{autoComplete:"off",autoCapitalize:"off",className:"whitespace-nowrap",rows:3,...f})}),u.jsx(Ae,{})]})}),u.jsx(Yn,{className:"md:col-span-2",children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx(xe,{variant:"destructiveOutline",type:"button",className:"rounded-full",onClick:d,disabled:a,children:"Cancel"}),u.jsxs(xe,{type:"submit",variant:"submit",className:"rounded-full",disabled:a||!r.formState.isDirty||!r.formState.isValid,children:[u.jsx(To,{})," Add SSH Key"]})]})})]})})})})}async function WOe(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 XOe(){return ut({mutationFn:WOe})}async function JOe({name:e,instanceClient:t}){const{data:n}=await t.post("/",{operation:"get_ssh_key",name:e});return n}function QOe(e){return{queryKey:[e.entityId,"get_ssh_key"],queryFn:()=>JOe(e),refetchInterval:1e4}}const e$e=Dt({name:tt().trim(),key:tt().min(1).trim()});async function t$e(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 n$e(){return ut({mutationFn:t$e})}function r$e({data:e,isModalOpen:t,closeModal:n,onSelectSSHKey:r,onChangesSaved:i}){const{name:o}=e,a=un({resolver:vn(e$e),defaultValues:{name:o,key:""}}),l=Wt(),{data:d}=Mt(QOe({...l,name:o})),{mutate:f,isPending:m}=n$e(),{mutate:h}=XOe(),v=b.useCallback(async({key:x})=>{x&&f({name:o,key:x.trim()+`
206
- `,...l},{onSuccess:()=>{Se.success("SSH Key updated successfully!"),r(void 0),i()}})},[f,o,l,r,i]),y=b.useCallback(()=>{h({name:o,...l},{onSuccess:()=>{Se.success("SSH Key deleted successfully!"),r(void 0),i()}})},[o,h,l,i,r]);return u.jsx(Un,{onOpenChange:n,open:t,children:u.jsx(Vn,{className:"sm:max-w-[750px]","aria-describedby":void 0,children:u.jsx(dn,{...a,children:u.jsxs("form",{onSubmit:a.handleSubmit(v),className:"grid gap-4 my-4 md:grid-cols-2",children:[u.jsx(Pn,{children:"Edit SSH Key"}),u.jsx(De,{control:a.control,name:"name",render:({field:x})=>u.jsxs(Te,{className:"md:col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Name"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",autoComplete:"off",autoCapitalize:"off",readOnly:!0,disabled:!0,...x})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:a.control,name:"key",render:({field:x})=>u.jsxs(Te,{className:"md:col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Key"}),u.jsx(ha,{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(Oe,{children:u.jsx(wb,{autoComplete:"off",autoCapitalize:"off",autoFocus:!0,rows:3,...x})}),u.jsx(Ae,{})]})}),u.jsxs(Te,{className:"md:col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Host"}),u.jsx(ha,{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(Oe,{children:u.jsx(ze,{type:"text",autoComplete:"off",autoCapitalize:"off",value:d?.host||"",disabled:!0,readOnly:!0})}),u.jsx(Ae,{})]}),u.jsxs(Te,{className:"md:col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Hostname"}),u.jsx(ha,{children:'When making the request, the actual hostname to use, i.e. "github.com".'}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",autoComplete:"off",autoCapitalize:"off",value:d?.hostname||"",disabled:!0,readOnly:!0})}),u.jsx(Ae,{})]}),u.jsxs(Yn,{children:[u.jsx(xe,{type:"button",variant:"destructiveOutline",className:"rounded-full",onClick:y,disabled:m,children:"Delete SSH Key"}),u.jsx("div",{className:"grow"}),u.jsx(xe,{type:"submit",variant:"submit",className:"rounded-full",disabled:m||!a.formState.isValid,children:"Update SSH Key"})]})]})})})})}function KM(){const e=jn(),{keyName:t}=rt({strict:!1}),n=Wt(),{data:r,refetch:i,isFetching:o,isRefetching:a}=Mt(zOe(n)),l=b.useMemo(()=>r?.find(x=>x.name===t),[r,t]),d=b.useCallback(x=>{const S=x?.original?.name,C=[t?"..":"",S].filter(Boolean);e({to:C.join("/")})},[t,e]),f=!!t&&!!l,[m,h]=b.useState(!1),v=b.useCallback(()=>{h(!0)},[h]),y=Ul(i);return u.jsxs(u.Fragment,{children:[u.jsxs(If,{columns:LOe,data:r||[],isFetching:o,onRowClick:d,children:[u.jsx(Ze,{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(xe,{variant:"defaultOutline",onClick:y,accessKey:"r",disabled:o||a,children:[u.jsx(xa,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),u.jsxs(xe,{variant:"positiveOutline",onClick:v,accessKey:"a",disabled:m,children:[u.jsx(Qr,{}),u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),m&&u.jsx(YOe,{isModalOpen:m,onChangesSaved:i,setIsModalOpen:h}),f&&u.jsx(r$e,{isModalOpen:f,closeModal:d,data:l,onSelectSSHKey:d,onChangesSaved:i}),u.jsx(b.Suspense,{fallback:u.jsx(no,{text:"Loading..."}),children:u.jsx(qOe,{})})]})}const GM=I0(),i$e=[{header:"Username",accessorKey:"username",enableSorting:!1},GM.display({header:"Role",enableSorting:!1,id:"role",cell:e=>e.row.original.role.role}),{header:"Active",accessorKey:"active",enableSorting:!1},GM.display({header:"Created",enableSorting:!1,id:"__createdtime__",cell:e=>Tc((Date.now()-e.row.original.__createdtime__)/1e3,e.row.original.__createdtime__)}),{header:"Updated",accessorKey:"__updatedtime__",enableSorting:!1,cell:e=>Tc((Date.now()-e.row.original.__updatedtime__)/1e3,e.row.original.__updatedtime__)}];function o$e({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const r=Wt(),{data:i}=Ji(oT(r)),o=un({resolver:vn(bd),defaultValues:{username:"",role:"",password:"",confirmPassword:""}}),{mutate:a,isPending:l}=rke(),d=b.useCallback(async f=>{f&&a({active:!0,password:f.password,role:f.role,username:f.username,...r},{onSuccess:()=>{const m=f.role;o.reset(),o.setValue("role",m),t(),Se.success("User added successfully!"),n(!1)}})},[a,o,r,t,n]);return u.jsx(Un,{onOpenChange:n,open:e,children:u.jsx(Vn,{"aria-describedby":void 0,children:u.jsx(dn,{...o,children:u.jsxs("form",{onSubmit:o.handleSubmit(d),className:"grid gap-4 my-4",children:[u.jsx(wr,{children:u.jsx(Pn,{children:"Add New User"})}),u.jsx(De,{control:o.control,name:"username",render:({field:f})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Username"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",enterKeyHint:"next",autoComplete:"username",...f})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:o.control,name:"password",render:({field:f})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Password"}),u.jsx(Oe,{children:u.jsx(ze,{type:"password",enterKeyHint:"next",autoComplete:"new-password",...f})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:o.control,name:"confirmPassword",render:({field:f})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Confirm Password"}),u.jsx(Oe,{children:u.jsx(ze,{type:"password",enterKeyHint:"next",autoComplete:"new-password",...f})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:o.control,name:"role",render:({field:f})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Role"}),u.jsx(b.Suspense,{fallback:u.jsx(Mr,{}),children:u.jsx(Oe,{children:u.jsxs(Gi,{...f,onValueChange:m=>f.onChange(m),children:[u.jsx(Yi,{className:"w-full",children:u.jsx(Zi,{placeholder:"Choose Role"})}),u.jsx(Wi,{children:u.jsxs(Wo,{children:[u.jsx(RI,{children:"Role"}),i?.map(m=>u.jsx($t,{value:m.id,children:m.role},m.id))]})})]})})}),u.jsx(Ae,{})]})}),u.jsx(Yn,{children:u.jsx("div",{className:"flex justify-between w-full",children:u.jsxs(xe,{type:"submit",variant:"submit",className:"rounded-full",disabled:l,children:[u.jsx(To,{})," Add User"]})})})]})})})})}const a$e=Dt({username:bd.shape.username,role:bd.shape.role,newPassword:bd.shape.password.or(Em()).optional(),confirmPassword:bd.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 s$e({data:e,onUserUpdated:t}){const n=Wt(),{data:r}=Ji(oT(n)),{mutate:i,isPending:o}=ike(),a=un({resolver:vn(a$e),defaultValues:{username:e.username,role:e.role.role,newPassword:"",confirmPassword:""}}),l=b.useCallback(d=>{const f={username:e.username,role:d.role,...n};d.newPassword&&(f.password=d.newPassword),i(f,{onSuccess:()=>{a.reset(),Se.success("User edited successfully!"),t()}})},[a,i,e.username,n,t]);return u.jsx(dn,{...a,children:u.jsxs("form",{onSubmit:a.handleSubmit(l),className:"grid gap-4 my-4",children:[u.jsx(wr,{children:u.jsx(Pn,{children:"Edit User"})}),u.jsx(De,{control:a.control,name:"username",render:({field:d})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Username"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",enterKeyHint:"next",autoComplete:"username",disabled:!0,readOnly:!0,...d})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:a.control,name:"newPassword",render:({field:d})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Change Password"}),u.jsx(Oe,{children:u.jsx(ze,{type:"password",enterKeyHint:"next",autoComplete:"new-password",...d})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:a.control,name:"confirmPassword",render:({field:d})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Confirm Password"}),u.jsx(Oe,{children:u.jsx(ze,{type:"password",enterKeyHint:"next",autoComplete:"new-password",...d})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:a.control,name:"role",render:({field:d})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Role"}),u.jsx(b.Suspense,{fallback:u.jsx(Mr,{}),children:u.jsx(Oe,{children:u.jsxs(Gi,{...d,onValueChange:f=>d.onChange(f),children:[u.jsx(Yi,{className:"w-full",children:u.jsx(Zi,{placeholder:"Choose Role"})}),u.jsx(Wi,{children:u.jsxs(Wo,{children:[u.jsx(RI,{children:"Role"}),r?.map(f=>u.jsx($t,{value:f.id,children:f.role},f.id))]})})]})})}),u.jsx(Ae,{})]})}),u.jsx(Yn,{children:u.jsx("div",{className:"flex justify-between w-full",children:u.jsxs(xe,{variant:"submit",className:"rounded-full",disabled:o,children:[u.jsx(To,{})," Save Changes"]})})})]})})}const l$e=Dt({username:sI,confirmUsernameForDeletion:tt().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 c$e({data:e,onUserDeleted:t}){const{mutate:n,isPending:r}=oke(),i=un({resolver:vn(l$e),defaultValues:{username:e.username,confirmUsernameForDeletion:""}}),o=ix(),a=b.useCallback(()=>{n({username:e.username,...o},{onSuccess:()=>{i.reset(),Se.success("User deleted successfully!"),t()}})},[e.username,i,n,o,t]);return u.jsx(dn,{...i,children:u.jsxs("form",{onSubmit:i.handleSubmit(a),className:"grid gap-4 my-4",children:[u.jsx(De,{control:i.control,name:"confirmUsernameForDeletion",render:({field:l})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Confirm Username"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",enterKeyHint:"next",autoComplete:"username",...l})}),u.jsx(Ae,{})]})}),u.jsx(Yn,{children:u.jsx("div",{className:"flex justify-between w-full",children:u.jsxs(xe,{variant:"destructive",className:"rounded-full",disabled:r||!i.formState.isValid,children:[u.jsx(Ca,{})," Delete User"]})})})]})})}function u$e({closeModal:e,clusterId:t,instanceId:n,data:r,isModalOpen:i,onUserDeleted:o,onUserUpdated:a}){const f=!(ms().user?.username===r.username);return u.jsx(Un,{onOpenChange:e,open:i,children:u.jsxs(Vn,{className:"sm:max-w-[750px]",children:[u.jsx(s$e,{data:r,onUserUpdated:a}),f&&u.jsx(c$e,{data:r,onUserDeleted:o})]})})}function d$e({entityId:e,instanceClient:t}){return{queryKey:[e,"list_users"],queryFn:()=>f$e({instanceClient:t}),refetchInterval:1e4}}async function f$e({instanceClient:e}){const{data:t}=await e.post("/",{operation:"list_users"});return t}function ZM(){const e=jn(),{instanceId:t,clusterId:n,username:r}=rt({strict:!1}),i=Wt(),{data:o,refetch:a,isFetching:l,isRefetching:d}=Ji(d$e(i)),f=b.useMemo(()=>o?.find(A=>A.username===r),[o,r]),m=b.useCallback(A=>{const D=[r?"..":"",A].filter(Boolean);e({to:D.join("/")})},[r,e]),h=!!r&&!!f,[v,y]=b.useState(!1),[x]=b.useState({attribute:"username",descending:!1}),S=b.useMemo(()=>[{desc:x.descending,id:x.attribute}],[x]),C=b.useCallback(()=>{y(!0)},[y]),k=b.useCallback(()=>{a(),y(!1)},[a,y]),E=b.useCallback(A=>{m(A.original.username)},[m]),j=b.useCallback(()=>{m(void 0)},[m]),R=b.useCallback(()=>{a(),m(void 0)},[m,a]),N=b.useCallback(()=>{a(),m(void 0)},[m,a]),T=Ul(a);return u.jsxs(b.Suspense,{fallback:u.jsx(no,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(If,{data:o,isFetching:l||d,columns:i$e,onRowClick:E,sortingState:S,children:[u.jsxs(xe,{variant:"defaultOutline",onClick:T,accessKey:"r",disabled:l||d,children:[u.jsx(xa,{})," ",u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),u.jsxs(xe,{variant:"positiveOutline",onClick:C,accessKey:"a",disabled:v,children:[u.jsx(Qr,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),u.jsx(o$e,{isModalOpen:v,onChangesSaved:k,setIsModalOpen:y}),h&&u.jsx(u$e,{instanceId:t,clusterId:n,closeModal:j,data:f,isModalOpen:h,onUserDeleted:N,onUserUpdated:R})]})}function my({context:e,params:t}){const n=wU(t);return e.queryClient.ensureQueryData(iT(n))}function p$e(e){const t=nt({getParentRoute:()=>e,path:"config",component:dOe}),n=nt({getParentRoute:()=>t,path:"/",component:SOe,loader:my}),r=nt({getParentRoute:()=>t,path:"roles",component:qM}),i=nt({getParentRoute:()=>t,path:"roles/$roleId",component:qM}),o=nt({getParentRoute:()=>t,path:"users",component:ZM}),a=nt({getParentRoute:()=>t,path:"users/$username",component:ZM}),l=nt({getParentRoute:()=>t,path:"ssh-keys",component:KM}),d=nt({getParentRoute:()=>t,path:"ssh-keys/$keyName",component:KM});return t.addChildren([n,r,i,o,a,l,d])}function Lk({clusterId:e,databaseName:t,instanceId:n,organizationId:r,tableName:i}){const o=["databases",t,i].filter(Jo).join("/");return ur({organizationId:r,instanceId:n,clusterId:e},o)}function m$e(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var aT="ScrollArea",[KK]=Qi(aT),[h$e,$o]=KK(aT),GK=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...a}=e,[l,d]=b.useState(null),[f,m]=b.useState(null),[h,v]=b.useState(null),[y,x]=b.useState(null),[S,C]=b.useState(null),[k,E]=b.useState(0),[j,R]=b.useState(0),[N,T]=b.useState(!1),[A,D]=b.useState(!1),F=pt(t,te=>d(te)),K=eu(i);return u.jsx(h$e,{scope:n,type:r,dir:K,scrollHideDelay:o,scrollArea:l,viewport:f,onViewportChange:m,content:h,onContentChange:v,scrollbarX:y,onScrollbarXChange:x,scrollbarXEnabled:N,onScrollbarXEnabledChange:T,scrollbarY:S,onScrollbarYChange:C,scrollbarYEnabled:A,onScrollbarYEnabledChange:D,onCornerWidthChange:E,onCornerHeightChange:R,children:u.jsx(Ye.div,{dir:K,...a,ref:F,style:{position:"relative","--radix-scroll-area-corner-width":k+"px","--radix-scroll-area-corner-height":j+"px",...e.style}})})});GK.displayName=aT;var ZK="ScrollAreaViewport",YK=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,a=$o(ZK,n),l=b.useRef(null),d=pt(t,l,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(Ye.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})})]})});YK.displayName=ZK;var Ra="ScrollAreaScrollbar",WK=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=$o(Ra,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=i,l=e.orientation==="horizontal";return b.useEffect(()=>(l?o(!0):a(!0),()=>{l?o(!1):a(!1)}),[l,o,a]),i.type==="hover"?u.jsx(g$e,{...r,ref:t,forceMount:n}):i.type==="scroll"?u.jsx(v$e,{...r,ref:t,forceMount:n}):i.type==="auto"?u.jsx(XK,{...r,ref:t,forceMount:n}):i.type==="always"?u.jsx(sT,{...r,ref:t}):null});WK.displayName=Ra;var g$e=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=$o(Ra,e.__scopeScrollArea),[o,a]=b.useState(!1);return b.useEffect(()=>{const l=i.scrollArea;let d=0;if(l){const f=()=>{window.clearTimeout(d),a(!0)},m=()=>{d=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return l.addEventListener("pointerenter",f),l.addEventListener("pointerleave",m),()=>{window.clearTimeout(d),l.removeEventListener("pointerenter",f),l.removeEventListener("pointerleave",m)}}},[i.scrollArea,i.scrollHideDelay]),u.jsx(or,{present:n||o,children:u.jsx(XK,{"data-state":o?"visible":"hidden",...r,ref:t})})}),v$e=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=$o(Ra,e.__scopeScrollArea),o=e.orientation==="horizontal",a=W0(()=>d("SCROLL_END"),100),[l,d]=m$e("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 b.useEffect(()=>{if(l==="idle"){const f=window.setTimeout(()=>d("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(f)}},[l,i.scrollHideDelay,d]),b.useEffect(()=>{const f=i.viewport,m=o?"scrollLeft":"scrollTop";if(f){let h=f[m];const v=()=>{const y=f[m];h!==y&&(d("SCROLL"),a()),h=y};return f.addEventListener("scroll",v),()=>f.removeEventListener("scroll",v)}},[i.viewport,o,d,a]),u.jsx(or,{present:n||l!=="hidden",children:u.jsx(sT,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ie(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Ie(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),XK=b.forwardRef((e,t)=>{const n=$o(Ra,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,a]=b.useState(!1),l=e.orientation==="horizontal",d=W0(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;a(l?f:m)}},10);return nf(n.viewport,d),nf(n.content,d),u.jsx(or,{present:r||o,children:u.jsx(sT,{"data-state":o?"visible":"hidden",...i,ref:t})})}),sT=b.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=$o(Ra,e.__scopeScrollArea),o=b.useRef(null),a=b.useRef(0),[l,d]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=nG(l.viewport,l.content),m={...r,sizes:l,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 _$e(v,a.current,l,y)}return n==="horizontal"?u.jsx(y$e,{...m,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollLeft,y=YM(v,l,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(b$e,{...m,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollTop,y=YM(v,l);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}),y$e=b.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=$o(Ra,e.__scopeScrollArea),[a,l]=b.useState(),d=b.useRef(null),f=pt(t,d,o.onScrollbarXChange);return b.useEffect(()=>{d.current&&l(getComputedStyle(d.current))},[d]),u.jsx(QK,{"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":Y0(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,h)=>{if(o.viewport){const v=o.viewport.scrollLeft+m.deltaX;e.onWheelScroll(v),iG(v,h)&&m.preventDefault()}},onResize:()=>{d.current&&o.viewport&&a&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:_b(a.paddingLeft),paddingEnd:_b(a.paddingRight)}})}})}),b$e=b.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=$o(Ra,e.__scopeScrollArea),[a,l]=b.useState(),d=b.useRef(null),f=pt(t,d,o.onScrollbarYChange);return b.useEffect(()=>{d.current&&l(getComputedStyle(d.current))},[d]),u.jsx(QK,{"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":Y0(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,h)=>{if(o.viewport){const v=o.viewport.scrollTop+m.deltaY;e.onWheelScroll(v),iG(v,h)&&m.preventDefault()}},onResize:()=>{d.current&&o.viewport&&a&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:_b(a.paddingTop),paddingEnd:_b(a.paddingBottom)}})}})}),[x$e,JK]=KK(Ra),QK=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:l,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:m,onResize:h,...v}=e,y=$o(Ra,n),[x,S]=b.useState(null),C=pt(t,F=>S(F)),k=b.useRef(null),E=b.useRef(""),j=y.viewport,R=r.content-r.viewport,N=Tn(m),T=Tn(d),A=W0(h,10);function D(F){if(k.current){const K=F.clientX-k.current.left,te=F.clientY-k.current.top;f({x:K,y:te})}}return b.useEffect(()=>{const F=K=>{const te=K.target;x?.contains(te)&&N(K,R)};return document.addEventListener("wheel",F,{passive:!1}),()=>document.removeEventListener("wheel",F,{passive:!1})},[j,x,R,N]),b.useEffect(T,[r,T]),nf(x,A),nf(y.content,A),u.jsx(x$e,{scope:n,scrollbar:x,hasThumb:i,onThumbChange:Tn(o),onThumbPointerUp:Tn(a),onThumbPositionChange:T,onThumbPointerDown:Tn(l),children:u.jsx(Ye.div,{...v,ref:C,style:{position:"absolute",...v.style},onPointerDown:Ie(e.onPointerDown,F=>{F.button===0&&(F.target.setPointerCapture(F.pointerId),k.current=x.getBoundingClientRect(),E.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),D(F))}),onPointerMove:Ie(e.onPointerMove,D),onPointerUp:Ie(e.onPointerUp,F=>{const K=F.target;K.hasPointerCapture(F.pointerId)&&K.releasePointerCapture(F.pointerId),document.body.style.webkitUserSelect=E.current,y.viewport&&(y.viewport.style.scrollBehavior=""),k.current=null})})})}),Sb="ScrollAreaThumb",eG=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=JK(Sb,e.__scopeScrollArea);return u.jsx(or,{present:n||i.hasThumb,children:u.jsx(w$e,{ref:t,...r})})}),w$e=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=$o(Sb,n),a=JK(Sb,n),{onThumbPositionChange:l}=a,d=pt(t,h=>a.onThumbChange(h)),f=b.useRef(void 0),m=W0(()=>{f.current&&(f.current(),f.current=void 0)},100);return b.useEffect(()=>{const h=o.viewport;if(h){const v=()=>{if(m(),!f.current){const y=C$e(h,l);f.current=y,l()}};return l(),h.addEventListener("scroll",v),()=>h.removeEventListener("scroll",v)}},[o.viewport,m,l]),u.jsx(Ye.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:Ie(e.onPointerDownCapture,h=>{const y=h.target.getBoundingClientRect(),x=h.clientX-y.left,S=h.clientY-y.top;a.onThumbPointerDown({x,y:S})}),onPointerUp:Ie(e.onPointerUp,a.onThumbPointerUp)})});eG.displayName=Sb;var lT="ScrollAreaCorner",tG=b.forwardRef((e,t)=>{const n=$o(lT,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?u.jsx(S$e,{...e,ref:t}):null});tG.displayName=lT;var S$e=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=$o(lT,n),[o,a]=b.useState(0),[l,d]=b.useState(0),f=!!(o&&l);return nf(i.scrollbarX,()=>{const m=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(m),d(m)}),nf(i.scrollbarY,()=>{const m=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(m),a(m)}),f?u.jsx(Ye.div,{...r,ref:t,style:{width:o,height:l,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function _b(e){return e?parseInt(e,10):0}function nG(e,t){const n=e/t;return isNaN(n)?0:n}function Y0(e){const t=nG(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function _$e(e,t,n,r="ltr"){const i=Y0(n),o=i/2,a=t||o,l=i-a,d=n.scrollbar.paddingStart+a,f=n.scrollbar.size-n.scrollbar.paddingEnd-l,m=n.content-n.viewport,h=r==="ltr"?[0,m]:[m*-1,0];return rG([d,f],h)(e)}function YM(e,t,n="ltr"){const r=Y0(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,a=t.content-t.viewport,l=o-r,d=n==="ltr"?[0,a]:[a*-1,0],f=ak(e,d);return rG([0,a],[0,l])(f)}function rG(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 iG(e,t){return e>0&&e<t}var C$e=(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,l=n.top!==o.top;(a||l)&&t(),n=o,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function W0(e,t){const n=Tn(e),r=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),b.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function nf(e,t){const n=Tn(t);rr(()=>{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 k$e=GK,E$e=YK,j$e=tG;function R$e({className:e,children:t,...n}){return u.jsxs(k$e,{"data-slot":"scroll-area",className:Ue("relative",e),...n,children:[u.jsx(E$e,{"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(I$e,{}),u.jsx(j$e,{})]})}function I$e({className:e,orientation:t="vertical",...n}){return u.jsx(WK,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Ue("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(eG,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}async function T$e({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 N$e(){return ut({mutationFn:T$e})}const Zv=Dt({databaseName:BK,tableName:HK,primaryKey:tt().regex(Z0,{error:"Primary key cannot include backticks or forward slashes."}).max(250,{error:"Primary key cannot be longer than 250 characters."})});function A$e({databaseName:e,onSelectTable:t}){const n=ir(),r=Wt(),i=_n(),[o,a]=b.useState(!1),l=un({resolver:vn(Zv),defaultValues:{databaseName:e||"",tableName:"",primaryKey:""}}),{mutate:d}=N$e(),f=async m=>{const h=m.databaseName||"data",v=m.tableName;d({databaseName:h,tableName:v,primaryKey:m.primaryKey||"id",...r,replicated:r.entityType==="cluster"},{onSuccess:async()=>{await n.invalidateQueries({queryKey:[r.entityId,"describe_all"],refetchType:"all"}),Se.success(`Table ${v} created successfully`),a(!1),l.reset(),t(h,v),await i.invalidate()}})};return u.jsxs(Un,{open:o,onOpenChange:a,children:[u.jsx(M8,{asChild:!0,children:u.jsx("div",{className:"sticky bottom-0 py-4 bg-black/70 backdrop-blur-xs",children:u.jsxs(xe,{variant:"positiveOutline",className:"w-full rounded-full",size:"lg",accessKey:"t",children:[u.jsx(Qr,{}),u.jsxs("span",{children:["Create a ",u.jsx("u",{children:"T"}),"able"]})]})})}),u.jsxs(Vn,{className:"sm:max-w-[425px]",children:[u.jsxs(wr,{children:[u.jsx(Pn,{children:"Create a New Table"}),u.jsx(Ir,{children:"What would you like to create?"})]}),u.jsx(dn,{...l,children:u.jsxs("form",{onSubmit:l.handleSubmit(f),className:"grid gap-6 text-white",children:[u.jsx(De,{control:l.control,name:"tableName",render:({field:m})=>u.jsxs(Te,{className:"",children:[u.jsx(Ne,{className:"pb-1",children:"Table Name"}),u.jsx(Oe,{children:u.jsx(ze,{...m,type:"text",maxLength:Zv.shape.tableName.maxLength,autoFocus:!0,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off"})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:l.control,name:"primaryKey",render:({field:m})=>u.jsxs(Te,{className:"",children:[u.jsx(Ne,{className:"pb-1",children:"Primary Key"}),u.jsx(Oe,{children:u.jsx(ze,{...m,placeholder:"id",type:"text",maxLength:Zv.shape.primaryKey.maxLength,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off"})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:l.control,name:"databaseName",render:({field:m})=>u.jsxs(Te,{className:"",children:[u.jsx(Ne,{className:"pb-1",children:"Database Name"}),u.jsx(Oe,{children:u.jsx(ze,{...m,type:"text",placeholder:"data",maxLength:Zv.shape.databaseName.maxLength,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off"})}),u.jsx(Ae,{})]})}),u.jsx(Yn,{children:u.jsxs(xe,{type:"submit",variant:"submit",className:"rounded-full",children:[u.jsx(Cne,{}),"Create New Table"]})})]})})]})]})}function O$e({instanceDatabaseMap:e}){const t=_n(),n=!e,r=rt({strict:!1}),i=jn(),o=yf(),{databaseNames:a,tableNames:l}=b.useMemo(()=>{const m=Object.keys(e||{}).sort(),h=r.databaseName?Object.keys(e?.[r.databaseName]||[]).sort():[];return{databaseNames:m,tableNames:h}},[e,r.databaseName]),d=b.useCallback(m=>{const h=m?Object.keys(e?.[m]||[]).sort():[];r.databaseName?i({to:Lk({...r,databaseName:m,tableName:h[0]})}):t.invalidate()},[e,r,t,i]),f=b.useCallback((m,h)=>{i({to:Lk({...r,databaseName:m,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(Mr,{className:"w-full h-9 m-0 rounded-md bg-gray-700"}):u.jsx("div",{className:"flex space-x-2",children:u.jsxs(Gi,{name:"databaseSelect",value:r.databaseName||"",disabled:a.length===0,onValueChange:d,children:[u.jsx(Yi,{className:"w-full",children:u.jsx(Zi,{placeholder:"Select a Database"})}),u.jsx(Wi,{children:u.jsx(Wo,{children:a.map(m=>u.jsx($t,{value:m,children:m},m))})})]})}),n?u.jsx(Mr,{className:"w-full min-h-80 rounded-md bg-gray-700 mb-0"}):u.jsxs(R$e,{className:"border rounded-md min-h-80 border-grey-700 mt-4",children:[l.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!'})]}):l.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:l.map(m=>u.jsx("li",{className:"flex items-center p-2 border-b hover:bg-grey-700/80 border-grey-700",children:u.jsxs(xe,{onClick:()=>f(r.databaseName,m),size:"lg",className:"items-center justify-between w-full bg-transparent border-none shadow-none hover:bg-transparent",children:[m,u.jsx("span",{children:r.tableName===m&&u.jsx(xi,{})})]})},m))})]}),o&&u.jsx(A$e,{databaseName:r.databaseName,onSelectTable:f})]})}function $$e(e){if(!e)return{dataTableColumns:[],hashAttribute:""};const{hash_attribute:t,attributes:n}=e,r=[],i=[],o=[],a=[];for(let l=n.length-1;l>=0;l--){const{attribute:d,type:f,is_primary_key:m,indexed:h}=n[l],v={header:d,accessorKey:d,enableSorting:!!(m||h),enableColumnFilter:!!(m||h),size:D$e(f)};m?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 D$e(e){switch(e){case"Id":case"ID":return 1;case"Boolean":return 1;case"Int":case"Long":case"Float":case"BigInt":return 1;default:return Math.round(window.innerWidth*.1)}}async function P$e({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 M$e(){return ut({mutationFn:P$e})}function z$e({isModalOpen:e,instanceTable:t,setIsModalOpen:n,refreshTable:r}){const{mutate:i,isPending:o}=M$e(),a=Wt(),[l,d]=b.useState(!0),[f,m]=b.useState(),[h,v]=b.useState(!1),[y,x]=b.useState([]),S=b.useMemo(()=>{const E={};for(const j of t.attributes)j.is_primary_key||j.attribute==="__createdtime__"||j.attribute==="__updatedtime__"||(E[j.attribute]=L$e(j.type));return JSON.stringify(E,null,4)},[t]),C=b.useCallback(E=>{v(!0),d(E.length===0)},[d]),k=b.useCallback(()=>{if(f&&l){const E=JSON.parse(f),j=Array.isArray(E)?E:[E],R=Se.loading(`Adding ${j.length} records...`);i({...a,databaseName:t.schema,tableName:t.name,records:j},{onSuccess:N=>{r(),N.skipped_hashes?.length||n(!1),x(N.skipped_hashes),(N.skipped_hashes?.length>0?Se.warning:Se.success)(N.skipped_hashes?.length>0?"Warning!":"Success!",{id:R,description:u.jsxs(u.Fragment,{children:[N.inserted_hashes.length>0&&u.jsxs("p",{children:["Added ",Wr(N.inserted_hashes.length,"record","records")]}),N.skipped_hashes.length>0&&u.jsxs("p",{children:["Skipped ",Wr(N.skipped_hashes.length,"record","records")]})]})})}})}},[f,i,a,t.name,t.schema,l,r,n]);return u.jsx(Un,{onOpenChange:n,open:e,children:u.jsxs(Vn,{"aria-describedby":void 0,onEscapeKeyDown:E=>{h&&E.preventDefault()},children:[u.jsx(wr,{children:u.jsxs(Pn,{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(M0,{className:"w-full h-96",language:"json",theme:"vs-dark",value:S,onValidate:C,onChange:m,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(eT,{className:"mt-2",children:[u.jsx(dE,{className:"w-4 h-4"}),u.jsxs(aAe,{children:["Skipped ",y.length===1?"Hash":"Hashes"," Detected"]}),u.jsx(tT,{className:"max-h-36 overflow-auto",children:u.jsx("ol",{children:y.map(E=>u.jsx("li",{children:E},E))})})]}),u.jsx(Yn,{children:u.jsx("div",{className:"flex justify-between w-full",children:u.jsxs(xe,{variant:"submit",className:"rounded-full",onClick:k,accessKey:"s",disabled:!f||!l||o,children:[u.jsx(To,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"S"}),"ave Changes"]})]})})})]})})}function L$e(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 F$e({databaseName:e,replicated:t,instanceClient:n}){const{data:r}=await n.post("/",{operation:"drop_database",database:e,replicated:t});return r}function U$e(){return ut({mutationFn:F$e})}function V$e({databaseName:e,onDeleted:t}){const{value:n,trigger:r}=Vl("ShowDeleteDatabase",!1),i=b.useCallback(()=>{ri("ShowDeleteDatabase",!1),Hl(r)},[r]),o=yf(),a=ir(),l=Wt(),d=_n(),{mutate:f,isPending:m}=U$e(),h=b.useCallback(()=>{f({databaseName:e,...l,replicated:l.entityType==="cluster"},{onSuccess:async()=>{i(),await a.invalidateQueries({queryKey:[l.entityId,"describe_all"],refetchType:"all"}),await d.invalidate(),Se.success(`Database ${e} dropped successfully`),t("database")}})},[i,e,f,l,t,a,d]);return!o||!e?u.jsx(u.Fragment,{}):u.jsx(w0,{typeOfThingBeingDeleted:"database",nameOfThingBeingDeleted:e,transitiveVerb:"Drop",presentParticiple:"Dropping",isModalOpen:n,setIsModalOpen:i,deletionConfirmed:h,deletionPending:m})}async function B$e({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 H$e(){return ut({mutationFn:B$e})}function q$e({databaseName:e,tableName:t,onDeleted:n}){const{value:r,trigger:i}=Vl("ShowDeleteTable",!1),o=b.useCallback(()=>{ri("ShowDeleteTable",!1),Hl(i)},[i]),a=yf(),l=ir(),d=Wt(),f=_n(),{mutate:m,isPending:h}=H$e(),v=b.useCallback(()=>{m({databaseName:e,tableName:t,...d,replicated:d.entityType==="cluster"},{onSuccess:async()=>{o(),await l.invalidateQueries({queryKey:[d.entityId,"describe_all"],refetchType:"all"}),await f.invalidate(),Se.success(`Table ${t} dropped successfully`),n("table")}})},[o,e,m,d,n,l,f,t]);return!a||!e?u.jsx(u.Fragment,{}):u.jsx(w0,{typeOfThingBeingDeleted:"table",nameOfThingBeingDeleted:`${e} > ${t}`,transitiveVerb:"Drop",presentParticiple:"Dropping",isModalOpen:r,setIsModalOpen:o,deletionConfirmed:v,deletionPending:h})}function K$e({canEditRecords:e,canDeleteRecords:t,setIsModalOpen:n,isModalOpen:r,hashAttribute:i,data:o,onSaveChanges:a,onDeleteRecord:l,isUpdateTableRecordsPending:d,isDeleteTableRecordsPending:f}){const[m,h]=b.useState(!0),[v,y]=b.useState(!1),[x,S]=b.useState(),C=b.useMemo(()=>{const E=o?.map(({__createdtime__:j,__updatedtime__:R,...N})=>N);return JSON.stringify(E,null,4)},[o]),k=b.useCallback(E=>{y(!0),h(E.length===0)},[h]);return u.jsx(Un,{onOpenChange:n,open:r,children:u.jsxs(Vn,{"aria-describedby":void 0,onEscapeKeyDown:e?E=>{v&&E.preventDefault()}:void 0,children:[u.jsx(wr,{children:u.jsxs(Pn,{children:[e?"Edit":"View"," Row"]})}),o?u.jsx(M0,{className:"w-full h-96",language:"json",theme:"vs-dark",options:e?void 0:{readOnly:!0},value:C,onValidate:k,onChange:E=>{S(E)}}):u.jsx(no,{}),u.jsx(Yn,{children:u.jsxs("div",{className:"flex justify-between w-full",children:[t&&u.jsxs(xe,{variant:"destructive",className:"rounded-full",onClick:()=>{const E=o[0]?.[i];E&&l([E])},disabled:f,children:[u.jsx(Ca,{})," Delete Row"]}),e&&u.jsxs(xe,{variant:"submit",className:"rounded-full",accessKey:"s",onClick:()=>{x&&m&&a(JSON.parse(x))},disabled:!x||!m||d,children:[u.jsx(To,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"S"}),"ave Changes"]})]})]})})]})})}async function G$e(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 Z$e(){return ut({mutationFn:G$e})}const Y$e=Dt({fileData:tt(),database:tt(),table:tt()});function W$e({setIsModalOpen:e,isModalOpen:t,onSaveChanges:n,database:r,table:i}){const[o,a]=b.useState(null),l=Wt(),{mutate:d,isPending:f}=Z$e(),m=y=>{if(!y.target.files)return;const x=y.target.files[0];if(x){const S=new FileReader;S.onload=C=>{const k=C.target?.result;typeof k=="string"&&(a(x),h.setValue("fileData",k))},S.readAsText(x)}},h=un({resolver:vn(Y$e),defaultValues:{database:r,table:i,fileData:""}}),v=y=>{d({fileData:y.fileData,database:r,table:i,...l},{onSuccess:({message:x})=>{h.reset(),a(null),n(x)}})};return u.jsx(Un,{onOpenChange:()=>{e(!1),h.reset()},open:t,children:u.jsxs(Vn,{children:[u.jsxs(wr,{children:[u.jsx(Pn,{children:"Import CSV"}),u.jsx(Ir,{children:"Upload a CSV file to import data into the table."})]}),u.jsx(dn,{...h,children:u.jsxs("form",{onSubmit:h.handleSubmit(v),children:[u.jsx("div",{className:"w-full",children:u.jsx(De,{control:h.control,name:"fileData",render:({field:y})=>u.jsxs(Te,{className:"relative",children:[u.jsx(Ne,{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(Oe,{children:u.jsxs("div",{children:[u.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[u.jsx(D4,{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:m})]})})}),u.jsx(Ae,{})]})})}),u.jsx(Yn,{className:"mt-4",children:u.jsxs(xe,{variant:"submit",className:"rounded-full",accessKey:"u",disabled:!o||f,children:[u.jsx(To,{}),u.jsxs("span",{children:[u.jsx("u",{children:"U"}),"pload CSV"]})]})})]})})]})})}async function X$e({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 J$e(){return ut({mutationFn:X$e})}function Q$e({databaseName:e,tableName:t,entityId:n,instanceClient:r}){return{queryKey:[n,e,t,"describe_table"],queryFn:async()=>{const{data:i}=await r.post("/",{operation:"describe_table",database:e,table:t});return i},staleTime:6e4,gcTime:5e3,enabled:!!e&&!!t,retry:!1}}const eDe=["1","bet","k","ok","si","tru","true","yes","yup"];function tDe(e){const t=e.toLowerCase().trim();return eDe.includes(t)}function WM(e){return!isNaN(e)&&!isNaN(parseFloat(e))}function nDe(e){if(e.startsWith("0.")&&WM(e))return!0;const t=e.toUpperCase().includes("E");return!(e!=="0"&&e.startsWith("0"))&&!t&&WM(e)}const XM={true:!0,TRUE:!0,false:!1,FALSE:!1,undefined:null,null:null,NULL:null,NaN:NaN},rDe=/^((\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 iDe(e){return e==null||e===""||typeof e!="string"?e:XM[e]!==void 0?XM[e]:nDe(e)?Number(e):rDe.test(e)?new Date(e):e}function oDe(e){const{enabled:t,entityId:n,databaseName:r,tableName:i,conditions:o,sort:a,pageIndex:l,pageSize:d,onlyIfCached:f}=e;return{enabled:t&&!!o,queryKey:[n,r,i,"search_by_conditions",o,a.attribute||"default",a.descending||!1,l||0,d||0,f],staleTime:6e4,gcTime:5e3,retry:!1,queryFn:()=>oG(e)}}function oG({instanceClient:e,databaseName:t,tableName:n,conditions:r,sort:i,pageIndex:o,pageSize:a,onlyIfCached:l,headers:d}){return e.post("/",{operation:"search_by_conditions",get_attributes:["*"],database:t,table:n,conditions:r,sort:i.attribute.length?i:void 0,offset:o*a,limit:a,onlyIfCached:l,noCacheStore:l},{timeout:0,headers:d})}function aDe(e,t,n){return t.split(/ & /).map(i=>sDe(e,i,n))}function sDe(e,t,n){t.startsWith(e)&&(t=t.substring(e.length));const{comparator:r,value:i}=cDe(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:tDe(i)};case"Blob":case"Bytes":return{search_attribute:e,search_type:r,search_value:i};default:return{search_attribute:e,search_type:r,search_value:iDe(i)}}}const JM={"=== ":"equals","== ":"eq","equals ":"equals","equal ":"equals","eq ":"eq","!== ":"not_equal","!= ":"ne","notequals ":"not_equal","notequal ":"not_equal","ne ":"ne"},lDe={">":"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 cDe(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=lDe[r];if(o)return{comparator:o,value:i}}for(const r in JM)if(t.startsWith(r))return{comparator:JM[r],value:e.slice(r.length)};return t.endsWith("*")?{comparator:"starts_with",value:e.slice(0,-1)}:{comparator:"equals",value:e}}function uDe({enabled:e,entityId:t,instanceClient:n,databaseName:r,tableName:i,ids:o}){return{queryKey:[t,"search_by_id",r,i,o],queryFn:()=>n.post("/",{get_attributes:["*"],ids:o,noCacheStore:!0,onlyIfCached:!0,operation:"search_by_id",database:r,table:i}),enabled:e&&!!o?.length,retry:!1}}function dDe(e){const{enabled:t,entityId:n,databaseName:r,tableName:i,searchAttribute:o,sort:a,pageIndex:l,pageSize:d,onlyIfCached:f}=e;return{enabled:t,queryKey:[n,r,i,"search_by_value",o,a.attribute||"default",a.descending||!1,l||0,d||0,f],retry:!1,staleTime:6e4,gcTime:5e3,queryFn:()=>aG(e)}}function aG({instanceClient:e,databaseName:t,tableName:n,searchAttribute:r,sort:i,pageIndex:o,pageSize:a,onlyIfCached:l,headers:d}){const f=i.attribute.length&&!(i.attribute===r&&!i.descending);return e.post("/",{operation:"search_by_value",get_attributes:["*"],database:t,table:n,search_attribute:r,search_value:"*",sort:f?i:void 0,offset:o*a,limit:a,onlyIfCached:l,noCacheStore:l},{timeout:0,headers:d})}async function fDe(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 pDe(){return ut({mutationFn:fDe})}const mDe=d0(tt(),tt());function hDe({applyFilters:e,columnFiltersForm:t,headerGroups:n}){const r=b.useCallback(i=>{if(i.key==="Enter")return i.preventDefault(),e(),!1},[e]);return u.jsx(zh,{children:u.jsx(dn,{...t,children:n.map(i=>u.jsx(Hi,{className:"border-none",children:i.headers.map(o=>u.jsx(fs,{style:{width:`${o.column.getSize()}px`},children:o.column.columnDef.enableColumnFilter&&u.jsx(De,{control:t.control,name:o.id,render:({field:a})=>u.jsxs(Te,{className:"border-r-1 border-r-black",children:[u.jsx(Oe,{children:u.jsx(ze,{...a,type:"text",autoCapitalize:"none",autoComplete:"off",className:"rounded-none",onKeyDown:r,value:a.value??""})}),u.jsx(Ae,{})]})})},o.id))},i.id))})})}function gDe({columns:e,columnVisibility:t,setColumnVisibility:n}){const r=b.useMemo(()=>e.map(i=>i.header).filter(Jo),[e]);return u.jsxs(Oh,{children:[u.jsx($h,{asChild:!0,children:u.jsxs(xe,{variant:"ghost",children:[u.jsx(hte,{className:"inline-block "}),"Columns"]})}),u.jsx(Dh,{children:r.map(i=>u.jsx(vDe,{columnHeader:i,columnVisibility:t,setColumnVisibility:n},i))})]})}function vDe({columnHeader:e,columnVisibility:t,setColumnVisibility:n}){const{toggled:r,toggle:i}=zm(t[e]??!0);return b.useEffect(()=>{t[e]!==r&&n({...t,[e]:r})},[e,t,r,n]),u.jsx(rwe,{checked:r,onClick:i,children:e},e)}function yDe({className:e}){return u.jsx(U4,{className:yr("animate-spin",e)})}function bDe({applyFilters:e,columns:t,columnVisibility:n,columnFiltersForm:r,data:i,isFetching:o,onColumnClick:a,onRowClick:l,pageIndex:d,pageSize:f,setPageIndex:m,setPageSize:h,filtersToggled:v,totalPages:y,totalRecords:x}){const S=A0({data:i||[],columns:t,manualPagination:!0,enableColumnResizing:!0,columnResizeMode:"onEnd",pageCount:y,defaultColumn:{minSize:1},state:{columnVisibility:n},rowCount:x,getCoreRowModel:N0(),getPaginationRowModel:t1e()}),C=b.useCallback(()=>{m(d-1)},[d,m]),k=b.useCallback(()=>{m(d+1)},[d,m]);return u.jsxs(u.Fragment,{children:[u.jsxs(O0,{containerClassName:"rounded-md bg-black-dark grow max-h-[calc(100vh-128px-16px-112px-80px)]",children:[u.jsx(zh,{children:S.getHeaderGroups().map(E=>u.jsx(Hi,{className:"border-none",children:E.headers.map(j=>u.jsx(Iq,{header:j,onColumnClick:a},j.id))},E.id))}),v&&u.jsx(hDe,{applyFilters:e,columnFiltersForm:r,headerGroups:S.getHeaderGroups()}),u.jsx($0,{className:"bg-black border border-grey-700",children:S.getRowModel().rows?.length?S.getRowModel().rows.map(E=>u.jsx(Hi,{"data-state":E.getIsSelected()&&"selected",onClick:()=>l?.(E),className:Ue("hover:bg-muted/10 data-[state=selected]:bg-muted",l&&"cursor-pointer"),children:E.getVisibleCells().map(j=>u.jsx(fs,{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()):Hc(j.column.columnDef.cell,j.getContext())},j.id))},E.id)):u.jsx(Hi,{children:u.jsx(fs,{colSpan:t.length,className:"h-24 text-center",children:o||i===void 0?u.jsx(yDe,{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(xe,{variant:"defaultOutline",size:"sm",onClick:C,className:"select-none",disabled:d===0,children:[u.jsx(Pc,{}),"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:x===void 0?u.jsx(Mr,{}):fy(x)})]}),x!==void 0&&x>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{children:u.jsxs(Gi,{defaultValue:f.toString(),onValueChange:E=>{h(Number(E))},children:[u.jsx(Yi,{className:"h-10 w-20",children:u.jsx(Zi,{})}),u.jsx(Wi,{side:"top",children:[20,50,100,250].map(E=>u.jsx($t,{value:`${E}`,children:E},E))})]})}),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:fy(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:fy(d+1)})]})]})]}),u.jsx("div",{className:"grow"}),u.jsxs(xe,{variant:"defaultOutline",size:"sm",onClick:k,className:"select-none",disabled:y===void 0||d===y-1,children:["Next",u.jsx(xi,{})]})]})]})}function xDe({instanceDatabaseMap:e,databaseName:t,tableName:n}){const r=rt({strict:!1}),i=jn(),o=Wt(),{clusterId:a,instanceId:l}=r,{toggled:d,toggle:f}=zm(!0),m=K_(l??a,t,n,"insert"),h=K_(l??a,t,n,"update"),v=K_(l??a,t,n,"delete"),y=yf(),{data:x}=Mt(Q$e({...o,databaseName:t,tableName:n})),S=b.useMemo(()=>Mh(x?.attributes??[],"attribute"),[x]),[C,k]=Qp(null,r),[E,j]=b.useState(!1),R=b.useMemo(()=>(t?Object.keys(e?.[t]||[]).sort():[]).length===1,[e,t]),{toggled:N,toggleOn:T,toggleOff:A}=zm(!1),D=un({resolver:vn(mDe)}),{reset:F}=D,K=D.watch(),[te,G]=Qp(null,[r.clusterId,r.instanceId,t,n]),q=b.useCallback(()=>{const qt=[];for(const We in K)if(K[We]?.length)try{qt.push(...aDe(We,K[We],S[We]))}catch(rn){Se.error(String(rn))}G(qt.length?qt:null),F({...K})},[S,F,K]),V=b.useCallback(()=>{F({},{keepValues:!1,keepDirtyValues:!1,keepDefaultValues:!1}),F(),G(null),A()},[A,F]);b.useEffect(function(){return V()},[r,V]);const{dataTableColumns:H,hashAttribute:z}=$$e(x),[W,L]=b.useState(!1),[ne,$]=b.useState(!1),[P,U]=Qp({attribute:z,descending:!1},r),[O,J]=Qp(0,[t,n]),[pe,ge]=b.useState(20),Q=x?.record_count,ve=x?.record_count?Math.ceil(x.record_count/pe):0,be=N&&!!te,ke={...o,enabled:!be&&!!z,databaseName:t,tableName:n,searchAttribute:z,sort:P,pageSize:pe,pageIndex:O,onlyIfCached:d},$e=dDe(ke),{data:Le,isFetching:St}=Mt($e),ct={...o,enabled:be&&!!z,databaseName:t,tableName:n,conditions:te,sort:P,pageSize:pe,pageIndex:O,onlyIfCached:d},Qe=oDe(ct),{data:zt,isFetching:Bt}=Mt(Qe),dr=be?zt:Le,Xt=St||Bt,{data:An}=Mt(uDe({...o,enabled:E,databaseName:t,tableName:n,ids:C})),{mutate:Z,isPending:re}=pDe(),{mutate:se,isPending:ie}=J$e(),fe=ir(),B=b.useCallback(()=>fe.invalidateQueries({queryKey:[o.entityId,t,n]}),[fe,o.entityId,t,n]),[le,Ee]=b.useState(!1),Me=b.useCallback(async()=>{if(!z)return;const qt=Se.loading("Loading CSV...");Ee(!0);const We={pageIndex:0,pageSize:1e6,headers:{Accept:"text/csv"}},rn=await(be?oG({...ct,...We}):aG({...ke,...We}));Se.loading("Preparing CSV...",{id:qt});const Wn=rn.data,pr=new Blob([Wn],{type:"text/csv"}),ea=URL.createObjectURL(pr),pn=document.createElement("a");pn.href=ea,pn.setAttribute("download",`${t}.${n}.${new Date().toISOString()}.csv`),pn.click(),Se.success("CSV Exported!",{id:qt}),Ee(!1)},[t,n,$e,Qe]),Ke=b.useCallback(qt=>{Z({...o,databaseName:t,tableName:n,records:qt},{onSuccess:()=>{B(),j(!1),Se.success("Record updated successfully")}})},[Z,o,t,n,B]),Jt=b.useCallback(qt=>{se({...o,databaseName:t,tableName:n,hashValues:qt},{onSuccess:()=>{B(),j(!1),Se.success("Record deleted successfully")}})},[se,o,t,n,B]),Ht=b.useCallback(qt=>{B(),$(!1),Se.success(`${qt}. Please wait a few moments then refresh the table.`)},[B]),Cn=qt=>{k([qt.original[z]]),j(!E)},Lt=(qt,We)=>{U({attribute:qt,descending:!We})},fn=Ul(B),jt=b.useCallback(()=>{L(!0)},[L]),ar=b.useCallback(()=>{$(!0)},[$]),Rn=b.useCallback(qt=>{i({to:qt==="table"?"../":"../../"})},[i]),[fr,ys]=jd(`ColumnDisplayed/${t}}/${n}`,{}),bs=Xa("ShowDeleteTable",!0),Ia=Xa("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:[m&&u.jsxs(xe,{variant:"positiveOutline",onClick:jt,disabled:W,accessKey:"n",children:[u.jsx(Qr,{}),u.jsxs("span",{children:["Add ",u.jsx("u",{children:"N"}),"ew Record(s)"]})]}),m&&u.jsxs(xe,{variant:"positiveOutline",onClick:ar,disabled:ne,accessKey:"c",children:[u.jsx(D4,{}),u.jsxs("span",{children:["Import ",u.jsx("u",{children:"C"}),"SV"]})]}),u.jsxs(xe,{variant:"positiveOutline",onClick:Me,disabled:le,accessKey:"e",children:[u.jsx(fte,{}),u.jsxs("span",{children:[u.jsx("u",{children:"E"}),"xport CSV"]})]})]}),u.jsxs("div",{className:"flex space-x-2",children:[N&&te&&u.jsxs(xe,{variant:"ghost",onClick:V,accessKey:"f",children:[u.jsx(sD,{className:"inline-block "}),u.jsxs("span",{children:["Clear ",u.jsx("u",{children:"F"}),"ilters"]})]}),N&&D.formState.isDirty&&u.jsxs(xe,{variant:"default",onClick:q,children:[u.jsx(Ite,{className:"inline-block "}),"Apply Filters"]}),N&&!te&&u.jsxs(xe,{variant:"ghost",onClick:A,accessKey:"f",children:[u.jsx(sD,{className:"inline-block "}),u.jsxs("span",{children:["Hide ",u.jsx("u",{children:"F"}),"ilters"]})]}),!N&&u.jsxs(xe,{variant:"ghost",onClick:T,accessKey:"f",children:[u.jsx(Ate,{className:"inline-block "}),u.jsxs("span",{children:["Show ",u.jsx("u",{children:"F"}),"ilters"]})]}),u.jsx(xe,{variant:"defaultOutline",onClick:fn,disabled:Xt,children:u.jsx(xa,{})}),u.jsx(gDe,{columns:H,columnVisibility:fr,setColumnVisibility:ys}),u.jsxs(Oh,{children:[u.jsx($h,{disabled:!e,children:u.jsx(lE,{"aria-label":"Table options",color:e?"white":"gray"})}),u.jsxs(Dh,{side:"bottom",align:"end",children:[u.jsxs(jr,{className:"focus:bg-primary/70 focus:text-white",onClick:f,children:[d?u.jsx(ote,{className:"text-green"}):u.jsx($4,{}),"Only If Cached",u.jsx(Ze,{to:"https://docs.harperdb.io/docs/developers/applications/caching#cache-control-header",target:"_blank",rel:"noopener noreferrer",onClick:FK,children:u.jsx(_te,{})})]}),y&&!R&&u.jsxs(jr,{className:"focus:bg-red/70 focus:text-white",onClick:bs,children:[u.jsx(Ca,{className:"inline-block "}),"Drop Table"]}),y&&u.jsxs(jr,{className:"focus:bg-red/70 focus:text-white",onClick:Ia,children:[u.jsx(jne,{}),"Drop Database"]})]})]})]})]}),u.jsx(bDe,{data:dr?.data,isFetching:Xt,filtersToggled:N,columns:H,columnVisibility:fr,onRowClick:Cn,onColumnClick:Lt,totalPages:ve,totalRecords:Q,pageIndex:O,pageSize:pe,columnFiltersForm:D,applyFilters:q,setPageIndex:J,setPageSize:ge}),m&&x&&W&&u.jsx(z$e,{instanceTable:x,isModalOpen:W,refreshTable:B,setIsModalOpen:L}),u.jsx(K$e,{canEditRecords:h,canDeleteRecords:v,setIsModalOpen:j,isModalOpen:E,hashAttribute:z,data:An?.data,onSaveChanges:Ke,onDeleteRecord:Jt,isUpdateTableRecordsPending:re,isDeleteTableRecordsPending:ie}),u.jsx(V$e,{databaseName:t,onDeleted:Rn}),u.jsx(q$e,{databaseName:t,tableName:n,onDeleted:Rn}),u.jsx(W$e,{isModalOpen:ne,setIsModalOpen:$,onSaveChanges:Ht,database:t,table:n})]})}function wDe(){const e=rt({strict:!1}),t=Wt(),{data:n}=Mt(qK(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(jc,{to:Lk({...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-(--spacing(36)))]",children:[u.jsx("section",{className:"col-span-1 text-white md:col-span-4 lg:col-span-3",children:u.jsx(O$e,{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(xDe,{instanceDatabaseMap:n,databaseName:e.databaseName,tableName:e.tableName})})]})}function SDe(e){return nt({getParentRoute:()=>e,path:"/databases/{-$databaseName}/{-$tableName}",component:wDe})}function _De({entityId:e,instanceClient:t},n){return{queryKey:[e,"get_status"],staleTime:9e3,refetchInterval:1e4,retryDelay:1e4,throwOnError:!1,enabled:n,queryFn:async()=>{const{data:r}=await t.post("/",{operation:"get_status"});return r}}}const sG={className:"text-white"};function CDe(){const e=FE(),t=rt({strict:!1}),{version:n}=qm({strict:!1}),r=BM("4.6.0",n),i=BM("4.7.0-beta.7",n),o=Wt(),{data:a}=Mt(_De(o,r)),l=a?.restartRequired??!1,d=b.useMemo(()=>[{to:ur(t),activeOptions:{exact:!0},name:"Applications",shortName:"Apps",icon:u.jsx(uE,{className:"inline-block"})},{to:ur(t,"databases"),icon:u.jsx(bte,{className:"inline-block"}),name:"Databases"},e&&i&&{to:ur(t,"apis"),name:"APIs",icon:u.jsx(xne,{className:"inline-block"})},e&&r&&{to:ur(t,"status"),icon:u.jsx($te,{className:"inline-block"}),name:"Status"},e&&{to:ur(t,"logs"),icon:u.jsx(rne,{className:"inline-block"}),name:"Logs"},e&&{to:ur(t,"config"),icon:u.jsx(Sne,{className:"inline-block"}),name:"Config"}].filter(Jo),[e,t,i,r]);return u.jsxs(u.Fragment,{children:[u.jsx(kDe,{links:d,restartRequired:l}),u.jsx(EDe,{links:d,restartRequired:l})]})}function kDe({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(gx,{restartRequired:t}),u.jsx("div",{className:"flex space-x-2",children:e.map(({shortName:n,...r})=>u.jsxs(Ze,{className:"p-2 text-center text-gray-400 hover:text-white",activeProps:sG,...r,children:[r.icon,u.jsx("span",{className:"hidden xl:inline-block ml-1",children:r.name}),n&&u.jsx("span",{className:"visible xl:hidden ml-1",children:n})]},r.to))})]})}function EDe({links:e,restartRequired:t}){return u.jsx(u.Fragment,{children:u.jsxs("div",{className:"flex md:hidden items-center justify-between h-full px-2 text-white",children:[u.jsx(gx,{restartRequired:t}),u.jsxs(Oh,{children:[u.jsx($h,{asChild:!0,children:u.jsx(xe,{variant:"ghost",className:"p-0",children:u.jsx(V4,{className:"h-8 w-8"})})}),u.jsxs(Dh,{children:[u.jsx(Qy,{children:"Instance Menu"}),u.jsx(eb,{}),e.map(n=>u.jsx(jr,{asChild:!0,children:u.jsx(Ze,{to:n.to,activeProps:sG,children:n.name})},n.to))]})]})]})})}function q1(){return u.jsxs(u.Fragment,{children:[u.jsx("nav",{className:"fixed top-20 w-full z-39 h-12 md:px-12 bg-grey-700",children:u.jsx(CDe,{})}),u.jsx("div",{className:"mt-32 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx(jl,{})})]})}function jDe(e){switch(e){case"local":return nt({getParentRoute:()=>z0,id:"_instanceLayout",component:q1,loader:my});case"cluster":return nt({getParentRoute:()=>ps,id:"_instanceLayout",component:q1,beforeLoad:QM,loader:my});case"instance":return nt({getParentRoute:()=>ps,path:"instance/$instanceId",component:q1,beforeLoad:QM,loader:my})}}async function QM({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?_U(r.user,t.organizationId,t.clusterId):SU(r.user,t.organizationId,t.clusterId);if(i){const a=t.instanceId||t.clusterId,l=es({id:a,forceFabricConnect:!0});try{const d=await sl({instanceClient:l});kt.setUserForIdAndKey(a,l.defaults.baseURL,d),kt.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 Kc({to:o,search:Hq()})}const RDe=Db(`inline-flex
207
- items-center
208
- justify-center
209
- gap-2
210
- whitespace-nowrap
211
- rounded-lg
212
- text-sm
213
- transition-[color,box-shadow]
214
- disabled:pointer-events-none
215
- disabled:opacity-50
216
- [&_svg]:pointer-events-none
217
- [&_svg:not([class*='size-'])]:size-4
218
- [&_svg]:shrink-0
219
- ring-ring/10
220
- dark:ring-ring/20
221
- dark:outline-ring/40
222
- outline-ring/50
223
- focus-visible:ring-1
224
- focus-visible:outline-1
225
- focus-visible:ring-purple-200
226
- 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 lG="Toggle",cG=b.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:i,...o}=e,[a,l]=Ko({prop:n,onChange:i,defaultProp:r??!1,caller:lG});return u.jsx(Ye.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:Ie(e.onClick,()=>{e.disabled||l(!a)})})});cG.displayName=lG;var IDe=cG;function TDe({className:e,variant:t,size:n,...r}){return u.jsx(IDe,{"data-slot":"toggle",className:Ue(RDe({variant:t,size:n,className:e})),...r})}function uG(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 ez=["secondary","default","warning","outline","success","destructive"];let tz=0;const K1=new Map,dG=e=>{if(K1.has(e))return K1.get(e);tz++;const t=tz%ez.length,n=ez[t];return K1.set(e,n),n};function NDe({columns:e,data:t,onRowClick:n}){const r=A0({data:t,columns:e,getCoreRowModel:N0()});return u.jsx("div",{className:"rounded-md bg-black-dark logsTable",children:u.jsxs(O0,{className:"text-xs",children:[u.jsx(zh,{children:r.getHeaderGroups().map(i=>u.jsx(Hi,{className:"border-none",children:i.headers.map(o=>u.jsx(OI,{className:"p-4 max-w-96",children:o.isPlaceholder?null:Hc(o.column.columnDef.header,o.getContext())},o.id))},i.id))}),u.jsx($0,{className:"bg-black",children:r.getRowModel().rows?.length?r.getRowModel().rows.map(i=>u.jsx(Hi,{"data-state":i.getIsSelected()&&"selected",className:Ue("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(fs,{className:"p-1",children:Hc(o.column.columnDef.cell,o.getContext())},o.id))},i.id)):u.jsx(Hi,{children:u.jsx(fs,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})})}function ADe(e){try{JSON.parse(e)}catch{return!1}return!0}function ODe({setIsModalOpen:e,isModalOpen:t,data:n}){const r=n?dG(n.node):"default";return u.jsx(Un,{onOpenChange:e,open:t,children:u.jsxs(Vn,{"aria-describedby":void 0,children:[u.jsx(wr,{children:u.jsx(Pn,{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(Yo,{variant:uG(n.level),children:wo(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(Yo,{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(M0,{className:"w-full h-72",language:ADe(n.message)?"json":"text",theme:"vs-dark",value:n.message,options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1}})]})]}):u.jsx(no,{}),u.jsx(Yn,{children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsxs(xe,{type:"button",variant:"destructive",className:"rounded-full",children:[u.jsx(Ca,{})," Delete Row"]}),u.jsxs(xe,{variant:"submit",className:"rounded-full",children:[u.jsx(To,{})," Save Changes"]})]})})]})})}function $De({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 DDe=Dt({limit:tt().optional(),level:Ml(["notify","error","warn","info","debug","trace","undefined"]).optional(),from:tt().or(Em()).optional(),until:tt().or(Em()).optional()});function PDe({form:e,resetFilters:t,submitFilters:n}){return u.jsx("div",{children:u.jsx(dn,{...e,children:u.jsxs("form",{onSubmit:e.handleSubmit(n),className:"flex-col space-y-5",children:[u.jsx(De,{control:e.control,name:"limit",render:({field:r})=>u.jsxs(Te,{children:[u.jsx(Ne,{children:"Log Limit:"}),u.jsxs(Gi,{onValueChange:r.onChange,value:r.value,children:[u.jsx(Yi,{className:"w-full",children:u.jsx(Zi,{placeholder:"Select log limit"})}),u.jsx(Wi,{children:u.jsxs(Wo,{children:[u.jsx($t,{value:"1000",children:"1000"}),u.jsx($t,{value:"500",children:"500"}),u.jsx($t,{value:"250",children:"250"}),u.jsx($t,{value:"100",children:"100"}),u.jsx($t,{value:"10",children:"10"})]})})]}),u.jsx(Ae,{})]})}),u.jsx(De,{control:e.control,name:"level",render:({field:r})=>u.jsxs(Te,{children:[u.jsx(Ne,{children:"Log Level:"}),u.jsxs(Gi,{onValueChange:r.onChange,value:r.value,children:[u.jsx(Yi,{className:"w-full",children:u.jsx(Zi,{placeholder:"Select log level"})}),u.jsx(Wi,{children:u.jsxs(Wo,{children:[u.jsx($t,{value:"undefined",children:"All"}),u.jsx($t,{value:"notify",children:"Notify"}),u.jsx($t,{value:"error",children:"Error"}),u.jsx($t,{value:"warn",children:"Warn"}),u.jsx($t,{value:"info",children:"Info"}),u.jsx($t,{value:"debug",children:"Debug"}),u.jsx($t,{value:"trace",children:"Trace"})]})})]}),u.jsx(Ae,{})]})}),u.jsx(De,{control:e.control,name:"from",render:({field:r})=>u.jsxs(Te,{children:[u.jsx(Ne,{children:"Start Date:"}),u.jsx(Oe,{children:u.jsx(ze,{type:"datetime-local",value:r.value,onChange:r.onChange})}),u.jsx(Ae,{})]})}),u.jsx(De,{control:e.control,name:"until",render:({field:r})=>u.jsxs(Te,{children:[u.jsx(Ne,{children:"End Date:"}),u.jsx(Oe,{children:u.jsx(ze,{type:"datetime-local",value:r.value,onChange:r.onChange})}),u.jsx(Ae,{})]})}),u.jsxs("div",{className:"flex items-center justify-between space-x-2 mt-2",children:[u.jsx(xe,{type:"submit",variant:"positiveOutline",className:"grow",children:"Apply Filters"}),u.jsx(xe,{type:"reset",variant:"destructiveOutline",onClick:()=>t(),children:"Clear Filters"})]})]})})})}const G1={limit:"100",level:"undefined",from:"",until:""},MDe=[{accessorKey:"level",header:"Status",cell:({row:e})=>{const{level:t}=e.original;return u.jsx(Yo,{variant:uG(t),children:wo(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=dG(t);return u.jsx(u.Fragment,{children:t?u.jsxs(px,{children:[u.jsx(mx,{asChild:!0,children:u.jsxs(Yo,{variant:n,children:[t.split(".")[0],"..."]})}),u.jsx(hx,{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})})}}],zDe=(e,t)=>{if(!e&&!t||!e||!t)return!0;const n=new Date(e),r=new Date(t);return n<=r};function LDe(){const[e,t]=b.useState(G1),[n,r]=b.useState(!1),[i,o]=b.useState(),[a,l]=b.useState(!1),d=Wt(),{data:f,isLoading:m,refetch:h,isFetching:v}=Mt($De({logFilters:e,...d,replicated:d.entityType==="cluster",isAutoRefreshEnabled:a})),y=un({resolver:vn(DDe),defaultValues:G1,mode:"onChange"}),x=E=>{o(E.original),r(!0)},S=async E=>{if(!zDe(E.from,E.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(E)},C=async()=>{y.reset(),t(G1)},k=Ul(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(PDe,{form:y,resetFilters:C,submitFilters:S}),u.jsxs("div",{className:"flex items-center justify-between space-x-2 mt-2",children:[u.jsxs(xe,{variant:"defaultOutline",onClick:k,disabled:v||m||a,className:"grow",children:[u.jsx(xa,{}),"Refresh"]}),u.jsxs(TDe,{variant:"outline","aria-label":"Toggle Auto Refresh",onPressedChange:l,children:[u.jsx(xa,{}),"Auto Refresh ",a?"On":"Off"]})]})]}),u.jsx("section",{className:"col-span-1 md:col-span-8 lg:col-span-9",children:m?u.jsx("div",{children:"Loading..."}):u.jsx("div",{children:u.jsx(NDe,{columns:MDe,data:f||[],onRowClick:x})})}),u.jsx(ODe,{isModalOpen:n,setIsModalOpen:r,data:i})]})}function FDe(e){return nt({getParentRoute:()=>e,path:"logs",component:LDe})}function UDe(e){return nt({getParentRoute:()=>e,path:"status",component:d4(async()=>Jm(()=>import("./index-C7BE1t1i.js"),__vite__mapDeps([3,1])),"StatusIndex")})}function VDe(e){const t=jDe(e),n=[FDe(t),...uOe(t),hke(t),UDe(t),p$e(t),SDe(t)];return t.addChildren(n)}nt({getParentRoute:()=>z0,path:"profile",component:d4(async()=>Jm(()=>import("./index-reMfz-PE.js"),[]),"ProfileIndex")});const BDe=rx.addChildren([...vbe,z0.addChildren([VDe("local")])]);function HDe({routeTree:e=BDe,authentication:t}){const n=ZX();return IQ({routeTree:e,history:n,defaultNotFoundComponent:Dne,defaultErrorComponent:Ey,defaultPreload:Pne()?!1:"intent",trailingSlash:"never",defaultPreloadStaleTime:0,scrollRestoration:!0,context:{queryClient:jy,authentication:t||{}}})}function qDe(){const e=$Q(),t=HDe({authentication:e});return u.jsxs(u.Fragment,{children:[u.jsx(AQ,{router:t,context:{authentication:e}}),!1]})}const KDe=({...e})=>u.jsx(cre,{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});let nz=!1;function GDe(){b.useEffect(()=>{nz||(nz=!0)},[])}var ZDe=function(){return null};function YDe(){return Hfe(),Dde(),GDe(),u.jsxs(u.Fragment,{children:[u.jsxs(TX,{client:jy,children:[u.jsx(qDe,{}),u.jsx(ZDe,{buttonPosition:"bottom-right"})]}),u.jsx(KDe,{richColors:!0})]})}var Z1={exports:{}},Gp={},Y1={exports:{}},W1={};var rz;function WDe(){return rz||(rz=1,(function(e){function t(z,W){var L=z.length;z.push(W);e:for(;0<L;){var ne=L-1>>>1,$=z[ne];if(0<i($,W))z[ne]=W,z[L]=$,L=ne;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var W=z[0],L=z.pop();if(L!==W){z[0]=L;e:for(var ne=0,$=z.length,P=$>>>1;ne<P;){var U=2*(ne+1)-1,O=z[U],J=U+1,pe=z[J];if(0>i(O,L))J<$&&0>i(pe,O)?(z[ne]=pe,z[J]=L,ne=J):(z[ne]=O,z[U]=L,ne=U);else if(J<$&&0>i(pe,L))z[ne]=pe,z[J]=L,ne=J;else break e}}return W}function i(z,W){var L=z.sortIndex-W.sortIndex;return L!==0?L:z.id-W.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,l=a.now();e.unstable_now=function(){return a.now()-l}}var d=[],f=[],m=1,h=null,v=3,y=!1,x=!1,S=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function R(z){for(var W=n(f);W!==null;){if(W.callback===null)r(f);else if(W.startTime<=z)r(f),W.sortIndex=W.expirationTime,t(d,W);else break;W=n(f)}}function N(z){if(S=!1,R(z),!x)if(n(d)!==null)x=!0,T||(T=!0,G());else{var W=n(f);W!==null&&H(N,W.startTime-z)}}var T=!1,A=-1,D=5,F=-1;function K(){return C?!0:!(e.unstable_now()-F<D)}function te(){if(C=!1,T){var z=e.unstable_now();F=z;var W=!0;try{e:{x=!1,S&&(S=!1,E(A),A=-1),y=!0;var L=v;try{t:{for(R(z),h=n(d);h!==null&&!(h.expirationTime>z&&K());){var ne=h.callback;if(typeof ne=="function"){h.callback=null,v=h.priorityLevel;var $=ne(h.expirationTime<=z);if(z=e.unstable_now(),typeof $=="function"){h.callback=$,R(z),W=!0;break t}h===n(d)&&r(d),R(z)}else r(d);h=n(d)}if(h!==null)W=!0;else{var P=n(f);P!==null&&H(N,P.startTime-z),W=!1}}break e}finally{h=null,v=L,y=!1}W=void 0}}finally{W?G():T=!1}}}var G;if(typeof j=="function")G=function(){j(te)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,V=q.port2;q.port1.onmessage=te,G=function(){V.postMessage(null)}}else G=function(){k(te,0)};function H(z,W){A=k(function(){z(e.unstable_now())},W)}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(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(z){switch(v){case 1:case 2:case 3:var W=3;break;default:W=v}var L=v;v=W;try{return z()}finally{v=L}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(z,W){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var L=v;v=z;try{return W()}finally{v=L}},e.unstable_scheduleCallback=function(z,W,L){var ne=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?ne+L:ne):L=ne,z){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=L+$,z={id:m++,callback:W,priorityLevel:z,startTime:L,expirationTime:$,sortIndex:-1},L>ne?(z.sortIndex=L,t(f,z),n(d)===null&&z===n(f)&&(S?(E(A),A=-1):S=!0,H(N,L-ne))):(z.sortIndex=$,t(d,z),x||y||(x=!0,T||(T=!0,G()))),z},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(z){var W=v;return function(){var L=v;v=W;try{return z.apply(this,arguments)}finally{v=L}}}})(W1)),W1}var iz;function XDe(){return iz||(iz=1,Y1.exports=WDe()),Y1.exports}var oz;function JDe(){if(oz)return Gp;oz=1;var e=XDe(),t=Bm(),n=u4();function r(s){var c="https://react.dev/errors/"+s;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)c+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+s+"; visit "+c+" 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 c=s,p=s;if(s.alternate)for(;c.return;)c=c.return;else{s=c;do c=s,(c.flags&4098)!==0&&(p=c.return),s=c.return;while(s)}return c.tag===3?p:null}function a(s){if(s.tag===13){var c=s.memoizedState;if(c===null&&(s=s.alternate,s!==null&&(c=s.memoizedState)),c!==null)return c.dehydrated}return null}function l(s){if(s.tag===31){var c=s.memoizedState;if(c===null&&(s=s.alternate,s!==null&&(c=s.memoizedState)),c!==null)return c.dehydrated}return null}function d(s){if(o(s)!==s)throw Error(r(188))}function f(s){var c=s.alternate;if(!c){if(c=o(s),c===null)throw Error(r(188));return c!==s?null:s}for(var p=s,g=c;;){var w=p.return;if(w===null)break;var _=w.alternate;if(_===null){if(g=w.return,g!==null){p=g;continue}break}if(w.child===_.child){for(_=w.child;_;){if(_===p)return d(w),s;if(_===g)return d(w),c;_=_.sibling}throw Error(r(188))}if(p.return!==g.return)p=w,g=_;else{for(var I=!1,M=w.child;M;){if(M===p){I=!0,p=w,g=_;break}if(M===g){I=!0,g=w,p=_;break}M=M.sibling}if(!I){for(M=_.child;M;){if(M===p){I=!0,p=_,g=w;break}if(M===g){I=!0,g=_,p=w;break}M=M.sibling}if(!I)throw Error(r(189))}}if(p.alternate!==g)throw Error(r(190))}if(p.tag!==3)throw Error(r(188));return p.stateNode.current===p?s:c}function m(s){var c=s.tag;if(c===5||c===26||c===27||c===6)return s;for(s=s.child;s!==null;){if(c=m(s),c!==null)return c;s=s.sibling}return null}var h=Object.assign,v=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),j=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function G(s){return s===null||typeof s!="object"?null:(s=te&&s[te]||s["@@iterator"],typeof s=="function"?s:null)}var q=Symbol.for("react.client.reference");function V(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===q?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case S:return"Fragment";case k:return"Profiler";case C:return"StrictMode";case N:return"Suspense";case T:return"SuspenseList";case F:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case x:return"Portal";case j:return s.displayName||"Context";case E:return(s._context.displayName||"Context")+".Consumer";case R:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case A:return c=s.displayName||null,c!==null?c:V(s.type)||"Memo";case D:c=s._payload,s=s._init;try{return V(s(c))}catch{}}return null}var H=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L={pending:!1,data:null,method:null,action:null},ne=[],$=-1;function P(s){return{current:s}}function U(s){0>$||(s.current=ne[$],ne[$]=null,$--)}function O(s,c){$++,ne[$]=s.current,s.current=c}var J=P(null),pe=P(null),ge=P(null),Q=P(null);function ve(s,c){switch(O(ge,c),O(pe,s),O(J,null),c.nodeType){case 9:case 11:s=(s=c.documentElement)&&(s=s.namespaceURI)?_O(s):0;break;default:if(s=c.tagName,c=c.namespaceURI)c=_O(c),s=CO(c,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}U(J),O(J,s)}function be(){U(J),U(pe),U(ge)}function ke(s){s.memoizedState!==null&&O(Q,s);var c=J.current,p=CO(c,s.type);c!==p&&(O(pe,s),O(J,p))}function $e(s){pe.current===s&&(U(J),U(pe)),Q.current===s&&(U(Q),yp._currentValue=L)}var Le,St;function ct(s){if(Le===void 0)try{throw Error()}catch(p){var c=p.stack.trim().match(/\n( *(at )?)/);Le=c&&c[1]||"",St=-1<p.stack.indexOf(`
227
- at`)?" (<anonymous>)":-1<p.stack.indexOf("@")?"@unknown:0:0":""}return`
228
- `+Le+s+St}var Qe=!1;function zt(s,c){if(!s||Qe)return"";Qe=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(c){var _e=function(){throw Error()};if(Object.defineProperty(_e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_e,[])}catch(he){var de=he}Reflect.construct(s,[],_e)}else{try{_e.call()}catch(he){de=he}s.call(_e.prototype)}}else{try{throw Error()}catch(he){de=he}(_e=s())&&typeof _e.catch=="function"&&_e.catch(function(){})}}catch(he){if(he&&de&&typeof he.stack=="string")return[he.stack,de.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(),I=_[0],M=_[1];if(I&&M){var Y=I.split(`
229
- `),ue=M.split(`
230
- `);for(w=g=0;g<Y.length&&!Y[g].includes("DetermineComponentFrameRoot");)g++;for(;w<ue.length&&!ue[w].includes("DetermineComponentFrameRoot");)w++;if(g===Y.length||w===ue.length)for(g=Y.length-1,w=ue.length-1;1<=g&&0<=w&&Y[g]!==ue[w];)w--;for(;1<=g&&0<=w;g--,w--)if(Y[g]!==ue[w]){if(g!==1||w!==1)do if(g--,w--,0>w||Y[g]!==ue[w]){var ye=`
231
- `+Y[g].replace(" at new "," at ");return s.displayName&&ye.includes("<anonymous>")&&(ye=ye.replace("<anonymous>",s.displayName)),ye}while(1<=g&&0<=w);break}}}finally{Qe=!1,Error.prepareStackTrace=p}return(p=s?s.displayName||s.name:"")?ct(p):""}function Bt(s,c){switch(s.tag){case 26:case 27:case 5:return ct(s.type);case 16:return ct("Lazy");case 13:return s.child!==c&&c!==null?ct("Suspense Fallback"):ct("Suspense");case 19:return ct("SuspenseList");case 0:case 15:return zt(s.type,!1);case 11:return zt(s.type.render,!1);case 1:return zt(s.type,!0);case 31:return ct("Activity");default:return""}}function dr(s){try{var c="",p=null;do c+=Bt(s,p),p=s,s=s.return;while(s);return c}catch(g){return`
232
- Error generating stack: `+g.message+`
233
- `+g.stack}}var Xt=Object.prototype.hasOwnProperty,An=e.unstable_scheduleCallback,Z=e.unstable_cancelCallback,re=e.unstable_shouldYield,se=e.unstable_requestPaint,ie=e.unstable_now,fe=e.unstable_getCurrentPriorityLevel,B=e.unstable_ImmediatePriority,le=e.unstable_UserBlockingPriority,Ee=e.unstable_NormalPriority,Me=e.unstable_LowPriority,Ke=e.unstable_IdlePriority,Jt=e.log,Ht=e.unstable_setDisableYieldValue,Cn=null,Lt=null;function fn(s){if(typeof Jt=="function"&&Ht(s),Lt&&typeof Lt.setStrictMode=="function")try{Lt.setStrictMode(Cn,s)}catch{}}var jt=Math.clz32?Math.clz32:fr,ar=Math.log,Rn=Math.LN2;function fr(s){return s>>>=0,s===0?32:31-(ar(s)/Rn|0)|0}var ys=256,bs=262144,Ia=4194304;function qt(s){var c=s&42;if(c!==0)return c;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 We(s,c,p){var g=s.pendingLanes;if(g===0)return 0;var w=0,_=s.suspendedLanes,I=s.pingedLanes;s=s.warmLanes;var M=g&134217727;return M!==0?(g=M&~_,g!==0?w=qt(g):(I&=M,I!==0?w=qt(I):p||(p=M&~s,p!==0&&(w=qt(p))))):(M=g&~_,M!==0?w=qt(M):I!==0?w=qt(I):p||(p=g&~s,p!==0&&(w=qt(p)))),w===0?0:c!==0&&c!==w&&(c&_)===0&&(_=w&-w,p=c&-c,_>=p||_===32&&(p&4194048)!==0)?c:w}function rn(s,c){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&c)===0}function Wn(s,c){switch(s){case 1:case 2:case 4:case 8:case 64:return c+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 c+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 pr(){var s=Ia;return Ia<<=1,(Ia&62914560)===0&&(Ia=4194304),s}function ea(s){for(var c=[],p=0;31>p;p++)c.push(s);return c}function pn(s,c){s.pendingLanes|=c,c!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function oi(s,c,p,g,w,_){var I=s.pendingLanes;s.pendingLanes=p,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=p,s.entangledLanes&=p,s.errorRecoveryDisabledLanes&=p,s.shellSuspendCounter=0;var M=s.entanglements,Y=s.expirationTimes,ue=s.hiddenUpdates;for(p=I&~p;0<p;){var ye=31-jt(p),_e=1<<ye;M[ye]=0,Y[ye]=-1;var de=ue[ye];if(de!==null)for(ue[ye]=null,ye=0;ye<de.length;ye++){var he=de[ye];he!==null&&(he.lane&=-536870913)}p&=~_e}g!==0&&ql(s,g,0),_!==0&&w===0&&s.tag!==0&&(s.suspendedLanes|=_&~(I&~c))}function ql(s,c,p){s.pendingLanes|=c,s.suspendedLanes&=~c;var g=31-jt(c);s.entangledLanes|=c,s.entanglements[g]=s.entanglements[g]|1073741824|p&261930}function ai(s,c){var p=s.entangledLanes|=c;for(s=s.entanglements;p;){var g=31-jt(p),w=1<<g;w&c|s[g]&c&&(s[g]|=c),p&=~w}}function si(s,c){var p=c&-c;return p=(p&42)!==0?1:du(p),(p&(s.suspendedLanes|c))!==0?0:p}function du(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 Do(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function X0(){var s=W.p;return s!==0?s:(s=window.event,s===void 0?32:GO(s.type))}function cT(s,c){var p=W.p;try{return W.p=s,c()}finally{W.p=p}}var xs=Math.random().toString(36).slice(2),Sr="__reactFiber$"+xs,li="__reactProps$"+xs,fu="__reactContainer$"+xs,J0="__reactEvents$"+xs,fG="__reactListeners$"+xs,pG="__reactHandles$"+xs,uT="__reactResources$"+xs,Of="__reactMarker$"+xs;function Q0(s){delete s[Sr],delete s[li],delete s[J0],delete s[fG],delete s[pG]}function pu(s){var c=s[Sr];if(c)return c;for(var p=s.parentNode;p;){if(c=p[fu]||p[Sr]){if(p=c.alternate,c.child!==null||p!==null&&p.child!==null)for(s=NO(s);s!==null;){if(p=s[Sr])return p;s=NO(s)}return c}s=p,p=s.parentNode}return null}function mu(s){if(s=s[Sr]||s[fu]){var c=s.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return s}return null}function $f(s){var c=s.tag;if(c===5||c===26||c===27||c===6)return s.stateNode;throw Error(r(33))}function hu(s){var c=s[uT];return c||(c=s[uT]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function mr(s){s[Of]=!0}var dT=new Set,fT={};function Kl(s,c){gu(s,c),gu(s+"Capture",c)}function gu(s,c){for(fT[s]=c,s=0;s<c.length;s++)dT.add(c[s])}var mG=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]*$"),pT={},mT={};function hG(s){return Xt.call(mT,s)?!0:Xt.call(pT,s)?!1:mG.test(s)?mT[s]=!0:(pT[s]=!0,!1)}function Kh(s,c,p){if(hG(c))if(p===null)s.removeAttribute(c);else{switch(typeof p){case"undefined":case"function":case"symbol":s.removeAttribute(c);return;case"boolean":var g=c.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){s.removeAttribute(c);return}}s.setAttribute(c,""+p)}}function Gh(s,c,p){if(p===null)s.removeAttribute(c);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(c);return}s.setAttribute(c,""+p)}}function Ta(s,c,p,g){if(g===null)s.removeAttribute(p);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(p);return}s.setAttributeNS(c,p,""+g)}}function ro(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function hT(s){var c=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function gG(s,c,p){var g=Object.getOwnPropertyDescriptor(s.constructor.prototype,c);if(!s.hasOwnProperty(c)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var w=g.get,_=g.set;return Object.defineProperty(s,c,{configurable:!0,get:function(){return w.call(this)},set:function(I){p=""+I,_.call(this,I)}}),Object.defineProperty(s,c,{enumerable:g.enumerable}),{getValue:function(){return p},setValue:function(I){p=""+I},stopTracking:function(){s._valueTracker=null,delete s[c]}}}}function ew(s){if(!s._valueTracker){var c=hT(s)?"checked":"value";s._valueTracker=gG(s,c,""+s[c])}}function gT(s){if(!s)return!1;var c=s._valueTracker;if(!c)return!0;var p=c.getValue(),g="";return s&&(g=hT(s)?s.checked?"true":"false":s.value),s=g,s!==p?(c.setValue(s),!0):!1}function Zh(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 vG=/[\n"\\]/g;function io(s){return s.replace(vG,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function tw(s,c,p,g,w,_,I,M){s.name="",I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?s.type=I:s.removeAttribute("type"),c!=null?I==="number"?(c===0&&s.value===""||s.value!=c)&&(s.value=""+ro(c)):s.value!==""+ro(c)&&(s.value=""+ro(c)):I!=="submit"&&I!=="reset"||s.removeAttribute("value"),c!=null?nw(s,I,ro(c)):p!=null?nw(s,I,ro(p)):g!=null&&s.removeAttribute("value"),w==null&&_!=null&&(s.defaultChecked=!!_),w!=null&&(s.checked=w&&typeof w!="function"&&typeof w!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?s.name=""+ro(M):s.removeAttribute("name")}function vT(s,c,p,g,w,_,I,M){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(s.type=_),c!=null||p!=null){if(!(_!=="submit"&&_!=="reset"||c!=null)){ew(s);return}p=p!=null?""+ro(p):"",c=c!=null?""+ro(c):p,M||c===s.value||(s.value=c),s.defaultValue=c}g=g??w,g=typeof g!="function"&&typeof g!="symbol"&&!!g,s.checked=M?s.checked:!!g,s.defaultChecked=!!g,I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(s.name=I),ew(s)}function nw(s,c,p){c==="number"&&Zh(s.ownerDocument)===s||s.defaultValue===""+p||(s.defaultValue=""+p)}function vu(s,c,p,g){if(s=s.options,c){c={};for(var w=0;w<p.length;w++)c["$"+p[w]]=!0;for(p=0;p<s.length;p++)w=c.hasOwnProperty("$"+s[p].value),s[p].selected!==w&&(s[p].selected=w),w&&g&&(s[p].defaultSelected=!0)}else{for(p=""+ro(p),c=null,w=0;w<s.length;w++){if(s[w].value===p){s[w].selected=!0,g&&(s[w].defaultSelected=!0);return}c!==null||s[w].disabled||(c=s[w])}c!==null&&(c.selected=!0)}}function yT(s,c,p){if(c!=null&&(c=""+ro(c),c!==s.value&&(s.value=c),p==null)){s.defaultValue!==c&&(s.defaultValue=c);return}s.defaultValue=p!=null?""+ro(p):""}function bT(s,c,p,g){if(c==null){if(g!=null){if(p!=null)throw Error(r(92));if(H(g)){if(1<g.length)throw Error(r(93));g=g[0]}p=g}p==null&&(p=""),c=p}p=ro(c),s.defaultValue=p,g=s.textContent,g===p&&g!==""&&g!==null&&(s.value=g),ew(s)}function yu(s,c){if(c){var p=s.firstChild;if(p&&p===s.lastChild&&p.nodeType===3){p.nodeValue=c;return}}s.textContent=c}var yG=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 xT(s,c,p){var g=c.indexOf("--")===0;p==null||typeof p=="boolean"||p===""?g?s.setProperty(c,""):c==="float"?s.cssFloat="":s[c]="":g?s.setProperty(c,p):typeof p!="number"||p===0||yG.has(c)?c==="float"?s.cssFloat=p:s[c]=(""+p).trim():s[c]=p+"px"}function wT(s,c,p){if(c!=null&&typeof c!="object")throw Error(r(62));if(s=s.style,p!=null){for(var g in p)!p.hasOwnProperty(g)||c!=null&&c.hasOwnProperty(g)||(g.indexOf("--")===0?s.setProperty(g,""):g==="float"?s.cssFloat="":s[g]="");for(var w in c)g=c[w],c.hasOwnProperty(w)&&p[w]!==g&&xT(s,w,g)}else for(var _ in c)c.hasOwnProperty(_)&&xT(s,_,c[_])}function rw(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 bG=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"]]),xG=/^[\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 Yh(s){return xG.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Na(){}var iw=null;function ow(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var bu=null,xu=null;function ST(s){var c=mu(s);if(c&&(s=c.stateNode)){var p=s[li]||null;e:switch(s=c.stateNode,c.type){case"input":if(tw(s,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name),c=p.name,p.type==="radio"&&c!=null){for(p=s;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll('input[name="'+io(""+c)+'"][type="radio"]'),c=0;c<p.length;c++){var g=p[c];if(g!==s&&g.form===s.form){var w=g[li]||null;if(!w)throw Error(r(90));tw(g,w.value,w.defaultValue,w.defaultValue,w.checked,w.defaultChecked,w.type,w.name)}}for(c=0;c<p.length;c++)g=p[c],g.form===s.form&&gT(g)}break e;case"textarea":yT(s,p.value,p.defaultValue);break e;case"select":c=p.value,c!=null&&vu(s,!!p.multiple,c,!1)}}}var aw=!1;function _T(s,c,p){if(aw)return s(c,p);aw=!0;try{var g=s(c);return g}finally{if(aw=!1,(bu!==null||xu!==null)&&(Pg(),bu&&(c=bu,s=xu,xu=bu=null,ST(c),s)))for(c=0;c<s.length;c++)ST(s[c])}}function Df(s,c){var p=s.stateNode;if(p===null)return null;var g=p[li]||null;if(g===null)return null;p=g[c];e:switch(c){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(p&&typeof p!="function")throw Error(r(231,c,typeof p));return p}var Aa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sw=!1;if(Aa)try{var Pf={};Object.defineProperty(Pf,"passive",{get:function(){sw=!0}}),window.addEventListener("test",Pf,Pf),window.removeEventListener("test",Pf,Pf)}catch{sw=!1}var ws=null,lw=null,Wh=null;function CT(){if(Wh)return Wh;var s,c=lw,p=c.length,g,w="value"in ws?ws.value:ws.textContent,_=w.length;for(s=0;s<p&&c[s]===w[s];s++);var I=p-s;for(g=1;g<=I&&c[p-g]===w[_-g];g++);return Wh=w.slice(s,1<g?1-g:void 0)}function Xh(s){var c=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&c===13&&(s=13)):s=c,s===10&&(s=13),32<=s||s===13?s:0}function Jh(){return!0}function kT(){return!1}function ci(s){function c(p,g,w,_,I){this._reactName=p,this._targetInst=w,this.type=g,this.nativeEvent=_,this.target=I,this.currentTarget=null;for(var M in s)s.hasOwnProperty(M)&&(p=s[M],this[M]=p?p(_):_[M]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?Jh:kT,this.isPropagationStopped=kT,this}return h(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=Jh)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=Jh)},persist:function(){},isPersistent:Jh}),c}var Gl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qh=ci(Gl),Mf=h({},Gl,{view:0,detail:0}),wG=ci(Mf),cw,uw,zf,eg=h({},Mf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fw,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!==zf&&(zf&&s.type==="mousemove"?(cw=s.screenX-zf.screenX,uw=s.screenY-zf.screenY):uw=cw=0,zf=s),cw)},movementY:function(s){return"movementY"in s?s.movementY:uw}}),ET=ci(eg),SG=h({},eg,{dataTransfer:0}),_G=ci(SG),CG=h({},Mf,{relatedTarget:0}),dw=ci(CG),kG=h({},Gl,{animationName:0,elapsedTime:0,pseudoElement:0}),EG=ci(kG),jG=h({},Gl,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),RG=ci(jG),IG=h({},Gl,{data:0}),jT=ci(IG),TG={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},NG={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"},AG={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function OG(s){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(s):(s=AG[s])?!!c[s]:!1}function fw(){return OG}var $G=h({},Mf,{key:function(s){if(s.key){var c=TG[s.key]||s.key;if(c!=="Unidentified")return c}return s.type==="keypress"?(s=Xh(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?NG[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fw,charCode:function(s){return s.type==="keypress"?Xh(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Xh(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),DG=ci($G),PG=h({},eg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),RT=ci(PG),MG=h({},Mf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fw}),zG=ci(MG),LG=h({},Gl,{propertyName:0,elapsedTime:0,pseudoElement:0}),FG=ci(LG),UG=h({},eg,{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}),VG=ci(UG),BG=h({},Gl,{newState:0,oldState:0}),HG=ci(BG),qG=[9,13,27,32],pw=Aa&&"CompositionEvent"in window,Lf=null;Aa&&"documentMode"in document&&(Lf=document.documentMode);var KG=Aa&&"TextEvent"in window&&!Lf,IT=Aa&&(!pw||Lf&&8<Lf&&11>=Lf),TT=" ",NT=!1;function AT(s,c){switch(s){case"keyup":return qG.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function OT(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var wu=!1;function GG(s,c){switch(s){case"compositionend":return OT(c);case"keypress":return c.which!==32?null:(NT=!0,TT);case"textInput":return s=c.data,s===TT&&NT?null:s;default:return null}}function ZG(s,c){if(wu)return s==="compositionend"||!pw&&AT(s,c)?(s=CT(),Wh=lw=ws=null,wu=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return IT&&c.locale!=="ko"?null:c.data;default:return null}}var YG={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 $T(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c==="input"?!!YG[s.type]:c==="textarea"}function DT(s,c,p,g){bu?xu?xu.push(g):xu=[g]:bu=g,c=Bg(c,"onChange"),0<c.length&&(p=new Qh("onChange","change",null,p,g),s.push({event:p,listeners:c}))}var Ff=null,Uf=null;function WG(s){vO(s,0)}function tg(s){var c=$f(s);if(gT(c))return s}function PT(s,c){if(s==="change")return c}var MT=!1;if(Aa){var mw;if(Aa){var hw="oninput"in document;if(!hw){var zT=document.createElement("div");zT.setAttribute("oninput","return;"),hw=typeof zT.oninput=="function"}mw=hw}else mw=!1;MT=mw&&(!document.documentMode||9<document.documentMode)}function LT(){Ff&&(Ff.detachEvent("onpropertychange",FT),Uf=Ff=null)}function FT(s){if(s.propertyName==="value"&&tg(Uf)){var c=[];DT(c,Uf,s,ow(s)),_T(WG,c)}}function XG(s,c,p){s==="focusin"?(LT(),Ff=c,Uf=p,Ff.attachEvent("onpropertychange",FT)):s==="focusout"&&LT()}function JG(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return tg(Uf)}function QG(s,c){if(s==="click")return tg(c)}function eZ(s,c){if(s==="input"||s==="change")return tg(c)}function tZ(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var Ii=typeof Object.is=="function"?Object.is:tZ;function Vf(s,c){if(Ii(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var p=Object.keys(s),g=Object.keys(c);if(p.length!==g.length)return!1;for(g=0;g<p.length;g++){var w=p[g];if(!Xt.call(c,w)||!Ii(s[w],c[w]))return!1}return!0}function UT(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function VT(s,c){var p=UT(s);s=0;for(var g;p;){if(p.nodeType===3){if(g=s+p.textContent.length,s<=c&&g>=c)return{node:p,offset:c-s};s=g}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=UT(p)}}function BT(s,c){return s&&c?s===c?!0:s&&s.nodeType===3?!1:c&&c.nodeType===3?BT(s,c.parentNode):"contains"in s?s.contains(c):s.compareDocumentPosition?!!(s.compareDocumentPosition(c)&16):!1:!1}function HT(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var c=Zh(s.document);c instanceof s.HTMLIFrameElement;){try{var p=typeof c.contentWindow.location.href=="string"}catch{p=!1}if(p)s=c.contentWindow;else break;c=Zh(s.document)}return c}function gw(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c&&(c==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||c==="textarea"||s.contentEditable==="true")}var nZ=Aa&&"documentMode"in document&&11>=document.documentMode,Su=null,vw=null,Bf=null,yw=!1;function qT(s,c,p){var g=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;yw||Su==null||Su!==Zh(g)||(g=Su,"selectionStart"in g&&gw(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}),Bf&&Vf(Bf,g)||(Bf=g,g=Bg(vw,"onSelect"),0<g.length&&(c=new Qh("onSelect","select",null,c,p),s.push({event:c,listeners:g}),c.target=Su)))}function Zl(s,c){var p={};return p[s.toLowerCase()]=c.toLowerCase(),p["Webkit"+s]="webkit"+c,p["Moz"+s]="moz"+c,p}var _u={animationend:Zl("Animation","AnimationEnd"),animationiteration:Zl("Animation","AnimationIteration"),animationstart:Zl("Animation","AnimationStart"),transitionrun:Zl("Transition","TransitionRun"),transitionstart:Zl("Transition","TransitionStart"),transitioncancel:Zl("Transition","TransitionCancel"),transitionend:Zl("Transition","TransitionEnd")},bw={},KT={};Aa&&(KT=document.createElement("div").style,"AnimationEvent"in window||(delete _u.animationend.animation,delete _u.animationiteration.animation,delete _u.animationstart.animation),"TransitionEvent"in window||delete _u.transitionend.transition);function Yl(s){if(bw[s])return bw[s];if(!_u[s])return s;var c=_u[s],p;for(p in c)if(c.hasOwnProperty(p)&&p in KT)return bw[s]=c[p];return s}var GT=Yl("animationend"),ZT=Yl("animationiteration"),YT=Yl("animationstart"),rZ=Yl("transitionrun"),iZ=Yl("transitionstart"),oZ=Yl("transitioncancel"),WT=Yl("transitionend"),XT=new Map,xw="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(" ");xw.push("scrollEnd");function Po(s,c){XT.set(s,c),Kl(c,[s])}var ng=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=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(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},oo=[],Cu=0,ww=0;function rg(){for(var s=Cu,c=ww=Cu=0;c<s;){var p=oo[c];oo[c++]=null;var g=oo[c];oo[c++]=null;var w=oo[c];oo[c++]=null;var _=oo[c];if(oo[c++]=null,g!==null&&w!==null){var I=g.pending;I===null?w.next=w:(w.next=I.next,I.next=w),g.pending=w}_!==0&&JT(p,w,_)}}function ig(s,c,p,g){oo[Cu++]=s,oo[Cu++]=c,oo[Cu++]=p,oo[Cu++]=g,ww|=g,s.lanes|=g,s=s.alternate,s!==null&&(s.lanes|=g)}function Sw(s,c,p,g){return ig(s,c,p,g),og(s)}function Wl(s,c){return ig(s,null,null,c),og(s)}function JT(s,c,p){s.lanes|=p;var g=s.alternate;g!==null&&(g.lanes|=p);for(var w=!1,_=s.return;_!==null;)_.childLanes|=p,g=_.alternate,g!==null&&(g.childLanes|=p),_.tag===22&&(s=_.stateNode,s===null||s._visibility&1||(w=!0)),s=_,_=_.return;return s.tag===3?(_=s.stateNode,w&&c!==null&&(w=31-jt(p),s=_.hiddenUpdates,g=s[w],g===null?s[w]=[c]:g.push(c),c.lane=p|536870912),_):null}function og(s){if(50<dp)throw dp=0,NS=null,Error(r(185));for(var c=s.return;c!==null;)s=c,c=s.return;return s.tag===3?s.stateNode:null}var ku={};function aZ(s,c,p,g){this.tag=s,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,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 Ti(s,c,p,g){return new aZ(s,c,p,g)}function _w(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Oa(s,c){var p=s.alternate;return p===null?(p=Ti(s.tag,c,s.key,s.mode),p.elementType=s.elementType,p.type=s.type,p.stateNode=s.stateNode,p.alternate=s,s.alternate=p):(p.pendingProps=c,p.type=s.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=s.flags&65011712,p.childLanes=s.childLanes,p.lanes=s.lanes,p.child=s.child,p.memoizedProps=s.memoizedProps,p.memoizedState=s.memoizedState,p.updateQueue=s.updateQueue,c=s.dependencies,p.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},p.sibling=s.sibling,p.index=s.index,p.ref=s.ref,p.refCleanup=s.refCleanup,p}function QT(s,c){s.flags&=65011714;var p=s.alternate;return p===null?(s.childLanes=0,s.lanes=c,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=p.childLanes,s.lanes=p.lanes,s.child=p.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=p.memoizedProps,s.memoizedState=p.memoizedState,s.updateQueue=p.updateQueue,s.type=p.type,c=p.dependencies,s.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),s}function ag(s,c,p,g,w,_){var I=0;if(g=s,typeof s=="function")_w(s)&&(I=1);else if(typeof s=="string")I=dY(s,p,J.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case F:return s=Ti(31,p,c,w),s.elementType=F,s.lanes=_,s;case S:return Xl(p.children,w,_,c);case C:I=8,w|=24;break;case k:return s=Ti(12,p,c,w|2),s.elementType=k,s.lanes=_,s;case N:return s=Ti(13,p,c,w),s.elementType=N,s.lanes=_,s;case T:return s=Ti(19,p,c,w),s.elementType=T,s.lanes=_,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case j:I=10;break e;case E:I=9;break e;case R:I=11;break e;case A:I=14;break e;case D:I=16,g=null;break e}I=29,p=Error(r(130,s===null?"null":typeof s,"")),g=null}return c=Ti(I,p,c,w),c.elementType=s,c.type=g,c.lanes=_,c}function Xl(s,c,p,g){return s=Ti(7,s,g,c),s.lanes=p,s}function Cw(s,c,p){return s=Ti(6,s,null,c),s.lanes=p,s}function eN(s){var c=Ti(18,null,null,0);return c.stateNode=s,c}function kw(s,c,p){return c=Ti(4,s.children!==null?s.children:[],s.key,c),c.lanes=p,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}var tN=new WeakMap;function ao(s,c){if(typeof s=="object"&&s!==null){var p=tN.get(s);return p!==void 0?p:(c={value:s,source:c,stack:dr(c)},tN.set(s,c),c)}return{value:s,source:c,stack:dr(c)}}var Eu=[],ju=0,sg=null,Hf=0,so=[],lo=0,Ss=null,ta=1,na="";function $a(s,c){Eu[ju++]=Hf,Eu[ju++]=sg,sg=s,Hf=c}function nN(s,c,p){so[lo++]=ta,so[lo++]=na,so[lo++]=Ss,Ss=s;var g=ta;s=na;var w=32-jt(g)-1;g&=~(1<<w),p+=1;var _=32-jt(c)+w;if(30<_){var I=w-w%5;_=(g&(1<<I)-1).toString(32),g>>=I,w-=I,ta=1<<32-jt(c)+w|p<<w|g,na=_+s}else ta=1<<_|p<<w|g,na=s}function Ew(s){s.return!==null&&($a(s,1),nN(s,1,0))}function jw(s){for(;s===sg;)sg=Eu[--ju],Eu[ju]=null,Hf=Eu[--ju],Eu[ju]=null;for(;s===Ss;)Ss=so[--lo],so[lo]=null,na=so[--lo],so[lo]=null,ta=so[--lo],so[lo]=null}function rN(s,c){so[lo++]=ta,so[lo++]=na,so[lo++]=Ss,ta=c.id,na=c.overflow,Ss=s}var _r=null,kn=null,Ot=!1,_s=null,co=!1,Rw=Error(r(519));function Cs(s){var c=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qf(ao(c,s)),Rw}function iN(s){var c=s.stateNode,p=s.type,g=s.memoizedProps;switch(c[Sr]=s,c[li]=g,p){case"dialog":Tt("cancel",c),Tt("close",c);break;case"iframe":case"object":case"embed":Tt("load",c);break;case"video":case"audio":for(p=0;p<pp.length;p++)Tt(pp[p],c);break;case"source":Tt("error",c);break;case"img":case"image":case"link":Tt("error",c),Tt("load",c);break;case"details":Tt("toggle",c);break;case"input":Tt("invalid",c),vT(c,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":Tt("invalid",c);break;case"textarea":Tt("invalid",c),bT(c,g.value,g.defaultValue,g.children)}p=g.children,typeof p!="string"&&typeof p!="number"&&typeof p!="bigint"||c.textContent===""+p||g.suppressHydrationWarning===!0||wO(c.textContent,p)?(g.popover!=null&&(Tt("beforetoggle",c),Tt("toggle",c)),g.onScroll!=null&&Tt("scroll",c),g.onScrollEnd!=null&&Tt("scrollend",c),g.onClick!=null&&(c.onclick=Na),c=!0):c=!1,c||Cs(s,!0)}function oN(s){for(_r=s.return;_r;)switch(_r.tag){case 5:case 31:case 13:co=!1;return;case 27:case 3:co=!0;return;default:_r=_r.return}}function Ru(s){if(s!==_r)return!1;if(!Ot)return oN(s),Ot=!0,!1;var c=s.tag,p;if((p=c!==3&&c!==27)&&((p=c===5)&&(p=s.type,p=!(p!=="form"&&p!=="button")||KS(s.type,s.memoizedProps)),p=!p),p&&kn&&Cs(s),oN(s),c===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));kn=TO(s)}else if(c===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));kn=TO(s)}else c===27?(c=kn,zs(s.type)?(s=XS,XS=null,kn=s):kn=c):kn=_r?fo(s.stateNode.nextSibling):null;return!0}function Jl(){kn=_r=null,Ot=!1}function Iw(){var s=_s;return s!==null&&(pi===null?pi=s:pi.push.apply(pi,s),_s=null),s}function qf(s){_s===null?_s=[s]:_s.push(s)}var Tw=P(null),Ql=null,Da=null;function ks(s,c,p){O(Tw,c._currentValue),c._currentValue=p}function Pa(s){s._currentValue=Tw.current,U(Tw)}function Nw(s,c,p){for(;s!==null;){var g=s.alternate;if((s.childLanes&c)!==c?(s.childLanes|=c,g!==null&&(g.childLanes|=c)):g!==null&&(g.childLanes&c)!==c&&(g.childLanes|=c),s===p)break;s=s.return}}function Aw(s,c,p,g){var w=s.child;for(w!==null&&(w.return=s);w!==null;){var _=w.dependencies;if(_!==null){var I=w.child;_=_.firstContext;e:for(;_!==null;){var M=_;_=w;for(var Y=0;Y<c.length;Y++)if(M.context===c[Y]){_.lanes|=p,M=_.alternate,M!==null&&(M.lanes|=p),Nw(_.return,p,s),g||(I=null);break e}_=M.next}}else if(w.tag===18){if(I=w.return,I===null)throw Error(r(341));I.lanes|=p,_=I.alternate,_!==null&&(_.lanes|=p),Nw(I,p,s),I=null}else I=w.child;if(I!==null)I.return=w;else for(I=w;I!==null;){if(I===s){I=null;break}if(w=I.sibling,w!==null){w.return=I.return,I=w;break}I=I.return}w=I}}function Iu(s,c,p,g){s=null;for(var w=c,_=!1;w!==null;){if(!_){if((w.flags&524288)!==0)_=!0;else if((w.flags&262144)!==0)break}if(w.tag===10){var I=w.alternate;if(I===null)throw Error(r(387));if(I=I.memoizedProps,I!==null){var M=w.type;Ii(w.pendingProps.value,I.value)||(s!==null?s.push(M):s=[M])}}else if(w===Q.current){if(I=w.alternate,I===null)throw Error(r(387));I.memoizedState.memoizedState!==w.memoizedState.memoizedState&&(s!==null?s.push(yp):s=[yp])}w=w.return}s!==null&&Aw(c,s,p,g),c.flags|=262144}function lg(s){for(s=s.firstContext;s!==null;){if(!Ii(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function ec(s){Ql=s,Da=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Cr(s){return aN(Ql,s)}function cg(s,c){return Ql===null&&ec(s),aN(s,c)}function aN(s,c){var p=c._currentValue;if(c={context:c,memoizedValue:p,next:null},Da===null){if(s===null)throw Error(r(308));Da=c,s.dependencies={lanes:0,firstContext:c},s.flags|=524288}else Da=Da.next=c;return p}var sZ=typeof AbortController<"u"?AbortController:function(){var s=[],c=this.signal={aborted:!1,addEventListener:function(p,g){s.push(g)}};this.abort=function(){c.aborted=!0,s.forEach(function(p){return p()})}},lZ=e.unstable_scheduleCallback,cZ=e.unstable_NormalPriority,Xn={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ow(){return{controller:new sZ,data:new Map,refCount:0}}function Kf(s){s.refCount--,s.refCount===0&&lZ(cZ,function(){s.controller.abort()})}var Gf=null,$w=0,Tu=0,Nu=null;function uZ(s,c){if(Gf===null){var p=Gf=[];$w=0,Tu=MS(),Nu={status:"pending",value:void 0,then:function(g){p.push(g)}}}return $w++,c.then(sN,sN),c}function sN(){if(--$w===0&&Gf!==null){Nu!==null&&(Nu.status="fulfilled");var s=Gf;Gf=null,Tu=0,Nu=null;for(var c=0;c<s.length;c++)(0,s[c])()}}function dZ(s,c){var p=[],g={status:"pending",value:null,reason:null,then:function(w){p.push(w)}};return s.then(function(){g.status="fulfilled",g.value=c;for(var w=0;w<p.length;w++)(0,p[w])(c)},function(w){for(g.status="rejected",g.reason=w,w=0;w<p.length;w++)(0,p[w])(void 0)}),g}var lN=z.S;z.S=function(s,c){qA=ie(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&uZ(s,c),lN!==null&&lN(s,c)};var tc=P(null);function Dw(){var s=tc.current;return s!==null?s:mn.pooledCache}function ug(s,c){c===null?O(tc,tc.current):O(tc,c.pool)}function cN(){var s=Dw();return s===null?null:{parent:Xn._currentValue,pool:s}}var Au=Error(r(460)),Pw=Error(r(474)),dg=Error(r(542)),fg={then:function(){}};function uN(s){return s=s.status,s==="fulfilled"||s==="rejected"}function dN(s,c,p){switch(p=s[p],p===void 0?s.push(c):p!==c&&(c.then(Na,Na),c=p),c.status){case"fulfilled":return c.value;case"rejected":throw s=c.reason,pN(s),s;default:if(typeof c.status=="string")c.then(Na,Na);else{if(s=mn,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=c,s.status="pending",s.then(function(g){if(c.status==="pending"){var w=c;w.status="fulfilled",w.value=g}},function(g){if(c.status==="pending"){var w=c;w.status="rejected",w.reason=g}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw s=c.reason,pN(s),s}throw rc=c,Au}}function nc(s){try{var c=s._init;return c(s._payload)}catch(p){throw p!==null&&typeof p=="object"&&typeof p.then=="function"?(rc=p,Au):p}}var rc=null;function fN(){if(rc===null)throw Error(r(459));var s=rc;return rc=null,s}function pN(s){if(s===Au||s===dg)throw Error(r(483))}var Ou=null,Zf=0;function pg(s){var c=Zf;return Zf+=1,Ou===null&&(Ou=[]),dN(Ou,s,c)}function Yf(s,c){c=c.props.ref,s.ref=c!==void 0?c:null}function mg(s,c){throw c.$$typeof===v?Error(r(525)):(s=Object.prototype.toString.call(c),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":s)))}function mN(s){function c(oe,ee){if(s){var ce=oe.deletions;ce===null?(oe.deletions=[ee],oe.flags|=16):ce.push(ee)}}function p(oe,ee){if(!s)return null;for(;ee!==null;)c(oe,ee),ee=ee.sibling;return null}function g(oe){for(var ee=new Map;oe!==null;)oe.key!==null?ee.set(oe.key,oe):ee.set(oe.index,oe),oe=oe.sibling;return ee}function w(oe,ee){return oe=Oa(oe,ee),oe.index=0,oe.sibling=null,oe}function _(oe,ee,ce){return oe.index=ce,s?(ce=oe.alternate,ce!==null?(ce=ce.index,ce<ee?(oe.flags|=67108866,ee):ce):(oe.flags|=67108866,ee)):(oe.flags|=1048576,ee)}function I(oe){return s&&oe.alternate===null&&(oe.flags|=67108866),oe}function M(oe,ee,ce,we){return ee===null||ee.tag!==6?(ee=Cw(ce,oe.mode,we),ee.return=oe,ee):(ee=w(ee,ce),ee.return=oe,ee)}function Y(oe,ee,ce,we){var Xe=ce.type;return Xe===S?ye(oe,ee,ce.props.children,we,ce.key):ee!==null&&(ee.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===D&&nc(Xe)===ee.type)?(ee=w(ee,ce.props),Yf(ee,ce),ee.return=oe,ee):(ee=ag(ce.type,ce.key,ce.props,null,oe.mode,we),Yf(ee,ce),ee.return=oe,ee)}function ue(oe,ee,ce,we){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==ce.containerInfo||ee.stateNode.implementation!==ce.implementation?(ee=kw(ce,oe.mode,we),ee.return=oe,ee):(ee=w(ee,ce.children||[]),ee.return=oe,ee)}function ye(oe,ee,ce,we,Xe){return ee===null||ee.tag!==7?(ee=Xl(ce,oe.mode,we,Xe),ee.return=oe,ee):(ee=w(ee,ce),ee.return=oe,ee)}function _e(oe,ee,ce){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=Cw(""+ee,oe.mode,ce),ee.return=oe,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case y:return ce=ag(ee.type,ee.key,ee.props,null,oe.mode,ce),Yf(ce,ee),ce.return=oe,ce;case x:return ee=kw(ee,oe.mode,ce),ee.return=oe,ee;case D:return ee=nc(ee),_e(oe,ee,ce)}if(H(ee)||G(ee))return ee=Xl(ee,oe.mode,ce,null),ee.return=oe,ee;if(typeof ee.then=="function")return _e(oe,pg(ee),ce);if(ee.$$typeof===j)return _e(oe,cg(oe,ee),ce);mg(oe,ee)}return null}function de(oe,ee,ce,we){var Xe=ee!==null?ee.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Xe!==null?null:M(oe,ee,""+ce,we);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case y:return ce.key===Xe?Y(oe,ee,ce,we):null;case x:return ce.key===Xe?ue(oe,ee,ce,we):null;case D:return ce=nc(ce),de(oe,ee,ce,we)}if(H(ce)||G(ce))return Xe!==null?null:ye(oe,ee,ce,we,null);if(typeof ce.then=="function")return de(oe,ee,pg(ce),we);if(ce.$$typeof===j)return de(oe,ee,cg(oe,ce),we);mg(oe,ce)}return null}function he(oe,ee,ce,we,Xe){if(typeof we=="string"&&we!==""||typeof we=="number"||typeof we=="bigint")return oe=oe.get(ce)||null,M(ee,oe,""+we,Xe);if(typeof we=="object"&&we!==null){switch(we.$$typeof){case y:return oe=oe.get(we.key===null?ce:we.key)||null,Y(ee,oe,we,Xe);case x:return oe=oe.get(we.key===null?ce:we.key)||null,ue(ee,oe,we,Xe);case D:return we=nc(we),he(oe,ee,ce,we,Xe)}if(H(we)||G(we))return oe=oe.get(ce)||null,ye(ee,oe,we,Xe,null);if(typeof we.then=="function")return he(oe,ee,ce,pg(we),Xe);if(we.$$typeof===j)return he(oe,ee,ce,cg(ee,we),Xe);mg(ee,we)}return null}function Be(oe,ee,ce,we){for(var Xe=null,Ft=null,Ge=ee,yt=ee=0,At=null;Ge!==null&&yt<ce.length;yt++){Ge.index>yt?(At=Ge,Ge=null):At=Ge.sibling;var Ut=de(oe,Ge,ce[yt],we);if(Ut===null){Ge===null&&(Ge=At);break}s&&Ge&&Ut.alternate===null&&c(oe,Ge),ee=_(Ut,ee,yt),Ft===null?Xe=Ut:Ft.sibling=Ut,Ft=Ut,Ge=At}if(yt===ce.length)return p(oe,Ge),Ot&&$a(oe,yt),Xe;if(Ge===null){for(;yt<ce.length;yt++)Ge=_e(oe,ce[yt],we),Ge!==null&&(ee=_(Ge,ee,yt),Ft===null?Xe=Ge:Ft.sibling=Ge,Ft=Ge);return Ot&&$a(oe,yt),Xe}for(Ge=g(Ge);yt<ce.length;yt++)At=he(Ge,oe,yt,ce[yt],we),At!==null&&(s&&At.alternate!==null&&Ge.delete(At.key===null?yt:At.key),ee=_(At,ee,yt),Ft===null?Xe=At:Ft.sibling=At,Ft=At);return s&&Ge.forEach(function(Bs){return c(oe,Bs)}),Ot&&$a(oe,yt),Xe}function et(oe,ee,ce,we){if(ce==null)throw Error(r(151));for(var Xe=null,Ft=null,Ge=ee,yt=ee=0,At=null,Ut=ce.next();Ge!==null&&!Ut.done;yt++,Ut=ce.next()){Ge.index>yt?(At=Ge,Ge=null):At=Ge.sibling;var Bs=de(oe,Ge,Ut.value,we);if(Bs===null){Ge===null&&(Ge=At);break}s&&Ge&&Bs.alternate===null&&c(oe,Ge),ee=_(Bs,ee,yt),Ft===null?Xe=Bs:Ft.sibling=Bs,Ft=Bs,Ge=At}if(Ut.done)return p(oe,Ge),Ot&&$a(oe,yt),Xe;if(Ge===null){for(;!Ut.done;yt++,Ut=ce.next())Ut=_e(oe,Ut.value,we),Ut!==null&&(ee=_(Ut,ee,yt),Ft===null?Xe=Ut:Ft.sibling=Ut,Ft=Ut);return Ot&&$a(oe,yt),Xe}for(Ge=g(Ge);!Ut.done;yt++,Ut=ce.next())Ut=he(Ge,oe,yt,Ut.value,we),Ut!==null&&(s&&Ut.alternate!==null&&Ge.delete(Ut.key===null?yt:Ut.key),ee=_(Ut,ee,yt),Ft===null?Xe=Ut:Ft.sibling=Ut,Ft=Ut);return s&&Ge.forEach(function(SY){return c(oe,SY)}),Ot&&$a(oe,yt),Xe}function sn(oe,ee,ce,we){if(typeof ce=="object"&&ce!==null&&ce.type===S&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case y:e:{for(var Xe=ce.key;ee!==null;){if(ee.key===Xe){if(Xe=ce.type,Xe===S){if(ee.tag===7){p(oe,ee.sibling),we=w(ee,ce.props.children),we.return=oe,oe=we;break e}}else if(ee.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===D&&nc(Xe)===ee.type){p(oe,ee.sibling),we=w(ee,ce.props),Yf(we,ce),we.return=oe,oe=we;break e}p(oe,ee);break}else c(oe,ee);ee=ee.sibling}ce.type===S?(we=Xl(ce.props.children,oe.mode,we,ce.key),we.return=oe,oe=we):(we=ag(ce.type,ce.key,ce.props,null,oe.mode,we),Yf(we,ce),we.return=oe,oe=we)}return I(oe);case x:e:{for(Xe=ce.key;ee!==null;){if(ee.key===Xe)if(ee.tag===4&&ee.stateNode.containerInfo===ce.containerInfo&&ee.stateNode.implementation===ce.implementation){p(oe,ee.sibling),we=w(ee,ce.children||[]),we.return=oe,oe=we;break e}else{p(oe,ee);break}else c(oe,ee);ee=ee.sibling}we=kw(ce,oe.mode,we),we.return=oe,oe=we}return I(oe);case D:return ce=nc(ce),sn(oe,ee,ce,we)}if(H(ce))return Be(oe,ee,ce,we);if(G(ce)){if(Xe=G(ce),typeof Xe!="function")throw Error(r(150));return ce=Xe.call(ce),et(oe,ee,ce,we)}if(typeof ce.then=="function")return sn(oe,ee,pg(ce),we);if(ce.$$typeof===j)return sn(oe,ee,cg(oe,ce),we);mg(oe,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,ee!==null&&ee.tag===6?(p(oe,ee.sibling),we=w(ee,ce),we.return=oe,oe=we):(p(oe,ee),we=Cw(ce,oe.mode,we),we.return=oe,oe=we),I(oe)):p(oe,ee)}return function(oe,ee,ce,we){try{Zf=0;var Xe=sn(oe,ee,ce,we);return Ou=null,Xe}catch(Ge){if(Ge===Au||Ge===dg)throw Ge;var Ft=Ti(29,Ge,null,oe.mode);return Ft.lanes=we,Ft.return=oe,Ft}}}var ic=mN(!0),hN=mN(!1),Es=!1;function Mw(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zw(s,c){s=s.updateQueue,c.updateQueue===s&&(c.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function js(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Rs(s,c,p){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,(Kt&2)!==0){var w=g.pending;return w===null?c.next=c:(c.next=w.next,w.next=c),g.pending=c,c=og(s),JT(s,null,p),c}return ig(s,g,c,p),og(s)}function Wf(s,c,p){if(c=c.updateQueue,c!==null&&(c=c.shared,(p&4194048)!==0)){var g=c.lanes;g&=s.pendingLanes,p|=g,c.lanes=p,ai(s,p)}}function Lw(s,c){var p=s.updateQueue,g=s.alternate;if(g!==null&&(g=g.updateQueue,p===g)){var w=null,_=null;if(p=p.firstBaseUpdate,p!==null){do{var I={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};_===null?w=_=I:_=_.next=I,p=p.next}while(p!==null);_===null?w=_=c:_=_.next=c}else w=_=c;p={baseState:g.baseState,firstBaseUpdate:w,lastBaseUpdate:_,shared:g.shared,callbacks:g.callbacks},s.updateQueue=p;return}s=p.lastBaseUpdate,s===null?p.firstBaseUpdate=c:s.next=c,p.lastBaseUpdate=c}var Fw=!1;function Xf(){if(Fw){var s=Nu;if(s!==null)throw s}}function Jf(s,c,p,g){Fw=!1;var w=s.updateQueue;Es=!1;var _=w.firstBaseUpdate,I=w.lastBaseUpdate,M=w.shared.pending;if(M!==null){w.shared.pending=null;var Y=M,ue=Y.next;Y.next=null,I===null?_=ue:I.next=ue,I=Y;var ye=s.alternate;ye!==null&&(ye=ye.updateQueue,M=ye.lastBaseUpdate,M!==I&&(M===null?ye.firstBaseUpdate=ue:M.next=ue,ye.lastBaseUpdate=Y))}if(_!==null){var _e=w.baseState;I=0,ye=ue=Y=null,M=_;do{var de=M.lane&-536870913,he=de!==M.lane;if(he?(Nt&de)===de:(g&de)===de){de!==0&&de===Tu&&(Fw=!0),ye!==null&&(ye=ye.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var Be=s,et=M;de=c;var sn=p;switch(et.tag){case 1:if(Be=et.payload,typeof Be=="function"){_e=Be.call(sn,_e,de);break e}_e=Be;break e;case 3:Be.flags=Be.flags&-65537|128;case 0:if(Be=et.payload,de=typeof Be=="function"?Be.call(sn,_e,de):Be,de==null)break e;_e=h({},_e,de);break e;case 2:Es=!0}}de=M.callback,de!==null&&(s.flags|=64,he&&(s.flags|=8192),he=w.callbacks,he===null?w.callbacks=[de]:he.push(de))}else he={lane:de,tag:M.tag,payload:M.payload,callback:M.callback,next:null},ye===null?(ue=ye=he,Y=_e):ye=ye.next=he,I|=de;if(M=M.next,M===null){if(M=w.shared.pending,M===null)break;he=M,M=he.next,he.next=null,w.lastBaseUpdate=he,w.shared.pending=null}}while(!0);ye===null&&(Y=_e),w.baseState=Y,w.firstBaseUpdate=ue,w.lastBaseUpdate=ye,_===null&&(w.shared.lanes=0),Os|=I,s.lanes=I,s.memoizedState=_e}}function gN(s,c){if(typeof s!="function")throw Error(r(191,s));s.call(c)}function vN(s,c){var p=s.callbacks;if(p!==null)for(s.callbacks=null,s=0;s<p.length;s++)gN(p[s],c)}var $u=P(null),hg=P(0);function yN(s,c){s=qa,O(hg,s),O($u,c),qa=s|c.baseLanes}function Uw(){O(hg,qa),O($u,$u.current)}function Vw(){qa=hg.current,U($u),U(hg)}var Ni=P(null),uo=null;function Is(s){var c=s.alternate;O(Bn,Bn.current&1),O(Ni,s),uo===null&&(c===null||$u.current!==null||c.memoizedState!==null)&&(uo=s)}function Bw(s){O(Bn,Bn.current),O(Ni,s),uo===null&&(uo=s)}function bN(s){s.tag===22?(O(Bn,Bn.current),O(Ni,s),uo===null&&(uo=s)):Ts()}function Ts(){O(Bn,Bn.current),O(Ni,Ni.current)}function Ai(s){U(Ni),uo===s&&(uo=null),U(Bn)}var Bn=P(0);function gg(s){for(var c=s;c!==null;){if(c.tag===13){var p=c.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||YS(p)||WS(p)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Ma=0,mt=null,on=null,Jn=null,vg=!1,Du=!1,oc=!1,yg=0,Qf=0,Pu=null,fZ=0;function Mn(){throw Error(r(321))}function Hw(s,c){if(c===null)return!1;for(var p=0;p<c.length&&p<s.length;p++)if(!Ii(s[p],c[p]))return!1;return!0}function qw(s,c,p,g,w,_){return Ma=_,mt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,z.H=s===null||s.memoizedState===null?nA:aS,oc=!1,_=p(g,w),oc=!1,Du&&(_=wN(c,p,g,w)),xN(s),_}function xN(s){z.H=np;var c=on!==null&&on.next!==null;if(Ma=0,Jn=on=mt=null,vg=!1,Qf=0,Pu=null,c)throw Error(r(300));s===null||Qn||(s=s.dependencies,s!==null&&lg(s)&&(Qn=!0))}function wN(s,c,p,g){mt=s;var w=0;do{if(Du&&(Pu=null),Qf=0,Du=!1,25<=w)throw Error(r(301));if(w+=1,Jn=on=null,s.updateQueue!=null){var _=s.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}z.H=rA,_=c(p,g)}while(Du);return _}function pZ(){var s=z.H,c=s.useState()[0];return c=typeof c.then=="function"?ep(c):c,s=s.useState()[0],(on!==null?on.memoizedState:null)!==s&&(mt.flags|=1024),c}function Kw(){var s=yg!==0;return yg=0,s}function Gw(s,c,p){c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~p}function Zw(s){if(vg){for(s=s.memoizedState;s!==null;){var c=s.queue;c!==null&&(c.pending=null),s=s.next}vg=!1}Ma=0,Jn=on=mt=null,Du=!1,Qf=yg=0,Pu=null}function Vr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Jn===null?mt.memoizedState=Jn=s:Jn=Jn.next=s,Jn}function Hn(){if(on===null){var s=mt.alternate;s=s!==null?s.memoizedState:null}else s=on.next;var c=Jn===null?mt.memoizedState:Jn.next;if(c!==null)Jn=c,on=s;else{if(s===null)throw mt.alternate===null?Error(r(467)):Error(r(310));on=s,s={memoizedState:on.memoizedState,baseState:on.baseState,baseQueue:on.baseQueue,queue:on.queue,next:null},Jn===null?mt.memoizedState=Jn=s:Jn=Jn.next=s}return Jn}function bg(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ep(s){var c=Qf;return Qf+=1,Pu===null&&(Pu=[]),s=dN(Pu,s,c),c=mt,(Jn===null?c.memoizedState:Jn.next)===null&&(c=c.alternate,z.H=c===null||c.memoizedState===null?nA:aS),s}function xg(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return ep(s);if(s.$$typeof===j)return Cr(s)}throw Error(r(438,String(s)))}function Yw(s){var c=null,p=mt.updateQueue;if(p!==null&&(c=p.memoCache),c==null){var g=mt.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(c={data:g.data.map(function(w){return w.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),p===null&&(p=bg(),mt.updateQueue=p),p.memoCache=c,p=c.data[c.index],p===void 0)for(p=c.data[c.index]=Array(s),g=0;g<s;g++)p[g]=K;return c.index++,p}function za(s,c){return typeof c=="function"?c(s):c}function wg(s){var c=Hn();return Ww(c,on,s)}function Ww(s,c,p){var g=s.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=p;var w=s.baseQueue,_=g.pending;if(_!==null){if(w!==null){var I=w.next;w.next=_.next,_.next=I}c.baseQueue=w=_,g.pending=null}if(_=s.baseState,w===null)s.memoizedState=_;else{c=w.next;var M=I=null,Y=null,ue=c,ye=!1;do{var _e=ue.lane&-536870913;if(_e!==ue.lane?(Nt&_e)===_e:(Ma&_e)===_e){var de=ue.revertLane;if(de===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null}),_e===Tu&&(ye=!0);else if((Ma&de)===de){ue=ue.next,de===Tu&&(ye=!0);continue}else _e={lane:0,revertLane:ue.revertLane,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},Y===null?(M=Y=_e,I=_):Y=Y.next=_e,mt.lanes|=de,Os|=de;_e=ue.action,oc&&p(_,_e),_=ue.hasEagerState?ue.eagerState:p(_,_e)}else de={lane:_e,revertLane:ue.revertLane,gesture:ue.gesture,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},Y===null?(M=Y=de,I=_):Y=Y.next=de,mt.lanes|=_e,Os|=_e;ue=ue.next}while(ue!==null&&ue!==c);if(Y===null?I=_:Y.next=M,!Ii(_,s.memoizedState)&&(Qn=!0,ye&&(p=Nu,p!==null)))throw p;s.memoizedState=_,s.baseState=I,s.baseQueue=Y,g.lastRenderedState=_}return w===null&&(g.lanes=0),[s.memoizedState,g.dispatch]}function Xw(s){var c=Hn(),p=c.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=s;var g=p.dispatch,w=p.pending,_=c.memoizedState;if(w!==null){p.pending=null;var I=w=w.next;do _=s(_,I.action),I=I.next;while(I!==w);Ii(_,c.memoizedState)||(Qn=!0),c.memoizedState=_,c.baseQueue===null&&(c.baseState=_),p.lastRenderedState=_}return[_,g]}function SN(s,c,p){var g=mt,w=Hn(),_=Ot;if(_){if(p===void 0)throw Error(r(407));p=p()}else p=c();var I=!Ii((on||w).memoizedState,p);if(I&&(w.memoizedState=p,Qn=!0),w=w.queue,eS(kN.bind(null,g,w,s),[s]),w.getSnapshot!==c||I||Jn!==null&&Jn.memoizedState.tag&1){if(g.flags|=2048,Mu(9,{destroy:void 0},CN.bind(null,g,w,p,c),null),mn===null)throw Error(r(349));_||(Ma&127)!==0||_N(g,c,p)}return p}function _N(s,c,p){s.flags|=16384,s={getSnapshot:c,value:p},c=mt.updateQueue,c===null?(c=bg(),mt.updateQueue=c,c.stores=[s]):(p=c.stores,p===null?c.stores=[s]:p.push(s))}function CN(s,c,p,g){c.value=p,c.getSnapshot=g,EN(c)&&jN(s)}function kN(s,c,p){return p(function(){EN(c)&&jN(s)})}function EN(s){var c=s.getSnapshot;s=s.value;try{var p=c();return!Ii(s,p)}catch{return!0}}function jN(s){var c=Wl(s,2);c!==null&&mi(c,s,2)}function Jw(s){var c=Vr();if(typeof s=="function"){var p=s;if(s=p(),oc){fn(!0);try{p()}finally{fn(!1)}}}return c.memoizedState=c.baseState=s,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:za,lastRenderedState:s},c}function RN(s,c,p,g){return s.baseState=p,Ww(s,on,typeof g=="function"?g:za)}function mZ(s,c,p,g,w){if(Cg(s))throw Error(r(485));if(s=c.action,s!==null){var _={payload:w,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(I){_.listeners.push(I)}};z.T!==null?p(!0):_.isTransition=!1,g(_),p=c.pending,p===null?(_.next=c.pending=_,IN(c,_)):(_.next=p.next,c.pending=p.next=_)}}function IN(s,c){var p=c.action,g=c.payload,w=s.state;if(c.isTransition){var _=z.T,I={};z.T=I;try{var M=p(w,g),Y=z.S;Y!==null&&Y(I,M),TN(s,c,M)}catch(ue){Qw(s,c,ue)}finally{_!==null&&I.types!==null&&(_.types=I.types),z.T=_}}else try{_=p(w,g),TN(s,c,_)}catch(ue){Qw(s,c,ue)}}function TN(s,c,p){p!==null&&typeof p=="object"&&typeof p.then=="function"?p.then(function(g){NN(s,c,g)},function(g){return Qw(s,c,g)}):NN(s,c,p)}function NN(s,c,p){c.status="fulfilled",c.value=p,AN(c),s.state=p,c=s.pending,c!==null&&(p=c.next,p===c?s.pending=null:(p=p.next,c.next=p,IN(s,p)))}function Qw(s,c,p){var g=s.pending;if(s.pending=null,g!==null){g=g.next;do c.status="rejected",c.reason=p,AN(c),c=c.next;while(c!==g)}s.action=null}function AN(s){s=s.listeners;for(var c=0;c<s.length;c++)(0,s[c])()}function ON(s,c){return c}function $N(s,c){if(Ot){var p=mn.formState;if(p!==null){e:{var g=mt;if(Ot){if(kn){t:{for(var w=kn,_=co;w.nodeType!==8;){if(!_){w=null;break t}if(w=fo(w.nextSibling),w===null){w=null;break t}}_=w.data,w=_==="F!"||_==="F"?w:null}if(w){kn=fo(w.nextSibling),g=w.data==="F!";break e}}Cs(g)}g=!1}g&&(c=p[0])}}return p=Vr(),p.memoizedState=p.baseState=c,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ON,lastRenderedState:c},p.queue=g,p=QN.bind(null,mt,g),g.dispatch=p,g=Jw(!1),_=oS.bind(null,mt,!1,g.queue),g=Vr(),w={state:c,dispatch:null,action:s,pending:null},g.queue=w,p=mZ.bind(null,mt,w,_,p),w.dispatch=p,g.memoizedState=s,[c,p,!1]}function DN(s){var c=Hn();return PN(c,on,s)}function PN(s,c,p){if(c=Ww(s,c,ON)[0],s=wg(za)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var g=ep(c)}catch(I){throw I===Au?dg:I}else g=c;c=Hn();var w=c.queue,_=w.dispatch;return p!==c.memoizedState&&(mt.flags|=2048,Mu(9,{destroy:void 0},hZ.bind(null,w,p),null)),[g,_,s]}function hZ(s,c){s.action=c}function MN(s){var c=Hn(),p=on;if(p!==null)return PN(c,p,s);Hn(),c=c.memoizedState,p=Hn();var g=p.queue.dispatch;return p.memoizedState=s,[c,g,!1]}function Mu(s,c,p,g){return s={tag:s,create:p,deps:g,inst:c,next:null},c=mt.updateQueue,c===null&&(c=bg(),mt.updateQueue=c),p=c.lastEffect,p===null?c.lastEffect=s.next=s:(g=p.next,p.next=s,s.next=g,c.lastEffect=s),s}function zN(){return Hn().memoizedState}function Sg(s,c,p,g){var w=Vr();mt.flags|=s,w.memoizedState=Mu(1|c,{destroy:void 0},p,g===void 0?null:g)}function _g(s,c,p,g){var w=Hn();g=g===void 0?null:g;var _=w.memoizedState.inst;on!==null&&g!==null&&Hw(g,on.memoizedState.deps)?w.memoizedState=Mu(c,_,p,g):(mt.flags|=s,w.memoizedState=Mu(1|c,_,p,g))}function LN(s,c){Sg(8390656,8,s,c)}function eS(s,c){_g(2048,8,s,c)}function gZ(s){mt.flags|=4;var c=mt.updateQueue;if(c===null)c=bg(),mt.updateQueue=c,c.events=[s];else{var p=c.events;p===null?c.events=[s]:p.push(s)}}function FN(s){var c=Hn().memoizedState;return gZ({ref:c,nextImpl:s}),function(){if((Kt&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}function UN(s,c){return _g(4,2,s,c)}function VN(s,c){return _g(4,4,s,c)}function BN(s,c){if(typeof c=="function"){s=s();var p=c(s);return function(){typeof p=="function"?p():c(null)}}if(c!=null)return s=s(),c.current=s,function(){c.current=null}}function HN(s,c,p){p=p!=null?p.concat([s]):null,_g(4,4,BN.bind(null,c,s),p)}function tS(){}function qN(s,c){var p=Hn();c=c===void 0?null:c;var g=p.memoizedState;return c!==null&&Hw(c,g[1])?g[0]:(p.memoizedState=[s,c],s)}function KN(s,c){var p=Hn();c=c===void 0?null:c;var g=p.memoizedState;if(c!==null&&Hw(c,g[1]))return g[0];if(g=s(),oc){fn(!0);try{s()}finally{fn(!1)}}return p.memoizedState=[g,c],g}function nS(s,c,p){return p===void 0||(Ma&1073741824)!==0&&(Nt&261930)===0?s.memoizedState=c:(s.memoizedState=p,s=GA(),mt.lanes|=s,Os|=s,p)}function GN(s,c,p,g){return Ii(p,c)?p:$u.current!==null?(s=nS(s,p,g),Ii(s,c)||(Qn=!0),s):(Ma&42)===0||(Ma&1073741824)!==0&&(Nt&261930)===0?(Qn=!0,s.memoizedState=p):(s=GA(),mt.lanes|=s,Os|=s,c)}function ZN(s,c,p,g,w){var _=W.p;W.p=_!==0&&8>_?_:8;var I=z.T,M={};z.T=M,oS(s,!1,c,p);try{var Y=w(),ue=z.S;if(ue!==null&&ue(M,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var ye=dZ(Y,g);tp(s,c,ye,Di(s))}else tp(s,c,g,Di(s))}catch(_e){tp(s,c,{then:function(){},status:"rejected",reason:_e},Di())}finally{W.p=_,I!==null&&M.types!==null&&(I.types=M.types),z.T=I}}function vZ(){}function rS(s,c,p,g){if(s.tag!==5)throw Error(r(476));var w=YN(s).queue;ZN(s,w,c,L,p===null?vZ:function(){return WN(s),p(g)})}function YN(s){var c=s.memoizedState;if(c!==null)return c;c={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:za,lastRenderedState:L},next:null};var p={};return c.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:za,lastRenderedState:p},next:null},s.memoizedState=c,s=s.alternate,s!==null&&(s.memoizedState=c),c}function WN(s){var c=YN(s);c.next===null&&(c=s.alternate.memoizedState),tp(s,c.next.queue,{},Di())}function iS(){return Cr(yp)}function XN(){return Hn().memoizedState}function JN(){return Hn().memoizedState}function yZ(s){for(var c=s.return;c!==null;){switch(c.tag){case 24:case 3:var p=Di();s=js(p);var g=Rs(c,s,p);g!==null&&(mi(g,c,p),Wf(g,c,p)),c={cache:Ow()},s.payload=c;return}c=c.return}}function bZ(s,c,p){var g=Di();p={lane:g,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Cg(s)?eA(c,p):(p=Sw(s,c,p,g),p!==null&&(mi(p,s,g),tA(p,c,g)))}function QN(s,c,p){var g=Di();tp(s,c,p,g)}function tp(s,c,p,g){var w={lane:g,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(Cg(s))eA(c,w);else{var _=s.alternate;if(s.lanes===0&&(_===null||_.lanes===0)&&(_=c.lastRenderedReducer,_!==null))try{var I=c.lastRenderedState,M=_(I,p);if(w.hasEagerState=!0,w.eagerState=M,Ii(M,I))return ig(s,c,w,0),mn===null&&rg(),!1}catch{}if(p=Sw(s,c,w,g),p!==null)return mi(p,s,g),tA(p,c,g),!0}return!1}function oS(s,c,p,g){if(g={lane:2,revertLane:MS(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Cg(s)){if(c)throw Error(r(479))}else c=Sw(s,p,g,2),c!==null&&mi(c,s,2)}function Cg(s){var c=s.alternate;return s===mt||c!==null&&c===mt}function eA(s,c){Du=vg=!0;var p=s.pending;p===null?c.next=c:(c.next=p.next,p.next=c),s.pending=c}function tA(s,c,p){if((p&4194048)!==0){var g=c.lanes;g&=s.pendingLanes,p|=g,c.lanes=p,ai(s,p)}}var np={readContext:Cr,use:xg,useCallback:Mn,useContext:Mn,useEffect:Mn,useImperativeHandle:Mn,useLayoutEffect:Mn,useInsertionEffect:Mn,useMemo:Mn,useReducer:Mn,useRef:Mn,useState:Mn,useDebugValue:Mn,useDeferredValue:Mn,useTransition:Mn,useSyncExternalStore:Mn,useId:Mn,useHostTransitionStatus:Mn,useFormState:Mn,useActionState:Mn,useOptimistic:Mn,useMemoCache:Mn,useCacheRefresh:Mn};np.useEffectEvent=Mn;var nA={readContext:Cr,use:xg,useCallback:function(s,c){return Vr().memoizedState=[s,c===void 0?null:c],s},useContext:Cr,useEffect:LN,useImperativeHandle:function(s,c,p){p=p!=null?p.concat([s]):null,Sg(4194308,4,BN.bind(null,c,s),p)},useLayoutEffect:function(s,c){return Sg(4194308,4,s,c)},useInsertionEffect:function(s,c){Sg(4,2,s,c)},useMemo:function(s,c){var p=Vr();c=c===void 0?null:c;var g=s();if(oc){fn(!0);try{s()}finally{fn(!1)}}return p.memoizedState=[g,c],g},useReducer:function(s,c,p){var g=Vr();if(p!==void 0){var w=p(c);if(oc){fn(!0);try{p(c)}finally{fn(!1)}}}else w=c;return g.memoizedState=g.baseState=w,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:w},g.queue=s,s=s.dispatch=bZ.bind(null,mt,s),[g.memoizedState,s]},useRef:function(s){var c=Vr();return s={current:s},c.memoizedState=s},useState:function(s){s=Jw(s);var c=s.queue,p=QN.bind(null,mt,c);return c.dispatch=p,[s.memoizedState,p]},useDebugValue:tS,useDeferredValue:function(s,c){var p=Vr();return nS(p,s,c)},useTransition:function(){var s=Jw(!1);return s=ZN.bind(null,mt,s.queue,!0,!1),Vr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,c,p){var g=mt,w=Vr();if(Ot){if(p===void 0)throw Error(r(407));p=p()}else{if(p=c(),mn===null)throw Error(r(349));(Nt&127)!==0||_N(g,c,p)}w.memoizedState=p;var _={value:p,getSnapshot:c};return w.queue=_,LN(kN.bind(null,g,_,s),[s]),g.flags|=2048,Mu(9,{destroy:void 0},CN.bind(null,g,_,p,c),null),p},useId:function(){var s=Vr(),c=mn.identifierPrefix;if(Ot){var p=na,g=ta;p=(g&~(1<<32-jt(g)-1)).toString(32)+p,c="_"+c+"R_"+p,p=yg++,0<p&&(c+="H"+p.toString(32)),c+="_"}else p=fZ++,c="_"+c+"r_"+p.toString(32)+"_";return s.memoizedState=c},useHostTransitionStatus:iS,useFormState:$N,useActionState:$N,useOptimistic:function(s){var c=Vr();c.memoizedState=c.baseState=s;var p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=p,c=oS.bind(null,mt,!0,p),p.dispatch=c,[s,c]},useMemoCache:Yw,useCacheRefresh:function(){return Vr().memoizedState=yZ.bind(null,mt)},useEffectEvent:function(s){var c=Vr(),p={impl:s};return c.memoizedState=p,function(){if((Kt&2)!==0)throw Error(r(440));return p.impl.apply(void 0,arguments)}}},aS={readContext:Cr,use:xg,useCallback:qN,useContext:Cr,useEffect:eS,useImperativeHandle:HN,useInsertionEffect:UN,useLayoutEffect:VN,useMemo:KN,useReducer:wg,useRef:zN,useState:function(){return wg(za)},useDebugValue:tS,useDeferredValue:function(s,c){var p=Hn();return GN(p,on.memoizedState,s,c)},useTransition:function(){var s=wg(za)[0],c=Hn().memoizedState;return[typeof s=="boolean"?s:ep(s),c]},useSyncExternalStore:SN,useId:XN,useHostTransitionStatus:iS,useFormState:DN,useActionState:DN,useOptimistic:function(s,c){var p=Hn();return RN(p,on,s,c)},useMemoCache:Yw,useCacheRefresh:JN};aS.useEffectEvent=FN;var rA={readContext:Cr,use:xg,useCallback:qN,useContext:Cr,useEffect:eS,useImperativeHandle:HN,useInsertionEffect:UN,useLayoutEffect:VN,useMemo:KN,useReducer:Xw,useRef:zN,useState:function(){return Xw(za)},useDebugValue:tS,useDeferredValue:function(s,c){var p=Hn();return on===null?nS(p,s,c):GN(p,on.memoizedState,s,c)},useTransition:function(){var s=Xw(za)[0],c=Hn().memoizedState;return[typeof s=="boolean"?s:ep(s),c]},useSyncExternalStore:SN,useId:XN,useHostTransitionStatus:iS,useFormState:MN,useActionState:MN,useOptimistic:function(s,c){var p=Hn();return on!==null?RN(p,on,s,c):(p.baseState=s,[s,p.queue.dispatch])},useMemoCache:Yw,useCacheRefresh:JN};rA.useEffectEvent=FN;function sS(s,c,p,g){c=s.memoizedState,p=p(g,c),p=p==null?c:h({},c,p),s.memoizedState=p,s.lanes===0&&(s.updateQueue.baseState=p)}var lS={enqueueSetState:function(s,c,p){s=s._reactInternals;var g=Di(),w=js(g);w.payload=c,p!=null&&(w.callback=p),c=Rs(s,w,g),c!==null&&(mi(c,s,g),Wf(c,s,g))},enqueueReplaceState:function(s,c,p){s=s._reactInternals;var g=Di(),w=js(g);w.tag=1,w.payload=c,p!=null&&(w.callback=p),c=Rs(s,w,g),c!==null&&(mi(c,s,g),Wf(c,s,g))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var p=Di(),g=js(p);g.tag=2,c!=null&&(g.callback=c),c=Rs(s,g,p),c!==null&&(mi(c,s,p),Wf(c,s,p))}};function iA(s,c,p,g,w,_,I){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,_,I):c.prototype&&c.prototype.isPureReactComponent?!Vf(p,g)||!Vf(w,_):!0}function oA(s,c,p,g){s=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(p,g),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(p,g),c.state!==s&&lS.enqueueReplaceState(c,c.state,null)}function ac(s,c){var p=c;if("ref"in c){p={};for(var g in c)g!=="ref"&&(p[g]=c[g])}if(s=s.defaultProps){p===c&&(p=h({},p));for(var w in s)p[w]===void 0&&(p[w]=s[w])}return p}function aA(s){ng(s)}function sA(s){console.error(s)}function lA(s){ng(s)}function kg(s,c){try{var p=s.onUncaughtError;p(c.value,{componentStack:c.stack})}catch(g){setTimeout(function(){throw g})}}function cA(s,c,p){try{var g=s.onCaughtError;g(p.value,{componentStack:p.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(w){setTimeout(function(){throw w})}}function cS(s,c,p){return p=js(p),p.tag=3,p.payload={element:null},p.callback=function(){kg(s,c)},p}function uA(s){return s=js(s),s.tag=3,s}function dA(s,c,p,g){var w=p.type.getDerivedStateFromError;if(typeof w=="function"){var _=g.value;s.payload=function(){return w(_)},s.callback=function(){cA(c,p,g)}}var I=p.stateNode;I!==null&&typeof I.componentDidCatch=="function"&&(s.callback=function(){cA(c,p,g),typeof w!="function"&&($s===null?$s=new Set([this]):$s.add(this));var M=g.stack;this.componentDidCatch(g.value,{componentStack:M!==null?M:""})})}function xZ(s,c,p,g,w){if(p.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(c=p.alternate,c!==null&&Iu(c,p,w,!0),p=Ni.current,p!==null){switch(p.tag){case 31:case 13:return uo===null?Mg():p.alternate===null&&zn===0&&(zn=3),p.flags&=-257,p.flags|=65536,p.lanes=w,g===fg?p.flags|=16384:(c=p.updateQueue,c===null?p.updateQueue=new Set([g]):c.add(g),$S(s,g,w)),!1;case 22:return p.flags|=65536,g===fg?p.flags|=16384:(c=p.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([g])},p.updateQueue=c):(p=c.retryQueue,p===null?c.retryQueue=new Set([g]):p.add(g)),$S(s,g,w)),!1}throw Error(r(435,p.tag))}return $S(s,g,w),Mg(),!1}if(Ot)return c=Ni.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=w,g!==Rw&&(s=Error(r(422),{cause:g}),qf(ao(s,p)))):(g!==Rw&&(c=Error(r(423),{cause:g}),qf(ao(c,p))),s=s.current.alternate,s.flags|=65536,w&=-w,s.lanes|=w,g=ao(g,p),w=cS(s.stateNode,g,w),Lw(s,w),zn!==4&&(zn=2)),!1;var _=Error(r(520),{cause:g});if(_=ao(_,p),up===null?up=[_]:up.push(_),zn!==4&&(zn=2),c===null)return!0;g=ao(g,p),p=c;do{switch(p.tag){case 3:return p.flags|=65536,s=w&-w,p.lanes|=s,s=cS(p.stateNode,g,s),Lw(p,s),!1;case 1:if(c=p.type,_=p.stateNode,(p.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&($s===null||!$s.has(_))))return p.flags|=65536,w&=-w,p.lanes|=w,w=uA(w),dA(w,s,p,g),Lw(p,w),!1}p=p.return}while(p!==null);return!1}var uS=Error(r(461)),Qn=!1;function kr(s,c,p,g){c.child=s===null?hN(c,null,p,g):ic(c,s.child,p,g)}function fA(s,c,p,g,w){p=p.render;var _=c.ref;if("ref"in g){var I={};for(var M in g)M!=="ref"&&(I[M]=g[M])}else I=g;return ec(c),g=qw(s,c,p,I,_,w),M=Kw(),s!==null&&!Qn?(Gw(s,c,w),La(s,c,w)):(Ot&&M&&Ew(c),c.flags|=1,kr(s,c,g,w),c.child)}function pA(s,c,p,g,w){if(s===null){var _=p.type;return typeof _=="function"&&!_w(_)&&_.defaultProps===void 0&&p.compare===null?(c.tag=15,c.type=_,mA(s,c,_,g,w)):(s=ag(p.type,null,g,c,c.mode,w),s.ref=c.ref,s.return=c,c.child=s)}if(_=s.child,!yS(s,w)){var I=_.memoizedProps;if(p=p.compare,p=p!==null?p:Vf,p(I,g)&&s.ref===c.ref)return La(s,c,w)}return c.flags|=1,s=Oa(_,g),s.ref=c.ref,s.return=c,c.child=s}function mA(s,c,p,g,w){if(s!==null){var _=s.memoizedProps;if(Vf(_,g)&&s.ref===c.ref)if(Qn=!1,c.pendingProps=g=_,yS(s,w))(s.flags&131072)!==0&&(Qn=!0);else return c.lanes=s.lanes,La(s,c,w)}return dS(s,c,p,g,w)}function hA(s,c,p,g){var w=g.children,_=s!==null?s.memoizedState:null;if(s===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((c.flags&128)!==0){if(_=_!==null?_.baseLanes|p:p,s!==null){for(g=c.child=s.child,w=0;g!==null;)w=w|g.lanes|g.childLanes,g=g.sibling;g=w&~_}else g=0,c.child=null;return gA(s,c,_,p,g)}if((p&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},s!==null&&ug(c,_!==null?_.cachePool:null),_!==null?yN(c,_):Uw(),bN(c);else return g=c.lanes=536870912,gA(s,c,_!==null?_.baseLanes|p:p,p,g)}else _!==null?(ug(c,_.cachePool),yN(c,_),Ts(),c.memoizedState=null):(s!==null&&ug(c,null),Uw(),Ts());return kr(s,c,w,p),c.child}function rp(s,c){return s!==null&&s.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function gA(s,c,p,g,w){var _=Dw();return _=_===null?null:{parent:Xn._currentValue,pool:_},c.memoizedState={baseLanes:p,cachePool:_},s!==null&&ug(c,null),Uw(),bN(c),s!==null&&Iu(s,c,g,!0),c.childLanes=w,null}function Eg(s,c){return c=Rg({mode:c.mode,children:c.children},s.mode),c.ref=s.ref,s.child=c,c.return=s,c}function vA(s,c,p){return ic(c,s.child,null,p),s=Eg(c,c.pendingProps),s.flags|=2,Ai(c),c.memoizedState=null,s}function wZ(s,c,p){var g=c.pendingProps,w=(c.flags&128)!==0;if(c.flags&=-129,s===null){if(Ot){if(g.mode==="hidden")return s=Eg(c,g),c.lanes=536870912,rp(null,s);if(Bw(c),(s=kn)?(s=IO(s,co),s=s!==null&&s.data==="&"?s:null,s!==null&&(c.memoizedState={dehydrated:s,treeContext:Ss!==null?{id:ta,overflow:na}:null,retryLane:536870912,hydrationErrors:null},p=eN(s),p.return=c,c.child=p,_r=c,kn=null)):s=null,s===null)throw Cs(c);return c.lanes=536870912,null}return Eg(c,g)}var _=s.memoizedState;if(_!==null){var I=_.dehydrated;if(Bw(c),w)if(c.flags&256)c.flags&=-257,c=vA(s,c,p);else if(c.memoizedState!==null)c.child=s.child,c.flags|=128,c=null;else throw Error(r(558));else if(Qn||Iu(s,c,p,!1),w=(p&s.childLanes)!==0,Qn||w){if(g=mn,g!==null&&(I=si(g,p),I!==0&&I!==_.retryLane))throw _.retryLane=I,Wl(s,I),mi(g,s,I),uS;Mg(),c=vA(s,c,p)}else s=_.treeContext,kn=fo(I.nextSibling),_r=c,Ot=!0,_s=null,co=!1,s!==null&&rN(c,s),c=Eg(c,g),c.flags|=4096;return c}return s=Oa(s.child,{mode:g.mode,children:g.children}),s.ref=c.ref,c.child=s,s.return=c,s}function jg(s,c){var p=c.ref;if(p===null)s!==null&&s.ref!==null&&(c.flags|=4194816);else{if(typeof p!="function"&&typeof p!="object")throw Error(r(284));(s===null||s.ref!==p)&&(c.flags|=4194816)}}function dS(s,c,p,g,w){return ec(c),p=qw(s,c,p,g,void 0,w),g=Kw(),s!==null&&!Qn?(Gw(s,c,w),La(s,c,w)):(Ot&&g&&Ew(c),c.flags|=1,kr(s,c,p,w),c.child)}function yA(s,c,p,g,w,_){return ec(c),c.updateQueue=null,p=wN(c,g,p,w),xN(s),g=Kw(),s!==null&&!Qn?(Gw(s,c,_),La(s,c,_)):(Ot&&g&&Ew(c),c.flags|=1,kr(s,c,p,_),c.child)}function bA(s,c,p,g,w){if(ec(c),c.stateNode===null){var _=ku,I=p.contextType;typeof I=="object"&&I!==null&&(_=Cr(I)),_=new p(g,_),c.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=lS,c.stateNode=_,_._reactInternals=c,_=c.stateNode,_.props=g,_.state=c.memoizedState,_.refs={},Mw(c),I=p.contextType,_.context=typeof I=="object"&&I!==null?Cr(I):ku,_.state=c.memoizedState,I=p.getDerivedStateFromProps,typeof I=="function"&&(sS(c,p,I,g),_.state=c.memoizedState),typeof p.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(I=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),I!==_.state&&lS.enqueueReplaceState(_,_.state,null),Jf(c,g,_,w),Xf(),_.state=c.memoizedState),typeof _.componentDidMount=="function"&&(c.flags|=4194308),g=!0}else if(s===null){_=c.stateNode;var M=c.memoizedProps,Y=ac(p,M);_.props=Y;var ue=_.context,ye=p.contextType;I=ku,typeof ye=="object"&&ye!==null&&(I=Cr(ye));var _e=p.getDerivedStateFromProps;ye=typeof _e=="function"||typeof _.getSnapshotBeforeUpdate=="function",M=c.pendingProps!==M,ye||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(M||ue!==I)&&oA(c,_,g,I),Es=!1;var de=c.memoizedState;_.state=de,Jf(c,g,_,w),Xf(),ue=c.memoizedState,M||de!==ue||Es?(typeof _e=="function"&&(sS(c,p,_e,g),ue=c.memoizedState),(Y=Es||iA(c,p,Y,g,de,ue,I))?(ye||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(c.flags|=4194308)):(typeof _.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=g,c.memoizedState=ue),_.props=g,_.state=ue,_.context=I,g=Y):(typeof _.componentDidMount=="function"&&(c.flags|=4194308),g=!1)}else{_=c.stateNode,zw(s,c),I=c.memoizedProps,ye=ac(p,I),_.props=ye,_e=c.pendingProps,de=_.context,ue=p.contextType,Y=ku,typeof ue=="object"&&ue!==null&&(Y=Cr(ue)),M=p.getDerivedStateFromProps,(ue=typeof M=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(I!==_e||de!==Y)&&oA(c,_,g,Y),Es=!1,de=c.memoizedState,_.state=de,Jf(c,g,_,w),Xf();var he=c.memoizedState;I!==_e||de!==he||Es||s!==null&&s.dependencies!==null&&lg(s.dependencies)?(typeof M=="function"&&(sS(c,p,M,g),he=c.memoizedState),(ye=Es||iA(c,p,ye,g,de,he,Y)||s!==null&&s.dependencies!==null&&lg(s.dependencies))?(ue||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(g,he,Y),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(g,he,Y)),typeof _.componentDidUpdate=="function"&&(c.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof _.componentDidUpdate!="function"||I===s.memoizedProps&&de===s.memoizedState||(c.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||I===s.memoizedProps&&de===s.memoizedState||(c.flags|=1024),c.memoizedProps=g,c.memoizedState=he),_.props=g,_.state=he,_.context=Y,g=ye):(typeof _.componentDidUpdate!="function"||I===s.memoizedProps&&de===s.memoizedState||(c.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||I===s.memoizedProps&&de===s.memoizedState||(c.flags|=1024),g=!1)}return _=g,jg(s,c),g=(c.flags&128)!==0,_||g?(_=c.stateNode,p=g&&typeof p.getDerivedStateFromError!="function"?null:_.render(),c.flags|=1,s!==null&&g?(c.child=ic(c,s.child,null,w),c.child=ic(c,null,p,w)):kr(s,c,p,w),c.memoizedState=_.state,s=c.child):s=La(s,c,w),s}function xA(s,c,p,g){return Jl(),c.flags|=256,kr(s,c,p,g),c.child}var fS={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function pS(s){return{baseLanes:s,cachePool:cN()}}function mS(s,c,p){return s=s!==null?s.childLanes&~p:0,c&&(s|=$i),s}function wA(s,c,p){var g=c.pendingProps,w=!1,_=(c.flags&128)!==0,I;if((I=_)||(I=s!==null&&s.memoizedState===null?!1:(Bn.current&2)!==0),I&&(w=!0,c.flags&=-129),I=(c.flags&32)!==0,c.flags&=-33,s===null){if(Ot){if(w?Is(c):Ts(),(s=kn)?(s=IO(s,co),s=s!==null&&s.data!=="&"?s:null,s!==null&&(c.memoizedState={dehydrated:s,treeContext:Ss!==null?{id:ta,overflow:na}:null,retryLane:536870912,hydrationErrors:null},p=eN(s),p.return=c,c.child=p,_r=c,kn=null)):s=null,s===null)throw Cs(c);return WS(s)?c.lanes=32:c.lanes=536870912,null}var M=g.children;return g=g.fallback,w?(Ts(),w=c.mode,M=Rg({mode:"hidden",children:M},w),g=Xl(g,w,p,null),M.return=c,g.return=c,M.sibling=g,c.child=M,g=c.child,g.memoizedState=pS(p),g.childLanes=mS(s,I,p),c.memoizedState=fS,rp(null,g)):(Is(c),hS(c,M))}var Y=s.memoizedState;if(Y!==null&&(M=Y.dehydrated,M!==null)){if(_)c.flags&256?(Is(c),c.flags&=-257,c=gS(s,c,p)):c.memoizedState!==null?(Ts(),c.child=s.child,c.flags|=128,c=null):(Ts(),M=g.fallback,w=c.mode,g=Rg({mode:"visible",children:g.children},w),M=Xl(M,w,p,null),M.flags|=2,g.return=c,M.return=c,g.sibling=M,c.child=g,ic(c,s.child,null,p),g=c.child,g.memoizedState=pS(p),g.childLanes=mS(s,I,p),c.memoizedState=fS,c=rp(null,g));else if(Is(c),WS(M)){if(I=M.nextSibling&&M.nextSibling.dataset,I)var ue=I.dgst;I=ue,g=Error(r(419)),g.stack="",g.digest=I,qf({value:g,source:null,stack:null}),c=gS(s,c,p)}else if(Qn||Iu(s,c,p,!1),I=(p&s.childLanes)!==0,Qn||I){if(I=mn,I!==null&&(g=si(I,p),g!==0&&g!==Y.retryLane))throw Y.retryLane=g,Wl(s,g),mi(I,s,g),uS;YS(M)||Mg(),c=gS(s,c,p)}else YS(M)?(c.flags|=192,c.child=s.child,c=null):(s=Y.treeContext,kn=fo(M.nextSibling),_r=c,Ot=!0,_s=null,co=!1,s!==null&&rN(c,s),c=hS(c,g.children),c.flags|=4096);return c}return w?(Ts(),M=g.fallback,w=c.mode,Y=s.child,ue=Y.sibling,g=Oa(Y,{mode:"hidden",children:g.children}),g.subtreeFlags=Y.subtreeFlags&65011712,ue!==null?M=Oa(ue,M):(M=Xl(M,w,p,null),M.flags|=2),M.return=c,g.return=c,g.sibling=M,c.child=g,rp(null,g),g=c.child,M=s.child.memoizedState,M===null?M=pS(p):(w=M.cachePool,w!==null?(Y=Xn._currentValue,w=w.parent!==Y?{parent:Y,pool:Y}:w):w=cN(),M={baseLanes:M.baseLanes|p,cachePool:w}),g.memoizedState=M,g.childLanes=mS(s,I,p),c.memoizedState=fS,rp(s.child,g)):(Is(c),p=s.child,s=p.sibling,p=Oa(p,{mode:"visible",children:g.children}),p.return=c,p.sibling=null,s!==null&&(I=c.deletions,I===null?(c.deletions=[s],c.flags|=16):I.push(s)),c.child=p,c.memoizedState=null,p)}function hS(s,c){return c=Rg({mode:"visible",children:c},s.mode),c.return=s,s.child=c}function Rg(s,c){return s=Ti(22,s,null,c),s.lanes=0,s}function gS(s,c,p){return ic(c,s.child,null,p),s=hS(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function SA(s,c,p){s.lanes|=c;var g=s.alternate;g!==null&&(g.lanes|=c),Nw(s.return,c,p)}function vS(s,c,p,g,w,_){var I=s.memoizedState;I===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:g,tail:p,tailMode:w,treeForkCount:_}:(I.isBackwards=c,I.rendering=null,I.renderingStartTime=0,I.last=g,I.tail=p,I.tailMode=w,I.treeForkCount=_)}function _A(s,c,p){var g=c.pendingProps,w=g.revealOrder,_=g.tail;g=g.children;var I=Bn.current,M=(I&2)!==0;if(M?(I=I&1|2,c.flags|=128):I&=1,O(Bn,I),kr(s,c,g,p),g=Ot?Hf:0,!M&&s!==null&&(s.flags&128)!==0)e:for(s=c.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&SA(s,p,c);else if(s.tag===19)SA(s,p,c);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===c)break e;for(;s.sibling===null;){if(s.return===null||s.return===c)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(w){case"forwards":for(p=c.child,w=null;p!==null;)s=p.alternate,s!==null&&gg(s)===null&&(w=p),p=p.sibling;p=w,p===null?(w=c.child,c.child=null):(w=p.sibling,p.sibling=null),vS(c,!1,w,p,_,g);break;case"backwards":case"unstable_legacy-backwards":for(p=null,w=c.child,c.child=null;w!==null;){if(s=w.alternate,s!==null&&gg(s)===null){c.child=w;break}s=w.sibling,w.sibling=p,p=w,w=s}vS(c,!0,p,null,_,g);break;case"together":vS(c,!1,null,null,void 0,g);break;default:c.memoizedState=null}return c.child}function La(s,c,p){if(s!==null&&(c.dependencies=s.dependencies),Os|=c.lanes,(p&c.childLanes)===0)if(s!==null){if(Iu(s,c,p,!1),(p&c.childLanes)===0)return null}else return null;if(s!==null&&c.child!==s.child)throw Error(r(153));if(c.child!==null){for(s=c.child,p=Oa(s,s.pendingProps),c.child=p,p.return=c;s.sibling!==null;)s=s.sibling,p=p.sibling=Oa(s,s.pendingProps),p.return=c;p.sibling=null}return c.child}function yS(s,c){return(s.lanes&c)!==0?!0:(s=s.dependencies,!!(s!==null&&lg(s)))}function SZ(s,c,p){switch(c.tag){case 3:ve(c,c.stateNode.containerInfo),ks(c,Xn,s.memoizedState.cache),Jl();break;case 27:case 5:ke(c);break;case 4:ve(c,c.stateNode.containerInfo);break;case 10:ks(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,Bw(c),null;break;case 13:var g=c.memoizedState;if(g!==null)return g.dehydrated!==null?(Is(c),c.flags|=128,null):(p&c.child.childLanes)!==0?wA(s,c,p):(Is(c),s=La(s,c,p),s!==null?s.sibling:null);Is(c);break;case 19:var w=(s.flags&128)!==0;if(g=(p&c.childLanes)!==0,g||(Iu(s,c,p,!1),g=(p&c.childLanes)!==0),w){if(g)return _A(s,c,p);c.flags|=128}if(w=c.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),O(Bn,Bn.current),g)break;return null;case 22:return c.lanes=0,hA(s,c,p,c.pendingProps);case 24:ks(c,Xn,s.memoizedState.cache)}return La(s,c,p)}function CA(s,c,p){if(s!==null)if(s.memoizedProps!==c.pendingProps)Qn=!0;else{if(!yS(s,p)&&(c.flags&128)===0)return Qn=!1,SZ(s,c,p);Qn=(s.flags&131072)!==0}else Qn=!1,Ot&&(c.flags&1048576)!==0&&nN(c,Hf,c.index);switch(c.lanes=0,c.tag){case 16:e:{var g=c.pendingProps;if(s=nc(c.elementType),c.type=s,typeof s=="function")_w(s)?(g=ac(s,g),c.tag=1,c=bA(null,c,s,g,p)):(c.tag=0,c=dS(null,c,s,g,p));else{if(s!=null){var w=s.$$typeof;if(w===R){c.tag=11,c=fA(null,c,s,g,p);break e}else if(w===A){c.tag=14,c=pA(null,c,s,g,p);break e}}throw c=V(s)||s,Error(r(306,c,""))}}return c;case 0:return dS(s,c,c.type,c.pendingProps,p);case 1:return g=c.type,w=ac(g,c.pendingProps),bA(s,c,g,w,p);case 3:e:{if(ve(c,c.stateNode.containerInfo),s===null)throw Error(r(387));g=c.pendingProps;var _=c.memoizedState;w=_.element,zw(s,c),Jf(c,g,null,p);var I=c.memoizedState;if(g=I.cache,ks(c,Xn,g),g!==_.cache&&Aw(c,[Xn],p,!0),Xf(),g=I.element,_.isDehydrated)if(_={element:g,isDehydrated:!1,cache:I.cache},c.updateQueue.baseState=_,c.memoizedState=_,c.flags&256){c=xA(s,c,g,p);break e}else if(g!==w){w=ao(Error(r(424)),c),qf(w),c=xA(s,c,g,p);break e}else for(s=c.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,kn=fo(s.firstChild),_r=c,Ot=!0,_s=null,co=!0,p=hN(c,null,g,p),c.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(Jl(),g===w){c=La(s,c,p);break e}kr(s,c,g,p)}c=c.child}return c;case 26:return jg(s,c),s===null?(p=DO(c.type,null,c.pendingProps,null))?c.memoizedState=p:Ot||(p=c.type,s=c.pendingProps,g=Hg(ge.current).createElement(p),g[Sr]=c,g[li]=s,Er(g,p,s),mr(g),c.stateNode=g):c.memoizedState=DO(c.type,s.memoizedProps,c.pendingProps,s.memoizedState),null;case 27:return ke(c),s===null&&Ot&&(g=c.stateNode=AO(c.type,c.pendingProps,ge.current),_r=c,co=!0,w=kn,zs(c.type)?(XS=w,kn=fo(g.firstChild)):kn=w),kr(s,c,c.pendingProps.children,p),jg(s,c),s===null&&(c.flags|=4194304),c.child;case 5:return s===null&&Ot&&((w=g=kn)&&(g=JZ(g,c.type,c.pendingProps,co),g!==null?(c.stateNode=g,_r=c,kn=fo(g.firstChild),co=!1,w=!0):w=!1),w||Cs(c)),ke(c),w=c.type,_=c.pendingProps,I=s!==null?s.memoizedProps:null,g=_.children,KS(w,_)?g=null:I!==null&&KS(w,I)&&(c.flags|=32),c.memoizedState!==null&&(w=qw(s,c,pZ,null,null,p),yp._currentValue=w),jg(s,c),kr(s,c,g,p),c.child;case 6:return s===null&&Ot&&((s=p=kn)&&(p=QZ(p,c.pendingProps,co),p!==null?(c.stateNode=p,_r=c,kn=null,s=!0):s=!1),s||Cs(c)),null;case 13:return wA(s,c,p);case 4:return ve(c,c.stateNode.containerInfo),g=c.pendingProps,s===null?c.child=ic(c,null,g,p):kr(s,c,g,p),c.child;case 11:return fA(s,c,c.type,c.pendingProps,p);case 7:return kr(s,c,c.pendingProps,p),c.child;case 8:return kr(s,c,c.pendingProps.children,p),c.child;case 12:return kr(s,c,c.pendingProps.children,p),c.child;case 10:return g=c.pendingProps,ks(c,c.type,g.value),kr(s,c,g.children,p),c.child;case 9:return w=c.type._context,g=c.pendingProps.children,ec(c),w=Cr(w),g=g(w),c.flags|=1,kr(s,c,g,p),c.child;case 14:return pA(s,c,c.type,c.pendingProps,p);case 15:return mA(s,c,c.type,c.pendingProps,p);case 19:return _A(s,c,p);case 31:return wZ(s,c,p);case 22:return hA(s,c,p,c.pendingProps);case 24:return ec(c),g=Cr(Xn),s===null?(w=Dw(),w===null&&(w=mn,_=Ow(),w.pooledCache=_,_.refCount++,_!==null&&(w.pooledCacheLanes|=p),w=_),c.memoizedState={parent:g,cache:w},Mw(c),ks(c,Xn,w)):((s.lanes&p)!==0&&(zw(s,c),Jf(c,null,null,p),Xf()),w=s.memoizedState,_=c.memoizedState,w.parent!==g?(w={parent:g,cache:g},c.memoizedState=w,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=w),ks(c,Xn,g)):(g=_.cache,ks(c,Xn,g),g!==w.cache&&Aw(c,[Xn],p,!0))),kr(s,c,c.pendingProps.children,p),c.child;case 29:throw c.pendingProps}throw Error(r(156,c.tag))}function Fa(s){s.flags|=4}function bS(s,c,p,g,w){if((c=(s.mode&32)!==0)&&(c=!1),c){if(s.flags|=16777216,(w&335544128)===w)if(s.stateNode.complete)s.flags|=8192;else if(XA())s.flags|=8192;else throw rc=fg,Pw}else s.flags&=-16777217}function kA(s,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!FO(c))if(XA())s.flags|=8192;else throw rc=fg,Pw}function Ig(s,c){c!==null&&(s.flags|=4),s.flags&16384&&(c=s.tag!==22?pr():536870912,s.lanes|=c,Uu|=c)}function ip(s,c){if(!Ot)switch(s.tailMode){case"hidden":c=s.tail;for(var p=null;c!==null;)c.alternate!==null&&(p=c),c=c.sibling;p===null?s.tail=null:p.sibling=null;break;case"collapsed":p=s.tail;for(var g=null;p!==null;)p.alternate!==null&&(g=p),p=p.sibling;g===null?c||s.tail===null?s.tail=null:s.tail.sibling=null:g.sibling=null}}function En(s){var c=s.alternate!==null&&s.alternate.child===s.child,p=0,g=0;if(c)for(var w=s.child;w!==null;)p|=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;)p|=w.lanes|w.childLanes,g|=w.subtreeFlags,g|=w.flags,w.return=s,w=w.sibling;return s.subtreeFlags|=g,s.childLanes=p,c}function _Z(s,c,p){var g=c.pendingProps;switch(jw(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return En(c),null;case 1:return En(c),null;case 3:return p=c.stateNode,g=null,s!==null&&(g=s.memoizedState.cache),c.memoizedState.cache!==g&&(c.flags|=2048),Pa(Xn),be(),p.pendingContext&&(p.context=p.pendingContext,p.pendingContext=null),(s===null||s.child===null)&&(Ru(c)?Fa(c):s===null||s.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,Iw())),En(c),null;case 26:var w=c.type,_=c.memoizedState;return s===null?(Fa(c),_!==null?(En(c),kA(c,_)):(En(c),bS(c,w,null,g,p))):_?_!==s.memoizedState?(Fa(c),En(c),kA(c,_)):(En(c),c.flags&=-16777217):(s=s.memoizedProps,s!==g&&Fa(c),En(c),bS(c,w,s,g,p)),null;case 27:if($e(c),p=ge.current,w=c.type,s!==null&&c.stateNode!=null)s.memoizedProps!==g&&Fa(c);else{if(!g){if(c.stateNode===null)throw Error(r(166));return En(c),null}s=J.current,Ru(c)?iN(c):(s=AO(w,g,p),c.stateNode=s,Fa(c))}return En(c),null;case 5:if($e(c),w=c.type,s!==null&&c.stateNode!=null)s.memoizedProps!==g&&Fa(c);else{if(!g){if(c.stateNode===null)throw Error(r(166));return En(c),null}if(_=J.current,Ru(c))iN(c);else{var I=Hg(ge.current);switch(_){case 1:_=I.createElementNS("http://www.w3.org/2000/svg",w);break;case 2:_=I.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;default:switch(w){case"svg":_=I.createElementNS("http://www.w3.org/2000/svg",w);break;case"math":_=I.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;case"script":_=I.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof g.is=="string"?I.createElement("select",{is:g.is}):I.createElement("select"),g.multiple?_.multiple=!0:g.size&&(_.size=g.size);break;default:_=typeof g.is=="string"?I.createElement(w,{is:g.is}):I.createElement(w)}}_[Sr]=c,_[li]=g;e:for(I=c.child;I!==null;){if(I.tag===5||I.tag===6)_.appendChild(I.stateNode);else if(I.tag!==4&&I.tag!==27&&I.child!==null){I.child.return=I,I=I.child;continue}if(I===c)break e;for(;I.sibling===null;){if(I.return===null||I.return===c)break e;I=I.return}I.sibling.return=I.return,I=I.sibling}c.stateNode=_;e:switch(Er(_,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&&Fa(c)}}return En(c),bS(c,c.type,s===null?null:s.memoizedProps,c.pendingProps,p),null;case 6:if(s&&c.stateNode!=null)s.memoizedProps!==g&&Fa(c);else{if(typeof g!="string"&&c.stateNode===null)throw Error(r(166));if(s=ge.current,Ru(c)){if(s=c.stateNode,p=c.memoizedProps,g=null,w=_r,w!==null)switch(w.tag){case 27:case 5:g=w.memoizedProps}s[Sr]=c,s=!!(s.nodeValue===p||g!==null&&g.suppressHydrationWarning===!0||wO(s.nodeValue,p)),s||Cs(c,!0)}else s=Hg(s).createTextNode(g),s[Sr]=c,c.stateNode=s}return En(c),null;case 31:if(p=c.memoizedState,s===null||s.memoizedState!==null){if(g=Ru(c),p!==null){if(s===null){if(!g)throw Error(r(318));if(s=c.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Sr]=c}else Jl(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;En(c),s=!1}else p=Iw(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=p),s=!0;if(!s)return c.flags&256?(Ai(c),c):(Ai(c),null);if((c.flags&128)!==0)throw Error(r(558))}return En(c),null;case 13:if(g=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(w=Ru(c),g!==null&&g.dehydrated!==null){if(s===null){if(!w)throw Error(r(318));if(w=c.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(r(317));w[Sr]=c}else Jl(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;En(c),w=!1}else w=Iw(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=w),w=!0;if(!w)return c.flags&256?(Ai(c),c):(Ai(c),null)}return Ai(c),(c.flags&128)!==0?(c.lanes=p,c):(p=g!==null,s=s!==null&&s.memoizedState!==null,p&&(g=c.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)),p!==s&&p&&(c.child.flags|=8192),Ig(c,c.updateQueue),En(c),null);case 4:return be(),s===null&&US(c.stateNode.containerInfo),En(c),null;case 10:return Pa(c.type),En(c),null;case 19:if(U(Bn),g=c.memoizedState,g===null)return En(c),null;if(w=(c.flags&128)!==0,_=g.rendering,_===null)if(w)ip(g,!1);else{if(zn!==0||s!==null&&(s.flags&128)!==0)for(s=c.child;s!==null;){if(_=gg(s),_!==null){for(c.flags|=128,ip(g,!1),s=_.updateQueue,c.updateQueue=s,Ig(c,s),c.subtreeFlags=0,s=p,p=c.child;p!==null;)QT(p,s),p=p.sibling;return O(Bn,Bn.current&1|2),Ot&&$a(c,g.treeForkCount),c.child}s=s.sibling}g.tail!==null&&ie()>$g&&(c.flags|=128,w=!0,ip(g,!1),c.lanes=4194304)}else{if(!w)if(s=gg(_),s!==null){if(c.flags|=128,w=!0,s=s.updateQueue,c.updateQueue=s,Ig(c,s),ip(g,!0),g.tail===null&&g.tailMode==="hidden"&&!_.alternate&&!Ot)return En(c),null}else 2*ie()-g.renderingStartTime>$g&&p!==536870912&&(c.flags|=128,w=!0,ip(g,!1),c.lanes=4194304);g.isBackwards?(_.sibling=c.child,c.child=_):(s=g.last,s!==null?s.sibling=_:c.child=_,g.last=_)}return g.tail!==null?(s=g.tail,g.rendering=s,g.tail=s.sibling,g.renderingStartTime=ie(),s.sibling=null,p=Bn.current,O(Bn,w?p&1|2:p&1),Ot&&$a(c,g.treeForkCount),s):(En(c),null);case 22:case 23:return Ai(c),Vw(),g=c.memoizedState!==null,s!==null?s.memoizedState!==null!==g&&(c.flags|=8192):g&&(c.flags|=8192),g?(p&536870912)!==0&&(c.flags&128)===0&&(En(c),c.subtreeFlags&6&&(c.flags|=8192)):En(c),p=c.updateQueue,p!==null&&Ig(c,p.retryQueue),p=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==p&&(c.flags|=2048),s!==null&&U(tc),null;case 24:return p=null,s!==null&&(p=s.memoizedState.cache),c.memoizedState.cache!==p&&(c.flags|=2048),Pa(Xn),En(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function CZ(s,c){switch(jw(c),c.tag){case 1:return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return Pa(Xn),be(),s=c.flags,(s&65536)!==0&&(s&128)===0?(c.flags=s&-65537|128,c):null;case 26:case 27:case 5:return $e(c),null;case 31:if(c.memoizedState!==null){if(Ai(c),c.alternate===null)throw Error(r(340));Jl()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 13:if(Ai(c),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Jl()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return U(Bn),null;case 4:return be(),null;case 10:return Pa(c.type),null;case 22:case 23:return Ai(c),Vw(),s!==null&&U(tc),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 24:return Pa(Xn),null;case 25:return null;default:return null}}function EA(s,c){switch(jw(c),c.tag){case 3:Pa(Xn),be();break;case 26:case 27:case 5:$e(c);break;case 4:be();break;case 31:c.memoizedState!==null&&Ai(c);break;case 13:Ai(c);break;case 19:U(Bn);break;case 10:Pa(c.type);break;case 22:case 23:Ai(c),Vw(),s!==null&&U(tc);break;case 24:Pa(Xn)}}function op(s,c){try{var p=c.updateQueue,g=p!==null?p.lastEffect:null;if(g!==null){var w=g.next;p=w;do{if((p.tag&s)===s){g=void 0;var _=p.create,I=p.inst;g=_(),I.destroy=g}p=p.next}while(p!==w)}}catch(M){tn(c,c.return,M)}}function Ns(s,c,p){try{var g=c.updateQueue,w=g!==null?g.lastEffect:null;if(w!==null){var _=w.next;g=_;do{if((g.tag&s)===s){var I=g.inst,M=I.destroy;if(M!==void 0){I.destroy=void 0,w=c;var Y=p,ue=M;try{ue()}catch(ye){tn(w,Y,ye)}}}g=g.next}while(g!==_)}}catch(ye){tn(c,c.return,ye)}}function jA(s){var c=s.updateQueue;if(c!==null){var p=s.stateNode;try{vN(c,p)}catch(g){tn(s,s.return,g)}}}function RA(s,c,p){p.props=ac(s.type,s.memoizedProps),p.state=s.memoizedState;try{p.componentWillUnmount()}catch(g){tn(s,c,g)}}function ap(s,c){try{var p=s.ref;if(p!==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 p=="function"?s.refCleanup=p(g):p.current=g}}catch(w){tn(s,c,w)}}function ra(s,c){var p=s.ref,g=s.refCleanup;if(p!==null)if(typeof g=="function")try{g()}catch(w){tn(s,c,w)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(w){tn(s,c,w)}else p.current=null}function IA(s){var c=s.type,p=s.memoizedProps,g=s.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":p.autoFocus&&g.focus();break e;case"img":p.src?g.src=p.src:p.srcSet&&(g.srcset=p.srcSet)}}catch(w){tn(s,s.return,w)}}function xS(s,c,p){try{var g=s.stateNode;KZ(g,s.type,p,c),g[li]=c}catch(w){tn(s,s.return,w)}}function TA(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&zs(s.type)||s.tag===4}function wS(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||TA(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&&zs(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 SS(s,c,p){var g=s.tag;if(g===5||g===6)s=s.stateNode,c?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(s,c):(c=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,c.appendChild(s),p=p._reactRootContainer,p!=null||c.onclick!==null||(c.onclick=Na));else if(g!==4&&(g===27&&zs(s.type)&&(p=s.stateNode,c=null),s=s.child,s!==null))for(SS(s,c,p),s=s.sibling;s!==null;)SS(s,c,p),s=s.sibling}function Tg(s,c,p){var g=s.tag;if(g===5||g===6)s=s.stateNode,c?p.insertBefore(s,c):p.appendChild(s);else if(g!==4&&(g===27&&zs(s.type)&&(p=s.stateNode),s=s.child,s!==null))for(Tg(s,c,p),s=s.sibling;s!==null;)Tg(s,c,p),s=s.sibling}function NA(s){var c=s.stateNode,p=s.memoizedProps;try{for(var g=s.type,w=c.attributes;w.length;)c.removeAttributeNode(w[0]);Er(c,g,p),c[Sr]=s,c[li]=p}catch(_){tn(s,s.return,_)}}var Ua=!1,er=!1,_S=!1,AA=typeof WeakSet=="function"?WeakSet:Set,hr=null;function kZ(s,c){if(s=s.containerInfo,HS=Xg,s=HT(s),gw(s)){if("selectionStart"in s)var p={start:s.selectionStart,end:s.selectionEnd};else e:{p=(p=s.ownerDocument)&&p.defaultView||window;var g=p.getSelection&&p.getSelection();if(g&&g.rangeCount!==0){p=g.anchorNode;var w=g.anchorOffset,_=g.focusNode;g=g.focusOffset;try{p.nodeType,_.nodeType}catch{p=null;break e}var I=0,M=-1,Y=-1,ue=0,ye=0,_e=s,de=null;t:for(;;){for(var he;_e!==p||w!==0&&_e.nodeType!==3||(M=I+w),_e!==_||g!==0&&_e.nodeType!==3||(Y=I+g),_e.nodeType===3&&(I+=_e.nodeValue.length),(he=_e.firstChild)!==null;)de=_e,_e=he;for(;;){if(_e===s)break t;if(de===p&&++ue===w&&(M=I),de===_&&++ye===g&&(Y=I),(he=_e.nextSibling)!==null)break;_e=de,de=_e.parentNode}_e=he}p=M===-1||Y===-1?null:{start:M,end:Y}}else p=null}p=p||{start:0,end:0}}else p=null;for(qS={focusedElem:s,selectionRange:p},Xg=!1,hr=c;hr!==null;)if(c=hr,s=c.child,(c.subtreeFlags&1028)!==0&&s!==null)s.return=c,hr=s;else for(;hr!==null;){switch(c=hr,_=c.alternate,s=c.flags,c.tag){case 0:if((s&4)!==0&&(s=c.updateQueue,s=s!==null?s.events:null,s!==null))for(p=0;p<s.length;p++)w=s[p],w.ref.impl=w.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&_!==null){s=void 0,p=c,w=_.memoizedProps,_=_.memoizedState,g=p.stateNode;try{var Be=ac(p.type,w);s=g.getSnapshotBeforeUpdate(Be,_),g.__reactInternalSnapshotBeforeUpdate=s}catch(et){tn(p,p.return,et)}}break;case 3:if((s&1024)!==0){if(s=c.stateNode.containerInfo,p=s.nodeType,p===9)ZS(s);else if(p===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":ZS(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=c.sibling,s!==null){s.return=c.return,hr=s;break}hr=c.return}}function OA(s,c,p){var g=p.flags;switch(p.tag){case 0:case 11:case 15:Ba(s,p),g&4&&op(5,p);break;case 1:if(Ba(s,p),g&4)if(s=p.stateNode,c===null)try{s.componentDidMount()}catch(I){tn(p,p.return,I)}else{var w=ac(p.type,c.memoizedProps);c=c.memoizedState;try{s.componentDidUpdate(w,c,s.__reactInternalSnapshotBeforeUpdate)}catch(I){tn(p,p.return,I)}}g&64&&jA(p),g&512&&ap(p,p.return);break;case 3:if(Ba(s,p),g&64&&(s=p.updateQueue,s!==null)){if(c=null,p.child!==null)switch(p.child.tag){case 27:case 5:c=p.child.stateNode;break;case 1:c=p.child.stateNode}try{vN(s,c)}catch(I){tn(p,p.return,I)}}break;case 27:c===null&&g&4&&NA(p);case 26:case 5:Ba(s,p),c===null&&g&4&&IA(p),g&512&&ap(p,p.return);break;case 12:Ba(s,p);break;case 31:Ba(s,p),g&4&&PA(s,p);break;case 13:Ba(s,p),g&4&&MA(s,p),g&64&&(s=p.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(p=$Z.bind(null,p),eY(s,p))));break;case 22:if(g=p.memoizedState!==null||Ua,!g){c=c!==null&&c.memoizedState!==null||er,w=Ua;var _=er;Ua=g,(er=c)&&!_?Ha(s,p,(p.subtreeFlags&8772)!==0):Ba(s,p),Ua=w,er=_}break;case 30:break;default:Ba(s,p)}}function $A(s){var c=s.alternate;c!==null&&(s.alternate=null,$A(c)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(c=s.stateNode,c!==null&&Q0(c)),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 In=null,ui=!1;function Va(s,c,p){for(p=p.child;p!==null;)DA(s,c,p),p=p.sibling}function DA(s,c,p){if(Lt&&typeof Lt.onCommitFiberUnmount=="function")try{Lt.onCommitFiberUnmount(Cn,p)}catch{}switch(p.tag){case 26:er||ra(p,c),Va(s,c,p),p.memoizedState?p.memoizedState.count--:p.stateNode&&(p=p.stateNode,p.parentNode.removeChild(p));break;case 27:er||ra(p,c);var g=In,w=ui;zs(p.type)&&(In=p.stateNode,ui=!1),Va(s,c,p),hp(p.stateNode),In=g,ui=w;break;case 5:er||ra(p,c);case 6:if(g=In,w=ui,In=null,Va(s,c,p),In=g,ui=w,In!==null)if(ui)try{(In.nodeType===9?In.body:In.nodeName==="HTML"?In.ownerDocument.body:In).removeChild(p.stateNode)}catch(_){tn(p,c,_)}else try{In.removeChild(p.stateNode)}catch(_){tn(p,c,_)}break;case 18:In!==null&&(ui?(s=In,jO(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,p.stateNode),Yu(s)):jO(In,p.stateNode));break;case 4:g=In,w=ui,In=p.stateNode.containerInfo,ui=!0,Va(s,c,p),In=g,ui=w;break;case 0:case 11:case 14:case 15:Ns(2,p,c),er||Ns(4,p,c),Va(s,c,p);break;case 1:er||(ra(p,c),g=p.stateNode,typeof g.componentWillUnmount=="function"&&RA(p,c,g)),Va(s,c,p);break;case 21:Va(s,c,p);break;case 22:er=(g=er)||p.memoizedState!==null,Va(s,c,p),er=g;break;default:Va(s,c,p)}}function PA(s,c){if(c.memoizedState===null&&(s=c.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Yu(s)}catch(p){tn(c,c.return,p)}}}function MA(s,c){if(c.memoizedState===null&&(s=c.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Yu(s)}catch(p){tn(c,c.return,p)}}function EZ(s){switch(s.tag){case 31:case 13:case 19:var c=s.stateNode;return c===null&&(c=s.stateNode=new AA),c;case 22:return s=s.stateNode,c=s._retryCache,c===null&&(c=s._retryCache=new AA),c;default:throw Error(r(435,s.tag))}}function Ng(s,c){var p=EZ(s);c.forEach(function(g){if(!p.has(g)){p.add(g);var w=DZ.bind(null,s,g);g.then(w,w)}})}function di(s,c){var p=c.deletions;if(p!==null)for(var g=0;g<p.length;g++){var w=p[g],_=s,I=c,M=I;e:for(;M!==null;){switch(M.tag){case 27:if(zs(M.type)){In=M.stateNode,ui=!1;break e}break;case 5:In=M.stateNode,ui=!1;break e;case 3:case 4:In=M.stateNode.containerInfo,ui=!0;break e}M=M.return}if(In===null)throw Error(r(160));DA(_,I,w),In=null,ui=!1,_=w.alternate,_!==null&&(_.return=null),w.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)zA(c,s),c=c.sibling}var Mo=null;function zA(s,c){var p=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:di(c,s),fi(s),g&4&&(Ns(3,s,s.return),op(3,s),Ns(5,s,s.return));break;case 1:di(c,s),fi(s),g&512&&(er||p===null||ra(p,p.return)),g&64&&Ua&&(s=s.updateQueue,s!==null&&(g=s.callbacks,g!==null&&(p=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=p===null?g:p.concat(g))));break;case 26:var w=Mo;if(di(c,s),fi(s),g&512&&(er||p===null||ra(p,p.return)),g&4){var _=p!==null?p.memoizedState:null;if(g=s.memoizedState,p===null)if(g===null)if(s.stateNode===null){e:{g=s.type,p=s.memoizedProps,w=w.ownerDocument||w;t:switch(g){case"title":_=w.getElementsByTagName("title")[0],(!_||_[Of]||_[Sr]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=w.createElement(g),w.head.insertBefore(_,w.querySelector("head > title"))),Er(_,g,p),_[Sr]=s,mr(_),g=_;break e;case"link":var I=zO("link","href",w).get(g+(p.href||""));if(I){for(var M=0;M<I.length;M++)if(_=I[M],_.getAttribute("href")===(p.href==null||p.href===""?null:p.href)&&_.getAttribute("rel")===(p.rel==null?null:p.rel)&&_.getAttribute("title")===(p.title==null?null:p.title)&&_.getAttribute("crossorigin")===(p.crossOrigin==null?null:p.crossOrigin)){I.splice(M,1);break t}}_=w.createElement(g),Er(_,g,p),w.head.appendChild(_);break;case"meta":if(I=zO("meta","content",w).get(g+(p.content||""))){for(M=0;M<I.length;M++)if(_=I[M],_.getAttribute("content")===(p.content==null?null:""+p.content)&&_.getAttribute("name")===(p.name==null?null:p.name)&&_.getAttribute("property")===(p.property==null?null:p.property)&&_.getAttribute("http-equiv")===(p.httpEquiv==null?null:p.httpEquiv)&&_.getAttribute("charset")===(p.charSet==null?null:p.charSet)){I.splice(M,1);break t}}_=w.createElement(g),Er(_,g,p),w.head.appendChild(_);break;default:throw Error(r(468,g))}_[Sr]=s,mr(_),g=_}s.stateNode=g}else LO(w,s.type,s.stateNode);else s.stateNode=MO(w,g,s.memoizedProps);else _!==g?(_===null?p.stateNode!==null&&(p=p.stateNode,p.parentNode.removeChild(p)):_.count--,g===null?LO(w,s.type,s.stateNode):MO(w,g,s.memoizedProps)):g===null&&s.stateNode!==null&&xS(s,s.memoizedProps,p.memoizedProps)}break;case 27:di(c,s),fi(s),g&512&&(er||p===null||ra(p,p.return)),p!==null&&g&4&&xS(s,s.memoizedProps,p.memoizedProps);break;case 5:if(di(c,s),fi(s),g&512&&(er||p===null||ra(p,p.return)),s.flags&32){w=s.stateNode;try{yu(w,"")}catch(Be){tn(s,s.return,Be)}}g&4&&s.stateNode!=null&&(w=s.memoizedProps,xS(s,w,p!==null?p.memoizedProps:w)),g&1024&&(_S=!0);break;case 6:if(di(c,s),fi(s),g&4){if(s.stateNode===null)throw Error(r(162));g=s.memoizedProps,p=s.stateNode;try{p.nodeValue=g}catch(Be){tn(s,s.return,Be)}}break;case 3:if(Gg=null,w=Mo,Mo=qg(c.containerInfo),di(c,s),Mo=w,fi(s),g&4&&p!==null&&p.memoizedState.isDehydrated)try{Yu(c.containerInfo)}catch(Be){tn(s,s.return,Be)}_S&&(_S=!1,LA(s));break;case 4:g=Mo,Mo=qg(s.stateNode.containerInfo),di(c,s),fi(s),Mo=g;break;case 12:di(c,s),fi(s);break;case 31:di(c,s),fi(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Ng(s,g)));break;case 13:di(c,s),fi(s),s.child.flags&8192&&s.memoizedState!==null!=(p!==null&&p.memoizedState!==null)&&(Og=ie()),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Ng(s,g)));break;case 22:w=s.memoizedState!==null;var Y=p!==null&&p.memoizedState!==null,ue=Ua,ye=er;if(Ua=ue||w,er=ye||Y,di(c,s),er=ye,Ua=ue,fi(s),g&8192)e:for(c=s.stateNode,c._visibility=w?c._visibility&-2:c._visibility|1,w&&(p===null||Y||Ua||er||sc(s)),p=null,c=s;;){if(c.tag===5||c.tag===26){if(p===null){Y=p=c;try{if(_=Y.stateNode,w)I=_.style,typeof I.setProperty=="function"?I.setProperty("display","none","important"):I.display="none";else{M=Y.stateNode;var _e=Y.memoizedProps.style,de=_e!=null&&_e.hasOwnProperty("display")?_e.display:null;M.style.display=de==null||typeof de=="boolean"?"":(""+de).trim()}}catch(Be){tn(Y,Y.return,Be)}}}else if(c.tag===6){if(p===null){Y=c;try{Y.stateNode.nodeValue=w?"":Y.memoizedProps}catch(Be){tn(Y,Y.return,Be)}}}else if(c.tag===18){if(p===null){Y=c;try{var he=Y.stateNode;w?RO(he,!0):RO(Y.stateNode,!1)}catch(Be){tn(Y,Y.return,Be)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===s)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break e;for(;c.sibling===null;){if(c.return===null||c.return===s)break e;p===c&&(p=null),c=c.return}p===c&&(p=null),c.sibling.return=c.return,c=c.sibling}g&4&&(g=s.updateQueue,g!==null&&(p=g.retryQueue,p!==null&&(g.retryQueue=null,Ng(s,p))));break;case 19:di(c,s),fi(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Ng(s,g)));break;case 30:break;case 21:break;default:di(c,s),fi(s)}}function fi(s){var c=s.flags;if(c&2){try{for(var p,g=s.return;g!==null;){if(TA(g)){p=g;break}g=g.return}if(p==null)throw Error(r(160));switch(p.tag){case 27:var w=p.stateNode,_=wS(s);Tg(s,_,w);break;case 5:var I=p.stateNode;p.flags&32&&(yu(I,""),p.flags&=-33);var M=wS(s);Tg(s,M,I);break;case 3:case 4:var Y=p.stateNode.containerInfo,ue=wS(s);SS(s,ue,Y);break;default:throw Error(r(161))}}catch(ye){tn(s,s.return,ye)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function LA(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var c=s;LA(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),s=s.sibling}}function Ba(s,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)OA(s,c.alternate,c),c=c.sibling}function sc(s){for(s=s.child;s!==null;){var c=s;switch(c.tag){case 0:case 11:case 14:case 15:Ns(4,c,c.return),sc(c);break;case 1:ra(c,c.return);var p=c.stateNode;typeof p.componentWillUnmount=="function"&&RA(c,c.return,p),sc(c);break;case 27:hp(c.stateNode);case 26:case 5:ra(c,c.return),sc(c);break;case 22:c.memoizedState===null&&sc(c);break;case 30:sc(c);break;default:sc(c)}s=s.sibling}}function Ha(s,c,p){for(p=p&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var g=c.alternate,w=s,_=c,I=_.flags;switch(_.tag){case 0:case 11:case 15:Ha(w,_,p),op(4,_);break;case 1:if(Ha(w,_,p),g=_,w=g.stateNode,typeof w.componentDidMount=="function")try{w.componentDidMount()}catch(ue){tn(g,g.return,ue)}if(g=_,w=g.updateQueue,w!==null){var M=g.stateNode;try{var Y=w.shared.hiddenCallbacks;if(Y!==null)for(w.shared.hiddenCallbacks=null,w=0;w<Y.length;w++)gN(Y[w],M)}catch(ue){tn(g,g.return,ue)}}p&&I&64&&jA(_),ap(_,_.return);break;case 27:NA(_);case 26:case 5:Ha(w,_,p),p&&g===null&&I&4&&IA(_),ap(_,_.return);break;case 12:Ha(w,_,p);break;case 31:Ha(w,_,p),p&&I&4&&PA(w,_);break;case 13:Ha(w,_,p),p&&I&4&&MA(w,_);break;case 22:_.memoizedState===null&&Ha(w,_,p),ap(_,_.return);break;case 30:break;default:Ha(w,_,p)}c=c.sibling}}function CS(s,c){var p=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),s=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(s=c.memoizedState.cachePool.pool),s!==p&&(s!=null&&s.refCount++,p!=null&&Kf(p))}function kS(s,c){s=null,c.alternate!==null&&(s=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==s&&(c.refCount++,s!=null&&Kf(s))}function zo(s,c,p,g){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)FA(s,c,p,g),c=c.sibling}function FA(s,c,p,g){var w=c.flags;switch(c.tag){case 0:case 11:case 15:zo(s,c,p,g),w&2048&&op(9,c);break;case 1:zo(s,c,p,g);break;case 3:zo(s,c,p,g),w&2048&&(s=null,c.alternate!==null&&(s=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==s&&(c.refCount++,s!=null&&Kf(s)));break;case 12:if(w&2048){zo(s,c,p,g),s=c.stateNode;try{var _=c.memoizedProps,I=_.id,M=_.onPostCommit;typeof M=="function"&&M(I,c.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(Y){tn(c,c.return,Y)}}else zo(s,c,p,g);break;case 31:zo(s,c,p,g);break;case 13:zo(s,c,p,g);break;case 23:break;case 22:_=c.stateNode,I=c.alternate,c.memoizedState!==null?_._visibility&2?zo(s,c,p,g):sp(s,c):_._visibility&2?zo(s,c,p,g):(_._visibility|=2,zu(s,c,p,g,(c.subtreeFlags&10256)!==0||!1)),w&2048&&CS(I,c);break;case 24:zo(s,c,p,g),w&2048&&kS(c.alternate,c);break;default:zo(s,c,p,g)}}function zu(s,c,p,g,w){for(w=w&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var _=s,I=c,M=p,Y=g,ue=I.flags;switch(I.tag){case 0:case 11:case 15:zu(_,I,M,Y,w),op(8,I);break;case 23:break;case 22:var ye=I.stateNode;I.memoizedState!==null?ye._visibility&2?zu(_,I,M,Y,w):sp(_,I):(ye._visibility|=2,zu(_,I,M,Y,w)),w&&ue&2048&&CS(I.alternate,I);break;case 24:zu(_,I,M,Y,w),w&&ue&2048&&kS(I.alternate,I);break;default:zu(_,I,M,Y,w)}c=c.sibling}}function sp(s,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var p=s,g=c,w=g.flags;switch(g.tag){case 22:sp(p,g),w&2048&&CS(g.alternate,g);break;case 24:sp(p,g),w&2048&&kS(g.alternate,g);break;default:sp(p,g)}c=c.sibling}}var lp=8192;function Lu(s,c,p){if(s.subtreeFlags&lp)for(s=s.child;s!==null;)UA(s,c,p),s=s.sibling}function UA(s,c,p){switch(s.tag){case 26:Lu(s,c,p),s.flags&lp&&s.memoizedState!==null&&fY(p,Mo,s.memoizedState,s.memoizedProps);break;case 5:Lu(s,c,p);break;case 3:case 4:var g=Mo;Mo=qg(s.stateNode.containerInfo),Lu(s,c,p),Mo=g;break;case 22:s.memoizedState===null&&(g=s.alternate,g!==null&&g.memoizedState!==null?(g=lp,lp=16777216,Lu(s,c,p),lp=g):Lu(s,c,p));break;default:Lu(s,c,p)}}function VA(s){var c=s.alternate;if(c!==null&&(s=c.child,s!==null)){c.child=null;do c=s.sibling,s.sibling=null,s=c;while(s!==null)}}function cp(s){var c=s.deletions;if((s.flags&16)!==0){if(c!==null)for(var p=0;p<c.length;p++){var g=c[p];hr=g,HA(g,s)}VA(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)BA(s),s=s.sibling}function BA(s){switch(s.tag){case 0:case 11:case 15:cp(s),s.flags&2048&&Ns(9,s,s.return);break;case 3:cp(s);break;case 12:cp(s);break;case 22:var c=s.stateNode;s.memoizedState!==null&&c._visibility&2&&(s.return===null||s.return.tag!==13)?(c._visibility&=-3,Ag(s)):cp(s);break;default:cp(s)}}function Ag(s){var c=s.deletions;if((s.flags&16)!==0){if(c!==null)for(var p=0;p<c.length;p++){var g=c[p];hr=g,HA(g,s)}VA(s)}for(s=s.child;s!==null;){switch(c=s,c.tag){case 0:case 11:case 15:Ns(8,c,c.return),Ag(c);break;case 22:p=c.stateNode,p._visibility&2&&(p._visibility&=-3,Ag(c));break;default:Ag(c)}s=s.sibling}}function HA(s,c){for(;hr!==null;){var p=hr;switch(p.tag){case 0:case 11:case 15:Ns(8,p,c);break;case 23:case 22:if(p.memoizedState!==null&&p.memoizedState.cachePool!==null){var g=p.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:Kf(p.memoizedState.cache)}if(g=p.child,g!==null)g.return=p,hr=g;else e:for(p=s;hr!==null;){g=hr;var w=g.sibling,_=g.return;if($A(g),g===p){hr=null;break e}if(w!==null){w.return=_,hr=w;break e}hr=_}}}var jZ={getCacheForType:function(s){var c=Cr(Xn),p=c.data.get(s);return p===void 0&&(p=s(),c.data.set(s,p)),p},cacheSignal:function(){return Cr(Xn).controller.signal}},RZ=typeof WeakMap=="function"?WeakMap:Map,Kt=0,mn=null,It=null,Nt=0,en=0,Oi=null,As=!1,Fu=!1,ES=!1,qa=0,zn=0,Os=0,lc=0,jS=0,$i=0,Uu=0,up=null,pi=null,RS=!1,Og=0,qA=0,$g=1/0,Dg=null,$s=null,sr=0,Ds=null,Vu=null,Ka=0,IS=0,TS=null,KA=null,dp=0,NS=null;function Di(){return(Kt&2)!==0&&Nt!==0?Nt&-Nt:z.T!==null?MS():X0()}function GA(){if($i===0)if((Nt&536870912)===0||Ot){var s=bs;bs<<=1,(bs&3932160)===0&&(bs=262144),$i=s}else $i=536870912;return s=Ni.current,s!==null&&(s.flags|=32),$i}function mi(s,c,p){(s===mn&&(en===2||en===9)||s.cancelPendingCommit!==null)&&(Bu(s,0),Ps(s,Nt,$i,!1)),pn(s,p),((Kt&2)===0||s!==mn)&&(s===mn&&((Kt&2)===0&&(lc|=p),zn===4&&Ps(s,Nt,$i,!1)),ia(s))}function ZA(s,c,p){if((Kt&6)!==0)throw Error(r(327));var g=!p&&(c&127)===0&&(c&s.expiredLanes)===0||rn(s,c),w=g?NZ(s,c):OS(s,c,!0),_=g;do{if(w===0){Fu&&!g&&Ps(s,c,0,!1);break}else{if(p=s.current.alternate,_&&!IZ(p)){w=OS(s,c,!1),_=!1;continue}if(w===2){if(_=c,s.errorRecoveryDisabledLanes&_)var I=0;else I=s.pendingLanes&-536870913,I=I!==0?I:I&536870912?536870912:0;if(I!==0){c=I;e:{var M=s;w=up;var Y=M.current.memoizedState.isDehydrated;if(Y&&(Bu(M,I).flags|=256),I=OS(M,I,!1),I!==2){if(ES&&!Y){M.errorRecoveryDisabledLanes|=_,lc|=_,w=4;break e}_=pi,pi=w,_!==null&&(pi===null?pi=_:pi.push.apply(pi,_))}w=I}if(_=!1,w!==2)continue}}if(w===1){Bu(s,0),Ps(s,c,0,!0);break}e:{switch(g=s,_=w,_){case 0:case 1:throw Error(r(345));case 4:if((c&4194048)!==c)break;case 6:Ps(g,c,$i,!As);break e;case 2:pi=null;break;case 3:case 5:break;default:throw Error(r(329))}if((c&62914560)===c&&(w=Og+300-ie(),10<w)){if(Ps(g,c,$i,!As),We(g,0,!0)!==0)break e;Ka=c,g.timeoutHandle=kO(YA.bind(null,g,p,pi,Dg,RS,c,$i,lc,Uu,As,_,"Throttled",-0,0),w);break e}YA(g,p,pi,Dg,RS,c,$i,lc,Uu,As,_,null,-0,0)}}break}while(!0);ia(s)}function YA(s,c,p,g,w,_,I,M,Y,ue,ye,_e,de,he){if(s.timeoutHandle=-1,_e=c.subtreeFlags,_e&8192||(_e&16785408)===16785408){_e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Na},UA(c,_,_e);var Be=(_&62914560)===_?Og-ie():(_&4194048)===_?qA-ie():0;if(Be=pY(_e,Be),Be!==null){Ka=_,s.cancelPendingCommit=Be(rO.bind(null,s,c,_,p,g,w,I,M,Y,ye,_e,null,de,he)),Ps(s,_,I,!ue);return}}rO(s,c,_,p,g,w,I,M,Y)}function IZ(s){for(var c=s;;){var p=c.tag;if((p===0||p===11||p===15)&&c.flags&16384&&(p=c.updateQueue,p!==null&&(p=p.stores,p!==null)))for(var g=0;g<p.length;g++){var w=p[g],_=w.getSnapshot;w=w.value;try{if(!Ii(_(),w))return!1}catch{return!1}}if(p=c.child,c.subtreeFlags&16384&&p!==null)p.return=c,c=p;else{if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Ps(s,c,p,g){c&=~jS,c&=~lc,s.suspendedLanes|=c,s.pingedLanes&=~c,g&&(s.warmLanes|=c),g=s.expirationTimes;for(var w=c;0<w;){var _=31-jt(w),I=1<<_;g[_]=-1,w&=~I}p!==0&&ql(s,p,c)}function Pg(){return(Kt&6)===0?(fp(0),!1):!0}function AS(){if(It!==null){if(en===0)var s=It.return;else s=It,Da=Ql=null,Zw(s),Ou=null,Zf=0,s=It;for(;s!==null;)EA(s.alternate,s),s=s.return;It=null}}function Bu(s,c){var p=s.timeoutHandle;p!==-1&&(s.timeoutHandle=-1,YZ(p)),p=s.cancelPendingCommit,p!==null&&(s.cancelPendingCommit=null,p()),Ka=0,AS(),mn=s,It=p=Oa(s.current,null),Nt=c,en=0,Oi=null,As=!1,Fu=rn(s,c),ES=!1,Uu=$i=jS=lc=Os=zn=0,pi=up=null,RS=!1,(c&8)!==0&&(c|=c&32);var g=s.entangledLanes;if(g!==0)for(s=s.entanglements,g&=c;0<g;){var w=31-jt(g),_=1<<w;c|=s[w],g&=~_}return qa=c,rg(),p}function WA(s,c){mt=null,z.H=np,c===Au||c===dg?(c=fN(),en=3):c===Pw?(c=fN(),en=4):en=c===uS?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,Oi=c,It===null&&(zn=1,kg(s,ao(c,s.current)))}function XA(){var s=Ni.current;return s===null?!0:(Nt&4194048)===Nt?uo===null:(Nt&62914560)===Nt||(Nt&536870912)!==0?s===uo:!1}function JA(){var s=z.H;return z.H=np,s===null?np:s}function QA(){var s=z.A;return z.A=jZ,s}function Mg(){zn=4,As||(Nt&4194048)!==Nt&&Ni.current!==null||(Fu=!0),(Os&134217727)===0&&(lc&134217727)===0||mn===null||Ps(mn,Nt,$i,!1)}function OS(s,c,p){var g=Kt;Kt|=2;var w=JA(),_=QA();(mn!==s||Nt!==c)&&(Dg=null,Bu(s,c)),c=!1;var I=zn;e:do try{if(en!==0&&It!==null){var M=It,Y=Oi;switch(en){case 8:AS(),I=6;break e;case 3:case 2:case 9:case 6:Ni.current===null&&(c=!0);var ue=en;if(en=0,Oi=null,Hu(s,M,Y,ue),p&&Fu){I=0;break e}break;default:ue=en,en=0,Oi=null,Hu(s,M,Y,ue)}}TZ(),I=zn;break}catch(ye){WA(s,ye)}while(!0);return c&&s.shellSuspendCounter++,Da=Ql=null,Kt=g,z.H=w,z.A=_,It===null&&(mn=null,Nt=0,rg()),I}function TZ(){for(;It!==null;)eO(It)}function NZ(s,c){var p=Kt;Kt|=2;var g=JA(),w=QA();mn!==s||Nt!==c?(Dg=null,$g=ie()+500,Bu(s,c)):Fu=rn(s,c);e:do try{if(en!==0&&It!==null){c=It;var _=Oi;t:switch(en){case 1:en=0,Oi=null,Hu(s,c,_,1);break;case 2:case 9:if(uN(_)){en=0,Oi=null,tO(c);break}c=function(){en!==2&&en!==9||mn!==s||(en=7),ia(s)},_.then(c,c);break e;case 3:en=7;break e;case 4:en=5;break e;case 7:uN(_)?(en=0,Oi=null,tO(c)):(en=0,Oi=null,Hu(s,c,_,7));break;case 5:var I=null;switch(It.tag){case 26:I=It.memoizedState;case 5:case 27:var M=It;if(I?FO(I):M.stateNode.complete){en=0,Oi=null;var Y=M.sibling;if(Y!==null)It=Y;else{var ue=M.return;ue!==null?(It=ue,zg(ue)):It=null}break t}}en=0,Oi=null,Hu(s,c,_,5);break;case 6:en=0,Oi=null,Hu(s,c,_,6);break;case 8:AS(),zn=6;break e;default:throw Error(r(462))}}AZ();break}catch(ye){WA(s,ye)}while(!0);return Da=Ql=null,z.H=g,z.A=w,Kt=p,It!==null?0:(mn=null,Nt=0,rg(),zn)}function AZ(){for(;It!==null&&!re();)eO(It)}function eO(s){var c=CA(s.alternate,s,qa);s.memoizedProps=s.pendingProps,c===null?zg(s):It=c}function tO(s){var c=s,p=c.alternate;switch(c.tag){case 15:case 0:c=yA(p,c,c.pendingProps,c.type,void 0,Nt);break;case 11:c=yA(p,c,c.pendingProps,c.type.render,c.ref,Nt);break;case 5:Zw(c);default:EA(p,c),c=It=QT(c,qa),c=CA(p,c,qa)}s.memoizedProps=s.pendingProps,c===null?zg(s):It=c}function Hu(s,c,p,g){Da=Ql=null,Zw(c),Ou=null,Zf=0;var w=c.return;try{if(xZ(s,w,c,p,Nt)){zn=1,kg(s,ao(p,s.current)),It=null;return}}catch(_){if(w!==null)throw It=w,_;zn=1,kg(s,ao(p,s.current)),It=null;return}c.flags&32768?(Ot||g===1?s=!0:Fu||(Nt&536870912)!==0?s=!1:(As=s=!0,(g===2||g===9||g===3||g===6)&&(g=Ni.current,g!==null&&g.tag===13&&(g.flags|=16384))),nO(c,s)):zg(c)}function zg(s){var c=s;do{if((c.flags&32768)!==0){nO(c,As);return}s=c.return;var p=_Z(c.alternate,c,qa);if(p!==null){It=p;return}if(c=c.sibling,c!==null){It=c;return}It=c=s}while(c!==null);zn===0&&(zn=5)}function nO(s,c){do{var p=CZ(s.alternate,s);if(p!==null){p.flags&=32767,It=p;return}if(p=s.return,p!==null&&(p.flags|=32768,p.subtreeFlags=0,p.deletions=null),!c&&(s=s.sibling,s!==null)){It=s;return}It=s=p}while(s!==null);zn=6,It=null}function rO(s,c,p,g,w,_,I,M,Y){s.cancelPendingCommit=null;do Lg();while(sr!==0);if((Kt&6)!==0)throw Error(r(327));if(c!==null){if(c===s.current)throw Error(r(177));if(_=c.lanes|c.childLanes,_|=ww,oi(s,p,_,I,M,Y),s===mn&&(It=mn=null,Nt=0),Vu=c,Ds=s,Ka=p,IS=_,TS=w,KA=g,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,PZ(Ee,function(){return lO(),null})):(s.callbackNode=null,s.callbackPriority=0),g=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||g){g=z.T,z.T=null,w=W.p,W.p=2,I=Kt,Kt|=4;try{kZ(s,c,p)}finally{Kt=I,W.p=w,z.T=g}}sr=1,iO(),oO(),aO()}}function iO(){if(sr===1){sr=0;var s=Ds,c=Vu,p=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||p){p=z.T,z.T=null;var g=W.p;W.p=2;var w=Kt;Kt|=4;try{zA(c,s);var _=qS,I=HT(s.containerInfo),M=_.focusedElem,Y=_.selectionRange;if(I!==M&&M&&M.ownerDocument&&BT(M.ownerDocument.documentElement,M)){if(Y!==null&&gw(M)){var ue=Y.start,ye=Y.end;if(ye===void 0&&(ye=ue),"selectionStart"in M)M.selectionStart=ue,M.selectionEnd=Math.min(ye,M.value.length);else{var _e=M.ownerDocument||document,de=_e&&_e.defaultView||window;if(de.getSelection){var he=de.getSelection(),Be=M.textContent.length,et=Math.min(Y.start,Be),sn=Y.end===void 0?et:Math.min(Y.end,Be);!he.extend&&et>sn&&(I=sn,sn=et,et=I);var oe=VT(M,et),ee=VT(M,sn);if(oe&&ee&&(he.rangeCount!==1||he.anchorNode!==oe.node||he.anchorOffset!==oe.offset||he.focusNode!==ee.node||he.focusOffset!==ee.offset)){var ce=_e.createRange();ce.setStart(oe.node,oe.offset),he.removeAllRanges(),et>sn?(he.addRange(ce),he.extend(ee.node,ee.offset)):(ce.setEnd(ee.node,ee.offset),he.addRange(ce))}}}}for(_e=[],he=M;he=he.parentNode;)he.nodeType===1&&_e.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<_e.length;M++){var we=_e[M];we.element.scrollLeft=we.left,we.element.scrollTop=we.top}}Xg=!!HS,qS=HS=null}finally{Kt=w,W.p=g,z.T=p}}s.current=c,sr=2}}function oO(){if(sr===2){sr=0;var s=Ds,c=Vu,p=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||p){p=z.T,z.T=null;var g=W.p;W.p=2;var w=Kt;Kt|=4;try{OA(s,c.alternate,c)}finally{Kt=w,W.p=g,z.T=p}}sr=3}}function aO(){if(sr===4||sr===3){sr=0,se();var s=Ds,c=Vu,p=Ka,g=KA;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?sr=5:(sr=0,Vu=Ds=null,sO(s,s.pendingLanes));var w=s.pendingLanes;if(w===0&&($s=null),Do(p),c=c.stateNode,Lt&&typeof Lt.onCommitFiberRoot=="function")try{Lt.onCommitFiberRoot(Cn,c,void 0,(c.current.flags&128)===128)}catch{}if(g!==null){c=z.T,w=W.p,W.p=2,z.T=null;try{for(var _=s.onRecoverableError,I=0;I<g.length;I++){var M=g[I];_(M.value,{componentStack:M.stack})}}finally{z.T=c,W.p=w}}(Ka&3)!==0&&Lg(),ia(s),w=s.pendingLanes,(p&261930)!==0&&(w&42)!==0?s===NS?dp++:(dp=0,NS=s):dp=0,fp(0)}}function sO(s,c){(s.pooledCacheLanes&=c)===0&&(c=s.pooledCache,c!=null&&(s.pooledCache=null,Kf(c)))}function Lg(){return iO(),oO(),aO(),lO()}function lO(){if(sr!==5)return!1;var s=Ds,c=IS;IS=0;var p=Do(Ka),g=z.T,w=W.p;try{W.p=32>p?32:p,z.T=null,p=TS,TS=null;var _=Ds,I=Ka;if(sr=0,Vu=Ds=null,Ka=0,(Kt&6)!==0)throw Error(r(331));var M=Kt;if(Kt|=4,BA(_.current),FA(_,_.current,I,p),Kt=M,fp(0,!1),Lt&&typeof Lt.onPostCommitFiberRoot=="function")try{Lt.onPostCommitFiberRoot(Cn,_)}catch{}return!0}finally{W.p=w,z.T=g,sO(s,c)}}function cO(s,c,p){c=ao(p,c),c=cS(s.stateNode,c,2),s=Rs(s,c,2),s!==null&&(pn(s,2),ia(s))}function tn(s,c,p){if(s.tag===3)cO(s,s,p);else for(;c!==null;){if(c.tag===3){cO(c,s,p);break}else if(c.tag===1){var g=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&($s===null||!$s.has(g))){s=ao(p,s),p=uA(2),g=Rs(c,p,2),g!==null&&(dA(p,g,c,s),pn(g,2),ia(g));break}}c=c.return}}function $S(s,c,p){var g=s.pingCache;if(g===null){g=s.pingCache=new RZ;var w=new Set;g.set(c,w)}else w=g.get(c),w===void 0&&(w=new Set,g.set(c,w));w.has(p)||(ES=!0,w.add(p),s=OZ.bind(null,s,c,p),c.then(s,s))}function OZ(s,c,p){var g=s.pingCache;g!==null&&g.delete(c),s.pingedLanes|=s.suspendedLanes&p,s.warmLanes&=~p,mn===s&&(Nt&p)===p&&(zn===4||zn===3&&(Nt&62914560)===Nt&&300>ie()-Og?(Kt&2)===0&&Bu(s,0):jS|=p,Uu===Nt&&(Uu=0)),ia(s)}function uO(s,c){c===0&&(c=pr()),s=Wl(s,c),s!==null&&(pn(s,c),ia(s))}function $Z(s){var c=s.memoizedState,p=0;c!==null&&(p=c.retryLane),uO(s,p)}function DZ(s,c){var p=0;switch(s.tag){case 31:case 13:var g=s.stateNode,w=s.memoizedState;w!==null&&(p=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(c),uO(s,p)}function PZ(s,c){return An(s,c)}var Fg=null,qu=null,DS=!1,Ug=!1,PS=!1,Ms=0;function ia(s){s!==qu&&s.next===null&&(qu===null?Fg=qu=s:qu=qu.next=s),Ug=!0,DS||(DS=!0,zZ())}function fp(s,c){if(!PS&&Ug){PS=!0;do for(var p=!1,g=Fg;g!==null;){if(s!==0){var w=g.pendingLanes;if(w===0)var _=0;else{var I=g.suspendedLanes,M=g.pingedLanes;_=(1<<31-jt(42|s)+1)-1,_&=w&~(I&~M),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(p=!0,mO(g,_))}else _=Nt,_=We(g,g===mn?_:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(_&3)===0||rn(g,_)||(p=!0,mO(g,_));g=g.next}while(p);PS=!1}}function MZ(){dO()}function dO(){Ug=DS=!1;var s=0;Ms!==0&&ZZ()&&(s=Ms);for(var c=ie(),p=null,g=Fg;g!==null;){var w=g.next,_=fO(g,c);_===0?(g.next=null,p===null?Fg=w:p.next=w,w===null&&(qu=p)):(p=g,(s!==0||(_&3)!==0)&&(Ug=!0)),g=w}sr!==0&&sr!==5||fp(s),Ms!==0&&(Ms=0)}function fO(s,c){for(var p=s.suspendedLanes,g=s.pingedLanes,w=s.expirationTimes,_=s.pendingLanes&-62914561;0<_;){var I=31-jt(_),M=1<<I,Y=w[I];Y===-1?((M&p)===0||(M&g)!==0)&&(w[I]=Wn(M,c)):Y<=c&&(s.expiredLanes|=M),_&=~M}if(c=mn,p=Nt,p=We(s,s===c?p:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g=s.callbackNode,p===0||s===c&&(en===2||en===9)||s.cancelPendingCommit!==null)return g!==null&&g!==null&&Z(g),s.callbackNode=null,s.callbackPriority=0;if((p&3)===0||rn(s,p)){if(c=p&-p,c===s.callbackPriority)return c;switch(g!==null&&Z(g),Do(p)){case 2:case 8:p=le;break;case 32:p=Ee;break;case 268435456:p=Ke;break;default:p=Ee}return g=pO.bind(null,s),p=An(p,g),s.callbackPriority=c,s.callbackNode=p,c}return g!==null&&g!==null&&Z(g),s.callbackPriority=2,s.callbackNode=null,2}function pO(s,c){if(sr!==0&&sr!==5)return s.callbackNode=null,s.callbackPriority=0,null;var p=s.callbackNode;if(Lg()&&s.callbackNode!==p)return null;var g=Nt;return g=We(s,s===mn?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g===0?null:(ZA(s,g,c),fO(s,ie()),s.callbackNode!=null&&s.callbackNode===p?pO.bind(null,s):null)}function mO(s,c){if(Lg())return null;ZA(s,c,!0)}function zZ(){WZ(function(){(Kt&6)!==0?An(B,MZ):dO()})}function MS(){if(Ms===0){var s=Tu;s===0&&(s=ys,ys<<=1,(ys&261888)===0&&(ys=256)),Ms=s}return Ms}function hO(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Yh(""+s)}function gO(s,c){var p=c.ownerDocument.createElement("input");return p.name=c.name,p.value=c.value,s.id&&p.setAttribute("form",s.id),c.parentNode.insertBefore(p,c),s=new FormData(s),p.parentNode.removeChild(p),s}function LZ(s,c,p,g,w){if(c==="submit"&&p&&p.stateNode===w){var _=hO((w[li]||null).action),I=g.submitter;I&&(c=(c=I[li]||null)?hO(c.formAction):I.getAttribute("formAction"),c!==null&&(_=c,I=null));var M=new Qh("action","action",null,g,w);s.push({event:M,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(Ms!==0){var Y=I?gO(w,I):new FormData(w);rS(p,{pending:!0,data:Y,method:w.method,action:_},null,Y)}}else typeof _=="function"&&(M.preventDefault(),Y=I?gO(w,I):new FormData(w),rS(p,{pending:!0,data:Y,method:w.method,action:_},_,Y))},currentTarget:w}]})}}for(var zS=0;zS<xw.length;zS++){var LS=xw[zS],FZ=LS.toLowerCase(),UZ=LS[0].toUpperCase()+LS.slice(1);Po(FZ,"on"+UZ)}Po(GT,"onAnimationEnd"),Po(ZT,"onAnimationIteration"),Po(YT,"onAnimationStart"),Po("dblclick","onDoubleClick"),Po("focusin","onFocus"),Po("focusout","onBlur"),Po(rZ,"onTransitionRun"),Po(iZ,"onTransitionStart"),Po(oZ,"onTransitionCancel"),Po(WT,"onTransitionEnd"),gu("onMouseEnter",["mouseout","mouseover"]),gu("onMouseLeave",["mouseout","mouseover"]),gu("onPointerEnter",["pointerout","pointerover"]),gu("onPointerLeave",["pointerout","pointerover"]),Kl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Kl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Kl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Kl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Kl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Kl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var pp="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(" "),VZ=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(pp));function vO(s,c){c=(c&4)!==0;for(var p=0;p<s.length;p++){var g=s[p],w=g.event;g=g.listeners;e:{var _=void 0;if(c)for(var I=g.length-1;0<=I;I--){var M=g[I],Y=M.instance,ue=M.currentTarget;if(M=M.listener,Y!==_&&w.isPropagationStopped())break e;_=M,w.currentTarget=ue;try{_(w)}catch(ye){ng(ye)}w.currentTarget=null,_=Y}else for(I=0;I<g.length;I++){if(M=g[I],Y=M.instance,ue=M.currentTarget,M=M.listener,Y!==_&&w.isPropagationStopped())break e;_=M,w.currentTarget=ue;try{_(w)}catch(ye){ng(ye)}w.currentTarget=null,_=Y}}}}function Tt(s,c){var p=c[J0];p===void 0&&(p=c[J0]=new Set);var g=s+"__bubble";p.has(g)||(yO(c,s,2,!1),p.add(g))}function FS(s,c,p){var g=0;c&&(g|=4),yO(p,s,g,c)}var Vg="_reactListening"+Math.random().toString(36).slice(2);function US(s){if(!s[Vg]){s[Vg]=!0,dT.forEach(function(p){p!=="selectionchange"&&(VZ.has(p)||FS(p,!1,s),FS(p,!0,s))});var c=s.nodeType===9?s:s.ownerDocument;c===null||c[Vg]||(c[Vg]=!0,FS("selectionchange",!1,c))}}function yO(s,c,p,g){switch(GO(c)){case 2:var w=gY;break;case 8:w=vY;break;default:w=n_}p=w.bind(null,c,p,s),w=void 0,!sw||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(w=!0),g?w!==void 0?s.addEventListener(c,p,{capture:!0,passive:w}):s.addEventListener(c,p,!0):w!==void 0?s.addEventListener(c,p,{passive:w}):s.addEventListener(c,p,!1)}function VS(s,c,p,g,w){var _=g;if((c&1)===0&&(c&2)===0&&g!==null)e:for(;;){if(g===null)return;var I=g.tag;if(I===3||I===4){var M=g.stateNode.containerInfo;if(M===w)break;if(I===4)for(I=g.return;I!==null;){var Y=I.tag;if((Y===3||Y===4)&&I.stateNode.containerInfo===w)return;I=I.return}for(;M!==null;){if(I=pu(M),I===null)return;if(Y=I.tag,Y===5||Y===6||Y===26||Y===27){g=_=I;continue e}M=M.parentNode}}g=g.return}_T(function(){var ue=_,ye=ow(p),_e=[];e:{var de=XT.get(s);if(de!==void 0){var he=Qh,Be=s;switch(s){case"keypress":if(Xh(p)===0)break e;case"keydown":case"keyup":he=DG;break;case"focusin":Be="focus",he=dw;break;case"focusout":Be="blur",he=dw;break;case"beforeblur":case"afterblur":he=dw;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=ET;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=_G;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=zG;break;case GT:case ZT:case YT:he=EG;break;case WT:he=FG;break;case"scroll":case"scrollend":he=wG;break;case"wheel":he=VG;break;case"copy":case"cut":case"paste":he=RG;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=RT;break;case"toggle":case"beforetoggle":he=HG}var et=(c&4)!==0,sn=!et&&(s==="scroll"||s==="scrollend"),oe=et?de!==null?de+"Capture":null:de;et=[];for(var ee=ue,ce;ee!==null;){var we=ee;if(ce=we.stateNode,we=we.tag,we!==5&&we!==26&&we!==27||ce===null||oe===null||(we=Df(ee,oe),we!=null&&et.push(mp(ee,we,ce))),sn)break;ee=ee.return}0<et.length&&(de=new he(de,Be,null,p,ye),_e.push({event:de,listeners:et}))}}if((c&7)===0){e:{if(de=s==="mouseover"||s==="pointerover",he=s==="mouseout"||s==="pointerout",de&&p!==iw&&(Be=p.relatedTarget||p.fromElement)&&(pu(Be)||Be[fu]))break e;if((he||de)&&(de=ye.window===ye?ye:(de=ye.ownerDocument)?de.defaultView||de.parentWindow:window,he?(Be=p.relatedTarget||p.toElement,he=ue,Be=Be?pu(Be):null,Be!==null&&(sn=o(Be),et=Be.tag,Be!==sn||et!==5&&et!==27&&et!==6)&&(Be=null)):(he=null,Be=ue),he!==Be)){if(et=ET,we="onMouseLeave",oe="onMouseEnter",ee="mouse",(s==="pointerout"||s==="pointerover")&&(et=RT,we="onPointerLeave",oe="onPointerEnter",ee="pointer"),sn=he==null?de:$f(he),ce=Be==null?de:$f(Be),de=new et(we,ee+"leave",he,p,ye),de.target=sn,de.relatedTarget=ce,we=null,pu(ye)===ue&&(et=new et(oe,ee+"enter",Be,p,ye),et.target=ce,et.relatedTarget=sn,we=et),sn=we,he&&Be)t:{for(et=BZ,oe=he,ee=Be,ce=0,we=oe;we;we=et(we))ce++;we=0;for(var Xe=ee;Xe;Xe=et(Xe))we++;for(;0<ce-we;)oe=et(oe),ce--;for(;0<we-ce;)ee=et(ee),we--;for(;ce--;){if(oe===ee||ee!==null&&oe===ee.alternate){et=oe;break t}oe=et(oe),ee=et(ee)}et=null}else et=null;he!==null&&bO(_e,de,he,et,!1),Be!==null&&sn!==null&&bO(_e,sn,Be,et,!0)}}e:{if(de=ue?$f(ue):window,he=de.nodeName&&de.nodeName.toLowerCase(),he==="select"||he==="input"&&de.type==="file")var Ft=PT;else if($T(de))if(MT)Ft=eZ;else{Ft=JG;var Ge=XG}else he=de.nodeName,!he||he.toLowerCase()!=="input"||de.type!=="checkbox"&&de.type!=="radio"?ue&&rw(ue.elementType)&&(Ft=PT):Ft=QG;if(Ft&&(Ft=Ft(s,ue))){DT(_e,Ft,p,ye);break e}Ge&&Ge(s,de,ue),s==="focusout"&&ue&&de.type==="number"&&ue.memoizedProps.value!=null&&nw(de,"number",de.value)}switch(Ge=ue?$f(ue):window,s){case"focusin":($T(Ge)||Ge.contentEditable==="true")&&(Su=Ge,vw=ue,Bf=null);break;case"focusout":Bf=vw=Su=null;break;case"mousedown":yw=!0;break;case"contextmenu":case"mouseup":case"dragend":yw=!1,qT(_e,p,ye);break;case"selectionchange":if(nZ)break;case"keydown":case"keyup":qT(_e,p,ye)}var yt;if(pw)e:{switch(s){case"compositionstart":var At="onCompositionStart";break e;case"compositionend":At="onCompositionEnd";break e;case"compositionupdate":At="onCompositionUpdate";break e}At=void 0}else wu?AT(s,p)&&(At="onCompositionEnd"):s==="keydown"&&p.keyCode===229&&(At="onCompositionStart");At&&(IT&&p.locale!=="ko"&&(wu||At!=="onCompositionStart"?At==="onCompositionEnd"&&wu&&(yt=CT()):(ws=ye,lw="value"in ws?ws.value:ws.textContent,wu=!0)),Ge=Bg(ue,At),0<Ge.length&&(At=new jT(At,s,null,p,ye),_e.push({event:At,listeners:Ge}),yt?At.data=yt:(yt=OT(p),yt!==null&&(At.data=yt)))),(yt=KG?GG(s,p):ZG(s,p))&&(At=Bg(ue,"onBeforeInput"),0<At.length&&(Ge=new jT("onBeforeInput","beforeinput",null,p,ye),_e.push({event:Ge,listeners:At}),Ge.data=yt)),LZ(_e,s,ue,p,ye)}vO(_e,c)})}function mp(s,c,p){return{instance:s,listener:c,currentTarget:p}}function Bg(s,c){for(var p=c+"Capture",g=[];s!==null;){var w=s,_=w.stateNode;if(w=w.tag,w!==5&&w!==26&&w!==27||_===null||(w=Df(s,p),w!=null&&g.unshift(mp(s,w,_)),w=Df(s,c),w!=null&&g.push(mp(s,w,_))),s.tag===3)return g;s=s.return}return[]}function BZ(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function bO(s,c,p,g,w){for(var _=c._reactName,I=[];p!==null&&p!==g;){var M=p,Y=M.alternate,ue=M.stateNode;if(M=M.tag,Y!==null&&Y===g)break;M!==5&&M!==26&&M!==27||ue===null||(Y=ue,w?(ue=Df(p,_),ue!=null&&I.unshift(mp(p,ue,Y))):w||(ue=Df(p,_),ue!=null&&I.push(mp(p,ue,Y)))),p=p.return}I.length!==0&&s.push({event:c,listeners:I})}var HZ=/\r\n?/g,qZ=/\u0000|\uFFFD/g;function xO(s){return(typeof s=="string"?s:""+s).replace(HZ,`
234
- `).replace(qZ,"")}function wO(s,c){return c=xO(c),xO(s)===c}function an(s,c,p,g,w,_){switch(p){case"children":typeof g=="string"?c==="body"||c==="textarea"&&g===""||yu(s,g):(typeof g=="number"||typeof g=="bigint")&&c!=="body"&&yu(s,""+g);break;case"className":Gh(s,"class",g);break;case"tabIndex":Gh(s,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":Gh(s,p,g);break;case"style":wT(s,g,_);break;case"data":if(c!=="object"){Gh(s,"data",g);break}case"src":case"href":if(g===""&&(c!=="a"||p!=="href")){s.removeAttribute(p);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(p);break}g=Yh(""+g),s.setAttribute(p,g);break;case"action":case"formAction":if(typeof g=="function"){s.setAttribute(p,"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"&&(p==="formAction"?(c!=="input"&&an(s,c,"name",w.name,w,null),an(s,c,"formEncType",w.formEncType,w,null),an(s,c,"formMethod",w.formMethod,w,null),an(s,c,"formTarget",w.formTarget,w,null)):(an(s,c,"encType",w.encType,w,null),an(s,c,"method",w.method,w,null),an(s,c,"target",w.target,w,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(p);break}g=Yh(""+g),s.setAttribute(p,g);break;case"onClick":g!=null&&(s.onclick=Na);break;case"onScroll":g!=null&&Tt("scroll",s);break;case"onScrollEnd":g!=null&&Tt("scrollend",s);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(p=g.__html,p!=null){if(w.children!=null)throw Error(r(60));s.innerHTML=p}}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}p=Yh(""+g),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",p);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(p,""+g):s.removeAttribute(p);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(p,""):s.removeAttribute(p);break;case"capture":case"download":g===!0?s.setAttribute(p,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(p,g):s.removeAttribute(p);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?s.setAttribute(p,g):s.removeAttribute(p);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?s.removeAttribute(p):s.setAttribute(p,g);break;case"popover":Tt("beforetoggle",s),Tt("toggle",s),Kh(s,"popover",g);break;case"xlinkActuate":Ta(s,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Ta(s,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Ta(s,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Ta(s,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Ta(s,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Ta(s,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Ta(s,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Ta(s,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Ta(s,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Kh(s,"is",g);break;case"innerText":case"textContent":break;default:(!(2<p.length)||p[0]!=="o"&&p[0]!=="O"||p[1]!=="n"&&p[1]!=="N")&&(p=bG.get(p)||p,Kh(s,p,g))}}function BS(s,c,p,g,w,_){switch(p){case"style":wT(s,g,_);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(p=g.__html,p!=null){if(w.children!=null)throw Error(r(60));s.innerHTML=p}}break;case"children":typeof g=="string"?yu(s,g):(typeof g=="number"||typeof g=="bigint")&&yu(s,""+g);break;case"onScroll":g!=null&&Tt("scroll",s);break;case"onScrollEnd":g!=null&&Tt("scrollend",s);break;case"onClick":g!=null&&(s.onclick=Na);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!fT.hasOwnProperty(p))e:{if(p[0]==="o"&&p[1]==="n"&&(w=p.endsWith("Capture"),c=p.slice(2,w?p.length-7:void 0),_=s[li]||null,_=_!=null?_[p]:null,typeof _=="function"&&s.removeEventListener(c,_,w),typeof g=="function")){typeof _!="function"&&_!==null&&(p in s?s[p]=null:s.hasAttribute(p)&&s.removeAttribute(p)),s.addEventListener(c,g,w);break e}p in s?s[p]=g:g===!0?s.setAttribute(p,""):Kh(s,p,g)}}}function Er(s,c,p){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Tt("error",s),Tt("load",s);var g=!1,w=!1,_;for(_ in p)if(p.hasOwnProperty(_)){var I=p[_];if(I!=null)switch(_){case"src":g=!0;break;case"srcSet":w=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:an(s,c,_,I,p,null)}}w&&an(s,c,"srcSet",p.srcSet,p,null),g&&an(s,c,"src",p.src,p,null);return;case"input":Tt("invalid",s);var M=_=I=w=null,Y=null,ue=null;for(g in p)if(p.hasOwnProperty(g)){var ye=p[g];if(ye!=null)switch(g){case"name":w=ye;break;case"type":I=ye;break;case"checked":Y=ye;break;case"defaultChecked":ue=ye;break;case"value":_=ye;break;case"defaultValue":M=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(r(137,c));break;default:an(s,c,g,ye,p,null)}}vT(s,_,M,Y,ue,I,w,!1);return;case"select":Tt("invalid",s),g=I=_=null;for(w in p)if(p.hasOwnProperty(w)&&(M=p[w],M!=null))switch(w){case"value":_=M;break;case"defaultValue":I=M;break;case"multiple":g=M;default:an(s,c,w,M,p,null)}c=_,p=I,s.multiple=!!g,c!=null?vu(s,!!g,c,!1):p!=null&&vu(s,!!g,p,!0);return;case"textarea":Tt("invalid",s),_=w=g=null;for(I in p)if(p.hasOwnProperty(I)&&(M=p[I],M!=null))switch(I){case"value":g=M;break;case"defaultValue":w=M;break;case"children":_=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(r(91));break;default:an(s,c,I,M,p,null)}bT(s,g,w,_);return;case"option":for(Y in p)p.hasOwnProperty(Y)&&(g=p[Y],g!=null)&&(Y==="selected"?s.selected=g&&typeof g!="function"&&typeof g!="symbol":an(s,c,Y,g,p,null));return;case"dialog":Tt("beforetoggle",s),Tt("toggle",s),Tt("cancel",s),Tt("close",s);break;case"iframe":case"object":Tt("load",s);break;case"video":case"audio":for(g=0;g<pp.length;g++)Tt(pp[g],s);break;case"image":Tt("error",s),Tt("load",s);break;case"details":Tt("toggle",s);break;case"embed":case"source":case"link":Tt("error",s),Tt("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(ue in p)if(p.hasOwnProperty(ue)&&(g=p[ue],g!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:an(s,c,ue,g,p,null)}return;default:if(rw(c)){for(ye in p)p.hasOwnProperty(ye)&&(g=p[ye],g!==void 0&&BS(s,c,ye,g,p,void 0));return}}for(M in p)p.hasOwnProperty(M)&&(g=p[M],g!=null&&an(s,c,M,g,p,null))}function KZ(s,c,p,g){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var w=null,_=null,I=null,M=null,Y=null,ue=null,ye=null;for(he in p){var _e=p[he];if(p.hasOwnProperty(he)&&_e!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":Y=_e;default:g.hasOwnProperty(he)||an(s,c,he,null,g,_e)}}for(var de in g){var he=g[de];if(_e=p[de],g.hasOwnProperty(de)&&(he!=null||_e!=null))switch(de){case"type":_=he;break;case"name":w=he;break;case"checked":ue=he;break;case"defaultChecked":ye=he;break;case"value":I=he;break;case"defaultValue":M=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,c));break;default:he!==_e&&an(s,c,de,he,g,_e)}}tw(s,I,M,Y,ue,ye,_,w);return;case"select":he=I=M=de=null;for(_ in p)if(Y=p[_],p.hasOwnProperty(_)&&Y!=null)switch(_){case"value":break;case"multiple":he=Y;default:g.hasOwnProperty(_)||an(s,c,_,null,g,Y)}for(w in g)if(_=g[w],Y=p[w],g.hasOwnProperty(w)&&(_!=null||Y!=null))switch(w){case"value":de=_;break;case"defaultValue":M=_;break;case"multiple":I=_;default:_!==Y&&an(s,c,w,_,g,Y)}c=M,p=I,g=he,de!=null?vu(s,!!p,de,!1):!!g!=!!p&&(c!=null?vu(s,!!p,c,!0):vu(s,!!p,p?[]:"",!1));return;case"textarea":he=de=null;for(M in p)if(w=p[M],p.hasOwnProperty(M)&&w!=null&&!g.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:an(s,c,M,null,g,w)}for(I in g)if(w=g[I],_=p[I],g.hasOwnProperty(I)&&(w!=null||_!=null))switch(I){case"value":de=w;break;case"defaultValue":he=w;break;case"children":break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(r(91));break;default:w!==_&&an(s,c,I,w,g,_)}yT(s,de,he);return;case"option":for(var Be in p)de=p[Be],p.hasOwnProperty(Be)&&de!=null&&!g.hasOwnProperty(Be)&&(Be==="selected"?s.selected=!1:an(s,c,Be,null,g,de));for(Y in g)de=g[Y],he=p[Y],g.hasOwnProperty(Y)&&de!==he&&(de!=null||he!=null)&&(Y==="selected"?s.selected=de&&typeof de!="function"&&typeof de!="symbol":an(s,c,Y,de,g,he));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 et in p)de=p[et],p.hasOwnProperty(et)&&de!=null&&!g.hasOwnProperty(et)&&an(s,c,et,null,g,de);for(ue in g)if(de=g[ue],he=p[ue],g.hasOwnProperty(ue)&&de!==he&&(de!=null||he!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,c));break;default:an(s,c,ue,de,g,he)}return;default:if(rw(c)){for(var sn in p)de=p[sn],p.hasOwnProperty(sn)&&de!==void 0&&!g.hasOwnProperty(sn)&&BS(s,c,sn,void 0,g,de);for(ye in g)de=g[ye],he=p[ye],!g.hasOwnProperty(ye)||de===he||de===void 0&&he===void 0||BS(s,c,ye,de,g,he);return}}for(var oe in p)de=p[oe],p.hasOwnProperty(oe)&&de!=null&&!g.hasOwnProperty(oe)&&an(s,c,oe,null,g,de);for(_e in g)de=g[_e],he=p[_e],!g.hasOwnProperty(_e)||de===he||de==null&&he==null||an(s,c,_e,de,g,he)}function SO(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function GZ(){if(typeof performance.getEntriesByType=="function"){for(var s=0,c=0,p=performance.getEntriesByType("resource"),g=0;g<p.length;g++){var w=p[g],_=w.transferSize,I=w.initiatorType,M=w.duration;if(_&&M&&SO(I)){for(I=0,M=w.responseEnd,g+=1;g<p.length;g++){var Y=p[g],ue=Y.startTime;if(ue>M)break;var ye=Y.transferSize,_e=Y.initiatorType;ye&&SO(_e)&&(Y=Y.responseEnd,I+=ye*(Y<M?1:(M-ue)/(Y-ue)))}if(--g,c+=8*(_+I)/(w.duration/1e3),s++,10<s)break}}if(0<s)return c/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var HS=null,qS=null;function Hg(s){return s.nodeType===9?s:s.ownerDocument}function _O(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 CO(s,c){if(s===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&c==="foreignObject"?0:s}function KS(s,c){return s==="textarea"||s==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var GS=null;function ZZ(){var s=window.event;return s&&s.type==="popstate"?s===GS?!1:(GS=s,!0):(GS=null,!1)}var kO=typeof setTimeout=="function"?setTimeout:void 0,YZ=typeof clearTimeout=="function"?clearTimeout:void 0,EO=typeof Promise=="function"?Promise:void 0,WZ=typeof queueMicrotask=="function"?queueMicrotask:typeof EO<"u"?function(s){return EO.resolve(null).then(s).catch(XZ)}:kO;function XZ(s){setTimeout(function(){throw s})}function zs(s){return s==="head"}function jO(s,c){var p=c,g=0;do{var w=p.nextSibling;if(s.removeChild(p),w&&w.nodeType===8)if(p=w.data,p==="/$"||p==="/&"){if(g===0){s.removeChild(w),Yu(c);return}g--}else if(p==="$"||p==="$?"||p==="$~"||p==="$!"||p==="&")g++;else if(p==="html")hp(s.ownerDocument.documentElement);else if(p==="head"){p=s.ownerDocument.head,hp(p);for(var _=p.firstChild;_;){var I=_.nextSibling,M=_.nodeName;_[Of]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&_.rel.toLowerCase()==="stylesheet"||p.removeChild(_),_=I}}else p==="body"&&hp(s.ownerDocument.body);p=w}while(p);Yu(c)}function RO(s,c){var p=s;s=0;do{var g=p.nextSibling;if(p.nodeType===1?c?(p._stashedDisplay=p.style.display,p.style.display="none"):(p.style.display=p._stashedDisplay||"",p.getAttribute("style")===""&&p.removeAttribute("style")):p.nodeType===3&&(c?(p._stashedText=p.nodeValue,p.nodeValue=""):p.nodeValue=p._stashedText||""),g&&g.nodeType===8)if(p=g.data,p==="/$"){if(s===0)break;s--}else p!=="$"&&p!=="$?"&&p!=="$~"&&p!=="$!"||s++;p=g}while(p)}function ZS(s){var c=s.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var p=c;switch(c=c.nextSibling,p.nodeName){case"HTML":case"HEAD":case"BODY":ZS(p),Q0(p);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(p.rel.toLowerCase()==="stylesheet")continue}s.removeChild(p)}}function JZ(s,c,p,g){for(;s.nodeType===1;){var w=p;if(s.nodeName.toLowerCase()!==c.toLowerCase()){if(!g&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(g){if(!s[Of])switch(c){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(c==="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=fo(s.nextSibling),s===null)break}return null}function QZ(s,c,p){if(c==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!p||(s=fo(s.nextSibling),s===null))return null;return s}function IO(s,c){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!c||(s=fo(s.nextSibling),s===null))return null;return s}function YS(s){return s.data==="$?"||s.data==="$~"}function WS(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function eY(s,c){var p=s.ownerDocument;if(s.data==="$~")s._reactRetry=c;else if(s.data!=="$?"||p.readyState!=="loading")c();else{var g=function(){c(),p.removeEventListener("DOMContentLoaded",g)};p.addEventListener("DOMContentLoaded",g),s._reactRetry=g}}function fo(s){for(;s!=null;s=s.nextSibling){var c=s.nodeType;if(c===1||c===3)break;if(c===8){if(c=s.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return s}var XS=null;function TO(s){s=s.nextSibling;for(var c=0;s;){if(s.nodeType===8){var p=s.data;if(p==="/$"||p==="/&"){if(c===0)return fo(s.nextSibling);c--}else p!=="$"&&p!=="$!"&&p!=="$?"&&p!=="$~"&&p!=="&"||c++}s=s.nextSibling}return null}function NO(s){s=s.previousSibling;for(var c=0;s;){if(s.nodeType===8){var p=s.data;if(p==="$"||p==="$!"||p==="$?"||p==="$~"||p==="&"){if(c===0)return s;c--}else p!=="/$"&&p!=="/&"||c++}s=s.previousSibling}return null}function AO(s,c,p){switch(c=Hg(p),s){case"html":if(s=c.documentElement,!s)throw Error(r(452));return s;case"head":if(s=c.head,!s)throw Error(r(453));return s;case"body":if(s=c.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function hp(s){for(var c=s.attributes;c.length;)s.removeAttributeNode(c[0]);Q0(s)}var po=new Map,OO=new Set;function qg(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Ga=W.d;W.d={f:tY,r:nY,D:rY,C:iY,L:oY,m:aY,X:lY,S:sY,M:cY};function tY(){var s=Ga.f(),c=Pg();return s||c}function nY(s){var c=mu(s);c!==null&&c.tag===5&&c.type==="form"?WN(c):Ga.r(s)}var Ku=typeof document>"u"?null:document;function $O(s,c,p){var g=Ku;if(g&&typeof c=="string"&&c){var w=io(c);w='link[rel="'+s+'"][href="'+w+'"]',typeof p=="string"&&(w+='[crossorigin="'+p+'"]'),OO.has(w)||(OO.add(w),s={rel:s,crossOrigin:p,href:c},g.querySelector(w)===null&&(c=g.createElement("link"),Er(c,"link",s),mr(c),g.head.appendChild(c)))}}function rY(s){Ga.D(s),$O("dns-prefetch",s,null)}function iY(s,c){Ga.C(s,c),$O("preconnect",s,c)}function oY(s,c,p){Ga.L(s,c,p);var g=Ku;if(g&&s&&c){var w='link[rel="preload"][as="'+io(c)+'"]';c==="image"&&p&&p.imageSrcSet?(w+='[imagesrcset="'+io(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(w+='[imagesizes="'+io(p.imageSizes)+'"]')):w+='[href="'+io(s)+'"]';var _=w;switch(c){case"style":_=Gu(s);break;case"script":_=Zu(s)}po.has(_)||(s=h({rel:"preload",href:c==="image"&&p&&p.imageSrcSet?void 0:s,as:c},p),po.set(_,s),g.querySelector(w)!==null||c==="style"&&g.querySelector(gp(_))||c==="script"&&g.querySelector(vp(_))||(c=g.createElement("link"),Er(c,"link",s),mr(c),g.head.appendChild(c)))}}function aY(s,c){Ga.m(s,c);var p=Ku;if(p&&s){var g=c&&typeof c.as=="string"?c.as:"script",w='link[rel="modulepreload"][as="'+io(g)+'"][href="'+io(s)+'"]',_=w;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=Zu(s)}if(!po.has(_)&&(s=h({rel:"modulepreload",href:s},c),po.set(_,s),p.querySelector(w)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(vp(_)))return}g=p.createElement("link"),Er(g,"link",s),mr(g),p.head.appendChild(g)}}}function sY(s,c,p){Ga.S(s,c,p);var g=Ku;if(g&&s){var w=hu(g).hoistableStyles,_=Gu(s);c=c||"default";var I=w.get(_);if(!I){var M={loading:0,preload:null};if(I=g.querySelector(gp(_)))M.loading=5;else{s=h({rel:"stylesheet",href:s,"data-precedence":c},p),(p=po.get(_))&&JS(s,p);var Y=I=g.createElement("link");mr(Y),Er(Y,"link",s),Y._p=new Promise(function(ue,ye){Y.onload=ue,Y.onerror=ye}),Y.addEventListener("load",function(){M.loading|=1}),Y.addEventListener("error",function(){M.loading|=2}),M.loading|=4,Kg(I,c,g)}I={type:"stylesheet",instance:I,count:1,state:M},w.set(_,I)}}}function lY(s,c){Ga.X(s,c);var p=Ku;if(p&&s){var g=hu(p).hoistableScripts,w=Zu(s),_=g.get(w);_||(_=p.querySelector(vp(w)),_||(s=h({src:s,async:!0},c),(c=po.get(w))&&QS(s,c),_=p.createElement("script"),mr(_),Er(_,"link",s),p.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},g.set(w,_))}}function cY(s,c){Ga.M(s,c);var p=Ku;if(p&&s){var g=hu(p).hoistableScripts,w=Zu(s),_=g.get(w);_||(_=p.querySelector(vp(w)),_||(s=h({src:s,async:!0,type:"module"},c),(c=po.get(w))&&QS(s,c),_=p.createElement("script"),mr(_),Er(_,"link",s),p.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},g.set(w,_))}}function DO(s,c,p,g){var w=(w=ge.current)?qg(w):null;if(!w)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(c=Gu(p.href),p=hu(w).hoistableStyles,g=p.get(c),g||(g={type:"style",instance:null,count:0,state:null},p.set(c,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){s=Gu(p.href);var _=hu(w).hoistableStyles,I=_.get(s);if(I||(w=w.ownerDocument||w,I={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(s,I),(_=w.querySelector(gp(s)))&&!_._p&&(I.instance=_,I.state.loading=5),po.has(s)||(p={rel:"preload",as:"style",href:p.href,crossOrigin:p.crossOrigin,integrity:p.integrity,media:p.media,hrefLang:p.hrefLang,referrerPolicy:p.referrerPolicy},po.set(s,p),_||uY(w,s,p,I.state))),c&&g===null)throw Error(r(528,""));return I}if(c&&g!==null)throw Error(r(529,""));return null;case"script":return c=p.async,p=p.src,typeof p=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=Zu(p),p=hu(w).hoistableScripts,g=p.get(c),g||(g={type:"script",instance:null,count:0,state:null},p.set(c,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function Gu(s){return'href="'+io(s)+'"'}function gp(s){return'link[rel="stylesheet"]['+s+"]"}function PO(s){return h({},s,{"data-precedence":s.precedence,precedence:null})}function uY(s,c,p,g){s.querySelector('link[rel="preload"][as="style"]['+c+"]")?g.loading=1:(c=s.createElement("link"),g.preload=c,c.addEventListener("load",function(){return g.loading|=1}),c.addEventListener("error",function(){return g.loading|=2}),Er(c,"link",p),mr(c),s.head.appendChild(c))}function Zu(s){return'[src="'+io(s)+'"]'}function vp(s){return"script[async]"+s}function MO(s,c,p){if(c.count++,c.instance===null)switch(c.type){case"style":var g=s.querySelector('style[data-href~="'+io(p.href)+'"]');if(g)return c.instance=g,mr(g),g;var w=h({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return g=(s.ownerDocument||s).createElement("style"),mr(g),Er(g,"style",w),Kg(g,p.precedence,s),c.instance=g;case"stylesheet":w=Gu(p.href);var _=s.querySelector(gp(w));if(_)return c.state.loading|=4,c.instance=_,mr(_),_;g=PO(p),(w=po.get(w))&&JS(g,w),_=(s.ownerDocument||s).createElement("link"),mr(_);var I=_;return I._p=new Promise(function(M,Y){I.onload=M,I.onerror=Y}),Er(_,"link",g),c.state.loading|=4,Kg(_,p.precedence,s),c.instance=_;case"script":return _=Zu(p.src),(w=s.querySelector(vp(_)))?(c.instance=w,mr(w),w):(g=p,(w=po.get(_))&&(g=h({},p),QS(g,w)),s=s.ownerDocument||s,w=s.createElement("script"),mr(w),Er(w,"link",g),s.head.appendChild(w),c.instance=w);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(g=c.instance,c.state.loading|=4,Kg(g,p.precedence,s));return c.instance}function Kg(s,c,p){for(var g=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),w=g.length?g[g.length-1]:null,_=w,I=0;I<g.length;I++){var M=g[I];if(M.dataset.precedence===c)_=M;else if(_!==w)break}_?_.parentNode.insertBefore(s,_.nextSibling):(c=p.nodeType===9?p.head:p,c.insertBefore(s,c.firstChild))}function JS(s,c){s.crossOrigin==null&&(s.crossOrigin=c.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=c.referrerPolicy),s.title==null&&(s.title=c.title)}function QS(s,c){s.crossOrigin==null&&(s.crossOrigin=c.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=c.referrerPolicy),s.integrity==null&&(s.integrity=c.integrity)}var Gg=null;function zO(s,c,p){if(Gg===null){var g=new Map,w=Gg=new Map;w.set(p,g)}else w=Gg,g=w.get(p),g||(g=new Map,w.set(p,g));if(g.has(s))return g;for(g.set(s,null),p=p.getElementsByTagName(s),w=0;w<p.length;w++){var _=p[w];if(!(_[Of]||_[Sr]||s==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var I=_.getAttribute(c)||"";I=s+I;var M=g.get(I);M?M.push(_):g.set(I,[_])}}return g}function LO(s,c,p){s=s.ownerDocument||s,s.head.insertBefore(p,c==="title"?s.querySelector("head > title"):null)}function dY(s,c,p){if(p===1||c.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;return c.rel==="stylesheet"?(s=c.disabled,typeof c.precedence=="string"&&s==null):!0;case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function FO(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function fY(s,c,p,g){if(p.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var w=Gu(g.href),_=c.querySelector(gp(w));if(_){c=_._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(s.count++,s=Zg.bind(s),c.then(s,s)),p.state.loading|=4,p.instance=_,mr(_);return}_=c.ownerDocument||c,g=PO(g),(w=po.get(w))&&JS(g,w),_=_.createElement("link"),mr(_);var I=_;I._p=new Promise(function(M,Y){I.onload=M,I.onerror=Y}),Er(_,"link",g),p.instance=_}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(p,c),(c=p.state.preload)&&(p.state.loading&3)===0&&(s.count++,p=Zg.bind(s),c.addEventListener("load",p),c.addEventListener("error",p))}}var e_=0;function pY(s,c){return s.stylesheets&&s.count===0&&Wg(s,s.stylesheets),0<s.count||0<s.imgCount?function(p){var g=setTimeout(function(){if(s.stylesheets&&Wg(s,s.stylesheets),s.unsuspend){var _=s.unsuspend;s.unsuspend=null,_()}},6e4+c);0<s.imgBytes&&e_===0&&(e_=62500*GZ());var w=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Wg(s,s.stylesheets),s.unsuspend)){var _=s.unsuspend;s.unsuspend=null,_()}},(s.imgBytes>e_?50:800)+c);return s.unsuspend=p,function(){s.unsuspend=null,clearTimeout(g),clearTimeout(w)}}:null}function Zg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Wg(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Yg=null;function Wg(s,c){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Yg=new Map,c.forEach(mY,s),Yg=null,Zg.call(s))}function mY(s,c){if(!(c.state.loading&4)){var p=Yg.get(s);if(p)var g=p.get(null);else{p=new Map,Yg.set(s,p);for(var w=s.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<w.length;_++){var I=w[_];(I.nodeName==="LINK"||I.getAttribute("media")!=="not all")&&(p.set(I.dataset.precedence,I),g=I)}g&&p.set(null,g)}w=c.instance,I=w.getAttribute("data-precedence"),_=p.get(I)||g,_===g&&p.set(null,w),p.set(I,w),this.count++,g=Zg.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)),c.state.loading|=4}}var yp={$$typeof:j,Provider:null,Consumer:null,_currentValue:L,_currentValue2:L,_threadCount:0};function hY(s,c,p,g,w,_,I,M,Y){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=ea(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ea(0),this.hiddenUpdates=ea(null),this.identifierPrefix=g,this.onUncaughtError=w,this.onCaughtError=_,this.onRecoverableError=I,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}function UO(s,c,p,g,w,_,I,M,Y,ue,ye,_e){return s=new hY(s,c,p,I,Y,ue,ye,_e,M),c=1,_===!0&&(c|=24),_=Ti(3,null,null,c),s.current=_,_.stateNode=s,c=Ow(),c.refCount++,s.pooledCache=c,c.refCount++,_.memoizedState={element:g,isDehydrated:p,cache:c},Mw(_),s}function VO(s){return s?(s=ku,s):ku}function BO(s,c,p,g,w,_){w=VO(w),g.context===null?g.context=w:g.pendingContext=w,g=js(c),g.payload={element:p},_=_===void 0?null:_,_!==null&&(g.callback=_),p=Rs(s,g,c),p!==null&&(mi(p,s,c),Wf(p,s,c))}function HO(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var p=s.retryLane;s.retryLane=p!==0&&p<c?p:c}}function t_(s,c){HO(s,c),(s=s.alternate)&&HO(s,c)}function qO(s){if(s.tag===13||s.tag===31){var c=Wl(s,67108864);c!==null&&mi(c,s,67108864),t_(s,67108864)}}function KO(s){if(s.tag===13||s.tag===31){var c=Di();c=du(c);var p=Wl(s,c);p!==null&&mi(p,s,c),t_(s,c)}}var Xg=!0;function gY(s,c,p,g){var w=z.T;z.T=null;var _=W.p;try{W.p=2,n_(s,c,p,g)}finally{W.p=_,z.T=w}}function vY(s,c,p,g){var w=z.T;z.T=null;var _=W.p;try{W.p=8,n_(s,c,p,g)}finally{W.p=_,z.T=w}}function n_(s,c,p,g){if(Xg){var w=r_(g);if(w===null)VS(s,c,g,Jg,p),ZO(s,g);else if(bY(w,s,c,p,g))g.stopPropagation();else if(ZO(s,g),c&4&&-1<yY.indexOf(s)){for(;w!==null;){var _=mu(w);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var I=qt(_.pendingLanes);if(I!==0){var M=_;for(M.pendingLanes|=2,M.entangledLanes|=2;I;){var Y=1<<31-jt(I);M.entanglements[1]|=Y,I&=~Y}ia(_),(Kt&6)===0&&($g=ie()+500,fp(0))}}break;case 31:case 13:M=Wl(_,2),M!==null&&mi(M,_,2),Pg(),t_(_,2)}if(_=r_(g),_===null&&VS(s,c,g,Jg,p),_===w)break;w=_}w!==null&&g.stopPropagation()}else VS(s,c,g,null,p)}}function r_(s){return s=ow(s),i_(s)}var Jg=null;function i_(s){if(Jg=null,s=pu(s),s!==null){var c=o(s);if(c===null)s=null;else{var p=c.tag;if(p===13){if(s=a(c),s!==null)return s;s=null}else if(p===31){if(s=l(c),s!==null)return s;s=null}else if(p===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;s=null}else c!==s&&(s=null)}}return Jg=s,null}function GO(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(fe()){case B:return 2;case le:return 8;case Ee:case Me:return 32;case Ke:return 268435456;default:return 32}default:return 32}}var o_=!1,Ls=null,Fs=null,Us=null,bp=new Map,xp=new Map,Vs=[],yY="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 ZO(s,c){switch(s){case"focusin":case"focusout":Ls=null;break;case"dragenter":case"dragleave":Fs=null;break;case"mouseover":case"mouseout":Us=null;break;case"pointerover":case"pointerout":bp.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":xp.delete(c.pointerId)}}function wp(s,c,p,g,w,_){return s===null||s.nativeEvent!==_?(s={blockedOn:c,domEventName:p,eventSystemFlags:g,nativeEvent:_,targetContainers:[w]},c!==null&&(c=mu(c),c!==null&&qO(c)),s):(s.eventSystemFlags|=g,c=s.targetContainers,w!==null&&c.indexOf(w)===-1&&c.push(w),s)}function bY(s,c,p,g,w){switch(c){case"focusin":return Ls=wp(Ls,s,c,p,g,w),!0;case"dragenter":return Fs=wp(Fs,s,c,p,g,w),!0;case"mouseover":return Us=wp(Us,s,c,p,g,w),!0;case"pointerover":var _=w.pointerId;return bp.set(_,wp(bp.get(_)||null,s,c,p,g,w)),!0;case"gotpointercapture":return _=w.pointerId,xp.set(_,wp(xp.get(_)||null,s,c,p,g,w)),!0}return!1}function YO(s){var c=pu(s.target);if(c!==null){var p=o(c);if(p!==null){if(c=p.tag,c===13){if(c=a(p),c!==null){s.blockedOn=c,cT(s.priority,function(){KO(p)});return}}else if(c===31){if(c=l(p),c!==null){s.blockedOn=c,cT(s.priority,function(){KO(p)});return}}else if(c===3&&p.stateNode.current.memoizedState.isDehydrated){s.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Qg(s){if(s.blockedOn!==null)return!1;for(var c=s.targetContainers;0<c.length;){var p=r_(s.nativeEvent);if(p===null){p=s.nativeEvent;var g=new p.constructor(p.type,p);iw=g,p.target.dispatchEvent(g),iw=null}else return c=mu(p),c!==null&&qO(c),s.blockedOn=p,!1;c.shift()}return!0}function WO(s,c,p){Qg(s)&&p.delete(c)}function xY(){o_=!1,Ls!==null&&Qg(Ls)&&(Ls=null),Fs!==null&&Qg(Fs)&&(Fs=null),Us!==null&&Qg(Us)&&(Us=null),bp.forEach(WO),xp.forEach(WO)}function ev(s,c){s.blockedOn===c&&(s.blockedOn=null,o_||(o_=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,xY)))}var tv=null;function XO(s){tv!==s&&(tv=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){tv===s&&(tv=null);for(var c=0;c<s.length;c+=3){var p=s[c],g=s[c+1],w=s[c+2];if(typeof g!="function"){if(i_(g||p)===null)continue;break}var _=mu(p);_!==null&&(s.splice(c,3),c-=3,rS(_,{pending:!0,data:w,method:p.method,action:g},g,w))}}))}function Yu(s){function c(Y){return ev(Y,s)}Ls!==null&&ev(Ls,s),Fs!==null&&ev(Fs,s),Us!==null&&ev(Us,s),bp.forEach(c),xp.forEach(c);for(var p=0;p<Vs.length;p++){var g=Vs[p];g.blockedOn===s&&(g.blockedOn=null)}for(;0<Vs.length&&(p=Vs[0],p.blockedOn===null);)YO(p),p.blockedOn===null&&Vs.shift();if(p=(s.ownerDocument||s).$$reactFormReplay,p!=null)for(g=0;g<p.length;g+=3){var w=p[g],_=p[g+1],I=w[li]||null;if(typeof _=="function")I||XO(p);else if(I){var M=null;if(_&&_.hasAttribute("formAction")){if(w=_,I=_[li]||null)M=I.formAction;else if(i_(w)!==null)continue}else M=I.action;typeof M=="function"?p[g+1]=M:(p.splice(g,3),g-=3),XO(p)}}}function JO(){function s(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(I){return w=I})},focusReset:"manual",scroll:"manual"})}function c(){w!==null&&(w(),w=null),g||setTimeout(p,20)}function p(){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",c),navigation.addEventListener("navigateerror",c),setTimeout(p,100),function(){g=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),w!==null&&(w(),w=null)}}}function a_(s){this._internalRoot=s}nv.prototype.render=a_.prototype.render=function(s){var c=this._internalRoot;if(c===null)throw Error(r(409));var p=c.current,g=Di();BO(p,g,s,c,null,null)},nv.prototype.unmount=a_.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var c=s.containerInfo;BO(s.current,2,null,s,null,null),Pg(),c[fu]=null}};function nv(s){this._internalRoot=s}nv.prototype.unstable_scheduleHydration=function(s){if(s){var c=X0();s={blockedOn:null,target:s,priority:c};for(var p=0;p<Vs.length&&c!==0&&c<Vs[p].priority;p++);Vs.splice(p,0,s),p===0&&YO(s)}};var QO=t.version;if(QO!=="19.2.3")throw Error(r(527,QO,"19.2.3"));W.findDOMNode=function(s){var c=s._reactInternals;if(c===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=f(c),s=s!==null?m(s):null,s=s===null?null:s.stateNode,s};var wY={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var rv=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rv.isDisabled&&rv.supportsFiber)try{Cn=rv.inject(wY),Lt=rv}catch{}}return Gp.createRoot=function(s,c){if(!i(s))throw Error(r(299));var p=!1,g="",w=aA,_=sA,I=lA;return c!=null&&(c.unstable_strictMode===!0&&(p=!0),c.identifierPrefix!==void 0&&(g=c.identifierPrefix),c.onUncaughtError!==void 0&&(w=c.onUncaughtError),c.onCaughtError!==void 0&&(_=c.onCaughtError),c.onRecoverableError!==void 0&&(I=c.onRecoverableError)),c=UO(s,1,!1,null,null,p,g,null,w,_,I,JO),s[fu]=c.current,US(s),new a_(c)},Gp.hydrateRoot=function(s,c,p){if(!i(s))throw Error(r(299));var g=!1,w="",_=aA,I=sA,M=lA,Y=null;return p!=null&&(p.unstable_strictMode===!0&&(g=!0),p.identifierPrefix!==void 0&&(w=p.identifierPrefix),p.onUncaughtError!==void 0&&(_=p.onUncaughtError),p.onCaughtError!==void 0&&(I=p.onCaughtError),p.onRecoverableError!==void 0&&(M=p.onRecoverableError),p.formState!==void 0&&(Y=p.formState)),c=UO(s,1,!0,c,p??null,g,w,Y,_,I,M,JO),c.context=VO(null),p=c.current,g=Di(),g=du(g),w=js(g),w.callback=null,Rs(p,w,g),p=g,c.current.lanes=p,pn(c,p),ia(c),s[fu]=c.current,US(s),new nv(c)},Gp.version="19.2.3",Gp}var az;function QDe(){if(az)return Z1.exports;az=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(),Z1.exports=JDe(),Z1.exports}var e2e=QDe();e2e.createRoot(document.getElementById("root"),{onUncaughtError:(e,t)=>{ay(),console.error("Uncaught error:",e,t)},onCaughtError:(e,t)=>{ay(),console.error("Caught error:",e,t)},onRecoverableError:(e,t)=>{ay(),console.warn("Recoverable error:",e,t)}}).render(u.jsx(b.StrictMode,{children:u.jsx(YDe,{})}));export{ut as $,nn as A,va as B,F_ as C,kE as D,gl as E,C2e as F,pae as G,vse as H,_t as I,Zse as J,AL as K,O2e as L,N2e as M,Rt as N,A2e as O,j2e as P,$2e as Q,wt as R,koe as S,xo as T,Pr as U,Lr as V,Wb as W,Ym as X,UL as Y,Fd as Z,Wm as _,vle as a,Fo as a$,Yt as a0,Dt as a1,tt as a2,_n as a3,jn as a4,Rl as a5,un as a6,vn as a7,b as a8,kt as a9,es as aA,Jk as aB,sl as aC,O7 as aD,qc as aE,Wr as aF,Jo as aG,w2e as aH,rf as aI,t2e as aJ,Bm as aK,X as aL,P2e as aM,ca as aN,Je as aO,iE as aP,rt as aQ,Mt as aR,vOe as aS,iT as aT,HAe as aU,no as aV,BM as aW,Ey as aX,Qr as aY,S2e as aZ,Tc as a_,$n as aa,Se as ab,Pfe as ac,u as ad,dn as ae,De as af,Te as ag,Ne as ah,Oe as ai,ze as aj,Ae as ak,xe as al,To as am,Ld as an,gE as ao,NL as ap,vre as aq,hl as ar,No as as,gt as at,xr as au,tL as av,Wt as aw,ir as ax,Om as ay,pj as az,Bb as b,Ue as b0,h4 as b1,rQ as b2,lf as b3,Wk as b4,WSe as b5,YSe as b6,oh as b7,Gi as b8,Yi as b9,Zi as ba,Wi as bb,Wo as bc,$t as bd,Ji as be,Mr as bf,R2e as c,Ose as d,gle as e,kF as f,I2e as g,k2e as h,_2e as i,vF as j,E2e as k,as as l,T2e as m,Uce as n,Zn as o,IE as p,Zm as q,hle as r,EF as s,br as t,jE as u,Vb as v,vl as w,tx as x,Dn as y,Vce as z};