harperdb 4.7.10 → 4.7.11

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.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.lazy-CI2uUC67.js","assets/react-redux-CajzJORs.js","assets/index-YHth6Ryl.css","assets/index-CKgGjgnE.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.lazy-4dmLPM-x.js","assets/react-redux-bY1TVOy8.js","assets/index-YHth6Ryl.css","assets/index-Duj5JfEk.js"])))=>i.map(i=>d[i]);
2
2
  function Lq(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 zTe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lw={exports:{}},Jf={};var hA;function Uq(){if(hA)return Jf;hA=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,o){var a=null;if(o!==void 0&&(a=""+o),i.key!==void 0&&(a=""+i.key),"key"in i){o={};for(var c in i)c!=="key"&&(o[c]=i[c])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:a,ref:i!==void 0?i:null,props:o}}return Jf.Fragment=t,Jf.jsx=n,Jf.jsxs=n,Jf}var gA;function Fq(){return gA||(gA=1,Lw.exports=Uq()),Lw.exports}var u=Fq();const Xu=!0,Vq="/",ld=9925,R_="HDB_ADMIN",oa="/",pC="../";function tP(e,t){return function(){return e.apply(t,arguments)}}const{toString:Bq}=Object.prototype,{getPrototypeOf:hC}=Object,{iterator:zy,toStringTag:nP}=Symbol,Ly=(e=>t=>{const n=Bq.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Uo=e=>(e=e.toLowerCase(),t=>Ly(t)===e),Uy=e=>t=>typeof t===e,{isArray:Dd}=Array,cd=Uy("undefined");function mp(e){return e!==null&&!cd(e)&&e.constructor!==null&&!cd(e.constructor)&&ui(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const rP=Uo("ArrayBuffer");function Hq(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&rP(e.buffer),t}const qq=Uy("string"),ui=Uy("function"),iP=Uy("number"),pp=e=>e!==null&&typeof e=="object",Gq=e=>e===!0||e===!1,dv=e=>{if(Ly(e)!=="object")return!1;const t=hC(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(nP in e)&&!(zy in e)},Kq=e=>{if(!pp(e)||mp(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Zq=Uo("Date"),Yq=Uo("File"),Wq=Uo("Blob"),Xq=Uo("FileList"),Qq=e=>pp(e)&&ui(e.pipe),Jq=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ui(e.append)&&((t=Ly(e))==="formdata"||t==="object"&&ui(e.toString)&&e.toString()==="[object FormData]"))},eG=Uo("URLSearchParams"),[tG,nG,rG,iG]=["ReadableStream","Request","Response","Headers"].map(Uo),oG=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function hp(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),Dd(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(mp(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let c;for(r=0;r<a;r++)c=o[r],t.call(null,e[c],c,e)}}function oP(e,t){if(mp(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Gl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,aP=e=>!cd(e)&&e!==Gl;function I_(){const{caseless:e,skipUndefined:t}=aP(this)&&this||{},n={},r=(i,o)=>{const a=e&&oP(n,o)||o;dv(n[a])&&dv(i)?n[a]=I_(n[a],i):dv(i)?n[a]=I_({},i):Dd(i)?n[a]=i.slice():(!t||!cd(i))&&(n[a]=i)};for(let i=0,o=arguments.length;i<o;i++)arguments[i]&&hp(arguments[i],r);return n}const aG=(e,t,n,{allOwnKeys:r}={})=>(hp(t,(i,o)=>{n&&ui(i)?e[o]=tP(i,n):e[o]=i},{allOwnKeys:r}),e),sG=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),lG=(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)},cG=(e,t,n,r)=>{let i,o,a;const c={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],(!r||r(a,e,t))&&!c[a]&&(t[a]=e[a],c[a]=!0);e=n!==!1&&hC(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},uG=(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},dG=e=>{if(!e)return null;if(Dd(e))return e;let t=e.length;if(!iP(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},fG=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&hC(Uint8Array)),mG=(e,t)=>{const r=(e&&e[zy]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},pG=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},hG=Uo("HTMLFormElement"),gG=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),vA=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),vG=Uo("RegExp"),sP=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};hp(n,(i,o)=>{let a;(a=t(i,o,e))!==!1&&(r[o]=a||i)}),Object.defineProperties(e,r)},yG=e=>{sP(e,(t,n)=>{if(ui(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(ui(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+"'")})}})},bG=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return Dd(e)?r(e):r(String(e).split(t)),n},xG=()=>{},wG=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function SG(e){return!!(e&&ui(e.append)&&e[nP]==="FormData"&&e[zy])}const _G=e=>{const t=new Array(10),n=(r,i)=>{if(pp(r)){if(t.indexOf(r)>=0)return;if(mp(r))return r;if(!("toJSON"in r)){t[i]=r;const o=Dd(r)?[]:{};return hp(r,(a,c)=>{const d=n(a,i+1);!cd(d)&&(o[c]=d)}),t[i]=void 0,o}}return r};return n(e,0)},CG=Uo("AsyncFunction"),EG=e=>e&&(pp(e)||ui(e))&&ui(e.then)&&ui(e.catch),lP=((e,t)=>e?setImmediate:t?((n,r)=>(Gl.addEventListener("message",({source:i,data:o})=>{i===Gl&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Gl.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ui(Gl.postMessage)),kG=typeof queueMicrotask<"u"?queueMicrotask.bind(Gl):typeof process<"u"&&process.nextTick||lP,jG=e=>e!=null&&ui(e[zy]),fe={isArray:Dd,isArrayBuffer:rP,isBuffer:mp,isFormData:Jq,isArrayBufferView:Hq,isString:qq,isNumber:iP,isBoolean:Gq,isObject:pp,isPlainObject:dv,isEmptyObject:Kq,isReadableStream:tG,isRequest:nG,isResponse:rG,isHeaders:iG,isUndefined:cd,isDate:Zq,isFile:Yq,isBlob:Wq,isRegExp:vG,isFunction:ui,isStream:Qq,isURLSearchParams:eG,isTypedArray:fG,isFileList:Xq,forEach:hp,merge:I_,extend:aG,trim:oG,stripBOM:sG,inherits:lG,toFlatObject:cG,kindOf:Ly,kindOfTest:Uo,endsWith:uG,toArray:dG,forEachEntry:mG,matchAll:pG,isHTMLForm:hG,hasOwnProperty:vA,hasOwnProp:vA,reduceDescriptors:sP,freezeMethods:yG,toObjectSet:bG,toCamelCase:gG,noop:xG,toFiniteNumber:wG,findKey:oP,global:Gl,isContextDefined:aP,isSpecCompliantForm:SG,toJSONObject:_G,isAsyncFn:CG,isThenable:EG,setImmediate:lP,asap:kG,isIterable:jG};function ft(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}fe.inherits(ft,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:fe.toJSONObject(this.config),code:this.code,status:this.status}}});const cP=ft.prototype,uP={};["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=>{uP[e]={value:e}});Object.defineProperties(ft,uP);Object.defineProperty(cP,"isAxiosError",{value:!0});ft.from=(e,t,n,r,i,o)=>{const a=Object.create(cP);fe.toFlatObject(e,a,function(p){return p!==Error.prototype},f=>f!=="isAxiosError");const c=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return ft.call(a,c,d,n,r,i),e&&a.cause==null&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",o&&Object.assign(a,o),a};const RG=null;function N_(e){return fe.isPlainObject(e)||fe.isArray(e)}function dP(e){return fe.endsWith(e,"[]")?e.slice(0,-2):e}function yA(e,t,n){return e?e.concat(t).map(function(i,o){return i=dP(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function IG(e){return fe.isArray(e)&&!e.some(N_)}const NG=fe.toFlatObject(fe,{},null,function(t){return/^is[A-Z]/.test(t)});function Fy(e,t,n){if(!fe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=fe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,C){return!fe.isUndefined(C[S])});const r=n.metaTokens,i=n.visitor||p,o=n.dots,a=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&fe.isSpecCompliantForm(t);if(!fe.isFunction(i))throw new TypeError("visitor must be a function");function f(b){if(b===null)return"";if(fe.isDate(b))return b.toISOString();if(fe.isBoolean(b))return b.toString();if(!d&&fe.isBlob(b))throw new ft("Blob is not supported. Use a Buffer instead.");return fe.isArrayBuffer(b)||fe.isTypedArray(b)?d&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function p(b,S,C){let E=b;if(b&&!C&&typeof b=="object"){if(fe.endsWith(S,"{}"))S=r?S:S.slice(0,-2),b=JSON.stringify(b);else if(fe.isArray(b)&&IG(b)||(fe.isFileList(b)||fe.endsWith(S,"[]"))&&(E=fe.toArray(b)))return S=dP(S),E.forEach(function(j,I){!(fe.isUndefined(j)||j===null)&&t.append(a===!0?yA([S],I,o):a===null?S:S+"[]",f(j))}),!1}return N_(b)?!0:(t.append(yA(C,S,o),f(b)),!1)}const h=[],v=Object.assign(NG,{defaultVisitor:p,convertValue:f,isVisitable:N_});function y(b,S){if(!fe.isUndefined(b)){if(h.indexOf(b)!==-1)throw Error("Circular reference detected in "+S.join("."));h.push(b),fe.forEach(b,function(E,k){(!(fe.isUndefined(E)||E===null)&&i.call(t,E,fe.isString(k)?k.trim():k,S,v))===!0&&y(E,S?S.concat(k):[k])}),h.pop()}}if(!fe.isObject(e))throw new TypeError("data must be an object");return y(e),t}function bA(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function gC(e,t){this._pairs=[],e&&Fy(e,this,t)}const fP=gC.prototype;fP.append=function(t,n){this._pairs.push([t,n])};fP.toString=function(t){const n=t?function(r){return t.call(this,r,bA)}:bA;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function TG(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function mP(e,t,n){if(!t)return e;const r=n&&n.encode||TG;fe.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(i?o=i(t,n):o=fe.isURLSearchParams(t)?t.toString():new gC(t,n).toString(r),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class xA{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){fe.forEach(this.handlers,function(r){r!==null&&t(r)})}}const pP={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},AG=typeof URLSearchParams<"u"?URLSearchParams:gC,OG=typeof FormData<"u"?FormData:null,DG=typeof Blob<"u"?Blob:null,$G={isBrowser:!0,classes:{URLSearchParams:AG,FormData:OG,Blob:DG},protocols:["http","https","file","blob","url","data"]},vC=typeof window<"u"&&typeof document<"u",T_=typeof navigator=="object"&&navigator||void 0,PG=vC&&(!T_||["ReactNative","NativeScript","NS"].indexOf(T_.product)<0),MG=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",zG=vC&&window.location.href||"http://localhost",LG=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:vC,hasStandardBrowserEnv:PG,hasStandardBrowserWebWorkerEnv:MG,navigator:T_,origin:zG},Symbol.toStringTag,{value:"Module"})),Cr={...LG,...$G};function UG(e,t){return Fy(e,new Cr.classes.URLSearchParams,{visitor:function(n,r,i,o){return Cr.isNode&&fe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function FG(e){return fe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function VG(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 hP(e){function t(n,r,i,o){let a=n[o++];if(a==="__proto__")return!0;const c=Number.isFinite(+a),d=o>=n.length;return a=!a&&fe.isArray(i)?i.length:a,d?(fe.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!c):((!i[a]||!fe.isObject(i[a]))&&(i[a]=[]),t(n,r,i[a],o)&&fe.isArray(i[a])&&(i[a]=VG(i[a])),!c)}if(fe.isFormData(e)&&fe.isFunction(e.entries)){const n={};return fe.forEachEntry(e,(r,i)=>{t(FG(r),i,n,0)}),n}return null}function BG(e,t,n){if(fe.isString(e))try{return(t||JSON.parse)(e),fe.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const gp={transitional:pP,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=fe.isObject(t);if(o&&fe.isHTMLForm(t)&&(t=new FormData(t)),fe.isFormData(t))return i?JSON.stringify(hP(t)):t;if(fe.isArrayBuffer(t)||fe.isBuffer(t)||fe.isStream(t)||fe.isFile(t)||fe.isBlob(t)||fe.isReadableStream(t))return t;if(fe.isArrayBufferView(t))return t.buffer;if(fe.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return UG(t,this.formSerializer).toString();if((c=fe.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Fy(c?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),BG(t)):t}],transformResponse:[function(t){const n=this.transitional||gp.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(fe.isResponse(t)||fe.isReadableStream(t))return t;if(t&&fe.isString(t)&&(r&&!this.responseType||i)){const a=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(c){if(a)throw c.name==="SyntaxError"?ft.from(c,ft.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Cr.classes.FormData,Blob:Cr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};fe.forEach(["delete","get","head","post","put","patch"],e=>{gp.headers[e]={}});const HG=fe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),qG=e=>{const t={};let n,r,i;return e&&e.split(`
3
3
  `).forEach(function(a){i=a.indexOf(":"),n=a.substring(0,i).trim().toLowerCase(),r=a.substring(i+1).trim(),!(!n||t[n]&&HG[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},wA=Symbol("internals");function em(e){return e&&String(e).trim().toLowerCase()}function fv(e){return e===!1||e==null?e:fe.isArray(e)?e.map(fv):String(e)}function GG(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 KG=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Uw(e,t,n,r,i){if(fe.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!fe.isString(t)){if(fe.isString(r))return t.indexOf(r)!==-1;if(fe.isRegExp(r))return r.test(t)}}function ZG(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function YG(e,t){const n=fe.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,o,a){return this[r].call(this,t,i,o,a)},configurable:!0})})}let di=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(c,d,f){const p=em(d);if(!p)throw new Error("header name must be a non-empty string");const h=fe.findKey(i,p);(!h||i[h]===void 0||f===!0||f===void 0&&i[h]!==!1)&&(i[h||d]=fv(c))}const a=(c,d)=>fe.forEach(c,(f,p)=>o(f,p,d));if(fe.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(fe.isString(t)&&(t=t.trim())&&!KG(t))a(qG(t),n);else if(fe.isObject(t)&&fe.isIterable(t)){let c={},d,f;for(const p of t){if(!fe.isArray(p))throw TypeError("Object iterator must return a key-value pair");c[f=p[0]]=(d=c[f])?fe.isArray(d)?[...d,p[1]]:[d,p[1]]:p[1]}a(c,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=em(t),t){const r=fe.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return GG(i);if(fe.isFunction(n))return n.call(this,i,r);if(fe.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=em(t),t){const r=fe.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Uw(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(a){if(a=em(a),a){const c=fe.findKey(r,a);c&&(!n||Uw(r,r[c],c,n))&&(delete r[c],i=!0)}}return fe.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||Uw(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return fe.forEach(this,(i,o)=>{const a=fe.findKey(r,o);if(a){n[a]=fv(i),delete n[o];return}const c=t?ZG(o):String(o).trim();c!==o&&delete n[o],n[c]=fv(i),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return fe.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&fe.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
4
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[wA]=this[wA]={accessors:{}}).accessors,i=this.prototype;function o(a){const c=em(a);r[c]||(YG(i,a),r[c]=!0)}return fe.isArray(t)?t.forEach(o):o(t),this}};di.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);fe.reduceDescriptors(di.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});fe.freezeMethods(di);function Fw(e,t){const n=this||gp,r=t||n,i=di.from(r.headers);let o=r.data;return fe.forEach(e,function(c){o=c.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function gP(e){return!!(e&&e.__CANCEL__)}function $d(e,t,n){ft.call(this,e??"canceled",ft.ERR_CANCELED,t,n),this.name="CanceledError"}fe.inherits($d,ft,{__CANCEL__:!0});function vP(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ft("Request failed with status code "+n.status,[ft.ERR_BAD_REQUEST,ft.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function WG(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function XG(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,a;return t=t!==void 0?t:1e3,function(d){const f=Date.now(),p=r[o];a||(a=f),n[i]=d,r[i]=f;let h=o,v=0;for(;h!==i;)v+=n[h++],h=h%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),f-a<t)return;const y=p&&f-p;return y?Math.round(v*1e3/y):void 0}}function QG(e,t){let n=0,r=1e3/t,i,o;const a=(f,p=Date.now())=>{n=p,i=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const p=Date.now(),h=p-n;h>=r?a(f,p):(i=f,o||(o=setTimeout(()=>{o=null,a(i)},r-h)))},()=>i&&a(i)]}const Tv=(e,t,n=3)=>{let r=0;const i=XG(50,250);return QG(o=>{const a=o.loaded,c=o.lengthComputable?o.total:void 0,d=a-r,f=i(d),p=a<=c;r=a;const h={loaded:a,total:c,progress:c?a/c:void 0,bytes:d,rate:f||void 0,estimated:f&&c&&p?(c-a)/f:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(h)},n)},SA=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},_A=e=>(...t)=>fe.asap(()=>e(...t)),JG=Cr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Cr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Cr.origin),Cr.navigator&&/(msie|trident)/i.test(Cr.navigator.userAgent)):()=>!0,eK=Cr.hasStandardBrowserEnv?{write(e,t,n,r,i,o,a){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];fe.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),fe.isString(r)&&c.push(`path=${r}`),fe.isString(i)&&c.push(`domain=${i}`),o===!0&&c.push("secure"),fe.isString(a)&&c.push(`SameSite=${a}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function tK(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function nK(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function yP(e,t,n){let r=!tK(t);return e&&(r||n==!1)?nK(e,t):t}const CA=e=>e instanceof di?{...e}:e;function lc(e,t){t=t||{};const n={};function r(f,p,h,v){return fe.isPlainObject(f)&&fe.isPlainObject(p)?fe.merge.call({caseless:v},f,p):fe.isPlainObject(p)?fe.merge({},p):fe.isArray(p)?p.slice():p}function i(f,p,h,v){if(fe.isUndefined(p)){if(!fe.isUndefined(f))return r(void 0,f,h,v)}else return r(f,p,h,v)}function o(f,p){if(!fe.isUndefined(p))return r(void 0,p)}function a(f,p){if(fe.isUndefined(p)){if(!fe.isUndefined(f))return r(void 0,f)}else return r(void 0,p)}function c(f,p,h){if(h in t)return r(f,p);if(h in e)return r(void 0,f)}const d={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(f,p,h)=>i(CA(f),CA(p),h,!0)};return fe.forEach(Object.keys({...e,...t}),function(p){const h=d[p]||i,v=h(e[p],t[p],p);fe.isUndefined(v)&&h!==c||(n[p]=v)}),n}const bP=e=>{const t=lc({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:a,auth:c}=t;if(t.headers=a=di.from(a),t.url=mP(yP(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),fe.isFormData(n)){if(Cr.hasStandardBrowserEnv||Cr.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(fe.isFunction(n.getHeaders)){const d=n.getHeaders(),f=["content-type","content-length"];Object.entries(d).forEach(([p,h])=>{f.includes(p.toLowerCase())&&a.set(p,h)})}}if(Cr.hasStandardBrowserEnv&&(r&&fe.isFunction(r)&&(r=r(t)),r||r!==!1&&JG(t.url))){const d=i&&o&&eK.read(o);d&&a.set(i,d)}return t},rK=typeof XMLHttpRequest<"u",iK=rK&&function(e){return new Promise(function(n,r){const i=bP(e);let o=i.data;const a=di.from(i.headers).normalize();let{responseType:c,onUploadProgress:d,onDownloadProgress:f}=i,p,h,v,y,b;function S(){y&&y(),b&&b(),i.cancelToken&&i.cancelToken.unsubscribe(p),i.signal&&i.signal.removeEventListener("abort",p)}let C=new XMLHttpRequest;C.open(i.method.toUpperCase(),i.url,!0),C.timeout=i.timeout;function E(){if(!C)return;const j=di.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),A={data:!c||c==="text"||c==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:j,config:e,request:C};vP(function(T){n(T),S()},function(T){r(T),S()},A),C=null}"onloadend"in C?C.onloadend=E:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(E)},C.onabort=function(){C&&(r(new ft("Request aborted",ft.ECONNABORTED,e,C)),C=null)},C.onerror=function(I){const A=I&&I.message?I.message:"Network Error",N=new ft(A,ft.ERR_NETWORK,e,C);N.event=I||null,r(N),C=null},C.ontimeout=function(){let I=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const A=i.transitional||pP;i.timeoutErrorMessage&&(I=i.timeoutErrorMessage),r(new ft(I,A.clarifyTimeoutError?ft.ETIMEDOUT:ft.ECONNABORTED,e,C)),C=null},o===void 0&&a.setContentType(null),"setRequestHeader"in C&&fe.forEach(a.toJSON(),function(I,A){C.setRequestHeader(A,I)}),fe.isUndefined(i.withCredentials)||(C.withCredentials=!!i.withCredentials),c&&c!=="json"&&(C.responseType=i.responseType),f&&([v,b]=Tv(f,!0),C.addEventListener("progress",v)),d&&C.upload&&([h,y]=Tv(d),C.upload.addEventListener("progress",h),C.upload.addEventListener("loadend",y)),(i.cancelToken||i.signal)&&(p=j=>{C&&(r(!j||j.type?new $d(null,e,C):j),C.abort(),C=null)},i.cancelToken&&i.cancelToken.subscribe(p),i.signal&&(i.signal.aborted?p():i.signal.addEventListener("abort",p)));const k=WG(i.url);if(k&&Cr.protocols.indexOf(k)===-1){r(new ft("Unsupported protocol "+k+":",ft.ERR_BAD_REQUEST,e));return}C.send(o||null)})},oK=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const o=function(f){if(!i){i=!0,c();const p=f instanceof Error?f:this.reason;r.abort(p instanceof ft?p:new $d(p instanceof Error?p.message:p))}};let a=t&&setTimeout(()=>{a=null,o(new ft(`timeout ${t} of ms exceeded`,ft.ETIMEDOUT))},t);const c=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(o):f.removeEventListener("abort",o)}),e=null)};e.forEach(f=>f.addEventListener("abort",o));const{signal:d}=r;return d.unsubscribe=()=>fe.asap(c),d}},aK=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},sK=async function*(e,t){for await(const n of lK(e))yield*aK(n,t)},lK=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()}},EA=(e,t,n,r)=>{const i=sK(e,t);let o=0,a,c=d=>{a||(a=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:f,value:p}=await i.next();if(f){c(),d.close();return}let h=p.byteLength;if(n){let v=o+=h;n(v)}d.enqueue(new Uint8Array(p))}catch(f){throw c(f),f}},cancel(d){return c(d),i.return()}},{highWaterMark:2})},kA=64*1024,{isFunction:wg}=fe,cK=(({Request:e,Response:t})=>({Request:e,Response:t}))(fe.global),{ReadableStream:jA,TextEncoder:RA}=fe.global,IA=(e,...t)=>{try{return!!e(...t)}catch{return!1}},uK=e=>{e=fe.merge.call({skipUndefined:!0},cK,e);const{fetch:t,Request:n,Response:r}=e,i=t?wg(t):typeof fetch=="function",o=wg(n),a=wg(r);if(!i)return!1;const c=i&&wg(jA),d=i&&(typeof RA=="function"?(b=>S=>b.encode(S))(new RA):async b=>new Uint8Array(await new n(b).arrayBuffer())),f=o&&c&&IA(()=>{let b=!1;const S=new n(Cr.origin,{body:new jA,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!S}),p=a&&c&&IA(()=>fe.isReadableStream(new r("").body)),h={stream:p&&(b=>b.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!h[b]&&(h[b]=(S,C)=>{let E=S&&S[b];if(E)return E.call(S);throw new ft(`Response type '${b}' is not supported`,ft.ERR_NOT_SUPPORT,C)})});const v=async b=>{if(b==null)return 0;if(fe.isBlob(b))return b.size;if(fe.isSpecCompliantForm(b))return(await new n(Cr.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(fe.isArrayBufferView(b)||fe.isArrayBuffer(b))return b.byteLength;if(fe.isURLSearchParams(b)&&(b=b+""),fe.isString(b))return(await d(b)).byteLength},y=async(b,S)=>{const C=fe.toFiniteNumber(b.getContentLength());return C??v(S)};return async b=>{let{url:S,method:C,data:E,signal:k,cancelToken:j,timeout:I,onDownloadProgress:A,onUploadProgress:N,responseType:T,headers:z,withCredentials:L="same-origin",fetchOptions:G}=bP(b),J=t||fetch;T=T?(T+"").toLowerCase():"text";let Z=oK([k,j&&j.toAbortSignal()],I),W=null;const F=Z&&Z.unsubscribe&&(()=>{Z.unsubscribe()});let Y;try{if(N&&f&&C!=="get"&&C!=="head"&&(Y=await y(z,E))!==0){let M=new n(S,{method:"POST",body:E,duplex:"half"}),V;if(fe.isFormData(E)&&(V=M.headers.get("content-type"))&&z.setContentType(V),M.body){const[O,ee]=SA(Y,Tv(_A(N)));E=EA(M.body,kA,O,ee)}}fe.isString(L)||(L=L?"include":"omit");const P=o&&"credentials"in n.prototype,K={...G,signal:Z,method:C.toUpperCase(),headers:z.normalize().toJSON(),body:E,duplex:"half",credentials:P?L:void 0};W=o&&new n(S,K);let U=await(o?J(W,G):J(S,K));const te=p&&(T==="stream"||T==="response");if(p&&(A||te&&F)){const M={};["status","statusText","headers"].forEach(ue=>{M[ue]=U[ue]});const V=fe.toFiniteNumber(U.headers.get("content-length")),[O,ee]=A&&SA(V,Tv(_A(A),!0))||[];U=new r(EA(U.body,kA,O,()=>{ee&&ee(),F&&F()}),M)}T=T||"text";let D=await h[fe.findKey(h,T)||"text"](U,b);return!te&&F&&F(),await new Promise((M,V)=>{vP(M,V,{data:D,headers:di.from(U.headers),status:U.status,statusText:U.statusText,config:b,request:W})})}catch(P){throw F&&F(),P&&P.name==="TypeError"&&/Load failed|fetch/i.test(P.message)?Object.assign(new ft("Network Error",ft.ERR_NETWORK,b,W),{cause:P.cause||P}):ft.from(P,P&&P.code,b,W)}}},dK=new Map,xP=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let a=o.length,c=a,d,f,p=dK;for(;c--;)d=o[c],f=p.get(d),f===void 0&&p.set(d,f=c?new Map:uK(t)),p=f;return f};xP();const yC={http:RG,xhr:iK,fetch:{get:xP}};fe.forEach(yC,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const NA=e=>`- ${e}`,fK=e=>fe.isFunction(e)||e===null||e===!1;function mK(e,t){e=fe.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let a=0;a<n;a++){r=e[a];let c;if(i=r,!fK(r)&&(i=yC[(c=String(r)).toLowerCase()],i===void 0))throw new ft(`Unknown adapter '${c}'`);if(i&&(fe.isFunction(i)||(i=i.get(t))))break;o[c||"#"+a]=i}if(!i){const a=Object.entries(o).map(([d,f])=>`adapter ${d} `+(f===!1?"is not supported by the environment":"is not available in the build"));let c=n?a.length>1?`since :
@@ -35,7 +35,7 @@ ${h}`,b=>{n.notifyAfterAddMessage(b-v)})}function c(h){return h!==void 0&&i[h]!=
35
35
  `);i={};const y=Rte(h.reason),b=y?t.sendOnExit:t.send;if(y&&e.isAsync){const S=e.finishSync();S.outputBytesCount&&b(OO(S));const C=[S.pendingData,v].filter(Boolean).join(`
36
36
  `);C&&b({data:C,bytesCount:GM(C)})}else v&&e.write(e.isEmpty?v:`
37
37
  ${v}`),e.finish(S=>{b(OO(S))})}return{flushController:n,add:f,upsert:f,stop:o.unsubscribe}}function OO(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}}function Pz({messagesLimit:e,bytesLimit:t,durationLimit:n,pageMayExitObservable:r,sessionExpireObservable:i}){const o=r.subscribe(b=>p(b.reason)),a=i.subscribe(()=>p("session_expire")),c=new At(()=>()=>{o.unsubscribe(),a.unsubscribe()});let d=0,f=0;function p(b){if(f===0)return;const S=f,C=d;f=0,d=0,y(),c.notify({reason:b,messagesCount:S,bytesCount:C})}let h;function v(){h===void 0&&(h=kr(()=>{p("duration_limit")},n))}function y(){io(h),h=void 0}return{flushObservable:c,get messagesCount(){return f},notifyBeforeAddMessage(b){d+b>=t&&p("bytes_limit"),f+=1,d+=b,v()},notifyAfterAddMessage(b=0){d+=b,f>=e?p("messages_limit"):d>=t&&p("bytes_limit")},notifyAfterRemoveMessage(b){d-=b,f-=1,f===0&&y()}}}const nl="DISCARDED",Di="SKIPPED";function Ite(){const e={};return{register(t,n){return e[t]||(e[t]=[]),e[t].push(n),{unregister:()=>{e[t]=e[t].filter(r=>r!==n)}}},triggerHook(t,n){const r=e[t]||[],i=[];for(const o of r){const a=o(n);if(a===nl)return nl;a!==Di&&i.push(a)}return Ka(...i)}}}const Ws={LOG:"log",CONFIGURATION:"configuration",USAGE:"usage"},Nte=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],Tte=1,Ate=[mee];let uS;function Hd(){return uS||(uS=new XM(100)),uS}function Ote(e,t,n,r,i,o){const a=new At,{stop:c}=$te(t,r,i,o,a),{enabled:d,metricsEnabled:f}=Dte(e,t,n,a);return{stop:c,enabled:d,metricsEnabled:f}}function Dte(e,t,n,r,i=Tte){const o={},a=!Ate.includes(t.site)&&Zl(t.telemetrySampleRate),c={[Ws.LOG]:a,[Ws.CONFIGURATION]:a&&Zl(t.telemetryConfigurationSampleRate),[Ws.USAGE]:a&&Zl(t.telemetryUsageSampleRate),metric:a&&Zl(i)},d=Pte(),f=Hd();return f.subscribe(({rawEvent:h,metricName:v})=>{if(v&&!c.metric||!c[h.type])return;const y=v||h.status||h.type;let b=o[y];if(b||(b=o[y]=new Set),b.size>=t.maxTelemetryEventsPerPage)return;const S=kp(h);if(b.has(S))return;const C=n.triggerHook(1,{startTime:ir().relative});if(C===nl)return;const E=p(C,e,h,d);r.notify(E),Cz("telemetry",E),b.add(S)}),f.unbuffer(),SJ(ZC),{enabled:a,metricsEnabled:c.metric};function p(h,v,y,b){const C={type:"telemetry",date:ir().timeStamp,service:v,version:"6.24.0",source:"browser",_dd:{format_version:2},telemetry:Ka(y,{runtime_env:b,connectivity:Ez(),sdk_setup:"npm"}),ddtags:_z(t).join(","),experimental_features:Array.from(Ree())};return Ka(C,h)}}function $te(e,t,n,r,i){const o=[];if(yd()){const a=jp(),c=i.subscribe(d=>a.send("internal_telemetry",d));o.push(c.unsubscribe)}else{const a=[e.rumEndpointBuilder];e.replica&&Mte(e)&&a.push(e.replica.rumEndpointBuilder);const c=$z({encoder:r(4),request:Oz(a,e.batchBytesLimit,t),flushController:Pz({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageMayExitObservable:n,sessionExpireObservable:new At}),messageBytesLimit:e.messageBytesLimit});o.push(c.stop);const d=i.subscribe(c.add);o.push(d.unsubscribe)}return{stop:()=>o.forEach(a=>a())}}function Pte(){var e;return{is_local_file:((e=la.location)===null||e===void 0?void 0:e.protocol)==="file:",is_worker:Hv}}function Mte(e){return e.site===pz}function Rp(e,t){W_(Wy.debug,e,t),Hd().notify({rawEvent:{type:Ws.LOG,message:e,status:"debug",...t}})}function ZC(e,t){Hd().notify({rawEvent:{type:Ws.LOG,status:"error",...Lte(e),...t}})}function zte(e){Hd().notify({rawEvent:{type:Ws.CONFIGURATION,configuration:e}})}function ab(e,t){Hd().notify({rawEvent:{type:Ws.LOG,message:e,status:"debug",...t},metricName:e})}function cr(e){Hd().notify({rawEvent:{type:Ws.USAGE,usage:e}})}function Lte(e){if(Rc(e)){const t=Cp(e);return{error:{kind:t.name,stack:Ep(Ute(t))},message:t.message}}return{error:{stack:bz},message:`Uncaught ${kp(e)}`}}function Ute(e){return e.stack=e.stack.filter(t=>!t.url||Nte.some(n=>t.url.startsWith(n))),e}function Mz(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}function oc(e){return Array.isArray(e)&&e.length>0}const Dg=1/0,Fte=Br;let lm=null;const bv=new Set;function Vte(){bv.forEach(e=>e())}function qd({expireDelay:e,maxEntries:t}){let n=[];lm||(lm=Vd(()=>Vte(),Fte));const r=()=>{const p=Oi()-e;for(;n.length>0&&n[n.length-1].endTime<p;)n.pop()};bv.add(r);function i(p,h){const v={value:p,startTime:h,endTime:Dg,remove:()=>{Mz(n,v)},close:y=>{v.endTime=y}};return t&&n.length>=t&&n.pop(),n.unshift(v),v}function o(p=Dg,h={returnInactive:!1}){for(const v of n)if(v.startTime<=p){if(h.returnInactive||p<=v.endTime)return v.value;break}}function a(p){const h=n[0];h&&h.endTime===Dg&&h.close(p)}function c(p=Dg,h=0){const v=Fd(p,h);return n.filter(y=>y.startTime<=v&&p<=y.endTime).map(y=>y.value)}function d(){n=[]}function f(){bv.delete(r),bv.size===0&&lm&&(Jy(lm),lm=null)}return{add:i,find:o,closeActive:a,findAll:c,reset:d,stop:f}}const Bte="datadog-synthetics-public-id",Hte="datadog-synthetics-result-id",qte="datadog-synthetics-injects-rum";function zz(){return Hv?!1:!!(la._DATADOG_SYNTHETICS_INJECTS_RUM||zs(qte))}function Lz(){const e=window._DATADOG_SYNTHETICS_PUBLIC_ID||zs(Bte);return typeof e=="string"?e:void 0}function Uz(){const e=window._DATADOG_SYNTHETICS_RESULT_ID||zs(Hte);return typeof e=="string"?e:void 0}function Fz(){return!!(Lz()&&Uz())}const Gte=Br,Kte=kc;function Zte(e,t,n,r){const i=new At,o=new At,a=iee(e.sessionStoreStrategyType,e,t,n),c=qd({expireDelay:Kte});if(a.renewObservable.subscribe(()=>{c.add(d(),Oi()),i.notify()}),a.expireObservable.subscribe(()=>{o.notify(),c.closeActive(Oi())}),a.expandOrRenewSession(),c.add(d(),HM().relative),_p(el.SHORT_SESSION_INVESTIGATION)){const f=a.getSession();f&&Jte(e,f)}r.observable.subscribe(()=>{r.isGranted()?a.expandOrRenewSession():a.expire(!1)}),Yte(e,()=>{r.isGranted()&&a.expandOrRenewSession()}),Wte(e,()=>a.expandSession()),Xte(e,()=>a.restartSession());function d(){const f=a.getSession();return f?{id:f.id,trackingType:f[t],isReplayForced:!!f.forcedReplay,anonymousId:f.anonymousId}:(Qte(e).catch(()=>{}),{id:"invalid",trackingType:iz,isReplayForced:!1,anonymousId:void 0})}return{findSession:(f,p)=>c.find(f,p),renewObservable:i,expireObservable:o,sessionStateUpdateObservable:a.sessionStateUpdateObservable,expire:a.expire,updateSessionState:a.updateSessionState}}function Yte(e,t){const{stop:n}=tl(e,window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0})}function Wte(e,t){const n=()=>{document.visibilityState==="visible"&&t()},{stop:r}=Cn(e,document,"visibilitychange",n);Vd(n,Gte)}function Xte(e,t){const{stop:n}=Cn(e,window,"resume",t,{capture:!0})}async function Qte(e){const t=e.sessionStoreStrategyType;if(!t)return;let n,r;t.type===hd.COOKIE?(n=lz(t.cookieOptions,e),r={cookie:await Vz(),currentDomain:`${window.location.protocol}//${window.location.hostname}`}):n=dz(),Rp("Unexpected session state",{sessionStoreStrategyType:t.type,session:n,isSyntheticsTest:Fz(),createdTimestamp:n?.created,expireTimestamp:n?.expire,...r})}function Jte(e,t){if(!window.cookieStore||!t.created)return;const n=Number(t.created),r=Fr(),{stop:i}=Cn(e,cookieStore,"change",o);function o(a){const c=tz(a.changed,f=>f.name===Ga);if(!c)return;const d=Fr()-n;if(d>14*Br)i();else{const f=ib(c.value);if(f.id&&f.id!==t.id){i();const p=Fr()-r;Vz().then(h=>{Rp("Session cookie changed",{time:p,session_age:d,old:t,new:f,cookie:h})}).catch(Js)}}}}async function Vz(){let e;return"cookieStore"in window?e=await window.cookieStore.getAll(Ga):e=document.cookie.split(/\s*;\s*/).filter(t=>t.startsWith(Ga)),{count:e.length,domain:ez()||"undefined",...e}}function ene(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(n,r){const i=GM(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 tne{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)}}}}function dS(e,t,n){let r=0,i=!1;return{isLimitReached(){if(r===0&&kr(()=>{r=0},Br),r+=1,r<=t||i)return i=!1,!1;if(r===t+1){i=!0;try{n({message:`Reached max number of ${e}s by minute: ${t}`,source:Bd.AGENT,startClocks:ir()})}finally{i=!1}}return!0}}}function YC(e,t,n){return document.readyState===t||document.readyState==="complete"?(n(),{stop:Ht}):Cn(e,window,t==="complete"?"load":"DOMContentLoaded",n,{once:!0})}function nne(e,t){return new Promise(n=>{YC(e,t,n)})}let fS;const WC=new WeakMap;function rne(e){return fS||(fS=ine(e)),fS}function ine(e){return new At(t=>{const{stop:n}=ra(XMLHttpRequest.prototype,"open",one),{stop:r}=ra(XMLHttpRequest.prototype,"send",o=>{ane(o,e,t)},{computeHandlingStack:!0}),{stop:i}=ra(XMLHttpRequest.prototype,"abort",sne);return()=>{n(),r(),i()}})}function one({target:e,parameters:[t,n]}){WC.set(e,{state:"open",method:String(t).toUpperCase(),url:VC(String(n))})}function ane({target:e,parameters:[t],handlingStack:n},r,i){const o=WC.get(e);if(!o)return;const a=o;a.state="start",a.startClocks=ir(),a.isAborted=!1,a.xhr=e,a.handlingStack=n,a.requestBody=t;let c=!1;const{stop:d}=ra(e,"onreadystatechange",()=>{e.readyState===XMLHttpRequest.DONE&&f()}),f=()=>{if(p(),d(),c)return;c=!0;const h=o;h.state="complete",h.duration=Mn(a.startClocks.timeStamp,vr()),h.status=e.status,typeof e.response=="string"&&(h.responseBody=e.response),i.notify(Zm(h))},{stop:p}=Cn(r,e,"loadend",f);i.notify(a)}function sne({target:e}){const t=WC.get(e);t&&(t.isAborted=!0)}async function lne(e,t){const n=e.getReader(),r=[];for(;;){const i=await n.read();if(i.done)break;t.collectStreamBody&&r.push(i.value)}return n.cancel().catch(Ht),t.collectStreamBody?KM(r):void 0}let mS;const Bz=[];function Hz({responseBodyAction:e}={}){return e&&Bz.push(e),mS||(mS=cne()),mS}function cne(){return new At(e=>{if(!la.fetch)return;const{stop:t}=ra(la,"fetch",n=>une(n,e),{computeHandlingStack:!0});return t})}function une({parameters:e,onPostCall:t,handlingStack:n},r){const[i,o]=e;let a=o&&o.method;a===void 0&&i instanceof Request&&(a=i.method);const c=a!==void 0?String(a).toUpperCase():"GET",d=i instanceof Request?i.url:VC(String(i)),f=ir(),p={state:"start",init:o,input:i,method:c,startClocks:f,url:d,handlingStack:n};r.notify(p),e[0]=p.input,e[1]=p.init,t(h=>{dne(r,h,p).catch(Js)})}async function dne(e,t,n){var r,i;const o=n;o.state="resolve";let a;try{a=await t}catch(d){o.status=0,o.isAborted=((i=(r=o.init)===null||r===void 0?void 0:r.signal)===null||i===void 0?void 0:i.aborted)||d instanceof DOMException&&d.code===DOMException.ABORT_ERR,o.error=d,e.notify(o);return}o.response=a,o.status=a.status,o.responseType=a.type,o.isAborted=!1;const c=Bz.reduce((d,f)=>Math.max(d,f(o)),0);if(c!==0){const d=hte(a);if(d&&d.body)try{const f=await lne(d.body,{collectStreamBody:c===2});o.responseBody=f&&new TextDecoder().decode(f)}catch{}}e.notify(o)}function fne(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){const n=window.requestIdleCallback(bt(e),t);return()=>window.cancelIdleCallback(n)}return pne(e)}const mne=50;function pne(e){const t=Fr(),n=kr(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,mne-(Fr()-t))})},0);return()=>io(n)}const hne=Nr,gne=30;function vne(){const e=[];function t(r){let i;if(r.didTimeout){const o=performance.now();i=()=>gne-(performance.now()-o)}else i=r.timeRemaining.bind(r);for(;i()>0&&e.length;)e.shift()();e.length&&n()}function n(){fne(t,{timeout:hne})}return{push(r){e.push(r)===1&&n()},stop(){e.length=0}}}let pS={};function yne(e){const t=e.map(n=>(pS[n]||(pS[n]=bne(n)),pS[n]));return WM(...t)}function bne(e){return new At(t=>{const n=za[e];return za[e]=(...r)=>{n.apply(console,r);const i=Xm("console error");Ys(()=>{t.notify(xne(r,e,i))})},()=>{za[e]=n}})}function xne(e,t,n){const r=e.map(i=>wne(i)).join(" ");if(t===Wy.error){const i=e.find(Rc),o=GC({originalError:i,handlingStack:n,startClocks:ir(),source:Bd.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 wne(e){return typeof e=="string"?fn(e):Rc(e)?yz(Cp(e)):kp(fn(e),void 0,2)}const Sne=500;function _ne(){const e=[];return{add:i=>{e.push(i)>Sne&&e.splice(0,1)},remove:i=>{Mz(e,i)},drain:i=>{e.forEach(o=>o(i)),e.length=0}}}function Cne(e){const t=jc(e)==="object";return t||mt.error("Unsupported context:",e),t}function hS(e,t,n){const r={...e};for(const[i,{required:o,type:a}]of Object.entries(t))a==="string"&&!DO(r[i])&&(r[i]=String(r[i])),o&&DO(r[i])&&mt.warn(`The property ${i} of ${n} is required; context will not be sent to the intake.`);return r}function DO(e){return e==null||e===""}function sb(e="",{propertiesConfig:t={}}={}){let n={};const r=new At,i={getContext:()=>KC(n),setContext:o=>{Cne(o)?n=fn(hS(o,t,e)):i.clearContext(),r.notify()},setContextProperty:(o,a)=>{n=fn(hS({...n,[o]:a},t,e)),r.notify()},removeContextProperty:o=>{delete n[o],hS(n,t,e),r.notify()},clearContext:()=>{n={},r.notify()},changeObservable:r};return i}function Or(e,t,n,r){return bt((...i)=>(r&&cr({feature:r}),e()[t][n](...i)))}const Ene="_dd_c",kne=[];function XC(e,t,n,r){const i=jne(n,r);kne.push(Cn(e,window,"storage",({key:f})=>{i===f&&a()})),t.changeObservable.subscribe(c);const o=Ka(d(),t.getContext());fl(o)||t.setContext(o);function a(){t.setContext(d())}function c(){localStorage.setItem(i,JSON.stringify(t.getContext()))}function d(){const f=localStorage.getItem(i);return f?JSON.parse(f):{}}}function jne(e,t){return`${Ene}_${e}_${t}`}function Rne(e,t,n){const r=qz();return t.storeContextsAcrossPages&&XC(t,r,n,4),e.register(0,()=>{const i=r.getContext();return fl(i)||!i.id?Di:{account:i}}),r}function qz(){return sb("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function Ine(e,t,n,r){const i=Gz();return t.storeContextsAcrossPages&&XC(t,i,n,2),e.register(0,()=>({context:i.getContext()})),i}function Gz(){return sb("global context")}function Nne(e,t,n,r){const i=Kz();return t.storeContextsAcrossPages&&XC(t,i,r,1),e.register(0,({eventType:o,startTime:a})=>{const c=i.getContext(),d=n.findTrackedSession(a);return d&&d.anonymousId&&!c.anonymous_id&&t.trackAnonymousUser&&(c.anonymous_id=d.anonymousId),fl(c)?Di:{type:o,usr:c}}),e.register(1,({startTime:o})=>{var a;return{anonymous_id:(a=n.findTrackedSession(o))===null||a===void 0?void 0:a.anonymousId}}),i}function Kz(){return sb("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}const ur={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},Dr={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"},Mr={DOCUMENT:"document",XHR:"xhr",BEACON:"beacon",FETCH:"fetch",CSS:"css",JS:"js",IMAGE:"image",FONT:"font",MEDIA:"media",OTHER:"other"},lb={FETCH:Mr.FETCH,XHR:Mr.XHR},Tne=500;function Ane(e=Jee){const t=new XM(Tne),n=e().subscribe(r=>{t.notify({type:0,error:r})});return{observable:t,stop:()=>{n.unsubscribe()}}}function One(){try{return new Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const vt={ACTION:"action",ERROR:"error",LONG_TASK:"long_task",VIEW:"view",RESOURCE:"resource",VITAL:"vital"},Zz={LONG_TASK:"long-task",LONG_ANIMATION_FRAME:"long-animation-frame"},La={INITIAL_LOAD:"initial_load",ROUTE_CHANGE:"route_change",BF_CACHE:"bf_cache"},QC={CLICK:"click",CUSTOM:"custom"},cm={RAGE_CLICK:"rage_click",ERROR_CLICK:"error_click",DEAD_CLICK:"dead_click"},Jm={DURATION:"duration",OPERATION_STEP:"operation_step"};function Dne(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}function $ne(e,t,n){function r(a){return!t.wasInPageStateDuringPeriod("frozen",a.startClocks.relative,a.duration)}function i(a){r(a)&&e.notify(12,$O(a))}function o(a,c,d,f){if(!_p(el.FEATURE_OPERATION_VITAL))return;const{operationKey:p,context:h,description:v}=d||{},y={name:a,type:Jm.OPERATION_STEP,operationKey:p,failureReason:f,stepType:c,startClocks:ir(),context:fn(h),description:v};e.notify(12,$O(y))}return{addOperationStepVital:o,addDurationVital:i,startDurationVital:(a,c={})=>Yz(n,a,c),stopDurationVital:(a,c={})=>{Wz(i,n,a,c)}}}function Yz({vitalsByName:e,vitalsByReference:t},n,r={}){const i={name:n,startClocks:ir(),...r},o={__dd_vital_reference:!0};return e.set(n,i),t.set(o,i),o}function Wz(e,{vitalsByName:t,vitalsByReference:n},r,i={}){const o=typeof r=="string"?t.get(r):n.get(r);o&&(e(Pne(o,o.startClocks,i,ir())),typeof r=="string"?t.delete(r):n.delete(r))}function Pne(e,t,n,r){var i;return{name:e.name,type:Jm.DURATION,startClocks:t,duration:Mn(t.timeStamp,r.timeStamp),context:Ka(e.context,n.context),description:(i=n.description)!==null&&i!==void 0?i:e.description}}function $O(e){const{startClocks:t,type:n,name:r,description:i,context:o}=e,a={id:Rr(),type:n,name:r,description:i,...n===Jm.DURATION?{duration:gt(e.duration)}:{step_type:e.stepType,operation_key:e.operationKey,failure_reason:e.failureReason}};return{rawRumEvent:{date:t.timeStamp,vital:a,type:vt.VITAL,context:o},startTime:t.relative,duration:n===Jm.DURATION?e.duration:void 0,domainContext:{}}}function Xz(e,t,n){if(e)for(const r of e){const i=r[t];i&&i(n)}}const PO=new Map;function Qz(e,t){if(t===100)return!0;if(t===0)return!1;const n=PO.get(t);if(n&&e===n.sessionId)return n.decision;let r;return window.BigInt?r=Mne(BigInt(`0x${e.split("-")[4]}`),t):r=Zl(t),PO.set(t,{sessionId:e,decision:r}),r}function Mne(e,t){const n=BigInt("1111111111111111111"),r=BigInt("0x10000000000000000"),i=e*n%r;return Number(i)<=t/100*Number(r)}function zne(){return e4(64)}function Jz(){return e4(63)}function e4(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 Tu(e){return e.toString(16).padStart(16,"0")}function Lne(e){const t=e;return jc(t)==="object"&&Wm(t.match)&&Array.isArray(t.propagatorTypes)}function Une(e){e.status===0&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function Fne(e,t,n,r){return{clearTracingIfNeeded:Une,traceFetch:i=>MO(e,i,t,n,r,o=>{var a;if(i.input instanceof Request&&!(!((a=i.init)===null||a===void 0)&&a.headers))i.input=new Request(i.input),Object.keys(o).forEach(c=>{i.input.headers.append(c,o[c])});else{i.init=Zm(i.init);const c=[];i.init.headers instanceof Headers?i.init.headers.forEach((d,f)=>{c.push([f,d])}):Array.isArray(i.init.headers)?i.init.headers.forEach(d=>{c.push(d)}):i.init.headers&&Object.keys(i.init.headers).forEach(d=>{c.push([d,i.init.headers[d]])}),i.init.headers=c.concat(BC(o))}}),traceXhr:(i,o)=>MO(e,i,t,n,r,a=>{Object.keys(a).forEach(c=>{o.setRequestHeader(c,a[c])})})}}function MO(e,t,n,r,i,o){const a=n.findTrackedSession();if(!a)return;const c=e.allowedTracingUrls.find(p=>ob([p.match],t.url,!0));if(!c)return;const d=Qz(a.id,e.traceSampleRate);(d||e.traceContextInjection===J_.ALL)&&(t.traceSampled=d,t.traceId=zne(),t.spanId=Jz(),o(Vne(t.traceId,t.spanId,t.traceSampled,a.id,c.propagatorTypes,r,i,e)))}function Vne(e,t,n,r,i,o,a,c){const d={};if(i.forEach(f=>{switch(f){case"datadog":{Object.assign(d,{"x-datadog-origin":"rum","x-datadog-parent-id":t.toString(),"x-datadog-sampling-priority":n?"1":"0","x-datadog-trace-id":e.toString()});break}case"tracecontext":{Object.assign(d,{traceparent:`00-0000000000000000${Tu(e)}-${Tu(t)}-0${n?"1":"0"}`,tracestate:`dd=s:${n?"1":"0"};o:rum`});break}case"b3":{Object.assign(d,{b3:`${Tu(e)}-${Tu(t)}-${n?"1":"0"}`});break}case"b3multi":{Object.assign(d,{"X-B3-TraceId":Tu(e),"X-B3-SpanId":Tu(t),"X-B3-Sampled":n?"1":"0"});break}}}),c.propagateTraceBaggage){const f={"session.id":r},p=o.getContext().id;typeof p=="string"&&(f["user.id"]=p);const h=a.getContext().id;typeof h=="string"&&(f["account.id"]=h);const v=Object.entries(f).map(([y,b])=>`${y}=${encodeURIComponent(b)}`).join(",");v&&(d.baggage=v)}return d}const t4=["tracecontext","datadog"];function Bne(e,t){var n,r,i,o,a,c,d;if(e.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(e.trackFeatureFlagsForEvents)&&mt.warn("trackFeatureFlagsForEvents should be an array"),!e.applicationId){mt.error("Application ID is not configured, no RUM data will be collected.");return}if(!Gu(e.sessionReplaySampleRate,"Session Replay")||!Gu(e.traceSampleRate,"Trace"))return;if(e.excludedActivityUrls!==void 0&&!Array.isArray(e.excludedActivityUrls)){mt.error("Excluded Activity Urls should be an array");return}const f=Hne(e);if(!f)return;const p=Cee(e,t),h=Gne(e);if(!p)return;const v=(n=e.sessionReplaySampleRate)!==null&&n!==void 0?n:0;return{applicationId:e.applicationId,actionNameAttribute:e.actionNameAttribute,sessionReplaySampleRate:v,startSessionReplayRecordingManually:e.startSessionReplayRecordingManually!==void 0?!!e.startSessionReplayRecordingManually:v===0,traceSampleRate:(r=e.traceSampleRate)!==null&&r!==void 0?r:100,rulePsr:wp(e.traceSampleRate)?e.traceSampleRate/100:void 0,allowedTracingUrls:f,excludedActivityUrls:(i=e.excludedActivityUrls)!==null&&i!==void 0?i:[],workerUrl:e.workerUrl,compressIntakeRequests:!!e.compressIntakeRequests,trackUserInteractions:!!(!((o=e.trackUserInteractions)!==null&&o!==void 0)||o),trackViewsManually:!!e.trackViewsManually,trackResources:!!(!((a=e.trackResources)!==null&&a!==void 0)||a),trackLongTasks:!!(!((c=e.trackLongTasks)!==null&&c!==void 0)||c),trackBfcacheViews:!!e.trackBfcacheViews,trackEarlyRequests:!!e.trackEarlyRequests,subdomain:e.subdomain,defaultPrivacyLevel:Bv(qu,e.defaultPrivacyLevel)?e.defaultPrivacyLevel:qu.MASK,enablePrivacyForActionName:!!e.enablePrivacyForActionName,traceContextInjection:Bv(J_,e.traceContextInjection)?e.traceContextInjection:J_.SAMPLED,plugins:e.plugins||[],trackFeatureFlagsForEvents:e.trackFeatureFlagsForEvents||[],profilingSampleRate:(d=e.profilingSampleRate)!==null&&d!==void 0?d:0,propagateTraceBaggage:!!e.propagateTraceBaggage,allowedGraphQlUrls:h,...p}}function Hne(e){if(e.allowedTracingUrls===void 0)return[];if(!Array.isArray(e.allowedTracingUrls)){mt.error("Allowed Tracing URLs should be an array");return}if(e.allowedTracingUrls.length!==0&&e.service===void 0){mt.error("Service needs to be configured when tracing is enabled");return}const t=[];return e.allowedTracingUrls.forEach(n=>{Wm(n)?t.push({match:n,propagatorTypes:t4}):Lne(n)?t.push(n):mt.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",n)}),t}function qne(e){const t=new Set;return oc(e.allowedTracingUrls)&&e.allowedTracingUrls.forEach(n=>{Wm(n)?t4.forEach(r=>t.add(r)):jc(n)==="object"&&Array.isArray(n.propagatorTypes)&&n.propagatorTypes.forEach(r=>t.add(r))}),Array.from(t)}function Gne(e){if(!e.allowedGraphQlUrls)return[];if(!Array.isArray(e.allowedGraphQlUrls))return mt.warn("allowedGraphQlUrls should be an array"),[];const t=[];return e.allowedGraphQlUrls.forEach(n=>{Wm(n)?t.push({match:n,trackPayload:!1,trackResponseErrors:!1}):n&&typeof n=="object"&&"match"in n&&Wm(n.match)&&t.push({match:n.match,trackPayload:!!n.trackPayload,trackResponseErrors:!!n.trackResponseErrors})}),t}function Kne(e){return oc(e)&&e.some(t=>typeof t=="object"&&"trackPayload"in t?!!t.trackPayload:!1)}function Zne(e){return oc(e)&&e.some(t=>typeof t=="object"&&"trackResponseErrors"in t?!!t.trackResponseErrors:!1)}function Yne(e){var t;const n=Eee(e);return{session_replay_sample_rate:e.sessionReplaySampleRate,start_session_replay_recording_manually:e.startSessionReplayRecordingManually,trace_sample_rate:e.traceSampleRate,trace_context_injection:e.traceContextInjection,propagate_trace_baggage:e.propagateTraceBaggage,action_name_attribute:e.actionNameAttribute,use_allowed_tracing_urls:oc(e.allowedTracingUrls),use_allowed_graph_ql_urls:oc(e.allowedGraphQlUrls),use_track_graph_ql_payload:Kne(e.allowedGraphQlUrls),use_track_graph_ql_response_errors:Zne(e.allowedGraphQlUrls),selected_tracing_propagators:qne(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:oc(e.excludedActivityUrls),use_worker_url:!!e.workerUrl,compress_intake_requests:e.compressIntakeRequests,track_views_manually:e.trackViewsManually,track_user_interactions:e.trackUserInteractions,track_resources:e.trackResources,track_long_task:e.trackLongTasks,track_bfcache_views:e.trackBfcacheViews,track_early_requests:e.trackEarlyRequests,plugins:(t=e.plugins)===null||t===void 0?void 0:t.map(r=>{var i;return{name:r.name,...(i=r.getConfigurationTelemetry)===null||i===void 0?void 0:i.call(r)}}),track_feature_flags_for_events:e.trackFeatureFlagsForEvents,remote_configuration_id:e.remoteConfigurationId,profiling_sample_rate:e.profilingSampleRate,use_remote_configuration_proxy:!!e.remoteConfigurationProxy,...n}}function Wne(e){const t=[];let n=0,r;const i={quote:void 0,escapeSequence:void 0};let o="";for(const a of e){if(r=zO[n].find(c=>nre[c](a,i)),!r)return[];if(i.escapeSequence!==void 0&&r!==12){if(!ore(i.escapeSequence))return[];o+=sre(i.escapeSequence),i.escapeSequence=void 0}rre.includes(r)?o+=a:ire.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 zO[n].includes(1)?(o!==""&&t.push(o),t):[]}const Xne=/[a-zA-Z_$]/,Qne=/[a-zA-Z0-9_$]/,Jne=/[0-9]/,ere=/[a-fA-F0-9]/,tre=`'"`,nre={0:()=>!1,1:()=>!1,2:e=>Xne.test(e),3:e=>Qne.test(e),4:e=>e===".",5:e=>e==="[",6:e=>e==="]",7:e=>Jne.test(e),8:e=>tre.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?ere.test(e):!1},zO={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]},rre=[2,3,7,10],ire=[4,5,6];function ore(e){return`"'/\\bfnrt`.includes(e)||e.startsWith("u")&&e.length===5}const are={'"':'"',"'":"'","/":"/","\\":"\\",b:"\b",f:"\f",n:`
38
- `,r:"\r",t:" "};function sre(e){return e.startsWith("u")?String.fromCharCode(parseInt(e.slice(1),16)):are[e]}const lre="v1",cre=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function ure(e,t){let n;const r=fre(),i=await gre(e);return i.ok?(r.increment("fetch","success"),n=dre(e,i.value,t,r)):(r.increment("fetch","failure"),mt.error(i.error)),ab("remote configuration metrics",{metrics:r.get()}),n}function dre(e,t,n,r){const i={...e};return cre.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(mre(v)){if(pre(v)){const y=v.rcSerializedType;switch(y){case"string":return v.value;case"regex":return n4(v.value);case"dynamic":return c(v);default:mt.error(`Unsupported remote configuration: "rcSerializedType": "${y}"`);return}}return ZM(v,o)}return v}function a(v,y){y.forEach(({key:b,value:S})=>{v.setContextProperty(b,o(S))})}function c(v){const y=v.strategy;let b;switch(y){case"cookie":b=d(v);break;case"dom":b=f(v);break;case"js":b=h(v);break;default:mt.error(`Unsupported remote configuration: "strategy": "${y}"`);return}const S=v.extractor;return S!==void 0&&typeof b=="string"?hre(S,b):b}function d({name:v}){const y=rb(v);return r.increment("cookie",y!==void 0?"success":"missing"),y}function f({selector:v,attribute:y}){let b;try{b=document.querySelector(v)}catch{mt.error(`Invalid selector in the remote configuration: '${v}'`),r.increment("dom","failure");return}if(!b){r.increment("dom","missing");return}if(p(b,y)){mt.error(`Forbidden element selected by the remote configuration: '${v}'`),r.increment("dom","failure");return}const S=y!==void 0?b.getAttribute(y):b.textContent;if(S===null){r.increment("dom","missing");return}return r.increment("dom","success"),S}function p(v,y){return v.getAttribute("type")==="password"&&y==="value"}function h({path:v}){let y=window;const b=Wne(v);if(b.length===0){mt.error(`Invalid JSON path in the remote configuration: '${v}'`),r.increment("js","failure");return}for(const S of b){if(!(S in y)){r.increment("js","missing");return}try{y=y[S]}catch(C){mt.error(`Error accessing: '${v}'`,C),r.increment("js","failure");return}}return r.increment("js","success"),y}}function fre(){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 mre(e){return typeof e=="object"&&e!==null}function pre(e){return"rcSerializedType"in e}function n4(e){try{return new RegExp(e)}catch{mt.error(`Invalid regex in the remote configuration: '${e}'`)}}function hre(e,t){const n=n4(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 gre(e){let t;try{t=await fetch(vre(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 vre(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${hz("rum",e)}/${lre}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function yre({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},n,r,i){const o=_ne(),a=Gz();gS(a,ur.globalContext,o);const c=Kz();gS(c,ur.userContext,o);const d=qz();gS(d,ur.accountContext,o);let f,p,h,v;const y=n.observable.subscribe(S),b={};function S(){if(!h||!v||!n.isGranted())return;y.unsubscribe();let I;if(v.trackViewsManually){if(!f)return;o.remove(f.callback),I=f.options}const A=i(v,p,I);o.drain(A)}function C(I,A){const N=yd();if(N&&(I=bre(I)),h=I,zte(Yne(I)),v){xz("DD_RUM",I);return}const T=Bne(I,A);if(T){if(!N&&!T.sessionStoreStrategyType){mt.warn("No storage available for session. We will not send any data.");return}T.compressIntakeRequests&&!N&&t&&(p=t(T,"Datadog RUM",Ht),!p)||(v=T,Hz().subscribe(Ht),n.tryToInit(T.trackingConsent),S())}}const E=I=>{o.add(A=>A.addDurationVital(I))};return{init(I,A,N){if(!I){mt.error("Missing configuration");return}kee(I.enableExperimentalFeatures),h=I,!(e&&zz())&&(Xz(I.plugins,"onInit",{initConfiguration:I,publicApi:A}),I.remoteConfigurationId?ure(I,{user:c,context:a}).then(T=>{T&&C(T,N)}).catch(Js):C(I,N))},get initConfiguration(){return h},getInternalContext:Ht,stopSession:Ht,addTiming(I,A=vr()){o.add(N=>N.addTiming(I,A))},startView(I,A=ir()){const N=T=>{T.startView(I,A)};o.add(N),f||(f={options:I,callback:N},S())},setViewName(I){o.add(A=>A.setViewName(I))},setViewContext(I){o.add(A=>A.setViewContext(I))},setViewContextProperty(I,A){o.add(N=>N.setViewContextProperty(I,A))},getViewContext:()=>b,globalContext:a,userContext:c,accountContext:d,addAction(I){o.add(A=>A.addAction(I))},addError(I){o.add(A=>A.addError(I))},addFeatureFlagEvaluation(I,A){o.add(N=>N.addFeatureFlagEvaluation(I,A))},startDurationVital(I,A){return Yz(r,I,A)},stopDurationVital(I,A){Wz(E,r,I,A)},addDurationVital:E,addOperationStepVital:(I,A,N,T)=>{o.add(z=>z.addOperationStepVital(fn(I),A,fn(N),fn(T)))}}}function bre(e){var t,n;return{...e,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(t=e.defaultPrivacyLevel)!==null&&t!==void 0?t:(n=jp())===null||n===void 0?void 0:n.getPrivacyLevel()}}function gS(e,t,n){e.changeObservable.subscribe(()=>{const r=e.getContext();n.add(i=>i[t].setContext(r))})}function xre(e,t,n,r={}){const i=oee(),o=Dne(),a=Ane().observable;let c=yre(r,i,o,(h,v,y)=>{const b=v&&r.createDeflateEncoder?C=>r.createDeflateEncoder(h,v,C):ene,S=e(h,t,n,y,b,i,o,a,r.sdkName);return t.onRumStart(S.lifeCycle,h,S.session,S.viewHistory,v,S.telemetry),n.onRumStart(S.lifeCycle,S.hooks,h,S.session,S.viewHistory,b),c=wre(c,S),Xz(h.plugins,"onRumStart",{strategy:c,addEvent:S.addEvent}),S});const d=()=>c,f=bt(h=>{const v=typeof h=="object"?h:{name:h};c.startView(v),cr({feature:"start-view"})}),p=nte({init:h=>{const v=new Error().stack;Ys(()=>c.init(h,p,v))},setTrackingConsent:bt(h=>{i.update(h),cr({feature:"set-tracking-consent",tracking_consent:h})}),setViewName:bt(h=>{c.setViewName(h),cr({feature:"set-view-name"})}),setViewContext:bt(h=>{c.setViewContext(h),cr({feature:"set-view-context"})}),setViewContextProperty:bt((h,v)=>{c.setViewContextProperty(h,v),cr({feature:"set-view-context-property"})}),getViewContext:bt(()=>(cr({feature:"set-view-context-property"}),c.getViewContext())),getInternalContext:bt(h=>c.getInternalContext(h)),getInitConfiguration:bt(()=>KC(c.initConfiguration)),addAction:(h,v)=>{const y=Xm("action");Ys(()=>{c.addAction({name:fn(h),context:fn(v),startClocks:ir(),type:QC.CUSTOM,handlingStack:y}),cr({feature:"add-action"})})},addError:(h,v)=>{const y=Xm("error");Ys(()=>{c.addError({error:h,handlingStack:y,context:fn(v),startClocks:ir()}),cr({feature:"add-error"})})},addTiming:bt((h,v)=>{c.addTiming(fn(h),v)}),setGlobalContext:Or(d,ur.globalContext,Dr.setContext,"set-global-context"),getGlobalContext:Or(d,ur.globalContext,Dr.getContext,"get-global-context"),setGlobalContextProperty:Or(d,ur.globalContext,Dr.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:Or(d,ur.globalContext,Dr.removeContextProperty,"remove-global-context-property"),clearGlobalContext:Or(d,ur.globalContext,Dr.clearContext,"clear-global-context"),setUser:Or(d,ur.userContext,Dr.setContext,"set-user"),getUser:Or(d,ur.userContext,Dr.getContext,"get-user"),setUserProperty:Or(d,ur.userContext,Dr.setContextProperty,"set-user-property"),removeUserProperty:Or(d,ur.userContext,Dr.removeContextProperty,"remove-user-property"),clearUser:Or(d,ur.userContext,Dr.clearContext,"clear-user"),setAccount:Or(d,ur.accountContext,Dr.setContext,"set-account"),getAccount:Or(d,ur.accountContext,Dr.getContext,"get-account"),setAccountProperty:Or(d,ur.accountContext,Dr.setContextProperty,"set-account-property"),removeAccountProperty:Or(d,ur.accountContext,Dr.removeContextProperty,"remove-account-property"),clearAccount:Or(d,ur.accountContext,Dr.clearContext,"clear-account"),startView:f,stopSession:bt(()=>{c.stopSession(),cr({feature:"stop-session"})}),addFeatureFlagEvaluation:bt((h,v)=>{c.addFeatureFlagEvaluation(fn(h),fn(v)),cr({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:bt(()=>t.getSessionReplayLink()),startSessionReplayRecording:bt(h=>{t.start(h),cr({feature:"start-session-replay-recording",force:h&&h.force})}),stopSessionReplayRecording:bt(()=>t.stop()),addDurationVital:bt((h,v)=>{cr({feature:"add-duration-vital"}),c.addDurationVital({name:fn(h),type:Jm.DURATION,startClocks:gJ(v.startTime),duration:v.duration,context:fn(v&&v.context),description:fn(v&&v.description)})}),startDurationVital:bt((h,v)=>(cr({feature:"start-duration-vital"}),c.startDurationVital(fn(h),{context:fn(v&&v.context),description:fn(v&&v.description)}))),stopDurationVital:bt((h,v)=>{cr({feature:"stop-duration-vital"}),c.stopDurationVital(typeof h=="string"?fn(h):h,{context:fn(v&&v.context),description:fn(v&&v.description)})}),startFeatureOperation:bt((h,v)=>{cr({feature:"add-operation-step-vital",action_type:"start"}),c.addOperationStepVital(h,"start",v)}),succeedFeatureOperation:bt((h,v)=>{cr({feature:"add-operation-step-vital",action_type:"succeed"}),c.addOperationStepVital(h,"end",v)}),failFeatureOperation:bt((h,v,y)=>{cr({feature:"add-operation-step-vital",action_type:"fail"}),c.addOperationStepVital(h,"end",y,v)})});return p}function wre(e,t){return{init:n=>{xz("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function Sre(){const e=_re();return new At(t=>{if(!e)return;const n=new e(bt(r=>t.notify(r)));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function _re(){let e;const t=window;if(t.Zone&&(e=Qs(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(Ht),r=Qs(n,"originalInstance");e=r&&r.constructor}return e||(e=t.MutationObserver),e}function Cre(){const e=new At,{stop:t}=ra(window,"open",()=>e.notify());return{observable:e,stop:t}}function Ere(e,t,n,r,i){return{get:o=>{const a=n.findView(o),c=i.findUrl(o),d=t.findTrackedSession(o);if(d&&a&&c){const f=r.findActionId(o);return{application_id:e,session_id:d.id,user_action:f?{id:f}:void 0,view:{id:a.id,name:a.name,referrer:c.referrer,url:c.url}}}}}}const kre=tne,jre=kc;function Rre(e){const t=qd({expireDelay:jre});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 r4="initial_document",Ire=[[Mr.DOCUMENT,e=>r4===e],[Mr.XHR,e=>e==="xmlhttprequest"],[Mr.FETCH,e=>e==="fetch"],[Mr.BEACON,e=>e==="beacon"],[Mr.CSS,(e,t)=>/\.css$/i.test(t)],[Mr.JS,(e,t)=>/\.js$/i.test(t)],[Mr.IMAGE,(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],[Mr.FONT,(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],[Mr.MEDIA,(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function Nre(e){const t=e.name;if(!RJ(t))return Mr.OTHER;const n=IJ(t);for(const[r,i]of Ire)if(i(e.initiatorType,n))return r;return Mr.OTHER}function LO(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function i4(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function Tre(e){const{duration:t,startTime:n,responseEnd:r}=e;return t===0&&n<r?Mn(n,r):t}function Are(e){if(!a4(e))return;const{startTime:t,fetchStart:n,workerStart:r,redirectStart:i,redirectEnd:o,domainLookupStart:a,domainLookupEnd:c,connectStart:d,secureConnectionStart:f,connectEnd:p,requestStart:h,responseStart:v,responseEnd:y}=e,b={download:Ll(t,v,y),first_byte:Ll(t,h,v)};return 0<r&&r<n&&(b.worker=Ll(t,r,n)),n<p&&(b.connect=Ll(t,d,p),d<=f&&f<=p&&(b.ssl=Ll(t,f,p))),n<c&&(b.dns=Ll(t,a,c)),t<o&&(b.redirect=Ll(t,i,o)),b}function o4(e){return e.duration>=0}function a4(e){const t=LO(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=Ore(e)?LO(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function Ore(e){return e.redirectEnd>e.startTime}function Ll(e,t,n){if(e<=t&&t<=n)return{duration:gt(Mn(t,n)),start:gt(Mn(e,t))}}function Dre(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function $re(e){return e.deliveryType===""?"other":e.deliveryType}function Pre(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 JC(e){return e&&(!See(e)||_p(el.TRACK_INTAKE_REQUESTS))}const Mre=/data:(.+)?(;base64)?,/g,zre=24e3;function Lre(e,t=zre){if(e.length<=t||!e.startsWith("data:"))return e;const n=e.substring(0,100).match(Mre);return n?`${n[0]}[...]`:e}const Ure=32*md;function Fre(e,t){const n=Bre(e.requestBody,t.trackPayload);if(n){if(t.trackResponseErrors&&e.responseBody){const r=Vre(e.responseBody);r&&(n.errors_count=r.length,n.errors=r)}return n}}function Vre(e){let t;try{t=JSON.parse(e)}catch{return}if(!t||typeof t!="object")return;const n=t;return oc(n.errors)?n.errors.map(i=>{var o;return{message:i.message,path:i.path,locations:i.locations,code:(o=i.extensions)===null||o===void 0?void 0:o.code}}):void 0}function s4(e,t){return t.allowedGraphQlUrls.find(n=>ob([n.match],e))}function Bre(e,t=!1){if(!e||typeof e!="string")return;let n;try{n=JSON.parse(e)}catch{return}if(!n||!n.query)return;const r=n.query.trim(),i=Hre(r),o=n.operationName;if(!i)return;let a;return n.variables&&(a=JSON.stringify(n.variables)),{operationType:i,operationName:o,variables:a,payload:t?FC(r,Ure,"..."):void 0}}function Hre(e){var t;return(t=e.match(/^\s*(query|mutation|subscription)\b/i))===null||t===void 0?void 0:t[1]}let UO=1;function qre(e,t,n,r,i){const o=Fne(t,n,r,i);Gre(e,t,o),Kre(e,t,o)}function Gre(e,t,n){const r=rne(t).subscribe(i=>{const o=i;if(JC(o.url))switch(o.state){case"start":n.traceXhr(o,o.xhr),o.requestIndex=l4(),e.notify(7,{requestIndex:o.requestIndex,url:o.url});break;case"complete":n.clearTracingIfNeeded(o),e.notify(8,{duration:o.duration,method:o.method,requestIndex:o.requestIndex,spanId:o.spanId,startClocks:o.startClocks,status:o.status,traceId:o.traceId,traceSampled:o.traceSampled,type:lb.XHR,url:o.url,xhr:o.xhr,isAborted:o.isAborted,handlingStack:o.handlingStack,requestBody:o.requestBody,responseBody:o.responseBody});break}});return{stop:()=>r.unsubscribe()}}function Kre(e,t,n){const r=Hz({responseBodyAction:i=>{var o;return!((o=s4(i.url,t))===null||o===void 0)&&o.trackResponseErrors?2:1}}).subscribe(i=>{var o;const a=i;if(JC(a.url))switch(a.state){case"start":n.traceFetch(a),a.requestIndex=l4(),e.notify(7,{requestIndex:a.requestIndex,url:a.url});break;case"resolve":n.clearTracingIfNeeded(a),e.notify(8,{duration:Mn(a.startClocks.timeStamp,vr()),method:a.method,requestIndex:a.requestIndex,responseType:a.responseType,spanId:a.spanId,startClocks:a.startClocks,status:a.status,traceId:a.traceId,traceSampled:a.traceSampled,type:lb.FETCH,url:a.url,response:a.response,init:a.init,input:a.input,isAborted:a.isAborted,handlingStack:a.handlingStack,requestBody:(o=a.init)===null||o===void 0?void 0:o.body,responseBody:a.responseBody});break}});return{stop:()=>r.unsubscribe()}}function l4(){const e=UO;return UO+=1,e}function c4(e){return wp(e)&&e<0?void 0:e}function u4({lifeCycle:e,isChildEvent:t,onChange:n=Ht}){const r={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},i=e.subscribe(13,o=>{var a;if(!(o.type==="view"||o.type==="vital"||!t(o)))switch(o.type){case vt.ERROR:r.errorCount+=1,n();break;case vt.ACTION:r.actionCount+=1,o.action.frustration&&(r.frustrationCount+=o.action.frustration.type.length),n();break;case vt.LONG_TASK:r.longTaskCount+=1,n();break;case vt.RESOURCE:!((a=o._dd)===null||a===void 0)&&a.discarded||(r.resourceCount+=1,n());break}});return{stop:()=>{i.unsubscribe()},eventCounts:r}}function Zre(e,t){const n=Fr();let r=!1;const{stop:i}=tl(e,window,["click","mousedown","keydown","touchstart","pointerdown"],c=>{if(!c.cancelable)return;const d={entryType:"first-input",processingStart:Oi(),processingEnd:Oi(),startTime:c.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};c.type==="pointerdown"?o(e,d):a(d)},{passive:!0,capture:!0});return{stop:i};function o(c,d){tl(c,window,["pointerup","pointercancel"],f=>{f.type==="pointerup"&&a(d)},{once:!0})}function a(c){if(!r){r=!0,i();const d=c.processingStart-c.startTime;d>=0&&d<Fr()-n&&t(c)}}}var $t;(function(e){e.EVENT="event",e.FIRST_INPUT="first-input",e.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",e.LAYOUT_SHIFT="layout-shift",e.LONG_TASK="longtask",e.LONG_ANIMATION_FRAME="long-animation-frame",e.NAVIGATION="navigation",e.PAINT="paint",e.RESOURCE="resource",e.VISIBILITY_STATE="visibility-state"})($t||($t={}));function ca(e,t){return new At(n=>{if(!window.PerformanceObserver)return;const r=d=>{const f=Xre(d);f.length>0&&n.notify(f)};let i,o=!0;const a=new PerformanceObserver(bt(d=>{o?i=kr(()=>r(d.getEntries())):r(d.getEntries())}));try{a.observe(t)}catch{if([$t.RESOURCE,$t.NAVIGATION,$t.LONG_TASK,$t.PAINT].includes(t.type)){t.buffered&&(i=kr(()=>r(performance.getEntriesByType(t.type))));try{a.observe({entryTypes:[t.type]})}catch{return}}}o=!1,Yre(e);let c;return!Ic($t.FIRST_INPUT)&&t.type===$t.FIRST_INPUT&&({stop:c}=Zre(e,d=>{r([d])})),()=>{a.disconnect(),c&&c(),io(i)}})}let um;function Yre(e){return!um&&Wre()&&"addEventListener"in performance&&(um=Cn(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{um?.stop()}}function Wre(){return window.performance!==void 0&&"getEntries"in performance}function Ic(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function Xre(e){return e.filter(t=>!Qre(t))}function Qre(e){return e.entryType===$t.RESOURCE&&(!JC(e.name)||!o4(e))}function t1(e){return e.nodeType===Node.TEXT_NODE}function Jre(e){return e.nodeType===Node.COMMENT_NODE}function Za(e){return e.nodeType===Node.ELEMENT_NODE}function d4(e){return Za(e)&&!!e.shadowRoot}function eie(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&Za(t.host)}function lAe(e){return e.childNodes.length>0||d4(e)}function cAe(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;d4(e)&&t(e.shadowRoot)}function tie(e){return eie(e)?e.host:e.parentNode}const f4=100,nie=100,FO="data-dd-excluded-activity-mutations";function eE(e,t,n,r,i,o){const a=iie(e,t,n,r);return rie(a,i,o)}function rie(e,t,n){let r,i=!1;const o=kr(bt(()=>f({hadActivity:!1})),f4),a=n!==void 0?kr(bt(()=>f({hadActivity:!0,end:vr()})),n):void 0,c=e.subscribe(({isBusy:p})=>{io(o),io(r);const h=vr();p||(r=kr(bt(()=>f({hadActivity:!0,end:h})),nie))}),d=()=>{i=!0,io(o),io(r),io(a),c.unsubscribe()};function f(p){i||(d(),t(p))}return{stop:d}}function iie(e,t,n,r){return new At(i=>{const o=[];let a,c=0;return o.push(t.subscribe(f=>{f.every(oie)||d()}),n.subscribe(d),ca(r,{type:$t.RESOURCE}).subscribe(f=>{f.some(p=>!vS(r,p.name))&&d()}),e.subscribe(7,f=>{vS(r,f.url)||(a===void 0&&(a=f.requestIndex),c+=1,d())}),e.subscribe(8,f=>{vS(r,f.url)||a===void 0||f.requestIndex<a||(c-=1,d())})),()=>{o.forEach(f=>f.unsubscribe())};function d(){i.notify({isBusy:c>0})}})}function vS(e,t){return ob(e.excludedActivityUrls,t)}function oie(e){const t=e.type==="characterData"?e.target.parentElement:e.target;return!!(t&&Za(t)&&t.matches(`[${FO}], [${FO}] *`))}const cb="data-dd-action-name",aie="Masked Element",sie=[cb,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],lie=[p4,uie],cie=[p4,die,fie];function Ip(e,t){if(!e.isConnected)return;let n,r=e;for(;r&&r.nodeName!=="HTML";){const i=VO(r,lie,pie,t,n);if(i)return i;n=VO(r,cie,hie,t,n)||ub(mie(r),n),r=r.parentElement}return n}function m4(e){return/[0-9]/.test(e)}function uie(e){if(e.id&&!m4(e.id))return`#${CSS.escape(e.id)}`}function die(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const r=t[n];if(!m4(r))return`${CSS.escape(e.tagName)}.${CSS.escape(r)}`}}function fie(e){return CSS.escape(e.tagName)}function p4(e,t){if(t){const r=n(t);if(r)return r}for(const r of sie){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 mie(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 VO(e,t,n,r,i){for(const o of t){const a=o(e,r);if(a&&n(e,a,i))return ub(a,i)}}function pie(e,t,n){return e.ownerDocument.querySelectorAll(ub(t,n)).length===1}function hie(e,t,n){let r;if(n===void 0)r=a=>a.matches(t);else{const a=ub(`${t}:scope`,n);r=c=>c.querySelector(a)!==null}let o=e.parentElement.firstElementChild;for(;o;){if(o!==e&&r(o))return!1;o=o.nextElementSibling}return!0}function ub(e,t){return t?`${e}>${t}`:e}const It={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:qu.ALLOW,MASK:qu.MASK,MASK_USER_INPUT:qu.MASK_USER_INPUT,MASK_UNLESS_ALLOWLISTED:qu.MASK_UNLESS_ALLOWLISTED},gie="data-dd-privacy",uAe="hidden",vie="dd-privacy-",yS="***",dAe="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",yie={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},bie="x";function Bl(e){return`[${gie}="${e}"], .${vie}${e}`}function tE(e,t,n){if(n&&n.has(e))return n.get(e);const r=tie(e),i=r?tE(r,t,n):t,o=wie(e),a=xie(o,i);return n&&n.set(e,a),a}function xie(e,t){switch(t){case It.HIDDEN:case It.IGNORE:return t}switch(e){case It.ALLOW:case It.MASK:case It.MASK_USER_INPUT:case It.MASK_UNLESS_ALLOWLISTED:case It.HIDDEN:case It.IGNORE:return e;default:return t}}function wie(e){if(Za(e)){if(e.tagName==="BASE")return It.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return It.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return It.MASK}if(e.matches(Bl(It.HIDDEN)))return It.HIDDEN;if(e.matches(Bl(It.MASK)))return It.MASK;if(e.matches(Bl(It.MASK_UNLESS_ALLOWLISTED)))return It.MASK_UNLESS_ALLOWLISTED;if(e.matches(Bl(It.MASK_USER_INPUT)))return It.MASK_USER_INPUT;if(e.matches(Bl(It.ALLOW)))return It.ALLOW;if(Sie(e))return It.IGNORE}}function h4(e,t){switch(t){case It.MASK:case It.HIDDEN:case It.IGNORE:return!0;case It.MASK_UNLESS_ALLOWLISTED:return t1(e)?$g(e.parentNode)?!0:!v4(e.textContent||""):$g(e);case It.MASK_USER_INPUT:return t1(e)?$g(e.parentNode):$g(e);default:return!1}}function $g(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;const t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!yie[t.tagName]}const g4=e=>e.replace(/\S/g,bie);function fAe(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=yS;else if(a===It.HIDDEN)i=yS;else if(h4(e,a))if(r==="DATALIST"||r==="SELECT"||r==="OPTGROUP"){if(!i.trim())return}else r==="OPTION"?i=yS:a===It.MASK_UNLESS_ALLOWLISTED?i=_ie(i):i=g4(i);return i}function Sie(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 v4(e){var t;return!e||!e.trim()?!0:((t=window.$DD_ALLOW)===null||t===void 0?void 0:t.has(e.toLocaleLowerCase()))||!1}function _ie(e,t){return v4(e)?e:t||g4(e)}const y4=Nr,Cie=100;function Eie(e,t){const n=[];let r=0,i;o(e);function o(d){d.stopObservable.subscribe(a),n.push(d),io(i),i=kr(c,y4)}function a(){r===1&&n.every(d=>d.isStopped())&&(r=2,t(n))}function c(){io(i),r===0&&(r=1,a())}return{tryAppend:d=>r!==0?!1:n.length>0&&!kie(n[n.length-1].event,d.event)?(c(),!1):(o(d),!0),stop:()=>{c()}}}function kie(e,t){return e.target===t.target&&jie(e,t)<=Cie&&e.timeStamp-t.timeStamp<=y4}function jie(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function Rie(e,t,n=It.ALLOW){const{actionNameAttribute:r}=t,i=BO(e,cb)||r&&BO(e,r);return i?{name:i,nameSource:"custom_attribute"}:n===It.MASK?{name:aie,nameSource:"mask_placeholder"}:HO(e,Iie,t)||HO(e,Nie,t)||{name:"",nameSource:"blank"}}function BO(e,t){const n=e.closest(`[${t}]`);if(!n)return;const r=n.getAttribute(t);return x4(b4(r.trim()))}const Iie=[(e,t)=>{if("labels"in e&&e.labels&&e.labels.length>0)return xv(e.labels[0],t)},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)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return xv(e,t)},e=>dm(e,"aria-label"),(e,t)=>{const n=e.getAttribute("aria-labelledby");if(n)return{name:n.split(/\s+/).map(r=>Aie(e,r)).filter(r=>!!r).map(r=>w4(r,t)).join(" "),nameSource:"text_content"}},e=>dm(e,"alt"),e=>dm(e,"name"),e=>dm(e,"title"),e=>dm(e,"placeholder"),(e,t)=>{if("options"in e&&e.options.length>0)return xv(e.options[0],t)}],Nie=[(e,t)=>xv(e,t)],Tie=10;function HO(e,t,n){let r=e,i=0;for(;i<=Tie&&r&&r.nodeName!=="BODY"&&r.nodeName!=="HTML"&&r.nodeName!=="HEAD";){for(const o of t){const a=o(r,n);if(a){const{name:c,nameSource:d}=a,f=c&&c.trim();if(f)return{name:x4(b4(f)),nameSource:d}}}if(r.nodeName==="FORM")break;r=r.parentElement,i+=1}}function b4(e){return e.replace(/\s+/g," ")}function x4(e){return e.length>100?`${FC(e,100)} [...]`:e}function Aie(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function dm(e,t){return{name:e.getAttribute(t)||"",nameSource:"standard_attribute"}}function xv(e,t){return{name:w4(e,t)||"",nameSource:"text_content"}}function w4(e,t){if(e.isContentEditable)return;const{enablePrivacyForActionName:n,actionNameAttribute:r,defaultPrivacyLevel:i}=t;if(_p(el.USE_TREE_WALKER_FOR_ACTION_NAME))return Oie(e,r,n,i);if("innerText"in e){let o=e.innerText;const a=c=>{const d=e.querySelectorAll(c);for(let f=0;f<d.length;f+=1){const p=d[f];if("innerText"in p){const h=p.innerText;h&&h.trim().length>0&&(o=o.replace(h,""))}}};return a(`[${cb}]`),r&&a(`[${r}]`),n&&a(`${Bl(It.HIDDEN)}, ${Bl(It.MASK)}`),o}return e.textContent}function Oie(e,t,n,r){const i=new Map,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,c);let a="";for(;o.nextNode();){const d=o.currentNode;if(Za(d)){(d.nodeName==="BR"||d.nodeName==="P"||["block","flex","grid","list-item","table","table-caption"].includes(getComputedStyle(d).display))&&(a+=" ");continue}a+=d.textContent||""}return a.replace(/\s+/g," ").trim();function c(d){const f=tE(d,r,i);if(n&&f&&h4(d,f))return NodeFilter.FILTER_REJECT;if(Za(d)){if(d.hasAttribute(cb)||t&&d.hasAttribute(t))return NodeFilter.FILTER_REJECT;const p=getComputedStyle(d);if(p.visibility!=="visible"||p.display==="none"||p.contentVisibility&&p.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}function Die(e,{onPointerDown:t,onPointerUp:n}){let r,i={selection:!1,input:!1,scroll:!1},o;const a=[Cn(e,window,"pointerdown",c=>{GO(c)&&(r=qO(),i={selection:!1,input:!1,scroll:!1},o=t(c))},{capture:!0}),Cn(e,window,"selectionchange",()=>{(!r||!qO())&&(i.selection=!0)},{capture:!0}),Cn(e,window,"scroll",()=>{i.scroll=!0},{capture:!0,passive:!0}),Cn(e,window,"pointerup",c=>{if(GO(c)&&o){const d=i;n(o,c,()=>d),o=void 0}},{capture:!0}),Cn(e,window,"input",()=>{i.input=!0},{capture:!0})];return{stop:()=>{a.forEach(c=>c.stop())}}}function qO(){const e=window.getSelection();return!e||e.isCollapsed}function GO(e){return e.target instanceof Element&&e.isPrimary!==!1}const KO=3;function $ie(e,t){if(Pie(e))return t.addFrustration(cm.RAGE_CLICK),e.some(ZO)&&t.addFrustration(cm.DEAD_CLICK),t.hasError&&t.addFrustration(cm.ERROR_CLICK),{isRage:!0};const n=e.some(r=>r.getUserActivity().selection);return e.forEach(r=>{r.hasError&&r.addFrustration(cm.ERROR_CLICK),ZO(r)&&!n&&r.addFrustration(cm.DEAD_CLICK)}),{isRage:!1}}function Pie(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(KO-1);t+=1)if(e[t+KO-1].event.timeStamp-e[t].event.timeStamp<=Nr)return!0;return!1}const Mie='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 ZO(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(Mie)}const S4=10*Nr,Mm=new Map;function zie(e){const t=Mm.get(e);return Mm.delete(e),t}function _4(e,t){Mm.set(e,t),Mm.forEach((n,r)=>{Mn(r,Oi())>S4&&Mm.delete(r)})}const Lie=5*Br;function Uie(e,t,n,r){const i=qd({expireDelay:Lie}),o=new At;let a;e.subscribe(10,()=>{i.reset()}),e.subscribe(5,p),e.subscribe(11,h=>{h.reason===ed.UNLOADING&&p()});const{stop:c}=Die(r,{onPointerDown:h=>Fie(r,e,t,h,n),onPointerUp:({clickActionBase:h,hadActivityOnPointerDown:v},y,b)=>{Vie(r,e,t,n,i,o,f,h,y,b,v)}});return{stop:()=>{p(),o.notify(),c()},actionContexts:{findActionId:h=>i.findAll(h)}};function f(h){if(!a||!a.tryAppend(h)){const v=h.clone();a=Eie(h,y=>{Hie(y,v)})}}function p(){a&&a.stop()}}function Fie(e,t,n,r,i){let o;if(e.enablePrivacyForActionName?o=tE(r.target,e.defaultPrivacyLevel):o=It.ALLOW,o===It.HIDDEN)return;const a=Bie(r,o,e);let c=!1;return eE(t,n,i,e,d=>{c=d.hadActivity},f4),{clickActionBase:a,hadActivityOnPointerDown:()=>c}}function Vie(e,t,n,r,i,o,a,c,d,f,p){var h;const v=C4(t,i,f,c,d);a(v);const y=(h=c?.target)===null||h===void 0?void 0:h.selector;y&&_4(d.timeStamp,y);const{stop:b}=eE(t,n,r,e,E=>{E.hadActivity&&E.end<v.startClocks.timeStamp?v.discard():E.hadActivity?v.stop(E.end):p()?v.stop(v.startClocks.timeStamp):v.stop()},S4),S=t.subscribe(5,({endClocks:E})=>{v.stop(E.timeStamp)}),C=o.subscribe(()=>{v.stop()});v.stopObservable.subscribe(()=>{S.unsubscribe(),b(),C.unsubscribe()})}function Bie(e,t,n){const r=e.target.getBoundingClientRect(),i=Ip(e.target,n.actionNameAttribute);i&&_4(e.timeStamp,i);const{name:o,nameSource:a}=Rie(e.target,n,t);return{type:QC.CLICK,target:{width:Math.round(r.width),height:Math.round(r.height),selector:i},position:{x:Math.round(e.clientX-r.left),y:Math.round(e.clientY-r.top)},name:o,nameSource:a}}function C4(e,t,n,r,i){const o=Rr(),a=ir(),c=t.add(o,a.relative),d=u4({lifeCycle:e,isChildEvent:b=>b.action!==void 0&&(Array.isArray(b.action.id)?b.action.id.includes(o):b.action.id===o)});let f=0,p;const h=[],v=new At;function y(b){f===0&&(p=b,f=1,p?c.close(UC(p)):c.remove(),d.stop(),v.notify())}return{event:i,stop:y,stopObservable:v,get hasError(){return d.eventCounts.errorCount>0},get hasPageActivity(){return p!==void 0},getUserActivity:n,addFrustration:b=>{h.push(b)},startClocks:a,isStopped:()=>f===1||f===2,clone:()=>C4(e,t,n,r,i),validate:b=>{if(y(),f!==1)return;const{resourceCount:S,errorCount:C,longTaskCount:E}=d.eventCounts,k={duration:p&&Mn(a.timeStamp,p),startClocks:a,id:o,frustrationTypes:h,counts:{resourceCount:S,errorCount:C,longTaskCount:E},events:b??[i],event:i,...r};e.notify(0,k),f=2},discard:()=>{y(),f=2}}}function Hie(e,t){const{isRage:n}=$ie(e,t);n?(e.forEach(r=>r.discard()),t.stop(vr()),t.validate(e.map(r=>r.event))):(t.discard(),e.forEach(r=>r.validate()))}function qie(e,t,n,r,i){const{unsubscribe:o}=e.subscribe(0,d=>{e.notify(12,YO(d))});t.register(0,({startTime:d,eventType:f})=>{if(f!==vt.ERROR&&f!==vt.RESOURCE&&f!==vt.LONG_TASK)return Di;const p=a.findActionId(d);return p?{type:f,action:{id:p}}:Di}),t.register(1,({startTime:d})=>({action:{id:a.findActionId(d)}}));let a={findActionId:Ht},c=Ht;return i.trackUserInteractions&&({actionContexts:a,stop:c}=Uie(e,n,r,i)),{addAction:d=>{e.notify(12,YO(d))},actionContexts:a,stop:()=>{o(),c()}}}function YO(e){const t=bS(e)?{action:{id:e.id,loading_time:c4(gt(e.duration)),frustration:{type:e.frustrationTypes},error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}},_dd:{action:{target:e.target,position:e.position,name_source:e.nameSource}}}:{context:e.context},n=Ka({action:{id:Rr(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:vt.ACTION},t),r=bS(e)?e.duration:void 0,i=bS(e)?{events:e.events}:{handlingStack:e.handlingStack};return{rawRumEvent:n,duration:r,startTime:e.startClocks.relative,domainContext:i}}function bS(e){return e.type!==QC.CUSTOM}function Gie(e){const t=yne([Wy.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function Kie(e,t){const n=ite(e,[Qm.cspViolation,Qm.intervention]).subscribe(r=>t.notify(r));return{stop:()=>{n.unsubscribe()}}}function Zie(e,t,n){const r=new At;return n.subscribe(i=>{i.type===0&&r.notify(i.error)}),Gie(r),Kie(t,r),r.subscribe(i=>e.notify(14,{error:i})),Yie(e)}function Yie(e){return e.subscribe(14,({error:t})=>{e.notify(12,Wie(t))}),{addError:({error:t,handlingStack:n,componentStack:r,startClocks:i,context:o})=>{const a=GC({originalError:t,handlingStack:n,componentStack:r,startClocks:i,nonErrorPrefix:"Provided",source:Bd.CUSTOM,handling:"handled"});a.context=Ka(a.context,o),e.notify(14,{error:a})}}}function Wie(e){const t={date:e.startClocks.timeStamp,error:{id:Rr(),message:e.message,source:e.source,stack:e.stack,handling_stack:e.handlingStack,component_stack:e.componentStack,type:e.type,handling:e.handling,causes:e.causes,source_type:"browser",fingerprint:e.fingerprint,csp:e.csp},type:vt.ERROR,context:e.context},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const WO=new WeakSet;function Xie(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=>!WO.has(r)).filter(r=>o4(r)&&a4(r)).filter(r=>Qie(r,e.startClocks.relative,E4({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return WO.add(n[0]),n[0].toJSON()}function E4(e){return Fd(e.startTime,e.duration)}function Qie(e,t,n){return e.startTime>=t-1&&E4(e)<=Fd(n,1)}const Jie=2*Br;function eoe(e){const t=toe(e)||noe(e);if(!(!t||t.traceTime<=Fr()-Jie))return t.traceId}function toe(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return k4(t&&t.content,n&&n.content)}function noe(e){const t=roe(e);if(t)return k4(Ym(t,"trace-id"),Ym(t,"trace-time"))}function k4(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function roe(e){for(let t=0;t<e.childNodes.length;t+=1){const n=XO(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=XO(n);if(r)return r;if(!t1(n))break}}function XO(e){if(e&&Jre(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function j4(){if(Ic($t.NAVIGATION)){const n=performance.getEntriesByType($t.NAVIGATION)[0];if(n)return n}const e=ioe(),t={entryType:$t.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:e.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...t,toJSON:void 0}),...e};return t}function ioe(){const e={},t=performance.timing;for(const n in t)if(wp(t[n])){const r=n,i=t[r];e[r]=i===0?0:UC(i)}return e}function ooe(e,t,n=j4){YC(e,"interactive",()=>{const r=n(),i=Object.assign(r.toJSON(),{entryType:$t.RESOURCE,initiatorType:r4,duration:r.responseEnd,traceId:eoe(document),toJSON:()=>({...i,toJSON:void 0})});t(i)})}const aoe=1e3;function soe(e){const t=new Set,n=e.subscribe(8,r=>{t.add(r),t.size>aoe&&(Rp("Too many requests"),t.delete(t.values().next().value))});return{getMatchingRequest(r){let i=1/0,o;for(const a of t){const c=r.startTime-a.startClocks.relative;0<=c&&c<i&&a.url===r.name&&(i=Math.abs(c),o=a)}return o&&t.delete(o),o},stop(){n.unsubscribe()}}}function loe(e,t,n,r=vne(),i=ooe){let o;const a=t.trackEarlyRequests;a?o=soe(e):e.subscribe(8,f=>{d(()=>coe(f,t,n))});const c=ca(t,{type:$t.RESOURCE,buffered:!0}).subscribe(f=>{for(const p of f)(a||!i4(p))&&d(()=>QO(p,t,n,o))});i(t,f=>{d(()=>QO(f,t,n,o))});function d(f){r.push(()=>{const p=f();p&&e.notify(12,p)})}return{stop:()=>{r.stop(),c.unsubscribe()}}}function coe(e,t,n){const r=Xie(e);return R4(r,e,n,t)}function QO(e,t,n,r){const i=i4(e)&&r?r.getMatchingRequest(e):void 0;return R4(e,i,n,t)}function R4(e,t,n,r){if(!e&&!t)return;const i=t?moe(t,r):poe(e,r);if(!r.trackResources&&!i)return;const o=e?Qy(e.startTime):t.startClocks,a=e?Tre(e):hoe(n,o,t.duration),c=t&&uoe(t,r),d=Ka({date:o.timeStamp,resource:{id:Rr(),duration:gt(a),type:t?t.type===lb.XHR?Mr.XHR:Mr.FETCH:Nre(e),method:t?t.method:void 0,status_code:t?t.status:goe(e.responseStatus),url:t?Lre(t.url):e.name,protocol:e&&Dre(e),delivery_type:e&&$re(e),graphql:c},type:vt.RESOURCE,_dd:{discarded:!r.trackResources}},i,e&&foe(e));return{startTime:o.relative,duration:a,rawRumEvent:d,domainContext:doe(e,t)}}function uoe(e,t){const n=s4(e.url,t);if(n)return Fre(e,n)}function doe(e,t){if(t){const n={performanceEntry:e,isAborted:t.isAborted,handlingStack:t.handlingStack};return t.type===lb.XHR?{xhr:t.xhr,...n}:{requestInput:t.input,requestInit:t.init,response:t.response,error:t.error,...n}}return{performanceEntry:e}}function foe(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...Pre(e),...Are(e)}}}function moe(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 poe(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:Jz().toString(),rule_psr:t.rulePsr}}}function hoe(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function goe(e){return e===0?void 0:e}function voe(e,t,n){const{stop:r,eventCounts:i}=u4({lifeCycle:e,isChildEvent:o=>o.view.id===t,onChange:n});return{stop:r,eventCounts:i}}const yoe=10*Br;function boe(e,t,n){return{stop:ca(e,{type:$t.PAINT,buffered:!0}).subscribe(i=>{const o=i.find(a=>a.name==="first-contentful-paint"&&a.startTime<t.timeStamp&&a.startTime<yoe);o&&n(o.startTime)}).unsubscribe}}function xoe(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(Mn(e,Oi()))})})}function woe(e,t,n){const r=ca(e,{type:$t.FIRST_INPUT,buffered:!0}).subscribe(i=>{const o=i.find(a=>a.startTime<t.timeStamp);if(o){const a=Mn(o.startTime,o.processingStart);let c;o.target&&Za(o.target)&&(c=Ip(o.target,e.actionNameAttribute)),n({delay:a>=0?a:0,time:o.startTime,targetSelector:c})}});return{stop:()=>{r.unsubscribe()}}}function Soe(e,t,n=j4){return Eoe(e,()=>{const r=n();Coe(r)||t(_oe(r))})}function _oe(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=Oi()?e.responseStart:void 0}}function Coe(e){return e.loadEventEnd<=0}function Eoe(e,t){let n;const{stop:r}=YC(e,"complete",()=>{n=kr(()=>t())});return{stop:()=>{r(),io(n)}}}const koe=10*Br;function joe(e,t,n,r){let i=1/0;const{stop:o}=tl(e,n,["pointerdown","keydown"],d=>{i=d.timeStamp},{capture:!0,once:!0});let a=0;const c=ca(e,{type:$t.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(d=>{const f=tz(d,p=>p.entryType===$t.LARGEST_CONTENTFUL_PAINT&&p.startTime<i&&p.startTime<t.timeStamp&&p.startTime<koe&&p.size>a);if(f){let p;f.element&&(p=Ip(f.element,e.actionNameAttribute)),r({value:f.startTime,targetSelector:p,resourceUrl:Roe(f)}),a=f.size}});return{stop:()=>{o(),c.unsubscribe()}}}function Roe(e){return e.url===""?void 0:e.url}function I4(e,t,n=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:Ht};if(Ic($t.VISIBILITY_STATE)){const o=performance.getEntriesByType($t.VISIBILITY_STATE).filter(a=>a.name==="hidden").find(a=>a.startTime>=t.relative);if(o)return{timeStamp:o.startTime,stop:Ht}}let r=1/0;const{stop:i}=tl(e,n,["pagehide","visibilitychange"],o=>{(o.type==="pagehide"||document.visibilityState==="hidden")&&(r=o.timeStamp,i())},{capture:!0});return{get timeStamp(){return r},stop:i}}function Ioe(e,t,n,r){const i={},{stop:o}=Soe(e,h=>{n(h.loadEvent),i.navigationTimings=h,r()}),a=I4(e,t),{stop:c}=boe(e,a,h=>{i.firstContentfulPaint=h,r()}),{stop:d}=joe(e,a,window,h=>{i.largestContentfulPaint=h,r()}),{stop:f}=woe(e,a,h=>{i.firstInput=h,r()});function p(){o(),c(),d(),f(),a.stop()}return{stop:p,initialViewMetrics:i}}const n1=(e,t)=>e*t,Noe=(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:n1(i-n,o-r)},JO=e=>{const t=n1(e.previousRect.width,e.previousRect.height),n=n1(e.currentRect.width,e.currentRect.height),r=Noe(e.previousRect,e.currentRect);return t+n-r};function Toe(e,t,n){if(!Poe())return{stop:Ht};let r=0,i;n({value:0});const o=$oe(),a=ca(e,{type:$t.LAYOUT_SHIFT,buffered:!0}).subscribe(c=>{var d;for(const f of c){if(f.hadRecentInput||f.startTime<t)continue;const{cumulatedValue:p,isMaxValue:h}=o.update(f);if(h){const v=Aoe(f.sources);i={target:v?.node?new WeakRef(v.node):void 0,time:Mn(t,f.startTime),previousRect:v?.previousRect,currentRect:v?.currentRect,devicePixelRatio:window.devicePixelRatio}}if(p>r){r=p;const v=(d=i?.target)===null||d===void 0?void 0:d.deref();n({value:$m(r,4),targetSelector:v&&Ip(v,e.actionNameAttribute),time:i?.time,previousRect:i?.previousRect?eD(i.previousRect):void 0,currentRect:i?.currentRect?eD(i.currentRect):void 0,devicePixelRatio:i?.devicePixelRatio})}}});return{stop:()=>{a.unsubscribe()}}}function Aoe(e){let t;for(const n of e)if(n.node&&Za(n.node)){const r=JO(n);(!t||JO(t)<r)&&(t=n)}return t}function eD({x:e,y:t,width:n,height:r}){return{x:e,y:t,width:n,height:r}}const Ooe=5*Nr,Doe=Nr;function $oe(){let e=0,t,n,r=0;return{update:i=>{const o=t===void 0||i.startTime-n>=Doe||i.startTime-t>=Ooe;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 Poe(){return Ic($t.LAYOUT_SHIFT)&&"WeakRef"in window}let wv,N4=0,xS=1/0,wS=0;function Moe(){"interactionCount"in performance||wv||(wv=new window.PerformanceObserver(bt(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(xS=Math.min(xS,n.interactionId),wS=Math.max(wS,n.interactionId),N4=(wS-xS)/7+1)})})),wv.observe({type:"event",buffered:!0,durationThreshold:0}))}const tD=()=>wv?N4:window.performance.interactionCount||0,nD=10,zoe=1*Br;function Loe(e,t,n){if(!Voe())return{getInteractionToNextPaint:()=>{},setViewEnd:Ht,stop:Ht};const{getViewInteractionCount:r,stopViewInteractionCount:i}=Foe(n);let o=1/0;const a=Uoe(r);let c=-1,d,f;function p(y){for(const S of y)S.interactionId&&S.startTime>=t&&S.startTime<=o&&a.process(S);const b=a.estimateP98Interaction();b&&b.duration!==c&&(c=b.duration,f=Mn(t,b.startTime),d=zie(b.startTime),!d&&b.target&&Za(b.target)&&(d=Ip(b.target,e.actionNameAttribute)))}const h=ca(e,{type:$t.FIRST_INPUT,buffered:!0}).subscribe(p),v=ca(e,{type:$t.EVENT,durationThreshold:40,buffered:!0}).subscribe(p);return{getInteractionToNextPaint:()=>{if(c>=0)return{value:Math.min(c,zoe),targetSelector:d,time:f};if(r())return{value:0}},setViewEnd:y=>{o=y,i()},stop:()=>{v.unsubscribe(),h.unsubscribe()}}}function Uoe(e){const t=[];function n(){t.sort((r,i)=>i.duration-r.duration).splice(nD)}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<nD||r.duration>o.duration)&&(t.push(r),n())},estimateP98Interaction(){const r=Math.min(t.length-1,Math.floor(e()/50));return t[r]}}}function Foe(e){Moe();const t=e===La.INITIAL_LOAD?0:tD();let n={stopped:!1};function r(){return tD()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:r(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:r()}}}}function Voe(){return Ic($t.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function Boe(e,t,n,r,i,o,a){let c=i===La.INITIAL_LOAD,d=!0;const f=[],p=I4(r,o);function h(){if(!d&&!c&&f.length>0){const y=Math.max(...f);y<p.timeStamp-o.relative&&a(y)}}const{stop:v}=eE(e,t,n,r,y=>{d&&(d=!1,y.hadActivity&&f.push(Mn(o.timeStamp,y.end)),h())});return{stop:()=>{v(),p.stop()},setLoadEvent:y=>{c&&(c=!1,f.push(y),h())}}}function mAe(){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 Hoe(){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 SS;function qoe(e){return SS||(SS=Goe(e)),SS}function Goe(e){return new At(t=>{const{throttled:n}=eb(()=>{t.notify(nE())},200);return Cn(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function nE(){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 Koe=Nr;function Zoe(e,t,n,r=Woe(e)){let i=0,o=0,a=0;const c=r.subscribe(({scrollDepth:d,scrollTop:f,scrollHeight:p})=>{let h=!1;if(d>i&&(i=d,h=!0),p>o){o=p;const v=Oi();a=Mn(t.relative,v),h=!0}h&&n({maxDepth:Math.min(i,o),maxDepthScrollTop:f,maxScrollHeight:o,maxScrollHeightTime:a})});return{stop:()=>c.unsubscribe()}}function Yoe(){const e=Hoe(),{height:t}=nE(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),r=Math.round(t+e);return{scrollHeight:n,scrollDepth:r,scrollTop:e}}function Woe(e,t=Koe){return new At(n=>{function r(){n.notify(Yoe())}if(window.ResizeObserver){const i=eb(r,t,{leading:!1,trailing:!0}),o=document.scrollingElement||document.documentElement,a=new ResizeObserver(bt(i.throttled));o&&a.observe(o);const c=Cn(e,window,"scroll",i.throttled,{passive:!0});return()=>{i.cancel(),a.disconnect(),c.stop()}}})}function Xoe(e,t,n,r,i,o,a){const c={},{stop:d,setLoadEvent:f}=Boe(e,t,n,r,o,a,S=>{c.loadingTime=S,i()}),{stop:p}=Zoe(r,a,S=>{c.scroll=S}),{stop:h}=Toe(r,a.relative,S=>{c.cumulativeLayoutShift=S,i()}),{stop:v,getInteractionToNextPaint:y,setViewEnd:b}=Loe(r,a.relative,o);return{stop:()=>{d(),h(),p()},stopINPTracking:v,setLoadEvent:f,setViewEnd:b,getCommonViewMetrics:()=>(c.interactionToNextPaint=y(),c)}}function Qoe(e,t){const{stop:n}=Cn(e,window,"pageshow",r=>{r.persisted&&t(r)},{capture:!0});return n}function Joe(e,t,n){xoe(e.relative,r=>{t.firstContentfulPaint=r,t.largestContentfulPaint={value:r},n()})}const eae=3e3,tae=5*Br,nae=5*Br;function rae(e,t,n,r,i,o,a,c){const d=new Set;let f=v(La.INITIAL_LOAD,HM(),c),p;y();let h;a&&(h=b(o),i.trackBfcacheViews&&(p=Qoe(i,S=>{f.end();const C=Qy(S.timeStamp);f=v(La.BF_CACHE,C,void 0)})));function v(S,C,E){const k=iae(t,n,r,i,e,S,C,E);return d.add(k),k.stopObservable.subscribe(()=>{d.delete(k)}),k}function y(){t.subscribe(10,()=>{f=v(La.ROUTE_CHANGE,void 0,{name:f.name,service:f.service,version:f.version,context:f.contextManager.getContext()})}),t.subscribe(9,()=>{f.end({sessionIsActive:!1})})}function b(S){return S.subscribe(({oldLocation:C,newLocation:E})=>{aae(C,E)&&(f.end(),f=v(La.ROUTE_CHANGE))})}return{addTiming:(S,C=vr())=>{f.addTiming(S,C)},startView:(S,C)=>{f.end({endClocks:C}),f=v(La.ROUTE_CHANGE,C,S)},setViewContext:S=>{f.contextManager.setContext(S)},setViewContextProperty:(S,C)=>{f.contextManager.setContextProperty(S,C)},setViewName:S=>{f.setViewName(S)},getViewContext:()=>f.contextManager.getContext(),stop:()=>{h&&h.unsubscribe(),p&&p(),f.end(),d.forEach(S=>S.stop())}}}function iae(e,t,n,r,i,o,a=ir(),c){const d=Rr(),f=new At,p={};let h=0,v;const y=Zm(i),b=sb();let S=!0,C=c?.name;const E=c?.service||r.service,k=c?.version||r.version,j=c?.context;j&&b.setContext(j);const I={id:d,name:C,startClocks:a,service:E,version:k,context:j};e.notify(1,I),e.notify(2,I);const{throttled:A,cancel:N}=eb(D,eae,{leading:!1}),{setLoadEvent:T,setViewEnd:z,stop:L,stopINPTracking:G,getCommonViewMetrics:J}=Xoe(e,t,n,r,te,o,a),{stop:Z,initialViewMetrics:W}=o===La.INITIAL_LOAD?Ioe(r,a,T,te):{stop:Ht,initialViewMetrics:{}};o===La.BF_CACHE&&Joe(a,W,te);const{stop:F,eventCounts:Y}=voe(e,d,te),P=Vd(D,tae),K=e.subscribe(11,M=>{M.reason===ed.UNLOADING&&D()});D(),b.changeObservable.subscribe(te);function U(){e.notify(3,{id:d,name:C,context:b.getContext(),startClocks:a,sessionIsActive:S})}function te(){U(),A()}function D(){N(),U(),h+=1;const M=v===void 0?vr():v.timeStamp;e.notify(4,{customTimings:p,documentVersion:h,id:d,name:C,service:E,version:k,context:b.getContext(),loadingType:o,location:y,startClocks:a,commonViewMetrics:J(),initialViewMetrics:W,duration:Mn(a.timeStamp,M),isActive:v===void 0,sessionIsActive:S,eventCounts:Y})}return{get name(){return C},service:E,version:k,contextManager:b,stopObservable:f,end(M={}){var V,O;v||(v=(V=M.endClocks)!==null&&V!==void 0?V:ir(),S=(O=M.sessionIsActive)!==null&&O!==void 0?O:!0,e.notify(5,{endClocks:v}),e.notify(6,{endClocks:v}),Jy(P),z(v.relative),L(),K.unsubscribe(),D(),kr(()=>{this.stop()},nae))},stop(){Z(),F(),G(),f.notify()},addTiming(M,V){if(v)return;const O=xJ(V)?V:Mn(a.timeStamp,V);p[oae(M)]=O,te()},setViewName(M){C=M,D()}}}function oae(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&mt.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function aae(e,t){return e.pathname!==t.pathname||!sae(t.hash)&&rD(t.hash)!==rD(e.hash)}function sae(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function rD(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function lae(e,t,n,r,i,o,a,c,d,f){return e.subscribe(4,p=>e.notify(12,cae(p,n,c))),t.register(0,({startTime:p,eventType:h})=>{const v=d.findView(p);return v?{type:h,service:v.service,version:v.version,context:v.context,view:{id:v.id,name:v.name}}:nl}),t.register(1,({startTime:p})=>{var h;return{view:{id:(h=d.findView(p))===null||h===void 0?void 0:h.id}}}),rae(r,e,i,o,n,a,!n.trackViewsManually,f)}function cae(e,t,n){var r,i,o,a,c,d,f,p,h,v,y,b,S,C,E,k,j,I;const A=n.getReplayStats(e.id),N=(i=(r=e.commonViewMetrics)===null||r===void 0?void 0:r.cumulativeLayoutShift)===null||i===void 0?void 0:i.devicePixelRatio,T={_dd:{document_version:e.documentVersion,replay_stats:A,cls:N?{device_pixel_ratio:N}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:vt.VIEW,view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:(o=e.commonViewMetrics.cumulativeLayoutShift)===null||o===void 0?void 0:o.value,cumulative_layout_shift_time:gt((a=e.commonViewMetrics.cumulativeLayoutShift)===null||a===void 0?void 0:a.time),cumulative_layout_shift_target_selector:(c=e.commonViewMetrics.cumulativeLayoutShift)===null||c===void 0?void 0:c.targetSelector,first_byte:gt((d=e.initialViewMetrics.navigationTimings)===null||d===void 0?void 0:d.firstByte),dom_complete:gt((f=e.initialViewMetrics.navigationTimings)===null||f===void 0?void 0:f.domComplete),dom_content_loaded:gt((p=e.initialViewMetrics.navigationTimings)===null||p===void 0?void 0:p.domContentLoaded),dom_interactive:gt((h=e.initialViewMetrics.navigationTimings)===null||h===void 0?void 0:h.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:gt(e.initialViewMetrics.firstContentfulPaint),first_input_delay:gt((v=e.initialViewMetrics.firstInput)===null||v===void 0?void 0:v.delay),first_input_time:gt((y=e.initialViewMetrics.firstInput)===null||y===void 0?void 0:y.time),first_input_target_selector:(b=e.initialViewMetrics.firstInput)===null||b===void 0?void 0:b.targetSelector,interaction_to_next_paint:gt((S=e.commonViewMetrics.interactionToNextPaint)===null||S===void 0?void 0:S.value),interaction_to_next_paint_time:gt((C=e.commonViewMetrics.interactionToNextPaint)===null||C===void 0?void 0:C.time),interaction_to_next_paint_target_selector:(E=e.commonViewMetrics.interactionToNextPaint)===null||E===void 0?void 0:E.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:gt((k=e.initialViewMetrics.largestContentfulPaint)===null||k===void 0?void 0:k.value),largest_contentful_paint_target_selector:(j=e.initialViewMetrics.largestContentfulPaint)===null||j===void 0?void 0:j.targetSelector,load_event:gt((I=e.initialViewMetrics.navigationTimings)===null||I===void 0?void 0:I.loadEvent),loading_time:c4(gt(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:uae(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:gt(e.duration)},display:e.commonViewMetrics.scroll?{scroll:{max_depth:e.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:e.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:e.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:gt(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:One()}};return fl(e.customTimings)||(T.view.custom_timings=ZM(e.customTimings,gt)),{rawRumEvent:T,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function uae({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:r,largestContentfulPaint:i}){return{cls:e&&{score:e.value,timestamp:gt(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:gt(n)},fid:r&&{duration:gt(r.delay),timestamp:gt(r.time),target_selector:r.targetSelector},inp:t&&{duration:gt(t.value),timestamp:gt(t.time),target_selector:t.targetSelector},lcp:i&&{timestamp:gt(i.value),target_selector:i.targetSelector,resource_url:i.resourceUrl}}}const dae="rum";function fae(e,t,n){const r=Zte(e,dae,i=>pae(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 mae(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:Dz("records")?1:0};return{findTrackedSession:()=>e,expire:Ht,expireObservable:new At,setForcedReplay:Ht}}function pae(e,t){return hae(t)?t:Zl(e.sessionSampleRate)?Zl(e.sessionReplaySampleRate)?"1":"2":"0"}function hae(e){return e==="0"||e==="1"||e==="2"}function gae(e,t,n,r,i,o){const a=[e.rumEndpointBuilder];e.replica&&a.push(e.replica.rumEndpointBuilder);const c=$z({encoder:o(2),request:Oz(a,e.batchBytesLimit,n),flushController:Pz({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageMayExitObservable:r,sessionExpireObservable:i}),messageBytesLimit:e.messageBytesLimit});return t.subscribe(13,d=>{d.type===vt.VIEW?c.upsert(d,d.view.id):c.add(d)}),c}function vae(e){const t=jp();e.subscribe(13,n=>{t.send("rum",n)})}const yae=kc;function bae(e,t,n,r){const i=qd({expireDelay:yae});let o;e.subscribe(1,({startClocks:d})=>{const f=r.href;i.add(c({url:f,referrer:o||document.referrer}),d.relative),o=f}),e.subscribe(6,({endClocks:d})=>{i.closeActive(d.relative)});const a=n.subscribe(({newLocation:d})=>{const f=i.find();if(f){const p=Oi();i.closeActive(p),i.add(c({url:d.href,referrer:f.referrer}),p)}});function c({url:d,referrer:f}){return{url:d,referrer:f}}return t.register(0,({startTime:d,eventType:f})=>{const p=i.find(d);return p?{type:f,view:{url:p.url,referrer:p.referrer}}:nl}),{findUrl:d=>i.find(d),stop:()=>{a.unsubscribe(),i.stop()}}}function xae(e,t){let n=Zm(t);return new At(r=>{const{stop:i}=wae(e,a),{stop:o}=Sae(e,a);function a(){if(n.href===t.href)return;const c=Zm(t);r.notify({newLocation:c,oldLocation:n}),n=c}return()=>{i(),o()}})}function wae(e,t){const{stop:n}=ra(iD("pushState"),"pushState",({onPostCall:o})=>{o(t)}),{stop:r}=ra(iD("replaceState"),"replaceState",({onPostCall:o})=>{o(t)}),{stop:i}=Cn(e,window,"popstate",t);return{stop:()=>{n(),r(),i()}}}function Sae(e,t){return Cn(e,window,"hashchange",t)}function iD(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const _ae=kc;function Cae(e,t,n){const r=qd({expireDelay:_ae});return e.subscribe(1,({startClocks:i})=>{r.add({},i.relative)}),e.subscribe(6,({endClocks:i})=>{r.closeActive(i.relative)}),t.register(0,({startTime:i,eventType:o})=>{if(!n.trackFeatureFlagsForEvents.concat([vt.VIEW,vt.ERROR]).includes(o))return Di;const c=r.find(i);return!c||fl(c)?Di:{type:o,feature_flags:c}}),{addFeatureFlagEvaluation:(i,o)=>{const a=r.find();a&&(a[i]=o)}}}const Eae=10*Nr;let td,Pg;function kae(e,t,n){e.metricsEnabled&&(T4(),Pg=!1,t.subscribe(13,()=>{Pg=!0}),n.subscribe(({bytesCount:r,messagesCount:i})=>{Pg&&(Pg=!1,td.batchCount+=1,aD(td.batchBytesCount,r),aD(td.batchMessagesCount,i))}),Vd(jae,Eae))}function jae(){td.batchCount!==0&&(ab("Customer data measures",td),T4())}function oD(){return{min:1/0,max:0,sum:0}}function aD(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function T4(){td={batchCount:0,batchBytesCount:oD(),batchMessagesCount:oD()}}const Rae=4e3,Iae=500,Nae=kc;function Tae(e,t,n=Iae){const r=qd({expireDelay:Nae,maxEntries:Rae});let i;Ic($t.VISIBILITY_STATE)&&performance.getEntriesByType($t.VISIBILITY_STATE).forEach(f=>{const p=f.name==="hidden"?"hidden":"active";a(p,f.startTime)}),a(A4(),Oi());const{stop:o}=tl(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],d=>{a(Oae(d),d.timeStamp)},{capture:!0});function a(d,f=Oi()){d!==i&&(i=d,r.closeActive(f),r.add({state:i,startTime:f},f))}function c(d,f,p){return r.findAll(f,p).some(h=>h.state===d)}return e.register(0,({startTime:d,duration:f=0,eventType:p})=>{if(p===vt.VIEW){const h=r.findAll(d,f);return{type:p,_dd:{page_states:Aae(h,d,n)}}}return p===vt.ACTION||p===vt.ERROR?{type:p,view:{in_foreground:c("active",d,0)}}:Di}),{wasInPageStateDuringPeriod:c,addPageState:a,stop:()=>{o(),r.stop()}}}function Aae(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:r,startTime:i})=>({state:r,start:gt(Mn(t,i))}))}function Oae(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":A4()}function A4(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function Dae(e,t){let n;const r=requestAnimationFrame(bt(()=>{n=nE()})),i=qoe(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 $ae(e,t){const n=window.cookieStore?Pae(e):zae;return new At(r=>n(t,i=>r.notify(i)))}function Pae(e){return(t,n)=>Cn(e,window.cookieStore,"change",i=>{const o=i.changed.find(a=>a.name===t)||i.deleted.find(a=>a.name===t);o&&n(o.value)}).stop}const Mae=Nr;function zae(e,t){const n=Ym(document.cookie,e),r=Vd(()=>{const i=Ym(document.cookie,e);i!==n&&t(i)},Mae);return()=>{Jy(r)}}const sD="datadog-ci-visibility-test-execution-id";function Lae(e,t,n=$ae(e,sD)){var r;let i=zs(sD)||((r=window.Cypress)===null||r===void 0?void 0:r.env("traceId"));const o=n.subscribe(a=>{i=a});return t.register(0,({eventType:a})=>typeof i!="string"?Di:{type:a,session:{type:"ci_test"},ci_test:{test_execution_id:i}}),{stop:()=>{o.unsubscribe()}}}function Uae(e,t){const n=ca(t,{type:$t.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(r=>{for(const i of r){const o=Qy(i.startTime),a={date:o.timeStamp,long_task:{id:Rr(),entry_type:Zz.LONG_ANIMATION_FRAME,duration:gt(i.duration),blocking_duration:gt(i.blockingDuration),first_ui_event_timestamp:gt(i.firstUIEventTimestamp),render_start:gt(i.renderStart),style_and_layout_start:gt(i.styleAndLayoutStart),start_time:gt(i.startTime),scripts:i.scripts.map(c=>({duration:gt(c.duration),pause_duration:gt(c.pauseDuration),forced_style_and_layout_duration:gt(c.forcedStyleAndLayoutDuration),start_time:gt(c.startTime),execution_start:gt(c.executionStart),source_url:c.sourceURL,source_function_name:c.sourceFunctionName,source_char_position:c.sourceCharPosition,invoker:c.invoker,invoker_type:c.invokerType,window_attribution:c.windowAttribution}))},type:vt.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:o.relative,duration:i.duration,domainContext:{performanceEntry:i}})}});return{stop:()=>n.unsubscribe()}}function Fae(e,t){const n=ca(t,{type:$t.LONG_TASK,buffered:!0}).subscribe(r=>{for(const i of r){if(i.entryType!==$t.LONG_TASK||!t.trackLongTasks)break;const o=Qy(i.startTime),a={date:o.timeStamp,long_task:{id:Rr(),entry_type:Zz.LONG_TASK,duration:gt(i.duration)},type:vt.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:o.relative,duration:i.duration,domainContext:{performanceEntry:i}})}});return{stop(){n.unsubscribe()}}}function Vae(e){e.register(0,({eventType:t})=>{if(!Fz())return Di;const n=Lz(),r=Uz();return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:r,injected:zz()}}})}function Bae(e,t,n){const r=KC(e),i=n(r);return BC(t).forEach(([o,a])=>r1(e,r,o.split(/\.|(?=\[\])/),a)),i}function r1(e,t,n,r){const[i,...o]=n;if(i==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((a,c)=>r1(a,t[c],o,r));return}if(!(!lD(e)||!lD(t))){if(o.length>0)return r1(e[i],t[i],o,r);Hae(e,i,t[i],r)}}function Hae(e,t,n,r){const i=jc(n);i===r?e[t]=fn(n):r==="object"&&(i==="undefined"||i==="null")&&(e[t]={})}function lD(e){return jc(e)==="object"}const Au={"view.name":"string","view.url":"string","view.referrer":"string"},Ou={context:"object"},Du={service:"string",version:"string"};let O4;function qae(e,t,n,r){O4={[vt.VIEW]:{"view.performance.lcp.resource_url":"string",...Ou,...Au,...Du},[vt.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...Ou,...Au,...Du},[vt.RESOURCE]:{"resource.url":"string","resource.graphql.variables":"string",...Ou,...Au,...Du},[vt.ACTION]:{"action.target.name":"string",...Ou,...Au,...Du},[vt.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...Ou,...Au,...Du},[vt.VITAL]:{...Ou,...Au,...Du}};const i={[vt.ERROR]:dS(vt.ERROR,e.eventRateLimiterThreshold,r),[vt.ACTION]:dS(vt.ACTION,e.eventRateLimiterThreshold,r),[vt.VITAL]:dS(vt.VITAL,e.eventRateLimiterThreshold,r)};t.subscribe(12,({startTime:o,duration:a,rawRumEvent:c,domainContext:d})=>{const f=n.triggerHook(0,{eventType:c.type,startTime:o,duration:a});if(f===nl)return;const p=Ka(f,c,{ddtags:_z(e).join(",")});Gae(p,e.beforeSend,d,i)&&(fl(p.context)&&delete p.context,t.notify(13,p))})}function Gae(e,t,n,r){var i;if(t){const a=Bae(e,O4[e.type],c=>t(c,n));if(a===!1&&e.type!==vt.VIEW)return!1;a===!1&&mt.warn("Can't dismiss view events using beforeSend!")}return!((i=r[e.type])===null||i===void 0?void 0:i.isLimitReached())}function Kae(e,t,n,r){e.register(0,({eventType:i,startTime:o})=>{const a=t.findTrackedSession(o),c=r.findView(o);if(!a||!c)return nl;let d,f,p;return i===vt.VIEW?(d=n.getReplayStats(c.id)?!0:void 0,f=a.sessionReplay===1,p=c.sessionIsActive?void 0:!1):d=n.isRecording()?!0:void 0,{type:i,session:{id:a.id,type:"user",has_replay:d,sampled_for_replay:f,is_active:p}}}),e.register(1,({startTime:i})=>{const o=t.findTrackedSession(i);return o?{session:{id:o.id}}:Di})}function Zae(e){e.register(0,({eventType:t})=>({type:t,connectivity:Ez()}))}function Yae(e,t,n){e.register(0,({eventType:r})=>{const i=t.source;return{type:r,_dd:{format_version:2,drift:yJ(),configuration:{session_sample_rate:$m(t.sessionSampleRate,3),session_replay_sample_rate:$m(t.sessionReplaySampleRate,3),profiling_sample_rate:$m(t.profilingSampleRate,3),beta_encode_cookie_options:t.betaEncodeCookieOptions},browser_sdk_version:yd()?"6.24.0":void 0,sdk_name:n},application:{id:t.applicationId},date:vr(),source:i}}),e.register(1,()=>({application:{id:t.applicationId}}))}function Wae(e,t){e.register(1,()=>t.isGranted()?Di:nl)}const Xae=Ite,Qae=[vt.ACTION,vt.ERROR,vt.LONG_TASK,vt.RESOURCE,vt.VITAL];function Jae(e){return{addEvent:(t,n,r,i)=>{Qae.includes(n.type)&&e.notify(12,{startTime:t,rawRumEvent:n,domainContext:r,duration:i})}}}function ese(e,t){if(!t.metricsEnabled)return{stop:Ht};const{unsubscribe:n}=e.subscribe(4,({initialViewMetrics:r})=>{!r.largestContentfulPaint||!r.navigationTimings||(ab("Initial view metrics",{metrics:tse(r.largestContentfulPaint,r.navigationTimings)}),n())});return{stop:n}}function tse(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function nse(e,t,n,r,i,o,a,c,d){const f=[],p=new kre,h=Xae();p.subscribe(13,ie=>Cz("rum",ie));const v=ie=>{p.notify(14,{error:ie}),Rp("Error reported to customer",{"error.message":ie.message})},y=jte(e),b=y.subscribe(ie=>{p.notify(11,ie)});f.push(()=>b.unsubscribe());const S=Ote("browser-rum-sdk",e,h,v,y,i);f.push(S.stop);const C=yd()?mae():fae(e,p,o);if(yd())vae(p);else{const ie=gae(e,p,v,y,C.expireObservable,i);f.push(()=>ie.stop()),kae(S,p,ie.flushController.flushObservable)}const E=Sre(),k=xae(e,location),{observable:j,stop:I}=Cre();f.push(I),Yae(h,e,d);const A=Tae(h,e),N=Rre(p);f.push(()=>N.stop());const T=bae(p,h,k,location);f.push(()=>T.stop());const z=Cae(p,h,e);Kae(h,C,t,N),Zae(h),Wae(h,o);const L=Ine(h,e,"rum"),G=Nne(h,e,C,"rum"),J=Rne(h,e,"rum"),{actionContexts:Z,addAction:W,addEvent:F,stop:Y}=rse(p,h,e,A,E,j,v);f.push(Y);const{addTiming:P,startView:K,setViewName:U,setViewContext:te,setViewContextProperty:D,getViewContext:M,stop:V}=lae(p,h,e,location,E,j,k,t,N,r);f.push(V);const{stop:O}=ese(p,S);f.push(O);const{stop:ee}=loe(p,e,A);if(f.push(ee),e.trackLongTasks)if(Ic($t.LONG_ANIMATION_FRAME)){const{stop:ie}=Uae(p,e);f.push(ie)}else Fae(p,e);const{addError:ue}=Zie(p,e,c);c.unbuffer(),qre(p,e,C,G,J);const pe=$ne(p,A,a),B=Ere(e.applicationId,C,N,Z,T);return f.push(()=>n.stop()),{addAction:W,addEvent:F,addError:ue,addTiming:P,addFeatureFlagEvaluation:z.addFeatureFlagEvaluation,startView:K,setViewContext:te,setViewContextProperty:D,getViewContext:M,setViewName:U,lifeCycle:p,viewHistory:N,session:C,stopSession:()=>C.expire(),getInternalContext:B.get,startDurationVital:pe.startDurationVital,stopDurationVital:pe.stopDurationVital,addDurationVital:pe.addDurationVital,addOperationStepVital:pe.addOperationStepVital,globalContext:L,userContext:G,accountContext:J,telemetry:S,stop:()=>{f.forEach(ie=>ie())},hooks:h}}function rse(e,t,n,r,i,o,a){const c=qie(e,t,i,o,n),d=Jae(e),f=Dae(t,n),p=Lae(n,t);return Vae(t),qae(n,e,t,a),{pageStateHistory:r,addAction:c.addAction,addEvent:d.addEvent,actionContexts:c.actionContexts,stop:()=>{c.stop(),p.stop(),f.stop(),r.stop()}}}function ise(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=ose(e),c=`/rum/replay/sessions/${i}`;return`${a}${c}?${o.join("&")}`}function ose(e){const t=e.site,n=e.subdomain||ase(e);return`https://${n?`${n}.`:""}${t}`}function ase(e){switch(e.site){case Yl:case fee:return"app";case pz:return"dd";default:return}}const sse=1e3;let to;function pAe(e){return db(e).segments_count}function hAe(e){db(e).segments_count+=1}function gAe(e){db(e).records_count+=1}function vAe(e,t){db(e).segments_total_raw_size+=t}function lse(e){return to?.get(e)}function db(e){to||(to=new Map);let t;return to.has(e)?t=to.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},to.set(e,t),to.size>sse&&cse()),t}function cse(){if(!to)return;const e=to.keys().next().value;e&&to.delete(e)}function D4(e,t,n){let r=0,i=[],o,a=!0,c=0;const d=[],{stop:f}=Cn(e,t,"message",({data:v})=>{if(v.type!=="wrote"||v.streamId!==n)return;const y=d[0];y&&(y.id===v.id?(d.shift(),r+=v.additionalBytesCount,i.push(v.result),o=v.trailer,y.writeCallback?y.writeCallback(v.result.byteLength):y.finishCallback&&y.finishCallback()):y.id<v.id&&f())});function p(){const v=i.length===0?new Uint8Array(0):KM(i.concat(o)),y={rawBytesCount:r,output:v,outputBytesCount:v.byteLength,encoding:"deflate"};return r=0,i=[],y}function h(){a||(t.postMessage({action:"reset",streamId:n}),a=!0)}return{isAsync:!0,get isEmpty(){return a},write(v,y){t.postMessage({action:"write",id:c,data:v,streamId:n}),d.push({id:c,writeCallback:y,data:v}),a=!1,c+=1},finish(v){h(),d.length?(d.forEach(y=>{delete y.writeCallback}),d[d.length-1].finishCallback=()=>v(p())):v(p())},finishSync(){h();const v=d.map(y=>y.data).join("");return d.length=0,{...p(),pendingData:v}},estimateEncodedBytesCount(v){return v.length/8},stop(){f()}}}function rE({configuredUrl:e,error:t,source:n,scriptType:r}){if(mt.error(`${n} failed to start: an error occurred while initializing the ${r}:`,t),t instanceof Event||t instanceof Error&&use(t.message)){let i;e?i=`Please make sure the ${r} URL ${e} is correct and CSP is correctly configured.`:i="Please make sure CSP is correctly configured.",mt.error(`${i} See documentation at ${Xy}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else r==="worker"&&ZC(t)}function use(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const dse=30*Nr;function $4(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){if(1===t.length)return t[0];const e=t.reduce((t,e)=>t+e.length,0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!==--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return-1^t},O={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=L(t.adler,e,r,a):2===t.state.wrap&&(t.adler=T(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!==--r);return s<=t.lookahead?s:t.lookahead},at=function(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-J)){t.window.set(t.window.subarray(s,s+s),0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--a);e=a=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=tt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},nt=function(t,e){for(var a,n;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},rt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function it(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var st=[new it(0,0,0,0,function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)}),new it(4,4,8,4,nt),new it(4,5,16,8,nt),new it(4,6,32,32,nt),new it(4,4,16,16,rt),new it(8,16,32,32,rt),new it(8,16,128,128,rt),new it(8,32,128,256,rt),new it(32,128,258,1024,rt),new it(32,258,258,4096,rt)];function ht(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var lt=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=st[e.level].max_lazy,e.good_match=st[e.level].good_length,e.nice_match=st[e.level].nice_length,e.max_chain_length=st[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},_t=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(at(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(at(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):st[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},ot=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},dt=new Uint8Array(256),ut=0;ut<256;ut++)dt[ut]=ut>=252?6:ut>=248?5:ut>=240?4:ut>=224?3:ut>=192?2:1;dt[254]=dt[254]=1;var ft=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ct=Object.prototype.toString;function pt(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new ht;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,lt(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ct.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,at(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,at(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function gt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function vt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}pt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ct.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=_t(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=ot(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},pt.prototype.onData=function(t){this.chunks.push(t)},pt.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.24.0"};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 Pn={status:0};function P4(e,t,n,r=$4){switch(Pn.status===0&&fse(e,t,r),Pn.status){case 1:return Pn.initializationFailureCallbacks.push(n),Pn.worker;case 3:return Pn.worker}}function cD(){return Pn.status}function fse(e,t,n=$4){try{const r=n(e),{stop:i}=Cn(e,r,"error",c=>{_S(e,t,c)}),{stop:o}=Cn(e,r,"message",({data:c})=>{c.type==="errored"?_S(e,t,c.error,c.streamId):c.type==="initialized"&&pse(c.version)});r.postMessage({action:"init"}),kr(()=>mse(t),dse),Pn={status:1,worker:r,stop:()=>{i(),o()},initializationFailureCallbacks:[]}}catch(r){_S(e,t,r)}}function mse(e){Pn.status===1&&(mt.error(`${e} failed to start: a timeout occurred while initializing the Worker`),Pn.initializationFailureCallbacks.forEach(t=>t()),Pn={status:2})}function pse(e){Pn.status===1&&(Pn={status:3,worker:Pn.worker,stop:Pn.stop,version:e})}function _S(e,t,n,r){Pn.status===1||Pn.status===0?(rE({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),Pn.status===1&&Pn.initializationFailureCallbacks.forEach(i=>i()),Pn={status:2}):ZC(n,{worker_version:Pn.status===3&&Pn.version,stream_id:r})}function M4(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function hse(e,t,n,r){const i=t.findTrackedSession(),o=gse(i,r),a=n.findView();return ise(e,{viewContext:a,errorType:o,session:i})}function gse(e,t){if(!M4())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 vse(e,t){if(!e.metricsEnabled)return{stop:Ht};let n,r,i;const{unsubscribe:o}=t.subscribe(a=>{switch(a.type){case"start":n={forced:a.forced,timestamp:vr()},r=void 0,i=void 0;break;case"document-ready":n&&(r=Mn(n.timestamp,vr()));break;case"recorder-settled":n&&(i=Mn(n.timestamp,vr()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":o(),n&&ab("Recorder init metrics",{metrics:yse(n.forced,i,Mn(n.timestamp,vr()),a.type,r)});break}});return{stop:o}}function yse(e,t,n,r,i){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:n,result:r,waitForDocReadyDuration:i}}function bse(e,t,n,r,i,o,a){let c=0,d;t.subscribe(9,()=>{(c===2||c===3)&&(v(),c=1)}),t.subscribe(10,()=>{c===1&&h()});const f=new At;vse(a,f);const p=async y=>{f.notify({type:"start",forced:y});const[b]=await Promise.all([uD(f,{type:"recorder-settled"},i()),uD(f,{type:"document-ready"},nne(e,"interactive"))]);if(c!==2){f.notify({type:"aborted"});return}if(!b){c=0,f.notify({type:"recorder-load-failed"});return}const S=o();if(!S){c=0,f.notify({type:"deflate-encoder-load-failed"});return}({stop:d}=b(t,e,n,r,S,a)),c=3,f.notify({type:"succeeded"})};function h(y){const b=n.findTrackedSession();if(xse(b,y)){c=1;return}if(wse(c))return;c=2;const S=Sse(b,y)||!1;p(S).catch(Js),S&&n.setForcedReplay()}function v(){c===3&&d?.(),c=0}return{start:h,stop:v,getSessionReplayLink(){return hse(e,n,r,c!==0)},isRecording:()=>c===3}}function xse(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function wse(e){return e===2||e===3}function Sse(e,t){return t&&t.force&&e.sessionReplay===0}async function uD(e,t,n){try{return await n}finally{e.notify(t)}}function _se(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:Ht},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function Cse(e,t){if(yd()&&!Dz("records")||!M4())return{start:Ht,stop:Ht,getReplayStats:()=>{},onRumStart:Ht,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:r}=_se();return{start:o=>n.start(o),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:i,isRecording:()=>cD()===3&&n.isRecording(),getReplayStats:o=>cD()===3?lse(o):void 0};function i(o,a,c,d,f,p){let h;function v(){return h||(f??(f=P4(a,"Datadog Session Replay",()=>{n.stop()},t)),f&&(h=D4(a,f,1))),h}n=bse(a,o,c,d,e,v,p),r(a)&&n.start()}}const Ese="modulepreload",kse=function(e){return"/"+e},dD={},Np=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let d=function(f){return Promise.all(f.map(p=>Promise.resolve(p).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");i=d(n.map(f=>{if(f=kse(f),f in dD)return;dD[f]=!0;const p=f.endsWith(".css"),h=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${h}`))return;const v=document.createElement("link");if(v.rel=p?"stylesheet":Ese,p||(v.as="script"),v.crossOrigin="",v.href=f,c&&v.setAttribute("nonce",c),document.head.appendChild(v),p)return new Promise((y,b)=>{v.addEventListener("load",y),v.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return i.then(a=>{for(const c of a||[])c.status==="rejected"&&o(c.reason);return t().catch(o)})};async function jse(e=Rse){try{return await e()}catch(t){rE({error:t,source:"Recorder",scriptType:"module"})}}async function Rse(){return(await Np(()=>import("./startRecording-CaSy66M8.js"),[])).startRecording}function Ise(){return go().Profiler!==void 0}const Nse=e=>{let t={status:"starting"};return e.register(0,({eventType:n})=>n!==vt.VIEW&&n!==vt.LONG_TASK?Di:{type:n,_dd:{profiling:t}}),{get:()=>t,set:n=>{t=n}}};async function Tse(e=Ase){try{return await e()}catch(t){rE({error:t,source:"Profiler",scriptType:"module"})}}async function Ase(){return(await Np(()=>import("./profiler-DPOPHs4U.js"),[])).createRumProfiler}function Ose(){let e;function t(n,r,i,o,a,c){const d=o.findTrackedSession();if(!d||!Qz(d.id,i.profilingSampleRate))return;const f=Nse(r);if(!Ise()){f.set({status:"error",error_reason:"not-supported-by-browser"});return}Tse().then(p=>{if(!p){Rp("[DD_RUM] Failed to lazy load the RUM Profiler"),f.set({status:"error",error_reason:"failed-to-lazy-load"});return}e=p(i,n,o,f,c),e.start(a.findView())}).catch(Js)}return{onRumStart:t,stop:()=>{e?.stop().catch(Js)}}}const Dse=Cse(jse),$se=Ose(),Pse=xre(nse,Dse,$se,{startDeflateWorker:P4,createDeflateEncoder:D4,sdkName:"rum"});rte(go(),"DD_RUM",Pse);function Sv(e,t){Xm("react error"),ir()}const fD={didCatch:!1,error:null};class yAe extends X.Component{constructor(t){super(t),this.resetError=()=>{this.setState(fD)},this.state=fD}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}componentDidCatch(t,n){Sv()}render(){return this.state.didCatch?X.createElement(this.props.fallback,{error:this.state.error,resetError:this.resetError}):this.props.children}}let mD=!1;function Mse(){x.useEffect(()=>{mD||(mD=!0)},[])}function zse(){return u.jsx(u.Fragment,{children:u.jsx(ll,{})})}const fb=NY()({component:zse});function Lse(){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 iE(){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 Use(e,t){const n=x.createContext(t),r=o=>{const{children:a,...c}=o,d=x.useMemo(()=>c,Object.values(c));return u.jsx(n.Provider,{value:d,children:a})};r.displayName=e+"Provider";function i(o){const a=x.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function Mi(e,t=[]){let n=[];function r(o,a){const c=x.createContext(a),d=n.length;n=[...n,a];const f=h=>{const{scope:v,children:y,...b}=h,S=v?.[e]?.[d]||c,C=x.useMemo(()=>b,Object.values(b));return u.jsx(S.Provider,{value:C,children:y})};f.displayName=o+"Provider";function p(h,v){const y=v?.[e]?.[d]||c,b=x.useContext(y);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,p]}const i=()=>{const o=n.map(a=>x.createContext(a));return function(c){const d=c?.[e]||o;return x.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return i.scopeName=e,[r,Fse(i,...t)]}function Fse(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((c,{useScope:d,scopeName:f})=>{const h=d(o)[`__scope${f}`];return{...c,...h}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function je(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function bd(e){const t=Vse(e),n=x.forwardRef((r,i)=>{const{children:o,...a}=r,c=x.Children.toArray(o),d=c.find(Hse);if(d){const f=d.props.children,p=c.map(h=>h===d?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:h);return u.jsx(t,{...a,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,p):null})}return u.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function Vse(e){const t=x.forwardRef((n,r)=>{const{children:i,...o}=n;if(x.isValidElement(i)){const a=Gse(i),c=qse(o,i.props);return i.type!==x.Fragment&&(c.ref=r?Ud(r,a):a),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var z4=Symbol("radix.slottable");function Bse(e){const t=({children:n})=>u.jsx(u.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=z4,t}function Hse(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===z4}function qse(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...c)=>{const d=o(...c);return i(...c),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Gse(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 Kse=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ke=Kse.reduce((e,t)=>{const n=bd(`Primitive.${t}`),r=x.forwardRef((i,o)=>{const{asChild:a,...c}=i,d=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(d,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Kv(e,t){e&&Md.flushSync(()=>e.dispatchEvent(t))}var Yn=globalThis?.document?x.useLayoutEffect:()=>{},Zse=_C[" useInsertionEffect ".trim().toString()]||Yn;function Do({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=Yse({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:i;{const p=x.useRef(e!==void 0);x.useEffect(()=>{const h=p.current;h!==c&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=c},[c,r])}const f=x.useCallback(p=>{if(c){const h=Wse(p)?p(e):p;h!==e&&a.current?.(h)}else o(p)},[c,e,o,a]);return[d,f]}function Yse({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),o=x.useRef(t);return Zse(()=>{o.current=t},[t]),x.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function Wse(e){return typeof e=="function"}var Xse=x.createContext(void 0);function Nc(e){const t=x.useContext(Xse);return e||t||"ltr"}function Qse(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var Wn=e=>{const{present:t,children:n}=e,r=Jse(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),o=ut(r.ref,ele(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:o}):null};Wn.displayName="Presence";function Jse(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),o=x.useRef("none"),a=e?"mounted":"unmounted",[c,d]=Qse(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const f=Mg(r.current);o.current=c==="mounted"?f:"none"},[c]),Yn(()=>{const f=r.current,p=i.current;if(p!==e){const v=o.current,y=Mg(f);e?d("MOUNT"):y==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&v!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),Yn(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,h=y=>{const S=Mg(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&S&&(d("ANIMATION_END"),!i.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},v=y=>{y.target===t&&(o.current=Mg(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:x.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Mg(e){return e?.animationName||"none"}function ele(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tle=_C[" useId ".trim().toString()]||(()=>{}),nle=0;function Ni(e){const[t,n]=x.useState(tle());return Yn(()=>{n(r=>r??String(nle++))},[e]),t?`radix-${t}`:""}function Tp(e){const t=e+"CollectionProvider",[n,r]=Mi(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=S=>{const{scope:C,children:E}=S,k=X.useRef(null),j=X.useRef(new Map).current;return u.jsx(i,{scope:C,itemMap:j,collectionRef:k,children:E})};a.displayName=t;const c=e+"CollectionSlot",d=bd(c),f=X.forwardRef((S,C)=>{const{scope:E,children:k}=S,j=o(c,E),I=ut(C,j.collectionRef);return u.jsx(d,{ref:I,children:k})});f.displayName=c;const p=e+"CollectionItemSlot",h="data-radix-collection-item",v=bd(p),y=X.forwardRef((S,C)=>{const{scope:E,children:k,...j}=S,I=X.useRef(null),A=ut(C,I),N=o(p,E);return X.useEffect(()=>(N.itemMap.set(I,{ref:I,...j}),()=>void N.itemMap.delete(I))),u.jsx(v,{[h]:"",ref:A,children:k})});y.displayName=p;function b(S){const C=o(e+"CollectionConsumer",S);return X.useCallback(()=>{const k=C.collectionRef.current;if(!k)return[];const j=Array.from(k.querySelectorAll(`[${h}]`));return Array.from(C.itemMap.values()).sort((N,T)=>j.indexOf(N.ref.current)-j.indexOf(T.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:a,Slot:f,ItemSlot:y},b,r]}function bn(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}function rle(e,t=globalThis?.document){const n=bn(e);x.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ile="DismissableLayer",i1="dismissableLayer.update",ole="dismissableLayer.pointerDownOutside",ale="dismissableLayer.focusOutside",pD,L4=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gd=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...d}=e,f=x.useContext(L4),[p,h]=x.useState(null),v=p?.ownerDocument??globalThis?.document,[,y]=x.useState({}),b=ut(t,T=>h(T)),S=Array.from(f.layers),[C]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),E=S.indexOf(C),k=p?S.indexOf(p):-1,j=f.layersWithOutsidePointerEventsDisabled.size>0,I=k>=E,A=cle(T=>{const z=T.target,L=[...f.branches].some(G=>G.contains(z));!I||L||(i?.(T),a?.(T),T.defaultPrevented||c?.())},v),N=ule(T=>{const z=T.target;[...f.branches].some(G=>G.contains(z))||(o?.(T),a?.(T),T.defaultPrevented||c?.())},v);return rle(T=>{k===f.layers.size-1&&(r?.(T),!T.defaultPrevented&&c&&(T.preventDefault(),c()))},v),x.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(pD=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),hD(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=pD)}},[p,v,n,f]),x.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),hD())},[p,f]),x.useEffect(()=>{const T=()=>y({});return document.addEventListener(i1,T),()=>document.removeEventListener(i1,T)},[]),u.jsx(Ke.div,{...d,ref:b,style:{pointerEvents:j?I?"auto":"none":void 0,...e.style},onFocusCapture:je(e.onFocusCapture,N.onFocusCapture),onBlurCapture:je(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:je(e.onPointerDownCapture,A.onPointerDownCapture)})});Gd.displayName=ile;var sle="DismissableLayerBranch",lle=x.forwardRef((e,t)=>{const n=x.useContext(L4),r=x.useRef(null),i=ut(t,r);return x.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(Ke.div,{...e,ref:i})});lle.displayName=sle;function cle(e,t=globalThis?.document){const n=bn(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const o=c=>{if(c.target&&!r.current){let d=function(){U4(ole,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=d,t.addEventListener("click",i.current,{once:!0})):d()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ule(e,t=globalThis?.document){const n=bn(e),r=x.useRef(!1);return x.useEffect(()=>{const i=o=>{o.target&&!r.current&&U4(ale,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 hD(){const e=new CustomEvent(i1);document.dispatchEvent(e)}function U4(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?Kv(i,o):i.dispatchEvent(o)}function oE(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var F4=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"}),dle="VisuallyHidden",V4=x.forwardRef((e,t)=>u.jsx(Ke.span,{...e,ref:t,style:{...F4,...e.style}}));V4.displayName=dle;var B4=V4,Tc="NavigationMenu",[aE,H4,fle]=Tp(Tc),[o1,mle,ple]=Tp(Tc),[sE]=Mi(Tc,[fle,ple]),[hle,vo]=sE(Tc),[gle,vle]=sE(Tc),q4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:o,delayDuration:a=200,skipDelayDuration:c=300,orientation:d="horizontal",dir:f,...p}=e,[h,v]=x.useState(null),y=ut(t,L=>v(L)),b=Nc(f),S=x.useRef(0),C=x.useRef(0),E=x.useRef(0),[k,j]=x.useState(!0),[I,A]=Do({prop:r,onChange:L=>{const G=L!=="",J=c>0;G?(window.clearTimeout(E.current),J&&j(!1)):(window.clearTimeout(E.current),E.current=window.setTimeout(()=>j(!0),c)),i?.(L)},defaultProp:o??"",caller:Tc}),N=x.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>A(""),150)},[A]),T=x.useCallback(L=>{window.clearTimeout(C.current),A(L)},[A]),z=x.useCallback(L=>{I===L?window.clearTimeout(C.current):S.current=window.setTimeout(()=>{window.clearTimeout(C.current),A(L)},a)},[I,A,a]);return x.useEffect(()=>()=>{window.clearTimeout(S.current),window.clearTimeout(C.current),window.clearTimeout(E.current)},[]),u.jsx(G4,{scope:n,isRootMenu:!0,value:I,dir:b,orientation:d,rootNavigationMenu:h,onTriggerEnter:L=>{window.clearTimeout(S.current),k?z(L):T(L)},onTriggerLeave:()=>{window.clearTimeout(S.current),N()},onContentEnter:()=>window.clearTimeout(C.current),onContentLeave:N,onItemSelect:L=>{A(G=>G===L?"":L)},onItemDismiss:()=>A(""),children:u.jsx(Ke.nav,{"aria-label":"Main","data-orientation":d,dir:b,...p,ref:y})})});q4.displayName=Tc;var a1="NavigationMenuSub",yle=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",...c}=e,d=vo(a1,n),[f,p]=Do({prop:r,onChange:i,defaultProp:o??"",caller:a1});return u.jsx(G4,{scope:n,isRootMenu:!1,value:f,dir:d.dir,orientation:a,rootNavigationMenu:d.rootNavigationMenu,onTriggerEnter:h=>p(h),onItemSelect:h=>p(h),onItemDismiss:()=>p(""),children:u.jsx(Ke.div,{"data-orientation":a,...c,ref:t})})});yle.displayName=a1;var G4=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:i,orientation:o,children:a,value:c,onItemSelect:d,onItemDismiss:f,onTriggerEnter:p,onTriggerLeave:h,onContentEnter:v,onContentLeave:y}=e,[b,S]=x.useState(null),[C,E]=x.useState(new Map),[k,j]=x.useState(null);return u.jsx(hle,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:c,previousValue:oE(c),baseId:Ni(),dir:i,orientation:o,viewport:b,onViewportChange:S,indicatorTrack:k,onIndicatorTrackChange:j,onTriggerEnter:bn(p),onTriggerLeave:bn(h),onContentEnter:bn(v),onContentLeave:bn(y),onItemSelect:bn(d),onItemDismiss:bn(f),onViewportContentChange:x.useCallback((I,A)=>{E(N=>(N.set(I,A),new Map(N)))},[]),onViewportContentRemove:x.useCallback(I=>{E(A=>A.has(I)?(A.delete(I),new Map(A)):A)},[]),children:u.jsx(aE.Provider,{scope:t,children:u.jsx(gle,{scope:t,items:C,children:a})})})},K4="NavigationMenuList",Z4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=vo(K4,n),o=u.jsx(Ke.ul,{"data-orientation":i.orientation,...r,ref:t});return u.jsx(Ke.div,{style:{position:"relative"},ref:i.onIndicatorTrackChange,children:u.jsx(aE.Slot,{scope:n,children:i.isRootMenu?u.jsx(tL,{asChild:!0,children:o}):o})})});Z4.displayName=K4;var Y4="NavigationMenuItem",[ble,W4]=sE(Y4),X4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...i}=e,o=Ni(),a=r||o||"LEGACY_REACT_AUTO_VALUE",c=x.useRef(null),d=x.useRef(null),f=x.useRef(null),p=x.useRef(()=>{}),h=x.useRef(!1),v=x.useCallback((b="start")=>{if(c.current){p.current();const S=l1(c.current);S.length&&uE(b==="start"?S:S.reverse())}},[]),y=x.useCallback(()=>{if(c.current){const b=l1(c.current);b.length&&(p.current=Ile(b))}},[]);return u.jsx(ble,{scope:n,value:a,triggerRef:d,contentRef:c,focusProxyRef:f,wasEscapeCloseRef:h,onEntryKeyDown:v,onFocusProxyEnter:v,onRootContentClose:y,onContentFocusOutside:y,children:u.jsx(Ke.li,{...i,ref:t})})});X4.displayName=Y4;var s1="NavigationMenuTrigger",xle=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...i}=e,o=vo(s1,e.__scopeNavigationMenu),a=W4(s1,e.__scopeNavigationMenu),c=x.useRef(null),d=ut(c,a.triggerRef,t),f=rL(o.baseId,a.value),p=iL(o.baseId,a.value),h=x.useRef(!1),v=x.useRef(!1),y=a.value===o.value;return u.jsxs(u.Fragment,{children:[u.jsx(aE.ItemSlot,{scope:n,value:a.value,children:u.jsx(nL,{asChild:!0,children:u.jsx(Ke.button,{id:f,disabled:r,"data-disabled":r?"":void 0,"data-state":dE(y),"aria-expanded":y,"aria-controls":p,...i,ref:d,onPointerEnter:je(e.onPointerEnter,()=>{v.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:je(e.onPointerMove,Zv(()=>{r||v.current||a.wasEscapeCloseRef.current||h.current||(o.onTriggerEnter(a.value),h.current=!0)})),onPointerLeave:je(e.onPointerLeave,Zv(()=>{r||(o.onTriggerLeave(),h.current=!1)})),onClick:je(e.onClick,()=>{o.onItemSelect(a.value),v.current=y}),onKeyDown:je(e.onKeyDown,b=>{const C={horizontal:"ArrowDown",vertical:o.dir==="rtl"?"ArrowLeft":"ArrowRight"}[o.orientation];y&&b.key===C&&(a.onEntryKeyDown(),b.preventDefault())})})})}),y&&u.jsxs(u.Fragment,{children:[u.jsx(B4,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:b=>{const S=a.contentRef.current,C=b.relatedTarget,E=C===c.current,k=S?.contains(C);(E||!k)&&a.onFocusProxyEnter(E?"start":"end")}}),o.viewport&&u.jsx("span",{"aria-owns":p})]})]})});xle.displayName=s1;var wle="NavigationMenuLink",gD="navigationMenu.linkSelect",Q4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:i,...o}=e;return u.jsx(nL,{asChild:!0,children:u.jsx(Ke.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...o,ref:t,onClick:je(e.onClick,a=>{const c=a.target,d=new CustomEvent(gD,{bubbles:!0,cancelable:!0});if(c.addEventListener(gD,f=>i?.(f),{once:!0}),Kv(c,d),!d.defaultPrevented&&!a.metaKey){const f=new CustomEvent(_v,{bubbles:!0,cancelable:!0});Kv(c,f)}},{checkForDefaultPrevented:!1})})})});Q4.displayName=wle;var lE="NavigationMenuIndicator",Sle=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=vo(lE,e.__scopeNavigationMenu),o=!!i.value;return i.indicatorTrack?TC.createPortal(u.jsx(Wn,{present:n||o,children:u.jsx(_le,{...r,ref:t})}),i.indicatorTrack):null});Sle.displayName=lE;var _le=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=vo(lE,n),o=H4(n),[a,c]=x.useState(null),[d,f]=x.useState(null),p=i.orientation==="horizontal",h=!!i.value;x.useEffect(()=>{const b=o().find(S=>S.value===i.value)?.ref.current;b&&c(b)},[o,i.value]);const v=()=>{a&&f({size:p?a.offsetWidth:a.offsetHeight,offset:p?a.offsetLeft:a.offsetTop})};return c1(a,v),c1(i.indicatorTrack,v),d?u.jsx(Ke.div,{"aria-hidden":!0,"data-state":h?"visible":"hidden","data-orientation":i.orientation,...r,ref:t,style:{position:"absolute",...p?{left:0,width:d.size+"px",transform:`translateX(${d.offset}px)`}:{top:0,height:d.size+"px",transform:`translateY(${d.offset}px)`},...r.style}}):null}),xd="NavigationMenuContent",Cle=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=vo(xd,e.__scopeNavigationMenu),o=W4(xd,e.__scopeNavigationMenu),a=ut(o.contentRef,t),c=o.value===i.value,d={value:o.value,triggerRef:o.triggerRef,focusProxyRef:o.focusProxyRef,wasEscapeCloseRef:o.wasEscapeCloseRef,onContentFocusOutside:o.onContentFocusOutside,onRootContentClose:o.onRootContentClose,...r};return i.viewport?u.jsx(Ele,{forceMount:n,...d,ref:a}):u.jsx(Wn,{present:n||c,children:u.jsx(J4,{"data-state":dE(c),...d,ref:a,onPointerEnter:je(e.onPointerEnter,i.onContentEnter),onPointerLeave:je(e.onPointerLeave,Zv(i.onContentLeave)),style:{pointerEvents:!c&&i.isRootMenu?"none":void 0,...d.style}})})});Cle.displayName=xd;var Ele=x.forwardRef((e,t)=>{const n=vo(xd,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:i}=n;return Yn(()=>{r(e.value,{ref:t,...e})},[e,t,r]),Yn(()=>()=>i(e.value),[e.value,i]),null}),_v="navigationMenu.rootContentDismiss",J4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:i,focusProxyRef:o,wasEscapeCloseRef:a,onRootContentClose:c,onContentFocusOutside:d,...f}=e,p=vo(xd,n),h=x.useRef(null),v=ut(h,t),y=rL(p.baseId,r),b=iL(p.baseId,r),S=H4(n),C=x.useRef(null),{onItemDismiss:E}=p;x.useEffect(()=>{const j=h.current;if(p.isRootMenu&&j){const I=()=>{E(),c(),j.contains(document.activeElement)&&i.current?.focus()};return j.addEventListener(_v,I),()=>j.removeEventListener(_v,I)}},[p.isRootMenu,e.value,i,E,c]);const k=x.useMemo(()=>{const I=S().map(G=>G.value);p.dir==="rtl"&&I.reverse();const A=I.indexOf(p.value),N=I.indexOf(p.previousValue),T=r===p.value,z=N===I.indexOf(r);if(!T&&!z)return C.current;const L=(()=>{if(A!==N){if(T&&N!==-1)return A>N?"from-end":"from-start";if(z&&A!==-1)return A>N?"to-start":"to-end"}return null})();return C.current=L,L},[p.previousValue,p.value,p.dir,S,r]);return u.jsx(tL,{asChild:!0,children:u.jsx(Gd,{id:b,"aria-labelledby":y,"data-motion":k,"data-orientation":p.orientation,...f,ref:v,disableOutsidePointerEvents:!1,onDismiss:()=>{const j=new Event(_v,{bubbles:!0,cancelable:!0});h.current?.dispatchEvent(j)},onFocusOutside:je(e.onFocusOutside,j=>{d();const I=j.target;p.rootNavigationMenu?.contains(I)&&j.preventDefault()}),onPointerDownOutside:je(e.onPointerDownOutside,j=>{const I=j.target,A=S().some(T=>T.ref.current?.contains(I)),N=p.isRootMenu&&p.viewport?.contains(I);(A||N||!p.isRootMenu)&&j.preventDefault()}),onKeyDown:je(e.onKeyDown,j=>{const I=j.altKey||j.ctrlKey||j.metaKey;if(j.key==="Tab"&&!I){const N=l1(j.currentTarget),T=document.activeElement,z=N.findIndex(J=>J===T),G=j.shiftKey?N.slice(0,z).reverse():N.slice(z+1,N.length);uE(G)?j.preventDefault():o.current?.focus()}}),onEscapeKeyDown:je(e.onEscapeKeyDown,j=>{a.current=!0})})})}),cE="NavigationMenuViewport",eL=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=!!vo(cE,e.__scopeNavigationMenu).value;return u.jsx(Wn,{present:n||o,children:u.jsx(kle,{...r,ref:t})})});eL.displayName=cE;var kle=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...i}=e,o=vo(cE,n),a=ut(t,o.onViewportChange),c=vle(xd,e.__scopeNavigationMenu),[d,f]=x.useState(null),[p,h]=x.useState(null),v=d?d?.width+"px":void 0,y=d?d?.height+"px":void 0,b=!!o.value,S=b?o.value:o.previousValue;return c1(p,()=>{p&&f({width:p.offsetWidth,height:p.offsetHeight})}),u.jsx(Ke.div,{"data-state":dE(b),"data-orientation":o.orientation,...i,ref:a,style:{pointerEvents:!b&&o.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":v,"--radix-navigation-menu-viewport-height":y,...i.style},onPointerEnter:je(e.onPointerEnter,o.onContentEnter),onPointerLeave:je(e.onPointerLeave,Zv(o.onContentLeave)),children:Array.from(c.items).map(([E,{ref:k,forceMount:j,...I}])=>{const A=S===E;return u.jsx(Wn,{present:j||A,children:u.jsx(J4,{...I,ref:Ud(k,N=>{A&&N&&h(N)})})},E)})})}),jle="FocusGroup",tL=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=vo(jle,n);return u.jsx(o1.Provider,{scope:n,children:u.jsx(o1.Slot,{scope:n,children:u.jsx(Ke.div,{dir:i.dir,...r,ref:t})})})}),vD=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],Rle="FocusGroupItem",nL=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=mle(n),o=vo(Rle,n);return u.jsx(o1.ItemSlot,{scope:n,children:u.jsx(Ke.button,{...r,ref:t,onKeyDown:je(e.onKeyDown,a=>{if(["Home","End",...vD].includes(a.key)){let d=i().map(h=>h.ref.current);if([o.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&d.reverse(),vD.includes(a.key)){const h=d.indexOf(a.currentTarget);d=d.slice(h+1)}setTimeout(()=>uE(d)),a.preventDefault()}})})})});function l1(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 uE(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function Ile(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 c1(e,t){const n=bn(t);Yn(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}function dE(e){return e?"open":"closed"}function rL(e,t){return`${e}-trigger-${t}`}function iL(e,t){return`${e}-content-${t}`}function Zv(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Nle=q4,Tle=Z4,Ale=X4,Ole=Q4,Dle=eL;function $le({className:e,...t}){return u.jsx("div",{className:Me("absolute top-full left-0 isolate z-50 flex justify-center"),children:u.jsx(Dle,{"data-slot":"navigation-menu-viewport",className:Me("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 oL({className:e,children:t,viewport:n=!0,...r}){return u.jsxs(Nle,{"data-slot":"navigation-menu","data-viewport":n,className:Me("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",e),...r,children:[t,n&&u.jsx($le,{})]})}function u1({className:e,...t}){return u.jsx(Ale,{"data-slot":"navigation-menu-item",className:Me("relative",e),...t})}function d1({className:e,...t}){return u.jsx(Ole,{"data-slot":"navigation-menu-link",className:Me("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 aL({className:e,...t}){return u.jsx(Tle,{"data-slot":"navigation-menu-list",className:Me("group flex flex-1 list-none items-center justify-center gap-1",e),...t})}const sL=Yy("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 fE(){return u.jsx("a",{href:"https://github.com/HarperFast/studio/releases",target:"_blank",rel:"noopener noreferrer",children:u.jsxs("span",{className:Me(sL({variant:"default"}),"text-xs inline-block ml-2 align-text-top"),children:["v4.7.10"," BETA"]})})}function mb(e,t,n){const{instanceId:r,clusterId:i}=tt({strict:!1});return Va({id:_n,operationsUrl:e,port:t,secure:n})}function pb(e,t,n){const{instanceId:r,clusterId:i}=tt({strict:!1});return{instanceClient:Va({id:_n,operationsUrl:e,port:t,secure:n}),entityType:"instance"}}function Ft(e,t,n){const r=tt({strict:!1});return lL({...r,operationsUrl:e,port:t,secure:n})}function lL({instanceId:e,clusterId:t,operationsUrl:n,port:r,secure:i}){const o=_n;return{instanceClient:Va({id:o,operationsUrl:n,port:r,secure:i}),entityId:o,entityType:"instance"}}function Ple(){localStorage.clear()}function Mle(){sessionStorage.clear()}async function zle(){Tt.setUserForEntity(_n,null),Vv.getQueryCache().clear(),Ple(),Mle(),await Vv.invalidateQueries({refetchType:"none"})}async function Lle(e){await Tt.signOutFromPotentiallyAuthenticatedInstances(),await yp({...e,entityId:_n})}function Ule(){const e=mb();return at({mutationFn:()=>Lle({instanceClient:e}),onSuccess:zle})}function hb(e){const{user:t}=cl(),{organizationId:n}=tt({strict:!1}),r=t?.roles?.[e??n];return!r?.permission&&!r?.organization?{update:!1,remove:!1}:r.permission?.super_user?{update:!0,remove:!0}:{update:r.organization.update,remove:r.organization.delete}}function Kd(e){const{user:t}=cl(),{organizationId:n}=tt({strict:!1}),r=t?.roles?.[e??n];if(!r?.permission&&!r?.organization?.roles)return{create:!1,remove:!1,update:!1,view:!1};if(r.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const i=r.organization.roles;return{create:i.create,remove:i.delete,update:i.update,view:i.view}}function gb(e,t){const{user:n}=cl(),{organizationId:r,clusterId:i}=tt({strict:!1});return cL(n,e??r,t??i)}function cL(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 Fle(e,t){const{user:n}=cl(),{organizationId:r,clusterId:i}=tt({strict:!1});return uL(n,r,i)}function uL(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 mE(e){const{clusterId:t,instanceId:n}=tt({strict:!1}),{user:r}=Ja(),i=r?.role?.permission;return i?i.super_user===!0:!1}function Zd(e){const{clusterId:t,instanceId:n}=tt({strict:!1}),{user:r}=Ja(),i=r?.role?.permission;return i?i.super_user===!0||i.structure_user===!0:!1}function CS(e,t,n,r){const{clusterId:i,instanceId:o}=tt({strict:!1}),{user:a}=Ja(),c=a?.role?.permission;return c?c.super_user===!0||c.structure_user===!0?!0:c[t]?.tables?.[n][r]===!0:!1}const pE={className:"text-white"};function dL(){const{mutate:e}=Ule(),t=pn(),{user:n}=_c(),r=on(),{organizationId:i}=tt({strict:!1}),{update:o}=hb(i),{view:a}=Kd(i),c=o,d=x.useCallback(()=>{e(void 0,{onSuccess:async()=>{_e.success("Success",{description:"You have been signed out successfully.",action:{label:"Dismiss",onClick:()=>_e.dismiss()}}),t({to:"/sign-in"}),r.invalidate()}})},[e,r,t]),f=x.useMemo(()=>[!Xu,!Xu,!Xu,{to:"https://docs.harperdb.io/docs",target:"_blank",icon:u.jsx(EM,{}),text:"Docs",textBreakpoint:"md"},{to:"https://github.com/HarperFast/studio/issues",target:"_blank",icon:u.jsx(eX,{}),text:"Report an Issue",textBreakpoint:"lg"},{to:"https://discord.gg/VzZuaw3Xay",target:"_blank",icon:u.jsx(Lse,{}),text:"Discord",textBreakpoint:"lg"},{onClick:d,icon:u.jsx(tQ,{}),text:"Sign Out",textBreakpoint:"md"}].filter(fa),[i,c,a,d]);return n?u.jsxs(u.Fragment,{children:[u.jsx(Hle,{menuItems:f}),u.jsx(Ble,{menuItems:f})]}):u.jsx(Vle,{})}function fL(e){return e.items!==void 0}function Vle(){return u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"inline-block",children:[u.jsx(Ge,{to:"/sign-in",children:u.jsx(iE,{})}),u.jsx(fE,{})]}),u.jsx(oL,{children:u.jsxs(aL,{className:"text-grey-400",children:[u.jsx(u1,{children:u.jsx(d1,{asChild:!0,children:u.jsxs(Ge,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[u.jsx(EM,{})," ",u.jsx("span",{className:"hidden md:inline-block",children:"Docs"})]})})}),u.jsx(u1,{children:u.jsx(d1,{asChild:!0,children:u.jsxs(Ge,{to:"/sign-in",className:"flex-row items-center",activeProps:pE,children:[u.jsx(XX,{})," Sign In"]})})})]})})]})}function Ble({menuItems:e}){const{user:t}=_c();return Ec(t),u.jsx("div",{className:"hidden md:block",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"inline-block",children:[u.jsx(Ge,{to:oa,children:u.jsx(iE,{})}),u.jsx(fE,{})]}),u.jsx(oL,{children:u.jsx(aL,{className:"text-grey-400",children:e.map(n=>fL(n)?!!n.items.length&&u.jsx("div",{className:"bg-black rounded-2xl flex",children:n.items.map(r=>u.jsx(yD,{menuItem:r},r.text))},n.text):u.jsx(yD,{menuItem:n},n.text))})})]})})}function yD({menuItem:e}){return u.jsx(u1,{className:"text-gray-400 hover:text-white",children:u.jsx(d1,{asChild:!0,children:u.jsxs(Ge,{to:e.to,onClick:e.onClick,className:"flex-row items-center",target:e.target,activeProps:e.to?pE: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 Hle({menuItems:e}){const{user:t}=_c();Ec(t);const[n,r]=x.useState(!1),i=x.useCallback(()=>r(a=>!a),[]),o=x.useCallback(()=>r(!1),[]);return u.jsxs("div",{className:"md:hidden",id:"mobile-menu",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Ge,{to:oa,children:u.jsx(iE,{})}),u.jsx(fE,{}),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(UM,{}):u.jsx($M,{})]})]}),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=>fL(a)?!!a.items.length&&u.jsx("div",{className:"bg-black pl-10 pr-2 py-2",children:a.items.map(c=>u.jsx(bD,{menuItem:c,onClick:o},c.text))},a.text):u.jsx(bD,{menuItem:a,onClick:o},a.text))})]})}function bD({menuItem:e,onClick:t}){const n=x.useCallback(()=>{e.onClick?.(),t()},[e,t]);return u.jsxs(Ge,{to:e.to,onClick:n,target:e.target,className:"flex flex-row px-3 py-2 text-base font-medium rounded-md text-gray-400 hover:text-white",activeProps:e.to?pE:void 0,children:[e.icon,u.jsx("span",{className:"ml-4",children:e.text})]})}function fm({title:e,children:t}){return u.jsxs("li",{className:"list-image-(--checkmark-icon) mt-4",children:[u.jsx("h3",{className:"text-xl font-bold",children:e}),t]})}function qle(){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(dL,{})}),u.jsxs("div",{className:"pt-20 grid h-screen grid-cols-1 md:grid-cols-2",children:[u.jsx("section",{className:"items-center justify-center hidden text-white md:flex bg-linear-(--blue-pink-gradient) px-6",children:u.jsxs("div",{children:[u.jsx("h1",{className:"text-4xl font-bold",children:"Harper Fabric"}),u.jsxs("ul",{className:"ps-5",children:[u.jsx(fm,{title:"Free Tier",children:u.jsx("span",{children:"Try us out, no credit card required!"})}),u.jsx(fm,{title:"Global Deployments Managed as One",children:u.jsx("span",{children:"Coordinate global environments as if they were a single node."})}),u.jsx(fm,{title:"Database, App, Cache, & Messaging",children:u.jsx("span",{children:"Bring your stack together for reliable, ultra-fast performance."})}),u.jsx(fm,{title:"NoSQL, Vector, & Blob",children:u.jsx("span",{children:"Store and serve modern data types with low latency, semantic search ability, and global reach."})}),u.jsx(fm,{title:"Simplified Operations",children:u.jsx("span",{children:"Focus on what differentiates your app; leave infrastructure to us."})})]}),u.jsx("span",{className:"opacity-5",children:"Bravo!"})]})}),u.jsx("section",{className:"flex items-center justify-center px-6 bg-linear-(--purple-gradient) dark:bg-linear-(--black-dark-gradient)",children:u.jsx(ll,{})})]})]})}function Gle(){x.useEffect(()=>{},[])}const Kle=["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 hE(e){if(!e||!e.includes("@"))return null;const t=e.split("@").pop()||"";if(!t)return null;for(const n of Kle)if(t===n||t.endsWith("."+n))return null;return t}let ES=null;function Zle(){const e=pn(),t=on(),n=yr(),{redirect:r}=br({strict:!1});return x.useEffect(()=>{ES||(ES=(async function(){const i=await FP().catch(()=>null);if(!i)_e.error("We were not able to verify your sign-in. Please try signing in again.",{duration:1e4}),await e({to:"/sign-in"});else{Tt.setUserForEntity(_n,i);const o=Ec(i);hE(i.email),await n.invalidateQueries({queryKey:By,refetchType:"none"}),await t.invalidate(),await e({to:r?.startsWith("/")?r:o})}ES=null})())},[]),u.jsxs("div",{className:"text-white w-lg flex flex-col gap-4",children:[u.jsxs("h1",{className:"text-3xl font-light",children:[u.jsx("span",{"aria-hidden":"true",className:"text-2xl animate-flower-dance mr-4",title:"Loading",children:"🌼"}),"Checking..."]}),u.jsx("div",{className:"underline flex gap-4",children:u.jsx(Ge,{className:"text-sm opacity-50 hover:text-blue-300",to:"/sign-in",children:"Try signing in again"})})]})}const Yle=["top","right","bottom","left"],rl=Math.min,ki=Math.max,Yv=Math.round,zg=Math.floor,ia=e=>({x:e,y:e}),Wle={left:"right",right:"left",bottom:"top",top:"bottom"},Xle={start:"end",end:"start"};function f1(e,t,n){return ki(e,rl(t,n))}function Ya(e,t){return typeof e=="function"?e(t):e}function Wa(e){return e.split("-")[0]}function Yd(e){return e.split("-")[1]}function gE(e){return e==="x"?"y":"x"}function vE(e){return e==="y"?"height":"width"}const Qle=new Set(["top","bottom"]);function ea(e){return Qle.has(Wa(e))?"y":"x"}function yE(e){return gE(ea(e))}function Jle(e,t,n){n===void 0&&(n=!1);const r=Yd(e),i=yE(e),o=vE(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Wv(a)),[a,Wv(a)]}function ece(e){const t=Wv(e);return[m1(e),t,m1(t)]}function m1(e){return e.replace(/start|end/g,t=>Xle[t])}const xD=["left","right"],wD=["right","left"],tce=["top","bottom"],nce=["bottom","top"];function rce(e,t,n){switch(e){case"top":case"bottom":return n?t?wD:xD:t?xD:wD;case"left":case"right":return t?tce:nce;default:return[]}}function ice(e,t,n,r){const i=Yd(e);let o=rce(Wa(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(m1)))),o}function Wv(e){return e.replace(/left|right|bottom|top/g,t=>Wle[t])}function oce(e){return{top:0,right:0,bottom:0,left:0,...e}}function mL(e){return typeof e!="number"?oce(e):{top:e,right:e,bottom:e,left:e}}function Xv(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 SD(e,t,n){let{reference:r,floating:i}=e;const o=ea(t),a=yE(t),c=vE(a),d=Wa(t),f=o==="y",p=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,v=r[c]/2-i[c]/2;let y;switch(d){case"top":y={x:p,y:r.y-i.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:h};break;case"left":y={x:r.x-i.width,y:h};break;default:y={x:r.x,y:r.y}}switch(Yd(t)){case"start":y[a]-=v*(n&&f?-1:1);break;case"end":y[a]+=v*(n&&f?-1:1);break}return y}const ace=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,c=o.filter(Boolean),d=await(a.isRTL==null?void 0:a.isRTL(t));let f=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:p,y:h}=SD(f,r,d),v=r,y={},b=0;for(let S=0;S<c.length;S++){const{name:C,fn:E}=c[S],{x:k,y:j,data:I,reset:A}=await E({x:p,y:h,initialPlacement:r,placement:v,strategy:i,middlewareData:y,rects:f,platform:a,elements:{reference:e,floating:t}});p=k??p,h=j??h,y={...y,[C]:{...y[C],...I}},A&&b<=50&&(b++,typeof A=="object"&&(A.placement&&(v=A.placement),A.rects&&(f=A.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:p,y:h}=SD(f,v,d)),S=-1)}return{x:p,y:h,placement:v,strategy:i,middlewareData:y}};async function ep(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:h="floating",altBoundary:v=!1,padding:y=0}=Ya(t,e),b=mL(y),C=c[v?h==="floating"?"reference":"floating":h],E=Xv(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(C)))==null||n?C:C.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:f,rootBoundary:p,strategy:d})),k=h==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,j=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),I=await(o.isElement==null?void 0:o.isElement(j))?await(o.getScale==null?void 0:o.getScale(j))||{x:1,y:1}:{x:1,y:1},A=Xv(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:k,offsetParent:j,strategy:d}):k);return{top:(E.top-A.top+b.top)/I.y,bottom:(A.bottom-E.bottom+b.bottom)/I.y,left:(E.left-A.left+b.left)/I.x,right:(A.right-E.right+b.right)/I.x}}const sce=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:c,middlewareData:d}=t,{element:f,padding:p=0}=Ya(e,t)||{};if(f==null)return{};const h=mL(p),v={x:n,y:r},y=yE(i),b=vE(y),S=await a.getDimensions(f),C=y==="y",E=C?"top":"left",k=C?"bottom":"right",j=C?"clientHeight":"clientWidth",I=o.reference[b]+o.reference[y]-v[y]-o.floating[b],A=v[y]-o.reference[y],N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let T=N?N[j]:0;(!T||!await(a.isElement==null?void 0:a.isElement(N)))&&(T=c.floating[j]||o.floating[b]);const z=I/2-A/2,L=T/2-S[b]/2-1,G=rl(h[E],L),J=rl(h[k],L),Z=G,W=T-S[b]-J,F=T/2-S[b]/2+z,Y=f1(Z,F,W),P=!d.arrow&&Yd(i)!=null&&F!==Y&&o.reference[b]/2-(F<Z?G:J)-S[b]/2<0,K=P?F<Z?F-Z:F-W:0;return{[y]:v[y]+K,data:{[y]:Y,centerOffset:F-Y-K,...P&&{alignmentOffset:K}},reset:P}}}),lce=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:c,platform:d,elements:f}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:S=!0,...C}=Ya(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const E=Wa(i),k=ea(c),j=Wa(c)===c,I=await(d.isRTL==null?void 0:d.isRTL(f.floating)),A=v||(j||!S?[Wv(c)]:ece(c)),N=b!=="none";!v&&N&&A.push(...ice(c,S,b,I));const T=[c,...A],z=await ep(t,C),L=[];let G=((r=o.flip)==null?void 0:r.overflows)||[];if(p&&L.push(z[E]),h){const F=Jle(i,a,I);L.push(z[F[0]],z[F[1]])}if(G=[...G,{placement:i,overflows:L}],!L.every(F=>F<=0)){var J,Z;const F=(((J=o.flip)==null?void 0:J.index)||0)+1,Y=T[F];if(Y&&(!(h==="alignment"?k!==ea(Y):!1)||G.every(U=>ea(U.placement)===k?U.overflows[0]>0:!0)))return{data:{index:F,overflows:G},reset:{placement:Y}};let P=(Z=G.filter(K=>K.overflows[0]<=0).sort((K,U)=>K.overflows[1]-U.overflows[1])[0])==null?void 0:Z.placement;if(!P)switch(y){case"bestFit":{var W;const K=(W=G.filter(U=>{if(N){const te=ea(U.placement);return te===k||te==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(te=>te>0).reduce((te,D)=>te+D,0)]).sort((U,te)=>U[1]-te[1])[0])==null?void 0:W[0];K&&(P=K);break}case"initialPlacement":P=c;break}if(i!==P)return{reset:{placement:P}}}return{}}}};function _D(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function CD(e){return Yle.some(t=>e[t]>=0)}const cce=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Ya(e,t);switch(r){case"referenceHidden":{const o=await ep(t,{...i,elementContext:"reference"}),a=_D(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:CD(a)}}}case"escaped":{const o=await ep(t,{...i,altBoundary:!0}),a=_D(o,n.floating);return{data:{escapedOffsets:a,escaped:CD(a)}}}default:return{}}}}},pL=new Set(["left","top"]);async function uce(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Wa(n),c=Yd(n),d=ea(n)==="y",f=pL.has(a)?-1:1,p=o&&d?-1:1,h=Ya(t,e);let{mainAxis:v,crossAxis:y,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof b=="number"&&(y=c==="end"?b*-1:b),d?{x:y*p,y:v*f}:{x:v*f,y:y*p}}const dce=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:c}=t,d=await uce(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:i+d.x,y:o+d.y,data:{...d,placement:a}}}}},fce=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:c={fn:C=>{let{x:E,y:k}=C;return{x:E,y:k}}},...d}=Ya(e,t),f={x:n,y:r},p=await ep(t,d),h=ea(Wa(i)),v=gE(h);let y=f[v],b=f[h];if(o){const C=v==="y"?"top":"left",E=v==="y"?"bottom":"right",k=y+p[C],j=y-p[E];y=f1(k,y,j)}if(a){const C=h==="y"?"top":"left",E=h==="y"?"bottom":"right",k=b+p[C],j=b-p[E];b=f1(k,b,j)}const S=c.fn({...t,[v]:y,[h]:b});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[v]:o,[h]:a}}}}}},mce=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=Ya(e,t),p={x:n,y:r},h=ea(i),v=gE(h);let y=p[v],b=p[h];const S=Ya(c,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(d){const j=v==="y"?"height":"width",I=o.reference[v]-o.floating[j]+C.mainAxis,A=o.reference[v]+o.reference[j]-C.mainAxis;y<I?y=I:y>A&&(y=A)}if(f){var E,k;const j=v==="y"?"width":"height",I=pL.has(Wa(i)),A=o.reference[h]-o.floating[j]+(I&&((E=a.offset)==null?void 0:E[h])||0)+(I?0:C.crossAxis),N=o.reference[h]+o.reference[j]+(I?0:((k=a.offset)==null?void 0:k[h])||0)-(I?C.crossAxis:0);b<A?b=A:b>N&&(b=N)}return{[v]:y,[h]:b}}}},pce=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:a,elements:c}=t,{apply:d=()=>{},...f}=Ya(e,t),p=await ep(t,f),h=Wa(i),v=Yd(i),y=ea(i)==="y",{width:b,height:S}=o.floating;let C,E;h==="top"||h==="bottom"?(C=h,E=v===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(E=h,C=v==="end"?"top":"bottom");const k=S-p.top-p.bottom,j=b-p.left-p.right,I=rl(S-p[C],k),A=rl(b-p[E],j),N=!t.middlewareData.shift;let T=I,z=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(z=j),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=k),N&&!v){const G=ki(p.left,0),J=ki(p.right,0),Z=ki(p.top,0),W=ki(p.bottom,0);y?z=b-2*(G!==0||J!==0?G+J:ki(p.left,p.right)):T=S-2*(Z!==0||W!==0?Z+W:ki(p.top,p.bottom))}await d({...t,availableWidth:z,availableHeight:T});const L=await a.getDimensions(c.floating);return b!==L.width||S!==L.height?{reset:{rects:!0}}:{}}}};function vb(){return typeof window<"u"}function Wd(e){return hL(e)?(e.nodeName||"").toLowerCase():"#document"}function Ti(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ma(e){var t;return(t=(hL(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function hL(e){return vb()?e instanceof Node||e instanceof Ti(e).Node:!1}function $o(e){return vb()?e instanceof Element||e instanceof Ti(e).Element:!1}function ua(e){return vb()?e instanceof HTMLElement||e instanceof Ti(e).HTMLElement:!1}function ED(e){return!vb()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ti(e).ShadowRoot}const hce=new Set(["inline","contents"]);function Ap(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Po(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!hce.has(i)}const gce=new Set(["table","td","th"]);function vce(e){return gce.has(Wd(e))}const yce=[":popover-open",":modal"];function yb(e){return yce.some(t=>{try{return e.matches(t)}catch{return!1}})}const bce=["transform","translate","scale","rotate","perspective"],xce=["transform","translate","scale","rotate","perspective","filter"],wce=["paint","layout","strict","content"];function bE(e){const t=xE(),n=$o(e)?Po(e):e;return bce.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)||xce.some(r=>(n.willChange||"").includes(r))||wce.some(r=>(n.contain||"").includes(r))}function Sce(e){let t=il(e);for(;ua(t)&&!wd(t);){if(bE(t))return t;if(yb(t))return null;t=il(t)}return null}function xE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const _ce=new Set(["html","body","#document"]);function wd(e){return _ce.has(Wd(e))}function Po(e){return Ti(e).getComputedStyle(e)}function bb(e){return $o(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function il(e){if(Wd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ED(e)&&e.host||ma(e);return ED(t)?t.host:t}function gL(e){const t=il(e);return wd(t)?e.ownerDocument?e.ownerDocument.body:e.body:ua(t)&&Ap(t)?t:gL(t)}function tp(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=gL(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=Ti(i);if(o){const c=p1(a);return t.concat(a,a.visualViewport||[],Ap(i)?i:[],c&&n?tp(c):[])}return t.concat(i,tp(i,[],n))}function p1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function vL(e){const t=Po(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=ua(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,c=Yv(n)!==o||Yv(r)!==a;return c&&(n=o,r=a),{width:n,height:r,$:c}}function wE(e){return $o(e)?e:e.contextElement}function nd(e){const t=wE(e);if(!ua(t))return ia(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=vL(t);let a=(o?Yv(n.width):n.width)/r,c=(o?Yv(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const Cce=ia(0);function yL(e){const t=Ti(e);return!xE()||!t.visualViewport?Cce:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ece(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ti(e)?!1:t}function pc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=wE(e);let a=ia(1);t&&(r?$o(r)&&(a=nd(r)):a=nd(e));const c=Ece(o,n,r)?yL(o):ia(0);let d=(i.left+c.x)/a.x,f=(i.top+c.y)/a.y,p=i.width/a.x,h=i.height/a.y;if(o){const v=Ti(o),y=r&&$o(r)?Ti(r):r;let b=v,S=p1(b);for(;S&&r&&y!==b;){const C=nd(S),E=S.getBoundingClientRect(),k=Po(S),j=E.left+(S.clientLeft+parseFloat(k.paddingLeft))*C.x,I=E.top+(S.clientTop+parseFloat(k.paddingTop))*C.y;d*=C.x,f*=C.y,p*=C.x,h*=C.y,d+=j,f+=I,b=Ti(S),S=p1(b)}}return Xv({width:p,height:h,x:d,y:f})}function xb(e,t){const n=bb(e).scrollLeft;return t?t.left+n:pc(ma(e)).left+n}function bL(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-xb(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function kce(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=ma(r),c=t?yb(t.floating):!1;if(r===a||c&&o)return n;let d={scrollLeft:0,scrollTop:0},f=ia(1);const p=ia(0),h=ua(r);if((h||!h&&!o)&&((Wd(r)!=="body"||Ap(a))&&(d=bb(r)),ua(r))){const y=pc(r);f=nd(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const v=a&&!h&&!o?bL(a,d):ia(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+p.x+v.x,y:n.y*f.y-d.scrollTop*f.y+p.y+v.y}}function jce(e){return Array.from(e.getClientRects())}function Rce(e){const t=ma(e),n=bb(e),r=e.ownerDocument.body,i=ki(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ki(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+xb(e);const c=-n.scrollTop;return Po(r).direction==="rtl"&&(a+=ki(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:c}}const kD=25;function Ice(e,t){const n=Ti(e),r=ma(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,c=0,d=0;if(i){o=i.width,a=i.height;const p=xE();(!p||p&&t==="fixed")&&(c=i.offsetLeft,d=i.offsetTop)}const f=xb(r);if(f<=0){const p=r.ownerDocument,h=p.body,v=getComputedStyle(h),y=p.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,b=Math.abs(r.clientWidth-h.clientWidth-y);b<=kD&&(o-=b)}else f<=kD&&(o+=f);return{width:o,height:a,x:c,y:d}}const Nce=new Set(["absolute","fixed"]);function Tce(e,t){const n=pc(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=ua(e)?nd(e):ia(1),a=e.clientWidth*o.x,c=e.clientHeight*o.y,d=i*o.x,f=r*o.y;return{width:a,height:c,x:d,y:f}}function jD(e,t,n){let r;if(t==="viewport")r=Ice(e,n);else if(t==="document")r=Rce(ma(e));else if($o(t))r=Tce(t,n);else{const i=yL(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Xv(r)}function xL(e,t){const n=il(e);return n===t||!$o(n)||wd(n)?!1:Po(n).position==="fixed"||xL(n,t)}function Ace(e,t){const n=t.get(e);if(n)return n;let r=tp(e,[],!1).filter(c=>$o(c)&&Wd(c)!=="body"),i=null;const o=Po(e).position==="fixed";let a=o?il(e):e;for(;$o(a)&&!wd(a);){const c=Po(a),d=bE(a);!d&&c.position==="fixed"&&(i=null),(o?!d&&!i:!d&&c.position==="static"&&!!i&&Nce.has(i.position)||Ap(a)&&!d&&xL(e,a))?r=r.filter(p=>p!==a):i=c,a=il(a)}return t.set(e,r),r}function Oce(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?yb(t)?[]:Ace(t,this._c):[].concat(n),r],c=a[0],d=a.reduce((f,p)=>{const h=jD(t,p,i);return f.top=ki(h.top,f.top),f.right=rl(h.right,f.right),f.bottom=rl(h.bottom,f.bottom),f.left=ki(h.left,f.left),f},jD(t,c,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Dce(e){const{width:t,height:n}=vL(e);return{width:t,height:n}}function $ce(e,t,n){const r=ua(t),i=ma(t),o=n==="fixed",a=pc(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const d=ia(0);function f(){d.x=xb(i)}if(r||!r&&!o)if((Wd(t)!=="body"||Ap(i))&&(c=bb(t)),r){const y=pc(t,!0,o,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}else i&&f();o&&!r&&i&&f();const p=i&&!r&&!o?bL(i,c):ia(0),h=a.left+c.scrollLeft-d.x-p.x,v=a.top+c.scrollTop-d.y-p.y;return{x:h,y:v,width:a.width,height:a.height}}function kS(e){return Po(e).position==="static"}function RD(e,t){if(!ua(e)||Po(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ma(e)===n&&(n=n.ownerDocument.body),n}function wL(e,t){const n=Ti(e);if(yb(e))return n;if(!ua(e)){let i=il(e);for(;i&&!wd(i);){if($o(i)&&!kS(i))return i;i=il(i)}return n}let r=RD(e,t);for(;r&&vce(r)&&kS(r);)r=RD(r,t);return r&&wd(r)&&kS(r)&&!bE(r)?n:r||Sce(e)||n}const Pce=async function(e){const t=this.getOffsetParent||wL,n=this.getDimensions,r=await n(e.floating);return{reference:$ce(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Mce(e){return Po(e).direction==="rtl"}const zce={convertOffsetParentRelativeRectToViewportRelativeRect:kce,getDocumentElement:ma,getClippingRect:Oce,getOffsetParent:wL,getElementRects:Pce,getClientRects:jce,getDimensions:Dce,getScale:nd,isElement:$o,isRTL:Mce};function SL(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Lce(e,t){let n=null,r;const i=ma(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),o();const f=e.getBoundingClientRect(),{left:p,top:h,width:v,height:y}=f;if(c||t(),!v||!y)return;const b=zg(h),S=zg(i.clientWidth-(p+v)),C=zg(i.clientHeight-(h+y)),E=zg(p),j={rootMargin:-b+"px "+-S+"px "+-C+"px "+-E+"px",threshold:ki(0,rl(1,d))||1};let I=!0;function A(N){const T=N[0].intersectionRatio;if(T!==d){if(!I)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},1e3)}T===1&&!SL(f,e.getBoundingClientRect())&&a(),I=!1}try{n=new IntersectionObserver(A,{...j,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,j)}n.observe(e)}return a(!0),o}function Uce(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=wE(e),p=i||o?[...f?tp(f):[],...tp(t)]:[];p.forEach(E=>{i&&E.addEventListener("scroll",n,{passive:!0}),o&&E.addEventListener("resize",n)});const h=f&&c?Lce(f,n):null;let v=-1,y=null;a&&(y=new ResizeObserver(E=>{let[k]=E;k&&k.target===f&&y&&(y.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var j;(j=y)==null||j.observe(t)})),n()}),f&&!d&&y.observe(f),y.observe(t));let b,S=d?pc(e):null;d&&C();function C(){const E=pc(e);S&&!SL(S,E)&&n(),S=E,b=requestAnimationFrame(C)}return n(),()=>{var E;p.forEach(k=>{i&&k.removeEventListener("scroll",n),o&&k.removeEventListener("resize",n)}),h?.(),(E=y)==null||E.disconnect(),y=null,d&&cancelAnimationFrame(b)}}const Fce=dce,Vce=fce,Bce=lce,Hce=pce,qce=cce,ID=sce,Gce=mce,Kce=(e,t,n)=>{const r=new Map,i={platform:zce,...n},o={...i.platform,_c:r};return ace(e,t,{...i,platform:o})};var Zce=typeof document<"u",Yce=function(){},Cv=Zce?x.useLayoutEffect:Yce;function Qv(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(!Qv(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)&&!Qv(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function _L(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ND(e,t){const n=_L(e);return Math.round(t*n)/n}function jS(e){const t=x.useRef(e);return Cv(()=>{t.current=e}),t}function Wce(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:c=!0,whileElementsMounted:d,open:f}=e,[p,h]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,y]=x.useState(r);Qv(v,r)||y(r);const[b,S]=x.useState(null),[C,E]=x.useState(null),k=x.useCallback(U=>{U!==N.current&&(N.current=U,S(U))},[]),j=x.useCallback(U=>{U!==T.current&&(T.current=U,E(U))},[]),I=o||b,A=a||C,N=x.useRef(null),T=x.useRef(null),z=x.useRef(p),L=d!=null,G=jS(d),J=jS(i),Z=jS(f),W=x.useCallback(()=>{if(!N.current||!T.current)return;const U={placement:t,strategy:n,middleware:v};J.current&&(U.platform=J.current),Kce(N.current,T.current,U).then(te=>{const D={...te,isPositioned:Z.current!==!1};F.current&&!Qv(z.current,D)&&(z.current=D,Md.flushSync(()=>{h(D)}))})},[v,t,n,J,Z]);Cv(()=>{f===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,h(U=>({...U,isPositioned:!1})))},[f]);const F=x.useRef(!1);Cv(()=>(F.current=!0,()=>{F.current=!1}),[]),Cv(()=>{if(I&&(N.current=I),A&&(T.current=A),I&&A){if(G.current)return G.current(I,A,W);W()}},[I,A,W,G,L]);const Y=x.useMemo(()=>({reference:N,floating:T,setReference:k,setFloating:j}),[k,j]),P=x.useMemo(()=>({reference:I,floating:A}),[I,A]),K=x.useMemo(()=>{const U={position:n,left:0,top:0};if(!P.floating)return U;const te=ND(P.floating,p.x),D=ND(P.floating,p.y);return c?{...U,transform:"translate("+te+"px, "+D+"px)",..._L(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:te,top:D}},[n,c,P.floating,p.x,p.y]);return x.useMemo(()=>({...p,update:W,refs:Y,elements:P,floatingStyles:K}),[p,W,Y,P,K])}const Xce=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?ID({element:r.current,padding:i}).fn(n):{}:r?ID({element:r,padding:i}).fn(n):{}}}},Qce=(e,t)=>({...Fce(e),options:[e,t]}),Jce=(e,t)=>({...Vce(e),options:[e,t]}),eue=(e,t)=>({...Gce(e),options:[e,t]}),tue=(e,t)=>({...Bce(e),options:[e,t]}),nue=(e,t)=>({...Hce(e),options:[e,t]}),rue=(e,t)=>({...qce(e),options:[e,t]}),iue=(e,t)=>({...Xce(e),options:[e,t]});var oue="Arrow",CL=x.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return u.jsx(Ke.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});CL.displayName=oue;var aue=CL;function EL(e){const[t,n]=x.useState(void 0);return Yn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,c;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;a=f.inlineSize,c=f.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var SE="Popper",[kL,Xd]=Mi(SE),[sue,jL]=kL(SE),RL=e=>{const{__scopePopper:t,children:n}=e,[r,i]=x.useState(null);return u.jsx(sue,{scope:t,anchor:r,onAnchorChange:i,children:n})};RL.displayName=SE;var IL="PopperAnchor",NL=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=jL(IL,n),a=x.useRef(null),c=ut(t,a),d=x.useRef(null);return x.useEffect(()=>{const f=d.current;d.current=r?.current||a.current,f!==d.current&&o.onAnchorChange(d.current)}),r?null:u.jsx(Ke.div,{...i,ref:c})});NL.displayName=IL;var _E="PopperContent",[lue,cue]=kL(_E),TL=x.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:h="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:b,...S}=e,C=jL(_E,n),[E,k]=x.useState(null),j=ut(t,B=>k(B)),[I,A]=x.useState(null),N=EL(I),T=N?.width??0,z=N?.height??0,L=r+(o!=="center"?"-"+o:""),G=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},J=Array.isArray(f)?f:[f],Z=J.length>0,W={padding:G,boundary:J.filter(due),altBoundary:Z},{refs:F,floatingStyles:Y,placement:P,isPositioned:K,middlewareData:U}=Wce({strategy:"fixed",placement:L,whileElementsMounted:(...B)=>Uce(...B,{animationFrame:y==="always"}),elements:{reference:C.anchor},middleware:[Qce({mainAxis:i+z,alignmentAxis:a}),d&&Jce({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?eue():void 0,...W}),d&&tue({...W}),nue({...W,apply:({elements:B,rects:ie,availableWidth:Se,availableHeight:Ie})=>{const{width:Fe,height:Ue}=ie.reference,Ye=B.floating.style;Ye.setProperty("--radix-popper-available-width",`${Se}px`),Ye.setProperty("--radix-popper-available-height",`${Ie}px`),Ye.setProperty("--radix-popper-anchor-width",`${Fe}px`),Ye.setProperty("--radix-popper-anchor-height",`${Ue}px`)}}),I&&iue({element:I,padding:c}),fue({arrowWidth:T,arrowHeight:z}),v&&rue({strategy:"referenceHidden",...W})]}),[te,D]=DL(P),M=bn(b);Yn(()=>{K&&M?.()},[K,M]);const V=U.arrow?.x,O=U.arrow?.y,ee=U.arrow?.centerOffset!==0,[ue,pe]=x.useState();return Yn(()=>{E&&pe(window.getComputedStyle(E).zIndex)},[E]),u.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:K?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(lue,{scope:n,placedSide:te,onArrowChange:A,arrowX:V,arrowY:O,shouldHideArrow:ee,children:u.jsx(Ke.div,{"data-side":te,"data-align":D,...S,ref:j,style:{...S.style,animation:K?void 0:"none"}})})})});TL.displayName=_E;var AL="PopperArrow",uue={top:"bottom",right:"left",bottom:"top",left:"right"},OL=x.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=cue(AL,r),a=uue[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(aue,{...i,ref:n,style:{...i.style,display:"block"}})})});OL.displayName=AL;function due(e){return e!==null}var fue=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,c=a?0:e.arrowWidth,d=a?0:e.arrowHeight,[f,p]=DL(n),h={start:"0%",center:"50%",end:"100%"}[p],v=(i.arrow?.x??0)+c/2,y=(i.arrow?.y??0)+d/2;let b="",S="";return f==="bottom"?(b=a?h:`${v}px`,S=`${-d}px`):f==="top"?(b=a?h:`${v}px`,S=`${r.floating.height+d}px`):f==="right"?(b=`${-d}px`,S=a?h:`${y}px`):f==="left"&&(b=`${r.floating.width+d}px`,S=a?h:`${y}px`),{data:{x:b,y:S}}}});function DL(e){const[t,n="center"]=e.split("-");return[t,n]}var CE=RL,EE=NL,kE=TL,jE=OL,mue="Portal",Op=x.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=x.useState(!1);Yn(()=>o(!0),[]);const a=n||i&&globalThis?.document?.body;return a?TC.createPortal(u.jsx(Ke.div,{...r,ref:t}),a):null});Op.displayName=mue;var[wb]=Mi("Tooltip",[Xd]),Sb=Xd(),$L="TooltipProvider",pue=700,h1="tooltip.open",[hue,RE]=wb($L),PL=e=>{const{__scopeTooltip:t,delayDuration:n=pue,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,a=x.useRef(!0),c=x.useRef(!1),d=x.useRef(0);return x.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),u.jsx(hue,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(d.current),a.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:x.useCallback(f=>{c.current=f},[]),disableHoverableContent:i,children:o})};PL.displayName=$L;var np="Tooltip",[gue,Dp]=wb(np),ML=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:a,delayDuration:c}=e,d=RE(np,e.__scopeTooltip),f=Sb(t),[p,h]=x.useState(null),v=Ni(),y=x.useRef(0),b=a??d.disableHoverableContent,S=c??d.delayDuration,C=x.useRef(!1),[E,k]=Do({prop:r,defaultProp:i??!1,onChange:T=>{T?(d.onOpen(),document.dispatchEvent(new CustomEvent(h1))):d.onClose(),o?.(T)},caller:np}),j=x.useMemo(()=>E?C.current?"delayed-open":"instant-open":"closed",[E]),I=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C.current=!1,k(!0)},[k]),A=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,k(!1)},[k]),N=x.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{C.current=!0,k(!0),y.current=0},S)},[S,k]);return x.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),u.jsx(CE,{...f,children:u.jsx(gue,{scope:t,contentId:v,open:E,stateAttribute:j,trigger:p,onTriggerChange:h,onTriggerEnter:x.useCallback(()=>{d.isOpenDelayedRef.current?N():I()},[d.isOpenDelayedRef,N,I]),onTriggerLeave:x.useCallback(()=>{b?A():(window.clearTimeout(y.current),y.current=0)},[A,b]),onOpen:I,onClose:A,disableHoverableContent:b,children:n})})};ML.displayName=np;var g1="TooltipTrigger",zL=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Dp(g1,n),o=RE(g1,n),a=Sb(n),c=x.useRef(null),d=ut(t,c,i.onTriggerChange),f=x.useRef(!1),p=x.useRef(!1),h=x.useCallback(()=>f.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),u.jsx(EE,{asChild:!0,...a,children:u.jsx(Ke.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:d,onPointerMove:je(e.onPointerMove,v=>{v.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:je(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:je(e.onPointerDown,()=>{i.open&&i.onClose(),f.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:je(e.onFocus,()=>{f.current||i.onOpen()}),onBlur:je(e.onBlur,i.onClose),onClick:je(e.onClick,i.onClose)})})});zL.displayName=g1;var IE="TooltipPortal",[vue,yue]=wb(IE,{forceMount:void 0}),LL=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=Dp(IE,t);return u.jsx(vue,{scope:t,forceMount:n,children:u.jsx(Wn,{present:n||o.open,children:u.jsx(Op,{asChild:!0,container:i,children:r})})})};LL.displayName=IE;var Sd="TooltipContent",UL=x.forwardRef((e,t)=>{const n=yue(Sd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=Dp(Sd,e.__scopeTooltip);return u.jsx(Wn,{present:r||a.open,children:a.disableHoverableContent?u.jsx(FL,{side:i,...o,ref:t}):u.jsx(bue,{side:i,...o,ref:t})})}),bue=x.forwardRef((e,t)=>{const n=Dp(Sd,e.__scopeTooltip),r=RE(Sd,e.__scopeTooltip),i=x.useRef(null),o=ut(t,i),[a,c]=x.useState(null),{trigger:d,onClose:f}=n,p=i.current,{onPointerInTransitChange:h}=r,v=x.useCallback(()=>{c(null),h(!1)},[h]),y=x.useCallback((b,S)=>{const C=b.currentTarget,E={x:b.clientX,y:b.clientY},k=_ue(E,C.getBoundingClientRect()),j=Cue(E,k),I=Eue(S.getBoundingClientRect()),A=jue([...j,...I]);c(A),h(!0)},[h]);return x.useEffect(()=>()=>v(),[v]),x.useEffect(()=>{if(d&&p){const b=C=>y(C,p),S=C=>y(C,d);return d.addEventListener("pointerleave",b),p.addEventListener("pointerleave",S),()=>{d.removeEventListener("pointerleave",b),p.removeEventListener("pointerleave",S)}}},[d,p,y,v]),x.useEffect(()=>{if(a){const b=S=>{const C=S.target,E={x:S.clientX,y:S.clientY},k=d?.contains(C)||p?.contains(C),j=!kue(E,a);k?v():j&&(v(),f())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[d,p,a,f,v]),u.jsx(FL,{...e,ref:o})}),[xue,wue]=wb(np,{isInside:!1}),Sue=Bse("TooltipContent"),FL=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...c}=e,d=Dp(Sd,n),f=Sb(n),{onClose:p}=d;return x.useEffect(()=>(document.addEventListener(h1,p),()=>document.removeEventListener(h1,p)),[p]),x.useEffect(()=>{if(d.trigger){const h=v=>{v.target?.contains(d.trigger)&&p()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[d.trigger,p]),u.jsx(Gd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:p,children:u.jsxs(kE,{"data-state":d.stateAttribute,...f,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[u.jsx(Sue,{children:r}),u.jsx(xue,{scope:n,isInside:!0,children:u.jsx(B4,{id:d.contentId,role:"tooltip",children:i||r})})]})})});UL.displayName=Sd;var VL="TooltipArrow",BL=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Sb(n);return wue(VL,n).isInside?null:u.jsx(jE,{...i,...r,ref:t})});BL.displayName=VL;function _ue(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 Cue(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 Eue(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 kue(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const c=t[o],d=t[a],f=c.x,p=c.y,h=d.x,v=d.y;p>r!=v>r&&n<(h-f)*(r-p)/(v-p)+f&&(i=!i)}return i}function jue(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),Rue(t)}function Rue(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 Iue=PL,Nue=ML,Tue=zL,Aue=LL,Oue=UL,Due=BL;function $ue({delayDuration:e=0,...t}){return u.jsx(Iue,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function _b({...e}){return u.jsx($ue,{children:u.jsx(Nue,{"data-slot":"tooltip",...e})})}function Cb({...e}){return u.jsx(Tue,{"data-slot":"tooltip-trigger",...e})}function Eb({className:e,sideOffset:t=0,arrowClassName:n,children:r,...i}){return u.jsx(Aue,{children:u.jsxs(Oue,{"data-slot":"tooltip-content",sideOffset:t,className:Me("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(Due,{className:Me("bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",n)})]})})}const mm=new Map;function Eo(e){if(!e)return"";if(mm.has(e))return mm.get(e);const t=e.replace(/[-_]+/g," ").replace(/\s+/g," ").trim();if(!t)return mm.set(e,""),"";const n=t.match(/([A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+|[0-9]+)/g);if(!n)return mm.set(e,""),"";const r=[];for(let a=0;a<n.length;a++){const c=n[a],d=a+1<n.length?n[a+1]:void 0;/^[A-Z]{2,}$/.test(c)&&d&&/[A-Z]*s$/.test(d)||/^[A-Z]$/.test(c)&&d!==void 0&&/^[A-Z]s$/.test(d)?(r.push(c+d),a++):r.push(c)}const o=r.map(Pue).join(" ");return mm.set(e,o),o}function Pue(e){return/^[A-Z]{2,3}s?$/.test(e)||/^[0-9]+$/.test(e)?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function kb({restartRequired:e}){const t=qY(),{organization:n,instance:r,cluster:i}=xp({strict:!1}),o="Instance",a=x.useMemo(()=>{const c=t.pathname.split("/").filter(f=>f&&f.length>0),d=[u.jsxs(Ge,{to:"/",children:[u.jsx(BX,{"aria-hidden":"true",className:"size-5 shrink-0"}),u.jsx("span",{className:"sr-only",children:"Home"})]})];for(let f=0;f<c.length;f++){const p=c[f];if(p==="instance")continue;let h=`/${c.slice(0,f+1).join("/")}`,v=Eo(p),y;p==="databases"&&c.length===f+3?(v=c[f+2],f+=2):v.startsWith("Org ")?v=n?.name||"Org":v.startsWith("Clu ")?(v=i?.name||"Cluster",c[f+1]==="instance"&&(h+="/instances")):v.startsWith("Ins ")?v=r?.name?.split(".")?.shift()||"Instance":v==="Apis"&&(v="APIs"),d.push(u.jsx("svg",{fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true",className:"size-5 shrink-0 text-grey",children:u.jsx("path",{d:"M5.555 17.776l8-16 .894.448-8 16-.894-.448z"})}),u.jsxs(Ge,{to:h,className:"text-xs md:text-sm font-medium hover:text-grey truncate max-w-48",children:[v,y]}))}return d},[t.pathname,i?.name,r?.name,n?.name]);return u.jsxs("div",{role:"list",className:"flex items-center space-x-2 xl:space-x-4 sm:max-w-9/10 max-w-[calc(100%-56px)]",children:[...a,e&&u.jsxs(_b,{children:[u.jsx(Cb,{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(Eb,{side:"bottom",children:["This ",o," is requesting a restart, when convenient, to apply your latest changes.",u.jsx("br",{}),"You can do this from the Apps or Config pages."]})]})]})}var $p=e=>e.type==="checkbox",Wl=e=>e instanceof Date,ai=e=>e==null;const HL=e=>typeof e=="object";var Zn=e=>!ai(e)&&!Array.isArray(e)&&HL(e)&&!Wl(e),qL=e=>Zn(e)&&e.target?$p(e.target)?e.target.checked:e.target.value:e,Mue=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,GL=(e,t)=>e.has(Mue(t)),zue=e=>{const t=e.constructor&&e.constructor.prototype;return Zn(t)&&t.hasOwnProperty("isPrototypeOf")},NE=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function dn(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(NE&&(e instanceof Blob||r))&&(n||Zn(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!zue(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=dn(e[i]));else return e;return t}var jb=e=>/^\w*$/.test(e),nn=e=>e===void 0,Rb=e=>Array.isArray(e)?e.filter(Boolean):[],TE=e=>Rb(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ne=(e,t,n)=>{if(!t||!Zn(e))return n;const r=(jb(t)?[t]:TE(t)).reduce((i,o)=>ai(i)?i:i[o],e);return nn(r)||r===e?nn(e[t])?n:e[t]:r},Ci=e=>typeof e=="boolean",zt=(e,t,n)=>{let r=-1;const i=jb(t)?[t]:TE(t),o=i.length,a=o-1;for(;++r<o;){const c=i[r];let d=n;if(r!==a){const f=e[c];d=Zn(f)||Array.isArray(f)?f:isNaN(+i[r+1])?{}:[]}if(c==="__proto__"||c==="constructor"||c==="prototype")return;e[c]=d,e=e[c]}};const Jv={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},oo={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},$a={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},AE=X.createContext(null);AE.displayName="HookFormContext";const Pp=()=>X.useContext(AE),Lue=e=>{const{children:t,...n}=e;return X.createElement(AE.Provider,{value:n},t)};var KL=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const a=o;return t._proxyFormState[a]!==oo.all&&(t._proxyFormState[a]=!r||oo.all),n&&(n[a]=!0),e[a]}});return i};const Ib=typeof window<"u"?X.useLayoutEffect:X.useEffect;function OE(e){const t=Pp(),{control:n=t.control,disabled:r,name:i,exact:o}=e||{},[a,c]=X.useState(n._formState),d=X.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Ib(()=>n._subscribe({name:i,formState:d.current,exact:o,callback:f=>{!r&&c({...n._formState,...f})}}),[i,r,o]),X.useEffect(()=>{d.current.isValid&&n._setValid(!0)},[n]),X.useMemo(()=>KL(a,n,d.current,!1),[a,n])}var ji=e=>typeof e=="string",ZL=(e,t,n,r,i)=>ji(e)?(r&&t.watch.add(e),Ne(n,e,i)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),Ne(n,o))):(r&&(t.watchAll=!0),n),v1=e=>ai(e)||!HL(e);function Ua(e,t,n=new WeakSet){if(v1(e)||v1(t))return e===t;if(Wl(e)&&Wl(t))return e.getTime()===t.getTime();const r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const o of r){const a=e[o];if(!i.includes(o))return!1;if(o!=="ref"){const c=t[o];if(Wl(a)&&Wl(c)||Zn(a)&&Zn(c)||Array.isArray(a)&&Array.isArray(c)?!Ua(a,c,n):a!==c)return!1}}return!0}function Uue(e){const t=Pp(),{control:n=t.control,name:r,defaultValue:i,disabled:o,exact:a,compute:c}=e||{},d=X.useRef(i),f=X.useRef(c),p=X.useRef(void 0);f.current=c;const h=X.useMemo(()=>n._getWatch(r,d.current),[n,r]),[v,y]=X.useState(f.current?f.current(h):h);return Ib(()=>n._subscribe({name:r,formState:{values:!0},exact:a,callback:b=>{if(!o){const S=ZL(r,n._names,b.values||n._formValues,!1,d.current);if(f.current){const C=f.current(S);Ua(C,p.current)||(y(C),p.current=C)}else y(S)}}}),[n,o,r,a]),X.useEffect(()=>n._removeUnmounted()),v}function Fue(e){const t=Pp(),{name:n,disabled:r,control:i=t.control,shouldUnregister:o,defaultValue:a}=e,c=GL(i._names.array,n),d=X.useMemo(()=>Ne(i._formValues,n,Ne(i._defaultValues,n,a)),[i,n,a]),f=Uue({control:i,name:n,defaultValue:d,exact:!0}),p=OE({control:i,name:n,exact:!0}),h=X.useRef(e),v=X.useRef(void 0),y=X.useRef(i.register(n,{...e.rules,value:f,...Ci(e.disabled)?{disabled:e.disabled}:{}}));h.current=e;const b=X.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ne(p.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ne(p.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ne(p.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ne(p.validatingFields,n)},error:{enumerable:!0,get:()=>Ne(p.errors,n)}}),[p,n]),S=X.useCallback(j=>y.current.onChange({target:{value:qL(j),name:n},type:Jv.CHANGE}),[n]),C=X.useCallback(()=>y.current.onBlur({target:{value:Ne(i._formValues,n),name:n},type:Jv.BLUR}),[n,i._formValues]),E=X.useCallback(j=>{const I=Ne(i._fields,n);I&&j&&(I._f.ref={focus:()=>j.focus&&j.focus(),select:()=>j.select&&j.select(),setCustomValidity:A=>j.setCustomValidity(A),reportValidity:()=>j.reportValidity()})},[i._fields,n]),k=X.useMemo(()=>({name:n,value:f,...Ci(r)||p.disabled?{disabled:p.disabled||r}:{},onChange:S,onBlur:C,ref:E}),[n,r,p.disabled,S,C,E,f]);return X.useEffect(()=>{const j=i._options.shouldUnregister||o,I=v.current;I&&I!==n&&!c&&i.unregister(I),i.register(n,{...h.current.rules,...Ci(h.current.disabled)?{disabled:h.current.disabled}:{}});const A=(N,T)=>{const z=Ne(i._fields,N);z&&z._f&&(z._f.mount=T)};if(A(n,!0),j){const N=dn(Ne(i._options.defaultValues,n,h.current.defaultValue));zt(i._defaultValues,n,N),nn(Ne(i._formValues,n))&&zt(i._formValues,n,N)}return!c&&i.register(n),v.current=n,()=>{(c?j&&!i._state.action:j)?i.unregister(n):A(n,!1)}},[n,i,c,o]),X.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),X.useMemo(()=>({field:k,formState:p,fieldState:b}),[k,p,b])}const Vue=e=>e.render(Fue(e));var DE=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},ci=e=>Array.isArray(e)?e:[e],TD=()=>{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 YL(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const i=e[r],o=t[r];if(i&&Zn(i)&&o){const a=YL(i,o);Zn(a)&&(n[r]=a)}else e[r]&&(n[r]=o)}return n}var Pr=e=>Zn(e)&&!Object.keys(e).length,$E=e=>e.type==="file",ko=e=>typeof e=="function",ey=e=>{if(!NE)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},WL=e=>e.type==="select-multiple",PE=e=>e.type==="radio",Bue=e=>PE(e)||$p(e),RS=e=>ey(e)&&e.isConnected;function Hue(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=nn(e)?r++:e[t[r++]];return e}function que(e){for(const t in e)if(e.hasOwnProperty(t)&&!nn(e[t]))return!1;return!0}function $n(e,t){const n=Array.isArray(t)?t:jb(t)?[t]:TE(t),r=n.length===1?e:Hue(e,n),i=n.length-1,o=n[i];return r&&delete r[o],i!==0&&(Zn(r)&&Pr(r)||Array.isArray(r)&&que(r))&&$n(e,n.slice(0,-1)),e}var Gue=e=>{for(const t in e)if(ko(e[t]))return!0;return!1};function XL(e){return Array.isArray(e)||Zn(e)&&!Gue(e)}function y1(e,t={}){for(const n in e)XL(e[n])?(t[n]=Array.isArray(e[n])?[]:{},y1(e[n],t[n])):nn(e[n])||(t[n]=!0);return t}function Bu(e,t,n){n||(n=y1(t));for(const r in e)XL(e[r])?nn(t)||v1(n[r])?n[r]=y1(e[r],Array.isArray(e[r])?[]:{}):Bu(e[r],ai(t)?{}:t[r],n[r]):n[r]=!Ua(e[r],t[r]);return n}const AD={value:!1,isValid:!1},OD={value:!0,isValid:!0};var QL=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&&!nn(e[0].attributes.value)?nn(e[0].value)||e[0].value===""?OD:{value:e[0].value,isValid:!0}:OD:AD}return AD},JL=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>nn(e)?e:t?e===""?NaN:e&&+e:n&&ji(e)?new Date(e):r?r(e):e;const DD={isValid:!1,value:null};var eU=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,DD):DD;function $D(e){const t=e.ref;return $E(t)?t.files:PE(t)?eU(e.refs).value:WL(t)?[...t.selectedOptions].map(({value:n})=>n):$p(t)?QL(e.refs).value:JL(nn(t.value)?e.ref.value:t.value,e)}var Kue=(e,t,n,r)=>{const i={};for(const o of e){const a=Ne(t,o);a&&zt(i,o,a._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},ty=e=>e instanceof RegExp,pm=e=>nn(e)?e:ty(e)?e.source:Zn(e)?ty(e.value)?e.value.source:e.value:e,Zu=e=>({isOnSubmit:!e||e===oo.onSubmit,isOnBlur:e===oo.onBlur,isOnChange:e===oo.onChange,isOnAll:e===oo.all,isOnTouch:e===oo.onTouched});const PD="AsyncFunction";var Zue=e=>!!e&&!!e.validate&&!!(ko(e.validate)&&e.validate.constructor.name===PD||Zn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===PD)),Yue=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),b1=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const rd=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const o=Ne(e,i);if(o){const{_f:a,...c}=o;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],i)&&!r)return!0;if(a.ref&&t(a.ref,a.name)&&!r)return!0;if(rd(c,t))break}else if(Zn(c)&&rd(c,t))break}}};function MD(e,t,n){const r=Ne(e,n);if(r||jb(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),a=Ne(t,o),c=Ne(e,o);if(a&&!Array.isArray(a)&&n!==o)return{name:n};if(c&&c.type)return{name:o,error:c};if(c&&c.root&&c.root.type)return{name:`${o}.root`,error:c.root};i.pop()}return{name:n}}var Wue=(e,t,n,r)=>{n(e);const{name:i,...o}=e;return Pr(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!r||oo.all))},Xue=(e,t,n)=>!e||!t||e===t||ci(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),Que=(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,Jue=(e,t)=>!Rb(Ne(e,t)).length&&$n(e,t),tU=(e,t,n)=>{const r=ci(Ne(e,n));return zt(r,"root",t[n]),zt(e,n,r),e};function zD(e,t,n="validate"){if(ji(e)||Array.isArray(e)&&e.every(ji)||Ci(e)&&!e)return{type:n,message:ji(e)?e:"",ref:t}}var $u=e=>Zn(e)&&!ty(e)?e:{value:e,message:""},x1=async(e,t,n,r,i,o)=>{const{ref:a,refs:c,required:d,maxLength:f,minLength:p,min:h,max:v,pattern:y,validate:b,name:S,valueAsNumber:C,mount:E}=e._f,k=Ne(n,S);if(!E||t.has(S))return{};const j=c?c[0]:a,I=Z=>{i&&j.reportValidity&&(j.setCustomValidity(Ci(Z)?"":Z||""),j.reportValidity())},A={},N=PE(a),T=$p(a),z=N||T,L=(C||$E(a))&&nn(a.value)&&nn(k)||ey(a)&&a.value===""||k===""||Array.isArray(k)&&!k.length,G=DE.bind(null,S,r,A),J=(Z,W,F,Y=$a.maxLength,P=$a.minLength)=>{const K=Z?W:F;A[S]={type:Z?Y:P,message:K,ref:a,...G(Z?Y:P,K)}};if(o?!Array.isArray(k)||!k.length:d&&(!z&&(L||ai(k))||Ci(k)&&!k||T&&!QL(c).isValid||N&&!eU(c).isValid)){const{value:Z,message:W}=ji(d)?{value:!!d,message:d}:$u(d);if(Z&&(A[S]={type:$a.required,message:W,ref:j,...G($a.required,W)},!r))return I(W),A}if(!L&&(!ai(h)||!ai(v))){let Z,W;const F=$u(v),Y=$u(h);if(!ai(k)&&!isNaN(k)){const P=a.valueAsNumber||k&&+k;ai(F.value)||(Z=P>F.value),ai(Y.value)||(W=P<Y.value)}else{const P=a.valueAsDate||new Date(k),K=D=>new Date(new Date().toDateString()+" "+D),U=a.type=="time",te=a.type=="week";ji(F.value)&&k&&(Z=U?K(k)>K(F.value):te?k>F.value:P>new Date(F.value)),ji(Y.value)&&k&&(W=U?K(k)<K(Y.value):te?k<Y.value:P<new Date(Y.value))}if((Z||W)&&(J(!!Z,F.message,Y.message,$a.max,$a.min),!r))return I(A[S].message),A}if((f||p)&&!L&&(ji(k)||o&&Array.isArray(k))){const Z=$u(f),W=$u(p),F=!ai(Z.value)&&k.length>+Z.value,Y=!ai(W.value)&&k.length<+W.value;if((F||Y)&&(J(F,Z.message,W.message),!r))return I(A[S].message),A}if(y&&!L&&ji(k)){const{value:Z,message:W}=$u(y);if(ty(Z)&&!k.match(Z)&&(A[S]={type:$a.pattern,message:W,ref:a,...G($a.pattern,W)},!r))return I(W),A}if(b){if(ko(b)){const Z=await b(k,n),W=zD(Z,j);if(W&&(A[S]={...W,...G($a.validate,W.message)},!r))return I(W.message),A}else if(Zn(b)){let Z={};for(const W in b){if(!Pr(Z)&&!r)break;const F=zD(await b[W](k,n),j,W);F&&(Z={...F,...G(W,F.message)},I(F.message),r&&(A[S]=Z))}if(!Pr(Z)&&(A[S]={ref:j,...Z},!r))return A}}return I(!0),A};const ede={mode:oo.onSubmit,reValidateMode:oo.onChange,shouldFocusError:!0};function tde(e={}){let t={...ede,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:ko(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=Zn(t.defaultValues)||Zn(t.values)?dn(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:dn(i),a={action:!1,mount:!1,watch:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},d,f=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let h={...p};const v={array:TD(),state:TD()},y=t.criteriaMode===oo.all,b=q=>oe=>{clearTimeout(f),f=setTimeout(q,oe)},S=async q=>{if(!t.disabled&&(p.isValid||h.isValid||q)){const oe=t.resolver?Pr((await T()).errors):await L(r,!0);oe!==n.isValid&&v.state.next({isValid:oe})}},C=(q,oe)=>{!t.disabled&&(p.isValidating||p.validatingFields||h.isValidating||h.validatingFields)&&((q||Array.from(c.mount)).forEach(de=>{de&&(oe?zt(n.validatingFields,de,oe):$n(n.validatingFields,de))}),v.state.next({validatingFields:n.validatingFields,isValidating:!Pr(n.validatingFields)}))},E=(q,oe=[],de,we,ve=!0,Ee=!0)=>{if(we&&de&&!t.disabled){if(a.action=!0,Ee&&Array.isArray(Ne(r,q))){const ne=de(Ne(r,q),we.argA,we.argB);ve&&zt(r,q,ne)}if(Ee&&Array.isArray(Ne(n.errors,q))){const ne=de(Ne(n.errors,q),we.argA,we.argB);ve&&zt(n.errors,q,ne),Jue(n.errors,q)}if((p.touchedFields||h.touchedFields)&&Ee&&Array.isArray(Ne(n.touchedFields,q))){const ne=de(Ne(n.touchedFields,q),we.argA,we.argB);ve&&zt(n.touchedFields,q,ne)}(p.dirtyFields||h.dirtyFields)&&(n.dirtyFields=Bu(i,o)),v.state.next({name:q,isDirty:J(q,oe),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else zt(o,q,oe)},k=(q,oe)=>{zt(n.errors,q,oe),v.state.next({errors:n.errors})},j=q=>{n.errors=q,v.state.next({errors:n.errors,isValid:!1})},I=(q,oe,de,we)=>{const ve=Ne(r,q);if(ve){const Ee=Ne(o,q,nn(de)?Ne(i,q):de);nn(Ee)||we&&we.defaultChecked||oe?zt(o,q,oe?Ee:$D(ve._f)):F(q,Ee),a.mount&&S()}},A=(q,oe,de,we,ve)=>{let Ee=!1,ne=!1;const ye={name:q};if(!t.disabled){if(!de||we){(p.isDirty||h.isDirty)&&(ne=n.isDirty,n.isDirty=ye.isDirty=J(),Ee=ne!==ye.isDirty);const Te=Ua(Ne(i,q),oe);ne=!!Ne(n.dirtyFields,q),Te?$n(n.dirtyFields,q):zt(n.dirtyFields,q,!0),ye.dirtyFields=n.dirtyFields,Ee=Ee||(p.dirtyFields||h.dirtyFields)&&ne!==!Te}if(de){const Te=Ne(n.touchedFields,q);Te||(zt(n.touchedFields,q,de),ye.touchedFields=n.touchedFields,Ee=Ee||(p.touchedFields||h.touchedFields)&&Te!==de)}Ee&&ve&&v.state.next(ye)}return Ee?ye:{}},N=(q,oe,de,we)=>{const ve=Ne(n.errors,q),Ee=(p.isValid||h.isValid)&&Ci(oe)&&n.isValid!==oe;if(t.delayError&&de?(d=b(()=>k(q,de)),d(t.delayError)):(clearTimeout(f),d=null,de?zt(n.errors,q,de):$n(n.errors,q)),(de?!Ua(ve,de):ve)||!Pr(we)||Ee){const ne={...we,...Ee&&Ci(oe)?{isValid:oe}:{},errors:n.errors,name:q};n={...n,...ne},v.state.next(ne)}},T=async q=>{C(q,!0);const oe=await t.resolver(o,t.context,Kue(q||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return C(q),oe},z=async q=>{const{errors:oe}=await T(q);if(q)for(const de of q){const we=Ne(oe,de);we?zt(n.errors,de,we):$n(n.errors,de)}else n.errors=oe;return oe},L=async(q,oe,de={valid:!0})=>{for(const we in q){const ve=q[we];if(ve){const{_f:Ee,...ne}=ve;if(Ee){const ye=c.array.has(Ee.name),Te=ve._f&&Zue(ve._f);Te&&p.validatingFields&&C([Ee.name],!0);const Ze=await x1(ve,c.disabled,o,y,t.shouldUseNativeValidation&&!oe,ye);if(Te&&p.validatingFields&&C([Ee.name]),Ze[Ee.name]&&(de.valid=!1,oe))break;!oe&&(Ne(Ze,Ee.name)?ye?tU(n.errors,Ze,Ee.name):zt(n.errors,Ee.name,Ze[Ee.name]):$n(n.errors,Ee.name))}!Pr(ne)&&await L(ne,oe,de)}}return de.valid},G=()=>{for(const q of c.unMount){const oe=Ne(r,q);oe&&(oe._f.refs?oe._f.refs.every(de=>!RS(de)):!RS(oe._f.ref))&&B(q)}c.unMount=new Set},J=(q,oe)=>!t.disabled&&(q&&oe&&zt(o,q,oe),!Ua(D(),i)),Z=(q,oe,de)=>ZL(q,c,{...a.mount?o:nn(oe)?i:ji(q)?{[q]:oe}:oe},de,oe),W=q=>Rb(Ne(a.mount?o:i,q,t.shouldUnregister?Ne(i,q,[]):[])),F=(q,oe,de={})=>{const we=Ne(r,q);let ve=oe;if(we){const Ee=we._f;Ee&&(!Ee.disabled&&zt(o,q,JL(oe,Ee)),ve=ey(Ee.ref)&&ai(oe)?"":oe,WL(Ee.ref)?[...Ee.ref.options].forEach(ne=>ne.selected=ve.includes(ne.value)):Ee.refs?$p(Ee.ref)?Ee.refs.forEach(ne=>{(!ne.defaultChecked||!ne.disabled)&&(Array.isArray(ve)?ne.checked=!!ve.find(ye=>ye===ne.value):ne.checked=ve===ne.value||!!ve)}):Ee.refs.forEach(ne=>ne.checked=ne.value===ve):$E(Ee.ref)?Ee.ref.value="":(Ee.ref.value=ve,Ee.ref.type||v.state.next({name:q,values:dn(o)})))}(de.shouldDirty||de.shouldTouch)&&A(q,ve,de.shouldTouch,de.shouldDirty,!0),de.shouldValidate&&te(q)},Y=(q,oe,de)=>{for(const we in oe){if(!oe.hasOwnProperty(we))return;const ve=oe[we],Ee=q+"."+we,ne=Ne(r,Ee);(c.array.has(q)||Zn(ve)||ne&&!ne._f)&&!Wl(ve)?Y(Ee,ve,de):F(Ee,ve,de)}},P=(q,oe,de={})=>{const we=Ne(r,q),ve=c.array.has(q),Ee=dn(oe);zt(o,q,Ee),ve?(v.array.next({name:q,values:dn(o)}),(p.isDirty||p.dirtyFields||h.isDirty||h.dirtyFields)&&de.shouldDirty&&v.state.next({name:q,dirtyFields:Bu(i,o),isDirty:J(q,Ee)})):we&&!we._f&&!ai(Ee)?Y(q,Ee,de):F(q,Ee,de),b1(q,c)&&v.state.next({...n,name:q}),v.state.next({name:a.mount?q:void 0,values:dn(o)})},K=async q=>{a.mount=!0;const oe=q.target;let de=oe.name,we=!0;const ve=Ne(r,de),Ee=Te=>{we=Number.isNaN(Te)||Wl(Te)&&isNaN(Te.getTime())||Ua(Te,Ne(o,de,Te))},ne=Zu(t.mode),ye=Zu(t.reValidateMode);if(ve){let Te,Ze;const st=oe.type?$D(ve._f):qL(q),qt=q.type===Jv.BLUR||q.type===Jv.FOCUS_OUT,Vn=!Yue(ve._f)&&!t.resolver&&!Ne(n.errors,de)&&!ve._f.deps||Que(qt,Ne(n.touchedFields,de),n.isSubmitted,ye,ne),xn=b1(de,c,qt);zt(o,de,st),qt?(!oe||!oe.readOnly)&&(ve._f.onBlur&&ve._f.onBlur(q),d&&d(0)):ve._f.onChange&&ve._f.onChange(q);const Yt=A(de,st,qt),_t=!Pr(Yt)||xn;if(!qt&&v.state.next({name:de,type:q.type,values:dn(o)}),Vn)return(p.isValid||h.isValid)&&(t.mode==="onBlur"?qt&&S():qt||S()),_t&&v.state.next({name:de,...xn?{}:Yt});if(!qt&&xn&&v.state.next({...n}),t.resolver){const{errors:yt}=await T([de]);if(Ee(st),we){const Gr=MD(n.errors,r,de),or=MD(yt,r,Gr.name||de);Te=or.error,de=or.name,Ze=Pr(yt)}}else C([de],!0),Te=(await x1(ve,c.disabled,o,y,t.shouldUseNativeValidation))[de],C([de]),Ee(st),we&&(Te?Ze=!1:(p.isValid||h.isValid)&&(Ze=await L(r,!0)));we&&(ve._f.deps&&(!Array.isArray(ve._f.deps)||ve._f.deps.length>0)&&te(ve._f.deps),N(de,Ze,Te,Yt))}},U=(q,oe)=>{if(Ne(n.errors,oe)&&q.focus)return q.focus(),1},te=async(q,oe={})=>{let de,we;const ve=ci(q);if(t.resolver){const Ee=await z(nn(q)?q:ve);de=Pr(Ee),we=q?!ve.some(ne=>Ne(Ee,ne)):de}else q?(we=(await Promise.all(ve.map(async Ee=>{const ne=Ne(r,Ee);return await L(ne&&ne._f?{[Ee]:ne}:ne)}))).every(Boolean),!(!we&&!n.isValid)&&S()):we=de=await L(r);return v.state.next({...!ji(q)||(p.isValid||h.isValid)&&de!==n.isValid?{}:{name:q},...t.resolver||!q?{isValid:de}:{},errors:n.errors}),oe.shouldFocus&&!we&&rd(r,U,q?ve:c.mount),we},D=(q,oe)=>{let de={...a.mount?o:i};return oe&&(de=YL(oe.dirtyFields?n.dirtyFields:n.touchedFields,de)),nn(q)?de:ji(q)?Ne(de,q):q.map(we=>Ne(de,we))},M=(q,oe)=>({invalid:!!Ne((oe||n).errors,q),isDirty:!!Ne((oe||n).dirtyFields,q),error:Ne((oe||n).errors,q),isValidating:!!Ne(n.validatingFields,q),isTouched:!!Ne((oe||n).touchedFields,q)}),V=q=>{q&&ci(q).forEach(oe=>$n(n.errors,oe)),v.state.next({errors:q?n.errors:{}})},O=(q,oe,de)=>{const we=(Ne(r,q,{_f:{}})._f||{}).ref,ve=Ne(n.errors,q)||{},{ref:Ee,message:ne,type:ye,...Te}=ve;zt(n.errors,q,{...Te,...oe,ref:we}),v.state.next({name:q,errors:n.errors,isValid:!1}),de&&de.shouldFocus&&we&&we.focus&&we.focus()},ee=(q,oe)=>ko(q)?v.state.subscribe({next:de=>"values"in de&&q(Z(void 0,oe),de)}):Z(q,oe,!0),ue=q=>v.state.subscribe({next:oe=>{Xue(q.name,oe.name,q.exact)&&Wue(oe,q.formState||p,Fn,q.reRenderRoot)&&q.callback({values:{...o},...n,...oe,defaultValues:i})}}).unsubscribe,pe=q=>(a.mount=!0,h={...h,...q.formState},ue({...q,formState:h})),B=(q,oe={})=>{for(const de of q?ci(q):c.mount)c.mount.delete(de),c.array.delete(de),oe.keepValue||($n(r,de),$n(o,de)),!oe.keepError&&$n(n.errors,de),!oe.keepDirty&&$n(n.dirtyFields,de),!oe.keepTouched&&$n(n.touchedFields,de),!oe.keepIsValidating&&$n(n.validatingFields,de),!t.shouldUnregister&&!oe.keepDefaultValue&&$n(i,de);v.state.next({values:dn(o)}),v.state.next({...n,...oe.keepDirty?{isDirty:J()}:{}}),!oe.keepIsValid&&S()},ie=({disabled:q,name:oe})=>{(Ci(q)&&a.mount||q||c.disabled.has(oe))&&(q?c.disabled.add(oe):c.disabled.delete(oe))},Se=(q,oe={})=>{let de=Ne(r,q);const we=Ci(oe.disabled)||Ci(t.disabled);return zt(r,q,{...de||{},_f:{...de&&de._f?de._f:{ref:{name:q}},name:q,mount:!0,...oe}}),c.mount.add(q),de?ie({disabled:Ci(oe.disabled)?oe.disabled:t.disabled,name:q}):I(q,!0,oe.value),{...we?{disabled:oe.disabled||t.disabled}:{},...t.progressive?{required:!!oe.required,min:pm(oe.min),max:pm(oe.max),minLength:pm(oe.minLength),maxLength:pm(oe.maxLength),pattern:pm(oe.pattern)}:{},name:q,onChange:K,onBlur:K,ref:ve=>{if(ve){Se(q,oe),de=Ne(r,q);const Ee=nn(ve.value)&&ve.querySelectorAll&&ve.querySelectorAll("input,select,textarea")[0]||ve,ne=Bue(Ee),ye=de._f.refs||[];if(ne?ye.find(Te=>Te===Ee):Ee===de._f.ref)return;zt(r,q,{_f:{...de._f,...ne?{refs:[...ye.filter(RS),Ee,...Array.isArray(Ne(i,q))?[{}]:[]],ref:{type:Ee.type,name:q}}:{ref:Ee}}}),I(q,!1,void 0,Ee)}else de=Ne(r,q,{}),de._f&&(de._f.mount=!1),(t.shouldUnregister||oe.shouldUnregister)&&!(GL(c.array,q)&&a.action)&&c.unMount.add(q)}}},Ie=()=>t.shouldFocusError&&rd(r,U,c.mount),Fe=q=>{Ci(q)&&(v.state.next({disabled:q}),rd(r,(oe,de)=>{const we=Ne(r,de);we&&(oe.disabled=we._f.disabled||q,Array.isArray(we._f.refs)&&we._f.refs.forEach(ve=>{ve.disabled=we._f.disabled||q}))},0,!1))},Ue=(q,oe)=>async de=>{let we;de&&(de.preventDefault&&de.preventDefault(),de.persist&&de.persist());let ve=dn(o);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:Ee,values:ne}=await T();n.errors=Ee,ve=dn(ne)}else await L(r);if(c.disabled.size)for(const Ee of c.disabled)$n(ve,Ee);if($n(n.errors,"root"),Pr(n.errors)){v.state.next({errors:{}});try{await q(ve,de)}catch(Ee){we=Ee}}else oe&&await oe({...n.errors},de),Ie(),setTimeout(Ie);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Pr(n.errors)&&!we,submitCount:n.submitCount+1,errors:n.errors}),we)throw we},Ye=(q,oe={})=>{Ne(r,q)&&(nn(oe.defaultValue)?P(q,dn(Ne(i,q))):(P(q,oe.defaultValue),zt(i,q,dn(oe.defaultValue))),oe.keepTouched||$n(n.touchedFields,q),oe.keepDirty||($n(n.dirtyFields,q),n.isDirty=oe.defaultValue?J(q,dn(Ne(i,q))):J()),oe.keepError||($n(n.errors,q),p.isValid&&S()),v.state.next({...n}))},St=(q,oe={})=>{const de=q?dn(q):i,we=dn(de),ve=Pr(q),Ee=ve?i:we;if(oe.keepDefaultValues||(i=de),!oe.keepValues){if(oe.keepDirtyValues){const ne=new Set([...c.mount,...Object.keys(Bu(i,o))]);for(const ye of Array.from(ne))Ne(n.dirtyFields,ye)?zt(Ee,ye,Ne(o,ye)):P(ye,Ne(Ee,ye))}else{if(NE&&nn(q))for(const ne of c.mount){const ye=Ne(r,ne);if(ye&&ye._f){const Te=Array.isArray(ye._f.refs)?ye._f.refs[0]:ye._f.ref;if(ey(Te)){const Ze=Te.closest("form");if(Ze){Ze.reset();break}}}}if(oe.keepFieldsRef)for(const ne of c.mount)P(ne,Ne(Ee,ne));else r={}}o=t.shouldUnregister?oe.keepDefaultValues?dn(i):{}:dn(Ee),v.array.next({values:{...Ee}}),v.state.next({values:{...Ee}})}c={mount:oe.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!p.isValid||!!oe.keepIsValid||!!oe.keepDirtyValues,a.watch=!!t.shouldUnregister,v.state.next({submitCount:oe.keepSubmitCount?n.submitCount:0,isDirty:ve?!1:oe.keepDirty?n.isDirty:!!(oe.keepDefaultValues&&!Ua(q,i)),isSubmitted:oe.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ve?{}:oe.keepDirtyValues?oe.keepDefaultValues&&o?Bu(i,o):n.dirtyFields:oe.keepDefaultValues&&q?Bu(i,q):oe.keepDirty?n.dirtyFields:{},touchedFields:oe.keepTouched?n.touchedFields:{},errors:oe.keepErrors?n.errors:{},isSubmitSuccessful:oe.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},gn=(q,oe)=>St(ko(q)?q(o):q,oe),Tn=(q,oe={})=>{const de=Ne(r,q),we=de&&de._f;if(we){const ve=we.refs?we.refs[0]:we.ref;ve.focus&&(ve.focus(),oe.shouldSelect&&ko(ve.select)&&ve.select())}},Fn=q=>{n={...n,...q}},en={control:{register:Se,unregister:B,getFieldState:M,handleSubmit:Ue,setError:O,_subscribe:ue,_runSchema:T,_focusError:Ie,_getWatch:Z,_getDirty:J,_setValid:S,_setFieldArray:E,_setDisabledField:ie,_setErrors:j,_getFieldArray:W,_reset:St,_resetDefaultValues:()=>ko(t.defaultValues)&&t.defaultValues().then(q=>{gn(q,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:G,_disableForm:Fe,_subjects:v,_proxyFormState:p,get _fields(){return r},get _formValues(){return o},get _state(){return a},set _state(q){a=q},get _defaultValues(){return i},get _names(){return c},set _names(q){c=q},get _formState(){return n},get _options(){return t},set _options(q){t={...t,...q}}},subscribe:pe,trigger:te,register:Se,handleSubmit:Ue,watch:ee,setValue:P,getValues:D,reset:gn,resetField:Ye,clearErrors:V,unregister:B,setError:O,setFocus:Tn,getFieldState:M};return{...en,formControl:en}}var Ns=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},IS=(e,t,n={})=>n.shouldFocus||nn(n.shouldFocus)?n.focusName||`${e}.${nn(n.focusIndex)?t:n.focusIndex}.`:"",NS=(e,t)=>[...e,...ci(t)],TS=e=>Array.isArray(e)?e.map(()=>{}):void 0;function AS(e,t,n){return[...e.slice(0,t),...ci(n),...e.slice(t)]}var OS=(e,t,n)=>Array.isArray(e)?(nn(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],DS=(e,t)=>[...ci(t),...ci(e)];function nde(e,t){let n=0;const r=[...e];for(const i of t)r.splice(i-n,1),n++;return Rb(r).length?r:[]}var $S=(e,t)=>nn(t)?[]:nde(e,ci(t).sort((n,r)=>n-r)),PS=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},LD=(e,t,n)=>(e[t]=n,e);function nU(e){const t=Pp(),{control:n=t.control,name:r,keyName:i="id",shouldUnregister:o,rules:a}=e,[c,d]=X.useState(n._getFieldArray(r)),f=X.useRef(n._getFieldArray(r).map(Ns)),p=X.useRef(!1);n._names.array.add(r),X.useMemo(()=>a&&c.length>=0&&n.register(r,a),[n,r,c.length,a]),Ib(()=>n._subjects.array.subscribe({next:({values:I,name:A})=>{if(A===r||!A){const N=Ne(I,r);Array.isArray(N)&&(d(N),f.current=N.map(Ns))}}}).unsubscribe,[n,r]);const h=X.useCallback(I=>{p.current=!0,n._setFieldArray(r,I)},[n,r]),v=(I,A)=>{const N=ci(dn(I)),T=NS(n._getFieldArray(r),N);n._names.focus=IS(r,T.length-1,A),f.current=NS(f.current,N.map(Ns)),h(T),d(T),n._setFieldArray(r,T,NS,{argA:TS(I)})},y=(I,A)=>{const N=ci(dn(I)),T=DS(n._getFieldArray(r),N);n._names.focus=IS(r,0,A),f.current=DS(f.current,N.map(Ns)),h(T),d(T),n._setFieldArray(r,T,DS,{argA:TS(I)})},b=I=>{const A=$S(n._getFieldArray(r),I);f.current=$S(f.current,I),h(A),d(A),!Array.isArray(Ne(n._fields,r))&&zt(n._fields,r,void 0),n._setFieldArray(r,A,$S,{argA:I})},S=(I,A,N)=>{const T=ci(dn(A)),z=AS(n._getFieldArray(r),I,T);n._names.focus=IS(r,I,N),f.current=AS(f.current,I,T.map(Ns)),h(z),d(z),n._setFieldArray(r,z,AS,{argA:I,argB:TS(A)})},C=(I,A)=>{const N=n._getFieldArray(r);PS(N,I,A),PS(f.current,I,A),h(N),d(N),n._setFieldArray(r,N,PS,{argA:I,argB:A},!1)},E=(I,A)=>{const N=n._getFieldArray(r);OS(N,I,A),OS(f.current,I,A),h(N),d(N),n._setFieldArray(r,N,OS,{argA:I,argB:A},!1)},k=(I,A)=>{const N=dn(A),T=LD(n._getFieldArray(r),I,N);f.current=[...T].map((z,L)=>!z||L===I?Ns():f.current[L]),h(T),d([...T]),n._setFieldArray(r,T,LD,{argA:I,argB:N},!0,!1)},j=I=>{const A=ci(dn(I));f.current=A.map(Ns),h([...A]),d([...A]),n._setFieldArray(r,[...A],N=>N,{},!0,!1)};return X.useEffect(()=>{if(n._state.action=!1,b1(r,n._names)&&n._subjects.state.next({...n._formState}),p.current&&(!Zu(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!Zu(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([r]).then(I=>{const A=Ne(I.errors,r),N=Ne(n._formState.errors,r);(N?!A&&N.type||A&&(N.type!==A.type||N.message!==A.message):A&&A.type)&&(A?zt(n._formState.errors,r,A):$n(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const I=Ne(n._fields,r);I&&I._f&&!(Zu(n._options.reValidateMode).isOnSubmit&&Zu(n._options.mode).isOnSubmit)&&x1(I,n._names.disabled,n._formValues,n._options.criteriaMode===oo.all,n._options.shouldUseNativeValidation,!0).then(A=>!Pr(A)&&n._subjects.state.next({errors:tU(n._formState.errors,A,r)}))}n._subjects.state.next({name:r,values:dn(n._formValues)}),n._names.focus&&rd(n._fields,(I,A)=>{if(n._names.focus&&A.startsWith(n._names.focus)&&I.focus)return I.focus(),1}),n._names.focus="",n._setValid(),p.current=!1},[c,r,n]),X.useEffect(()=>(!Ne(n._formValues,r)&&n._setFieldArray(r),()=>{const I=(A,N)=>{const T=Ne(n._fields,A);T&&T._f&&(T._f.mount=N)};n._options.shouldUnregister||o?n.unregister(r):I(r,!1)}),[r,n,i,o]),{swap:X.useCallback(C,[h,r,n]),move:X.useCallback(E,[h,r,n]),prepend:X.useCallback(y,[h,r,n]),append:X.useCallback(v,[h,r,n]),remove:X.useCallback(b,[h,r,n]),insert:X.useCallback(S,[h,r,n]),update:X.useCallback(k,[h,r,n]),replace:X.useCallback(j,[h,r,n]),fields:X.useMemo(()=>c.map((I,A)=>({...I,[i]:f.current[A]||Ns()})),[c,i])}}function Xt(e={}){const t=X.useRef(void 0),n=X.useRef(void 0),[r,i]=X.useState({isDirty:!1,isValidating:!1,isLoading:ko(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:ko(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!ko(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...c}=tde(e);t.current={...c,formState:r}}const o=t.current.control;return o._options=e,Ib(()=>{const a=o._subscribe({formState:o._proxyFormState,callback:()=>i({...o._formState}),reRenderRoot:!0});return i(c=>({...c,isReady:!0})),o._formState.isReady=!0,a},[o]),X.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),X.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),X.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),X.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),X.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==r.isDirty&&o._subjects.state.next({isDirty:a})}},[o,r.isDirty]),X.useEffect(()=>{e.values&&!Ua(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),n.current=e.values,i(a=>({...a}))):o._resetDefaultValues()},[o,e.values]),X.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=KL(r,o),t.current}const Qt=Lue,rU=x.createContext({}),iU=x.createContext({});function Nb(){const e=x.useContext(rU),t=x.useContext(iU),{getFieldState:n}=Pp(),r=OE({name:e.name}),i=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...i}}function $e({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:i}=Nb();return u.jsx(OC,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${i}`:`${r}`,"aria-invalid":!!t,...e})}function Pe({...e}){return u.jsx(rU,{value:{name:e.name},children:u.jsx(Vue,{...e})})}function Ae({className:e,...t}){const n=x.useId();return u.jsx(iU,{value:{id:n},children:u.jsx("div",{"data-slot":"form-item",className:Me("grid gap-2",e),...t})})}var rde=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],oU=rde.reduce((e,t)=>{const n=SM(`Primitive.${t}`),r=x.forwardRef((i,o)=>{const{asChild:a,...c}=i,d=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(d,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),ide="Label",aU=x.forwardRef((e,t)=>u.jsx(oU.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));aU.displayName=ide;var ode=aU;function Mp({className:e,...t}){return u.jsx(ode,{"data-slot":"label",className:Me("text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function Oe({className:e,...t}){const{error:n,formItemId:r}=Nb();return u.jsx(Mp,{"data-slot":"form-label","data-error":!!n,className:Me("data-[error=true]:text-destructive",e),htmlFor:r,...t})}function De({className:e,...t}){const{error:n,formMessageId:r}=Nb(),i=n?String(n?.message):t.children;return i?u.jsx("p",{"data-slot":"form-message",id:r,className:Me("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:Me(`border-input file:text-foreground placeholder:text-muted-foreground selection:bg-purple
38
+ `,r:"\r",t:" "};function sre(e){return e.startsWith("u")?String.fromCharCode(parseInt(e.slice(1),16)):are[e]}const lre="v1",cre=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function ure(e,t){let n;const r=fre(),i=await gre(e);return i.ok?(r.increment("fetch","success"),n=dre(e,i.value,t,r)):(r.increment("fetch","failure"),mt.error(i.error)),ab("remote configuration metrics",{metrics:r.get()}),n}function dre(e,t,n,r){const i={...e};return cre.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(mre(v)){if(pre(v)){const y=v.rcSerializedType;switch(y){case"string":return v.value;case"regex":return n4(v.value);case"dynamic":return c(v);default:mt.error(`Unsupported remote configuration: "rcSerializedType": "${y}"`);return}}return ZM(v,o)}return v}function a(v,y){y.forEach(({key:b,value:S})=>{v.setContextProperty(b,o(S))})}function c(v){const y=v.strategy;let b;switch(y){case"cookie":b=d(v);break;case"dom":b=f(v);break;case"js":b=h(v);break;default:mt.error(`Unsupported remote configuration: "strategy": "${y}"`);return}const S=v.extractor;return S!==void 0&&typeof b=="string"?hre(S,b):b}function d({name:v}){const y=rb(v);return r.increment("cookie",y!==void 0?"success":"missing"),y}function f({selector:v,attribute:y}){let b;try{b=document.querySelector(v)}catch{mt.error(`Invalid selector in the remote configuration: '${v}'`),r.increment("dom","failure");return}if(!b){r.increment("dom","missing");return}if(p(b,y)){mt.error(`Forbidden element selected by the remote configuration: '${v}'`),r.increment("dom","failure");return}const S=y!==void 0?b.getAttribute(y):b.textContent;if(S===null){r.increment("dom","missing");return}return r.increment("dom","success"),S}function p(v,y){return v.getAttribute("type")==="password"&&y==="value"}function h({path:v}){let y=window;const b=Wne(v);if(b.length===0){mt.error(`Invalid JSON path in the remote configuration: '${v}'`),r.increment("js","failure");return}for(const S of b){if(!(S in y)){r.increment("js","missing");return}try{y=y[S]}catch(C){mt.error(`Error accessing: '${v}'`,C),r.increment("js","failure");return}}return r.increment("js","success"),y}}function fre(){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 mre(e){return typeof e=="object"&&e!==null}function pre(e){return"rcSerializedType"in e}function n4(e){try{return new RegExp(e)}catch{mt.error(`Invalid regex in the remote configuration: '${e}'`)}}function hre(e,t){const n=n4(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 gre(e){let t;try{t=await fetch(vre(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 vre(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${hz("rum",e)}/${lre}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function yre({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},n,r,i){const o=_ne(),a=Gz();gS(a,ur.globalContext,o);const c=Kz();gS(c,ur.userContext,o);const d=qz();gS(d,ur.accountContext,o);let f,p,h,v;const y=n.observable.subscribe(S),b={};function S(){if(!h||!v||!n.isGranted())return;y.unsubscribe();let I;if(v.trackViewsManually){if(!f)return;o.remove(f.callback),I=f.options}const A=i(v,p,I);o.drain(A)}function C(I,A){const N=yd();if(N&&(I=bre(I)),h=I,zte(Yne(I)),v){xz("DD_RUM",I);return}const T=Bne(I,A);if(T){if(!N&&!T.sessionStoreStrategyType){mt.warn("No storage available for session. We will not send any data.");return}T.compressIntakeRequests&&!N&&t&&(p=t(T,"Datadog RUM",Ht),!p)||(v=T,Hz().subscribe(Ht),n.tryToInit(T.trackingConsent),S())}}const E=I=>{o.add(A=>A.addDurationVital(I))};return{init(I,A,N){if(!I){mt.error("Missing configuration");return}kee(I.enableExperimentalFeatures),h=I,!(e&&zz())&&(Xz(I.plugins,"onInit",{initConfiguration:I,publicApi:A}),I.remoteConfigurationId?ure(I,{user:c,context:a}).then(T=>{T&&C(T,N)}).catch(Js):C(I,N))},get initConfiguration(){return h},getInternalContext:Ht,stopSession:Ht,addTiming(I,A=vr()){o.add(N=>N.addTiming(I,A))},startView(I,A=ir()){const N=T=>{T.startView(I,A)};o.add(N),f||(f={options:I,callback:N},S())},setViewName(I){o.add(A=>A.setViewName(I))},setViewContext(I){o.add(A=>A.setViewContext(I))},setViewContextProperty(I,A){o.add(N=>N.setViewContextProperty(I,A))},getViewContext:()=>b,globalContext:a,userContext:c,accountContext:d,addAction(I){o.add(A=>A.addAction(I))},addError(I){o.add(A=>A.addError(I))},addFeatureFlagEvaluation(I,A){o.add(N=>N.addFeatureFlagEvaluation(I,A))},startDurationVital(I,A){return Yz(r,I,A)},stopDurationVital(I,A){Wz(E,r,I,A)},addDurationVital:E,addOperationStepVital:(I,A,N,T)=>{o.add(z=>z.addOperationStepVital(fn(I),A,fn(N),fn(T)))}}}function bre(e){var t,n;return{...e,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(t=e.defaultPrivacyLevel)!==null&&t!==void 0?t:(n=jp())===null||n===void 0?void 0:n.getPrivacyLevel()}}function gS(e,t,n){e.changeObservable.subscribe(()=>{const r=e.getContext();n.add(i=>i[t].setContext(r))})}function xre(e,t,n,r={}){const i=oee(),o=Dne(),a=Ane().observable;let c=yre(r,i,o,(h,v,y)=>{const b=v&&r.createDeflateEncoder?C=>r.createDeflateEncoder(h,v,C):ene,S=e(h,t,n,y,b,i,o,a,r.sdkName);return t.onRumStart(S.lifeCycle,h,S.session,S.viewHistory,v,S.telemetry),n.onRumStart(S.lifeCycle,S.hooks,h,S.session,S.viewHistory,b),c=wre(c,S),Xz(h.plugins,"onRumStart",{strategy:c,addEvent:S.addEvent}),S});const d=()=>c,f=bt(h=>{const v=typeof h=="object"?h:{name:h};c.startView(v),cr({feature:"start-view"})}),p=nte({init:h=>{const v=new Error().stack;Ys(()=>c.init(h,p,v))},setTrackingConsent:bt(h=>{i.update(h),cr({feature:"set-tracking-consent",tracking_consent:h})}),setViewName:bt(h=>{c.setViewName(h),cr({feature:"set-view-name"})}),setViewContext:bt(h=>{c.setViewContext(h),cr({feature:"set-view-context"})}),setViewContextProperty:bt((h,v)=>{c.setViewContextProperty(h,v),cr({feature:"set-view-context-property"})}),getViewContext:bt(()=>(cr({feature:"set-view-context-property"}),c.getViewContext())),getInternalContext:bt(h=>c.getInternalContext(h)),getInitConfiguration:bt(()=>KC(c.initConfiguration)),addAction:(h,v)=>{const y=Xm("action");Ys(()=>{c.addAction({name:fn(h),context:fn(v),startClocks:ir(),type:QC.CUSTOM,handlingStack:y}),cr({feature:"add-action"})})},addError:(h,v)=>{const y=Xm("error");Ys(()=>{c.addError({error:h,handlingStack:y,context:fn(v),startClocks:ir()}),cr({feature:"add-error"})})},addTiming:bt((h,v)=>{c.addTiming(fn(h),v)}),setGlobalContext:Or(d,ur.globalContext,Dr.setContext,"set-global-context"),getGlobalContext:Or(d,ur.globalContext,Dr.getContext,"get-global-context"),setGlobalContextProperty:Or(d,ur.globalContext,Dr.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:Or(d,ur.globalContext,Dr.removeContextProperty,"remove-global-context-property"),clearGlobalContext:Or(d,ur.globalContext,Dr.clearContext,"clear-global-context"),setUser:Or(d,ur.userContext,Dr.setContext,"set-user"),getUser:Or(d,ur.userContext,Dr.getContext,"get-user"),setUserProperty:Or(d,ur.userContext,Dr.setContextProperty,"set-user-property"),removeUserProperty:Or(d,ur.userContext,Dr.removeContextProperty,"remove-user-property"),clearUser:Or(d,ur.userContext,Dr.clearContext,"clear-user"),setAccount:Or(d,ur.accountContext,Dr.setContext,"set-account"),getAccount:Or(d,ur.accountContext,Dr.getContext,"get-account"),setAccountProperty:Or(d,ur.accountContext,Dr.setContextProperty,"set-account-property"),removeAccountProperty:Or(d,ur.accountContext,Dr.removeContextProperty,"remove-account-property"),clearAccount:Or(d,ur.accountContext,Dr.clearContext,"clear-account"),startView:f,stopSession:bt(()=>{c.stopSession(),cr({feature:"stop-session"})}),addFeatureFlagEvaluation:bt((h,v)=>{c.addFeatureFlagEvaluation(fn(h),fn(v)),cr({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:bt(()=>t.getSessionReplayLink()),startSessionReplayRecording:bt(h=>{t.start(h),cr({feature:"start-session-replay-recording",force:h&&h.force})}),stopSessionReplayRecording:bt(()=>t.stop()),addDurationVital:bt((h,v)=>{cr({feature:"add-duration-vital"}),c.addDurationVital({name:fn(h),type:Jm.DURATION,startClocks:gJ(v.startTime),duration:v.duration,context:fn(v&&v.context),description:fn(v&&v.description)})}),startDurationVital:bt((h,v)=>(cr({feature:"start-duration-vital"}),c.startDurationVital(fn(h),{context:fn(v&&v.context),description:fn(v&&v.description)}))),stopDurationVital:bt((h,v)=>{cr({feature:"stop-duration-vital"}),c.stopDurationVital(typeof h=="string"?fn(h):h,{context:fn(v&&v.context),description:fn(v&&v.description)})}),startFeatureOperation:bt((h,v)=>{cr({feature:"add-operation-step-vital",action_type:"start"}),c.addOperationStepVital(h,"start",v)}),succeedFeatureOperation:bt((h,v)=>{cr({feature:"add-operation-step-vital",action_type:"succeed"}),c.addOperationStepVital(h,"end",v)}),failFeatureOperation:bt((h,v,y)=>{cr({feature:"add-operation-step-vital",action_type:"fail"}),c.addOperationStepVital(h,"end",y,v)})});return p}function wre(e,t){return{init:n=>{xz("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function Sre(){const e=_re();return new At(t=>{if(!e)return;const n=new e(bt(r=>t.notify(r)));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function _re(){let e;const t=window;if(t.Zone&&(e=Qs(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(Ht),r=Qs(n,"originalInstance");e=r&&r.constructor}return e||(e=t.MutationObserver),e}function Cre(){const e=new At,{stop:t}=ra(window,"open",()=>e.notify());return{observable:e,stop:t}}function Ere(e,t,n,r,i){return{get:o=>{const a=n.findView(o),c=i.findUrl(o),d=t.findTrackedSession(o);if(d&&a&&c){const f=r.findActionId(o);return{application_id:e,session_id:d.id,user_action:f?{id:f}:void 0,view:{id:a.id,name:a.name,referrer:c.referrer,url:c.url}}}}}}const kre=tne,jre=kc;function Rre(e){const t=qd({expireDelay:jre});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 r4="initial_document",Ire=[[Mr.DOCUMENT,e=>r4===e],[Mr.XHR,e=>e==="xmlhttprequest"],[Mr.FETCH,e=>e==="fetch"],[Mr.BEACON,e=>e==="beacon"],[Mr.CSS,(e,t)=>/\.css$/i.test(t)],[Mr.JS,(e,t)=>/\.js$/i.test(t)],[Mr.IMAGE,(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],[Mr.FONT,(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],[Mr.MEDIA,(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function Nre(e){const t=e.name;if(!RJ(t))return Mr.OTHER;const n=IJ(t);for(const[r,i]of Ire)if(i(e.initiatorType,n))return r;return Mr.OTHER}function LO(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function i4(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function Tre(e){const{duration:t,startTime:n,responseEnd:r}=e;return t===0&&n<r?Mn(n,r):t}function Are(e){if(!a4(e))return;const{startTime:t,fetchStart:n,workerStart:r,redirectStart:i,redirectEnd:o,domainLookupStart:a,domainLookupEnd:c,connectStart:d,secureConnectionStart:f,connectEnd:p,requestStart:h,responseStart:v,responseEnd:y}=e,b={download:Ll(t,v,y),first_byte:Ll(t,h,v)};return 0<r&&r<n&&(b.worker=Ll(t,r,n)),n<p&&(b.connect=Ll(t,d,p),d<=f&&f<=p&&(b.ssl=Ll(t,f,p))),n<c&&(b.dns=Ll(t,a,c)),t<o&&(b.redirect=Ll(t,i,o)),b}function o4(e){return e.duration>=0}function a4(e){const t=LO(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=Ore(e)?LO(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function Ore(e){return e.redirectEnd>e.startTime}function Ll(e,t,n){if(e<=t&&t<=n)return{duration:gt(Mn(t,n)),start:gt(Mn(e,t))}}function Dre(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function $re(e){return e.deliveryType===""?"other":e.deliveryType}function Pre(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 JC(e){return e&&(!See(e)||_p(el.TRACK_INTAKE_REQUESTS))}const Mre=/data:(.+)?(;base64)?,/g,zre=24e3;function Lre(e,t=zre){if(e.length<=t||!e.startsWith("data:"))return e;const n=e.substring(0,100).match(Mre);return n?`${n[0]}[...]`:e}const Ure=32*md;function Fre(e,t){const n=Bre(e.requestBody,t.trackPayload);if(n){if(t.trackResponseErrors&&e.responseBody){const r=Vre(e.responseBody);r&&(n.errors_count=r.length,n.errors=r)}return n}}function Vre(e){let t;try{t=JSON.parse(e)}catch{return}if(!t||typeof t!="object")return;const n=t;return oc(n.errors)?n.errors.map(i=>{var o;return{message:i.message,path:i.path,locations:i.locations,code:(o=i.extensions)===null||o===void 0?void 0:o.code}}):void 0}function s4(e,t){return t.allowedGraphQlUrls.find(n=>ob([n.match],e))}function Bre(e,t=!1){if(!e||typeof e!="string")return;let n;try{n=JSON.parse(e)}catch{return}if(!n||!n.query)return;const r=n.query.trim(),i=Hre(r),o=n.operationName;if(!i)return;let a;return n.variables&&(a=JSON.stringify(n.variables)),{operationType:i,operationName:o,variables:a,payload:t?FC(r,Ure,"..."):void 0}}function Hre(e){var t;return(t=e.match(/^\s*(query|mutation|subscription)\b/i))===null||t===void 0?void 0:t[1]}let UO=1;function qre(e,t,n,r,i){const o=Fne(t,n,r,i);Gre(e,t,o),Kre(e,t,o)}function Gre(e,t,n){const r=rne(t).subscribe(i=>{const o=i;if(JC(o.url))switch(o.state){case"start":n.traceXhr(o,o.xhr),o.requestIndex=l4(),e.notify(7,{requestIndex:o.requestIndex,url:o.url});break;case"complete":n.clearTracingIfNeeded(o),e.notify(8,{duration:o.duration,method:o.method,requestIndex:o.requestIndex,spanId:o.spanId,startClocks:o.startClocks,status:o.status,traceId:o.traceId,traceSampled:o.traceSampled,type:lb.XHR,url:o.url,xhr:o.xhr,isAborted:o.isAborted,handlingStack:o.handlingStack,requestBody:o.requestBody,responseBody:o.responseBody});break}});return{stop:()=>r.unsubscribe()}}function Kre(e,t,n){const r=Hz({responseBodyAction:i=>{var o;return!((o=s4(i.url,t))===null||o===void 0)&&o.trackResponseErrors?2:1}}).subscribe(i=>{var o;const a=i;if(JC(a.url))switch(a.state){case"start":n.traceFetch(a),a.requestIndex=l4(),e.notify(7,{requestIndex:a.requestIndex,url:a.url});break;case"resolve":n.clearTracingIfNeeded(a),e.notify(8,{duration:Mn(a.startClocks.timeStamp,vr()),method:a.method,requestIndex:a.requestIndex,responseType:a.responseType,spanId:a.spanId,startClocks:a.startClocks,status:a.status,traceId:a.traceId,traceSampled:a.traceSampled,type:lb.FETCH,url:a.url,response:a.response,init:a.init,input:a.input,isAborted:a.isAborted,handlingStack:a.handlingStack,requestBody:(o=a.init)===null||o===void 0?void 0:o.body,responseBody:a.responseBody});break}});return{stop:()=>r.unsubscribe()}}function l4(){const e=UO;return UO+=1,e}function c4(e){return wp(e)&&e<0?void 0:e}function u4({lifeCycle:e,isChildEvent:t,onChange:n=Ht}){const r={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},i=e.subscribe(13,o=>{var a;if(!(o.type==="view"||o.type==="vital"||!t(o)))switch(o.type){case vt.ERROR:r.errorCount+=1,n();break;case vt.ACTION:r.actionCount+=1,o.action.frustration&&(r.frustrationCount+=o.action.frustration.type.length),n();break;case vt.LONG_TASK:r.longTaskCount+=1,n();break;case vt.RESOURCE:!((a=o._dd)===null||a===void 0)&&a.discarded||(r.resourceCount+=1,n());break}});return{stop:()=>{i.unsubscribe()},eventCounts:r}}function Zre(e,t){const n=Fr();let r=!1;const{stop:i}=tl(e,window,["click","mousedown","keydown","touchstart","pointerdown"],c=>{if(!c.cancelable)return;const d={entryType:"first-input",processingStart:Oi(),processingEnd:Oi(),startTime:c.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};c.type==="pointerdown"?o(e,d):a(d)},{passive:!0,capture:!0});return{stop:i};function o(c,d){tl(c,window,["pointerup","pointercancel"],f=>{f.type==="pointerup"&&a(d)},{once:!0})}function a(c){if(!r){r=!0,i();const d=c.processingStart-c.startTime;d>=0&&d<Fr()-n&&t(c)}}}var $t;(function(e){e.EVENT="event",e.FIRST_INPUT="first-input",e.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",e.LAYOUT_SHIFT="layout-shift",e.LONG_TASK="longtask",e.LONG_ANIMATION_FRAME="long-animation-frame",e.NAVIGATION="navigation",e.PAINT="paint",e.RESOURCE="resource",e.VISIBILITY_STATE="visibility-state"})($t||($t={}));function ca(e,t){return new At(n=>{if(!window.PerformanceObserver)return;const r=d=>{const f=Xre(d);f.length>0&&n.notify(f)};let i,o=!0;const a=new PerformanceObserver(bt(d=>{o?i=kr(()=>r(d.getEntries())):r(d.getEntries())}));try{a.observe(t)}catch{if([$t.RESOURCE,$t.NAVIGATION,$t.LONG_TASK,$t.PAINT].includes(t.type)){t.buffered&&(i=kr(()=>r(performance.getEntriesByType(t.type))));try{a.observe({entryTypes:[t.type]})}catch{return}}}o=!1,Yre(e);let c;return!Ic($t.FIRST_INPUT)&&t.type===$t.FIRST_INPUT&&({stop:c}=Zre(e,d=>{r([d])})),()=>{a.disconnect(),c&&c(),io(i)}})}let um;function Yre(e){return!um&&Wre()&&"addEventListener"in performance&&(um=Cn(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{um?.stop()}}function Wre(){return window.performance!==void 0&&"getEntries"in performance}function Ic(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function Xre(e){return e.filter(t=>!Qre(t))}function Qre(e){return e.entryType===$t.RESOURCE&&(!JC(e.name)||!o4(e))}function t1(e){return e.nodeType===Node.TEXT_NODE}function Jre(e){return e.nodeType===Node.COMMENT_NODE}function Za(e){return e.nodeType===Node.ELEMENT_NODE}function d4(e){return Za(e)&&!!e.shadowRoot}function eie(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&Za(t.host)}function lAe(e){return e.childNodes.length>0||d4(e)}function cAe(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;d4(e)&&t(e.shadowRoot)}function tie(e){return eie(e)?e.host:e.parentNode}const f4=100,nie=100,FO="data-dd-excluded-activity-mutations";function eE(e,t,n,r,i,o){const a=iie(e,t,n,r);return rie(a,i,o)}function rie(e,t,n){let r,i=!1;const o=kr(bt(()=>f({hadActivity:!1})),f4),a=n!==void 0?kr(bt(()=>f({hadActivity:!0,end:vr()})),n):void 0,c=e.subscribe(({isBusy:p})=>{io(o),io(r);const h=vr();p||(r=kr(bt(()=>f({hadActivity:!0,end:h})),nie))}),d=()=>{i=!0,io(o),io(r),io(a),c.unsubscribe()};function f(p){i||(d(),t(p))}return{stop:d}}function iie(e,t,n,r){return new At(i=>{const o=[];let a,c=0;return o.push(t.subscribe(f=>{f.every(oie)||d()}),n.subscribe(d),ca(r,{type:$t.RESOURCE}).subscribe(f=>{f.some(p=>!vS(r,p.name))&&d()}),e.subscribe(7,f=>{vS(r,f.url)||(a===void 0&&(a=f.requestIndex),c+=1,d())}),e.subscribe(8,f=>{vS(r,f.url)||a===void 0||f.requestIndex<a||(c-=1,d())})),()=>{o.forEach(f=>f.unsubscribe())};function d(){i.notify({isBusy:c>0})}})}function vS(e,t){return ob(e.excludedActivityUrls,t)}function oie(e){const t=e.type==="characterData"?e.target.parentElement:e.target;return!!(t&&Za(t)&&t.matches(`[${FO}], [${FO}] *`))}const cb="data-dd-action-name",aie="Masked Element",sie=[cb,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],lie=[p4,uie],cie=[p4,die,fie];function Ip(e,t){if(!e.isConnected)return;let n,r=e;for(;r&&r.nodeName!=="HTML";){const i=VO(r,lie,pie,t,n);if(i)return i;n=VO(r,cie,hie,t,n)||ub(mie(r),n),r=r.parentElement}return n}function m4(e){return/[0-9]/.test(e)}function uie(e){if(e.id&&!m4(e.id))return`#${CSS.escape(e.id)}`}function die(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const r=t[n];if(!m4(r))return`${CSS.escape(e.tagName)}.${CSS.escape(r)}`}}function fie(e){return CSS.escape(e.tagName)}function p4(e,t){if(t){const r=n(t);if(r)return r}for(const r of sie){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 mie(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 VO(e,t,n,r,i){for(const o of t){const a=o(e,r);if(a&&n(e,a,i))return ub(a,i)}}function pie(e,t,n){return e.ownerDocument.querySelectorAll(ub(t,n)).length===1}function hie(e,t,n){let r;if(n===void 0)r=a=>a.matches(t);else{const a=ub(`${t}:scope`,n);r=c=>c.querySelector(a)!==null}let o=e.parentElement.firstElementChild;for(;o;){if(o!==e&&r(o))return!1;o=o.nextElementSibling}return!0}function ub(e,t){return t?`${e}>${t}`:e}const It={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:qu.ALLOW,MASK:qu.MASK,MASK_USER_INPUT:qu.MASK_USER_INPUT,MASK_UNLESS_ALLOWLISTED:qu.MASK_UNLESS_ALLOWLISTED},gie="data-dd-privacy",uAe="hidden",vie="dd-privacy-",yS="***",dAe="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",yie={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},bie="x";function Bl(e){return`[${gie}="${e}"], .${vie}${e}`}function tE(e,t,n){if(n&&n.has(e))return n.get(e);const r=tie(e),i=r?tE(r,t,n):t,o=wie(e),a=xie(o,i);return n&&n.set(e,a),a}function xie(e,t){switch(t){case It.HIDDEN:case It.IGNORE:return t}switch(e){case It.ALLOW:case It.MASK:case It.MASK_USER_INPUT:case It.MASK_UNLESS_ALLOWLISTED:case It.HIDDEN:case It.IGNORE:return e;default:return t}}function wie(e){if(Za(e)){if(e.tagName==="BASE")return It.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return It.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return It.MASK}if(e.matches(Bl(It.HIDDEN)))return It.HIDDEN;if(e.matches(Bl(It.MASK)))return It.MASK;if(e.matches(Bl(It.MASK_UNLESS_ALLOWLISTED)))return It.MASK_UNLESS_ALLOWLISTED;if(e.matches(Bl(It.MASK_USER_INPUT)))return It.MASK_USER_INPUT;if(e.matches(Bl(It.ALLOW)))return It.ALLOW;if(Sie(e))return It.IGNORE}}function h4(e,t){switch(t){case It.MASK:case It.HIDDEN:case It.IGNORE:return!0;case It.MASK_UNLESS_ALLOWLISTED:return t1(e)?$g(e.parentNode)?!0:!v4(e.textContent||""):$g(e);case It.MASK_USER_INPUT:return t1(e)?$g(e.parentNode):$g(e);default:return!1}}function $g(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;const t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!yie[t.tagName]}const g4=e=>e.replace(/\S/g,bie);function fAe(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=yS;else if(a===It.HIDDEN)i=yS;else if(h4(e,a))if(r==="DATALIST"||r==="SELECT"||r==="OPTGROUP"){if(!i.trim())return}else r==="OPTION"?i=yS:a===It.MASK_UNLESS_ALLOWLISTED?i=_ie(i):i=g4(i);return i}function Sie(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 v4(e){var t;return!e||!e.trim()?!0:((t=window.$DD_ALLOW)===null||t===void 0?void 0:t.has(e.toLocaleLowerCase()))||!1}function _ie(e,t){return v4(e)?e:t||g4(e)}const y4=Nr,Cie=100;function Eie(e,t){const n=[];let r=0,i;o(e);function o(d){d.stopObservable.subscribe(a),n.push(d),io(i),i=kr(c,y4)}function a(){r===1&&n.every(d=>d.isStopped())&&(r=2,t(n))}function c(){io(i),r===0&&(r=1,a())}return{tryAppend:d=>r!==0?!1:n.length>0&&!kie(n[n.length-1].event,d.event)?(c(),!1):(o(d),!0),stop:()=>{c()}}}function kie(e,t){return e.target===t.target&&jie(e,t)<=Cie&&e.timeStamp-t.timeStamp<=y4}function jie(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function Rie(e,t,n=It.ALLOW){const{actionNameAttribute:r}=t,i=BO(e,cb)||r&&BO(e,r);return i?{name:i,nameSource:"custom_attribute"}:n===It.MASK?{name:aie,nameSource:"mask_placeholder"}:HO(e,Iie,t)||HO(e,Nie,t)||{name:"",nameSource:"blank"}}function BO(e,t){const n=e.closest(`[${t}]`);if(!n)return;const r=n.getAttribute(t);return x4(b4(r.trim()))}const Iie=[(e,t)=>{if("labels"in e&&e.labels&&e.labels.length>0)return xv(e.labels[0],t)},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)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return xv(e,t)},e=>dm(e,"aria-label"),(e,t)=>{const n=e.getAttribute("aria-labelledby");if(n)return{name:n.split(/\s+/).map(r=>Aie(e,r)).filter(r=>!!r).map(r=>w4(r,t)).join(" "),nameSource:"text_content"}},e=>dm(e,"alt"),e=>dm(e,"name"),e=>dm(e,"title"),e=>dm(e,"placeholder"),(e,t)=>{if("options"in e&&e.options.length>0)return xv(e.options[0],t)}],Nie=[(e,t)=>xv(e,t)],Tie=10;function HO(e,t,n){let r=e,i=0;for(;i<=Tie&&r&&r.nodeName!=="BODY"&&r.nodeName!=="HTML"&&r.nodeName!=="HEAD";){for(const o of t){const a=o(r,n);if(a){const{name:c,nameSource:d}=a,f=c&&c.trim();if(f)return{name:x4(b4(f)),nameSource:d}}}if(r.nodeName==="FORM")break;r=r.parentElement,i+=1}}function b4(e){return e.replace(/\s+/g," ")}function x4(e){return e.length>100?`${FC(e,100)} [...]`:e}function Aie(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function dm(e,t){return{name:e.getAttribute(t)||"",nameSource:"standard_attribute"}}function xv(e,t){return{name:w4(e,t)||"",nameSource:"text_content"}}function w4(e,t){if(e.isContentEditable)return;const{enablePrivacyForActionName:n,actionNameAttribute:r,defaultPrivacyLevel:i}=t;if(_p(el.USE_TREE_WALKER_FOR_ACTION_NAME))return Oie(e,r,n,i);if("innerText"in e){let o=e.innerText;const a=c=>{const d=e.querySelectorAll(c);for(let f=0;f<d.length;f+=1){const p=d[f];if("innerText"in p){const h=p.innerText;h&&h.trim().length>0&&(o=o.replace(h,""))}}};return a(`[${cb}]`),r&&a(`[${r}]`),n&&a(`${Bl(It.HIDDEN)}, ${Bl(It.MASK)}`),o}return e.textContent}function Oie(e,t,n,r){const i=new Map,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,c);let a="";for(;o.nextNode();){const d=o.currentNode;if(Za(d)){(d.nodeName==="BR"||d.nodeName==="P"||["block","flex","grid","list-item","table","table-caption"].includes(getComputedStyle(d).display))&&(a+=" ");continue}a+=d.textContent||""}return a.replace(/\s+/g," ").trim();function c(d){const f=tE(d,r,i);if(n&&f&&h4(d,f))return NodeFilter.FILTER_REJECT;if(Za(d)){if(d.hasAttribute(cb)||t&&d.hasAttribute(t))return NodeFilter.FILTER_REJECT;const p=getComputedStyle(d);if(p.visibility!=="visible"||p.display==="none"||p.contentVisibility&&p.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}function Die(e,{onPointerDown:t,onPointerUp:n}){let r,i={selection:!1,input:!1,scroll:!1},o;const a=[Cn(e,window,"pointerdown",c=>{GO(c)&&(r=qO(),i={selection:!1,input:!1,scroll:!1},o=t(c))},{capture:!0}),Cn(e,window,"selectionchange",()=>{(!r||!qO())&&(i.selection=!0)},{capture:!0}),Cn(e,window,"scroll",()=>{i.scroll=!0},{capture:!0,passive:!0}),Cn(e,window,"pointerup",c=>{if(GO(c)&&o){const d=i;n(o,c,()=>d),o=void 0}},{capture:!0}),Cn(e,window,"input",()=>{i.input=!0},{capture:!0})];return{stop:()=>{a.forEach(c=>c.stop())}}}function qO(){const e=window.getSelection();return!e||e.isCollapsed}function GO(e){return e.target instanceof Element&&e.isPrimary!==!1}const KO=3;function $ie(e,t){if(Pie(e))return t.addFrustration(cm.RAGE_CLICK),e.some(ZO)&&t.addFrustration(cm.DEAD_CLICK),t.hasError&&t.addFrustration(cm.ERROR_CLICK),{isRage:!0};const n=e.some(r=>r.getUserActivity().selection);return e.forEach(r=>{r.hasError&&r.addFrustration(cm.ERROR_CLICK),ZO(r)&&!n&&r.addFrustration(cm.DEAD_CLICK)}),{isRage:!1}}function Pie(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(KO-1);t+=1)if(e[t+KO-1].event.timeStamp-e[t].event.timeStamp<=Nr)return!0;return!1}const Mie='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 ZO(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(Mie)}const S4=10*Nr,Mm=new Map;function zie(e){const t=Mm.get(e);return Mm.delete(e),t}function _4(e,t){Mm.set(e,t),Mm.forEach((n,r)=>{Mn(r,Oi())>S4&&Mm.delete(r)})}const Lie=5*Br;function Uie(e,t,n,r){const i=qd({expireDelay:Lie}),o=new At;let a;e.subscribe(10,()=>{i.reset()}),e.subscribe(5,p),e.subscribe(11,h=>{h.reason===ed.UNLOADING&&p()});const{stop:c}=Die(r,{onPointerDown:h=>Fie(r,e,t,h,n),onPointerUp:({clickActionBase:h,hadActivityOnPointerDown:v},y,b)=>{Vie(r,e,t,n,i,o,f,h,y,b,v)}});return{stop:()=>{p(),o.notify(),c()},actionContexts:{findActionId:h=>i.findAll(h)}};function f(h){if(!a||!a.tryAppend(h)){const v=h.clone();a=Eie(h,y=>{Hie(y,v)})}}function p(){a&&a.stop()}}function Fie(e,t,n,r,i){let o;if(e.enablePrivacyForActionName?o=tE(r.target,e.defaultPrivacyLevel):o=It.ALLOW,o===It.HIDDEN)return;const a=Bie(r,o,e);let c=!1;return eE(t,n,i,e,d=>{c=d.hadActivity},f4),{clickActionBase:a,hadActivityOnPointerDown:()=>c}}function Vie(e,t,n,r,i,o,a,c,d,f,p){var h;const v=C4(t,i,f,c,d);a(v);const y=(h=c?.target)===null||h===void 0?void 0:h.selector;y&&_4(d.timeStamp,y);const{stop:b}=eE(t,n,r,e,E=>{E.hadActivity&&E.end<v.startClocks.timeStamp?v.discard():E.hadActivity?v.stop(E.end):p()?v.stop(v.startClocks.timeStamp):v.stop()},S4),S=t.subscribe(5,({endClocks:E})=>{v.stop(E.timeStamp)}),C=o.subscribe(()=>{v.stop()});v.stopObservable.subscribe(()=>{S.unsubscribe(),b(),C.unsubscribe()})}function Bie(e,t,n){const r=e.target.getBoundingClientRect(),i=Ip(e.target,n.actionNameAttribute);i&&_4(e.timeStamp,i);const{name:o,nameSource:a}=Rie(e.target,n,t);return{type:QC.CLICK,target:{width:Math.round(r.width),height:Math.round(r.height),selector:i},position:{x:Math.round(e.clientX-r.left),y:Math.round(e.clientY-r.top)},name:o,nameSource:a}}function C4(e,t,n,r,i){const o=Rr(),a=ir(),c=t.add(o,a.relative),d=u4({lifeCycle:e,isChildEvent:b=>b.action!==void 0&&(Array.isArray(b.action.id)?b.action.id.includes(o):b.action.id===o)});let f=0,p;const h=[],v=new At;function y(b){f===0&&(p=b,f=1,p?c.close(UC(p)):c.remove(),d.stop(),v.notify())}return{event:i,stop:y,stopObservable:v,get hasError(){return d.eventCounts.errorCount>0},get hasPageActivity(){return p!==void 0},getUserActivity:n,addFrustration:b=>{h.push(b)},startClocks:a,isStopped:()=>f===1||f===2,clone:()=>C4(e,t,n,r,i),validate:b=>{if(y(),f!==1)return;const{resourceCount:S,errorCount:C,longTaskCount:E}=d.eventCounts,k={duration:p&&Mn(a.timeStamp,p),startClocks:a,id:o,frustrationTypes:h,counts:{resourceCount:S,errorCount:C,longTaskCount:E},events:b??[i],event:i,...r};e.notify(0,k),f=2},discard:()=>{y(),f=2}}}function Hie(e,t){const{isRage:n}=$ie(e,t);n?(e.forEach(r=>r.discard()),t.stop(vr()),t.validate(e.map(r=>r.event))):(t.discard(),e.forEach(r=>r.validate()))}function qie(e,t,n,r,i){const{unsubscribe:o}=e.subscribe(0,d=>{e.notify(12,YO(d))});t.register(0,({startTime:d,eventType:f})=>{if(f!==vt.ERROR&&f!==vt.RESOURCE&&f!==vt.LONG_TASK)return Di;const p=a.findActionId(d);return p?{type:f,action:{id:p}}:Di}),t.register(1,({startTime:d})=>({action:{id:a.findActionId(d)}}));let a={findActionId:Ht},c=Ht;return i.trackUserInteractions&&({actionContexts:a,stop:c}=Uie(e,n,r,i)),{addAction:d=>{e.notify(12,YO(d))},actionContexts:a,stop:()=>{o(),c()}}}function YO(e){const t=bS(e)?{action:{id:e.id,loading_time:c4(gt(e.duration)),frustration:{type:e.frustrationTypes},error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}},_dd:{action:{target:e.target,position:e.position,name_source:e.nameSource}}}:{context:e.context},n=Ka({action:{id:Rr(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:vt.ACTION},t),r=bS(e)?e.duration:void 0,i=bS(e)?{events:e.events}:{handlingStack:e.handlingStack};return{rawRumEvent:n,duration:r,startTime:e.startClocks.relative,domainContext:i}}function bS(e){return e.type!==QC.CUSTOM}function Gie(e){const t=yne([Wy.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function Kie(e,t){const n=ite(e,[Qm.cspViolation,Qm.intervention]).subscribe(r=>t.notify(r));return{stop:()=>{n.unsubscribe()}}}function Zie(e,t,n){const r=new At;return n.subscribe(i=>{i.type===0&&r.notify(i.error)}),Gie(r),Kie(t,r),r.subscribe(i=>e.notify(14,{error:i})),Yie(e)}function Yie(e){return e.subscribe(14,({error:t})=>{e.notify(12,Wie(t))}),{addError:({error:t,handlingStack:n,componentStack:r,startClocks:i,context:o})=>{const a=GC({originalError:t,handlingStack:n,componentStack:r,startClocks:i,nonErrorPrefix:"Provided",source:Bd.CUSTOM,handling:"handled"});a.context=Ka(a.context,o),e.notify(14,{error:a})}}}function Wie(e){const t={date:e.startClocks.timeStamp,error:{id:Rr(),message:e.message,source:e.source,stack:e.stack,handling_stack:e.handlingStack,component_stack:e.componentStack,type:e.type,handling:e.handling,causes:e.causes,source_type:"browser",fingerprint:e.fingerprint,csp:e.csp},type:vt.ERROR,context:e.context},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const WO=new WeakSet;function Xie(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=>!WO.has(r)).filter(r=>o4(r)&&a4(r)).filter(r=>Qie(r,e.startClocks.relative,E4({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return WO.add(n[0]),n[0].toJSON()}function E4(e){return Fd(e.startTime,e.duration)}function Qie(e,t,n){return e.startTime>=t-1&&E4(e)<=Fd(n,1)}const Jie=2*Br;function eoe(e){const t=toe(e)||noe(e);if(!(!t||t.traceTime<=Fr()-Jie))return t.traceId}function toe(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return k4(t&&t.content,n&&n.content)}function noe(e){const t=roe(e);if(t)return k4(Ym(t,"trace-id"),Ym(t,"trace-time"))}function k4(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function roe(e){for(let t=0;t<e.childNodes.length;t+=1){const n=XO(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=XO(n);if(r)return r;if(!t1(n))break}}function XO(e){if(e&&Jre(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function j4(){if(Ic($t.NAVIGATION)){const n=performance.getEntriesByType($t.NAVIGATION)[0];if(n)return n}const e=ioe(),t={entryType:$t.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:e.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...t,toJSON:void 0}),...e};return t}function ioe(){const e={},t=performance.timing;for(const n in t)if(wp(t[n])){const r=n,i=t[r];e[r]=i===0?0:UC(i)}return e}function ooe(e,t,n=j4){YC(e,"interactive",()=>{const r=n(),i=Object.assign(r.toJSON(),{entryType:$t.RESOURCE,initiatorType:r4,duration:r.responseEnd,traceId:eoe(document),toJSON:()=>({...i,toJSON:void 0})});t(i)})}const aoe=1e3;function soe(e){const t=new Set,n=e.subscribe(8,r=>{t.add(r),t.size>aoe&&(Rp("Too many requests"),t.delete(t.values().next().value))});return{getMatchingRequest(r){let i=1/0,o;for(const a of t){const c=r.startTime-a.startClocks.relative;0<=c&&c<i&&a.url===r.name&&(i=Math.abs(c),o=a)}return o&&t.delete(o),o},stop(){n.unsubscribe()}}}function loe(e,t,n,r=vne(),i=ooe){let o;const a=t.trackEarlyRequests;a?o=soe(e):e.subscribe(8,f=>{d(()=>coe(f,t,n))});const c=ca(t,{type:$t.RESOURCE,buffered:!0}).subscribe(f=>{for(const p of f)(a||!i4(p))&&d(()=>QO(p,t,n,o))});i(t,f=>{d(()=>QO(f,t,n,o))});function d(f){r.push(()=>{const p=f();p&&e.notify(12,p)})}return{stop:()=>{r.stop(),c.unsubscribe()}}}function coe(e,t,n){const r=Xie(e);return R4(r,e,n,t)}function QO(e,t,n,r){const i=i4(e)&&r?r.getMatchingRequest(e):void 0;return R4(e,i,n,t)}function R4(e,t,n,r){if(!e&&!t)return;const i=t?moe(t,r):poe(e,r);if(!r.trackResources&&!i)return;const o=e?Qy(e.startTime):t.startClocks,a=e?Tre(e):hoe(n,o,t.duration),c=t&&uoe(t,r),d=Ka({date:o.timeStamp,resource:{id:Rr(),duration:gt(a),type:t?t.type===lb.XHR?Mr.XHR:Mr.FETCH:Nre(e),method:t?t.method:void 0,status_code:t?t.status:goe(e.responseStatus),url:t?Lre(t.url):e.name,protocol:e&&Dre(e),delivery_type:e&&$re(e),graphql:c},type:vt.RESOURCE,_dd:{discarded:!r.trackResources}},i,e&&foe(e));return{startTime:o.relative,duration:a,rawRumEvent:d,domainContext:doe(e,t)}}function uoe(e,t){const n=s4(e.url,t);if(n)return Fre(e,n)}function doe(e,t){if(t){const n={performanceEntry:e,isAborted:t.isAborted,handlingStack:t.handlingStack};return t.type===lb.XHR?{xhr:t.xhr,...n}:{requestInput:t.input,requestInit:t.init,response:t.response,error:t.error,...n}}return{performanceEntry:e}}function foe(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...Pre(e),...Are(e)}}}function moe(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 poe(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:Jz().toString(),rule_psr:t.rulePsr}}}function hoe(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function goe(e){return e===0?void 0:e}function voe(e,t,n){const{stop:r,eventCounts:i}=u4({lifeCycle:e,isChildEvent:o=>o.view.id===t,onChange:n});return{stop:r,eventCounts:i}}const yoe=10*Br;function boe(e,t,n){return{stop:ca(e,{type:$t.PAINT,buffered:!0}).subscribe(i=>{const o=i.find(a=>a.name==="first-contentful-paint"&&a.startTime<t.timeStamp&&a.startTime<yoe);o&&n(o.startTime)}).unsubscribe}}function xoe(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(Mn(e,Oi()))})})}function woe(e,t,n){const r=ca(e,{type:$t.FIRST_INPUT,buffered:!0}).subscribe(i=>{const o=i.find(a=>a.startTime<t.timeStamp);if(o){const a=Mn(o.startTime,o.processingStart);let c;o.target&&Za(o.target)&&(c=Ip(o.target,e.actionNameAttribute)),n({delay:a>=0?a:0,time:o.startTime,targetSelector:c})}});return{stop:()=>{r.unsubscribe()}}}function Soe(e,t,n=j4){return Eoe(e,()=>{const r=n();Coe(r)||t(_oe(r))})}function _oe(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=Oi()?e.responseStart:void 0}}function Coe(e){return e.loadEventEnd<=0}function Eoe(e,t){let n;const{stop:r}=YC(e,"complete",()=>{n=kr(()=>t())});return{stop:()=>{r(),io(n)}}}const koe=10*Br;function joe(e,t,n,r){let i=1/0;const{stop:o}=tl(e,n,["pointerdown","keydown"],d=>{i=d.timeStamp},{capture:!0,once:!0});let a=0;const c=ca(e,{type:$t.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(d=>{const f=tz(d,p=>p.entryType===$t.LARGEST_CONTENTFUL_PAINT&&p.startTime<i&&p.startTime<t.timeStamp&&p.startTime<koe&&p.size>a);if(f){let p;f.element&&(p=Ip(f.element,e.actionNameAttribute)),r({value:f.startTime,targetSelector:p,resourceUrl:Roe(f)}),a=f.size}});return{stop:()=>{o(),c.unsubscribe()}}}function Roe(e){return e.url===""?void 0:e.url}function I4(e,t,n=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:Ht};if(Ic($t.VISIBILITY_STATE)){const o=performance.getEntriesByType($t.VISIBILITY_STATE).filter(a=>a.name==="hidden").find(a=>a.startTime>=t.relative);if(o)return{timeStamp:o.startTime,stop:Ht}}let r=1/0;const{stop:i}=tl(e,n,["pagehide","visibilitychange"],o=>{(o.type==="pagehide"||document.visibilityState==="hidden")&&(r=o.timeStamp,i())},{capture:!0});return{get timeStamp(){return r},stop:i}}function Ioe(e,t,n,r){const i={},{stop:o}=Soe(e,h=>{n(h.loadEvent),i.navigationTimings=h,r()}),a=I4(e,t),{stop:c}=boe(e,a,h=>{i.firstContentfulPaint=h,r()}),{stop:d}=joe(e,a,window,h=>{i.largestContentfulPaint=h,r()}),{stop:f}=woe(e,a,h=>{i.firstInput=h,r()});function p(){o(),c(),d(),f(),a.stop()}return{stop:p,initialViewMetrics:i}}const n1=(e,t)=>e*t,Noe=(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:n1(i-n,o-r)},JO=e=>{const t=n1(e.previousRect.width,e.previousRect.height),n=n1(e.currentRect.width,e.currentRect.height),r=Noe(e.previousRect,e.currentRect);return t+n-r};function Toe(e,t,n){if(!Poe())return{stop:Ht};let r=0,i;n({value:0});const o=$oe(),a=ca(e,{type:$t.LAYOUT_SHIFT,buffered:!0}).subscribe(c=>{var d;for(const f of c){if(f.hadRecentInput||f.startTime<t)continue;const{cumulatedValue:p,isMaxValue:h}=o.update(f);if(h){const v=Aoe(f.sources);i={target:v?.node?new WeakRef(v.node):void 0,time:Mn(t,f.startTime),previousRect:v?.previousRect,currentRect:v?.currentRect,devicePixelRatio:window.devicePixelRatio}}if(p>r){r=p;const v=(d=i?.target)===null||d===void 0?void 0:d.deref();n({value:$m(r,4),targetSelector:v&&Ip(v,e.actionNameAttribute),time:i?.time,previousRect:i?.previousRect?eD(i.previousRect):void 0,currentRect:i?.currentRect?eD(i.currentRect):void 0,devicePixelRatio:i?.devicePixelRatio})}}});return{stop:()=>{a.unsubscribe()}}}function Aoe(e){let t;for(const n of e)if(n.node&&Za(n.node)){const r=JO(n);(!t||JO(t)<r)&&(t=n)}return t}function eD({x:e,y:t,width:n,height:r}){return{x:e,y:t,width:n,height:r}}const Ooe=5*Nr,Doe=Nr;function $oe(){let e=0,t,n,r=0;return{update:i=>{const o=t===void 0||i.startTime-n>=Doe||i.startTime-t>=Ooe;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 Poe(){return Ic($t.LAYOUT_SHIFT)&&"WeakRef"in window}let wv,N4=0,xS=1/0,wS=0;function Moe(){"interactionCount"in performance||wv||(wv=new window.PerformanceObserver(bt(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(xS=Math.min(xS,n.interactionId),wS=Math.max(wS,n.interactionId),N4=(wS-xS)/7+1)})})),wv.observe({type:"event",buffered:!0,durationThreshold:0}))}const tD=()=>wv?N4:window.performance.interactionCount||0,nD=10,zoe=1*Br;function Loe(e,t,n){if(!Voe())return{getInteractionToNextPaint:()=>{},setViewEnd:Ht,stop:Ht};const{getViewInteractionCount:r,stopViewInteractionCount:i}=Foe(n);let o=1/0;const a=Uoe(r);let c=-1,d,f;function p(y){for(const S of y)S.interactionId&&S.startTime>=t&&S.startTime<=o&&a.process(S);const b=a.estimateP98Interaction();b&&b.duration!==c&&(c=b.duration,f=Mn(t,b.startTime),d=zie(b.startTime),!d&&b.target&&Za(b.target)&&(d=Ip(b.target,e.actionNameAttribute)))}const h=ca(e,{type:$t.FIRST_INPUT,buffered:!0}).subscribe(p),v=ca(e,{type:$t.EVENT,durationThreshold:40,buffered:!0}).subscribe(p);return{getInteractionToNextPaint:()=>{if(c>=0)return{value:Math.min(c,zoe),targetSelector:d,time:f};if(r())return{value:0}},setViewEnd:y=>{o=y,i()},stop:()=>{v.unsubscribe(),h.unsubscribe()}}}function Uoe(e){const t=[];function n(){t.sort((r,i)=>i.duration-r.duration).splice(nD)}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<nD||r.duration>o.duration)&&(t.push(r),n())},estimateP98Interaction(){const r=Math.min(t.length-1,Math.floor(e()/50));return t[r]}}}function Foe(e){Moe();const t=e===La.INITIAL_LOAD?0:tD();let n={stopped:!1};function r(){return tD()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:r(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:r()}}}}function Voe(){return Ic($t.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function Boe(e,t,n,r,i,o,a){let c=i===La.INITIAL_LOAD,d=!0;const f=[],p=I4(r,o);function h(){if(!d&&!c&&f.length>0){const y=Math.max(...f);y<p.timeStamp-o.relative&&a(y)}}const{stop:v}=eE(e,t,n,r,y=>{d&&(d=!1,y.hadActivity&&f.push(Mn(o.timeStamp,y.end)),h())});return{stop:()=>{v(),p.stop()},setLoadEvent:y=>{c&&(c=!1,f.push(y),h())}}}function mAe(){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 Hoe(){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 SS;function qoe(e){return SS||(SS=Goe(e)),SS}function Goe(e){return new At(t=>{const{throttled:n}=eb(()=>{t.notify(nE())},200);return Cn(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function nE(){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 Koe=Nr;function Zoe(e,t,n,r=Woe(e)){let i=0,o=0,a=0;const c=r.subscribe(({scrollDepth:d,scrollTop:f,scrollHeight:p})=>{let h=!1;if(d>i&&(i=d,h=!0),p>o){o=p;const v=Oi();a=Mn(t.relative,v),h=!0}h&&n({maxDepth:Math.min(i,o),maxDepthScrollTop:f,maxScrollHeight:o,maxScrollHeightTime:a})});return{stop:()=>c.unsubscribe()}}function Yoe(){const e=Hoe(),{height:t}=nE(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),r=Math.round(t+e);return{scrollHeight:n,scrollDepth:r,scrollTop:e}}function Woe(e,t=Koe){return new At(n=>{function r(){n.notify(Yoe())}if(window.ResizeObserver){const i=eb(r,t,{leading:!1,trailing:!0}),o=document.scrollingElement||document.documentElement,a=new ResizeObserver(bt(i.throttled));o&&a.observe(o);const c=Cn(e,window,"scroll",i.throttled,{passive:!0});return()=>{i.cancel(),a.disconnect(),c.stop()}}})}function Xoe(e,t,n,r,i,o,a){const c={},{stop:d,setLoadEvent:f}=Boe(e,t,n,r,o,a,S=>{c.loadingTime=S,i()}),{stop:p}=Zoe(r,a,S=>{c.scroll=S}),{stop:h}=Toe(r,a.relative,S=>{c.cumulativeLayoutShift=S,i()}),{stop:v,getInteractionToNextPaint:y,setViewEnd:b}=Loe(r,a.relative,o);return{stop:()=>{d(),h(),p()},stopINPTracking:v,setLoadEvent:f,setViewEnd:b,getCommonViewMetrics:()=>(c.interactionToNextPaint=y(),c)}}function Qoe(e,t){const{stop:n}=Cn(e,window,"pageshow",r=>{r.persisted&&t(r)},{capture:!0});return n}function Joe(e,t,n){xoe(e.relative,r=>{t.firstContentfulPaint=r,t.largestContentfulPaint={value:r},n()})}const eae=3e3,tae=5*Br,nae=5*Br;function rae(e,t,n,r,i,o,a,c){const d=new Set;let f=v(La.INITIAL_LOAD,HM(),c),p;y();let h;a&&(h=b(o),i.trackBfcacheViews&&(p=Qoe(i,S=>{f.end();const C=Qy(S.timeStamp);f=v(La.BF_CACHE,C,void 0)})));function v(S,C,E){const k=iae(t,n,r,i,e,S,C,E);return d.add(k),k.stopObservable.subscribe(()=>{d.delete(k)}),k}function y(){t.subscribe(10,()=>{f=v(La.ROUTE_CHANGE,void 0,{name:f.name,service:f.service,version:f.version,context:f.contextManager.getContext()})}),t.subscribe(9,()=>{f.end({sessionIsActive:!1})})}function b(S){return S.subscribe(({oldLocation:C,newLocation:E})=>{aae(C,E)&&(f.end(),f=v(La.ROUTE_CHANGE))})}return{addTiming:(S,C=vr())=>{f.addTiming(S,C)},startView:(S,C)=>{f.end({endClocks:C}),f=v(La.ROUTE_CHANGE,C,S)},setViewContext:S=>{f.contextManager.setContext(S)},setViewContextProperty:(S,C)=>{f.contextManager.setContextProperty(S,C)},setViewName:S=>{f.setViewName(S)},getViewContext:()=>f.contextManager.getContext(),stop:()=>{h&&h.unsubscribe(),p&&p(),f.end(),d.forEach(S=>S.stop())}}}function iae(e,t,n,r,i,o,a=ir(),c){const d=Rr(),f=new At,p={};let h=0,v;const y=Zm(i),b=sb();let S=!0,C=c?.name;const E=c?.service||r.service,k=c?.version||r.version,j=c?.context;j&&b.setContext(j);const I={id:d,name:C,startClocks:a,service:E,version:k,context:j};e.notify(1,I),e.notify(2,I);const{throttled:A,cancel:N}=eb(D,eae,{leading:!1}),{setLoadEvent:T,setViewEnd:z,stop:L,stopINPTracking:G,getCommonViewMetrics:J}=Xoe(e,t,n,r,te,o,a),{stop:Z,initialViewMetrics:W}=o===La.INITIAL_LOAD?Ioe(r,a,T,te):{stop:Ht,initialViewMetrics:{}};o===La.BF_CACHE&&Joe(a,W,te);const{stop:F,eventCounts:Y}=voe(e,d,te),P=Vd(D,tae),K=e.subscribe(11,M=>{M.reason===ed.UNLOADING&&D()});D(),b.changeObservable.subscribe(te);function U(){e.notify(3,{id:d,name:C,context:b.getContext(),startClocks:a,sessionIsActive:S})}function te(){U(),A()}function D(){N(),U(),h+=1;const M=v===void 0?vr():v.timeStamp;e.notify(4,{customTimings:p,documentVersion:h,id:d,name:C,service:E,version:k,context:b.getContext(),loadingType:o,location:y,startClocks:a,commonViewMetrics:J(),initialViewMetrics:W,duration:Mn(a.timeStamp,M),isActive:v===void 0,sessionIsActive:S,eventCounts:Y})}return{get name(){return C},service:E,version:k,contextManager:b,stopObservable:f,end(M={}){var V,O;v||(v=(V=M.endClocks)!==null&&V!==void 0?V:ir(),S=(O=M.sessionIsActive)!==null&&O!==void 0?O:!0,e.notify(5,{endClocks:v}),e.notify(6,{endClocks:v}),Jy(P),z(v.relative),L(),K.unsubscribe(),D(),kr(()=>{this.stop()},nae))},stop(){Z(),F(),G(),f.notify()},addTiming(M,V){if(v)return;const O=xJ(V)?V:Mn(a.timeStamp,V);p[oae(M)]=O,te()},setViewName(M){C=M,D()}}}function oae(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&mt.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function aae(e,t){return e.pathname!==t.pathname||!sae(t.hash)&&rD(t.hash)!==rD(e.hash)}function sae(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function rD(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function lae(e,t,n,r,i,o,a,c,d,f){return e.subscribe(4,p=>e.notify(12,cae(p,n,c))),t.register(0,({startTime:p,eventType:h})=>{const v=d.findView(p);return v?{type:h,service:v.service,version:v.version,context:v.context,view:{id:v.id,name:v.name}}:nl}),t.register(1,({startTime:p})=>{var h;return{view:{id:(h=d.findView(p))===null||h===void 0?void 0:h.id}}}),rae(r,e,i,o,n,a,!n.trackViewsManually,f)}function cae(e,t,n){var r,i,o,a,c,d,f,p,h,v,y,b,S,C,E,k,j,I;const A=n.getReplayStats(e.id),N=(i=(r=e.commonViewMetrics)===null||r===void 0?void 0:r.cumulativeLayoutShift)===null||i===void 0?void 0:i.devicePixelRatio,T={_dd:{document_version:e.documentVersion,replay_stats:A,cls:N?{device_pixel_ratio:N}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:vt.VIEW,view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:(o=e.commonViewMetrics.cumulativeLayoutShift)===null||o===void 0?void 0:o.value,cumulative_layout_shift_time:gt((a=e.commonViewMetrics.cumulativeLayoutShift)===null||a===void 0?void 0:a.time),cumulative_layout_shift_target_selector:(c=e.commonViewMetrics.cumulativeLayoutShift)===null||c===void 0?void 0:c.targetSelector,first_byte:gt((d=e.initialViewMetrics.navigationTimings)===null||d===void 0?void 0:d.firstByte),dom_complete:gt((f=e.initialViewMetrics.navigationTimings)===null||f===void 0?void 0:f.domComplete),dom_content_loaded:gt((p=e.initialViewMetrics.navigationTimings)===null||p===void 0?void 0:p.domContentLoaded),dom_interactive:gt((h=e.initialViewMetrics.navigationTimings)===null||h===void 0?void 0:h.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:gt(e.initialViewMetrics.firstContentfulPaint),first_input_delay:gt((v=e.initialViewMetrics.firstInput)===null||v===void 0?void 0:v.delay),first_input_time:gt((y=e.initialViewMetrics.firstInput)===null||y===void 0?void 0:y.time),first_input_target_selector:(b=e.initialViewMetrics.firstInput)===null||b===void 0?void 0:b.targetSelector,interaction_to_next_paint:gt((S=e.commonViewMetrics.interactionToNextPaint)===null||S===void 0?void 0:S.value),interaction_to_next_paint_time:gt((C=e.commonViewMetrics.interactionToNextPaint)===null||C===void 0?void 0:C.time),interaction_to_next_paint_target_selector:(E=e.commonViewMetrics.interactionToNextPaint)===null||E===void 0?void 0:E.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:gt((k=e.initialViewMetrics.largestContentfulPaint)===null||k===void 0?void 0:k.value),largest_contentful_paint_target_selector:(j=e.initialViewMetrics.largestContentfulPaint)===null||j===void 0?void 0:j.targetSelector,load_event:gt((I=e.initialViewMetrics.navigationTimings)===null||I===void 0?void 0:I.loadEvent),loading_time:c4(gt(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:uae(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:gt(e.duration)},display:e.commonViewMetrics.scroll?{scroll:{max_depth:e.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:e.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:e.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:gt(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:One()}};return fl(e.customTimings)||(T.view.custom_timings=ZM(e.customTimings,gt)),{rawRumEvent:T,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function uae({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:r,largestContentfulPaint:i}){return{cls:e&&{score:e.value,timestamp:gt(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:gt(n)},fid:r&&{duration:gt(r.delay),timestamp:gt(r.time),target_selector:r.targetSelector},inp:t&&{duration:gt(t.value),timestamp:gt(t.time),target_selector:t.targetSelector},lcp:i&&{timestamp:gt(i.value),target_selector:i.targetSelector,resource_url:i.resourceUrl}}}const dae="rum";function fae(e,t,n){const r=Zte(e,dae,i=>pae(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 mae(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:Dz("records")?1:0};return{findTrackedSession:()=>e,expire:Ht,expireObservable:new At,setForcedReplay:Ht}}function pae(e,t){return hae(t)?t:Zl(e.sessionSampleRate)?Zl(e.sessionReplaySampleRate)?"1":"2":"0"}function hae(e){return e==="0"||e==="1"||e==="2"}function gae(e,t,n,r,i,o){const a=[e.rumEndpointBuilder];e.replica&&a.push(e.replica.rumEndpointBuilder);const c=$z({encoder:o(2),request:Oz(a,e.batchBytesLimit,n),flushController:Pz({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageMayExitObservable:r,sessionExpireObservable:i}),messageBytesLimit:e.messageBytesLimit});return t.subscribe(13,d=>{d.type===vt.VIEW?c.upsert(d,d.view.id):c.add(d)}),c}function vae(e){const t=jp();e.subscribe(13,n=>{t.send("rum",n)})}const yae=kc;function bae(e,t,n,r){const i=qd({expireDelay:yae});let o;e.subscribe(1,({startClocks:d})=>{const f=r.href;i.add(c({url:f,referrer:o||document.referrer}),d.relative),o=f}),e.subscribe(6,({endClocks:d})=>{i.closeActive(d.relative)});const a=n.subscribe(({newLocation:d})=>{const f=i.find();if(f){const p=Oi();i.closeActive(p),i.add(c({url:d.href,referrer:f.referrer}),p)}});function c({url:d,referrer:f}){return{url:d,referrer:f}}return t.register(0,({startTime:d,eventType:f})=>{const p=i.find(d);return p?{type:f,view:{url:p.url,referrer:p.referrer}}:nl}),{findUrl:d=>i.find(d),stop:()=>{a.unsubscribe(),i.stop()}}}function xae(e,t){let n=Zm(t);return new At(r=>{const{stop:i}=wae(e,a),{stop:o}=Sae(e,a);function a(){if(n.href===t.href)return;const c=Zm(t);r.notify({newLocation:c,oldLocation:n}),n=c}return()=>{i(),o()}})}function wae(e,t){const{stop:n}=ra(iD("pushState"),"pushState",({onPostCall:o})=>{o(t)}),{stop:r}=ra(iD("replaceState"),"replaceState",({onPostCall:o})=>{o(t)}),{stop:i}=Cn(e,window,"popstate",t);return{stop:()=>{n(),r(),i()}}}function Sae(e,t){return Cn(e,window,"hashchange",t)}function iD(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const _ae=kc;function Cae(e,t,n){const r=qd({expireDelay:_ae});return e.subscribe(1,({startClocks:i})=>{r.add({},i.relative)}),e.subscribe(6,({endClocks:i})=>{r.closeActive(i.relative)}),t.register(0,({startTime:i,eventType:o})=>{if(!n.trackFeatureFlagsForEvents.concat([vt.VIEW,vt.ERROR]).includes(o))return Di;const c=r.find(i);return!c||fl(c)?Di:{type:o,feature_flags:c}}),{addFeatureFlagEvaluation:(i,o)=>{const a=r.find();a&&(a[i]=o)}}}const Eae=10*Nr;let td,Pg;function kae(e,t,n){e.metricsEnabled&&(T4(),Pg=!1,t.subscribe(13,()=>{Pg=!0}),n.subscribe(({bytesCount:r,messagesCount:i})=>{Pg&&(Pg=!1,td.batchCount+=1,aD(td.batchBytesCount,r),aD(td.batchMessagesCount,i))}),Vd(jae,Eae))}function jae(){td.batchCount!==0&&(ab("Customer data measures",td),T4())}function oD(){return{min:1/0,max:0,sum:0}}function aD(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function T4(){td={batchCount:0,batchBytesCount:oD(),batchMessagesCount:oD()}}const Rae=4e3,Iae=500,Nae=kc;function Tae(e,t,n=Iae){const r=qd({expireDelay:Nae,maxEntries:Rae});let i;Ic($t.VISIBILITY_STATE)&&performance.getEntriesByType($t.VISIBILITY_STATE).forEach(f=>{const p=f.name==="hidden"?"hidden":"active";a(p,f.startTime)}),a(A4(),Oi());const{stop:o}=tl(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],d=>{a(Oae(d),d.timeStamp)},{capture:!0});function a(d,f=Oi()){d!==i&&(i=d,r.closeActive(f),r.add({state:i,startTime:f},f))}function c(d,f,p){return r.findAll(f,p).some(h=>h.state===d)}return e.register(0,({startTime:d,duration:f=0,eventType:p})=>{if(p===vt.VIEW){const h=r.findAll(d,f);return{type:p,_dd:{page_states:Aae(h,d,n)}}}return p===vt.ACTION||p===vt.ERROR?{type:p,view:{in_foreground:c("active",d,0)}}:Di}),{wasInPageStateDuringPeriod:c,addPageState:a,stop:()=>{o(),r.stop()}}}function Aae(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:r,startTime:i})=>({state:r,start:gt(Mn(t,i))}))}function Oae(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":A4()}function A4(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function Dae(e,t){let n;const r=requestAnimationFrame(bt(()=>{n=nE()})),i=qoe(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 $ae(e,t){const n=window.cookieStore?Pae(e):zae;return new At(r=>n(t,i=>r.notify(i)))}function Pae(e){return(t,n)=>Cn(e,window.cookieStore,"change",i=>{const o=i.changed.find(a=>a.name===t)||i.deleted.find(a=>a.name===t);o&&n(o.value)}).stop}const Mae=Nr;function zae(e,t){const n=Ym(document.cookie,e),r=Vd(()=>{const i=Ym(document.cookie,e);i!==n&&t(i)},Mae);return()=>{Jy(r)}}const sD="datadog-ci-visibility-test-execution-id";function Lae(e,t,n=$ae(e,sD)){var r;let i=zs(sD)||((r=window.Cypress)===null||r===void 0?void 0:r.env("traceId"));const o=n.subscribe(a=>{i=a});return t.register(0,({eventType:a})=>typeof i!="string"?Di:{type:a,session:{type:"ci_test"},ci_test:{test_execution_id:i}}),{stop:()=>{o.unsubscribe()}}}function Uae(e,t){const n=ca(t,{type:$t.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(r=>{for(const i of r){const o=Qy(i.startTime),a={date:o.timeStamp,long_task:{id:Rr(),entry_type:Zz.LONG_ANIMATION_FRAME,duration:gt(i.duration),blocking_duration:gt(i.blockingDuration),first_ui_event_timestamp:gt(i.firstUIEventTimestamp),render_start:gt(i.renderStart),style_and_layout_start:gt(i.styleAndLayoutStart),start_time:gt(i.startTime),scripts:i.scripts.map(c=>({duration:gt(c.duration),pause_duration:gt(c.pauseDuration),forced_style_and_layout_duration:gt(c.forcedStyleAndLayoutDuration),start_time:gt(c.startTime),execution_start:gt(c.executionStart),source_url:c.sourceURL,source_function_name:c.sourceFunctionName,source_char_position:c.sourceCharPosition,invoker:c.invoker,invoker_type:c.invokerType,window_attribution:c.windowAttribution}))},type:vt.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:o.relative,duration:i.duration,domainContext:{performanceEntry:i}})}});return{stop:()=>n.unsubscribe()}}function Fae(e,t){const n=ca(t,{type:$t.LONG_TASK,buffered:!0}).subscribe(r=>{for(const i of r){if(i.entryType!==$t.LONG_TASK||!t.trackLongTasks)break;const o=Qy(i.startTime),a={date:o.timeStamp,long_task:{id:Rr(),entry_type:Zz.LONG_TASK,duration:gt(i.duration)},type:vt.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:o.relative,duration:i.duration,domainContext:{performanceEntry:i}})}});return{stop(){n.unsubscribe()}}}function Vae(e){e.register(0,({eventType:t})=>{if(!Fz())return Di;const n=Lz(),r=Uz();return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:r,injected:zz()}}})}function Bae(e,t,n){const r=KC(e),i=n(r);return BC(t).forEach(([o,a])=>r1(e,r,o.split(/\.|(?=\[\])/),a)),i}function r1(e,t,n,r){const[i,...o]=n;if(i==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((a,c)=>r1(a,t[c],o,r));return}if(!(!lD(e)||!lD(t))){if(o.length>0)return r1(e[i],t[i],o,r);Hae(e,i,t[i],r)}}function Hae(e,t,n,r){const i=jc(n);i===r?e[t]=fn(n):r==="object"&&(i==="undefined"||i==="null")&&(e[t]={})}function lD(e){return jc(e)==="object"}const Au={"view.name":"string","view.url":"string","view.referrer":"string"},Ou={context:"object"},Du={service:"string",version:"string"};let O4;function qae(e,t,n,r){O4={[vt.VIEW]:{"view.performance.lcp.resource_url":"string",...Ou,...Au,...Du},[vt.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...Ou,...Au,...Du},[vt.RESOURCE]:{"resource.url":"string","resource.graphql.variables":"string",...Ou,...Au,...Du},[vt.ACTION]:{"action.target.name":"string",...Ou,...Au,...Du},[vt.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...Ou,...Au,...Du},[vt.VITAL]:{...Ou,...Au,...Du}};const i={[vt.ERROR]:dS(vt.ERROR,e.eventRateLimiterThreshold,r),[vt.ACTION]:dS(vt.ACTION,e.eventRateLimiterThreshold,r),[vt.VITAL]:dS(vt.VITAL,e.eventRateLimiterThreshold,r)};t.subscribe(12,({startTime:o,duration:a,rawRumEvent:c,domainContext:d})=>{const f=n.triggerHook(0,{eventType:c.type,startTime:o,duration:a});if(f===nl)return;const p=Ka(f,c,{ddtags:_z(e).join(",")});Gae(p,e.beforeSend,d,i)&&(fl(p.context)&&delete p.context,t.notify(13,p))})}function Gae(e,t,n,r){var i;if(t){const a=Bae(e,O4[e.type],c=>t(c,n));if(a===!1&&e.type!==vt.VIEW)return!1;a===!1&&mt.warn("Can't dismiss view events using beforeSend!")}return!((i=r[e.type])===null||i===void 0?void 0:i.isLimitReached())}function Kae(e,t,n,r){e.register(0,({eventType:i,startTime:o})=>{const a=t.findTrackedSession(o),c=r.findView(o);if(!a||!c)return nl;let d,f,p;return i===vt.VIEW?(d=n.getReplayStats(c.id)?!0:void 0,f=a.sessionReplay===1,p=c.sessionIsActive?void 0:!1):d=n.isRecording()?!0:void 0,{type:i,session:{id:a.id,type:"user",has_replay:d,sampled_for_replay:f,is_active:p}}}),e.register(1,({startTime:i})=>{const o=t.findTrackedSession(i);return o?{session:{id:o.id}}:Di})}function Zae(e){e.register(0,({eventType:t})=>({type:t,connectivity:Ez()}))}function Yae(e,t,n){e.register(0,({eventType:r})=>{const i=t.source;return{type:r,_dd:{format_version:2,drift:yJ(),configuration:{session_sample_rate:$m(t.sessionSampleRate,3),session_replay_sample_rate:$m(t.sessionReplaySampleRate,3),profiling_sample_rate:$m(t.profilingSampleRate,3),beta_encode_cookie_options:t.betaEncodeCookieOptions},browser_sdk_version:yd()?"6.24.0":void 0,sdk_name:n},application:{id:t.applicationId},date:vr(),source:i}}),e.register(1,()=>({application:{id:t.applicationId}}))}function Wae(e,t){e.register(1,()=>t.isGranted()?Di:nl)}const Xae=Ite,Qae=[vt.ACTION,vt.ERROR,vt.LONG_TASK,vt.RESOURCE,vt.VITAL];function Jae(e){return{addEvent:(t,n,r,i)=>{Qae.includes(n.type)&&e.notify(12,{startTime:t,rawRumEvent:n,domainContext:r,duration:i})}}}function ese(e,t){if(!t.metricsEnabled)return{stop:Ht};const{unsubscribe:n}=e.subscribe(4,({initialViewMetrics:r})=>{!r.largestContentfulPaint||!r.navigationTimings||(ab("Initial view metrics",{metrics:tse(r.largestContentfulPaint,r.navigationTimings)}),n())});return{stop:n}}function tse(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function nse(e,t,n,r,i,o,a,c,d){const f=[],p=new kre,h=Xae();p.subscribe(13,ie=>Cz("rum",ie));const v=ie=>{p.notify(14,{error:ie}),Rp("Error reported to customer",{"error.message":ie.message})},y=jte(e),b=y.subscribe(ie=>{p.notify(11,ie)});f.push(()=>b.unsubscribe());const S=Ote("browser-rum-sdk",e,h,v,y,i);f.push(S.stop);const C=yd()?mae():fae(e,p,o);if(yd())vae(p);else{const ie=gae(e,p,v,y,C.expireObservable,i);f.push(()=>ie.stop()),kae(S,p,ie.flushController.flushObservable)}const E=Sre(),k=xae(e,location),{observable:j,stop:I}=Cre();f.push(I),Yae(h,e,d);const A=Tae(h,e),N=Rre(p);f.push(()=>N.stop());const T=bae(p,h,k,location);f.push(()=>T.stop());const z=Cae(p,h,e);Kae(h,C,t,N),Zae(h),Wae(h,o);const L=Ine(h,e,"rum"),G=Nne(h,e,C,"rum"),J=Rne(h,e,"rum"),{actionContexts:Z,addAction:W,addEvent:F,stop:Y}=rse(p,h,e,A,E,j,v);f.push(Y);const{addTiming:P,startView:K,setViewName:U,setViewContext:te,setViewContextProperty:D,getViewContext:M,stop:V}=lae(p,h,e,location,E,j,k,t,N,r);f.push(V);const{stop:O}=ese(p,S);f.push(O);const{stop:ee}=loe(p,e,A);if(f.push(ee),e.trackLongTasks)if(Ic($t.LONG_ANIMATION_FRAME)){const{stop:ie}=Uae(p,e);f.push(ie)}else Fae(p,e);const{addError:ue}=Zie(p,e,c);c.unbuffer(),qre(p,e,C,G,J);const pe=$ne(p,A,a),B=Ere(e.applicationId,C,N,Z,T);return f.push(()=>n.stop()),{addAction:W,addEvent:F,addError:ue,addTiming:P,addFeatureFlagEvaluation:z.addFeatureFlagEvaluation,startView:K,setViewContext:te,setViewContextProperty:D,getViewContext:M,setViewName:U,lifeCycle:p,viewHistory:N,session:C,stopSession:()=>C.expire(),getInternalContext:B.get,startDurationVital:pe.startDurationVital,stopDurationVital:pe.stopDurationVital,addDurationVital:pe.addDurationVital,addOperationStepVital:pe.addOperationStepVital,globalContext:L,userContext:G,accountContext:J,telemetry:S,stop:()=>{f.forEach(ie=>ie())},hooks:h}}function rse(e,t,n,r,i,o,a){const c=qie(e,t,i,o,n),d=Jae(e),f=Dae(t,n),p=Lae(n,t);return Vae(t),qae(n,e,t,a),{pageStateHistory:r,addAction:c.addAction,addEvent:d.addEvent,actionContexts:c.actionContexts,stop:()=>{c.stop(),p.stop(),f.stop(),r.stop()}}}function ise(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=ose(e),c=`/rum/replay/sessions/${i}`;return`${a}${c}?${o.join("&")}`}function ose(e){const t=e.site,n=e.subdomain||ase(e);return`https://${n?`${n}.`:""}${t}`}function ase(e){switch(e.site){case Yl:case fee:return"app";case pz:return"dd";default:return}}const sse=1e3;let to;function pAe(e){return db(e).segments_count}function hAe(e){db(e).segments_count+=1}function gAe(e){db(e).records_count+=1}function vAe(e,t){db(e).segments_total_raw_size+=t}function lse(e){return to?.get(e)}function db(e){to||(to=new Map);let t;return to.has(e)?t=to.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},to.set(e,t),to.size>sse&&cse()),t}function cse(){if(!to)return;const e=to.keys().next().value;e&&to.delete(e)}function D4(e,t,n){let r=0,i=[],o,a=!0,c=0;const d=[],{stop:f}=Cn(e,t,"message",({data:v})=>{if(v.type!=="wrote"||v.streamId!==n)return;const y=d[0];y&&(y.id===v.id?(d.shift(),r+=v.additionalBytesCount,i.push(v.result),o=v.trailer,y.writeCallback?y.writeCallback(v.result.byteLength):y.finishCallback&&y.finishCallback()):y.id<v.id&&f())});function p(){const v=i.length===0?new Uint8Array(0):KM(i.concat(o)),y={rawBytesCount:r,output:v,outputBytesCount:v.byteLength,encoding:"deflate"};return r=0,i=[],y}function h(){a||(t.postMessage({action:"reset",streamId:n}),a=!0)}return{isAsync:!0,get isEmpty(){return a},write(v,y){t.postMessage({action:"write",id:c,data:v,streamId:n}),d.push({id:c,writeCallback:y,data:v}),a=!1,c+=1},finish(v){h(),d.length?(d.forEach(y=>{delete y.writeCallback}),d[d.length-1].finishCallback=()=>v(p())):v(p())},finishSync(){h();const v=d.map(y=>y.data).join("");return d.length=0,{...p(),pendingData:v}},estimateEncodedBytesCount(v){return v.length/8},stop(){f()}}}function rE({configuredUrl:e,error:t,source:n,scriptType:r}){if(mt.error(`${n} failed to start: an error occurred while initializing the ${r}:`,t),t instanceof Event||t instanceof Error&&use(t.message)){let i;e?i=`Please make sure the ${r} URL ${e} is correct and CSP is correctly configured.`:i="Please make sure CSP is correctly configured.",mt.error(`${i} See documentation at ${Xy}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else r==="worker"&&ZC(t)}function use(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const dse=30*Nr;function $4(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){if(1===t.length)return t[0];const e=t.reduce((t,e)=>t+e.length,0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!==--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return-1^t},O={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=L(t.adler,e,r,a):2===t.state.wrap&&(t.adler=T(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!==--r);return s<=t.lookahead?s:t.lookahead},at=function(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-J)){t.window.set(t.window.subarray(s,s+s),0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--a);e=a=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=tt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},nt=function(t,e){for(var a,n;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},rt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function it(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var st=[new it(0,0,0,0,function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)}),new it(4,4,8,4,nt),new it(4,5,16,8,nt),new it(4,6,32,32,nt),new it(4,4,16,16,rt),new it(8,16,32,32,rt),new it(8,16,128,128,rt),new it(8,32,128,256,rt),new it(32,128,258,1024,rt),new it(32,258,258,4096,rt)];function ht(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var lt=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=st[e.level].max_lazy,e.good_match=st[e.level].good_length,e.nice_match=st[e.level].nice_length,e.max_chain_length=st[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},_t=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(at(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(at(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):st[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},ot=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},dt=new Uint8Array(256),ut=0;ut<256;ut++)dt[ut]=ut>=252?6:ut>=248?5:ut>=240?4:ut>=224?3:ut>=192?2:1;dt[254]=dt[254]=1;var ft=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ct=Object.prototype.toString;function pt(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new ht;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,lt(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ct.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,at(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,at(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function gt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function vt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}pt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ct.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=_t(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=ot(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},pt.prototype.onData=function(t){this.chunks.push(t)},pt.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.24.0"};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 Pn={status:0};function P4(e,t,n,r=$4){switch(Pn.status===0&&fse(e,t,r),Pn.status){case 1:return Pn.initializationFailureCallbacks.push(n),Pn.worker;case 3:return Pn.worker}}function cD(){return Pn.status}function fse(e,t,n=$4){try{const r=n(e),{stop:i}=Cn(e,r,"error",c=>{_S(e,t,c)}),{stop:o}=Cn(e,r,"message",({data:c})=>{c.type==="errored"?_S(e,t,c.error,c.streamId):c.type==="initialized"&&pse(c.version)});r.postMessage({action:"init"}),kr(()=>mse(t),dse),Pn={status:1,worker:r,stop:()=>{i(),o()},initializationFailureCallbacks:[]}}catch(r){_S(e,t,r)}}function mse(e){Pn.status===1&&(mt.error(`${e} failed to start: a timeout occurred while initializing the Worker`),Pn.initializationFailureCallbacks.forEach(t=>t()),Pn={status:2})}function pse(e){Pn.status===1&&(Pn={status:3,worker:Pn.worker,stop:Pn.stop,version:e})}function _S(e,t,n,r){Pn.status===1||Pn.status===0?(rE({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),Pn.status===1&&Pn.initializationFailureCallbacks.forEach(i=>i()),Pn={status:2}):ZC(n,{worker_version:Pn.status===3&&Pn.version,stream_id:r})}function M4(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function hse(e,t,n,r){const i=t.findTrackedSession(),o=gse(i,r),a=n.findView();return ise(e,{viewContext:a,errorType:o,session:i})}function gse(e,t){if(!M4())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 vse(e,t){if(!e.metricsEnabled)return{stop:Ht};let n,r,i;const{unsubscribe:o}=t.subscribe(a=>{switch(a.type){case"start":n={forced:a.forced,timestamp:vr()},r=void 0,i=void 0;break;case"document-ready":n&&(r=Mn(n.timestamp,vr()));break;case"recorder-settled":n&&(i=Mn(n.timestamp,vr()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":o(),n&&ab("Recorder init metrics",{metrics:yse(n.forced,i,Mn(n.timestamp,vr()),a.type,r)});break}});return{stop:o}}function yse(e,t,n,r,i){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:n,result:r,waitForDocReadyDuration:i}}function bse(e,t,n,r,i,o,a){let c=0,d;t.subscribe(9,()=>{(c===2||c===3)&&(v(),c=1)}),t.subscribe(10,()=>{c===1&&h()});const f=new At;vse(a,f);const p=async y=>{f.notify({type:"start",forced:y});const[b]=await Promise.all([uD(f,{type:"recorder-settled"},i()),uD(f,{type:"document-ready"},nne(e,"interactive"))]);if(c!==2){f.notify({type:"aborted"});return}if(!b){c=0,f.notify({type:"recorder-load-failed"});return}const S=o();if(!S){c=0,f.notify({type:"deflate-encoder-load-failed"});return}({stop:d}=b(t,e,n,r,S,a)),c=3,f.notify({type:"succeeded"})};function h(y){const b=n.findTrackedSession();if(xse(b,y)){c=1;return}if(wse(c))return;c=2;const S=Sse(b,y)||!1;p(S).catch(Js),S&&n.setForcedReplay()}function v(){c===3&&d?.(),c=0}return{start:h,stop:v,getSessionReplayLink(){return hse(e,n,r,c!==0)},isRecording:()=>c===3}}function xse(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function wse(e){return e===2||e===3}function Sse(e,t){return t&&t.force&&e.sessionReplay===0}async function uD(e,t,n){try{return await n}finally{e.notify(t)}}function _se(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:Ht},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function Cse(e,t){if(yd()&&!Dz("records")||!M4())return{start:Ht,stop:Ht,getReplayStats:()=>{},onRumStart:Ht,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:r}=_se();return{start:o=>n.start(o),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:i,isRecording:()=>cD()===3&&n.isRecording(),getReplayStats:o=>cD()===3?lse(o):void 0};function i(o,a,c,d,f,p){let h;function v(){return h||(f??(f=P4(a,"Datadog Session Replay",()=>{n.stop()},t)),f&&(h=D4(a,f,1))),h}n=bse(a,o,c,d,e,v,p),r(a)&&n.start()}}const Ese="modulepreload",kse=function(e){return"/"+e},dD={},Np=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let d=function(f){return Promise.all(f.map(p=>Promise.resolve(p).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");i=d(n.map(f=>{if(f=kse(f),f in dD)return;dD[f]=!0;const p=f.endsWith(".css"),h=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${h}`))return;const v=document.createElement("link");if(v.rel=p?"stylesheet":Ese,p||(v.as="script"),v.crossOrigin="",v.href=f,c&&v.setAttribute("nonce",c),document.head.appendChild(v),p)return new Promise((y,b)=>{v.addEventListener("load",y),v.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return i.then(a=>{for(const c of a||[])c.status==="rejected"&&o(c.reason);return t().catch(o)})};async function jse(e=Rse){try{return await e()}catch(t){rE({error:t,source:"Recorder",scriptType:"module"})}}async function Rse(){return(await Np(()=>import("./startRecording-B13uS081.js"),[])).startRecording}function Ise(){return go().Profiler!==void 0}const Nse=e=>{let t={status:"starting"};return e.register(0,({eventType:n})=>n!==vt.VIEW&&n!==vt.LONG_TASK?Di:{type:n,_dd:{profiling:t}}),{get:()=>t,set:n=>{t=n}}};async function Tse(e=Ase){try{return await e()}catch(t){rE({error:t,source:"Profiler",scriptType:"module"})}}async function Ase(){return(await Np(()=>import("./profiler-BUlyg7xg.js"),[])).createRumProfiler}function Ose(){let e;function t(n,r,i,o,a,c){const d=o.findTrackedSession();if(!d||!Qz(d.id,i.profilingSampleRate))return;const f=Nse(r);if(!Ise()){f.set({status:"error",error_reason:"not-supported-by-browser"});return}Tse().then(p=>{if(!p){Rp("[DD_RUM] Failed to lazy load the RUM Profiler"),f.set({status:"error",error_reason:"failed-to-lazy-load"});return}e=p(i,n,o,f,c),e.start(a.findView())}).catch(Js)}return{onRumStart:t,stop:()=>{e?.stop().catch(Js)}}}const Dse=Cse(jse),$se=Ose(),Pse=xre(nse,Dse,$se,{startDeflateWorker:P4,createDeflateEncoder:D4,sdkName:"rum"});rte(go(),"DD_RUM",Pse);function Sv(e,t){Xm("react error"),ir()}const fD={didCatch:!1,error:null};class yAe extends X.Component{constructor(t){super(t),this.resetError=()=>{this.setState(fD)},this.state=fD}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}componentDidCatch(t,n){Sv()}render(){return this.state.didCatch?X.createElement(this.props.fallback,{error:this.state.error,resetError:this.resetError}):this.props.children}}let mD=!1;function Mse(){x.useEffect(()=>{mD||(mD=!0)},[])}function zse(){return u.jsx(u.Fragment,{children:u.jsx(ll,{})})}const fb=NY()({component:zse});function Lse(){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 iE(){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 Use(e,t){const n=x.createContext(t),r=o=>{const{children:a,...c}=o,d=x.useMemo(()=>c,Object.values(c));return u.jsx(n.Provider,{value:d,children:a})};r.displayName=e+"Provider";function i(o){const a=x.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function Mi(e,t=[]){let n=[];function r(o,a){const c=x.createContext(a),d=n.length;n=[...n,a];const f=h=>{const{scope:v,children:y,...b}=h,S=v?.[e]?.[d]||c,C=x.useMemo(()=>b,Object.values(b));return u.jsx(S.Provider,{value:C,children:y})};f.displayName=o+"Provider";function p(h,v){const y=v?.[e]?.[d]||c,b=x.useContext(y);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,p]}const i=()=>{const o=n.map(a=>x.createContext(a));return function(c){const d=c?.[e]||o;return x.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return i.scopeName=e,[r,Fse(i,...t)]}function Fse(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((c,{useScope:d,scopeName:f})=>{const h=d(o)[`__scope${f}`];return{...c,...h}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function je(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function bd(e){const t=Vse(e),n=x.forwardRef((r,i)=>{const{children:o,...a}=r,c=x.Children.toArray(o),d=c.find(Hse);if(d){const f=d.props.children,p=c.map(h=>h===d?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:h);return u.jsx(t,{...a,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,p):null})}return u.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function Vse(e){const t=x.forwardRef((n,r)=>{const{children:i,...o}=n;if(x.isValidElement(i)){const a=Gse(i),c=qse(o,i.props);return i.type!==x.Fragment&&(c.ref=r?Ud(r,a):a),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var z4=Symbol("radix.slottable");function Bse(e){const t=({children:n})=>u.jsx(u.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=z4,t}function Hse(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===z4}function qse(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...c)=>{const d=o(...c);return i(...c),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Gse(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 Kse=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ke=Kse.reduce((e,t)=>{const n=bd(`Primitive.${t}`),r=x.forwardRef((i,o)=>{const{asChild:a,...c}=i,d=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(d,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Kv(e,t){e&&Md.flushSync(()=>e.dispatchEvent(t))}var Yn=globalThis?.document?x.useLayoutEffect:()=>{},Zse=_C[" useInsertionEffect ".trim().toString()]||Yn;function Do({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=Yse({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:i;{const p=x.useRef(e!==void 0);x.useEffect(()=>{const h=p.current;h!==c&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=c},[c,r])}const f=x.useCallback(p=>{if(c){const h=Wse(p)?p(e):p;h!==e&&a.current?.(h)}else o(p)},[c,e,o,a]);return[d,f]}function Yse({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),o=x.useRef(t);return Zse(()=>{o.current=t},[t]),x.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function Wse(e){return typeof e=="function"}var Xse=x.createContext(void 0);function Nc(e){const t=x.useContext(Xse);return e||t||"ltr"}function Qse(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var Wn=e=>{const{present:t,children:n}=e,r=Jse(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),o=ut(r.ref,ele(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:o}):null};Wn.displayName="Presence";function Jse(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),o=x.useRef("none"),a=e?"mounted":"unmounted",[c,d]=Qse(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const f=Mg(r.current);o.current=c==="mounted"?f:"none"},[c]),Yn(()=>{const f=r.current,p=i.current;if(p!==e){const v=o.current,y=Mg(f);e?d("MOUNT"):y==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&v!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),Yn(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,h=y=>{const S=Mg(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&S&&(d("ANIMATION_END"),!i.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},v=y=>{y.target===t&&(o.current=Mg(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:x.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Mg(e){return e?.animationName||"none"}function ele(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tle=_C[" useId ".trim().toString()]||(()=>{}),nle=0;function Ni(e){const[t,n]=x.useState(tle());return Yn(()=>{n(r=>r??String(nle++))},[e]),t?`radix-${t}`:""}function Tp(e){const t=e+"CollectionProvider",[n,r]=Mi(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=S=>{const{scope:C,children:E}=S,k=X.useRef(null),j=X.useRef(new Map).current;return u.jsx(i,{scope:C,itemMap:j,collectionRef:k,children:E})};a.displayName=t;const c=e+"CollectionSlot",d=bd(c),f=X.forwardRef((S,C)=>{const{scope:E,children:k}=S,j=o(c,E),I=ut(C,j.collectionRef);return u.jsx(d,{ref:I,children:k})});f.displayName=c;const p=e+"CollectionItemSlot",h="data-radix-collection-item",v=bd(p),y=X.forwardRef((S,C)=>{const{scope:E,children:k,...j}=S,I=X.useRef(null),A=ut(C,I),N=o(p,E);return X.useEffect(()=>(N.itemMap.set(I,{ref:I,...j}),()=>void N.itemMap.delete(I))),u.jsx(v,{[h]:"",ref:A,children:k})});y.displayName=p;function b(S){const C=o(e+"CollectionConsumer",S);return X.useCallback(()=>{const k=C.collectionRef.current;if(!k)return[];const j=Array.from(k.querySelectorAll(`[${h}]`));return Array.from(C.itemMap.values()).sort((N,T)=>j.indexOf(N.ref.current)-j.indexOf(T.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:a,Slot:f,ItemSlot:y},b,r]}function bn(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}function rle(e,t=globalThis?.document){const n=bn(e);x.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ile="DismissableLayer",i1="dismissableLayer.update",ole="dismissableLayer.pointerDownOutside",ale="dismissableLayer.focusOutside",pD,L4=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gd=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...d}=e,f=x.useContext(L4),[p,h]=x.useState(null),v=p?.ownerDocument??globalThis?.document,[,y]=x.useState({}),b=ut(t,T=>h(T)),S=Array.from(f.layers),[C]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),E=S.indexOf(C),k=p?S.indexOf(p):-1,j=f.layersWithOutsidePointerEventsDisabled.size>0,I=k>=E,A=cle(T=>{const z=T.target,L=[...f.branches].some(G=>G.contains(z));!I||L||(i?.(T),a?.(T),T.defaultPrevented||c?.())},v),N=ule(T=>{const z=T.target;[...f.branches].some(G=>G.contains(z))||(o?.(T),a?.(T),T.defaultPrevented||c?.())},v);return rle(T=>{k===f.layers.size-1&&(r?.(T),!T.defaultPrevented&&c&&(T.preventDefault(),c()))},v),x.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(pD=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),hD(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=pD)}},[p,v,n,f]),x.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),hD())},[p,f]),x.useEffect(()=>{const T=()=>y({});return document.addEventListener(i1,T),()=>document.removeEventListener(i1,T)},[]),u.jsx(Ke.div,{...d,ref:b,style:{pointerEvents:j?I?"auto":"none":void 0,...e.style},onFocusCapture:je(e.onFocusCapture,N.onFocusCapture),onBlurCapture:je(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:je(e.onPointerDownCapture,A.onPointerDownCapture)})});Gd.displayName=ile;var sle="DismissableLayerBranch",lle=x.forwardRef((e,t)=>{const n=x.useContext(L4),r=x.useRef(null),i=ut(t,r);return x.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(Ke.div,{...e,ref:i})});lle.displayName=sle;function cle(e,t=globalThis?.document){const n=bn(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const o=c=>{if(c.target&&!r.current){let d=function(){U4(ole,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=d,t.addEventListener("click",i.current,{once:!0})):d()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ule(e,t=globalThis?.document){const n=bn(e),r=x.useRef(!1);return x.useEffect(()=>{const i=o=>{o.target&&!r.current&&U4(ale,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 hD(){const e=new CustomEvent(i1);document.dispatchEvent(e)}function U4(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?Kv(i,o):i.dispatchEvent(o)}function oE(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var F4=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"}),dle="VisuallyHidden",V4=x.forwardRef((e,t)=>u.jsx(Ke.span,{...e,ref:t,style:{...F4,...e.style}}));V4.displayName=dle;var B4=V4,Tc="NavigationMenu",[aE,H4,fle]=Tp(Tc),[o1,mle,ple]=Tp(Tc),[sE]=Mi(Tc,[fle,ple]),[hle,vo]=sE(Tc),[gle,vle]=sE(Tc),q4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:o,delayDuration:a=200,skipDelayDuration:c=300,orientation:d="horizontal",dir:f,...p}=e,[h,v]=x.useState(null),y=ut(t,L=>v(L)),b=Nc(f),S=x.useRef(0),C=x.useRef(0),E=x.useRef(0),[k,j]=x.useState(!0),[I,A]=Do({prop:r,onChange:L=>{const G=L!=="",J=c>0;G?(window.clearTimeout(E.current),J&&j(!1)):(window.clearTimeout(E.current),E.current=window.setTimeout(()=>j(!0),c)),i?.(L)},defaultProp:o??"",caller:Tc}),N=x.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>A(""),150)},[A]),T=x.useCallback(L=>{window.clearTimeout(C.current),A(L)},[A]),z=x.useCallback(L=>{I===L?window.clearTimeout(C.current):S.current=window.setTimeout(()=>{window.clearTimeout(C.current),A(L)},a)},[I,A,a]);return x.useEffect(()=>()=>{window.clearTimeout(S.current),window.clearTimeout(C.current),window.clearTimeout(E.current)},[]),u.jsx(G4,{scope:n,isRootMenu:!0,value:I,dir:b,orientation:d,rootNavigationMenu:h,onTriggerEnter:L=>{window.clearTimeout(S.current),k?z(L):T(L)},onTriggerLeave:()=>{window.clearTimeout(S.current),N()},onContentEnter:()=>window.clearTimeout(C.current),onContentLeave:N,onItemSelect:L=>{A(G=>G===L?"":L)},onItemDismiss:()=>A(""),children:u.jsx(Ke.nav,{"aria-label":"Main","data-orientation":d,dir:b,...p,ref:y})})});q4.displayName=Tc;var a1="NavigationMenuSub",yle=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",...c}=e,d=vo(a1,n),[f,p]=Do({prop:r,onChange:i,defaultProp:o??"",caller:a1});return u.jsx(G4,{scope:n,isRootMenu:!1,value:f,dir:d.dir,orientation:a,rootNavigationMenu:d.rootNavigationMenu,onTriggerEnter:h=>p(h),onItemSelect:h=>p(h),onItemDismiss:()=>p(""),children:u.jsx(Ke.div,{"data-orientation":a,...c,ref:t})})});yle.displayName=a1;var G4=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:i,orientation:o,children:a,value:c,onItemSelect:d,onItemDismiss:f,onTriggerEnter:p,onTriggerLeave:h,onContentEnter:v,onContentLeave:y}=e,[b,S]=x.useState(null),[C,E]=x.useState(new Map),[k,j]=x.useState(null);return u.jsx(hle,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:c,previousValue:oE(c),baseId:Ni(),dir:i,orientation:o,viewport:b,onViewportChange:S,indicatorTrack:k,onIndicatorTrackChange:j,onTriggerEnter:bn(p),onTriggerLeave:bn(h),onContentEnter:bn(v),onContentLeave:bn(y),onItemSelect:bn(d),onItemDismiss:bn(f),onViewportContentChange:x.useCallback((I,A)=>{E(N=>(N.set(I,A),new Map(N)))},[]),onViewportContentRemove:x.useCallback(I=>{E(A=>A.has(I)?(A.delete(I),new Map(A)):A)},[]),children:u.jsx(aE.Provider,{scope:t,children:u.jsx(gle,{scope:t,items:C,children:a})})})},K4="NavigationMenuList",Z4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=vo(K4,n),o=u.jsx(Ke.ul,{"data-orientation":i.orientation,...r,ref:t});return u.jsx(Ke.div,{style:{position:"relative"},ref:i.onIndicatorTrackChange,children:u.jsx(aE.Slot,{scope:n,children:i.isRootMenu?u.jsx(tL,{asChild:!0,children:o}):o})})});Z4.displayName=K4;var Y4="NavigationMenuItem",[ble,W4]=sE(Y4),X4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...i}=e,o=Ni(),a=r||o||"LEGACY_REACT_AUTO_VALUE",c=x.useRef(null),d=x.useRef(null),f=x.useRef(null),p=x.useRef(()=>{}),h=x.useRef(!1),v=x.useCallback((b="start")=>{if(c.current){p.current();const S=l1(c.current);S.length&&uE(b==="start"?S:S.reverse())}},[]),y=x.useCallback(()=>{if(c.current){const b=l1(c.current);b.length&&(p.current=Ile(b))}},[]);return u.jsx(ble,{scope:n,value:a,triggerRef:d,contentRef:c,focusProxyRef:f,wasEscapeCloseRef:h,onEntryKeyDown:v,onFocusProxyEnter:v,onRootContentClose:y,onContentFocusOutside:y,children:u.jsx(Ke.li,{...i,ref:t})})});X4.displayName=Y4;var s1="NavigationMenuTrigger",xle=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...i}=e,o=vo(s1,e.__scopeNavigationMenu),a=W4(s1,e.__scopeNavigationMenu),c=x.useRef(null),d=ut(c,a.triggerRef,t),f=rL(o.baseId,a.value),p=iL(o.baseId,a.value),h=x.useRef(!1),v=x.useRef(!1),y=a.value===o.value;return u.jsxs(u.Fragment,{children:[u.jsx(aE.ItemSlot,{scope:n,value:a.value,children:u.jsx(nL,{asChild:!0,children:u.jsx(Ke.button,{id:f,disabled:r,"data-disabled":r?"":void 0,"data-state":dE(y),"aria-expanded":y,"aria-controls":p,...i,ref:d,onPointerEnter:je(e.onPointerEnter,()=>{v.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:je(e.onPointerMove,Zv(()=>{r||v.current||a.wasEscapeCloseRef.current||h.current||(o.onTriggerEnter(a.value),h.current=!0)})),onPointerLeave:je(e.onPointerLeave,Zv(()=>{r||(o.onTriggerLeave(),h.current=!1)})),onClick:je(e.onClick,()=>{o.onItemSelect(a.value),v.current=y}),onKeyDown:je(e.onKeyDown,b=>{const C={horizontal:"ArrowDown",vertical:o.dir==="rtl"?"ArrowLeft":"ArrowRight"}[o.orientation];y&&b.key===C&&(a.onEntryKeyDown(),b.preventDefault())})})})}),y&&u.jsxs(u.Fragment,{children:[u.jsx(B4,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:b=>{const S=a.contentRef.current,C=b.relatedTarget,E=C===c.current,k=S?.contains(C);(E||!k)&&a.onFocusProxyEnter(E?"start":"end")}}),o.viewport&&u.jsx("span",{"aria-owns":p})]})]})});xle.displayName=s1;var wle="NavigationMenuLink",gD="navigationMenu.linkSelect",Q4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:i,...o}=e;return u.jsx(nL,{asChild:!0,children:u.jsx(Ke.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...o,ref:t,onClick:je(e.onClick,a=>{const c=a.target,d=new CustomEvent(gD,{bubbles:!0,cancelable:!0});if(c.addEventListener(gD,f=>i?.(f),{once:!0}),Kv(c,d),!d.defaultPrevented&&!a.metaKey){const f=new CustomEvent(_v,{bubbles:!0,cancelable:!0});Kv(c,f)}},{checkForDefaultPrevented:!1})})})});Q4.displayName=wle;var lE="NavigationMenuIndicator",Sle=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=vo(lE,e.__scopeNavigationMenu),o=!!i.value;return i.indicatorTrack?TC.createPortal(u.jsx(Wn,{present:n||o,children:u.jsx(_le,{...r,ref:t})}),i.indicatorTrack):null});Sle.displayName=lE;var _le=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=vo(lE,n),o=H4(n),[a,c]=x.useState(null),[d,f]=x.useState(null),p=i.orientation==="horizontal",h=!!i.value;x.useEffect(()=>{const b=o().find(S=>S.value===i.value)?.ref.current;b&&c(b)},[o,i.value]);const v=()=>{a&&f({size:p?a.offsetWidth:a.offsetHeight,offset:p?a.offsetLeft:a.offsetTop})};return c1(a,v),c1(i.indicatorTrack,v),d?u.jsx(Ke.div,{"aria-hidden":!0,"data-state":h?"visible":"hidden","data-orientation":i.orientation,...r,ref:t,style:{position:"absolute",...p?{left:0,width:d.size+"px",transform:`translateX(${d.offset}px)`}:{top:0,height:d.size+"px",transform:`translateY(${d.offset}px)`},...r.style}}):null}),xd="NavigationMenuContent",Cle=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=vo(xd,e.__scopeNavigationMenu),o=W4(xd,e.__scopeNavigationMenu),a=ut(o.contentRef,t),c=o.value===i.value,d={value:o.value,triggerRef:o.triggerRef,focusProxyRef:o.focusProxyRef,wasEscapeCloseRef:o.wasEscapeCloseRef,onContentFocusOutside:o.onContentFocusOutside,onRootContentClose:o.onRootContentClose,...r};return i.viewport?u.jsx(Ele,{forceMount:n,...d,ref:a}):u.jsx(Wn,{present:n||c,children:u.jsx(J4,{"data-state":dE(c),...d,ref:a,onPointerEnter:je(e.onPointerEnter,i.onContentEnter),onPointerLeave:je(e.onPointerLeave,Zv(i.onContentLeave)),style:{pointerEvents:!c&&i.isRootMenu?"none":void 0,...d.style}})})});Cle.displayName=xd;var Ele=x.forwardRef((e,t)=>{const n=vo(xd,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:i}=n;return Yn(()=>{r(e.value,{ref:t,...e})},[e,t,r]),Yn(()=>()=>i(e.value),[e.value,i]),null}),_v="navigationMenu.rootContentDismiss",J4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:i,focusProxyRef:o,wasEscapeCloseRef:a,onRootContentClose:c,onContentFocusOutside:d,...f}=e,p=vo(xd,n),h=x.useRef(null),v=ut(h,t),y=rL(p.baseId,r),b=iL(p.baseId,r),S=H4(n),C=x.useRef(null),{onItemDismiss:E}=p;x.useEffect(()=>{const j=h.current;if(p.isRootMenu&&j){const I=()=>{E(),c(),j.contains(document.activeElement)&&i.current?.focus()};return j.addEventListener(_v,I),()=>j.removeEventListener(_v,I)}},[p.isRootMenu,e.value,i,E,c]);const k=x.useMemo(()=>{const I=S().map(G=>G.value);p.dir==="rtl"&&I.reverse();const A=I.indexOf(p.value),N=I.indexOf(p.previousValue),T=r===p.value,z=N===I.indexOf(r);if(!T&&!z)return C.current;const L=(()=>{if(A!==N){if(T&&N!==-1)return A>N?"from-end":"from-start";if(z&&A!==-1)return A>N?"to-start":"to-end"}return null})();return C.current=L,L},[p.previousValue,p.value,p.dir,S,r]);return u.jsx(tL,{asChild:!0,children:u.jsx(Gd,{id:b,"aria-labelledby":y,"data-motion":k,"data-orientation":p.orientation,...f,ref:v,disableOutsidePointerEvents:!1,onDismiss:()=>{const j=new Event(_v,{bubbles:!0,cancelable:!0});h.current?.dispatchEvent(j)},onFocusOutside:je(e.onFocusOutside,j=>{d();const I=j.target;p.rootNavigationMenu?.contains(I)&&j.preventDefault()}),onPointerDownOutside:je(e.onPointerDownOutside,j=>{const I=j.target,A=S().some(T=>T.ref.current?.contains(I)),N=p.isRootMenu&&p.viewport?.contains(I);(A||N||!p.isRootMenu)&&j.preventDefault()}),onKeyDown:je(e.onKeyDown,j=>{const I=j.altKey||j.ctrlKey||j.metaKey;if(j.key==="Tab"&&!I){const N=l1(j.currentTarget),T=document.activeElement,z=N.findIndex(J=>J===T),G=j.shiftKey?N.slice(0,z).reverse():N.slice(z+1,N.length);uE(G)?j.preventDefault():o.current?.focus()}}),onEscapeKeyDown:je(e.onEscapeKeyDown,j=>{a.current=!0})})})}),cE="NavigationMenuViewport",eL=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=!!vo(cE,e.__scopeNavigationMenu).value;return u.jsx(Wn,{present:n||o,children:u.jsx(kle,{...r,ref:t})})});eL.displayName=cE;var kle=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...i}=e,o=vo(cE,n),a=ut(t,o.onViewportChange),c=vle(xd,e.__scopeNavigationMenu),[d,f]=x.useState(null),[p,h]=x.useState(null),v=d?d?.width+"px":void 0,y=d?d?.height+"px":void 0,b=!!o.value,S=b?o.value:o.previousValue;return c1(p,()=>{p&&f({width:p.offsetWidth,height:p.offsetHeight})}),u.jsx(Ke.div,{"data-state":dE(b),"data-orientation":o.orientation,...i,ref:a,style:{pointerEvents:!b&&o.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":v,"--radix-navigation-menu-viewport-height":y,...i.style},onPointerEnter:je(e.onPointerEnter,o.onContentEnter),onPointerLeave:je(e.onPointerLeave,Zv(o.onContentLeave)),children:Array.from(c.items).map(([E,{ref:k,forceMount:j,...I}])=>{const A=S===E;return u.jsx(Wn,{present:j||A,children:u.jsx(J4,{...I,ref:Ud(k,N=>{A&&N&&h(N)})})},E)})})}),jle="FocusGroup",tL=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=vo(jle,n);return u.jsx(o1.Provider,{scope:n,children:u.jsx(o1.Slot,{scope:n,children:u.jsx(Ke.div,{dir:i.dir,...r,ref:t})})})}),vD=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],Rle="FocusGroupItem",nL=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=mle(n),o=vo(Rle,n);return u.jsx(o1.ItemSlot,{scope:n,children:u.jsx(Ke.button,{...r,ref:t,onKeyDown:je(e.onKeyDown,a=>{if(["Home","End",...vD].includes(a.key)){let d=i().map(h=>h.ref.current);if([o.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&d.reverse(),vD.includes(a.key)){const h=d.indexOf(a.currentTarget);d=d.slice(h+1)}setTimeout(()=>uE(d)),a.preventDefault()}})})})});function l1(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 uE(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function Ile(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 c1(e,t){const n=bn(t);Yn(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}function dE(e){return e?"open":"closed"}function rL(e,t){return`${e}-trigger-${t}`}function iL(e,t){return`${e}-content-${t}`}function Zv(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Nle=q4,Tle=Z4,Ale=X4,Ole=Q4,Dle=eL;function $le({className:e,...t}){return u.jsx("div",{className:Me("absolute top-full left-0 isolate z-50 flex justify-center"),children:u.jsx(Dle,{"data-slot":"navigation-menu-viewport",className:Me("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 oL({className:e,children:t,viewport:n=!0,...r}){return u.jsxs(Nle,{"data-slot":"navigation-menu","data-viewport":n,className:Me("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",e),...r,children:[t,n&&u.jsx($le,{})]})}function u1({className:e,...t}){return u.jsx(Ale,{"data-slot":"navigation-menu-item",className:Me("relative",e),...t})}function d1({className:e,...t}){return u.jsx(Ole,{"data-slot":"navigation-menu-link",className:Me("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 aL({className:e,...t}){return u.jsx(Tle,{"data-slot":"navigation-menu-list",className:Me("group flex flex-1 list-none items-center justify-center gap-1",e),...t})}const sL=Yy("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 fE(){return u.jsx("a",{href:"https://github.com/HarperFast/studio/releases",target:"_blank",rel:"noopener noreferrer",children:u.jsxs("span",{className:Me(sL({variant:"default"}),"text-xs inline-block ml-2 align-text-top"),children:["v4.7.11"," BETA"]})})}function mb(e,t,n){const{instanceId:r,clusterId:i}=tt({strict:!1});return Va({id:_n,operationsUrl:e,port:t,secure:n})}function pb(e,t,n){const{instanceId:r,clusterId:i}=tt({strict:!1});return{instanceClient:Va({id:_n,operationsUrl:e,port:t,secure:n}),entityType:"instance"}}function Ft(e,t,n){const r=tt({strict:!1});return lL({...r,operationsUrl:e,port:t,secure:n})}function lL({instanceId:e,clusterId:t,operationsUrl:n,port:r,secure:i}){const o=_n;return{instanceClient:Va({id:o,operationsUrl:n,port:r,secure:i}),entityId:o,entityType:"instance"}}function Ple(){localStorage.clear()}function Mle(){sessionStorage.clear()}async function zle(){Tt.setUserForEntity(_n,null),Vv.getQueryCache().clear(),Ple(),Mle(),await Vv.invalidateQueries({refetchType:"none"})}async function Lle(e){await Tt.signOutFromPotentiallyAuthenticatedInstances(),await yp({...e,entityId:_n})}function Ule(){const e=mb();return at({mutationFn:()=>Lle({instanceClient:e}),onSuccess:zle})}function hb(e){const{user:t}=cl(),{organizationId:n}=tt({strict:!1}),r=t?.roles?.[e??n];return!r?.permission&&!r?.organization?{update:!1,remove:!1}:r.permission?.super_user?{update:!0,remove:!0}:{update:r.organization.update,remove:r.organization.delete}}function Kd(e){const{user:t}=cl(),{organizationId:n}=tt({strict:!1}),r=t?.roles?.[e??n];if(!r?.permission&&!r?.organization?.roles)return{create:!1,remove:!1,update:!1,view:!1};if(r.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const i=r.organization.roles;return{create:i.create,remove:i.delete,update:i.update,view:i.view}}function gb(e,t){const{user:n}=cl(),{organizationId:r,clusterId:i}=tt({strict:!1});return cL(n,e??r,t??i)}function cL(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 Fle(e,t){const{user:n}=cl(),{organizationId:r,clusterId:i}=tt({strict:!1});return uL(n,r,i)}function uL(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 mE(e){const{clusterId:t,instanceId:n}=tt({strict:!1}),{user:r}=Ja(),i=r?.role?.permission;return i?i.super_user===!0:!1}function Zd(e){const{clusterId:t,instanceId:n}=tt({strict:!1}),{user:r}=Ja(),i=r?.role?.permission;return i?i.super_user===!0||i.structure_user===!0:!1}function CS(e,t,n,r){const{clusterId:i,instanceId:o}=tt({strict:!1}),{user:a}=Ja(),c=a?.role?.permission;return c?c.super_user===!0||c.structure_user===!0?!0:c[t]?.tables?.[n][r]===!0:!1}const pE={className:"text-white"};function dL(){const{mutate:e}=Ule(),t=pn(),{user:n}=_c(),r=on(),{organizationId:i}=tt({strict:!1}),{update:o}=hb(i),{view:a}=Kd(i),c=o,d=x.useCallback(()=>{e(void 0,{onSuccess:async()=>{_e.success("Success",{description:"You have been signed out successfully.",action:{label:"Dismiss",onClick:()=>_e.dismiss()}}),t({to:"/sign-in"}),r.invalidate()}})},[e,r,t]),f=x.useMemo(()=>[!Xu,!Xu,!Xu,{to:"https://docs.harperdb.io/docs",target:"_blank",icon:u.jsx(EM,{}),text:"Docs",textBreakpoint:"md"},{to:"https://github.com/HarperFast/studio/issues",target:"_blank",icon:u.jsx(eX,{}),text:"Report an Issue",textBreakpoint:"lg"},{to:"https://discord.gg/VzZuaw3Xay",target:"_blank",icon:u.jsx(Lse,{}),text:"Discord",textBreakpoint:"lg"},{onClick:d,icon:u.jsx(tQ,{}),text:"Sign Out",textBreakpoint:"md"}].filter(fa),[i,c,a,d]);return n?u.jsxs(u.Fragment,{children:[u.jsx(Hle,{menuItems:f}),u.jsx(Ble,{menuItems:f})]}):u.jsx(Vle,{})}function fL(e){return e.items!==void 0}function Vle(){return u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"inline-block",children:[u.jsx(Ge,{to:"/sign-in",children:u.jsx(iE,{})}),u.jsx(fE,{})]}),u.jsx(oL,{children:u.jsxs(aL,{className:"text-grey-400",children:[u.jsx(u1,{children:u.jsx(d1,{asChild:!0,children:u.jsxs(Ge,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[u.jsx(EM,{})," ",u.jsx("span",{className:"hidden md:inline-block",children:"Docs"})]})})}),u.jsx(u1,{children:u.jsx(d1,{asChild:!0,children:u.jsxs(Ge,{to:"/sign-in",className:"flex-row items-center",activeProps:pE,children:[u.jsx(XX,{})," Sign In"]})})})]})})]})}function Ble({menuItems:e}){const{user:t}=_c();return Ec(t),u.jsx("div",{className:"hidden md:block",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"inline-block",children:[u.jsx(Ge,{to:oa,children:u.jsx(iE,{})}),u.jsx(fE,{})]}),u.jsx(oL,{children:u.jsx(aL,{className:"text-grey-400",children:e.map(n=>fL(n)?!!n.items.length&&u.jsx("div",{className:"bg-black rounded-2xl flex",children:n.items.map(r=>u.jsx(yD,{menuItem:r},r.text))},n.text):u.jsx(yD,{menuItem:n},n.text))})})]})})}function yD({menuItem:e}){return u.jsx(u1,{className:"text-gray-400 hover:text-white",children:u.jsx(d1,{asChild:!0,children:u.jsxs(Ge,{to:e.to,onClick:e.onClick,className:"flex-row items-center",target:e.target,activeProps:e.to?pE: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 Hle({menuItems:e}){const{user:t}=_c();Ec(t);const[n,r]=x.useState(!1),i=x.useCallback(()=>r(a=>!a),[]),o=x.useCallback(()=>r(!1),[]);return u.jsxs("div",{className:"md:hidden",id:"mobile-menu",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Ge,{to:oa,children:u.jsx(iE,{})}),u.jsx(fE,{}),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(UM,{}):u.jsx($M,{})]})]}),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=>fL(a)?!!a.items.length&&u.jsx("div",{className:"bg-black pl-10 pr-2 py-2",children:a.items.map(c=>u.jsx(bD,{menuItem:c,onClick:o},c.text))},a.text):u.jsx(bD,{menuItem:a,onClick:o},a.text))})]})}function bD({menuItem:e,onClick:t}){const n=x.useCallback(()=>{e.onClick?.(),t()},[e,t]);return u.jsxs(Ge,{to:e.to,onClick:n,target:e.target,className:"flex flex-row px-3 py-2 text-base font-medium rounded-md text-gray-400 hover:text-white",activeProps:e.to?pE:void 0,children:[e.icon,u.jsx("span",{className:"ml-4",children:e.text})]})}function fm({title:e,children:t}){return u.jsxs("li",{className:"list-image-(--checkmark-icon) mt-4",children:[u.jsx("h3",{className:"text-xl font-bold",children:e}),t]})}function qle(){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(dL,{})}),u.jsxs("div",{className:"pt-20 grid h-screen grid-cols-1 md:grid-cols-2",children:[u.jsx("section",{className:"items-center justify-center hidden text-white md:flex bg-linear-(--blue-pink-gradient) px-6",children:u.jsxs("div",{children:[u.jsx("h1",{className:"text-4xl font-bold",children:"Harper Fabric"}),u.jsxs("ul",{className:"ps-5",children:[u.jsx(fm,{title:"Free Tier",children:u.jsx("span",{children:"Try us out, no credit card required!"})}),u.jsx(fm,{title:"Global Deployments Managed as One",children:u.jsx("span",{children:"Coordinate global environments as if they were a single node."})}),u.jsx(fm,{title:"Database, App, Cache, & Messaging",children:u.jsx("span",{children:"Bring your stack together for reliable, ultra-fast performance."})}),u.jsx(fm,{title:"NoSQL, Vector, & Blob",children:u.jsx("span",{children:"Store and serve modern data types with low latency, semantic search ability, and global reach."})}),u.jsx(fm,{title:"Simplified Operations",children:u.jsx("span",{children:"Focus on what differentiates your app; leave infrastructure to us."})})]}),u.jsx("span",{className:"opacity-5",children:"Bravo!"})]})}),u.jsx("section",{className:"flex items-center justify-center px-6 bg-linear-(--purple-gradient) dark:bg-linear-(--black-dark-gradient)",children:u.jsx(ll,{})})]})]})}function Gle(){x.useEffect(()=>{},[])}const Kle=["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 hE(e){if(!e||!e.includes("@"))return null;const t=e.split("@").pop()||"";if(!t)return null;for(const n of Kle)if(t===n||t.endsWith("."+n))return null;return t}let ES=null;function Zle(){const e=pn(),t=on(),n=yr(),{redirect:r}=br({strict:!1});return x.useEffect(()=>{ES||(ES=(async function(){const i=await FP().catch(()=>null);if(!i)_e.error("We were not able to verify your sign-in. Please try signing in again.",{duration:1e4}),await e({to:"/sign-in"});else{Tt.setUserForEntity(_n,i);const o=Ec(i);hE(i.email),await n.invalidateQueries({queryKey:By,refetchType:"none"}),await t.invalidate(),await e({to:r?.startsWith("/")?r:o})}ES=null})())},[]),u.jsxs("div",{className:"text-white w-lg flex flex-col gap-4",children:[u.jsxs("h1",{className:"text-3xl font-light",children:[u.jsx("span",{"aria-hidden":"true",className:"text-2xl animate-flower-dance mr-4",title:"Loading",children:"🌼"}),"Checking..."]}),u.jsx("div",{className:"underline flex gap-4",children:u.jsx(Ge,{className:"text-sm opacity-50 hover:text-blue-300",to:"/sign-in",children:"Try signing in again"})})]})}const Yle=["top","right","bottom","left"],rl=Math.min,ki=Math.max,Yv=Math.round,zg=Math.floor,ia=e=>({x:e,y:e}),Wle={left:"right",right:"left",bottom:"top",top:"bottom"},Xle={start:"end",end:"start"};function f1(e,t,n){return ki(e,rl(t,n))}function Ya(e,t){return typeof e=="function"?e(t):e}function Wa(e){return e.split("-")[0]}function Yd(e){return e.split("-")[1]}function gE(e){return e==="x"?"y":"x"}function vE(e){return e==="y"?"height":"width"}const Qle=new Set(["top","bottom"]);function ea(e){return Qle.has(Wa(e))?"y":"x"}function yE(e){return gE(ea(e))}function Jle(e,t,n){n===void 0&&(n=!1);const r=Yd(e),i=yE(e),o=vE(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Wv(a)),[a,Wv(a)]}function ece(e){const t=Wv(e);return[m1(e),t,m1(t)]}function m1(e){return e.replace(/start|end/g,t=>Xle[t])}const xD=["left","right"],wD=["right","left"],tce=["top","bottom"],nce=["bottom","top"];function rce(e,t,n){switch(e){case"top":case"bottom":return n?t?wD:xD:t?xD:wD;case"left":case"right":return t?tce:nce;default:return[]}}function ice(e,t,n,r){const i=Yd(e);let o=rce(Wa(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(m1)))),o}function Wv(e){return e.replace(/left|right|bottom|top/g,t=>Wle[t])}function oce(e){return{top:0,right:0,bottom:0,left:0,...e}}function mL(e){return typeof e!="number"?oce(e):{top:e,right:e,bottom:e,left:e}}function Xv(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 SD(e,t,n){let{reference:r,floating:i}=e;const o=ea(t),a=yE(t),c=vE(a),d=Wa(t),f=o==="y",p=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,v=r[c]/2-i[c]/2;let y;switch(d){case"top":y={x:p,y:r.y-i.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:h};break;case"left":y={x:r.x-i.width,y:h};break;default:y={x:r.x,y:r.y}}switch(Yd(t)){case"start":y[a]-=v*(n&&f?-1:1);break;case"end":y[a]+=v*(n&&f?-1:1);break}return y}const ace=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,c=o.filter(Boolean),d=await(a.isRTL==null?void 0:a.isRTL(t));let f=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:p,y:h}=SD(f,r,d),v=r,y={},b=0;for(let S=0;S<c.length;S++){const{name:C,fn:E}=c[S],{x:k,y:j,data:I,reset:A}=await E({x:p,y:h,initialPlacement:r,placement:v,strategy:i,middlewareData:y,rects:f,platform:a,elements:{reference:e,floating:t}});p=k??p,h=j??h,y={...y,[C]:{...y[C],...I}},A&&b<=50&&(b++,typeof A=="object"&&(A.placement&&(v=A.placement),A.rects&&(f=A.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:p,y:h}=SD(f,v,d)),S=-1)}return{x:p,y:h,placement:v,strategy:i,middlewareData:y}};async function ep(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:h="floating",altBoundary:v=!1,padding:y=0}=Ya(t,e),b=mL(y),C=c[v?h==="floating"?"reference":"floating":h],E=Xv(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(C)))==null||n?C:C.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:f,rootBoundary:p,strategy:d})),k=h==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,j=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),I=await(o.isElement==null?void 0:o.isElement(j))?await(o.getScale==null?void 0:o.getScale(j))||{x:1,y:1}:{x:1,y:1},A=Xv(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:k,offsetParent:j,strategy:d}):k);return{top:(E.top-A.top+b.top)/I.y,bottom:(A.bottom-E.bottom+b.bottom)/I.y,left:(E.left-A.left+b.left)/I.x,right:(A.right-E.right+b.right)/I.x}}const sce=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:c,middlewareData:d}=t,{element:f,padding:p=0}=Ya(e,t)||{};if(f==null)return{};const h=mL(p),v={x:n,y:r},y=yE(i),b=vE(y),S=await a.getDimensions(f),C=y==="y",E=C?"top":"left",k=C?"bottom":"right",j=C?"clientHeight":"clientWidth",I=o.reference[b]+o.reference[y]-v[y]-o.floating[b],A=v[y]-o.reference[y],N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let T=N?N[j]:0;(!T||!await(a.isElement==null?void 0:a.isElement(N)))&&(T=c.floating[j]||o.floating[b]);const z=I/2-A/2,L=T/2-S[b]/2-1,G=rl(h[E],L),J=rl(h[k],L),Z=G,W=T-S[b]-J,F=T/2-S[b]/2+z,Y=f1(Z,F,W),P=!d.arrow&&Yd(i)!=null&&F!==Y&&o.reference[b]/2-(F<Z?G:J)-S[b]/2<0,K=P?F<Z?F-Z:F-W:0;return{[y]:v[y]+K,data:{[y]:Y,centerOffset:F-Y-K,...P&&{alignmentOffset:K}},reset:P}}}),lce=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:c,platform:d,elements:f}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:S=!0,...C}=Ya(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const E=Wa(i),k=ea(c),j=Wa(c)===c,I=await(d.isRTL==null?void 0:d.isRTL(f.floating)),A=v||(j||!S?[Wv(c)]:ece(c)),N=b!=="none";!v&&N&&A.push(...ice(c,S,b,I));const T=[c,...A],z=await ep(t,C),L=[];let G=((r=o.flip)==null?void 0:r.overflows)||[];if(p&&L.push(z[E]),h){const F=Jle(i,a,I);L.push(z[F[0]],z[F[1]])}if(G=[...G,{placement:i,overflows:L}],!L.every(F=>F<=0)){var J,Z;const F=(((J=o.flip)==null?void 0:J.index)||0)+1,Y=T[F];if(Y&&(!(h==="alignment"?k!==ea(Y):!1)||G.every(U=>ea(U.placement)===k?U.overflows[0]>0:!0)))return{data:{index:F,overflows:G},reset:{placement:Y}};let P=(Z=G.filter(K=>K.overflows[0]<=0).sort((K,U)=>K.overflows[1]-U.overflows[1])[0])==null?void 0:Z.placement;if(!P)switch(y){case"bestFit":{var W;const K=(W=G.filter(U=>{if(N){const te=ea(U.placement);return te===k||te==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(te=>te>0).reduce((te,D)=>te+D,0)]).sort((U,te)=>U[1]-te[1])[0])==null?void 0:W[0];K&&(P=K);break}case"initialPlacement":P=c;break}if(i!==P)return{reset:{placement:P}}}return{}}}};function _D(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function CD(e){return Yle.some(t=>e[t]>=0)}const cce=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Ya(e,t);switch(r){case"referenceHidden":{const o=await ep(t,{...i,elementContext:"reference"}),a=_D(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:CD(a)}}}case"escaped":{const o=await ep(t,{...i,altBoundary:!0}),a=_D(o,n.floating);return{data:{escapedOffsets:a,escaped:CD(a)}}}default:return{}}}}},pL=new Set(["left","top"]);async function uce(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Wa(n),c=Yd(n),d=ea(n)==="y",f=pL.has(a)?-1:1,p=o&&d?-1:1,h=Ya(t,e);let{mainAxis:v,crossAxis:y,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof b=="number"&&(y=c==="end"?b*-1:b),d?{x:y*p,y:v*f}:{x:v*f,y:y*p}}const dce=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:c}=t,d=await uce(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:i+d.x,y:o+d.y,data:{...d,placement:a}}}}},fce=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:c={fn:C=>{let{x:E,y:k}=C;return{x:E,y:k}}},...d}=Ya(e,t),f={x:n,y:r},p=await ep(t,d),h=ea(Wa(i)),v=gE(h);let y=f[v],b=f[h];if(o){const C=v==="y"?"top":"left",E=v==="y"?"bottom":"right",k=y+p[C],j=y-p[E];y=f1(k,y,j)}if(a){const C=h==="y"?"top":"left",E=h==="y"?"bottom":"right",k=b+p[C],j=b-p[E];b=f1(k,b,j)}const S=c.fn({...t,[v]:y,[h]:b});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[v]:o,[h]:a}}}}}},mce=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=Ya(e,t),p={x:n,y:r},h=ea(i),v=gE(h);let y=p[v],b=p[h];const S=Ya(c,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(d){const j=v==="y"?"height":"width",I=o.reference[v]-o.floating[j]+C.mainAxis,A=o.reference[v]+o.reference[j]-C.mainAxis;y<I?y=I:y>A&&(y=A)}if(f){var E,k;const j=v==="y"?"width":"height",I=pL.has(Wa(i)),A=o.reference[h]-o.floating[j]+(I&&((E=a.offset)==null?void 0:E[h])||0)+(I?0:C.crossAxis),N=o.reference[h]+o.reference[j]+(I?0:((k=a.offset)==null?void 0:k[h])||0)-(I?C.crossAxis:0);b<A?b=A:b>N&&(b=N)}return{[v]:y,[h]:b}}}},pce=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:a,elements:c}=t,{apply:d=()=>{},...f}=Ya(e,t),p=await ep(t,f),h=Wa(i),v=Yd(i),y=ea(i)==="y",{width:b,height:S}=o.floating;let C,E;h==="top"||h==="bottom"?(C=h,E=v===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(E=h,C=v==="end"?"top":"bottom");const k=S-p.top-p.bottom,j=b-p.left-p.right,I=rl(S-p[C],k),A=rl(b-p[E],j),N=!t.middlewareData.shift;let T=I,z=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(z=j),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=k),N&&!v){const G=ki(p.left,0),J=ki(p.right,0),Z=ki(p.top,0),W=ki(p.bottom,0);y?z=b-2*(G!==0||J!==0?G+J:ki(p.left,p.right)):T=S-2*(Z!==0||W!==0?Z+W:ki(p.top,p.bottom))}await d({...t,availableWidth:z,availableHeight:T});const L=await a.getDimensions(c.floating);return b!==L.width||S!==L.height?{reset:{rects:!0}}:{}}}};function vb(){return typeof window<"u"}function Wd(e){return hL(e)?(e.nodeName||"").toLowerCase():"#document"}function Ti(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ma(e){var t;return(t=(hL(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function hL(e){return vb()?e instanceof Node||e instanceof Ti(e).Node:!1}function $o(e){return vb()?e instanceof Element||e instanceof Ti(e).Element:!1}function ua(e){return vb()?e instanceof HTMLElement||e instanceof Ti(e).HTMLElement:!1}function ED(e){return!vb()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ti(e).ShadowRoot}const hce=new Set(["inline","contents"]);function Ap(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Po(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!hce.has(i)}const gce=new Set(["table","td","th"]);function vce(e){return gce.has(Wd(e))}const yce=[":popover-open",":modal"];function yb(e){return yce.some(t=>{try{return e.matches(t)}catch{return!1}})}const bce=["transform","translate","scale","rotate","perspective"],xce=["transform","translate","scale","rotate","perspective","filter"],wce=["paint","layout","strict","content"];function bE(e){const t=xE(),n=$o(e)?Po(e):e;return bce.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)||xce.some(r=>(n.willChange||"").includes(r))||wce.some(r=>(n.contain||"").includes(r))}function Sce(e){let t=il(e);for(;ua(t)&&!wd(t);){if(bE(t))return t;if(yb(t))return null;t=il(t)}return null}function xE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const _ce=new Set(["html","body","#document"]);function wd(e){return _ce.has(Wd(e))}function Po(e){return Ti(e).getComputedStyle(e)}function bb(e){return $o(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function il(e){if(Wd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ED(e)&&e.host||ma(e);return ED(t)?t.host:t}function gL(e){const t=il(e);return wd(t)?e.ownerDocument?e.ownerDocument.body:e.body:ua(t)&&Ap(t)?t:gL(t)}function tp(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=gL(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=Ti(i);if(o){const c=p1(a);return t.concat(a,a.visualViewport||[],Ap(i)?i:[],c&&n?tp(c):[])}return t.concat(i,tp(i,[],n))}function p1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function vL(e){const t=Po(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=ua(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,c=Yv(n)!==o||Yv(r)!==a;return c&&(n=o,r=a),{width:n,height:r,$:c}}function wE(e){return $o(e)?e:e.contextElement}function nd(e){const t=wE(e);if(!ua(t))return ia(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=vL(t);let a=(o?Yv(n.width):n.width)/r,c=(o?Yv(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const Cce=ia(0);function yL(e){const t=Ti(e);return!xE()||!t.visualViewport?Cce:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ece(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ti(e)?!1:t}function pc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=wE(e);let a=ia(1);t&&(r?$o(r)&&(a=nd(r)):a=nd(e));const c=Ece(o,n,r)?yL(o):ia(0);let d=(i.left+c.x)/a.x,f=(i.top+c.y)/a.y,p=i.width/a.x,h=i.height/a.y;if(o){const v=Ti(o),y=r&&$o(r)?Ti(r):r;let b=v,S=p1(b);for(;S&&r&&y!==b;){const C=nd(S),E=S.getBoundingClientRect(),k=Po(S),j=E.left+(S.clientLeft+parseFloat(k.paddingLeft))*C.x,I=E.top+(S.clientTop+parseFloat(k.paddingTop))*C.y;d*=C.x,f*=C.y,p*=C.x,h*=C.y,d+=j,f+=I,b=Ti(S),S=p1(b)}}return Xv({width:p,height:h,x:d,y:f})}function xb(e,t){const n=bb(e).scrollLeft;return t?t.left+n:pc(ma(e)).left+n}function bL(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-xb(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function kce(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=ma(r),c=t?yb(t.floating):!1;if(r===a||c&&o)return n;let d={scrollLeft:0,scrollTop:0},f=ia(1);const p=ia(0),h=ua(r);if((h||!h&&!o)&&((Wd(r)!=="body"||Ap(a))&&(d=bb(r)),ua(r))){const y=pc(r);f=nd(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const v=a&&!h&&!o?bL(a,d):ia(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+p.x+v.x,y:n.y*f.y-d.scrollTop*f.y+p.y+v.y}}function jce(e){return Array.from(e.getClientRects())}function Rce(e){const t=ma(e),n=bb(e),r=e.ownerDocument.body,i=ki(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ki(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+xb(e);const c=-n.scrollTop;return Po(r).direction==="rtl"&&(a+=ki(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:c}}const kD=25;function Ice(e,t){const n=Ti(e),r=ma(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,c=0,d=0;if(i){o=i.width,a=i.height;const p=xE();(!p||p&&t==="fixed")&&(c=i.offsetLeft,d=i.offsetTop)}const f=xb(r);if(f<=0){const p=r.ownerDocument,h=p.body,v=getComputedStyle(h),y=p.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,b=Math.abs(r.clientWidth-h.clientWidth-y);b<=kD&&(o-=b)}else f<=kD&&(o+=f);return{width:o,height:a,x:c,y:d}}const Nce=new Set(["absolute","fixed"]);function Tce(e,t){const n=pc(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=ua(e)?nd(e):ia(1),a=e.clientWidth*o.x,c=e.clientHeight*o.y,d=i*o.x,f=r*o.y;return{width:a,height:c,x:d,y:f}}function jD(e,t,n){let r;if(t==="viewport")r=Ice(e,n);else if(t==="document")r=Rce(ma(e));else if($o(t))r=Tce(t,n);else{const i=yL(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Xv(r)}function xL(e,t){const n=il(e);return n===t||!$o(n)||wd(n)?!1:Po(n).position==="fixed"||xL(n,t)}function Ace(e,t){const n=t.get(e);if(n)return n;let r=tp(e,[],!1).filter(c=>$o(c)&&Wd(c)!=="body"),i=null;const o=Po(e).position==="fixed";let a=o?il(e):e;for(;$o(a)&&!wd(a);){const c=Po(a),d=bE(a);!d&&c.position==="fixed"&&(i=null),(o?!d&&!i:!d&&c.position==="static"&&!!i&&Nce.has(i.position)||Ap(a)&&!d&&xL(e,a))?r=r.filter(p=>p!==a):i=c,a=il(a)}return t.set(e,r),r}function Oce(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?yb(t)?[]:Ace(t,this._c):[].concat(n),r],c=a[0],d=a.reduce((f,p)=>{const h=jD(t,p,i);return f.top=ki(h.top,f.top),f.right=rl(h.right,f.right),f.bottom=rl(h.bottom,f.bottom),f.left=ki(h.left,f.left),f},jD(t,c,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Dce(e){const{width:t,height:n}=vL(e);return{width:t,height:n}}function $ce(e,t,n){const r=ua(t),i=ma(t),o=n==="fixed",a=pc(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const d=ia(0);function f(){d.x=xb(i)}if(r||!r&&!o)if((Wd(t)!=="body"||Ap(i))&&(c=bb(t)),r){const y=pc(t,!0,o,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}else i&&f();o&&!r&&i&&f();const p=i&&!r&&!o?bL(i,c):ia(0),h=a.left+c.scrollLeft-d.x-p.x,v=a.top+c.scrollTop-d.y-p.y;return{x:h,y:v,width:a.width,height:a.height}}function kS(e){return Po(e).position==="static"}function RD(e,t){if(!ua(e)||Po(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ma(e)===n&&(n=n.ownerDocument.body),n}function wL(e,t){const n=Ti(e);if(yb(e))return n;if(!ua(e)){let i=il(e);for(;i&&!wd(i);){if($o(i)&&!kS(i))return i;i=il(i)}return n}let r=RD(e,t);for(;r&&vce(r)&&kS(r);)r=RD(r,t);return r&&wd(r)&&kS(r)&&!bE(r)?n:r||Sce(e)||n}const Pce=async function(e){const t=this.getOffsetParent||wL,n=this.getDimensions,r=await n(e.floating);return{reference:$ce(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Mce(e){return Po(e).direction==="rtl"}const zce={convertOffsetParentRelativeRectToViewportRelativeRect:kce,getDocumentElement:ma,getClippingRect:Oce,getOffsetParent:wL,getElementRects:Pce,getClientRects:jce,getDimensions:Dce,getScale:nd,isElement:$o,isRTL:Mce};function SL(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Lce(e,t){let n=null,r;const i=ma(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),o();const f=e.getBoundingClientRect(),{left:p,top:h,width:v,height:y}=f;if(c||t(),!v||!y)return;const b=zg(h),S=zg(i.clientWidth-(p+v)),C=zg(i.clientHeight-(h+y)),E=zg(p),j={rootMargin:-b+"px "+-S+"px "+-C+"px "+-E+"px",threshold:ki(0,rl(1,d))||1};let I=!0;function A(N){const T=N[0].intersectionRatio;if(T!==d){if(!I)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},1e3)}T===1&&!SL(f,e.getBoundingClientRect())&&a(),I=!1}try{n=new IntersectionObserver(A,{...j,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,j)}n.observe(e)}return a(!0),o}function Uce(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=wE(e),p=i||o?[...f?tp(f):[],...tp(t)]:[];p.forEach(E=>{i&&E.addEventListener("scroll",n,{passive:!0}),o&&E.addEventListener("resize",n)});const h=f&&c?Lce(f,n):null;let v=-1,y=null;a&&(y=new ResizeObserver(E=>{let[k]=E;k&&k.target===f&&y&&(y.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var j;(j=y)==null||j.observe(t)})),n()}),f&&!d&&y.observe(f),y.observe(t));let b,S=d?pc(e):null;d&&C();function C(){const E=pc(e);S&&!SL(S,E)&&n(),S=E,b=requestAnimationFrame(C)}return n(),()=>{var E;p.forEach(k=>{i&&k.removeEventListener("scroll",n),o&&k.removeEventListener("resize",n)}),h?.(),(E=y)==null||E.disconnect(),y=null,d&&cancelAnimationFrame(b)}}const Fce=dce,Vce=fce,Bce=lce,Hce=pce,qce=cce,ID=sce,Gce=mce,Kce=(e,t,n)=>{const r=new Map,i={platform:zce,...n},o={...i.platform,_c:r};return ace(e,t,{...i,platform:o})};var Zce=typeof document<"u",Yce=function(){},Cv=Zce?x.useLayoutEffect:Yce;function Qv(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(!Qv(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)&&!Qv(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function _L(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ND(e,t){const n=_L(e);return Math.round(t*n)/n}function jS(e){const t=x.useRef(e);return Cv(()=>{t.current=e}),t}function Wce(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:c=!0,whileElementsMounted:d,open:f}=e,[p,h]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,y]=x.useState(r);Qv(v,r)||y(r);const[b,S]=x.useState(null),[C,E]=x.useState(null),k=x.useCallback(U=>{U!==N.current&&(N.current=U,S(U))},[]),j=x.useCallback(U=>{U!==T.current&&(T.current=U,E(U))},[]),I=o||b,A=a||C,N=x.useRef(null),T=x.useRef(null),z=x.useRef(p),L=d!=null,G=jS(d),J=jS(i),Z=jS(f),W=x.useCallback(()=>{if(!N.current||!T.current)return;const U={placement:t,strategy:n,middleware:v};J.current&&(U.platform=J.current),Kce(N.current,T.current,U).then(te=>{const D={...te,isPositioned:Z.current!==!1};F.current&&!Qv(z.current,D)&&(z.current=D,Md.flushSync(()=>{h(D)}))})},[v,t,n,J,Z]);Cv(()=>{f===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,h(U=>({...U,isPositioned:!1})))},[f]);const F=x.useRef(!1);Cv(()=>(F.current=!0,()=>{F.current=!1}),[]),Cv(()=>{if(I&&(N.current=I),A&&(T.current=A),I&&A){if(G.current)return G.current(I,A,W);W()}},[I,A,W,G,L]);const Y=x.useMemo(()=>({reference:N,floating:T,setReference:k,setFloating:j}),[k,j]),P=x.useMemo(()=>({reference:I,floating:A}),[I,A]),K=x.useMemo(()=>{const U={position:n,left:0,top:0};if(!P.floating)return U;const te=ND(P.floating,p.x),D=ND(P.floating,p.y);return c?{...U,transform:"translate("+te+"px, "+D+"px)",..._L(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:te,top:D}},[n,c,P.floating,p.x,p.y]);return x.useMemo(()=>({...p,update:W,refs:Y,elements:P,floatingStyles:K}),[p,W,Y,P,K])}const Xce=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?ID({element:r.current,padding:i}).fn(n):{}:r?ID({element:r,padding:i}).fn(n):{}}}},Qce=(e,t)=>({...Fce(e),options:[e,t]}),Jce=(e,t)=>({...Vce(e),options:[e,t]}),eue=(e,t)=>({...Gce(e),options:[e,t]}),tue=(e,t)=>({...Bce(e),options:[e,t]}),nue=(e,t)=>({...Hce(e),options:[e,t]}),rue=(e,t)=>({...qce(e),options:[e,t]}),iue=(e,t)=>({...Xce(e),options:[e,t]});var oue="Arrow",CL=x.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return u.jsx(Ke.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});CL.displayName=oue;var aue=CL;function EL(e){const[t,n]=x.useState(void 0);return Yn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,c;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;a=f.inlineSize,c=f.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var SE="Popper",[kL,Xd]=Mi(SE),[sue,jL]=kL(SE),RL=e=>{const{__scopePopper:t,children:n}=e,[r,i]=x.useState(null);return u.jsx(sue,{scope:t,anchor:r,onAnchorChange:i,children:n})};RL.displayName=SE;var IL="PopperAnchor",NL=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=jL(IL,n),a=x.useRef(null),c=ut(t,a),d=x.useRef(null);return x.useEffect(()=>{const f=d.current;d.current=r?.current||a.current,f!==d.current&&o.onAnchorChange(d.current)}),r?null:u.jsx(Ke.div,{...i,ref:c})});NL.displayName=IL;var _E="PopperContent",[lue,cue]=kL(_E),TL=x.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:h="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:b,...S}=e,C=jL(_E,n),[E,k]=x.useState(null),j=ut(t,B=>k(B)),[I,A]=x.useState(null),N=EL(I),T=N?.width??0,z=N?.height??0,L=r+(o!=="center"?"-"+o:""),G=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},J=Array.isArray(f)?f:[f],Z=J.length>0,W={padding:G,boundary:J.filter(due),altBoundary:Z},{refs:F,floatingStyles:Y,placement:P,isPositioned:K,middlewareData:U}=Wce({strategy:"fixed",placement:L,whileElementsMounted:(...B)=>Uce(...B,{animationFrame:y==="always"}),elements:{reference:C.anchor},middleware:[Qce({mainAxis:i+z,alignmentAxis:a}),d&&Jce({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?eue():void 0,...W}),d&&tue({...W}),nue({...W,apply:({elements:B,rects:ie,availableWidth:Se,availableHeight:Ie})=>{const{width:Fe,height:Ue}=ie.reference,Ye=B.floating.style;Ye.setProperty("--radix-popper-available-width",`${Se}px`),Ye.setProperty("--radix-popper-available-height",`${Ie}px`),Ye.setProperty("--radix-popper-anchor-width",`${Fe}px`),Ye.setProperty("--radix-popper-anchor-height",`${Ue}px`)}}),I&&iue({element:I,padding:c}),fue({arrowWidth:T,arrowHeight:z}),v&&rue({strategy:"referenceHidden",...W})]}),[te,D]=DL(P),M=bn(b);Yn(()=>{K&&M?.()},[K,M]);const V=U.arrow?.x,O=U.arrow?.y,ee=U.arrow?.centerOffset!==0,[ue,pe]=x.useState();return Yn(()=>{E&&pe(window.getComputedStyle(E).zIndex)},[E]),u.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:K?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(lue,{scope:n,placedSide:te,onArrowChange:A,arrowX:V,arrowY:O,shouldHideArrow:ee,children:u.jsx(Ke.div,{"data-side":te,"data-align":D,...S,ref:j,style:{...S.style,animation:K?void 0:"none"}})})})});TL.displayName=_E;var AL="PopperArrow",uue={top:"bottom",right:"left",bottom:"top",left:"right"},OL=x.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=cue(AL,r),a=uue[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(aue,{...i,ref:n,style:{...i.style,display:"block"}})})});OL.displayName=AL;function due(e){return e!==null}var fue=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,c=a?0:e.arrowWidth,d=a?0:e.arrowHeight,[f,p]=DL(n),h={start:"0%",center:"50%",end:"100%"}[p],v=(i.arrow?.x??0)+c/2,y=(i.arrow?.y??0)+d/2;let b="",S="";return f==="bottom"?(b=a?h:`${v}px`,S=`${-d}px`):f==="top"?(b=a?h:`${v}px`,S=`${r.floating.height+d}px`):f==="right"?(b=`${-d}px`,S=a?h:`${y}px`):f==="left"&&(b=`${r.floating.width+d}px`,S=a?h:`${y}px`),{data:{x:b,y:S}}}});function DL(e){const[t,n="center"]=e.split("-");return[t,n]}var CE=RL,EE=NL,kE=TL,jE=OL,mue="Portal",Op=x.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=x.useState(!1);Yn(()=>o(!0),[]);const a=n||i&&globalThis?.document?.body;return a?TC.createPortal(u.jsx(Ke.div,{...r,ref:t}),a):null});Op.displayName=mue;var[wb]=Mi("Tooltip",[Xd]),Sb=Xd(),$L="TooltipProvider",pue=700,h1="tooltip.open",[hue,RE]=wb($L),PL=e=>{const{__scopeTooltip:t,delayDuration:n=pue,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,a=x.useRef(!0),c=x.useRef(!1),d=x.useRef(0);return x.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),u.jsx(hue,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(d.current),a.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:x.useCallback(f=>{c.current=f},[]),disableHoverableContent:i,children:o})};PL.displayName=$L;var np="Tooltip",[gue,Dp]=wb(np),ML=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:a,delayDuration:c}=e,d=RE(np,e.__scopeTooltip),f=Sb(t),[p,h]=x.useState(null),v=Ni(),y=x.useRef(0),b=a??d.disableHoverableContent,S=c??d.delayDuration,C=x.useRef(!1),[E,k]=Do({prop:r,defaultProp:i??!1,onChange:T=>{T?(d.onOpen(),document.dispatchEvent(new CustomEvent(h1))):d.onClose(),o?.(T)},caller:np}),j=x.useMemo(()=>E?C.current?"delayed-open":"instant-open":"closed",[E]),I=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C.current=!1,k(!0)},[k]),A=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,k(!1)},[k]),N=x.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{C.current=!0,k(!0),y.current=0},S)},[S,k]);return x.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),u.jsx(CE,{...f,children:u.jsx(gue,{scope:t,contentId:v,open:E,stateAttribute:j,trigger:p,onTriggerChange:h,onTriggerEnter:x.useCallback(()=>{d.isOpenDelayedRef.current?N():I()},[d.isOpenDelayedRef,N,I]),onTriggerLeave:x.useCallback(()=>{b?A():(window.clearTimeout(y.current),y.current=0)},[A,b]),onOpen:I,onClose:A,disableHoverableContent:b,children:n})})};ML.displayName=np;var g1="TooltipTrigger",zL=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Dp(g1,n),o=RE(g1,n),a=Sb(n),c=x.useRef(null),d=ut(t,c,i.onTriggerChange),f=x.useRef(!1),p=x.useRef(!1),h=x.useCallback(()=>f.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),u.jsx(EE,{asChild:!0,...a,children:u.jsx(Ke.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:d,onPointerMove:je(e.onPointerMove,v=>{v.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:je(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:je(e.onPointerDown,()=>{i.open&&i.onClose(),f.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:je(e.onFocus,()=>{f.current||i.onOpen()}),onBlur:je(e.onBlur,i.onClose),onClick:je(e.onClick,i.onClose)})})});zL.displayName=g1;var IE="TooltipPortal",[vue,yue]=wb(IE,{forceMount:void 0}),LL=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=Dp(IE,t);return u.jsx(vue,{scope:t,forceMount:n,children:u.jsx(Wn,{present:n||o.open,children:u.jsx(Op,{asChild:!0,container:i,children:r})})})};LL.displayName=IE;var Sd="TooltipContent",UL=x.forwardRef((e,t)=>{const n=yue(Sd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=Dp(Sd,e.__scopeTooltip);return u.jsx(Wn,{present:r||a.open,children:a.disableHoverableContent?u.jsx(FL,{side:i,...o,ref:t}):u.jsx(bue,{side:i,...o,ref:t})})}),bue=x.forwardRef((e,t)=>{const n=Dp(Sd,e.__scopeTooltip),r=RE(Sd,e.__scopeTooltip),i=x.useRef(null),o=ut(t,i),[a,c]=x.useState(null),{trigger:d,onClose:f}=n,p=i.current,{onPointerInTransitChange:h}=r,v=x.useCallback(()=>{c(null),h(!1)},[h]),y=x.useCallback((b,S)=>{const C=b.currentTarget,E={x:b.clientX,y:b.clientY},k=_ue(E,C.getBoundingClientRect()),j=Cue(E,k),I=Eue(S.getBoundingClientRect()),A=jue([...j,...I]);c(A),h(!0)},[h]);return x.useEffect(()=>()=>v(),[v]),x.useEffect(()=>{if(d&&p){const b=C=>y(C,p),S=C=>y(C,d);return d.addEventListener("pointerleave",b),p.addEventListener("pointerleave",S),()=>{d.removeEventListener("pointerleave",b),p.removeEventListener("pointerleave",S)}}},[d,p,y,v]),x.useEffect(()=>{if(a){const b=S=>{const C=S.target,E={x:S.clientX,y:S.clientY},k=d?.contains(C)||p?.contains(C),j=!kue(E,a);k?v():j&&(v(),f())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[d,p,a,f,v]),u.jsx(FL,{...e,ref:o})}),[xue,wue]=wb(np,{isInside:!1}),Sue=Bse("TooltipContent"),FL=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...c}=e,d=Dp(Sd,n),f=Sb(n),{onClose:p}=d;return x.useEffect(()=>(document.addEventListener(h1,p),()=>document.removeEventListener(h1,p)),[p]),x.useEffect(()=>{if(d.trigger){const h=v=>{v.target?.contains(d.trigger)&&p()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[d.trigger,p]),u.jsx(Gd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:p,children:u.jsxs(kE,{"data-state":d.stateAttribute,...f,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[u.jsx(Sue,{children:r}),u.jsx(xue,{scope:n,isInside:!0,children:u.jsx(B4,{id:d.contentId,role:"tooltip",children:i||r})})]})})});UL.displayName=Sd;var VL="TooltipArrow",BL=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Sb(n);return wue(VL,n).isInside?null:u.jsx(jE,{...i,...r,ref:t})});BL.displayName=VL;function _ue(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 Cue(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 Eue(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 kue(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const c=t[o],d=t[a],f=c.x,p=c.y,h=d.x,v=d.y;p>r!=v>r&&n<(h-f)*(r-p)/(v-p)+f&&(i=!i)}return i}function jue(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),Rue(t)}function Rue(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 Iue=PL,Nue=ML,Tue=zL,Aue=LL,Oue=UL,Due=BL;function $ue({delayDuration:e=0,...t}){return u.jsx(Iue,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function _b({...e}){return u.jsx($ue,{children:u.jsx(Nue,{"data-slot":"tooltip",...e})})}function Cb({...e}){return u.jsx(Tue,{"data-slot":"tooltip-trigger",...e})}function Eb({className:e,sideOffset:t=0,arrowClassName:n,children:r,...i}){return u.jsx(Aue,{children:u.jsxs(Oue,{"data-slot":"tooltip-content",sideOffset:t,className:Me("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(Due,{className:Me("bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",n)})]})})}const mm=new Map;function Eo(e){if(!e)return"";if(mm.has(e))return mm.get(e);const t=e.replace(/[-_]+/g," ").replace(/\s+/g," ").trim();if(!t)return mm.set(e,""),"";const n=t.match(/([A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+|[0-9]+)/g);if(!n)return mm.set(e,""),"";const r=[];for(let a=0;a<n.length;a++){const c=n[a],d=a+1<n.length?n[a+1]:void 0;/^[A-Z]{2,}$/.test(c)&&d&&/[A-Z]*s$/.test(d)||/^[A-Z]$/.test(c)&&d!==void 0&&/^[A-Z]s$/.test(d)?(r.push(c+d),a++):r.push(c)}const o=r.map(Pue).join(" ");return mm.set(e,o),o}function Pue(e){return/^[A-Z]{2,3}s?$/.test(e)||/^[0-9]+$/.test(e)?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function kb({restartRequired:e}){const t=qY(),{organization:n,instance:r,cluster:i}=xp({strict:!1}),o="Instance",a=x.useMemo(()=>{const c=t.pathname.split("/").filter(f=>f&&f.length>0),d=[u.jsxs(Ge,{to:"/",children:[u.jsx(BX,{"aria-hidden":"true",className:"size-5 shrink-0"}),u.jsx("span",{className:"sr-only",children:"Home"})]})];for(let f=0;f<c.length;f++){const p=c[f];if(p==="instance")continue;let h=`/${c.slice(0,f+1).join("/")}`,v=Eo(p),y;p==="databases"&&c.length===f+3?(v=c[f+2],f+=2):v.startsWith("Org ")?v=n?.name||"Org":v.startsWith("Clu ")?(v=i?.name||"Cluster",c[f+1]==="instance"&&(h+="/instances")):v.startsWith("Ins ")?v=r?.name?.split(".")?.shift()||"Instance":v==="Apis"&&(v="APIs"),d.push(u.jsx("svg",{fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true",className:"size-5 shrink-0 text-grey",children:u.jsx("path",{d:"M5.555 17.776l8-16 .894.448-8 16-.894-.448z"})}),u.jsxs(Ge,{to:h,className:"text-xs md:text-sm font-medium hover:text-grey truncate max-w-48",children:[v,y]}))}return d},[t.pathname,i?.name,r?.name,n?.name]);return u.jsxs("div",{role:"list",className:"flex items-center space-x-2 xl:space-x-4 sm:max-w-9/10 max-w-[calc(100%-56px)]",children:[...a,e&&u.jsxs(_b,{children:[u.jsx(Cb,{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(Eb,{side:"bottom",children:["This ",o," is requesting a restart, when convenient, to apply your latest changes.",u.jsx("br",{}),"You can do this from the Apps or Config pages."]})]})]})}var $p=e=>e.type==="checkbox",Wl=e=>e instanceof Date,ai=e=>e==null;const HL=e=>typeof e=="object";var Zn=e=>!ai(e)&&!Array.isArray(e)&&HL(e)&&!Wl(e),qL=e=>Zn(e)&&e.target?$p(e.target)?e.target.checked:e.target.value:e,Mue=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,GL=(e,t)=>e.has(Mue(t)),zue=e=>{const t=e.constructor&&e.constructor.prototype;return Zn(t)&&t.hasOwnProperty("isPrototypeOf")},NE=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function dn(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(NE&&(e instanceof Blob||r))&&(n||Zn(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!zue(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=dn(e[i]));else return e;return t}var jb=e=>/^\w*$/.test(e),nn=e=>e===void 0,Rb=e=>Array.isArray(e)?e.filter(Boolean):[],TE=e=>Rb(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ne=(e,t,n)=>{if(!t||!Zn(e))return n;const r=(jb(t)?[t]:TE(t)).reduce((i,o)=>ai(i)?i:i[o],e);return nn(r)||r===e?nn(e[t])?n:e[t]:r},Ci=e=>typeof e=="boolean",zt=(e,t,n)=>{let r=-1;const i=jb(t)?[t]:TE(t),o=i.length,a=o-1;for(;++r<o;){const c=i[r];let d=n;if(r!==a){const f=e[c];d=Zn(f)||Array.isArray(f)?f:isNaN(+i[r+1])?{}:[]}if(c==="__proto__"||c==="constructor"||c==="prototype")return;e[c]=d,e=e[c]}};const Jv={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},oo={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},$a={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},AE=X.createContext(null);AE.displayName="HookFormContext";const Pp=()=>X.useContext(AE),Lue=e=>{const{children:t,...n}=e;return X.createElement(AE.Provider,{value:n},t)};var KL=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const a=o;return t._proxyFormState[a]!==oo.all&&(t._proxyFormState[a]=!r||oo.all),n&&(n[a]=!0),e[a]}});return i};const Ib=typeof window<"u"?X.useLayoutEffect:X.useEffect;function OE(e){const t=Pp(),{control:n=t.control,disabled:r,name:i,exact:o}=e||{},[a,c]=X.useState(n._formState),d=X.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Ib(()=>n._subscribe({name:i,formState:d.current,exact:o,callback:f=>{!r&&c({...n._formState,...f})}}),[i,r,o]),X.useEffect(()=>{d.current.isValid&&n._setValid(!0)},[n]),X.useMemo(()=>KL(a,n,d.current,!1),[a,n])}var ji=e=>typeof e=="string",ZL=(e,t,n,r,i)=>ji(e)?(r&&t.watch.add(e),Ne(n,e,i)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),Ne(n,o))):(r&&(t.watchAll=!0),n),v1=e=>ai(e)||!HL(e);function Ua(e,t,n=new WeakSet){if(v1(e)||v1(t))return e===t;if(Wl(e)&&Wl(t))return e.getTime()===t.getTime();const r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const o of r){const a=e[o];if(!i.includes(o))return!1;if(o!=="ref"){const c=t[o];if(Wl(a)&&Wl(c)||Zn(a)&&Zn(c)||Array.isArray(a)&&Array.isArray(c)?!Ua(a,c,n):a!==c)return!1}}return!0}function Uue(e){const t=Pp(),{control:n=t.control,name:r,defaultValue:i,disabled:o,exact:a,compute:c}=e||{},d=X.useRef(i),f=X.useRef(c),p=X.useRef(void 0);f.current=c;const h=X.useMemo(()=>n._getWatch(r,d.current),[n,r]),[v,y]=X.useState(f.current?f.current(h):h);return Ib(()=>n._subscribe({name:r,formState:{values:!0},exact:a,callback:b=>{if(!o){const S=ZL(r,n._names,b.values||n._formValues,!1,d.current);if(f.current){const C=f.current(S);Ua(C,p.current)||(y(C),p.current=C)}else y(S)}}}),[n,o,r,a]),X.useEffect(()=>n._removeUnmounted()),v}function Fue(e){const t=Pp(),{name:n,disabled:r,control:i=t.control,shouldUnregister:o,defaultValue:a}=e,c=GL(i._names.array,n),d=X.useMemo(()=>Ne(i._formValues,n,Ne(i._defaultValues,n,a)),[i,n,a]),f=Uue({control:i,name:n,defaultValue:d,exact:!0}),p=OE({control:i,name:n,exact:!0}),h=X.useRef(e),v=X.useRef(void 0),y=X.useRef(i.register(n,{...e.rules,value:f,...Ci(e.disabled)?{disabled:e.disabled}:{}}));h.current=e;const b=X.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ne(p.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ne(p.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ne(p.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ne(p.validatingFields,n)},error:{enumerable:!0,get:()=>Ne(p.errors,n)}}),[p,n]),S=X.useCallback(j=>y.current.onChange({target:{value:qL(j),name:n},type:Jv.CHANGE}),[n]),C=X.useCallback(()=>y.current.onBlur({target:{value:Ne(i._formValues,n),name:n},type:Jv.BLUR}),[n,i._formValues]),E=X.useCallback(j=>{const I=Ne(i._fields,n);I&&j&&(I._f.ref={focus:()=>j.focus&&j.focus(),select:()=>j.select&&j.select(),setCustomValidity:A=>j.setCustomValidity(A),reportValidity:()=>j.reportValidity()})},[i._fields,n]),k=X.useMemo(()=>({name:n,value:f,...Ci(r)||p.disabled?{disabled:p.disabled||r}:{},onChange:S,onBlur:C,ref:E}),[n,r,p.disabled,S,C,E,f]);return X.useEffect(()=>{const j=i._options.shouldUnregister||o,I=v.current;I&&I!==n&&!c&&i.unregister(I),i.register(n,{...h.current.rules,...Ci(h.current.disabled)?{disabled:h.current.disabled}:{}});const A=(N,T)=>{const z=Ne(i._fields,N);z&&z._f&&(z._f.mount=T)};if(A(n,!0),j){const N=dn(Ne(i._options.defaultValues,n,h.current.defaultValue));zt(i._defaultValues,n,N),nn(Ne(i._formValues,n))&&zt(i._formValues,n,N)}return!c&&i.register(n),v.current=n,()=>{(c?j&&!i._state.action:j)?i.unregister(n):A(n,!1)}},[n,i,c,o]),X.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),X.useMemo(()=>({field:k,formState:p,fieldState:b}),[k,p,b])}const Vue=e=>e.render(Fue(e));var DE=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},ci=e=>Array.isArray(e)?e:[e],TD=()=>{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 YL(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const i=e[r],o=t[r];if(i&&Zn(i)&&o){const a=YL(i,o);Zn(a)&&(n[r]=a)}else e[r]&&(n[r]=o)}return n}var Pr=e=>Zn(e)&&!Object.keys(e).length,$E=e=>e.type==="file",ko=e=>typeof e=="function",ey=e=>{if(!NE)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},WL=e=>e.type==="select-multiple",PE=e=>e.type==="radio",Bue=e=>PE(e)||$p(e),RS=e=>ey(e)&&e.isConnected;function Hue(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=nn(e)?r++:e[t[r++]];return e}function que(e){for(const t in e)if(e.hasOwnProperty(t)&&!nn(e[t]))return!1;return!0}function $n(e,t){const n=Array.isArray(t)?t:jb(t)?[t]:TE(t),r=n.length===1?e:Hue(e,n),i=n.length-1,o=n[i];return r&&delete r[o],i!==0&&(Zn(r)&&Pr(r)||Array.isArray(r)&&que(r))&&$n(e,n.slice(0,-1)),e}var Gue=e=>{for(const t in e)if(ko(e[t]))return!0;return!1};function XL(e){return Array.isArray(e)||Zn(e)&&!Gue(e)}function y1(e,t={}){for(const n in e)XL(e[n])?(t[n]=Array.isArray(e[n])?[]:{},y1(e[n],t[n])):nn(e[n])||(t[n]=!0);return t}function Bu(e,t,n){n||(n=y1(t));for(const r in e)XL(e[r])?nn(t)||v1(n[r])?n[r]=y1(e[r],Array.isArray(e[r])?[]:{}):Bu(e[r],ai(t)?{}:t[r],n[r]):n[r]=!Ua(e[r],t[r]);return n}const AD={value:!1,isValid:!1},OD={value:!0,isValid:!0};var QL=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&&!nn(e[0].attributes.value)?nn(e[0].value)||e[0].value===""?OD:{value:e[0].value,isValid:!0}:OD:AD}return AD},JL=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>nn(e)?e:t?e===""?NaN:e&&+e:n&&ji(e)?new Date(e):r?r(e):e;const DD={isValid:!1,value:null};var eU=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,DD):DD;function $D(e){const t=e.ref;return $E(t)?t.files:PE(t)?eU(e.refs).value:WL(t)?[...t.selectedOptions].map(({value:n})=>n):$p(t)?QL(e.refs).value:JL(nn(t.value)?e.ref.value:t.value,e)}var Kue=(e,t,n,r)=>{const i={};for(const o of e){const a=Ne(t,o);a&&zt(i,o,a._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},ty=e=>e instanceof RegExp,pm=e=>nn(e)?e:ty(e)?e.source:Zn(e)?ty(e.value)?e.value.source:e.value:e,Zu=e=>({isOnSubmit:!e||e===oo.onSubmit,isOnBlur:e===oo.onBlur,isOnChange:e===oo.onChange,isOnAll:e===oo.all,isOnTouch:e===oo.onTouched});const PD="AsyncFunction";var Zue=e=>!!e&&!!e.validate&&!!(ko(e.validate)&&e.validate.constructor.name===PD||Zn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===PD)),Yue=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),b1=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const rd=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const o=Ne(e,i);if(o){const{_f:a,...c}=o;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],i)&&!r)return!0;if(a.ref&&t(a.ref,a.name)&&!r)return!0;if(rd(c,t))break}else if(Zn(c)&&rd(c,t))break}}};function MD(e,t,n){const r=Ne(e,n);if(r||jb(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),a=Ne(t,o),c=Ne(e,o);if(a&&!Array.isArray(a)&&n!==o)return{name:n};if(c&&c.type)return{name:o,error:c};if(c&&c.root&&c.root.type)return{name:`${o}.root`,error:c.root};i.pop()}return{name:n}}var Wue=(e,t,n,r)=>{n(e);const{name:i,...o}=e;return Pr(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!r||oo.all))},Xue=(e,t,n)=>!e||!t||e===t||ci(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),Que=(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,Jue=(e,t)=>!Rb(Ne(e,t)).length&&$n(e,t),tU=(e,t,n)=>{const r=ci(Ne(e,n));return zt(r,"root",t[n]),zt(e,n,r),e};function zD(e,t,n="validate"){if(ji(e)||Array.isArray(e)&&e.every(ji)||Ci(e)&&!e)return{type:n,message:ji(e)?e:"",ref:t}}var $u=e=>Zn(e)&&!ty(e)?e:{value:e,message:""},x1=async(e,t,n,r,i,o)=>{const{ref:a,refs:c,required:d,maxLength:f,minLength:p,min:h,max:v,pattern:y,validate:b,name:S,valueAsNumber:C,mount:E}=e._f,k=Ne(n,S);if(!E||t.has(S))return{};const j=c?c[0]:a,I=Z=>{i&&j.reportValidity&&(j.setCustomValidity(Ci(Z)?"":Z||""),j.reportValidity())},A={},N=PE(a),T=$p(a),z=N||T,L=(C||$E(a))&&nn(a.value)&&nn(k)||ey(a)&&a.value===""||k===""||Array.isArray(k)&&!k.length,G=DE.bind(null,S,r,A),J=(Z,W,F,Y=$a.maxLength,P=$a.minLength)=>{const K=Z?W:F;A[S]={type:Z?Y:P,message:K,ref:a,...G(Z?Y:P,K)}};if(o?!Array.isArray(k)||!k.length:d&&(!z&&(L||ai(k))||Ci(k)&&!k||T&&!QL(c).isValid||N&&!eU(c).isValid)){const{value:Z,message:W}=ji(d)?{value:!!d,message:d}:$u(d);if(Z&&(A[S]={type:$a.required,message:W,ref:j,...G($a.required,W)},!r))return I(W),A}if(!L&&(!ai(h)||!ai(v))){let Z,W;const F=$u(v),Y=$u(h);if(!ai(k)&&!isNaN(k)){const P=a.valueAsNumber||k&&+k;ai(F.value)||(Z=P>F.value),ai(Y.value)||(W=P<Y.value)}else{const P=a.valueAsDate||new Date(k),K=D=>new Date(new Date().toDateString()+" "+D),U=a.type=="time",te=a.type=="week";ji(F.value)&&k&&(Z=U?K(k)>K(F.value):te?k>F.value:P>new Date(F.value)),ji(Y.value)&&k&&(W=U?K(k)<K(Y.value):te?k<Y.value:P<new Date(Y.value))}if((Z||W)&&(J(!!Z,F.message,Y.message,$a.max,$a.min),!r))return I(A[S].message),A}if((f||p)&&!L&&(ji(k)||o&&Array.isArray(k))){const Z=$u(f),W=$u(p),F=!ai(Z.value)&&k.length>+Z.value,Y=!ai(W.value)&&k.length<+W.value;if((F||Y)&&(J(F,Z.message,W.message),!r))return I(A[S].message),A}if(y&&!L&&ji(k)){const{value:Z,message:W}=$u(y);if(ty(Z)&&!k.match(Z)&&(A[S]={type:$a.pattern,message:W,ref:a,...G($a.pattern,W)},!r))return I(W),A}if(b){if(ko(b)){const Z=await b(k,n),W=zD(Z,j);if(W&&(A[S]={...W,...G($a.validate,W.message)},!r))return I(W.message),A}else if(Zn(b)){let Z={};for(const W in b){if(!Pr(Z)&&!r)break;const F=zD(await b[W](k,n),j,W);F&&(Z={...F,...G(W,F.message)},I(F.message),r&&(A[S]=Z))}if(!Pr(Z)&&(A[S]={ref:j,...Z},!r))return A}}return I(!0),A};const ede={mode:oo.onSubmit,reValidateMode:oo.onChange,shouldFocusError:!0};function tde(e={}){let t={...ede,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:ko(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=Zn(t.defaultValues)||Zn(t.values)?dn(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:dn(i),a={action:!1,mount:!1,watch:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},d,f=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let h={...p};const v={array:TD(),state:TD()},y=t.criteriaMode===oo.all,b=q=>oe=>{clearTimeout(f),f=setTimeout(q,oe)},S=async q=>{if(!t.disabled&&(p.isValid||h.isValid||q)){const oe=t.resolver?Pr((await T()).errors):await L(r,!0);oe!==n.isValid&&v.state.next({isValid:oe})}},C=(q,oe)=>{!t.disabled&&(p.isValidating||p.validatingFields||h.isValidating||h.validatingFields)&&((q||Array.from(c.mount)).forEach(de=>{de&&(oe?zt(n.validatingFields,de,oe):$n(n.validatingFields,de))}),v.state.next({validatingFields:n.validatingFields,isValidating:!Pr(n.validatingFields)}))},E=(q,oe=[],de,we,ve=!0,Ee=!0)=>{if(we&&de&&!t.disabled){if(a.action=!0,Ee&&Array.isArray(Ne(r,q))){const ne=de(Ne(r,q),we.argA,we.argB);ve&&zt(r,q,ne)}if(Ee&&Array.isArray(Ne(n.errors,q))){const ne=de(Ne(n.errors,q),we.argA,we.argB);ve&&zt(n.errors,q,ne),Jue(n.errors,q)}if((p.touchedFields||h.touchedFields)&&Ee&&Array.isArray(Ne(n.touchedFields,q))){const ne=de(Ne(n.touchedFields,q),we.argA,we.argB);ve&&zt(n.touchedFields,q,ne)}(p.dirtyFields||h.dirtyFields)&&(n.dirtyFields=Bu(i,o)),v.state.next({name:q,isDirty:J(q,oe),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else zt(o,q,oe)},k=(q,oe)=>{zt(n.errors,q,oe),v.state.next({errors:n.errors})},j=q=>{n.errors=q,v.state.next({errors:n.errors,isValid:!1})},I=(q,oe,de,we)=>{const ve=Ne(r,q);if(ve){const Ee=Ne(o,q,nn(de)?Ne(i,q):de);nn(Ee)||we&&we.defaultChecked||oe?zt(o,q,oe?Ee:$D(ve._f)):F(q,Ee),a.mount&&S()}},A=(q,oe,de,we,ve)=>{let Ee=!1,ne=!1;const ye={name:q};if(!t.disabled){if(!de||we){(p.isDirty||h.isDirty)&&(ne=n.isDirty,n.isDirty=ye.isDirty=J(),Ee=ne!==ye.isDirty);const Te=Ua(Ne(i,q),oe);ne=!!Ne(n.dirtyFields,q),Te?$n(n.dirtyFields,q):zt(n.dirtyFields,q,!0),ye.dirtyFields=n.dirtyFields,Ee=Ee||(p.dirtyFields||h.dirtyFields)&&ne!==!Te}if(de){const Te=Ne(n.touchedFields,q);Te||(zt(n.touchedFields,q,de),ye.touchedFields=n.touchedFields,Ee=Ee||(p.touchedFields||h.touchedFields)&&Te!==de)}Ee&&ve&&v.state.next(ye)}return Ee?ye:{}},N=(q,oe,de,we)=>{const ve=Ne(n.errors,q),Ee=(p.isValid||h.isValid)&&Ci(oe)&&n.isValid!==oe;if(t.delayError&&de?(d=b(()=>k(q,de)),d(t.delayError)):(clearTimeout(f),d=null,de?zt(n.errors,q,de):$n(n.errors,q)),(de?!Ua(ve,de):ve)||!Pr(we)||Ee){const ne={...we,...Ee&&Ci(oe)?{isValid:oe}:{},errors:n.errors,name:q};n={...n,...ne},v.state.next(ne)}},T=async q=>{C(q,!0);const oe=await t.resolver(o,t.context,Kue(q||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return C(q),oe},z=async q=>{const{errors:oe}=await T(q);if(q)for(const de of q){const we=Ne(oe,de);we?zt(n.errors,de,we):$n(n.errors,de)}else n.errors=oe;return oe},L=async(q,oe,de={valid:!0})=>{for(const we in q){const ve=q[we];if(ve){const{_f:Ee,...ne}=ve;if(Ee){const ye=c.array.has(Ee.name),Te=ve._f&&Zue(ve._f);Te&&p.validatingFields&&C([Ee.name],!0);const Ze=await x1(ve,c.disabled,o,y,t.shouldUseNativeValidation&&!oe,ye);if(Te&&p.validatingFields&&C([Ee.name]),Ze[Ee.name]&&(de.valid=!1,oe))break;!oe&&(Ne(Ze,Ee.name)?ye?tU(n.errors,Ze,Ee.name):zt(n.errors,Ee.name,Ze[Ee.name]):$n(n.errors,Ee.name))}!Pr(ne)&&await L(ne,oe,de)}}return de.valid},G=()=>{for(const q of c.unMount){const oe=Ne(r,q);oe&&(oe._f.refs?oe._f.refs.every(de=>!RS(de)):!RS(oe._f.ref))&&B(q)}c.unMount=new Set},J=(q,oe)=>!t.disabled&&(q&&oe&&zt(o,q,oe),!Ua(D(),i)),Z=(q,oe,de)=>ZL(q,c,{...a.mount?o:nn(oe)?i:ji(q)?{[q]:oe}:oe},de,oe),W=q=>Rb(Ne(a.mount?o:i,q,t.shouldUnregister?Ne(i,q,[]):[])),F=(q,oe,de={})=>{const we=Ne(r,q);let ve=oe;if(we){const Ee=we._f;Ee&&(!Ee.disabled&&zt(o,q,JL(oe,Ee)),ve=ey(Ee.ref)&&ai(oe)?"":oe,WL(Ee.ref)?[...Ee.ref.options].forEach(ne=>ne.selected=ve.includes(ne.value)):Ee.refs?$p(Ee.ref)?Ee.refs.forEach(ne=>{(!ne.defaultChecked||!ne.disabled)&&(Array.isArray(ve)?ne.checked=!!ve.find(ye=>ye===ne.value):ne.checked=ve===ne.value||!!ve)}):Ee.refs.forEach(ne=>ne.checked=ne.value===ve):$E(Ee.ref)?Ee.ref.value="":(Ee.ref.value=ve,Ee.ref.type||v.state.next({name:q,values:dn(o)})))}(de.shouldDirty||de.shouldTouch)&&A(q,ve,de.shouldTouch,de.shouldDirty,!0),de.shouldValidate&&te(q)},Y=(q,oe,de)=>{for(const we in oe){if(!oe.hasOwnProperty(we))return;const ve=oe[we],Ee=q+"."+we,ne=Ne(r,Ee);(c.array.has(q)||Zn(ve)||ne&&!ne._f)&&!Wl(ve)?Y(Ee,ve,de):F(Ee,ve,de)}},P=(q,oe,de={})=>{const we=Ne(r,q),ve=c.array.has(q),Ee=dn(oe);zt(o,q,Ee),ve?(v.array.next({name:q,values:dn(o)}),(p.isDirty||p.dirtyFields||h.isDirty||h.dirtyFields)&&de.shouldDirty&&v.state.next({name:q,dirtyFields:Bu(i,o),isDirty:J(q,Ee)})):we&&!we._f&&!ai(Ee)?Y(q,Ee,de):F(q,Ee,de),b1(q,c)&&v.state.next({...n,name:q}),v.state.next({name:a.mount?q:void 0,values:dn(o)})},K=async q=>{a.mount=!0;const oe=q.target;let de=oe.name,we=!0;const ve=Ne(r,de),Ee=Te=>{we=Number.isNaN(Te)||Wl(Te)&&isNaN(Te.getTime())||Ua(Te,Ne(o,de,Te))},ne=Zu(t.mode),ye=Zu(t.reValidateMode);if(ve){let Te,Ze;const st=oe.type?$D(ve._f):qL(q),qt=q.type===Jv.BLUR||q.type===Jv.FOCUS_OUT,Vn=!Yue(ve._f)&&!t.resolver&&!Ne(n.errors,de)&&!ve._f.deps||Que(qt,Ne(n.touchedFields,de),n.isSubmitted,ye,ne),xn=b1(de,c,qt);zt(o,de,st),qt?(!oe||!oe.readOnly)&&(ve._f.onBlur&&ve._f.onBlur(q),d&&d(0)):ve._f.onChange&&ve._f.onChange(q);const Yt=A(de,st,qt),_t=!Pr(Yt)||xn;if(!qt&&v.state.next({name:de,type:q.type,values:dn(o)}),Vn)return(p.isValid||h.isValid)&&(t.mode==="onBlur"?qt&&S():qt||S()),_t&&v.state.next({name:de,...xn?{}:Yt});if(!qt&&xn&&v.state.next({...n}),t.resolver){const{errors:yt}=await T([de]);if(Ee(st),we){const Gr=MD(n.errors,r,de),or=MD(yt,r,Gr.name||de);Te=or.error,de=or.name,Ze=Pr(yt)}}else C([de],!0),Te=(await x1(ve,c.disabled,o,y,t.shouldUseNativeValidation))[de],C([de]),Ee(st),we&&(Te?Ze=!1:(p.isValid||h.isValid)&&(Ze=await L(r,!0)));we&&(ve._f.deps&&(!Array.isArray(ve._f.deps)||ve._f.deps.length>0)&&te(ve._f.deps),N(de,Ze,Te,Yt))}},U=(q,oe)=>{if(Ne(n.errors,oe)&&q.focus)return q.focus(),1},te=async(q,oe={})=>{let de,we;const ve=ci(q);if(t.resolver){const Ee=await z(nn(q)?q:ve);de=Pr(Ee),we=q?!ve.some(ne=>Ne(Ee,ne)):de}else q?(we=(await Promise.all(ve.map(async Ee=>{const ne=Ne(r,Ee);return await L(ne&&ne._f?{[Ee]:ne}:ne)}))).every(Boolean),!(!we&&!n.isValid)&&S()):we=de=await L(r);return v.state.next({...!ji(q)||(p.isValid||h.isValid)&&de!==n.isValid?{}:{name:q},...t.resolver||!q?{isValid:de}:{},errors:n.errors}),oe.shouldFocus&&!we&&rd(r,U,q?ve:c.mount),we},D=(q,oe)=>{let de={...a.mount?o:i};return oe&&(de=YL(oe.dirtyFields?n.dirtyFields:n.touchedFields,de)),nn(q)?de:ji(q)?Ne(de,q):q.map(we=>Ne(de,we))},M=(q,oe)=>({invalid:!!Ne((oe||n).errors,q),isDirty:!!Ne((oe||n).dirtyFields,q),error:Ne((oe||n).errors,q),isValidating:!!Ne(n.validatingFields,q),isTouched:!!Ne((oe||n).touchedFields,q)}),V=q=>{q&&ci(q).forEach(oe=>$n(n.errors,oe)),v.state.next({errors:q?n.errors:{}})},O=(q,oe,de)=>{const we=(Ne(r,q,{_f:{}})._f||{}).ref,ve=Ne(n.errors,q)||{},{ref:Ee,message:ne,type:ye,...Te}=ve;zt(n.errors,q,{...Te,...oe,ref:we}),v.state.next({name:q,errors:n.errors,isValid:!1}),de&&de.shouldFocus&&we&&we.focus&&we.focus()},ee=(q,oe)=>ko(q)?v.state.subscribe({next:de=>"values"in de&&q(Z(void 0,oe),de)}):Z(q,oe,!0),ue=q=>v.state.subscribe({next:oe=>{Xue(q.name,oe.name,q.exact)&&Wue(oe,q.formState||p,Fn,q.reRenderRoot)&&q.callback({values:{...o},...n,...oe,defaultValues:i})}}).unsubscribe,pe=q=>(a.mount=!0,h={...h,...q.formState},ue({...q,formState:h})),B=(q,oe={})=>{for(const de of q?ci(q):c.mount)c.mount.delete(de),c.array.delete(de),oe.keepValue||($n(r,de),$n(o,de)),!oe.keepError&&$n(n.errors,de),!oe.keepDirty&&$n(n.dirtyFields,de),!oe.keepTouched&&$n(n.touchedFields,de),!oe.keepIsValidating&&$n(n.validatingFields,de),!t.shouldUnregister&&!oe.keepDefaultValue&&$n(i,de);v.state.next({values:dn(o)}),v.state.next({...n,...oe.keepDirty?{isDirty:J()}:{}}),!oe.keepIsValid&&S()},ie=({disabled:q,name:oe})=>{(Ci(q)&&a.mount||q||c.disabled.has(oe))&&(q?c.disabled.add(oe):c.disabled.delete(oe))},Se=(q,oe={})=>{let de=Ne(r,q);const we=Ci(oe.disabled)||Ci(t.disabled);return zt(r,q,{...de||{},_f:{...de&&de._f?de._f:{ref:{name:q}},name:q,mount:!0,...oe}}),c.mount.add(q),de?ie({disabled:Ci(oe.disabled)?oe.disabled:t.disabled,name:q}):I(q,!0,oe.value),{...we?{disabled:oe.disabled||t.disabled}:{},...t.progressive?{required:!!oe.required,min:pm(oe.min),max:pm(oe.max),minLength:pm(oe.minLength),maxLength:pm(oe.maxLength),pattern:pm(oe.pattern)}:{},name:q,onChange:K,onBlur:K,ref:ve=>{if(ve){Se(q,oe),de=Ne(r,q);const Ee=nn(ve.value)&&ve.querySelectorAll&&ve.querySelectorAll("input,select,textarea")[0]||ve,ne=Bue(Ee),ye=de._f.refs||[];if(ne?ye.find(Te=>Te===Ee):Ee===de._f.ref)return;zt(r,q,{_f:{...de._f,...ne?{refs:[...ye.filter(RS),Ee,...Array.isArray(Ne(i,q))?[{}]:[]],ref:{type:Ee.type,name:q}}:{ref:Ee}}}),I(q,!1,void 0,Ee)}else de=Ne(r,q,{}),de._f&&(de._f.mount=!1),(t.shouldUnregister||oe.shouldUnregister)&&!(GL(c.array,q)&&a.action)&&c.unMount.add(q)}}},Ie=()=>t.shouldFocusError&&rd(r,U,c.mount),Fe=q=>{Ci(q)&&(v.state.next({disabled:q}),rd(r,(oe,de)=>{const we=Ne(r,de);we&&(oe.disabled=we._f.disabled||q,Array.isArray(we._f.refs)&&we._f.refs.forEach(ve=>{ve.disabled=we._f.disabled||q}))},0,!1))},Ue=(q,oe)=>async de=>{let we;de&&(de.preventDefault&&de.preventDefault(),de.persist&&de.persist());let ve=dn(o);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:Ee,values:ne}=await T();n.errors=Ee,ve=dn(ne)}else await L(r);if(c.disabled.size)for(const Ee of c.disabled)$n(ve,Ee);if($n(n.errors,"root"),Pr(n.errors)){v.state.next({errors:{}});try{await q(ve,de)}catch(Ee){we=Ee}}else oe&&await oe({...n.errors},de),Ie(),setTimeout(Ie);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Pr(n.errors)&&!we,submitCount:n.submitCount+1,errors:n.errors}),we)throw we},Ye=(q,oe={})=>{Ne(r,q)&&(nn(oe.defaultValue)?P(q,dn(Ne(i,q))):(P(q,oe.defaultValue),zt(i,q,dn(oe.defaultValue))),oe.keepTouched||$n(n.touchedFields,q),oe.keepDirty||($n(n.dirtyFields,q),n.isDirty=oe.defaultValue?J(q,dn(Ne(i,q))):J()),oe.keepError||($n(n.errors,q),p.isValid&&S()),v.state.next({...n}))},St=(q,oe={})=>{const de=q?dn(q):i,we=dn(de),ve=Pr(q),Ee=ve?i:we;if(oe.keepDefaultValues||(i=de),!oe.keepValues){if(oe.keepDirtyValues){const ne=new Set([...c.mount,...Object.keys(Bu(i,o))]);for(const ye of Array.from(ne))Ne(n.dirtyFields,ye)?zt(Ee,ye,Ne(o,ye)):P(ye,Ne(Ee,ye))}else{if(NE&&nn(q))for(const ne of c.mount){const ye=Ne(r,ne);if(ye&&ye._f){const Te=Array.isArray(ye._f.refs)?ye._f.refs[0]:ye._f.ref;if(ey(Te)){const Ze=Te.closest("form");if(Ze){Ze.reset();break}}}}if(oe.keepFieldsRef)for(const ne of c.mount)P(ne,Ne(Ee,ne));else r={}}o=t.shouldUnregister?oe.keepDefaultValues?dn(i):{}:dn(Ee),v.array.next({values:{...Ee}}),v.state.next({values:{...Ee}})}c={mount:oe.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!p.isValid||!!oe.keepIsValid||!!oe.keepDirtyValues,a.watch=!!t.shouldUnregister,v.state.next({submitCount:oe.keepSubmitCount?n.submitCount:0,isDirty:ve?!1:oe.keepDirty?n.isDirty:!!(oe.keepDefaultValues&&!Ua(q,i)),isSubmitted:oe.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ve?{}:oe.keepDirtyValues?oe.keepDefaultValues&&o?Bu(i,o):n.dirtyFields:oe.keepDefaultValues&&q?Bu(i,q):oe.keepDirty?n.dirtyFields:{},touchedFields:oe.keepTouched?n.touchedFields:{},errors:oe.keepErrors?n.errors:{},isSubmitSuccessful:oe.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},gn=(q,oe)=>St(ko(q)?q(o):q,oe),Tn=(q,oe={})=>{const de=Ne(r,q),we=de&&de._f;if(we){const ve=we.refs?we.refs[0]:we.ref;ve.focus&&(ve.focus(),oe.shouldSelect&&ko(ve.select)&&ve.select())}},Fn=q=>{n={...n,...q}},en={control:{register:Se,unregister:B,getFieldState:M,handleSubmit:Ue,setError:O,_subscribe:ue,_runSchema:T,_focusError:Ie,_getWatch:Z,_getDirty:J,_setValid:S,_setFieldArray:E,_setDisabledField:ie,_setErrors:j,_getFieldArray:W,_reset:St,_resetDefaultValues:()=>ko(t.defaultValues)&&t.defaultValues().then(q=>{gn(q,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:G,_disableForm:Fe,_subjects:v,_proxyFormState:p,get _fields(){return r},get _formValues(){return o},get _state(){return a},set _state(q){a=q},get _defaultValues(){return i},get _names(){return c},set _names(q){c=q},get _formState(){return n},get _options(){return t},set _options(q){t={...t,...q}}},subscribe:pe,trigger:te,register:Se,handleSubmit:Ue,watch:ee,setValue:P,getValues:D,reset:gn,resetField:Ye,clearErrors:V,unregister:B,setError:O,setFocus:Tn,getFieldState:M};return{...en,formControl:en}}var Ns=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},IS=(e,t,n={})=>n.shouldFocus||nn(n.shouldFocus)?n.focusName||`${e}.${nn(n.focusIndex)?t:n.focusIndex}.`:"",NS=(e,t)=>[...e,...ci(t)],TS=e=>Array.isArray(e)?e.map(()=>{}):void 0;function AS(e,t,n){return[...e.slice(0,t),...ci(n),...e.slice(t)]}var OS=(e,t,n)=>Array.isArray(e)?(nn(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],DS=(e,t)=>[...ci(t),...ci(e)];function nde(e,t){let n=0;const r=[...e];for(const i of t)r.splice(i-n,1),n++;return Rb(r).length?r:[]}var $S=(e,t)=>nn(t)?[]:nde(e,ci(t).sort((n,r)=>n-r)),PS=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},LD=(e,t,n)=>(e[t]=n,e);function nU(e){const t=Pp(),{control:n=t.control,name:r,keyName:i="id",shouldUnregister:o,rules:a}=e,[c,d]=X.useState(n._getFieldArray(r)),f=X.useRef(n._getFieldArray(r).map(Ns)),p=X.useRef(!1);n._names.array.add(r),X.useMemo(()=>a&&c.length>=0&&n.register(r,a),[n,r,c.length,a]),Ib(()=>n._subjects.array.subscribe({next:({values:I,name:A})=>{if(A===r||!A){const N=Ne(I,r);Array.isArray(N)&&(d(N),f.current=N.map(Ns))}}}).unsubscribe,[n,r]);const h=X.useCallback(I=>{p.current=!0,n._setFieldArray(r,I)},[n,r]),v=(I,A)=>{const N=ci(dn(I)),T=NS(n._getFieldArray(r),N);n._names.focus=IS(r,T.length-1,A),f.current=NS(f.current,N.map(Ns)),h(T),d(T),n._setFieldArray(r,T,NS,{argA:TS(I)})},y=(I,A)=>{const N=ci(dn(I)),T=DS(n._getFieldArray(r),N);n._names.focus=IS(r,0,A),f.current=DS(f.current,N.map(Ns)),h(T),d(T),n._setFieldArray(r,T,DS,{argA:TS(I)})},b=I=>{const A=$S(n._getFieldArray(r),I);f.current=$S(f.current,I),h(A),d(A),!Array.isArray(Ne(n._fields,r))&&zt(n._fields,r,void 0),n._setFieldArray(r,A,$S,{argA:I})},S=(I,A,N)=>{const T=ci(dn(A)),z=AS(n._getFieldArray(r),I,T);n._names.focus=IS(r,I,N),f.current=AS(f.current,I,T.map(Ns)),h(z),d(z),n._setFieldArray(r,z,AS,{argA:I,argB:TS(A)})},C=(I,A)=>{const N=n._getFieldArray(r);PS(N,I,A),PS(f.current,I,A),h(N),d(N),n._setFieldArray(r,N,PS,{argA:I,argB:A},!1)},E=(I,A)=>{const N=n._getFieldArray(r);OS(N,I,A),OS(f.current,I,A),h(N),d(N),n._setFieldArray(r,N,OS,{argA:I,argB:A},!1)},k=(I,A)=>{const N=dn(A),T=LD(n._getFieldArray(r),I,N);f.current=[...T].map((z,L)=>!z||L===I?Ns():f.current[L]),h(T),d([...T]),n._setFieldArray(r,T,LD,{argA:I,argB:N},!0,!1)},j=I=>{const A=ci(dn(I));f.current=A.map(Ns),h([...A]),d([...A]),n._setFieldArray(r,[...A],N=>N,{},!0,!1)};return X.useEffect(()=>{if(n._state.action=!1,b1(r,n._names)&&n._subjects.state.next({...n._formState}),p.current&&(!Zu(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!Zu(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([r]).then(I=>{const A=Ne(I.errors,r),N=Ne(n._formState.errors,r);(N?!A&&N.type||A&&(N.type!==A.type||N.message!==A.message):A&&A.type)&&(A?zt(n._formState.errors,r,A):$n(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const I=Ne(n._fields,r);I&&I._f&&!(Zu(n._options.reValidateMode).isOnSubmit&&Zu(n._options.mode).isOnSubmit)&&x1(I,n._names.disabled,n._formValues,n._options.criteriaMode===oo.all,n._options.shouldUseNativeValidation,!0).then(A=>!Pr(A)&&n._subjects.state.next({errors:tU(n._formState.errors,A,r)}))}n._subjects.state.next({name:r,values:dn(n._formValues)}),n._names.focus&&rd(n._fields,(I,A)=>{if(n._names.focus&&A.startsWith(n._names.focus)&&I.focus)return I.focus(),1}),n._names.focus="",n._setValid(),p.current=!1},[c,r,n]),X.useEffect(()=>(!Ne(n._formValues,r)&&n._setFieldArray(r),()=>{const I=(A,N)=>{const T=Ne(n._fields,A);T&&T._f&&(T._f.mount=N)};n._options.shouldUnregister||o?n.unregister(r):I(r,!1)}),[r,n,i,o]),{swap:X.useCallback(C,[h,r,n]),move:X.useCallback(E,[h,r,n]),prepend:X.useCallback(y,[h,r,n]),append:X.useCallback(v,[h,r,n]),remove:X.useCallback(b,[h,r,n]),insert:X.useCallback(S,[h,r,n]),update:X.useCallback(k,[h,r,n]),replace:X.useCallback(j,[h,r,n]),fields:X.useMemo(()=>c.map((I,A)=>({...I,[i]:f.current[A]||Ns()})),[c,i])}}function Xt(e={}){const t=X.useRef(void 0),n=X.useRef(void 0),[r,i]=X.useState({isDirty:!1,isValidating:!1,isLoading:ko(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:ko(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!ko(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...c}=tde(e);t.current={...c,formState:r}}const o=t.current.control;return o._options=e,Ib(()=>{const a=o._subscribe({formState:o._proxyFormState,callback:()=>i({...o._formState}),reRenderRoot:!0});return i(c=>({...c,isReady:!0})),o._formState.isReady=!0,a},[o]),X.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),X.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),X.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),X.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),X.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==r.isDirty&&o._subjects.state.next({isDirty:a})}},[o,r.isDirty]),X.useEffect(()=>{e.values&&!Ua(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),n.current=e.values,i(a=>({...a}))):o._resetDefaultValues()},[o,e.values]),X.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=KL(r,o),t.current}const Qt=Lue,rU=x.createContext({}),iU=x.createContext({});function Nb(){const e=x.useContext(rU),t=x.useContext(iU),{getFieldState:n}=Pp(),r=OE({name:e.name}),i=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...i}}function $e({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:i}=Nb();return u.jsx(OC,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${i}`:`${r}`,"aria-invalid":!!t,...e})}function Pe({...e}){return u.jsx(rU,{value:{name:e.name},children:u.jsx(Vue,{...e})})}function Ae({className:e,...t}){const n=x.useId();return u.jsx(iU,{value:{id:n},children:u.jsx("div",{"data-slot":"form-item",className:Me("grid gap-2",e),...t})})}var rde=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],oU=rde.reduce((e,t)=>{const n=SM(`Primitive.${t}`),r=x.forwardRef((i,o)=>{const{asChild:a,...c}=i,d=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(d,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),ide="Label",aU=x.forwardRef((e,t)=>u.jsx(oU.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));aU.displayName=ide;var ode=aU;function Mp({className:e,...t}){return u.jsx(ode,{"data-slot":"label",className:Me("text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function Oe({className:e,...t}){const{error:n,formItemId:r}=Nb();return u.jsx(Mp,{"data-slot":"form-label","data-error":!!n,className:Me("data-[error=true]:text-destructive",e),htmlFor:r,...t})}function De({className:e,...t}){const{error:n,formMessageId:r}=Nb(),i=n?String(n?.message):t.children;return i?u.jsx("p",{"data-slot":"form-message",id:r,className:Me("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:Me(`border-input file:text-foreground placeholder:text-muted-foreground selection:bg-purple
39
39
  selection:text-primary-foreground
40
40
  dark:aria-invalid:outline-destructive dark:aria-invalid:ring-destructive/50 ring-ring/10
41
41
  dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 aria-invalid:outline-destructive/60
@@ -124,7 +124,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
124
124
  monaco.config({ paths: { vs: '...' } })
125
125
 
126
126
  For more please check the link https://github.com/suren-atoyan/monaco-loader#config
127
- `},F2=Fwe(qwe)(cH),Gwe={config:Bwe},Kwe=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 uH(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],uH(e[n],t[n]))}),M2(M2({},e),t)}var Zwe={type:"cancelation",msg:"operation is manually canceled"};function n_(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(Zwe):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var Ywe=Lwe.create({config:Uwe,isInitialized:!1,resolve:null,reject:null,monaco:null}),dH=xwe(Ywe,2),ih=dH[0],hx=dH[1];function Wwe(e){var t=Gwe.config(e),n=t.monaco,r=bwe(t,["monaco"]);hx(function(i){return{config:uH(i.config,r),monaco:n}})}function Xwe(){var e=ih(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(hx({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),n_(r_);if(window.monaco&&window.monaco.editor)return fH(window.monaco),e.resolve(window.monaco),n_(r_);Kwe(Qwe,eSe)(tSe)}return n_(r_)}function Qwe(e){return document.body.appendChild(e)}function Jwe(e){var t=document.createElement("script");return e&&(t.src=e),t}function eSe(e){var t=ih(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=Jwe("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function tSe(){var e=ih(function(n){var r=n.config,i=n.resolve,o=n.reject;return{config:r,resolve:i,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){fH(n),e.resolve(n)},function(n){e.reject(n)})}function fH(e){ih().monaco||hx({monaco:e})}function nSe(){return ih(function(e){var t=e.monaco;return t})}var r_=new Promise(function(e,t){return hx({resolve:e,reject:t})}),mH={config:Wwe,init:Xwe,__getMonacoInstance:nSe},rSe={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},i_=rSe,iSe={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},oSe=iSe;function aSe({children:e}){return X.createElement("div",{style:oSe.container},e)}var sSe=aSe,lSe=sSe;function cSe({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:a}){return X.createElement("section",{style:{...i_.wrapper,width:e,height:t},...a},!n&&X.createElement(lSe,null,r),X.createElement("div",{ref:i,style:{...i_.fullWidth,...!n&&i_.hide},className:o}))}var uSe=cSe,pH=x.memo(uSe);function dSe(e){x.useEffect(e,[])}var hH=dSe;function fSe(e,t,n=!0){let r=x.useRef(!0);x.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Ei=fSe;function Um(){}function Yu(e,t,n,r){return mSe(e,r)||pSe(e,t,n,r)}function mSe(e,t){return e.editor.getModel(gH(e,t))}function pSe(e,t,n,r){return e.editor.createModel(t,n,r?gH(e,r):void 0)}function gH(e,t){return e.Uri.parse(t)}function hSe({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:a,keepCurrentOriginalModel:c=!1,keepCurrentModifiedModel:d=!1,theme:f="light",loading:p="Loading...",options:h={},height:v="100%",width:y="100%",className:b,wrapperProps:S={},beforeMount:C=Um,onMount:E=Um}){let[k,j]=x.useState(!1),[I,A]=x.useState(!0),N=x.useRef(null),T=x.useRef(null),z=x.useRef(null),L=x.useRef(E),G=x.useRef(C),J=x.useRef(!1);hH(()=>{let Y=mH.init();return Y.then(P=>(T.current=P)&&A(!1)).catch(P=>P?.type!=="cancelation"&&console.error("Monaco initialization: error:",P)),()=>N.current?F():Y.cancel()}),Ei(()=>{if(N.current&&T.current){let Y=N.current.getOriginalEditor(),P=Yu(T.current,e||"",r||n||"text",o||"");P!==Y.getModel()&&Y.setModel(P)}},[o],k),Ei(()=>{if(N.current&&T.current){let Y=N.current.getModifiedEditor(),P=Yu(T.current,t||"",i||n||"text",a||"");P!==Y.getModel()&&Y.setModel(P)}},[a],k),Ei(()=>{let Y=N.current.getModifiedEditor();Y.getOption(T.current.editor.EditorOption.readOnly)?Y.setValue(t||""):t!==Y.getValue()&&(Y.executeEdits("",[{range:Y.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),Y.pushUndoStop())},[t],k),Ei(()=>{N.current?.getModel()?.original.setValue(e||"")},[e],k),Ei(()=>{let{original:Y,modified:P}=N.current.getModel();T.current.editor.setModelLanguage(Y,r||n||"text"),T.current.editor.setModelLanguage(P,i||n||"text")},[n,r,i],k),Ei(()=>{T.current?.editor.setTheme(f)},[f],k),Ei(()=>{N.current?.updateOptions(h)},[h],k);let Z=x.useCallback(()=>{if(!T.current)return;G.current(T.current);let Y=Yu(T.current,e||"",r||n||"text",o||""),P=Yu(T.current,t||"",i||n||"text",a||"");N.current?.setModel({original:Y,modified:P})},[n,t,i,e,r,o,a]),W=x.useCallback(()=>{!J.current&&z.current&&(N.current=T.current.editor.createDiffEditor(z.current,{automaticLayout:!0,...h}),Z(),T.current?.editor.setTheme(f),j(!0),J.current=!0)},[h,f,Z]);x.useEffect(()=>{k&&L.current(N.current,T.current)},[k]),x.useEffect(()=>{!I&&!k&&W()},[I,k,W]);function F(){let Y=N.current?.getModel();c||Y?.original?.dispose(),d||Y?.modified?.dispose(),N.current?.dispose()}return X.createElement(pH,{width:y,height:v,isEditorReady:k,loading:p,_ref:z,className:b,wrapperProps:S})}var gSe=hSe;x.memo(gSe);function vSe(e){let t=x.useRef();return x.useEffect(()=>{t.current=e},[e]),t.current}var ySe=vSe,tv=new Map;function bSe({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:o,theme:a="light",line:c,loading:d="Loading...",options:f={},overrideServices:p={},saveViewState:h=!0,keepCurrentModel:v=!1,width:y="100%",height:b="100%",className:S,wrapperProps:C={},beforeMount:E=Um,onMount:k=Um,onChange:j,onValidate:I=Um}){let[A,N]=x.useState(!1),[T,z]=x.useState(!0),L=x.useRef(null),G=x.useRef(null),J=x.useRef(null),Z=x.useRef(k),W=x.useRef(E),F=x.useRef(),Y=x.useRef(r),P=ySe(o),K=x.useRef(!1),U=x.useRef(!1);hH(()=>{let M=mH.init();return M.then(V=>(L.current=V)&&z(!1)).catch(V=>V?.type!=="cancelation"&&console.error("Monaco initialization: error:",V)),()=>G.current?D():M.cancel()}),Ei(()=>{let M=Yu(L.current,e||r||"",t||i||"",o||n||"");M!==G.current?.getModel()&&(h&&tv.set(P,G.current?.saveViewState()),G.current?.setModel(M),h&&G.current?.restoreViewState(tv.get(o)))},[o],A),Ei(()=>{G.current?.updateOptions(f)},[f],A),Ei(()=>{!G.current||r===void 0||(G.current.getOption(L.current.editor.EditorOption.readOnly)?G.current.setValue(r):r!==G.current.getValue()&&(U.current=!0,G.current.executeEdits("",[{range:G.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),G.current.pushUndoStop(),U.current=!1))},[r],A),Ei(()=>{let M=G.current?.getModel();M&&i&&L.current?.editor.setModelLanguage(M,i)},[i],A),Ei(()=>{c!==void 0&&G.current?.revealLine(c)},[c],A),Ei(()=>{L.current?.editor.setTheme(a)},[a],A);let te=x.useCallback(()=>{if(!(!J.current||!L.current)&&!K.current){W.current(L.current);let M=o||n,V=Yu(L.current,r||e||"",t||i||"",M||"");G.current=L.current?.editor.create(J.current,{model:V,automaticLayout:!0,...f},p),h&&G.current.restoreViewState(tv.get(M)),L.current.editor.setTheme(a),c!==void 0&&G.current.revealLine(c),N(!0),K.current=!0}},[e,t,n,r,i,o,f,p,h,a,c]);x.useEffect(()=>{A&&Z.current(G.current,L.current)},[A]),x.useEffect(()=>{!T&&!A&&te()},[T,A,te]),Y.current=r,x.useEffect(()=>{A&&j&&(F.current?.dispose(),F.current=G.current?.onDidChangeModelContent(M=>{U.current||j(G.current.getValue(),M)}))},[A,j]),x.useEffect(()=>{if(A){let M=L.current.editor.onDidChangeMarkers(V=>{let O=G.current.getModel()?.uri;if(O&&V.find(ee=>ee.path===O.path)){let ee=L.current.editor.getModelMarkers({resource:O});I?.(ee)}});return()=>{M?.dispose()}}return()=>{}},[A,I]);function D(){F.current?.dispose(),v?h&&tv.set(o,G.current.saveViewState()):G.current.getModel()?.dispose(),G.current.dispose()}return X.createElement(pH,{width:y,height:b,isEditorReady:A,loading:d,_ref:J,className:S,wrapperProps:C})}var xSe=bSe,oh=x.memo(xSe),gx=oh;const V2={roles:{create:!0,view:!0,update:!0,delete:!0},clusters:{create:!0,view:!0,update:!0,delete:!0,resources:[]}};function wSe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const{organizationId:r}=tt({strict:!1}),[i,o]=x.useState(!0),[a,c]=x.useState(JSON.stringify(V2,null,2)),{mutate:d,isPending:f}=gwe(),p=Xt({resolver:sn(pwe),defaultValues:{roleName:"",updateOrganization:!1,deleteOrganization:!1}}),h=x.useCallback(y=>{o(y.length===0)},[o]),v=x.useCallback(async y=>{const b={organizationId:r,name:y.roleName,update:y.updateOrganization,delete:y.deleteOrganization,...JSON.parse(a)};y&&i&&d(b,{onSuccess:()=>{p.reset(),t(),_e.success("Organization role added successfully!")},onError:S=>{_e.error(`Failed to add organization role: ${S.message}`)}})},[i,a,d,p,t,r]);return u.jsx(zn,{onOpenChange:n,open:e,children:u.jsxs(Ln,{children:[u.jsx(Nn,{children:"Add New Organization Role"}),u.jsx(Ir,{children:"Set the new organization role permissions."}),u.jsx(Qt,{...p,children:u.jsxs("form",{className:"grid grid-cols-2 gap-4 my-4",onSubmit:p.handleSubmit(v),children:[u.jsx(Pe,{control:p.control,name:"roleName",render:({field:y})=>u.jsxs(Ae,{className:"col-span-2",children:[u.jsx(Oe,{className:"pb-1",children:"Role Name"}),u.jsx($e,{children:u.jsx(ze,{type:"text",placeholder:"Developer",className:"",...y})}),u.jsx(De,{})]})}),u.jsx(Pe,{control:p.control,name:"updateOrganization",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Can Update Organization"}),u.jsx($e,{children:u.jsx(ze,{type:"checkbox",className:"w-6 ml-2",checked:y.value,onChange:b=>y.onChange(b.target.checked)})}),u.jsx(De,{})]})}),u.jsx(Pe,{control:p.control,name:"deleteOrganization",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Can Delete Organization"}),u.jsx($e,{children:u.jsx(ze,{type:"checkbox",className:"w-6 ml-2",checked:y.value,onChange:b=>y.onChange(b.target.checked)})}),u.jsx(De,{})]})}),u.jsx("div",{className:"col-span-2",children:u.jsx(oh,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate:h,onChange:y=>{y&&c(y)},defaultValue:JSON.stringify(V2,null,2)})}),u.jsx(Un,{className:"col-span-2",children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx(be,{variant:"destructiveOutline",className:"rounded-full",type:"button",onClick:()=>n(!1),disabled:f,children:"Cancel"}),u.jsx(be,{variant:"submit",className:"rounded-full",disabled:f||!i,children:"Save Changes"})]})})]})})]})})}async function SSe({roleId:e}){const{data:t}=await Ut.delete(`/Role/${e}`,{id:e,deleted:!0});return t}function _Se(){return at({mutationFn:({roleId:e})=>SSe({roleId:e})})}const CSe=Er.object({roleName:Er.string().nonempty({error:"Please enter a role name."}).regex(/^[a-zA-Z_]*$/,{error:"Role must contain only letters and underscores."}).max(30,{error:"Role name cannot be longer than 30 characters."}),updateOrganization:Er.boolean(),deleteOrganization:Er.boolean()});async function ESe({roleId:e,updatedRoleInfo:t}){const{data:n}=await Ut.put(`/Role/${e}`,t);return n}function kSe(){return at({mutationFn:({roleId:e,updatedRoleInfo:t})=>ESe({roleId:e,updatedRoleInfo:t})})}function jSe({organizationId:e,roleId:t}){return{queryKey:[e,"roles",t],queryFn:()=>RSe(t),refetchInterval:10*1e3}}async function RSe(e){const{data:t}=await Ut.get(`/Role/${e}`);return t}const ISe=({onRoleDeleteClick:e,setIsConfirmingRoleDeletion:t,isRoleDeletionPending:n})=>u.jsxs(u.Fragment,{children:[u.jsx(Nn,{children:"Confirm Role Deletion"}),u.jsx(Ir,{children:"Are you sure you want to delete this role? This action cannot be undone."}),u.jsxs(Un,{children:[u.jsx(be,{type:"button",variant:"defaultOutline",className:"rounded-full",onClick:()=>t(!1),children:"Cancel"}),u.jsx(be,{variant:"destructiveOutline",className:"rounded-full",onClick:e,disabled:n,children:n?"Deleting...":"Delete Role"})]})]});function NSe({data:e,isModalOpen:t,closeModal:n,roleDeleted:r}){const{data:i}=Pi(jSe({roleId:e.id,organizationId:e.organizationId})),o=cl(),a=o.user&&o.user?.roles?.[e.organizationId]?.role===e.roleName,{update:c,remove:d}=Kd(e.organizationId),{mutate:f,isPending:p}=kSe(),{mutate:h,isPending:v}=_Se(),[y,b]=x.useState(!1),S=x.useCallback(()=>{h({roleId:e.id},{onSuccess:()=>{_e.success("Role deleted successfully!"),r(),n()},onError:T=>{_e.error("Error",{description:`Failed to delete role: ${T instanceof Error?T.message:String(T)}.`,action:{label:"Dismiss",onClick:()=>_e.dismiss()}})}})},[e.id,h,r,n]),[C,E]=x.useState(!0),[k,j]=x.useState(JSON.stringify({roles:{...i.organization.roles},clusters:{...i.organization.clusters}},null,2)),I=Xt({resolver:sn(CSe),defaultValues:{roleName:i.role,updateOrganization:i?.organization.update||!1,deleteOrganization:i?.organization.delete||!1}}),A=x.useCallback(T=>{E(T.length===0)},[E]),N=x.useCallback(async T=>{if(!c)return;const z={...i};z.organizationId=e.organizationId,z.name=T.roleName,z.role=T.roleName,z.organization.roles=JSON.parse(k).roles,z.organization.clusters=JSON.parse(k).clusters,z.organization.update=T.updateOrganization,z.organization.delete=T.deleteOrganization,k&&C&&f({roleId:e.id,updatedRoleInfo:z},{onSuccess:()=>{_e.success("Role updated successfully!"),n()},onError:L=>{_e.error("Error",{description:`Failed to update role: ${L instanceof Error?L.message:String(L)}.`,action:{label:"Dismiss",onClick:()=>_e.dismiss()}})}})},[c,i,e.organizationId,e.id,k,C,f,n]);return u.jsx(zn,{onOpenChange:n,open:t,children:u.jsx(Ln,{children:y?u.jsx(ISe,{onRoleDeleteClick:S,setIsConfirmingRoleDeletion:b,isRoleDeletionPending:v}):u.jsxs(u.Fragment,{children:[u.jsxs(Nn,{children:[a||!c?"View":"Edit",' Organization Role "',i.role,'"']}),u.jsx(Qt,{...I,children:u.jsxs("form",{className:"grid grid-cols-2 gap-4 my-4",onSubmit:I.handleSubmit(N),children:[u.jsx(Pe,{control:I.control,name:"roleName",render:({field:T})=>u.jsxs(Ae,{className:"col-span-2",children:[u.jsx(Oe,{className:"pb-1",children:"Role Name"}),u.jsx($e,{children:u.jsx(ze,{type:"text",placeholder:"Developer",className:"",...T,disabled:a||!c,readOnly:a||!c})}),u.jsx(De,{})]})}),u.jsx(Pe,{control:I.control,name:"updateOrganization",render:({field:T})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Can Update Organization"}),u.jsx($e,{children:u.jsx(ze,{type:"checkbox",className:"w-6 ml-2",disabled:a||!c,readOnly:a||!c,checked:T.value,onChange:z=>T.onChange(z.target.checked)})}),u.jsx(De,{})]})}),u.jsx(Pe,{control:I.control,name:"deleteOrganization",render:({field:T})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Can Delete Organization"}),u.jsx($e,{children:u.jsx(ze,{type:"checkbox",className:"w-6 ml-2",disabled:a||!c,readOnly:a||!c,checked:T.value,onChange:z=>T.onChange(z.target.checked)})}),u.jsx(De,{})]})}),u.jsx("div",{className:"col-span-2",children:u.jsx(oh,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate:A,onChange:T=>{T&&j(T)},options:a||!c?{readOnly:!0}:void 0,defaultValue:k})}),!a&&(d||c)&&u.jsx(Un,{className:"col-span-2",children:u.jsxs("div",{className:"flex justify-between w-full",children:[d&&u.jsx(be,{type:"button",variant:"destructiveOutline",className:"rounded-full",onClick:()=>b(!0),disabled:p,children:"Delete Role"}),c&&u.jsx(be,{variant:"submit",className:"rounded-full",disabled:!C||p,children:"Save Changes"})]})})]})})]})})})}function vH(){const e=pn(),{organizationId:t,orgRoleId:n}=tt({strict:!1}),{create:r}=Kd(t),{data:i,refetch:o,isFetching:a,isRefetching:c}=Pi(px(t)),d=x.useMemo(()=>i&&i?.find(j=>j.id===n),[i,n]),f=!!n&&!!d,[p,h]=x.useState(!1),v=x.useCallback(j=>{const I=[n?"..":"",j].filter(Boolean);e({to:I.join("/")})},[n,e]),y=x.useCallback(()=>{o(),h(!1)},[o,h]),b=x.useCallback(()=>{h(!0)},[h]),S=x.useCallback(()=>{o(),h(!1)},[o,h]),C=x.useCallback(j=>{v(j.original.id)},[v]),E=x.useCallback(()=>{v(void 0)},[v]),k=vl(o);return u.jsxs(u.Fragment,{children:[u.jsx(rs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs(x.Suspense,{fallback:u.jsx(Ui,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(af,{data:i,columns:mwe,onRowClick:C,children:[u.jsxs(be,{variant:"defaultOutline",onClick:k,accessKey:"r",disabled:a||c,children:[u.jsx(sa,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),r&&u.jsxs(be,{variant:"positiveOutline",onClick:b,accessKey:"a",disabled:p,children:[u.jsx(po,{}),u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),r&&u.jsx(wSe,{isModalOpen:p,onChangesSaved:S,setIsModalOpen:h}),f&&u.jsx(NSe,{roleDeleted:y,data:d,isModalOpen:f,closeModal:E})]})})]})}const TSe=lx(),ASe=[{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},TSe.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}],OSe=Er.object({email:ef.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:Er.string().nonempty({error:"Please select a role."})});async function DSe(e){const{data:t}=await Ut.post("/OrganizationRole/",e);return t}function yH(){return at({mutationFn:e=>DSe(e)})}Er.object({email:ef.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:Er.string().nonempty({error:"Please select a role."})});async function $Se(e){const{data:t}=await Ut.post("/UserInvite/",e);return t}function PSe(){return at({mutationFn:e=>$Se(e)})}function MSe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const{organizationId:r}=tt({strict:!1}),{data:i}=Pi(px(r)),[o,a]=x.useState(!1),c=Xt({resolver:sn(OSe),defaultValues:{email:"",roleId:""}}),{mutate:d,isPending:f}=yH(),{mutate:p,isPending:h}=PSe(),v=x.useCallback(async y=>{y&&(o?p:d)(y,{onSuccess:()=>{const b=y.roleId;c.reset(),c.setValue("roleId",b),t(),_e.success("User invited successfully!"),n(!1),a(!1)},onError:b=>{b?.status===404&&a(!0)}})},[d,c,p,t,n,o]);return u.jsx(zn,{onOpenChange:()=>{n(!1),a(!1),c.reset()},open:e,children:u.jsx(Ln,{"aria-describedby":void 0,children:u.jsx(Qt,{...c,children:u.jsxs("form",{onSubmit:c.handleSubmit(v),className:"grid gap-4 my-4",children:[u.jsx(xr,{children:u.jsx(Nn,{children:o?"Invite User":"Add User"})}),u.jsx(Pe,{control:c.control,name:"email",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Email"}),u.jsx($e,{children:u.jsx(ze,{type:"email",enterKeyHint:"next",autoComplete:"email",...y})}),u.jsx(De,{})]})}),u.jsx(Pe,{control:c.control,name:"roleId",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Roles"}),u.jsx(x.Suspense,{fallback:u.jsx(jr,{}),children:u.jsx($e,{children:u.jsxs(co,{...y,onValueChange:b=>y.onChange(b),children:[u.jsx(fo,{className:"w-full",children:u.jsx(uo,{placeholder:"Choose Role"})}),u.jsx(mo,{children:u.jsxs(Lo,{children:[u.jsx(qj,{children:"Role"}),i?.map(b=>u.jsx(Sn,{value:b.id,children:b.roleName},b.id))]})})]})})}),u.jsx(De,{})]})}),o&&u.jsxs(Ir,{className:"p-3 my-5 text-white rounded-md bg-amber-600 flex",children:[u.jsx(rQ,{className:"inline-block size-12 pr-2"}),u.jsx("span",{children:"This person doesn’t have a Fabric account. Do you want to invite them?"})]}),u.jsx(Un,{children:u.jsx("div",{className:"flex justify-between w-full",children:u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",disabled:f||h,children:[u.jsx(ho,{})," ",o?"Invite User":"Add User"]})})})]})})})})}async function zSe({roleId:e,userId:t}){const{data:n}=await Ut.delete(`/OrganizationRole/role/${e}/user/${t}`);return n}function LSe(){return at({mutationFn:({roleId:e,userId:t})=>zSe({roleId:e,userId:t})})}function bH(e){const[t,n]=x.useState(e||!1),r=x.useCallback(i=>{n(i.target.checked)},[]);return[t,r]}function USe({data:e,readOnly:t,canRemove:n,orgRole:r,selectedRoles:i,setChangesMade:o}){const{mutate:a,isPending:c}=yH(),{mutate:d,isPending:f}=LSe(),p=!!i[r.roleName],[h,v]=x.useState(p),[y,b]=bH(p);return x.useEffect(()=>{y!==h&&(y?a({email:e.email,roleId:r.id},{onSuccess:()=>{v(y),o(!0),_e.success("Role added successfully")}}):d({userId:e.id,roleId:r.id},{onSuccess:()=>{v(y),o(!0),_e.success("Role removed successfully")}}))},[a,e.email,e.id,y,r.id,d,o,h]),u.jsxs(Mp,{className:"flex",children:[u.jsx(ze,{type:"checkbox",className:"w-6",disabled:t||c||f||!n&&y,checked:y,onChange:b}),u.jsx("span",{className:"pl-4 pr-8 flex-1 py-2.5",children:r.roleName})]},r.id)}function FSe({closeModal:e,data:t,isModalOpen:n,onUserUpdated:r}){const{organizationId:i}=tt({strict:!1}),o=cl(),{update:a,remove:c}=Kd(i),d=o.user?.email===t.email,{data:f}=Pi(px(i)),p=x.useMemo(()=>t.roles?rf(t.roles,"roleName"):{},[t]),[h,v]=x.useState(!1);return u.jsx(zn,{onOpenChange:h?r:e,open:n,children:u.jsxs(Ln,{className:"sm:max-w-[750px]",children:[u.jsx(xr,{children:u.jsxs(Nn,{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(USe,{readOnly:!a,canRemove:c,data:t,orgRole:y,selectedRoles:p,setChangesMade:v},y.id))]})})}function VSe(e,t){return e.email>t.email?1:-1}function xH(){const e=pn(),{organizationId:t,orgUserId:n}=tt({strict:!1}),{update:r}=Kd(t),{data:i,refetch:o,isFetching:a,isRefetching:c}=Pi(px(t)),d=x.useMemo(()=>{const N={};for(const T of i)if(T.users)for(const z of T.users)N[z.id]||(N[z.id]={...z,roles:[]}),N[z.id].roles.push(T);return Object.values(N).sort(VSe)},[i]),f=x.useMemo(()=>d?.find(N=>N.id===n),[d,n]),p=x.useCallback(N=>{const T=[n?"..":"",N].filter(Boolean);e({to:T.join("/")})},[n,e]),h=!!n&&!!f,[v,y]=x.useState(!1),[b]=x.useState({attribute:"email",descending:!1}),S=x.useMemo(()=>[{desc:b.descending,id:b.attribute}],[b]),C=x.useCallback(()=>{y(!0)},[y]),E=x.useCallback(()=>{o(),y(!1)},[o,y]),k=x.useCallback(N=>{p(N.original.id)},[p]),j=x.useCallback(()=>{p(void 0)},[p]),I=x.useCallback(()=>{o(),p(void 0)},[p,o]),A=vl(o);return u.jsxs(u.Fragment,{children:[u.jsx(rs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs(x.Suspense,{fallback:u.jsx(Ui,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(af,{data:d,isFetching:a||c,columns:ASe,onRowClick:k,sortingState:S,children:[u.jsxs(be,{variant:"defaultOutline",onClick:A,accessKey:"r",disabled:a||c,children:[u.jsx(sa,{})," ",u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),r&&u.jsxs(be,{variant:"positiveOutline",onClick:C,accessKey:"a",disabled:v,children:[u.jsx(po,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),r&&u.jsx(MSe,{isModalOpen:v,onChangesSaved:E,setIsModalOpen:y}),h&&u.jsx(FSe,{closeModal:j,data:f,isModalOpen:h,onUserUpdated:I})]})})]})}function BSe({organizationRole:e,onDeleteOrgModal:t}){const{organizationId:n,organizationName:r,roleName:i}=e,{remove:o,update:a}=hb(n),c=a,{view:d}=Kd(n),f=x.useCallback(()=>{t(e)},[t,e]);return u.jsxs(fc,{className:"relative h-full justify-between",children:[u.jsxs(ul,{children:[u.jsxs(Cc,{className:"flex items-center justify-between",children:[u.jsx("span",{className:"truncate",children:n}),o&&u.jsxs(eh,{children:[u.jsx(th,{className:"p-4 -m-4 -mr-6 hover:text-white",children:u.jsx($C,{"aria-label":"Options"})}),u.jsxs(nh,{children:[u.jsx(vy,{className:"text-gray-600 text-xs",children:"Options"}),u.jsx(yy,{}),u.jsx(Ge,{to:`${n}`,children:u.jsx(gr,{children:"Clusters"})}),d&&u.jsx(Ge,{to:`${n}/roles`,children:u.jsx(gr,{children:"Roles"})}),d&&u.jsx(Ge,{to:`${n}/users`,children:u.jsx(gr,{children:"Users"})}),c&&u.jsx(Ge,{to:`${n}/billing`,children:u.jsx(gr,{children:"Billing"})}),u.jsx(yy,{}),o&&u.jsx(gr,{className:"focus:bg-red/70 focus:text-white",onClick:f,children:"Delete"})]})]})]}),u.jsx(dl,{children:u.jsx("h2",{children:r})})]}),u.jsxs(es,{className:"flex justify-between",children:[u.jsx(zo,{children:Eo(i)}),u.jsx(Ge,{to:n,className:"text-sm","aria-label":`View ${r}`,title:`View ${r}`,children:u.jsxs("span",{className:"py-2 transition-all duration-100 ease-in-out border-0 hover:border-b-2",children:["View ",u.jsx(ro,{className:"inline-block"})]})})]})]})}async function HSe(e){const{data:t}=await Ut.delete(`/Organization/${e}`);return t}function qSe(){return at({mutationFn:e=>HSe(e)})}async function GSe(e){const{data:t}=await Ut.post("/Organization/",{...e});return t}function KSe(){return at({mutationFn:e=>GSe(e)})}const nv=mn({name:nt().max(255,{error:"Name cannot be longer than 255 characters."}),subdomain:nt().max(62,{error:"The subdomain cannot be longer than 62 characters."}).regex(/^[a-zA-Z0-9-]*$/,{error:"Please only use letters, digits and dashes (-) in the subdomain."})});function ZSe(){const{user:e}=cl(),t=pn(),n=Xt({resolver:sn(nv),defaultValues:{name:"",subdomain:""}}),{setFocus:r,watch:i}=n;x.useEffect(()=>{r("name")},[r]);const o=`${e?.firstname} ${e?.lastname} Org`,a=i("name")||o,c=i("subdomain"),d=x.useMemo(()=>{const y=sB(ix(a),nv.shape.subdomain.maxLength);return{suggestedSubdomain:y,fullHostName:`future-cluster-names.${c||y}.harperfabric.com`}},[a,c]),{mutate:f,isPending:p}=KSe(),h=yr(),v=x.useCallback(async y=>{f({name:y.name||o,subdomain:y.subdomain||d.suggestedSubdomain},{onSuccess:b=>{h.invalidateQueries({queryKey:By,refetchType:"active"}),Tt.reloadUser(_n),t({to:`/${b.id}`})}})},[d.suggestedSubdomain,h,f,o,t]);return u.jsx(u.Fragment,{children:u.jsx(Qt,{...n,children:u.jsxs("form",{onSubmit:n.handleSubmit(v),className:"grid gap-6 text-white max-w-xl",children:[u.jsx(Pe,{control:n.control,name:"name",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Name"}),u.jsx($e,{children:u.jsx(ze,{type:"text",maxLength:nv.shape.name.maxLength,autoCapitalize:"words",placeholder:o,...y})}),u.jsx(De,{})]})}),u.jsx(Pe,{control:n.control,name:"subdomain",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Subdomain"}),u.jsx($e,{children:u.jsx(ze,{type:"text",maxLength:nv.shape.subdomain.maxLength,autoCapitalize:"none",placeholder:d.suggestedSubdomain,...y})}),u.jsx(De,{})]})}),u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Full Host Name"}),u.jsx($e,{children:u.jsx("span",{children:d.fullHostName})}),u.jsx(De,{})]}),u.jsx(Un,{children:u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",disabled:p,children:["Create New Organization ",u.jsx(ro,{})]})})]})})})}function wH(){return u.jsxs(u.Fragment,{children:[u.jsx(rs,{}),u.jsx("section",{className:"mt-40 md:mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx(ZSe,{})})]})}function YSe(){const e=yr(),{data:t}=Pi(eZ()),{mutate:n,isPending:r}=qSe(),[i,o]=x.useState(!1),[a,c]=x.useState(null),[d,f]=x.useState(""),p=x.useCallback(()=>f(""),[]),h=x.useMemo(()=>{const C=t?.roles||{},E=Object.values(C);return Object.keys(C).map((j,I)=>({organizationId:j,organizationName:E[I].organizationName,roleName:E[I].role})).filter(WB(["organizationId","organizationName"],d)).sort((j,I)=>(j.organizationName||"")>(I.organizationName||"")?1:-1)||[]},[d,t?.roles]),v=x.useCallback(C=>{f(C.currentTarget.value?.toLowerCase()||"")},[]),y=x.useCallback(C=>{C?.organizationId&&n(C.organizationId,{onSuccess:()=>{_e.success("Success",{description:"Organization successfully deleted.",duration:5e3,action:{label:"Dismiss",onClick:()=>_e.dismiss()}}),e.invalidateQueries({queryKey:[]}),o(!1)},onError:()=>o(!1)})},[n,e,o]),b=x.useCallback(C=>{c(C),o(!0)},[]),{createCluster:S}=br({strict:!1});return h.length===1&&!d.length&&S?u.jsx(ic,{to:`/${h[0].organizationId}/new-cluster`,replace:!0}):!h.length&&!d.length?u.jsx(wH,{}):u.jsxs(u.Fragment,{children:[u.jsx(rs,{children:u.jsxs("div",{className:"flex w-full justify-end gap-2",children:[u.jsx(ze,{placeholder:"Filter by name",className:"inline-block w-48 md:w-64 bg-black border",value:d,onChange:v}),u.jsx(Ge,{to:"/new-org",children:u.jsxs(be,{variant:"positive",className:"rounded-full w-44",accessKey:"n",children:[u.jsx(po,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"N"}),"ew Organization"]})]})})]})}),u.jsx("section",{className:"mt-40 md:mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-12",children:[h.map(C=>u.jsx("div",{className:"col-span-1 md:col-span-4 lg:col-span-3 2xl:col-span-2",children:u.jsx(BSe,{organizationRole:C,onDeleteOrgModal:b})},C.organizationId)),!h.length&&u.jsxs("div",{className:"col-span-1 md:col-span-12 text-center",children:[u.jsx("h2",{className:"my-4 text-xl",children:"No matches found."}),u.jsx(be,{variant:"outline",onClick:p,children:"Clear Filters"})]})]})}),a&&u.jsx(ex,{typeOfThingBeingDeleted:"organization",nameOfThingBeingDeleted:a.organizationName,isModalOpen:i,setIsModalOpen:()=>o(!1),deletionConfirmed:()=>y(a),deletionPending:r})]})}function WSe(){const{isLoading:e}=_c(),{createCluster:t}=br({strict:!1}),[,n]=nf(Mc.SavedClusterState,null);return x.useEffect(()=>{t&&n(t)},[t,n]),e?u.jsx(Ui,{className:"fixed z-50 translate-1/2"}):u.jsxs(u.Fragment,{children:[u.jsx("header",{className:"fixed top-0 z-40 w-full h-20 p-4 bg-black-dark dark:bg-black-dark dark:border-b dark:border-black md:px-12",children:u.jsx(dL,{})}),u.jsx("main",{children:u.jsx(ll,{})})]})}const XSe=["/","/forgot-password","/reset-password","/sign-in","/sign-up","/verify-email"];function SH(){const e=XB();return!XSe.includes(e)&&{redirect:e}}const vx=Qe({getParentRoute:()=>fb,id:"_dashboardLayout",component:WSe,beforeLoad:({context:e})=>{const t=e.authentication[_n];if(t&&!t.isLoading&&!t.user)throw Sc({to:"/sign-in",search:SH()})}}),Xj=Qe({getParentRoute:()=>vx,id:"_orgsLayout"});Qe({getParentRoute:()=>Xj,path:"/",component:YSe});Qe({getParentRoute:()=>Xj,path:"/new-org",component:wH});const Lc=Qe({getParentRoute:()=>Xj,path:"$organizationId",beforeLoad:async e=>({organization:await e.context.queryClient.ensureQueryData(zc(e.params.organizationId))})}),QSe=Qe({getParentRoute:()=>Lc,path:"/roles",component:vH}),JSe=Qe({getParentRoute:()=>Lc,path:"/roles/$orgRoleId",component:vH}),e_e=Qe({getParentRoute:()=>Lc,path:"/users",component:xH}),t_e=Qe({getParentRoute:()=>Lc,path:"/users/$orgUserId",component:xH});uwe(Lc);const _H=Qe({getParentRoute:()=>Lc,id:"_clusterLayout"});Qe({getParentRoute:()=>_H,path:"/",component:s0e});Qe({getParentRoute:()=>Lc,path:"/new-cluster",component:Gj});Qe({getParentRoute:()=>Qa,path:"/edit",component:Gj});function n_e(){return u.jsx(ll,{})}const Qa=Qe({getParentRoute:()=>_H,path:"$clusterId",component:n_e,beforeLoad:async({context:e,params:t})=>({cluster:await e.queryClient.ensureQueryData(Ac(t.clusterId))})}),Wu=mn({username:_j,role:nt().nonempty({error:"Please select a role."}),password:Yp.min(8,{error:"Password must be at least 8 characters long."}),confirmPassword:nt()}).refine(e=>e.password===e.confirmPassword,{error:"Passwords do not match.",path:["confirmPassword"]});async function r_e(e){await Ut.patch(`/ResetPasswordUpdater/${e}`)}async function CH(e){const{instanceClient:t,...n}=e,{data:r}=await t.post("/",{operation:"add_user",...n});return r}function i_e(){return at({mutationFn:CH})}async function EH({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 o_e(){return at({mutationFn:EH})}async function kH({username:e,instanceClient:t}){const{data:n}=await t.post("/",{operation:"drop_user",username:e});return n}function a_e(){return at({mutationFn:kH})}async function s_e({clusterId:e,initialUsername:t,desiredUsername:n,newPassword:r,tempPassword:i,instanceClient:o}){if(!i)throw new Error("You may not have permission to set the password on this cluster.");let a=o;try{const c=await w1({username:t,password:i,instanceClient:a,entityId:e});return c.instanceClient&&(a=c.instanceClient),n===R_?await EH({username:n,password:r,instanceClient:a}):(await CH({username:n,password:r,role:"super_user",active:!0,instanceClient:a}),await kH({username:R_,instanceClient:a}),await w1({username:n,password:r,instanceClient:a,entityId:e})),await r_e(e),c}catch(c){throw await yp({entityId:e,instanceClient:a}),c}}function l_e(){return at({mutationFn:s_e})}function c_e(){const{user:e}=cl(),{clusterId:t}=tt({strict:!1}),{data:n}=Pt(Ac(t,!0)),r=pn(),i=x.useMemo(()=>CC(n),[n]),o=mb(i),{redirect:a}=br({strict:!1}),c=on(),d=Xt({resolver:sn(Wu),defaultValues:{confirmPassword:"",password:"",role:"super_user",username:e?.email??""}}),{setFocus:f,control:p,handleSubmit:h}=d;x.useEffect(()=>{f("password")},[f]);const v=n?.instances?.find(C=>C.tempPassword)?.tempPassword,{mutate:y,isPending:b}=l_e(),S=x.useCallback(async C=>{if(!i){_e.error("Cluster is not yet fully loaded, please wait a moment before trying to sign in.");return}y({instanceClient:o,clusterId:t,newPassword:C.password,tempPassword:v,initialUsername:R_,desiredUsername:C.username},{onSuccess:async({message:E,user:k})=>{_e.success(E),Tt.setUserForEntity(n,k),c.invalidate(),await r({to:a?.startsWith("/")?a:pC})}})},[n,t,o,r,i,a,c,y,v]);return n&&!n.resetPassword?u.jsx(ic,{to:"../sign-in",replace:!0}):u.jsxs(u.Fragment,{children:[u.jsx("nav",{className:"fixed top-20 w-full h-12 z-39 px-4 md:px-12 bg-grey-700 flex items-center",children:u.jsx(kb,{})}),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(Qt,{...d,children:u.jsxs("form",{onSubmit:h(S),className:"my-4",children:[u.jsx(Pe,{control:p,name:"username",render:({field:C})=>u.jsxs(Ae,{className:"my-4",children:[u.jsx(Oe,{children:"Username"}),u.jsx($e,{children:u.jsx(ze,{autoComplete:"username",type:"text",...C})}),u.jsx(De,{})]})}),u.jsx(Pe,{control:p,name:"password",render:({field:C})=>u.jsxs(Ae,{className:"my-4",children:[u.jsx(Oe,{children:"Password"}),u.jsx($e,{children:u.jsx(ze,{type:"password",...C})}),u.jsx(De,{})]})}),u.jsx(Pe,{control:p,name:"confirmPassword",render:({field:C})=>u.jsxs(Ae,{className:"my-4",children:[u.jsx(Oe,{children:"Confirm Password"}),u.jsx($e,{children:u.jsx(ze,{type:"password",...C})}),u.jsx(De,{})]})}),u.jsx(be,{disabled:b,type:"submit",variant:"submit",className:"w-full my-2 rounded-full",children:"Create Admin User"})]})}),u.jsxs("p",{className:"text-muted-foreground flex gap-2 align-middle",children:[u.jsx(VW,{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 u_e({columns:e,data:t}){const n=dx({data:t,columns:e,getCoreRowModel:ux()});return u.jsx("div",{className:"bg-black-dark rounded-md",children:u.jsxs(fx,{children:[u.jsx(rh,{children:n.getHeaderGroups().map(r=>u.jsx(Ai,{className:"border-none",children:r.headers.map(i=>u.jsx(Wj,{className:"p-4",style:{width:`${i.getSize()}%`},children:i.isPlaceholder?null:wc(i.column.columnDef.header,i.getContext())},i.id))},r.id))}),u.jsx(mx,{className:"bg-black",children:n.getRowModel().rows?.length?n.getRowModel().rows.map(r=>u.jsx(Ai,{"data-state":r.getIsSelected()&&"selected",className:"hover:bg-muted/10 data-[state=selected]:bg-muted",children:r.getVisibleCells().map(i=>u.jsx(Xa,{className:"p-4",style:{width:`${i.column.getSize()}%`},children:wc(i.column.columnDef.cell,i.getContext())},i.id))},r.id)):u.jsx(Ai,{children:u.jsx(Xa,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})})}function d_e(){return u.jsx("div",{className:"flex-col items-center justify-center px-16 space-y-3 text-center pt-30",children:u.jsx("p",{children:"No instances found."})})}function f_e({isSelfManaged:e,instance:t}){const{user:n,isLoading:r}=Ja(t.id),i=x.useMemo(()=>EC(t),[t]),o=mb(i),{update:a}=Fle(),c=Tt.checkForFabricConnect(t.id),d=x.useCallback(async()=>{await yp({instanceClient:o,entityId:t.id}),Tt.setUserForEntity(t,null)},[t,o]);return r||!["CLONE_READY","RUNNING","UPDATED"].includes(t.status)?u.jsx(DM,{className:"animate-spin",color:"gray"}):!n||c?u.jsxs("span",{className:"flex gap-4",children:[a&&!e&&u.jsx(Ge,{to:`../instance/${t.id}${oa}`,className:"text-sm","aria-label":`Connect to ${t.name} instance`,title:`Connect to ${t.name} instance`,children:u.jsx(be,{variant:"positiveOutline",children:"Fabric Connect"})}),u.jsx(Ge,{to:`../instance/${t.id}/sign-in`,className:"text-sm","aria-label":`Sign in to ${t.name} instance`,title:`Sign in to ${t.name} instance`,children:u.jsx(be,{variant:a?"defaultOutline":"positiveOutline",children:"Direct Sign In"})})]}):u.jsxs("span",{className:"flex gap-4",children:[u.jsx(Ge,{to:`../instance/${t.id}${oa}`,className:"text-sm","aria-label":`Go to ${t.name} instance`,title:`Go to ${t.name} instance`,children:u.jsx(be,{variant:"positiveOutline",children:"Direct Connect"})}),u.jsx(be,{variant:"destructiveOutline",className:"text-sm","aria-label":`Sign out from ${t.name} instance`,title:`Sign out from ${t.name} instance`,onClick:d,children:"Direct Sign Out"})]})}function m_e(){const{clusterId:e}=tt({strict:!1}),{data:t,isLoading:n}=Pt(Ac(e,!0)),r=Uj(t),i=x.useMemo(()=>[{id:"instanceActions",size:1,minSize:1,cell:a=>u.jsx("div",{className:"flex justify-end",children:u.jsx(f_e,{isSelfManaged:r,instance:a.row.original})})},r&&{accessorKey:"instanceFqdn",size:90,header:"URL",cell:a=>ZB({secure:a.row.original.operationsApiSecure?"true":"false",port:a.row.original.operationsApiPort,fqdn:a.row.original.instanceFqdn})},!r&&{accessorKey:"name",size:90,header:"Name"},!r&&{accessorKey:"status",header:"Status",size:1,minSize:1,cell:a=>{const c=a.getValue();return u.jsx(zo,{variant:B5(c),children:Eo(c)})}},!r&&{accessorKey:"version",size:1,minSize:1,header:"Version"},!r&&{accessorKey:"storageGb",size:1,minSize:1,header:"Storage",cell:a=>{const c=a.getValue();return Pa(c,Math.pow(1024,3))}},!r&&{accessorKey:"cpuCores",size:1,minSize:1,header:"Cores/Threads",cell:a=>u.jsxs(u.Fragment,{children:[a.row.original.cpuCores," / ",a.row.original.threads]})},!r&&{accessorKey:"memoryMb",size:1,minSize:1,header:"Memory",cell:a=>{const c=a.getValue();return Pa(c,Math.pow(1024,2))}}].filter(fa),[r]),o=x.useMemo(()=>t?.instances?t.instances.filter(a=>a.status&&!ME.includes(a.status)).sort(oB):[],[t]);return u.jsxs(u.Fragment,{children:[u.jsx(rs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx(fc,{className:"p-0 mt-4 min-h-96",children:u.jsx(es,{className:"p-0 min-h-96",children:n?u.jsx(jr,{}):o.length?u.jsx(u_e,{data:o,columns:i}):u.jsx(d_e,{})})})})]})}function Jl({children:e,className:t}){return u.jsxs(u.Fragment,{children:[u.jsx(rs,{}),u.jsx("div",{className:aa("mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))] flex justify-center",t),children:e})]})}function p_e(){const{clusterId:e}=tt({strict:!1}),{data:t,isLoading:n}=Pt(Ac(e,2e3)),r=t?.status,i=x.useMemo(()=>r&&Tb.includes(r),[r]);return n||!t?u.jsx(Jl,{className:"flex justify-center",children:u.jsx(jr,{})}):i?u.jsx(Jl,{className:"flex justify-center",children:u.jsxs("div",{className:"center w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"All done!"}),u.jsx(lp,{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(Fj,{cluster:t})})]})}):u.jsx(Jl,{className:"flex justify-center",children:u.jsxs("div",{className:"center w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"Here we go!"}),u.jsx(lp,{cluster:t,forceProgressBarVisible:!0}),u.jsxs("p",{children:["Your cluster is updating with the latest changes. This includes waiting several minutes to let traffic drain safely.",u.jsxs("span",{className:"text-muted-foreground",children:["We will let you know when we are ready for you to connect! In the meantime, join us on ",u.jsx("a",{href:"https://discord.gg/VzZuaw3Xay",target:"_blank",children:"Discord"}),"! Get real-time help from our engineers, see feature drops early, and connect with others building on Fabric."]})]})]})})}function h_e(){const e=on(),{clusterId:t}=tt({strict:!1}),{data:n,isLoading:r}=Pt(Ac(t,2e3)),i=n?.status,o=x.useMemo(()=>i&&Tb.includes(i),[i]),a=Wp(i),[,c]=nf(Mc.SavedClusterState,null),d=x.useCallback(()=>{c(n),e.navigate({to:`/${n.organizationId}/new-cluster`})},[n,e,c]);return r||!n?u.jsx(Jl,{className:"flex justify-center",children:u.jsx(jr,{})}):a?u.jsx(Jl,{className:"flex justify-center",children:u.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4 items-center",children:[u.jsx(fX,{className:"w-24 h-24"}),u.jsxs("span",{children:["Your cluster failed to successfully start. This is usually caused by temporary communication problems. Would you like to try again? We also get notified about these failures. ",u.jsx(al,{})," if you want more help."]}),u.jsx(be,{type:"button",variant:"positiveOutline",onClick:d,children:"Try Again"})]})}):o?u.jsx(Jl,{className:"flex justify-center",children:u.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"It's ready!"}),u.jsx(lp,{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(Fj,{cluster:n})})]})}):u.jsx(Jl,{className:"flex justify-center",children:u.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"Here we go!"}),u.jsx(lp,{cluster:n,forceProgressBarVisible:!0}),u.jsxs("p",{children:["Your cluster is spinning up with the latest changes, including your own DNS records and private connections. Please wait while we get everything going.",u.jsxs("span",{className:"text-muted-foreground",children:["We will let you know when we are ready for you to connect! In the meantime, join us on ",u.jsx("a",{href:"https://discord.gg/VzZuaw3Xay",target:"_blank",children:"Discord"}),"! Get real-time help from our engineers, see feature drops early, and connect with others building on Fabric."]})]})]})})}Qe({getParentRoute:()=>Qa,path:"instances",component:m_e});Qe({getParentRoute:()=>Qa,path:"starting-up",component:h_e});Qe({getParentRoute:()=>Qa,path:"scaling",component:p_e});Qe({getParentRoute:()=>Qa,path:"sign-in",component:Cj,beforeLoad:({context:e,location:t,params:n})=>{const r=Tt.checkForFabricConnect(n.clusterId);if(e.authentication[n.clusterId]?.user&&!r){const i=t?.search;throw Sc({to:i?.redirect?.startsWith("/")?i.redirect:pC})}}});Qe({getParentRoute:()=>Qa,path:"instance/$instanceId/sign-in",component:Cj,beforeLoad:({context:e,location:t,params:n})=>{if(!(Tt.checkForFabricConnect(n.clusterId)||Tt.checkForFabricConnect(n.instanceId))&&e.authentication[n.instanceId]?.user){const i=t?.search;throw Sc({to:i?.redirect?.startsWith("/")?i.redirect:pC})}}});Qe({getParentRoute:()=>Qa,path:"finish-setup",component:c_e});function g_e(e){return Qe({getParentRoute:()=>e,path:"apis"}).lazy(()=>Np(()=>import("./index.lazy-CI2uUC67.js"),__vite__mapDeps([0,1,2])).then(t=>t.route))}async function v_e(e,t=3,n=1e3){let r=0;if(t<=0)throw new Error("retries must be greater than 0");let i;for(;r<t;)try{return await e()}catch(o){if(r++,i=o,r===t)break;await bp(n)}throw i}async function jH({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 bp(1e4),await v_e(()=>qs({instanceClient:n,timeout:3e3}),12,15e3),r}function y_e(){return at({mutationFn:jH})}function b_e({onRestartedSuccessfully:e}={}){const{clusterId:t}=tt({strict:!1}),n=yr(),[r,i]=x.useState(!1);return{onRestartClick:x.useCallback(async()=>{if(!t)throw new Error("clusterId must be set in the route to invoke useRestartClusterClick");i(!0);let a=!1;const c={duration:6e4,action:{label:"Cancel",onClick:()=>{a=!0}}},d=_e.loading("Restarting",{...c,description:u.jsx(cp,{animated:!0,width:"0%"})}),f=await zE(t),p=Tt.checkForFabricConnect(f.id),h=f?.instances??[],v=h.filter(b=>b.status==="RUNNING").map(b=>Va({id:b.id,forceFabricConnect:p,operationsUrl:EC(b)})).reverse();let y=0;if(v.length)for(let b=0;b<v.length;b++){const S=v[b];if(!a){_e.loading(`Restarting Instance ${b+1} of ${v.length}`,{...c,id:d,description:u.jsx(cp,{animated:!0,width:(b===0?0:b/v.length*100)+"%"})});try{await qs({instanceClient:S}),await jH({operation:"restart",replicated:!1,instanceClient:S}),y+=1}catch{b+1!==v.length&&(_e.loading(`Failed Restarting Instance ${b+1} of ${v.length}`,{...c,id:d,description:"We will carry on momentarily."}),await bp(3e3))}}}if(i(!1),n.invalidateQueries({queryKey:[t]}),a)_e.error("Cancelled",{id:d,description:"The restart was partially cancelled.",duration:1e4,action:{label:"Dismiss",onClick:()=>_e.dismiss()}});else if(h.length===y)e?.(),_e.success("Success",{id:d,description:"Cluster fully restarted!",duration:1e4,action:{label:"Dismiss",onClick:()=>_e.dismiss()}});else{const b=Io(h.length,"instance","instances"),S=Io(y,'"RUNNING" instance was','"RUNNING" instances were');_e.error("Error",{id:d,description:`Failed to fully restart cluster.
127
+ `},F2=Fwe(qwe)(cH),Gwe={config:Bwe},Kwe=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 uH(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],uH(e[n],t[n]))}),M2(M2({},e),t)}var Zwe={type:"cancelation",msg:"operation is manually canceled"};function n_(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(Zwe):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var Ywe=Lwe.create({config:Uwe,isInitialized:!1,resolve:null,reject:null,monaco:null}),dH=xwe(Ywe,2),ih=dH[0],hx=dH[1];function Wwe(e){var t=Gwe.config(e),n=t.monaco,r=bwe(t,["monaco"]);hx(function(i){return{config:uH(i.config,r),monaco:n}})}function Xwe(){var e=ih(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(hx({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),n_(r_);if(window.monaco&&window.monaco.editor)return fH(window.monaco),e.resolve(window.monaco),n_(r_);Kwe(Qwe,eSe)(tSe)}return n_(r_)}function Qwe(e){return document.body.appendChild(e)}function Jwe(e){var t=document.createElement("script");return e&&(t.src=e),t}function eSe(e){var t=ih(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=Jwe("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function tSe(){var e=ih(function(n){var r=n.config,i=n.resolve,o=n.reject;return{config:r,resolve:i,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){fH(n),e.resolve(n)},function(n){e.reject(n)})}function fH(e){ih().monaco||hx({monaco:e})}function nSe(){return ih(function(e){var t=e.monaco;return t})}var r_=new Promise(function(e,t){return hx({resolve:e,reject:t})}),mH={config:Wwe,init:Xwe,__getMonacoInstance:nSe},rSe={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},i_=rSe,iSe={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},oSe=iSe;function aSe({children:e}){return X.createElement("div",{style:oSe.container},e)}var sSe=aSe,lSe=sSe;function cSe({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:a}){return X.createElement("section",{style:{...i_.wrapper,width:e,height:t},...a},!n&&X.createElement(lSe,null,r),X.createElement("div",{ref:i,style:{...i_.fullWidth,...!n&&i_.hide},className:o}))}var uSe=cSe,pH=x.memo(uSe);function dSe(e){x.useEffect(e,[])}var hH=dSe;function fSe(e,t,n=!0){let r=x.useRef(!0);x.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Ei=fSe;function Um(){}function Yu(e,t,n,r){return mSe(e,r)||pSe(e,t,n,r)}function mSe(e,t){return e.editor.getModel(gH(e,t))}function pSe(e,t,n,r){return e.editor.createModel(t,n,r?gH(e,r):void 0)}function gH(e,t){return e.Uri.parse(t)}function hSe({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:a,keepCurrentOriginalModel:c=!1,keepCurrentModifiedModel:d=!1,theme:f="light",loading:p="Loading...",options:h={},height:v="100%",width:y="100%",className:b,wrapperProps:S={},beforeMount:C=Um,onMount:E=Um}){let[k,j]=x.useState(!1),[I,A]=x.useState(!0),N=x.useRef(null),T=x.useRef(null),z=x.useRef(null),L=x.useRef(E),G=x.useRef(C),J=x.useRef(!1);hH(()=>{let Y=mH.init();return Y.then(P=>(T.current=P)&&A(!1)).catch(P=>P?.type!=="cancelation"&&console.error("Monaco initialization: error:",P)),()=>N.current?F():Y.cancel()}),Ei(()=>{if(N.current&&T.current){let Y=N.current.getOriginalEditor(),P=Yu(T.current,e||"",r||n||"text",o||"");P!==Y.getModel()&&Y.setModel(P)}},[o],k),Ei(()=>{if(N.current&&T.current){let Y=N.current.getModifiedEditor(),P=Yu(T.current,t||"",i||n||"text",a||"");P!==Y.getModel()&&Y.setModel(P)}},[a],k),Ei(()=>{let Y=N.current.getModifiedEditor();Y.getOption(T.current.editor.EditorOption.readOnly)?Y.setValue(t||""):t!==Y.getValue()&&(Y.executeEdits("",[{range:Y.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),Y.pushUndoStop())},[t],k),Ei(()=>{N.current?.getModel()?.original.setValue(e||"")},[e],k),Ei(()=>{let{original:Y,modified:P}=N.current.getModel();T.current.editor.setModelLanguage(Y,r||n||"text"),T.current.editor.setModelLanguage(P,i||n||"text")},[n,r,i],k),Ei(()=>{T.current?.editor.setTheme(f)},[f],k),Ei(()=>{N.current?.updateOptions(h)},[h],k);let Z=x.useCallback(()=>{if(!T.current)return;G.current(T.current);let Y=Yu(T.current,e||"",r||n||"text",o||""),P=Yu(T.current,t||"",i||n||"text",a||"");N.current?.setModel({original:Y,modified:P})},[n,t,i,e,r,o,a]),W=x.useCallback(()=>{!J.current&&z.current&&(N.current=T.current.editor.createDiffEditor(z.current,{automaticLayout:!0,...h}),Z(),T.current?.editor.setTheme(f),j(!0),J.current=!0)},[h,f,Z]);x.useEffect(()=>{k&&L.current(N.current,T.current)},[k]),x.useEffect(()=>{!I&&!k&&W()},[I,k,W]);function F(){let Y=N.current?.getModel();c||Y?.original?.dispose(),d||Y?.modified?.dispose(),N.current?.dispose()}return X.createElement(pH,{width:y,height:v,isEditorReady:k,loading:p,_ref:z,className:b,wrapperProps:S})}var gSe=hSe;x.memo(gSe);function vSe(e){let t=x.useRef();return x.useEffect(()=>{t.current=e},[e]),t.current}var ySe=vSe,tv=new Map;function bSe({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:o,theme:a="light",line:c,loading:d="Loading...",options:f={},overrideServices:p={},saveViewState:h=!0,keepCurrentModel:v=!1,width:y="100%",height:b="100%",className:S,wrapperProps:C={},beforeMount:E=Um,onMount:k=Um,onChange:j,onValidate:I=Um}){let[A,N]=x.useState(!1),[T,z]=x.useState(!0),L=x.useRef(null),G=x.useRef(null),J=x.useRef(null),Z=x.useRef(k),W=x.useRef(E),F=x.useRef(),Y=x.useRef(r),P=ySe(o),K=x.useRef(!1),U=x.useRef(!1);hH(()=>{let M=mH.init();return M.then(V=>(L.current=V)&&z(!1)).catch(V=>V?.type!=="cancelation"&&console.error("Monaco initialization: error:",V)),()=>G.current?D():M.cancel()}),Ei(()=>{let M=Yu(L.current,e||r||"",t||i||"",o||n||"");M!==G.current?.getModel()&&(h&&tv.set(P,G.current?.saveViewState()),G.current?.setModel(M),h&&G.current?.restoreViewState(tv.get(o)))},[o],A),Ei(()=>{G.current?.updateOptions(f)},[f],A),Ei(()=>{!G.current||r===void 0||(G.current.getOption(L.current.editor.EditorOption.readOnly)?G.current.setValue(r):r!==G.current.getValue()&&(U.current=!0,G.current.executeEdits("",[{range:G.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),G.current.pushUndoStop(),U.current=!1))},[r],A),Ei(()=>{let M=G.current?.getModel();M&&i&&L.current?.editor.setModelLanguage(M,i)},[i],A),Ei(()=>{c!==void 0&&G.current?.revealLine(c)},[c],A),Ei(()=>{L.current?.editor.setTheme(a)},[a],A);let te=x.useCallback(()=>{if(!(!J.current||!L.current)&&!K.current){W.current(L.current);let M=o||n,V=Yu(L.current,r||e||"",t||i||"",M||"");G.current=L.current?.editor.create(J.current,{model:V,automaticLayout:!0,...f},p),h&&G.current.restoreViewState(tv.get(M)),L.current.editor.setTheme(a),c!==void 0&&G.current.revealLine(c),N(!0),K.current=!0}},[e,t,n,r,i,o,f,p,h,a,c]);x.useEffect(()=>{A&&Z.current(G.current,L.current)},[A]),x.useEffect(()=>{!T&&!A&&te()},[T,A,te]),Y.current=r,x.useEffect(()=>{A&&j&&(F.current?.dispose(),F.current=G.current?.onDidChangeModelContent(M=>{U.current||j(G.current.getValue(),M)}))},[A,j]),x.useEffect(()=>{if(A){let M=L.current.editor.onDidChangeMarkers(V=>{let O=G.current.getModel()?.uri;if(O&&V.find(ee=>ee.path===O.path)){let ee=L.current.editor.getModelMarkers({resource:O});I?.(ee)}});return()=>{M?.dispose()}}return()=>{}},[A,I]);function D(){F.current?.dispose(),v?h&&tv.set(o,G.current.saveViewState()):G.current.getModel()?.dispose(),G.current.dispose()}return X.createElement(pH,{width:y,height:b,isEditorReady:A,loading:d,_ref:J,className:S,wrapperProps:C})}var xSe=bSe,oh=x.memo(xSe),gx=oh;const V2={roles:{create:!0,view:!0,update:!0,delete:!0},clusters:{create:!0,view:!0,update:!0,delete:!0,resources:[]}};function wSe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const{organizationId:r}=tt({strict:!1}),[i,o]=x.useState(!0),[a,c]=x.useState(JSON.stringify(V2,null,2)),{mutate:d,isPending:f}=gwe(),p=Xt({resolver:sn(pwe),defaultValues:{roleName:"",updateOrganization:!1,deleteOrganization:!1}}),h=x.useCallback(y=>{o(y.length===0)},[o]),v=x.useCallback(async y=>{const b={organizationId:r,name:y.roleName,update:y.updateOrganization,delete:y.deleteOrganization,...JSON.parse(a)};y&&i&&d(b,{onSuccess:()=>{p.reset(),t(),_e.success("Organization role added successfully!")},onError:S=>{_e.error(`Failed to add organization role: ${S.message}`)}})},[i,a,d,p,t,r]);return u.jsx(zn,{onOpenChange:n,open:e,children:u.jsxs(Ln,{children:[u.jsx(Nn,{children:"Add New Organization Role"}),u.jsx(Ir,{children:"Set the new organization role permissions."}),u.jsx(Qt,{...p,children:u.jsxs("form",{className:"grid grid-cols-2 gap-4 my-4",onSubmit:p.handleSubmit(v),children:[u.jsx(Pe,{control:p.control,name:"roleName",render:({field:y})=>u.jsxs(Ae,{className:"col-span-2",children:[u.jsx(Oe,{className:"pb-1",children:"Role Name"}),u.jsx($e,{children:u.jsx(ze,{type:"text",placeholder:"Developer",className:"",...y})}),u.jsx(De,{})]})}),u.jsx(Pe,{control:p.control,name:"updateOrganization",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Can Update Organization"}),u.jsx($e,{children:u.jsx(ze,{type:"checkbox",className:"w-6 ml-2",checked:y.value,onChange:b=>y.onChange(b.target.checked)})}),u.jsx(De,{})]})}),u.jsx(Pe,{control:p.control,name:"deleteOrganization",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Can Delete Organization"}),u.jsx($e,{children:u.jsx(ze,{type:"checkbox",className:"w-6 ml-2",checked:y.value,onChange:b=>y.onChange(b.target.checked)})}),u.jsx(De,{})]})}),u.jsx("div",{className:"col-span-2",children:u.jsx(oh,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate:h,onChange:y=>{y&&c(y)},defaultValue:JSON.stringify(V2,null,2)})}),u.jsx(Un,{className:"col-span-2",children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx(be,{variant:"destructiveOutline",className:"rounded-full",type:"button",onClick:()=>n(!1),disabled:f,children:"Cancel"}),u.jsx(be,{variant:"submit",className:"rounded-full",disabled:f||!i,children:"Save Changes"})]})})]})})]})})}async function SSe({roleId:e}){const{data:t}=await Ut.delete(`/Role/${e}`,{id:e,deleted:!0});return t}function _Se(){return at({mutationFn:({roleId:e})=>SSe({roleId:e})})}const CSe=Er.object({roleName:Er.string().nonempty({error:"Please enter a role name."}).regex(/^[a-zA-Z_]*$/,{error:"Role must contain only letters and underscores."}).max(30,{error:"Role name cannot be longer than 30 characters."}),updateOrganization:Er.boolean(),deleteOrganization:Er.boolean()});async function ESe({roleId:e,updatedRoleInfo:t}){const{data:n}=await Ut.put(`/Role/${e}`,t);return n}function kSe(){return at({mutationFn:({roleId:e,updatedRoleInfo:t})=>ESe({roleId:e,updatedRoleInfo:t})})}function jSe({organizationId:e,roleId:t}){return{queryKey:[e,"roles",t],queryFn:()=>RSe(t),refetchInterval:10*1e3}}async function RSe(e){const{data:t}=await Ut.get(`/Role/${e}`);return t}const ISe=({onRoleDeleteClick:e,setIsConfirmingRoleDeletion:t,isRoleDeletionPending:n})=>u.jsxs(u.Fragment,{children:[u.jsx(Nn,{children:"Confirm Role Deletion"}),u.jsx(Ir,{children:"Are you sure you want to delete this role? This action cannot be undone."}),u.jsxs(Un,{children:[u.jsx(be,{type:"button",variant:"defaultOutline",className:"rounded-full",onClick:()=>t(!1),children:"Cancel"}),u.jsx(be,{variant:"destructiveOutline",className:"rounded-full",onClick:e,disabled:n,children:n?"Deleting...":"Delete Role"})]})]});function NSe({data:e,isModalOpen:t,closeModal:n,roleDeleted:r}){const{data:i}=Pi(jSe({roleId:e.id,organizationId:e.organizationId})),o=cl(),a=o.user&&o.user?.roles?.[e.organizationId]?.role===e.roleName,{update:c,remove:d}=Kd(e.organizationId),{mutate:f,isPending:p}=kSe(),{mutate:h,isPending:v}=_Se(),[y,b]=x.useState(!1),S=x.useCallback(()=>{h({roleId:e.id},{onSuccess:()=>{_e.success("Role deleted successfully!"),r(),n()},onError:T=>{_e.error("Error",{description:`Failed to delete role: ${T instanceof Error?T.message:String(T)}.`,action:{label:"Dismiss",onClick:()=>_e.dismiss()}})}})},[e.id,h,r,n]),[C,E]=x.useState(!0),[k,j]=x.useState(JSON.stringify({roles:{...i.organization.roles},clusters:{...i.organization.clusters}},null,2)),I=Xt({resolver:sn(CSe),defaultValues:{roleName:i.role,updateOrganization:i?.organization.update||!1,deleteOrganization:i?.organization.delete||!1}}),A=x.useCallback(T=>{E(T.length===0)},[E]),N=x.useCallback(async T=>{if(!c)return;const z={...i};z.organizationId=e.organizationId,z.name=T.roleName,z.role=T.roleName,z.organization.roles=JSON.parse(k).roles,z.organization.clusters=JSON.parse(k).clusters,z.organization.update=T.updateOrganization,z.organization.delete=T.deleteOrganization,k&&C&&f({roleId:e.id,updatedRoleInfo:z},{onSuccess:()=>{_e.success("Role updated successfully!"),n()},onError:L=>{_e.error("Error",{description:`Failed to update role: ${L instanceof Error?L.message:String(L)}.`,action:{label:"Dismiss",onClick:()=>_e.dismiss()}})}})},[c,i,e.organizationId,e.id,k,C,f,n]);return u.jsx(zn,{onOpenChange:n,open:t,children:u.jsx(Ln,{children:y?u.jsx(ISe,{onRoleDeleteClick:S,setIsConfirmingRoleDeletion:b,isRoleDeletionPending:v}):u.jsxs(u.Fragment,{children:[u.jsxs(Nn,{children:[a||!c?"View":"Edit",' Organization Role "',i.role,'"']}),u.jsx(Qt,{...I,children:u.jsxs("form",{className:"grid grid-cols-2 gap-4 my-4",onSubmit:I.handleSubmit(N),children:[u.jsx(Pe,{control:I.control,name:"roleName",render:({field:T})=>u.jsxs(Ae,{className:"col-span-2",children:[u.jsx(Oe,{className:"pb-1",children:"Role Name"}),u.jsx($e,{children:u.jsx(ze,{type:"text",placeholder:"Developer",className:"",...T,disabled:a||!c,readOnly:a||!c})}),u.jsx(De,{})]})}),u.jsx(Pe,{control:I.control,name:"updateOrganization",render:({field:T})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Can Update Organization"}),u.jsx($e,{children:u.jsx(ze,{type:"checkbox",className:"w-6 ml-2",disabled:a||!c,readOnly:a||!c,checked:T.value,onChange:z=>T.onChange(z.target.checked)})}),u.jsx(De,{})]})}),u.jsx(Pe,{control:I.control,name:"deleteOrganization",render:({field:T})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Can Delete Organization"}),u.jsx($e,{children:u.jsx(ze,{type:"checkbox",className:"w-6 ml-2",disabled:a||!c,readOnly:a||!c,checked:T.value,onChange:z=>T.onChange(z.target.checked)})}),u.jsx(De,{})]})}),u.jsx("div",{className:"col-span-2",children:u.jsx(oh,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate:A,onChange:T=>{T&&j(T)},options:a||!c?{readOnly:!0}:void 0,defaultValue:k})}),!a&&(d||c)&&u.jsx(Un,{className:"col-span-2",children:u.jsxs("div",{className:"flex justify-between w-full",children:[d&&u.jsx(be,{type:"button",variant:"destructiveOutline",className:"rounded-full",onClick:()=>b(!0),disabled:p,children:"Delete Role"}),c&&u.jsx(be,{variant:"submit",className:"rounded-full",disabled:!C||p,children:"Save Changes"})]})})]})})]})})})}function vH(){const e=pn(),{organizationId:t,orgRoleId:n}=tt({strict:!1}),{create:r}=Kd(t),{data:i,refetch:o,isFetching:a,isRefetching:c}=Pi(px(t)),d=x.useMemo(()=>i&&i?.find(j=>j.id===n),[i,n]),f=!!n&&!!d,[p,h]=x.useState(!1),v=x.useCallback(j=>{const I=[n?"..":"",j].filter(Boolean);e({to:I.join("/")})},[n,e]),y=x.useCallback(()=>{o(),h(!1)},[o,h]),b=x.useCallback(()=>{h(!0)},[h]),S=x.useCallback(()=>{o(),h(!1)},[o,h]),C=x.useCallback(j=>{v(j.original.id)},[v]),E=x.useCallback(()=>{v(void 0)},[v]),k=vl(o);return u.jsxs(u.Fragment,{children:[u.jsx(rs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs(x.Suspense,{fallback:u.jsx(Ui,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(af,{data:i,columns:mwe,onRowClick:C,children:[u.jsxs(be,{variant:"defaultOutline",onClick:k,accessKey:"r",disabled:a||c,children:[u.jsx(sa,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),r&&u.jsxs(be,{variant:"positiveOutline",onClick:b,accessKey:"a",disabled:p,children:[u.jsx(po,{}),u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),r&&u.jsx(wSe,{isModalOpen:p,onChangesSaved:S,setIsModalOpen:h}),f&&u.jsx(NSe,{roleDeleted:y,data:d,isModalOpen:f,closeModal:E})]})})]})}const TSe=lx(),ASe=[{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},TSe.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}],OSe=Er.object({email:ef.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:Er.string().nonempty({error:"Please select a role."})});async function DSe(e){const{data:t}=await Ut.post("/OrganizationRole/",e);return t}function yH(){return at({mutationFn:e=>DSe(e)})}Er.object({email:ef.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:Er.string().nonempty({error:"Please select a role."})});async function $Se(e){const{data:t}=await Ut.post("/UserInvite/",e);return t}function PSe(){return at({mutationFn:e=>$Se(e)})}function MSe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const{organizationId:r}=tt({strict:!1}),{data:i}=Pi(px(r)),[o,a]=x.useState(!1),c=Xt({resolver:sn(OSe),defaultValues:{email:"",roleId:""}}),{mutate:d,isPending:f}=yH(),{mutate:p,isPending:h}=PSe(),v=x.useCallback(async y=>{y&&(o?p:d)(y,{onSuccess:()=>{const b=y.roleId;c.reset(),c.setValue("roleId",b),t(),_e.success("User invited successfully!"),n(!1),a(!1)},onError:b=>{b?.status===404&&a(!0)}})},[d,c,p,t,n,o]);return u.jsx(zn,{onOpenChange:()=>{n(!1),a(!1),c.reset()},open:e,children:u.jsx(Ln,{"aria-describedby":void 0,children:u.jsx(Qt,{...c,children:u.jsxs("form",{onSubmit:c.handleSubmit(v),className:"grid gap-4 my-4",children:[u.jsx(xr,{children:u.jsx(Nn,{children:o?"Invite User":"Add User"})}),u.jsx(Pe,{control:c.control,name:"email",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Email"}),u.jsx($e,{children:u.jsx(ze,{type:"email",enterKeyHint:"next",autoComplete:"email",...y})}),u.jsx(De,{})]})}),u.jsx(Pe,{control:c.control,name:"roleId",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Roles"}),u.jsx(x.Suspense,{fallback:u.jsx(jr,{}),children:u.jsx($e,{children:u.jsxs(co,{...y,onValueChange:b=>y.onChange(b),children:[u.jsx(fo,{className:"w-full",children:u.jsx(uo,{placeholder:"Choose Role"})}),u.jsx(mo,{children:u.jsxs(Lo,{children:[u.jsx(qj,{children:"Role"}),i?.map(b=>u.jsx(Sn,{value:b.id,children:b.roleName},b.id))]})})]})})}),u.jsx(De,{})]})}),o&&u.jsxs(Ir,{className:"p-3 my-5 text-white rounded-md bg-amber-600 flex",children:[u.jsx(rQ,{className:"inline-block size-12 pr-2"}),u.jsx("span",{children:"This person doesn’t have a Fabric account. Do you want to invite them?"})]}),u.jsx(Un,{children:u.jsx("div",{className:"flex justify-between w-full",children:u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",disabled:f||h,children:[u.jsx(ho,{})," ",o?"Invite User":"Add User"]})})})]})})})})}async function zSe({roleId:e,userId:t}){const{data:n}=await Ut.delete(`/OrganizationRole/role/${e}/user/${t}`);return n}function LSe(){return at({mutationFn:({roleId:e,userId:t})=>zSe({roleId:e,userId:t})})}function bH(e){const[t,n]=x.useState(e||!1),r=x.useCallback(i=>{n(i.target.checked)},[]);return[t,r]}function USe({data:e,readOnly:t,canRemove:n,orgRole:r,selectedRoles:i,setChangesMade:o}){const{mutate:a,isPending:c}=yH(),{mutate:d,isPending:f}=LSe(),p=!!i[r.roleName],[h,v]=x.useState(p),[y,b]=bH(p);return x.useEffect(()=>{y!==h&&(y?a({email:e.email,roleId:r.id},{onSuccess:()=>{v(y),o(!0),_e.success("Role added successfully")}}):d({userId:e.id,roleId:r.id},{onSuccess:()=>{v(y),o(!0),_e.success("Role removed successfully")}}))},[a,e.email,e.id,y,r.id,d,o,h]),u.jsxs(Mp,{className:"flex",children:[u.jsx(ze,{type:"checkbox",className:"w-6",disabled:t||c||f||!n&&y,checked:y,onChange:b}),u.jsx("span",{className:"pl-4 pr-8 flex-1 py-2.5",children:r.roleName})]},r.id)}function FSe({closeModal:e,data:t,isModalOpen:n,onUserUpdated:r}){const{organizationId:i}=tt({strict:!1}),o=cl(),{update:a,remove:c}=Kd(i),d=o.user?.email===t.email,{data:f}=Pi(px(i)),p=x.useMemo(()=>t.roles?rf(t.roles,"roleName"):{},[t]),[h,v]=x.useState(!1);return u.jsx(zn,{onOpenChange:h?r:e,open:n,children:u.jsxs(Ln,{className:"sm:max-w-[750px]",children:[u.jsx(xr,{children:u.jsxs(Nn,{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(USe,{readOnly:!a,canRemove:c,data:t,orgRole:y,selectedRoles:p,setChangesMade:v},y.id))]})})}function VSe(e,t){return e.email>t.email?1:-1}function xH(){const e=pn(),{organizationId:t,orgUserId:n}=tt({strict:!1}),{update:r}=Kd(t),{data:i,refetch:o,isFetching:a,isRefetching:c}=Pi(px(t)),d=x.useMemo(()=>{const N={};for(const T of i)if(T.users)for(const z of T.users)N[z.id]||(N[z.id]={...z,roles:[]}),N[z.id].roles.push(T);return Object.values(N).sort(VSe)},[i]),f=x.useMemo(()=>d?.find(N=>N.id===n),[d,n]),p=x.useCallback(N=>{const T=[n?"..":"",N].filter(Boolean);e({to:T.join("/")})},[n,e]),h=!!n&&!!f,[v,y]=x.useState(!1),[b]=x.useState({attribute:"email",descending:!1}),S=x.useMemo(()=>[{desc:b.descending,id:b.attribute}],[b]),C=x.useCallback(()=>{y(!0)},[y]),E=x.useCallback(()=>{o(),y(!1)},[o,y]),k=x.useCallback(N=>{p(N.original.id)},[p]),j=x.useCallback(()=>{p(void 0)},[p]),I=x.useCallback(()=>{o(),p(void 0)},[p,o]),A=vl(o);return u.jsxs(u.Fragment,{children:[u.jsx(rs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs(x.Suspense,{fallback:u.jsx(Ui,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(af,{data:d,isFetching:a||c,columns:ASe,onRowClick:k,sortingState:S,children:[u.jsxs(be,{variant:"defaultOutline",onClick:A,accessKey:"r",disabled:a||c,children:[u.jsx(sa,{})," ",u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),r&&u.jsxs(be,{variant:"positiveOutline",onClick:C,accessKey:"a",disabled:v,children:[u.jsx(po,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),r&&u.jsx(MSe,{isModalOpen:v,onChangesSaved:E,setIsModalOpen:y}),h&&u.jsx(FSe,{closeModal:j,data:f,isModalOpen:h,onUserUpdated:I})]})})]})}function BSe({organizationRole:e,onDeleteOrgModal:t}){const{organizationId:n,organizationName:r,roleName:i}=e,{remove:o,update:a}=hb(n),c=a,{view:d}=Kd(n),f=x.useCallback(()=>{t(e)},[t,e]);return u.jsxs(fc,{className:"relative h-full justify-between",children:[u.jsxs(ul,{children:[u.jsxs(Cc,{className:"flex items-center justify-between",children:[u.jsx("span",{className:"truncate",children:n}),o&&u.jsxs(eh,{children:[u.jsx(th,{className:"p-4 -m-4 -mr-6 hover:text-white",children:u.jsx($C,{"aria-label":"Options"})}),u.jsxs(nh,{children:[u.jsx(vy,{className:"text-gray-600 text-xs",children:"Options"}),u.jsx(yy,{}),u.jsx(Ge,{to:`${n}`,children:u.jsx(gr,{children:"Clusters"})}),d&&u.jsx(Ge,{to:`${n}/roles`,children:u.jsx(gr,{children:"Roles"})}),d&&u.jsx(Ge,{to:`${n}/users`,children:u.jsx(gr,{children:"Users"})}),c&&u.jsx(Ge,{to:`${n}/billing`,children:u.jsx(gr,{children:"Billing"})}),u.jsx(yy,{}),o&&u.jsx(gr,{className:"focus:bg-red/70 focus:text-white",onClick:f,children:"Delete"})]})]})]}),u.jsx(dl,{children:u.jsx("h2",{children:r})})]}),u.jsxs(es,{className:"flex justify-between",children:[u.jsx(zo,{children:Eo(i)}),u.jsx(Ge,{to:n,className:"text-sm","aria-label":`View ${r}`,title:`View ${r}`,children:u.jsxs("span",{className:"py-2 transition-all duration-100 ease-in-out border-0 hover:border-b-2",children:["View ",u.jsx(ro,{className:"inline-block"})]})})]})]})}async function HSe(e){const{data:t}=await Ut.delete(`/Organization/${e}`);return t}function qSe(){return at({mutationFn:e=>HSe(e)})}async function GSe(e){const{data:t}=await Ut.post("/Organization/",{...e});return t}function KSe(){return at({mutationFn:e=>GSe(e)})}const nv=mn({name:nt().max(255,{error:"Name cannot be longer than 255 characters."}),subdomain:nt().max(62,{error:"The subdomain cannot be longer than 62 characters."}).regex(/^[a-zA-Z0-9-]*$/,{error:"Please only use letters, digits and dashes (-) in the subdomain."})});function ZSe(){const{user:e}=cl(),t=pn(),n=Xt({resolver:sn(nv),defaultValues:{name:"",subdomain:""}}),{setFocus:r,watch:i}=n;x.useEffect(()=>{r("name")},[r]);const o=`${e?.firstname} ${e?.lastname} Org`,a=i("name")||o,c=i("subdomain"),d=x.useMemo(()=>{const y=sB(ix(a),nv.shape.subdomain.maxLength);return{suggestedSubdomain:y,fullHostName:`future-cluster-names.${c||y}.harperfabric.com`}},[a,c]),{mutate:f,isPending:p}=KSe(),h=yr(),v=x.useCallback(async y=>{f({name:y.name||o,subdomain:y.subdomain||d.suggestedSubdomain},{onSuccess:b=>{h.invalidateQueries({queryKey:By,refetchType:"active"}),Tt.reloadUser(_n),t({to:`/${b.id}`})}})},[d.suggestedSubdomain,h,f,o,t]);return u.jsx(u.Fragment,{children:u.jsx(Qt,{...n,children:u.jsxs("form",{onSubmit:n.handleSubmit(v),className:"grid gap-6 text-white max-w-xl",children:[u.jsx(Pe,{control:n.control,name:"name",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Name"}),u.jsx($e,{children:u.jsx(ze,{type:"text",maxLength:nv.shape.name.maxLength,autoCapitalize:"words",placeholder:o,...y})}),u.jsx(De,{})]})}),u.jsx(Pe,{control:n.control,name:"subdomain",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Subdomain"}),u.jsx($e,{children:u.jsx(ze,{type:"text",maxLength:nv.shape.subdomain.maxLength,autoCapitalize:"none",placeholder:d.suggestedSubdomain,...y})}),u.jsx(De,{})]})}),u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Full Host Name"}),u.jsx($e,{children:u.jsx("span",{children:d.fullHostName})}),u.jsx(De,{})]}),u.jsx(Un,{children:u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",disabled:p,children:["Create New Organization ",u.jsx(ro,{})]})})]})})})}function wH(){return u.jsxs(u.Fragment,{children:[u.jsx(rs,{}),u.jsx("section",{className:"mt-40 md:mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx(ZSe,{})})]})}function YSe(){const e=yr(),{data:t}=Pi(eZ()),{mutate:n,isPending:r}=qSe(),[i,o]=x.useState(!1),[a,c]=x.useState(null),[d,f]=x.useState(""),p=x.useCallback(()=>f(""),[]),h=x.useMemo(()=>{const C=t?.roles||{},E=Object.values(C);return Object.keys(C).map((j,I)=>({organizationId:j,organizationName:E[I].organizationName,roleName:E[I].role})).filter(WB(["organizationId","organizationName"],d)).sort((j,I)=>(j.organizationName||"")>(I.organizationName||"")?1:-1)||[]},[d,t?.roles]),v=x.useCallback(C=>{f(C.currentTarget.value?.toLowerCase()||"")},[]),y=x.useCallback(C=>{C?.organizationId&&n(C.organizationId,{onSuccess:()=>{_e.success("Success",{description:"Organization successfully deleted.",duration:5e3,action:{label:"Dismiss",onClick:()=>_e.dismiss()}}),e.invalidateQueries({queryKey:[]}),o(!1)},onError:()=>o(!1)})},[n,e,o]),b=x.useCallback(C=>{c(C),o(!0)},[]),{createCluster:S}=br({strict:!1});return h.length===1&&!d.length&&S?u.jsx(ic,{to:`/${h[0].organizationId}/new-cluster`,replace:!0}):!h.length&&!d.length?u.jsx(wH,{}):u.jsxs(u.Fragment,{children:[u.jsx(rs,{children:u.jsxs("div",{className:"flex w-full justify-end gap-2",children:[u.jsx(ze,{placeholder:"Filter by name",className:"inline-block w-48 md:w-64 bg-black border",value:d,onChange:v}),u.jsx(Ge,{to:"/new-org",children:u.jsxs(be,{variant:"positive",className:"rounded-full w-44",accessKey:"n",children:[u.jsx(po,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"N"}),"ew Organization"]})]})})]})}),u.jsx("section",{className:"mt-40 md:mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-12",children:[h.map(C=>u.jsx("div",{className:"col-span-1 md:col-span-4 lg:col-span-3 2xl:col-span-2",children:u.jsx(BSe,{organizationRole:C,onDeleteOrgModal:b})},C.organizationId)),!h.length&&u.jsxs("div",{className:"col-span-1 md:col-span-12 text-center",children:[u.jsx("h2",{className:"my-4 text-xl",children:"No matches found."}),u.jsx(be,{variant:"outline",onClick:p,children:"Clear Filters"})]})]})}),a&&u.jsx(ex,{typeOfThingBeingDeleted:"organization",nameOfThingBeingDeleted:a.organizationName,isModalOpen:i,setIsModalOpen:()=>o(!1),deletionConfirmed:()=>y(a),deletionPending:r})]})}function WSe(){const{isLoading:e}=_c(),{createCluster:t}=br({strict:!1}),[,n]=nf(Mc.SavedClusterState,null);return x.useEffect(()=>{t&&n(t)},[t,n]),e?u.jsx(Ui,{className:"fixed z-50 translate-1/2"}):u.jsxs(u.Fragment,{children:[u.jsx("header",{className:"fixed top-0 z-40 w-full h-20 p-4 bg-black-dark dark:bg-black-dark dark:border-b dark:border-black md:px-12",children:u.jsx(dL,{})}),u.jsx("main",{children:u.jsx(ll,{})})]})}const XSe=["/","/forgot-password","/reset-password","/sign-in","/sign-up","/verify-email"];function SH(){const e=XB();return!XSe.includes(e)&&{redirect:e}}const vx=Qe({getParentRoute:()=>fb,id:"_dashboardLayout",component:WSe,beforeLoad:({context:e})=>{const t=e.authentication[_n];if(t&&!t.isLoading&&!t.user)throw Sc({to:"/sign-in",search:SH()})}}),Xj=Qe({getParentRoute:()=>vx,id:"_orgsLayout"});Qe({getParentRoute:()=>Xj,path:"/",component:YSe});Qe({getParentRoute:()=>Xj,path:"/new-org",component:wH});const Lc=Qe({getParentRoute:()=>Xj,path:"$organizationId",beforeLoad:async e=>({organization:await e.context.queryClient.ensureQueryData(zc(e.params.organizationId))})}),QSe=Qe({getParentRoute:()=>Lc,path:"/roles",component:vH}),JSe=Qe({getParentRoute:()=>Lc,path:"/roles/$orgRoleId",component:vH}),e_e=Qe({getParentRoute:()=>Lc,path:"/users",component:xH}),t_e=Qe({getParentRoute:()=>Lc,path:"/users/$orgUserId",component:xH});uwe(Lc);const _H=Qe({getParentRoute:()=>Lc,id:"_clusterLayout"});Qe({getParentRoute:()=>_H,path:"/",component:s0e});Qe({getParentRoute:()=>Lc,path:"/new-cluster",component:Gj});Qe({getParentRoute:()=>Qa,path:"/edit",component:Gj});function n_e(){return u.jsx(ll,{})}const Qa=Qe({getParentRoute:()=>_H,path:"$clusterId",component:n_e,beforeLoad:async({context:e,params:t})=>({cluster:await e.queryClient.ensureQueryData(Ac(t.clusterId))})}),Wu=mn({username:_j,role:nt().nonempty({error:"Please select a role."}),password:Yp.min(8,{error:"Password must be at least 8 characters long."}),confirmPassword:nt()}).refine(e=>e.password===e.confirmPassword,{error:"Passwords do not match.",path:["confirmPassword"]});async function r_e(e){await Ut.patch(`/ResetPasswordUpdater/${e}`)}async function CH(e){const{instanceClient:t,...n}=e,{data:r}=await t.post("/",{operation:"add_user",...n});return r}function i_e(){return at({mutationFn:CH})}async function EH({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 o_e(){return at({mutationFn:EH})}async function kH({username:e,instanceClient:t}){const{data:n}=await t.post("/",{operation:"drop_user",username:e});return n}function a_e(){return at({mutationFn:kH})}async function s_e({clusterId:e,initialUsername:t,desiredUsername:n,newPassword:r,tempPassword:i,instanceClient:o}){if(!i)throw new Error("You may not have permission to set the password on this cluster.");let a=o;try{const c=await w1({username:t,password:i,instanceClient:a,entityId:e});return c.instanceClient&&(a=c.instanceClient),n===R_?await EH({username:n,password:r,instanceClient:a}):(await CH({username:n,password:r,role:"super_user",active:!0,instanceClient:a}),await kH({username:R_,instanceClient:a}),await w1({username:n,password:r,instanceClient:a,entityId:e})),await r_e(e),c}catch(c){throw await yp({entityId:e,instanceClient:a}),c}}function l_e(){return at({mutationFn:s_e})}function c_e(){const{user:e}=cl(),{clusterId:t}=tt({strict:!1}),{data:n}=Pt(Ac(t,!0)),r=pn(),i=x.useMemo(()=>CC(n),[n]),o=mb(i),{redirect:a}=br({strict:!1}),c=on(),d=Xt({resolver:sn(Wu),defaultValues:{confirmPassword:"",password:"",role:"super_user",username:e?.email??""}}),{setFocus:f,control:p,handleSubmit:h}=d;x.useEffect(()=>{f("password")},[f]);const v=n?.instances?.find(C=>C.tempPassword)?.tempPassword,{mutate:y,isPending:b}=l_e(),S=x.useCallback(async C=>{if(!i){_e.error("Cluster is not yet fully loaded, please wait a moment before trying to sign in.");return}y({instanceClient:o,clusterId:t,newPassword:C.password,tempPassword:v,initialUsername:R_,desiredUsername:C.username},{onSuccess:async({message:E,user:k})=>{_e.success(E),Tt.setUserForEntity(n,k),c.invalidate(),await r({to:a?.startsWith("/")?a:pC})}})},[n,t,o,r,i,a,c,y,v]);return n&&!n.resetPassword?u.jsx(ic,{to:"../sign-in",replace:!0}):u.jsxs(u.Fragment,{children:[u.jsx("nav",{className:"fixed top-20 w-full h-12 z-39 px-4 md:px-12 bg-grey-700 flex items-center",children:u.jsx(kb,{})}),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(Qt,{...d,children:u.jsxs("form",{onSubmit:h(S),className:"my-4",children:[u.jsx(Pe,{control:p,name:"username",render:({field:C})=>u.jsxs(Ae,{className:"my-4",children:[u.jsx(Oe,{children:"Username"}),u.jsx($e,{children:u.jsx(ze,{autoComplete:"username",type:"text",...C})}),u.jsx(De,{})]})}),u.jsx(Pe,{control:p,name:"password",render:({field:C})=>u.jsxs(Ae,{className:"my-4",children:[u.jsx(Oe,{children:"Password"}),u.jsx($e,{children:u.jsx(ze,{type:"password",...C})}),u.jsx(De,{})]})}),u.jsx(Pe,{control:p,name:"confirmPassword",render:({field:C})=>u.jsxs(Ae,{className:"my-4",children:[u.jsx(Oe,{children:"Confirm Password"}),u.jsx($e,{children:u.jsx(ze,{type:"password",...C})}),u.jsx(De,{})]})}),u.jsx(be,{disabled:b,type:"submit",variant:"submit",className:"w-full my-2 rounded-full",children:"Create Admin User"})]})}),u.jsxs("p",{className:"text-muted-foreground flex gap-2 align-middle",children:[u.jsx(VW,{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 u_e({columns:e,data:t}){const n=dx({data:t,columns:e,getCoreRowModel:ux()});return u.jsx("div",{className:"bg-black-dark rounded-md",children:u.jsxs(fx,{children:[u.jsx(rh,{children:n.getHeaderGroups().map(r=>u.jsx(Ai,{className:"border-none",children:r.headers.map(i=>u.jsx(Wj,{className:"p-4",style:{width:`${i.getSize()}%`},children:i.isPlaceholder?null:wc(i.column.columnDef.header,i.getContext())},i.id))},r.id))}),u.jsx(mx,{className:"bg-black",children:n.getRowModel().rows?.length?n.getRowModel().rows.map(r=>u.jsx(Ai,{"data-state":r.getIsSelected()&&"selected",className:"hover:bg-muted/10 data-[state=selected]:bg-muted",children:r.getVisibleCells().map(i=>u.jsx(Xa,{className:"p-4",style:{width:`${i.column.getSize()}%`},children:wc(i.column.columnDef.cell,i.getContext())},i.id))},r.id)):u.jsx(Ai,{children:u.jsx(Xa,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})})}function d_e(){return u.jsx("div",{className:"flex-col items-center justify-center px-16 space-y-3 text-center pt-30",children:u.jsx("p",{children:"No instances found."})})}function f_e({isSelfManaged:e,instance:t}){const{user:n,isLoading:r}=Ja(t.id),i=x.useMemo(()=>EC(t),[t]),o=mb(i),{update:a}=Fle(),c=Tt.checkForFabricConnect(t.id),d=x.useCallback(async()=>{await yp({instanceClient:o,entityId:t.id}),Tt.setUserForEntity(t,null)},[t,o]);return r||!["CLONE_READY","RUNNING","UPDATED"].includes(t.status)?u.jsx(DM,{className:"animate-spin",color:"gray"}):!n||c?u.jsxs("span",{className:"flex gap-4",children:[a&&!e&&u.jsx(Ge,{to:`../instance/${t.id}${oa}`,className:"text-sm","aria-label":`Connect to ${t.name} instance`,title:`Connect to ${t.name} instance`,children:u.jsx(be,{variant:"positiveOutline",children:"Fabric Connect"})}),u.jsx(Ge,{to:`../instance/${t.id}/sign-in`,className:"text-sm","aria-label":`Sign in to ${t.name} instance`,title:`Sign in to ${t.name} instance`,children:u.jsx(be,{variant:a?"defaultOutline":"positiveOutline",children:"Direct Sign In"})})]}):u.jsxs("span",{className:"flex gap-4",children:[u.jsx(Ge,{to:`../instance/${t.id}${oa}`,className:"text-sm","aria-label":`Go to ${t.name} instance`,title:`Go to ${t.name} instance`,children:u.jsx(be,{variant:"positiveOutline",children:"Direct Connect"})}),u.jsx(be,{variant:"destructiveOutline",className:"text-sm","aria-label":`Sign out from ${t.name} instance`,title:`Sign out from ${t.name} instance`,onClick:d,children:"Direct Sign Out"})]})}function m_e(){const{clusterId:e}=tt({strict:!1}),{data:t,isLoading:n}=Pt(Ac(e,!0)),r=Uj(t),i=x.useMemo(()=>[{id:"instanceActions",size:1,minSize:1,cell:a=>u.jsx("div",{className:"flex justify-end",children:u.jsx(f_e,{isSelfManaged:r,instance:a.row.original})})},r&&{accessorKey:"instanceFqdn",size:90,header:"URL",cell:a=>ZB({secure:a.row.original.operationsApiSecure?"true":"false",port:a.row.original.operationsApiPort,fqdn:a.row.original.instanceFqdn})},!r&&{accessorKey:"name",size:90,header:"Name"},!r&&{accessorKey:"status",header:"Status",size:1,minSize:1,cell:a=>{const c=a.getValue();return u.jsx(zo,{variant:B5(c),children:Eo(c)})}},!r&&{accessorKey:"version",size:1,minSize:1,header:"Version"},!r&&{accessorKey:"storageGb",size:1,minSize:1,header:"Storage",cell:a=>{const c=a.getValue();return Pa(c,Math.pow(1024,3))}},!r&&{accessorKey:"cpuCores",size:1,minSize:1,header:"Cores/Threads",cell:a=>u.jsxs(u.Fragment,{children:[a.row.original.cpuCores," / ",a.row.original.threads]})},!r&&{accessorKey:"memoryMb",size:1,minSize:1,header:"Memory",cell:a=>{const c=a.getValue();return Pa(c,Math.pow(1024,2))}}].filter(fa),[r]),o=x.useMemo(()=>t?.instances?t.instances.filter(a=>a.status&&!ME.includes(a.status)).sort(oB):[],[t]);return u.jsxs(u.Fragment,{children:[u.jsx(rs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx(fc,{className:"p-0 mt-4 min-h-96",children:u.jsx(es,{className:"p-0 min-h-96",children:n?u.jsx(jr,{}):o.length?u.jsx(u_e,{data:o,columns:i}):u.jsx(d_e,{})})})})]})}function Jl({children:e,className:t}){return u.jsxs(u.Fragment,{children:[u.jsx(rs,{}),u.jsx("div",{className:aa("mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))] flex justify-center",t),children:e})]})}function p_e(){const{clusterId:e}=tt({strict:!1}),{data:t,isLoading:n}=Pt(Ac(e,2e3)),r=t?.status,i=x.useMemo(()=>r&&Tb.includes(r),[r]);return n||!t?u.jsx(Jl,{className:"flex justify-center",children:u.jsx(jr,{})}):i?u.jsx(Jl,{className:"flex justify-center",children:u.jsxs("div",{className:"center w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"All done!"}),u.jsx(lp,{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(Fj,{cluster:t})})]})}):u.jsx(Jl,{className:"flex justify-center",children:u.jsxs("div",{className:"center w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"Here we go!"}),u.jsx(lp,{cluster:t,forceProgressBarVisible:!0}),u.jsxs("p",{children:["Your cluster is updating with the latest changes. This includes waiting several minutes to let traffic drain safely.",u.jsxs("span",{className:"text-muted-foreground",children:["We will let you know when we are ready for you to connect! In the meantime, join us on ",u.jsx("a",{href:"https://discord.gg/VzZuaw3Xay",target:"_blank",children:"Discord"}),"! Get real-time help from our engineers, see feature drops early, and connect with others building on Fabric."]})]})]})})}function h_e(){const e=on(),{clusterId:t}=tt({strict:!1}),{data:n,isLoading:r}=Pt(Ac(t,2e3)),i=n?.status,o=x.useMemo(()=>i&&Tb.includes(i),[i]),a=Wp(i),[,c]=nf(Mc.SavedClusterState,null),d=x.useCallback(()=>{c(n),e.navigate({to:`/${n.organizationId}/new-cluster`})},[n,e,c]);return r||!n?u.jsx(Jl,{className:"flex justify-center",children:u.jsx(jr,{})}):a?u.jsx(Jl,{className:"flex justify-center",children:u.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4 items-center",children:[u.jsx(fX,{className:"w-24 h-24"}),u.jsxs("span",{children:["Your cluster failed to successfully start. This is usually caused by temporary communication problems. Would you like to try again? We also get notified about these failures. ",u.jsx(al,{})," if you want more help."]}),u.jsx(be,{type:"button",variant:"positiveOutline",onClick:d,children:"Try Again"})]})}):o?u.jsx(Jl,{className:"flex justify-center",children:u.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"It's ready!"}),u.jsx(lp,{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(Fj,{cluster:n})})]})}):u.jsx(Jl,{className:"flex justify-center",children:u.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"Here we go!"}),u.jsx(lp,{cluster:n,forceProgressBarVisible:!0}),u.jsxs("p",{children:["Your cluster is spinning up with the latest changes, including your own DNS records and private connections. Please wait while we get everything going.",u.jsxs("span",{className:"text-muted-foreground",children:["We will let you know when we are ready for you to connect! In the meantime, join us on ",u.jsx("a",{href:"https://discord.gg/VzZuaw3Xay",target:"_blank",children:"Discord"}),"! Get real-time help from our engineers, see feature drops early, and connect with others building on Fabric."]})]})]})})}Qe({getParentRoute:()=>Qa,path:"instances",component:m_e});Qe({getParentRoute:()=>Qa,path:"starting-up",component:h_e});Qe({getParentRoute:()=>Qa,path:"scaling",component:p_e});Qe({getParentRoute:()=>Qa,path:"sign-in",component:Cj,beforeLoad:({context:e,location:t,params:n})=>{const r=Tt.checkForFabricConnect(n.clusterId);if(e.authentication[n.clusterId]?.user&&!r){const i=t?.search;throw Sc({to:i?.redirect?.startsWith("/")?i.redirect:pC})}}});Qe({getParentRoute:()=>Qa,path:"instance/$instanceId/sign-in",component:Cj,beforeLoad:({context:e,location:t,params:n})=>{if(!(Tt.checkForFabricConnect(n.clusterId)||Tt.checkForFabricConnect(n.instanceId))&&e.authentication[n.instanceId]?.user){const i=t?.search;throw Sc({to:i?.redirect?.startsWith("/")?i.redirect:pC})}}});Qe({getParentRoute:()=>Qa,path:"finish-setup",component:c_e});function g_e(e){return Qe({getParentRoute:()=>e,path:"apis"}).lazy(()=>Np(()=>import("./index.lazy-4dmLPM-x.js"),__vite__mapDeps([0,1,2])).then(t=>t.route))}async function v_e(e,t=3,n=1e3){let r=0;if(t<=0)throw new Error("retries must be greater than 0");let i;for(;r<t;)try{return await e()}catch(o){if(r++,i=o,r===t)break;await bp(n)}throw i}async function jH({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 bp(1e4),await v_e(()=>qs({instanceClient:n,timeout:3e3}),12,15e3),r}function y_e(){return at({mutationFn:jH})}function b_e({onRestartedSuccessfully:e}={}){const{clusterId:t}=tt({strict:!1}),n=yr(),[r,i]=x.useState(!1);return{onRestartClick:x.useCallback(async()=>{if(!t)throw new Error("clusterId must be set in the route to invoke useRestartClusterClick");i(!0);let a=!1;const c={duration:6e4,action:{label:"Cancel",onClick:()=>{a=!0}}},d=_e.loading("Restarting",{...c,description:u.jsx(cp,{animated:!0,width:"0%"})}),f=await zE(t),p=Tt.checkForFabricConnect(f.id),h=f?.instances??[],v=h.filter(b=>b.status==="RUNNING").map(b=>Va({id:b.id,forceFabricConnect:p,operationsUrl:EC(b)})).reverse();let y=0;if(v.length)for(let b=0;b<v.length;b++){const S=v[b];if(!a){_e.loading(`Restarting Instance ${b+1} of ${v.length}`,{...c,id:d,description:u.jsx(cp,{animated:!0,width:(b===0?0:b/v.length*100)+"%"})});try{await qs({instanceClient:S}),await jH({operation:"restart",replicated:!1,instanceClient:S}),y+=1}catch{b+1!==v.length&&(_e.loading(`Failed Restarting Instance ${b+1} of ${v.length}`,{...c,id:d,description:"We will carry on momentarily."}),await bp(3e3))}}}if(i(!1),n.invalidateQueries({queryKey:[t]}),a)_e.error("Cancelled",{id:d,description:"The restart was partially cancelled.",duration:1e4,action:{label:"Dismiss",onClick:()=>_e.dismiss()}});else if(h.length===y)e?.(),_e.success("Success",{id:d,description:"Cluster fully restarted!",duration:1e4,action:{label:"Dismiss",onClick:()=>_e.dismiss()}});else{const b=Io(h.length,"instance","instances"),S=Io(y,'"RUNNING" instance was','"RUNNING" instances were');_e.error("Error",{id:d,description:`Failed to fully restart cluster.
128
128
  `+([h.length===0&&"No instances were found within the cluster to restart.",y===0&&`No instances were in a "RUNNING" state of ${b}.`,h.length!==y&&`Only ${S} restarted of ${b}.`].filter(fa).shift()||""),duration:1e4,action:{label:"Dismiss",onClick:()=>_e.dismiss()}})}},[t,e,n]),isRestartPending:r}}function x_e({operation:e,instanceClient:t,onRestartedSuccessfully:n}){const{clusterId:r,instanceId:i}=tt({strict:!1}),o="Instance",{mutate:a,isPending:c}=y_e(),d=yr();return{onRestartClick:x.useCallback(()=>{const p=_e.loading("Restarting",{description:`Restarting ${o.toLowerCase()}. This may take up to 60 seconds.`,duration:18e4,action:{label:"Dismiss",onClick:()=>_e.dismiss()}});a({operation:e,replicated:e==="restart_service"&&o==="Cluster",instanceClient:t},{onSuccess:()=>{d.invalidateQueries({queryKey:[r]}),d.invalidateQueries({queryKey:[i]}),_e.dismiss(p),_e.success("Success",{description:`${o} restarted!`,action:{label:"Dismiss",onClick:()=>_e.dismiss()}}),n?.()},onError:()=>{_e.dismiss(p),_e.error("Error",{description:`Failed to restart ${o.toLowerCase()}.`,action:{label:"Dismiss",onClick:()=>_e.dismiss()}})}})},[r,t,i,n,e,d,a,o]),isRestartPending:c}}function RH({className:e,disabled:t,hideText:n,instanceClient:r,operation:i,targetNoun:o,tooltip:a,variant:c}){const{onRestartClick:d,isRestartPending:f}=b_e(),{onRestartClick:p,isRestartPending:h}=x_e({operation:i,instanceClient:r});return u.jsxs(_b,{children:[u.jsx(Cb,{asChild:!0,children:u.jsxs(be,{variant:c||"positiveOutline",className:aa("mx-0 md:mx-4 rounded-full",e),onClick:o==="Cluster"&&i==="restart"?d:p,disabled:t||h||f,children:[u.jsx(xQ,{}),n!==!0&&u.jsxs("span",{className:"hidden md:inline-block",children:["Restart ",o]})]})}),u.jsx(Eb,{children:a||(i==="restart_service"?"Restarts all service threads to apply changes. No downtime expected. Performance may be briefly slower during restart.":"This fully restarts the Harper service and causes downtime.")})]})}const o_="__root__",Hl="importedApplications",Ro="newApplication";function B2(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!r.includes(i)||e[i]!==t[i])return!1;return!0}function Iv(e,t){const[n,r]=x.useState(t),[i,o]=x.useState(e);return x.useEffect(()=>{B2(n,t)||(r(t),o(e))},[n,t,e]),B2(n,t)?[i,o]:[e,o]}const Hu={};function ky(e,t,n){const r=x.useCallback(i=>t(i),[n]);x.useEffect(()=>(Hu[e]||(Hu[e]=[]),Hu[e].push(r),function(){const o=Hu[e].indexOf(r);o>=0&&Hu[e].splice(o,1)}),[e,t,r])}function yx(e,t){const n=Hu[e];if(n)for(const r of n)r(t)}function H2(e,t){return()=>yx(e,t)}function q2(e,t){return x.useCallback(()=>yx(e,t),[e,t])}function G2(e,t){return Vj(sessionStorage.getItem(String(e)))??t}function w_e(e,t){t==null?sessionStorage.removeItem(String(e)):sessionStorage.setItem(String(e),JSON.stringify(t))}function od(e,t){const n=Iv(G2(e,t),[e]),[r,i]=n;return x.useEffect(()=>{w_e(e,r),yx(`Session:${e}`,r)},[e,r]),ky(`Session:${e}`,function(a){r!==a&&i(a)},[r,e,t]),x.useEffect(function(){const a=c=>{c.key===e&&i(G2(e,t))};return window.addEventListener("storage",a),()=>{window.removeEventListener("storage",a)}},[e,i,t]),n}function bx(e){const{instanceId:t,clusterId:n}=tt({strict:!1}),r=_n,[i,o]=od(`EditorFileContent/${r}}/${e}`,void 0);return x.useMemo(()=>({content:e?i:void 0,setContent:o}),[e,i,o])}function Lr(e){return!!e?.entries}const IH=x.createContext(null);function mi(){return x.useContext(IH)}function Uc(e,t){const[n,r]=x.useState(t);return ky(e,i=>r(i),[r]),n}function Nd(e,t){yx(e,t)}function rv(e,t){return()=>Nd(e,t)}function li(e,t){return x.useCallback(()=>Nd(e,t),[e,t])}function S_e({toggledSidebar:e,toggleSidebar:t}){const n=Ft(),{openedEntryContents:r,openedEntry:i,isSavingFile:o,restrictPackageModification:a}=mi(),{content:c}=bx(i?.path),d=Zd(),f=n.entityType==="instance"?"Instance":"Cluster",p=li("ShowAddDirectoryOrFileModalType","file"),h=li("ShowAddDirectoryOrFileModalType","directory"),v=li("ShowDownloadApplicationModal",!0),y=li("ShowRenameFileModal",!0),b=li("ShowDeleteDirectoryOrFileModal",!0),S=li("ShowRedeployApplicationModal",!0),C=q2("SaveFile",!0),E=q2("RevertChanges",!0),k=c===void 0||c===r;return u.jsxs("div",{className:"absolute top-0 right-0 left-0 backdrop-blur-sm bg-black-10 shadow-xl flex pr-4 md:pr-12",children:[u.jsxs(be,{variant:"ghost",className:(e?"toggled-sidebar-toggler":"hidden-sidebar-toggler")+" inline-flex text-sm md:hidden focus:outline-none focus:ring-2 text-white hover:text-grey focus:ring-gray-600 rounded-none",onClick:t,children:[u.jsxs("span",{className:"sr-only",children:[e?"Close":"Open"," sidebar"]}),e?u.jsx(dQ,{}):u.jsx(cQ,{})]}),i&&i?.path!==Ro&&u.jsxs(u.Fragment,{children:[i.package&&u.jsxs(_b,{children:[u.jsx(Cb,{asChild:!0,children:u.jsxs(be,{variant:"ghost",type:"button",className:"cursor-help",children:[u.jsx(JX,{width:16,height:16}),u.jsx("span",{className:"hidden md:inline-block",children:"Imported applications are read-only"})]})}),u.jsx(Eb,{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."})})]}),!Lr(i)&&!i.package&&d&&u.jsxs(be,{variant:"default",className:"rounded-none",onClick:C,disabled:k||o,children:[u.jsx(ho,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"S"}),"ave"]})]}),!Lr(i)&&!i.package&&d&&u.jsxs(be,{variant:"ghost",className:"rounded-none",onClick:y,disabled:!k||o,children:[u.jsx(PM,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"ename"]})]}),!i.package&&d&&u.jsxs(be,{variant:"ghost",className:"rounded-none",onClick:p,children:[u.jsx(kX,{}),u.jsxs("span",{children:[u.jsx("u",{children:"N"}),"ew",u.jsx("span",{className:"hidden mlg:inline-block",children:" File"})]})]}),!i.package&&d&&u.jsxs(be,{variant:"ghost",className:"rounded-none",onClick:h,children:[u.jsx(RX,{}),u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd",u.jsx("span",{className:"hidden xl:inline-block",children:" Directory"})]})]}),i.project&&u.jsxs(be,{variant:"ghost",className:"rounded-none",onClick:v,children:[u.jsx(TM,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:["Download",u.jsx("span",{className:"hidden xl:inline-block",children:" Application"})]})]}),!!i.package&&d&&!a&&u.jsxs(be,{variant:"ghost",className:"rounded-none",onClick:S,children:[u.jsx(MC,{}),u.jsxs("span",{children:["Redeploy ",u.jsx("u",{children:"P"}),"ackage"]})]}),u.jsx("div",{className:"grow"}),d&&u.jsx(RH,{targetNoun:f,instanceClient:n.instanceClient,operation:"restart_service",variant:"ghost",className:"rounded-none mx-0 md:mx-0",disabled:!k||o}),!Lr(i)&&!i.package&&d&&u.jsxs(be,{variant:"ghost",className:"rounded-none",onClick:E,disabled:k||o,children:[u.jsx($Q,{}),u.jsx("span",{className:"hidden xl:inline-block",children:"Revert Changes"})]}),!a&&d&&u.jsxs(be,{variant:"destructiveGhost",className:"rounded-none",onClick:b,children:[u.jsx(ts,{}),u.jsxs("span",{className:"hidden xl:inline-block",children:[u.jsx("u",{children:"D"}),"elete"]})]})]})]})}function __e(e){return x.useCallback((t,n,r)=>{if(n!=="href")return t;if(t.startsWith("http"))return r.properties.target="_blank",t;{const i=QB().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 C_e(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const E_e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,k_e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,j_e={};function K2(e,t){return(j_e.jsx?k_e:E_e).test(e)}const R_e=/[ \t\n\f\r]/g;function I_e(e){return typeof e=="object"?e.type==="text"?Z2(e.value):!1:Z2(e)}function Z2(e){return e.replace(R_e,"")===""}class ah{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ah.prototype.normal={};ah.prototype.property={};ah.prototype.space=void 0;function NH(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new ah(n,r,t)}function W1(e){return e.toLowerCase()}class pi{constructor(t,n){this.attribute=n,this.property=t}}pi.prototype.attribute="";pi.prototype.booleanish=!1;pi.prototype.boolean=!1;pi.prototype.commaOrSpaceSeparated=!1;pi.prototype.commaSeparated=!1;pi.prototype.defined=!1;pi.prototype.mustUseProperty=!1;pi.prototype.number=!1;pi.prototype.overloadedBoolean=!1;pi.prototype.property="";pi.prototype.spaceSeparated=!1;pi.prototype.space=void 0;let N_e=0;const ht=Fc(),Kn=Fc(),X1=Fc(),ke=Fc(),tn=Fc(),ad=Fc(),_i=Fc();function Fc(){return 2**++N_e}const Q1=Object.freeze(Object.defineProperty({__proto__:null,boolean:ht,booleanish:Kn,commaOrSpaceSeparated:_i,commaSeparated:ad,number:ke,overloadedBoolean:X1,spaceSeparated:tn},Symbol.toStringTag,{value:"Module"})),a_=Object.keys(Q1);class Qj extends pi{constructor(t,n,r,i){let o=-1;if(super(t,n),Y2(this,"space",i),typeof r=="number")for(;++o<a_.length;){const a=a_[o];Y2(this,a_[o],(r&Q1[a])===Q1[a])}}}Qj.prototype.defined=!0;function Y2(e,t,n){n&&(e[t]=n)}function sf(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Qj(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[W1(r)]=r,n[W1(o.attribute)]=r}return new ah(t,n,e.space)}const TH=sf({properties:{ariaActiveDescendant:null,ariaAtomic:Kn,ariaAutoComplete:null,ariaBusy:Kn,ariaChecked:Kn,ariaColCount:ke,ariaColIndex:ke,ariaColSpan:ke,ariaControls:tn,ariaCurrent:null,ariaDescribedBy:tn,ariaDetails:null,ariaDisabled:Kn,ariaDropEffect:tn,ariaErrorMessage:null,ariaExpanded:Kn,ariaFlowTo:tn,ariaGrabbed:Kn,ariaHasPopup:null,ariaHidden:Kn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:tn,ariaLevel:ke,ariaLive:null,ariaModal:Kn,ariaMultiLine:Kn,ariaMultiSelectable:Kn,ariaOrientation:null,ariaOwns:tn,ariaPlaceholder:null,ariaPosInSet:ke,ariaPressed:Kn,ariaReadOnly:Kn,ariaRelevant:null,ariaRequired:Kn,ariaRoleDescription:tn,ariaRowCount:ke,ariaRowIndex:ke,ariaRowSpan:ke,ariaSelected:Kn,ariaSetSize:ke,ariaSort:null,ariaValueMax:ke,ariaValueMin:ke,ariaValueNow:ke,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function AH(e,t){return t in e?e[t]:t}function OH(e,t){return AH(e,t.toLowerCase())}const T_e=sf({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ad,acceptCharset:tn,accessKey:tn,action:null,allow:null,allowFullScreen:ht,allowPaymentRequest:ht,allowUserMedia:ht,alt:null,as:null,async:ht,autoCapitalize:null,autoComplete:tn,autoFocus:ht,autoPlay:ht,blocking:tn,capture:null,charSet:null,checked:ht,cite:null,className:tn,cols:ke,colSpan:null,content:null,contentEditable:Kn,controls:ht,controlsList:tn,coords:ke|ad,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ht,defer:ht,dir:null,dirName:null,disabled:ht,download:X1,draggable:Kn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ht,formTarget:null,headers:tn,height:ke,hidden:X1,high:ke,href:null,hrefLang:null,htmlFor:tn,httpEquiv:tn,id:null,imageSizes:null,imageSrcSet:null,inert:ht,inputMode:null,integrity:null,is:null,isMap:ht,itemId:null,itemProp:tn,itemRef:tn,itemScope:ht,itemType:tn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ht,low:ke,manifest:null,max:null,maxLength:ke,media:null,method:null,min:null,minLength:ke,multiple:ht,muted:ht,name:null,nonce:null,noModule:ht,noValidate:ht,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ht,optimum:ke,pattern:null,ping:tn,placeholder:null,playsInline:ht,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ht,referrerPolicy:null,rel:tn,required:ht,reversed:ht,rows:ke,rowSpan:ke,sandbox:tn,scope:null,scoped:ht,seamless:ht,selected:ht,shadowRootClonable:ht,shadowRootDelegatesFocus:ht,shadowRootMode:null,shape:null,size:ke,sizes:null,slot:null,span:ke,spellCheck:Kn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ke,step:null,style:null,tabIndex:ke,target:null,title:null,translate:null,type:null,typeMustMatch:ht,useMap:null,value:Kn,width:ke,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:tn,axis:null,background:null,bgColor:null,border:ke,borderColor:null,bottomMargin:ke,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ht,declare:ht,event:null,face:null,frame:null,frameBorder:null,hSpace:ke,leftMargin:ke,link:null,longDesc:null,lowSrc:null,marginHeight:ke,marginWidth:ke,noResize:ht,noHref:ht,noShade:ht,noWrap:ht,object:null,profile:null,prompt:null,rev:null,rightMargin:ke,rules:null,scheme:null,scrolling:Kn,standby:null,summary:null,text:null,topMargin:ke,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ke,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ht,disableRemotePlayback:ht,prefix:null,property:null,results:ke,security:null,unselectable:null},space:"html",transform:OH}),A_e=sf({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:_i,accentHeight:ke,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ke,amplitude:ke,arabicForm:null,ascent:ke,attributeName:null,attributeType:null,azimuth:ke,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ke,by:null,calcMode:null,capHeight:ke,className:tn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ke,diffuseConstant:ke,direction:null,display:null,dur:null,divisor:ke,dominantBaseline:null,download:ht,dx:null,dy:null,edgeMode:null,editable:null,elevation:ke,enableBackground:null,end:null,event:null,exponent:ke,externalResourcesRequired:null,fill:null,fillOpacity:ke,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ad,g2:ad,glyphName:ad,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ke,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ke,horizOriginX:ke,horizOriginY:ke,id:null,ideographic:ke,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ke,k:ke,k1:ke,k2:ke,k3:ke,k4:ke,kernelMatrix:_i,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ke,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ke,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ke,overlineThickness:ke,paintOrder:null,panose1:null,path:null,pathLength:ke,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:tn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ke,pointsAtY:ke,pointsAtZ:ke,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:_i,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:_i,rev:_i,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:_i,requiredFeatures:_i,requiredFonts:_i,requiredFormats:_i,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ke,specularExponent:ke,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ke,strikethroughThickness:ke,string:null,stroke:null,strokeDashArray:_i,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ke,strokeOpacity:ke,strokeWidth:null,style:null,surfaceScale:ke,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:_i,tabIndex:ke,tableValues:null,target:null,targetX:ke,targetY:ke,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:_i,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ke,underlineThickness:ke,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ke,values:null,vAlphabetic:ke,vMathematical:ke,vectorEffect:null,vHanging:ke,vIdeographic:ke,version:null,vertAdvY:ke,vertOriginX:ke,vertOriginY:ke,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ke,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:AH}),DH=sf({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()}}),$H=sf({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:OH}),PH=sf({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),O_e={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},D_e=/[A-Z]/g,W2=/-[a-z]/g,$_e=/^data[-\w.:]+$/i;function P_e(e,t){const n=W1(t);let r=t,i=pi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&$_e.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(W2,z_e);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!W2.test(o)){let a=o.replace(D_e,M_e);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Qj}return new i(r,t)}function M_e(e){return"-"+e.toLowerCase()}function z_e(e){return e.charAt(1).toUpperCase()}const L_e=NH([TH,T_e,DH,$H,PH],"html"),Jj=NH([TH,A_e,DH,$H,PH],"svg");function U_e(e){return e.join(" ").trim()}var Lu={},s_,X2;function F_e(){if(X2)return s_;X2=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
129
129
  `,f="/",p="*",h="",v="comment",y="declaration";s_=function(S,C){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];C=C||{};var E=1,k=1;function j(W){var F=W.match(t);F&&(E+=F.length);var Y=W.lastIndexOf(d);k=~Y?W.length-Y:k+W.length}function I(){var W={line:E,column:k};return function(F){return F.position=new A(W),z(),F}}function A(W){this.start=W,this.end={line:E,column:k},this.source=C.source}A.prototype.content=S;function N(W){var F=new Error(C.source+":"+E+":"+k+": "+W);if(F.reason=W,F.filename=C.source,F.line=E,F.column=k,F.source=S,!C.silent)throw F}function T(W){var F=W.exec(S);if(F){var Y=F[0];return j(Y),S=S.slice(Y.length),F}}function z(){T(n)}function L(W){var F;for(W=W||[];F=G();)F!==!1&&W.push(F);return W}function G(){var W=I();if(!(f!=S.charAt(0)||p!=S.charAt(1))){for(var F=2;h!=S.charAt(F)&&(p!=S.charAt(F)||f!=S.charAt(F+1));)++F;if(F+=2,h===S.charAt(F-1))return N("End of comment missing");var Y=S.slice(2,F-2);return k+=2,j(Y),S=S.slice(F),k+=2,W({type:v,comment:Y})}}function J(){var W=I(),F=T(r);if(F){if(G(),!T(i))return N("property missing ':'");var Y=T(o),P=W({type:y,property:b(F[0].replace(e,h)),value:Y?b(Y[0].replace(e,h)):h});return T(a),P}}function Z(){var W=[];L(W);for(var F;F=J();)F!==!1&&(W.push(F),L(W));return W}return z(),Z()};function b(S){return S?S.replace(c,h):h}return s_}var Q2;function V_e(){if(Q2)return Lu;Q2=1;var e=Lu&&Lu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Lu,"__esModule",{value:!0}),Lu.default=n;const t=e(F_e());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const a=(0,t.default)(r),c=typeof i=="function";return a.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:p}=d;c?i(f,p,d):p&&(o=o||{},o[f]=p)}),o}return Lu}var bm={},J2;function B_e(){if(J2)return bm;J2=1,Object.defineProperty(bm,"__esModule",{value:!0}),bm.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(f){return!f||n.test(f)||e.test(f)},a=function(f,p){return p.toUpperCase()},c=function(f,p){return"".concat(p,"-")},d=function(f,p){return p===void 0&&(p={}),o(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(i,c):f=f.replace(r,c),f.replace(t,a))};return bm.camelCase=d,bm}var xm,e$;function H_e(){if(e$)return xm;e$=1;var e=xm&&xm.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(V_e()),n=B_e();function r(i,o){var a={};return!i||typeof i!="string"||(0,t.default)(i,function(c,d){c&&d&&(a[(0,n.camelCase)(c,o)]=d)}),a}return r.default=r,xm=r,xm}var q_e=H_e();const G_e=fp(q_e),MH=zH("end"),eR=zH("start");function zH(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 K_e(e){const t=eR(e),n=MH(e);if(t&&n)return{start:t,end:n}}function Fm(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?t$(e.position):"start"in e||"end"in e?t$(e):"line"in e||"column"in e?J1(e):""}function J1(e){return n$(e&&e.line)+":"+n$(e&&e.column)}function t$(e){return J1(e&&e.start)+"-"+J1(e&&e.end)}function n$(e){return e&&typeof e=="number"?e:1}class Tr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?o.ruleId=r:(o.source=r.slice(0,d),o.ruleId=r.slice(d+1))}if(!o.place&&o.ancestors&&o.ancestors){const d=o.ancestors[o.ancestors.length-1];d&&(o.place=d.position)}const c=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=c?c.line:void 0,this.name=Fm(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}}Tr.prototype.file="";Tr.prototype.name="";Tr.prototype.reason="";Tr.prototype.message="";Tr.prototype.stack="";Tr.prototype.column=void 0;Tr.prototype.line=void 0;Tr.prototype.ancestors=void 0;Tr.prototype.cause=void 0;Tr.prototype.fatal=void 0;Tr.prototype.place=void 0;Tr.prototype.ruleId=void 0;Tr.prototype.source=void 0;const tR={}.hasOwnProperty,Z_e=new Map,Y_e=/[A-Z]/g,W_e=new Set(["table","tbody","thead","tfoot","tr"]),X_e=new Set(["td","th"]),LH="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Q_e(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=a1e(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=o1e(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"?Jj:L_e,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=UH(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function UH(e,t,n){if(t.type==="element")return J_e(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return e1e(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return n1e(e,t,n);if(t.type==="mdxjsEsm")return t1e(e,t);if(t.type==="root")return r1e(e,t,n);if(t.type==="text")return i1e(e,t)}function J_e(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Jj,e.schema=i),e.ancestors.push(t);const o=VH(e,t.tagName,!1),a=s1e(e,t);let c=rR(e,t);return W_e.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!I_e(d):!0})),FH(e,a,o,t),nR(a,c),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function e1e(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)}dp(e,t.position)}function t1e(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);dp(e,t.position)}function n1e(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Jj,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:VH(e,t.name,!0),a=l1e(e,t),c=rR(e,t);return FH(e,a,o,t),nR(a,c),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function r1e(e,t,n){const r={};return nR(r,rR(e,t)),e.create(t,e.Fragment,r,n)}function i1e(e,t){return t.value}function FH(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function nR(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function o1e(e,t,n){return r;function r(i,o,a,c){const f=Array.isArray(a.children)?n:t;return c?f(o,a,c):f(o,a)}}function a1e(e,t){return n;function n(r,i,o,a){const c=Array.isArray(o.children),d=eR(r);return t(i,o,a,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function s1e(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&tR.call(t.properties,i)){const o=c1e(e,i,t.properties[i]);if(o){const[a,c]=o;e.tableCellAlignToStyle&&a==="align"&&typeof c=="string"&&X_e.has(t.tagName)?r=c:n[a]=c}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function l1e(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const c=a.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else dp(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,o=e.evaluater.evaluateExpression(c.expression)}else dp(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function rR(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Z_e;for(;++r<t.children.length;){const o=t.children[r];let a;if(e.passKeys){const d=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(d){const f=i.get(d)||0;a=d+"-"+f,i.set(d,f+1)}}const c=UH(e,o,a);c!==void 0&&n.push(c)}return n}function c1e(e,t,n){const r=P_e(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?C_e(n):U_e(n)),r.property==="style"){let i=typeof n=="object"?n:u1e(e,String(n));return e.stylePropertyNameCase==="css"&&(i=d1e(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?O_e[r.property]||r.property:r.attribute,n]}}function u1e(e,t){try{return G_e(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Tr("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=LH+"#cannot-parse-style-attribute",i}}function VH(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,a;for(;++o<i.length;){const c=K2(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:c,computed:!!(o&&c.type==="Literal"),optional:!1}:c}r=a}else r=K2(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return tR.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);dp(e)}function dp(e,t){const n=new Tr("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=LH+"#cannot-handle-mdx-estrees-without-createevaluater",n}function d1e(e){const t={};let n;for(n in e)tR.call(e,n)&&(t[f1e(n)]=e[n]);return t}function f1e(e){let t=e.replace(Y_e,m1e);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function m1e(e){return"-"+e.toLowerCase()}const l_={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"]},p1e={};function h1e(e,t){const n=p1e,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return BH(e,r,i)}function BH(e,t,n){if(g1e(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 r$(e.children,t,n)}return Array.isArray(e)?r$(e,t,n):""}function r$(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=BH(e[i],t,n);return r.join("")}function g1e(e){return!!(e&&typeof e=="object")}const i$=document.createElement("i");function iR(e){const t="&"+e+";";i$.innerHTML=t;const n=i$.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function da(e,t,n,r){const i=e.length;let o=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(t,0),e.splice(...a),o+=1e4,t+=1e4}function no(e,t){return e.length>0?(da(e,e.length,0,t),e):t}const o$={}.hasOwnProperty;function v1e(e){const t={};let n=-1;for(;++n<e.length;)y1e(t,e[n]);return t}function y1e(e,t){let n;for(n in t){const i=(o$.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){o$.call(i,a)||(i[a]=[]);const c=o[a];b1e(i[a],Array.isArray(c)?c:c?[c]:[])}}}function b1e(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);da(e,0,0,r)}function HH(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 sd(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Qo=yl(/[A-Za-z]/),Ii=yl(/[\dA-Za-z]/),x1e=yl(/[#-'*+\--9=?A-Z^-~]/);function eC(e){return e!==null&&(e<32||e===127)}const tC=yl(/\d/),w1e=yl(/[\dA-Fa-f]/),S1e=yl(/[!-/:-@[-`{-~]/);function rt(e){return e!==null&&e<-2}function fi(e){return e!==null&&(e<0||e===32)}function Lt(e){return e===-2||e===-1||e===32}const _1e=yl(new RegExp("\\p{P}|\\p{S}","u")),C1e=yl(/\s/);function yl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function lf(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&&Ii(e.charCodeAt(n+1))&&Ii(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const c=e.charCodeAt(n+1);o<56320&&c>56319&&c<57344?(a=String.fromCharCode(o,c),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function rn(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(d){return Lt(d)?(e.enter(n),c(d)):t(d)}function c(d){return Lt(d)&&o++<i?(e.consume(d),c):(e.exit(n),t(d))}}const E1e={tokenize:k1e};function k1e(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),rn(e,t,"linePrefix")}function i(c){return e.enter("paragraph"),o(c)}function o(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,a(c)}function a(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return rt(c)?(e.consume(c),e.exit("chunkText"),o):(e.consume(c),a)}}const j1e={tokenize:R1e},a$={tokenize:I1e};function R1e(e){const t=this,n=[];let r=0,i,o,a;return c;function c(j){if(r<n.length){const I=n[r];return t.containerState=I[1],e.attempt(I[0].continuation,d,f)(j)}return f(j)}function d(j){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&k();const I=t.events.length;let A=I,N;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){N=t.events[A][1].end;break}E(r);let T=I;for(;T<t.events.length;)t.events[T][1].end={...N},T++;return da(t.events,A+1,0,t.events.slice(I)),t.events.length=T,f(j)}return c(j)}function f(j){if(r===n.length){if(!i)return v(j);if(i.currentConstruct&&i.currentConstruct.concrete)return b(j);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(a$,p,h)(j)}function p(j){return i&&k(),E(r),v(j)}function h(j){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,b(j)}function v(j){return t.containerState={},e.attempt(a$,y,b)(j)}function y(j){return r++,n.push([t.currentConstruct,t.containerState]),v(j)}function b(j){if(j===null){i&&k(),E(0),e.consume(j);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),S(j)}function S(j){if(j===null){C(e.exit("chunkFlow"),!0),E(0),e.consume(j);return}return rt(j)?(e.consume(j),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(j),S)}function C(j,I){const A=t.sliceStream(j);if(I&&A.push(null),j.previous=o,o&&(o.next=j),o=j,i.defineSkip(j.start),i.write(A),t.parser.lazy[j.start.line]){let N=i.events.length;for(;N--;)if(i.events[N][1].start.offset<a&&(!i.events[N][1].end||i.events[N][1].end.offset>a))return;const T=t.events.length;let z=T,L,G;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){if(L){G=t.events[z][1].end;break}L=!0}for(E(r),N=T;N<t.events.length;)t.events[N][1].end={...G},N++;da(t.events,z+1,0,t.events.slice(T)),t.events.length=N}}function E(j){let I=n.length;for(;I-- >j;){const A=n[I];t.containerState=A[1],A[0].exit.call(t,e)}n.length=j}function k(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function I1e(e,t,n){return rn(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function s$(e){if(e===null||fi(e)||C1e(e))return 1;if(_1e(e))return 2}function oR(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 nC={name:"attention",resolveAll:N1e,tokenize:T1e};function N1e(e,t){let n=-1,r,i,o,a,c,d,f,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},v={...e[n][1].start};l$(h,-d),l$(v,d),a={type:d>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},o={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:d>1?"strong":"emphasis",start:{...a.start},end:{...c.end}},e[r][1].end={...a.start},e[n][1].start={...c.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=no(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=no(f,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),f=no(f,oR(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=no(f,[["exit",o,t],["enter",c,t],["exit",c,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=no(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,da(e,r-1,n-r+3,f),n=r+f.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function T1e(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=s$(r);let o;return a;function a(d){return o=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===o)return e.consume(d),c;const f=e.exit("attentionSequence"),p=s$(d),h=!p||p===2&&i||n.includes(d),v=!i||i===2&&p||n.includes(r);return f._open=!!(o===42?h:h&&(i||!v)),f._close=!!(o===42?v:v&&(p||!h)),t(d)}}function l$(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const A1e={name:"autolink",tokenize:O1e};function O1e(e,t,n){let r=0;return i;function i(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(y){return Qo(y)?(e.consume(y),a):y===64?n(y):f(y)}function a(y){return y===43||y===45||y===46||Ii(y)?(r=1,c(y)):f(y)}function c(y){return y===58?(e.consume(y),r=0,d):(y===43||y===45||y===46||Ii(y))&&r++<32?(e.consume(y),c):(r=0,f(y))}function d(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||eC(y)?n(y):(e.consume(y),d)}function f(y){return y===64?(e.consume(y),p):x1e(y)?(e.consume(y),f):n(y)}function p(y){return Ii(y)?h(y):n(y)}function h(y){return y===46?(e.consume(y),r=0,p):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):v(y)}function v(y){if((y===45||Ii(y))&&r++<63){const b=y===45?v:h;return e.consume(y),b}return n(y)}}const xx={partial:!0,tokenize:D1e};function D1e(e,t,n){return r;function r(o){return Lt(o)?rn(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||rt(o)?t(o):n(o)}}const qH={continuation:{tokenize:P1e},exit:M1e,name:"blockQuote",tokenize:$1e};function $1e(e,t,n){const r=this;return i;function i(a){if(a===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return n(a)}function o(a){return Lt(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function P1e(e,t,n){const r=this;return i;function i(a){return Lt(a)?rn(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(qH,t,n)(a)}}function M1e(e){e.exit("blockQuote")}const GH={name:"characterEscape",tokenize:z1e};function z1e(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 S1e(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const KH={name:"characterReference",tokenize:L1e};function L1e(e,t,n){const r=this;let i=0,o,a;return c;function c(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),d}function d(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),o=31,a=Ii,p(h))}function f(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=w1e,p):(e.enter("characterReferenceValue"),o=7,a=tC,p(h))}function p(h){if(h===59&&i){const v=e.exit("characterReferenceValue");return a===Ii&&!iR(r.sliceSerialize(v))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(h)&&i++<o?(e.consume(h),p):n(h)}}const c$={partial:!0,tokenize:F1e},u$={concrete:!0,name:"codeFenced",tokenize:U1e};function U1e(e,t,n){const r=this,i={partial:!0,tokenize:A};let o=0,a=0,c;return d;function d(N){return f(N)}function f(N){const T=r.events[r.events.length-1];return o=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,c=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(N)}function p(N){return N===c?(a++,e.consume(N),p):a<3?n(N):(e.exit("codeFencedFenceSequence"),Lt(N)?rn(e,h,"whitespace")(N):h(N))}function h(N){return N===null||rt(N)?(e.exit("codeFencedFence"),r.interrupt?t(N):e.check(c$,S,I)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(N))}function v(N){return N===null||rt(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(N)):Lt(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),rn(e,y,"whitespace")(N)):N===96&&N===c?n(N):(e.consume(N),v)}function y(N){return N===null||rt(N)?h(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(N))}function b(N){return N===null||rt(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(N)):N===96&&N===c?n(N):(e.consume(N),b)}function S(N){return e.attempt(i,I,C)(N)}function C(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),E}function E(N){return o>0&&Lt(N)?rn(e,k,"linePrefix",o+1)(N):k(N)}function k(N){return N===null||rt(N)?e.check(c$,S,I)(N):(e.enter("codeFlowValue"),j(N))}function j(N){return N===null||rt(N)?(e.exit("codeFlowValue"),k(N)):(e.consume(N),j)}function I(N){return e.exit("codeFenced"),t(N)}function A(N,T,z){let L=0;return G;function G(Y){return N.enter("lineEnding"),N.consume(Y),N.exit("lineEnding"),J}function J(Y){return N.enter("codeFencedFence"),Lt(Y)?rn(N,Z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):Z(Y)}function Z(Y){return Y===c?(N.enter("codeFencedFenceSequence"),W(Y)):z(Y)}function W(Y){return Y===c?(L++,N.consume(Y),W):L>=a?(N.exit("codeFencedFenceSequence"),Lt(Y)?rn(N,F,"whitespace")(Y):F(Y)):z(Y)}function F(Y){return Y===null||rt(Y)?(N.exit("codeFencedFence"),T(Y)):z(Y)}}}function F1e(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 c_={name:"codeIndented",tokenize:B1e},V1e={partial:!0,tokenize:H1e};function B1e(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),rn(e,o,"linePrefix",5)(f)}function o(f){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?a(f):n(f)}function a(f){return f===null?d(f):rt(f)?e.attempt(V1e,a,d)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||rt(f)?(e.exit("codeFlowValue"),a(f)):(e.consume(f),c)}function d(f){return e.exit("codeIndented"),t(f)}}function H1e(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):rt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):rn(e,o,"linePrefix",5)(a)}function o(a){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(a):rt(a)?i(a):n(a)}}const q1e={name:"codeText",previous:K1e,resolve:G1e,tokenize:Z1e};function G1e(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 K1e(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Z1e(e,t,n){let r=0,i,o;return a;function a(h){return e.enter("codeText"),e.enter("codeTextSequence"),c(h)}function c(h){return h===96?(e.consume(h),r++,c):(e.exit("codeTextSequence"),d(h))}function d(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),d):h===96?(o=e.enter("codeTextSequence"),i=0,p(h)):rt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(h))}function f(h){return h===null||h===32||h===96||rt(h)?(e.exit("codeTextData"),d(h)):(e.consume(h),f)}function p(h){return h===96?(e.consume(h),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(o.type="codeTextData",f(h))}}class Y1e{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&&wm(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),wm(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),wm(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);wm(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);wm(this.left,n.reverse())}}}function wm(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 ZH(e){const t={};let n=-1,r,i,o,a,c,d,f;const p=new Y1e(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,o=0,o<d.length&&d[o][1].type==="lineEndingBlank"&&(o+=2),o<d.length&&d[o][1].type==="content"))for(;++o<d.length&&d[o][1].type!=="content";)d[o][1].type==="chunkText"&&(d[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,W1e(p,n)),n=t[n],f=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(a=p.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},c=p.slice(i,n),c.unshift(r),p.splice(i,n-i+1,c))}}return da(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function W1e(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const c=a.events,d=[],f={};let p,h,v=-1,y=n,b=0,S=0;const C=[S];for(;y;){for(;e.get(++i)[1]!==y;);o.push(i),y._tokenizer||(p=r.sliceStream(y),y.next||p.push(null),h&&a.defineSkip(y.start),y._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(p),y._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=y,y=y.next}for(y=n;++v<c.length;)c[v][0]==="exit"&&c[v-1][0]==="enter"&&c[v][1].type===c[v-1][1].type&&c[v][1].start.line!==c[v][1].end.line&&(S=v+1,C.push(S),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(a.events=[],y?(y._tokenizer=void 0,y.previous=void 0):C.pop(),v=C.length;v--;){const E=c.slice(C[v],C[v+1]),k=o.pop();d.push([k,k+E.length-1]),e.splice(k,2,E)}for(d.reverse(),v=-1;++v<d.length;)f[b+d[v][0]]=b+d[v][1],b+=d[v][1]-d[v][0]-1;return f}const X1e={resolve:J1e,tokenize:eCe},Q1e={partial:!0,tokenize:tCe};function J1e(e){return ZH(e),e}function eCe(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(c)}function i(c){return c===null?o(c):rt(c)?e.check(Q1e,a,o)(c):(e.consume(c),i)}function o(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function a(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function tCe(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),rn(e,o,"linePrefix")}function o(a){if(a===null||rt(a))return n(a);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function YH(e,t,n,r,i,o,a,c,d){const f=d||Number.POSITIVE_INFINITY;let p=0;return h;function h(E){return E===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(E),e.exit(o),v):E===null||E===32||E===41||eC(E)?n(E):(e.enter(r),e.enter(a),e.enter(c),e.enter("chunkString",{contentType:"string"}),S(E))}function v(E){return E===62?(e.enter(o),e.consume(E),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),y(E))}function y(E){return E===62?(e.exit("chunkString"),e.exit(c),v(E)):E===null||E===60||rt(E)?n(E):(e.consume(E),E===92?b:y)}function b(E){return E===60||E===62||E===92?(e.consume(E),y):y(E)}function S(E){return!p&&(E===null||E===41||fi(E))?(e.exit("chunkString"),e.exit(c),e.exit(a),e.exit(r),t(E)):p<f&&E===40?(e.consume(E),p++,S):E===41?(e.consume(E),p--,S):E===null||E===32||E===40||eC(E)?n(E):(e.consume(E),E===92?C:S)}function C(E){return E===40||E===41||E===92?(e.consume(E),S):S(E)}}function WH(e,t,n,r,i,o){const a=this;let c=0,d;return f;function f(y){return e.enter(r),e.enter(i),e.consume(y),e.exit(i),e.enter(o),p}function p(y){return c>999||y===null||y===91||y===93&&!d||y===94&&!c&&"_hiddenFootnoteSupport"in a.parser.constructs?n(y):y===93?(e.exit(o),e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):rt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===null||y===91||y===93||rt(y)||c++>999?(e.exit("chunkString"),p(y)):(e.consume(y),d||(d=!Lt(y)),y===92?v:h)}function v(y){return y===91||y===92||y===93?(e.consume(y),c++,h):h(y)}}function XH(e,t,n,r,i,o){let a;return c;function c(v){return v===34||v===39||v===40?(e.enter(r),e.enter(i),e.consume(v),e.exit(i),a=v===40?41:v,d):n(v)}function d(v){return v===a?(e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):(e.enter(o),f(v))}function f(v){return v===a?(e.exit(o),d(a)):v===null?n(v):rt(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),rn(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===a||v===null||rt(v)?(e.exit("chunkString"),f(v)):(e.consume(v),v===92?h:p)}function h(v){return v===a||v===92?(e.consume(v),p):p(v)}}function Vm(e,t){let n;return r;function r(i){return rt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Lt(i)?rn(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const nCe={name:"definition",tokenize:iCe},rCe={partial:!0,tokenize:oCe};function iCe(e,t,n){const r=this;let i;return o;function o(y){return e.enter("definition"),a(y)}function a(y){return WH.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function c(y){return i=sd(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 fi(y)?Vm(e,f)(y):f(y)}function f(y){return YH(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function p(y){return e.attempt(rCe,h,h)(y)}function h(y){return Lt(y)?rn(e,v,"whitespace")(y):v(y)}function v(y){return y===null||rt(y)?(e.exit("definition"),r.parser.defined.push(i),t(y)):n(y)}}function oCe(e,t,n){return r;function r(c){return fi(c)?Vm(e,i)(c):n(c)}function i(c){return XH(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function o(c){return Lt(c)?rn(e,a,"whitespace")(c):a(c)}function a(c){return c===null||rt(c)?t(c):n(c)}}const aCe={name:"hardBreakEscape",tokenize:sCe};function sCe(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return rt(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const lCe={name:"headingAtx",resolve:cCe,tokenize:uCe};function cCe(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},da(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function uCe(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),a(p)}function a(p){return p===35&&r++<6?(e.consume(p),a):p===null||fi(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||rt(p)?(e.exit("atxHeading"),t(p)):Lt(p)?rn(e,c,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),c(p))}function f(p){return p===null||p===35||fi(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),f)}}const dCe=["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"],d$=["pre","script","style","textarea"],fCe={concrete:!0,name:"htmlFlow",resolveTo:hCe,tokenize:gCe},mCe={partial:!0,tokenize:yCe},pCe={partial:!0,tokenize:vCe};function hCe(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 gCe(e,t,n){const r=this;let i,o,a,c,d;return f;function f(O){return p(O)}function p(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),h}function h(O){return O===33?(e.consume(O),v):O===47?(e.consume(O),o=!0,S):O===63?(e.consume(O),i=3,r.interrupt?t:D):Qo(O)?(e.consume(O),a=String.fromCharCode(O),C):n(O)}function v(O){return O===45?(e.consume(O),i=2,y):O===91?(e.consume(O),i=5,c=0,b):Qo(O)?(e.consume(O),i=4,r.interrupt?t:D):n(O)}function y(O){return O===45?(e.consume(O),r.interrupt?t:D):n(O)}function b(O){const ee="CDATA[";return O===ee.charCodeAt(c++)?(e.consume(O),c===ee.length?r.interrupt?t:Z:b):n(O)}function S(O){return Qo(O)?(e.consume(O),a=String.fromCharCode(O),C):n(O)}function C(O){if(O===null||O===47||O===62||fi(O)){const ee=O===47,ue=a.toLowerCase();return!ee&&!o&&d$.includes(ue)?(i=1,r.interrupt?t(O):Z(O)):dCe.includes(a.toLowerCase())?(i=6,ee?(e.consume(O),E):r.interrupt?t(O):Z(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):o?k(O):j(O))}return O===45||Ii(O)?(e.consume(O),a+=String.fromCharCode(O),C):n(O)}function E(O){return O===62?(e.consume(O),r.interrupt?t:Z):n(O)}function k(O){return Lt(O)?(e.consume(O),k):G(O)}function j(O){return O===47?(e.consume(O),G):O===58||O===95||Qo(O)?(e.consume(O),I):Lt(O)?(e.consume(O),j):G(O)}function I(O){return O===45||O===46||O===58||O===95||Ii(O)?(e.consume(O),I):A(O)}function A(O){return O===61?(e.consume(O),N):Lt(O)?(e.consume(O),A):j(O)}function N(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),d=O,T):Lt(O)?(e.consume(O),N):z(O)}function T(O){return O===d?(e.consume(O),d=null,L):O===null||rt(O)?n(O):(e.consume(O),T)}function z(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||fi(O)?A(O):(e.consume(O),z)}function L(O){return O===47||O===62||Lt(O)?j(O):n(O)}function G(O){return O===62?(e.consume(O),J):n(O)}function J(O){return O===null||rt(O)?Z(O):Lt(O)?(e.consume(O),J):n(O)}function Z(O){return O===45&&i===2?(e.consume(O),P):O===60&&i===1?(e.consume(O),K):O===62&&i===4?(e.consume(O),M):O===63&&i===3?(e.consume(O),D):O===93&&i===5?(e.consume(O),te):rt(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(mCe,V,W)(O)):O===null||rt(O)?(e.exit("htmlFlowData"),W(O)):(e.consume(O),Z)}function W(O){return e.check(pCe,F,V)(O)}function F(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),Y}function Y(O){return O===null||rt(O)?W(O):(e.enter("htmlFlowData"),Z(O))}function P(O){return O===45?(e.consume(O),D):Z(O)}function K(O){return O===47?(e.consume(O),a="",U):Z(O)}function U(O){if(O===62){const ee=a.toLowerCase();return d$.includes(ee)?(e.consume(O),M):Z(O)}return Qo(O)&&a.length<8?(e.consume(O),a+=String.fromCharCode(O),U):Z(O)}function te(O){return O===93?(e.consume(O),D):Z(O)}function D(O){return O===62?(e.consume(O),M):O===45&&i===2?(e.consume(O),D):Z(O)}function M(O){return O===null||rt(O)?(e.exit("htmlFlowData"),V(O)):(e.consume(O),M)}function V(O){return e.exit("htmlFlow"),t(O)}}function vCe(e,t,n){const r=this;return i;function i(a){return rt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function yCe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(xx,t,n)}}const bCe={name:"htmlText",tokenize:xCe};function xCe(e,t,n){const r=this;let i,o,a;return c;function c(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),d}function d(D){return D===33?(e.consume(D),f):D===47?(e.consume(D),A):D===63?(e.consume(D),j):Qo(D)?(e.consume(D),z):n(D)}function f(D){return D===45?(e.consume(D),p):D===91?(e.consume(D),o=0,b):Qo(D)?(e.consume(D),k):n(D)}function p(D){return D===45?(e.consume(D),y):n(D)}function h(D){return D===null?n(D):D===45?(e.consume(D),v):rt(D)?(a=h,K(D)):(e.consume(D),h)}function v(D){return D===45?(e.consume(D),y):h(D)}function y(D){return D===62?P(D):D===45?v(D):h(D)}function b(D){const M="CDATA[";return D===M.charCodeAt(o++)?(e.consume(D),o===M.length?S:b):n(D)}function S(D){return D===null?n(D):D===93?(e.consume(D),C):rt(D)?(a=S,K(D)):(e.consume(D),S)}function C(D){return D===93?(e.consume(D),E):S(D)}function E(D){return D===62?P(D):D===93?(e.consume(D),E):S(D)}function k(D){return D===null||D===62?P(D):rt(D)?(a=k,K(D)):(e.consume(D),k)}function j(D){return D===null?n(D):D===63?(e.consume(D),I):rt(D)?(a=j,K(D)):(e.consume(D),j)}function I(D){return D===62?P(D):j(D)}function A(D){return Qo(D)?(e.consume(D),N):n(D)}function N(D){return D===45||Ii(D)?(e.consume(D),N):T(D)}function T(D){return rt(D)?(a=T,K(D)):Lt(D)?(e.consume(D),T):P(D)}function z(D){return D===45||Ii(D)?(e.consume(D),z):D===47||D===62||fi(D)?L(D):n(D)}function L(D){return D===47?(e.consume(D),P):D===58||D===95||Qo(D)?(e.consume(D),G):rt(D)?(a=L,K(D)):Lt(D)?(e.consume(D),L):P(D)}function G(D){return D===45||D===46||D===58||D===95||Ii(D)?(e.consume(D),G):J(D)}function J(D){return D===61?(e.consume(D),Z):rt(D)?(a=J,K(D)):Lt(D)?(e.consume(D),J):L(D)}function Z(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),i=D,W):rt(D)?(a=Z,K(D)):Lt(D)?(e.consume(D),Z):(e.consume(D),F)}function W(D){return D===i?(e.consume(D),i=void 0,Y):D===null?n(D):rt(D)?(a=W,K(D)):(e.consume(D),W)}function F(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||fi(D)?L(D):(e.consume(D),F)}function Y(D){return D===47||D===62||fi(D)?L(D):n(D)}function P(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function K(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),U}function U(D){return Lt(D)?rn(e,te,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):te(D)}function te(D){return e.enter("htmlTextData"),a(D)}}const aR={name:"labelEnd",resolveAll:CCe,resolveTo:ECe,tokenize:kCe},wCe={tokenize:jCe},SCe={tokenize:RCe},_Ce={tokenize:ICe};function CCe(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&da(e,0,e.length,n),e}function ECe(e,t){let n=e.length,r=0,i,o,a,c;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const d={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[o][1].start},end:{...e[a][1].end}},p={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return c=[["enter",d,t],["enter",f,t]],c=no(c,e.slice(o+1,o+r+3)),c=no(c,[["enter",p,t]]),c=no(c,oR(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),c=no(c,[["exit",p,t],e[a-2],e[a-1],["exit",f,t]]),c=no(c,e.slice(a+1)),c=no(c,[["exit",d,t]]),da(e,o,e.length,c),e}function kCe(e,t,n){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return c;function c(v){return o?o._inactive?h(v):(a=r.parser.defined.includes(sd(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(wCe,p,a?p:h)(v):v===91?e.attempt(SCe,p,a?f:h)(v):a?p(v):h(v)}function f(v){return e.attempt(_Ce,p,h)(v)}function p(v){return t(v)}function h(v){return o._balanced=!0,n(v)}}function jCe(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 fi(h)?Vm(e,o)(h):o(h)}function o(h){return h===41?p(h):YH(e,a,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return fi(h)?Vm(e,d)(h):p(h)}function c(h){return n(h)}function d(h){return h===34||h===39||h===40?XH(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):p(h)}function f(h){return fi(h)?Vm(e,p)(h):p(h)}function p(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function RCe(e,t,n){const r=this;return i;function i(c){return WH.call(r,e,o,a,"reference","referenceMarker","referenceString")(c)}function o(c){return r.parser.defined.includes(sd(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function a(c){return n(c)}}function ICe(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 NCe={name:"labelStartImage",resolveAll:aR.resolveAll,tokenize:TCe};function TCe(e,t,n){const r=this;return i;function i(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),o}function o(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),a):n(c)}function a(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const ACe={name:"labelStartLink",resolveAll:aR.resolveAll,tokenize:OCe};function OCe(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 u_={name:"lineEnding",tokenize:DCe};function DCe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),rn(e,t,"linePrefix")}}const Nv={name:"thematicBreak",tokenize:$Ce};function $Ce(e,t,n){let r=0,i;return o;function o(f){return e.enter("thematicBreak"),a(f)}function a(f){return i=f,c(f)}function c(f){return f===i?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||rt(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===i?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),Lt(f)?rn(e,c,"whitespace")(f):c(f))}}const ri={continuation:{tokenize:LCe},exit:FCe,name:"list",tokenize:zCe},PCe={partial:!0,tokenize:VCe},MCe={partial:!0,tokenize:UCe};function zCe(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return c;function c(y){const b=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:tC(y)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(Nv,n,f)(y):f(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(y)}return n(y)}function d(y){return tC(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(xx,r.interrupt?n:p,e.attempt(PCe,v,h))}function p(y){return r.containerState.initialBlankLine=!0,o++,v(y)}function h(y){return Lt(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),v):n(y)}function v(y){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function LCe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(xx,i,o);function i(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,rn(e,t,"listItemIndent",r.containerState.size+1)(c)}function o(c){return r.containerState.furtherBlankLines||!Lt(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(MCe,t,a)(c))}function a(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,rn(e,e.attempt(ri,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function UCe(e,t,n){const r=this;return rn(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 FCe(e){e.exit(this.containerState.type)}function VCe(e,t,n){const r=this;return rn(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!Lt(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const f$={name:"setextUnderline",resolveTo:BCe,tokenize:HCe};function BCe(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 HCe(e,t,n){const r=this;let i;return o;function o(f){let p=r.events.length,h;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){h=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=f,a(f)):n(f)}function a(f){return e.enter("setextHeadingLineSequence"),c(f)}function c(f){return f===i?(e.consume(f),c):(e.exit("setextHeadingLineSequence"),Lt(f)?rn(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||rt(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const qCe={tokenize:GCe};function GCe(e){const t=this,n=e.attempt(xx,r,e.attempt(this.parser.constructs.flowInitial,i,rn(e,e.attempt(this.parser.constructs.flow,i,e.attempt(X1e,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 KCe={resolveAll:JH()},ZCe=QH("string"),YCe=QH("text");function QH(e){return{resolveAll:JH(e==="text"?WCe:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,c);return a;function a(p){return f(p)?o(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return f(p)?(n.exit("data"),o(p)):(n.consume(p),d)}function f(p){if(p===null)return!0;const h=i[p];let v=-1;if(h)for(;++v<h.length;){const y=h[v];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function JH(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 WCe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,a=-1,c=0,d;for(;o--;){const f=i[o];if(typeof f=="string"){for(a=f.length;f.charCodeAt(a-1)===32;)c++,a--;if(a)break;a=-1}else if(f===-2)d=!0,c++;else if(f!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const f={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const XCe={42:ri,43:ri,45:ri,48:ri,49:ri,50:ri,51:ri,52:ri,53:ri,54:ri,55:ri,56:ri,57:ri,62:qH},QCe={91:nCe},JCe={[-2]:c_,[-1]:c_,32:c_},eEe={35:lCe,42:Nv,45:[f$,Nv],60:fCe,61:f$,95:Nv,96:u$,126:u$},tEe={38:KH,92:GH},nEe={[-5]:u_,[-4]:u_,[-3]:u_,33:NCe,38:KH,42:nC,60:[A1e,bCe],91:ACe,92:[aCe,GH],93:aR,95:nC,96:q1e},rEe={null:[nC,KCe]},iEe={null:[42,95]},oEe={null:[]},aEe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:iEe,contentInitial:QCe,disable:oEe,document:XCe,flow:eEe,flowInitial:JCe,insideSpan:rEe,string:tEe,text:nEe},Symbol.toStringTag,{value:"Module"}));function sEe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let a=[],c=[];const d={attempt:T(A),check:T(N),consume:k,enter:j,exit:I,interrupt:T(N,{interrupt:!0})},f={code:null,containerState:{},defineSkip:S,events:[],now:b,parser:e,previous:null,sliceSerialize:v,sliceStream:y,write:h};let p=t.tokenize.call(f,d);return t.resolveAll&&o.push(t),f;function h(J){return a=no(a,J),C(),a[a.length-1]!==null?[]:(z(t,0),f.events=oR(o,f.events,f),f.events)}function v(J,Z){return cEe(y(J),Z)}function y(J){return lEe(a,J)}function b(){const{_bufferIndex:J,_index:Z,line:W,column:F,offset:Y}=r;return{_bufferIndex:J,_index:Z,line:W,column:F,offset:Y}}function S(J){i[J.line]=J.column,G()}function C(){let J;for(;r._index<a.length;){const Z=a[r._index];if(typeof Z=="string")for(J=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===J&&r._bufferIndex<Z.length;)E(Z.charCodeAt(r._bufferIndex));else E(Z)}}function E(J){p=p(J)}function k(J){rt(J)?(r.line++,r.column=1,r.offset+=J===-3?2:1,G()):J!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=J}function j(J,Z){const W=Z||{};return W.type=J,W.start=b(),f.events.push(["enter",W,f]),c.push(W),W}function I(J){const Z=c.pop();return Z.end=b(),f.events.push(["exit",Z,f]),Z}function A(J,Z){z(J,Z.from)}function N(J,Z){Z.restore()}function T(J,Z){return W;function W(F,Y,P){let K,U,te,D;return Array.isArray(F)?V(F):"tokenize"in F?V([F]):M(F);function M(pe){return B;function B(ie){const Se=ie!==null&&pe[ie],Ie=ie!==null&&pe.null,Fe=[...Array.isArray(Se)?Se:Se?[Se]:[],...Array.isArray(Ie)?Ie:Ie?[Ie]:[]];return V(Fe)(ie)}}function V(pe){return K=pe,U=0,pe.length===0?P:O(pe[U])}function O(pe){return B;function B(ie){return D=L(),te=pe,pe.partial||(f.currentConstruct=pe),pe.name&&f.parser.constructs.disable.null.includes(pe.name)?ue():pe.tokenize.call(Z?Object.assign(Object.create(f),Z):f,d,ee,ue)(ie)}}function ee(pe){return J(te,D),Y}function ue(pe){return D.restore(),++U<K.length?O(K[U]):P}}}function z(J,Z){J.resolveAll&&!o.includes(J)&&o.push(J),J.resolve&&da(f.events,Z,f.events.length-Z,J.resolve(f.events.slice(Z),f)),J.resolveTo&&(f.events=J.resolveTo(f.events,f))}function L(){const J=b(),Z=f.previous,W=f.currentConstruct,F=f.events.length,Y=Array.from(c);return{from:F,restore:P};function P(){r=J,f.previous=Z,f.currentConstruct=W,f.events.length=F,c=Y,G()}}function G(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function lEe(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){const c=a[0];typeof c=="string"?a[0]=c.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function cEe(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
130
130
  `;break}case-3:{a=`\r
@@ -192,7 +192,7 @@ cd ${a}`},{title:"Start Local Harper Instance",code:"npm run dev",alert:"You wil
192
192
  focus-visible:ring-1
193
193
  focus-visible:outline-1
194
194
  focus-visible:ring-purple-200
195
- aria-invalid:focus-visible:ring-0`,{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",outline:"border bg-default border-primary border-2 text-white shadow-xs hover:-translate-y-1 transition duration-200 hover:bg-grey-700/40"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});var C9="Toggle",E9=x.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:i,...o}=e,[a,c]=Do({prop:n,onChange:i,defaultProp:r??!1,caller:C9});return u.jsx(Ke.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:je(e.onClick,()=>{e.disabled||c(!a)})})});E9.displayName=C9;var mTe=E9;function pTe({className:e,variant:t,size:n,...r}){return u.jsx(mTe,{"data-slot":"toggle",className:Me(fTe({variant:t,size:n,className:e})),...r})}function k9(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 Y$=["secondary","default","warning","outline","success","destructive"];let W$=0;const __=new Map,j9=e=>{if(__.has(e))return __.get(e);W$++;const t=W$%Y$.length,n=Y$[t];return __.set(e,n),n};function hTe({columns:e,data:t,onRowClick:n}){const r=dx({data:t,columns:e,getCoreRowModel:ux()});return u.jsx("div",{className:"rounded-md bg-black-dark logsTable",children:u.jsxs(fx,{className:"text-xs",children:[u.jsx(rh,{children:r.getHeaderGroups().map(i=>u.jsx(Ai,{className:"border-none",children:i.headers.map(o=>u.jsx(Wj,{className:"p-4 max-w-96",children:o.isPlaceholder?null:wc(o.column.columnDef.header,o.getContext())},o.id))},i.id))}),u.jsx(mx,{className:"bg-black",children:r.getRowModel().rows?.length?r.getRowModel().rows.map(i=>u.jsx(Ai,{"data-state":i.getIsSelected()&&"selected",className:Me("hover:bg-muted/10 data-[state=selected]:bg-muted max-w-full",n&&"cursor-pointer"),onClick:()=>n?.(i),children:i.getVisibleCells().map(o=>u.jsx(Xa,{className:"p-1",children:wc(o.column.columnDef.cell,o.getContext())},o.id))},i.id)):u.jsx(Ai,{children:u.jsx(Xa,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})})}function gTe(e){try{JSON.parse(e)}catch{return!1}return!0}function vTe({setIsModalOpen:e,isModalOpen:t,data:n}){const r=n?j9(n.node):"default";return u.jsx(zn,{onOpenChange:e,open:t,children:u.jsxs(Ln,{"aria-describedby":void 0,children:[u.jsx(xr,{children:u.jsx(Nn,{children:"Edit Row"})}),n?u.jsxs("div",{className:"flex flex-col gap-3 text-white",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"inline-block pr-2",children:"Level:"}),u.jsx(zo,{variant:k9(n.level),children:Eo(n.level)})]}),u.jsxs("div",{children:[u.jsx("h3",{children:"Timestamp:"}),u.jsx("p",{className:"text-sm",children:n.timestamp})]}),u.jsxs("div",{children:[u.jsx("h3",{children:"Thread:"}),u.jsx("p",{className:"text-sm",children:n.thread})]}),u.jsxs("div",{children:[u.jsx("h3",{children:"Node:"}),u.jsx(zo,{variant:r,children:n.node})]}),u.jsxs("div",{children:[u.jsx("h3",{children:"Tags:"}),u.jsx("p",{className:"text-sm",children:n.tags&&n.tags.length>0?u.jsx("span",{children:n.tags}):"N/A"})]}),u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-bold",children:"Message"}),u.jsx(gx,{className:"w-full h-72",language:gTe(n.message)?"json":"text",theme:"vs-dark",value:n.message,options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1}})]})]}):u.jsx(Ui,{}),u.jsx(Un,{children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsxs(be,{type:"button",variant:"destructive",className:"rounded-full",children:[u.jsx(ts,{})," Delete Row"]}),u.jsxs(be,{variant:"submit",className:"rounded-full",children:[u.jsx(ho,{})," Save Changes"]})]})})]})})}function yTe({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 bTe=mn({limit:nt().optional(),level:Jd(["notify","error","warn","info","debug","trace","undefined"]).optional(),from:nt().or(uy()).optional(),until:nt().or(uy()).optional()});function xTe({form:e,resetFilters:t,submitFilters:n}){return u.jsx("div",{children:u.jsx(Qt,{...e,children:u.jsxs("form",{onSubmit:e.handleSubmit(n),className:"flex-col space-y-5",children:[u.jsx(Pe,{control:e.control,name:"limit",render:({field:r})=>u.jsxs(Ae,{children:[u.jsx(Oe,{children:"Log Limit:"}),u.jsxs(co,{onValueChange:r.onChange,value:r.value,children:[u.jsx(fo,{className:"w-full",children:u.jsx(uo,{placeholder:"Select log limit"})}),u.jsx(mo,{children:u.jsxs(Lo,{children:[u.jsx(Sn,{value:"1000",children:"1000"}),u.jsx(Sn,{value:"500",children:"500"}),u.jsx(Sn,{value:"250",children:"250"}),u.jsx(Sn,{value:"100",children:"100"}),u.jsx(Sn,{value:"10",children:"10"})]})})]}),u.jsx(De,{})]})}),u.jsx(Pe,{control:e.control,name:"level",render:({field:r})=>u.jsxs(Ae,{children:[u.jsx(Oe,{children:"Log Level:"}),u.jsxs(co,{onValueChange:r.onChange,value:r.value,children:[u.jsx(fo,{className:"w-full",children:u.jsx(uo,{placeholder:"Select log level"})}),u.jsx(mo,{children:u.jsxs(Lo,{children:[u.jsx(Sn,{value:"undefined",children:"All"}),u.jsx(Sn,{value:"notify",children:"Notify"}),u.jsx(Sn,{value:"error",children:"Error"}),u.jsx(Sn,{value:"warn",children:"Warn"}),u.jsx(Sn,{value:"info",children:"Info"}),u.jsx(Sn,{value:"debug",children:"Debug"}),u.jsx(Sn,{value:"trace",children:"Trace"})]})})]}),u.jsx(De,{})]})}),u.jsx(Pe,{control:e.control,name:"from",render:({field:r})=>u.jsxs(Ae,{children:[u.jsx(Oe,{children:"Start Date:"}),u.jsx($e,{children:u.jsx(ze,{type:"datetime-local",value:r.value,onChange:r.onChange})}),u.jsx(De,{})]})}),u.jsx(Pe,{control:e.control,name:"until",render:({field:r})=>u.jsxs(Ae,{children:[u.jsx(Oe,{children:"End Date:"}),u.jsx($e,{children:u.jsx(ze,{type:"datetime-local",value:r.value,onChange:r.onChange})}),u.jsx(De,{})]})}),u.jsxs("div",{className:"flex items-center justify-between space-x-2 mt-2",children:[u.jsx(be,{type:"submit",variant:"positiveOutline",className:"grow",children:"Apply Filters"}),u.jsx(be,{type:"reset",variant:"destructiveOutline",onClick:()=>t(),children:"Clear Filters"})]})]})})})}const C_={limit:"100",level:"undefined",from:"",until:""},wTe=[{accessorKey:"level",header:"Status",cell:({row:e})=>{const{level:t}=e.original;return u.jsx(zo,{variant:k9(t),children:Eo(t)})}},{accessorKey:"timestamp",header:"Date",cell:({row:e})=>{const{timestamp:t}=e.original;return u.jsx("span",{children:new Date(t).toLocaleDateString()})}},{accessorKey:"time",header:"Time",cell:({row:e})=>{const{timestamp:t}=e.original;return u.jsx("span",{children:new Date(t).toLocaleTimeString()})}},{accessorKey:"thread",header:"Thread"},{accessorKey:"node",header:"Node",cell:({row:e})=>{const{node:t}=e.original,n=j9(t);return u.jsx(u.Fragment,{children:t?u.jsxs(_b,{children:[u.jsx(Cb,{asChild:!0,children:u.jsxs(zo,{variant:n,children:[t.split(".")[0],"..."]})}),u.jsx(Eb,{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})})}}],STe=(e,t)=>{if(!e&&!t||!e||!t)return!0;const n=new Date(e),r=new Date(t);return n<=r};function _Te(){const[e,t]=x.useState(C_),[n,r]=x.useState(!1),[i,o]=x.useState(),[a,c]=x.useState(!1),d=Ft(),{data:f,isLoading:p,refetch:h,isFetching:v}=Pt(yTe({logFilters:e,...d,replicated:d.entityType==="cluster",isAutoRefreshEnabled:a})),y=Xt({resolver:sn(bTe),defaultValues:C_,mode:"onChange"}),b=k=>{o(k.original),r(!0)},S=async k=>{if(!STe(k.from,k.until)){y.setError("from",{type:"onChange",message:"Start date must be before end date"}),y.setError("until",{type:"onChange",message:"End date must be after start date"});return}t(k)},C=async()=>{y.reset(),t(C_)},E=vl(h);return u.jsxs("div",{className:"grid grid-cols-1 gap-4 text-white md:grid-cols-12",children:[u.jsxs("section",{className:"col-span-1 md:col-span-4 lg:col-span-3 px-2 pt-4 md:pt-12",children:[u.jsx(xTe,{form:y,resetFilters:C,submitFilters:S}),u.jsxs("div",{className:"flex items-center justify-between space-x-2 mt-2",children:[u.jsxs(be,{variant:"defaultOutline",onClick:E,disabled:v||p||a,className:"grow",children:[u.jsx(sa,{}),"Refresh"]}),u.jsxs(pTe,{variant:"outline","aria-label":"Toggle Auto Refresh",onPressedChange:c,children:[u.jsx(sa,{}),"Auto Refresh ",a?"On":"Off"]})]})]}),u.jsx("section",{className:"col-span-1 md:col-span-8 lg:col-span-9",children:p?u.jsx("div",{children:"Loading..."}):u.jsx("div",{children:u.jsx(hTe,{columns:wTe,data:f||[],onRowClick:b})})}),u.jsx(vTe,{isModalOpen:n,setIsModalOpen:r,data:i})]})}function CTe(e){return Qe({getParentRoute:()=>e,path:"logs",component:_Te})}function ETe(e){return Qe({getParentRoute:()=>e,path:"status",component:aM(async()=>Np(()=>import("./index-CKgGjgnE.js"),__vite__mapDeps([3,1])),"StatusIndex")})}function kTe(e){const t=dTe(e),n=[CTe(t),...ZRe(t),g_e(t),ETe(t),YIe(t),iTe(t)];return t.addChildren(n)}Qe({getParentRoute:()=>vx,path:"profile",component:aM(async()=>Np(()=>import("./index-D3qabeYN.js"),[]),"ProfileIndex")});const jTe=fb.addChildren([...gge,vx.addChildren([kTe("local")])]);function RTe({routeTree:e=jTe,authentication:t}){const n=aZ();return FY({routeTree:e,history:n,defaultNotFoundComponent:zQ,defaultErrorComponent:Fv,defaultPreload:LQ()?!1:"intent",trailingSlash:"never",defaultPreloadStaleTime:0,scrollRestoration:!0,context:{queryClient:Vv,authentication:t||{}}})}function ITe(){const e=GY(),t=RTe({authentication:e});return u.jsxs(u.Fragment,{children:[u.jsx(HY,{router:t,context:{authentication:e}}),!1]})}const NTe=({...e})=>u.jsx(fJ,{className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground font-medium",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground font-medium"}},...e});var TTe=function(){return null};function ATe(){return Gle(),Mse(),u.jsxs(u.Fragment,{children:[u.jsxs(VK,{client:Vv,children:[u.jsx(ITe,{}),u.jsx(TTe,{buttonPosition:"bottom-right"})]}),u.jsx(NTe,{richColors:!0})]})}var E_={exports:{}},Em={},k_={exports:{}},j_={};var X$;function OTe(){return X$||(X$=1,(function(e){function t(P,K){var U=P.length;P.push(K);e:for(;0<U;){var te=U-1>>>1,D=P[te];if(0<i(D,K))P[te]=K,P[U]=D,U=te;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var K=P[0],U=P.pop();if(U!==K){P[0]=U;e:for(var te=0,D=P.length,M=D>>>1;te<M;){var V=2*(te+1)-1,O=P[V],ee=V+1,ue=P[ee];if(0>i(O,U))ee<D&&0>i(ue,O)?(P[te]=ue,P[ee]=U,te=ee):(P[te]=O,P[V]=U,te=V);else if(ee<D&&0>i(ue,U))P[te]=ue,P[ee]=U,te=ee;else break e}}return K}function i(P,K){var U=P.sortIndex-K.sortIndex;return U!==0?U:P.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var d=[],f=[],p=1,h=null,v=3,y=!1,b=!1,S=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function I(P){for(var K=n(f);K!==null;){if(K.callback===null)r(f);else if(K.startTime<=P)r(f),K.sortIndex=K.expirationTime,t(d,K);else break;K=n(f)}}function A(P){if(S=!1,I(P),!b)if(n(d)!==null)b=!0,N||(N=!0,Z());else{var K=n(f);K!==null&&Y(A,K.startTime-P)}}var N=!1,T=-1,z=5,L=-1;function G(){return C?!0:!(e.unstable_now()-L<z)}function J(){if(C=!1,N){var P=e.unstable_now();L=P;var K=!0;try{e:{b=!1,S&&(S=!1,k(T),T=-1),y=!0;var U=v;try{t:{for(I(P),h=n(d);h!==null&&!(h.expirationTime>P&&G());){var te=h.callback;if(typeof te=="function"){h.callback=null,v=h.priorityLevel;var D=te(h.expirationTime<=P);if(P=e.unstable_now(),typeof D=="function"){h.callback=D,I(P),K=!0;break t}h===n(d)&&r(d),I(P)}else r(d);h=n(d)}if(h!==null)K=!0;else{var M=n(f);M!==null&&Y(A,M.startTime-P),K=!1}}break e}finally{h=null,v=U,y=!1}K=void 0}}finally{K?Z():N=!1}}}var Z;if(typeof j=="function")Z=function(){j(J)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,F=W.port2;W.port1.onmessage=J,Z=function(){F.postMessage(null)}}else Z=function(){E(J,0)};function Y(P,K){T=E(function(){P(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(P){switch(v){case 1:case 2:case 3:var K=3;break;default:K=v}var U=v;v=K;try{return P()}finally{v=U}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(P,K){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var U=v;v=P;try{return K()}finally{v=U}},e.unstable_scheduleCallback=function(P,K,U){var te=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?te+U:te):U=te,P){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=U+D,P={id:p++,callback:K,priorityLevel:P,startTime:U,expirationTime:D,sortIndex:-1},U>te?(P.sortIndex=U,t(f,P),n(d)===null&&P===n(f)&&(S?(k(T),T=-1):S=!0,Y(A,U-te))):(P.sortIndex=D,t(d,P),b||y||(b=!0,N||(N=!0,Z()))),P},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(P){var K=v;return function(){var U=v;v=K;try{return P.apply(this,arguments)}finally{v=U}}}})(j_)),j_}var Q$;function DTe(){return Q$||(Q$=1,k_.exports=OTe()),k_.exports}var J$;function $Te(){if(J$)return Em;J$=1;var e=DTe(),t=vp(),n=oM();function r(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)l+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function o(s){var l=s,m=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(m=l.return),s=l.return;while(s)}return l.tag===3?m:null}function a(s){if(s.tag===13){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function c(s){if(s.tag===31){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function d(s){if(o(s)!==s)throw Error(r(188))}function f(s){var l=s.alternate;if(!l){if(l=o(s),l===null)throw Error(r(188));return l!==s?null:s}for(var m=s,g=l;;){var w=m.return;if(w===null)break;var _=w.alternate;if(_===null){if(g=w.return,g!==null){m=g;continue}break}if(w.child===_.child){for(_=w.child;_;){if(_===m)return d(w),s;if(_===g)return d(w),l;_=_.sibling}throw Error(r(188))}if(m.return!==g.return)m=w,g=_;else{for(var R=!1,$=w.child;$;){if($===m){R=!0,m=w,g=_;break}if($===g){R=!0,g=w,m=_;break}$=$.sibling}if(!R){for($=_.child;$;){if($===m){R=!0,m=_,g=w;break}if($===g){R=!0,g=_,m=w;break}$=$.sibling}if(!R)throw Error(r(189))}}if(m.alternate!==g)throw Error(r(190))}if(m.tag!==3)throw Error(r(188));return m.stateNode.current===m?s:l}function p(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s;for(s=s.child;s!==null;){if(l=p(s),l!==null)return l;s=s.sibling}return null}var h=Object.assign,v=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),j=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),G=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function Z(s){return s===null||typeof s!="object"?null:(s=J&&s[J]||s["@@iterator"],typeof s=="function"?s:null)}var W=Symbol.for("react.client.reference");function F(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===W?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case S:return"Fragment";case E:return"Profiler";case C:return"StrictMode";case A:return"Suspense";case N:return"SuspenseList";case L:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case b:return"Portal";case j:return s.displayName||"Context";case k:return(s._context.displayName||"Context")+".Consumer";case I:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case T:return l=s.displayName||null,l!==null?l:F(s.type)||"Memo";case z:l=s._payload,s=s._init;try{return F(s(l))}catch{}}return null}var Y=Array.isArray,P=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},te=[],D=-1;function M(s){return{current:s}}function V(s){0>D||(s.current=te[D],te[D]=null,D--)}function O(s,l){D++,te[D]=s.current,s.current=l}var ee=M(null),ue=M(null),pe=M(null),B=M(null);function ie(s,l){switch(O(pe,l),O(ue,s),O(ee,null),l.nodeType){case 9:case 11:s=(s=l.documentElement)&&(s=s.namespaceURI)?zT(s):0;break;default:if(s=l.tagName,l=l.namespaceURI)l=zT(l),s=LT(l,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}V(ee),O(ee,s)}function Se(){V(ee),V(ue),V(pe)}function Ie(s){s.memoizedState!==null&&O(B,s);var l=ee.current,m=LT(l,s.type);l!==m&&(O(ue,s),O(ee,m))}function Fe(s){ue.current===s&&(V(ee),V(ue)),B.current===s&&(V(B),Yf._currentValue=U)}var Ue,Ye;function St(s){if(Ue===void 0)try{throw Error()}catch(m){var l=m.stack.trim().match(/\n( *(at )?)/);Ue=l&&l[1]||"",Ye=-1<m.stack.indexOf(`
195
+ aria-invalid:focus-visible:ring-0`,{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",outline:"border bg-default border-primary border-2 text-white shadow-xs hover:-translate-y-1 transition duration-200 hover:bg-grey-700/40"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});var C9="Toggle",E9=x.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:i,...o}=e,[a,c]=Do({prop:n,onChange:i,defaultProp:r??!1,caller:C9});return u.jsx(Ke.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:je(e.onClick,()=>{e.disabled||c(!a)})})});E9.displayName=C9;var mTe=E9;function pTe({className:e,variant:t,size:n,...r}){return u.jsx(mTe,{"data-slot":"toggle",className:Me(fTe({variant:t,size:n,className:e})),...r})}function k9(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 Y$=["secondary","default","warning","outline","success","destructive"];let W$=0;const __=new Map,j9=e=>{if(__.has(e))return __.get(e);W$++;const t=W$%Y$.length,n=Y$[t];return __.set(e,n),n};function hTe({columns:e,data:t,onRowClick:n}){const r=dx({data:t,columns:e,getCoreRowModel:ux()});return u.jsx("div",{className:"rounded-md bg-black-dark logsTable",children:u.jsxs(fx,{className:"text-xs",children:[u.jsx(rh,{children:r.getHeaderGroups().map(i=>u.jsx(Ai,{className:"border-none",children:i.headers.map(o=>u.jsx(Wj,{className:"p-4 max-w-96",children:o.isPlaceholder?null:wc(o.column.columnDef.header,o.getContext())},o.id))},i.id))}),u.jsx(mx,{className:"bg-black",children:r.getRowModel().rows?.length?r.getRowModel().rows.map(i=>u.jsx(Ai,{"data-state":i.getIsSelected()&&"selected",className:Me("hover:bg-muted/10 data-[state=selected]:bg-muted max-w-full",n&&"cursor-pointer"),onClick:()=>n?.(i),children:i.getVisibleCells().map(o=>u.jsx(Xa,{className:"p-1",children:wc(o.column.columnDef.cell,o.getContext())},o.id))},i.id)):u.jsx(Ai,{children:u.jsx(Xa,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})})}function gTe(e){try{JSON.parse(e)}catch{return!1}return!0}function vTe({setIsModalOpen:e,isModalOpen:t,data:n}){const r=n?j9(n.node):"default";return u.jsx(zn,{onOpenChange:e,open:t,children:u.jsxs(Ln,{"aria-describedby":void 0,children:[u.jsx(xr,{children:u.jsx(Nn,{children:"Edit Row"})}),n?u.jsxs("div",{className:"flex flex-col gap-3 text-white",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"inline-block pr-2",children:"Level:"}),u.jsx(zo,{variant:k9(n.level),children:Eo(n.level)})]}),u.jsxs("div",{children:[u.jsx("h3",{children:"Timestamp:"}),u.jsx("p",{className:"text-sm",children:n.timestamp})]}),u.jsxs("div",{children:[u.jsx("h3",{children:"Thread:"}),u.jsx("p",{className:"text-sm",children:n.thread})]}),u.jsxs("div",{children:[u.jsx("h3",{children:"Node:"}),u.jsx(zo,{variant:r,children:n.node})]}),u.jsxs("div",{children:[u.jsx("h3",{children:"Tags:"}),u.jsx("p",{className:"text-sm",children:n.tags&&n.tags.length>0?u.jsx("span",{children:n.tags}):"N/A"})]}),u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-bold",children:"Message"}),u.jsx(gx,{className:"w-full h-72",language:gTe(n.message)?"json":"text",theme:"vs-dark",value:n.message,options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1}})]})]}):u.jsx(Ui,{}),u.jsx(Un,{children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsxs(be,{type:"button",variant:"destructive",className:"rounded-full",children:[u.jsx(ts,{})," Delete Row"]}),u.jsxs(be,{variant:"submit",className:"rounded-full",children:[u.jsx(ho,{})," Save Changes"]})]})})]})})}function yTe({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 bTe=mn({limit:nt().optional(),level:Jd(["notify","error","warn","info","debug","trace","undefined"]).optional(),from:nt().or(uy()).optional(),until:nt().or(uy()).optional()});function xTe({form:e,resetFilters:t,submitFilters:n}){return u.jsx("div",{children:u.jsx(Qt,{...e,children:u.jsxs("form",{onSubmit:e.handleSubmit(n),className:"flex-col space-y-5",children:[u.jsx(Pe,{control:e.control,name:"limit",render:({field:r})=>u.jsxs(Ae,{children:[u.jsx(Oe,{children:"Log Limit:"}),u.jsxs(co,{onValueChange:r.onChange,value:r.value,children:[u.jsx(fo,{className:"w-full",children:u.jsx(uo,{placeholder:"Select log limit"})}),u.jsx(mo,{children:u.jsxs(Lo,{children:[u.jsx(Sn,{value:"1000",children:"1000"}),u.jsx(Sn,{value:"500",children:"500"}),u.jsx(Sn,{value:"250",children:"250"}),u.jsx(Sn,{value:"100",children:"100"}),u.jsx(Sn,{value:"10",children:"10"})]})})]}),u.jsx(De,{})]})}),u.jsx(Pe,{control:e.control,name:"level",render:({field:r})=>u.jsxs(Ae,{children:[u.jsx(Oe,{children:"Log Level:"}),u.jsxs(co,{onValueChange:r.onChange,value:r.value,children:[u.jsx(fo,{className:"w-full",children:u.jsx(uo,{placeholder:"Select log level"})}),u.jsx(mo,{children:u.jsxs(Lo,{children:[u.jsx(Sn,{value:"undefined",children:"All"}),u.jsx(Sn,{value:"notify",children:"Notify"}),u.jsx(Sn,{value:"error",children:"Error"}),u.jsx(Sn,{value:"warn",children:"Warn"}),u.jsx(Sn,{value:"info",children:"Info"}),u.jsx(Sn,{value:"debug",children:"Debug"}),u.jsx(Sn,{value:"trace",children:"Trace"})]})})]}),u.jsx(De,{})]})}),u.jsx(Pe,{control:e.control,name:"from",render:({field:r})=>u.jsxs(Ae,{children:[u.jsx(Oe,{children:"Start Date:"}),u.jsx($e,{children:u.jsx(ze,{type:"datetime-local",value:r.value,onChange:r.onChange})}),u.jsx(De,{})]})}),u.jsx(Pe,{control:e.control,name:"until",render:({field:r})=>u.jsxs(Ae,{children:[u.jsx(Oe,{children:"End Date:"}),u.jsx($e,{children:u.jsx(ze,{type:"datetime-local",value:r.value,onChange:r.onChange})}),u.jsx(De,{})]})}),u.jsxs("div",{className:"flex items-center justify-between space-x-2 mt-2",children:[u.jsx(be,{type:"submit",variant:"positiveOutline",className:"grow",children:"Apply Filters"}),u.jsx(be,{type:"reset",variant:"destructiveOutline",onClick:()=>t(),children:"Clear Filters"})]})]})})})}const C_={limit:"100",level:"undefined",from:"",until:""},wTe=[{accessorKey:"level",header:"Status",cell:({row:e})=>{const{level:t}=e.original;return u.jsx(zo,{variant:k9(t),children:Eo(t)})}},{accessorKey:"timestamp",header:"Date",cell:({row:e})=>{const{timestamp:t}=e.original;return u.jsx("span",{children:new Date(t).toLocaleDateString()})}},{accessorKey:"time",header:"Time",cell:({row:e})=>{const{timestamp:t}=e.original;return u.jsx("span",{children:new Date(t).toLocaleTimeString()})}},{accessorKey:"thread",header:"Thread"},{accessorKey:"node",header:"Node",cell:({row:e})=>{const{node:t}=e.original,n=j9(t);return u.jsx(u.Fragment,{children:t?u.jsxs(_b,{children:[u.jsx(Cb,{asChild:!0,children:u.jsxs(zo,{variant:n,children:[t.split(".")[0],"..."]})}),u.jsx(Eb,{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})})}}],STe=(e,t)=>{if(!e&&!t||!e||!t)return!0;const n=new Date(e),r=new Date(t);return n<=r};function _Te(){const[e,t]=x.useState(C_),[n,r]=x.useState(!1),[i,o]=x.useState(),[a,c]=x.useState(!1),d=Ft(),{data:f,isLoading:p,refetch:h,isFetching:v}=Pt(yTe({logFilters:e,...d,replicated:d.entityType==="cluster",isAutoRefreshEnabled:a})),y=Xt({resolver:sn(bTe),defaultValues:C_,mode:"onChange"}),b=k=>{o(k.original),r(!0)},S=async k=>{if(!STe(k.from,k.until)){y.setError("from",{type:"onChange",message:"Start date must be before end date"}),y.setError("until",{type:"onChange",message:"End date must be after start date"});return}t(k)},C=async()=>{y.reset(),t(C_)},E=vl(h);return u.jsxs("div",{className:"grid grid-cols-1 gap-4 text-white md:grid-cols-12",children:[u.jsxs("section",{className:"col-span-1 md:col-span-4 lg:col-span-3 px-2 pt-4 md:pt-12",children:[u.jsx(xTe,{form:y,resetFilters:C,submitFilters:S}),u.jsxs("div",{className:"flex items-center justify-between space-x-2 mt-2",children:[u.jsxs(be,{variant:"defaultOutline",onClick:E,disabled:v||p||a,className:"grow",children:[u.jsx(sa,{}),"Refresh"]}),u.jsxs(pTe,{variant:"outline","aria-label":"Toggle Auto Refresh",onPressedChange:c,children:[u.jsx(sa,{}),"Auto Refresh ",a?"On":"Off"]})]})]}),u.jsx("section",{className:"col-span-1 md:col-span-8 lg:col-span-9",children:p?u.jsx("div",{children:"Loading..."}):u.jsx("div",{children:u.jsx(hTe,{columns:wTe,data:f||[],onRowClick:b})})}),u.jsx(vTe,{isModalOpen:n,setIsModalOpen:r,data:i})]})}function CTe(e){return Qe({getParentRoute:()=>e,path:"logs",component:_Te})}function ETe(e){return Qe({getParentRoute:()=>e,path:"status",component:aM(async()=>Np(()=>import("./index-Duj5JfEk.js"),__vite__mapDeps([3,1])),"StatusIndex")})}function kTe(e){const t=dTe(e),n=[CTe(t),...ZRe(t),g_e(t),ETe(t),YIe(t),iTe(t)];return t.addChildren(n)}Qe({getParentRoute:()=>vx,path:"profile",component:aM(async()=>Np(()=>import("./index-DmMDPK6n.js"),[]),"ProfileIndex")});const jTe=fb.addChildren([...gge,vx.addChildren([kTe("local")])]);function RTe({routeTree:e=jTe,authentication:t}){const n=aZ();return FY({routeTree:e,history:n,defaultNotFoundComponent:zQ,defaultErrorComponent:Fv,defaultPreload:LQ()?!1:"intent",trailingSlash:"never",defaultPreloadStaleTime:0,scrollRestoration:!0,context:{queryClient:Vv,authentication:t||{}}})}function ITe(){const e=GY(),t=RTe({authentication:e});return u.jsxs(u.Fragment,{children:[u.jsx(HY,{router:t,context:{authentication:e}}),!1]})}const NTe=({...e})=>u.jsx(fJ,{className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground font-medium",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground font-medium"}},...e});var TTe=function(){return null};function ATe(){return Gle(),Mse(),u.jsxs(u.Fragment,{children:[u.jsxs(VK,{client:Vv,children:[u.jsx(ITe,{}),u.jsx(TTe,{buttonPosition:"bottom-right"})]}),u.jsx(NTe,{richColors:!0})]})}var E_={exports:{}},Em={},k_={exports:{}},j_={};var X$;function OTe(){return X$||(X$=1,(function(e){function t(P,K){var U=P.length;P.push(K);e:for(;0<U;){var te=U-1>>>1,D=P[te];if(0<i(D,K))P[te]=K,P[U]=D,U=te;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var K=P[0],U=P.pop();if(U!==K){P[0]=U;e:for(var te=0,D=P.length,M=D>>>1;te<M;){var V=2*(te+1)-1,O=P[V],ee=V+1,ue=P[ee];if(0>i(O,U))ee<D&&0>i(ue,O)?(P[te]=ue,P[ee]=U,te=ee):(P[te]=O,P[V]=U,te=V);else if(ee<D&&0>i(ue,U))P[te]=ue,P[ee]=U,te=ee;else break e}}return K}function i(P,K){var U=P.sortIndex-K.sortIndex;return U!==0?U:P.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var d=[],f=[],p=1,h=null,v=3,y=!1,b=!1,S=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function I(P){for(var K=n(f);K!==null;){if(K.callback===null)r(f);else if(K.startTime<=P)r(f),K.sortIndex=K.expirationTime,t(d,K);else break;K=n(f)}}function A(P){if(S=!1,I(P),!b)if(n(d)!==null)b=!0,N||(N=!0,Z());else{var K=n(f);K!==null&&Y(A,K.startTime-P)}}var N=!1,T=-1,z=5,L=-1;function G(){return C?!0:!(e.unstable_now()-L<z)}function J(){if(C=!1,N){var P=e.unstable_now();L=P;var K=!0;try{e:{b=!1,S&&(S=!1,k(T),T=-1),y=!0;var U=v;try{t:{for(I(P),h=n(d);h!==null&&!(h.expirationTime>P&&G());){var te=h.callback;if(typeof te=="function"){h.callback=null,v=h.priorityLevel;var D=te(h.expirationTime<=P);if(P=e.unstable_now(),typeof D=="function"){h.callback=D,I(P),K=!0;break t}h===n(d)&&r(d),I(P)}else r(d);h=n(d)}if(h!==null)K=!0;else{var M=n(f);M!==null&&Y(A,M.startTime-P),K=!1}}break e}finally{h=null,v=U,y=!1}K=void 0}}finally{K?Z():N=!1}}}var Z;if(typeof j=="function")Z=function(){j(J)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,F=W.port2;W.port1.onmessage=J,Z=function(){F.postMessage(null)}}else Z=function(){E(J,0)};function Y(P,K){T=E(function(){P(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(P){switch(v){case 1:case 2:case 3:var K=3;break;default:K=v}var U=v;v=K;try{return P()}finally{v=U}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(P,K){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var U=v;v=P;try{return K()}finally{v=U}},e.unstable_scheduleCallback=function(P,K,U){var te=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?te+U:te):U=te,P){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=U+D,P={id:p++,callback:K,priorityLevel:P,startTime:U,expirationTime:D,sortIndex:-1},U>te?(P.sortIndex=U,t(f,P),n(d)===null&&P===n(f)&&(S?(k(T),T=-1):S=!0,Y(A,U-te))):(P.sortIndex=D,t(d,P),b||y||(b=!0,N||(N=!0,Z()))),P},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(P){var K=v;return function(){var U=v;v=K;try{return P.apply(this,arguments)}finally{v=U}}}})(j_)),j_}var Q$;function DTe(){return Q$||(Q$=1,k_.exports=OTe()),k_.exports}var J$;function $Te(){if(J$)return Em;J$=1;var e=DTe(),t=vp(),n=oM();function r(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)l+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function o(s){var l=s,m=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(m=l.return),s=l.return;while(s)}return l.tag===3?m:null}function a(s){if(s.tag===13){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function c(s){if(s.tag===31){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function d(s){if(o(s)!==s)throw Error(r(188))}function f(s){var l=s.alternate;if(!l){if(l=o(s),l===null)throw Error(r(188));return l!==s?null:s}for(var m=s,g=l;;){var w=m.return;if(w===null)break;var _=w.alternate;if(_===null){if(g=w.return,g!==null){m=g;continue}break}if(w.child===_.child){for(_=w.child;_;){if(_===m)return d(w),s;if(_===g)return d(w),l;_=_.sibling}throw Error(r(188))}if(m.return!==g.return)m=w,g=_;else{for(var R=!1,$=w.child;$;){if($===m){R=!0,m=w,g=_;break}if($===g){R=!0,g=w,m=_;break}$=$.sibling}if(!R){for($=_.child;$;){if($===m){R=!0,m=_,g=w;break}if($===g){R=!0,g=_,m=w;break}$=$.sibling}if(!R)throw Error(r(189))}}if(m.alternate!==g)throw Error(r(190))}if(m.tag!==3)throw Error(r(188));return m.stateNode.current===m?s:l}function p(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s;for(s=s.child;s!==null;){if(l=p(s),l!==null)return l;s=s.sibling}return null}var h=Object.assign,v=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),j=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),G=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function Z(s){return s===null||typeof s!="object"?null:(s=J&&s[J]||s["@@iterator"],typeof s=="function"?s:null)}var W=Symbol.for("react.client.reference");function F(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===W?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case S:return"Fragment";case E:return"Profiler";case C:return"StrictMode";case A:return"Suspense";case N:return"SuspenseList";case L:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case b:return"Portal";case j:return s.displayName||"Context";case k:return(s._context.displayName||"Context")+".Consumer";case I:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case T:return l=s.displayName||null,l!==null?l:F(s.type)||"Memo";case z:l=s._payload,s=s._init;try{return F(s(l))}catch{}}return null}var Y=Array.isArray,P=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},te=[],D=-1;function M(s){return{current:s}}function V(s){0>D||(s.current=te[D],te[D]=null,D--)}function O(s,l){D++,te[D]=s.current,s.current=l}var ee=M(null),ue=M(null),pe=M(null),B=M(null);function ie(s,l){switch(O(pe,l),O(ue,s),O(ee,null),l.nodeType){case 9:case 11:s=(s=l.documentElement)&&(s=s.namespaceURI)?zT(s):0;break;default:if(s=l.tagName,l=l.namespaceURI)l=zT(l),s=LT(l,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}V(ee),O(ee,s)}function Se(){V(ee),V(ue),V(pe)}function Ie(s){s.memoizedState!==null&&O(B,s);var l=ee.current,m=LT(l,s.type);l!==m&&(O(ue,s),O(ee,m))}function Fe(s){ue.current===s&&(V(ee),V(ue)),B.current===s&&(V(B),Yf._currentValue=U)}var Ue,Ye;function St(s){if(Ue===void 0)try{throw Error()}catch(m){var l=m.stack.trim().match(/\n( *(at )?)/);Ue=l&&l[1]||"",Ye=-1<m.stack.indexOf(`
196
196
  at`)?" (<anonymous>)":-1<m.stack.indexOf("@")?"@unknown:0:0":""}return`
197
197
  `+Ue+s+Ye}var gn=!1;function Tn(s,l){if(!s||gn)return"";gn=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(l){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(me){var ce=me}Reflect.construct(s,[],xe)}else{try{xe.call()}catch(me){ce=me}s.call(xe.prototype)}}else{try{throw Error()}catch(me){ce=me}(xe=s())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(me){if(me&&ce&&typeof me.stack=="string")return[me.stack,ce.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var w=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");w&&w.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=g.DetermineComponentFrameRoot(),R=_[0],$=_[1];if(R&&$){var H=R.split(`
198
198
  `),le=$.split(`