harperdb 4.7.13 → 4.7.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.lazy-CpOLLVMN.js","assets/react-redux-Dfr59TAh.js","assets/index-CVjGhoEG.css","assets/index-CLmLLaxk.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.lazy-CwPUt0Bc.js","assets/react-redux-Dy0makvb.js","assets/index-CVjGhoEG.css","assets/index-DHFTW4ZU.js"])))=>i.map(i=>d[i]);
2
2
  function dY(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 B$e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ef(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var o_={exports:{}},xp={};var HA;function fY(){if(HA)return xp;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 xp.Fragment=t,xp.jsx=n,xp.jsxs=n,xp}var qA;function pY(){return qA||(qA=1,o_.exports=fY()),o_.exports}var u=pY();const hd=!0,mY="/",Ed=9925,Y1="HDB_ADMIN",ya="/",zk="../",hY=1024*1024*1024,gY=100*1024*1024;function GM(e,t){return function(){return e.apply(t,arguments)}}const{toString:vY}=Object.prototype,{getPrototypeOf:Lk}=Object,{iterator:_b,toStringTag:ZM}=Symbol,Cb=(e=>t=>{const n=vY.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Wo=e=>(e=e.toLowerCase(),t=>Cb(t)===e),kb=e=>t=>typeof t===e,{isArray:tf}=Array,jd=kb("undefined");function zm(e){return e!==null&&!jd(e)&&e.constructor!==null&&!jd(e.constructor)&&xi(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const YM=Wo("ArrayBuffer");function yY(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&YM(e.buffer),t}const bY=kb("string"),xi=kb("function"),WM=kb("number"),Lm=e=>e!==null&&typeof e=="object",xY=e=>e===!0||e===!1,Yv=e=>{if(Cb(e)!=="object")return!1;const t=Lk(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(ZM in e)&&!(_b in e)},wY=e=>{if(!Lm(e)||zm(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},SY=Wo("Date"),_Y=Wo("File"),CY=Wo("Blob"),kY=Wo("FileList"),EY=e=>Lm(e)&&xi(e.pipe),jY=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||xi(e.append)&&((t=Cb(e))==="formdata"||t==="object"&&xi(e.toString)&&e.toString()==="[object FormData]"))},RY=Wo("URLSearchParams"),[IY,NY,TY,OY]=["ReadableStream","Request","Response","Headers"].map(Wo),AY=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Fm(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),tf(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(zm(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 XM(e,t){if(zm(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 fc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,JM=e=>!jd(e)&&e!==fc;function W1(){const{caseless:e,skipUndefined:t}=JM(this)&&this||{},n={},r=(i,o)=>{const a=e&&XM(n,o)||o;Yv(n[a])&&Yv(i)?n[a]=W1(n[a],i):Yv(i)?n[a]=W1({},i):tf(i)?n[a]=i.slice():(!t||!jd(i))&&(n[a]=i)};for(let i=0,o=arguments.length;i<o;i++)arguments[i]&&Fm(arguments[i],r);return n}const DY=(e,t,n,{allOwnKeys:r}={})=>(Fm(t,(i,o)=>{n&&xi(i)?e[o]=GM(i,n):e[o]=i},{allOwnKeys:r}),e),$Y=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),PY=(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)},MY=(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&&Lk(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},zY=(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},LY=e=>{if(!e)return null;if(tf(e))return e;let t=e.length;if(!WM(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},FY=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Lk(Uint8Array)),UY=(e,t)=>{const r=(e&&e[_b]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},VY=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},BY=Wo("HTMLFormElement"),HY=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),KA=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),qY=Wo("RegExp"),QM=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Fm(n,(i,o)=>{let a;(a=t(i,o,e))!==!1&&(r[o]=a||i)}),Object.defineProperties(e,r)},KY=e=>{QM(e,(t,n)=>{if(xi(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(xi(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+"'")})}})},GY=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return tf(e)?r(e):r(String(e).split(t)),n},ZY=()=>{},YY=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function WY(e){return!!(e&&xi(e.append)&&e[ZM]==="FormData"&&e[_b])}const XY=e=>{const t=new Array(10),n=(r,i)=>{if(Lm(r)){if(t.indexOf(r)>=0)return;if(zm(r))return r;if(!("toJSON"in r)){t[i]=r;const o=tf(r)?[]:{};return Fm(r,(a,c)=>{const d=n(a,i+1);!jd(d)&&(o[c]=d)}),t[i]=void 0,o}}return r};return n(e,0)},JY=Wo("AsyncFunction"),QY=e=>e&&(Lm(e)||xi(e))&&xi(e.then)&&xi(e.catch),ez=((e,t)=>e?setImmediate:t?((n,r)=>(fc.addEventListener("message",({source:i,data:o})=>{i===fc&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),fc.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",xi(fc.postMessage)),eW=typeof queueMicrotask<"u"?queueMicrotask.bind(fc):typeof process<"u"&&process.nextTick||ez,tW=e=>e!=null&&xi(e[_b]),me={isArray:tf,isArrayBuffer:YM,isBuffer:zm,isFormData:jY,isArrayBufferView:yY,isString:bY,isNumber:WM,isBoolean:xY,isObject:Lm,isPlainObject:Yv,isEmptyObject:wY,isReadableStream:IY,isRequest:NY,isResponse:TY,isHeaders:OY,isUndefined:jd,isDate:SY,isFile:_Y,isBlob:CY,isRegExp:qY,isFunction:xi,isStream:EY,isURLSearchParams:RY,isTypedArray:FY,isFileList:kY,forEach:Fm,merge:W1,extend:DY,trim:AY,stripBOM:$Y,inherits:PY,toFlatObject:MY,kindOf:Cb,kindOfTest:Wo,endsWith:zY,toArray:LY,forEachEntry:UY,matchAll:VY,isHTMLForm:BY,hasOwnProperty:KA,hasOwnProp:KA,reduceDescriptors:QM,freezeMethods:KY,toObjectSet:GY,toCamelCase:HY,noop:ZY,toFiniteNumber:YY,findKey:XM,global:fc,isContextDefined:JM,isSpecCompliantForm:WY,toJSONObject:XY,isAsyncFn:JY,isThenable:QY,setImmediate:ez,asap:eW,isIterable:tW};function mt(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}me.inherits(mt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:me.toJSONObject(this.config),code:this.code,status:this.status}}});const tz=mt.prototype,nz={};["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=>{nz[e]={value:e}});Object.defineProperties(mt,nz);Object.defineProperty(tz,"isAxiosError",{value:!0});mt.from=(e,t,n,r,i,o)=>{const a=Object.create(tz);me.toFlatObject(e,a,function(m){return m!==Error.prototype},f=>f!=="isAxiosError");const c=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return mt.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 nW=null;function X1(e){return me.isPlainObject(e)||me.isArray(e)}function rz(e){return me.endsWith(e,"[]")?e.slice(0,-2):e}function GA(e,t,n){return e?e.concat(t).map(function(i,o){return i=rz(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function rW(e){return me.isArray(e)&&!e.some(X1)}const iW=me.toFlatObject(me,{},null,function(t){return/^is[A-Z]/.test(t)});function Eb(e,t,n){if(!me.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=me.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,C){return!me.isUndefined(C[S])});const r=n.metaTokens,i=n.visitor||m,o=n.dots,a=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&me.isSpecCompliantForm(t);if(!me.isFunction(i))throw new TypeError("visitor must be a function");function f(x){if(x===null)return"";if(me.isDate(x))return x.toISOString();if(me.isBoolean(x))return x.toString();if(!d&&me.isBlob(x))throw new mt("Blob is not supported. Use a Buffer instead.");return me.isArrayBuffer(x)||me.isTypedArray(x)?d&&typeof Blob=="function"?new Blob([x]):Buffer.from(x):x}function m(x,S,C){let k=x;if(x&&!C&&typeof x=="object"){if(me.endsWith(S,"{}"))S=r?S:S.slice(0,-2),x=JSON.stringify(x);else if(me.isArray(x)&&rW(x)||(me.isFileList(x)||me.endsWith(S,"[]"))&&(k=me.toArray(x)))return S=rz(S),k.forEach(function(j,R){!(me.isUndefined(j)||j===null)&&t.append(a===!0?GA([S],R,o):a===null?S:S+"[]",f(j))}),!1}return X1(x)?!0:(t.append(GA(C,S,o),f(x)),!1)}const h=[],v=Object.assign(iW,{defaultVisitor:m,convertValue:f,isVisitable:X1});function y(x,S){if(!me.isUndefined(x)){if(h.indexOf(x)!==-1)throw Error("Circular reference detected in "+S.join("."));h.push(x),me.forEach(x,function(k,E){(!(me.isUndefined(k)||k===null)&&i.call(t,k,me.isString(E)?E.trim():E,S,v))===!0&&y(k,S?S.concat(E):[E])}),h.pop()}}if(!me.isObject(e))throw new TypeError("data must be an object");return y(e),t}function ZA(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Fk(e,t){this._pairs=[],e&&Eb(e,this,t)}const iz=Fk.prototype;iz.append=function(t,n){this._pairs.push([t,n])};iz.toString=function(t){const n=t?function(r){return t.call(this,r,ZA)}:ZA;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function oW(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function oz(e,t,n){if(!t)return e;const r=n&&n.encode||oW;me.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(i?o=i(t,n):o=me.isURLSearchParams(t)?t.toString():new Fk(t,n).toString(r),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class YA{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){me.forEach(this.handlers,function(r){r!==null&&t(r)})}}const az={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},aW=typeof URLSearchParams<"u"?URLSearchParams:Fk,sW=typeof FormData<"u"?FormData:null,lW=typeof Blob<"u"?Blob:null,cW={isBrowser:!0,classes:{URLSearchParams:aW,FormData:sW,Blob:lW},protocols:["http","https","file","blob","url","data"]},Uk=typeof window<"u"&&typeof document<"u",J1=typeof navigator=="object"&&navigator||void 0,uW=Uk&&(!J1||["ReactNative","NativeScript","NS"].indexOf(J1.product)<0),dW=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",fW=Uk&&window.location.href||"http://localhost",pW=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Uk,hasStandardBrowserEnv:uW,hasStandardBrowserWebWorkerEnv:dW,navigator:J1,origin:fW},Symbol.toStringTag,{value:"Module"})),Or={...pW,...cW};function mW(e,t){return Eb(e,new Or.classes.URLSearchParams,{visitor:function(n,r,i,o){return Or.isNode&&me.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function hW(e){return me.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function gW(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 sz(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&&me.isArray(i)?i.length:a,d?(me.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!c):((!i[a]||!me.isObject(i[a]))&&(i[a]=[]),t(n,r,i[a],o)&&me.isArray(i[a])&&(i[a]=gW(i[a])),!c)}if(me.isFormData(e)&&me.isFunction(e.entries)){const n={};return me.forEachEntry(e,(r,i)=>{t(hW(r),i,n,0)}),n}return null}function vW(e,t,n){if(me.isString(e))try{return(t||JSON.parse)(e),me.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Um={transitional:az,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=me.isObject(t);if(o&&me.isHTMLForm(t)&&(t=new FormData(t)),me.isFormData(t))return i?JSON.stringify(sz(t)):t;if(me.isArrayBuffer(t)||me.isBuffer(t)||me.isStream(t)||me.isFile(t)||me.isBlob(t)||me.isReadableStream(t))return t;if(me.isArrayBufferView(t))return t.buffer;if(me.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return mW(t,this.formSerializer).toString();if((c=me.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Eb(c?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),vW(t)):t}],transformResponse:[function(t){const n=this.transitional||Um.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(me.isResponse(t)||me.isReadableStream(t))return t;if(t&&me.isString(t)&&(r&&!this.responseType||i)){const a=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(c){if(a)throw c.name==="SyntaxError"?mt.from(c,mt.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:Or.classes.FormData,Blob:Or.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};me.forEach(["delete","get","head","post","put","patch"],e=>{Um.headers[e]={}});const yW=me.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),bW=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]&&yW[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 wp(e){return e&&String(e).trim().toLowerCase()}function Wv(e){return e===!1||e==null?e:me.isArray(e)?e.map(Wv):String(e)}function xW(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 wW=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function a_(e,t,n,r,i){if(me.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!me.isString(t)){if(me.isString(r))return t.indexOf(r)!==-1;if(me.isRegExp(r))return r.test(t)}}function SW(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function _W(e,t){const n=me.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,o,a){return this[r].call(this,t,i,o,a)},configurable:!0})})}let wi=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(c,d,f){const m=wp(d);if(!m)throw new Error("header name must be a non-empty string");const h=me.findKey(i,m);(!h||i[h]===void 0||f===!0||f===void 0&&i[h]!==!1)&&(i[h||d]=Wv(c))}const a=(c,d)=>me.forEach(c,(f,m)=>o(f,m,d));if(me.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(me.isString(t)&&(t=t.trim())&&!wW(t))a(bW(t),n);else if(me.isObject(t)&&me.isIterable(t)){let c={},d,f;for(const m of t){if(!me.isArray(m))throw TypeError("Object iterator must return a key-value pair");c[f=m[0]]=(d=c[f])?me.isArray(d)?[...d,m[1]]:[d,m[1]]:m[1]}a(c,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=wp(t),t){const r=me.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return xW(i);if(me.isFunction(n))return n.call(this,i,r);if(me.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=wp(t),t){const r=me.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||a_(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(a){if(a=wp(a),a){const c=me.findKey(r,a);c&&(!n||a_(r,r[c],c,n))&&(delete r[c],i=!0)}}return me.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||a_(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return me.forEach(this,(i,o)=>{const a=me.findKey(r,o);if(a){n[a]=Wv(i),delete n[o];return}const c=t?SW(o):String(o).trim();c!==o&&delete n[o],n[c]=Wv(i),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return me.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&me.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
4
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=wp(a);r[c]||(_W(i,a),r[c]=!0)}return me.isArray(t)?t.forEach(o):o(t),this}};wi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);me.reduceDescriptors(wi.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});me.freezeMethods(wi);function s_(e,t){const n=this||Um,r=t||n,i=wi.from(r.headers);let o=r.data;return me.forEach(e,function(c){o=c.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function lz(e){return!!(e&&e.__CANCEL__)}function nf(e,t,n){mt.call(this,e??"canceled",mt.ERR_CANCELED,t,n),this.name="CanceledError"}me.inherits(nf,mt,{__CANCEL__:!0});function cz(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new mt("Request failed with status code "+n.status,[mt.ERR_BAD_REQUEST,mt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function CW(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function kW(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,a;return t=t!==void 0?t:1e3,function(d){const f=Date.now(),m=r[o];a||(a=f),n[i]=d,r[i]=f;let h=o,v=0;for(;h!==i;)v+=n[h++],h=h%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),f-a<t)return;const y=m&&f-m;return y?Math.round(v*1e3/y):void 0}}function EW(e,t){let n=0,r=1e3/t,i,o;const a=(f,m=Date.now())=>{n=m,i=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const m=Date.now(),h=m-n;h>=r?a(f,m):(i=f,o||(o=setTimeout(()=>{o=null,a(i)},r-h)))},()=>i&&a(i)]}const hy=(e,t,n=3)=>{let r=0;const i=kW(50,250);return EW(o=>{const a=o.loaded,c=o.lengthComputable?o.total:void 0,d=a-r,f=i(d),m=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&&m?(c-a)/f:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(h)},n)},XA=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},JA=e=>(...t)=>me.asap(()=>e(...t)),jW=Or.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Or.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Or.origin),Or.navigator&&/(msie|trident)/i.test(Or.navigator.userAgent)):()=>!0,RW=Or.hasStandardBrowserEnv?{write(e,t,n,r,i,o,a){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];me.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),me.isString(r)&&c.push(`path=${r}`),me.isString(i)&&c.push(`domain=${i}`),o===!0&&c.push("secure"),me.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 IW(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function NW(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function uz(e,t,n){let r=!IW(t);return e&&(r||n==!1)?NW(e,t):t}const QA=e=>e instanceof wi?{...e}:e;function jc(e,t){t=t||{};const n={};function r(f,m,h,v){return me.isPlainObject(f)&&me.isPlainObject(m)?me.merge.call({caseless:v},f,m):me.isPlainObject(m)?me.merge({},m):me.isArray(m)?m.slice():m}function i(f,m,h,v){if(me.isUndefined(m)){if(!me.isUndefined(f))return r(void 0,f,h,v)}else return r(f,m,h,v)}function o(f,m){if(!me.isUndefined(m))return r(void 0,m)}function a(f,m){if(me.isUndefined(m)){if(!me.isUndefined(f))return r(void 0,f)}else return r(void 0,m)}function c(f,m,h){if(h in t)return r(f,m);if(h in e)return r(void 0,f)}const d={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(f,m,h)=>i(QA(f),QA(m),h,!0)};return me.forEach(Object.keys({...e,...t}),function(m){const h=d[m]||i,v=h(e[m],t[m],m);me.isUndefined(v)&&h!==c||(n[m]=v)}),n}const dz=e=>{const t=jc({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:a,auth:c}=t;if(t.headers=a=wi.from(a),t.url=oz(uz(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),me.isFormData(n)){if(Or.hasStandardBrowserEnv||Or.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(me.isFunction(n.getHeaders)){const d=n.getHeaders(),f=["content-type","content-length"];Object.entries(d).forEach(([m,h])=>{f.includes(m.toLowerCase())&&a.set(m,h)})}}if(Or.hasStandardBrowserEnv&&(r&&me.isFunction(r)&&(r=r(t)),r||r!==!1&&jW(t.url))){const d=i&&o&&RW.read(o);d&&a.set(i,d)}return t},TW=typeof XMLHttpRequest<"u",OW=TW&&function(e){return new Promise(function(n,r){const i=dz(e);let o=i.data;const a=wi.from(i.headers).normalize();let{responseType:c,onUploadProgress:d,onDownloadProgress:f}=i,m,h,v,y,x;function S(){y&&y(),x&&x(),i.cancelToken&&i.cancelToken.unsubscribe(m),i.signal&&i.signal.removeEventListener("abort",m)}let C=new XMLHttpRequest;C.open(i.method.toUpperCase(),i.url,!0),C.timeout=i.timeout;function k(){if(!C)return;const j=wi.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),T={data:!c||c==="text"||c==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:j,config:e,request:C};cz(function(O){n(O),S()},function(O){r(O),S()},T),C=null}"onloadend"in C?C.onloadend=k:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(k)},C.onabort=function(){C&&(r(new mt("Request aborted",mt.ECONNABORTED,e,C)),C=null)},C.onerror=function(R){const T=R&&R.message?R.message:"Network Error",N=new mt(T,mt.ERR_NETWORK,e,C);N.event=R||null,r(N),C=null},C.ontimeout=function(){let R=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const T=i.transitional||az;i.timeoutErrorMessage&&(R=i.timeoutErrorMessage),r(new mt(R,T.clarifyTimeoutError?mt.ETIMEDOUT:mt.ECONNABORTED,e,C)),C=null},o===void 0&&a.setContentType(null),"setRequestHeader"in C&&me.forEach(a.toJSON(),function(R,T){C.setRequestHeader(T,R)}),me.isUndefined(i.withCredentials)||(C.withCredentials=!!i.withCredentials),c&&c!=="json"&&(C.responseType=i.responseType),f&&([v,x]=hy(f,!0),C.addEventListener("progress",v)),d&&C.upload&&([h,y]=hy(d),C.upload.addEventListener("progress",h),C.upload.addEventListener("loadend",y)),(i.cancelToken||i.signal)&&(m=j=>{C&&(r(!j||j.type?new nf(null,e,C):j),C.abort(),C=null)},i.cancelToken&&i.cancelToken.subscribe(m),i.signal&&(i.signal.aborted?m():i.signal.addEventListener("abort",m)));const E=CW(i.url);if(E&&Or.protocols.indexOf(E)===-1){r(new mt("Unsupported protocol "+E+":",mt.ERR_BAD_REQUEST,e));return}C.send(o||null)})},AW=(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 m=f instanceof Error?f:this.reason;r.abort(m instanceof mt?m:new nf(m instanceof Error?m.message:m))}};let a=t&&setTimeout(()=>{a=null,o(new mt(`timeout ${t} of ms exceeded`,mt.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=()=>me.asap(c),d}},DW=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},$W=async function*(e,t){for await(const n of PW(e))yield*DW(n,t)},PW=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()}},eD=(e,t,n,r)=>{const i=$W(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:m}=await i.next();if(f){c(),d.close();return}let h=m.byteLength;if(n){let v=o+=h;n(v)}d.enqueue(new Uint8Array(m))}catch(f){throw c(f),f}},cancel(d){return c(d),i.return()}},{highWaterMark:2})},tD=64*1024,{isFunction:iv}=me,MW=(({Request:e,Response:t})=>({Request:e,Response:t}))(me.global),{ReadableStream:nD,TextEncoder:rD}=me.global,iD=(e,...t)=>{try{return!!e(...t)}catch{return!1}},zW=e=>{e=me.merge.call({skipUndefined:!0},MW,e);const{fetch:t,Request:n,Response:r}=e,i=t?iv(t):typeof fetch=="function",o=iv(n),a=iv(r);if(!i)return!1;const c=i&&iv(nD),d=i&&(typeof rD=="function"?(x=>S=>x.encode(S))(new rD):async x=>new Uint8Array(await new n(x).arrayBuffer())),f=o&&c&&iD(()=>{let x=!1;const S=new n(Or.origin,{body:new nD,method:"POST",get duplex(){return x=!0,"half"}}).headers.has("Content-Type");return x&&!S}),m=a&&c&&iD(()=>me.isReadableStream(new r("").body)),h={stream:m&&(x=>x.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(x=>{!h[x]&&(h[x]=(S,C)=>{let k=S&&S[x];if(k)return k.call(S);throw new mt(`Response type '${x}' is not supported`,mt.ERR_NOT_SUPPORT,C)})});const v=async x=>{if(x==null)return 0;if(me.isBlob(x))return x.size;if(me.isSpecCompliantForm(x))return(await new n(Or.origin,{method:"POST",body:x}).arrayBuffer()).byteLength;if(me.isArrayBufferView(x)||me.isArrayBuffer(x))return x.byteLength;if(me.isURLSearchParams(x)&&(x=x+""),me.isString(x))return(await d(x)).byteLength},y=async(x,S)=>{const C=me.toFiniteNumber(x.getContentLength());return C??v(S)};return async x=>{let{url:S,method:C,data:k,signal:E,cancelToken:j,timeout:R,onDownloadProgress:T,onUploadProgress:N,responseType:O,headers:M,withCredentials:L="same-origin",fetchOptions:K}=dz(x),ee=t||fetch;O=O?(O+"").toLowerCase():"text";let q=AW([E,j&&j.toAbortSignal()],R),Y=null;const U=q&&q.unsubscribe&&(()=>{q.unsubscribe()});let H;try{if(N&&f&&C!=="get"&&C!=="head"&&(H=await y(M,k))!==0){let $=new n(S,{method:"POST",body:k,duplex:"half"}),V;if(me.isFormData(k)&&(V=$.headers.get("content-type"))&&M.setContentType(V),$.body){const[A,J]=XA(H,hy(JA(N)));k=eD($.body,tD,A,J)}}me.isString(L)||(L=L?"include":"omit");const z=o&&"credentials"in n.prototype,W={...K,signal:q,method:C.toUpperCase(),headers:M.normalize().toJSON(),body:k,duplex:"half",credentials:z?L:void 0};Y=o&&new n(S,W);let F=await(o?ee(Y,K):ee(S,W));const te=m&&(O==="stream"||O==="response");if(m&&(T||te&&U)){const $={};["status","statusText","headers"].forEach(fe=>{$[fe]=F[fe]});const V=me.toFiniteNumber(F.headers.get("content-length")),[A,J]=T&&XA(V,hy(JA(T),!0))||[];F=new r(eD(F.body,tD,A,()=>{J&&J(),U&&U()}),$)}O=O||"text";let D=await h[me.findKey(h,O)||"text"](F,x);return!te&&U&&U(),await new Promise(($,V)=>{cz($,V,{data:D,headers:wi.from(F.headers),status:F.status,statusText:F.statusText,config:x,request:Y})})}catch(z){throw U&&U(),z&&z.name==="TypeError"&&/Load failed|fetch/i.test(z.message)?Object.assign(new mt("Network Error",mt.ERR_NETWORK,x,Y),{cause:z.cause||z}):mt.from(z,z&&z.code,x,Y)}}},LW=new Map,fz=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,m=LW;for(;c--;)d=o[c],f=m.get(d),f===void 0&&m.set(d,f=c?new Map:zW(t)),m=f;return f};fz();const Vk={http:nW,xhr:OW,fetch:{get:fz}};me.forEach(Vk,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const oD=e=>`- ${e}`,FW=e=>me.isFunction(e)||e===null||e===!1;function UW(e,t){e=me.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let a=0;a<n;a++){r=e[a];let c;if(i=r,!FW(r)&&(i=Vk[(c=String(r)).toLowerCase()],i===void 0))throw new mt(`Unknown adapter '${c}'`);if(i&&(me.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 @@ ${m}`,y=>{n.notifyAfterAddMessage(y-h)})}function a(m){return m!==void 0&&r[m]!=
35
35
  `);r={};const v=foe(m.reason),y=v?t.sendOnExit:t.send;if(v&&e.isAsync){const x=e.finishSync();x.outputBytesCount&&y(u$(x));const S=[x.pendingData,h].filter(Boolean).join(`
36
36
  `);S&&y({data:S,bytesCount:dL(S)})}else h&&e.write(e.isEmpty?h:`
37
37
  ${h}`),e.finish(x=>{y(u$(x))})}return{flushController:n,add:d,upsert:d,stop:i.unsubscribe}}function u$(e){let t;return typeof e.output=="string"?t=e.output:t=new Blob([e.output],{type:"text/plain"}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}const poe=30*Mr,moe=Mb?1:50;function TL({pageMayExitObservable:e,sessionExpireObservable:t}){const n=e.subscribe(h=>c(h.reason)),r=t.subscribe(()=>c("session_expire")),i=new $t(()=>()=>{n.unsubscribe(),r.unsubscribe()});let o=0,a=0;function c(h){if(a===0)return;const v=a,y=o;a=0,o=0,m(),i.notify({reason:h,messagesCount:v,bytesCount:y})}let d;function f(){d===void 0&&(d=Ar(()=>{c("duration_limit")},poe))}function m(){yo(d),d=void 0}return{flushObservable:i,get messagesCount(){return a},notifyBeforeAddMessage(h){o+h>=xC&&c("bytes_limit"),a+=1,o+=h,f()},notifyAfterAddMessage(h=0){o+=h,a>=moe?c("messages_limit"):o>=xC&&c("bytes_limit")},notifyAfterRemoveMessage(h){o-=h,a-=1,a===0&&m()}}}const vl="DISCARDED",Hi="SKIPPED";function hoe(){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===vl)return vl;a!==Hi&&i.push(a)}return is(...i)}}}const dl={LOG:"log",CONFIGURATION:"configuration",USAGE:"usage"},goe=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],voe=1,yoe=[Wre],boe=15;let N_;function ff(){return N_||(N_=new L4(100)),N_}function xoe(e,t,n,r,i,o){const a=new $t,{stop:c}=Soe(t,r,i,o,a),{enabled:d,metricsEnabled:f}=woe(e,t,n,a);return{stop:c,enabled:d,metricsEnabled:f}}function woe(e,t,n,r,i=voe,o=boe){const a={},c=!yoe.includes(t.site)&&mc(t.telemetrySampleRate),d={[dl.LOG]:c,[dl.CONFIGURATION]:c&&mc(t.telemetryConfigurationSampleRate),[dl.USAGE]:c&&mc(t.telemetryUsageSampleRate),metric:c&&mc(i)},f=_oe(),m=ff();return m.subscribe(({rawEvent:v,metricName:y})=>{if(y&&!d.metric||!d[v.type])return;const x=y||v.status||v.type;let S=a[x];if(S||(S=a[x]=new Set),S.size>=o)return;const C=$d(v);if(S.has(C))return;const k=n.triggerHook(1,{startTime:cr().relative});if(k===vl)return;const E=h(k,e,v,f);r.notify(E),bL("telemetry",E),S.add(C)}),m.unbuffer(),Qne(yE),{enabled:c,metricsEnabled:d.metric};function h(v,y,x,S){const k={type:"telemetry",date:cr().timeStamp,service:y,version:"6.25.0",source:"browser",_dd:{format_version:2},telemetry:is(x,{runtime_env:S,connectivity:xL(),sdk_setup:"npm"}),ddtags:yL(t).join(","),experimental_features:Array.from(die())};return is(k,v)}}function Soe(e,t,n,r,i){const o=[];if(Pd()){const a=Ym(),c=i.subscribe(d=>a.send("internal_telemetry",d));o.push(c.unsubscribe)}else{const a=[e.rumEndpointBuilder];e.replica&&Coe(e)&&a.push(e.replica.rumEndpointBuilder);const c=NL({encoder:r(4),request:RL(a,t),flushController:TL({pageMayExitObservable:n,sessionExpireObservable:new $t})});o.push(c.stop);const d=i.subscribe(c.add);o.push(d.unsubscribe)}return{stop:()=>o.forEach(a=>a())}}function _oe(){var e;return{is_local_file:((e=xa.location)===null||e===void 0?void 0:e.protocol)==="file:",is_worker:Mb}}function Coe(e){return e.site===oL}function Wm(e,t){hC($b.debug,e,t),ff().notify({rawEvent:{type:dl.LOG,message:e,status:"debug",...t}})}function yE(e,t){ff().notify({rawEvent:{type:dl.LOG,status:"error",...Eoe(e),...t}})}function koe(e){ff().notify({rawEvent:{type:dl.CONFIGURATION,configuration:e}})}function Zb(e,t){ff().notify({rawEvent:{type:dl.LOG,message:e,status:"debug",...t},metricName:e})}function mr(e){ff().notify({rawEvent:{type:dl.USAGE,usage:e}})}function Eoe(e){if(Nl(e)){const t=Kb(e);return{error:{kind:t.name,stack:Gb(joe(t))},message:t.message}}return{error:{stack:pL},message:`Uncaught ${$d(e)}`}}function joe(e){return e.stack=e.stack.filter(t=>!t.url||goe.some(n=>t.url.startsWith(n))),e}function OL(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}function Cc(e){return Array.isArray(e)&&e.length>0}const vv=1/0,Roe=Jr;let Ip=null;const ry=new Set;function Ioe(){ry.forEach(e=>e())}function pf({expireDelay:e,maxEntries:t}){let n=[];Ip||(Ip=cf(()=>Ioe(),Roe));const r=()=>{const m=Bi()-e;for(;n.length>0&&n[n.length-1].endTime<m;)n.pop()};ry.add(r);function i(m,h){const v={value:m,startTime:h,endTime:vv,remove:()=>{OL(n,v)},close:y=>{v.endTime=y}};return t&&n.length>=t&&n.pop(),n.unshift(v),v}function o(m=vv,h={returnInactive:!1}){for(const v of n)if(v.startTime<=m){if(h.returnInactive||m<=v.endTime)return v.value;break}}function a(m){const h=n[0];h&&h.endTime===vv&&h.close(m)}function c(m=vv,h=0){const v=uf(m,h);return n.filter(y=>y.startTime<=v&&m<=y.endTime).map(y=>y.value)}function d(){n=[]}function f(){ry.delete(r),ry.size===0&&Ip&&(zb(Ip),Ip=null)}return{add:i,find:o,closeActive:a,findAll:c,reset:d,stop:f}}const Noe="datadog-synthetics-public-id",Toe="datadog-synthetics-result-id",Ooe="datadog-synthetics-injects-rum";function AL(){return Mb?!1:!!(xa._DATADOG_SYNTHETICS_INJECTS_RUM||el(Ooe))}function DL(){const e=window._DATADOG_SYNTHETICS_PUBLIC_ID||el(Noe);return typeof e=="string"?e:void 0}function $L(){const e=window._DATADOG_SYNTHETICS_RESULT_ID||el(Toe);return typeof e=="string"?e:void 0}function PL(){return!!(DL()&&$L())}const Aoe=Jr,Doe=Kc;function $oe(e,t,n,r){const i=new $t,o=new $t,a=Ure(e.sessionStoreStrategyType,e,t,n),c=pf({expireDelay:Doe});if(a.renewObservable.subscribe(()=>{c.add(d(),Bi()),i.notify()}),a.expireObservable.subscribe(()=>{o.notify(),c.closeActive(Bi())}),a.expandOrRenewSession(),c.add(d(),V4().relative),Zm(hl.SHORT_SESSION_INVESTIGATION)){const f=a.getSession();f&&Foe(e,f)}r.observable.subscribe(()=>{r.isGranted()?a.expandOrRenewSession():a.expire(!1)}),Poe(e,()=>{r.isGranted()&&a.expandOrRenewSession()}),Moe(e,()=>a.expandSession()),zoe(e,()=>a.restartSession());function d(){const f=a.getSession();return f?{id:f.id,trackingType:f[t],isReplayForced:!!f.forcedReplay,anonymousId:f.anonymousId}:(Loe(e).catch(()=>{}),{id:"invalid",trackingType:Y4,isReplayForced:!1,anonymousId:void 0})}return{findSession:(f,m)=>c.find(f,m),renewObservable:i,expireObservable:o,sessionStateUpdateObservable:a.sessionStateUpdateObservable,expire:a.expire,updateSessionState:a.updateSessionState}}function Poe(e,t){const{stop:n}=gl(e,window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0})}function Moe(e,t){const n=()=>{document.visibilityState==="visible"&&t()},{stop:r}=Dn(e,document,"visibilitychange",n);cf(n,Aoe)}function zoe(e,t){const{stop:n}=Dn(e,window,"resume",t,{capture:!0})}async function Loe(e){const t=e.sessionStoreStrategyType;if(!t)return;let n,r;t.type===Od.COOKIE?(n=Q4(t.cookieOptions,e),r={cookie:await ML(),currentDomain:`${window.location.protocol}//${window.location.hostname}`}):n=nL(),Wm("Unexpected session state",{sessionStoreStrategyType:t.type,session:n,isSyntheticsTest:PL(),createdTimestamp:n?.created,expireTimestamp:n?.expire,...r})}function Foe(e,t){if(!window.cookieStore||!t.created)return;const n=Number(t.created),r=Wr(),{stop:i}=Dn(e,cookieStore,"change",o);function o(a){const c=K4(a.changed,f=>f.name===rs);if(!c)return;const d=Wr()-n;if(d>14*Jr)i();else{const f=Hb(c.value);if(f.id&&f.id!==t.id){i();const m=Wr()-r;ML().then(h=>{Wm("Session cookie changed",{time:m,session_age:d,old:t,new:f,cookie:h})}).catch(ml)}}}}async function ML(){let e;return"cookieStore"in window?e=await window.cookieStore.getAll(rs):e=document.cookie.split(/\s*;\s*/).filter(t=>t.startsWith(rs)),{count:e.length,domain:q4()||"undefined",...e}}function Uoe(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(n,r){const i=dL(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 Voe{constructor(){this.callbacks={}}notify(t,n){const r=this.callbacks[t];r&&r.forEach(i=>i(n))}subscribe(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter(r=>n!==r)}}}}const Boe=3e3;function T_(e,t,n=Boe){let r=0,i=!1;return{isLimitReached(){if(r===0&&Ar(()=>{r=0},Jr),r+=1,r<=n||i)return i=!1,!1;if(r===n+1){i=!0;try{t({message:`Reached max number of ${e}s by minute: ${n}`,source:df.AGENT,startClocks:cr()})}finally{i=!1}}return!0}}}function bE(e,t,n){return document.readyState===t||document.readyState==="complete"?(n(),{stop:Jt}):Dn(e,window,t==="complete"?"load":"DOMContentLoaded",n,{once:!0})}function Hoe(e,t){return new Promise(n=>{bE(e,t,n)})}let O_;const xE=new WeakMap;function qoe(e){return O_||(O_=Koe(e)),O_}function Koe(e){return new $t(t=>{const{stop:n}=ga(XMLHttpRequest.prototype,"open",Goe),{stop:r}=ga(XMLHttpRequest.prototype,"send",o=>{Zoe(o,e,t)},{computeHandlingStack:!0}),{stop:i}=ga(XMLHttpRequest.prototype,"abort",Yoe);return()=>{n(),r(),i()}})}function Goe({target:e,parameters:[t,n]}){xE.set(e,{state:"open",method:String(t).toUpperCase(),url:fE(String(n))})}function Zoe({target:e,parameters:[t],handlingStack:n},r,i){const o=xE.get(e);if(!o)return;const a=o;a.state="start",a.startClocks=cr(),a.isAborted=!1,a.xhr=e,a.handlingStack=n,a.requestBody=t;let c=!1;const{stop:d}=ga(e,"onreadystatechange",()=>{e.readyState===XMLHttpRequest.DONE&&f()}),f=()=>{if(m(),d(),c)return;c=!0;const h=o;h.state="complete",h.duration=Gn(a.startClocks.timeStamp,Cr()),h.status=e.status,typeof e.response=="string"&&(h.responseBody=e.response),i.notify(hm(h))},{stop:m}=Dn(r,e,"loadend",f);i.notify(a)}function Yoe({target:e}){const t=xE.get(e);t&&(t.isAborted=!0)}async function Woe(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(Jt),t.collectStreamBody?fL(r):void 0}let A_;const zL=[];function LL({responseBodyAction:e}={}){return e&&zL.push(e),A_||(A_=Xoe()),A_}function Xoe(){return new $t(e=>{if(!xa.fetch)return;const{stop:t}=ga(xa,"fetch",n=>Joe(n,e),{computeHandlingStack:!0});return t})}function Joe({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:fE(String(i)),f=cr(),m={state:"start",init:o,input:i,method:c,startClocks:f,url:d,handlingStack:n};r.notify(m),e[0]=m.input,e[1]=m.init,t(h=>{Qoe(r,h,m).catch(ml)})}async function Qoe(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=zL.reduce((d,f)=>Math.max(d,f(o)),0);if(c!==0){const d=Qie(a);if(d&&d.body)try{const f=await Woe(d.body,{collectStreamBody:c===2});o.responseBody=f&&new TextDecoder().decode(f)}catch{}}e.notify(o)}function eae(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){const n=window.requestIdleCallback(St(e),t);return()=>window.cancelIdleCallback(n)}return nae(e)}const tae=50;function nae(e){const t=Wr(),n=Ar(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,tae-(Wr()-t))})},0);return()=>yo(n)}const rae=Mr,iae=30;function oae(){const e=[];function t(r){let i;if(r.didTimeout){const o=performance.now();i=()=>iae-(performance.now()-o)}else i=r.timeRemaining.bind(r);for(;i()>0&&e.length;)e.shift()();e.length&&n()}function n(){eae(t,{timeout:rae})}return{push(r){e.push(r)===1&&n()},stop(){e.length=0}}}let D_={};function aae(e){const t=e.map(n=>(D_[n]||(D_[n]=sae(n)),D_[n]));return z4(...t)}function sae(e){return new $t(t=>{const n=Xa[e];return Xa[e]=(...r)=>{n.apply(console,r);const i=ym("console error");ul(()=>{t.notify(lae(r,e,i))})},()=>{Xa[e]=n}})}function lae(e,t,n){const r=e.map(i=>cae(i)).join(" ");if(t===$b.error){const i=e.find(Nl),o=gE({originalError:i,handlingStack:n,startClocks:cr(),source:df.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 cae(e){return typeof e=="string"?vn(e):Nl(e)?cL(Kb(e)):$d(vn(e),void 0,2)}const uae=500;function dae(){const e=[];return{add:i=>{e.push(i)>uae&&e.splice(0,1)},remove:i=>{OL(e,i)},drain:i=>{e.forEach(o=>o(i)),e.length=0}}}function fae(e){const t=Gc(e)==="object";return t||ht.error("Unsupported context:",e),t}function $_(e,t,n){const r={...e};for(const[i,{required:o,type:a}]of Object.entries(t))a==="string"&&!d$(r[i])&&(r[i]=String(r[i])),o&&d$(r[i])&&ht.warn(`The property ${i} of ${n} is required; context will not be sent to the intake.`);return r}function d$(e){return e==null||e===""}function Yb(e="",{propertiesConfig:t={}}={}){let n={};const r=new $t,i={getContext:()=>vE(n),setContext:o=>{fae(o)?n=vn($_(o,t,e)):i.clearContext(),r.notify()},setContextProperty:(o,a)=>{n=vn($_({...n,[o]:a},t,e)),r.notify()},removeContextProperty:o=>{delete n[o],$_(n,t,e),r.notify()},clearContext:()=>{n={},r.notify()},changeObservable:r};return i}function Vr(e,t,n,r){return St((...i)=>(r&&mr({feature:r}),e()[t][n](...i)))}const pae="_dd_c",mae=[];function wE(e,t,n,r){const i=hae(n,r);mae.push(Dn(e,window,"storage",({key:f})=>{i===f&&a()})),t.changeObservable.subscribe(c);const o=is(d(),t.getContext());Il(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 hae(e,t){return`${pae}_${e}_${t}`}function gae(e,t,n){const r=FL();return t.storeContextsAcrossPages&&wE(t,r,n,4),e.register(0,()=>{const i=r.getContext();return Il(i)||!i.id?Hi:{account:i}}),r}function FL(){return Yb("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function vae(e,t,n,r){const i=UL();return t.storeContextsAcrossPages&&wE(t,i,n,2),e.register(0,()=>({context:i.getContext()})),i}function UL(){return Yb("global context")}function yae(e,t,n,r){const i=VL();return t.storeContextsAcrossPages&&wE(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),Il(c)?Hi:{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 VL(){return Yb("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}const hr={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},Br={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"},Kr={DOCUMENT:"document",XHR:"xhr",BEACON:"beacon",FETCH:"fetch",CSS:"css",JS:"js",IMAGE:"image",FONT:"font",MEDIA:"media",OTHER:"other"},Wb={FETCH:Kr.FETCH,XHR:Kr.XHR},bae=500;function xae(e=Mie){const t=new L4(bae),n=e().subscribe(r=>{t.notify({type:0,error:r})});return{observable:t,stop:()=>{n.unsubscribe()}}}function wae(){try{return new Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const xt={ACTION:"action",ERROR:"error",LONG_TASK:"long_task",VIEW:"view",RESOURCE:"resource",VITAL:"vital"},BL={LONG_TASK:"long-task",LONG_ANIMATION_FRAME:"long-animation-frame"},Ja={INITIAL_LOAD:"initial_load",ROUTE_CHANGE:"route_change",BF_CACHE:"bf_cache"},SE={CLICK:"click",CUSTOM:"custom"},Np={RAGE_CLICK:"rage_click",ERROR_CLICK:"error_click",DEAD_CLICK:"dead_click"},xm={DURATION:"duration",OPERATION_STEP:"operation_step"};function Sae(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}function _ae(e,t,n){function r(a){return!t.wasInPageStateDuringPeriod("frozen",a.startClocks.relative,a.duration)}function i(a){r(a)&&e.notify(12,f$(a))}function o(a,c,d,f){if(!Zm(hl.FEATURE_OPERATION_VITAL))return;const{operationKey:m,context:h,description:v}=d||{},y={name:a,type:xm.OPERATION_STEP,operationKey:m,failureReason:f,stepType:c,startClocks:cr(),context:vn(h),description:v};e.notify(12,f$(y))}return{addOperationStepVital:o,addDurationVital:i,startDurationVital:(a,c={})=>HL(n,a,c),stopDurationVital:(a,c={})=>{qL(i,n,a,c)}}}function HL({vitalsByName:e,vitalsByReference:t},n,r={}){const i={name:n,startClocks:cr(),...r},o={__dd_vital_reference:!0};return e.set(n,i),t.set(o,i),o}function qL(e,{vitalsByName:t,vitalsByReference:n},r,i={}){const o=typeof r=="string"?t.get(r):n.get(r);o&&(e(Cae(o,o.startClocks,i,cr())),typeof r=="string"?t.delete(r):n.delete(r))}function Cae(e,t,n,r){var i;return{name:e.name,type:xm.DURATION,startClocks:t,duration:Gn(t.timeStamp,r.timeStamp),context:is(e.context,n.context),description:(i=n.description)!==null&&i!==void 0?i:e.description}}function f$(e){const{startClocks:t,type:n,name:r,description:i,context:o}=e,a={id:$r(),type:n,name:r,description:i,...n===xm.DURATION?{duration:bt(e.duration)}:{step_type:e.stepType,operation_key:e.operationKey,failure_reason:e.failureReason}};return{rawRumEvent:{date:t.timeStamp,vital:a,type:xt.VITAL,context:o},startTime:t.relative,duration:n===xm.DURATION?e.duration:void 0,domainContext:{}}}function KL(e,t,n){if(e)for(const r of e){const i=r[t];i&&i(n)}}const p$=new Map;function GL(e,t){if(t===100)return!0;if(t===0)return!1;const n=p$.get(t);if(n&&e===n.sessionId)return n.decision;let r;return window.BigInt?r=kae(BigInt(`0x${e.split("-")[4]}`),t):r=mc(t),p$.set(t,{sessionId:e,decision:r}),r}function kae(e,t){const n=BigInt("1111111111111111111"),r=BigInt("0x10000000000000000"),i=e*n%r;return Number(i)<=t/100*Number(r)}function Eae(){return YL(64)}function ZL(){return YL(63)}function YL(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 Zu(e){return e.toString(16).padStart(16,"0")}function jae(e){const t=e;return Gc(t)==="object"&&vm(t.match)&&Array.isArray(t.propagatorTypes)}function Rae(e){e.status===0&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function Iae(e,t,n,r){return{clearTracingIfNeeded:Rae,traceFetch:i=>m$(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=hm(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(pE(o))}}),traceXhr:(i,o)=>m$(e,i,t,n,r,a=>{Object.keys(a).forEach(c=>{o.setRequestHeader(c,a[c])})})}}function m$(e,t,n,r,i,o){const a=n.findTrackedSession();if(!a)return;const c=e.allowedTracingUrls.find(m=>qb([m.match],t.url,!0));if(!c)return;const d=GL(a.id,e.traceSampleRate);(d||e.traceContextInjection===yC.ALL)&&(t.traceSampled=d,t.traceId=Eae(),t.spanId=ZL(),o(Nae(t.traceId,t.spanId,t.traceSampled,a.id,c.propagatorTypes,r,i,e)))}function Nae(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${Zu(e)}-${Zu(t)}-0${n?"1":"0"}`,tracestate:`dd=s:${n?"1":"0"};o:rum`});break}case"b3":{Object.assign(d,{b3:`${Zu(e)}-${Zu(t)}-${n?"1":"0"}`});break}case"b3multi":{Object.assign(d,{"X-B3-TraceId":Zu(e),"X-B3-SpanId":Zu(t),"X-B3-Sampled":n?"1":"0"});break}}}),c.propagateTraceBaggage){const f={"session.id":r},m=o.getContext().id;typeof m=="string"&&(f["user.id"]=m);const h=a.getContext().id;typeof h=="string"&&(f["account.id"]=h);const v=Object.entries(f).map(([y,x])=>`${y}=${encodeURIComponent(x)}`).join(",");v&&(d.baggage=v)}return d}const WL=["tracecontext","datadog"];function Tae(e,t){var n,r,i,o,a,c,d;if(e.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(e.trackFeatureFlagsForEvents)&&ht.warn("trackFeatureFlagsForEvents should be an array"),!e.applicationId){ht.error("Application ID is not configured, no RUM data will be collected.");return}if(!ud(e.sessionReplaySampleRate,"Session Replay")||!ud(e.traceSampleRate,"Trace"))return;if(e.excludedActivityUrls!==void 0&&!Array.isArray(e.excludedActivityUrls)){ht.error("Excluded Activity Urls should be an array");return}const f=Oae(e);if(!f)return;const m=sie(e,t),h=Dae(e);if(!m)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:Km(e.traceSampleRate)?e.traceSampleRate/100:void 0,allowedTracingUrls:f,excludedActivityUrls:(i=e.excludedActivityUrls)!==null&&i!==void 0?i:[],workerUrl:e.workerUrl,compressIntakeRequests:!!e.compressIntakeRequests,trackUserInteractions:!!(!((o=e.trackUserInteractions)!==null&&o!==void 0)||o),trackViewsManually:!!e.trackViewsManually,trackResources:!!(!((a=e.trackResources)!==null&&a!==void 0)||a),trackLongTasks:!!(!((c=e.trackLongTasks)!==null&&c!==void 0)||c),trackBfcacheViews:!!e.trackBfcacheViews,trackEarlyRequests:!!e.trackEarlyRequests,subdomain:e.subdomain,defaultPrivacyLevel:Ry(cd,e.defaultPrivacyLevel)?e.defaultPrivacyLevel:cd.MASK,enablePrivacyForActionName:!!e.enablePrivacyForActionName,traceContextInjection:Ry(yC,e.traceContextInjection)?e.traceContextInjection:yC.SAMPLED,plugins:e.plugins||[],trackFeatureFlagsForEvents:e.trackFeatureFlagsForEvents||[],profilingSampleRate:(d=e.profilingSampleRate)!==null&&d!==void 0?d:0,propagateTraceBaggage:!!e.propagateTraceBaggage,allowedGraphQlUrls:h,...m}}function Oae(e){if(e.allowedTracingUrls===void 0)return[];if(!Array.isArray(e.allowedTracingUrls)){ht.error("Allowed Tracing URLs should be an array");return}if(e.allowedTracingUrls.length!==0&&e.service===void 0){ht.error("Service needs to be configured when tracing is enabled");return}const t=[];return e.allowedTracingUrls.forEach(n=>{vm(n)?t.push({match:n,propagatorTypes:WL}):jae(n)?t.push(n):ht.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",n)}),t}function Aae(e){const t=new Set;return Cc(e.allowedTracingUrls)&&e.allowedTracingUrls.forEach(n=>{vm(n)?WL.forEach(r=>t.add(r)):Gc(n)==="object"&&Array.isArray(n.propagatorTypes)&&n.propagatorTypes.forEach(r=>t.add(r))}),Array.from(t)}function Dae(e){if(!e.allowedGraphQlUrls)return[];if(!Array.isArray(e.allowedGraphQlUrls))return ht.warn("allowedGraphQlUrls should be an array"),[];const t=[];return e.allowedGraphQlUrls.forEach(n=>{vm(n)?t.push({match:n,trackPayload:!1,trackResponseErrors:!1}):n&&typeof n=="object"&&"match"in n&&vm(n.match)&&t.push({match:n.match,trackPayload:!!n.trackPayload,trackResponseErrors:!!n.trackResponseErrors})}),t}function $ae(e){return Cc(e)&&e.some(t=>typeof t=="object"&&"trackPayload"in t?!!t.trackPayload:!1)}function Pae(e){return Cc(e)&&e.some(t=>typeof t=="object"&&"trackResponseErrors"in t?!!t.trackResponseErrors:!1)}function Mae(e){var t;const n=lie(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:Cc(e.allowedTracingUrls),use_allowed_graph_ql_urls:Cc(e.allowedGraphQlUrls),use_track_graph_ql_payload:$ae(e.allowedGraphQlUrls),use_track_graph_ql_response_errors:Pae(e.allowedGraphQlUrls),selected_tracing_propagators:Aae(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:Cc(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 zae(e){const t=[];let n=0,r;const i={quote:void 0,escapeSequence:void 0};let o="";for(const a of e){if(r=h$[n].find(c=>Hae[c](a,i)),!r)return[];if(i.escapeSequence!==void 0&&r!==12){if(!Gae(i.escapeSequence))return[];o+=Yae(i.escapeSequence),i.escapeSequence=void 0}qae.includes(r)?o+=a:Kae.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 h$[n].includes(1)?(o!==""&&t.push(o),t):[]}const Lae=/[a-zA-Z_$]/,Fae=/[a-zA-Z0-9_$]/,Uae=/[0-9]/,Vae=/[a-fA-F0-9]/,Bae=`'"`,Hae={0:()=>!1,1:()=>!1,2:e=>Lae.test(e),3:e=>Fae.test(e),4:e=>e===".",5:e=>e==="[",6:e=>e==="]",7:e=>Uae.test(e),8:e=>Bae.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?Vae.test(e):!1},h$={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]},qae=[2,3,7,10],Kae=[4,5,6];function Gae(e){return`"'/\\bfnrt`.includes(e)||e.startsWith("u")&&e.length===5}const Zae={'"':'"',"'":"'","/":"/","\\":"\\",b:"\b",f:"\f",n:`
38
- `,r:"\r",t:" "};function Yae(e){return e.startsWith("u")?String.fromCharCode(parseInt(e.slice(1),16)):Zae[e]}const Wae="v1",Xae=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function Jae(e,t){let n;const r=ese(),i=await ise(e);return i.ok?(r.increment("fetch","success"),n=Qae(e,i.value,t,r)):(r.increment("fetch","failure"),ht.error(i.error)),Zb("remote configuration metrics",{metrics:r.get()}),n}function Qae(e,t,n,r){const i={...e};return Xae.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(tse(v)){if(nse(v)){const y=v.rcSerializedType;switch(y){case"string":return v.value;case"regex":return XL(v.value);case"dynamic":return c(v);default:ht.error(`Unsupported remote configuration: "rcSerializedType": "${y}"`);return}}return P4(v,o)}return v}function a(v,y){y.forEach(({key:x,value:S})=>{v.setContextProperty(x,o(S))})}function c(v){const y=v.strategy;let x;switch(y){case"cookie":x=d(v);break;case"dom":x=f(v);break;case"js":x=h(v);break;default:ht.error(`Unsupported remote configuration: "strategy": "${y}"`);return}const S=v.extractor;return S!==void 0&&typeof x=="string"?rse(S,x):x}function d({name:v}){const y=Bb(v);return r.increment("cookie",y!==void 0?"success":"missing"),y}function f({selector:v,attribute:y}){let x;try{x=document.querySelector(v)}catch{ht.error(`Invalid selector in the remote configuration: '${v}'`),r.increment("dom","failure");return}if(!x){r.increment("dom","missing");return}if(m(x,y)){ht.error(`Forbidden element selected by the remote configuration: '${v}'`),r.increment("dom","failure");return}const S=y!==void 0?x.getAttribute(y):x.textContent;if(S===null){r.increment("dom","missing");return}return r.increment("dom","success"),S}function m(v,y){return v.getAttribute("type")==="password"&&y==="value"}function h({path:v}){let y=window;const x=zae(v);if(x.length===0){ht.error(`Invalid JSON path in the remote configuration: '${v}'`),r.increment("js","failure");return}for(const S of x){if(!(S in y)){r.increment("js","missing");return}try{y=y[S]}catch(C){ht.error(`Error accessing: '${v}'`,C),r.increment("js","failure");return}}return r.increment("js","success"),y}}function ese(){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 tse(e){return typeof e=="object"&&e!==null}function nse(e){return"rcSerializedType"in e}function XL(e){try{return new RegExp(e)}catch{ht.error(`Invalid regex in the remote configuration: '${e}'`)}}function rse(e,t){const n=XL(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 ise(e){let t;try{t=await fetch(ose(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 ose(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${aL("rum",e)}/${Wae}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function ase({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},n,r,i){const o=dae(),a=UL();P_(a,hr.globalContext,o);const c=VL();P_(c,hr.userContext,o);const d=FL();P_(d,hr.accountContext,o);let f,m,h,v;const y=n.observable.subscribe(S),x={};function S(){if(!h||!v||!n.isGranted())return;y.unsubscribe();let R;if(v.trackViewsManually){if(!f)return;o.remove(f.callback),R=f.options}const T=i(v,m,R);o.drain(T)}function C(R,T){const N=Pd();if(N&&(R=sse(R)),h=R,koe(Mae(R)),v){hL("DD_RUM",R);return}const O=Tae(R,T);if(O){if(!N&&!O.sessionStoreStrategyType){ht.warn("No storage available for session. We will not send any data.");return}O.compressIntakeRequests&&!N&&t&&(m=t(O,"Datadog RUM",Jt),!m)||(v=O,LL().subscribe(Jt),n.tryToInit(O.trackingConsent),S())}}const k=R=>{o.add(T=>T.addDurationVital(R))};return{init(R,T,N){if(!R){ht.error("Missing configuration");return}cie(R.enableExperimentalFeatures),h=R,!(e&&AL())&&(KL(R.plugins,"onInit",{initConfiguration:R,publicApi:T}),R.remoteConfigurationId?Jae(R,{user:c,context:a}).then(O=>{O&&C(O,N)}).catch(ml):C(R,N))},get initConfiguration(){return h},getInternalContext:Jt,stopSession:Jt,addTiming(R,T=Cr()){o.add(N=>N.addTiming(R,T))},startView(R,T=cr()){const N=O=>{O.startView(R,T)};o.add(N),f||(f={options:R,callback:N},S())},setViewName(R){o.add(T=>T.setViewName(R))},setViewContext(R){o.add(T=>T.setViewContext(R))},setViewContextProperty(R,T){o.add(N=>N.setViewContextProperty(R,T))},getViewContext:()=>x,globalContext:a,userContext:c,accountContext:d,addAction(R){o.add(T=>T.addAction(R))},addError(R){o.add(T=>T.addError(R))},addFeatureFlagEvaluation(R,T){o.add(N=>N.addFeatureFlagEvaluation(R,T))},startDurationVital(R,T){return HL(r,R,T)},stopDurationVital(R,T){qL(k,r,R,T)},addDurationVital:k,addOperationStepVital:(R,T,N,O)=>{o.add(M=>M.addOperationStepVital(vn(R),T,vn(N),vn(O)))}}}function sse(e){var t,n;return{...e,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(t=e.defaultPrivacyLevel)!==null&&t!==void 0?t:(n=Ym())===null||n===void 0?void 0:n.getPrivacyLevel()}}function P_(e,t,n){e.changeObservable.subscribe(()=>{const r=e.getContext();n.add(i=>i[t].setContext(r))})}function lse(e,t,n,r={}){const i=Vre(),o=Sae(),a=xae().observable;let c=ase(r,i,o,(h,v,y)=>{const x=v&&r.createDeflateEncoder?C=>r.createDeflateEncoder(h,v,C):Uoe,S=e(h,t,n,y,x,i,o,a,r.sdkName);return t.onRumStart(S.lifeCycle,h,S.session,S.viewHistory,v,S.telemetry),n.onRumStart(S.lifeCycle,S.hooks,h,S.session,S.viewHistory,x),c=cse(c,S),KL(h.plugins,"onRumStart",{strategy:c,addEvent:S.addEvent}),S});const d=()=>c,f=St(h=>{const v=typeof h=="object"?h:{name:h};c.startView(v),mr({feature:"start-view"})}),m=Fie({init:h=>{const v=new Error().stack;ul(()=>c.init(h,m,v))},setTrackingConsent:St(h=>{i.update(h),mr({feature:"set-tracking-consent",tracking_consent:h})}),setViewName:St(h=>{c.setViewName(h),mr({feature:"set-view-name"})}),setViewContext:St(h=>{c.setViewContext(h),mr({feature:"set-view-context"})}),setViewContextProperty:St((h,v)=>{c.setViewContextProperty(h,v),mr({feature:"set-view-context-property"})}),getViewContext:St(()=>(mr({feature:"set-view-context-property"}),c.getViewContext())),getInternalContext:St(h=>c.getInternalContext(h)),getInitConfiguration:St(()=>vE(c.initConfiguration)),addAction:(h,v)=>{const y=ym("action");ul(()=>{c.addAction({name:vn(h),context:vn(v),startClocks:cr(),type:SE.CUSTOM,handlingStack:y}),mr({feature:"add-action"})})},addError:(h,v)=>{const y=ym("error");ul(()=>{c.addError({error:h,handlingStack:y,context:vn(v),startClocks:cr()}),mr({feature:"add-error"})})},addTiming:St((h,v)=>{c.addTiming(vn(h),v)}),setGlobalContext:Vr(d,hr.globalContext,Br.setContext,"set-global-context"),getGlobalContext:Vr(d,hr.globalContext,Br.getContext,"get-global-context"),setGlobalContextProperty:Vr(d,hr.globalContext,Br.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:Vr(d,hr.globalContext,Br.removeContextProperty,"remove-global-context-property"),clearGlobalContext:Vr(d,hr.globalContext,Br.clearContext,"clear-global-context"),setUser:Vr(d,hr.userContext,Br.setContext,"set-user"),getUser:Vr(d,hr.userContext,Br.getContext,"get-user"),setUserProperty:Vr(d,hr.userContext,Br.setContextProperty,"set-user-property"),removeUserProperty:Vr(d,hr.userContext,Br.removeContextProperty,"remove-user-property"),clearUser:Vr(d,hr.userContext,Br.clearContext,"clear-user"),setAccount:Vr(d,hr.accountContext,Br.setContext,"set-account"),getAccount:Vr(d,hr.accountContext,Br.getContext,"get-account"),setAccountProperty:Vr(d,hr.accountContext,Br.setContextProperty,"set-account-property"),removeAccountProperty:Vr(d,hr.accountContext,Br.removeContextProperty,"remove-account-property"),clearAccount:Vr(d,hr.accountContext,Br.clearContext,"clear-account"),startView:f,stopSession:St(()=>{c.stopSession(),mr({feature:"stop-session"})}),addFeatureFlagEvaluation:St((h,v)=>{c.addFeatureFlagEvaluation(vn(h),vn(v)),mr({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:St(()=>t.getSessionReplayLink()),startSessionReplayRecording:St(h=>{t.start(h),mr({feature:"start-session-replay-recording",force:h&&h.force})}),stopSessionReplayRecording:St(()=>t.stop()),addDurationVital:St((h,v)=>{mr({feature:"add-duration-vital"}),c.addDurationVital({name:vn(h),type:xm.DURATION,startClocks:nre(v.startTime),duration:v.duration,context:vn(v&&v.context),description:vn(v&&v.description)})}),startDurationVital:St((h,v)=>(mr({feature:"start-duration-vital"}),c.startDurationVital(vn(h),{context:vn(v&&v.context),description:vn(v&&v.description)}))),stopDurationVital:St((h,v)=>{mr({feature:"stop-duration-vital"}),c.stopDurationVital(typeof h=="string"?vn(h):h,{context:vn(v&&v.context),description:vn(v&&v.description)})}),startFeatureOperation:St((h,v)=>{mr({feature:"add-operation-step-vital",action_type:"start"}),c.addOperationStepVital(h,"start",v)}),succeedFeatureOperation:St((h,v)=>{mr({feature:"add-operation-step-vital",action_type:"succeed"}),c.addOperationStepVital(h,"end",v)}),failFeatureOperation:St((h,v,y)=>{mr({feature:"add-operation-step-vital",action_type:"fail"}),c.addOperationStepVital(h,"end",y,v)})});return m}function cse(e,t){return{init:n=>{hL("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function use(){const e=dse();return new $t(t=>{if(!e)return;const n=new e(St(r=>t.notify(r)));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function dse(){let e;const t=window;if(t.Zone&&(e=pl(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(Jt),r=pl(n,"originalInstance");e=r&&r.constructor}return e||(e=t.MutationObserver),e}function fse(){const e=new $t,{stop:t}=ga(window,"open",()=>e.notify());return{observable:e,stop:t}}function pse(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 mse=Voe,hse=Kc;function gse(e){const t=pf({expireDelay:hse});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 JL="initial_document",vse=[[Kr.DOCUMENT,e=>JL===e],[Kr.XHR,e=>e==="xmlhttprequest"],[Kr.FETCH,e=>e==="fetch"],[Kr.BEACON,e=>e==="beacon"],[Kr.CSS,(e,t)=>/\.css$/i.test(t)],[Kr.JS,(e,t)=>/\.js$/i.test(t)],[Kr.IMAGE,(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],[Kr.FONT,(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],[Kr.MEDIA,(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function yse(e){const t=e.name;if(!dre(t))return Kr.OTHER;const n=fre(t);for(const[r,i]of vse)if(i(e.initiatorType,n))return r;return Kr.OTHER}function g$(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function QL(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function bse(e){const{duration:t,startTime:n,responseEnd:r}=e;return t===0&&n<r?Gn(n,r):t}function xse(e){if(!tF(e))return;const{startTime:t,fetchStart:n,workerStart:r,redirectStart:i,redirectEnd:o,domainLookupStart:a,domainLookupEnd:c,connectStart:d,secureConnectionStart:f,connectEnd:m,requestStart:h,responseStart:v,responseEnd:y}=e,x={download:ac(t,v,y),first_byte:ac(t,h,v)};return 0<r&&r<n&&(x.worker=ac(t,r,n)),n<m&&(x.connect=ac(t,d,m),d<=f&&f<=m&&(x.ssl=ac(t,f,m))),n<c&&(x.dns=ac(t,a,c)),t<o&&(x.redirect=ac(t,i,o)),x}function eF(e){return e.duration>=0}function tF(e){const t=g$(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=wse(e)?g$(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function wse(e){return e.redirectEnd>e.startTime}function ac(e,t,n){if(e<=t&&t<=n)return{duration:bt(Gn(t,n)),start:bt(Gn(e,t))}}function Sse(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function _se(e){return e.deliveryType===""?"other":e.deliveryType}function Cse(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 _E(e){return e&&(!oie(e)||Zm(hl.TRACK_INTAKE_REQUESTS))}const kse=/data:(.+)?(;base64)?,/g,Ese=24e3;function jse(e,t=Ese){if(e.length<=t||!e.startsWith("data:"))return e;const n=e.substring(0,100).match(kse);return n?`${n[0]}[...]`:e}const Rse=32*Zc;function Ise(e,t){const n=Tse(e.requestBody,t.trackPayload);if(n){if(t.trackResponseErrors&&e.responseBody){const r=Nse(e.responseBody);r&&(n.errors_count=r.length,n.errors=r)}return n}}function Nse(e){let t;try{t=JSON.parse(e)}catch{return}if(!t||typeof t!="object")return;const n=t;return Cc(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 nF(e,t){return t.allowedGraphQlUrls.find(n=>qb([n.match],e))}function Tse(e,t=!1){if(!e||typeof e!="string")return;let n;try{n=JSON.parse(e)}catch{return}if(!n)return;let r,i;if(n.query){const c=n.query.trim();r=Ose(c),t&&(i=dE(c,Rse,"..."))}const o=n.operationName;let a;return n.variables&&(a=JSON.stringify(n.variables)),{operationType:r,operationName:o,variables:a,payload:i}}function Ose(e){var t;return(t=e.match(/^\s*(query|mutation|subscription)\b/i))===null||t===void 0?void 0:t[1]}let v$=1;function Ase(e,t,n,r,i){const o=Iae(t,n,r,i);Dse(e,t,o),$se(e,t,o)}function Dse(e,t,n){const r=qoe(t).subscribe(i=>{const o=i;if(_E(o.url))switch(o.state){case"start":n.traceXhr(o,o.xhr),o.requestIndex=rF(),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:Wb.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 $se(e,t,n){const r=LL({responseBodyAction:i=>{var o;return!((o=nF(i.url,t))===null||o===void 0)&&o.trackResponseErrors?2:1}}).subscribe(i=>{var o;const a=i;if(_E(a.url))switch(a.state){case"start":n.traceFetch(a),a.requestIndex=rF(),e.notify(7,{requestIndex:a.requestIndex,url:a.url});break;case"resolve":n.clearTracingIfNeeded(a),e.notify(8,{duration:Gn(a.startClocks.timeStamp,Cr()),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:Wb.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 rF(){const e=v$;return v$+=1,e}function iF(e){return Km(e)&&e<0?void 0:e}function oF({lifeCycle:e,isChildEvent:t,onChange:n=Jt}){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 xt.ERROR:r.errorCount+=1,n();break;case xt.ACTION:r.actionCount+=1,o.action.frustration&&(r.frustrationCount+=o.action.frustration.type.length),n();break;case xt.LONG_TASK:r.longTaskCount+=1,n();break;case xt.RESOURCE:!((a=o._dd)===null||a===void 0)&&a.discarded||(r.resourceCount+=1,n());break}});return{stop:()=>{i.unsubscribe()},eventCounts:r}}function Pse(e,t){const n=Wr();let r=!1;const{stop:i}=gl(e,window,["click","mousedown","keydown","touchstart","pointerdown"],c=>{if(!c.cancelable)return;const d={entryType:"first-input",processingStart:Bi(),processingEnd:Bi(),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){gl(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<Wr()-n&&t(c)}}}var Ut;(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"})(Ut||(Ut={}));function wa(e,t){return new $t(n=>{if(!window.PerformanceObserver)return;const r=d=>{const f=Lse(d);f.length>0&&n.notify(f)};let i,o=!0;const a=new PerformanceObserver(St(d=>{o?i=Ar(()=>r(d.getEntries())):r(d.getEntries())}));try{a.observe(t)}catch{if([Ut.RESOURCE,Ut.NAVIGATION,Ut.LONG_TASK,Ut.PAINT].includes(t.type)){t.buffered&&(i=Ar(()=>r(performance.getEntriesByType(t.type))));try{a.observe({entryTypes:[t.type]})}catch{return}}}o=!1,Mse(e);let c;return!Yc(Ut.FIRST_INPUT)&&t.type===Ut.FIRST_INPUT&&({stop:c}=Pse(e,d=>{r([d])})),()=>{a.disconnect(),c&&c(),yo(i)}})}let Tp;function Mse(e){return!Tp&&zse()&&"addEventListener"in performance&&(Tp=Dn(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{Tp?.stop()}}function zse(){return window.performance!==void 0&&"getEntries"in performance}function Yc(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function Lse(e){return e.filter(t=>!Fse(t))}function Fse(e){return e.entryType===Ut.RESOURCE&&(!_E(e.name)||!eF(e))}function wC(e){return e.nodeType===Node.TEXT_NODE}function Use(e){return e.nodeType===Node.COMMENT_NODE}function os(e){return e.nodeType===Node.ELEMENT_NODE}function aF(e){return os(e)&&!!e.shadowRoot}function Vse(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&os(t.host)}function p2e(e){return e.childNodes.length>0||aF(e)}function m2e(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;aF(e)&&t(e.shadowRoot)}function Bse(e){return Vse(e)?e.host:e.parentNode}const sF=100,Hse=100,y$="data-dd-excluded-activity-mutations";function CE(e,t,n,r,i,o){const a=Kse(e,t,n,r);return qse(a,i,o)}function qse(e,t,n){let r,i=!1;const o=Ar(St(()=>f({hadActivity:!1})),sF),a=n!==void 0?Ar(St(()=>f({hadActivity:!0,end:Cr()})),n):void 0,c=e.subscribe(({isBusy:m})=>{yo(o),yo(r);const h=Cr();m||(r=Ar(St(()=>f({hadActivity:!0,end:h})),Hse))}),d=()=>{i=!0,yo(o),yo(r),yo(a),c.unsubscribe()};function f(m){i||(d(),t(m))}return{stop:d}}function Kse(e,t,n,r){return new $t(i=>{const o=[];let a,c=0;return o.push(t.subscribe(f=>{f.every(Gse)||d()}),n.subscribe(d),wa(r,{type:Ut.RESOURCE}).subscribe(f=>{f.some(m=>!M_(r,m.name))&&d()}),e.subscribe(7,f=>{M_(r,f.url)||(a===void 0&&(a=f.requestIndex),c+=1,d())}),e.subscribe(8,f=>{M_(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 M_(e,t){return qb(e.excludedActivityUrls,t)}function Gse(e){const t=e.type==="characterData"?e.target.parentElement:e.target;return!!(t&&os(t)&&t.matches(`[${y$}], [${y$}] *`))}const Xb="data-dd-action-name",lF="Masked Element",cF=[Xb,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],Zse=[dF,Wse],Yse=[dF,Xse,Jse];function Xm(e,t){if(!e.isConnected)return;let n,r=e;for(;r&&r.nodeName!=="HTML";){const i=b$(r,Zse,ele,t,n);if(i)return i;n=b$(r,Yse,tle,t,n)||Jb(Qse(r),n),r=r.parentElement}return n}function uF(e){return/[0-9]/.test(e)}function Wse(e){if(e.id&&!uF(e.id))return`#${CSS.escape(e.id)}`}function Xse(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const r=t[n];if(!uF(r))return`${CSS.escape(e.tagName)}.${CSS.escape(r)}`}}function Jse(e){return CSS.escape(e.tagName)}function dF(e,t){if(t){const r=n(t);if(r)return r}for(const r of cF){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 Qse(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 b$(e,t,n,r,i){for(const o of t){const a=o(e,r);if(a&&n(e,a,i))return Jb(a,i)}}function ele(e,t,n){return e.ownerDocument.querySelectorAll(Jb(t,n)).length===1}function tle(e,t,n){let r;if(n===void 0)r=a=>a.matches(t);else{const a=Jb(`${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 Jb(e,t){return t?`${e}>${t}`:e}const kt={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:cd.ALLOW,MASK:cd.MASK,MASK_USER_INPUT:cd.MASK_USER_INPUT,MASK_UNLESS_ALLOWLISTED:cd.MASK_UNLESS_ALLOWLISTED},fF="data-dd-privacy",h2e="hidden",nle="dd-privacy-",z_="***",g2e="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",rle={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},ile="x";function cc(e){return`[${fF}="${e}"], .${nle}${e}`}function Qb(e,t,n){if(n&&n.has(e))return n.get(e);const r=Bse(e),i=r?Qb(r,t,n):t,o=ale(e),a=ole(o,i);return n&&n.set(e,a),a}function ole(e,t){switch(t){case kt.HIDDEN:case kt.IGNORE:return t}switch(e){case kt.ALLOW:case kt.MASK:case kt.MASK_USER_INPUT:case kt.MASK_UNLESS_ALLOWLISTED:case kt.HIDDEN:case kt.IGNORE:return e;default:return t}}function ale(e){if(os(e)){if(e.tagName==="BASE")return kt.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return kt.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return kt.MASK}if(e.matches(cc(kt.HIDDEN)))return kt.HIDDEN;if(e.matches(cc(kt.MASK)))return kt.MASK;if(e.matches(cc(kt.MASK_UNLESS_ALLOWLISTED)))return kt.MASK_UNLESS_ALLOWLISTED;if(e.matches(cc(kt.MASK_USER_INPUT)))return kt.MASK_USER_INPUT;if(e.matches(cc(kt.ALLOW)))return kt.ALLOW;if(lle(e))return kt.IGNORE}}function pF(e,t){switch(t){case kt.MASK:case kt.HIDDEN:case kt.IGNORE:return!0;case kt.MASK_UNLESS_ALLOWLISTED:return wC(e)?yv(e.parentNode)?!0:!hF(e.textContent||""):yv(e);case kt.MASK_USER_INPUT:return wC(e)?yv(e.parentNode):yv(e);default:return!1}}function sle(e,t,n,r,i){if(r!==kt.MASK&&r!==kt.MASK_UNLESS_ALLOWLISTED||t===fF||cF.includes(t)||t===i.actionNameAttribute)return!1;switch(t){case"title":case"alt":case"placeholder":case"aria-label":case"name":return!0}return!!(e==="A"&&t==="href"||e==="IFRAME"&&t==="srcdoc"||n&&t.startsWith("data-")||(e==="IMG"||e==="SOURCE")&&(t==="src"||t==="srcset"))}function yv(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;const t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!rle[t.tagName]}const mF=e=>e.replace(/\S/g,ile);function v2e(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=z_;else if(a===kt.HIDDEN)i=z_;else if(pF(e,a))if(r==="DATALIST"||r==="SELECT"||r==="OPTGROUP"){if(!i.trim())return}else r==="OPTION"?i=z_:a===kt.MASK_UNLESS_ALLOWLISTED?i=gF(i):i=mF(i);return i}function lle(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 hF(e){var t;return!e||!e.trim()?!0:((t=window.$DD_ALLOW)===null||t===void 0?void 0:t.has(e.toLocaleLowerCase()))||!1}function gF(e,t){return hF(e)?e:t||mF(e)}const vF=Mr,cle=100;function ule(e,t){const n=[];let r=0,i;o(e);function o(d){d.stopObservable.subscribe(a),n.push(d),yo(i),i=Ar(c,vF)}function a(){r===1&&n.every(d=>d.isStopped())&&(r=2,t(n))}function c(){yo(i),r===0&&(r=1,a())}return{tryAppend:d=>r!==0?!1:n.length>0&&!dle(n[n.length-1].event,d.event)?(c(),!1):(o(d),!0),stop:()=>{c()}}}function dle(e,t){return e.target===t.target&&fle(e,t)<=cle&&e.timeStamp-t.timeStamp<=vF}function fle(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function ple(e,t,n=kt.ALLOW){const r=new Map,{actionNameAttribute:i}=t,o=x$(e,Xb)||i&&x$(e,i);return o?{name:o,nameSource:"custom_attribute"}:n===kt.MASK?{name:lF,nameSource:"mask_placeholder"}:w$(e,mle,t,r)||w$(e,hle,t,r)||{name:"",nameSource:"blank"}}function x$(e,t){const n=e.closest(`[${t}]`);if(!n)return;const r=n.getAttribute(t);return bF(yF(r.trim()))}const mle=[(e,t,n)=>{if("labels"in e&&e.labels&&e.labels.length>0)return iy(e.labels[0],t,n)},e=>{if(e.nodeName==="INPUT"){const t=e,n=t.getAttribute("type");if(n==="button"||n==="submit"||n==="reset")return{name:t.value,nameSource:"text_content"}}},(e,t,n)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return iy(e,t,n)},(e,t,n)=>Op(e,"aria-label",t,n),(e,t,n)=>{const r=e.getAttribute("aria-labelledby");if(r)return{name:r.split(/\s+/).map(i=>vle(e,i)).filter(i=>!!i).map(i=>xF(i,t,n)).join(" "),nameSource:"text_content"}},(e,t,n)=>Op(e,"alt",t,n),(e,t,n)=>Op(e,"name",t,n),(e,t,n)=>Op(e,"title",t,n),(e,t,n)=>Op(e,"placeholder",t,n),(e,t,n)=>{if("options"in e&&e.options.length>0)return iy(e.options[0],t,n)}],hle=[(e,t,n)=>iy(e,t,n)],gle=10;function w$(e,t,n,r){let i=e,o=0;for(;o<=gle&&i&&i.nodeName!=="BODY"&&i.nodeName!=="HTML"&&i.nodeName!=="HEAD";){for(const a of t){const c=a(i,n,r);if(c){const{name:d,nameSource:f}=c,m=d&&d.trim();if(m)return{name:bF(yF(m)),nameSource:f}}}if(i.nodeName==="FORM")break;i=i.parentElement,o+=1}}function yF(e){return e.replace(/\s+/g," ")}function bF(e){return e.length>100?`${dE(e,100)} [...]`:e}function vle(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function Op(e,t,n,r){const{enablePrivacyForActionName:i,defaultPrivacyLevel:o}=n;let a=e.getAttribute(t);if(a&&i){const c=Qb(e,o,r);sle(e.tagName,t,a,c,n)&&(a=gF(a,lF))}else a||(a="");return{name:a,nameSource:"standard_attribute"}}function iy(e,t,n){return{name:xF(e,t,n)||"",nameSource:"text_content"}}function xF(e,t,n){if(e.isContentEditable)return;const{enablePrivacyForActionName:r,actionNameAttribute:i,defaultPrivacyLevel:o}=t;if(Zm(hl.USE_TREE_WALKER_FOR_ACTION_NAME))return yle(e,i,r,o,n);if("innerText"in e){let a=e.innerText;const c=d=>{const f=e.querySelectorAll(d);for(let m=0;m<f.length;m+=1){const h=f[m];if("innerText"in h){const v=h.innerText;v&&v.trim().length>0&&(a=a.replace(v,""))}}};return c(`[${Xb}]`),i&&c(`[${i}]`),r&&c(`${cc(kt.HIDDEN)}, ${cc(kt.MASK)}`),a}return e.textContent}function yle(e,t,n,r,i){const o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,c);let a="";for(;o.nextNode();){const d=o.currentNode;if(os(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=Qb(d,r,i);if(n&&f&&pF(d,f))return NodeFilter.FILTER_REJECT;if(os(d)){if(d.hasAttribute(Xb)||t&&d.hasAttribute(t))return NodeFilter.FILTER_REJECT;const m=getComputedStyle(d);if(m.visibility!=="visible"||m.display==="none"||m.contentVisibility&&m.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}function ble(e,{onPointerDown:t,onPointerUp:n}){let r,i={selection:!1,input:!1,scroll:!1},o;const a=[Dn(e,window,"pointerdown",c=>{_$(c)&&(r=S$(),i={selection:!1,input:!1,scroll:!1},o=t(c))},{capture:!0}),Dn(e,window,"selectionchange",()=>{(!r||!S$())&&(i.selection=!0)},{capture:!0}),Dn(e,window,"scroll",()=>{i.scroll=!0},{capture:!0,passive:!0}),Dn(e,window,"pointerup",c=>{if(_$(c)&&o){const d=i;n(o,c,()=>d),o=void 0}},{capture:!0}),Dn(e,window,"input",()=>{i.input=!0},{capture:!0})];return{stop:()=>{a.forEach(c=>c.stop())}}}function S$(){const e=window.getSelection();return!e||e.isCollapsed}function _$(e){return e.target instanceof Element&&e.isPrimary!==!1}const C$=3;function xle(e,t){if(wle(e))return t.addFrustration(Np.RAGE_CLICK),e.some(k$)&&t.addFrustration(Np.DEAD_CLICK),t.hasError&&t.addFrustration(Np.ERROR_CLICK),{isRage:!0};const n=e.some(r=>r.getUserActivity().selection);return e.forEach(r=>{r.hasError&&r.addFrustration(Np.ERROR_CLICK),k$(r)&&!n&&r.addFrustration(Np.DEAD_CLICK)}),{isRage:!1}}function wle(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(C$-1);t+=1)if(e[t+C$-1].event.timeStamp-e[t].event.timeStamp<=Mr)return!0;return!1}const Sle='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 k$(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(Sle)}const wF=10*Mr,im=new Map;function _le(e){const t=im.get(e);return im.delete(e),t}function SF(e,t){im.set(e,t),im.forEach((n,r)=>{Gn(r,Bi())>wF&&im.delete(r)})}const Cle=5*Jr;function kle(e,t,n,r){const i=pf({expireDelay:Cle}),o=new $t;let a;e.subscribe(10,()=>{i.reset()}),e.subscribe(5,m),e.subscribe(11,h=>{h.reason===yd.UNLOADING&&m()});const{stop:c}=ble(r,{onPointerDown:h=>Ele(r,e,t,h,n),onPointerUp:({clickActionBase:h,hadActivityOnPointerDown:v},y,x)=>{jle(r,e,t,n,i,o,f,h,y,x,v)}});return{stop:()=>{m(),o.notify(),c()},actionContexts:{findActionId:h=>i.findAll(h)}};function f(h){if(!a||!a.tryAppend(h)){const v=h.clone();a=ule(h,y=>{Ile(y,v)})}}function m(){a&&a.stop()}}function Ele(e,t,n,r,i){let o;if(e.enablePrivacyForActionName?o=Qb(r.target,e.defaultPrivacyLevel):o=kt.ALLOW,o===kt.HIDDEN)return;const a=Rle(r,o,e);let c=!1;return CE(t,n,i,e,d=>{c=d.hadActivity},sF),{clickActionBase:a,hadActivityOnPointerDown:()=>c}}function jle(e,t,n,r,i,o,a,c,d,f,m){var h;const v=_F(t,i,f,c,d);a(v);const y=(h=c?.target)===null||h===void 0?void 0:h.selector;y&&SF(d.timeStamp,y);const{stop:x}=CE(t,n,r,e,k=>{k.hadActivity&&k.end<v.startClocks.timeStamp?v.discard():k.hadActivity?v.stop(k.end):m()?v.stop(v.startClocks.timeStamp):v.stop()},wF),S=t.subscribe(5,({endClocks:k})=>{v.stop(k.timeStamp)}),C=o.subscribe(()=>{v.stop()});v.stopObservable.subscribe(()=>{S.unsubscribe(),x(),C.unsubscribe()})}function Rle(e,t,n){const r=e.target.getBoundingClientRect(),i=Xm(e.target,n.actionNameAttribute);i&&SF(e.timeStamp,i);const{name:o,nameSource:a}=ple(e.target,n,t);return{type:SE.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 _F(e,t,n,r,i){const o=$r(),a=cr(),c=t.add(o,a.relative),d=oF({lifeCycle:e,isChildEvent:x=>x.action!==void 0&&(Array.isArray(x.action.id)?x.action.id.includes(o):x.action.id===o)});let f=0,m;const h=[],v=new $t;function y(x){f===0&&(m=x,f=1,m?c.close(uE(m)):c.remove(),d.stop(),v.notify())}return{event:i,stop:y,stopObservable:v,get hasError(){return d.eventCounts.errorCount>0},get hasPageActivity(){return m!==void 0},getUserActivity:n,addFrustration:x=>{h.push(x)},startClocks:a,isStopped:()=>f===1||f===2,clone:()=>_F(e,t,n,r,i),validate:x=>{if(y(),f!==1)return;const{resourceCount:S,errorCount:C,longTaskCount:k}=d.eventCounts,E={duration:m&&Gn(a.timeStamp,m),startClocks:a,id:o,frustrationTypes:h,counts:{resourceCount:S,errorCount:C,longTaskCount:k},events:x??[i],event:i,...r};e.notify(0,E),f=2},discard:()=>{y(),f=2}}}function Ile(e,t){const{isRage:n}=xle(e,t);n?(e.forEach(r=>r.discard()),t.stop(Cr()),t.validate(e.map(r=>r.event))):(t.discard(),e.forEach(r=>r.validate()))}function Nle(e,t,n,r,i){const{unsubscribe:o}=e.subscribe(0,d=>{e.notify(12,E$(d))});t.register(0,({startTime:d,eventType:f})=>{if(f!==xt.ERROR&&f!==xt.RESOURCE&&f!==xt.LONG_TASK)return Hi;const m=a.findActionId(d);return m?{type:f,action:{id:m}}:Hi}),t.register(1,({startTime:d})=>({action:{id:a.findActionId(d)}}));let a={findActionId:Jt},c=Jt;return i.trackUserInteractions&&({actionContexts:a,stop:c}=kle(e,n,r,i)),{addAction:d=>{e.notify(12,E$(d))},actionContexts:a,stop:()=>{o(),c()}}}function E$(e){const t=L_(e)?{action:{id:e.id,loading_time:iF(bt(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=is({action:{id:$r(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:xt.ACTION},t),r=L_(e)?e.duration:void 0,i=L_(e)?{events:e.events}:{handlingStack:e.handlingStack};return{rawRumEvent:n,duration:r,startTime:e.startClocks.relative,domainContext:i}}function L_(e){return e.type!==SE.CUSTOM}function Tle(e){const t=aae([$b.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function Ole(e,t){const n=Vie(e,[bm.cspViolation,bm.intervention]).subscribe(r=>t.notify(r));return{stop:()=>{n.unsubscribe()}}}function Ale(e,t,n){const r=new $t;return n.subscribe(i=>{i.type===0&&r.notify(i.error)}),Tle(r),Ole(t,r),r.subscribe(i=>e.notify(14,{error:i})),Dle(e)}function Dle(e){return e.subscribe(14,({error:t})=>{e.notify(12,$le(t))}),{addError:({error:t,handlingStack:n,componentStack:r,startClocks:i,context:o})=>{const a=gE({originalError:t,handlingStack:n,componentStack:r,startClocks:i,nonErrorPrefix:"Provided",source:df.CUSTOM,handling:"handled"});a.context=is(a.context,o),e.notify(14,{error:a})}}}function $le(e){const t={date:e.startClocks.timeStamp,error:{id:$r(),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:xt.ERROR,context:e.context},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const j$=new WeakSet;function Ple(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=>!j$.has(r)).filter(r=>eF(r)&&tF(r)).filter(r=>Mle(r,e.startClocks.relative,CF({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return j$.add(n[0]),n[0].toJSON()}function CF(e){return uf(e.startTime,e.duration)}function Mle(e,t,n){return e.startTime>=t-1&&CF(e)<=uf(n,1)}const zle=2*Jr;function Lle(e){const t=Fle(e)||Ule(e);if(!(!t||t.traceTime<=Wr()-zle))return t.traceId}function Fle(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return kF(t&&t.content,n&&n.content)}function Ule(e){const t=Vle(e);if(t)return kF(gm(t,"trace-id"),gm(t,"trace-time"))}function kF(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function Vle(e){for(let t=0;t<e.childNodes.length;t+=1){const n=R$(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=R$(n);if(r)return r;if(!wC(n))break}}function R$(e){if(e&&Use(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function EF(){if(Yc(Ut.NAVIGATION)){const n=performance.getEntriesByType(Ut.NAVIGATION)[0];if(n)return n}const e=Ble(),t={entryType:Ut.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 Ble(){const e={},t=performance.timing;for(const n in t)if(Km(t[n])){const r=n,i=t[r];e[r]=i===0?0:uE(i)}return e}function Hle(e,t,n=EF){bE(e,"interactive",()=>{const r=n(),i=Object.assign(r.toJSON(),{entryType:Ut.RESOURCE,initiatorType:JL,duration:r.responseEnd,traceId:Lle(document),toJSON:()=>({...i,toJSON:void 0})});t(i)})}const qle=1e3;function Kle(e){const t=new Set,n=e.subscribe(8,r=>{t.add(r),t.size>qle&&(Wm("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 Gle(e,t,n,r=oae(),i=Hle){let o;const a=t.trackEarlyRequests;a?o=Kle(e):e.subscribe(8,f=>{d(()=>Zle(f,t,n))});const c=wa(t,{type:Ut.RESOURCE,buffered:!0}).subscribe(f=>{for(const m of f)(a||!QL(m))&&d(()=>I$(m,t,n,o))});i(t,f=>{d(()=>I$(f,t,n,o))});function d(f){r.push(()=>{const m=f();m&&e.notify(12,m)})}return{stop:()=>{r.stop(),c.unsubscribe()}}}function Zle(e,t,n){const r=Ple(e);return jF(r,e,n,t)}function I$(e,t,n,r){const i=QL(e)&&r?r.getMatchingRequest(e):void 0;return jF(e,i,n,t)}function jF(e,t,n,r){if(!e&&!t)return;const i=t?Jle(t,r):Qle(e,r);if(!r.trackResources&&!i)return;const o=e?Lb(e.startTime):t.startClocks,a=e?bse(e):ece(n,o,t.duration),c=t&&Yle(t,r),d=is({date:o.timeStamp,resource:{id:$r(),duration:bt(a),type:t?t.type===Wb.XHR?Kr.XHR:Kr.FETCH:yse(e),method:t?t.method:void 0,status_code:t?t.status:tce(e.responseStatus),url:t?jse(t.url):e.name,protocol:e&&Sse(e),delivery_type:e&&_se(e),graphql:c},type:xt.RESOURCE,_dd:{discarded:!r.trackResources}},i,e&&Xle(e));return{startTime:o.relative,duration:a,rawRumEvent:d,domainContext:Wle(e,t)}}function Yle(e,t){const n=nF(e.url,t);if(n)return Ise(e,n)}function Wle(e,t){if(t){const n={performanceEntry:e,isAborted:t.isAborted,handlingStack:t.handlingStack};return t.type===Wb.XHR?{xhr:t.xhr,...n}:{requestInput:t.input,requestInit:t.init,response:t.response,error:t.error,...n}}return{performanceEntry:e}}function Xle(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...Cse(e),...xse(e)}}}function Jle(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 Qle(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:ZL().toString(),rule_psr:t.rulePsr}}}function ece(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function tce(e){return e===0?void 0:e}function nce(e,t,n){const{stop:r,eventCounts:i}=oF({lifeCycle:e,isChildEvent:o=>o.view.id===t,onChange:n});return{stop:r,eventCounts:i}}const rce=10*Jr;function ice(e,t,n){return{stop:wa(e,{type:Ut.PAINT,buffered:!0}).subscribe(i=>{const o=i.find(a=>a.name==="first-contentful-paint"&&a.startTime<t.timeStamp&&a.startTime<rce);o&&n(o.startTime)}).unsubscribe}}function oce(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(Gn(e,Bi()))})})}function ace(e,t,n){const r=wa(e,{type:Ut.FIRST_INPUT,buffered:!0}).subscribe(i=>{const o=i.find(a=>a.startTime<t.timeStamp);if(o){const a=Gn(o.startTime,o.processingStart);let c;o.target&&os(o.target)&&(c=Xm(o.target,e.actionNameAttribute)),n({delay:a>=0?a:0,time:o.startTime,targetSelector:c})}});return{stop:()=>{r.unsubscribe()}}}function sce(e,t,n=EF){return uce(e,()=>{const r=n();cce(r)||t(lce(r))})}function lce(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=Bi()?e.responseStart:void 0}}function cce(e){return e.loadEventEnd<=0}function uce(e,t){let n;const{stop:r}=bE(e,"complete",()=>{n=Ar(()=>t())});return{stop:()=>{r(),yo(n)}}}const dce=10*Jr;function fce(e,t,n,r){let i=1/0;const{stop:o}=gl(e,n,["pointerdown","keydown"],d=>{i=d.timeStamp},{capture:!0,once:!0});let a=0;const c=wa(e,{type:Ut.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(d=>{const f=K4(d,m=>m.entryType===Ut.LARGEST_CONTENTFUL_PAINT&&m.startTime<i&&m.startTime<t.timeStamp&&m.startTime<dce&&m.size>a);if(f){let m;f.element&&(m=Xm(f.element,e.actionNameAttribute)),r({value:f.startTime,targetSelector:m,resourceUrl:pce(f)}),a=f.size}});return{stop:()=>{o(),c.unsubscribe()}}}function pce(e){return e.url===""?void 0:e.url}function RF(e,t,n=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:Jt};if(Yc(Ut.VISIBILITY_STATE)){const o=performance.getEntriesByType(Ut.VISIBILITY_STATE).filter(a=>a.name==="hidden").find(a=>a.startTime>=t.relative);if(o)return{timeStamp:o.startTime,stop:Jt}}let r=1/0;const{stop:i}=gl(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 mce(e,t,n,r){const i={},{stop:o}=sce(e,h=>{n(h.loadEvent),i.navigationTimings=h,r()}),a=RF(e,t),{stop:c}=ice(e,a,h=>{i.firstContentfulPaint=h,r()}),{stop:d}=fce(e,a,window,h=>{i.largestContentfulPaint=h,r()}),{stop:f}=ace(e,a,h=>{i.firstInput=h,r()});function m(){o(),c(),d(),f(),a.stop()}return{stop:m,initialViewMetrics:i}}const SC=(e,t)=>e*t,hce=(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:SC(i-n,o-r)},N$=e=>{const t=SC(e.previousRect.width,e.previousRect.height),n=SC(e.currentRect.width,e.currentRect.height),r=hce(e.previousRect,e.currentRect);return t+n-r};function gce(e,t,n){if(!wce())return{stop:Jt};let r=0,i;n({value:0});const o=xce(),a=wa(e,{type:Ut.LAYOUT_SHIFT,buffered:!0}).subscribe(c=>{var d;for(const f of c){if(f.hadRecentInput||f.startTime<t)continue;const{cumulatedValue:m,isMaxValue:h}=o.update(f);if(h){const v=vce(f.sources);i={target:v?.node?new WeakRef(v.node):void 0,time:Gn(t,f.startTime),previousRect:v?.previousRect,currentRect:v?.currentRect,devicePixelRatio:window.devicePixelRatio}}if(m>r){r=m;const v=(d=i?.target)===null||d===void 0?void 0:d.deref();n({value:ld(r,4),targetSelector:v&&Xm(v,e.actionNameAttribute),time:i?.time,previousRect:i?.previousRect?T$(i.previousRect):void 0,currentRect:i?.currentRect?T$(i.currentRect):void 0,devicePixelRatio:i?.devicePixelRatio})}}});return{stop:()=>{a.unsubscribe()}}}function vce(e){let t;for(const n of e)if(n.node&&os(n.node)){const r=N$(n);(!t||N$(t)<r)&&(t=n)}return t}function T$({x:e,y:t,width:n,height:r}){return{x:e,y:t,width:n,height:r}}const yce=5*Mr,bce=Mr;function xce(){let e=0,t,n,r=0;return{update:i=>{const o=t===void 0||i.startTime-n>=bce||i.startTime-t>=yce;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 wce(){return Yc(Ut.LAYOUT_SHIFT)&&"WeakRef"in window}let oy,IF=0,F_=1/0,U_=0;function Sce(){"interactionCount"in performance||oy||(oy=new window.PerformanceObserver(St(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(F_=Math.min(F_,n.interactionId),U_=Math.max(U_,n.interactionId),IF=(U_-F_)/7+1)})})),oy.observe({type:"event",buffered:!0,durationThreshold:0}))}const O$=()=>oy?IF:window.performance.interactionCount||0,A$=10,_ce=1*Jr;function Cce(e,t,n){if(!jce())return{getInteractionToNextPaint:()=>{},setViewEnd:Jt,stop:Jt};const{getViewInteractionCount:r,stopViewInteractionCount:i}=Ece(n);let o=1/0;const a=kce(r);let c=-1,d,f;function m(y){for(const S of y)S.interactionId&&S.startTime>=t&&S.startTime<=o&&a.process(S);const x=a.estimateP98Interaction();x&&x.duration!==c&&(c=x.duration,f=Gn(t,x.startTime),d=_le(x.startTime),!d&&x.target&&os(x.target)&&(d=Xm(x.target,e.actionNameAttribute)))}const h=wa(e,{type:Ut.FIRST_INPUT,buffered:!0}).subscribe(m),v=wa(e,{type:Ut.EVENT,durationThreshold:40,buffered:!0}).subscribe(m);return{getInteractionToNextPaint:()=>{if(c>=0)return{value:Math.min(c,_ce),targetSelector:d,time:f};if(r())return{value:0}},setViewEnd:y=>{o=y,i()},stop:()=>{v.unsubscribe(),h.unsubscribe()}}}function kce(e){const t=[];function n(){t.sort((r,i)=>i.duration-r.duration).splice(A$)}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<A$||r.duration>o.duration)&&(t.push(r),n())},estimateP98Interaction(){const r=Math.min(t.length-1,Math.floor(e()/50));return t[r]}}}function Ece(e){Sce();const t=e===Ja.INITIAL_LOAD?0:O$();let n={stopped:!1};function r(){return O$()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:r(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:r()}}}}function jce(){return Yc(Ut.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function Rce(e,t,n,r,i,o,a){let c=i===Ja.INITIAL_LOAD,d=!0;const f=[],m=RF(r,o);function h(){if(!d&&!c&&f.length>0){const y=Math.max(...f);y<m.timeStamp-o.relative&&a(y)}}const{stop:v}=CE(e,t,n,r,y=>{d&&(d=!1,y.hadActivity&&f.push(Gn(o.timeStamp,y.end)),h())});return{stop:()=>{v(),m.stop()},setLoadEvent:y=>{c&&(c=!1,f.push(y),h())}}}function y2e(){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 Ice(){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 V_;function Nce(e){return V_||(V_=Tce(e)),V_}function Tce(e){return new $t(t=>{const{throttled:n}=Fb(()=>{t.notify(kE())},200);return Dn(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function kE(){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 Oce=Mr;function Ace(e,t,n,r=$ce(e)){let i=0,o=0,a=0;const c=r.subscribe(({scrollDepth:d,scrollTop:f,scrollHeight:m})=>{let h=!1;if(d>i&&(i=d,h=!0),m>o){o=m;const v=Bi();a=Gn(t.relative,v),h=!0}h&&n({maxDepth:Math.min(i,o),maxDepthScrollTop:f,maxScrollHeight:o,maxScrollHeightTime:a})});return{stop:()=>c.unsubscribe()}}function Dce(){const e=Ice(),{height:t}=kE(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),r=Math.round(t+e);return{scrollHeight:n,scrollDepth:r,scrollTop:e}}function $ce(e,t=Oce){return new $t(n=>{function r(){n.notify(Dce())}if(window.ResizeObserver){const i=Fb(r,t,{leading:!1,trailing:!0}),o=document.scrollingElement||document.documentElement,a=new ResizeObserver(St(i.throttled));o&&a.observe(o);const c=Dn(e,window,"scroll",i.throttled,{passive:!0});return()=>{i.cancel(),a.disconnect(),c.stop()}}})}function Pce(e,t,n,r,i,o,a){const c={},{stop:d,setLoadEvent:f}=Rce(e,t,n,r,o,a,S=>{c.loadingTime=S,i()}),{stop:m}=Ace(r,a,S=>{c.scroll=S}),{stop:h}=gce(r,a.relative,S=>{c.cumulativeLayoutShift=S,i()}),{stop:v,getInteractionToNextPaint:y,setViewEnd:x}=Cce(r,a.relative,o);return{stop:()=>{d(),h(),m()},stopINPTracking:v,setLoadEvent:f,setViewEnd:x,getCommonViewMetrics:()=>(c.interactionToNextPaint=y(),c)}}function Mce(e,t){const{stop:n}=Dn(e,window,"pageshow",r=>{r.persisted&&t(r)},{capture:!0});return n}function zce(e,t,n){oce(e.relative,r=>{t.firstContentfulPaint=r,t.largestContentfulPaint={value:r},n()})}const Lce=3e3,Fce=5*Jr,Uce=5*Jr;function Vce(e,t,n,r,i,o,a,c){const d=new Set;let f=v(Ja.INITIAL_LOAD,V4(),c),m;y();let h;a&&(h=x(o),i.trackBfcacheViews&&(m=Mce(i,S=>{f.end();const C=Lb(S.timeStamp);f=v(Ja.BF_CACHE,C,void 0)})));function v(S,C,k){const E=Bce(t,n,r,i,e,S,C,k);return d.add(E),E.stopObservable.subscribe(()=>{d.delete(E)}),E}function y(){t.subscribe(10,()=>{f=v(Ja.ROUTE_CHANGE,void 0,{name:f.name,service:f.service,version:f.version,context:f.contextManager.getContext()})}),t.subscribe(9,()=>{f.end({sessionIsActive:!1})})}function x(S){return S.subscribe(({oldLocation:C,newLocation:k})=>{qce(C,k)&&(f.end(),f=v(Ja.ROUTE_CHANGE))})}return{addTiming:(S,C=Cr())=>{f.addTiming(S,C)},startView:(S,C)=>{f.end({endClocks:C}),f=v(Ja.ROUTE_CHANGE,C,S)},setViewContext:S=>{f.contextManager.setContext(S)},setViewContextProperty:(S,C)=>{f.contextManager.setContextProperty(S,C)},setViewName:S=>{f.setViewName(S)},getViewContext:()=>f.contextManager.getContext(),stop:()=>{h&&h.unsubscribe(),m&&m(),f.end(),d.forEach(S=>S.stop())}}}function Bce(e,t,n,r,i,o,a=cr(),c){const d=$r(),f=new $t,m={};let h=0,v;const y=hm(i),x=Yb();let S=!0,C=c?.name;const k=c?.service||r.service,E=c?.version||r.version,j=c?.context;j&&x.setContext(j);const R={id:d,name:C,startClocks:a,service:k,version:E,context:j};e.notify(1,R),e.notify(2,R);const{throttled:T,cancel:N}=Fb(D,Lce,{leading:!1}),{setLoadEvent:O,setViewEnd:M,stop:L,stopINPTracking:K,getCommonViewMetrics:ee}=Pce(e,t,n,r,te,o,a),{stop:q,initialViewMetrics:Y}=o===Ja.INITIAL_LOAD?mce(r,a,O,te):{stop:Jt,initialViewMetrics:{}};o===Ja.BF_CACHE&&zce(a,Y,te);const{stop:U,eventCounts:H}=nce(e,d,te),z=cf(D,Fce),W=e.subscribe(11,$=>{$.reason===yd.UNLOADING&&D()});D(),x.changeObservable.subscribe(te);function F(){e.notify(3,{id:d,name:C,context:x.getContext(),startClocks:a,sessionIsActive:S})}function te(){F(),T()}function D(){N(),F(),h+=1;const $=v===void 0?Cr():v.timeStamp;e.notify(4,{customTimings:m,documentVersion:h,id:d,name:C,service:k,version:E,context:x.getContext(),loadingType:o,location:y,startClocks:a,commonViewMetrics:ee(),initialViewMetrics:Y,duration:Gn(a.timeStamp,$),isActive:v===void 0,sessionIsActive:S,eventCounts:H})}return{get name(){return C},service:k,version:E,contextManager:x,stopObservable:f,end($={}){var V,A;v||(v=(V=$.endClocks)!==null&&V!==void 0?V:cr(),S=(A=$.sessionIsActive)!==null&&A!==void 0?A:!0,e.notify(5,{endClocks:v}),e.notify(6,{endClocks:v}),zb(z),M(v.relative),L(),W.unsubscribe(),D(),Ar(()=>{this.stop()},Uce))},stop(){q(),U(),K(),f.notify()},addTiming($,V){if(v)return;const A=are(V)?V:Gn(a.timeStamp,V);m[Hce($)]=A,te()},setViewName($){C=$,D()}}}function Hce(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&ht.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function qce(e,t){return e.pathname!==t.pathname||!Kce(t.hash)&&D$(t.hash)!==D$(e.hash)}function Kce(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function D$(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function Gce(e,t,n,r,i,o,a,c,d,f){return e.subscribe(4,m=>e.notify(12,Zce(m,n,c))),t.register(0,({startTime:m,eventType:h})=>{const v=d.findView(m);return v?{type:h,service:v.service,version:v.version,context:v.context,view:{id:v.id,name:v.name}}:vl}),t.register(1,({startTime:m})=>{var h;return{view:{id:(h=d.findView(m))===null||h===void 0?void 0:h.id}}}),Vce(r,e,i,o,n,a,!n.trackViewsManually,f)}function Zce(e,t,n){var r,i,o,a,c,d,f,m,h,v,y,x,S,C,k,E,j,R;const T=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,O={_dd:{document_version:e.documentVersion,replay_stats:T,cls:N?{device_pixel_ratio:N}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:xt.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:bt((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:bt((d=e.initialViewMetrics.navigationTimings)===null||d===void 0?void 0:d.firstByte),dom_complete:bt((f=e.initialViewMetrics.navigationTimings)===null||f===void 0?void 0:f.domComplete),dom_content_loaded:bt((m=e.initialViewMetrics.navigationTimings)===null||m===void 0?void 0:m.domContentLoaded),dom_interactive:bt((h=e.initialViewMetrics.navigationTimings)===null||h===void 0?void 0:h.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:bt(e.initialViewMetrics.firstContentfulPaint),first_input_delay:bt((v=e.initialViewMetrics.firstInput)===null||v===void 0?void 0:v.delay),first_input_time:bt((y=e.initialViewMetrics.firstInput)===null||y===void 0?void 0:y.time),first_input_target_selector:(x=e.initialViewMetrics.firstInput)===null||x===void 0?void 0:x.targetSelector,interaction_to_next_paint:bt((S=e.commonViewMetrics.interactionToNextPaint)===null||S===void 0?void 0:S.value),interaction_to_next_paint_time:bt((C=e.commonViewMetrics.interactionToNextPaint)===null||C===void 0?void 0:C.time),interaction_to_next_paint_target_selector:(k=e.commonViewMetrics.interactionToNextPaint)===null||k===void 0?void 0:k.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:bt((E=e.initialViewMetrics.largestContentfulPaint)===null||E===void 0?void 0:E.value),largest_contentful_paint_target_selector:(j=e.initialViewMetrics.largestContentfulPaint)===null||j===void 0?void 0:j.targetSelector,load_event:bt((R=e.initialViewMetrics.navigationTimings)===null||R===void 0?void 0:R.loadEvent),loading_time:iF(bt(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:Yce(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:bt(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:bt(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:wae()}};return Il(e.customTimings)||(O.view.custom_timings=P4(e.customTimings,bt)),{rawRumEvent:O,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function Yce({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:r,largestContentfulPaint:i}){return{cls:e&&{score:e.value,timestamp:bt(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:bt(n)},fid:r&&{duration:bt(r.delay),timestamp:bt(r.time),target_selector:r.targetSelector},inp:t&&{duration:bt(t.value),timestamp:bt(t.time),target_selector:t.targetSelector},lcp:i&&{timestamp:bt(i.value),target_selector:i.targetSelector,resource_url:i.resourceUrl}}}const Wce="rum";function Xce(e,t,n){const r=$oe(e,Wce,i=>Qce(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 Jce(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:IL("records")?1:0};return{findTrackedSession:()=>e,expire:Jt,expireObservable:new $t,setForcedReplay:Jt}}function Qce(e,t){return eue(t)?t:mc(e.sessionSampleRate)?mc(e.sessionReplaySampleRate)?"1":"2":"0"}function eue(e){return e==="0"||e==="1"||e==="2"}function tue(e,t,n,r,i,o){const a=[e.rumEndpointBuilder];e.replica&&a.push(e.replica.rumEndpointBuilder);const c=NL({encoder:o(2),request:RL(a,n),flushController:TL({pageMayExitObservable:r,sessionExpireObservable:i})});return t.subscribe(13,d=>{d.type===xt.VIEW?c.upsert(d,d.view.id):c.add(d)}),c}function nue(e){const t=Ym();e.subscribe(13,n=>{t.send("rum",n)})}const rue=Kc;function iue(e,t,n,r){const i=pf({expireDelay:rue});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 m=Bi();i.closeActive(m),i.add(c({url:d.href,referrer:f.referrer}),m)}});function c({url:d,referrer:f}){return{url:d,referrer:f}}return t.register(0,({startTime:d,eventType:f})=>{const m=i.find(d);return m?{type:f,view:{url:m.url,referrer:m.referrer}}:vl}),{findUrl:d=>i.find(d),stop:()=>{a.unsubscribe(),i.stop()}}}function oue(e,t){let n=hm(t);return new $t(r=>{const{stop:i}=aue(e,a),{stop:o}=sue(e,a);function a(){if(n.href===t.href)return;const c=hm(t);r.notify({newLocation:c,oldLocation:n}),n=c}return()=>{i(),o()}})}function aue(e,t){const{stop:n}=ga($$("pushState"),"pushState",({onPostCall:o})=>{o(t)}),{stop:r}=ga($$("replaceState"),"replaceState",({onPostCall:o})=>{o(t)}),{stop:i}=Dn(e,window,"popstate",t);return{stop:()=>{n(),r(),i()}}}function sue(e,t){return Dn(e,window,"hashchange",t)}function $$(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const lue=Kc;function cue(e,t,n){const r=pf({expireDelay:lue});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([xt.VIEW,xt.ERROR]).includes(o))return Hi;const c=r.find(i);return!c||Il(c)?Hi:{type:o,feature_flags:c}}),{addFeatureFlagEvaluation:(i,o)=>{const a=r.find();a&&(a[i]=o)}}}const uue=10*Mr;let bd,bv;function due(e,t,n){e.metricsEnabled&&(NF(),bv=!1,t.subscribe(13,()=>{bv=!0}),n.subscribe(({bytesCount:r,messagesCount:i})=>{bv&&(bv=!1,bd.batchCount+=1,M$(bd.batchBytesCount,r),M$(bd.batchMessagesCount,i))}),cf(fue,uue))}function fue(){bd.batchCount!==0&&(Zb("Customer data measures",bd),NF())}function P$(){return{min:1/0,max:0,sum:0}}function M$(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function NF(){bd={batchCount:0,batchBytesCount:P$(),batchMessagesCount:P$()}}const pue=4e3,mue=500,hue=Kc;function gue(e,t,n=mue){const r=pf({expireDelay:hue,maxEntries:pue});let i;Yc(Ut.VISIBILITY_STATE)&&performance.getEntriesByType(Ut.VISIBILITY_STATE).forEach(f=>{const m=f.name==="hidden"?"hidden":"active";a(m,f.startTime)}),a(TF(),Bi());const{stop:o}=gl(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],d=>{a(yue(d),d.timeStamp)},{capture:!0});function a(d,f=Bi()){d!==i&&(i=d,r.closeActive(f),r.add({state:i,startTime:f},f))}function c(d,f,m){return r.findAll(f,m).some(h=>h.state===d)}return e.register(0,({startTime:d,duration:f=0,eventType:m})=>{if(m===xt.VIEW){const h=r.findAll(d,f);return{type:m,_dd:{page_states:vue(h,d,n)}}}return m===xt.ACTION||m===xt.ERROR?{type:m,view:{in_foreground:c("active",d,0)}}:Hi}),{wasInPageStateDuringPeriod:c,addPageState:a,stop:()=>{o(),r.stop()}}}function vue(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:r,startTime:i})=>({state:r,start:bt(Gn(t,i))}))}function yue(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":TF()}function TF(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function bue(e,t){let n;const r=requestAnimationFrame(St(()=>{n=kE()})),i=Nce(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 xue(e,t){const n=window.cookieStore?wue(e):_ue;return new $t(r=>n(t,i=>r.notify(i)))}function wue(e){return(t,n)=>Dn(e,window.cookieStore,"change",i=>{const o=i.changed.find(a=>a.name===t)||i.deleted.find(a=>a.name===t);o&&n(o.value)}).stop}const Sue=Mr;function _ue(e,t){const n=gm(document.cookie,e),r=cf(()=>{const i=gm(document.cookie,e);i!==n&&t(i)},Sue);return()=>{zb(r)}}const z$="datadog-ci-visibility-test-execution-id";function Cue(e,t,n=xue(e,z$)){var r;let i=el(z$)||((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"?Hi:{type:a,session:{type:"ci_test"},ci_test:{test_execution_id:i}}),{stop:()=>{o.unsubscribe()}}}function kue(e,t){const n=wa(t,{type:Ut.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(r=>{for(const i of r){const o=Lb(i.startTime),a={date:o.timeStamp,long_task:{id:$r(),entry_type:BL.LONG_ANIMATION_FRAME,duration:bt(i.duration),blocking_duration:bt(i.blockingDuration),first_ui_event_timestamp:bt(i.firstUIEventTimestamp),render_start:bt(i.renderStart),style_and_layout_start:bt(i.styleAndLayoutStart),start_time:bt(i.startTime),scripts:i.scripts.map(c=>({duration:bt(c.duration),pause_duration:bt(c.pauseDuration),forced_style_and_layout_duration:bt(c.forcedStyleAndLayoutDuration),start_time:bt(c.startTime),execution_start:bt(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:xt.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:o.relative,duration:i.duration,domainContext:{performanceEntry:i}})}});return{stop:()=>n.unsubscribe()}}function Eue(e,t){const n=wa(t,{type:Ut.LONG_TASK,buffered:!0}).subscribe(r=>{for(const i of r){if(i.entryType!==Ut.LONG_TASK||!t.trackLongTasks)break;const o=Lb(i.startTime),a={date:o.timeStamp,long_task:{id:$r(),entry_type:BL.LONG_TASK,duration:bt(i.duration)},type:xt.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:o.relative,duration:i.duration,domainContext:{performanceEntry:i}})}});return{stop(){n.unsubscribe()}}}function jue(e){e.register(0,({eventType:t})=>{if(!PL())return Hi;const n=DL(),r=$L();return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:r,injected:AL()}}})}function Rue(e,t,n){const r=vE(e),i=n(r);return pE(t).forEach(([o,a])=>_C(e,r,o.split(/\.|(?=\[\])/),a)),i}function _C(e,t,n,r){const[i,...o]=n;if(i==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((a,c)=>_C(a,t[c],o,r));return}if(!(!L$(e)||!L$(t))){if(o.length>0)return _C(e[i],t[i],o,r);Iue(e,i,t[i],r)}}function Iue(e,t,n,r){const i=Gc(n);i===r?e[t]=vn(n):r==="object"&&(i==="undefined"||i==="null")&&(e[t]={})}function L$(e){return Gc(e)==="object"}const Yu={"view.name":"string","view.url":"string","view.referrer":"string"},Wu={context:"object"},Xu={service:"string",version:"string"};let OF;function Nue(e,t,n,r,i){OF={[xt.VIEW]:{"view.performance.lcp.resource_url":"string",...Wu,...Yu,...Xu},[xt.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...Wu,...Yu,...Xu},[xt.RESOURCE]:{"resource.url":"string","resource.graphql.variables":"string",...Wu,...Yu,...Xu},[xt.ACTION]:{"action.target.name":"string",...Wu,...Yu,...Xu},[xt.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...Wu,...Yu,...Xu},[xt.VITAL]:{...Wu,...Yu,...Xu}};const o={[xt.ERROR]:T_(xt.ERROR,r,i),[xt.ACTION]:T_(xt.ACTION,r,i),[xt.VITAL]:T_(xt.VITAL,r,i)};t.subscribe(12,({startTime:a,duration:c,rawRumEvent:d,domainContext:f})=>{const m=n.triggerHook(0,{eventType:d.type,startTime:a,duration:c});if(m===vl)return;const h=is(m,d,{ddtags:yL(e).join(",")});Tue(h,e.beforeSend,f,o)&&(Il(h.context)&&delete h.context,t.notify(13,h))})}function Tue(e,t,n,r){var i;if(t){const a=Rue(e,OF[e.type],c=>t(c,n));if(a===!1&&e.type!==xt.VIEW)return!1;a===!1&&ht.warn("Can't dismiss view events using beforeSend!")}return!((i=r[e.type])===null||i===void 0?void 0:i.isLimitReached())}function Oue(e,t,n,r){e.register(0,({eventType:i,startTime:o})=>{const a=t.findTrackedSession(o),c=r.findView(o);if(!a||!c)return vl;let d,f,m;return i===xt.VIEW?(d=n.getReplayStats(c.id)?!0:void 0,f=a.sessionReplay===1,m=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:m}}}),e.register(1,({startTime:i})=>{const o=t.findTrackedSession(i);return o?{session:{id:o.id}}:Hi})}function Aue(e){e.register(0,({eventType:t})=>({type:t,connectivity:xL()}))}function Due(e,t,n){e.register(0,({eventType:r})=>{const i=t.source;return{type:r,_dd:{format_version:2,drift:ire(),configuration:{session_sample_rate:ld(t.sessionSampleRate,3),session_replay_sample_rate:ld(t.sessionReplaySampleRate,3),profiling_sample_rate:ld(t.profilingSampleRate,3),trace_sample_rate:ld(t.traceSampleRate,3),beta_encode_cookie_options:t.betaEncodeCookieOptions},browser_sdk_version:Pd()?"6.25.0":void 0,sdk_name:n},application:{id:t.applicationId},date:Cr(),source:i}}),e.register(1,()=>({application:{id:t.applicationId}}))}function $ue(e,t){e.register(1,()=>t.isGranted()?Hi:vl)}const Pue=hoe,Mue=[xt.ACTION,xt.ERROR,xt.LONG_TASK,xt.RESOURCE,xt.VITAL];function zue(e){return{addEvent:(t,n,r,i)=>{Mue.includes(n.type)&&e.notify(12,{startTime:t,rawRumEvent:n,domainContext:r,duration:i})}}}function Lue(e,t){if(!t.metricsEnabled)return{stop:Jt};const{unsubscribe:n}=e.subscribe(4,({initialViewMetrics:r})=>{!r.largestContentfulPaint||!r.navigationTimings||(Zb("Initial view metrics",{metrics:Fue(r.largestContentfulPaint,r.navigationTimings)}),n())});return{stop:n}}function Fue(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function Uue(e,t,n,r,i,o,a,c,d){const f=[],m=new mse,h=Pue();m.subscribe(13,R=>bL("rum",R));const v=R=>{m.notify(14,{error:R}),Wm("Error reported to customer",{"error.message":R.message})},y=doe(e),x=y.subscribe(R=>{m.notify(11,R)});f.push(()=>x.unsubscribe());const S=xoe("browser-rum-sdk",e,h,v,y,i);f.push(S.stop);const C=Pd()?Jce():Xce(e,m,o);if(Pd())nue(m);else{const R=tue(e,m,v,y,C.expireObservable,i);f.push(()=>R.stop()),due(S,m,R.flushController.flushObservable)}$ue(h,o);const{stop:k}=Lue(m,S);f.push(k);const{stop:E,...j}=Vue(m,h,e,C,t,r,a,c,d,v);return f.push(E),c.unbuffer(),f.push(()=>n.stop()),{...j,lifeCycle:m,session:C,stopSession:()=>C.expire(),telemetry:S,stop:()=>{f.forEach(R=>R())},hooks:h}}function Vue(e,t,n,r,i,o,a,c,d,f){const m=[],h=use(),v=oue(n,location),{observable:y,stop:x}=fse();m.push(x),Due(t,n,d);const S=gue(t,n);m.push(()=>S.stop());const C=gse(e);m.push(()=>C.stop());const k=iue(e,t,v,location);m.push(()=>k.stop());const E=cue(e,t,n);Oue(t,r,i,C),Aue(t);const j=vae(t,n,"rum"),R=yae(t,n,r,"rum"),T=gae(t,n,"rum"),N=Nle(e,t,h,y,n);m.push(N.stop);const O=zue(e),M=bue(t,n);m.push(M.stop);const L=Cue(n,t);m.push(L.stop),jue(t),Nue(n,e,t,f);const{addTiming:K,startView:ee,setViewName:q,setViewContext:Y,setViewContextProperty:U,getViewContext:H,stop:z}=Gce(e,t,n,location,h,y,v,i,C,o);m.push(z);const{stop:W}=Gle(e,n,S);if(m.push(W),n.trackLongTasks)if(Yc(Ut.LONG_ANIMATION_FRAME)){const{stop:$}=kue(e,n);m.push($)}else Eue(e,n);const{addError:F}=Ale(e,n,c);Ase(e,n,r,R,T);const te=_ae(e,S,a),D=pse(n.applicationId,r,C,N.actionContexts,k);return{addAction:N.addAction,addEvent:O.addEvent,addError:F,addTiming:K,addFeatureFlagEvaluation:E.addFeatureFlagEvaluation,startView:ee,setViewContext:Y,setViewContextProperty:U,getViewContext:H,setViewName:q,viewHistory:C,getInternalContext:D.get,startDurationVital:te.startDurationVital,stopDurationVital:te.stopDurationVital,addDurationVital:te.addDurationVital,addOperationStepVital:te.addOperationStepVital,globalContext:j,userContext:R,accountContext:T,stop:()=>m.forEach($=>$())}}function Bue(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=Hue(e),c=`/rum/replay/sessions/${i}`;return`${a}${c}?${o.join("&")}`}function Hue(e){const t=e.site,n=e.subdomain||que(e);return`https://${n?`${n}.`:""}${t}`}function que(e){switch(e.site){case hc:case Yre:return"app";case oL:return"dd";default:return}}const Kue=1e3;let go;function b2e(e){return ex(e).segments_count}function x2e(e){ex(e).segments_count+=1}function w2e(e){ex(e).records_count+=1}function S2e(e,t){ex(e).segments_total_raw_size+=t}function Gue(e){return go?.get(e)}function ex(e){go||(go=new Map);let t;return go.has(e)?t=go.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},go.set(e,t),go.size>Kue&&Zue()),t}function Zue(){if(!go)return;const e=go.keys().next().value;e&&go.delete(e)}function AF(e,t,n){let r=0,i=[],o,a=!0,c=0;const d=[],{stop:f}=Dn(e,t,"message",({data:v})=>{if(v.type!=="wrote"||v.streamId!==n)return;const y=d[0];y&&(y.id===v.id?(d.shift(),r+=v.additionalBytesCount,i.push(v.result),o=v.trailer,y.writeCallback?y.writeCallback(v.result.byteLength):y.finishCallback&&y.finishCallback()):y.id<v.id&&f())});function m(){const v=i.length===0?new Uint8Array(0):fL(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(m())):v(m())},finishSync(){h();const v=d.map(y=>y.data).join("");return d.length=0,{...m(),pendingData:v}},estimateEncodedBytesCount(v){return v.length/8},stop(){f()}}}function EE({configuredUrl:e,error:t,source:n,scriptType:r}){if(ht.error(`${n} failed to start: an error occurred while initializing the ${r}:`,t),t instanceof Event||t instanceof Error&&Yue(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.",ht.error(`${i} See documentation at ${Pb}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else r==="worker"&&yE(t)}function Yue(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const Wue=30*Mr;function DF(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){if(1===t.length)return t[0];const e=t.reduce((t,e)=>t+e.length,0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!==--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return-1^t},O={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=L(t.adler,e,r,a):2===t.state.wrap&&(t.adler=T(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!==--r);return s<=t.lookahead?s:t.lookahead},at=function(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-J)){t.window.set(t.window.subarray(s,s+s),0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--a);e=a=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=tt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},nt=function(t,e){for(var a,n;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},rt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function it(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var st=[new it(0,0,0,0,function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)}),new it(4,4,8,4,nt),new it(4,5,16,8,nt),new it(4,6,32,32,nt),new it(4,4,16,16,rt),new it(8,16,32,32,rt),new it(8,16,128,128,rt),new it(8,32,128,256,rt),new it(32,128,258,1024,rt),new it(32,258,258,4096,rt)];function ht(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var lt=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=st[e.level].max_lazy,e.good_match=st[e.level].good_length,e.nice_match=st[e.level].nice_length,e.max_chain_length=st[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},_t=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(at(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(at(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):st[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},ot=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},dt=new Uint8Array(256),ut=0;ut<256;ut++)dt[ut]=ut>=252?6:ut>=248?5:ut>=240?4:ut>=224?3:ut>=192?2:1;dt[254]=dt[254]=1;var ft=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ct=Object.prototype.toString;function pt(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new ht;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,lt(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ct.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,at(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,at(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function gt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function vt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}pt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ct.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=_t(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=ot(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},pt.prototype.onData=function(t){this.chunks.push(t)},pt.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.25.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 Kn={status:0};function $F(e,t,n,r=DF){switch(Kn.status===0&&Xue(e,t,r),Kn.status){case 1:return Kn.initializationFailureCallbacks.push(n),Kn.worker;case 3:return Kn.worker}}function F$(){return Kn.status}function Xue(e,t,n=DF){try{const r=n(e),{stop:i}=Dn(e,r,"error",c=>{B_(e,t,c)}),{stop:o}=Dn(e,r,"message",({data:c})=>{c.type==="errored"?B_(e,t,c.error,c.streamId):c.type==="initialized"&&Que(c.version)});r.postMessage({action:"init"}),Ar(()=>Jue(t),Wue),Kn={status:1,worker:r,stop:()=>{i(),o()},initializationFailureCallbacks:[]}}catch(r){B_(e,t,r)}}function Jue(e){Kn.status===1&&(ht.error(`${e} failed to start: a timeout occurred while initializing the Worker`),Kn.initializationFailureCallbacks.forEach(t=>t()),Kn={status:2})}function Que(e){Kn.status===1&&(Kn={status:3,worker:Kn.worker,stop:Kn.stop,version:e})}function B_(e,t,n,r){Kn.status===1||Kn.status===0?(EE({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),Kn.status===1&&Kn.initializationFailureCallbacks.forEach(i=>i()),Kn={status:2}):yE(n,{worker_version:Kn.status===3&&Kn.version,stream_id:r})}function PF(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function ede(e,t,n,r){const i=t.findTrackedSession(),o=tde(i,r),a=n.findView();return Bue(e,{viewContext:a,errorType:o,session:i})}function tde(e,t){if(!PF())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 nde(e,t){if(!e.metricsEnabled)return{stop:Jt};let n,r,i;const{unsubscribe:o}=t.subscribe(a=>{switch(a.type){case"start":n={forced:a.forced,timestamp:Cr()},r=void 0,i=void 0;break;case"document-ready":n&&(r=Gn(n.timestamp,Cr()));break;case"recorder-settled":n&&(i=Gn(n.timestamp,Cr()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":o(),n&&Zb("Recorder init metrics",{metrics:rde(n.forced,i,Gn(n.timestamp,Cr()),a.type,r)});break}});return{stop:o}}function rde(e,t,n,r,i){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:n,result:r,waitForDocReadyDuration:i}}function ide(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 $t;nde(a,f);const m=async y=>{f.notify({type:"start",forced:y});const[x]=await Promise.all([U$(f,{type:"recorder-settled"},i()),U$(f,{type:"document-ready"},Hoe(e,"interactive"))]);if(c!==2){f.notify({type:"aborted"});return}if(!x){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}=x(t,e,n,r,S,a)),c=3,f.notify({type:"succeeded"})};function h(y){const x=n.findTrackedSession();if(ode(x,y)){c=1;return}if(ade(c))return;c=2;const S=sde(x,y)||!1;m(S).catch(ml),S&&n.setForcedReplay()}function v(){c===3&&d?.(),c=0}return{start:h,stop:v,getSessionReplayLink(){return ede(e,n,r,c!==0)},isRecording:()=>c===3}}function ode(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function ade(e){return e===2||e===3}function sde(e,t){return t&&t.force&&e.sessionReplay===0}async function U$(e,t,n){try{return await n}finally{e.notify(t)}}function lde(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:Jt},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function cde(e,t){if(Pd()&&!IL("records")||!PF())return{start:Jt,stop:Jt,getReplayStats:()=>{},onRumStart:Jt,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:r}=lde();return{start:o=>n.start(o),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:i,isRecording:()=>F$()===3&&n.isRecording(),getReplayStats:o=>F$()===3?Gue(o):void 0};function i(o,a,c,d,f,m){let h;function v(){return h||(f??(f=$F(a,"Datadog Session Replay",()=>{n.stop()},t)),f&&(h=AF(a,f,1))),h}n=ide(a,o,c,d,e,v,m),r(a)&&n.start()}}const ude="modulepreload",dde=function(e){return"/"+e},V$={},Jm=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let d=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");i=d(n.map(f=>{if(f=dde(f),f in V$)return;V$[f]=!0;const m=f.endsWith(".css"),h=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${h}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":ude,m||(v.as="script"),v.crossOrigin="",v.href=f,c&&v.setAttribute("nonce",c),document.head.appendChild(v),m)return new Promise((y,x)=>{v.addEventListener("load",y),v.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(a){const 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 fde(e=pde){try{return await e()}catch(t){EE({error:t,source:"Recorder",scriptType:"module"})}}async function pde(){return(await Jm(()=>import("./startRecording-CngdzGnH.js"),[])).startRecording}function mde(){return Ro().Profiler!==void 0}const hde=e=>{let t={status:"starting"};return e.register(0,({eventType:n})=>n!==xt.VIEW&&n!==xt.LONG_TASK?Hi:{type:n,_dd:{profiling:t}}),{get:()=>t,set:n=>{t=n}}};async function gde(e=vde){try{return await e()}catch(t){EE({error:t,source:"Profiler",scriptType:"module"})}}async function vde(){return(await Jm(()=>import("./profiler-DqSCXbQf.js"),[])).createRumProfiler}function yde(){let e;function t(n,r,i,o,a,c){const d=o.findTrackedSession();if(!d||!GL(d.id,i.profilingSampleRate))return;const f=hde(r);if(!mde()){f.set({status:"error",error_reason:"not-supported-by-browser"});return}gde().then(m=>{if(!m){Wm("[DD_RUM] Failed to lazy load the RUM Profiler"),f.set({status:"error",error_reason:"failed-to-lazy-load"});return}e=m(i,n,o,f,c),e.start(a.findView())}).catch(ml)}return{onRumStart:t,stop:()=>{e?.stop().catch(ml)}}}const bde=cde(fde),xde=yde(),wde=lse(Uue,bde,xde,{startDeflateWorker:$F,createDeflateEncoder:AF,sdkName:"rum"});Uie(Ro(),"DD_RUM",wde);function ay(e,t){ym("react error"),cr()}const B$={didCatch:!1,error:null};class _2e extends Q.Component{constructor(t){super(t),this.resetError=()=>{this.setState(B$)},this.state=B$}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}componentDidCatch(t,n){ay()}render(){return this.state.didCatch?Q.createElement(this.props.fallback,{error:this.state.error,resetError:this.resetError}):this.props.children}}let H$=!1;function Sde(){b.useEffect(()=>{H$||(H$=!0)},[])}function _de(){return u.jsx(u.Fragment,{children:u.jsx(kl,{})})}const tx=oQ()({component:_de});function Cde(){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 jE(){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 kde(e,t){const n=b.createContext(t),r=o=>{const{children:a,...c}=o,d=b.useMemo(()=>c,Object.values(c));return u.jsx(n.Provider,{value:d,children:a})};r.displayName=e+"Provider";function i(o){const a=b.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function Xi(e,t=[]){let n=[];function r(o,a){const c=b.createContext(a),d=n.length;n=[...n,a];const f=h=>{const{scope:v,children:y,...x}=h,S=v?.[e]?.[d]||c,C=b.useMemo(()=>x,Object.values(x));return u.jsx(S.Provider,{value:C,children:y})};f.displayName=o+"Provider";function m(h,v){const y=v?.[e]?.[d]||c,x=b.useContext(y);if(x)return x;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,m]}const i=()=>{const o=n.map(a=>b.createContext(a));return function(c){const d=c?.[e]||o;return b.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return i.scopeName=e,[r,Ede(i,...t)]}function Ede(...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 b.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function Md(e){const t=jde(e),n=b.forwardRef((r,i)=>{const{children:o,...a}=r,c=b.Children.toArray(o),d=c.find(Ide);if(d){const f=d.props.children,m=c.map(h=>h===d?b.Children.count(f)>1?b.Children.only(null):b.isValidElement(f)?f.props.children:null:h);return u.jsx(t,{...a,ref:i,children:b.isValidElement(f)?b.cloneElement(f,void 0,m):null})}return u.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function jde(e){const t=b.forwardRef((n,r)=>{const{children:i,...o}=n;if(b.isValidElement(i)){const a=Tde(i),c=Nde(o,i.props);return i.type!==b.Fragment&&(c.ref=r?lf(r,a):a),b.cloneElement(i,c)}return b.Children.count(i)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var MF=Symbol("radix.slottable");function Rde(e){const t=({children:n})=>u.jsx(u.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=MF,t}function Ide(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===MF}function Nde(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 Tde(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 Ode=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ye=Ode.reduce((e,t)=>{const n=Md(`Primitive.${t}`),r=b.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 Ty(e,t){e&&of.flushSync(()=>e.dispatchEvent(t))}var nr=globalThis?.document?b.useLayoutEffect:()=>{},Ade=Gk[" useInsertionEffect ".trim().toString()]||nr;function qo({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=Dde({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:i;{const m=b.useRef(e!==void 0);b.useEffect(()=>{const h=m.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.`),m.current=c},[c,r])}const f=b.useCallback(m=>{if(c){const h=$de(m)?m(e):m;h!==e&&a.current?.(h)}else o(m)},[c,e,o,a]);return[d,f]}function Dde({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),i=b.useRef(n),o=b.useRef(t);return Ade(()=>{o.current=t},[t]),b.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function $de(e){return typeof e=="function"}var Pde=b.createContext(void 0);function Wc(e){const t=b.useContext(Pde);return e||t||"ltr"}function Mde(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var ir=e=>{const{present:t,children:n}=e,r=zde(t),i=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),o=ft(r.ref,Lde(i));return typeof n=="function"||r.isPresent?b.cloneElement(i,{ref:o}):null};ir.displayName="Presence";function zde(e){const[t,n]=b.useState(),r=b.useRef(null),i=b.useRef(e),o=b.useRef("none"),a=e?"mounted":"unmounted",[c,d]=Mde(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const f=xv(r.current);o.current=c==="mounted"?f:"none"},[c]),nr(()=>{const f=r.current,m=i.current;if(m!==e){const v=o.current,y=xv(f);e?d("MOUNT"):y==="none"||f?.display==="none"?d("UNMOUNT"):d(m&&v!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),nr(()=>{if(t){let f;const m=t.ownerDocument.defaultView??window,h=y=>{const S=xv(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&S&&(d("ANIMATION_END"),!i.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",f=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},v=y=>{y.target===t&&(o.current=xv(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{m.clearTimeout(f),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:b.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function xv(e){return e?.animationName||"none"}function Lde(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 Fde=Gk[" useId ".trim().toString()]||(()=>{}),Ude=0;function Fi(e){const[t,n]=b.useState(Fde());return nr(()=>{n(r=>r??String(Ude++))},[e]),t?`radix-${t}`:""}function Qm(e){const t=e+"CollectionProvider",[n,r]=Xi(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=S=>{const{scope:C,children:k}=S,E=Q.useRef(null),j=Q.useRef(new Map).current;return u.jsx(i,{scope:C,itemMap:j,collectionRef:E,children:k})};a.displayName=t;const c=e+"CollectionSlot",d=Md(c),f=Q.forwardRef((S,C)=>{const{scope:k,children:E}=S,j=o(c,k),R=ft(C,j.collectionRef);return u.jsx(d,{ref:R,children:E})});f.displayName=c;const m=e+"CollectionItemSlot",h="data-radix-collection-item",v=Md(m),y=Q.forwardRef((S,C)=>{const{scope:k,children:E,...j}=S,R=Q.useRef(null),T=ft(C,R),N=o(m,k);return Q.useEffect(()=>(N.itemMap.set(R,{ref:R,...j}),()=>{N.itemMap.delete(R)})),u.jsx(v,{[h]:"",ref:T,children:E})});y.displayName=m;function x(S){const C=o(e+"CollectionConsumer",S);return Q.useCallback(()=>{const E=C.collectionRef.current;if(!E)return[];const j=Array.from(E.querySelectorAll(`[${h}]`));return Array.from(C.itemMap.values()).sort((N,O)=>j.indexOf(N.ref.current)-j.indexOf(O.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:a,Slot:f,ItemSlot:y},x,r]}function In(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>t.current?.(...n),[])}function Vde(e,t=globalThis?.document){const n=In(e);b.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Bde="DismissableLayer",CC="dismissableLayer.update",Hde="dismissableLayer.pointerDownOutside",qde="dismissableLayer.focusOutside",q$,zF=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),mf=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...d}=e,f=b.useContext(zF),[m,h]=b.useState(null),v=m?.ownerDocument??globalThis?.document,[,y]=b.useState({}),x=ft(t,O=>h(O)),S=Array.from(f.layers),[C]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),k=S.indexOf(C),E=m?S.indexOf(m):-1,j=f.layersWithOutsidePointerEventsDisabled.size>0,R=E>=k,T=Zde(O=>{const M=O.target,L=[...f.branches].some(K=>K.contains(M));!R||L||(i?.(O),a?.(O),O.defaultPrevented||c?.())},v),N=Yde(O=>{const M=O.target;[...f.branches].some(K=>K.contains(M))||(o?.(O),a?.(O),O.defaultPrevented||c?.())},v);return Vde(O=>{E===f.layers.size-1&&(r?.(O),!O.defaultPrevented&&c&&(O.preventDefault(),c()))},v),b.useEffect(()=>{if(m)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(q$=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),K$(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=q$)}},[m,v,n,f]),b.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),K$())},[m,f]),b.useEffect(()=>{const O=()=>y({});return document.addEventListener(CC,O),()=>document.removeEventListener(CC,O)},[]),u.jsx(Ye.div,{...d,ref:x,style:{pointerEvents:j?R?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,N.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,T.onPointerDownCapture)})});mf.displayName=Bde;var Kde="DismissableLayerBranch",Gde=b.forwardRef((e,t)=>{const n=b.useContext(zF),r=b.useRef(null),i=ft(t,r);return b.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(Ye.div,{...e,ref:i})});Gde.displayName=Kde;function Zde(e,t=globalThis?.document){const n=In(e),r=b.useRef(!1),i=b.useRef(()=>{});return b.useEffect(()=>{const o=c=>{if(c.target&&!r.current){let d=function(){LF(Hde,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 Yde(e,t=globalThis?.document){const n=In(e),r=b.useRef(!1);return b.useEffect(()=>{const i=o=>{o.target&&!r.current&&LF(qde,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 K$(){const e=new CustomEvent(CC);document.dispatchEvent(e)}function LF(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?Ty(i,o):i.dispatchEvent(o)}function RE(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var FF=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"}),Wde="VisuallyHidden",UF=b.forwardRef((e,t)=>u.jsx(Ye.span,{...e,ref:t,style:{...FF,...e.style}}));UF.displayName=Wde;var VF=UF,Xc="NavigationMenu",[IE,BF,Xde]=Qm(Xc),[kC,Jde,Qde]=Qm(Xc),[NE]=Xi(Xc,[Xde,Qde]),[efe,Io]=NE(Xc),[tfe,nfe]=NE(Xc),HF=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:o,delayDuration:a=200,skipDelayDuration:c=300,orientation:d="horizontal",dir:f,...m}=e,[h,v]=b.useState(null),y=ft(t,L=>v(L)),x=Wc(f),S=b.useRef(0),C=b.useRef(0),k=b.useRef(0),[E,j]=b.useState(!0),[R,T]=qo({prop:r,onChange:L=>{const K=L!=="",ee=c>0;K?(window.clearTimeout(k.current),ee&&j(!1)):(window.clearTimeout(k.current),k.current=window.setTimeout(()=>j(!0),c)),i?.(L)},defaultProp:o??"",caller:Xc}),N=b.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>T(""),150)},[T]),O=b.useCallback(L=>{window.clearTimeout(C.current),T(L)},[T]),M=b.useCallback(L=>{R===L?window.clearTimeout(C.current):S.current=window.setTimeout(()=>{window.clearTimeout(C.current),T(L)},a)},[R,T,a]);return b.useEffect(()=>()=>{window.clearTimeout(S.current),window.clearTimeout(C.current),window.clearTimeout(k.current)},[]),u.jsx(qF,{scope:n,isRootMenu:!0,value:R,dir:x,orientation:d,rootNavigationMenu:h,onTriggerEnter:L=>{window.clearTimeout(S.current),E?M(L):O(L)},onTriggerLeave:()=>{window.clearTimeout(S.current),N()},onContentEnter:()=>window.clearTimeout(C.current),onContentLeave:N,onItemSelect:L=>{T(K=>K===L?"":L)},onItemDismiss:()=>T(""),children:u.jsx(Ye.nav,{"aria-label":"Main","data-orientation":d,dir:x,...m,ref:y})})});HF.displayName=Xc;var EC="NavigationMenuSub",rfe=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",...c}=e,d=Io(EC,n),[f,m]=qo({prop:r,onChange:i,defaultProp:o??"",caller:EC});return u.jsx(qF,{scope:n,isRootMenu:!1,value:f,dir:d.dir,orientation:a,rootNavigationMenu:d.rootNavigationMenu,onTriggerEnter:h=>m(h),onItemSelect:h=>m(h),onItemDismiss:()=>m(""),children:u.jsx(Ye.div,{"data-orientation":a,...c,ref:t})})});rfe.displayName=EC;var qF=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:i,orientation:o,children:a,value:c,onItemSelect:d,onItemDismiss:f,onTriggerEnter:m,onTriggerLeave:h,onContentEnter:v,onContentLeave:y}=e,[x,S]=b.useState(null),[C,k]=b.useState(new Map),[E,j]=b.useState(null);return u.jsx(efe,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:c,previousValue:RE(c),baseId:Fi(),dir:i,orientation:o,viewport:x,onViewportChange:S,indicatorTrack:E,onIndicatorTrackChange:j,onTriggerEnter:In(m),onTriggerLeave:In(h),onContentEnter:In(v),onContentLeave:In(y),onItemSelect:In(d),onItemDismiss:In(f),onViewportContentChange:b.useCallback((R,T)=>{k(N=>(N.set(R,T),new Map(N)))},[]),onViewportContentRemove:b.useCallback(R=>{k(T=>T.has(R)?(T.delete(R),new Map(T)):T)},[]),children:u.jsx(IE.Provider,{scope:t,children:u.jsx(tfe,{scope:t,items:C,children:a})})})},KF="NavigationMenuList",GF=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Io(KF,n),o=u.jsx(Ye.ul,{"data-orientation":i.orientation,...r,ref:t});return u.jsx(Ye.div,{style:{position:"relative"},ref:i.onIndicatorTrackChange,children:u.jsx(IE.Slot,{scope:n,children:i.isRootMenu?u.jsx(eU,{asChild:!0,children:o}):o})})});GF.displayName=KF;var ZF="NavigationMenuItem",[ife,YF]=NE(ZF),WF=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...i}=e,o=Fi(),a=r||o||"LEGACY_REACT_AUTO_VALUE",c=b.useRef(null),d=b.useRef(null),f=b.useRef(null),m=b.useRef(()=>{}),h=b.useRef(!1),v=b.useCallback((x="start")=>{if(c.current){m.current();const S=RC(c.current);S.length&&AE(x==="start"?S:S.reverse())}},[]),y=b.useCallback(()=>{if(c.current){const x=RC(c.current);x.length&&(m.current=mfe(x))}},[]);return u.jsx(ife,{scope:n,value:a,triggerRef:d,contentRef:c,focusProxyRef:f,wasEscapeCloseRef:h,onEntryKeyDown:v,onFocusProxyEnter:v,onRootContentClose:y,onContentFocusOutside:y,children:u.jsx(Ye.li,{...i,ref:t})})});WF.displayName=ZF;var jC="NavigationMenuTrigger",ofe=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...i}=e,o=Io(jC,e.__scopeNavigationMenu),a=YF(jC,e.__scopeNavigationMenu),c=b.useRef(null),d=ft(c,a.triggerRef,t),f=nU(o.baseId,a.value),m=rU(o.baseId,a.value),h=b.useRef(!1),v=b.useRef(!1),y=a.value===o.value;return u.jsxs(u.Fragment,{children:[u.jsx(IE.ItemSlot,{scope:n,value:a.value,children:u.jsx(tU,{asChild:!0,children:u.jsx(Ye.button,{id:f,disabled:r,"data-disabled":r?"":void 0,"data-state":DE(y),"aria-expanded":y,"aria-controls":m,...i,ref:d,onPointerEnter:Re(e.onPointerEnter,()=>{v.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:Re(e.onPointerMove,Oy(()=>{r||v.current||a.wasEscapeCloseRef.current||h.current||(o.onTriggerEnter(a.value),h.current=!0)})),onPointerLeave:Re(e.onPointerLeave,Oy(()=>{r||(o.onTriggerLeave(),h.current=!1)})),onClick:Re(e.onClick,()=>{o.onItemSelect(a.value),v.current=y}),onKeyDown:Re(e.onKeyDown,x=>{const C={horizontal:"ArrowDown",vertical:o.dir==="rtl"?"ArrowLeft":"ArrowRight"}[o.orientation];y&&x.key===C&&(a.onEntryKeyDown(),x.preventDefault())})})})}),y&&u.jsxs(u.Fragment,{children:[u.jsx(VF,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:x=>{const S=a.contentRef.current,C=x.relatedTarget,k=C===c.current,E=S?.contains(C);(k||!E)&&a.onFocusProxyEnter(k?"start":"end")}}),o.viewport&&u.jsx("span",{"aria-owns":m})]})]})});ofe.displayName=jC;var afe="NavigationMenuLink",G$="navigationMenu.linkSelect",XF=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:i,...o}=e;return u.jsx(tU,{asChild:!0,children:u.jsx(Ye.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...o,ref:t,onClick:Re(e.onClick,a=>{const c=a.target,d=new CustomEvent(G$,{bubbles:!0,cancelable:!0});if(c.addEventListener(G$,f=>i?.(f),{once:!0}),Ty(c,d),!d.defaultPrevented&&!a.metaKey){const f=new CustomEvent(sy,{bubbles:!0,cancelable:!0});Ty(c,f)}},{checkForDefaultPrevented:!1})})})});XF.displayName=afe;var TE="NavigationMenuIndicator",sfe=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Io(TE,e.__scopeNavigationMenu),o=!!i.value;return i.indicatorTrack?tE.createPortal(u.jsx(ir,{present:n||o,children:u.jsx(lfe,{...r,ref:t})}),i.indicatorTrack):null});sfe.displayName=TE;var lfe=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Io(TE,n),o=BF(n),[a,c]=b.useState(null),[d,f]=b.useState(null),m=i.orientation==="horizontal",h=!!i.value;b.useEffect(()=>{const x=o().find(S=>S.value===i.value)?.ref.current;x&&c(x)},[o,i.value]);const v=()=>{a&&f({size:m?a.offsetWidth:a.offsetHeight,offset:m?a.offsetLeft:a.offsetTop})};return IC(a,v),IC(i.indicatorTrack,v),d?u.jsx(Ye.div,{"aria-hidden":!0,"data-state":h?"visible":"hidden","data-orientation":i.orientation,...r,ref:t,style:{position:"absolute",...m?{left:0,width:d.size+"px",transform:`translateX(${d.offset}px)`}:{top:0,height:d.size+"px",transform:`translateY(${d.offset}px)`},...r.style}}):null}),zd="NavigationMenuContent",cfe=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Io(zd,e.__scopeNavigationMenu),o=YF(zd,e.__scopeNavigationMenu),a=ft(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(ufe,{forceMount:n,...d,ref:a}):u.jsx(ir,{present:n||c,children:u.jsx(JF,{"data-state":DE(c),...d,ref:a,onPointerEnter:Re(e.onPointerEnter,i.onContentEnter),onPointerLeave:Re(e.onPointerLeave,Oy(i.onContentLeave)),style:{pointerEvents:!c&&i.isRootMenu?"none":void 0,...d.style}})})});cfe.displayName=zd;var ufe=b.forwardRef((e,t)=>{const n=Io(zd,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:i}=n;return nr(()=>{r(e.value,{ref:t,...e})},[e,t,r]),nr(()=>()=>i(e.value),[e.value,i]),null}),sy="navigationMenu.rootContentDismiss",JF=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:i,focusProxyRef:o,wasEscapeCloseRef:a,onRootContentClose:c,onContentFocusOutside:d,...f}=e,m=Io(zd,n),h=b.useRef(null),v=ft(h,t),y=nU(m.baseId,r),x=rU(m.baseId,r),S=BF(n),C=b.useRef(null),{onItemDismiss:k}=m;b.useEffect(()=>{const j=h.current;if(m.isRootMenu&&j){const R=()=>{k(),c(),j.contains(document.activeElement)&&i.current?.focus()};return j.addEventListener(sy,R),()=>j.removeEventListener(sy,R)}},[m.isRootMenu,e.value,i,k,c]);const E=b.useMemo(()=>{const R=S().map(K=>K.value);m.dir==="rtl"&&R.reverse();const T=R.indexOf(m.value),N=R.indexOf(m.previousValue),O=r===m.value,M=N===R.indexOf(r);if(!O&&!M)return C.current;const L=(()=>{if(T!==N){if(O&&N!==-1)return T>N?"from-end":"from-start";if(M&&T!==-1)return T>N?"to-start":"to-end"}return null})();return C.current=L,L},[m.previousValue,m.value,m.dir,S,r]);return u.jsx(eU,{asChild:!0,children:u.jsx(mf,{id:x,"aria-labelledby":y,"data-motion":E,"data-orientation":m.orientation,...f,ref:v,disableOutsidePointerEvents:!1,onDismiss:()=>{const j=new Event(sy,{bubbles:!0,cancelable:!0});h.current?.dispatchEvent(j)},onFocusOutside:Re(e.onFocusOutside,j=>{d();const R=j.target;m.rootNavigationMenu?.contains(R)&&j.preventDefault()}),onPointerDownOutside:Re(e.onPointerDownOutside,j=>{const R=j.target,T=S().some(O=>O.ref.current?.contains(R)),N=m.isRootMenu&&m.viewport?.contains(R);(T||N||!m.isRootMenu)&&j.preventDefault()}),onKeyDown:Re(e.onKeyDown,j=>{const R=j.altKey||j.ctrlKey||j.metaKey;if(j.key==="Tab"&&!R){const N=RC(j.currentTarget),O=document.activeElement,M=N.findIndex(ee=>ee===O),K=j.shiftKey?N.slice(0,M).reverse():N.slice(M+1,N.length);AE(K)?j.preventDefault():o.current?.focus()}}),onEscapeKeyDown:Re(e.onEscapeKeyDown,j=>{a.current=!0})})})}),OE="NavigationMenuViewport",QF=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=!!Io(OE,e.__scopeNavigationMenu).value;return u.jsx(ir,{present:n||o,children:u.jsx(dfe,{...r,ref:t})})});QF.displayName=OE;var dfe=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...i}=e,o=Io(OE,n),a=ft(t,o.onViewportChange),c=nfe(zd,e.__scopeNavigationMenu),[d,f]=b.useState(null),[m,h]=b.useState(null),v=d?d?.width+"px":void 0,y=d?d?.height+"px":void 0,x=!!o.value,S=x?o.value:o.previousValue;return IC(m,()=>{m&&f({width:m.offsetWidth,height:m.offsetHeight})}),u.jsx(Ye.div,{"data-state":DE(x),"data-orientation":o.orientation,...i,ref:a,style:{pointerEvents:!x&&o.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":v,"--radix-navigation-menu-viewport-height":y,...i.style},onPointerEnter:Re(e.onPointerEnter,o.onContentEnter),onPointerLeave:Re(e.onPointerLeave,Oy(o.onContentLeave)),children:Array.from(c.items).map(([k,{ref:E,forceMount:j,...R}])=>{const T=S===k;return u.jsx(ir,{present:j||T,children:u.jsx(JF,{...R,ref:lf(E,N=>{T&&N&&h(N)})})},k)})})}),ffe="FocusGroup",eU=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Io(ffe,n);return u.jsx(kC.Provider,{scope:n,children:u.jsx(kC.Slot,{scope:n,children:u.jsx(Ye.div,{dir:i.dir,...r,ref:t})})})}),Z$=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],pfe="FocusGroupItem",tU=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Jde(n),o=Io(pfe,n);return u.jsx(kC.ItemSlot,{scope:n,children:u.jsx(Ye.button,{...r,ref:t,onKeyDown:Re(e.onKeyDown,a=>{if(["Home","End",...Z$].includes(a.key)){let d=i().map(h=>h.ref.current);if([o.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&d.reverse(),Z$.includes(a.key)){const h=d.indexOf(a.currentTarget);d=d.slice(h+1)}setTimeout(()=>AE(d)),a.preventDefault()}})})})});function RC(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 AE(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function mfe(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 IC(e,t){const n=In(t);nr(()=>{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 nU(e,t){return`${e}-trigger-${t}`}function rU(e,t){return`${e}-content-${t}`}function Oy(e){return t=>t.pointerType==="mouse"?e(t):void 0}var hfe=HF,gfe=GF,vfe=WF,yfe=XF,bfe=QF;function xfe({className:e,...t}){return u.jsx("div",{className:Ue("absolute top-full left-0 isolate z-50 flex justify-center"),children:u.jsx(bfe,{"data-slot":"navigation-menu-viewport",className:Ue("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",e),...t})})}function iU({className:e,children:t,viewport:n=!0,...r}){return u.jsxs(hfe,{"data-slot":"navigation-menu","data-viewport":n,className:Ue("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",e),...r,children:[t,n&&u.jsx(xfe,{})]})}function NC({className:e,...t}){return u.jsx(vfe,{"data-slot":"navigation-menu-item",className:Ue("relative",e),...t})}function TC({className:e,...t}){return u.jsx(yfe,{"data-slot":"navigation-menu-link",className:Ue("hover:text-white ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 flex flex-col gap-1 rounded-sm p-2 text-sm transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",e),...t})}function oU({className:e,...t}){return u.jsx(gfe,{"data-slot":"navigation-menu-list",className:Ue("group flex flex-1 list-none items-center justify-center gap-1",e),...t})}const aU=Ab("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 $E(){return u.jsx("a",{href:"https://github.com/HarperFast/studio/releases",target:"_blank",rel:"noopener noreferrer",children:u.jsxs("span",{className:Ue(aU({variant:"default"}),"text-xs inline-block ml-2 align-text-top"),children:["v4.7.13"," BETA"]})})}function eh(e,t,n){const{instanceId:r,clusterId:i}=it({strict:!1});return Qa({id:An,operationsUrl:e,port:t,secure:n})}function nx(e,t,n){const{instanceId:r,clusterId:i}=it({strict:!1});return{instanceClient:Qa({id:An,operationsUrl:e,port:t,secure:n}),entityType:"instance"}}function Zt(e,t,n){const r=it({strict:!1});return b.useMemo(()=>sU({...r,operationsUrl:e,port:t,secure:n}),[r,e,t,n])}function sU({instanceId:e,clusterId:t,operationsUrl:n,port:r,secure:i}){const o=An;return{instanceClient:Qa({id:o,operationsUrl:n,port:r,secure:i}),entityId:o,entityType:"instance"}}function wfe(){localStorage.clear()}function Sfe(){sessionStorage.clear()}async function _fe(){Et.setUserForEntity(An,null),jy.getQueryCache().clear(),wfe(),Sfe(),await jy.invalidateQueries({refetchType:"none"})}async function Cfe(e){await Et.signOutFromPotentiallyAuthenticatedInstances(),await Bm({...e,entityId:An})}function kfe(){const e=eh();return ct({mutationFn:()=>Cfe({instanceClient:e}),onSuccess:_fe})}function rx(e){const{user:t}=El(),{organizationId:n}=it({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 hf(e){const{user:t}=El(),{organizationId:n}=it({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 ix(e,t){const{user:n}=El(),{organizationId:r,clusterId:i}=it({strict:!1});return lU(n,e??r,t??i)}function lU(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 Efe(e,t){const{user:n}=El(),{organizationId:r,clusterId:i}=it({strict:!1});return cU(n,r,i)}function cU(e,t,n){const r=e?.roles?.[t];if(!r?.permission&&!r?.organization?.clusters)return{create:!1,remove:!1,update:!1,view:!1};if(r.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const i=r.organization.clusters.resources?.find(a=>a.id===n)?.instances,o=r.organization.clusters;return{create:i?i.create:o.create,remove:i?i.delete:o.delete,update:i?i.update:o.update,view:i?i.view:o.view}}function PE(e){const{clusterId:t,instanceId:n}=it({strict:!1}),{user:r}=fs(),i=r?.role?.permission;return i?i.super_user===!0:!1}function gf(e){const{clusterId:t,instanceId:n}=it({strict:!1}),{user:r}=fs(),i=r?.role?.permission;return i?i.super_user===!0||i.structure_user===!0:!1}function H_(e,t,n,r){const{clusterId:i,instanceId:o}=it({strict:!1}),{user:a}=fs(),c=a?.role?.permission;return c?c.super_user===!0||c.structure_user===!0?!0:c[t]?.tables?.[n][r]===!0:!1}const ME={className:"text-white"};function uU(){const{mutate:e}=kfe(),t=En(),{user:n}=Bc(),r=xn(),{organizationId:i}=it({strict:!1}),{update:o}=rx(i),{view:a}=hf(i),c=o,d=b.useCallback(()=>{e(void 0,{onSuccess:async()=>{we.success("Success",{description:"You have been signed out successfully.",action:{label:"Dismiss",onClick:()=>we.dismiss()}}),t({to:"/sign-in"}),r.invalidate()}})},[e,r,t]),f=b.useMemo(()=>[!hd,!hd,!hd,{to:"https://docs.harperdb.io/docs",target:"_blank",icon:u.jsx(y4,{}),text:"Docs",textBreakpoint:"md"},{to:"https://github.com/HarperFast/studio/issues",target:"_blank",icon:u.jsx(Lee,{}),text:"Report an Issue",textBreakpoint:"lg"},{to:"https://discord.gg/VzZuaw3Xay",target:"_blank",icon:u.jsx(Cde,{}),text:"Discord",textBreakpoint:"lg"},{onClick:d,icon:u.jsx(Lte,{}),text:"Sign Out",textBreakpoint:"md"}].filter(Xo),[i,c,a,d]);return n?u.jsxs(u.Fragment,{children:[u.jsx(Ife,{menuItems:f}),u.jsx(Rfe,{menuItems:f})]}):u.jsx(jfe,{})}function dU(e){return e.items!==void 0}function jfe(){return u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"inline-block",children:[u.jsx(Ze,{to:"/sign-in",children:u.jsx(jE,{})}),u.jsx($E,{})]}),u.jsx(iU,{children:u.jsxs(oU,{className:"text-grey-400",children:[u.jsx(NC,{children:u.jsx(TC,{asChild:!0,children:u.jsxs(Ze,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[u.jsx(y4,{})," ",u.jsx("span",{className:"hidden md:inline-block",children:"Docs"})]})})}),u.jsx(NC,{children:u.jsx(TC,{asChild:!0,children:u.jsxs(Ze,{to:"/sign-in",className:"flex-row items-center",activeProps:ME,children:[u.jsx(Mte,{})," Sign In"]})})})]})})]})}function Rfe({menuItems:e}){const{user:t}=Bc();return qc(t),u.jsx("div",{className:"hidden md:block",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"inline-block",children:[u.jsx(Ze,{to:ya,children:u.jsx(jE,{})}),u.jsx($E,{})]}),u.jsx(iU,{children:u.jsx(oU,{className:"text-grey-400",children:e.map(n=>dU(n)?!!n.items.length&&u.jsx("div",{className:"bg-black rounded-2xl flex",children:n.items.map(r=>u.jsx(Y$,{menuItem:r},r.text))},n.text):u.jsx(Y$,{menuItem:n},n.text))})})]})})}function Y$({menuItem:e}){return u.jsx(NC,{className:"text-gray-400 hover:text-white",children:u.jsx(TC,{asChild:!0,children:u.jsxs(Ze,{to:e.to,onClick:e.onClick,className:"flex-row items-center",target:e.target,activeProps:e.to?ME: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 Ife({menuItems:e}){const{user:t}=Bc();qc(t);const[n,r]=b.useState(!1),i=b.useCallback(()=>r(a=>!a),[]),o=b.useCallback(()=>r(!1),[]);return u.jsxs("div",{className:"md:hidden",id:"mobile-menu",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Ze,{to:ya,children:u.jsx(jE,{})}),u.jsx($E,{}),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(D4,{}):u.jsx(I4,{})]})]}),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=>dU(a)?!!a.items.length&&u.jsx("div",{className:"bg-black pl-10 pr-2 py-2",children:a.items.map(c=>u.jsx(W$,{menuItem:c,onClick:o},c.text))},a.text):u.jsx(W$,{menuItem:a,onClick:o},a.text))})]})}function W$({menuItem:e,onClick:t}){const n=b.useCallback(()=>{e.onClick?.(),t()},[e,t]);return u.jsxs(Ze,{to:e.to,onClick:n,target:e.target,className:"flex flex-row px-3 py-2 text-base font-medium rounded-md text-gray-400 hover:text-white",activeProps:e.to?ME:void 0,children:[e.icon,u.jsx("span",{className:"ml-4",children:e.text})]})}function Ap({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 Nfe(){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(uU,{})}),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(Ap,{title:"Free Tier",children:u.jsx("span",{children:"Try us out, no credit card required!"})}),u.jsx(Ap,{title:"Global Deployments Managed as One",children:u.jsx("span",{children:"Coordinate global environments as if they were a single node."})}),u.jsx(Ap,{title:"Database, App, Cache, & Messaging",children:u.jsx("span",{children:"Bring your stack together for reliable, ultra-fast performance."})}),u.jsx(Ap,{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(Ap,{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(kl,{})})]})]})}function Tfe(){b.useEffect(()=>{},[])}const Ofe=["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 zE(e){if(!e||!e.includes("@"))return null;const t=e.split("@").pop()||"";if(!t)return null;for(const n of Ofe)if(t===n||t.endsWith("."+n))return null;return t}let q_=null;function Afe(){const e=En(),t=xn(),n=rr(),{redirect:r}=Er({strict:!1});return b.useEffect(()=>{q_||(q_=(async function(){const i=await Az().catch(()=>null);if(!i)we.error("We were not able to verify your sign-in. Please try signing in again.",{duration:1e4}),await e({to:"/sign-in"});else{Et.setUserForEntity(An,i);const o=qc(i);zE(i.email),await n.invalidateQueries({queryKey:Rb,refetchType:"none"}),await t.invalidate(),await e({to:r?.startsWith("/")?r:o})}q_=null})())},[]),u.jsxs("div",{className:"text-white w-lg flex flex-col gap-4",children:[u.jsxs("h1",{className:"text-3xl font-light",children:[u.jsx("span",{"aria-hidden":"true",className:"text-2xl animate-flower-dance mr-4",title:"Loading",children:"🌼"}),"Checking..."]}),u.jsx("div",{className:"underline flex gap-4",children:u.jsx(Ze,{className:"text-sm opacity-50 hover:text-blue-300",to:"/sign-in",children:"Try signing in again"})})]})}const Dfe=["top","right","bottom","left"],yl=Math.min,Mi=Math.max,Ay=Math.round,wv=Math.floor,va=e=>({x:e,y:e}),$fe={left:"right",right:"left",bottom:"top",top:"bottom"},Pfe={start:"end",end:"start"};function OC(e,t,n){return Mi(e,yl(t,n))}function as(e,t){return typeof e=="function"?e(t):e}function ss(e){return e.split("-")[0]}function vf(e){return e.split("-")[1]}function LE(e){return e==="x"?"y":"x"}function FE(e){return e==="y"?"height":"width"}const Mfe=new Set(["top","bottom"]);function da(e){return Mfe.has(ss(e))?"y":"x"}function UE(e){return LE(da(e))}function zfe(e,t,n){n===void 0&&(n=!1);const r=vf(e),i=UE(e),o=FE(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Dy(a)),[a,Dy(a)]}function Lfe(e){const t=Dy(e);return[AC(e),t,AC(t)]}function AC(e){return e.replace(/start|end/g,t=>Pfe[t])}const X$=["left","right"],J$=["right","left"],Ffe=["top","bottom"],Ufe=["bottom","top"];function Vfe(e,t,n){switch(e){case"top":case"bottom":return n?t?J$:X$:t?X$:J$;case"left":case"right":return t?Ffe:Ufe;default:return[]}}function Bfe(e,t,n,r){const i=vf(e);let o=Vfe(ss(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(AC)))),o}function Dy(e){return e.replace(/left|right|bottom|top/g,t=>$fe[t])}function Hfe(e){return{top:0,right:0,bottom:0,left:0,...e}}function fU(e){return typeof e!="number"?Hfe(e):{top:e,right:e,bottom:e,left:e}}function $y(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 Q$(e,t,n){let{reference:r,floating:i}=e;const o=da(t),a=UE(t),c=FE(a),d=ss(t),f=o==="y",m=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:m,y:r.y-i.height};break;case"bottom":y={x:m,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:h};break;case"left":y={x:r.x-i.width,y:h};break;default:y={x:r.x,y:r.y}}switch(vf(t)){case"start":y[a]-=v*(n&&f?-1:1);break;case"end":y[a]+=v*(n&&f?-1:1);break}return y}const qfe=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:m,y:h}=Q$(f,r,d),v=r,y={},x=0;for(let S=0;S<c.length;S++){const{name:C,fn:k}=c[S],{x:E,y:j,data:R,reset:T}=await k({x:m,y:h,initialPlacement:r,placement:v,strategy:i,middlewareData:y,rects:f,platform:a,elements:{reference:e,floating:t}});m=E??m,h=j??h,y={...y,[C]:{...y[C],...R}},T&&x<=50&&(x++,typeof T=="object"&&(T.placement&&(v=T.placement),T.rects&&(f=T.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):T.rects),{x:m,y:h}=Q$(f,v,d)),S=-1)}return{x:m,y:h,placement:v,strategy:i,middlewareData:y}};async function wm(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:v=!1,padding:y=0}=as(t,e),x=fU(y),C=c[v?h==="floating"?"reference":"floating":h],k=$y(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:m,strategy:d})),E=h==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,j=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),R=await(o.isElement==null?void 0:o.isElement(j))?await(o.getScale==null?void 0:o.getScale(j))||{x:1,y:1}:{x:1,y:1},T=$y(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:E,offsetParent:j,strategy:d}):E);return{top:(k.top-T.top+x.top)/R.y,bottom:(T.bottom-k.bottom+x.bottom)/R.y,left:(k.left-T.left+x.left)/R.x,right:(T.right-k.right+x.right)/R.x}}const Kfe=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:m=0}=as(e,t)||{};if(f==null)return{};const h=fU(m),v={x:n,y:r},y=UE(i),x=FE(y),S=await a.getDimensions(f),C=y==="y",k=C?"top":"left",E=C?"bottom":"right",j=C?"clientHeight":"clientWidth",R=o.reference[x]+o.reference[y]-v[y]-o.floating[x],T=v[y]-o.reference[y],N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let O=N?N[j]:0;(!O||!await(a.isElement==null?void 0:a.isElement(N)))&&(O=c.floating[j]||o.floating[x]);const M=R/2-T/2,L=O/2-S[x]/2-1,K=yl(h[k],L),ee=yl(h[E],L),q=K,Y=O-S[x]-ee,U=O/2-S[x]/2+M,H=OC(q,U,Y),z=!d.arrow&&vf(i)!=null&&U!==H&&o.reference[x]/2-(U<q?K:ee)-S[x]/2<0,W=z?U<q?U-q:U-Y:0;return{[y]:v[y]+W,data:{[y]:H,centerOffset:U-H-W,...z&&{alignmentOffset:W}},reset:z}}}),Gfe=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:m=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:S=!0,...C}=as(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const k=ss(i),E=da(c),j=ss(c)===c,R=await(d.isRTL==null?void 0:d.isRTL(f.floating)),T=v||(j||!S?[Dy(c)]:Lfe(c)),N=x!=="none";!v&&N&&T.push(...Bfe(c,S,x,R));const O=[c,...T],M=await wm(t,C),L=[];let K=((r=o.flip)==null?void 0:r.overflows)||[];if(m&&L.push(M[k]),h){const U=zfe(i,a,R);L.push(M[U[0]],M[U[1]])}if(K=[...K,{placement:i,overflows:L}],!L.every(U=>U<=0)){var ee,q;const U=(((ee=o.flip)==null?void 0:ee.index)||0)+1,H=O[U];if(H&&(!(h==="alignment"?E!==da(H):!1)||K.every(F=>da(F.placement)===E?F.overflows[0]>0:!0)))return{data:{index:U,overflows:K},reset:{placement:H}};let z=(q=K.filter(W=>W.overflows[0]<=0).sort((W,F)=>W.overflows[1]-F.overflows[1])[0])==null?void 0:q.placement;if(!z)switch(y){case"bestFit":{var Y;const W=(Y=K.filter(F=>{if(N){const te=da(F.placement);return te===E||te==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(te=>te>0).reduce((te,D)=>te+D,0)]).sort((F,te)=>F[1]-te[1])[0])==null?void 0:Y[0];W&&(z=W);break}case"initialPlacement":z=c;break}if(i!==z)return{reset:{placement:z}}}return{}}}};function e2(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function t2(e){return Dfe.some(t=>e[t]>=0)}const Zfe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=as(e,t);switch(r){case"referenceHidden":{const o=await wm(t,{...i,elementContext:"reference"}),a=e2(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:t2(a)}}}case"escaped":{const o=await wm(t,{...i,altBoundary:!0}),a=e2(o,n.floating);return{data:{escapedOffsets:a,escaped:t2(a)}}}default:return{}}}}},pU=new Set(["left","top"]);async function Yfe(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=ss(n),c=vf(n),d=da(n)==="y",f=pU.has(a)?-1:1,m=o&&d?-1:1,h=as(t,e);let{mainAxis:v,crossAxis:y,alignmentAxis:x}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof x=="number"&&(y=c==="end"?x*-1:x),d?{x:y*m,y:v*f}:{x:v*f,y:y*m}}const Wfe=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 Yfe(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}}}}},Xfe=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:k,y:E}=C;return{x:k,y:E}}},...d}=as(e,t),f={x:n,y:r},m=await wm(t,d),h=da(ss(i)),v=LE(h);let y=f[v],x=f[h];if(o){const C=v==="y"?"top":"left",k=v==="y"?"bottom":"right",E=y+m[C],j=y-m[k];y=OC(E,y,j)}if(a){const C=h==="y"?"top":"left",k=h==="y"?"bottom":"right",E=x+m[C],j=x-m[k];x=OC(E,x,j)}const S=c.fn({...t,[v]:y,[h]:x});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[v]:o,[h]:a}}}}}},Jfe=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}=as(e,t),m={x:n,y:r},h=da(i),v=LE(h);let y=m[v],x=m[h];const S=as(c,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(d){const j=v==="y"?"height":"width",R=o.reference[v]-o.floating[j]+C.mainAxis,T=o.reference[v]+o.reference[j]-C.mainAxis;y<R?y=R:y>T&&(y=T)}if(f){var k,E;const j=v==="y"?"width":"height",R=pU.has(ss(i)),T=o.reference[h]-o.floating[j]+(R&&((k=a.offset)==null?void 0:k[h])||0)+(R?0:C.crossAxis),N=o.reference[h]+o.reference[j]+(R?0:((E=a.offset)==null?void 0:E[h])||0)-(R?C.crossAxis:0);x<T?x=T:x>N&&(x=N)}return{[v]:y,[h]:x}}}},Qfe=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}=as(e,t),m=await wm(t,f),h=ss(i),v=vf(i),y=da(i)==="y",{width:x,height:S}=o.floating;let C,k;h==="top"||h==="bottom"?(C=h,k=v===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(k=h,C=v==="end"?"top":"bottom");const E=S-m.top-m.bottom,j=x-m.left-m.right,R=yl(S-m[C],E),T=yl(x-m[k],j),N=!t.middlewareData.shift;let O=R,M=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=j),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=E),N&&!v){const K=Mi(m.left,0),ee=Mi(m.right,0),q=Mi(m.top,0),Y=Mi(m.bottom,0);y?M=x-2*(K!==0||ee!==0?K+ee:Mi(m.left,m.right)):O=S-2*(q!==0||Y!==0?q+Y:Mi(m.top,m.bottom))}await d({...t,availableWidth:M,availableHeight:O});const L=await a.getDimensions(c.floating);return x!==L.width||S!==L.height?{reset:{rects:!0}}:{}}}};function ox(){return typeof window<"u"}function yf(e){return mU(e)?(e.nodeName||"").toLowerCase():"#document"}function Ui(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ka(e){var t;return(t=(mU(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function mU(e){return ox()?e instanceof Node||e instanceof Ui(e).Node:!1}function Ko(e){return ox()?e instanceof Element||e instanceof Ui(e).Element:!1}function Sa(e){return ox()?e instanceof HTMLElement||e instanceof Ui(e).HTMLElement:!1}function n2(e){return!ox()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ui(e).ShadowRoot}const epe=new Set(["inline","contents"]);function th(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Go(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!epe.has(i)}const tpe=new Set(["table","td","th"]);function npe(e){return tpe.has(yf(e))}const rpe=[":popover-open",":modal"];function ax(e){return rpe.some(t=>{try{return e.matches(t)}catch{return!1}})}const ipe=["transform","translate","scale","rotate","perspective"],ope=["transform","translate","scale","rotate","perspective","filter"],ape=["paint","layout","strict","content"];function VE(e){const t=BE(),n=Ko(e)?Go(e):e;return ipe.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)||ope.some(r=>(n.willChange||"").includes(r))||ape.some(r=>(n.contain||"").includes(r))}function spe(e){let t=bl(e);for(;Sa(t)&&!Ld(t);){if(VE(t))return t;if(ax(t))return null;t=bl(t)}return null}function BE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const lpe=new Set(["html","body","#document"]);function Ld(e){return lpe.has(yf(e))}function Go(e){return Ui(e).getComputedStyle(e)}function sx(e){return Ko(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bl(e){if(yf(e)==="html")return e;const t=e.assignedSlot||e.parentNode||n2(e)&&e.host||ka(e);return n2(t)?t.host:t}function hU(e){const t=bl(e);return Ld(t)?e.ownerDocument?e.ownerDocument.body:e.body:Sa(t)&&th(t)?t:hU(t)}function Sm(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=hU(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=Ui(i);if(o){const c=DC(a);return t.concat(a,a.visualViewport||[],th(i)?i:[],c&&n?Sm(c):[])}return t.concat(i,Sm(i,[],n))}function DC(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gU(e){const t=Go(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Sa(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,c=Ay(n)!==o||Ay(r)!==a;return c&&(n=o,r=a),{width:n,height:r,$:c}}function HE(e){return Ko(e)?e:e.contextElement}function xd(e){const t=HE(e);if(!Sa(t))return va(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=gU(t);let a=(o?Ay(n.width):n.width)/r,c=(o?Ay(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const cpe=va(0);function vU(e){const t=Ui(e);return!BE()||!t.visualViewport?cpe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function upe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ui(e)?!1:t}function Ac(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=HE(e);let a=va(1);t&&(r?Ko(r)&&(a=xd(r)):a=xd(e));const c=upe(o,n,r)?vU(o):va(0);let d=(i.left+c.x)/a.x,f=(i.top+c.y)/a.y,m=i.width/a.x,h=i.height/a.y;if(o){const v=Ui(o),y=r&&Ko(r)?Ui(r):r;let x=v,S=DC(x);for(;S&&r&&y!==x;){const C=xd(S),k=S.getBoundingClientRect(),E=Go(S),j=k.left+(S.clientLeft+parseFloat(E.paddingLeft))*C.x,R=k.top+(S.clientTop+parseFloat(E.paddingTop))*C.y;d*=C.x,f*=C.y,m*=C.x,h*=C.y,d+=j,f+=R,x=Ui(S),S=DC(x)}}return $y({width:m,height:h,x:d,y:f})}function lx(e,t){const n=sx(e).scrollLeft;return t?t.left+n:Ac(ka(e)).left+n}function yU(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-lx(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function dpe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=ka(r),c=t?ax(t.floating):!1;if(r===a||c&&o)return n;let d={scrollLeft:0,scrollTop:0},f=va(1);const m=va(0),h=Sa(r);if((h||!h&&!o)&&((yf(r)!=="body"||th(a))&&(d=sx(r)),Sa(r))){const y=Ac(r);f=xd(r),m.x=y.x+r.clientLeft,m.y=y.y+r.clientTop}const v=a&&!h&&!o?yU(a,d):va(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+m.x+v.x,y:n.y*f.y-d.scrollTop*f.y+m.y+v.y}}function fpe(e){return Array.from(e.getClientRects())}function ppe(e){const t=ka(e),n=sx(e),r=e.ownerDocument.body,i=Mi(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Mi(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+lx(e);const c=-n.scrollTop;return Go(r).direction==="rtl"&&(a+=Mi(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:c}}const r2=25;function mpe(e,t){const n=Ui(e),r=ka(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,c=0,d=0;if(i){o=i.width,a=i.height;const m=BE();(!m||m&&t==="fixed")&&(c=i.offsetLeft,d=i.offsetTop)}const f=lx(r);if(f<=0){const m=r.ownerDocument,h=m.body,v=getComputedStyle(h),y=m.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,x=Math.abs(r.clientWidth-h.clientWidth-y);x<=r2&&(o-=x)}else f<=r2&&(o+=f);return{width:o,height:a,x:c,y:d}}const hpe=new Set(["absolute","fixed"]);function gpe(e,t){const n=Ac(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Sa(e)?xd(e):va(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 i2(e,t,n){let r;if(t==="viewport")r=mpe(e,n);else if(t==="document")r=ppe(ka(e));else if(Ko(t))r=gpe(t,n);else{const i=vU(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return $y(r)}function bU(e,t){const n=bl(e);return n===t||!Ko(n)||Ld(n)?!1:Go(n).position==="fixed"||bU(n,t)}function vpe(e,t){const n=t.get(e);if(n)return n;let r=Sm(e,[],!1).filter(c=>Ko(c)&&yf(c)!=="body"),i=null;const o=Go(e).position==="fixed";let a=o?bl(e):e;for(;Ko(a)&&!Ld(a);){const c=Go(a),d=VE(a);!d&&c.position==="fixed"&&(i=null),(o?!d&&!i:!d&&c.position==="static"&&!!i&&hpe.has(i.position)||th(a)&&!d&&bU(e,a))?r=r.filter(m=>m!==a):i=c,a=bl(a)}return t.set(e,r),r}function ype(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?ax(t)?[]:vpe(t,this._c):[].concat(n),r],c=a[0],d=a.reduce((f,m)=>{const h=i2(t,m,i);return f.top=Mi(h.top,f.top),f.right=yl(h.right,f.right),f.bottom=yl(h.bottom,f.bottom),f.left=Mi(h.left,f.left),f},i2(t,c,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function bpe(e){const{width:t,height:n}=gU(e);return{width:t,height:n}}function xpe(e,t,n){const r=Sa(t),i=ka(t),o=n==="fixed",a=Ac(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const d=va(0);function f(){d.x=lx(i)}if(r||!r&&!o)if((yf(t)!=="body"||th(i))&&(c=sx(t)),r){const y=Ac(t,!0,o,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}else i&&f();o&&!r&&i&&f();const m=i&&!r&&!o?yU(i,c):va(0),h=a.left+c.scrollLeft-d.x-m.x,v=a.top+c.scrollTop-d.y-m.y;return{x:h,y:v,width:a.width,height:a.height}}function K_(e){return Go(e).position==="static"}function o2(e,t){if(!Sa(e)||Go(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ka(e)===n&&(n=n.ownerDocument.body),n}function xU(e,t){const n=Ui(e);if(ax(e))return n;if(!Sa(e)){let i=bl(e);for(;i&&!Ld(i);){if(Ko(i)&&!K_(i))return i;i=bl(i)}return n}let r=o2(e,t);for(;r&&npe(r)&&K_(r);)r=o2(r,t);return r&&Ld(r)&&K_(r)&&!VE(r)?n:r||spe(e)||n}const wpe=async function(e){const t=this.getOffsetParent||xU,n=this.getDimensions,r=await n(e.floating);return{reference:xpe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Spe(e){return Go(e).direction==="rtl"}const _pe={convertOffsetParentRelativeRectToViewportRelativeRect:dpe,getDocumentElement:ka,getClippingRect:ype,getOffsetParent:xU,getElementRects:wpe,getClientRects:fpe,getDimensions:bpe,getScale:xd,isElement:Ko,isRTL:Spe};function wU(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Cpe(e,t){let n=null,r;const i=ka(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:m,top:h,width:v,height:y}=f;if(c||t(),!v||!y)return;const x=wv(h),S=wv(i.clientWidth-(m+v)),C=wv(i.clientHeight-(h+y)),k=wv(m),j={rootMargin:-x+"px "+-S+"px "+-C+"px "+-k+"px",threshold:Mi(0,yl(1,d))||1};let R=!0;function T(N){const O=N[0].intersectionRatio;if(O!==d){if(!R)return a();O?a(!1,O):r=setTimeout(()=>{a(!1,1e-7)},1e3)}O===1&&!wU(f,e.getBoundingClientRect())&&a(),R=!1}try{n=new IntersectionObserver(T,{...j,root:i.ownerDocument})}catch{n=new IntersectionObserver(T,j)}n.observe(e)}return a(!0),o}function kpe(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=HE(e),m=i||o?[...f?Sm(f):[],...Sm(t)]:[];m.forEach(k=>{i&&k.addEventListener("scroll",n,{passive:!0}),o&&k.addEventListener("resize",n)});const h=f&&c?Cpe(f,n):null;let v=-1,y=null;a&&(y=new ResizeObserver(k=>{let[E]=k;E&&E.target===f&&y&&(y.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var j;(j=y)==null||j.observe(t)})),n()}),f&&!d&&y.observe(f),y.observe(t));let x,S=d?Ac(e):null;d&&C();function C(){const k=Ac(e);S&&!wU(S,k)&&n(),S=k,x=requestAnimationFrame(C)}return n(),()=>{var k;m.forEach(E=>{i&&E.removeEventListener("scroll",n),o&&E.removeEventListener("resize",n)}),h?.(),(k=y)==null||k.disconnect(),y=null,d&&cancelAnimationFrame(x)}}const Epe=Wfe,jpe=Xfe,Rpe=Gfe,Ipe=Qfe,Npe=Zfe,a2=Kfe,Tpe=Jfe,Ope=(e,t,n)=>{const r=new Map,i={platform:_pe,...n},o={...i.platform,_c:r};return qfe(e,t,{...i,platform:o})};var Ape=typeof document<"u",Dpe=function(){},ly=Ape?b.useLayoutEffect:Dpe;function Py(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(!Py(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)&&!Py(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function SU(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function s2(e,t){const n=SU(e);return Math.round(t*n)/n}function G_(e){const t=b.useRef(e);return ly(()=>{t.current=e}),t}function $pe(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,[m,h]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,y]=b.useState(r);Py(v,r)||y(r);const[x,S]=b.useState(null),[C,k]=b.useState(null),E=b.useCallback(F=>{F!==N.current&&(N.current=F,S(F))},[]),j=b.useCallback(F=>{F!==O.current&&(O.current=F,k(F))},[]),R=o||x,T=a||C,N=b.useRef(null),O=b.useRef(null),M=b.useRef(m),L=d!=null,K=G_(d),ee=G_(i),q=G_(f),Y=b.useCallback(()=>{if(!N.current||!O.current)return;const F={placement:t,strategy:n,middleware:v};ee.current&&(F.platform=ee.current),Ope(N.current,O.current,F).then(te=>{const D={...te,isPositioned:q.current!==!1};U.current&&!Py(M.current,D)&&(M.current=D,of.flushSync(()=>{h(D)}))})},[v,t,n,ee,q]);ly(()=>{f===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,h(F=>({...F,isPositioned:!1})))},[f]);const U=b.useRef(!1);ly(()=>(U.current=!0,()=>{U.current=!1}),[]),ly(()=>{if(R&&(N.current=R),T&&(O.current=T),R&&T){if(K.current)return K.current(R,T,Y);Y()}},[R,T,Y,K,L]);const H=b.useMemo(()=>({reference:N,floating:O,setReference:E,setFloating:j}),[E,j]),z=b.useMemo(()=>({reference:R,floating:T}),[R,T]),W=b.useMemo(()=>{const F={position:n,left:0,top:0};if(!z.floating)return F;const te=s2(z.floating,m.x),D=s2(z.floating,m.y);return c?{...F,transform:"translate("+te+"px, "+D+"px)",...SU(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:te,top:D}},[n,c,z.floating,m.x,m.y]);return b.useMemo(()=>({...m,update:Y,refs:H,elements:z,floatingStyles:W}),[m,Y,H,z,W])}const Ppe=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?a2({element:r.current,padding:i}).fn(n):{}:r?a2({element:r,padding:i}).fn(n):{}}}},Mpe=(e,t)=>({...Epe(e),options:[e,t]}),zpe=(e,t)=>({...jpe(e),options:[e,t]}),Lpe=(e,t)=>({...Tpe(e),options:[e,t]}),Fpe=(e,t)=>({...Rpe(e),options:[e,t]}),Upe=(e,t)=>({...Ipe(e),options:[e,t]}),Vpe=(e,t)=>({...Npe(e),options:[e,t]}),Bpe=(e,t)=>({...Ppe(e),options:[e,t]});var Hpe="Arrow",_U=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return u.jsx(Ye.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});_U.displayName=Hpe;var qpe=_U;function CU(e){const[t,n]=b.useState(void 0);return nr(()=>{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 qE="Popper",[kU,bf]=Xi(qE),[Kpe,EU]=kU(qE),jU=e=>{const{__scopePopper:t,children:n}=e,[r,i]=b.useState(null);return u.jsx(Kpe,{scope:t,anchor:r,onAnchorChange:i,children:n})};jU.displayName=qE;var RU="PopperAnchor",IU=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=EU(RU,n),a=b.useRef(null),c=ft(t,a),d=b.useRef(null);return b.useEffect(()=>{const f=d.current;d.current=r?.current||a.current,f!==d.current&&o.onAnchorChange(d.current)}),r?null:u.jsx(Ye.div,{...i,ref:c})});IU.displayName=RU;var KE="PopperContent",[Gpe,Zpe]=kU(KE),NU=b.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:m=0,sticky:h="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:x,...S}=e,C=EU(KE,n),[k,E]=b.useState(null),j=ft(t,B=>E(B)),[R,T]=b.useState(null),N=CU(R),O=N?.width??0,M=N?.height??0,L=r+(o!=="center"?"-"+o:""),K=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},ee=Array.isArray(f)?f:[f],q=ee.length>0,Y={padding:K,boundary:ee.filter(Wpe),altBoundary:q},{refs:U,floatingStyles:H,placement:z,isPositioned:W,middlewareData:F}=$pe({strategy:"fixed",placement:L,whileElementsMounted:(...B)=>kpe(...B,{animationFrame:y==="always"}),elements:{reference:C.anchor},middleware:[Mpe({mainAxis:i+M,alignmentAxis:a}),d&&zpe({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Lpe():void 0,...Y}),d&&Fpe({...Y}),Upe({...Y,apply:({elements:B,rects:se,availableWidth:_e,availableHeight:Ie})=>{const{width:Fe,height:Le}=se.reference,We=B.floating.style;We.setProperty("--radix-popper-available-width",`${_e}px`),We.setProperty("--radix-popper-available-height",`${Ie}px`),We.setProperty("--radix-popper-anchor-width",`${Fe}px`),We.setProperty("--radix-popper-anchor-height",`${Le}px`)}}),R&&Bpe({element:R,padding:c}),Xpe({arrowWidth:O,arrowHeight:M}),v&&Vpe({strategy:"referenceHidden",...Y})]}),[te,D]=AU(z),$=In(x);nr(()=>{W&&$?.()},[W,$]);const V=F.arrow?.x,A=F.arrow?.y,J=F.arrow?.centerOffset!==0,[fe,ge]=b.useState();return nr(()=>{k&&ge(window.getComputedStyle(k).zIndex)},[k]),u.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:W?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(Gpe,{scope:n,placedSide:te,onArrowChange:T,arrowX:V,arrowY:A,shouldHideArrow:J,children:u.jsx(Ye.div,{"data-side":te,"data-align":D,...S,ref:j,style:{...S.style,animation:W?void 0:"none"}})})})});NU.displayName=KE;var TU="PopperArrow",Ype={top:"bottom",right:"left",bottom:"top",left:"right"},OU=b.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=Zpe(TU,r),a=Ype[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(qpe,{...i,ref:n,style:{...i.style,display:"block"}})})});OU.displayName=TU;function Wpe(e){return e!==null}var Xpe=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,m]=AU(n),h={start:"0%",center:"50%",end:"100%"}[m],v=(i.arrow?.x??0)+c/2,y=(i.arrow?.y??0)+d/2;let x="",S="";return f==="bottom"?(x=a?h:`${v}px`,S=`${-d}px`):f==="top"?(x=a?h:`${v}px`,S=`${r.floating.height+d}px`):f==="right"?(x=`${-d}px`,S=a?h:`${y}px`):f==="left"&&(x=`${r.floating.width+d}px`,S=a?h:`${y}px`),{data:{x,y:S}}}});function AU(e){const[t,n="center"]=e.split("-");return[t,n]}var GE=jU,ZE=IU,YE=NU,WE=OU,Jpe="Portal",nh=b.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=b.useState(!1);nr(()=>o(!0),[]);const a=n||i&&globalThis?.document?.body;return a?tE.createPortal(u.jsx(Ye.div,{...r,ref:t}),a):null});nh.displayName=Jpe;var[cx]=Xi("Tooltip",[bf]),ux=bf(),DU="TooltipProvider",Qpe=700,$C="tooltip.open",[eme,XE]=cx(DU),$U=e=>{const{__scopeTooltip:t,delayDuration:n=Qpe,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,a=b.useRef(!0),c=b.useRef(!1),d=b.useRef(0);return b.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),u.jsx(eme,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(d.current),a.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:b.useCallback(f=>{c.current=f},[]),disableHoverableContent:i,children:o})};$U.displayName=DU;var _m="Tooltip",[tme,rh]=cx(_m),PU=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:a,delayDuration:c}=e,d=XE(_m,e.__scopeTooltip),f=ux(t),[m,h]=b.useState(null),v=Fi(),y=b.useRef(0),x=a??d.disableHoverableContent,S=c??d.delayDuration,C=b.useRef(!1),[k,E]=qo({prop:r,defaultProp:i??!1,onChange:O=>{O?(d.onOpen(),document.dispatchEvent(new CustomEvent($C))):d.onClose(),o?.(O)},caller:_m}),j=b.useMemo(()=>k?C.current?"delayed-open":"instant-open":"closed",[k]),R=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C.current=!1,E(!0)},[E]),T=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,E(!1)},[E]),N=b.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{C.current=!0,E(!0),y.current=0},S)},[S,E]);return b.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),u.jsx(GE,{...f,children:u.jsx(tme,{scope:t,contentId:v,open:k,stateAttribute:j,trigger:m,onTriggerChange:h,onTriggerEnter:b.useCallback(()=>{d.isOpenDelayedRef.current?N():R()},[d.isOpenDelayedRef,N,R]),onTriggerLeave:b.useCallback(()=>{x?T():(window.clearTimeout(y.current),y.current=0)},[T,x]),onOpen:R,onClose:T,disableHoverableContent:x,children:n})})};PU.displayName=_m;var PC="TooltipTrigger",MU=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=rh(PC,n),o=XE(PC,n),a=ux(n),c=b.useRef(null),d=ft(t,c,i.onTriggerChange),f=b.useRef(!1),m=b.useRef(!1),h=b.useCallback(()=>f.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),u.jsx(ZE,{asChild:!0,...a,children:u.jsx(Ye.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:d,onPointerMove:Re(e.onPointerMove,v=>{v.pointerType!=="touch"&&!m.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),m.current=!0)}),onPointerLeave:Re(e.onPointerLeave,()=>{i.onTriggerLeave(),m.current=!1}),onPointerDown:Re(e.onPointerDown,()=>{i.open&&i.onClose(),f.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Re(e.onFocus,()=>{f.current||i.onOpen()}),onBlur:Re(e.onBlur,i.onClose),onClick:Re(e.onClick,i.onClose)})})});MU.displayName=PC;var JE="TooltipPortal",[nme,rme]=cx(JE,{forceMount:void 0}),zU=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=rh(JE,t);return u.jsx(nme,{scope:t,forceMount:n,children:u.jsx(ir,{present:n||o.open,children:u.jsx(nh,{asChild:!0,container:i,children:r})})})};zU.displayName=JE;var Fd="TooltipContent",LU=b.forwardRef((e,t)=>{const n=rme(Fd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=rh(Fd,e.__scopeTooltip);return u.jsx(ir,{present:r||a.open,children:a.disableHoverableContent?u.jsx(FU,{side:i,...o,ref:t}):u.jsx(ime,{side:i,...o,ref:t})})}),ime=b.forwardRef((e,t)=>{const n=rh(Fd,e.__scopeTooltip),r=XE(Fd,e.__scopeTooltip),i=b.useRef(null),o=ft(t,i),[a,c]=b.useState(null),{trigger:d,onClose:f}=n,m=i.current,{onPointerInTransitChange:h}=r,v=b.useCallback(()=>{c(null),h(!1)},[h]),y=b.useCallback((x,S)=>{const C=x.currentTarget,k={x:x.clientX,y:x.clientY},E=lme(k,C.getBoundingClientRect()),j=cme(k,E),R=ume(S.getBoundingClientRect()),T=fme([...j,...R]);c(T),h(!0)},[h]);return b.useEffect(()=>()=>v(),[v]),b.useEffect(()=>{if(d&&m){const x=C=>y(C,m),S=C=>y(C,d);return d.addEventListener("pointerleave",x),m.addEventListener("pointerleave",S),()=>{d.removeEventListener("pointerleave",x),m.removeEventListener("pointerleave",S)}}},[d,m,y,v]),b.useEffect(()=>{if(a){const x=S=>{const C=S.target,k={x:S.clientX,y:S.clientY},E=d?.contains(C)||m?.contains(C),j=!dme(k,a);E?v():j&&(v(),f())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[d,m,a,f,v]),u.jsx(FU,{...e,ref:o})}),[ome,ame]=cx(_m,{isInside:!1}),sme=Rde("TooltipContent"),FU=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...c}=e,d=rh(Fd,n),f=ux(n),{onClose:m}=d;return b.useEffect(()=>(document.addEventListener($C,m),()=>document.removeEventListener($C,m)),[m]),b.useEffect(()=>{if(d.trigger){const h=v=>{v.target?.contains(d.trigger)&&m()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[d.trigger,m]),u.jsx(mf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:m,children:u.jsxs(YE,{"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(sme,{children:r}),u.jsx(ome,{scope:n,isInside:!0,children:u.jsx(VF,{id:d.contentId,role:"tooltip",children:i||r})})]})})});LU.displayName=Fd;var UU="TooltipArrow",VU=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=ux(n);return ame(UU,n).isInside?null:u.jsx(WE,{...i,...r,ref:t})});VU.displayName=UU;function lme(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 cme(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 ume(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 dme(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,m=c.y,h=d.x,v=d.y;m>r!=v>r&&n<(h-f)*(r-m)/(v-m)+f&&(i=!i)}return i}function fme(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),pme(t)}function pme(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 mme=$U,hme=PU,gme=MU,vme=zU,yme=LU,bme=VU;function xme({delayDuration:e=0,...t}){return u.jsx(mme,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function dx({...e}){return u.jsx(xme,{children:u.jsx(hme,{"data-slot":"tooltip",...e})})}function fx({...e}){return u.jsx(gme,{"data-slot":"tooltip-trigger",...e})}function px({className:e,sideOffset:t=0,arrowClassName:n,children:r,...i}){return u.jsx(vme,{children:u.jsxs(yme,{"data-slot":"tooltip-content",sideOffset:t,className:Ue("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...i,children:[r,u.jsx(bme,{className:Ue("bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",n)})]})})}const Dp=new Map;function bo(e){if(!e)return"";if(Dp.has(e))return Dp.get(e);const t=e.replace(/[-_]+/g," ").replace(/\s+/g," ").trim();if(!t)return Dp.set(e,""),"";const n=t.match(/([A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+|[0-9]+)/g);if(!n)return Dp.set(e,""),"";const r=[];for(let a=0;a<n.length;a++){const 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(wme).join(" ");return Dp.set(e,o),o}function wme(e){return/^[A-Z]{2,3}s?$/.test(e)||/^[0-9]+$/.test(e)?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function mx({restartRequired:e}){const t=xQ(),{organization:n,instance:r,cluster:i}=qm({strict:!1}),o="Instance",a=b.useMemo(()=>{const c=t.pathname.split("/").filter(f=>f&&f.length>0),d=[u.jsxs(Ze,{to:"/",children:[u.jsx(Ite,{"aria-hidden":"true",className:"size-5 shrink-0"}),u.jsx("span",{className:"sr-only",children:"Home"})]},"home")];for(let f=0;f<c.length;f++){const m=c[f];if(m==="instance")continue;let h=`/${c.slice(0,f+1).join("/")}`,v=bo(m),y;m==="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(Ze,{to:h,className:"text-xs md:text-sm font-medium hover:text-grey truncate max-w-48",children:[v,y]}))}return d},[t.pathname,i?.name,r?.name,n?.name]);return u.jsxs("div",{role:"list",className:"flex items-center space-x-2 xl:space-x-4 sm:max-w-9/10 max-w-[calc(100%-56px)]",children:[...a,e&&u.jsxs(dx,{children:[u.jsx(fx,{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(px,{side:"bottom",children:["This ",o," is requesting a restart, when convenient, to apply your latest changes.",u.jsx("br",{}),"You can do this from the Apps or Config pages."]})]})]})}var ih=e=>e.type==="checkbox",gc=e=>e instanceof Date,hi=e=>e==null;const BU=e=>typeof e=="object";var tr=e=>!hi(e)&&!Array.isArray(e)&&BU(e)&&!gc(e),HU=e=>tr(e)&&e.target?ih(e.target)?e.target.checked:e.target.value:e,Sme=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,qU=(e,t)=>e.has(Sme(t)),_me=e=>{const t=e.constructor&&e.constructor.prototype;return tr(t)&&t.hasOwnProperty("isPrototypeOf")},QE=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function kn(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(!(QE&&(e instanceof Blob||r))&&(n||tr(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!_me(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=kn(e[i]));else return e;return t}var hx=e=>/^\w*$/.test(e),yn=e=>e===void 0,gx=e=>Array.isArray(e)?e.filter(Boolean):[],ej=e=>gx(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Pe=(e,t,n)=>{if(!t||!tr(e))return n;const r=(hx(t)?[t]:ej(t)).reduce((i,o)=>hi(i)?i:i[o],e);return yn(r)||r===e?yn(e[t])?n:e[t]:r},$i=e=>typeof e=="boolean",qt=(e,t,n)=>{let r=-1;const i=hx(t)?[t]:ej(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=tr(f)||Array.isArray(f)?f:isNaN(+i[r+1])?{}:[]}if(c==="__proto__"||c==="constructor"||c==="prototype")return;e[c]=d,e=e[c]}};const My={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},xo={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Za={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},tj=Q.createContext(null);tj.displayName="HookFormContext";const oh=()=>Q.useContext(tj),Cme=e=>{const{children:t,...n}=e;return Q.createElement(tj.Provider,{value:n},t)};var KU=(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]!==xo.all&&(t._proxyFormState[a]=!r||xo.all),n&&(n[a]=!0),e[a]}});return i};const vx=typeof window<"u"?Q.useLayoutEffect:Q.useEffect;function nj(e){const t=oh(),{control:n=t.control,disabled:r,name:i,exact:o}=e||{},[a,c]=Q.useState(n._formState),d=Q.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return vx(()=>n._subscribe({name:i,formState:d.current,exact:o,callback:f=>{!r&&c({...n._formState,...f})}}),[i,r,o]),Q.useEffect(()=>{d.current.isValid&&n._setValid(!0)},[n]),Q.useMemo(()=>KU(a,n,d.current,!1),[a,n])}var zi=e=>typeof e=="string",MC=(e,t,n,r,i)=>zi(e)?(r&&t.watch.add(e),Pe(n,e,i)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),Pe(n,o))):(r&&(t.watchAll=!0),n),zC=e=>hi(e)||!BU(e);function zo(e,t,n=new WeakSet){if(zC(e)||zC(t))return Object.is(e,t);if(gc(e)&&gc(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(gc(a)&&gc(c)||tr(a)&&tr(c)||Array.isArray(a)&&Array.isArray(c)?!zo(a,c,n):!Object.is(a,c))return!1}}return!0}function kme(e){const t=oh(),{control:n=t.control,name:r,defaultValue:i,disabled:o,exact:a,compute:c}=e||{},d=Q.useRef(i),f=Q.useRef(c),m=Q.useRef(void 0),h=Q.useRef(n),v=Q.useRef(r);f.current=c;const[y,x]=Q.useState(()=>{const R=n._getWatch(r,d.current);return f.current?f.current(R):R}),S=Q.useCallback(R=>{const T=MC(r,n._names,R||n._formValues,!1,d.current);return f.current?f.current(T):T},[n._formValues,n._names,r]),C=Q.useCallback(R=>{if(!o){const T=MC(r,n._names,R||n._formValues,!1,d.current);if(f.current){const N=f.current(T);zo(N,m.current)||(x(N),m.current=N)}else x(T)}},[n._formValues,n._names,o,r]);vx(()=>((h.current!==n||!zo(v.current,r))&&(h.current=n,v.current=r,C()),n._subscribe({name:r,formState:{values:!0},exact:a,callback:R=>{C(R.values)}})),[n,a,r,C]),Q.useEffect(()=>n._removeUnmounted());const k=h.current!==n,E=v.current,j=Q.useMemo(()=>{if(o)return null;const R=!k&&!zo(E,r);return k||R?S():null},[o,k,r,E,S]);return j!==null?j:y}function Eme(e){const t=oh(),{name:n,disabled:r,control:i=t.control,shouldUnregister:o,defaultValue:a,exact:c=!0}=e,d=qU(i._names.array,n),f=Q.useMemo(()=>Pe(i._formValues,n,Pe(i._defaultValues,n,a)),[i,n,a]),m=kme({control:i,name:n,defaultValue:f,exact:c}),h=nj({control:i,name:n,exact:c}),v=Q.useRef(e),y=Q.useRef(void 0),x=Q.useRef(i.register(n,{...e.rules,value:m,...$i(e.disabled)?{disabled:e.disabled}:{}}));v.current=e;const S=Q.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Pe(h.errors,n)},isDirty:{enumerable:!0,get:()=>!!Pe(h.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Pe(h.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Pe(h.validatingFields,n)},error:{enumerable:!0,get:()=>Pe(h.errors,n)}}),[h,n]),C=Q.useCallback(R=>x.current.onChange({target:{value:HU(R),name:n},type:My.CHANGE}),[n]),k=Q.useCallback(()=>x.current.onBlur({target:{value:Pe(i._formValues,n),name:n},type:My.BLUR}),[n,i._formValues]),E=Q.useCallback(R=>{const T=Pe(i._fields,n);T&&R&&(T._f.ref={focus:()=>R.focus&&R.focus(),select:()=>R.select&&R.select(),setCustomValidity:N=>R.setCustomValidity(N),reportValidity:()=>R.reportValidity()})},[i._fields,n]),j=Q.useMemo(()=>({name:n,value:m,...$i(r)||h.disabled?{disabled:h.disabled||r}:{},onChange:C,onBlur:k,ref:E}),[n,r,h.disabled,C,k,E,m]);return Q.useEffect(()=>{const R=i._options.shouldUnregister||o,T=y.current;T&&T!==n&&!d&&i.unregister(T),i.register(n,{...v.current.rules,...$i(v.current.disabled)?{disabled:v.current.disabled}:{}});const N=(O,M)=>{const L=Pe(i._fields,O);L&&L._f&&(L._f.mount=M)};if(N(n,!0),R){const O=kn(Pe(i._options.defaultValues,n,v.current.defaultValue));qt(i._defaultValues,n,O),yn(Pe(i._formValues,n))&&qt(i._formValues,n,O)}return!d&&i.register(n),y.current=n,()=>{(d?R&&!i._state.action:R)?i.unregister(n):N(n,!1)}},[n,i,d,o]),Q.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),Q.useMemo(()=>({field:j,formState:h,fieldState:S}),[j,h,S])}const jme=e=>e.render(Eme(e));var rj=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},bi=e=>Array.isArray(e)?e:[e],l2=()=>{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 GU(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const i=e[r],o=t[r];if(i&&tr(i)&&o){const a=GU(i,o);tr(a)&&(n[r]=a)}else e[r]&&(n[r]=o)}return n}var Nr=e=>tr(e)&&!Object.keys(e).length,ij=e=>e.type==="file",Lo=e=>typeof e=="function",zy=e=>{if(!QE)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ZU=e=>e.type==="select-multiple",oj=e=>e.type==="radio",Rme=e=>oj(e)||ih(e),Z_=e=>zy(e)&&e.isConnected;function Ime(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=yn(e)?r++:e[t[r++]];return e}function Nme(e){for(const t in e)if(e.hasOwnProperty(t)&&!yn(e[t]))return!1;return!0}function qn(e,t){const n=Array.isArray(t)?t:hx(t)?[t]:ej(t),r=n.length===1?e:Ime(e,n),i=n.length-1,o=n[i];return r&&delete r[o],i!==0&&(tr(r)&&Nr(r)||Array.isArray(r)&&Nme(r))&&qn(e,n.slice(0,-1)),e}var Tme=e=>{for(const t in e)if(Lo(e[t]))return!0;return!1};function YU(e){return Array.isArray(e)||tr(e)&&!Tme(e)}function LC(e,t={}){for(const n in e){const r=e[n];YU(r)?(t[n]=Array.isArray(r)?[]:{},LC(r,t[n])):yn(r)||(t[n]=!0)}return t}function ad(e,t,n){n||(n=LC(t));for(const r in e){const i=e[r];if(YU(i))yn(t)||zC(n[r])?n[r]=LC(i,Array.isArray(i)?[]:{}):ad(i,hi(t)?{}:t[r],n[r]);else{const o=t[r];n[r]=!zo(i,o)}}return n}const c2={value:!1,isValid:!1},u2={value:!0,isValid:!0};var WU=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&&!yn(e[0].attributes.value)?yn(e[0].value)||e[0].value===""?u2:{value:e[0].value,isValid:!0}:u2:c2}return c2},XU=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>yn(e)?e:t?e===""?NaN:e&&+e:n&&zi(e)?new Date(e):r?r(e):e;const d2={isValid:!1,value:null};var JU=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,d2):d2;function f2(e){const t=e.ref;return ij(t)?t.files:oj(t)?JU(e.refs).value:ZU(t)?[...t.selectedOptions].map(({value:n})=>n):ih(t)?WU(e.refs).value:XU(yn(t.value)?e.ref.value:t.value,e)}var Ome=(e,t,n,r)=>{const i={};for(const o of e){const a=Pe(t,o);a&&qt(i,o,a._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},Ly=e=>e instanceof RegExp,$p=e=>yn(e)?e:Ly(e)?e.source:tr(e)?Ly(e.value)?e.value.source:e.value:e,fd=e=>({isOnSubmit:!e||e===xo.onSubmit,isOnBlur:e===xo.onBlur,isOnChange:e===xo.onChange,isOnAll:e===xo.all,isOnTouch:e===xo.onTouched});const p2="AsyncFunction";var Ame=e=>!!e&&!!e.validate&&!!(Lo(e.validate)&&e.validate.constructor.name===p2||tr(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===p2)),Dme=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),FC=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const wd=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const o=Pe(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(wd(c,t))break}else if(tr(c)&&wd(c,t))break}}};function m2(e,t,n){const r=Pe(e,n);if(r||hx(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),a=Pe(t,o),c=Pe(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 $me=(e,t,n,r)=>{n(e);const{name:i,...o}=e;return Nr(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!r||xo.all))},Pme=(e,t,n)=>!e||!t||e===t||bi(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),Mme=(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,zme=(e,t)=>!gx(Pe(e,t)).length&&qn(e,t),QU=(e,t,n)=>{const r=bi(Pe(e,n));return qt(r,"root",t[n]),qt(e,n,r),e};function h2(e,t,n="validate"){if(zi(e)||Array.isArray(e)&&e.every(zi)||$i(e)&&!e)return{type:n,message:zi(e)?e:"",ref:t}}var Ju=e=>tr(e)&&!Ly(e)?e:{value:e,message:""},UC=async(e,t,n,r,i,o)=>{const{ref:a,refs:c,required:d,maxLength:f,minLength:m,min:h,max:v,pattern:y,validate:x,name:S,valueAsNumber:C,mount:k}=e._f,E=Pe(n,S);if(!k||t.has(S))return{};const j=c?c[0]:a,R=q=>{i&&j.reportValidity&&(j.setCustomValidity($i(q)?"":q||""),j.reportValidity())},T={},N=oj(a),O=ih(a),M=N||O,L=(C||ij(a))&&yn(a.value)&&yn(E)||zy(a)&&a.value===""||E===""||Array.isArray(E)&&!E.length,K=rj.bind(null,S,r,T),ee=(q,Y,U,H=Za.maxLength,z=Za.minLength)=>{const W=q?Y:U;T[S]={type:q?H:z,message:W,ref:a,...K(q?H:z,W)}};if(o?!Array.isArray(E)||!E.length:d&&(!M&&(L||hi(E))||$i(E)&&!E||O&&!WU(c).isValid||N&&!JU(c).isValid)){const{value:q,message:Y}=zi(d)?{value:!!d,message:d}:Ju(d);if(q&&(T[S]={type:Za.required,message:Y,ref:j,...K(Za.required,Y)},!r))return R(Y),T}if(!L&&(!hi(h)||!hi(v))){let q,Y;const U=Ju(v),H=Ju(h);if(!hi(E)&&!isNaN(E)){const z=a.valueAsNumber||E&&+E;hi(U.value)||(q=z>U.value),hi(H.value)||(Y=z<H.value)}else{const z=a.valueAsDate||new Date(E),W=D=>new Date(new Date().toDateString()+" "+D),F=a.type=="time",te=a.type=="week";zi(U.value)&&E&&(q=F?W(E)>W(U.value):te?E>U.value:z>new Date(U.value)),zi(H.value)&&E&&(Y=F?W(E)<W(H.value):te?E<H.value:z<new Date(H.value))}if((q||Y)&&(ee(!!q,U.message,H.message,Za.max,Za.min),!r))return R(T[S].message),T}if((f||m)&&!L&&(zi(E)||o&&Array.isArray(E))){const q=Ju(f),Y=Ju(m),U=!hi(q.value)&&E.length>+q.value,H=!hi(Y.value)&&E.length<+Y.value;if((U||H)&&(ee(U,q.message,Y.message),!r))return R(T[S].message),T}if(y&&!L&&zi(E)){const{value:q,message:Y}=Ju(y);if(Ly(q)&&!E.match(q)&&(T[S]={type:Za.pattern,message:Y,ref:a,...K(Za.pattern,Y)},!r))return R(Y),T}if(x){if(Lo(x)){const q=await x(E,n),Y=h2(q,j);if(Y&&(T[S]={...Y,...K(Za.validate,Y.message)},!r))return R(Y.message),T}else if(tr(x)){let q={};for(const Y in x){if(!Nr(q)&&!r)break;const U=h2(await x[Y](E,n),j,Y);U&&(q={...U,...K(Y,U.message)},R(U.message),r&&(T[S]=q))}if(!Nr(q)&&(T[S]={ref:j,...q},!r))return T}}return R(!0),T};const Lme={mode:xo.onSubmit,reValidateMode:xo.onChange,shouldFocusError:!0};function Fme(e={}){let t={...Lme,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Lo(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=tr(t.defaultValues)||tr(t.values)?kn(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:kn(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 m={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let h={...m};const v={array:l2(),state:l2()},y=t.criteriaMode===xo.all,x=G=>ae=>{clearTimeout(f),f=setTimeout(G,ae)},S=async G=>{if(!t.disabled&&(m.isValid||h.isValid||G)){const ae=t.resolver?Nr((await O()).errors):await L(r,!0);ae!==n.isValid&&v.state.next({isValid:ae})}},C=(G,ae)=>{!t.disabled&&(m.isValidating||m.validatingFields||h.isValidating||h.validatingFields)&&((G||Array.from(c.mount)).forEach(pe=>{pe&&(ae?qt(n.validatingFields,pe,ae):qn(n.validatingFields,pe))}),v.state.next({validatingFields:n.validatingFields,isValidating:!Nr(n.validatingFields)}))},k=(G,ae=[],pe,Ce,re=!0,ue=!0)=>{if(Ce&&pe&&!t.disabled){if(a.action=!0,ue&&Array.isArray(Pe(r,G))){const X=pe(Pe(r,G),Ce.argA,Ce.argB);re&&qt(r,G,X)}if(ue&&Array.isArray(Pe(n.errors,G))){const X=pe(Pe(n.errors,G),Ce.argA,Ce.argB);re&&qt(n.errors,G,X),zme(n.errors,G)}if((m.touchedFields||h.touchedFields)&&ue&&Array.isArray(Pe(n.touchedFields,G))){const X=pe(Pe(n.touchedFields,G),Ce.argA,Ce.argB);re&&qt(n.touchedFields,G,X)}(m.dirtyFields||h.dirtyFields)&&(n.dirtyFields=ad(i,o)),v.state.next({name:G,isDirty:ee(G,ae),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else qt(o,G,ae)},E=(G,ae)=>{qt(n.errors,G,ae),v.state.next({errors:n.errors})},j=G=>{n.errors=G,v.state.next({errors:n.errors,isValid:!1})},R=(G,ae,pe,Ce)=>{const re=Pe(r,G);if(re){const ue=Pe(o,G,yn(pe)?Pe(i,G):pe);yn(ue)||Ce&&Ce.defaultChecked||ae?qt(o,G,ae?ue:f2(re._f)):U(G,ue),a.mount&&!a.action&&S()}},T=(G,ae,pe,Ce,re)=>{let ue=!1,X=!1;const ve={name:G};if(!t.disabled){if(!pe||Ce){(m.isDirty||h.isDirty)&&(X=n.isDirty,n.isDirty=ve.isDirty=ee(),ue=X!==ve.isDirty);const Ee=zo(Pe(i,G),ae);X=!!Pe(n.dirtyFields,G),Ee?qn(n.dirtyFields,G):qt(n.dirtyFields,G,!0),ve.dirtyFields=n.dirtyFields,ue=ue||(m.dirtyFields||h.dirtyFields)&&X!==!Ee}if(pe){const Ee=Pe(n.touchedFields,G);Ee||(qt(n.touchedFields,G,pe),ve.touchedFields=n.touchedFields,ue=ue||(m.touchedFields||h.touchedFields)&&Ee!==pe)}ue&&re&&v.state.next(ve)}return ue?ve:{}},N=(G,ae,pe,Ce)=>{const re=Pe(n.errors,G),ue=(m.isValid||h.isValid)&&$i(ae)&&n.isValid!==ae;if(t.delayError&&pe?(d=x(()=>E(G,pe)),d(t.delayError)):(clearTimeout(f),d=null,pe?qt(n.errors,G,pe):qn(n.errors,G)),(pe?!zo(re,pe):re)||!Nr(Ce)||ue){const X={...Ce,...ue&&$i(ae)?{isValid:ae}:{},errors:n.errors,name:G};n={...n,...X},v.state.next(X)}},O=async G=>{C(G,!0);const ae=await t.resolver(o,t.context,Ome(G||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return C(G),ae},M=async G=>{const{errors:ae}=await O(G);if(G)for(const pe of G){const Ce=Pe(ae,pe);Ce?qt(n.errors,pe,Ce):qn(n.errors,pe)}else n.errors=ae;return ae},L=async(G,ae,pe={valid:!0})=>{for(const Ce in G){const re=G[Ce];if(re){const{_f:ue,...X}=re;if(ue){const ve=c.array.has(ue.name),Ee=re._f&&Ame(re._f);Ee&&m.validatingFields&&C([ue.name],!0);const Ke=await UC(re,c.disabled,o,y,t.shouldUseNativeValidation&&!ae,ve);if(Ee&&m.validatingFields&&C([ue.name]),Ke[ue.name]&&(pe.valid=!1,ae))break;!ae&&(Pe(Ke,ue.name)?ve?QU(n.errors,Ke,ue.name):qt(n.errors,ue.name,Ke[ue.name]):qn(n.errors,ue.name))}!Nr(X)&&await L(X,ae,pe)}}return pe.valid},K=()=>{for(const G of c.unMount){const ae=Pe(r,G);ae&&(ae._f.refs?ae._f.refs.every(pe=>!Z_(pe)):!Z_(ae._f.ref))&&B(G)}c.unMount=new Set},ee=(G,ae)=>!t.disabled&&(G&&ae&&qt(o,G,ae),!zo(D(),i)),q=(G,ae,pe)=>MC(G,c,{...a.mount?o:yn(ae)?i:zi(G)?{[G]:ae}:ae},pe,ae),Y=G=>gx(Pe(a.mount?o:i,G,t.shouldUnregister?Pe(i,G,[]):[])),U=(G,ae,pe={})=>{const Ce=Pe(r,G);let re=ae;if(Ce){const ue=Ce._f;ue&&(!ue.disabled&&qt(o,G,XU(ae,ue)),re=zy(ue.ref)&&hi(ae)?"":ae,ZU(ue.ref)?[...ue.ref.options].forEach(X=>X.selected=re.includes(X.value)):ue.refs?ih(ue.ref)?ue.refs.forEach(X=>{(!X.defaultChecked||!X.disabled)&&(Array.isArray(re)?X.checked=!!re.find(ve=>ve===X.value):X.checked=re===X.value||!!re)}):ue.refs.forEach(X=>X.checked=X.value===re):ij(ue.ref)?ue.ref.value="":(ue.ref.value=re,ue.ref.type||v.state.next({name:G,values:kn(o)})))}(pe.shouldDirty||pe.shouldTouch)&&T(G,re,pe.shouldTouch,pe.shouldDirty,!0),pe.shouldValidate&&te(G)},H=(G,ae,pe)=>{for(const Ce in ae){if(!ae.hasOwnProperty(Ce))return;const re=ae[Ce],ue=G+"."+Ce,X=Pe(r,ue);(c.array.has(G)||tr(re)||X&&!X._f)&&!gc(re)?H(ue,re,pe):U(ue,re,pe)}},z=(G,ae,pe={})=>{const Ce=Pe(r,G),re=c.array.has(G),ue=kn(ae);qt(o,G,ue),re?(v.array.next({name:G,values:kn(o)}),(m.isDirty||m.dirtyFields||h.isDirty||h.dirtyFields)&&pe.shouldDirty&&v.state.next({name:G,dirtyFields:ad(i,o),isDirty:ee(G,ue)})):Ce&&!Ce._f&&!hi(ue)?H(G,ue,pe):U(G,ue,pe),FC(G,c)&&v.state.next({...n,name:G}),v.state.next({name:a.mount?G:void 0,values:kn(o)})},W=async G=>{a.mount=!0;const ae=G.target;let pe=ae.name,Ce=!0;const re=Pe(r,pe),ue=Ee=>{Ce=Number.isNaN(Ee)||gc(Ee)&&isNaN(Ee.getTime())||zo(Ee,Pe(o,pe,Ee))},X=fd(t.mode),ve=fd(t.reValidateMode);if(re){let Ee,Ke;const et=ae.type?f2(re._f):HU(G),Vt=G.type===My.BLUR||G.type===My.FOCUS_OUT,jn=!Dme(re._f)&&!t.resolver&&!Pe(n.errors,pe)&&!re._f.deps||Mme(Vt,Pe(n.touchedFields,pe),n.isSubmitted,ve,X),ln=FC(pe,c,Vt);qt(o,pe,et),Vt?(!ae||!ae.readOnly)&&(re._f.onBlur&&re._f.onBlur(G),d&&d(0)):re._f.onChange&&re._f.onChange(G);const zt=T(pe,et,Vt),wn=!Nr(zt)||ln;if(!Vt&&v.state.next({name:pe,type:G.type,values:kn(o)}),jn)return(m.isValid||h.isValid)&&(t.mode==="onBlur"?Vt&&S():Vt||S()),wn&&v.state.next({name:pe,...ln?{}:zt});if(!Vt&&ln&&v.state.next({...n}),t.resolver){const{errors:_t}=await O([pe]);if(ue(et),Ce){const ur=m2(n.errors,r,pe),Sn=m2(_t,r,ur.name||pe);Ee=Sn.error,pe=Sn.name,Ke=Nr(_t)}}else C([pe],!0),Ee=(await UC(re,c.disabled,o,y,t.shouldUseNativeValidation))[pe],C([pe]),ue(et),Ce&&(Ee?Ke=!1:(m.isValid||h.isValid)&&(Ke=await L(r,!0)));Ce&&(re._f.deps&&(!Array.isArray(re._f.deps)||re._f.deps.length>0)&&te(re._f.deps),N(pe,Ke,Ee,zt))}},F=(G,ae)=>{if(Pe(n.errors,ae)&&G.focus)return G.focus(),1},te=async(G,ae={})=>{let pe,Ce;const re=bi(G);if(t.resolver){const ue=await M(yn(G)?G:re);pe=Nr(ue),Ce=G?!re.some(X=>Pe(ue,X)):pe}else G?(Ce=(await Promise.all(re.map(async ue=>{const X=Pe(r,ue);return await L(X&&X._f?{[ue]:X}:X)}))).every(Boolean),!(!Ce&&!n.isValid)&&S()):Ce=pe=await L(r);return v.state.next({...!zi(G)||(m.isValid||h.isValid)&&pe!==n.isValid?{}:{name:G},...t.resolver||!G?{isValid:pe}:{},errors:n.errors}),ae.shouldFocus&&!Ce&&wd(r,F,G?re:c.mount),Ce},D=(G,ae)=>{let pe={...a.mount?o:i};return ae&&(pe=GU(ae.dirtyFields?n.dirtyFields:n.touchedFields,pe)),yn(G)?pe:zi(G)?Pe(pe,G):G.map(Ce=>Pe(pe,Ce))},$=(G,ae)=>({invalid:!!Pe((ae||n).errors,G),isDirty:!!Pe((ae||n).dirtyFields,G),error:Pe((ae||n).errors,G),isValidating:!!Pe(n.validatingFields,G),isTouched:!!Pe((ae||n).touchedFields,G)}),V=G=>{G&&bi(G).forEach(ae=>qn(n.errors,ae)),v.state.next({errors:G?n.errors:{}})},A=(G,ae,pe)=>{const Ce=(Pe(r,G,{_f:{}})._f||{}).ref,re=Pe(n.errors,G)||{},{ref:ue,message:X,type:ve,...Ee}=re;qt(n.errors,G,{...Ee,...ae,ref:Ce}),v.state.next({name:G,errors:n.errors,isValid:!1}),pe&&pe.shouldFocus&&Ce&&Ce.focus&&Ce.focus()},J=(G,ae)=>Lo(G)?v.state.subscribe({next:pe=>"values"in pe&&G(q(void 0,ae),pe)}):q(G,ae,!0),fe=G=>v.state.subscribe({next:ae=>{Pme(G.name,ae.name,G.exact)&&$me(ae,G.formState||m,sn,G.reRenderRoot)&&G.callback({values:{...o},...n,...ae,defaultValues:i})}}).unsubscribe,ge=G=>(a.mount=!0,h={...h,...G.formState},fe({...G,formState:h})),B=(G,ae={})=>{for(const pe of G?bi(G):c.mount)c.mount.delete(pe),c.array.delete(pe),ae.keepValue||(qn(r,pe),qn(o,pe)),!ae.keepError&&qn(n.errors,pe),!ae.keepDirty&&qn(n.dirtyFields,pe),!ae.keepTouched&&qn(n.touchedFields,pe),!ae.keepIsValidating&&qn(n.validatingFields,pe),!t.shouldUnregister&&!ae.keepDefaultValue&&qn(i,pe);v.state.next({values:kn(o)}),v.state.next({...n,...ae.keepDirty?{isDirty:ee()}:{}}),!ae.keepIsValid&&S()},se=({disabled:G,name:ae})=>{($i(G)&&a.mount||G||c.disabled.has(ae))&&(G?c.disabled.add(ae):c.disabled.delete(ae))},_e=(G,ae={})=>{let pe=Pe(r,G);const Ce=$i(ae.disabled)||$i(t.disabled);return qt(r,G,{...pe||{},_f:{...pe&&pe._f?pe._f:{ref:{name:G}},name:G,mount:!0,...ae}}),c.mount.add(G),pe?se({disabled:$i(ae.disabled)?ae.disabled:t.disabled,name:G}):R(G,!0,ae.value),{...Ce?{disabled:ae.disabled||t.disabled}:{},...t.progressive?{required:!!ae.required,min:$p(ae.min),max:$p(ae.max),minLength:$p(ae.minLength),maxLength:$p(ae.maxLength),pattern:$p(ae.pattern)}:{},name:G,onChange:W,onBlur:W,ref:re=>{if(re){_e(G,ae),pe=Pe(r,G);const ue=yn(re.value)&&re.querySelectorAll&&re.querySelectorAll("input,select,textarea")[0]||re,X=Rme(ue),ve=pe._f.refs||[];if(X?ve.find(Ee=>Ee===ue):ue===pe._f.ref)return;qt(r,G,{_f:{...pe._f,...X?{refs:[...ve.filter(Z_),ue,...Array.isArray(Pe(i,G))?[{}]:[]],ref:{type:ue.type,name:G}}:{ref:ue}}}),R(G,!1,void 0,ue)}else pe=Pe(r,G,{}),pe._f&&(pe._f.mount=!1),(t.shouldUnregister||ae.shouldUnregister)&&!(qU(c.array,G)&&a.action)&&c.unMount.add(G)}}},Ie=()=>t.shouldFocusError&&wd(r,F,c.mount),Fe=G=>{$i(G)&&(v.state.next({disabled:G}),wd(r,(ae,pe)=>{const Ce=Pe(r,pe);Ce&&(ae.disabled=Ce._f.disabled||G,Array.isArray(Ce._f.refs)&&Ce._f.refs.forEach(re=>{re.disabled=Ce._f.disabled||G}))},0,!1))},Le=(G,ae)=>async pe=>{let Ce;pe&&(pe.preventDefault&&pe.preventDefault(),pe.persist&&pe.persist());let re=kn(o);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:ue,values:X}=await O();n.errors=ue,re=kn(X)}else await L(r);if(c.disabled.size)for(const ue of c.disabled)qn(re,ue);if(qn(n.errors,"root"),Nr(n.errors)){v.state.next({errors:{}});try{await G(re,pe)}catch(ue){Ce=ue}}else ae&&await ae({...n.errors},pe),Ie(),setTimeout(Ie);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Nr(n.errors)&&!Ce,submitCount:n.submitCount+1,errors:n.errors}),Ce)throw Ce},We=(G,ae={})=>{Pe(r,G)&&(yn(ae.defaultValue)?z(G,kn(Pe(i,G))):(z(G,ae.defaultValue),qt(i,G,kn(ae.defaultValue))),ae.keepTouched||qn(n.touchedFields,G),ae.keepDirty||(qn(n.dirtyFields,G),n.isDirty=ae.defaultValue?ee(G,kn(Pe(i,G))):ee()),ae.keepError||(qn(n.errors,G),m.isValid&&S()),v.state.next({...n}))},gt=(G,ae={})=>{const pe=G?kn(G):i,Ce=kn(pe),re=Nr(G),ue=re?i:Ce;if(ae.keepDefaultValues||(i=pe),!ae.keepValues){if(ae.keepDirtyValues){const X=new Set([...c.mount,...Object.keys(ad(i,o))]);for(const ve of Array.from(X))Pe(n.dirtyFields,ve)?qt(ue,ve,Pe(o,ve)):z(ve,Pe(ue,ve))}else{if(QE&&yn(G))for(const X of c.mount){const ve=Pe(r,X);if(ve&&ve._f){const Ee=Array.isArray(ve._f.refs)?ve._f.refs[0]:ve._f.ref;if(zy(Ee)){const Ke=Ee.closest("form");if(Ke){Ke.reset();break}}}}if(ae.keepFieldsRef)for(const X of c.mount)z(X,Pe(ue,X));else r={}}o=t.shouldUnregister?ae.keepDefaultValues?kn(i):{}:kn(ue),v.array.next({values:{...ue}}),v.state.next({values:{...ue}})}c={mount:ae.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!m.isValid||!!ae.keepIsValid||!!ae.keepDirtyValues||!t.shouldUnregister&&!Nr(ue),a.watch=!!t.shouldUnregister,a.action=!1,ae.keepErrors||(n.errors={}),v.state.next({submitCount:ae.keepSubmitCount?n.submitCount:0,isDirty:re?!1:ae.keepDirty?n.isDirty:!!(ae.keepDefaultValues&&!zo(G,i)),isSubmitted:ae.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:re?{}:ae.keepDirtyValues?ae.keepDefaultValues&&o?ad(i,o):n.dirtyFields:ae.keepDefaultValues&&G?ad(i,G):ae.keepDirty?n.dirtyFields:{},touchedFields:ae.keepTouched?n.touchedFields:{},errors:ae.keepErrors?n.errors:{},isSubmitSuccessful:ae.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},Qt=(G,ae)=>gt(Lo(G)?G(o):G,ae),Tn=(G,ae={})=>{const pe=Pe(r,G),Ce=pe&&pe._f;if(Ce){const re=Ce.refs?Ce.refs[0]:Ce.ref;re.focus&&(re.focus(),ae.shouldSelect&&Lo(re.select)&&re.select())}},sn=G=>{n={...n,...G}},Mt={control:{register:_e,unregister:B,getFieldState:$,handleSubmit:Le,setError:A,_subscribe:fe,_runSchema:O,_focusError:Ie,_getWatch:q,_getDirty:ee,_setValid:S,_setFieldArray:k,_setDisabledField:se,_setErrors:j,_getFieldArray:Y,_reset:gt,_resetDefaultValues:()=>Lo(t.defaultValues)&&t.defaultValues().then(G=>{Qt(G,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:K,_disableForm:Fe,_subjects:v,_proxyFormState:m,get _fields(){return r},get _formValues(){return o},get _state(){return a},set _state(G){a=G},get _defaultValues(){return i},get _names(){return c},set _names(G){c=G},get _formState(){return n},get _options(){return t},set _options(G){t={...t,...G}}},subscribe:ge,trigger:te,register:_e,handleSubmit:Le,watch:J,setValue:z,getValues:D,reset:Qt,resetField:We,clearErrors:V,unregister:B,setError:A,setFocus:Tn,getFieldState:$};return{...Mt,formControl:Mt}}var Hs=()=>{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)})},Y_=(e,t,n={})=>n.shouldFocus||yn(n.shouldFocus)?n.focusName||`${e}.${yn(n.focusIndex)?t:n.focusIndex}.`:"",W_=(e,t)=>[...e,...bi(t)],X_=e=>Array.isArray(e)?e.map(()=>{}):void 0;function J_(e,t,n){return[...e.slice(0,t),...bi(n),...e.slice(t)]}var Q_=(e,t,n)=>Array.isArray(e)?(yn(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],e1=(e,t)=>[...bi(t),...bi(e)];function Ume(e,t){let n=0;const r=[...e];for(const i of t)r.splice(i-n,1),n++;return gx(r).length?r:[]}var t1=(e,t)=>yn(t)?[]:Ume(e,bi(t).sort((n,r)=>n-r)),n1=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},g2=(e,t,n)=>(e[t]=n,e);function aj(e){const t=oh(),{control:n=t.control,name:r,keyName:i="id",shouldUnregister:o,rules:a}=e,[c,d]=Q.useState(n._getFieldArray(r)),f=Q.useRef(n._getFieldArray(r).map(Hs)),m=Q.useRef(!1);n._names.array.add(r),Q.useMemo(()=>a&&c.length>=0&&n.register(r,a),[n,r,c.length,a]),vx(()=>n._subjects.array.subscribe({next:({values:R,name:T})=>{if(T===r||!T){const N=Pe(R,r);Array.isArray(N)&&(d(N),f.current=N.map(Hs))}}}).unsubscribe,[n,r]);const h=Q.useCallback(R=>{m.current=!0,n._setFieldArray(r,R)},[n,r]),v=(R,T)=>{const N=bi(kn(R)),O=W_(n._getFieldArray(r),N);n._names.focus=Y_(r,O.length-1,T),f.current=W_(f.current,N.map(Hs)),h(O),d(O),n._setFieldArray(r,O,W_,{argA:X_(R)})},y=(R,T)=>{const N=bi(kn(R)),O=e1(n._getFieldArray(r),N);n._names.focus=Y_(r,0,T),f.current=e1(f.current,N.map(Hs)),h(O),d(O),n._setFieldArray(r,O,e1,{argA:X_(R)})},x=R=>{const T=t1(n._getFieldArray(r),R);f.current=t1(f.current,R),h(T),d(T),!Array.isArray(Pe(n._fields,r))&&qt(n._fields,r,void 0),n._setFieldArray(r,T,t1,{argA:R})},S=(R,T,N)=>{const O=bi(kn(T)),M=J_(n._getFieldArray(r),R,O);n._names.focus=Y_(r,R,N),f.current=J_(f.current,R,O.map(Hs)),h(M),d(M),n._setFieldArray(r,M,J_,{argA:R,argB:X_(T)})},C=(R,T)=>{const N=n._getFieldArray(r);n1(N,R,T),n1(f.current,R,T),h(N),d(N),n._setFieldArray(r,N,n1,{argA:R,argB:T},!1)},k=(R,T)=>{const N=n._getFieldArray(r);Q_(N,R,T),Q_(f.current,R,T),h(N),d(N),n._setFieldArray(r,N,Q_,{argA:R,argB:T},!1)},E=(R,T)=>{const N=kn(T),O=g2(n._getFieldArray(r),R,N);f.current=[...O].map((M,L)=>!M||L===R?Hs():f.current[L]),h(O),d([...O]),n._setFieldArray(r,O,g2,{argA:R,argB:N},!0,!1)},j=R=>{const T=bi(kn(R));f.current=T.map(Hs),h([...T]),d([...T]),n._setFieldArray(r,[...T],N=>N,{},!0,!1)};return Q.useEffect(()=>{if(n._state.action=!1,FC(r,n._names)&&n._subjects.state.next({...n._formState}),m.current&&(!fd(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!fd(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([r]).then(R=>{const T=Pe(R.errors,r),N=Pe(n._formState.errors,r);(N?!T&&N.type||T&&(N.type!==T.type||N.message!==T.message):T&&T.type)&&(T?qt(n._formState.errors,r,T):qn(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const R=Pe(n._fields,r);R&&R._f&&!(fd(n._options.reValidateMode).isOnSubmit&&fd(n._options.mode).isOnSubmit)&&UC(R,n._names.disabled,n._formValues,n._options.criteriaMode===xo.all,n._options.shouldUseNativeValidation,!0).then(T=>!Nr(T)&&n._subjects.state.next({errors:QU(n._formState.errors,T,r)}))}n._subjects.state.next({name:r,values:kn(n._formValues)}),n._names.focus&&wd(n._fields,(R,T)=>{if(n._names.focus&&T.startsWith(n._names.focus)&&R.focus)return R.focus(),1}),n._names.focus="",n._setValid(),m.current=!1},[c,r,n]),Q.useEffect(()=>(!Pe(n._formValues,r)&&n._setFieldArray(r),()=>{const R=(T,N)=>{const O=Pe(n._fields,T);O&&O._f&&(O._f.mount=N)};n._options.shouldUnregister||o?n.unregister(r):R(r,!1)}),[r,n,i,o]),{swap:Q.useCallback(C,[h,r,n]),move:Q.useCallback(k,[h,r,n]),prepend:Q.useCallback(y,[h,r,n]),append:Q.useCallback(v,[h,r,n]),remove:Q.useCallback(x,[h,r,n]),insert:Q.useCallback(S,[h,r,n]),update:Q.useCallback(E,[h,r,n]),replace:Q.useCallback(j,[h,r,n]),fields:Q.useMemo(()=>c.map((R,T)=>({...R,[i]:f.current[T]||Hs()})),[c,i])}}function on(e={}){const t=Q.useRef(void 0),n=Q.useRef(void 0),[r,i]=Q.useState({isDirty:!1,isValidating:!1,isLoading:Lo(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:Lo(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Lo(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...c}=Fme(e);t.current={...c,formState:r}}const o=t.current.control;return o._options=e,vx(()=>{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]),Q.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),Q.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),Q.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),Q.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),Q.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==r.isDirty&&o._subjects.state.next({isDirty:a})}},[o,r.isDirty]),Q.useEffect(()=>{var a;e.values&&!zo(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((a=o._options.resetOptions)===null||a===void 0)&&a.keepIsValid||o._setValid(),n.current=e.values,i(c=>({...c}))):o._resetDefaultValues()},[o,e.values]),Q.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=KU(r,o),t.current}const an=Cme,e6=b.createContext({}),t6=b.createContext({});function yx(){const e=b.useContext(e6),t=b.useContext(t6),{getFieldState:n}=oh(),r=nj({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 De({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:i}=yx();return u.jsx(rE,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${i}`:`${r}`,"aria-invalid":!!t,...e})}function $e({...e}){return u.jsx(e6,{value:{name:e.name},children:u.jsx(jme,{...e})})}function Ne({className:e,...t}){const n=b.useId();return u.jsx(t6,{value:{id:n},children:u.jsx("div",{"data-slot":"form-item",className:Ue("grid gap-2",e),...t})})}var Vme=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],n6=Vme.reduce((e,t)=>{const n=g4(`Primitive.${t}`),r=b.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}},{}),Bme="Label",r6=b.forwardRef((e,t)=>u.jsx(n6.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));r6.displayName=Bme;var Hme=r6;function ah({className:e,...t}){return u.jsx(Hme,{"data-slot":"label",className:Ue("text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function Te({className:e,...t}){const{error:n,formItemId:r}=yx();return u.jsx(ah,{"data-slot":"form-label","data-error":!!n,className:Ue("data-[error=true]:text-destructive",e),htmlFor:r,...t})}function Oe({className:e,...t}){const{error:n,formMessageId:r}=yx(),i=n?String(n?.message):t.children;return i?u.jsx("p",{"data-slot":"form-message",id:r,className:Ue("text-destructive text-sm",e),...t,children:i}):null}function Me({className:e,type:t,...n}){return u.jsx("input",{type:t,"data-slot":"input",className:Ue(`border-input file:text-foreground placeholder:text-muted-foreground selection:bg-purple
38
+ `,r:"\r",t:" "};function Yae(e){return e.startsWith("u")?String.fromCharCode(parseInt(e.slice(1),16)):Zae[e]}const Wae="v1",Xae=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function Jae(e,t){let n;const r=ese(),i=await ise(e);return i.ok?(r.increment("fetch","success"),n=Qae(e,i.value,t,r)):(r.increment("fetch","failure"),ht.error(i.error)),Zb("remote configuration metrics",{metrics:r.get()}),n}function Qae(e,t,n,r){const i={...e};return Xae.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(tse(v)){if(nse(v)){const y=v.rcSerializedType;switch(y){case"string":return v.value;case"regex":return XL(v.value);case"dynamic":return c(v);default:ht.error(`Unsupported remote configuration: "rcSerializedType": "${y}"`);return}}return P4(v,o)}return v}function a(v,y){y.forEach(({key:x,value:S})=>{v.setContextProperty(x,o(S))})}function c(v){const y=v.strategy;let x;switch(y){case"cookie":x=d(v);break;case"dom":x=f(v);break;case"js":x=h(v);break;default:ht.error(`Unsupported remote configuration: "strategy": "${y}"`);return}const S=v.extractor;return S!==void 0&&typeof x=="string"?rse(S,x):x}function d({name:v}){const y=Bb(v);return r.increment("cookie",y!==void 0?"success":"missing"),y}function f({selector:v,attribute:y}){let x;try{x=document.querySelector(v)}catch{ht.error(`Invalid selector in the remote configuration: '${v}'`),r.increment("dom","failure");return}if(!x){r.increment("dom","missing");return}if(m(x,y)){ht.error(`Forbidden element selected by the remote configuration: '${v}'`),r.increment("dom","failure");return}const S=y!==void 0?x.getAttribute(y):x.textContent;if(S===null){r.increment("dom","missing");return}return r.increment("dom","success"),S}function m(v,y){return v.getAttribute("type")==="password"&&y==="value"}function h({path:v}){let y=window;const x=zae(v);if(x.length===0){ht.error(`Invalid JSON path in the remote configuration: '${v}'`),r.increment("js","failure");return}for(const S of x){if(!(S in y)){r.increment("js","missing");return}try{y=y[S]}catch(C){ht.error(`Error accessing: '${v}'`,C),r.increment("js","failure");return}}return r.increment("js","success"),y}}function ese(){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 tse(e){return typeof e=="object"&&e!==null}function nse(e){return"rcSerializedType"in e}function XL(e){try{return new RegExp(e)}catch{ht.error(`Invalid regex in the remote configuration: '${e}'`)}}function rse(e,t){const n=XL(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 ise(e){let t;try{t=await fetch(ose(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 ose(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${aL("rum",e)}/${Wae}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function ase({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},n,r,i){const o=dae(),a=UL();P_(a,hr.globalContext,o);const c=VL();P_(c,hr.userContext,o);const d=FL();P_(d,hr.accountContext,o);let f,m,h,v;const y=n.observable.subscribe(S),x={};function S(){if(!h||!v||!n.isGranted())return;y.unsubscribe();let R;if(v.trackViewsManually){if(!f)return;o.remove(f.callback),R=f.options}const T=i(v,m,R);o.drain(T)}function C(R,T){const N=Pd();if(N&&(R=sse(R)),h=R,koe(Mae(R)),v){hL("DD_RUM",R);return}const O=Tae(R,T);if(O){if(!N&&!O.sessionStoreStrategyType){ht.warn("No storage available for session. We will not send any data.");return}O.compressIntakeRequests&&!N&&t&&(m=t(O,"Datadog RUM",Jt),!m)||(v=O,LL().subscribe(Jt),n.tryToInit(O.trackingConsent),S())}}const k=R=>{o.add(T=>T.addDurationVital(R))};return{init(R,T,N){if(!R){ht.error("Missing configuration");return}cie(R.enableExperimentalFeatures),h=R,!(e&&AL())&&(KL(R.plugins,"onInit",{initConfiguration:R,publicApi:T}),R.remoteConfigurationId?Jae(R,{user:c,context:a}).then(O=>{O&&C(O,N)}).catch(ml):C(R,N))},get initConfiguration(){return h},getInternalContext:Jt,stopSession:Jt,addTiming(R,T=Cr()){o.add(N=>N.addTiming(R,T))},startView(R,T=cr()){const N=O=>{O.startView(R,T)};o.add(N),f||(f={options:R,callback:N},S())},setViewName(R){o.add(T=>T.setViewName(R))},setViewContext(R){o.add(T=>T.setViewContext(R))},setViewContextProperty(R,T){o.add(N=>N.setViewContextProperty(R,T))},getViewContext:()=>x,globalContext:a,userContext:c,accountContext:d,addAction(R){o.add(T=>T.addAction(R))},addError(R){o.add(T=>T.addError(R))},addFeatureFlagEvaluation(R,T){o.add(N=>N.addFeatureFlagEvaluation(R,T))},startDurationVital(R,T){return HL(r,R,T)},stopDurationVital(R,T){qL(k,r,R,T)},addDurationVital:k,addOperationStepVital:(R,T,N,O)=>{o.add(M=>M.addOperationStepVital(vn(R),T,vn(N),vn(O)))}}}function sse(e){var t,n;return{...e,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(t=e.defaultPrivacyLevel)!==null&&t!==void 0?t:(n=Ym())===null||n===void 0?void 0:n.getPrivacyLevel()}}function P_(e,t,n){e.changeObservable.subscribe(()=>{const r=e.getContext();n.add(i=>i[t].setContext(r))})}function lse(e,t,n,r={}){const i=Vre(),o=Sae(),a=xae().observable;let c=ase(r,i,o,(h,v,y)=>{const x=v&&r.createDeflateEncoder?C=>r.createDeflateEncoder(h,v,C):Uoe,S=e(h,t,n,y,x,i,o,a,r.sdkName);return t.onRumStart(S.lifeCycle,h,S.session,S.viewHistory,v,S.telemetry),n.onRumStart(S.lifeCycle,S.hooks,h,S.session,S.viewHistory,x),c=cse(c,S),KL(h.plugins,"onRumStart",{strategy:c,addEvent:S.addEvent}),S});const d=()=>c,f=St(h=>{const v=typeof h=="object"?h:{name:h};c.startView(v),mr({feature:"start-view"})}),m=Fie({init:h=>{const v=new Error().stack;ul(()=>c.init(h,m,v))},setTrackingConsent:St(h=>{i.update(h),mr({feature:"set-tracking-consent",tracking_consent:h})}),setViewName:St(h=>{c.setViewName(h),mr({feature:"set-view-name"})}),setViewContext:St(h=>{c.setViewContext(h),mr({feature:"set-view-context"})}),setViewContextProperty:St((h,v)=>{c.setViewContextProperty(h,v),mr({feature:"set-view-context-property"})}),getViewContext:St(()=>(mr({feature:"set-view-context-property"}),c.getViewContext())),getInternalContext:St(h=>c.getInternalContext(h)),getInitConfiguration:St(()=>vE(c.initConfiguration)),addAction:(h,v)=>{const y=ym("action");ul(()=>{c.addAction({name:vn(h),context:vn(v),startClocks:cr(),type:SE.CUSTOM,handlingStack:y}),mr({feature:"add-action"})})},addError:(h,v)=>{const y=ym("error");ul(()=>{c.addError({error:h,handlingStack:y,context:vn(v),startClocks:cr()}),mr({feature:"add-error"})})},addTiming:St((h,v)=>{c.addTiming(vn(h),v)}),setGlobalContext:Vr(d,hr.globalContext,Br.setContext,"set-global-context"),getGlobalContext:Vr(d,hr.globalContext,Br.getContext,"get-global-context"),setGlobalContextProperty:Vr(d,hr.globalContext,Br.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:Vr(d,hr.globalContext,Br.removeContextProperty,"remove-global-context-property"),clearGlobalContext:Vr(d,hr.globalContext,Br.clearContext,"clear-global-context"),setUser:Vr(d,hr.userContext,Br.setContext,"set-user"),getUser:Vr(d,hr.userContext,Br.getContext,"get-user"),setUserProperty:Vr(d,hr.userContext,Br.setContextProperty,"set-user-property"),removeUserProperty:Vr(d,hr.userContext,Br.removeContextProperty,"remove-user-property"),clearUser:Vr(d,hr.userContext,Br.clearContext,"clear-user"),setAccount:Vr(d,hr.accountContext,Br.setContext,"set-account"),getAccount:Vr(d,hr.accountContext,Br.getContext,"get-account"),setAccountProperty:Vr(d,hr.accountContext,Br.setContextProperty,"set-account-property"),removeAccountProperty:Vr(d,hr.accountContext,Br.removeContextProperty,"remove-account-property"),clearAccount:Vr(d,hr.accountContext,Br.clearContext,"clear-account"),startView:f,stopSession:St(()=>{c.stopSession(),mr({feature:"stop-session"})}),addFeatureFlagEvaluation:St((h,v)=>{c.addFeatureFlagEvaluation(vn(h),vn(v)),mr({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:St(()=>t.getSessionReplayLink()),startSessionReplayRecording:St(h=>{t.start(h),mr({feature:"start-session-replay-recording",force:h&&h.force})}),stopSessionReplayRecording:St(()=>t.stop()),addDurationVital:St((h,v)=>{mr({feature:"add-duration-vital"}),c.addDurationVital({name:vn(h),type:xm.DURATION,startClocks:nre(v.startTime),duration:v.duration,context:vn(v&&v.context),description:vn(v&&v.description)})}),startDurationVital:St((h,v)=>(mr({feature:"start-duration-vital"}),c.startDurationVital(vn(h),{context:vn(v&&v.context),description:vn(v&&v.description)}))),stopDurationVital:St((h,v)=>{mr({feature:"stop-duration-vital"}),c.stopDurationVital(typeof h=="string"?vn(h):h,{context:vn(v&&v.context),description:vn(v&&v.description)})}),startFeatureOperation:St((h,v)=>{mr({feature:"add-operation-step-vital",action_type:"start"}),c.addOperationStepVital(h,"start",v)}),succeedFeatureOperation:St((h,v)=>{mr({feature:"add-operation-step-vital",action_type:"succeed"}),c.addOperationStepVital(h,"end",v)}),failFeatureOperation:St((h,v,y)=>{mr({feature:"add-operation-step-vital",action_type:"fail"}),c.addOperationStepVital(h,"end",y,v)})});return m}function cse(e,t){return{init:n=>{hL("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function use(){const e=dse();return new $t(t=>{if(!e)return;const n=new e(St(r=>t.notify(r)));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function dse(){let e;const t=window;if(t.Zone&&(e=pl(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(Jt),r=pl(n,"originalInstance");e=r&&r.constructor}return e||(e=t.MutationObserver),e}function fse(){const e=new $t,{stop:t}=ga(window,"open",()=>e.notify());return{observable:e,stop:t}}function pse(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 mse=Voe,hse=Kc;function gse(e){const t=pf({expireDelay:hse});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 JL="initial_document",vse=[[Kr.DOCUMENT,e=>JL===e],[Kr.XHR,e=>e==="xmlhttprequest"],[Kr.FETCH,e=>e==="fetch"],[Kr.BEACON,e=>e==="beacon"],[Kr.CSS,(e,t)=>/\.css$/i.test(t)],[Kr.JS,(e,t)=>/\.js$/i.test(t)],[Kr.IMAGE,(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],[Kr.FONT,(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],[Kr.MEDIA,(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function yse(e){const t=e.name;if(!dre(t))return Kr.OTHER;const n=fre(t);for(const[r,i]of vse)if(i(e.initiatorType,n))return r;return Kr.OTHER}function g$(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function QL(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function bse(e){const{duration:t,startTime:n,responseEnd:r}=e;return t===0&&n<r?Gn(n,r):t}function xse(e){if(!tF(e))return;const{startTime:t,fetchStart:n,workerStart:r,redirectStart:i,redirectEnd:o,domainLookupStart:a,domainLookupEnd:c,connectStart:d,secureConnectionStart:f,connectEnd:m,requestStart:h,responseStart:v,responseEnd:y}=e,x={download:ac(t,v,y),first_byte:ac(t,h,v)};return 0<r&&r<n&&(x.worker=ac(t,r,n)),n<m&&(x.connect=ac(t,d,m),d<=f&&f<=m&&(x.ssl=ac(t,f,m))),n<c&&(x.dns=ac(t,a,c)),t<o&&(x.redirect=ac(t,i,o)),x}function eF(e){return e.duration>=0}function tF(e){const t=g$(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=wse(e)?g$(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function wse(e){return e.redirectEnd>e.startTime}function ac(e,t,n){if(e<=t&&t<=n)return{duration:bt(Gn(t,n)),start:bt(Gn(e,t))}}function Sse(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function _se(e){return e.deliveryType===""?"other":e.deliveryType}function Cse(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 _E(e){return e&&(!oie(e)||Zm(hl.TRACK_INTAKE_REQUESTS))}const kse=/data:(.+)?(;base64)?,/g,Ese=24e3;function jse(e,t=Ese){if(e.length<=t||!e.startsWith("data:"))return e;const n=e.substring(0,100).match(kse);return n?`${n[0]}[...]`:e}const Rse=32*Zc;function Ise(e,t){const n=Tse(e.requestBody,t.trackPayload);if(n){if(t.trackResponseErrors&&e.responseBody){const r=Nse(e.responseBody);r&&(n.errors_count=r.length,n.errors=r)}return n}}function Nse(e){let t;try{t=JSON.parse(e)}catch{return}if(!t||typeof t!="object")return;const n=t;return Cc(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 nF(e,t){return t.allowedGraphQlUrls.find(n=>qb([n.match],e))}function Tse(e,t=!1){if(!e||typeof e!="string")return;let n;try{n=JSON.parse(e)}catch{return}if(!n)return;let r,i;if(n.query){const c=n.query.trim();r=Ose(c),t&&(i=dE(c,Rse,"..."))}const o=n.operationName;let a;return n.variables&&(a=JSON.stringify(n.variables)),{operationType:r,operationName:o,variables:a,payload:i}}function Ose(e){var t;return(t=e.match(/^\s*(query|mutation|subscription)\b/i))===null||t===void 0?void 0:t[1]}let v$=1;function Ase(e,t,n,r,i){const o=Iae(t,n,r,i);Dse(e,t,o),$se(e,t,o)}function Dse(e,t,n){const r=qoe(t).subscribe(i=>{const o=i;if(_E(o.url))switch(o.state){case"start":n.traceXhr(o,o.xhr),o.requestIndex=rF(),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:Wb.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 $se(e,t,n){const r=LL({responseBodyAction:i=>{var o;return!((o=nF(i.url,t))===null||o===void 0)&&o.trackResponseErrors?2:1}}).subscribe(i=>{var o;const a=i;if(_E(a.url))switch(a.state){case"start":n.traceFetch(a),a.requestIndex=rF(),e.notify(7,{requestIndex:a.requestIndex,url:a.url});break;case"resolve":n.clearTracingIfNeeded(a),e.notify(8,{duration:Gn(a.startClocks.timeStamp,Cr()),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:Wb.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 rF(){const e=v$;return v$+=1,e}function iF(e){return Km(e)&&e<0?void 0:e}function oF({lifeCycle:e,isChildEvent:t,onChange:n=Jt}){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 xt.ERROR:r.errorCount+=1,n();break;case xt.ACTION:r.actionCount+=1,o.action.frustration&&(r.frustrationCount+=o.action.frustration.type.length),n();break;case xt.LONG_TASK:r.longTaskCount+=1,n();break;case xt.RESOURCE:!((a=o._dd)===null||a===void 0)&&a.discarded||(r.resourceCount+=1,n());break}});return{stop:()=>{i.unsubscribe()},eventCounts:r}}function Pse(e,t){const n=Wr();let r=!1;const{stop:i}=gl(e,window,["click","mousedown","keydown","touchstart","pointerdown"],c=>{if(!c.cancelable)return;const d={entryType:"first-input",processingStart:Bi(),processingEnd:Bi(),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){gl(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<Wr()-n&&t(c)}}}var Ut;(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"})(Ut||(Ut={}));function wa(e,t){return new $t(n=>{if(!window.PerformanceObserver)return;const r=d=>{const f=Lse(d);f.length>0&&n.notify(f)};let i,o=!0;const a=new PerformanceObserver(St(d=>{o?i=Ar(()=>r(d.getEntries())):r(d.getEntries())}));try{a.observe(t)}catch{if([Ut.RESOURCE,Ut.NAVIGATION,Ut.LONG_TASK,Ut.PAINT].includes(t.type)){t.buffered&&(i=Ar(()=>r(performance.getEntriesByType(t.type))));try{a.observe({entryTypes:[t.type]})}catch{return}}}o=!1,Mse(e);let c;return!Yc(Ut.FIRST_INPUT)&&t.type===Ut.FIRST_INPUT&&({stop:c}=Pse(e,d=>{r([d])})),()=>{a.disconnect(),c&&c(),yo(i)}})}let Tp;function Mse(e){return!Tp&&zse()&&"addEventListener"in performance&&(Tp=Dn(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{Tp?.stop()}}function zse(){return window.performance!==void 0&&"getEntries"in performance}function Yc(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function Lse(e){return e.filter(t=>!Fse(t))}function Fse(e){return e.entryType===Ut.RESOURCE&&(!_E(e.name)||!eF(e))}function wC(e){return e.nodeType===Node.TEXT_NODE}function Use(e){return e.nodeType===Node.COMMENT_NODE}function os(e){return e.nodeType===Node.ELEMENT_NODE}function aF(e){return os(e)&&!!e.shadowRoot}function Vse(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&os(t.host)}function p2e(e){return e.childNodes.length>0||aF(e)}function m2e(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;aF(e)&&t(e.shadowRoot)}function Bse(e){return Vse(e)?e.host:e.parentNode}const sF=100,Hse=100,y$="data-dd-excluded-activity-mutations";function CE(e,t,n,r,i,o){const a=Kse(e,t,n,r);return qse(a,i,o)}function qse(e,t,n){let r,i=!1;const o=Ar(St(()=>f({hadActivity:!1})),sF),a=n!==void 0?Ar(St(()=>f({hadActivity:!0,end:Cr()})),n):void 0,c=e.subscribe(({isBusy:m})=>{yo(o),yo(r);const h=Cr();m||(r=Ar(St(()=>f({hadActivity:!0,end:h})),Hse))}),d=()=>{i=!0,yo(o),yo(r),yo(a),c.unsubscribe()};function f(m){i||(d(),t(m))}return{stop:d}}function Kse(e,t,n,r){return new $t(i=>{const o=[];let a,c=0;return o.push(t.subscribe(f=>{f.every(Gse)||d()}),n.subscribe(d),wa(r,{type:Ut.RESOURCE}).subscribe(f=>{f.some(m=>!M_(r,m.name))&&d()}),e.subscribe(7,f=>{M_(r,f.url)||(a===void 0&&(a=f.requestIndex),c+=1,d())}),e.subscribe(8,f=>{M_(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 M_(e,t){return qb(e.excludedActivityUrls,t)}function Gse(e){const t=e.type==="characterData"?e.target.parentElement:e.target;return!!(t&&os(t)&&t.matches(`[${y$}], [${y$}] *`))}const Xb="data-dd-action-name",lF="Masked Element",cF=[Xb,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],Zse=[dF,Wse],Yse=[dF,Xse,Jse];function Xm(e,t){if(!e.isConnected)return;let n,r=e;for(;r&&r.nodeName!=="HTML";){const i=b$(r,Zse,ele,t,n);if(i)return i;n=b$(r,Yse,tle,t,n)||Jb(Qse(r),n),r=r.parentElement}return n}function uF(e){return/[0-9]/.test(e)}function Wse(e){if(e.id&&!uF(e.id))return`#${CSS.escape(e.id)}`}function Xse(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const r=t[n];if(!uF(r))return`${CSS.escape(e.tagName)}.${CSS.escape(r)}`}}function Jse(e){return CSS.escape(e.tagName)}function dF(e,t){if(t){const r=n(t);if(r)return r}for(const r of cF){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 Qse(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 b$(e,t,n,r,i){for(const o of t){const a=o(e,r);if(a&&n(e,a,i))return Jb(a,i)}}function ele(e,t,n){return e.ownerDocument.querySelectorAll(Jb(t,n)).length===1}function tle(e,t,n){let r;if(n===void 0)r=a=>a.matches(t);else{const a=Jb(`${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 Jb(e,t){return t?`${e}>${t}`:e}const kt={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:cd.ALLOW,MASK:cd.MASK,MASK_USER_INPUT:cd.MASK_USER_INPUT,MASK_UNLESS_ALLOWLISTED:cd.MASK_UNLESS_ALLOWLISTED},fF="data-dd-privacy",h2e="hidden",nle="dd-privacy-",z_="***",g2e="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",rle={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},ile="x";function cc(e){return`[${fF}="${e}"], .${nle}${e}`}function Qb(e,t,n){if(n&&n.has(e))return n.get(e);const r=Bse(e),i=r?Qb(r,t,n):t,o=ale(e),a=ole(o,i);return n&&n.set(e,a),a}function ole(e,t){switch(t){case kt.HIDDEN:case kt.IGNORE:return t}switch(e){case kt.ALLOW:case kt.MASK:case kt.MASK_USER_INPUT:case kt.MASK_UNLESS_ALLOWLISTED:case kt.HIDDEN:case kt.IGNORE:return e;default:return t}}function ale(e){if(os(e)){if(e.tagName==="BASE")return kt.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return kt.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return kt.MASK}if(e.matches(cc(kt.HIDDEN)))return kt.HIDDEN;if(e.matches(cc(kt.MASK)))return kt.MASK;if(e.matches(cc(kt.MASK_UNLESS_ALLOWLISTED)))return kt.MASK_UNLESS_ALLOWLISTED;if(e.matches(cc(kt.MASK_USER_INPUT)))return kt.MASK_USER_INPUT;if(e.matches(cc(kt.ALLOW)))return kt.ALLOW;if(lle(e))return kt.IGNORE}}function pF(e,t){switch(t){case kt.MASK:case kt.HIDDEN:case kt.IGNORE:return!0;case kt.MASK_UNLESS_ALLOWLISTED:return wC(e)?yv(e.parentNode)?!0:!hF(e.textContent||""):yv(e);case kt.MASK_USER_INPUT:return wC(e)?yv(e.parentNode):yv(e);default:return!1}}function sle(e,t,n,r,i){if(r!==kt.MASK&&r!==kt.MASK_UNLESS_ALLOWLISTED||t===fF||cF.includes(t)||t===i.actionNameAttribute)return!1;switch(t){case"title":case"alt":case"placeholder":case"aria-label":case"name":return!0}return!!(e==="A"&&t==="href"||e==="IFRAME"&&t==="srcdoc"||n&&t.startsWith("data-")||(e==="IMG"||e==="SOURCE")&&(t==="src"||t==="srcset"))}function yv(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;const t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!rle[t.tagName]}const mF=e=>e.replace(/\S/g,ile);function v2e(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=z_;else if(a===kt.HIDDEN)i=z_;else if(pF(e,a))if(r==="DATALIST"||r==="SELECT"||r==="OPTGROUP"){if(!i.trim())return}else r==="OPTION"?i=z_:a===kt.MASK_UNLESS_ALLOWLISTED?i=gF(i):i=mF(i);return i}function lle(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 hF(e){var t;return!e||!e.trim()?!0:((t=window.$DD_ALLOW)===null||t===void 0?void 0:t.has(e.toLocaleLowerCase()))||!1}function gF(e,t){return hF(e)?e:t||mF(e)}const vF=Mr,cle=100;function ule(e,t){const n=[];let r=0,i;o(e);function o(d){d.stopObservable.subscribe(a),n.push(d),yo(i),i=Ar(c,vF)}function a(){r===1&&n.every(d=>d.isStopped())&&(r=2,t(n))}function c(){yo(i),r===0&&(r=1,a())}return{tryAppend:d=>r!==0?!1:n.length>0&&!dle(n[n.length-1].event,d.event)?(c(),!1):(o(d),!0),stop:()=>{c()}}}function dle(e,t){return e.target===t.target&&fle(e,t)<=cle&&e.timeStamp-t.timeStamp<=vF}function fle(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function ple(e,t,n=kt.ALLOW){const r=new Map,{actionNameAttribute:i}=t,o=x$(e,Xb)||i&&x$(e,i);return o?{name:o,nameSource:"custom_attribute"}:n===kt.MASK?{name:lF,nameSource:"mask_placeholder"}:w$(e,mle,t,r)||w$(e,hle,t,r)||{name:"",nameSource:"blank"}}function x$(e,t){const n=e.closest(`[${t}]`);if(!n)return;const r=n.getAttribute(t);return bF(yF(r.trim()))}const mle=[(e,t,n)=>{if("labels"in e&&e.labels&&e.labels.length>0)return iy(e.labels[0],t,n)},e=>{if(e.nodeName==="INPUT"){const t=e,n=t.getAttribute("type");if(n==="button"||n==="submit"||n==="reset")return{name:t.value,nameSource:"text_content"}}},(e,t,n)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return iy(e,t,n)},(e,t,n)=>Op(e,"aria-label",t,n),(e,t,n)=>{const r=e.getAttribute("aria-labelledby");if(r)return{name:r.split(/\s+/).map(i=>vle(e,i)).filter(i=>!!i).map(i=>xF(i,t,n)).join(" "),nameSource:"text_content"}},(e,t,n)=>Op(e,"alt",t,n),(e,t,n)=>Op(e,"name",t,n),(e,t,n)=>Op(e,"title",t,n),(e,t,n)=>Op(e,"placeholder",t,n),(e,t,n)=>{if("options"in e&&e.options.length>0)return iy(e.options[0],t,n)}],hle=[(e,t,n)=>iy(e,t,n)],gle=10;function w$(e,t,n,r){let i=e,o=0;for(;o<=gle&&i&&i.nodeName!=="BODY"&&i.nodeName!=="HTML"&&i.nodeName!=="HEAD";){for(const a of t){const c=a(i,n,r);if(c){const{name:d,nameSource:f}=c,m=d&&d.trim();if(m)return{name:bF(yF(m)),nameSource:f}}}if(i.nodeName==="FORM")break;i=i.parentElement,o+=1}}function yF(e){return e.replace(/\s+/g," ")}function bF(e){return e.length>100?`${dE(e,100)} [...]`:e}function vle(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function Op(e,t,n,r){const{enablePrivacyForActionName:i,defaultPrivacyLevel:o}=n;let a=e.getAttribute(t);if(a&&i){const c=Qb(e,o,r);sle(e.tagName,t,a,c,n)&&(a=gF(a,lF))}else a||(a="");return{name:a,nameSource:"standard_attribute"}}function iy(e,t,n){return{name:xF(e,t,n)||"",nameSource:"text_content"}}function xF(e,t,n){if(e.isContentEditable)return;const{enablePrivacyForActionName:r,actionNameAttribute:i,defaultPrivacyLevel:o}=t;if(Zm(hl.USE_TREE_WALKER_FOR_ACTION_NAME))return yle(e,i,r,o,n);if("innerText"in e){let a=e.innerText;const c=d=>{const f=e.querySelectorAll(d);for(let m=0;m<f.length;m+=1){const h=f[m];if("innerText"in h){const v=h.innerText;v&&v.trim().length>0&&(a=a.replace(v,""))}}};return c(`[${Xb}]`),i&&c(`[${i}]`),r&&c(`${cc(kt.HIDDEN)}, ${cc(kt.MASK)}`),a}return e.textContent}function yle(e,t,n,r,i){const o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,c);let a="";for(;o.nextNode();){const d=o.currentNode;if(os(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=Qb(d,r,i);if(n&&f&&pF(d,f))return NodeFilter.FILTER_REJECT;if(os(d)){if(d.hasAttribute(Xb)||t&&d.hasAttribute(t))return NodeFilter.FILTER_REJECT;const m=getComputedStyle(d);if(m.visibility!=="visible"||m.display==="none"||m.contentVisibility&&m.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}function ble(e,{onPointerDown:t,onPointerUp:n}){let r,i={selection:!1,input:!1,scroll:!1},o;const a=[Dn(e,window,"pointerdown",c=>{_$(c)&&(r=S$(),i={selection:!1,input:!1,scroll:!1},o=t(c))},{capture:!0}),Dn(e,window,"selectionchange",()=>{(!r||!S$())&&(i.selection=!0)},{capture:!0}),Dn(e,window,"scroll",()=>{i.scroll=!0},{capture:!0,passive:!0}),Dn(e,window,"pointerup",c=>{if(_$(c)&&o){const d=i;n(o,c,()=>d),o=void 0}},{capture:!0}),Dn(e,window,"input",()=>{i.input=!0},{capture:!0})];return{stop:()=>{a.forEach(c=>c.stop())}}}function S$(){const e=window.getSelection();return!e||e.isCollapsed}function _$(e){return e.target instanceof Element&&e.isPrimary!==!1}const C$=3;function xle(e,t){if(wle(e))return t.addFrustration(Np.RAGE_CLICK),e.some(k$)&&t.addFrustration(Np.DEAD_CLICK),t.hasError&&t.addFrustration(Np.ERROR_CLICK),{isRage:!0};const n=e.some(r=>r.getUserActivity().selection);return e.forEach(r=>{r.hasError&&r.addFrustration(Np.ERROR_CLICK),k$(r)&&!n&&r.addFrustration(Np.DEAD_CLICK)}),{isRage:!1}}function wle(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(C$-1);t+=1)if(e[t+C$-1].event.timeStamp-e[t].event.timeStamp<=Mr)return!0;return!1}const Sle='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 k$(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(Sle)}const wF=10*Mr,im=new Map;function _le(e){const t=im.get(e);return im.delete(e),t}function SF(e,t){im.set(e,t),im.forEach((n,r)=>{Gn(r,Bi())>wF&&im.delete(r)})}const Cle=5*Jr;function kle(e,t,n,r){const i=pf({expireDelay:Cle}),o=new $t;let a;e.subscribe(10,()=>{i.reset()}),e.subscribe(5,m),e.subscribe(11,h=>{h.reason===yd.UNLOADING&&m()});const{stop:c}=ble(r,{onPointerDown:h=>Ele(r,e,t,h,n),onPointerUp:({clickActionBase:h,hadActivityOnPointerDown:v},y,x)=>{jle(r,e,t,n,i,o,f,h,y,x,v)}});return{stop:()=>{m(),o.notify(),c()},actionContexts:{findActionId:h=>i.findAll(h)}};function f(h){if(!a||!a.tryAppend(h)){const v=h.clone();a=ule(h,y=>{Ile(y,v)})}}function m(){a&&a.stop()}}function Ele(e,t,n,r,i){let o;if(e.enablePrivacyForActionName?o=Qb(r.target,e.defaultPrivacyLevel):o=kt.ALLOW,o===kt.HIDDEN)return;const a=Rle(r,o,e);let c=!1;return CE(t,n,i,e,d=>{c=d.hadActivity},sF),{clickActionBase:a,hadActivityOnPointerDown:()=>c}}function jle(e,t,n,r,i,o,a,c,d,f,m){var h;const v=_F(t,i,f,c,d);a(v);const y=(h=c?.target)===null||h===void 0?void 0:h.selector;y&&SF(d.timeStamp,y);const{stop:x}=CE(t,n,r,e,k=>{k.hadActivity&&k.end<v.startClocks.timeStamp?v.discard():k.hadActivity?v.stop(k.end):m()?v.stop(v.startClocks.timeStamp):v.stop()},wF),S=t.subscribe(5,({endClocks:k})=>{v.stop(k.timeStamp)}),C=o.subscribe(()=>{v.stop()});v.stopObservable.subscribe(()=>{S.unsubscribe(),x(),C.unsubscribe()})}function Rle(e,t,n){const r=e.target.getBoundingClientRect(),i=Xm(e.target,n.actionNameAttribute);i&&SF(e.timeStamp,i);const{name:o,nameSource:a}=ple(e.target,n,t);return{type:SE.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 _F(e,t,n,r,i){const o=$r(),a=cr(),c=t.add(o,a.relative),d=oF({lifeCycle:e,isChildEvent:x=>x.action!==void 0&&(Array.isArray(x.action.id)?x.action.id.includes(o):x.action.id===o)});let f=0,m;const h=[],v=new $t;function y(x){f===0&&(m=x,f=1,m?c.close(uE(m)):c.remove(),d.stop(),v.notify())}return{event:i,stop:y,stopObservable:v,get hasError(){return d.eventCounts.errorCount>0},get hasPageActivity(){return m!==void 0},getUserActivity:n,addFrustration:x=>{h.push(x)},startClocks:a,isStopped:()=>f===1||f===2,clone:()=>_F(e,t,n,r,i),validate:x=>{if(y(),f!==1)return;const{resourceCount:S,errorCount:C,longTaskCount:k}=d.eventCounts,E={duration:m&&Gn(a.timeStamp,m),startClocks:a,id:o,frustrationTypes:h,counts:{resourceCount:S,errorCount:C,longTaskCount:k},events:x??[i],event:i,...r};e.notify(0,E),f=2},discard:()=>{y(),f=2}}}function Ile(e,t){const{isRage:n}=xle(e,t);n?(e.forEach(r=>r.discard()),t.stop(Cr()),t.validate(e.map(r=>r.event))):(t.discard(),e.forEach(r=>r.validate()))}function Nle(e,t,n,r,i){const{unsubscribe:o}=e.subscribe(0,d=>{e.notify(12,E$(d))});t.register(0,({startTime:d,eventType:f})=>{if(f!==xt.ERROR&&f!==xt.RESOURCE&&f!==xt.LONG_TASK)return Hi;const m=a.findActionId(d);return m?{type:f,action:{id:m}}:Hi}),t.register(1,({startTime:d})=>({action:{id:a.findActionId(d)}}));let a={findActionId:Jt},c=Jt;return i.trackUserInteractions&&({actionContexts:a,stop:c}=kle(e,n,r,i)),{addAction:d=>{e.notify(12,E$(d))},actionContexts:a,stop:()=>{o(),c()}}}function E$(e){const t=L_(e)?{action:{id:e.id,loading_time:iF(bt(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=is({action:{id:$r(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:xt.ACTION},t),r=L_(e)?e.duration:void 0,i=L_(e)?{events:e.events}:{handlingStack:e.handlingStack};return{rawRumEvent:n,duration:r,startTime:e.startClocks.relative,domainContext:i}}function L_(e){return e.type!==SE.CUSTOM}function Tle(e){const t=aae([$b.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function Ole(e,t){const n=Vie(e,[bm.cspViolation,bm.intervention]).subscribe(r=>t.notify(r));return{stop:()=>{n.unsubscribe()}}}function Ale(e,t,n){const r=new $t;return n.subscribe(i=>{i.type===0&&r.notify(i.error)}),Tle(r),Ole(t,r),r.subscribe(i=>e.notify(14,{error:i})),Dle(e)}function Dle(e){return e.subscribe(14,({error:t})=>{e.notify(12,$le(t))}),{addError:({error:t,handlingStack:n,componentStack:r,startClocks:i,context:o})=>{const a=gE({originalError:t,handlingStack:n,componentStack:r,startClocks:i,nonErrorPrefix:"Provided",source:df.CUSTOM,handling:"handled"});a.context=is(a.context,o),e.notify(14,{error:a})}}}function $le(e){const t={date:e.startClocks.timeStamp,error:{id:$r(),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:xt.ERROR,context:e.context},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const j$=new WeakSet;function Ple(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=>!j$.has(r)).filter(r=>eF(r)&&tF(r)).filter(r=>Mle(r,e.startClocks.relative,CF({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return j$.add(n[0]),n[0].toJSON()}function CF(e){return uf(e.startTime,e.duration)}function Mle(e,t,n){return e.startTime>=t-1&&CF(e)<=uf(n,1)}const zle=2*Jr;function Lle(e){const t=Fle(e)||Ule(e);if(!(!t||t.traceTime<=Wr()-zle))return t.traceId}function Fle(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return kF(t&&t.content,n&&n.content)}function Ule(e){const t=Vle(e);if(t)return kF(gm(t,"trace-id"),gm(t,"trace-time"))}function kF(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function Vle(e){for(let t=0;t<e.childNodes.length;t+=1){const n=R$(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=R$(n);if(r)return r;if(!wC(n))break}}function R$(e){if(e&&Use(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function EF(){if(Yc(Ut.NAVIGATION)){const n=performance.getEntriesByType(Ut.NAVIGATION)[0];if(n)return n}const e=Ble(),t={entryType:Ut.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 Ble(){const e={},t=performance.timing;for(const n in t)if(Km(t[n])){const r=n,i=t[r];e[r]=i===0?0:uE(i)}return e}function Hle(e,t,n=EF){bE(e,"interactive",()=>{const r=n(),i=Object.assign(r.toJSON(),{entryType:Ut.RESOURCE,initiatorType:JL,duration:r.responseEnd,traceId:Lle(document),toJSON:()=>({...i,toJSON:void 0})});t(i)})}const qle=1e3;function Kle(e){const t=new Set,n=e.subscribe(8,r=>{t.add(r),t.size>qle&&(Wm("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 Gle(e,t,n,r=oae(),i=Hle){let o;const a=t.trackEarlyRequests;a?o=Kle(e):e.subscribe(8,f=>{d(()=>Zle(f,t,n))});const c=wa(t,{type:Ut.RESOURCE,buffered:!0}).subscribe(f=>{for(const m of f)(a||!QL(m))&&d(()=>I$(m,t,n,o))});i(t,f=>{d(()=>I$(f,t,n,o))});function d(f){r.push(()=>{const m=f();m&&e.notify(12,m)})}return{stop:()=>{r.stop(),c.unsubscribe()}}}function Zle(e,t,n){const r=Ple(e);return jF(r,e,n,t)}function I$(e,t,n,r){const i=QL(e)&&r?r.getMatchingRequest(e):void 0;return jF(e,i,n,t)}function jF(e,t,n,r){if(!e&&!t)return;const i=t?Jle(t,r):Qle(e,r);if(!r.trackResources&&!i)return;const o=e?Lb(e.startTime):t.startClocks,a=e?bse(e):ece(n,o,t.duration),c=t&&Yle(t,r),d=is({date:o.timeStamp,resource:{id:$r(),duration:bt(a),type:t?t.type===Wb.XHR?Kr.XHR:Kr.FETCH:yse(e),method:t?t.method:void 0,status_code:t?t.status:tce(e.responseStatus),url:t?jse(t.url):e.name,protocol:e&&Sse(e),delivery_type:e&&_se(e),graphql:c},type:xt.RESOURCE,_dd:{discarded:!r.trackResources}},i,e&&Xle(e));return{startTime:o.relative,duration:a,rawRumEvent:d,domainContext:Wle(e,t)}}function Yle(e,t){const n=nF(e.url,t);if(n)return Ise(e,n)}function Wle(e,t){if(t){const n={performanceEntry:e,isAborted:t.isAborted,handlingStack:t.handlingStack};return t.type===Wb.XHR?{xhr:t.xhr,...n}:{requestInput:t.input,requestInit:t.init,response:t.response,error:t.error,...n}}return{performanceEntry:e}}function Xle(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...Cse(e),...xse(e)}}}function Jle(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 Qle(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:ZL().toString(),rule_psr:t.rulePsr}}}function ece(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function tce(e){return e===0?void 0:e}function nce(e,t,n){const{stop:r,eventCounts:i}=oF({lifeCycle:e,isChildEvent:o=>o.view.id===t,onChange:n});return{stop:r,eventCounts:i}}const rce=10*Jr;function ice(e,t,n){return{stop:wa(e,{type:Ut.PAINT,buffered:!0}).subscribe(i=>{const o=i.find(a=>a.name==="first-contentful-paint"&&a.startTime<t.timeStamp&&a.startTime<rce);o&&n(o.startTime)}).unsubscribe}}function oce(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(Gn(e,Bi()))})})}function ace(e,t,n){const r=wa(e,{type:Ut.FIRST_INPUT,buffered:!0}).subscribe(i=>{const o=i.find(a=>a.startTime<t.timeStamp);if(o){const a=Gn(o.startTime,o.processingStart);let c;o.target&&os(o.target)&&(c=Xm(o.target,e.actionNameAttribute)),n({delay:a>=0?a:0,time:o.startTime,targetSelector:c})}});return{stop:()=>{r.unsubscribe()}}}function sce(e,t,n=EF){return uce(e,()=>{const r=n();cce(r)||t(lce(r))})}function lce(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=Bi()?e.responseStart:void 0}}function cce(e){return e.loadEventEnd<=0}function uce(e,t){let n;const{stop:r}=bE(e,"complete",()=>{n=Ar(()=>t())});return{stop:()=>{r(),yo(n)}}}const dce=10*Jr;function fce(e,t,n,r){let i=1/0;const{stop:o}=gl(e,n,["pointerdown","keydown"],d=>{i=d.timeStamp},{capture:!0,once:!0});let a=0;const c=wa(e,{type:Ut.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(d=>{const f=K4(d,m=>m.entryType===Ut.LARGEST_CONTENTFUL_PAINT&&m.startTime<i&&m.startTime<t.timeStamp&&m.startTime<dce&&m.size>a);if(f){let m;f.element&&(m=Xm(f.element,e.actionNameAttribute)),r({value:f.startTime,targetSelector:m,resourceUrl:pce(f)}),a=f.size}});return{stop:()=>{o(),c.unsubscribe()}}}function pce(e){return e.url===""?void 0:e.url}function RF(e,t,n=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:Jt};if(Yc(Ut.VISIBILITY_STATE)){const o=performance.getEntriesByType(Ut.VISIBILITY_STATE).filter(a=>a.name==="hidden").find(a=>a.startTime>=t.relative);if(o)return{timeStamp:o.startTime,stop:Jt}}let r=1/0;const{stop:i}=gl(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 mce(e,t,n,r){const i={},{stop:o}=sce(e,h=>{n(h.loadEvent),i.navigationTimings=h,r()}),a=RF(e,t),{stop:c}=ice(e,a,h=>{i.firstContentfulPaint=h,r()}),{stop:d}=fce(e,a,window,h=>{i.largestContentfulPaint=h,r()}),{stop:f}=ace(e,a,h=>{i.firstInput=h,r()});function m(){o(),c(),d(),f(),a.stop()}return{stop:m,initialViewMetrics:i}}const SC=(e,t)=>e*t,hce=(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:SC(i-n,o-r)},N$=e=>{const t=SC(e.previousRect.width,e.previousRect.height),n=SC(e.currentRect.width,e.currentRect.height),r=hce(e.previousRect,e.currentRect);return t+n-r};function gce(e,t,n){if(!wce())return{stop:Jt};let r=0,i;n({value:0});const o=xce(),a=wa(e,{type:Ut.LAYOUT_SHIFT,buffered:!0}).subscribe(c=>{var d;for(const f of c){if(f.hadRecentInput||f.startTime<t)continue;const{cumulatedValue:m,isMaxValue:h}=o.update(f);if(h){const v=vce(f.sources);i={target:v?.node?new WeakRef(v.node):void 0,time:Gn(t,f.startTime),previousRect:v?.previousRect,currentRect:v?.currentRect,devicePixelRatio:window.devicePixelRatio}}if(m>r){r=m;const v=(d=i?.target)===null||d===void 0?void 0:d.deref();n({value:ld(r,4),targetSelector:v&&Xm(v,e.actionNameAttribute),time:i?.time,previousRect:i?.previousRect?T$(i.previousRect):void 0,currentRect:i?.currentRect?T$(i.currentRect):void 0,devicePixelRatio:i?.devicePixelRatio})}}});return{stop:()=>{a.unsubscribe()}}}function vce(e){let t;for(const n of e)if(n.node&&os(n.node)){const r=N$(n);(!t||N$(t)<r)&&(t=n)}return t}function T$({x:e,y:t,width:n,height:r}){return{x:e,y:t,width:n,height:r}}const yce=5*Mr,bce=Mr;function xce(){let e=0,t,n,r=0;return{update:i=>{const o=t===void 0||i.startTime-n>=bce||i.startTime-t>=yce;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 wce(){return Yc(Ut.LAYOUT_SHIFT)&&"WeakRef"in window}let oy,IF=0,F_=1/0,U_=0;function Sce(){"interactionCount"in performance||oy||(oy=new window.PerformanceObserver(St(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(F_=Math.min(F_,n.interactionId),U_=Math.max(U_,n.interactionId),IF=(U_-F_)/7+1)})})),oy.observe({type:"event",buffered:!0,durationThreshold:0}))}const O$=()=>oy?IF:window.performance.interactionCount||0,A$=10,_ce=1*Jr;function Cce(e,t,n){if(!jce())return{getInteractionToNextPaint:()=>{},setViewEnd:Jt,stop:Jt};const{getViewInteractionCount:r,stopViewInteractionCount:i}=Ece(n);let o=1/0;const a=kce(r);let c=-1,d,f;function m(y){for(const S of y)S.interactionId&&S.startTime>=t&&S.startTime<=o&&a.process(S);const x=a.estimateP98Interaction();x&&x.duration!==c&&(c=x.duration,f=Gn(t,x.startTime),d=_le(x.startTime),!d&&x.target&&os(x.target)&&(d=Xm(x.target,e.actionNameAttribute)))}const h=wa(e,{type:Ut.FIRST_INPUT,buffered:!0}).subscribe(m),v=wa(e,{type:Ut.EVENT,durationThreshold:40,buffered:!0}).subscribe(m);return{getInteractionToNextPaint:()=>{if(c>=0)return{value:Math.min(c,_ce),targetSelector:d,time:f};if(r())return{value:0}},setViewEnd:y=>{o=y,i()},stop:()=>{v.unsubscribe(),h.unsubscribe()}}}function kce(e){const t=[];function n(){t.sort((r,i)=>i.duration-r.duration).splice(A$)}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<A$||r.duration>o.duration)&&(t.push(r),n())},estimateP98Interaction(){const r=Math.min(t.length-1,Math.floor(e()/50));return t[r]}}}function Ece(e){Sce();const t=e===Ja.INITIAL_LOAD?0:O$();let n={stopped:!1};function r(){return O$()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:r(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:r()}}}}function jce(){return Yc(Ut.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function Rce(e,t,n,r,i,o,a){let c=i===Ja.INITIAL_LOAD,d=!0;const f=[],m=RF(r,o);function h(){if(!d&&!c&&f.length>0){const y=Math.max(...f);y<m.timeStamp-o.relative&&a(y)}}const{stop:v}=CE(e,t,n,r,y=>{d&&(d=!1,y.hadActivity&&f.push(Gn(o.timeStamp,y.end)),h())});return{stop:()=>{v(),m.stop()},setLoadEvent:y=>{c&&(c=!1,f.push(y),h())}}}function y2e(){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 Ice(){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 V_;function Nce(e){return V_||(V_=Tce(e)),V_}function Tce(e){return new $t(t=>{const{throttled:n}=Fb(()=>{t.notify(kE())},200);return Dn(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function kE(){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 Oce=Mr;function Ace(e,t,n,r=$ce(e)){let i=0,o=0,a=0;const c=r.subscribe(({scrollDepth:d,scrollTop:f,scrollHeight:m})=>{let h=!1;if(d>i&&(i=d,h=!0),m>o){o=m;const v=Bi();a=Gn(t.relative,v),h=!0}h&&n({maxDepth:Math.min(i,o),maxDepthScrollTop:f,maxScrollHeight:o,maxScrollHeightTime:a})});return{stop:()=>c.unsubscribe()}}function Dce(){const e=Ice(),{height:t}=kE(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),r=Math.round(t+e);return{scrollHeight:n,scrollDepth:r,scrollTop:e}}function $ce(e,t=Oce){return new $t(n=>{function r(){n.notify(Dce())}if(window.ResizeObserver){const i=Fb(r,t,{leading:!1,trailing:!0}),o=document.scrollingElement||document.documentElement,a=new ResizeObserver(St(i.throttled));o&&a.observe(o);const c=Dn(e,window,"scroll",i.throttled,{passive:!0});return()=>{i.cancel(),a.disconnect(),c.stop()}}})}function Pce(e,t,n,r,i,o,a){const c={},{stop:d,setLoadEvent:f}=Rce(e,t,n,r,o,a,S=>{c.loadingTime=S,i()}),{stop:m}=Ace(r,a,S=>{c.scroll=S}),{stop:h}=gce(r,a.relative,S=>{c.cumulativeLayoutShift=S,i()}),{stop:v,getInteractionToNextPaint:y,setViewEnd:x}=Cce(r,a.relative,o);return{stop:()=>{d(),h(),m()},stopINPTracking:v,setLoadEvent:f,setViewEnd:x,getCommonViewMetrics:()=>(c.interactionToNextPaint=y(),c)}}function Mce(e,t){const{stop:n}=Dn(e,window,"pageshow",r=>{r.persisted&&t(r)},{capture:!0});return n}function zce(e,t,n){oce(e.relative,r=>{t.firstContentfulPaint=r,t.largestContentfulPaint={value:r},n()})}const Lce=3e3,Fce=5*Jr,Uce=5*Jr;function Vce(e,t,n,r,i,o,a,c){const d=new Set;let f=v(Ja.INITIAL_LOAD,V4(),c),m;y();let h;a&&(h=x(o),i.trackBfcacheViews&&(m=Mce(i,S=>{f.end();const C=Lb(S.timeStamp);f=v(Ja.BF_CACHE,C,void 0)})));function v(S,C,k){const E=Bce(t,n,r,i,e,S,C,k);return d.add(E),E.stopObservable.subscribe(()=>{d.delete(E)}),E}function y(){t.subscribe(10,()=>{f=v(Ja.ROUTE_CHANGE,void 0,{name:f.name,service:f.service,version:f.version,context:f.contextManager.getContext()})}),t.subscribe(9,()=>{f.end({sessionIsActive:!1})})}function x(S){return S.subscribe(({oldLocation:C,newLocation:k})=>{qce(C,k)&&(f.end(),f=v(Ja.ROUTE_CHANGE))})}return{addTiming:(S,C=Cr())=>{f.addTiming(S,C)},startView:(S,C)=>{f.end({endClocks:C}),f=v(Ja.ROUTE_CHANGE,C,S)},setViewContext:S=>{f.contextManager.setContext(S)},setViewContextProperty:(S,C)=>{f.contextManager.setContextProperty(S,C)},setViewName:S=>{f.setViewName(S)},getViewContext:()=>f.contextManager.getContext(),stop:()=>{h&&h.unsubscribe(),m&&m(),f.end(),d.forEach(S=>S.stop())}}}function Bce(e,t,n,r,i,o,a=cr(),c){const d=$r(),f=new $t,m={};let h=0,v;const y=hm(i),x=Yb();let S=!0,C=c?.name;const k=c?.service||r.service,E=c?.version||r.version,j=c?.context;j&&x.setContext(j);const R={id:d,name:C,startClocks:a,service:k,version:E,context:j};e.notify(1,R),e.notify(2,R);const{throttled:T,cancel:N}=Fb(D,Lce,{leading:!1}),{setLoadEvent:O,setViewEnd:M,stop:L,stopINPTracking:K,getCommonViewMetrics:ee}=Pce(e,t,n,r,te,o,a),{stop:q,initialViewMetrics:Y}=o===Ja.INITIAL_LOAD?mce(r,a,O,te):{stop:Jt,initialViewMetrics:{}};o===Ja.BF_CACHE&&zce(a,Y,te);const{stop:U,eventCounts:H}=nce(e,d,te),z=cf(D,Fce),W=e.subscribe(11,$=>{$.reason===yd.UNLOADING&&D()});D(),x.changeObservable.subscribe(te);function F(){e.notify(3,{id:d,name:C,context:x.getContext(),startClocks:a,sessionIsActive:S})}function te(){F(),T()}function D(){N(),F(),h+=1;const $=v===void 0?Cr():v.timeStamp;e.notify(4,{customTimings:m,documentVersion:h,id:d,name:C,service:k,version:E,context:x.getContext(),loadingType:o,location:y,startClocks:a,commonViewMetrics:ee(),initialViewMetrics:Y,duration:Gn(a.timeStamp,$),isActive:v===void 0,sessionIsActive:S,eventCounts:H})}return{get name(){return C},service:k,version:E,contextManager:x,stopObservable:f,end($={}){var V,A;v||(v=(V=$.endClocks)!==null&&V!==void 0?V:cr(),S=(A=$.sessionIsActive)!==null&&A!==void 0?A:!0,e.notify(5,{endClocks:v}),e.notify(6,{endClocks:v}),zb(z),M(v.relative),L(),W.unsubscribe(),D(),Ar(()=>{this.stop()},Uce))},stop(){q(),U(),K(),f.notify()},addTiming($,V){if(v)return;const A=are(V)?V:Gn(a.timeStamp,V);m[Hce($)]=A,te()},setViewName($){C=$,D()}}}function Hce(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&ht.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function qce(e,t){return e.pathname!==t.pathname||!Kce(t.hash)&&D$(t.hash)!==D$(e.hash)}function Kce(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function D$(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function Gce(e,t,n,r,i,o,a,c,d,f){return e.subscribe(4,m=>e.notify(12,Zce(m,n,c))),t.register(0,({startTime:m,eventType:h})=>{const v=d.findView(m);return v?{type:h,service:v.service,version:v.version,context:v.context,view:{id:v.id,name:v.name}}:vl}),t.register(1,({startTime:m})=>{var h;return{view:{id:(h=d.findView(m))===null||h===void 0?void 0:h.id}}}),Vce(r,e,i,o,n,a,!n.trackViewsManually,f)}function Zce(e,t,n){var r,i,o,a,c,d,f,m,h,v,y,x,S,C,k,E,j,R;const T=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,O={_dd:{document_version:e.documentVersion,replay_stats:T,cls:N?{device_pixel_ratio:N}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:xt.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:bt((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:bt((d=e.initialViewMetrics.navigationTimings)===null||d===void 0?void 0:d.firstByte),dom_complete:bt((f=e.initialViewMetrics.navigationTimings)===null||f===void 0?void 0:f.domComplete),dom_content_loaded:bt((m=e.initialViewMetrics.navigationTimings)===null||m===void 0?void 0:m.domContentLoaded),dom_interactive:bt((h=e.initialViewMetrics.navigationTimings)===null||h===void 0?void 0:h.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:bt(e.initialViewMetrics.firstContentfulPaint),first_input_delay:bt((v=e.initialViewMetrics.firstInput)===null||v===void 0?void 0:v.delay),first_input_time:bt((y=e.initialViewMetrics.firstInput)===null||y===void 0?void 0:y.time),first_input_target_selector:(x=e.initialViewMetrics.firstInput)===null||x===void 0?void 0:x.targetSelector,interaction_to_next_paint:bt((S=e.commonViewMetrics.interactionToNextPaint)===null||S===void 0?void 0:S.value),interaction_to_next_paint_time:bt((C=e.commonViewMetrics.interactionToNextPaint)===null||C===void 0?void 0:C.time),interaction_to_next_paint_target_selector:(k=e.commonViewMetrics.interactionToNextPaint)===null||k===void 0?void 0:k.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:bt((E=e.initialViewMetrics.largestContentfulPaint)===null||E===void 0?void 0:E.value),largest_contentful_paint_target_selector:(j=e.initialViewMetrics.largestContentfulPaint)===null||j===void 0?void 0:j.targetSelector,load_event:bt((R=e.initialViewMetrics.navigationTimings)===null||R===void 0?void 0:R.loadEvent),loading_time:iF(bt(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:Yce(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:bt(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:bt(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:wae()}};return Il(e.customTimings)||(O.view.custom_timings=P4(e.customTimings,bt)),{rawRumEvent:O,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function Yce({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:r,largestContentfulPaint:i}){return{cls:e&&{score:e.value,timestamp:bt(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:bt(n)},fid:r&&{duration:bt(r.delay),timestamp:bt(r.time),target_selector:r.targetSelector},inp:t&&{duration:bt(t.value),timestamp:bt(t.time),target_selector:t.targetSelector},lcp:i&&{timestamp:bt(i.value),target_selector:i.targetSelector,resource_url:i.resourceUrl}}}const Wce="rum";function Xce(e,t,n){const r=$oe(e,Wce,i=>Qce(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 Jce(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:IL("records")?1:0};return{findTrackedSession:()=>e,expire:Jt,expireObservable:new $t,setForcedReplay:Jt}}function Qce(e,t){return eue(t)?t:mc(e.sessionSampleRate)?mc(e.sessionReplaySampleRate)?"1":"2":"0"}function eue(e){return e==="0"||e==="1"||e==="2"}function tue(e,t,n,r,i,o){const a=[e.rumEndpointBuilder];e.replica&&a.push(e.replica.rumEndpointBuilder);const c=NL({encoder:o(2),request:RL(a,n),flushController:TL({pageMayExitObservable:r,sessionExpireObservable:i})});return t.subscribe(13,d=>{d.type===xt.VIEW?c.upsert(d,d.view.id):c.add(d)}),c}function nue(e){const t=Ym();e.subscribe(13,n=>{t.send("rum",n)})}const rue=Kc;function iue(e,t,n,r){const i=pf({expireDelay:rue});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 m=Bi();i.closeActive(m),i.add(c({url:d.href,referrer:f.referrer}),m)}});function c({url:d,referrer:f}){return{url:d,referrer:f}}return t.register(0,({startTime:d,eventType:f})=>{const m=i.find(d);return m?{type:f,view:{url:m.url,referrer:m.referrer}}:vl}),{findUrl:d=>i.find(d),stop:()=>{a.unsubscribe(),i.stop()}}}function oue(e,t){let n=hm(t);return new $t(r=>{const{stop:i}=aue(e,a),{stop:o}=sue(e,a);function a(){if(n.href===t.href)return;const c=hm(t);r.notify({newLocation:c,oldLocation:n}),n=c}return()=>{i(),o()}})}function aue(e,t){const{stop:n}=ga($$("pushState"),"pushState",({onPostCall:o})=>{o(t)}),{stop:r}=ga($$("replaceState"),"replaceState",({onPostCall:o})=>{o(t)}),{stop:i}=Dn(e,window,"popstate",t);return{stop:()=>{n(),r(),i()}}}function sue(e,t){return Dn(e,window,"hashchange",t)}function $$(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const lue=Kc;function cue(e,t,n){const r=pf({expireDelay:lue});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([xt.VIEW,xt.ERROR]).includes(o))return Hi;const c=r.find(i);return!c||Il(c)?Hi:{type:o,feature_flags:c}}),{addFeatureFlagEvaluation:(i,o)=>{const a=r.find();a&&(a[i]=o)}}}const uue=10*Mr;let bd,bv;function due(e,t,n){e.metricsEnabled&&(NF(),bv=!1,t.subscribe(13,()=>{bv=!0}),n.subscribe(({bytesCount:r,messagesCount:i})=>{bv&&(bv=!1,bd.batchCount+=1,M$(bd.batchBytesCount,r),M$(bd.batchMessagesCount,i))}),cf(fue,uue))}function fue(){bd.batchCount!==0&&(Zb("Customer data measures",bd),NF())}function P$(){return{min:1/0,max:0,sum:0}}function M$(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function NF(){bd={batchCount:0,batchBytesCount:P$(),batchMessagesCount:P$()}}const pue=4e3,mue=500,hue=Kc;function gue(e,t,n=mue){const r=pf({expireDelay:hue,maxEntries:pue});let i;Yc(Ut.VISIBILITY_STATE)&&performance.getEntriesByType(Ut.VISIBILITY_STATE).forEach(f=>{const m=f.name==="hidden"?"hidden":"active";a(m,f.startTime)}),a(TF(),Bi());const{stop:o}=gl(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],d=>{a(yue(d),d.timeStamp)},{capture:!0});function a(d,f=Bi()){d!==i&&(i=d,r.closeActive(f),r.add({state:i,startTime:f},f))}function c(d,f,m){return r.findAll(f,m).some(h=>h.state===d)}return e.register(0,({startTime:d,duration:f=0,eventType:m})=>{if(m===xt.VIEW){const h=r.findAll(d,f);return{type:m,_dd:{page_states:vue(h,d,n)}}}return m===xt.ACTION||m===xt.ERROR?{type:m,view:{in_foreground:c("active",d,0)}}:Hi}),{wasInPageStateDuringPeriod:c,addPageState:a,stop:()=>{o(),r.stop()}}}function vue(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:r,startTime:i})=>({state:r,start:bt(Gn(t,i))}))}function yue(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":TF()}function TF(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function bue(e,t){let n;const r=requestAnimationFrame(St(()=>{n=kE()})),i=Nce(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 xue(e,t){const n=window.cookieStore?wue(e):_ue;return new $t(r=>n(t,i=>r.notify(i)))}function wue(e){return(t,n)=>Dn(e,window.cookieStore,"change",i=>{const o=i.changed.find(a=>a.name===t)||i.deleted.find(a=>a.name===t);o&&n(o.value)}).stop}const Sue=Mr;function _ue(e,t){const n=gm(document.cookie,e),r=cf(()=>{const i=gm(document.cookie,e);i!==n&&t(i)},Sue);return()=>{zb(r)}}const z$="datadog-ci-visibility-test-execution-id";function Cue(e,t,n=xue(e,z$)){var r;let i=el(z$)||((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"?Hi:{type:a,session:{type:"ci_test"},ci_test:{test_execution_id:i}}),{stop:()=>{o.unsubscribe()}}}function kue(e,t){const n=wa(t,{type:Ut.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(r=>{for(const i of r){const o=Lb(i.startTime),a={date:o.timeStamp,long_task:{id:$r(),entry_type:BL.LONG_ANIMATION_FRAME,duration:bt(i.duration),blocking_duration:bt(i.blockingDuration),first_ui_event_timestamp:bt(i.firstUIEventTimestamp),render_start:bt(i.renderStart),style_and_layout_start:bt(i.styleAndLayoutStart),start_time:bt(i.startTime),scripts:i.scripts.map(c=>({duration:bt(c.duration),pause_duration:bt(c.pauseDuration),forced_style_and_layout_duration:bt(c.forcedStyleAndLayoutDuration),start_time:bt(c.startTime),execution_start:bt(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:xt.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:o.relative,duration:i.duration,domainContext:{performanceEntry:i}})}});return{stop:()=>n.unsubscribe()}}function Eue(e,t){const n=wa(t,{type:Ut.LONG_TASK,buffered:!0}).subscribe(r=>{for(const i of r){if(i.entryType!==Ut.LONG_TASK||!t.trackLongTasks)break;const o=Lb(i.startTime),a={date:o.timeStamp,long_task:{id:$r(),entry_type:BL.LONG_TASK,duration:bt(i.duration)},type:xt.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:o.relative,duration:i.duration,domainContext:{performanceEntry:i}})}});return{stop(){n.unsubscribe()}}}function jue(e){e.register(0,({eventType:t})=>{if(!PL())return Hi;const n=DL(),r=$L();return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:r,injected:AL()}}})}function Rue(e,t,n){const r=vE(e),i=n(r);return pE(t).forEach(([o,a])=>_C(e,r,o.split(/\.|(?=\[\])/),a)),i}function _C(e,t,n,r){const[i,...o]=n;if(i==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((a,c)=>_C(a,t[c],o,r));return}if(!(!L$(e)||!L$(t))){if(o.length>0)return _C(e[i],t[i],o,r);Iue(e,i,t[i],r)}}function Iue(e,t,n,r){const i=Gc(n);i===r?e[t]=vn(n):r==="object"&&(i==="undefined"||i==="null")&&(e[t]={})}function L$(e){return Gc(e)==="object"}const Yu={"view.name":"string","view.url":"string","view.referrer":"string"},Wu={context:"object"},Xu={service:"string",version:"string"};let OF;function Nue(e,t,n,r,i){OF={[xt.VIEW]:{"view.performance.lcp.resource_url":"string",...Wu,...Yu,...Xu},[xt.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...Wu,...Yu,...Xu},[xt.RESOURCE]:{"resource.url":"string","resource.graphql.variables":"string",...Wu,...Yu,...Xu},[xt.ACTION]:{"action.target.name":"string",...Wu,...Yu,...Xu},[xt.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...Wu,...Yu,...Xu},[xt.VITAL]:{...Wu,...Yu,...Xu}};const o={[xt.ERROR]:T_(xt.ERROR,r,i),[xt.ACTION]:T_(xt.ACTION,r,i),[xt.VITAL]:T_(xt.VITAL,r,i)};t.subscribe(12,({startTime:a,duration:c,rawRumEvent:d,domainContext:f})=>{const m=n.triggerHook(0,{eventType:d.type,startTime:a,duration:c});if(m===vl)return;const h=is(m,d,{ddtags:yL(e).join(",")});Tue(h,e.beforeSend,f,o)&&(Il(h.context)&&delete h.context,t.notify(13,h))})}function Tue(e,t,n,r){var i;if(t){const a=Rue(e,OF[e.type],c=>t(c,n));if(a===!1&&e.type!==xt.VIEW)return!1;a===!1&&ht.warn("Can't dismiss view events using beforeSend!")}return!((i=r[e.type])===null||i===void 0?void 0:i.isLimitReached())}function Oue(e,t,n,r){e.register(0,({eventType:i,startTime:o})=>{const a=t.findTrackedSession(o),c=r.findView(o);if(!a||!c)return vl;let d,f,m;return i===xt.VIEW?(d=n.getReplayStats(c.id)?!0:void 0,f=a.sessionReplay===1,m=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:m}}}),e.register(1,({startTime:i})=>{const o=t.findTrackedSession(i);return o?{session:{id:o.id}}:Hi})}function Aue(e){e.register(0,({eventType:t})=>({type:t,connectivity:xL()}))}function Due(e,t,n){e.register(0,({eventType:r})=>{const i=t.source;return{type:r,_dd:{format_version:2,drift:ire(),configuration:{session_sample_rate:ld(t.sessionSampleRate,3),session_replay_sample_rate:ld(t.sessionReplaySampleRate,3),profiling_sample_rate:ld(t.profilingSampleRate,3),trace_sample_rate:ld(t.traceSampleRate,3),beta_encode_cookie_options:t.betaEncodeCookieOptions},browser_sdk_version:Pd()?"6.25.0":void 0,sdk_name:n},application:{id:t.applicationId},date:Cr(),source:i}}),e.register(1,()=>({application:{id:t.applicationId}}))}function $ue(e,t){e.register(1,()=>t.isGranted()?Hi:vl)}const Pue=hoe,Mue=[xt.ACTION,xt.ERROR,xt.LONG_TASK,xt.RESOURCE,xt.VITAL];function zue(e){return{addEvent:(t,n,r,i)=>{Mue.includes(n.type)&&e.notify(12,{startTime:t,rawRumEvent:n,domainContext:r,duration:i})}}}function Lue(e,t){if(!t.metricsEnabled)return{stop:Jt};const{unsubscribe:n}=e.subscribe(4,({initialViewMetrics:r})=>{!r.largestContentfulPaint||!r.navigationTimings||(Zb("Initial view metrics",{metrics:Fue(r.largestContentfulPaint,r.navigationTimings)}),n())});return{stop:n}}function Fue(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function Uue(e,t,n,r,i,o,a,c,d){const f=[],m=new mse,h=Pue();m.subscribe(13,R=>bL("rum",R));const v=R=>{m.notify(14,{error:R}),Wm("Error reported to customer",{"error.message":R.message})},y=doe(e),x=y.subscribe(R=>{m.notify(11,R)});f.push(()=>x.unsubscribe());const S=xoe("browser-rum-sdk",e,h,v,y,i);f.push(S.stop);const C=Pd()?Jce():Xce(e,m,o);if(Pd())nue(m);else{const R=tue(e,m,v,y,C.expireObservable,i);f.push(()=>R.stop()),due(S,m,R.flushController.flushObservable)}$ue(h,o);const{stop:k}=Lue(m,S);f.push(k);const{stop:E,...j}=Vue(m,h,e,C,t,r,a,c,d,v);return f.push(E),c.unbuffer(),f.push(()=>n.stop()),{...j,lifeCycle:m,session:C,stopSession:()=>C.expire(),telemetry:S,stop:()=>{f.forEach(R=>R())},hooks:h}}function Vue(e,t,n,r,i,o,a,c,d,f){const m=[],h=use(),v=oue(n,location),{observable:y,stop:x}=fse();m.push(x),Due(t,n,d);const S=gue(t,n);m.push(()=>S.stop());const C=gse(e);m.push(()=>C.stop());const k=iue(e,t,v,location);m.push(()=>k.stop());const E=cue(e,t,n);Oue(t,r,i,C),Aue(t);const j=vae(t,n,"rum"),R=yae(t,n,r,"rum"),T=gae(t,n,"rum"),N=Nle(e,t,h,y,n);m.push(N.stop);const O=zue(e),M=bue(t,n);m.push(M.stop);const L=Cue(n,t);m.push(L.stop),jue(t),Nue(n,e,t,f);const{addTiming:K,startView:ee,setViewName:q,setViewContext:Y,setViewContextProperty:U,getViewContext:H,stop:z}=Gce(e,t,n,location,h,y,v,i,C,o);m.push(z);const{stop:W}=Gle(e,n,S);if(m.push(W),n.trackLongTasks)if(Yc(Ut.LONG_ANIMATION_FRAME)){const{stop:$}=kue(e,n);m.push($)}else Eue(e,n);const{addError:F}=Ale(e,n,c);Ase(e,n,r,R,T);const te=_ae(e,S,a),D=pse(n.applicationId,r,C,N.actionContexts,k);return{addAction:N.addAction,addEvent:O.addEvent,addError:F,addTiming:K,addFeatureFlagEvaluation:E.addFeatureFlagEvaluation,startView:ee,setViewContext:Y,setViewContextProperty:U,getViewContext:H,setViewName:q,viewHistory:C,getInternalContext:D.get,startDurationVital:te.startDurationVital,stopDurationVital:te.stopDurationVital,addDurationVital:te.addDurationVital,addOperationStepVital:te.addOperationStepVital,globalContext:j,userContext:R,accountContext:T,stop:()=>m.forEach($=>$())}}function Bue(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=Hue(e),c=`/rum/replay/sessions/${i}`;return`${a}${c}?${o.join("&")}`}function Hue(e){const t=e.site,n=e.subdomain||que(e);return`https://${n?`${n}.`:""}${t}`}function que(e){switch(e.site){case hc:case Yre:return"app";case oL:return"dd";default:return}}const Kue=1e3;let go;function b2e(e){return ex(e).segments_count}function x2e(e){ex(e).segments_count+=1}function w2e(e){ex(e).records_count+=1}function S2e(e,t){ex(e).segments_total_raw_size+=t}function Gue(e){return go?.get(e)}function ex(e){go||(go=new Map);let t;return go.has(e)?t=go.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},go.set(e,t),go.size>Kue&&Zue()),t}function Zue(){if(!go)return;const e=go.keys().next().value;e&&go.delete(e)}function AF(e,t,n){let r=0,i=[],o,a=!0,c=0;const d=[],{stop:f}=Dn(e,t,"message",({data:v})=>{if(v.type!=="wrote"||v.streamId!==n)return;const y=d[0];y&&(y.id===v.id?(d.shift(),r+=v.additionalBytesCount,i.push(v.result),o=v.trailer,y.writeCallback?y.writeCallback(v.result.byteLength):y.finishCallback&&y.finishCallback()):y.id<v.id&&f())});function m(){const v=i.length===0?new Uint8Array(0):fL(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(m())):v(m())},finishSync(){h();const v=d.map(y=>y.data).join("");return d.length=0,{...m(),pendingData:v}},estimateEncodedBytesCount(v){return v.length/8},stop(){f()}}}function EE({configuredUrl:e,error:t,source:n,scriptType:r}){if(ht.error(`${n} failed to start: an error occurred while initializing the ${r}:`,t),t instanceof Event||t instanceof Error&&Yue(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.",ht.error(`${i} See documentation at ${Pb}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else r==="worker"&&yE(t)}function Yue(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const Wue=30*Mr;function DF(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){if(1===t.length)return t[0];const e=t.reduce((t,e)=>t+e.length,0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!==--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return-1^t},O={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=L(t.adler,e,r,a):2===t.state.wrap&&(t.adler=T(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!==--r);return s<=t.lookahead?s:t.lookahead},at=function(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-J)){t.window.set(t.window.subarray(s,s+s),0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--a);e=a=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=tt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},nt=function(t,e){for(var a,n;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},rt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function it(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var st=[new it(0,0,0,0,function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)}),new it(4,4,8,4,nt),new it(4,5,16,8,nt),new it(4,6,32,32,nt),new it(4,4,16,16,rt),new it(8,16,32,32,rt),new it(8,16,128,128,rt),new it(8,32,128,256,rt),new it(32,128,258,1024,rt),new it(32,258,258,4096,rt)];function ht(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var lt=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=st[e.level].max_lazy,e.good_match=st[e.level].good_length,e.nice_match=st[e.level].nice_length,e.max_chain_length=st[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},_t=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(at(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(at(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):st[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},ot=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},dt=new Uint8Array(256),ut=0;ut<256;ut++)dt[ut]=ut>=252?6:ut>=248?5:ut>=240?4:ut>=224?3:ut>=192?2:1;dt[254]=dt[254]=1;var ft=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ct=Object.prototype.toString;function pt(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new ht;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,lt(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ct.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,at(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,at(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function gt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function vt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}pt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ct.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=_t(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=ot(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},pt.prototype.onData=function(t){this.chunks.push(t)},pt.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.25.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 Kn={status:0};function $F(e,t,n,r=DF){switch(Kn.status===0&&Xue(e,t,r),Kn.status){case 1:return Kn.initializationFailureCallbacks.push(n),Kn.worker;case 3:return Kn.worker}}function F$(){return Kn.status}function Xue(e,t,n=DF){try{const r=n(e),{stop:i}=Dn(e,r,"error",c=>{B_(e,t,c)}),{stop:o}=Dn(e,r,"message",({data:c})=>{c.type==="errored"?B_(e,t,c.error,c.streamId):c.type==="initialized"&&Que(c.version)});r.postMessage({action:"init"}),Ar(()=>Jue(t),Wue),Kn={status:1,worker:r,stop:()=>{i(),o()},initializationFailureCallbacks:[]}}catch(r){B_(e,t,r)}}function Jue(e){Kn.status===1&&(ht.error(`${e} failed to start: a timeout occurred while initializing the Worker`),Kn.initializationFailureCallbacks.forEach(t=>t()),Kn={status:2})}function Que(e){Kn.status===1&&(Kn={status:3,worker:Kn.worker,stop:Kn.stop,version:e})}function B_(e,t,n,r){Kn.status===1||Kn.status===0?(EE({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),Kn.status===1&&Kn.initializationFailureCallbacks.forEach(i=>i()),Kn={status:2}):yE(n,{worker_version:Kn.status===3&&Kn.version,stream_id:r})}function PF(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function ede(e,t,n,r){const i=t.findTrackedSession(),o=tde(i,r),a=n.findView();return Bue(e,{viewContext:a,errorType:o,session:i})}function tde(e,t){if(!PF())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 nde(e,t){if(!e.metricsEnabled)return{stop:Jt};let n,r,i;const{unsubscribe:o}=t.subscribe(a=>{switch(a.type){case"start":n={forced:a.forced,timestamp:Cr()},r=void 0,i=void 0;break;case"document-ready":n&&(r=Gn(n.timestamp,Cr()));break;case"recorder-settled":n&&(i=Gn(n.timestamp,Cr()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":o(),n&&Zb("Recorder init metrics",{metrics:rde(n.forced,i,Gn(n.timestamp,Cr()),a.type,r)});break}});return{stop:o}}function rde(e,t,n,r,i){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:n,result:r,waitForDocReadyDuration:i}}function ide(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 $t;nde(a,f);const m=async y=>{f.notify({type:"start",forced:y});const[x]=await Promise.all([U$(f,{type:"recorder-settled"},i()),U$(f,{type:"document-ready"},Hoe(e,"interactive"))]);if(c!==2){f.notify({type:"aborted"});return}if(!x){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}=x(t,e,n,r,S,a)),c=3,f.notify({type:"succeeded"})};function h(y){const x=n.findTrackedSession();if(ode(x,y)){c=1;return}if(ade(c))return;c=2;const S=sde(x,y)||!1;m(S).catch(ml),S&&n.setForcedReplay()}function v(){c===3&&d?.(),c=0}return{start:h,stop:v,getSessionReplayLink(){return ede(e,n,r,c!==0)},isRecording:()=>c===3}}function ode(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function ade(e){return e===2||e===3}function sde(e,t){return t&&t.force&&e.sessionReplay===0}async function U$(e,t,n){try{return await n}finally{e.notify(t)}}function lde(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:Jt},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function cde(e,t){if(Pd()&&!IL("records")||!PF())return{start:Jt,stop:Jt,getReplayStats:()=>{},onRumStart:Jt,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:r}=lde();return{start:o=>n.start(o),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:i,isRecording:()=>F$()===3&&n.isRecording(),getReplayStats:o=>F$()===3?Gue(o):void 0};function i(o,a,c,d,f,m){let h;function v(){return h||(f??(f=$F(a,"Datadog Session Replay",()=>{n.stop()},t)),f&&(h=AF(a,f,1))),h}n=ide(a,o,c,d,e,v,m),r(a)&&n.start()}}const ude="modulepreload",dde=function(e){return"/"+e},V$={},Jm=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let d=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");i=d(n.map(f=>{if(f=dde(f),f in V$)return;V$[f]=!0;const m=f.endsWith(".css"),h=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${h}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":ude,m||(v.as="script"),v.crossOrigin="",v.href=f,c&&v.setAttribute("nonce",c),document.head.appendChild(v),m)return new Promise((y,x)=>{v.addEventListener("load",y),v.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(a){const 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 fde(e=pde){try{return await e()}catch(t){EE({error:t,source:"Recorder",scriptType:"module"})}}async function pde(){return(await Jm(()=>import("./startRecording-IOmSWGHg.js"),[])).startRecording}function mde(){return Ro().Profiler!==void 0}const hde=e=>{let t={status:"starting"};return e.register(0,({eventType:n})=>n!==xt.VIEW&&n!==xt.LONG_TASK?Hi:{type:n,_dd:{profiling:t}}),{get:()=>t,set:n=>{t=n}}};async function gde(e=vde){try{return await e()}catch(t){EE({error:t,source:"Profiler",scriptType:"module"})}}async function vde(){return(await Jm(()=>import("./profiler-Cnhc6FqT.js"),[])).createRumProfiler}function yde(){let e;function t(n,r,i,o,a,c){const d=o.findTrackedSession();if(!d||!GL(d.id,i.profilingSampleRate))return;const f=hde(r);if(!mde()){f.set({status:"error",error_reason:"not-supported-by-browser"});return}gde().then(m=>{if(!m){Wm("[DD_RUM] Failed to lazy load the RUM Profiler"),f.set({status:"error",error_reason:"failed-to-lazy-load"});return}e=m(i,n,o,f,c),e.start(a.findView())}).catch(ml)}return{onRumStart:t,stop:()=>{e?.stop().catch(ml)}}}const bde=cde(fde),xde=yde(),wde=lse(Uue,bde,xde,{startDeflateWorker:$F,createDeflateEncoder:AF,sdkName:"rum"});Uie(Ro(),"DD_RUM",wde);function ay(e,t){ym("react error"),cr()}const B$={didCatch:!1,error:null};class _2e extends Q.Component{constructor(t){super(t),this.resetError=()=>{this.setState(B$)},this.state=B$}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}componentDidCatch(t,n){ay()}render(){return this.state.didCatch?Q.createElement(this.props.fallback,{error:this.state.error,resetError:this.resetError}):this.props.children}}let H$=!1;function Sde(){b.useEffect(()=>{H$||(H$=!0)},[])}function _de(){return u.jsx(u.Fragment,{children:u.jsx(kl,{})})}const tx=oQ()({component:_de});function Cde(){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 jE(){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 kde(e,t){const n=b.createContext(t),r=o=>{const{children:a,...c}=o,d=b.useMemo(()=>c,Object.values(c));return u.jsx(n.Provider,{value:d,children:a})};r.displayName=e+"Provider";function i(o){const a=b.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function Xi(e,t=[]){let n=[];function r(o,a){const c=b.createContext(a),d=n.length;n=[...n,a];const f=h=>{const{scope:v,children:y,...x}=h,S=v?.[e]?.[d]||c,C=b.useMemo(()=>x,Object.values(x));return u.jsx(S.Provider,{value:C,children:y})};f.displayName=o+"Provider";function m(h,v){const y=v?.[e]?.[d]||c,x=b.useContext(y);if(x)return x;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,m]}const i=()=>{const o=n.map(a=>b.createContext(a));return function(c){const d=c?.[e]||o;return b.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return i.scopeName=e,[r,Ede(i,...t)]}function Ede(...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 b.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function Md(e){const t=jde(e),n=b.forwardRef((r,i)=>{const{children:o,...a}=r,c=b.Children.toArray(o),d=c.find(Ide);if(d){const f=d.props.children,m=c.map(h=>h===d?b.Children.count(f)>1?b.Children.only(null):b.isValidElement(f)?f.props.children:null:h);return u.jsx(t,{...a,ref:i,children:b.isValidElement(f)?b.cloneElement(f,void 0,m):null})}return u.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function jde(e){const t=b.forwardRef((n,r)=>{const{children:i,...o}=n;if(b.isValidElement(i)){const a=Tde(i),c=Nde(o,i.props);return i.type!==b.Fragment&&(c.ref=r?lf(r,a):a),b.cloneElement(i,c)}return b.Children.count(i)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var MF=Symbol("radix.slottable");function Rde(e){const t=({children:n})=>u.jsx(u.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=MF,t}function Ide(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===MF}function Nde(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 Tde(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 Ode=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ye=Ode.reduce((e,t)=>{const n=Md(`Primitive.${t}`),r=b.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 Ty(e,t){e&&of.flushSync(()=>e.dispatchEvent(t))}var nr=globalThis?.document?b.useLayoutEffect:()=>{},Ade=Gk[" useInsertionEffect ".trim().toString()]||nr;function qo({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=Dde({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:i;{const m=b.useRef(e!==void 0);b.useEffect(()=>{const h=m.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.`),m.current=c},[c,r])}const f=b.useCallback(m=>{if(c){const h=$de(m)?m(e):m;h!==e&&a.current?.(h)}else o(m)},[c,e,o,a]);return[d,f]}function Dde({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),i=b.useRef(n),o=b.useRef(t);return Ade(()=>{o.current=t},[t]),b.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function $de(e){return typeof e=="function"}var Pde=b.createContext(void 0);function Wc(e){const t=b.useContext(Pde);return e||t||"ltr"}function Mde(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var ir=e=>{const{present:t,children:n}=e,r=zde(t),i=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),o=ft(r.ref,Lde(i));return typeof n=="function"||r.isPresent?b.cloneElement(i,{ref:o}):null};ir.displayName="Presence";function zde(e){const[t,n]=b.useState(),r=b.useRef(null),i=b.useRef(e),o=b.useRef("none"),a=e?"mounted":"unmounted",[c,d]=Mde(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const f=xv(r.current);o.current=c==="mounted"?f:"none"},[c]),nr(()=>{const f=r.current,m=i.current;if(m!==e){const v=o.current,y=xv(f);e?d("MOUNT"):y==="none"||f?.display==="none"?d("UNMOUNT"):d(m&&v!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),nr(()=>{if(t){let f;const m=t.ownerDocument.defaultView??window,h=y=>{const S=xv(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&S&&(d("ANIMATION_END"),!i.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",f=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},v=y=>{y.target===t&&(o.current=xv(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{m.clearTimeout(f),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:b.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function xv(e){return e?.animationName||"none"}function Lde(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 Fde=Gk[" useId ".trim().toString()]||(()=>{}),Ude=0;function Fi(e){const[t,n]=b.useState(Fde());return nr(()=>{n(r=>r??String(Ude++))},[e]),t?`radix-${t}`:""}function Qm(e){const t=e+"CollectionProvider",[n,r]=Xi(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=S=>{const{scope:C,children:k}=S,E=Q.useRef(null),j=Q.useRef(new Map).current;return u.jsx(i,{scope:C,itemMap:j,collectionRef:E,children:k})};a.displayName=t;const c=e+"CollectionSlot",d=Md(c),f=Q.forwardRef((S,C)=>{const{scope:k,children:E}=S,j=o(c,k),R=ft(C,j.collectionRef);return u.jsx(d,{ref:R,children:E})});f.displayName=c;const m=e+"CollectionItemSlot",h="data-radix-collection-item",v=Md(m),y=Q.forwardRef((S,C)=>{const{scope:k,children:E,...j}=S,R=Q.useRef(null),T=ft(C,R),N=o(m,k);return Q.useEffect(()=>(N.itemMap.set(R,{ref:R,...j}),()=>{N.itemMap.delete(R)})),u.jsx(v,{[h]:"",ref:T,children:E})});y.displayName=m;function x(S){const C=o(e+"CollectionConsumer",S);return Q.useCallback(()=>{const E=C.collectionRef.current;if(!E)return[];const j=Array.from(E.querySelectorAll(`[${h}]`));return Array.from(C.itemMap.values()).sort((N,O)=>j.indexOf(N.ref.current)-j.indexOf(O.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:a,Slot:f,ItemSlot:y},x,r]}function In(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>t.current?.(...n),[])}function Vde(e,t=globalThis?.document){const n=In(e);b.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Bde="DismissableLayer",CC="dismissableLayer.update",Hde="dismissableLayer.pointerDownOutside",qde="dismissableLayer.focusOutside",q$,zF=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),mf=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...d}=e,f=b.useContext(zF),[m,h]=b.useState(null),v=m?.ownerDocument??globalThis?.document,[,y]=b.useState({}),x=ft(t,O=>h(O)),S=Array.from(f.layers),[C]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),k=S.indexOf(C),E=m?S.indexOf(m):-1,j=f.layersWithOutsidePointerEventsDisabled.size>0,R=E>=k,T=Zde(O=>{const M=O.target,L=[...f.branches].some(K=>K.contains(M));!R||L||(i?.(O),a?.(O),O.defaultPrevented||c?.())},v),N=Yde(O=>{const M=O.target;[...f.branches].some(K=>K.contains(M))||(o?.(O),a?.(O),O.defaultPrevented||c?.())},v);return Vde(O=>{E===f.layers.size-1&&(r?.(O),!O.defaultPrevented&&c&&(O.preventDefault(),c()))},v),b.useEffect(()=>{if(m)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(q$=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),K$(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=q$)}},[m,v,n,f]),b.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),K$())},[m,f]),b.useEffect(()=>{const O=()=>y({});return document.addEventListener(CC,O),()=>document.removeEventListener(CC,O)},[]),u.jsx(Ye.div,{...d,ref:x,style:{pointerEvents:j?R?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,N.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,T.onPointerDownCapture)})});mf.displayName=Bde;var Kde="DismissableLayerBranch",Gde=b.forwardRef((e,t)=>{const n=b.useContext(zF),r=b.useRef(null),i=ft(t,r);return b.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(Ye.div,{...e,ref:i})});Gde.displayName=Kde;function Zde(e,t=globalThis?.document){const n=In(e),r=b.useRef(!1),i=b.useRef(()=>{});return b.useEffect(()=>{const o=c=>{if(c.target&&!r.current){let d=function(){LF(Hde,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 Yde(e,t=globalThis?.document){const n=In(e),r=b.useRef(!1);return b.useEffect(()=>{const i=o=>{o.target&&!r.current&&LF(qde,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 K$(){const e=new CustomEvent(CC);document.dispatchEvent(e)}function LF(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?Ty(i,o):i.dispatchEvent(o)}function RE(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var FF=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"}),Wde="VisuallyHidden",UF=b.forwardRef((e,t)=>u.jsx(Ye.span,{...e,ref:t,style:{...FF,...e.style}}));UF.displayName=Wde;var VF=UF,Xc="NavigationMenu",[IE,BF,Xde]=Qm(Xc),[kC,Jde,Qde]=Qm(Xc),[NE]=Xi(Xc,[Xde,Qde]),[efe,Io]=NE(Xc),[tfe,nfe]=NE(Xc),HF=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:o,delayDuration:a=200,skipDelayDuration:c=300,orientation:d="horizontal",dir:f,...m}=e,[h,v]=b.useState(null),y=ft(t,L=>v(L)),x=Wc(f),S=b.useRef(0),C=b.useRef(0),k=b.useRef(0),[E,j]=b.useState(!0),[R,T]=qo({prop:r,onChange:L=>{const K=L!=="",ee=c>0;K?(window.clearTimeout(k.current),ee&&j(!1)):(window.clearTimeout(k.current),k.current=window.setTimeout(()=>j(!0),c)),i?.(L)},defaultProp:o??"",caller:Xc}),N=b.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>T(""),150)},[T]),O=b.useCallback(L=>{window.clearTimeout(C.current),T(L)},[T]),M=b.useCallback(L=>{R===L?window.clearTimeout(C.current):S.current=window.setTimeout(()=>{window.clearTimeout(C.current),T(L)},a)},[R,T,a]);return b.useEffect(()=>()=>{window.clearTimeout(S.current),window.clearTimeout(C.current),window.clearTimeout(k.current)},[]),u.jsx(qF,{scope:n,isRootMenu:!0,value:R,dir:x,orientation:d,rootNavigationMenu:h,onTriggerEnter:L=>{window.clearTimeout(S.current),E?M(L):O(L)},onTriggerLeave:()=>{window.clearTimeout(S.current),N()},onContentEnter:()=>window.clearTimeout(C.current),onContentLeave:N,onItemSelect:L=>{T(K=>K===L?"":L)},onItemDismiss:()=>T(""),children:u.jsx(Ye.nav,{"aria-label":"Main","data-orientation":d,dir:x,...m,ref:y})})});HF.displayName=Xc;var EC="NavigationMenuSub",rfe=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",...c}=e,d=Io(EC,n),[f,m]=qo({prop:r,onChange:i,defaultProp:o??"",caller:EC});return u.jsx(qF,{scope:n,isRootMenu:!1,value:f,dir:d.dir,orientation:a,rootNavigationMenu:d.rootNavigationMenu,onTriggerEnter:h=>m(h),onItemSelect:h=>m(h),onItemDismiss:()=>m(""),children:u.jsx(Ye.div,{"data-orientation":a,...c,ref:t})})});rfe.displayName=EC;var qF=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:i,orientation:o,children:a,value:c,onItemSelect:d,onItemDismiss:f,onTriggerEnter:m,onTriggerLeave:h,onContentEnter:v,onContentLeave:y}=e,[x,S]=b.useState(null),[C,k]=b.useState(new Map),[E,j]=b.useState(null);return u.jsx(efe,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:c,previousValue:RE(c),baseId:Fi(),dir:i,orientation:o,viewport:x,onViewportChange:S,indicatorTrack:E,onIndicatorTrackChange:j,onTriggerEnter:In(m),onTriggerLeave:In(h),onContentEnter:In(v),onContentLeave:In(y),onItemSelect:In(d),onItemDismiss:In(f),onViewportContentChange:b.useCallback((R,T)=>{k(N=>(N.set(R,T),new Map(N)))},[]),onViewportContentRemove:b.useCallback(R=>{k(T=>T.has(R)?(T.delete(R),new Map(T)):T)},[]),children:u.jsx(IE.Provider,{scope:t,children:u.jsx(tfe,{scope:t,items:C,children:a})})})},KF="NavigationMenuList",GF=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Io(KF,n),o=u.jsx(Ye.ul,{"data-orientation":i.orientation,...r,ref:t});return u.jsx(Ye.div,{style:{position:"relative"},ref:i.onIndicatorTrackChange,children:u.jsx(IE.Slot,{scope:n,children:i.isRootMenu?u.jsx(eU,{asChild:!0,children:o}):o})})});GF.displayName=KF;var ZF="NavigationMenuItem",[ife,YF]=NE(ZF),WF=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...i}=e,o=Fi(),a=r||o||"LEGACY_REACT_AUTO_VALUE",c=b.useRef(null),d=b.useRef(null),f=b.useRef(null),m=b.useRef(()=>{}),h=b.useRef(!1),v=b.useCallback((x="start")=>{if(c.current){m.current();const S=RC(c.current);S.length&&AE(x==="start"?S:S.reverse())}},[]),y=b.useCallback(()=>{if(c.current){const x=RC(c.current);x.length&&(m.current=mfe(x))}},[]);return u.jsx(ife,{scope:n,value:a,triggerRef:d,contentRef:c,focusProxyRef:f,wasEscapeCloseRef:h,onEntryKeyDown:v,onFocusProxyEnter:v,onRootContentClose:y,onContentFocusOutside:y,children:u.jsx(Ye.li,{...i,ref:t})})});WF.displayName=ZF;var jC="NavigationMenuTrigger",ofe=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...i}=e,o=Io(jC,e.__scopeNavigationMenu),a=YF(jC,e.__scopeNavigationMenu),c=b.useRef(null),d=ft(c,a.triggerRef,t),f=nU(o.baseId,a.value),m=rU(o.baseId,a.value),h=b.useRef(!1),v=b.useRef(!1),y=a.value===o.value;return u.jsxs(u.Fragment,{children:[u.jsx(IE.ItemSlot,{scope:n,value:a.value,children:u.jsx(tU,{asChild:!0,children:u.jsx(Ye.button,{id:f,disabled:r,"data-disabled":r?"":void 0,"data-state":DE(y),"aria-expanded":y,"aria-controls":m,...i,ref:d,onPointerEnter:Re(e.onPointerEnter,()=>{v.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:Re(e.onPointerMove,Oy(()=>{r||v.current||a.wasEscapeCloseRef.current||h.current||(o.onTriggerEnter(a.value),h.current=!0)})),onPointerLeave:Re(e.onPointerLeave,Oy(()=>{r||(o.onTriggerLeave(),h.current=!1)})),onClick:Re(e.onClick,()=>{o.onItemSelect(a.value),v.current=y}),onKeyDown:Re(e.onKeyDown,x=>{const C={horizontal:"ArrowDown",vertical:o.dir==="rtl"?"ArrowLeft":"ArrowRight"}[o.orientation];y&&x.key===C&&(a.onEntryKeyDown(),x.preventDefault())})})})}),y&&u.jsxs(u.Fragment,{children:[u.jsx(VF,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:x=>{const S=a.contentRef.current,C=x.relatedTarget,k=C===c.current,E=S?.contains(C);(k||!E)&&a.onFocusProxyEnter(k?"start":"end")}}),o.viewport&&u.jsx("span",{"aria-owns":m})]})]})});ofe.displayName=jC;var afe="NavigationMenuLink",G$="navigationMenu.linkSelect",XF=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:i,...o}=e;return u.jsx(tU,{asChild:!0,children:u.jsx(Ye.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...o,ref:t,onClick:Re(e.onClick,a=>{const c=a.target,d=new CustomEvent(G$,{bubbles:!0,cancelable:!0});if(c.addEventListener(G$,f=>i?.(f),{once:!0}),Ty(c,d),!d.defaultPrevented&&!a.metaKey){const f=new CustomEvent(sy,{bubbles:!0,cancelable:!0});Ty(c,f)}},{checkForDefaultPrevented:!1})})})});XF.displayName=afe;var TE="NavigationMenuIndicator",sfe=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Io(TE,e.__scopeNavigationMenu),o=!!i.value;return i.indicatorTrack?tE.createPortal(u.jsx(ir,{present:n||o,children:u.jsx(lfe,{...r,ref:t})}),i.indicatorTrack):null});sfe.displayName=TE;var lfe=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Io(TE,n),o=BF(n),[a,c]=b.useState(null),[d,f]=b.useState(null),m=i.orientation==="horizontal",h=!!i.value;b.useEffect(()=>{const x=o().find(S=>S.value===i.value)?.ref.current;x&&c(x)},[o,i.value]);const v=()=>{a&&f({size:m?a.offsetWidth:a.offsetHeight,offset:m?a.offsetLeft:a.offsetTop})};return IC(a,v),IC(i.indicatorTrack,v),d?u.jsx(Ye.div,{"aria-hidden":!0,"data-state":h?"visible":"hidden","data-orientation":i.orientation,...r,ref:t,style:{position:"absolute",...m?{left:0,width:d.size+"px",transform:`translateX(${d.offset}px)`}:{top:0,height:d.size+"px",transform:`translateY(${d.offset}px)`},...r.style}}):null}),zd="NavigationMenuContent",cfe=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Io(zd,e.__scopeNavigationMenu),o=YF(zd,e.__scopeNavigationMenu),a=ft(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(ufe,{forceMount:n,...d,ref:a}):u.jsx(ir,{present:n||c,children:u.jsx(JF,{"data-state":DE(c),...d,ref:a,onPointerEnter:Re(e.onPointerEnter,i.onContentEnter),onPointerLeave:Re(e.onPointerLeave,Oy(i.onContentLeave)),style:{pointerEvents:!c&&i.isRootMenu?"none":void 0,...d.style}})})});cfe.displayName=zd;var ufe=b.forwardRef((e,t)=>{const n=Io(zd,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:i}=n;return nr(()=>{r(e.value,{ref:t,...e})},[e,t,r]),nr(()=>()=>i(e.value),[e.value,i]),null}),sy="navigationMenu.rootContentDismiss",JF=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:i,focusProxyRef:o,wasEscapeCloseRef:a,onRootContentClose:c,onContentFocusOutside:d,...f}=e,m=Io(zd,n),h=b.useRef(null),v=ft(h,t),y=nU(m.baseId,r),x=rU(m.baseId,r),S=BF(n),C=b.useRef(null),{onItemDismiss:k}=m;b.useEffect(()=>{const j=h.current;if(m.isRootMenu&&j){const R=()=>{k(),c(),j.contains(document.activeElement)&&i.current?.focus()};return j.addEventListener(sy,R),()=>j.removeEventListener(sy,R)}},[m.isRootMenu,e.value,i,k,c]);const E=b.useMemo(()=>{const R=S().map(K=>K.value);m.dir==="rtl"&&R.reverse();const T=R.indexOf(m.value),N=R.indexOf(m.previousValue),O=r===m.value,M=N===R.indexOf(r);if(!O&&!M)return C.current;const L=(()=>{if(T!==N){if(O&&N!==-1)return T>N?"from-end":"from-start";if(M&&T!==-1)return T>N?"to-start":"to-end"}return null})();return C.current=L,L},[m.previousValue,m.value,m.dir,S,r]);return u.jsx(eU,{asChild:!0,children:u.jsx(mf,{id:x,"aria-labelledby":y,"data-motion":E,"data-orientation":m.orientation,...f,ref:v,disableOutsidePointerEvents:!1,onDismiss:()=>{const j=new Event(sy,{bubbles:!0,cancelable:!0});h.current?.dispatchEvent(j)},onFocusOutside:Re(e.onFocusOutside,j=>{d();const R=j.target;m.rootNavigationMenu?.contains(R)&&j.preventDefault()}),onPointerDownOutside:Re(e.onPointerDownOutside,j=>{const R=j.target,T=S().some(O=>O.ref.current?.contains(R)),N=m.isRootMenu&&m.viewport?.contains(R);(T||N||!m.isRootMenu)&&j.preventDefault()}),onKeyDown:Re(e.onKeyDown,j=>{const R=j.altKey||j.ctrlKey||j.metaKey;if(j.key==="Tab"&&!R){const N=RC(j.currentTarget),O=document.activeElement,M=N.findIndex(ee=>ee===O),K=j.shiftKey?N.slice(0,M).reverse():N.slice(M+1,N.length);AE(K)?j.preventDefault():o.current?.focus()}}),onEscapeKeyDown:Re(e.onEscapeKeyDown,j=>{a.current=!0})})})}),OE="NavigationMenuViewport",QF=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=!!Io(OE,e.__scopeNavigationMenu).value;return u.jsx(ir,{present:n||o,children:u.jsx(dfe,{...r,ref:t})})});QF.displayName=OE;var dfe=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...i}=e,o=Io(OE,n),a=ft(t,o.onViewportChange),c=nfe(zd,e.__scopeNavigationMenu),[d,f]=b.useState(null),[m,h]=b.useState(null),v=d?d?.width+"px":void 0,y=d?d?.height+"px":void 0,x=!!o.value,S=x?o.value:o.previousValue;return IC(m,()=>{m&&f({width:m.offsetWidth,height:m.offsetHeight})}),u.jsx(Ye.div,{"data-state":DE(x),"data-orientation":o.orientation,...i,ref:a,style:{pointerEvents:!x&&o.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":v,"--radix-navigation-menu-viewport-height":y,...i.style},onPointerEnter:Re(e.onPointerEnter,o.onContentEnter),onPointerLeave:Re(e.onPointerLeave,Oy(o.onContentLeave)),children:Array.from(c.items).map(([k,{ref:E,forceMount:j,...R}])=>{const T=S===k;return u.jsx(ir,{present:j||T,children:u.jsx(JF,{...R,ref:lf(E,N=>{T&&N&&h(N)})})},k)})})}),ffe="FocusGroup",eU=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Io(ffe,n);return u.jsx(kC.Provider,{scope:n,children:u.jsx(kC.Slot,{scope:n,children:u.jsx(Ye.div,{dir:i.dir,...r,ref:t})})})}),Z$=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],pfe="FocusGroupItem",tU=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Jde(n),o=Io(pfe,n);return u.jsx(kC.ItemSlot,{scope:n,children:u.jsx(Ye.button,{...r,ref:t,onKeyDown:Re(e.onKeyDown,a=>{if(["Home","End",...Z$].includes(a.key)){let d=i().map(h=>h.ref.current);if([o.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&d.reverse(),Z$.includes(a.key)){const h=d.indexOf(a.currentTarget);d=d.slice(h+1)}setTimeout(()=>AE(d)),a.preventDefault()}})})})});function RC(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 AE(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function mfe(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 IC(e,t){const n=In(t);nr(()=>{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 nU(e,t){return`${e}-trigger-${t}`}function rU(e,t){return`${e}-content-${t}`}function Oy(e){return t=>t.pointerType==="mouse"?e(t):void 0}var hfe=HF,gfe=GF,vfe=WF,yfe=XF,bfe=QF;function xfe({className:e,...t}){return u.jsx("div",{className:Ue("absolute top-full left-0 isolate z-50 flex justify-center"),children:u.jsx(bfe,{"data-slot":"navigation-menu-viewport",className:Ue("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",e),...t})})}function iU({className:e,children:t,viewport:n=!0,...r}){return u.jsxs(hfe,{"data-slot":"navigation-menu","data-viewport":n,className:Ue("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",e),...r,children:[t,n&&u.jsx(xfe,{})]})}function NC({className:e,...t}){return u.jsx(vfe,{"data-slot":"navigation-menu-item",className:Ue("relative",e),...t})}function TC({className:e,...t}){return u.jsx(yfe,{"data-slot":"navigation-menu-link",className:Ue("hover:text-white ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 flex flex-col gap-1 rounded-sm p-2 text-sm transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",e),...t})}function oU({className:e,...t}){return u.jsx(gfe,{"data-slot":"navigation-menu-list",className:Ue("group flex flex-1 list-none items-center justify-center gap-1",e),...t})}const aU=Ab("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 $E(){return u.jsx("a",{href:"https://github.com/HarperFast/studio/releases",target:"_blank",rel:"noopener noreferrer",children:u.jsxs("span",{className:Ue(aU({variant:"default"}),"text-xs inline-block ml-2 align-text-top"),children:["v4.7.14"," BETA"]})})}function eh(e,t,n){const{instanceId:r,clusterId:i}=it({strict:!1});return Qa({id:An,operationsUrl:e,port:t,secure:n})}function nx(e,t,n){const{instanceId:r,clusterId:i}=it({strict:!1});return{instanceClient:Qa({id:An,operationsUrl:e,port:t,secure:n}),entityType:"instance"}}function Zt(e,t,n){const r=it({strict:!1});return b.useMemo(()=>sU({...r,operationsUrl:e,port:t,secure:n}),[r,e,t,n])}function sU({instanceId:e,clusterId:t,operationsUrl:n,port:r,secure:i}){const o=An;return{instanceClient:Qa({id:o,operationsUrl:n,port:r,secure:i}),entityId:o,entityType:"instance"}}function wfe(){localStorage.clear()}function Sfe(){sessionStorage.clear()}async function _fe(){Et.setUserForEntity(An,null),jy.getQueryCache().clear(),wfe(),Sfe(),await jy.invalidateQueries({refetchType:"none"})}async function Cfe(e){await Et.signOutFromPotentiallyAuthenticatedInstances(),await Bm({...e,entityId:An})}function kfe(){const e=eh();return ct({mutationFn:()=>Cfe({instanceClient:e}),onSuccess:_fe})}function rx(e){const{user:t}=El(),{organizationId:n}=it({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 hf(e){const{user:t}=El(),{organizationId:n}=it({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 ix(e,t){const{user:n}=El(),{organizationId:r,clusterId:i}=it({strict:!1});return lU(n,e??r,t??i)}function lU(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 Efe(e,t){const{user:n}=El(),{organizationId:r,clusterId:i}=it({strict:!1});return cU(n,r,i)}function cU(e,t,n){const r=e?.roles?.[t];if(!r?.permission&&!r?.organization?.clusters)return{create:!1,remove:!1,update:!1,view:!1};if(r.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const i=r.organization.clusters.resources?.find(a=>a.id===n)?.instances,o=r.organization.clusters;return{create:i?i.create:o.create,remove:i?i.delete:o.delete,update:i?i.update:o.update,view:i?i.view:o.view}}function PE(e){const{clusterId:t,instanceId:n}=it({strict:!1}),{user:r}=fs(),i=r?.role?.permission;return i?i.super_user===!0:!1}function gf(e){const{clusterId:t,instanceId:n}=it({strict:!1}),{user:r}=fs(),i=r?.role?.permission;return i?i.super_user===!0||i.structure_user===!0:!1}function H_(e,t,n,r){const{clusterId:i,instanceId:o}=it({strict:!1}),{user:a}=fs(),c=a?.role?.permission;return c?c.super_user===!0||c.structure_user===!0?!0:c[t]?.tables?.[n][r]===!0:!1}const ME={className:"text-white"};function uU(){const{mutate:e}=kfe(),t=En(),{user:n}=Bc(),r=xn(),{organizationId:i}=it({strict:!1}),{update:o}=rx(i),{view:a}=hf(i),c=o,d=b.useCallback(()=>{e(void 0,{onSuccess:async()=>{we.success("Success",{description:"You have been signed out successfully.",action:{label:"Dismiss",onClick:()=>we.dismiss()}}),t({to:"/sign-in"}),r.invalidate()}})},[e,r,t]),f=b.useMemo(()=>[!hd,!hd,!hd,{to:"https://docs.harperdb.io/docs",target:"_blank",icon:u.jsx(y4,{}),text:"Docs",textBreakpoint:"md"},{to:"https://github.com/HarperFast/studio/issues",target:"_blank",icon:u.jsx(Lee,{}),text:"Report an Issue",textBreakpoint:"lg"},{to:"https://discord.gg/VzZuaw3Xay",target:"_blank",icon:u.jsx(Cde,{}),text:"Discord",textBreakpoint:"lg"},{onClick:d,icon:u.jsx(Lte,{}),text:"Sign Out",textBreakpoint:"md"}].filter(Xo),[i,c,a,d]);return n?u.jsxs(u.Fragment,{children:[u.jsx(Ife,{menuItems:f}),u.jsx(Rfe,{menuItems:f})]}):u.jsx(jfe,{})}function dU(e){return e.items!==void 0}function jfe(){return u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"inline-block",children:[u.jsx(Ze,{to:"/sign-in",children:u.jsx(jE,{})}),u.jsx($E,{})]}),u.jsx(iU,{children:u.jsxs(oU,{className:"text-grey-400",children:[u.jsx(NC,{children:u.jsx(TC,{asChild:!0,children:u.jsxs(Ze,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[u.jsx(y4,{})," ",u.jsx("span",{className:"hidden md:inline-block",children:"Docs"})]})})}),u.jsx(NC,{children:u.jsx(TC,{asChild:!0,children:u.jsxs(Ze,{to:"/sign-in",className:"flex-row items-center",activeProps:ME,children:[u.jsx(Mte,{})," Sign In"]})})})]})})]})}function Rfe({menuItems:e}){const{user:t}=Bc();return qc(t),u.jsx("div",{className:"hidden md:block",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"inline-block",children:[u.jsx(Ze,{to:ya,children:u.jsx(jE,{})}),u.jsx($E,{})]}),u.jsx(iU,{children:u.jsx(oU,{className:"text-grey-400",children:e.map(n=>dU(n)?!!n.items.length&&u.jsx("div",{className:"bg-black rounded-2xl flex",children:n.items.map(r=>u.jsx(Y$,{menuItem:r},r.text))},n.text):u.jsx(Y$,{menuItem:n},n.text))})})]})})}function Y$({menuItem:e}){return u.jsx(NC,{className:"text-gray-400 hover:text-white",children:u.jsx(TC,{asChild:!0,children:u.jsxs(Ze,{to:e.to,onClick:e.onClick,className:"flex-row items-center",target:e.target,activeProps:e.to?ME: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 Ife({menuItems:e}){const{user:t}=Bc();qc(t);const[n,r]=b.useState(!1),i=b.useCallback(()=>r(a=>!a),[]),o=b.useCallback(()=>r(!1),[]);return u.jsxs("div",{className:"md:hidden",id:"mobile-menu",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Ze,{to:ya,children:u.jsx(jE,{})}),u.jsx($E,{}),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(D4,{}):u.jsx(I4,{})]})]}),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=>dU(a)?!!a.items.length&&u.jsx("div",{className:"bg-black pl-10 pr-2 py-2",children:a.items.map(c=>u.jsx(W$,{menuItem:c,onClick:o},c.text))},a.text):u.jsx(W$,{menuItem:a,onClick:o},a.text))})]})}function W$({menuItem:e,onClick:t}){const n=b.useCallback(()=>{e.onClick?.(),t()},[e,t]);return u.jsxs(Ze,{to:e.to,onClick:n,target:e.target,className:"flex flex-row px-3 py-2 text-base font-medium rounded-md text-gray-400 hover:text-white",activeProps:e.to?ME:void 0,children:[e.icon,u.jsx("span",{className:"ml-4",children:e.text})]})}function Ap({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 Nfe(){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(uU,{})}),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(Ap,{title:"Free Tier",children:u.jsx("span",{children:"Try us out, no credit card required!"})}),u.jsx(Ap,{title:"Global Deployments Managed as One",children:u.jsx("span",{children:"Coordinate global environments as if they were a single node."})}),u.jsx(Ap,{title:"Database, App, Cache, & Messaging",children:u.jsx("span",{children:"Bring your stack together for reliable, ultra-fast performance."})}),u.jsx(Ap,{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(Ap,{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(kl,{})})]})]})}function Tfe(){b.useEffect(()=>{},[])}const Ofe=["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 zE(e){if(!e||!e.includes("@"))return null;const t=e.split("@").pop()||"";if(!t)return null;for(const n of Ofe)if(t===n||t.endsWith("."+n))return null;return t}let q_=null;function Afe(){const e=En(),t=xn(),n=rr(),{redirect:r}=Er({strict:!1});return b.useEffect(()=>{q_||(q_=(async function(){const i=await Az().catch(()=>null);if(!i)we.error("We were not able to verify your sign-in. Please try signing in again.",{duration:1e4}),await e({to:"/sign-in"});else{Et.setUserForEntity(An,i);const o=qc(i);zE(i.email),await n.invalidateQueries({queryKey:Rb,refetchType:"none"}),await t.invalidate(),await e({to:r?.startsWith("/")?r:o})}q_=null})())},[]),u.jsxs("div",{className:"text-white w-lg flex flex-col gap-4",children:[u.jsxs("h1",{className:"text-3xl font-light",children:[u.jsx("span",{"aria-hidden":"true",className:"text-2xl animate-flower-dance mr-4",title:"Loading",children:"🌼"}),"Checking..."]}),u.jsx("div",{className:"underline flex gap-4",children:u.jsx(Ze,{className:"text-sm opacity-50 hover:text-blue-300",to:"/sign-in",children:"Try signing in again"})})]})}const Dfe=["top","right","bottom","left"],yl=Math.min,Mi=Math.max,Ay=Math.round,wv=Math.floor,va=e=>({x:e,y:e}),$fe={left:"right",right:"left",bottom:"top",top:"bottom"},Pfe={start:"end",end:"start"};function OC(e,t,n){return Mi(e,yl(t,n))}function as(e,t){return typeof e=="function"?e(t):e}function ss(e){return e.split("-")[0]}function vf(e){return e.split("-")[1]}function LE(e){return e==="x"?"y":"x"}function FE(e){return e==="y"?"height":"width"}const Mfe=new Set(["top","bottom"]);function da(e){return Mfe.has(ss(e))?"y":"x"}function UE(e){return LE(da(e))}function zfe(e,t,n){n===void 0&&(n=!1);const r=vf(e),i=UE(e),o=FE(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Dy(a)),[a,Dy(a)]}function Lfe(e){const t=Dy(e);return[AC(e),t,AC(t)]}function AC(e){return e.replace(/start|end/g,t=>Pfe[t])}const X$=["left","right"],J$=["right","left"],Ffe=["top","bottom"],Ufe=["bottom","top"];function Vfe(e,t,n){switch(e){case"top":case"bottom":return n?t?J$:X$:t?X$:J$;case"left":case"right":return t?Ffe:Ufe;default:return[]}}function Bfe(e,t,n,r){const i=vf(e);let o=Vfe(ss(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(AC)))),o}function Dy(e){return e.replace(/left|right|bottom|top/g,t=>$fe[t])}function Hfe(e){return{top:0,right:0,bottom:0,left:0,...e}}function fU(e){return typeof e!="number"?Hfe(e):{top:e,right:e,bottom:e,left:e}}function $y(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 Q$(e,t,n){let{reference:r,floating:i}=e;const o=da(t),a=UE(t),c=FE(a),d=ss(t),f=o==="y",m=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:m,y:r.y-i.height};break;case"bottom":y={x:m,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:h};break;case"left":y={x:r.x-i.width,y:h};break;default:y={x:r.x,y:r.y}}switch(vf(t)){case"start":y[a]-=v*(n&&f?-1:1);break;case"end":y[a]+=v*(n&&f?-1:1);break}return y}const qfe=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:m,y:h}=Q$(f,r,d),v=r,y={},x=0;for(let S=0;S<c.length;S++){const{name:C,fn:k}=c[S],{x:E,y:j,data:R,reset:T}=await k({x:m,y:h,initialPlacement:r,placement:v,strategy:i,middlewareData:y,rects:f,platform:a,elements:{reference:e,floating:t}});m=E??m,h=j??h,y={...y,[C]:{...y[C],...R}},T&&x<=50&&(x++,typeof T=="object"&&(T.placement&&(v=T.placement),T.rects&&(f=T.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):T.rects),{x:m,y:h}=Q$(f,v,d)),S=-1)}return{x:m,y:h,placement:v,strategy:i,middlewareData:y}};async function wm(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:v=!1,padding:y=0}=as(t,e),x=fU(y),C=c[v?h==="floating"?"reference":"floating":h],k=$y(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:m,strategy:d})),E=h==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,j=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),R=await(o.isElement==null?void 0:o.isElement(j))?await(o.getScale==null?void 0:o.getScale(j))||{x:1,y:1}:{x:1,y:1},T=$y(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:E,offsetParent:j,strategy:d}):E);return{top:(k.top-T.top+x.top)/R.y,bottom:(T.bottom-k.bottom+x.bottom)/R.y,left:(k.left-T.left+x.left)/R.x,right:(T.right-k.right+x.right)/R.x}}const Kfe=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:m=0}=as(e,t)||{};if(f==null)return{};const h=fU(m),v={x:n,y:r},y=UE(i),x=FE(y),S=await a.getDimensions(f),C=y==="y",k=C?"top":"left",E=C?"bottom":"right",j=C?"clientHeight":"clientWidth",R=o.reference[x]+o.reference[y]-v[y]-o.floating[x],T=v[y]-o.reference[y],N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let O=N?N[j]:0;(!O||!await(a.isElement==null?void 0:a.isElement(N)))&&(O=c.floating[j]||o.floating[x]);const M=R/2-T/2,L=O/2-S[x]/2-1,K=yl(h[k],L),ee=yl(h[E],L),q=K,Y=O-S[x]-ee,U=O/2-S[x]/2+M,H=OC(q,U,Y),z=!d.arrow&&vf(i)!=null&&U!==H&&o.reference[x]/2-(U<q?K:ee)-S[x]/2<0,W=z?U<q?U-q:U-Y:0;return{[y]:v[y]+W,data:{[y]:H,centerOffset:U-H-W,...z&&{alignmentOffset:W}},reset:z}}}),Gfe=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:m=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:S=!0,...C}=as(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const k=ss(i),E=da(c),j=ss(c)===c,R=await(d.isRTL==null?void 0:d.isRTL(f.floating)),T=v||(j||!S?[Dy(c)]:Lfe(c)),N=x!=="none";!v&&N&&T.push(...Bfe(c,S,x,R));const O=[c,...T],M=await wm(t,C),L=[];let K=((r=o.flip)==null?void 0:r.overflows)||[];if(m&&L.push(M[k]),h){const U=zfe(i,a,R);L.push(M[U[0]],M[U[1]])}if(K=[...K,{placement:i,overflows:L}],!L.every(U=>U<=0)){var ee,q;const U=(((ee=o.flip)==null?void 0:ee.index)||0)+1,H=O[U];if(H&&(!(h==="alignment"?E!==da(H):!1)||K.every(F=>da(F.placement)===E?F.overflows[0]>0:!0)))return{data:{index:U,overflows:K},reset:{placement:H}};let z=(q=K.filter(W=>W.overflows[0]<=0).sort((W,F)=>W.overflows[1]-F.overflows[1])[0])==null?void 0:q.placement;if(!z)switch(y){case"bestFit":{var Y;const W=(Y=K.filter(F=>{if(N){const te=da(F.placement);return te===E||te==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(te=>te>0).reduce((te,D)=>te+D,0)]).sort((F,te)=>F[1]-te[1])[0])==null?void 0:Y[0];W&&(z=W);break}case"initialPlacement":z=c;break}if(i!==z)return{reset:{placement:z}}}return{}}}};function e2(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function t2(e){return Dfe.some(t=>e[t]>=0)}const Zfe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=as(e,t);switch(r){case"referenceHidden":{const o=await wm(t,{...i,elementContext:"reference"}),a=e2(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:t2(a)}}}case"escaped":{const o=await wm(t,{...i,altBoundary:!0}),a=e2(o,n.floating);return{data:{escapedOffsets:a,escaped:t2(a)}}}default:return{}}}}},pU=new Set(["left","top"]);async function Yfe(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=ss(n),c=vf(n),d=da(n)==="y",f=pU.has(a)?-1:1,m=o&&d?-1:1,h=as(t,e);let{mainAxis:v,crossAxis:y,alignmentAxis:x}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof x=="number"&&(y=c==="end"?x*-1:x),d?{x:y*m,y:v*f}:{x:v*f,y:y*m}}const Wfe=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 Yfe(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}}}}},Xfe=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:k,y:E}=C;return{x:k,y:E}}},...d}=as(e,t),f={x:n,y:r},m=await wm(t,d),h=da(ss(i)),v=LE(h);let y=f[v],x=f[h];if(o){const C=v==="y"?"top":"left",k=v==="y"?"bottom":"right",E=y+m[C],j=y-m[k];y=OC(E,y,j)}if(a){const C=h==="y"?"top":"left",k=h==="y"?"bottom":"right",E=x+m[C],j=x-m[k];x=OC(E,x,j)}const S=c.fn({...t,[v]:y,[h]:x});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[v]:o,[h]:a}}}}}},Jfe=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}=as(e,t),m={x:n,y:r},h=da(i),v=LE(h);let y=m[v],x=m[h];const S=as(c,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(d){const j=v==="y"?"height":"width",R=o.reference[v]-o.floating[j]+C.mainAxis,T=o.reference[v]+o.reference[j]-C.mainAxis;y<R?y=R:y>T&&(y=T)}if(f){var k,E;const j=v==="y"?"width":"height",R=pU.has(ss(i)),T=o.reference[h]-o.floating[j]+(R&&((k=a.offset)==null?void 0:k[h])||0)+(R?0:C.crossAxis),N=o.reference[h]+o.reference[j]+(R?0:((E=a.offset)==null?void 0:E[h])||0)-(R?C.crossAxis:0);x<T?x=T:x>N&&(x=N)}return{[v]:y,[h]:x}}}},Qfe=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}=as(e,t),m=await wm(t,f),h=ss(i),v=vf(i),y=da(i)==="y",{width:x,height:S}=o.floating;let C,k;h==="top"||h==="bottom"?(C=h,k=v===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(k=h,C=v==="end"?"top":"bottom");const E=S-m.top-m.bottom,j=x-m.left-m.right,R=yl(S-m[C],E),T=yl(x-m[k],j),N=!t.middlewareData.shift;let O=R,M=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=j),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=E),N&&!v){const K=Mi(m.left,0),ee=Mi(m.right,0),q=Mi(m.top,0),Y=Mi(m.bottom,0);y?M=x-2*(K!==0||ee!==0?K+ee:Mi(m.left,m.right)):O=S-2*(q!==0||Y!==0?q+Y:Mi(m.top,m.bottom))}await d({...t,availableWidth:M,availableHeight:O});const L=await a.getDimensions(c.floating);return x!==L.width||S!==L.height?{reset:{rects:!0}}:{}}}};function ox(){return typeof window<"u"}function yf(e){return mU(e)?(e.nodeName||"").toLowerCase():"#document"}function Ui(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ka(e){var t;return(t=(mU(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function mU(e){return ox()?e instanceof Node||e instanceof Ui(e).Node:!1}function Ko(e){return ox()?e instanceof Element||e instanceof Ui(e).Element:!1}function Sa(e){return ox()?e instanceof HTMLElement||e instanceof Ui(e).HTMLElement:!1}function n2(e){return!ox()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ui(e).ShadowRoot}const epe=new Set(["inline","contents"]);function th(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Go(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!epe.has(i)}const tpe=new Set(["table","td","th"]);function npe(e){return tpe.has(yf(e))}const rpe=[":popover-open",":modal"];function ax(e){return rpe.some(t=>{try{return e.matches(t)}catch{return!1}})}const ipe=["transform","translate","scale","rotate","perspective"],ope=["transform","translate","scale","rotate","perspective","filter"],ape=["paint","layout","strict","content"];function VE(e){const t=BE(),n=Ko(e)?Go(e):e;return ipe.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)||ope.some(r=>(n.willChange||"").includes(r))||ape.some(r=>(n.contain||"").includes(r))}function spe(e){let t=bl(e);for(;Sa(t)&&!Ld(t);){if(VE(t))return t;if(ax(t))return null;t=bl(t)}return null}function BE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const lpe=new Set(["html","body","#document"]);function Ld(e){return lpe.has(yf(e))}function Go(e){return Ui(e).getComputedStyle(e)}function sx(e){return Ko(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bl(e){if(yf(e)==="html")return e;const t=e.assignedSlot||e.parentNode||n2(e)&&e.host||ka(e);return n2(t)?t.host:t}function hU(e){const t=bl(e);return Ld(t)?e.ownerDocument?e.ownerDocument.body:e.body:Sa(t)&&th(t)?t:hU(t)}function Sm(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=hU(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=Ui(i);if(o){const c=DC(a);return t.concat(a,a.visualViewport||[],th(i)?i:[],c&&n?Sm(c):[])}return t.concat(i,Sm(i,[],n))}function DC(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gU(e){const t=Go(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Sa(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,c=Ay(n)!==o||Ay(r)!==a;return c&&(n=o,r=a),{width:n,height:r,$:c}}function HE(e){return Ko(e)?e:e.contextElement}function xd(e){const t=HE(e);if(!Sa(t))return va(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=gU(t);let a=(o?Ay(n.width):n.width)/r,c=(o?Ay(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const cpe=va(0);function vU(e){const t=Ui(e);return!BE()||!t.visualViewport?cpe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function upe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ui(e)?!1:t}function Ac(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=HE(e);let a=va(1);t&&(r?Ko(r)&&(a=xd(r)):a=xd(e));const c=upe(o,n,r)?vU(o):va(0);let d=(i.left+c.x)/a.x,f=(i.top+c.y)/a.y,m=i.width/a.x,h=i.height/a.y;if(o){const v=Ui(o),y=r&&Ko(r)?Ui(r):r;let x=v,S=DC(x);for(;S&&r&&y!==x;){const C=xd(S),k=S.getBoundingClientRect(),E=Go(S),j=k.left+(S.clientLeft+parseFloat(E.paddingLeft))*C.x,R=k.top+(S.clientTop+parseFloat(E.paddingTop))*C.y;d*=C.x,f*=C.y,m*=C.x,h*=C.y,d+=j,f+=R,x=Ui(S),S=DC(x)}}return $y({width:m,height:h,x:d,y:f})}function lx(e,t){const n=sx(e).scrollLeft;return t?t.left+n:Ac(ka(e)).left+n}function yU(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-lx(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function dpe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=ka(r),c=t?ax(t.floating):!1;if(r===a||c&&o)return n;let d={scrollLeft:0,scrollTop:0},f=va(1);const m=va(0),h=Sa(r);if((h||!h&&!o)&&((yf(r)!=="body"||th(a))&&(d=sx(r)),Sa(r))){const y=Ac(r);f=xd(r),m.x=y.x+r.clientLeft,m.y=y.y+r.clientTop}const v=a&&!h&&!o?yU(a,d):va(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+m.x+v.x,y:n.y*f.y-d.scrollTop*f.y+m.y+v.y}}function fpe(e){return Array.from(e.getClientRects())}function ppe(e){const t=ka(e),n=sx(e),r=e.ownerDocument.body,i=Mi(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Mi(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+lx(e);const c=-n.scrollTop;return Go(r).direction==="rtl"&&(a+=Mi(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:c}}const r2=25;function mpe(e,t){const n=Ui(e),r=ka(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,c=0,d=0;if(i){o=i.width,a=i.height;const m=BE();(!m||m&&t==="fixed")&&(c=i.offsetLeft,d=i.offsetTop)}const f=lx(r);if(f<=0){const m=r.ownerDocument,h=m.body,v=getComputedStyle(h),y=m.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,x=Math.abs(r.clientWidth-h.clientWidth-y);x<=r2&&(o-=x)}else f<=r2&&(o+=f);return{width:o,height:a,x:c,y:d}}const hpe=new Set(["absolute","fixed"]);function gpe(e,t){const n=Ac(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Sa(e)?xd(e):va(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 i2(e,t,n){let r;if(t==="viewport")r=mpe(e,n);else if(t==="document")r=ppe(ka(e));else if(Ko(t))r=gpe(t,n);else{const i=vU(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return $y(r)}function bU(e,t){const n=bl(e);return n===t||!Ko(n)||Ld(n)?!1:Go(n).position==="fixed"||bU(n,t)}function vpe(e,t){const n=t.get(e);if(n)return n;let r=Sm(e,[],!1).filter(c=>Ko(c)&&yf(c)!=="body"),i=null;const o=Go(e).position==="fixed";let a=o?bl(e):e;for(;Ko(a)&&!Ld(a);){const c=Go(a),d=VE(a);!d&&c.position==="fixed"&&(i=null),(o?!d&&!i:!d&&c.position==="static"&&!!i&&hpe.has(i.position)||th(a)&&!d&&bU(e,a))?r=r.filter(m=>m!==a):i=c,a=bl(a)}return t.set(e,r),r}function ype(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?ax(t)?[]:vpe(t,this._c):[].concat(n),r],c=a[0],d=a.reduce((f,m)=>{const h=i2(t,m,i);return f.top=Mi(h.top,f.top),f.right=yl(h.right,f.right),f.bottom=yl(h.bottom,f.bottom),f.left=Mi(h.left,f.left),f},i2(t,c,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function bpe(e){const{width:t,height:n}=gU(e);return{width:t,height:n}}function xpe(e,t,n){const r=Sa(t),i=ka(t),o=n==="fixed",a=Ac(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const d=va(0);function f(){d.x=lx(i)}if(r||!r&&!o)if((yf(t)!=="body"||th(i))&&(c=sx(t)),r){const y=Ac(t,!0,o,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}else i&&f();o&&!r&&i&&f();const m=i&&!r&&!o?yU(i,c):va(0),h=a.left+c.scrollLeft-d.x-m.x,v=a.top+c.scrollTop-d.y-m.y;return{x:h,y:v,width:a.width,height:a.height}}function K_(e){return Go(e).position==="static"}function o2(e,t){if(!Sa(e)||Go(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ka(e)===n&&(n=n.ownerDocument.body),n}function xU(e,t){const n=Ui(e);if(ax(e))return n;if(!Sa(e)){let i=bl(e);for(;i&&!Ld(i);){if(Ko(i)&&!K_(i))return i;i=bl(i)}return n}let r=o2(e,t);for(;r&&npe(r)&&K_(r);)r=o2(r,t);return r&&Ld(r)&&K_(r)&&!VE(r)?n:r||spe(e)||n}const wpe=async function(e){const t=this.getOffsetParent||xU,n=this.getDimensions,r=await n(e.floating);return{reference:xpe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Spe(e){return Go(e).direction==="rtl"}const _pe={convertOffsetParentRelativeRectToViewportRelativeRect:dpe,getDocumentElement:ka,getClippingRect:ype,getOffsetParent:xU,getElementRects:wpe,getClientRects:fpe,getDimensions:bpe,getScale:xd,isElement:Ko,isRTL:Spe};function wU(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Cpe(e,t){let n=null,r;const i=ka(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:m,top:h,width:v,height:y}=f;if(c||t(),!v||!y)return;const x=wv(h),S=wv(i.clientWidth-(m+v)),C=wv(i.clientHeight-(h+y)),k=wv(m),j={rootMargin:-x+"px "+-S+"px "+-C+"px "+-k+"px",threshold:Mi(0,yl(1,d))||1};let R=!0;function T(N){const O=N[0].intersectionRatio;if(O!==d){if(!R)return a();O?a(!1,O):r=setTimeout(()=>{a(!1,1e-7)},1e3)}O===1&&!wU(f,e.getBoundingClientRect())&&a(),R=!1}try{n=new IntersectionObserver(T,{...j,root:i.ownerDocument})}catch{n=new IntersectionObserver(T,j)}n.observe(e)}return a(!0),o}function kpe(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=HE(e),m=i||o?[...f?Sm(f):[],...Sm(t)]:[];m.forEach(k=>{i&&k.addEventListener("scroll",n,{passive:!0}),o&&k.addEventListener("resize",n)});const h=f&&c?Cpe(f,n):null;let v=-1,y=null;a&&(y=new ResizeObserver(k=>{let[E]=k;E&&E.target===f&&y&&(y.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var j;(j=y)==null||j.observe(t)})),n()}),f&&!d&&y.observe(f),y.observe(t));let x,S=d?Ac(e):null;d&&C();function C(){const k=Ac(e);S&&!wU(S,k)&&n(),S=k,x=requestAnimationFrame(C)}return n(),()=>{var k;m.forEach(E=>{i&&E.removeEventListener("scroll",n),o&&E.removeEventListener("resize",n)}),h?.(),(k=y)==null||k.disconnect(),y=null,d&&cancelAnimationFrame(x)}}const Epe=Wfe,jpe=Xfe,Rpe=Gfe,Ipe=Qfe,Npe=Zfe,a2=Kfe,Tpe=Jfe,Ope=(e,t,n)=>{const r=new Map,i={platform:_pe,...n},o={...i.platform,_c:r};return qfe(e,t,{...i,platform:o})};var Ape=typeof document<"u",Dpe=function(){},ly=Ape?b.useLayoutEffect:Dpe;function Py(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(!Py(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)&&!Py(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function SU(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function s2(e,t){const n=SU(e);return Math.round(t*n)/n}function G_(e){const t=b.useRef(e);return ly(()=>{t.current=e}),t}function $pe(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,[m,h]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,y]=b.useState(r);Py(v,r)||y(r);const[x,S]=b.useState(null),[C,k]=b.useState(null),E=b.useCallback(F=>{F!==N.current&&(N.current=F,S(F))},[]),j=b.useCallback(F=>{F!==O.current&&(O.current=F,k(F))},[]),R=o||x,T=a||C,N=b.useRef(null),O=b.useRef(null),M=b.useRef(m),L=d!=null,K=G_(d),ee=G_(i),q=G_(f),Y=b.useCallback(()=>{if(!N.current||!O.current)return;const F={placement:t,strategy:n,middleware:v};ee.current&&(F.platform=ee.current),Ope(N.current,O.current,F).then(te=>{const D={...te,isPositioned:q.current!==!1};U.current&&!Py(M.current,D)&&(M.current=D,of.flushSync(()=>{h(D)}))})},[v,t,n,ee,q]);ly(()=>{f===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,h(F=>({...F,isPositioned:!1})))},[f]);const U=b.useRef(!1);ly(()=>(U.current=!0,()=>{U.current=!1}),[]),ly(()=>{if(R&&(N.current=R),T&&(O.current=T),R&&T){if(K.current)return K.current(R,T,Y);Y()}},[R,T,Y,K,L]);const H=b.useMemo(()=>({reference:N,floating:O,setReference:E,setFloating:j}),[E,j]),z=b.useMemo(()=>({reference:R,floating:T}),[R,T]),W=b.useMemo(()=>{const F={position:n,left:0,top:0};if(!z.floating)return F;const te=s2(z.floating,m.x),D=s2(z.floating,m.y);return c?{...F,transform:"translate("+te+"px, "+D+"px)",...SU(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:te,top:D}},[n,c,z.floating,m.x,m.y]);return b.useMemo(()=>({...m,update:Y,refs:H,elements:z,floatingStyles:W}),[m,Y,H,z,W])}const Ppe=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?a2({element:r.current,padding:i}).fn(n):{}:r?a2({element:r,padding:i}).fn(n):{}}}},Mpe=(e,t)=>({...Epe(e),options:[e,t]}),zpe=(e,t)=>({...jpe(e),options:[e,t]}),Lpe=(e,t)=>({...Tpe(e),options:[e,t]}),Fpe=(e,t)=>({...Rpe(e),options:[e,t]}),Upe=(e,t)=>({...Ipe(e),options:[e,t]}),Vpe=(e,t)=>({...Npe(e),options:[e,t]}),Bpe=(e,t)=>({...Ppe(e),options:[e,t]});var Hpe="Arrow",_U=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return u.jsx(Ye.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});_U.displayName=Hpe;var qpe=_U;function CU(e){const[t,n]=b.useState(void 0);return nr(()=>{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 qE="Popper",[kU,bf]=Xi(qE),[Kpe,EU]=kU(qE),jU=e=>{const{__scopePopper:t,children:n}=e,[r,i]=b.useState(null);return u.jsx(Kpe,{scope:t,anchor:r,onAnchorChange:i,children:n})};jU.displayName=qE;var RU="PopperAnchor",IU=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=EU(RU,n),a=b.useRef(null),c=ft(t,a),d=b.useRef(null);return b.useEffect(()=>{const f=d.current;d.current=r?.current||a.current,f!==d.current&&o.onAnchorChange(d.current)}),r?null:u.jsx(Ye.div,{...i,ref:c})});IU.displayName=RU;var KE="PopperContent",[Gpe,Zpe]=kU(KE),NU=b.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:m=0,sticky:h="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:x,...S}=e,C=EU(KE,n),[k,E]=b.useState(null),j=ft(t,B=>E(B)),[R,T]=b.useState(null),N=CU(R),O=N?.width??0,M=N?.height??0,L=r+(o!=="center"?"-"+o:""),K=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},ee=Array.isArray(f)?f:[f],q=ee.length>0,Y={padding:K,boundary:ee.filter(Wpe),altBoundary:q},{refs:U,floatingStyles:H,placement:z,isPositioned:W,middlewareData:F}=$pe({strategy:"fixed",placement:L,whileElementsMounted:(...B)=>kpe(...B,{animationFrame:y==="always"}),elements:{reference:C.anchor},middleware:[Mpe({mainAxis:i+M,alignmentAxis:a}),d&&zpe({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Lpe():void 0,...Y}),d&&Fpe({...Y}),Upe({...Y,apply:({elements:B,rects:se,availableWidth:_e,availableHeight:Ie})=>{const{width:Fe,height:Le}=se.reference,We=B.floating.style;We.setProperty("--radix-popper-available-width",`${_e}px`),We.setProperty("--radix-popper-available-height",`${Ie}px`),We.setProperty("--radix-popper-anchor-width",`${Fe}px`),We.setProperty("--radix-popper-anchor-height",`${Le}px`)}}),R&&Bpe({element:R,padding:c}),Xpe({arrowWidth:O,arrowHeight:M}),v&&Vpe({strategy:"referenceHidden",...Y})]}),[te,D]=AU(z),$=In(x);nr(()=>{W&&$?.()},[W,$]);const V=F.arrow?.x,A=F.arrow?.y,J=F.arrow?.centerOffset!==0,[fe,ge]=b.useState();return nr(()=>{k&&ge(window.getComputedStyle(k).zIndex)},[k]),u.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:W?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(Gpe,{scope:n,placedSide:te,onArrowChange:T,arrowX:V,arrowY:A,shouldHideArrow:J,children:u.jsx(Ye.div,{"data-side":te,"data-align":D,...S,ref:j,style:{...S.style,animation:W?void 0:"none"}})})})});NU.displayName=KE;var TU="PopperArrow",Ype={top:"bottom",right:"left",bottom:"top",left:"right"},OU=b.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=Zpe(TU,r),a=Ype[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(qpe,{...i,ref:n,style:{...i.style,display:"block"}})})});OU.displayName=TU;function Wpe(e){return e!==null}var Xpe=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,m]=AU(n),h={start:"0%",center:"50%",end:"100%"}[m],v=(i.arrow?.x??0)+c/2,y=(i.arrow?.y??0)+d/2;let x="",S="";return f==="bottom"?(x=a?h:`${v}px`,S=`${-d}px`):f==="top"?(x=a?h:`${v}px`,S=`${r.floating.height+d}px`):f==="right"?(x=`${-d}px`,S=a?h:`${y}px`):f==="left"&&(x=`${r.floating.width+d}px`,S=a?h:`${y}px`),{data:{x,y:S}}}});function AU(e){const[t,n="center"]=e.split("-");return[t,n]}var GE=jU,ZE=IU,YE=NU,WE=OU,Jpe="Portal",nh=b.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=b.useState(!1);nr(()=>o(!0),[]);const a=n||i&&globalThis?.document?.body;return a?tE.createPortal(u.jsx(Ye.div,{...r,ref:t}),a):null});nh.displayName=Jpe;var[cx]=Xi("Tooltip",[bf]),ux=bf(),DU="TooltipProvider",Qpe=700,$C="tooltip.open",[eme,XE]=cx(DU),$U=e=>{const{__scopeTooltip:t,delayDuration:n=Qpe,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,a=b.useRef(!0),c=b.useRef(!1),d=b.useRef(0);return b.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),u.jsx(eme,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(d.current),a.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:b.useCallback(f=>{c.current=f},[]),disableHoverableContent:i,children:o})};$U.displayName=DU;var _m="Tooltip",[tme,rh]=cx(_m),PU=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:a,delayDuration:c}=e,d=XE(_m,e.__scopeTooltip),f=ux(t),[m,h]=b.useState(null),v=Fi(),y=b.useRef(0),x=a??d.disableHoverableContent,S=c??d.delayDuration,C=b.useRef(!1),[k,E]=qo({prop:r,defaultProp:i??!1,onChange:O=>{O?(d.onOpen(),document.dispatchEvent(new CustomEvent($C))):d.onClose(),o?.(O)},caller:_m}),j=b.useMemo(()=>k?C.current?"delayed-open":"instant-open":"closed",[k]),R=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C.current=!1,E(!0)},[E]),T=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,E(!1)},[E]),N=b.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{C.current=!0,E(!0),y.current=0},S)},[S,E]);return b.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),u.jsx(GE,{...f,children:u.jsx(tme,{scope:t,contentId:v,open:k,stateAttribute:j,trigger:m,onTriggerChange:h,onTriggerEnter:b.useCallback(()=>{d.isOpenDelayedRef.current?N():R()},[d.isOpenDelayedRef,N,R]),onTriggerLeave:b.useCallback(()=>{x?T():(window.clearTimeout(y.current),y.current=0)},[T,x]),onOpen:R,onClose:T,disableHoverableContent:x,children:n})})};PU.displayName=_m;var PC="TooltipTrigger",MU=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=rh(PC,n),o=XE(PC,n),a=ux(n),c=b.useRef(null),d=ft(t,c,i.onTriggerChange),f=b.useRef(!1),m=b.useRef(!1),h=b.useCallback(()=>f.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),u.jsx(ZE,{asChild:!0,...a,children:u.jsx(Ye.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:d,onPointerMove:Re(e.onPointerMove,v=>{v.pointerType!=="touch"&&!m.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),m.current=!0)}),onPointerLeave:Re(e.onPointerLeave,()=>{i.onTriggerLeave(),m.current=!1}),onPointerDown:Re(e.onPointerDown,()=>{i.open&&i.onClose(),f.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Re(e.onFocus,()=>{f.current||i.onOpen()}),onBlur:Re(e.onBlur,i.onClose),onClick:Re(e.onClick,i.onClose)})})});MU.displayName=PC;var JE="TooltipPortal",[nme,rme]=cx(JE,{forceMount:void 0}),zU=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=rh(JE,t);return u.jsx(nme,{scope:t,forceMount:n,children:u.jsx(ir,{present:n||o.open,children:u.jsx(nh,{asChild:!0,container:i,children:r})})})};zU.displayName=JE;var Fd="TooltipContent",LU=b.forwardRef((e,t)=>{const n=rme(Fd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=rh(Fd,e.__scopeTooltip);return u.jsx(ir,{present:r||a.open,children:a.disableHoverableContent?u.jsx(FU,{side:i,...o,ref:t}):u.jsx(ime,{side:i,...o,ref:t})})}),ime=b.forwardRef((e,t)=>{const n=rh(Fd,e.__scopeTooltip),r=XE(Fd,e.__scopeTooltip),i=b.useRef(null),o=ft(t,i),[a,c]=b.useState(null),{trigger:d,onClose:f}=n,m=i.current,{onPointerInTransitChange:h}=r,v=b.useCallback(()=>{c(null),h(!1)},[h]),y=b.useCallback((x,S)=>{const C=x.currentTarget,k={x:x.clientX,y:x.clientY},E=lme(k,C.getBoundingClientRect()),j=cme(k,E),R=ume(S.getBoundingClientRect()),T=fme([...j,...R]);c(T),h(!0)},[h]);return b.useEffect(()=>()=>v(),[v]),b.useEffect(()=>{if(d&&m){const x=C=>y(C,m),S=C=>y(C,d);return d.addEventListener("pointerleave",x),m.addEventListener("pointerleave",S),()=>{d.removeEventListener("pointerleave",x),m.removeEventListener("pointerleave",S)}}},[d,m,y,v]),b.useEffect(()=>{if(a){const x=S=>{const C=S.target,k={x:S.clientX,y:S.clientY},E=d?.contains(C)||m?.contains(C),j=!dme(k,a);E?v():j&&(v(),f())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[d,m,a,f,v]),u.jsx(FU,{...e,ref:o})}),[ome,ame]=cx(_m,{isInside:!1}),sme=Rde("TooltipContent"),FU=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...c}=e,d=rh(Fd,n),f=ux(n),{onClose:m}=d;return b.useEffect(()=>(document.addEventListener($C,m),()=>document.removeEventListener($C,m)),[m]),b.useEffect(()=>{if(d.trigger){const h=v=>{v.target?.contains(d.trigger)&&m()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[d.trigger,m]),u.jsx(mf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:m,children:u.jsxs(YE,{"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(sme,{children:r}),u.jsx(ome,{scope:n,isInside:!0,children:u.jsx(VF,{id:d.contentId,role:"tooltip",children:i||r})})]})})});LU.displayName=Fd;var UU="TooltipArrow",VU=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=ux(n);return ame(UU,n).isInside?null:u.jsx(WE,{...i,...r,ref:t})});VU.displayName=UU;function lme(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 cme(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 ume(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 dme(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,m=c.y,h=d.x,v=d.y;m>r!=v>r&&n<(h-f)*(r-m)/(v-m)+f&&(i=!i)}return i}function fme(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),pme(t)}function pme(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 mme=$U,hme=PU,gme=MU,vme=zU,yme=LU,bme=VU;function xme({delayDuration:e=0,...t}){return u.jsx(mme,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function dx({...e}){return u.jsx(xme,{children:u.jsx(hme,{"data-slot":"tooltip",...e})})}function fx({...e}){return u.jsx(gme,{"data-slot":"tooltip-trigger",...e})}function px({className:e,sideOffset:t=0,arrowClassName:n,children:r,...i}){return u.jsx(vme,{children:u.jsxs(yme,{"data-slot":"tooltip-content",sideOffset:t,className:Ue("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...i,children:[r,u.jsx(bme,{className:Ue("bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",n)})]})})}const Dp=new Map;function bo(e){if(!e)return"";if(Dp.has(e))return Dp.get(e);const t=e.replace(/[-_]+/g," ").replace(/\s+/g," ").trim();if(!t)return Dp.set(e,""),"";const n=t.match(/([A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+|[0-9]+)/g);if(!n)return Dp.set(e,""),"";const r=[];for(let a=0;a<n.length;a++){const 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(wme).join(" ");return Dp.set(e,o),o}function wme(e){return/^[A-Z]{2,3}s?$/.test(e)||/^[0-9]+$/.test(e)?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function mx({restartRequired:e}){const t=xQ(),{organization:n,instance:r,cluster:i}=qm({strict:!1}),o="Instance",a=b.useMemo(()=>{const c=t.pathname.split("/").filter(f=>f&&f.length>0),d=[u.jsxs(Ze,{to:"/",children:[u.jsx(Ite,{"aria-hidden":"true",className:"size-5 shrink-0"}),u.jsx("span",{className:"sr-only",children:"Home"})]},"home")];for(let f=0;f<c.length;f++){const m=c[f];if(m==="instance")continue;let h=`/${c.slice(0,f+1).join("/")}`,v=bo(m),y;m==="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(Ze,{to:h,className:"text-xs md:text-sm font-medium hover:text-grey truncate max-w-48",children:[v,y]}))}return d},[t.pathname,i?.name,r?.name,n?.name]);return u.jsxs("div",{role:"list",className:"flex items-center space-x-2 xl:space-x-4 sm:max-w-9/10 max-w-[calc(100%-56px)]",children:[...a,e&&u.jsxs(dx,{children:[u.jsx(fx,{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(px,{side:"bottom",children:["This ",o," is requesting a restart, when convenient, to apply your latest changes.",u.jsx("br",{}),"You can do this from the Apps or Config pages."]})]})]})}var ih=e=>e.type==="checkbox",gc=e=>e instanceof Date,hi=e=>e==null;const BU=e=>typeof e=="object";var tr=e=>!hi(e)&&!Array.isArray(e)&&BU(e)&&!gc(e),HU=e=>tr(e)&&e.target?ih(e.target)?e.target.checked:e.target.value:e,Sme=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,qU=(e,t)=>e.has(Sme(t)),_me=e=>{const t=e.constructor&&e.constructor.prototype;return tr(t)&&t.hasOwnProperty("isPrototypeOf")},QE=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function kn(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(!(QE&&(e instanceof Blob||r))&&(n||tr(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!_me(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=kn(e[i]));else return e;return t}var hx=e=>/^\w*$/.test(e),yn=e=>e===void 0,gx=e=>Array.isArray(e)?e.filter(Boolean):[],ej=e=>gx(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Pe=(e,t,n)=>{if(!t||!tr(e))return n;const r=(hx(t)?[t]:ej(t)).reduce((i,o)=>hi(i)?i:i[o],e);return yn(r)||r===e?yn(e[t])?n:e[t]:r},$i=e=>typeof e=="boolean",qt=(e,t,n)=>{let r=-1;const i=hx(t)?[t]:ej(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=tr(f)||Array.isArray(f)?f:isNaN(+i[r+1])?{}:[]}if(c==="__proto__"||c==="constructor"||c==="prototype")return;e[c]=d,e=e[c]}};const My={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},xo={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Za={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},tj=Q.createContext(null);tj.displayName="HookFormContext";const oh=()=>Q.useContext(tj),Cme=e=>{const{children:t,...n}=e;return Q.createElement(tj.Provider,{value:n},t)};var KU=(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]!==xo.all&&(t._proxyFormState[a]=!r||xo.all),n&&(n[a]=!0),e[a]}});return i};const vx=typeof window<"u"?Q.useLayoutEffect:Q.useEffect;function nj(e){const t=oh(),{control:n=t.control,disabled:r,name:i,exact:o}=e||{},[a,c]=Q.useState(n._formState),d=Q.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return vx(()=>n._subscribe({name:i,formState:d.current,exact:o,callback:f=>{!r&&c({...n._formState,...f})}}),[i,r,o]),Q.useEffect(()=>{d.current.isValid&&n._setValid(!0)},[n]),Q.useMemo(()=>KU(a,n,d.current,!1),[a,n])}var zi=e=>typeof e=="string",MC=(e,t,n,r,i)=>zi(e)?(r&&t.watch.add(e),Pe(n,e,i)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),Pe(n,o))):(r&&(t.watchAll=!0),n),zC=e=>hi(e)||!BU(e);function zo(e,t,n=new WeakSet){if(zC(e)||zC(t))return Object.is(e,t);if(gc(e)&&gc(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(gc(a)&&gc(c)||tr(a)&&tr(c)||Array.isArray(a)&&Array.isArray(c)?!zo(a,c,n):!Object.is(a,c))return!1}}return!0}function kme(e){const t=oh(),{control:n=t.control,name:r,defaultValue:i,disabled:o,exact:a,compute:c}=e||{},d=Q.useRef(i),f=Q.useRef(c),m=Q.useRef(void 0),h=Q.useRef(n),v=Q.useRef(r);f.current=c;const[y,x]=Q.useState(()=>{const R=n._getWatch(r,d.current);return f.current?f.current(R):R}),S=Q.useCallback(R=>{const T=MC(r,n._names,R||n._formValues,!1,d.current);return f.current?f.current(T):T},[n._formValues,n._names,r]),C=Q.useCallback(R=>{if(!o){const T=MC(r,n._names,R||n._formValues,!1,d.current);if(f.current){const N=f.current(T);zo(N,m.current)||(x(N),m.current=N)}else x(T)}},[n._formValues,n._names,o,r]);vx(()=>((h.current!==n||!zo(v.current,r))&&(h.current=n,v.current=r,C()),n._subscribe({name:r,formState:{values:!0},exact:a,callback:R=>{C(R.values)}})),[n,a,r,C]),Q.useEffect(()=>n._removeUnmounted());const k=h.current!==n,E=v.current,j=Q.useMemo(()=>{if(o)return null;const R=!k&&!zo(E,r);return k||R?S():null},[o,k,r,E,S]);return j!==null?j:y}function Eme(e){const t=oh(),{name:n,disabled:r,control:i=t.control,shouldUnregister:o,defaultValue:a,exact:c=!0}=e,d=qU(i._names.array,n),f=Q.useMemo(()=>Pe(i._formValues,n,Pe(i._defaultValues,n,a)),[i,n,a]),m=kme({control:i,name:n,defaultValue:f,exact:c}),h=nj({control:i,name:n,exact:c}),v=Q.useRef(e),y=Q.useRef(void 0),x=Q.useRef(i.register(n,{...e.rules,value:m,...$i(e.disabled)?{disabled:e.disabled}:{}}));v.current=e;const S=Q.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Pe(h.errors,n)},isDirty:{enumerable:!0,get:()=>!!Pe(h.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Pe(h.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Pe(h.validatingFields,n)},error:{enumerable:!0,get:()=>Pe(h.errors,n)}}),[h,n]),C=Q.useCallback(R=>x.current.onChange({target:{value:HU(R),name:n},type:My.CHANGE}),[n]),k=Q.useCallback(()=>x.current.onBlur({target:{value:Pe(i._formValues,n),name:n},type:My.BLUR}),[n,i._formValues]),E=Q.useCallback(R=>{const T=Pe(i._fields,n);T&&R&&(T._f.ref={focus:()=>R.focus&&R.focus(),select:()=>R.select&&R.select(),setCustomValidity:N=>R.setCustomValidity(N),reportValidity:()=>R.reportValidity()})},[i._fields,n]),j=Q.useMemo(()=>({name:n,value:m,...$i(r)||h.disabled?{disabled:h.disabled||r}:{},onChange:C,onBlur:k,ref:E}),[n,r,h.disabled,C,k,E,m]);return Q.useEffect(()=>{const R=i._options.shouldUnregister||o,T=y.current;T&&T!==n&&!d&&i.unregister(T),i.register(n,{...v.current.rules,...$i(v.current.disabled)?{disabled:v.current.disabled}:{}});const N=(O,M)=>{const L=Pe(i._fields,O);L&&L._f&&(L._f.mount=M)};if(N(n,!0),R){const O=kn(Pe(i._options.defaultValues,n,v.current.defaultValue));qt(i._defaultValues,n,O),yn(Pe(i._formValues,n))&&qt(i._formValues,n,O)}return!d&&i.register(n),y.current=n,()=>{(d?R&&!i._state.action:R)?i.unregister(n):N(n,!1)}},[n,i,d,o]),Q.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),Q.useMemo(()=>({field:j,formState:h,fieldState:S}),[j,h,S])}const jme=e=>e.render(Eme(e));var rj=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},bi=e=>Array.isArray(e)?e:[e],l2=()=>{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 GU(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const i=e[r],o=t[r];if(i&&tr(i)&&o){const a=GU(i,o);tr(a)&&(n[r]=a)}else e[r]&&(n[r]=o)}return n}var Nr=e=>tr(e)&&!Object.keys(e).length,ij=e=>e.type==="file",Lo=e=>typeof e=="function",zy=e=>{if(!QE)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ZU=e=>e.type==="select-multiple",oj=e=>e.type==="radio",Rme=e=>oj(e)||ih(e),Z_=e=>zy(e)&&e.isConnected;function Ime(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=yn(e)?r++:e[t[r++]];return e}function Nme(e){for(const t in e)if(e.hasOwnProperty(t)&&!yn(e[t]))return!1;return!0}function qn(e,t){const n=Array.isArray(t)?t:hx(t)?[t]:ej(t),r=n.length===1?e:Ime(e,n),i=n.length-1,o=n[i];return r&&delete r[o],i!==0&&(tr(r)&&Nr(r)||Array.isArray(r)&&Nme(r))&&qn(e,n.slice(0,-1)),e}var Tme=e=>{for(const t in e)if(Lo(e[t]))return!0;return!1};function YU(e){return Array.isArray(e)||tr(e)&&!Tme(e)}function LC(e,t={}){for(const n in e){const r=e[n];YU(r)?(t[n]=Array.isArray(r)?[]:{},LC(r,t[n])):yn(r)||(t[n]=!0)}return t}function ad(e,t,n){n||(n=LC(t));for(const r in e){const i=e[r];if(YU(i))yn(t)||zC(n[r])?n[r]=LC(i,Array.isArray(i)?[]:{}):ad(i,hi(t)?{}:t[r],n[r]);else{const o=t[r];n[r]=!zo(i,o)}}return n}const c2={value:!1,isValid:!1},u2={value:!0,isValid:!0};var WU=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&&!yn(e[0].attributes.value)?yn(e[0].value)||e[0].value===""?u2:{value:e[0].value,isValid:!0}:u2:c2}return c2},XU=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>yn(e)?e:t?e===""?NaN:e&&+e:n&&zi(e)?new Date(e):r?r(e):e;const d2={isValid:!1,value:null};var JU=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,d2):d2;function f2(e){const t=e.ref;return ij(t)?t.files:oj(t)?JU(e.refs).value:ZU(t)?[...t.selectedOptions].map(({value:n})=>n):ih(t)?WU(e.refs).value:XU(yn(t.value)?e.ref.value:t.value,e)}var Ome=(e,t,n,r)=>{const i={};for(const o of e){const a=Pe(t,o);a&&qt(i,o,a._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},Ly=e=>e instanceof RegExp,$p=e=>yn(e)?e:Ly(e)?e.source:tr(e)?Ly(e.value)?e.value.source:e.value:e,fd=e=>({isOnSubmit:!e||e===xo.onSubmit,isOnBlur:e===xo.onBlur,isOnChange:e===xo.onChange,isOnAll:e===xo.all,isOnTouch:e===xo.onTouched});const p2="AsyncFunction";var Ame=e=>!!e&&!!e.validate&&!!(Lo(e.validate)&&e.validate.constructor.name===p2||tr(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===p2)),Dme=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),FC=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const wd=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const o=Pe(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(wd(c,t))break}else if(tr(c)&&wd(c,t))break}}};function m2(e,t,n){const r=Pe(e,n);if(r||hx(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),a=Pe(t,o),c=Pe(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 $me=(e,t,n,r)=>{n(e);const{name:i,...o}=e;return Nr(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!r||xo.all))},Pme=(e,t,n)=>!e||!t||e===t||bi(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),Mme=(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,zme=(e,t)=>!gx(Pe(e,t)).length&&qn(e,t),QU=(e,t,n)=>{const r=bi(Pe(e,n));return qt(r,"root",t[n]),qt(e,n,r),e};function h2(e,t,n="validate"){if(zi(e)||Array.isArray(e)&&e.every(zi)||$i(e)&&!e)return{type:n,message:zi(e)?e:"",ref:t}}var Ju=e=>tr(e)&&!Ly(e)?e:{value:e,message:""},UC=async(e,t,n,r,i,o)=>{const{ref:a,refs:c,required:d,maxLength:f,minLength:m,min:h,max:v,pattern:y,validate:x,name:S,valueAsNumber:C,mount:k}=e._f,E=Pe(n,S);if(!k||t.has(S))return{};const j=c?c[0]:a,R=q=>{i&&j.reportValidity&&(j.setCustomValidity($i(q)?"":q||""),j.reportValidity())},T={},N=oj(a),O=ih(a),M=N||O,L=(C||ij(a))&&yn(a.value)&&yn(E)||zy(a)&&a.value===""||E===""||Array.isArray(E)&&!E.length,K=rj.bind(null,S,r,T),ee=(q,Y,U,H=Za.maxLength,z=Za.minLength)=>{const W=q?Y:U;T[S]={type:q?H:z,message:W,ref:a,...K(q?H:z,W)}};if(o?!Array.isArray(E)||!E.length:d&&(!M&&(L||hi(E))||$i(E)&&!E||O&&!WU(c).isValid||N&&!JU(c).isValid)){const{value:q,message:Y}=zi(d)?{value:!!d,message:d}:Ju(d);if(q&&(T[S]={type:Za.required,message:Y,ref:j,...K(Za.required,Y)},!r))return R(Y),T}if(!L&&(!hi(h)||!hi(v))){let q,Y;const U=Ju(v),H=Ju(h);if(!hi(E)&&!isNaN(E)){const z=a.valueAsNumber||E&&+E;hi(U.value)||(q=z>U.value),hi(H.value)||(Y=z<H.value)}else{const z=a.valueAsDate||new Date(E),W=D=>new Date(new Date().toDateString()+" "+D),F=a.type=="time",te=a.type=="week";zi(U.value)&&E&&(q=F?W(E)>W(U.value):te?E>U.value:z>new Date(U.value)),zi(H.value)&&E&&(Y=F?W(E)<W(H.value):te?E<H.value:z<new Date(H.value))}if((q||Y)&&(ee(!!q,U.message,H.message,Za.max,Za.min),!r))return R(T[S].message),T}if((f||m)&&!L&&(zi(E)||o&&Array.isArray(E))){const q=Ju(f),Y=Ju(m),U=!hi(q.value)&&E.length>+q.value,H=!hi(Y.value)&&E.length<+Y.value;if((U||H)&&(ee(U,q.message,Y.message),!r))return R(T[S].message),T}if(y&&!L&&zi(E)){const{value:q,message:Y}=Ju(y);if(Ly(q)&&!E.match(q)&&(T[S]={type:Za.pattern,message:Y,ref:a,...K(Za.pattern,Y)},!r))return R(Y),T}if(x){if(Lo(x)){const q=await x(E,n),Y=h2(q,j);if(Y&&(T[S]={...Y,...K(Za.validate,Y.message)},!r))return R(Y.message),T}else if(tr(x)){let q={};for(const Y in x){if(!Nr(q)&&!r)break;const U=h2(await x[Y](E,n),j,Y);U&&(q={...U,...K(Y,U.message)},R(U.message),r&&(T[S]=q))}if(!Nr(q)&&(T[S]={ref:j,...q},!r))return T}}return R(!0),T};const Lme={mode:xo.onSubmit,reValidateMode:xo.onChange,shouldFocusError:!0};function Fme(e={}){let t={...Lme,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Lo(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=tr(t.defaultValues)||tr(t.values)?kn(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:kn(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 m={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let h={...m};const v={array:l2(),state:l2()},y=t.criteriaMode===xo.all,x=G=>ae=>{clearTimeout(f),f=setTimeout(G,ae)},S=async G=>{if(!t.disabled&&(m.isValid||h.isValid||G)){const ae=t.resolver?Nr((await O()).errors):await L(r,!0);ae!==n.isValid&&v.state.next({isValid:ae})}},C=(G,ae)=>{!t.disabled&&(m.isValidating||m.validatingFields||h.isValidating||h.validatingFields)&&((G||Array.from(c.mount)).forEach(pe=>{pe&&(ae?qt(n.validatingFields,pe,ae):qn(n.validatingFields,pe))}),v.state.next({validatingFields:n.validatingFields,isValidating:!Nr(n.validatingFields)}))},k=(G,ae=[],pe,Ce,re=!0,ue=!0)=>{if(Ce&&pe&&!t.disabled){if(a.action=!0,ue&&Array.isArray(Pe(r,G))){const X=pe(Pe(r,G),Ce.argA,Ce.argB);re&&qt(r,G,X)}if(ue&&Array.isArray(Pe(n.errors,G))){const X=pe(Pe(n.errors,G),Ce.argA,Ce.argB);re&&qt(n.errors,G,X),zme(n.errors,G)}if((m.touchedFields||h.touchedFields)&&ue&&Array.isArray(Pe(n.touchedFields,G))){const X=pe(Pe(n.touchedFields,G),Ce.argA,Ce.argB);re&&qt(n.touchedFields,G,X)}(m.dirtyFields||h.dirtyFields)&&(n.dirtyFields=ad(i,o)),v.state.next({name:G,isDirty:ee(G,ae),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else qt(o,G,ae)},E=(G,ae)=>{qt(n.errors,G,ae),v.state.next({errors:n.errors})},j=G=>{n.errors=G,v.state.next({errors:n.errors,isValid:!1})},R=(G,ae,pe,Ce)=>{const re=Pe(r,G);if(re){const ue=Pe(o,G,yn(pe)?Pe(i,G):pe);yn(ue)||Ce&&Ce.defaultChecked||ae?qt(o,G,ae?ue:f2(re._f)):U(G,ue),a.mount&&!a.action&&S()}},T=(G,ae,pe,Ce,re)=>{let ue=!1,X=!1;const ve={name:G};if(!t.disabled){if(!pe||Ce){(m.isDirty||h.isDirty)&&(X=n.isDirty,n.isDirty=ve.isDirty=ee(),ue=X!==ve.isDirty);const Ee=zo(Pe(i,G),ae);X=!!Pe(n.dirtyFields,G),Ee?qn(n.dirtyFields,G):qt(n.dirtyFields,G,!0),ve.dirtyFields=n.dirtyFields,ue=ue||(m.dirtyFields||h.dirtyFields)&&X!==!Ee}if(pe){const Ee=Pe(n.touchedFields,G);Ee||(qt(n.touchedFields,G,pe),ve.touchedFields=n.touchedFields,ue=ue||(m.touchedFields||h.touchedFields)&&Ee!==pe)}ue&&re&&v.state.next(ve)}return ue?ve:{}},N=(G,ae,pe,Ce)=>{const re=Pe(n.errors,G),ue=(m.isValid||h.isValid)&&$i(ae)&&n.isValid!==ae;if(t.delayError&&pe?(d=x(()=>E(G,pe)),d(t.delayError)):(clearTimeout(f),d=null,pe?qt(n.errors,G,pe):qn(n.errors,G)),(pe?!zo(re,pe):re)||!Nr(Ce)||ue){const X={...Ce,...ue&&$i(ae)?{isValid:ae}:{},errors:n.errors,name:G};n={...n,...X},v.state.next(X)}},O=async G=>{C(G,!0);const ae=await t.resolver(o,t.context,Ome(G||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return C(G),ae},M=async G=>{const{errors:ae}=await O(G);if(G)for(const pe of G){const Ce=Pe(ae,pe);Ce?qt(n.errors,pe,Ce):qn(n.errors,pe)}else n.errors=ae;return ae},L=async(G,ae,pe={valid:!0})=>{for(const Ce in G){const re=G[Ce];if(re){const{_f:ue,...X}=re;if(ue){const ve=c.array.has(ue.name),Ee=re._f&&Ame(re._f);Ee&&m.validatingFields&&C([ue.name],!0);const Ke=await UC(re,c.disabled,o,y,t.shouldUseNativeValidation&&!ae,ve);if(Ee&&m.validatingFields&&C([ue.name]),Ke[ue.name]&&(pe.valid=!1,ae))break;!ae&&(Pe(Ke,ue.name)?ve?QU(n.errors,Ke,ue.name):qt(n.errors,ue.name,Ke[ue.name]):qn(n.errors,ue.name))}!Nr(X)&&await L(X,ae,pe)}}return pe.valid},K=()=>{for(const G of c.unMount){const ae=Pe(r,G);ae&&(ae._f.refs?ae._f.refs.every(pe=>!Z_(pe)):!Z_(ae._f.ref))&&B(G)}c.unMount=new Set},ee=(G,ae)=>!t.disabled&&(G&&ae&&qt(o,G,ae),!zo(D(),i)),q=(G,ae,pe)=>MC(G,c,{...a.mount?o:yn(ae)?i:zi(G)?{[G]:ae}:ae},pe,ae),Y=G=>gx(Pe(a.mount?o:i,G,t.shouldUnregister?Pe(i,G,[]):[])),U=(G,ae,pe={})=>{const Ce=Pe(r,G);let re=ae;if(Ce){const ue=Ce._f;ue&&(!ue.disabled&&qt(o,G,XU(ae,ue)),re=zy(ue.ref)&&hi(ae)?"":ae,ZU(ue.ref)?[...ue.ref.options].forEach(X=>X.selected=re.includes(X.value)):ue.refs?ih(ue.ref)?ue.refs.forEach(X=>{(!X.defaultChecked||!X.disabled)&&(Array.isArray(re)?X.checked=!!re.find(ve=>ve===X.value):X.checked=re===X.value||!!re)}):ue.refs.forEach(X=>X.checked=X.value===re):ij(ue.ref)?ue.ref.value="":(ue.ref.value=re,ue.ref.type||v.state.next({name:G,values:kn(o)})))}(pe.shouldDirty||pe.shouldTouch)&&T(G,re,pe.shouldTouch,pe.shouldDirty,!0),pe.shouldValidate&&te(G)},H=(G,ae,pe)=>{for(const Ce in ae){if(!ae.hasOwnProperty(Ce))return;const re=ae[Ce],ue=G+"."+Ce,X=Pe(r,ue);(c.array.has(G)||tr(re)||X&&!X._f)&&!gc(re)?H(ue,re,pe):U(ue,re,pe)}},z=(G,ae,pe={})=>{const Ce=Pe(r,G),re=c.array.has(G),ue=kn(ae);qt(o,G,ue),re?(v.array.next({name:G,values:kn(o)}),(m.isDirty||m.dirtyFields||h.isDirty||h.dirtyFields)&&pe.shouldDirty&&v.state.next({name:G,dirtyFields:ad(i,o),isDirty:ee(G,ue)})):Ce&&!Ce._f&&!hi(ue)?H(G,ue,pe):U(G,ue,pe),FC(G,c)&&v.state.next({...n,name:G}),v.state.next({name:a.mount?G:void 0,values:kn(o)})},W=async G=>{a.mount=!0;const ae=G.target;let pe=ae.name,Ce=!0;const re=Pe(r,pe),ue=Ee=>{Ce=Number.isNaN(Ee)||gc(Ee)&&isNaN(Ee.getTime())||zo(Ee,Pe(o,pe,Ee))},X=fd(t.mode),ve=fd(t.reValidateMode);if(re){let Ee,Ke;const et=ae.type?f2(re._f):HU(G),Vt=G.type===My.BLUR||G.type===My.FOCUS_OUT,jn=!Dme(re._f)&&!t.resolver&&!Pe(n.errors,pe)&&!re._f.deps||Mme(Vt,Pe(n.touchedFields,pe),n.isSubmitted,ve,X),ln=FC(pe,c,Vt);qt(o,pe,et),Vt?(!ae||!ae.readOnly)&&(re._f.onBlur&&re._f.onBlur(G),d&&d(0)):re._f.onChange&&re._f.onChange(G);const zt=T(pe,et,Vt),wn=!Nr(zt)||ln;if(!Vt&&v.state.next({name:pe,type:G.type,values:kn(o)}),jn)return(m.isValid||h.isValid)&&(t.mode==="onBlur"?Vt&&S():Vt||S()),wn&&v.state.next({name:pe,...ln?{}:zt});if(!Vt&&ln&&v.state.next({...n}),t.resolver){const{errors:_t}=await O([pe]);if(ue(et),Ce){const ur=m2(n.errors,r,pe),Sn=m2(_t,r,ur.name||pe);Ee=Sn.error,pe=Sn.name,Ke=Nr(_t)}}else C([pe],!0),Ee=(await UC(re,c.disabled,o,y,t.shouldUseNativeValidation))[pe],C([pe]),ue(et),Ce&&(Ee?Ke=!1:(m.isValid||h.isValid)&&(Ke=await L(r,!0)));Ce&&(re._f.deps&&(!Array.isArray(re._f.deps)||re._f.deps.length>0)&&te(re._f.deps),N(pe,Ke,Ee,zt))}},F=(G,ae)=>{if(Pe(n.errors,ae)&&G.focus)return G.focus(),1},te=async(G,ae={})=>{let pe,Ce;const re=bi(G);if(t.resolver){const ue=await M(yn(G)?G:re);pe=Nr(ue),Ce=G?!re.some(X=>Pe(ue,X)):pe}else G?(Ce=(await Promise.all(re.map(async ue=>{const X=Pe(r,ue);return await L(X&&X._f?{[ue]:X}:X)}))).every(Boolean),!(!Ce&&!n.isValid)&&S()):Ce=pe=await L(r);return v.state.next({...!zi(G)||(m.isValid||h.isValid)&&pe!==n.isValid?{}:{name:G},...t.resolver||!G?{isValid:pe}:{},errors:n.errors}),ae.shouldFocus&&!Ce&&wd(r,F,G?re:c.mount),Ce},D=(G,ae)=>{let pe={...a.mount?o:i};return ae&&(pe=GU(ae.dirtyFields?n.dirtyFields:n.touchedFields,pe)),yn(G)?pe:zi(G)?Pe(pe,G):G.map(Ce=>Pe(pe,Ce))},$=(G,ae)=>({invalid:!!Pe((ae||n).errors,G),isDirty:!!Pe((ae||n).dirtyFields,G),error:Pe((ae||n).errors,G),isValidating:!!Pe(n.validatingFields,G),isTouched:!!Pe((ae||n).touchedFields,G)}),V=G=>{G&&bi(G).forEach(ae=>qn(n.errors,ae)),v.state.next({errors:G?n.errors:{}})},A=(G,ae,pe)=>{const Ce=(Pe(r,G,{_f:{}})._f||{}).ref,re=Pe(n.errors,G)||{},{ref:ue,message:X,type:ve,...Ee}=re;qt(n.errors,G,{...Ee,...ae,ref:Ce}),v.state.next({name:G,errors:n.errors,isValid:!1}),pe&&pe.shouldFocus&&Ce&&Ce.focus&&Ce.focus()},J=(G,ae)=>Lo(G)?v.state.subscribe({next:pe=>"values"in pe&&G(q(void 0,ae),pe)}):q(G,ae,!0),fe=G=>v.state.subscribe({next:ae=>{Pme(G.name,ae.name,G.exact)&&$me(ae,G.formState||m,sn,G.reRenderRoot)&&G.callback({values:{...o},...n,...ae,defaultValues:i})}}).unsubscribe,ge=G=>(a.mount=!0,h={...h,...G.formState},fe({...G,formState:h})),B=(G,ae={})=>{for(const pe of G?bi(G):c.mount)c.mount.delete(pe),c.array.delete(pe),ae.keepValue||(qn(r,pe),qn(o,pe)),!ae.keepError&&qn(n.errors,pe),!ae.keepDirty&&qn(n.dirtyFields,pe),!ae.keepTouched&&qn(n.touchedFields,pe),!ae.keepIsValidating&&qn(n.validatingFields,pe),!t.shouldUnregister&&!ae.keepDefaultValue&&qn(i,pe);v.state.next({values:kn(o)}),v.state.next({...n,...ae.keepDirty?{isDirty:ee()}:{}}),!ae.keepIsValid&&S()},se=({disabled:G,name:ae})=>{($i(G)&&a.mount||G||c.disabled.has(ae))&&(G?c.disabled.add(ae):c.disabled.delete(ae))},_e=(G,ae={})=>{let pe=Pe(r,G);const Ce=$i(ae.disabled)||$i(t.disabled);return qt(r,G,{...pe||{},_f:{...pe&&pe._f?pe._f:{ref:{name:G}},name:G,mount:!0,...ae}}),c.mount.add(G),pe?se({disabled:$i(ae.disabled)?ae.disabled:t.disabled,name:G}):R(G,!0,ae.value),{...Ce?{disabled:ae.disabled||t.disabled}:{},...t.progressive?{required:!!ae.required,min:$p(ae.min),max:$p(ae.max),minLength:$p(ae.minLength),maxLength:$p(ae.maxLength),pattern:$p(ae.pattern)}:{},name:G,onChange:W,onBlur:W,ref:re=>{if(re){_e(G,ae),pe=Pe(r,G);const ue=yn(re.value)&&re.querySelectorAll&&re.querySelectorAll("input,select,textarea")[0]||re,X=Rme(ue),ve=pe._f.refs||[];if(X?ve.find(Ee=>Ee===ue):ue===pe._f.ref)return;qt(r,G,{_f:{...pe._f,...X?{refs:[...ve.filter(Z_),ue,...Array.isArray(Pe(i,G))?[{}]:[]],ref:{type:ue.type,name:G}}:{ref:ue}}}),R(G,!1,void 0,ue)}else pe=Pe(r,G,{}),pe._f&&(pe._f.mount=!1),(t.shouldUnregister||ae.shouldUnregister)&&!(qU(c.array,G)&&a.action)&&c.unMount.add(G)}}},Ie=()=>t.shouldFocusError&&wd(r,F,c.mount),Fe=G=>{$i(G)&&(v.state.next({disabled:G}),wd(r,(ae,pe)=>{const Ce=Pe(r,pe);Ce&&(ae.disabled=Ce._f.disabled||G,Array.isArray(Ce._f.refs)&&Ce._f.refs.forEach(re=>{re.disabled=Ce._f.disabled||G}))},0,!1))},Le=(G,ae)=>async pe=>{let Ce;pe&&(pe.preventDefault&&pe.preventDefault(),pe.persist&&pe.persist());let re=kn(o);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:ue,values:X}=await O();n.errors=ue,re=kn(X)}else await L(r);if(c.disabled.size)for(const ue of c.disabled)qn(re,ue);if(qn(n.errors,"root"),Nr(n.errors)){v.state.next({errors:{}});try{await G(re,pe)}catch(ue){Ce=ue}}else ae&&await ae({...n.errors},pe),Ie(),setTimeout(Ie);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Nr(n.errors)&&!Ce,submitCount:n.submitCount+1,errors:n.errors}),Ce)throw Ce},We=(G,ae={})=>{Pe(r,G)&&(yn(ae.defaultValue)?z(G,kn(Pe(i,G))):(z(G,ae.defaultValue),qt(i,G,kn(ae.defaultValue))),ae.keepTouched||qn(n.touchedFields,G),ae.keepDirty||(qn(n.dirtyFields,G),n.isDirty=ae.defaultValue?ee(G,kn(Pe(i,G))):ee()),ae.keepError||(qn(n.errors,G),m.isValid&&S()),v.state.next({...n}))},gt=(G,ae={})=>{const pe=G?kn(G):i,Ce=kn(pe),re=Nr(G),ue=re?i:Ce;if(ae.keepDefaultValues||(i=pe),!ae.keepValues){if(ae.keepDirtyValues){const X=new Set([...c.mount,...Object.keys(ad(i,o))]);for(const ve of Array.from(X))Pe(n.dirtyFields,ve)?qt(ue,ve,Pe(o,ve)):z(ve,Pe(ue,ve))}else{if(QE&&yn(G))for(const X of c.mount){const ve=Pe(r,X);if(ve&&ve._f){const Ee=Array.isArray(ve._f.refs)?ve._f.refs[0]:ve._f.ref;if(zy(Ee)){const Ke=Ee.closest("form");if(Ke){Ke.reset();break}}}}if(ae.keepFieldsRef)for(const X of c.mount)z(X,Pe(ue,X));else r={}}o=t.shouldUnregister?ae.keepDefaultValues?kn(i):{}:kn(ue),v.array.next({values:{...ue}}),v.state.next({values:{...ue}})}c={mount:ae.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!m.isValid||!!ae.keepIsValid||!!ae.keepDirtyValues||!t.shouldUnregister&&!Nr(ue),a.watch=!!t.shouldUnregister,a.action=!1,ae.keepErrors||(n.errors={}),v.state.next({submitCount:ae.keepSubmitCount?n.submitCount:0,isDirty:re?!1:ae.keepDirty?n.isDirty:!!(ae.keepDefaultValues&&!zo(G,i)),isSubmitted:ae.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:re?{}:ae.keepDirtyValues?ae.keepDefaultValues&&o?ad(i,o):n.dirtyFields:ae.keepDefaultValues&&G?ad(i,G):ae.keepDirty?n.dirtyFields:{},touchedFields:ae.keepTouched?n.touchedFields:{},errors:ae.keepErrors?n.errors:{},isSubmitSuccessful:ae.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},Qt=(G,ae)=>gt(Lo(G)?G(o):G,ae),Tn=(G,ae={})=>{const pe=Pe(r,G),Ce=pe&&pe._f;if(Ce){const re=Ce.refs?Ce.refs[0]:Ce.ref;re.focus&&(re.focus(),ae.shouldSelect&&Lo(re.select)&&re.select())}},sn=G=>{n={...n,...G}},Mt={control:{register:_e,unregister:B,getFieldState:$,handleSubmit:Le,setError:A,_subscribe:fe,_runSchema:O,_focusError:Ie,_getWatch:q,_getDirty:ee,_setValid:S,_setFieldArray:k,_setDisabledField:se,_setErrors:j,_getFieldArray:Y,_reset:gt,_resetDefaultValues:()=>Lo(t.defaultValues)&&t.defaultValues().then(G=>{Qt(G,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:K,_disableForm:Fe,_subjects:v,_proxyFormState:m,get _fields(){return r},get _formValues(){return o},get _state(){return a},set _state(G){a=G},get _defaultValues(){return i},get _names(){return c},set _names(G){c=G},get _formState(){return n},get _options(){return t},set _options(G){t={...t,...G}}},subscribe:ge,trigger:te,register:_e,handleSubmit:Le,watch:J,setValue:z,getValues:D,reset:Qt,resetField:We,clearErrors:V,unregister:B,setError:A,setFocus:Tn,getFieldState:$};return{...Mt,formControl:Mt}}var Hs=()=>{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)})},Y_=(e,t,n={})=>n.shouldFocus||yn(n.shouldFocus)?n.focusName||`${e}.${yn(n.focusIndex)?t:n.focusIndex}.`:"",W_=(e,t)=>[...e,...bi(t)],X_=e=>Array.isArray(e)?e.map(()=>{}):void 0;function J_(e,t,n){return[...e.slice(0,t),...bi(n),...e.slice(t)]}var Q_=(e,t,n)=>Array.isArray(e)?(yn(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],e1=(e,t)=>[...bi(t),...bi(e)];function Ume(e,t){let n=0;const r=[...e];for(const i of t)r.splice(i-n,1),n++;return gx(r).length?r:[]}var t1=(e,t)=>yn(t)?[]:Ume(e,bi(t).sort((n,r)=>n-r)),n1=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},g2=(e,t,n)=>(e[t]=n,e);function aj(e){const t=oh(),{control:n=t.control,name:r,keyName:i="id",shouldUnregister:o,rules:a}=e,[c,d]=Q.useState(n._getFieldArray(r)),f=Q.useRef(n._getFieldArray(r).map(Hs)),m=Q.useRef(!1);n._names.array.add(r),Q.useMemo(()=>a&&c.length>=0&&n.register(r,a),[n,r,c.length,a]),vx(()=>n._subjects.array.subscribe({next:({values:R,name:T})=>{if(T===r||!T){const N=Pe(R,r);Array.isArray(N)&&(d(N),f.current=N.map(Hs))}}}).unsubscribe,[n,r]);const h=Q.useCallback(R=>{m.current=!0,n._setFieldArray(r,R)},[n,r]),v=(R,T)=>{const N=bi(kn(R)),O=W_(n._getFieldArray(r),N);n._names.focus=Y_(r,O.length-1,T),f.current=W_(f.current,N.map(Hs)),h(O),d(O),n._setFieldArray(r,O,W_,{argA:X_(R)})},y=(R,T)=>{const N=bi(kn(R)),O=e1(n._getFieldArray(r),N);n._names.focus=Y_(r,0,T),f.current=e1(f.current,N.map(Hs)),h(O),d(O),n._setFieldArray(r,O,e1,{argA:X_(R)})},x=R=>{const T=t1(n._getFieldArray(r),R);f.current=t1(f.current,R),h(T),d(T),!Array.isArray(Pe(n._fields,r))&&qt(n._fields,r,void 0),n._setFieldArray(r,T,t1,{argA:R})},S=(R,T,N)=>{const O=bi(kn(T)),M=J_(n._getFieldArray(r),R,O);n._names.focus=Y_(r,R,N),f.current=J_(f.current,R,O.map(Hs)),h(M),d(M),n._setFieldArray(r,M,J_,{argA:R,argB:X_(T)})},C=(R,T)=>{const N=n._getFieldArray(r);n1(N,R,T),n1(f.current,R,T),h(N),d(N),n._setFieldArray(r,N,n1,{argA:R,argB:T},!1)},k=(R,T)=>{const N=n._getFieldArray(r);Q_(N,R,T),Q_(f.current,R,T),h(N),d(N),n._setFieldArray(r,N,Q_,{argA:R,argB:T},!1)},E=(R,T)=>{const N=kn(T),O=g2(n._getFieldArray(r),R,N);f.current=[...O].map((M,L)=>!M||L===R?Hs():f.current[L]),h(O),d([...O]),n._setFieldArray(r,O,g2,{argA:R,argB:N},!0,!1)},j=R=>{const T=bi(kn(R));f.current=T.map(Hs),h([...T]),d([...T]),n._setFieldArray(r,[...T],N=>N,{},!0,!1)};return Q.useEffect(()=>{if(n._state.action=!1,FC(r,n._names)&&n._subjects.state.next({...n._formState}),m.current&&(!fd(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!fd(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([r]).then(R=>{const T=Pe(R.errors,r),N=Pe(n._formState.errors,r);(N?!T&&N.type||T&&(N.type!==T.type||N.message!==T.message):T&&T.type)&&(T?qt(n._formState.errors,r,T):qn(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const R=Pe(n._fields,r);R&&R._f&&!(fd(n._options.reValidateMode).isOnSubmit&&fd(n._options.mode).isOnSubmit)&&UC(R,n._names.disabled,n._formValues,n._options.criteriaMode===xo.all,n._options.shouldUseNativeValidation,!0).then(T=>!Nr(T)&&n._subjects.state.next({errors:QU(n._formState.errors,T,r)}))}n._subjects.state.next({name:r,values:kn(n._formValues)}),n._names.focus&&wd(n._fields,(R,T)=>{if(n._names.focus&&T.startsWith(n._names.focus)&&R.focus)return R.focus(),1}),n._names.focus="",n._setValid(),m.current=!1},[c,r,n]),Q.useEffect(()=>(!Pe(n._formValues,r)&&n._setFieldArray(r),()=>{const R=(T,N)=>{const O=Pe(n._fields,T);O&&O._f&&(O._f.mount=N)};n._options.shouldUnregister||o?n.unregister(r):R(r,!1)}),[r,n,i,o]),{swap:Q.useCallback(C,[h,r,n]),move:Q.useCallback(k,[h,r,n]),prepend:Q.useCallback(y,[h,r,n]),append:Q.useCallback(v,[h,r,n]),remove:Q.useCallback(x,[h,r,n]),insert:Q.useCallback(S,[h,r,n]),update:Q.useCallback(E,[h,r,n]),replace:Q.useCallback(j,[h,r,n]),fields:Q.useMemo(()=>c.map((R,T)=>({...R,[i]:f.current[T]||Hs()})),[c,i])}}function on(e={}){const t=Q.useRef(void 0),n=Q.useRef(void 0),[r,i]=Q.useState({isDirty:!1,isValidating:!1,isLoading:Lo(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:Lo(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Lo(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...c}=Fme(e);t.current={...c,formState:r}}const o=t.current.control;return o._options=e,vx(()=>{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]),Q.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),Q.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),Q.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),Q.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),Q.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==r.isDirty&&o._subjects.state.next({isDirty:a})}},[o,r.isDirty]),Q.useEffect(()=>{var a;e.values&&!zo(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((a=o._options.resetOptions)===null||a===void 0)&&a.keepIsValid||o._setValid(),n.current=e.values,i(c=>({...c}))):o._resetDefaultValues()},[o,e.values]),Q.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=KU(r,o),t.current}const an=Cme,e6=b.createContext({}),t6=b.createContext({});function yx(){const e=b.useContext(e6),t=b.useContext(t6),{getFieldState:n}=oh(),r=nj({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 De({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:i}=yx();return u.jsx(rE,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${i}`:`${r}`,"aria-invalid":!!t,...e})}function $e({...e}){return u.jsx(e6,{value:{name:e.name},children:u.jsx(jme,{...e})})}function Ne({className:e,...t}){const n=b.useId();return u.jsx(t6,{value:{id:n},children:u.jsx("div",{"data-slot":"form-item",className:Ue("grid gap-2",e),...t})})}var Vme=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],n6=Vme.reduce((e,t)=>{const n=g4(`Primitive.${t}`),r=b.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}},{}),Bme="Label",r6=b.forwardRef((e,t)=>u.jsx(n6.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));r6.displayName=Bme;var Hme=r6;function ah({className:e,...t}){return u.jsx(Hme,{"data-slot":"label",className:Ue("text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function Te({className:e,...t}){const{error:n,formItemId:r}=yx();return u.jsx(ah,{"data-slot":"form-label","data-error":!!n,className:Ue("data-[error=true]:text-destructive",e),htmlFor:r,...t})}function Oe({className:e,...t}){const{error:n,formMessageId:r}=yx(),i=n?String(n?.message):t.children;return i?u.jsx("p",{"data-slot":"form-message",id:r,className:Ue("text-destructive text-sm",e),...t,children:i}):null}function Me({className:e,type:t,...n}){return u.jsx("input",{type:t,"data-slot":"input",className:Ue(`border-input file:text-foreground placeholder:text-muted-foreground selection:bg-purple
39
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
- `},bP=I1e(A1e)(bq),D1e={config:T1e},$1e=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 xq(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],xq(e[n],t[n]))}),hP(hP({},e),t)}var P1e={type:"cancelation",msg:"operation is manually canceled"};function S1(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(P1e):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var M1e=j1e.create({config:R1e,isInitialized:!1,resolve:null,reject:null,monaco:null}),wq=l1e(M1e,2),Lh=wq[0],D0=wq[1];function z1e(e){var t=D1e.config(e),n=t.monaco,r=s1e(t,["monaco"]);D0(function(i){return{config:xq(i.config,r),monaco:n}})}function L1e(){var e=Lh(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(D0({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),S1(_1);if(window.monaco&&window.monaco.editor)return Sq(window.monaco),e.resolve(window.monaco),S1(_1);$1e(F1e,V1e)(B1e)}return S1(_1)}function F1e(e){return document.body.appendChild(e)}function U1e(e){var t=document.createElement("script");return e&&(t.src=e),t}function V1e(e){var t=Lh(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=U1e("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function B1e(){var e=Lh(function(n){var r=n.config,i=n.resolve,o=n.reject;return{config:r,resolve:i,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){Sq(n),e.resolve(n)},function(n){e.reject(n)})}function Sq(e){Lh().monaco||D0({monaco:e})}function H1e(){return Lh(function(e){var t=e.monaco;return t})}var _1=new Promise(function(e,t){return D0({resolve:e,reject:t})}),_q={config:z1e,init:L1e,__getMonacoInstance:H1e},q1e={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},C1=q1e,K1e={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},G1e=K1e;function Z1e({children:e}){return Q.createElement("div",{style:G1e.container},e)}var Y1e=Z1e,W1e=Y1e;function X1e({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:a}){return Q.createElement("section",{style:{...C1.wrapper,width:e,height:t},...a},!n&&Q.createElement(W1e,null,r),Q.createElement("div",{ref:i,style:{...C1.fullWidth,...!n&&C1.hide},className:o}))}var J1e=X1e,Cq=b.memo(J1e);function Q1e(e){b.useEffect(e,[])}var kq=Q1e;function eCe(e,t,n=!0){let r=b.useRef(!0);b.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Pi=eCe;function sm(){}function pd(e,t,n,r){return tCe(e,r)||nCe(e,t,n,r)}function tCe(e,t){return e.editor.getModel(Eq(e,t))}function nCe(e,t,n,r){return e.editor.createModel(t,n,r?Eq(e,r):void 0)}function Eq(e,t){return e.Uri.parse(t)}function rCe({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:a,keepCurrentOriginalModel:c=!1,keepCurrentModifiedModel:d=!1,theme:f="light",loading:m="Loading...",options:h={},height:v="100%",width:y="100%",className:x,wrapperProps:S={},beforeMount:C=sm,onMount:k=sm}){let[E,j]=b.useState(!1),[R,T]=b.useState(!0),N=b.useRef(null),O=b.useRef(null),M=b.useRef(null),L=b.useRef(k),K=b.useRef(C),ee=b.useRef(!1);kq(()=>{let H=_q.init();return H.then(z=>(O.current=z)&&T(!1)).catch(z=>z?.type!=="cancelation"&&console.error("Monaco initialization: error:",z)),()=>N.current?U():H.cancel()}),Pi(()=>{if(N.current&&O.current){let H=N.current.getOriginalEditor(),z=pd(O.current,e||"",r||n||"text",o||"");z!==H.getModel()&&H.setModel(z)}},[o],E),Pi(()=>{if(N.current&&O.current){let H=N.current.getModifiedEditor(),z=pd(O.current,t||"",i||n||"text",a||"");z!==H.getModel()&&H.setModel(z)}},[a],E),Pi(()=>{let H=N.current.getModifiedEditor();H.getOption(O.current.editor.EditorOption.readOnly)?H.setValue(t||""):t!==H.getValue()&&(H.executeEdits("",[{range:H.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),H.pushUndoStop())},[t],E),Pi(()=>{N.current?.getModel()?.original.setValue(e||"")},[e],E),Pi(()=>{let{original:H,modified:z}=N.current.getModel();O.current.editor.setModelLanguage(H,r||n||"text"),O.current.editor.setModelLanguage(z,i||n||"text")},[n,r,i],E),Pi(()=>{O.current?.editor.setTheme(f)},[f],E),Pi(()=>{N.current?.updateOptions(h)},[h],E);let q=b.useCallback(()=>{if(!O.current)return;K.current(O.current);let H=pd(O.current,e||"",r||n||"text",o||""),z=pd(O.current,t||"",i||n||"text",a||"");N.current?.setModel({original:H,modified:z})},[n,t,i,e,r,o,a]),Y=b.useCallback(()=>{!ee.current&&M.current&&(N.current=O.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...h}),q(),O.current?.editor.setTheme(f),j(!0),ee.current=!0)},[h,f,q]);b.useEffect(()=>{E&&L.current(N.current,O.current)},[E]),b.useEffect(()=>{!R&&!E&&Y()},[R,E,Y]);function U(){let H=N.current?.getModel();c||H?.original?.dispose(),d||H?.modified?.dispose(),N.current?.dispose()}return Q.createElement(Cq,{width:y,height:v,isEditorReady:E,loading:m,_ref:M,className:x,wrapperProps:S})}var iCe=rCe;b.memo(iCe);function oCe(e){let t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current}var aCe=oCe,zv=new Map;function sCe({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:o,theme:a="light",line:c,loading:d="Loading...",options:f={},overrideServices:m={},saveViewState:h=!0,keepCurrentModel:v=!1,width:y="100%",height:x="100%",className:S,wrapperProps:C={},beforeMount:k=sm,onMount:E=sm,onChange:j,onValidate:R=sm}){let[T,N]=b.useState(!1),[O,M]=b.useState(!0),L=b.useRef(null),K=b.useRef(null),ee=b.useRef(null),q=b.useRef(E),Y=b.useRef(k),U=b.useRef(),H=b.useRef(r),z=aCe(o),W=b.useRef(!1),F=b.useRef(!1);kq(()=>{let $=_q.init();return $.then(V=>(L.current=V)&&M(!1)).catch(V=>V?.type!=="cancelation"&&console.error("Monaco initialization: error:",V)),()=>K.current?D():$.cancel()}),Pi(()=>{let $=pd(L.current,e||r||"",t||i||"",o||n||"");$!==K.current?.getModel()&&(h&&zv.set(z,K.current?.saveViewState()),K.current?.setModel($),h&&K.current?.restoreViewState(zv.get(o)))},[o],T),Pi(()=>{K.current?.updateOptions(f)},[f],T),Pi(()=>{!K.current||r===void 0||(K.current.getOption(L.current.editor.EditorOption.readOnly)?K.current.setValue(r):r!==K.current.getValue()&&(F.current=!0,K.current.executeEdits("",[{range:K.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),K.current.pushUndoStop(),F.current=!1))},[r],T),Pi(()=>{let $=K.current?.getModel();$&&i&&L.current?.editor.setModelLanguage($,i)},[i],T),Pi(()=>{c!==void 0&&K.current?.revealLine(c)},[c],T),Pi(()=>{L.current?.editor.setTheme(a)},[a],T);let te=b.useCallback(()=>{if(!(!ee.current||!L.current)&&!W.current){Y.current(L.current);let $=o||n,V=pd(L.current,r||e||"",t||i||"",$||"");K.current=L.current?.editor.create(ee.current,{model:V,automaticLayout:!0,...f},m),h&&K.current.restoreViewState(zv.get($)),L.current.editor.setTheme(a),c!==void 0&&K.current.revealLine(c),N(!0),W.current=!0}},[e,t,n,r,i,o,f,m,h,a,c]);b.useEffect(()=>{T&&q.current(K.current,L.current)},[T]),b.useEffect(()=>{!O&&!T&&te()},[O,T,te]),H.current=r,b.useEffect(()=>{T&&j&&(U.current?.dispose(),U.current=K.current?.onDidChangeModelContent($=>{F.current||j(K.current.getValue(),$)}))},[T,j]),b.useEffect(()=>{if(T){let $=L.current.editor.onDidChangeMarkers(V=>{let A=K.current.getModel()?.uri;if(A&&V.find(J=>J.path===A.path)){let J=L.current.editor.getModelMarkers({resource:A});R?.(J)}});return()=>{$?.dispose()}}return()=>{}},[T,R]);function D(){U.current?.dispose(),v?h&&zv.set(o,K.current.saveViewState()):K.current.getModel()?.dispose(),K.current.dispose()}return Q.createElement(Cq,{width:y,height:x,isEditorReady:T,loading:d,_ref:ee,className:S,wrapperProps:C})}var lCe=sCe,Fh=b.memo(lCe),$0=Fh;const xP={roles:{create:!0,view:!0,update:!0,delete:!0},clusters:{create:!0,view:!0,update:!0,delete:!0,resources:[]}};function cCe({isModalOpen:e,setIsModalOpen:t}){const n=rr(),{organizationId:r}=it({strict:!1}),[i,o]=b.useState(!0),[a,c]=b.useState(JSON.stringify(xP,null,2)),{mutate:d,isPending:f}=i1e(),m=on({resolver:mn(yq),defaultValues:{name:"",update:!1,delete:!1}}),h=b.useCallback(y=>{o(y.length===0)},[o]),v=b.useCallback(async y=>{const x=Mh(a);if(!x)return;const S={...y,...x,organizationId:r};y&&i&&d(S,{onSuccess:()=>{we.success("Organization role added successfully!"),t(!1),n.invalidateQueries({queryKey:[r,"roles"],refetchType:"active"}),m.reset()},onError:C=>{we.error(`Failed to add organization role: ${C.message}`)}})},[i,a,d,m,n,t,r]);return u.jsx(Fn,{onOpenChange:t,open:e,children:u.jsxs(Un,{children:[u.jsx($n,{children:"Add New Organization Role"}),u.jsx(kr,{children:"Set the new organization role permissions."}),u.jsx(an,{...m,children:u.jsxs("form",{className:"grid grid-cols-2 gap-4 my-4",onSubmit:m.handleSubmit(v),children:[u.jsx($e,{control:m.control,name:"name",render:({field:y})=>u.jsxs(Ne,{className:"col-span-2",children:[u.jsx(Te,{className:"pb-1",children:"Role Name"}),u.jsx(De,{children:u.jsx(Me,{type:"text",className:"",...y})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:m.control,name:"update",render:({field:y})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Can Update Organization"}),u.jsx(De,{children:u.jsx(Me,{type:"checkbox",className:"w-6 ml-2",checked:y.value,onChange:x=>y.onChange(x.target.checked)})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:m.control,name:"delete",render:({field:y})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Can Delete Organization"}),u.jsx(De,{children:u.jsx(Me,{type:"checkbox",className:"w-6 ml-2",checked:y.value,onChange:x=>y.onChange(x.target.checked)})}),u.jsx(Oe,{})]})}),u.jsx("div",{className:"col-span-2",children:u.jsx(Fh,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate:h,onChange:y=>{y&&c(y)},defaultValue:JSON.stringify(xP,null,2)})}),u.jsx(Zn,{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:()=>t(!1),disabled:f,children:"Cancel"}),u.jsx(be,{variant:"submit",className:"rounded-full",disabled:f||!i||!m.formState.isValid,children:"Save Changes"})]})})]})})]})})}async function uCe({roleId:e}){const{data:t}=await Gt.delete(`/Role/${e}`,{id:e,deleted:!0});return t}function dCe(){return ct({mutationFn:({roleId:e})=>uCe({roleId:e})})}async function fCe({roleId:e,updatedRoleInfo:t}){const{data:n}=await Gt.put(`/Role/${e}`,t);return n}function pCe(){return ct({mutationFn:({roleId:e,updatedRoleInfo:t})=>fCe({roleId:e,updatedRoleInfo:t})})}function mCe({organizationId:e,roleId:t}){return{queryKey:[e,"roles",t],queryFn:()=>hCe(t),refetchInterval:10*1e3}}async function hCe(e){const{data:t}=await Gt.get(`/Role/${e}`);return t}function gCe({onRoleDeleteClick:e,setIsConfirmingRoleDeletion:t,isRoleDeletionPending:n}){return u.jsxs(u.Fragment,{children:[u.jsx($n,{children:"Confirm Role Deletion"}),u.jsx(kr,{children:"Are you sure you want to delete this role? This action cannot be undone."}),u.jsxs(Zn,{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 vCe({data:e,isModalOpen:t,closeModal:n}){const r=rr(),{data:i}=Wi(mCe({roleId:e.id,organizationId:e.organizationId})),o=El(),a=o.user&&o.user?.roles?.[e.organizationId]?.role===e.roleName,{update:c,remove:d}=hf(e.organizationId),{mutate:f,isPending:m}=pCe(),{mutate:h,isPending:v}=dCe(),[y,x]=b.useState(!1),S=on({resolver:mn(yq),defaultValues:{name:e.roleName,update:i.organization.update||!1,delete:i.organization.delete||!1}}),C=b.useCallback(()=>{h({roleId:e.id},{onSuccess:()=>{we.success("Role deleted successfully!"),n(!0),S.reset()},onError:M=>{we.error("Error",{description:`Failed to delete role: ${M instanceof Error?M.message:String(M)}.`,action:{label:"Dismiss",onClick:()=>we.dismiss()}})}})},[e.id,h,S,n]),[k,E]=b.useState(!0),[j,R]=b.useState(JSON.stringify({roles:{...i.organization.roles},clusters:{...i.organization.clusters}},null,2)),T=b.useCallback(M=>{E(M.length===0)},[E]),N=b.useCallback(async M=>{if(!c)return;const L=Mh(j);if(!L)return;const K={...M,...L,organizationId:e.organizationId};j&&k&&f({roleId:e.id,updatedRoleInfo:K},{onSuccess:async()=>{we.success("Role updated successfully!"),await r.invalidateQueries({queryKey:[e.organizationId,"roles",e.id]}),n(!1),S.reset()},onError:ee=>{we.error("Error",{description:`Failed to update role: ${ee instanceof Error?ee.message:String(ee)}.`,action:{label:"Dismiss",onClick:()=>we.dismiss()}})}})},[n,e.id,e.organizationId,S,k,r,i,c,j,f]),O=b.useCallback(()=>n(!1),[n]);return u.jsx(Fn,{onOpenChange:O,open:t,children:u.jsx(Un,{children:y?u.jsx(gCe,{onRoleDeleteClick:C,setIsConfirmingRoleDeletion:x,isRoleDeletionPending:v}):u.jsxs(u.Fragment,{children:[u.jsxs($n,{children:[a||!c?"View":"Edit",' Organization Role "',e.roleName,'"']}),u.jsx(an,{...S,children:u.jsxs("form",{className:"grid grid-cols-2 gap-4 my-4",onSubmit:S.handleSubmit(N),children:[u.jsx($e,{control:S.control,name:"name",render:({field:M})=>u.jsxs(Ne,{className:"col-span-2",children:[u.jsx(Te,{className:"pb-1",children:"Role Name"}),u.jsx(De,{children:u.jsx(Me,{type:"text",className:"",...M,disabled:!0,readOnly:!0})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:S.control,name:"update",render:({field:M})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Can Update Organization"}),u.jsx(De,{children:u.jsx(Me,{type:"checkbox",className:"w-6 ml-2",disabled:a||!c,readOnly:a||!c,checked:M.value,onChange:L=>M.onChange(L.target.checked)})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:S.control,name:"delete",render:({field:M})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Can Delete Organization"}),u.jsx(De,{children:u.jsx(Me,{type:"checkbox",className:"w-6 ml-2",disabled:a||!c,readOnly:a||!c,checked:M.value,onChange:L=>M.onChange(L.target.checked)})}),u.jsx(Oe,{})]})}),u.jsx("div",{className:"col-span-2",children:u.jsx(Fh,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate:T,onChange:M=>{M&&R(M)},options:a||!c?{readOnly:!0}:void 0,defaultValue:j})}),!a&&(d||c)&&u.jsx(Zn,{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:()=>x(!0),disabled:m,children:"Delete Role"}),c&&u.jsx(be,{variant:"submit",className:"rounded-full",disabled:!k||m||!S.formState.isValid||!S.formState.isDirty,children:"Save Changes"})]})})]})})]})})})}function jq(){const e=En(),t=rr(),{organizationId:n,orgRoleId:r}=it({strict:!1}),{create:i}=hf(n),{data:o,refetch:a,isFetching:c,isRefetching:d}=Wi(A0(n)),f=b.useMemo(()=>o&&o?.find(E=>E.id===r),[o,r]),m=!!r&&!!f,[h,v]=b.useState(!1),y=b.useCallback(async(E,j)=>{const R=[r?"..":"",E].filter(Boolean);await e({to:R.join("/")}),j&&await t.invalidateQueries({queryKey:[n,"roles"],refetchType:"active"})},[r,e,t]),x=b.useCallback(()=>{v(!0)},[v]),S=b.useCallback(E=>y(E.original.id,!1),[y]),C=b.useCallback(E=>y(void 0,E),[y]),k=Ml(a);return u.jsxs(u.Fragment,{children:[u.jsx(gs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-(--spacing(32)))]",children:u.jsxs(b.Suspense,{fallback:u.jsx(eo,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(jf,{data:o,columns:n1e,onRowClick:S,children:[u.jsxs(be,{variant:"defaultOutline",onClick:k,accessKey:"r",disabled:c||d,children:[u.jsx(ba,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),i&&u.jsxs(be,{variant:"positiveOutline",onClick:x,accessKey:"a",disabled:h,children:[u.jsx(Xr,{}),u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),i&&u.jsx(cCe,{isModalOpen:h,setIsModalOpen:v}),m&&u.jsx(vCe,{data:f,isModalOpen:m,closeModal:C})]})})]})}const yCe=j0(),bCe=[{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},yCe.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}],xCe=Sl.object({email:Sf.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:Sl.string().nonempty({error:"Please select a role."})});async function wCe(e){const{data:t}=await Gt.post("/OrganizationRole/",e);return t}function Rq(){return ct({mutationFn:e=>wCe(e)})}Sl.object({email:Sf.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:Sl.string().nonempty({error:"Please select a role."})});async function SCe(e){const{data:t}=await Gt.post("/UserInvite/",e);return t}function _Ce(){return ct({mutationFn:e=>SCe(e)})}function CCe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const{organizationId:r}=it({strict:!1}),{data:i}=Wi(A0(r)),[o,a]=b.useState(!1),c=on({resolver:mn(xCe),defaultValues:{email:"",roleId:""}}),{mutate:d,isPending:f}=Rq(),{mutate:m,isPending:h}=_Ce(),v=b.useCallback(async y=>{y&&(o?m:d)(y,{onSuccess:()=>{const x=y.roleId;c.reset(),c.setValue("roleId",x),t(),we.success("User invited successfully!"),n(!1),a(!1)},onError:x=>{x?.status===404&&a(!0)}})},[d,c,m,t,n,o]);return u.jsx(Fn,{onOpenChange:()=>{n(!1),a(!1),c.reset()},open:e,children:u.jsx(Un,{"aria-describedby":void 0,children:u.jsx(an,{...c,children:u.jsxs("form",{onSubmit:c.handleSubmit(v),className:"grid gap-4 my-4",children:[u.jsx(gr,{children:u.jsx($n,{children:o?"Invite User":"Add User"})}),u.jsx($e,{control:c.control,name:"email",render:({field:y})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Email"}),u.jsx(De,{children:u.jsx(Me,{type:"email",enterKeyHint:"next",autoComplete:"email",...y})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:c.control,name:"roleId",render:({field:y})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Roles"}),u.jsx(b.Suspense,{fallback:u.jsx(Dr,{}),children:u.jsx(De,{children:u.jsxs(qi,{...y,onValueChange:x=>y.onChange(x),children:[u.jsx(Gi,{className:"w-full",children:u.jsx(Ki,{placeholder:"Choose Role"})}),u.jsx(Zi,{children:u.jsxs(Yo,{children:[u.jsx(yI,{children:"Role"}),i?.map(x=>u.jsx(At,{value:x.id,children:x.roleName},x.id))]})})]})})}),u.jsx(Oe,{})]})}),o&&u.jsxs(kr,{className:"p-3 my-5 text-white rounded-md bg-amber-600 flex",children:[u.jsx(Ute,{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(Zn,{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(jo,{})," ",o?"Invite User":"Add User"]})})})]})})})})}async function kCe({roleId:e,userId:t}){const{data:n}=await Gt.delete(`/OrganizationRole/role/${e}/user/${t}`);return n}function ECe(){return ct({mutationFn:({roleId:e,userId:t})=>kCe({roleId:e,userId:t})})}function Iq(e){const[t,n]=b.useState(e||!1),r=b.useCallback(i=>{n(i.target.checked)},[]);return[t,r]}function jCe({data:e,readOnly:t,canRemove:n,orgRole:r,selectedRoles:i,setChangesMade:o}){const{mutate:a,isPending:c}=Rq(),{mutate:d,isPending:f}=ECe(),m=!!i[r.roleName],[h,v]=b.useState(m),[y,x]=Iq(m);return b.useEffect(()=>{y!==h&&(y?a({email:e.email,roleId:r.id},{onSuccess:()=>{v(y),o(!0),we.success("Role added successfully")}}):d({userId:e.id,roleId:r.id},{onSuccess:()=>{v(y),o(!0),we.success("Role removed successfully")}}))},[a,e.email,e.id,y,r.id,d,o,h]),u.jsxs(ah,{className:"flex",children:[u.jsx(Me,{type:"checkbox",className:"w-6",disabled:t||c||f||!n&&y,checked:y,onChange:x}),u.jsx("span",{className:"pl-4 pr-8 flex-1 py-2.5",children:r.roleName})]},r.id)}function RCe({closeModal:e,data:t,isModalOpen:n,onUserUpdated:r}){const{organizationId:i}=it({strict:!1}),o=El(),{update:a,remove:c}=hf(i),d=o.user?.email===t.email,{data:f}=Wi(A0(i)),m=b.useMemo(()=>t.roles?kf(t.roles,"roleName"):{},[t]),[h,v]=b.useState(!1);return u.jsx(Fn,{onOpenChange:h?r:e,open:n,children:u.jsxs(Un,{className:"sm:max-w-[750px]",children:[u.jsx(gr,{children:u.jsxs($n,{children:[a?"Edit ":"View "," ",t.email," ",d?"(yourself)":""]})}),a&&u.jsxs(kr,{children:["To remove ",d?"your self":"this user"," from the organization, uncheck all of the boxes below."]}),f.map(y=>u.jsx(jCe,{readOnly:!a,canRemove:c,data:t,orgRole:y,selectedRoles:m,setChangesMade:v},y.id))]})})}function ICe(e,t){return e.email>t.email?1:-1}function Nq(){const e=En(),{organizationId:t,orgUserId:n}=it({strict:!1}),{update:r}=hf(t),{data:i,refetch:o,isFetching:a,isRefetching:c}=Wi(A0(t)),d=b.useMemo(()=>{const N={};for(const O of i)if(O.users)for(const M of O.users)N[M.id]||(N[M.id]={...M,roles:[]}),N[M.id].roles.push(O);return Object.values(N).sort(ICe)},[i]),f=b.useMemo(()=>d?.find(N=>N.id===n),[d,n]),m=b.useCallback(N=>{const O=[n?"..":"",N].filter(Boolean);e({to:O.join("/")})},[n,e]),h=!!n&&!!f,[v,y]=b.useState(!1),[x]=b.useState({attribute:"email",descending:!1}),S=b.useMemo(()=>[{desc:x.descending,id:x.attribute}],[x]),C=b.useCallback(()=>{y(!0)},[y]),k=b.useCallback(()=>{o(),y(!1)},[o,y]),E=b.useCallback(N=>{m(N.original.id)},[m]),j=b.useCallback(()=>{m(void 0)},[m]),R=b.useCallback(()=>{o(),m(void 0)},[m,o]),T=Ml(o);return u.jsxs(u.Fragment,{children:[u.jsx(gs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs(b.Suspense,{fallback:u.jsx(eo,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(jf,{data:d,isFetching:a||c,columns:bCe,onRowClick:E,sortingState:S,children:[u.jsxs(be,{variant:"defaultOutline",onClick:T,accessKey:"r",disabled:a||c,children:[u.jsx(ba,{})," ",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(Xr,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),r&&u.jsx(CCe,{isModalOpen:v,onChangesSaved:k,setIsModalOpen:y}),h&&u.jsx(RCe,{closeModal:j,data:f,isModalOpen:h,onUserUpdated:R})]})})]})}function NCe({organizationRole:e,onDeleteOrgModal:t}){const{organizationId:n,organizationName:r,roleName:i}=e,{remove:o,update:a}=rx(n),c=a,{view:d}=hf(n),f=b.useCallback(()=>{t(e)},[t,e]);return u.jsxs(Tc,{className:"relative h-full justify-between",children:[u.jsxs(jl,{children:[u.jsxs(Hc,{className:"flex items-center justify-between",children:[u.jsx("span",{className:"truncate",children:n}),o&&u.jsxs(Dh,{children:[u.jsx($h,{className:"p-4 -m-4 -mr-6 hover:text-white",children:u.jsx(oE,{"aria-label":"Options"})}),u.jsxs(Ph,{children:[u.jsx(Jy,{className:"text-gray-600 text-xs",children:"Options"}),u.jsx(Qy,{}),u.jsx(Ze,{to:`${n}`,children:u.jsx(Sr,{children:"Clusters"})}),d&&u.jsx(Ze,{to:`${n}/roles`,children:u.jsx(Sr,{children:"Roles"})}),d&&u.jsx(Ze,{to:`${n}/users`,children:u.jsx(Sr,{children:"Users"})}),c&&u.jsx(Ze,{to:`${n}/billing`,children:u.jsx(Sr,{children:"Billing"})}),u.jsx(Qy,{}),o&&u.jsx(Sr,{className:"focus:bg-red/70 focus:text-white",onClick:f,children:"Delete"})]})]})]}),u.jsx(Rl,{children:u.jsx("h2",{children:r})})]}),u.jsxs(ps,{className:"flex justify-between",children:[u.jsx(Zo,{children:bo(i)}),u.jsx(Ze,{to:n,className:"text-sm","aria-label":`View ${r}`,title:`View ${r}`,children:u.jsxs("span",{className:"py-2 transition-all duration-100 ease-in-out border-0 hover:border-b-2",children:["View ",u.jsx(vi,{className:"inline-block"})]})})]})]})}async function TCe(e){const{data:t}=await Gt.delete(`/Organization/${e}`);return t}function OCe(){return ct({mutationFn:e=>TCe(e)})}async function ACe(e){const{data:t}=await Gt.post("/Organization/",{...e});return t}function DCe(){return ct({mutationFn:e=>ACe(e)})}const Lv=Dt({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 $Ce(){const{user:e}=El(),t=En(),n=on({resolver:mn(Lv),defaultValues:{name:"",subdomain:""}}),{setFocus:r,watch:i}=n;b.useEffect(()=>{r("name")},[r]);const o=`${e?.firstname} ${e?.lastname} Org`,a=i("name")||o,c=i("subdomain"),d=b.useMemo(()=>{const y=g9(_0(a),Lv.shape.subdomain.maxLength);return{suggestedSubdomain:y,fullHostName:`future-cluster-names.${c||y}.harperfabric.com`}},[a,c]),{mutate:f,isPending:m}=DCe(),h=rr(),v=b.useCallback(async y=>{f({name:y.name||o,subdomain:y.subdomain||d.suggestedSubdomain},{onSuccess:x=>{h.invalidateQueries({queryKey:Rb,refetchType:"active"}),Et.reloadUser(An),t({to:`/${x.id}`})}})},[d.suggestedSubdomain,h,f,o,t]);return u.jsx(u.Fragment,{children:u.jsx(an,{...n,children:u.jsxs("form",{onSubmit:n.handleSubmit(v),className:"grid gap-6 text-white max-w-xl",children:[u.jsx($e,{control:n.control,name:"name",render:({field:y})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Name"}),u.jsx(De,{children:u.jsx(Me,{type:"text",maxLength:Lv.shape.name.maxLength,autoCapitalize:"words",placeholder:o,...y})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:n.control,name:"subdomain",render:({field:y})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Subdomain"}),u.jsx(De,{children:u.jsx(Me,{type:"text",maxLength:Lv.shape.subdomain.maxLength,autoCapitalize:"none",placeholder:d.suggestedSubdomain,...y})}),u.jsx(Oe,{})]})}),u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Full Host Name"}),u.jsx(De,{children:u.jsx("span",{children:d.fullHostName})}),u.jsx(Oe,{})]}),u.jsx(Zn,{children:u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",disabled:m,children:["Create New Organization ",u.jsx(vi,{})]})})]})})})}function Tq(){return u.jsxs(u.Fragment,{children:[u.jsx(gs,{}),u.jsx("section",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx($Ce,{})})]})}function PCe(){const e=rr(),{data:t}=Wi(IX()),{mutate:n,isPending:r}=OCe(),[i,o]=b.useState(!1),[a,c]=b.useState(null),[d,f]=b.useState(""),m=b.useCallback(()=>f(""),[]),h=b.useMemo(()=>{const C=t?.roles||{},k=Object.values(C);return Object.keys(C).map((j,R)=>({organizationId:j,organizationName:k[R].organizationName,roleName:k[R].role})).filter(oq(["organizationId","organizationName"],d)).sort((j,R)=>(j.organizationName||"")>(R.organizationName||"")?1:-1)||[]},[d,t?.roles]),v=b.useCallback(C=>{f(C.currentTarget.value?.toLowerCase()||"")},[]),y=b.useCallback(C=>{C?.organizationId&&n(C.organizationId,{onSuccess:()=>{we.success("Success",{description:"Organization successfully deleted.",duration:5e3,action:{label:"Dismiss",onClick:()=>we.dismiss()}}),e.invalidateQueries({queryKey:[]}),o(!1)},onError:()=>o(!1)})},[n,e,o]),x=b.useCallback(C=>{c(C),o(!0)},[]),{createCluster:S}=Er({strict:!1});return h.length===1&&!d.length&&S?u.jsx(_c,{to:`/${h[0].organizationId}/new-cluster`,replace:!0}):!h.length&&!d.length?u.jsx(Tq,{}):u.jsxs(u.Fragment,{children:[u.jsx(gs,{children:u.jsxs("div",{className:"flex w-full justify-end gap-2",children:[u.jsx(Me,{placeholder:"Filter by name",className:"inline-block w-full text-xs",value:d,onChange:v}),u.jsx(Ze,{to:"/new-org",children:u.jsxs(be,{variant:"positive",accessKey:"n",children:[u.jsx(Xr,{}),u.jsxs("span",{className:"hidden sm:inline-block",children:[u.jsx("u",{children:"N"}),"ew ",u.jsx("span",{className:"hidden md:inline-block",children:"Organization"})]})]})})]})}),u.jsx("section",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-12",children:[h.map(C=>u.jsx("div",{className:"col-span-1 md:col-span-4 lg:col-span-3 2xl:col-span-2",children:u.jsx(NCe,{organizationRole:C,onDeleteOrgModal:x})},C.organizationId)),!h.length&&u.jsxs("div",{className:"col-span-1 md:col-span-12 text-center",children:[u.jsx("h2",{className:"my-4 text-xl",children:"No matches found."}),u.jsx(be,{variant:"outline",onClick:m,children:"Clear Filters"})]})]})}),a&&u.jsx(b0,{typeOfThingBeingDeleted:"organization",nameOfThingBeingDeleted:a.organizationName,isModalOpen:i,setIsModalOpen:()=>o(!1),deletionConfirmed:()=>y(a),deletionPending:r})]})}function MCe(){const{isLoading:e}=Bc(),{createCluster:t}=Er({strict:!1}),[,n]=Cf(ru.SavedClusterState,null);return b.useEffect(()=>{t&&n(t)},[t,n]),e?u.jsx(eo,{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(uU,{})}),u.jsx("main",{children:u.jsx(kl,{})})]})}const zCe=["/","/forgot-password","/reset-password","/sign-in","/sign-up","/verify-email"];function Oq(){const e=aq();return!zCe.includes(e)&&{redirect:e}}const P0=rt({getParentRoute:()=>tx,id:"_dashboardLayout",component:MCe,beforeLoad:({context:e})=>{const t=e.authentication[An];if(t&&!t.isLoading&&!t.user)throw Vc({to:"/sign-in",search:Oq()})}}),CI=rt({getParentRoute:()=>P0,id:"_orgsLayout"});rt({getParentRoute:()=>CI,path:"/",component:PCe});rt({getParentRoute:()=>CI,path:"/new-org",component:Tq});const ou=rt({getParentRoute:()=>CI,path:"$organizationId",beforeLoad:async e=>({organization:await e.context.queryClient.ensureQueryData(iu(e.params.organizationId))})}),LCe=rt({getParentRoute:()=>ou,path:"/roles",component:jq}),FCe=rt({getParentRoute:()=>ou,path:"/roles/$orgRoleId",component:jq}),UCe=rt({getParentRoute:()=>ou,path:"/users",component:Nq}),VCe=rt({getParentRoute:()=>ou,path:"/users/$orgUserId",component:Nq});Q_e(ou);const Aq=rt({getParentRoute:()=>ou,id:"_clusterLayout"});rt({getParentRoute:()=>Aq,path:"/",component:WSe});rt({getParentRoute:()=>ou,path:"/new-cluster",component:bI});rt({getParentRoute:()=>ds,path:"/edit",component:bI});function BCe(){return u.jsx(kl,{})}const ds=rt({getParentRoute:()=>Aq,path:"$clusterId",component:BCe,beforeLoad:async({context:e,params:t})=>({cluster:await e.queryClient.ensureQueryData(Tl(t.clusterId))})}),md=Dt({username:XR,role:nt().nonempty({error:"Please select a role."}),password:Ih.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 HCe(e){await Gt.patch(`/ResetPasswordUpdater/${e}`)}async function Dq(e){const{instanceClient:t,...n}=e,{data:r}=await t.post("/",{operation:"add_user",...n});return r}function qCe(){return ct({mutationFn:Dq})}async function $q({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 KCe(){return ct({mutationFn:$q})}async function Pq({username:e,instanceClient:t}){const{data:n}=await t.post("/",{operation:"drop_user",username:e});return n}function GCe(){return ct({mutationFn:Pq})}async function ZCe({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 VC({username:t,password:i,instanceClient:a,entityId:e});return c.instanceClient&&(a=c.instanceClient),n===Y1?await $q({username:n,password:r,instanceClient:a}):(await Dq({username:n,password:r,role:"super_user",active:!0,instanceClient:a}),await Pq({username:Y1,instanceClient:a}),await VC({username:n,password:r,instanceClient:a,entityId:e})),await HCe(e),c}catch(c){throw await Bm({entityId:e,instanceClient:a}),c}}function YCe(){return ct({mutationFn:ZCe})}function WCe(){const{user:e}=El(),{clusterId:t}=it({strict:!1}),{data:n}=Pt(Tl(t,!0)),r=En(),i=b.useMemo(()=>Zk(n),[n]),o=eh(i),{redirect:a}=Er({strict:!1}),c=xn(),d=on({resolver:mn(md),defaultValues:{confirmPassword:"",password:"",role:"super_user",username:e?.email??""}}),{setFocus:f,control:m,handleSubmit:h}=d;b.useEffect(()=>{f("password")},[f]);const v=n?.instances?.find(C=>C.tempPassword)?.tempPassword,{mutate:y,isPending:x}=YCe(),S=b.useCallback(async C=>{if(!i){we.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:Y1,desiredUsername:C.username},{onSuccess:async({message:k,user:E})=>{we.success(k),Et.setUserForEntity(n,E),c.invalidate(),await r({to:a?.startsWith("/")?a:zk})}})},[n,t,o,r,i,a,c,y,v]);return n&&!n.resetPassword?u.jsx(_c,{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(mx,{})}),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(an,{...d,children:u.jsxs("form",{onSubmit:h(S),className:"my-4",children:[u.jsx($e,{control:m,name:"username",render:({field:C})=>u.jsxs(Ne,{className:"my-4",children:[u.jsx(Te,{children:"Username"}),u.jsx(De,{children:u.jsx(Me,{autoComplete:"username",type:"text",...C})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:m,name:"password",render:({field:C})=>u.jsxs(Ne,{className:"my-4",children:[u.jsx(Te,{children:"Password"}),u.jsx(De,{children:u.jsx(Me,{type:"password",...C})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:m,name:"confirmPassword",render:({field:C})=>u.jsxs(Ne,{className:"my-4",children:[u.jsx(Te,{children:"Confirm Password"}),u.jsx(De,{children:u.jsx(Me,{type:"password",...C})}),u.jsx(Oe,{})]})}),u.jsx(be,{disabled:x,type:"submit",variant:"submit",className:"w-full my-2 rounded-full",children:"Create Admin User"})]})}),u.jsxs("p",{className:"text-muted-foreground flex gap-2 align-middle",children:[u.jsx(kee,{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 XCe({columns:e,data:t}){const n=N0({data:t,columns:e,getCoreRowModel:I0()});return u.jsx("div",{className:"bg-black-dark rounded-md",children:u.jsxs(T0,{children:[u.jsx(zh,{children:n.getHeaderGroups().map(r=>u.jsx(Vi,{className:"border-none",children:r.headers.map(i=>u.jsx(_I,{className:"p-4",style:{width:`${i.getSize()}%`},children:i.isPlaceholder?null:Fc(i.column.columnDef.header,i.getContext())},i.id))},r.id))}),u.jsx(O0,{className:"bg-black",children:n.getRowModel().rows?.length?n.getRowModel().rows.map(r=>u.jsx(Vi,{"data-state":r.getIsSelected()&&"selected",className:"hover:bg-muted/10 data-[state=selected]:bg-muted",children:r.getVisibleCells().map(i=>u.jsx(us,{className:"p-4",style:{width:`${i.column.getSize()}%`},children:Fc(i.column.columnDef.cell,i.getContext())},i.id))},r.id)):u.jsx(Vi,{children:u.jsx(us,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})})}function JCe(){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 QCe({isSelfManaged:e,instance:t}){const{user:n,isLoading:r}=fs(t.id),i=b.useMemo(()=>Yk(t),[t]),o=eh(i),{update:a}=Efe(),c=Et.checkForFabricConnect(t.id),d=b.useCallback(async()=>{await Bm({instanceClient:o,entityId:t.id}),Et.setUserForEntity(t,null)},[t,o]);return r||!["CLONE_READY","RUNNING","UPDATED"].includes(t.status)?u.jsx(R4,{className:"animate-spin",color:"gray"}):!n||c?u.jsxs("span",{className:"flex gap-4",children:[a&&!e&&u.jsx(Ze,{to:`../instance/${t.id}${ya}`,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(Ze,{to:`../instance/${t.id}/sign-in`,className:"text-sm","aria-label":`Sign in to ${t.name} instance`,title:`Sign in to ${t.name} instance`,children:u.jsx(be,{variant:a?"defaultOutline":"positiveOutline",children:"Direct Sign In"})})]}):u.jsxs("span",{className:"flex gap-4",children:[u.jsx(Ze,{to:`../instance/${t.id}${ya}`,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 eke(){const{clusterId:e}=it({strict:!1}),{data:t,isLoading:n}=Pt(Tl(e,!0)),r=mI(t),i=b.useMemo(()=>[{id:"instanceActions",size:1,minSize:1,cell:a=>u.jsx("div",{className:"flex justify-end",children:u.jsx(QCe,{isSelfManaged:r,instance:a.row.original})})},r&&{accessorKey:"instanceFqdn",size:90,header:"URL",cell:a=>rq({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:JH(c),children:bo(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 Mo(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 Mo(c,Math.pow(1024,2))}}].filter(Xo),[r]),o=b.useMemo(()=>t?.instances?t.instances.filter(a=>a.status&&!sj.includes(a.status)).sort(m9):[],[t]);return u.jsxs(u.Fragment,{children:[u.jsx(gs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx(Tc,{className:"p-0 mt-4 min-h-96",children:u.jsx(ps,{className:"p-0 min-h-96",children:n?u.jsx(Dr,{}):o.length?u.jsx(XCe,{data:o,columns:i}):u.jsx(JCe,{})})})})]})}function yc({children:e,className:t}){return u.jsxs(u.Fragment,{children:[u.jsx(gs,{}),u.jsx("div",{className:_i("mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))] flex justify-center",t),children:e})]})}function tke(){const{clusterId:e}=it({strict:!1}),{data:t,isLoading:n}=Pt(Tl(e,2e3)),r=t?.status,i=b.useMemo(()=>r&&bx.includes(r),[r]);return n||!t?u.jsx(yc,{className:"flex justify-center",children:u.jsx(Dr,{})}):i?u.jsx(yc,{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(Om,{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(hI,{cluster:t})})]})}):u.jsx(yc,{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(Om,{cluster:t,forceProgressBarVisible:!0}),u.jsxs("p",{children:["Your cluster is updating with the latest changes. This includes waiting several minutes to let traffic drain safely."," ",u.jsxs("span",{className:"text-muted-foreground",children:["We will let you know when we are ready for you to connect! In the meantime, join us on"," ",u.jsx("a",{href:"https://discord.gg/VzZuaw3Xay",target:"_blank",rel:"noreferrer",children:"Discord"}),"! Get real-time help from our engineers, see feature drops early, and connect with others building on Fabric."]})]})]})})}function nke(){const e=xn(),{clusterId:t}=it({strict:!1}),{data:n,isLoading:r}=Pt(Tl(t,2e3)),i=n?.status,o=b.useMemo(()=>i&&bx.includes(i),[i]),a=Nh(i),[,c]=Cf(ru.SavedClusterState,null),d=b.useCallback(()=>{c(n),e.navigate({to:`/${n.organizationId}/new-cluster`})},[n,e,c]);return r||!n?u.jsx(yc,{className:"flex justify-center",children:u.jsx(Dr,{})}):a?u.jsx(yc,{className:"flex justify-center",children:u.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4 items-center",children:[u.jsx(Xee,{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(_l,{})," if you want more help."]}),u.jsx(be,{type:"button",variant:"positiveOutline",onClick:d,children:"Try Again"})]})}):o?u.jsx(yc,{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(Om,{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(hI,{cluster:n})})]})}):u.jsx(yc,{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(Om,{cluster:n,forceProgressBarVisible:!0}),u.jsxs("p",{children:["Your cluster is spinning up with the latest changes, including your own DNS records and private connections. Please wait while we get everything going."," ",u.jsxs("span",{className:"text-muted-foreground",children:["We will let you know when we are ready for you to connect! In the meantime, join us on"," ",u.jsx("a",{href:"https://discord.gg/VzZuaw3Xay",target:"_blank",rel:"noreferrer",children:"Discord"}),"! Get real-time help from our engineers, see feature drops early, and connect with others building on Fabric."]})]})]})})}rt({getParentRoute:()=>ds,path:"instances",component:eke});rt({getParentRoute:()=>ds,path:"starting-up",component:nke});rt({getParentRoute:()=>ds,path:"scaling",component:tke});rt({getParentRoute:()=>ds,path:"sign-in",component:JR,beforeLoad:({context:e,location:t,params:n})=>{const r=Et.checkForFabricConnect(n.clusterId);if(e.authentication[n.clusterId]?.user&&!r){const i=t?.search;throw Vc({to:i?.redirect?.startsWith("/")?i.redirect:zk})}}});rt({getParentRoute:()=>ds,path:"instance/$instanceId/sign-in",component:JR,beforeLoad:({context:e,location:t,params:n})=>{if(!(Et.checkForFabricConnect(n.clusterId)||Et.checkForFabricConnect(n.instanceId))&&e.authentication[n.instanceId]?.user){const i=t?.search;throw Vc({to:i?.redirect?.startsWith("/")?i.redirect:zk})}}});rt({getParentRoute:()=>ds,path:"finish-setup",component:WCe});function rke(e){return rt({getParentRoute:()=>e,path:"apis"}).lazy(()=>Jm(()=>import("./index.lazy-CpOLLVMN.js"),__vite__mapDeps([0,1,2])).then(t=>t.route))}function wP(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!r.includes(i)||e[i]!==t[i])return!1;return!0}function Qp(e,t){const[n,r]=b.useState(t),[i,o]=b.useState(e);return b.useEffect(()=>{wP(n,t)||(r(t),o(e))},[n,t,e]),wP(n,t)?[i,o]:[e,o]}const sd={};function sb(e,t,n){const r=b.useCallback((i,o)=>t(i,o),[n]);b.useEffect(()=>(sd[e]||(sd[e]=[]),sd[e].push(r),function(){const o=sd[e].indexOf(r);o>=0&&sd[e].splice(o,1)}),[e,t,r])}function Uh(e,t,n){const r=sd[e];if(r)for(const i of r)i(t,n)}function Mq(e,t,n){return r=>Uh(e,t,r)}function k1(e,t,n){return b.useCallback(r=>Uh(e,t,r),[e,t,n])}function SP(e,t){return Mh(sessionStorage.getItem(String(e)))??t}function ike(e,t){t==null?sessionStorage.removeItem(String(e)):sessionStorage.setItem(String(e),JSON.stringify(t))}function _d(e,t){const n=Qp(SP(e,t),[e]),[r,i]=n;return b.useEffect(()=>{ike(e,r),Uh(`Session:${e}`,r)},[e,r]),sb(`Session:${e}`,function(a){r!==a&&i(a)},[r,e,t]),b.useEffect(function(){const a=c=>{c.key===e&&i(SP(e,t))};return window.addEventListener("storage",a),()=>{window.removeEventListener("storage",a)}},[e,i,t]),n}function oke(e,t=!1){const[n,r]=_d(e,t),i=b.useCallback(c=>{c?.preventDefault?.(),r(d=>!d)},[r]),o=b.useCallback(c=>{c?.preventDefault?.(),r(!0)},[r]),a=b.useCallback(c=>{c?.preventDefault?.(),r(!1)},[r]);return b.useMemo(()=>({toggled:n,setToggled:r,toggle:i,toggleOn:o,toggleOff:a}),[i,r,a,o,n])}const zq=b.createContext(null);function zr(){return b.useContext(zq)}async function Lq({file:e,project:t,entityType:n,instanceClient:r}){const{data:i}=await r.post("/",{operation:"drop_component",file:e||void 0,project:t,replicated:n==="cluster"});return i}function M0(e){const t=(e||"")?.split(".");return t.length>1?t.slice(-1)[0]:""}function Fq(e){switch(M0(e).toLowerCase()){case"jpg":case"jpeg":case"gif":case"png":case"pneg":case"webp":return!0;default:return!1}}async function Uq({instanceClient:e,file:t,project:n,encoding:r}){const{data:i}=await e.post("/",{operation:"get_component_file",file:t,project:n,encoding:r??(Fq(t)?"base64":"utf8")});return{file:t,project:n,...i}}function ake(e){return{queryKey:Vq(e),queryFn:()=>Uq(e),enabled:!!e.file&&!!e.project,retry:!1}}function Vq(e){return[e.entityId,"get_component_file",e.file,e.project,e.encoding]}async function kI({file:e,payload:t,project:n,entityType:r,instanceClient:i,encoding:o}){const{data:a}=await i.post("/",{operation:"set_component_file",file:e,payload:t,project:n,encoding:o,replicated:r==="cluster"},{timeout:3e5});return a}function Bq(){return ct({mutationFn:kI})}function Hq(){const{reloadRootEntries:e,setFocusedItem:t,setSelectedItems:n}=zr(),r=Zt();return b.useCallback(async i=>{let o=!1;const a=i.filter(y=>y.from!==y.to);if(a.length===0)return;const c=`Renaming ${Zr(a.length,"File","Files")}`,d={duration:6e4,action:{label:"Cancel",onClick:()=>{o=!0}}};d.id=we.loading(c,{...d,description:u.jsx(Am,{animated:!0,width:"0%"})});const m=a.length*3;let h=0;function v(){h+=1,we.loading(c,{...d,description:u.jsx(Am,{animated:!0,width:(h===0?0:h/m*100)+"%"})})}for(const y of a){const x=y.from.split("/"),S=x.shift(),C=x.join("/"),k=y.to.split("/"),E=k.shift(),j=k.join("/"),R=await Uq({...r,file:C,project:S,encoding:"base64"});if(o||(v(),await kI({...r,file:j,project:E,encoding:"base64",payload:R.message}),o)||(v(),await Lq({...r,file:C,project:S}),o))break;v()}h>=m?we.success(`Renamed ${Zr(a.length,"File","Files")}`,{id:d.id,description:"All done!",duration:3e3,action:{label:"OK",onClick:()=>{}}}):we.warning("Rename Cancelled",{id:d.id,description:`${h} of ${m} steps completed.`,duration:1e4,action:{label:"OK",onClick:()=>{}}}),e(),n(y=>{const x=y.slice();for(const S of a){const C=x.indexOf(S.from);C>=0?x.splice(C,1,S.to):x.push(S.to)}return x}),t(y=>{for(const x of a)if(y===x.from)return x.to;return y})},[r,e,t,n])}function ske(e,t){return e[t]!==void 0}function qq(e){return t=>ske(t,e)}function zl(e,t){const[n,r]=b.useState({value:t});return sb(e,(i,o)=>r({value:i,trigger:o}),[r]),n}function ei(e,t,n){Uh(e,t,n)}function z0(e,t,n){return r=>ei(e,t,r)}function Wa(e,t,n){return b.useCallback(r=>{ei(e,t,r)},[e,t,n])}const lke={handleGlobal(e,t){if((t.cmd||t.ctrl)&&e==="Delete")return ei("ShowDeleteDirectoryOrFileModal",!0),!0},addEditorAction(e){return{id:"delete-file",label:"Delete File",keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.Delete],run:z0("ShowDeleteDirectoryOrFileModal",!0)}}},cke={handleGlobal(e,t){if(t.ctrl&&t.alt&&t.shift&&e==="˜")return ei("ShowAddDirectoryOrFileModalType","directory"),!0},addEditorAction(e){return{id:"new-directory",label:"New Directory",keybindings:[e.KeyMod.WinCtrl|e.KeyMod.Alt|e.KeyMod.Shift|e.KeyCode.KeyN],run:z0("ShowAddDirectoryOrFileModalType","directory")}}},uke={handleGlobal(e,t){if(t.ctrl&&e==="n")return ei("ShowAddDirectoryOrFileModalType","file"),!0},addEditorAction(e){return{id:"new-file",label:"New File",keybindings:[e.KeyMod.WinCtrl|e.KeyCode.KeyN],run:z0("ShowAddDirectoryOrFileModalType","file")}}},dke={handleGlobal(e){if(e==="F2")return ei("ShowRenameFileModal","file"),!0},addEditorAction(e){return{id:"rename-file",label:"Rename File",keybindings:[e.KeyMod.WinCtrl|e.KeyMod.Alt|e.KeyCode.KeyR,e.KeyCode.F2],run:z0("ShowRenameFileModal",!0)}}},fke={addEditorAction(){return{id:"revert-file",label:"Revert File",run:Mq("RevertChanges",!0)}}},pke={handleGlobal(e,t){if(t.cmd&&e==="s")return Uh("SaveFile",!0),!0},addEditorAction(e){return{id:"save-file",label:"Save Changes",keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.KeyS],run:Mq("SaveFile",!0)}}},Kq=[lke,cke,uke,dke,fke,pke],mke=Kq.filter(qq("addEditorAction")),hke=Kq.filter(qq("handleGlobal"));function gke(e){const[t,n]=e,r=mke.map(i=>t.addAction(i.addEditorAction(n)));return()=>{for(const i of r)i?.dispose()}}function vke(){b.useEffect(()=>(document.addEventListener("keydown",_P),()=>{document.removeEventListener("keydown",_P)}),[])}function _P(e){const t=e.getModifierState("Meta"),n=e.getModifierState("Alt"),r=e.getModifierState("Shift"),i=e.getModifierState("Control"),o={cmd:t,alt:n,shift:r,ctrl:i};for(const a of hke)if(a.handleGlobal(e.key,o)){e.preventDefault();return}}function yke(e){return e.split("/").pop()}function EI(...e){return e.flat(1).join("/")}var ts;(function(e){e.DoubleClickItemToExpand="double-click-item-to-expand",e.ClickItemToExpand="click-item-to-expand",e.ClickArrowToExpand="click-arrow-to-expand"})(ts||(ts={}));var lb=function(){return lb=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},lb.apply(this,arguments)},bke=function(e,t){return{mode:e.mode,createInteractiveElementProps:function(n,r,i,o){return lb(lb({},t.createInteractiveElementProps(n,r,i,o)),e.createInteractiveElementProps(n,r,i,o))}}},Wd=function(e){return e.ctrlKey||navigator.platform.toUpperCase().indexOf("MAC")>=0&&e.metaKey},xke=(function(){function e(t){this.mode=ts.DoubleClickItemToExpand,this.environment=t}return e.prototype.createInteractiveElementProps=function(t,n,r,i){var o=this;return{onClick:function(a){var c=a.detail===0;r.focusItem(),a.shiftKey&&!c?r.selectUpTo(!Wd(a)):Wd(a)&&!c?i.isSelected?r.unselectItem():r.addToSelectedItems():r.selectItem()},onDoubleClick:function(){r.focusItem(),r.selectItem(),t.isFolder&&r.toggleExpandedState(),(!t.isFolder||o.environment.canInvokePrimaryActionOnItemContainer)&&r.primaryAction()},onFocus:function(){r.focusItem()},onDragStart:function(a){a.dataTransfer.dropEffect="move",r.startDragging()},onDragOver:function(a){a.preventDefault()},draggable:i.canDrag&&!i.isRenaming,tabIndex:i.isRenaming?void 0:i.isFocused?0:-1}},e})(),wke=(function(){function e(t){this.mode=ts.ClickItemToExpand,this.environment=t}return e.prototype.createInteractiveElementProps=function(t,n,r,i){var o=this;return{onClick:function(a){var c=a.detail===0;r.focusItem(),a.shiftKey&&!c?r.selectUpTo(!Wd(a)):Wd(a)&&!c?i.isSelected?r.unselectItem():r.addToSelectedItems():(t.isFolder&&r.toggleExpandedState(),r.selectItem(),(!t.isFolder||o.environment.canInvokePrimaryActionOnItemContainer)&&r.primaryAction())},onFocus:function(){r.focusItem()},onDragStart:function(a){a.dataTransfer.dropEffect="move",r.startDragging()},onDragOver:function(a){a.preventDefault()},draggable:i.canDrag&&!i.isRenaming,tabIndex:i.isRenaming?void 0:i.isFocused?0:-1}},e})(),Ske=(function(){function e(t){this.mode=ts.ClickItemToExpand,this.environment=t}return e.prototype.createInteractiveElementProps=function(t,n,r,i){var o=this;return{onClick:function(a){var c=a.detail===0;r.focusItem(),a.shiftKey&&!c?r.selectUpTo(!Wd(a)):Wd(a)&&!c?i.isSelected?r.unselectItem():r.addToSelectedItems():(r.selectItem(),(!t.isFolder||o.environment.canInvokePrimaryActionOnItemContainer)&&r.primaryAction())},onFocus:function(){r.focusItem()},onDragStart:function(a){a.dataTransfer.dropEffect="move",r.startDragging()},onDragOver:function(a){a.preventDefault()},draggable:i.canDrag&&!i.isRenaming,tabIndex:i.isRenaming?void 0:i.isFocused?0:-1}},e})(),CP=function(e,t){switch(e){case ts.DoubleClickItemToExpand:return new xke(t);case ts.ClickItemToExpand:return new wke(t);case ts.ClickArrowToExpand:return new Ske(t);default:throw Error("Unknown interaction mode ".concat(e))}},Gq=b.createContext(null),_ke=function(){return b.useContext(Gq)},Cke=function(e){var t=e.children,n=hn(),r=n.defaultInteractionMode,i=b.useMemo(function(){var o;return r&&typeof r!="string"?r.extends?bke(r,CP(r.extends,n)):r:CP((o=r)!==null&&o!==void 0?o:ts.ClickItemToExpand,n)},[]);return b.createElement(Gq.Provider,{value:i},t)},Zq=function(){var e=hn();return b.useCallback(function(t,n){if(t.targetType==="between-items"){if(!e.canReorderItems)return!1}else if(t.targetType==="root"){if(!e.canDropOnFolder)return!1}else{var r=e.items[t.targetItem];if(!r||!e.canDropOnFolder&&r.isFolder||!e.canDropOnNonFolder&&!r.isFolder||n.some(function(i){return i.index===t.targetItem}))return!1}return!(e.canDropAt&&(!n||!e.canDropAt(n,t)))},[e])},Yq=function(){var e=hn();return b.useCallback(function(t,n){for(var r=e.linearItems[n],i=r[t].depth,o=t;r[o]&&r[o].depth!==i-1;o-=1);var a=r[o];return a||(a={item:e.trees[n].rootItem,depth:0},o=0),{parent:a,parentLinearIndex:o}},[e.linearItems,e.trees])},kke=function(){var e=hn(),t=Yq(),n=Zq(),r=b.useCallback(function(i,o,a){var c=t(o,i),d=c.parent,f=c.parentLinearIndex;return a.some(function(m){return m.index===d.item})?!0:d.depth===0?!1:r(i,f,a)},[t]);return b.useCallback(function(i,o){for(var a,c,d,f,m=e.linearItems[i],h=[],v=-1,y=0;y<m.length;y++){var x=m[y],S=x.item,C=x.depth;if(!(v!==-1&&C>v)){v=-1;var k=t(y,i).parent,E=e.items[k.item].children.indexOf(S);if(r(i,y,o)){v=C+1;continue}var j={targetType:"item",parentItem:k.item,targetItem:S,linearIndex:y,depth:C,treeId:i},R={targetType:"between-items",parentItem:k.item,linePosition:"top",childIndex:E,depth:C,treeId:i,linearIndex:y},T={targetType:"between-items",parentItem:k.item,linePosition:"bottom",linearIndex:y+1,childIndex:E+1,depth:C,treeId:i},N=(c=(a=m[y-1])===null||a===void 0?void 0:a.depth)!==null&&c!==void 0?c:-1,O=(f=(d=m[y+1])===null||d===void 0?void 0:d.depth)!==null&&f!==void 0?f:-1,M=C===N,L=C===O-1;!M&&n(R,o)&&h.push(R),n(j,o)&&h.push(j),!L&&n(T,o)&&h.push(T)}}return h},[n,e.items,e.linearItems,t,r])},Fv=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},cb=function(e,t,n){var r=b.useRef();b.useEffect(function(){if(!r.current)r.current=Fv([],n,!0),e();else{var i=r.current.some(function(o,a){return o!==n[a]});i&&(r.current=Fv([],n,!0),e())}},Fv(Fv([],t,!0),n,!0))},ub=function(){return ub=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},ub.apply(this,arguments)},Wq=function(e,t){return e.map(function(n){return[n,t(n)]}).reduce(function(n,r){var i,o=r[0],a=r[1];return ub(ub({},n),(i={},i[o]=a,i))},{})},wo=function(){return typeof document<"u"?document:void 0};function Rf(e){e===void 0&&(e=!1);var t=b.useRef(new Array);return b.useEffect(function(){if(e)return function(){};var n=t.current;return function(){return n.forEach(function(r){return cancelAnimationFrame(r)})}},[e,t]),b.useCallback(function(n){var r=requestAnimationFrame(function(){t.current.splice(t.current.indexOf(r),1),n()});t.current.push(r)},[t])}var db=function(e){var t=b.useRef(e);return t.current=e,t},So=function(e){var t=db(e);return b.useCallback((function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t.current.apply(t,n)}),[t])},Xq=function(){var e=hn();return So(function(t,n){return n.map(function(r){return[r,e.linearItems[t].findIndex(function(i){return i.item===r.index})]}).sort(function(r,i){r[0];var o=r[1];i[0];var a=i[1];return o-a}).map(function(r){var i=r[0];return i})})},Eke=function(e){var t,n=(t=wo())===null||t===void 0?void 0:t.querySelector('[data-rct-tree="'.concat(e,'"] [data-rct-item-container="true"]'));if(n){var r=getComputedStyle(n);return n.offsetHeight+Math.max(parseFloat(r.marginTop),parseFloat(r.marginBottom))}return 5},Jq=function(e,t){return e.clientX<=t.left||e.clientX>=t.right||e.clientY<=t.top||e.clientY>=t.bottom},jke=(function(){function e(t,n,r,i,o,a){this.env=t,this.e=n,this.treeId=r,this.linearIndex=i.linearIndex,this.offset=i.offset,this.indentation=i.indentation,this.targetItem=this.env.linearItems[this.treeId][this.linearIndex],this.getParentOfLinearItem=a,this.draggingItems=o}return e.prototype.getEmptyTreeDragPosition=function(){return{targetType:"root",treeId:this.treeId,depth:0,linearIndex:0,targetItem:this.env.trees[this.treeId].rootItem}},e.prototype.maybeRedirectToParent=function(){var t=!this.env.canReorderItems&&!this.env.canDropOnNonFolder&&!this.env.items[this.targetItem.item].isFolder;if(t){var n=this.getParentOfLinearItem(this.linearIndex,this.treeId),r=n.parentLinearIndex,i=n.parent;this.targetItem=i,this.linearIndex=r}},e.prototype.maybeReparentUpwards=function(){var t,n;if(this.indentation!==void 0){var r=this.env.linearItems[this.treeId],i=r[this.linearIndex].depth,o=i-((n=(t=r[this.linearIndex+1])===null||t===void 0?void 0:t.depth)!==null&&n!==void 0?n:0),a=this.offset==="bottom"&&o>0;if(a){for(var c=Math.max(i-o,this.indentation),d={parentLinearIndex:this.linearIndex,parent:this.targetItem},f,m=i;m>=c;m-=1)f=d,d=this.getParentOfLinearItem(d.parentLinearIndex,this.treeId);if(this.indentation!==r[this.linearIndex].depth&&f){var h=this.env.items[d.parent.item].children.indexOf(f.parent.item)+1;if(!(this.draggingItems&&this.isDescendant(this.treeId,d.parentLinearIndex+1,this.draggingItems)))return{targetType:"between-items",treeId:this.treeId,parentItem:d.parent.item,depth:c,linearIndex:this.linearIndex+1,childIndex:h,linePosition:"bottom"}}}}},e.prototype.maybeRedirectInsideOpenFolder=function(){var t=this.env.linearItems[this.treeId][this.linearIndex+1],n=!this.env.canDropBelowOpenFolders&&t&&this.targetItem.depth===t.depth-1&&this.offset==="bottom";n&&(this.targetItem=t,this.linearIndex+=1,this.offset="top")},e.prototype.maybeMapToBottomOffset=function(){var t=this.env.linearItems[this.treeId][this.linearIndex-1];if(!(!t||t?.depth===void 0)){var n=t.depth-this.targetItem.depth;this.offset==="top"&&(n===0||n>0&&this.indentation!==void 0)&&(this.offset="bottom",this.linearIndex-=1,this.targetItem=this.env.linearItems[this.treeId][this.linearIndex])}},e.prototype.canDropAtCurrentTarget=function(){var t=this,n,r=this.env.items[this.targetItem.item];return!(!this.offset&&!this.env.canDropOnNonFolder&&!r.isFolder||!this.offset&&!this.env.canDropOnFolder&&r.isFolder||this.offset&&!this.env.canReorderItems||!((n=this.draggingItems)===null||n===void 0)&&n.some(function(i){return i.index===t.targetItem.item}))},e.prototype.getDraggingPosition=function(){if(this.env.linearItems[this.treeId].length===0)return this.getEmptyTreeDragPosition();if(!(!this.draggingItems||this.linearIndex<0||this.linearIndex>=this.env.linearItems[this.treeId].length)){this.maybeRedirectToParent(),this.maybeRedirectInsideOpenFolder(),this.maybeMapToBottomOffset();var t=this.maybeReparentUpwards();if(t)return t;if(this.areDraggingItemsDescendantOfTarget()||!this.canDropAtCurrentTarget())return"invalid";var n=this.getParentOfLinearItem(this.linearIndex,this.treeId).parent,r=this.env.items[n.item].children.indexOf(this.targetItem.item)+(this.offset==="top"?0:1);return this.offset?{targetType:"between-items",treeId:this.treeId,parentItem:n.item,depth:this.targetItem.depth,linearIndex:this.linearIndex+(this.offset==="top"?0:1),childIndex:r,linePosition:this.offset}:{targetType:"item",treeId:this.treeId,parentItem:n.item,targetItem:this.targetItem.item,depth:this.targetItem.depth,linearIndex:this.linearIndex}}},e.prototype.isDescendant=function(t,n,r){var i=this.getParentOfLinearItem(n,t),o=i.parentLinearIndex,a=i.parent;return r.some(function(c){return c.index===a.item})?!0:a.depth===0?!1:this.isDescendant(t,o,r)},e.prototype.areDraggingItemsDescendantOfTarget=function(){return this.draggingItems&&this.isDescendant(this.treeId,this.linearIndex,this.draggingItems)},e})(),Rke=function(){var e=b.useRef("initial"),t=b.useState(void 0),n=t[0],r=t[1],i=b.useRef(0),o=hn(),a=Yq(),c=So(function(v,y,x){if(!x)return!1;var S=x.offset,C=x.linearIndex,k="".concat(y,"__").concat(C,"__").concat(S??"","__").concat(x.indentation);return k!==e.current?(e.current=k,!0):!1}),d=So(function(v,y,x){if(x.current){var S=x.current.getBoundingClientRect();if(!Jq(v,S)){var C=(v.clientY-S.top)/i.current,k=o.linearItems[y],E=Math.min(Math.max(0,Math.floor(C)),k.length-1);if(k.length===0)return{linearIndex:0,offset:"bottom",indentation:0};var j=k[E],R=o.items[j.item],T=o.renderDepthOffset?Math.max(Math.floor((v.clientX-S.left)/o.renderDepthOffset),0):void 0,N,O=o.canReorderItems?R?.isFolder&&o.canDropOnFolder||o.canDropOnNonFolder?.2:.5:0;return C-.5>=k.length-1?N="bottom":C%1<O?N="top":C%1>1-O&&(N="bottom"),{linearIndex:E,offset:N,indentation:T}}}}),f=So(function(v,y,x){var S=d(v,y,x);if(c(v,y,S))return!n||!o.canDragAndDrop||!S||v.clientX<0||v.clientY<0?"invalid":new jke(o,v,y,S,n,a).getDraggingPosition()}),m=So(function(v,y){r(y),e.current="initial",i.current=Eke(v)}),h=So(function(){r(void 0),e.current="initial",i.current=0});return{initiateDraggingPosition:m,resetDraggingPosition:h,draggingItems:n,getDraggingPosition:f,itemHeight:i}},Qq=b.createContext(null),Ea=function(){return b.useContext(Qq)},Ike=function(e){var t=e.children,n=hn(),r=b.useState(!1),i=r[0],o=r[1],a=b.useState({}),c=a[0],d=a[1],f=b.useState(0),m=f[0],h=f[1],v=b.useState(),y=v[0],x=v[1],S=kke(),C=Rf(),k=Xq(),E=Rke(),j=E.initiateDraggingPosition,R=E.resetDraggingPosition,T=E.draggingItems,N=E.getDraggingPosition,O=E.itemHeight,M=b.useCallback(function(V,A){var J;if(n.activeTreeId&&(!((J=n.viewState[n.activeTreeId])===null||J===void 0)&&J.focusedItem)&&n.linearItems&&A){var fe=n.viewState[n.activeTreeId].focusedItem,ge=S(n.activeTreeId,A),B=ge.findIndex(function(se){return se.targetType==="item"?se.targetItem===fe:se.targetType==="between-items"?n.items[se.parentItem].children[se.childIndex]===fe:!1});h(B?Math.min(B+1,ge.length-1):0)}else h(0)},[n.activeTreeId,n.items,n.linearItems,n.viewState,S]),L=So(function(){o(!1),d({}),h(0),x(void 0),R()});cb(function(){n.activeTreeId&&n.linearItems[n.activeTreeId]&&c[n.activeTreeId]&&M(c[n.activeTreeId],T)},[T,n.activeTreeId,n.linearItems,M,c],[n.activeTreeId]),cb(function(){i&&n.activeTreeId&&x(c[n.activeTreeId][m])},[m,n.activeTreeId,i,c],[m,n.activeTreeId]);var K=Zq(),ee=function(V){var A;T&&!K(V,T)||(x(V),n.setActiveTree(V.treeId),T&&n.activeTreeId!==V.treeId&&((A=n.onSelectItems)===null||A===void 0||A.call(n,T.map(function(J){return J.index}),V.treeId)))},q=So(function(V,A,J){if(T){var fe=N(V,A,J);if(fe){if(fe==="invalid"){x(void 0);return}ee(fe)}}}),Y=So(function(V,A){A.current&&Jq(V,A.current.getBoundingClientRect())&&x(void 0)}),U=So(function(){!T||!y||!n.onDrop||(n.onDrop(T,y),C(function(){var V;(V=n.onFocusItem)===null||V===void 0||V.call(n,T[0],y.treeId),L()}))}),H=b.useCallback(function(V,A){var J=Wq(n.treeIds,function(fe){return S(fe,V)});j(A,V),d(J),n.activeTreeId&&M(J[n.activeTreeId],V)},[n.activeTreeId,n.treeIds,S,j,M]),z=b.useCallback(function(){var V,A,J;if(n.canDragAndDrop&&n.activeTreeId){var fe=(A=(V=n.viewState[n.activeTreeId])===null||V===void 0?void 0:V.selectedItems)!==null&&A!==void 0?A:[(J=n.viewState[n.activeTreeId])===null||J===void 0?void 0:J.focusedItem];if(fe.length===0||fe[0]===void 0)return;var ge=k(n.activeTreeId,fe.map(function(B){return n.items[B]}));if(n.canDrag&&!n.canDrag(ge))return;H(ge,n.activeTreeId),setTimeout(function(){o(!0)})}},[n,k,H]),W=b.useCallback(function(){L()},[L]),F=b.useCallback(function(){U(),L()},[U,L]),te=b.useCallback(function(){h(function(V){return Math.max(0,V-1)})},[]),D=b.useCallback(function(){n.activeTreeId&&h(function(V){return Math.min(c[n.activeTreeId].length-1,V+1)})},[n.activeTreeId,c]),$=b.useMemo(function(){return{onStartDraggingItems:H,startProgrammaticDrag:z,abortProgrammaticDrag:W,completeProgrammaticDrag:F,programmaticDragUp:te,programmaticDragDown:D,draggingItems:T,draggingPosition:y,itemHeight:O.current,isProgrammaticallyDragging:i,onDragOverTreeHandler:q,onDragLeaveContainerHandler:Y,viableDragPositions:c}},[W,F,T,y,i,O,q,Y,H,D,te,z,c]);return b.useEffect(function(){return window.addEventListener("dragend",L),window.addEventListener("drop",U),function(){window.removeEventListener("dragend",L),window.removeEventListener("drop",U)}},[U,L]),b.createElement(Qq.Provider,{value:$},t)},lm=function(){return lm=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},lm.apply(this,arguments)},Nke=function(e,t){var n=hn(),r=Ea();b.useImperativeHandle(e,function(){return lm(lm(lm({},t),n),{treeEnvironmentContext:n,dragAndDropContext:r})})},e7=function(e,t,n){return t===void 0&&(t=50),n===void 0&&(n=1e4),new Promise(function(r){e()&&r();var i,o=setInterval(function(){e()&&i()},t),a=setTimeout(function(){i()},n);i=function(){clearInterval(o),clearTimeout(a),r()}})},gk=function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function c(m){try{f(r.next(m))}catch(h){a(h)}}function d(m){try{f(r.throw(m))}catch(h){a(h)}}function f(m){m.done?o(m.value):i(m.value).then(c,d)}f((r=r.apply(e,t||[])).next())})},vk=function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(f){return function(m){return d([f,m])}}function d(f){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(n=0)),n;)try{if(r=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,i=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){n.label=f[1];break}if(f[0]===6&&n.label<o[1]){n.label=o[1],o=f;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(f);break}o[2]&&n.ops.pop(),n.trys.pop();continue}f=t.call(e,n)}catch(m){f=[6,m],i=0}finally{r=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},kP=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},t7=b.createContext(null),Tke=function(){return b.useContext(t7)},n7=function(e,t,n){return gk(void 0,void 0,void 0,function(){var r,i,o,a,c,d,f;return vk(this,function(m){for(r=function(h){e7(function(){var v;return!!(!((v=t.current)===null||v===void 0)&&v[h])}).then(function(){var v,y=(v=t.current)===null||v===void 0?void 0:v[h];y?.isFolder&&(n(y),n7(h,t,n))})},i=0,o=(f=(d=(c=t.current)===null||c===void 0?void 0:c[e])===null||d===void 0?void 0:d.children)!==null&&f!==void 0?f:[];i<o.length;i++)a=o[i],r(a);return[2]})})},Oke=b.forwardRef(function(e,t){var n=hn(),r=n.onCollapseItem,i=n.items,o=n.trees,a=n.viewState,c=n.onExpandItem,d=n.onFocusItem,f=n.setActiveTree,m=n.onRenameItem,h=n.onSelectItems,v=n.onPrimaryAction,y=n.linearItems,x=Ea(),S=x.abortProgrammaticDrag,C=x.completeProgrammaticDrag,k=x.programmaticDragDown,E=x.programmaticDragUp,j=x.startProgrammaticDrag,R=db(i),T=b.useCallback(function(D,$){r?.(i[D],$)},[i,r]),N=b.useCallback(function(D,$){c?.(i[D],$)},[i,c]),O=b.useCallback(function(D,$,V){V===void 0&&(V=!0),d?.(i[D],$,V)},[i,d]),M=b.useCallback(function(D,$){$===void 0&&($=!0),f(D,$)},[f]),L=b.useCallback(function(D){var $=y[D],V=$.findIndex(function(fe){var ge,B=fe.item;return B===((ge=a[D])===null||ge===void 0?void 0:ge.focusedItem)}),A=V!==void 0?Math.min($.length-1,V+1):0,J=i[$[A].item];d?.(J,D)},[i,y,d,a]),K=b.useCallback(function(D){var $=y[D],V=$.findIndex(function(fe){var ge,B=fe.item;return B===((ge=a[D])===null||ge===void 0?void 0:ge.focusedItem)}),A=V!==void 0?Math.max(0,V-1):0,J=i[$[A].item];d?.(J,D)},[i,y,d,a]),ee=b.useCallback(function(D,$,V){m?.(i[D],$,V)},[i,m]),q=b.useCallback(function(D,$){h?.(D,$)},[h]),Y=b.useCallback(function(D,$){var V,A;!((A=(V=a[$])===null||V===void 0?void 0:V.expandedItems)===null||A===void 0)&&A.includes(D)?r?.(i[D],$):c?.(i[D],$)},[i,r,c,a]),U=b.useCallback(function(D,$){var V,A,J,fe,ge;!((A=(V=a[$])===null||V===void 0?void 0:V.selectedItems)===null||A===void 0)&&A.includes(D)?h?.((fe=(J=a[$].selectedItems)===null||J===void 0?void 0:J.filter(function(B){return B!==D}))!==null&&fe!==void 0?fe:[],$):h?.(kP(kP([],(ge=a[$].selectedItems)!==null&&ge!==void 0?ge:[],!0),[D],!1),$)},[h,a]),H=b.useCallback(function(D,$){v?.(i[D],$)},[i,v]),z=b.useCallback(function(D,$){return gk(void 0,void 0,void 0,function(){var V,A;return vk(this,function(J){switch(J.label){case 0:return V=$[0],A=$.slice(1),[4,e7(function(){var fe;return!!(!((fe=R.current)===null||fe===void 0)&&fe[V])}).then(function(){var fe=R.current[V];return fe?(c?.(fe,D),A.length>0?z(D,A):Promise.resolve()):Promise.resolve()})];case 1:return J.sent(),[2]}})})},[R,c]),W=b.useCallback(function(D){return gk(void 0,void 0,void 0,function(){return vk(this,function($){switch($.label){case 0:return[4,n7(o[D].rootItem,R,function(V){return c?.(V,D)})];case 1:return $.sent(),[2]}})})},[R,c,o]),F=b.useCallback(function(D){for(var $,V,A=0,J=(V=($=a[D])===null||$===void 0?void 0:$.expandedItems)!==null&&V!==void 0?V:[];A<J.length;A++){var fe=J[A];r?.(i[fe],D)}},[i,r,a]),te=b.useMemo(function(){return{collapseItem:T,expandItem:N,focusItem:O,focusTree:M,moveFocusDown:L,moveFocusUp:K,renameItem:ee,selectItems:q,toggleItemExpandedState:Y,toggleItemSelectStatus:U,invokePrimaryAction:H,expandAll:W,expandSubsequently:z,collapseAll:F,abortProgrammaticDrag:S,completeProgrammaticDrag:C,moveProgrammaticDragPositionDown:k,moveProgrammaticDragPositionUp:E,startProgrammaticDrag:j}},[T,N,O,M,L,K,ee,q,Y,U,H,W,z,F,S,C,k,E,j]);return Nke(t,te),b.createElement(t7.Provider,{value:te},e.children)}),Ake=function(e){var t,n,r,i;if(e)if(e.scrollIntoViewIfNeeded)e.scrollIntoViewIfNeeded();else{var o=e.getBoundingClientRect(),a=o.top>=0&&o.left>=0&&o.bottom<=(window.innerHeight||!!(!((n=(t=wo())===null||t===void 0?void 0:t.documentElement)===null||n===void 0)&&n.clientHeight))&&o.right<=(window.innerWidth||!!(!((i=(r=wo())===null||r===void 0?void 0:r.documentElement)===null||i===void 0)&&i.clientWidth));a||e.scrollIntoView()}},pi=function(){return pi=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},pi.apply(this,arguments)},qs=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(n){return!!n}).join(" ")},Dke=function(e,t){return{renderItemTitle:function(n){var r=n.title,i=n.context,o=n.info;if(!o.isSearching||!i.isSearchMatching)return r;var a=r.toLowerCase().indexOf(o.search.toLowerCase());return Q.createElement(Q.Fragment,null,a>0&&Q.createElement("span",null,r.slice(0,a)),Q.createElement("span",{className:"rct-tree-item-search-highlight"},r.slice(a,a+o.search.length)),a+o.search.length<r.length&&Q.createElement("span",null,r.slice(a+o.search.length,r.length)))},renderItemArrow:function(n){var r=n.item,i=n.context;return Q.createElement("div",pi({className:qs(r.isFolder&&"rct-tree-item-arrow-isFolder",i.isExpanded&&"rct-tree-item-arrow-expanded","rct-tree-item-arrow")},i.arrowProps),r.isFolder&&(i.isExpanded?Q.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 16 16",enableBackground:"new 0 0 16 16",xmlSpace:"preserve"},Q.createElement("g",null,Q.createElement("g",null,Q.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z",className:"rct-tree-item-arrow-path"})))):Q.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 16 16",enableBackground:"new 0 0 16 16",xmlSpace:"preserve"},Q.createElement("g",null,Q.createElement("g",null,Q.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z",className:"rct-tree-item-arrow-path"}))))))},renderItem:function(n){var r=n.item,i=n.depth,o=n.children,a=n.title,c=n.context,d=n.arrow,f=c.isRenaming?"div":"button",m=c.isRenaming?void 0:"button";return Q.createElement("li",pi({},c.itemContainerWithChildrenProps,{className:qs("rct-tree-item-li",r.isFolder&&"rct-tree-item-li-isFolder",c.isSelected&&"rct-tree-item-li-selected",c.isExpanded&&"rct-tree-item-li-expanded",c.isFocused&&"rct-tree-item-li-focused",c.isDraggingOver&&"rct-tree-item-li-dragging-over",c.isSearchMatching&&"rct-tree-item-li-search-match")}),Q.createElement("div",pi({},c.itemContainerWithoutChildrenProps,{style:{"--depthOffset":"".concat((i+1)*e,"px")},className:qs("rct-tree-item-title-container",r.isFolder&&"rct-tree-item-title-container-isFolder",c.isSelected&&"rct-tree-item-title-container-selected",c.isExpanded&&"rct-tree-item-title-container-expanded",c.isFocused&&"rct-tree-item-title-container-focused",c.isDraggingOver&&"rct-tree-item-title-container-dragging-over",c.isSearchMatching&&"rct-tree-item-title-container-search-match")}),d,Q.createElement(f,pi({type:m},c.interactiveElementProps,{className:qs("rct-tree-item-button",r.isFolder&&"rct-tree-item-button-isFolder",c.isSelected&&"rct-tree-item-button-selected",c.isExpanded&&"rct-tree-item-button-expanded",c.isFocused&&"rct-tree-item-button-focused",c.isDraggingOver&&"rct-tree-item-button-dragging-over",c.isSearchMatching&&"rct-tree-item-button-search-match")}),a)),o)},renderRenameInput:function(n){var r=n.inputProps,i=n.inputRef,o=n.submitButtonProps,a=n.submitButtonRef,c=n.formProps;return Q.createElement("form",pi({},c,{className:"rct-tree-item-renaming-form"}),Q.createElement("input",pi({},r,{ref:i,className:"rct-tree-item-renaming-input"})),Q.createElement("input",pi({},o,{ref:a,type:"submit",className:"rct-tree-item-renaming-submit-button",value:"🗸"})))},renderTreeContainer:function(n){var r=n.children,i=n.containerProps,o=n.info;return Q.createElement("div",{className:qs("rct-tree-root",o.isFocused&&"rct-tree-root-focus",o.isRenaming&&"rct-tree-root-renaming",o.areItemsSelected&&"rct-tree-root-itemsselected",t)},Q.createElement("div",pi({},i,{style:pi({minHeight:"30px"},i.style)}),r))},renderItemsContainer:function(n){var r=n.children,i=n.containerProps;return Q.createElement("ul",pi({},i,{className:"rct-tree-items-container"}),r)},renderDragBetweenLine:function(n){var r=n.draggingPosition,i=n.lineProps;return Q.createElement("div",pi({},i,{style:{left:"".concat(r.depth*e,"px")},className:qs("rct-tree-drag-between-line",r.targetType==="between-items"&&r.linePosition==="top"&&"rct-tree-drag-between-line-top",r.targetType==="between-items"&&r.linePosition==="bottom"&&"rct-tree-drag-between-line-bottom")}))},renderSearchInput:function(n){var r=n.inputProps;return Q.createElement("div",{className:qs("rct-tree-search-input-container")},Q.createElement("span",{className:"rct-tree-input-icon"}),Q.createElement("input",pi({},r,{className:qs("rct-tree-search-input")})))},renderLiveDescriptorContainer:function(n){var r=n.tree,i=n.children;return Q.createElement("div",{id:"rct-livedescription-".concat(r.treeId),style:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",width:"1px"}},i)},renderDepthOffset:e}},$ke=function(e){var t=e.renderItem,n=e.renderItemTitle,r=e.renderItemArrow,i=e.renderRenameInput,o=e.renderItemsContainer,a=e.renderTreeContainer,c=e.renderDragBetweenLine,d=e.renderSearchInput,f=e.renderLiveDescriptorContainer,m=e.renderDepthOffset,h=b.useMemo(function(){return Dke(m??10)},[m]),v={renderItem:t,renderItemTitle:n,renderItemArrow:r,renderRenameInput:i,renderItemsContainer:o,renderTreeContainer:a,renderDragBetweenLine:c,renderSearchInput:d,renderLiveDescriptorContainer:f,renderDepthOffset:m},y=Object.entries(h).reduce(function(x,S){var C=S[0],k=S[1],E=C;return v[E]?x[E]=v[E]:x[E]=k,x},{});return y.renderItem.displayName="RenderItem",y.renderItemTitle.displayName="RenderItemTitle",y.renderItemArrow.displayName="RenderItemArrow",y.renderRenameInput.displayName="RenderRenameInput",y.renderItemsContainer.displayName="RenderItemsContainer",y.renderTreeContainer.displayName="RenderTreeContainer",y.renderDragBetweenLine.displayName="RenderDragBetweenLine",y.renderSearchInput.displayName="RenderSearchInput",y},jI=function(e,t,n,r){var i,o,a;r===void 0&&(r=0);for(var c=[],d=0,f=(o=(i=n[e])===null||i===void 0?void 0:i.children)!==null&&o!==void 0?o:[];d<f.length;d++){var m=f[d],h=n[m];c.push({item:m,depth:r}),h&&h.isFolder&&h.children&&(!((a=t.expandedItems)===null||a===void 0)&&a.includes(m))&&c.push.apply(c,jI(m,t,n,r+1))}return c},uc=function(){return uc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},uc.apply(this,arguments)},Pke=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Mke=function(e){var t=e.onExpandItem,n=e.onCollapseItem,r=e.onDrop,i=Pke(e,["onExpandItem","onCollapseItem","onDrop"]),o=b.useState({}),a=o[0],c=o[1],d=b.useState(),f=d[0],m=d[1],h=b.useMemo(function(){return Object.keys(a)},[a]),v=i.onFocusItem,y=i.autoFocus,x=i.onRegisterTree,S=i.onUnregisterTree,C=i.items,k=i.viewState,E=db(v),j=db(k),R=b.useMemo(function(){return Wq(h,function(U){var H;return jI(a[U].rootItem,(H=k[U])!==null&&H!==void 0?H:{},C)})},[a,C,h,k]),T=b.useCallback(function(U,H,z){var W,F,te,D,$,V,A,J,fe;if(z===void 0&&(z=!0),(y??!0)&&z){var ge=(F=(W=wo())===null||W===void 0?void 0:W.querySelector('[data-rct-tree="'.concat(H,'"] [data-rct-item-id="').concat(U.index,'"]')))!==null&&F!==void 0?F:(te=wo())===null||te===void 0?void 0:te.querySelector('[data-rct-tree="'.concat(H,'"] [data-rct-item-id]'));((V=($=(D=wo())===null||D===void 0?void 0:D.activeElement)===null||$===void 0?void 0:$.attributes.getNamedItem("data-rct-search-input"))===null||V===void 0?void 0:V.value)!=="true"?(A=ge?.focus)===null||A===void 0||A.call(ge):Ake(ge)}((J=j.current[H])===null||J===void 0?void 0:J.focusedItem)!==U.index&&((fe=E.current)===null||fe===void 0||fe.call(E,U,H))},[y,E,j]),N=b.useCallback(function(U){c(function(H){var z;return uc(uc({},H),(z={},z[U.treeId]=U,z))}),x?.(U)},[x]),O=b.useCallback(function(U){S?.(a[U]),delete a[U],c(a)},[S,a]),M=b.useCallback(function(U,H){n?.(U,H),c(function(z){return z})},[n]),L=b.useCallback(function(U,H){t?.(U,H),c(function(z){return z})},[t]),K=b.useCallback(function(U,H){r?.(U,H),c(function(z){return z})},[r]),ee=b.useCallback(function(U){var H,z,W=(H=wo())===null||H===void 0?void 0:H.querySelector('[data-rct-tree="'.concat(U,'"] [data-rct-item-focus="true"]'));(z=W?.focus)===null||z===void 0||z.call(W)},[]),q=b.useCallback(function(U,H){H===void 0&&(H=!0);var z=function(F){var te,D;H&&(y??!0)&&F&&!(!((D=(te=wo())===null||te===void 0?void 0:te.querySelector('[data-rct-tree="'.concat(F,'"]')))===null||D===void 0)&&D.contains(document.activeElement))&&ee(F)};if(typeof U=="function")m(function(F){var te=U(F);return te!==F&&z(te),te});else{var W=U;m(W),z(W)}},[y,ee]),Y=$ke(i);return uc(uc(uc({},Y),i),{onFocusItem:T,registerTree:N,unregisterTree:O,onExpandItem:L,onCollapseItem:M,onDrop:K,setActiveTree:q,treeIds:h,trees:a,activeTreeId:f,linearItems:R})},r7=b.createContext(null),hn=function(){return b.useContext(r7)},zke=b.forwardRef(function(e,t){var n=Mke(e),r=e.viewState,i=e.onFocusItem;return b.useEffect(function(){for(var o,a,c,d=0,f=Object.keys(n.trees);d<f.length;d++){var m=f[d],h=(a=(o=e.items[n.trees[m].rootItem])===null||o===void 0?void 0:o.children)===null||a===void 0?void 0:a[0],v=h&&e.items[h];!(!((c=r[m])===null||c===void 0)&&c.focusedItem)&&n.trees[m]&&v&&i?.(v,m,!1)}},[n.trees,i,e.items,r]),b.createElement(r7.Provider,{value:n},b.createElement(Cke,null,b.createElement(Ike,null,b.createElement(Oke,{ref:t},e.children))))}),Lke=function(e){var t,n=e.treeId,r=Ea(),i=r.draggingPosition,o=r.itemHeight,a=ti().renderers,c=i&&i.targetType==="between-items"&&i.treeId===n;if(!c)return null;var d={onDragOver:function(f){return f.preventDefault()}};return b.createElement("div",{style:{position:"absolute",left:"0",right:"0",top:"".concat(((t=i?.linearIndex)!==null&&t!==void 0?t:0)*o,"px")}},a.renderDragBetweenLine({draggingPosition:i,lineProps:d}))},Xd=function(e,t,n){var r=So(n);b.useEffect(function(){return e?(e.addEventListener(t,r),function(){return e.removeEventListener(t,r)}):function(){}},[e,r,t])},Fke=function(e,t,n){var r=b.useState(!1),i=r[0],o=r[1],a=b.useRef(!1),c=Rf();return Xd(e,"focusin",function(){i||(o(!0),t?.()),a.current&&(a.current=!1)}),Xd(e,"focusout",function(){a.current=!0,c(function(){a.current&&!e?.contains(document.activeElement)&&(n?.(),a.current=!1,o(!1))})}),i},Uv=function(e,t,n){Xd(wo(),"keydown",function(r){n&&n&&e.toLowerCase()===r.key.toLowerCase()&&t(r)})},EP={expandSiblings:["control+*"],moveFocusToFirstItem:["home"],moveFocusToLastItem:["end"],primaryAction:["enter"],renameItem:["f2"],abortRenameItem:["escape"],toggleSelectItem:["control+ "],abortSearch:["escape","enter"],startSearch:[],selectAll:["control+a"],startProgrammaticDnd:["control+shift+d"],completeProgrammaticDnd:["enter"],abortProgrammaticDnd:["escape"]},fb=function(){return fb=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},fb.apply(this,arguments)},i7=function(){var e=hn();return b.useMemo(function(){return e.keyboardBindings?fb(fb({},EP),e.keyboardBindings):EP},[e.keyboardBindings])},Uke=["input","textarea"],mo=function(e,t,n,r){r===void 0&&(r=!1);var i=b.useRef([]),o=i7(),a=Rf(),c=b.useMemo(function(){return o[e].map(function(d){return d.split("+")})},[e,o]);Xd(wo(),"keydown",function(d){var f;if(n!==!1&&!((Uke.includes((f=d.target.tagName)===null||f===void 0?void 0:f.toLowerCase())||d.target.isContentEditable)&&!r)&&!i.current.includes(d.key)){i.current.push(d.key);var m=i.current.map(function(v){return v.toLowerCase()}),h=c.map(function(v){return m.map(function(y){return v.includes(y.toLowerCase())}).reduce(function(y,x){return y&&x},!0)}).reduce(function(v,y){return v||y},!1);h&&(i.current.length>1||!/^[a-zA-Z\s]$/.test(d.key))&&d.preventDefault()}}),Xd(wo(),"keyup",function(d){if(n!==!1){var f=i.current.map(function(h){return h.toLowerCase()}),m=c.map(function(h){return h.map(function(v){return f.includes(v.toLowerCase())}).reduce(function(v,y){return v&&y},!0)}).reduce(function(h,v){return h||v},!1);m&&a(function(){return t(d)}),i.current=i.current.filter(function(h){return h!==d.key})}})},Vh=function(){var e,t=ti().treeId,n=hn().viewState;return(e=n[t])!==null&&e!==void 0?e:{}},L0=function(e){return hn().linearItems[e]},Vke=function(){var e=ti().treeId,t=hn(),n=t.onFocusItem,r=t.items,i=L0(e),o=Vh();return So(function(a){var c,d=(c=i.findIndex(function(v){return v.item===o.focusedItem}))!==null&&c!==void 0?c:0,f=a(d,i),m=Math.max(0,Math.min(i.length-1,f)),h=r[i[m].item];return n?.(h,e),h})},jP=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Bke=function(e){var t=b.useRef({target:e,previous:void 0});return t.current.target!==e&&(t.current.previous=t.current.target,t.current.target=e),t.current.previous},o7=function(e){var t=Vh(),n=ti().treeId,r=L0(n),i=hn().onSelectItems,o=Bke(t.focusedItem);return b.useCallback(function(a,c){var d,f;c===void 0&&(c=!1);var m=a.index,h=function(C,k){var E=jP(jP([],c?[]:C,!0),k.filter(function(j){return c||!C.includes(j)}),!0);i?.(E,n)};if(t&&t.selectedItems&&t.selectedItems.length>0){var v=t.focusedItem===m?o:t.focusedItem,y=e==="last-focus"?r.findIndex(function(C){return v===C.item}):r.findIndex(function(C){var k;return(k=t.selectedItems)===null||k===void 0?void 0:k.includes(C.item)}),x=r.findIndex(function(C){return C.item===m});if(y<x){var S=r.slice(y,x+1).map(function(C){var k=C.item;return k});h((d=t.selectedItems)!==null&&d!==void 0?d:[],S)}else{var S=r.slice(x,y+1).map(function(k){var E=k.item;return E});h((f=t.selectedItems)!==null&&f!==void 0?f:[],S)}}else i?.([m],n)},[t,i,n,e,r,o])},RP=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Hke=function(){var e,t=hn(),n=ti(),r=n.treeId,i=n.setRenamingItem,o=n.setSearch,a=n.renamingItem,c=L0(r),d=Ea(),f=Vh(),m=Vke(),h=o7("first-selected"),v=t.activeTreeId===r,y=!!a,x=t.disableArrowKeys,S=!x&&v&&!y;Uv("arrowdown",function(C){if(C.preventDefault(),d.isProgrammaticallyDragging)d.programmaticDragDown();else{var k=m(function(E){return E+1});C.shiftKey&&h(k)}},S),Uv("arrowup",function(C){if(C.preventDefault(),d.isProgrammaticallyDragging)d.programmaticDragUp();else{var k=m(function(E){return E-1});C.shiftKey&&h(k)}},S),mo("moveFocusToFirstItem",function(C){C.preventDefault(),m(function(){return 0})},v&&!d.isProgrammaticallyDragging&&!y),mo("moveFocusToLastItem",function(C){C.preventDefault(),m(function(k,E){return E.length-1})},v&&!d.isProgrammaticallyDragging&&!y),Uv("arrowright",function(C){C.preventDefault(),m(function(k,E){var j,R,T=t.items[E[k].item];if(T.isFolder){if(!((j=f.expandedItems)===null||j===void 0)&&j.includes(T.index))return k+1;(R=t.onExpandItem)===null||R===void 0||R.call(t,T,r)}return k})},S&&!d.isProgrammaticallyDragging),Uv("arrowleft",function(C){C.preventDefault(),m(function(k,E){var j,R,T=t.items[E[k].item],N=E[k].depth;if(T.isFolder&&(!((j=f.expandedItems)===null||j===void 0)&&j.includes(T.index)))(R=t.onCollapseItem)===null||R===void 0||R.call(t,T,r);else if(N>0){var O=k;for(O;E[O].depth!==N-1;O-=1);return O}return k})},S&&!d.isProgrammaticallyDragging),mo("primaryAction",function(C){var k,E;C.preventDefault(),f.focusedItem!==void 0&&((k=t.onSelectItems)===null||k===void 0||k.call(t,[f.focusedItem],r),(E=t.onPrimaryAction)===null||E===void 0||E.call(t,t.items[f.focusedItem],r))},v&&!d.isProgrammaticallyDragging&&!y),mo("toggleSelectItem",function(C){var k,E,j;C.preventDefault(),C.stopPropagation(),f.focusedItem!==void 0&&(f.selectedItems&&f.selectedItems.includes(f.focusedItem)?(k=t.onSelectItems)===null||k===void 0||k.call(t,f.selectedItems.filter(function(R){return R!==f.focusedItem}),r):(E=t.onSelectItems)===null||E===void 0||E.call(t,RP(RP([],(j=f.selectedItems)!==null&&j!==void 0?j:[],!0),[f.focusedItem],!1),r))},v&&!d.isProgrammaticallyDragging&&!y),mo("selectAll",function(C){var k;C.preventDefault(),(k=t.onSelectItems)===null||k===void 0||k.call(t,c.map(function(E){var j=E.item;return j}),r)},v&&!d.isProgrammaticallyDragging&&!y),mo("renameItem",function(C){var k;if(f.focusedItem!==void 0){C.preventDefault();var E=t.items[f.focusedItem];E.canRename!==!1&&((k=t.onStartRenamingItem)===null||k===void 0||k.call(t,E,r),i(E.index))}},v&&((e=t.canRename)!==null&&e!==void 0?e:!0)&&!y),mo("startSearch",function(C){var k,E;C.preventDefault(),o(""),(E=(k=document.querySelector('[data-rct-search-input="true"]'))===null||k===void 0?void 0:k.focus)===null||E===void 0||E.call(k)},v&&!d.isProgrammaticallyDragging&&!y),mo("startProgrammaticDnd",function(C){C.preventDefault(),d.startProgrammaticDrag()},v&&!y),mo("completeProgrammaticDnd",function(C){C.preventDefault(),d.completeProgrammaticDrag()},v&&d.isProgrammaticallyDragging&&!y),mo("abortProgrammaticDnd",function(C){C.preventDefault(),d.abortProgrammaticDrag()},v&&d.isProgrammaticallyDragging&&!y)},a7=function(e,t,n){return n.toLowerCase().includes(e.toLowerCase())},qke=function(){var e=hn(),t=e.doesSearchMatchItem,n=e.items,r=e.getItemTitle,i=e.onFocusItem,o=ti(),a=o.search,c=o.treeId,d=L0(c),f=Rf();cb(function(){a&&a.length>0&&f(function(){var m=d.find(function(h){var v=h.item;return(t??a7)(a,n[v],r(n[v]))});m&&i?.(n[m.item],c)})},[t,r,d,n,i,a,c,f],[a])},yk=function(){return yk=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},yk.apply(this,arguments)},Kke=function(e){var t,n=e.containerRef,r=ti(),i=r.search,o=r.setSearch,a=r.treeId,c=r.renderers,d=r.renamingItem,f=hn();Vh();var m=f.activeTreeId===a,h=Rf();qke();var v=function(){var y,x,S;if(o(null),!((y=f.autoFocus)!==null&&y!==void 0)||y){var C=(x=wo())===null||x===void 0?void 0:x.querySelector('[data-rct-tree="'.concat(a,'"] [data-rct-item-focus="true"]'));(S=C?.focus)===null||S===void 0||S.call(C)}};return mo("abortSearch",function(){h(function(){v()})},m&&i!==null,!0),Xd(n,"keydown",function(y){var x,S,C=y.key.charCodeAt(0);(!((x=f.canSearch)!==null&&x!==void 0)||x)&&(!((S=f.canSearchByStartingTyping)!==null&&S!==void 0)||S)&&m&&i===null&&!d&&!y.ctrlKey&&!y.shiftKey&&!y.altKey&&!y.metaKey&&(C>=48&&C<=57||C>=97&&C<=122)&&o("")}),!(!((t=f.canSearch)!==null&&t!==void 0)||t)||i===null?null:c.renderSearchInput({inputProps:yk({value:i,onChange:function(y){return o(y.target.value)},onBlur:function(){v()},ref:function(y){var x;(x=y?.focus)===null||x===void 0||x.call(y)},"aria-label":"Search for items"},{"data-rct-search-input":"true"})})},Gke={introduction:`
127
+ `},bP=I1e(A1e)(bq),D1e={config:T1e},$1e=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 xq(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],xq(e[n],t[n]))}),hP(hP({},e),t)}var P1e={type:"cancelation",msg:"operation is manually canceled"};function S1(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(P1e):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var M1e=j1e.create({config:R1e,isInitialized:!1,resolve:null,reject:null,monaco:null}),wq=l1e(M1e,2),Lh=wq[0],D0=wq[1];function z1e(e){var t=D1e.config(e),n=t.monaco,r=s1e(t,["monaco"]);D0(function(i){return{config:xq(i.config,r),monaco:n}})}function L1e(){var e=Lh(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(D0({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),S1(_1);if(window.monaco&&window.monaco.editor)return Sq(window.monaco),e.resolve(window.monaco),S1(_1);$1e(F1e,V1e)(B1e)}return S1(_1)}function F1e(e){return document.body.appendChild(e)}function U1e(e){var t=document.createElement("script");return e&&(t.src=e),t}function V1e(e){var t=Lh(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=U1e("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function B1e(){var e=Lh(function(n){var r=n.config,i=n.resolve,o=n.reject;return{config:r,resolve:i,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){Sq(n),e.resolve(n)},function(n){e.reject(n)})}function Sq(e){Lh().monaco||D0({monaco:e})}function H1e(){return Lh(function(e){var t=e.monaco;return t})}var _1=new Promise(function(e,t){return D0({resolve:e,reject:t})}),_q={config:z1e,init:L1e,__getMonacoInstance:H1e},q1e={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},C1=q1e,K1e={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},G1e=K1e;function Z1e({children:e}){return Q.createElement("div",{style:G1e.container},e)}var Y1e=Z1e,W1e=Y1e;function X1e({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:a}){return Q.createElement("section",{style:{...C1.wrapper,width:e,height:t},...a},!n&&Q.createElement(W1e,null,r),Q.createElement("div",{ref:i,style:{...C1.fullWidth,...!n&&C1.hide},className:o}))}var J1e=X1e,Cq=b.memo(J1e);function Q1e(e){b.useEffect(e,[])}var kq=Q1e;function eCe(e,t,n=!0){let r=b.useRef(!0);b.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Pi=eCe;function sm(){}function pd(e,t,n,r){return tCe(e,r)||nCe(e,t,n,r)}function tCe(e,t){return e.editor.getModel(Eq(e,t))}function nCe(e,t,n,r){return e.editor.createModel(t,n,r?Eq(e,r):void 0)}function Eq(e,t){return e.Uri.parse(t)}function rCe({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:a,keepCurrentOriginalModel:c=!1,keepCurrentModifiedModel:d=!1,theme:f="light",loading:m="Loading...",options:h={},height:v="100%",width:y="100%",className:x,wrapperProps:S={},beforeMount:C=sm,onMount:k=sm}){let[E,j]=b.useState(!1),[R,T]=b.useState(!0),N=b.useRef(null),O=b.useRef(null),M=b.useRef(null),L=b.useRef(k),K=b.useRef(C),ee=b.useRef(!1);kq(()=>{let H=_q.init();return H.then(z=>(O.current=z)&&T(!1)).catch(z=>z?.type!=="cancelation"&&console.error("Monaco initialization: error:",z)),()=>N.current?U():H.cancel()}),Pi(()=>{if(N.current&&O.current){let H=N.current.getOriginalEditor(),z=pd(O.current,e||"",r||n||"text",o||"");z!==H.getModel()&&H.setModel(z)}},[o],E),Pi(()=>{if(N.current&&O.current){let H=N.current.getModifiedEditor(),z=pd(O.current,t||"",i||n||"text",a||"");z!==H.getModel()&&H.setModel(z)}},[a],E),Pi(()=>{let H=N.current.getModifiedEditor();H.getOption(O.current.editor.EditorOption.readOnly)?H.setValue(t||""):t!==H.getValue()&&(H.executeEdits("",[{range:H.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),H.pushUndoStop())},[t],E),Pi(()=>{N.current?.getModel()?.original.setValue(e||"")},[e],E),Pi(()=>{let{original:H,modified:z}=N.current.getModel();O.current.editor.setModelLanguage(H,r||n||"text"),O.current.editor.setModelLanguage(z,i||n||"text")},[n,r,i],E),Pi(()=>{O.current?.editor.setTheme(f)},[f],E),Pi(()=>{N.current?.updateOptions(h)},[h],E);let q=b.useCallback(()=>{if(!O.current)return;K.current(O.current);let H=pd(O.current,e||"",r||n||"text",o||""),z=pd(O.current,t||"",i||n||"text",a||"");N.current?.setModel({original:H,modified:z})},[n,t,i,e,r,o,a]),Y=b.useCallback(()=>{!ee.current&&M.current&&(N.current=O.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...h}),q(),O.current?.editor.setTheme(f),j(!0),ee.current=!0)},[h,f,q]);b.useEffect(()=>{E&&L.current(N.current,O.current)},[E]),b.useEffect(()=>{!R&&!E&&Y()},[R,E,Y]);function U(){let H=N.current?.getModel();c||H?.original?.dispose(),d||H?.modified?.dispose(),N.current?.dispose()}return Q.createElement(Cq,{width:y,height:v,isEditorReady:E,loading:m,_ref:M,className:x,wrapperProps:S})}var iCe=rCe;b.memo(iCe);function oCe(e){let t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current}var aCe=oCe,zv=new Map;function sCe({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:o,theme:a="light",line:c,loading:d="Loading...",options:f={},overrideServices:m={},saveViewState:h=!0,keepCurrentModel:v=!1,width:y="100%",height:x="100%",className:S,wrapperProps:C={},beforeMount:k=sm,onMount:E=sm,onChange:j,onValidate:R=sm}){let[T,N]=b.useState(!1),[O,M]=b.useState(!0),L=b.useRef(null),K=b.useRef(null),ee=b.useRef(null),q=b.useRef(E),Y=b.useRef(k),U=b.useRef(),H=b.useRef(r),z=aCe(o),W=b.useRef(!1),F=b.useRef(!1);kq(()=>{let $=_q.init();return $.then(V=>(L.current=V)&&M(!1)).catch(V=>V?.type!=="cancelation"&&console.error("Monaco initialization: error:",V)),()=>K.current?D():$.cancel()}),Pi(()=>{let $=pd(L.current,e||r||"",t||i||"",o||n||"");$!==K.current?.getModel()&&(h&&zv.set(z,K.current?.saveViewState()),K.current?.setModel($),h&&K.current?.restoreViewState(zv.get(o)))},[o],T),Pi(()=>{K.current?.updateOptions(f)},[f],T),Pi(()=>{!K.current||r===void 0||(K.current.getOption(L.current.editor.EditorOption.readOnly)?K.current.setValue(r):r!==K.current.getValue()&&(F.current=!0,K.current.executeEdits("",[{range:K.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),K.current.pushUndoStop(),F.current=!1))},[r],T),Pi(()=>{let $=K.current?.getModel();$&&i&&L.current?.editor.setModelLanguage($,i)},[i],T),Pi(()=>{c!==void 0&&K.current?.revealLine(c)},[c],T),Pi(()=>{L.current?.editor.setTheme(a)},[a],T);let te=b.useCallback(()=>{if(!(!ee.current||!L.current)&&!W.current){Y.current(L.current);let $=o||n,V=pd(L.current,r||e||"",t||i||"",$||"");K.current=L.current?.editor.create(ee.current,{model:V,automaticLayout:!0,...f},m),h&&K.current.restoreViewState(zv.get($)),L.current.editor.setTheme(a),c!==void 0&&K.current.revealLine(c),N(!0),W.current=!0}},[e,t,n,r,i,o,f,m,h,a,c]);b.useEffect(()=>{T&&q.current(K.current,L.current)},[T]),b.useEffect(()=>{!O&&!T&&te()},[O,T,te]),H.current=r,b.useEffect(()=>{T&&j&&(U.current?.dispose(),U.current=K.current?.onDidChangeModelContent($=>{F.current||j(K.current.getValue(),$)}))},[T,j]),b.useEffect(()=>{if(T){let $=L.current.editor.onDidChangeMarkers(V=>{let A=K.current.getModel()?.uri;if(A&&V.find(J=>J.path===A.path)){let J=L.current.editor.getModelMarkers({resource:A});R?.(J)}});return()=>{$?.dispose()}}return()=>{}},[T,R]);function D(){U.current?.dispose(),v?h&&zv.set(o,K.current.saveViewState()):K.current.getModel()?.dispose(),K.current.dispose()}return Q.createElement(Cq,{width:y,height:x,isEditorReady:T,loading:d,_ref:ee,className:S,wrapperProps:C})}var lCe=sCe,Fh=b.memo(lCe),$0=Fh;const xP={roles:{create:!0,view:!0,update:!0,delete:!0},clusters:{create:!0,view:!0,update:!0,delete:!0,resources:[]}};function cCe({isModalOpen:e,setIsModalOpen:t}){const n=rr(),{organizationId:r}=it({strict:!1}),[i,o]=b.useState(!0),[a,c]=b.useState(JSON.stringify(xP,null,2)),{mutate:d,isPending:f}=i1e(),m=on({resolver:mn(yq),defaultValues:{name:"",update:!1,delete:!1}}),h=b.useCallback(y=>{o(y.length===0)},[o]),v=b.useCallback(async y=>{const x=Mh(a);if(!x)return;const S={...y,...x,organizationId:r};y&&i&&d(S,{onSuccess:()=>{we.success("Organization role added successfully!"),t(!1),n.invalidateQueries({queryKey:[r,"roles"],refetchType:"active"}),m.reset()},onError:C=>{we.error(`Failed to add organization role: ${C.message}`)}})},[i,a,d,m,n,t,r]);return u.jsx(Fn,{onOpenChange:t,open:e,children:u.jsxs(Un,{children:[u.jsx($n,{children:"Add New Organization Role"}),u.jsx(kr,{children:"Set the new organization role permissions."}),u.jsx(an,{...m,children:u.jsxs("form",{className:"grid grid-cols-2 gap-4 my-4",onSubmit:m.handleSubmit(v),children:[u.jsx($e,{control:m.control,name:"name",render:({field:y})=>u.jsxs(Ne,{className:"col-span-2",children:[u.jsx(Te,{className:"pb-1",children:"Role Name"}),u.jsx(De,{children:u.jsx(Me,{type:"text",className:"",...y})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:m.control,name:"update",render:({field:y})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Can Update Organization"}),u.jsx(De,{children:u.jsx(Me,{type:"checkbox",className:"w-6 ml-2",checked:y.value,onChange:x=>y.onChange(x.target.checked)})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:m.control,name:"delete",render:({field:y})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Can Delete Organization"}),u.jsx(De,{children:u.jsx(Me,{type:"checkbox",className:"w-6 ml-2",checked:y.value,onChange:x=>y.onChange(x.target.checked)})}),u.jsx(Oe,{})]})}),u.jsx("div",{className:"col-span-2",children:u.jsx(Fh,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate:h,onChange:y=>{y&&c(y)},defaultValue:JSON.stringify(xP,null,2)})}),u.jsx(Zn,{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:()=>t(!1),disabled:f,children:"Cancel"}),u.jsx(be,{variant:"submit",className:"rounded-full",disabled:f||!i||!m.formState.isValid,children:"Save Changes"})]})})]})})]})})}async function uCe({roleId:e}){const{data:t}=await Gt.delete(`/Role/${e}`,{id:e,deleted:!0});return t}function dCe(){return ct({mutationFn:({roleId:e})=>uCe({roleId:e})})}async function fCe({roleId:e,updatedRoleInfo:t}){const{data:n}=await Gt.put(`/Role/${e}`,t);return n}function pCe(){return ct({mutationFn:({roleId:e,updatedRoleInfo:t})=>fCe({roleId:e,updatedRoleInfo:t})})}function mCe({organizationId:e,roleId:t}){return{queryKey:[e,"roles",t],queryFn:()=>hCe(t),refetchInterval:10*1e3}}async function hCe(e){const{data:t}=await Gt.get(`/Role/${e}`);return t}function gCe({onRoleDeleteClick:e,setIsConfirmingRoleDeletion:t,isRoleDeletionPending:n}){return u.jsxs(u.Fragment,{children:[u.jsx($n,{children:"Confirm Role Deletion"}),u.jsx(kr,{children:"Are you sure you want to delete this role? This action cannot be undone."}),u.jsxs(Zn,{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 vCe({data:e,isModalOpen:t,closeModal:n}){const r=rr(),{data:i}=Wi(mCe({roleId:e.id,organizationId:e.organizationId})),o=El(),a=o.user&&o.user?.roles?.[e.organizationId]?.role===e.roleName,{update:c,remove:d}=hf(e.organizationId),{mutate:f,isPending:m}=pCe(),{mutate:h,isPending:v}=dCe(),[y,x]=b.useState(!1),S=on({resolver:mn(yq),defaultValues:{name:e.roleName,update:i.organization.update||!1,delete:i.organization.delete||!1}}),C=b.useCallback(()=>{h({roleId:e.id},{onSuccess:()=>{we.success("Role deleted successfully!"),n(!0),S.reset()},onError:M=>{we.error("Error",{description:`Failed to delete role: ${M instanceof Error?M.message:String(M)}.`,action:{label:"Dismiss",onClick:()=>we.dismiss()}})}})},[e.id,h,S,n]),[k,E]=b.useState(!0),[j,R]=b.useState(JSON.stringify({roles:{...i.organization.roles},clusters:{...i.organization.clusters}},null,2)),T=b.useCallback(M=>{E(M.length===0)},[E]),N=b.useCallback(async M=>{if(!c)return;const L=Mh(j);if(!L)return;const K={...M,...L,organizationId:e.organizationId};j&&k&&f({roleId:e.id,updatedRoleInfo:K},{onSuccess:async()=>{we.success("Role updated successfully!"),await r.invalidateQueries({queryKey:[e.organizationId,"roles",e.id]}),n(!1),S.reset()},onError:ee=>{we.error("Error",{description:`Failed to update role: ${ee instanceof Error?ee.message:String(ee)}.`,action:{label:"Dismiss",onClick:()=>we.dismiss()}})}})},[n,e.id,e.organizationId,S,k,r,i,c,j,f]),O=b.useCallback(()=>n(!1),[n]);return u.jsx(Fn,{onOpenChange:O,open:t,children:u.jsx(Un,{children:y?u.jsx(gCe,{onRoleDeleteClick:C,setIsConfirmingRoleDeletion:x,isRoleDeletionPending:v}):u.jsxs(u.Fragment,{children:[u.jsxs($n,{children:[a||!c?"View":"Edit",' Organization Role "',e.roleName,'"']}),u.jsx(an,{...S,children:u.jsxs("form",{className:"grid grid-cols-2 gap-4 my-4",onSubmit:S.handleSubmit(N),children:[u.jsx($e,{control:S.control,name:"name",render:({field:M})=>u.jsxs(Ne,{className:"col-span-2",children:[u.jsx(Te,{className:"pb-1",children:"Role Name"}),u.jsx(De,{children:u.jsx(Me,{type:"text",className:"",...M,disabled:!0,readOnly:!0})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:S.control,name:"update",render:({field:M})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Can Update Organization"}),u.jsx(De,{children:u.jsx(Me,{type:"checkbox",className:"w-6 ml-2",disabled:a||!c,readOnly:a||!c,checked:M.value,onChange:L=>M.onChange(L.target.checked)})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:S.control,name:"delete",render:({field:M})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Can Delete Organization"}),u.jsx(De,{children:u.jsx(Me,{type:"checkbox",className:"w-6 ml-2",disabled:a||!c,readOnly:a||!c,checked:M.value,onChange:L=>M.onChange(L.target.checked)})}),u.jsx(Oe,{})]})}),u.jsx("div",{className:"col-span-2",children:u.jsx(Fh,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate:T,onChange:M=>{M&&R(M)},options:a||!c?{readOnly:!0}:void 0,defaultValue:j})}),!a&&(d||c)&&u.jsx(Zn,{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:()=>x(!0),disabled:m,children:"Delete Role"}),c&&u.jsx(be,{variant:"submit",className:"rounded-full",disabled:!k||m||!S.formState.isValid||!S.formState.isDirty,children:"Save Changes"})]})})]})})]})})})}function jq(){const e=En(),t=rr(),{organizationId:n,orgRoleId:r}=it({strict:!1}),{create:i}=hf(n),{data:o,refetch:a,isFetching:c,isRefetching:d}=Wi(A0(n)),f=b.useMemo(()=>o&&o?.find(E=>E.id===r),[o,r]),m=!!r&&!!f,[h,v]=b.useState(!1),y=b.useCallback(async(E,j)=>{const R=[r?"..":"",E].filter(Boolean);await e({to:R.join("/")}),j&&await t.invalidateQueries({queryKey:[n,"roles"],refetchType:"active"})},[r,e,t]),x=b.useCallback(()=>{v(!0)},[v]),S=b.useCallback(E=>y(E.original.id,!1),[y]),C=b.useCallback(E=>y(void 0,E),[y]),k=Ml(a);return u.jsxs(u.Fragment,{children:[u.jsx(gs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-(--spacing(32)))]",children:u.jsxs(b.Suspense,{fallback:u.jsx(eo,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(jf,{data:o,columns:n1e,onRowClick:S,children:[u.jsxs(be,{variant:"defaultOutline",onClick:k,accessKey:"r",disabled:c||d,children:[u.jsx(ba,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),i&&u.jsxs(be,{variant:"positiveOutline",onClick:x,accessKey:"a",disabled:h,children:[u.jsx(Xr,{}),u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),i&&u.jsx(cCe,{isModalOpen:h,setIsModalOpen:v}),m&&u.jsx(vCe,{data:f,isModalOpen:m,closeModal:C})]})})]})}const yCe=j0(),bCe=[{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},yCe.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}],xCe=Sl.object({email:Sf.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:Sl.string().nonempty({error:"Please select a role."})});async function wCe(e){const{data:t}=await Gt.post("/OrganizationRole/",e);return t}function Rq(){return ct({mutationFn:e=>wCe(e)})}Sl.object({email:Sf.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:Sl.string().nonempty({error:"Please select a role."})});async function SCe(e){const{data:t}=await Gt.post("/UserInvite/",e);return t}function _Ce(){return ct({mutationFn:e=>SCe(e)})}function CCe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const{organizationId:r}=it({strict:!1}),{data:i}=Wi(A0(r)),[o,a]=b.useState(!1),c=on({resolver:mn(xCe),defaultValues:{email:"",roleId:""}}),{mutate:d,isPending:f}=Rq(),{mutate:m,isPending:h}=_Ce(),v=b.useCallback(async y=>{y&&(o?m:d)(y,{onSuccess:()=>{const x=y.roleId;c.reset(),c.setValue("roleId",x),t(),we.success("User invited successfully!"),n(!1),a(!1)},onError:x=>{x?.status===404&&a(!0)}})},[d,c,m,t,n,o]);return u.jsx(Fn,{onOpenChange:()=>{n(!1),a(!1),c.reset()},open:e,children:u.jsx(Un,{"aria-describedby":void 0,children:u.jsx(an,{...c,children:u.jsxs("form",{onSubmit:c.handleSubmit(v),className:"grid gap-4 my-4",children:[u.jsx(gr,{children:u.jsx($n,{children:o?"Invite User":"Add User"})}),u.jsx($e,{control:c.control,name:"email",render:({field:y})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Email"}),u.jsx(De,{children:u.jsx(Me,{type:"email",enterKeyHint:"next",autoComplete:"email",...y})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:c.control,name:"roleId",render:({field:y})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Roles"}),u.jsx(b.Suspense,{fallback:u.jsx(Dr,{}),children:u.jsx(De,{children:u.jsxs(qi,{...y,onValueChange:x=>y.onChange(x),children:[u.jsx(Gi,{className:"w-full",children:u.jsx(Ki,{placeholder:"Choose Role"})}),u.jsx(Zi,{children:u.jsxs(Yo,{children:[u.jsx(yI,{children:"Role"}),i?.map(x=>u.jsx(At,{value:x.id,children:x.roleName},x.id))]})})]})})}),u.jsx(Oe,{})]})}),o&&u.jsxs(kr,{className:"p-3 my-5 text-white rounded-md bg-amber-600 flex",children:[u.jsx(Ute,{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(Zn,{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(jo,{})," ",o?"Invite User":"Add User"]})})})]})})})})}async function kCe({roleId:e,userId:t}){const{data:n}=await Gt.delete(`/OrganizationRole/role/${e}/user/${t}`);return n}function ECe(){return ct({mutationFn:({roleId:e,userId:t})=>kCe({roleId:e,userId:t})})}function Iq(e){const[t,n]=b.useState(e||!1),r=b.useCallback(i=>{n(i.target.checked)},[]);return[t,r]}function jCe({data:e,readOnly:t,canRemove:n,orgRole:r,selectedRoles:i,setChangesMade:o}){const{mutate:a,isPending:c}=Rq(),{mutate:d,isPending:f}=ECe(),m=!!i[r.roleName],[h,v]=b.useState(m),[y,x]=Iq(m);return b.useEffect(()=>{y!==h&&(y?a({email:e.email,roleId:r.id},{onSuccess:()=>{v(y),o(!0),we.success("Role added successfully")}}):d({userId:e.id,roleId:r.id},{onSuccess:()=>{v(y),o(!0),we.success("Role removed successfully")}}))},[a,e.email,e.id,y,r.id,d,o,h]),u.jsxs(ah,{className:"flex",children:[u.jsx(Me,{type:"checkbox",className:"w-6",disabled:t||c||f||!n&&y,checked:y,onChange:x}),u.jsx("span",{className:"pl-4 pr-8 flex-1 py-2.5",children:r.roleName})]},r.id)}function RCe({closeModal:e,data:t,isModalOpen:n,onUserUpdated:r}){const{organizationId:i}=it({strict:!1}),o=El(),{update:a,remove:c}=hf(i),d=o.user?.email===t.email,{data:f}=Wi(A0(i)),m=b.useMemo(()=>t.roles?kf(t.roles,"roleName"):{},[t]),[h,v]=b.useState(!1);return u.jsx(Fn,{onOpenChange:h?r:e,open:n,children:u.jsxs(Un,{className:"sm:max-w-[750px]",children:[u.jsx(gr,{children:u.jsxs($n,{children:[a?"Edit ":"View "," ",t.email," ",d?"(yourself)":""]})}),a&&u.jsxs(kr,{children:["To remove ",d?"your self":"this user"," from the organization, uncheck all of the boxes below."]}),f.map(y=>u.jsx(jCe,{readOnly:!a,canRemove:c,data:t,orgRole:y,selectedRoles:m,setChangesMade:v},y.id))]})})}function ICe(e,t){return e.email>t.email?1:-1}function Nq(){const e=En(),{organizationId:t,orgUserId:n}=it({strict:!1}),{update:r}=hf(t),{data:i,refetch:o,isFetching:a,isRefetching:c}=Wi(A0(t)),d=b.useMemo(()=>{const N={};for(const O of i)if(O.users)for(const M of O.users)N[M.id]||(N[M.id]={...M,roles:[]}),N[M.id].roles.push(O);return Object.values(N).sort(ICe)},[i]),f=b.useMemo(()=>d?.find(N=>N.id===n),[d,n]),m=b.useCallback(N=>{const O=[n?"..":"",N].filter(Boolean);e({to:O.join("/")})},[n,e]),h=!!n&&!!f,[v,y]=b.useState(!1),[x]=b.useState({attribute:"email",descending:!1}),S=b.useMemo(()=>[{desc:x.descending,id:x.attribute}],[x]),C=b.useCallback(()=>{y(!0)},[y]),k=b.useCallback(()=>{o(),y(!1)},[o,y]),E=b.useCallback(N=>{m(N.original.id)},[m]),j=b.useCallback(()=>{m(void 0)},[m]),R=b.useCallback(()=>{o(),m(void 0)},[m,o]),T=Ml(o);return u.jsxs(u.Fragment,{children:[u.jsx(gs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs(b.Suspense,{fallback:u.jsx(eo,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(jf,{data:d,isFetching:a||c,columns:bCe,onRowClick:E,sortingState:S,children:[u.jsxs(be,{variant:"defaultOutline",onClick:T,accessKey:"r",disabled:a||c,children:[u.jsx(ba,{})," ",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(Xr,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),r&&u.jsx(CCe,{isModalOpen:v,onChangesSaved:k,setIsModalOpen:y}),h&&u.jsx(RCe,{closeModal:j,data:f,isModalOpen:h,onUserUpdated:R})]})})]})}function NCe({organizationRole:e,onDeleteOrgModal:t}){const{organizationId:n,organizationName:r,roleName:i}=e,{remove:o,update:a}=rx(n),c=a,{view:d}=hf(n),f=b.useCallback(()=>{t(e)},[t,e]);return u.jsxs(Tc,{className:"relative h-full justify-between",children:[u.jsxs(jl,{children:[u.jsxs(Hc,{className:"flex items-center justify-between",children:[u.jsx("span",{className:"truncate",children:n}),o&&u.jsxs(Dh,{children:[u.jsx($h,{className:"p-4 -m-4 -mr-6 hover:text-white",children:u.jsx(oE,{"aria-label":"Options"})}),u.jsxs(Ph,{children:[u.jsx(Jy,{className:"text-gray-600 text-xs",children:"Options"}),u.jsx(Qy,{}),u.jsx(Ze,{to:`${n}`,children:u.jsx(Sr,{children:"Clusters"})}),d&&u.jsx(Ze,{to:`${n}/roles`,children:u.jsx(Sr,{children:"Roles"})}),d&&u.jsx(Ze,{to:`${n}/users`,children:u.jsx(Sr,{children:"Users"})}),c&&u.jsx(Ze,{to:`${n}/billing`,children:u.jsx(Sr,{children:"Billing"})}),u.jsx(Qy,{}),o&&u.jsx(Sr,{className:"focus:bg-red/70 focus:text-white",onClick:f,children:"Delete"})]})]})]}),u.jsx(Rl,{children:u.jsx("h2",{children:r})})]}),u.jsxs(ps,{className:"flex justify-between",children:[u.jsx(Zo,{children:bo(i)}),u.jsx(Ze,{to:n,className:"text-sm","aria-label":`View ${r}`,title:`View ${r}`,children:u.jsxs("span",{className:"py-2 transition-all duration-100 ease-in-out border-0 hover:border-b-2",children:["View ",u.jsx(vi,{className:"inline-block"})]})})]})]})}async function TCe(e){const{data:t}=await Gt.delete(`/Organization/${e}`);return t}function OCe(){return ct({mutationFn:e=>TCe(e)})}async function ACe(e){const{data:t}=await Gt.post("/Organization/",{...e});return t}function DCe(){return ct({mutationFn:e=>ACe(e)})}const Lv=Dt({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 $Ce(){const{user:e}=El(),t=En(),n=on({resolver:mn(Lv),defaultValues:{name:"",subdomain:""}}),{setFocus:r,watch:i}=n;b.useEffect(()=>{r("name")},[r]);const o=`${e?.firstname} ${e?.lastname} Org`,a=i("name")||o,c=i("subdomain"),d=b.useMemo(()=>{const y=g9(_0(a),Lv.shape.subdomain.maxLength);return{suggestedSubdomain:y,fullHostName:`future-cluster-names.${c||y}.harperfabric.com`}},[a,c]),{mutate:f,isPending:m}=DCe(),h=rr(),v=b.useCallback(async y=>{f({name:y.name||o,subdomain:y.subdomain||d.suggestedSubdomain},{onSuccess:x=>{h.invalidateQueries({queryKey:Rb,refetchType:"active"}),Et.reloadUser(An),t({to:`/${x.id}`})}})},[d.suggestedSubdomain,h,f,o,t]);return u.jsx(u.Fragment,{children:u.jsx(an,{...n,children:u.jsxs("form",{onSubmit:n.handleSubmit(v),className:"grid gap-6 text-white max-w-xl",children:[u.jsx($e,{control:n.control,name:"name",render:({field:y})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Name"}),u.jsx(De,{children:u.jsx(Me,{type:"text",maxLength:Lv.shape.name.maxLength,autoCapitalize:"words",placeholder:o,...y})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:n.control,name:"subdomain",render:({field:y})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Subdomain"}),u.jsx(De,{children:u.jsx(Me,{type:"text",maxLength:Lv.shape.subdomain.maxLength,autoCapitalize:"none",placeholder:d.suggestedSubdomain,...y})}),u.jsx(Oe,{})]})}),u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Full Host Name"}),u.jsx(De,{children:u.jsx("span",{children:d.fullHostName})}),u.jsx(Oe,{})]}),u.jsx(Zn,{children:u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",disabled:m,children:["Create New Organization ",u.jsx(vi,{})]})})]})})})}function Tq(){return u.jsxs(u.Fragment,{children:[u.jsx(gs,{}),u.jsx("section",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx($Ce,{})})]})}function PCe(){const e=rr(),{data:t}=Wi(IX()),{mutate:n,isPending:r}=OCe(),[i,o]=b.useState(!1),[a,c]=b.useState(null),[d,f]=b.useState(""),m=b.useCallback(()=>f(""),[]),h=b.useMemo(()=>{const C=t?.roles||{},k=Object.values(C);return Object.keys(C).map((j,R)=>({organizationId:j,organizationName:k[R].organizationName,roleName:k[R].role})).filter(oq(["organizationId","organizationName"],d)).sort((j,R)=>(j.organizationName||"")>(R.organizationName||"")?1:-1)||[]},[d,t?.roles]),v=b.useCallback(C=>{f(C.currentTarget.value?.toLowerCase()||"")},[]),y=b.useCallback(C=>{C?.organizationId&&n(C.organizationId,{onSuccess:()=>{we.success("Success",{description:"Organization successfully deleted.",duration:5e3,action:{label:"Dismiss",onClick:()=>we.dismiss()}}),e.invalidateQueries({queryKey:[]}),o(!1)},onError:()=>o(!1)})},[n,e,o]),x=b.useCallback(C=>{c(C),o(!0)},[]),{createCluster:S}=Er({strict:!1});return h.length===1&&!d.length&&S?u.jsx(_c,{to:`/${h[0].organizationId}/new-cluster`,replace:!0}):!h.length&&!d.length?u.jsx(Tq,{}):u.jsxs(u.Fragment,{children:[u.jsx(gs,{children:u.jsxs("div",{className:"flex w-full justify-end gap-2",children:[u.jsx(Me,{placeholder:"Filter by name",className:"inline-block w-full text-xs",value:d,onChange:v}),u.jsx(Ze,{to:"/new-org",children:u.jsxs(be,{variant:"positive",accessKey:"n",children:[u.jsx(Xr,{}),u.jsxs("span",{className:"hidden sm:inline-block",children:[u.jsx("u",{children:"N"}),"ew ",u.jsx("span",{className:"hidden md:inline-block",children:"Organization"})]})]})})]})}),u.jsx("section",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-12",children:[h.map(C=>u.jsx("div",{className:"col-span-1 md:col-span-4 lg:col-span-3 2xl:col-span-2",children:u.jsx(NCe,{organizationRole:C,onDeleteOrgModal:x})},C.organizationId)),!h.length&&u.jsxs("div",{className:"col-span-1 md:col-span-12 text-center",children:[u.jsx("h2",{className:"my-4 text-xl",children:"No matches found."}),u.jsx(be,{variant:"outline",onClick:m,children:"Clear Filters"})]})]})}),a&&u.jsx(b0,{typeOfThingBeingDeleted:"organization",nameOfThingBeingDeleted:a.organizationName,isModalOpen:i,setIsModalOpen:()=>o(!1),deletionConfirmed:()=>y(a),deletionPending:r})]})}function MCe(){const{isLoading:e}=Bc(),{createCluster:t}=Er({strict:!1}),[,n]=Cf(ru.SavedClusterState,null);return b.useEffect(()=>{t&&n(t)},[t,n]),e?u.jsx(eo,{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(uU,{})}),u.jsx("main",{children:u.jsx(kl,{})})]})}const zCe=["/","/forgot-password","/reset-password","/sign-in","/sign-up","/verify-email"];function Oq(){const e=aq();return!zCe.includes(e)&&{redirect:e}}const P0=rt({getParentRoute:()=>tx,id:"_dashboardLayout",component:MCe,beforeLoad:({context:e})=>{const t=e.authentication[An];if(t&&!t.isLoading&&!t.user)throw Vc({to:"/sign-in",search:Oq()})}}),CI=rt({getParentRoute:()=>P0,id:"_orgsLayout"});rt({getParentRoute:()=>CI,path:"/",component:PCe});rt({getParentRoute:()=>CI,path:"/new-org",component:Tq});const ou=rt({getParentRoute:()=>CI,path:"$organizationId",beforeLoad:async e=>({organization:await e.context.queryClient.ensureQueryData(iu(e.params.organizationId))})}),LCe=rt({getParentRoute:()=>ou,path:"/roles",component:jq}),FCe=rt({getParentRoute:()=>ou,path:"/roles/$orgRoleId",component:jq}),UCe=rt({getParentRoute:()=>ou,path:"/users",component:Nq}),VCe=rt({getParentRoute:()=>ou,path:"/users/$orgUserId",component:Nq});Q_e(ou);const Aq=rt({getParentRoute:()=>ou,id:"_clusterLayout"});rt({getParentRoute:()=>Aq,path:"/",component:WSe});rt({getParentRoute:()=>ou,path:"/new-cluster",component:bI});rt({getParentRoute:()=>ds,path:"/edit",component:bI});function BCe(){return u.jsx(kl,{})}const ds=rt({getParentRoute:()=>Aq,path:"$clusterId",component:BCe,beforeLoad:async({context:e,params:t})=>({cluster:await e.queryClient.ensureQueryData(Tl(t.clusterId))})}),md=Dt({username:XR,role:nt().nonempty({error:"Please select a role."}),password:Ih.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 HCe(e){await Gt.patch(`/ResetPasswordUpdater/${e}`)}async function Dq(e){const{instanceClient:t,...n}=e,{data:r}=await t.post("/",{operation:"add_user",...n});return r}function qCe(){return ct({mutationFn:Dq})}async function $q({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 KCe(){return ct({mutationFn:$q})}async function Pq({username:e,instanceClient:t}){const{data:n}=await t.post("/",{operation:"drop_user",username:e});return n}function GCe(){return ct({mutationFn:Pq})}async function ZCe({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 VC({username:t,password:i,instanceClient:a,entityId:e});return c.instanceClient&&(a=c.instanceClient),n===Y1?await $q({username:n,password:r,instanceClient:a}):(await Dq({username:n,password:r,role:"super_user",active:!0,instanceClient:a}),await Pq({username:Y1,instanceClient:a}),await VC({username:n,password:r,instanceClient:a,entityId:e})),await HCe(e),c}catch(c){throw await Bm({entityId:e,instanceClient:a}),c}}function YCe(){return ct({mutationFn:ZCe})}function WCe(){const{user:e}=El(),{clusterId:t}=it({strict:!1}),{data:n}=Pt(Tl(t,!0)),r=En(),i=b.useMemo(()=>Zk(n),[n]),o=eh(i),{redirect:a}=Er({strict:!1}),c=xn(),d=on({resolver:mn(md),defaultValues:{confirmPassword:"",password:"",role:"super_user",username:e?.email??""}}),{setFocus:f,control:m,handleSubmit:h}=d;b.useEffect(()=>{f("password")},[f]);const v=n?.instances?.find(C=>C.tempPassword)?.tempPassword,{mutate:y,isPending:x}=YCe(),S=b.useCallback(async C=>{if(!i){we.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:Y1,desiredUsername:C.username},{onSuccess:async({message:k,user:E})=>{we.success(k),Et.setUserForEntity(n,E),c.invalidate(),await r({to:a?.startsWith("/")?a:zk})}})},[n,t,o,r,i,a,c,y,v]);return n&&!n.resetPassword?u.jsx(_c,{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(mx,{})}),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(an,{...d,children:u.jsxs("form",{onSubmit:h(S),className:"my-4",children:[u.jsx($e,{control:m,name:"username",render:({field:C})=>u.jsxs(Ne,{className:"my-4",children:[u.jsx(Te,{children:"Username"}),u.jsx(De,{children:u.jsx(Me,{autoComplete:"username",type:"text",...C})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:m,name:"password",render:({field:C})=>u.jsxs(Ne,{className:"my-4",children:[u.jsx(Te,{children:"Password"}),u.jsx(De,{children:u.jsx(Me,{type:"password",...C})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:m,name:"confirmPassword",render:({field:C})=>u.jsxs(Ne,{className:"my-4",children:[u.jsx(Te,{children:"Confirm Password"}),u.jsx(De,{children:u.jsx(Me,{type:"password",...C})}),u.jsx(Oe,{})]})}),u.jsx(be,{disabled:x,type:"submit",variant:"submit",className:"w-full my-2 rounded-full",children:"Create Admin User"})]})}),u.jsxs("p",{className:"text-muted-foreground flex gap-2 align-middle",children:[u.jsx(kee,{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 XCe({columns:e,data:t}){const n=N0({data:t,columns:e,getCoreRowModel:I0()});return u.jsx("div",{className:"bg-black-dark rounded-md",children:u.jsxs(T0,{children:[u.jsx(zh,{children:n.getHeaderGroups().map(r=>u.jsx(Vi,{className:"border-none",children:r.headers.map(i=>u.jsx(_I,{className:"p-4",style:{width:`${i.getSize()}%`},children:i.isPlaceholder?null:Fc(i.column.columnDef.header,i.getContext())},i.id))},r.id))}),u.jsx(O0,{className:"bg-black",children:n.getRowModel().rows?.length?n.getRowModel().rows.map(r=>u.jsx(Vi,{"data-state":r.getIsSelected()&&"selected",className:"hover:bg-muted/10 data-[state=selected]:bg-muted",children:r.getVisibleCells().map(i=>u.jsx(us,{className:"p-4",style:{width:`${i.column.getSize()}%`},children:Fc(i.column.columnDef.cell,i.getContext())},i.id))},r.id)):u.jsx(Vi,{children:u.jsx(us,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})})}function JCe(){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 QCe({isSelfManaged:e,instance:t}){const{user:n,isLoading:r}=fs(t.id),i=b.useMemo(()=>Yk(t),[t]),o=eh(i),{update:a}=Efe(),c=Et.checkForFabricConnect(t.id),d=b.useCallback(async()=>{await Bm({instanceClient:o,entityId:t.id}),Et.setUserForEntity(t,null)},[t,o]);return r||!["CLONE_READY","RUNNING","UPDATED"].includes(t.status)?u.jsx(R4,{className:"animate-spin",color:"gray"}):!n||c?u.jsxs("span",{className:"flex gap-4",children:[a&&!e&&u.jsx(Ze,{to:`../instance/${t.id}${ya}`,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(Ze,{to:`../instance/${t.id}/sign-in`,className:"text-sm","aria-label":`Sign in to ${t.name} instance`,title:`Sign in to ${t.name} instance`,children:u.jsx(be,{variant:a?"defaultOutline":"positiveOutline",children:"Direct Sign In"})})]}):u.jsxs("span",{className:"flex gap-4",children:[u.jsx(Ze,{to:`../instance/${t.id}${ya}`,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 eke(){const{clusterId:e}=it({strict:!1}),{data:t,isLoading:n}=Pt(Tl(e,!0)),r=mI(t),i=b.useMemo(()=>[{id:"instanceActions",size:1,minSize:1,cell:a=>u.jsx("div",{className:"flex justify-end",children:u.jsx(QCe,{isSelfManaged:r,instance:a.row.original})})},r&&{accessorKey:"instanceFqdn",size:90,header:"URL",cell:a=>rq({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:JH(c),children:bo(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 Mo(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 Mo(c,Math.pow(1024,2))}}].filter(Xo),[r]),o=b.useMemo(()=>t?.instances?t.instances.filter(a=>a.status&&!sj.includes(a.status)).sort(m9):[],[t]);return u.jsxs(u.Fragment,{children:[u.jsx(gs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx(Tc,{className:"p-0 mt-4 min-h-96",children:u.jsx(ps,{className:"p-0 min-h-96",children:n?u.jsx(Dr,{}):o.length?u.jsx(XCe,{data:o,columns:i}):u.jsx(JCe,{})})})})]})}function yc({children:e,className:t}){return u.jsxs(u.Fragment,{children:[u.jsx(gs,{}),u.jsx("div",{className:_i("mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))] flex justify-center",t),children:e})]})}function tke(){const{clusterId:e}=it({strict:!1}),{data:t,isLoading:n}=Pt(Tl(e,2e3)),r=t?.status,i=b.useMemo(()=>r&&bx.includes(r),[r]);return n||!t?u.jsx(yc,{className:"flex justify-center",children:u.jsx(Dr,{})}):i?u.jsx(yc,{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(Om,{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(hI,{cluster:t})})]})}):u.jsx(yc,{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(Om,{cluster:t,forceProgressBarVisible:!0}),u.jsxs("p",{children:["Your cluster is updating with the latest changes. This includes waiting several minutes to let traffic drain safely."," ",u.jsxs("span",{className:"text-muted-foreground",children:["We will let you know when we are ready for you to connect! In the meantime, join us on"," ",u.jsx("a",{href:"https://discord.gg/VzZuaw3Xay",target:"_blank",rel:"noreferrer",children:"Discord"}),"! Get real-time help from our engineers, see feature drops early, and connect with others building on Fabric."]})]})]})})}function nke(){const e=xn(),{clusterId:t}=it({strict:!1}),{data:n,isLoading:r}=Pt(Tl(t,2e3)),i=n?.status,o=b.useMemo(()=>i&&bx.includes(i),[i]),a=Nh(i),[,c]=Cf(ru.SavedClusterState,null),d=b.useCallback(()=>{c(n),e.navigate({to:`/${n.organizationId}/new-cluster`})},[n,e,c]);return r||!n?u.jsx(yc,{className:"flex justify-center",children:u.jsx(Dr,{})}):a?u.jsx(yc,{className:"flex justify-center",children:u.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4 items-center",children:[u.jsx(Xee,{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(_l,{})," if you want more help."]}),u.jsx(be,{type:"button",variant:"positiveOutline",onClick:d,children:"Try Again"})]})}):o?u.jsx(yc,{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(Om,{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(hI,{cluster:n})})]})}):u.jsx(yc,{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(Om,{cluster:n,forceProgressBarVisible:!0}),u.jsxs("p",{children:["Your cluster is spinning up with the latest changes, including your own DNS records and private connections. Please wait while we get everything going."," ",u.jsxs("span",{className:"text-muted-foreground",children:["We will let you know when we are ready for you to connect! In the meantime, join us on"," ",u.jsx("a",{href:"https://discord.gg/VzZuaw3Xay",target:"_blank",rel:"noreferrer",children:"Discord"}),"! Get real-time help from our engineers, see feature drops early, and connect with others building on Fabric."]})]})]})})}rt({getParentRoute:()=>ds,path:"instances",component:eke});rt({getParentRoute:()=>ds,path:"starting-up",component:nke});rt({getParentRoute:()=>ds,path:"scaling",component:tke});rt({getParentRoute:()=>ds,path:"sign-in",component:JR,beforeLoad:({context:e,location:t,params:n})=>{const r=Et.checkForFabricConnect(n.clusterId);if(e.authentication[n.clusterId]?.user&&!r){const i=t?.search;throw Vc({to:i?.redirect?.startsWith("/")?i.redirect:zk})}}});rt({getParentRoute:()=>ds,path:"instance/$instanceId/sign-in",component:JR,beforeLoad:({context:e,location:t,params:n})=>{if(!(Et.checkForFabricConnect(n.clusterId)||Et.checkForFabricConnect(n.instanceId))&&e.authentication[n.instanceId]?.user){const i=t?.search;throw Vc({to:i?.redirect?.startsWith("/")?i.redirect:zk})}}});rt({getParentRoute:()=>ds,path:"finish-setup",component:WCe});function rke(e){return rt({getParentRoute:()=>e,path:"apis"}).lazy(()=>Jm(()=>import("./index.lazy-CwPUt0Bc.js"),__vite__mapDeps([0,1,2])).then(t=>t.route))}function wP(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!r.includes(i)||e[i]!==t[i])return!1;return!0}function Qp(e,t){const[n,r]=b.useState(t),[i,o]=b.useState(e);return b.useEffect(()=>{wP(n,t)||(r(t),o(e))},[n,t,e]),wP(n,t)?[i,o]:[e,o]}const sd={};function sb(e,t,n){const r=b.useCallback((i,o)=>t(i,o),[n]);b.useEffect(()=>(sd[e]||(sd[e]=[]),sd[e].push(r),function(){const o=sd[e].indexOf(r);o>=0&&sd[e].splice(o,1)}),[e,t,r])}function Uh(e,t,n){const r=sd[e];if(r)for(const i of r)i(t,n)}function Mq(e,t,n){return r=>Uh(e,t,r)}function k1(e,t,n){return b.useCallback(r=>Uh(e,t,r),[e,t,n])}function SP(e,t){return Mh(sessionStorage.getItem(String(e)))??t}function ike(e,t){t==null?sessionStorage.removeItem(String(e)):sessionStorage.setItem(String(e),JSON.stringify(t))}function _d(e,t){const n=Qp(SP(e,t),[e]),[r,i]=n;return b.useEffect(()=>{ike(e,r),Uh(`Session:${e}`,r)},[e,r]),sb(`Session:${e}`,function(a){r!==a&&i(a)},[r,e,t]),b.useEffect(function(){const a=c=>{c.key===e&&i(SP(e,t))};return window.addEventListener("storage",a),()=>{window.removeEventListener("storage",a)}},[e,i,t]),n}function oke(e,t=!1){const[n,r]=_d(e,t),i=b.useCallback(c=>{c?.preventDefault?.(),r(d=>!d)},[r]),o=b.useCallback(c=>{c?.preventDefault?.(),r(!0)},[r]),a=b.useCallback(c=>{c?.preventDefault?.(),r(!1)},[r]);return b.useMemo(()=>({toggled:n,setToggled:r,toggle:i,toggleOn:o,toggleOff:a}),[i,r,a,o,n])}const zq=b.createContext(null);function zr(){return b.useContext(zq)}async function Lq({file:e,project:t,entityType:n,instanceClient:r}){const{data:i}=await r.post("/",{operation:"drop_component",file:e||void 0,project:t,replicated:n==="cluster"});return i}function M0(e){const t=(e||"")?.split(".");return t.length>1?t.slice(-1)[0]:""}function Fq(e){switch(M0(e).toLowerCase()){case"jpg":case"jpeg":case"gif":case"png":case"pneg":case"webp":return!0;default:return!1}}async function Uq({instanceClient:e,file:t,project:n,encoding:r}){const{data:i}=await e.post("/",{operation:"get_component_file",file:t,project:n,encoding:r??(Fq(t)?"base64":"utf8")});return{file:t,project:n,...i}}function ake(e){return{queryKey:Vq(e),queryFn:()=>Uq(e),enabled:!!e.file&&!!e.project,retry:!1}}function Vq(e){return[e.entityId,"get_component_file",e.file,e.project,e.encoding]}async function kI({file:e,payload:t,project:n,entityType:r,instanceClient:i,encoding:o}){const{data:a}=await i.post("/",{operation:"set_component_file",file:e,payload:t,project:n,encoding:o,replicated:r==="cluster"},{timeout:3e5});return a}function Bq(){return ct({mutationFn:kI})}function Hq(){const{reloadRootEntries:e,setFocusedItem:t,setSelectedItems:n}=zr(),r=Zt();return b.useCallback(async i=>{let o=!1;const a=i.filter(y=>y.from!==y.to);if(a.length===0)return;const c=`Renaming ${Zr(a.length,"File","Files")}`,d={duration:6e4,action:{label:"Cancel",onClick:()=>{o=!0}}};d.id=we.loading(c,{...d,description:u.jsx(Am,{animated:!0,width:"0%"})});const m=a.length*3;let h=0;function v(){h+=1,we.loading(c,{...d,description:u.jsx(Am,{animated:!0,width:(h===0?0:h/m*100)+"%"})})}for(const y of a){const x=y.from.split("/"),S=x.shift(),C=x.join("/"),k=y.to.split("/"),E=k.shift(),j=k.join("/"),R=await Uq({...r,file:C,project:S,encoding:"base64"});if(o||(v(),await kI({...r,file:j,project:E,encoding:"base64",payload:R.message}),o)||(v(),await Lq({...r,file:C,project:S}),o))break;v()}h>=m?we.success(`Renamed ${Zr(a.length,"File","Files")}`,{id:d.id,description:"All done!",duration:3e3,action:{label:"OK",onClick:()=>{}}}):we.warning("Rename Cancelled",{id:d.id,description:`${h} of ${m} steps completed.`,duration:1e4,action:{label:"OK",onClick:()=>{}}}),e(),n(y=>{const x=y.slice();for(const S of a){const C=x.indexOf(S.from);C>=0?x.splice(C,1,S.to):x.push(S.to)}return x}),t(y=>{for(const x of a)if(y===x.from)return x.to;return y})},[r,e,t,n])}function ske(e,t){return e[t]!==void 0}function qq(e){return t=>ske(t,e)}function zl(e,t){const[n,r]=b.useState({value:t});return sb(e,(i,o)=>r({value:i,trigger:o}),[r]),n}function ei(e,t,n){Uh(e,t,n)}function z0(e,t,n){return r=>ei(e,t,r)}function Wa(e,t,n){return b.useCallback(r=>{ei(e,t,r)},[e,t,n])}const lke={handleGlobal(e,t){if((t.cmd||t.ctrl)&&e==="Delete")return ei("ShowDeleteDirectoryOrFileModal",!0),!0},addEditorAction(e){return{id:"delete-file",label:"Delete File",keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.Delete],run:z0("ShowDeleteDirectoryOrFileModal",!0)}}},cke={handleGlobal(e,t){if(t.ctrl&&t.alt&&t.shift&&e==="˜")return ei("ShowAddDirectoryOrFileModalType","directory"),!0},addEditorAction(e){return{id:"new-directory",label:"New Directory",keybindings:[e.KeyMod.WinCtrl|e.KeyMod.Alt|e.KeyMod.Shift|e.KeyCode.KeyN],run:z0("ShowAddDirectoryOrFileModalType","directory")}}},uke={handleGlobal(e,t){if(t.ctrl&&e==="n")return ei("ShowAddDirectoryOrFileModalType","file"),!0},addEditorAction(e){return{id:"new-file",label:"New File",keybindings:[e.KeyMod.WinCtrl|e.KeyCode.KeyN],run:z0("ShowAddDirectoryOrFileModalType","file")}}},dke={handleGlobal(e){if(e==="F2")return ei("ShowRenameFileModal","file"),!0},addEditorAction(e){return{id:"rename-file",label:"Rename File",keybindings:[e.KeyMod.WinCtrl|e.KeyMod.Alt|e.KeyCode.KeyR,e.KeyCode.F2],run:z0("ShowRenameFileModal",!0)}}},fke={addEditorAction(){return{id:"revert-file",label:"Revert File",run:Mq("RevertChanges",!0)}}},pke={handleGlobal(e,t){if(t.cmd&&e==="s")return Uh("SaveFile",!0),!0},addEditorAction(e){return{id:"save-file",label:"Save Changes",keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.KeyS],run:Mq("SaveFile",!0)}}},Kq=[lke,cke,uke,dke,fke,pke],mke=Kq.filter(qq("addEditorAction")),hke=Kq.filter(qq("handleGlobal"));function gke(e){const[t,n]=e,r=mke.map(i=>t.addAction(i.addEditorAction(n)));return()=>{for(const i of r)i?.dispose()}}function vke(){b.useEffect(()=>(document.addEventListener("keydown",_P),()=>{document.removeEventListener("keydown",_P)}),[])}function _P(e){const t=e.getModifierState("Meta"),n=e.getModifierState("Alt"),r=e.getModifierState("Shift"),i=e.getModifierState("Control"),o={cmd:t,alt:n,shift:r,ctrl:i};for(const a of hke)if(a.handleGlobal(e.key,o)){e.preventDefault();return}}function yke(e){return e.split("/").pop()}function EI(...e){return e.flat(1).join("/")}var ts;(function(e){e.DoubleClickItemToExpand="double-click-item-to-expand",e.ClickItemToExpand="click-item-to-expand",e.ClickArrowToExpand="click-arrow-to-expand"})(ts||(ts={}));var lb=function(){return lb=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},lb.apply(this,arguments)},bke=function(e,t){return{mode:e.mode,createInteractiveElementProps:function(n,r,i,o){return lb(lb({},t.createInteractiveElementProps(n,r,i,o)),e.createInteractiveElementProps(n,r,i,o))}}},Wd=function(e){return e.ctrlKey||navigator.platform.toUpperCase().indexOf("MAC")>=0&&e.metaKey},xke=(function(){function e(t){this.mode=ts.DoubleClickItemToExpand,this.environment=t}return e.prototype.createInteractiveElementProps=function(t,n,r,i){var o=this;return{onClick:function(a){var c=a.detail===0;r.focusItem(),a.shiftKey&&!c?r.selectUpTo(!Wd(a)):Wd(a)&&!c?i.isSelected?r.unselectItem():r.addToSelectedItems():r.selectItem()},onDoubleClick:function(){r.focusItem(),r.selectItem(),t.isFolder&&r.toggleExpandedState(),(!t.isFolder||o.environment.canInvokePrimaryActionOnItemContainer)&&r.primaryAction()},onFocus:function(){r.focusItem()},onDragStart:function(a){a.dataTransfer.dropEffect="move",r.startDragging()},onDragOver:function(a){a.preventDefault()},draggable:i.canDrag&&!i.isRenaming,tabIndex:i.isRenaming?void 0:i.isFocused?0:-1}},e})(),wke=(function(){function e(t){this.mode=ts.ClickItemToExpand,this.environment=t}return e.prototype.createInteractiveElementProps=function(t,n,r,i){var o=this;return{onClick:function(a){var c=a.detail===0;r.focusItem(),a.shiftKey&&!c?r.selectUpTo(!Wd(a)):Wd(a)&&!c?i.isSelected?r.unselectItem():r.addToSelectedItems():(t.isFolder&&r.toggleExpandedState(),r.selectItem(),(!t.isFolder||o.environment.canInvokePrimaryActionOnItemContainer)&&r.primaryAction())},onFocus:function(){r.focusItem()},onDragStart:function(a){a.dataTransfer.dropEffect="move",r.startDragging()},onDragOver:function(a){a.preventDefault()},draggable:i.canDrag&&!i.isRenaming,tabIndex:i.isRenaming?void 0:i.isFocused?0:-1}},e})(),Ske=(function(){function e(t){this.mode=ts.ClickItemToExpand,this.environment=t}return e.prototype.createInteractiveElementProps=function(t,n,r,i){var o=this;return{onClick:function(a){var c=a.detail===0;r.focusItem(),a.shiftKey&&!c?r.selectUpTo(!Wd(a)):Wd(a)&&!c?i.isSelected?r.unselectItem():r.addToSelectedItems():(r.selectItem(),(!t.isFolder||o.environment.canInvokePrimaryActionOnItemContainer)&&r.primaryAction())},onFocus:function(){r.focusItem()},onDragStart:function(a){a.dataTransfer.dropEffect="move",r.startDragging()},onDragOver:function(a){a.preventDefault()},draggable:i.canDrag&&!i.isRenaming,tabIndex:i.isRenaming?void 0:i.isFocused?0:-1}},e})(),CP=function(e,t){switch(e){case ts.DoubleClickItemToExpand:return new xke(t);case ts.ClickItemToExpand:return new wke(t);case ts.ClickArrowToExpand:return new Ske(t);default:throw Error("Unknown interaction mode ".concat(e))}},Gq=b.createContext(null),_ke=function(){return b.useContext(Gq)},Cke=function(e){var t=e.children,n=hn(),r=n.defaultInteractionMode,i=b.useMemo(function(){var o;return r&&typeof r!="string"?r.extends?bke(r,CP(r.extends,n)):r:CP((o=r)!==null&&o!==void 0?o:ts.ClickItemToExpand,n)},[]);return b.createElement(Gq.Provider,{value:i},t)},Zq=function(){var e=hn();return b.useCallback(function(t,n){if(t.targetType==="between-items"){if(!e.canReorderItems)return!1}else if(t.targetType==="root"){if(!e.canDropOnFolder)return!1}else{var r=e.items[t.targetItem];if(!r||!e.canDropOnFolder&&r.isFolder||!e.canDropOnNonFolder&&!r.isFolder||n.some(function(i){return i.index===t.targetItem}))return!1}return!(e.canDropAt&&(!n||!e.canDropAt(n,t)))},[e])},Yq=function(){var e=hn();return b.useCallback(function(t,n){for(var r=e.linearItems[n],i=r[t].depth,o=t;r[o]&&r[o].depth!==i-1;o-=1);var a=r[o];return a||(a={item:e.trees[n].rootItem,depth:0},o=0),{parent:a,parentLinearIndex:o}},[e.linearItems,e.trees])},kke=function(){var e=hn(),t=Yq(),n=Zq(),r=b.useCallback(function(i,o,a){var c=t(o,i),d=c.parent,f=c.parentLinearIndex;return a.some(function(m){return m.index===d.item})?!0:d.depth===0?!1:r(i,f,a)},[t]);return b.useCallback(function(i,o){for(var a,c,d,f,m=e.linearItems[i],h=[],v=-1,y=0;y<m.length;y++){var x=m[y],S=x.item,C=x.depth;if(!(v!==-1&&C>v)){v=-1;var k=t(y,i).parent,E=e.items[k.item].children.indexOf(S);if(r(i,y,o)){v=C+1;continue}var j={targetType:"item",parentItem:k.item,targetItem:S,linearIndex:y,depth:C,treeId:i},R={targetType:"between-items",parentItem:k.item,linePosition:"top",childIndex:E,depth:C,treeId:i,linearIndex:y},T={targetType:"between-items",parentItem:k.item,linePosition:"bottom",linearIndex:y+1,childIndex:E+1,depth:C,treeId:i},N=(c=(a=m[y-1])===null||a===void 0?void 0:a.depth)!==null&&c!==void 0?c:-1,O=(f=(d=m[y+1])===null||d===void 0?void 0:d.depth)!==null&&f!==void 0?f:-1,M=C===N,L=C===O-1;!M&&n(R,o)&&h.push(R),n(j,o)&&h.push(j),!L&&n(T,o)&&h.push(T)}}return h},[n,e.items,e.linearItems,t,r])},Fv=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},cb=function(e,t,n){var r=b.useRef();b.useEffect(function(){if(!r.current)r.current=Fv([],n,!0),e();else{var i=r.current.some(function(o,a){return o!==n[a]});i&&(r.current=Fv([],n,!0),e())}},Fv(Fv([],t,!0),n,!0))},ub=function(){return ub=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},ub.apply(this,arguments)},Wq=function(e,t){return e.map(function(n){return[n,t(n)]}).reduce(function(n,r){var i,o=r[0],a=r[1];return ub(ub({},n),(i={},i[o]=a,i))},{})},wo=function(){return typeof document<"u"?document:void 0};function Rf(e){e===void 0&&(e=!1);var t=b.useRef(new Array);return b.useEffect(function(){if(e)return function(){};var n=t.current;return function(){return n.forEach(function(r){return cancelAnimationFrame(r)})}},[e,t]),b.useCallback(function(n){var r=requestAnimationFrame(function(){t.current.splice(t.current.indexOf(r),1),n()});t.current.push(r)},[t])}var db=function(e){var t=b.useRef(e);return t.current=e,t},So=function(e){var t=db(e);return b.useCallback((function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t.current.apply(t,n)}),[t])},Xq=function(){var e=hn();return So(function(t,n){return n.map(function(r){return[r,e.linearItems[t].findIndex(function(i){return i.item===r.index})]}).sort(function(r,i){r[0];var o=r[1];i[0];var a=i[1];return o-a}).map(function(r){var i=r[0];return i})})},Eke=function(e){var t,n=(t=wo())===null||t===void 0?void 0:t.querySelector('[data-rct-tree="'.concat(e,'"] [data-rct-item-container="true"]'));if(n){var r=getComputedStyle(n);return n.offsetHeight+Math.max(parseFloat(r.marginTop),parseFloat(r.marginBottom))}return 5},Jq=function(e,t){return e.clientX<=t.left||e.clientX>=t.right||e.clientY<=t.top||e.clientY>=t.bottom},jke=(function(){function e(t,n,r,i,o,a){this.env=t,this.e=n,this.treeId=r,this.linearIndex=i.linearIndex,this.offset=i.offset,this.indentation=i.indentation,this.targetItem=this.env.linearItems[this.treeId][this.linearIndex],this.getParentOfLinearItem=a,this.draggingItems=o}return e.prototype.getEmptyTreeDragPosition=function(){return{targetType:"root",treeId:this.treeId,depth:0,linearIndex:0,targetItem:this.env.trees[this.treeId].rootItem}},e.prototype.maybeRedirectToParent=function(){var t=!this.env.canReorderItems&&!this.env.canDropOnNonFolder&&!this.env.items[this.targetItem.item].isFolder;if(t){var n=this.getParentOfLinearItem(this.linearIndex,this.treeId),r=n.parentLinearIndex,i=n.parent;this.targetItem=i,this.linearIndex=r}},e.prototype.maybeReparentUpwards=function(){var t,n;if(this.indentation!==void 0){var r=this.env.linearItems[this.treeId],i=r[this.linearIndex].depth,o=i-((n=(t=r[this.linearIndex+1])===null||t===void 0?void 0:t.depth)!==null&&n!==void 0?n:0),a=this.offset==="bottom"&&o>0;if(a){for(var c=Math.max(i-o,this.indentation),d={parentLinearIndex:this.linearIndex,parent:this.targetItem},f,m=i;m>=c;m-=1)f=d,d=this.getParentOfLinearItem(d.parentLinearIndex,this.treeId);if(this.indentation!==r[this.linearIndex].depth&&f){var h=this.env.items[d.parent.item].children.indexOf(f.parent.item)+1;if(!(this.draggingItems&&this.isDescendant(this.treeId,d.parentLinearIndex+1,this.draggingItems)))return{targetType:"between-items",treeId:this.treeId,parentItem:d.parent.item,depth:c,linearIndex:this.linearIndex+1,childIndex:h,linePosition:"bottom"}}}}},e.prototype.maybeRedirectInsideOpenFolder=function(){var t=this.env.linearItems[this.treeId][this.linearIndex+1],n=!this.env.canDropBelowOpenFolders&&t&&this.targetItem.depth===t.depth-1&&this.offset==="bottom";n&&(this.targetItem=t,this.linearIndex+=1,this.offset="top")},e.prototype.maybeMapToBottomOffset=function(){var t=this.env.linearItems[this.treeId][this.linearIndex-1];if(!(!t||t?.depth===void 0)){var n=t.depth-this.targetItem.depth;this.offset==="top"&&(n===0||n>0&&this.indentation!==void 0)&&(this.offset="bottom",this.linearIndex-=1,this.targetItem=this.env.linearItems[this.treeId][this.linearIndex])}},e.prototype.canDropAtCurrentTarget=function(){var t=this,n,r=this.env.items[this.targetItem.item];return!(!this.offset&&!this.env.canDropOnNonFolder&&!r.isFolder||!this.offset&&!this.env.canDropOnFolder&&r.isFolder||this.offset&&!this.env.canReorderItems||!((n=this.draggingItems)===null||n===void 0)&&n.some(function(i){return i.index===t.targetItem.item}))},e.prototype.getDraggingPosition=function(){if(this.env.linearItems[this.treeId].length===0)return this.getEmptyTreeDragPosition();if(!(!this.draggingItems||this.linearIndex<0||this.linearIndex>=this.env.linearItems[this.treeId].length)){this.maybeRedirectToParent(),this.maybeRedirectInsideOpenFolder(),this.maybeMapToBottomOffset();var t=this.maybeReparentUpwards();if(t)return t;if(this.areDraggingItemsDescendantOfTarget()||!this.canDropAtCurrentTarget())return"invalid";var n=this.getParentOfLinearItem(this.linearIndex,this.treeId).parent,r=this.env.items[n.item].children.indexOf(this.targetItem.item)+(this.offset==="top"?0:1);return this.offset?{targetType:"between-items",treeId:this.treeId,parentItem:n.item,depth:this.targetItem.depth,linearIndex:this.linearIndex+(this.offset==="top"?0:1),childIndex:r,linePosition:this.offset}:{targetType:"item",treeId:this.treeId,parentItem:n.item,targetItem:this.targetItem.item,depth:this.targetItem.depth,linearIndex:this.linearIndex}}},e.prototype.isDescendant=function(t,n,r){var i=this.getParentOfLinearItem(n,t),o=i.parentLinearIndex,a=i.parent;return r.some(function(c){return c.index===a.item})?!0:a.depth===0?!1:this.isDescendant(t,o,r)},e.prototype.areDraggingItemsDescendantOfTarget=function(){return this.draggingItems&&this.isDescendant(this.treeId,this.linearIndex,this.draggingItems)},e})(),Rke=function(){var e=b.useRef("initial"),t=b.useState(void 0),n=t[0],r=t[1],i=b.useRef(0),o=hn(),a=Yq(),c=So(function(v,y,x){if(!x)return!1;var S=x.offset,C=x.linearIndex,k="".concat(y,"__").concat(C,"__").concat(S??"","__").concat(x.indentation);return k!==e.current?(e.current=k,!0):!1}),d=So(function(v,y,x){if(x.current){var S=x.current.getBoundingClientRect();if(!Jq(v,S)){var C=(v.clientY-S.top)/i.current,k=o.linearItems[y],E=Math.min(Math.max(0,Math.floor(C)),k.length-1);if(k.length===0)return{linearIndex:0,offset:"bottom",indentation:0};var j=k[E],R=o.items[j.item],T=o.renderDepthOffset?Math.max(Math.floor((v.clientX-S.left)/o.renderDepthOffset),0):void 0,N,O=o.canReorderItems?R?.isFolder&&o.canDropOnFolder||o.canDropOnNonFolder?.2:.5:0;return C-.5>=k.length-1?N="bottom":C%1<O?N="top":C%1>1-O&&(N="bottom"),{linearIndex:E,offset:N,indentation:T}}}}),f=So(function(v,y,x){var S=d(v,y,x);if(c(v,y,S))return!n||!o.canDragAndDrop||!S||v.clientX<0||v.clientY<0?"invalid":new jke(o,v,y,S,n,a).getDraggingPosition()}),m=So(function(v,y){r(y),e.current="initial",i.current=Eke(v)}),h=So(function(){r(void 0),e.current="initial",i.current=0});return{initiateDraggingPosition:m,resetDraggingPosition:h,draggingItems:n,getDraggingPosition:f,itemHeight:i}},Qq=b.createContext(null),Ea=function(){return b.useContext(Qq)},Ike=function(e){var t=e.children,n=hn(),r=b.useState(!1),i=r[0],o=r[1],a=b.useState({}),c=a[0],d=a[1],f=b.useState(0),m=f[0],h=f[1],v=b.useState(),y=v[0],x=v[1],S=kke(),C=Rf(),k=Xq(),E=Rke(),j=E.initiateDraggingPosition,R=E.resetDraggingPosition,T=E.draggingItems,N=E.getDraggingPosition,O=E.itemHeight,M=b.useCallback(function(V,A){var J;if(n.activeTreeId&&(!((J=n.viewState[n.activeTreeId])===null||J===void 0)&&J.focusedItem)&&n.linearItems&&A){var fe=n.viewState[n.activeTreeId].focusedItem,ge=S(n.activeTreeId,A),B=ge.findIndex(function(se){return se.targetType==="item"?se.targetItem===fe:se.targetType==="between-items"?n.items[se.parentItem].children[se.childIndex]===fe:!1});h(B?Math.min(B+1,ge.length-1):0)}else h(0)},[n.activeTreeId,n.items,n.linearItems,n.viewState,S]),L=So(function(){o(!1),d({}),h(0),x(void 0),R()});cb(function(){n.activeTreeId&&n.linearItems[n.activeTreeId]&&c[n.activeTreeId]&&M(c[n.activeTreeId],T)},[T,n.activeTreeId,n.linearItems,M,c],[n.activeTreeId]),cb(function(){i&&n.activeTreeId&&x(c[n.activeTreeId][m])},[m,n.activeTreeId,i,c],[m,n.activeTreeId]);var K=Zq(),ee=function(V){var A;T&&!K(V,T)||(x(V),n.setActiveTree(V.treeId),T&&n.activeTreeId!==V.treeId&&((A=n.onSelectItems)===null||A===void 0||A.call(n,T.map(function(J){return J.index}),V.treeId)))},q=So(function(V,A,J){if(T){var fe=N(V,A,J);if(fe){if(fe==="invalid"){x(void 0);return}ee(fe)}}}),Y=So(function(V,A){A.current&&Jq(V,A.current.getBoundingClientRect())&&x(void 0)}),U=So(function(){!T||!y||!n.onDrop||(n.onDrop(T,y),C(function(){var V;(V=n.onFocusItem)===null||V===void 0||V.call(n,T[0],y.treeId),L()}))}),H=b.useCallback(function(V,A){var J=Wq(n.treeIds,function(fe){return S(fe,V)});j(A,V),d(J),n.activeTreeId&&M(J[n.activeTreeId],V)},[n.activeTreeId,n.treeIds,S,j,M]),z=b.useCallback(function(){var V,A,J;if(n.canDragAndDrop&&n.activeTreeId){var fe=(A=(V=n.viewState[n.activeTreeId])===null||V===void 0?void 0:V.selectedItems)!==null&&A!==void 0?A:[(J=n.viewState[n.activeTreeId])===null||J===void 0?void 0:J.focusedItem];if(fe.length===0||fe[0]===void 0)return;var ge=k(n.activeTreeId,fe.map(function(B){return n.items[B]}));if(n.canDrag&&!n.canDrag(ge))return;H(ge,n.activeTreeId),setTimeout(function(){o(!0)})}},[n,k,H]),W=b.useCallback(function(){L()},[L]),F=b.useCallback(function(){U(),L()},[U,L]),te=b.useCallback(function(){h(function(V){return Math.max(0,V-1)})},[]),D=b.useCallback(function(){n.activeTreeId&&h(function(V){return Math.min(c[n.activeTreeId].length-1,V+1)})},[n.activeTreeId,c]),$=b.useMemo(function(){return{onStartDraggingItems:H,startProgrammaticDrag:z,abortProgrammaticDrag:W,completeProgrammaticDrag:F,programmaticDragUp:te,programmaticDragDown:D,draggingItems:T,draggingPosition:y,itemHeight:O.current,isProgrammaticallyDragging:i,onDragOverTreeHandler:q,onDragLeaveContainerHandler:Y,viableDragPositions:c}},[W,F,T,y,i,O,q,Y,H,D,te,z,c]);return b.useEffect(function(){return window.addEventListener("dragend",L),window.addEventListener("drop",U),function(){window.removeEventListener("dragend",L),window.removeEventListener("drop",U)}},[U,L]),b.createElement(Qq.Provider,{value:$},t)},lm=function(){return lm=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},lm.apply(this,arguments)},Nke=function(e,t){var n=hn(),r=Ea();b.useImperativeHandle(e,function(){return lm(lm(lm({},t),n),{treeEnvironmentContext:n,dragAndDropContext:r})})},e7=function(e,t,n){return t===void 0&&(t=50),n===void 0&&(n=1e4),new Promise(function(r){e()&&r();var i,o=setInterval(function(){e()&&i()},t),a=setTimeout(function(){i()},n);i=function(){clearInterval(o),clearTimeout(a),r()}})},gk=function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function c(m){try{f(r.next(m))}catch(h){a(h)}}function d(m){try{f(r.throw(m))}catch(h){a(h)}}function f(m){m.done?o(m.value):i(m.value).then(c,d)}f((r=r.apply(e,t||[])).next())})},vk=function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(f){return function(m){return d([f,m])}}function d(f){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(n=0)),n;)try{if(r=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,i=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){n.label=f[1];break}if(f[0]===6&&n.label<o[1]){n.label=o[1],o=f;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(f);break}o[2]&&n.ops.pop(),n.trys.pop();continue}f=t.call(e,n)}catch(m){f=[6,m],i=0}finally{r=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},kP=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},t7=b.createContext(null),Tke=function(){return b.useContext(t7)},n7=function(e,t,n){return gk(void 0,void 0,void 0,function(){var r,i,o,a,c,d,f;return vk(this,function(m){for(r=function(h){e7(function(){var v;return!!(!((v=t.current)===null||v===void 0)&&v[h])}).then(function(){var v,y=(v=t.current)===null||v===void 0?void 0:v[h];y?.isFolder&&(n(y),n7(h,t,n))})},i=0,o=(f=(d=(c=t.current)===null||c===void 0?void 0:c[e])===null||d===void 0?void 0:d.children)!==null&&f!==void 0?f:[];i<o.length;i++)a=o[i],r(a);return[2]})})},Oke=b.forwardRef(function(e,t){var n=hn(),r=n.onCollapseItem,i=n.items,o=n.trees,a=n.viewState,c=n.onExpandItem,d=n.onFocusItem,f=n.setActiveTree,m=n.onRenameItem,h=n.onSelectItems,v=n.onPrimaryAction,y=n.linearItems,x=Ea(),S=x.abortProgrammaticDrag,C=x.completeProgrammaticDrag,k=x.programmaticDragDown,E=x.programmaticDragUp,j=x.startProgrammaticDrag,R=db(i),T=b.useCallback(function(D,$){r?.(i[D],$)},[i,r]),N=b.useCallback(function(D,$){c?.(i[D],$)},[i,c]),O=b.useCallback(function(D,$,V){V===void 0&&(V=!0),d?.(i[D],$,V)},[i,d]),M=b.useCallback(function(D,$){$===void 0&&($=!0),f(D,$)},[f]),L=b.useCallback(function(D){var $=y[D],V=$.findIndex(function(fe){var ge,B=fe.item;return B===((ge=a[D])===null||ge===void 0?void 0:ge.focusedItem)}),A=V!==void 0?Math.min($.length-1,V+1):0,J=i[$[A].item];d?.(J,D)},[i,y,d,a]),K=b.useCallback(function(D){var $=y[D],V=$.findIndex(function(fe){var ge,B=fe.item;return B===((ge=a[D])===null||ge===void 0?void 0:ge.focusedItem)}),A=V!==void 0?Math.max(0,V-1):0,J=i[$[A].item];d?.(J,D)},[i,y,d,a]),ee=b.useCallback(function(D,$,V){m?.(i[D],$,V)},[i,m]),q=b.useCallback(function(D,$){h?.(D,$)},[h]),Y=b.useCallback(function(D,$){var V,A;!((A=(V=a[$])===null||V===void 0?void 0:V.expandedItems)===null||A===void 0)&&A.includes(D)?r?.(i[D],$):c?.(i[D],$)},[i,r,c,a]),U=b.useCallback(function(D,$){var V,A,J,fe,ge;!((A=(V=a[$])===null||V===void 0?void 0:V.selectedItems)===null||A===void 0)&&A.includes(D)?h?.((fe=(J=a[$].selectedItems)===null||J===void 0?void 0:J.filter(function(B){return B!==D}))!==null&&fe!==void 0?fe:[],$):h?.(kP(kP([],(ge=a[$].selectedItems)!==null&&ge!==void 0?ge:[],!0),[D],!1),$)},[h,a]),H=b.useCallback(function(D,$){v?.(i[D],$)},[i,v]),z=b.useCallback(function(D,$){return gk(void 0,void 0,void 0,function(){var V,A;return vk(this,function(J){switch(J.label){case 0:return V=$[0],A=$.slice(1),[4,e7(function(){var fe;return!!(!((fe=R.current)===null||fe===void 0)&&fe[V])}).then(function(){var fe=R.current[V];return fe?(c?.(fe,D),A.length>0?z(D,A):Promise.resolve()):Promise.resolve()})];case 1:return J.sent(),[2]}})})},[R,c]),W=b.useCallback(function(D){return gk(void 0,void 0,void 0,function(){return vk(this,function($){switch($.label){case 0:return[4,n7(o[D].rootItem,R,function(V){return c?.(V,D)})];case 1:return $.sent(),[2]}})})},[R,c,o]),F=b.useCallback(function(D){for(var $,V,A=0,J=(V=($=a[D])===null||$===void 0?void 0:$.expandedItems)!==null&&V!==void 0?V:[];A<J.length;A++){var fe=J[A];r?.(i[fe],D)}},[i,r,a]),te=b.useMemo(function(){return{collapseItem:T,expandItem:N,focusItem:O,focusTree:M,moveFocusDown:L,moveFocusUp:K,renameItem:ee,selectItems:q,toggleItemExpandedState:Y,toggleItemSelectStatus:U,invokePrimaryAction:H,expandAll:W,expandSubsequently:z,collapseAll:F,abortProgrammaticDrag:S,completeProgrammaticDrag:C,moveProgrammaticDragPositionDown:k,moveProgrammaticDragPositionUp:E,startProgrammaticDrag:j}},[T,N,O,M,L,K,ee,q,Y,U,H,W,z,F,S,C,k,E,j]);return Nke(t,te),b.createElement(t7.Provider,{value:te},e.children)}),Ake=function(e){var t,n,r,i;if(e)if(e.scrollIntoViewIfNeeded)e.scrollIntoViewIfNeeded();else{var o=e.getBoundingClientRect(),a=o.top>=0&&o.left>=0&&o.bottom<=(window.innerHeight||!!(!((n=(t=wo())===null||t===void 0?void 0:t.documentElement)===null||n===void 0)&&n.clientHeight))&&o.right<=(window.innerWidth||!!(!((i=(r=wo())===null||r===void 0?void 0:r.documentElement)===null||i===void 0)&&i.clientWidth));a||e.scrollIntoView()}},pi=function(){return pi=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},pi.apply(this,arguments)},qs=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(n){return!!n}).join(" ")},Dke=function(e,t){return{renderItemTitle:function(n){var r=n.title,i=n.context,o=n.info;if(!o.isSearching||!i.isSearchMatching)return r;var a=r.toLowerCase().indexOf(o.search.toLowerCase());return Q.createElement(Q.Fragment,null,a>0&&Q.createElement("span",null,r.slice(0,a)),Q.createElement("span",{className:"rct-tree-item-search-highlight"},r.slice(a,a+o.search.length)),a+o.search.length<r.length&&Q.createElement("span",null,r.slice(a+o.search.length,r.length)))},renderItemArrow:function(n){var r=n.item,i=n.context;return Q.createElement("div",pi({className:qs(r.isFolder&&"rct-tree-item-arrow-isFolder",i.isExpanded&&"rct-tree-item-arrow-expanded","rct-tree-item-arrow")},i.arrowProps),r.isFolder&&(i.isExpanded?Q.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 16 16",enableBackground:"new 0 0 16 16",xmlSpace:"preserve"},Q.createElement("g",null,Q.createElement("g",null,Q.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z",className:"rct-tree-item-arrow-path"})))):Q.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 16 16",enableBackground:"new 0 0 16 16",xmlSpace:"preserve"},Q.createElement("g",null,Q.createElement("g",null,Q.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z",className:"rct-tree-item-arrow-path"}))))))},renderItem:function(n){var r=n.item,i=n.depth,o=n.children,a=n.title,c=n.context,d=n.arrow,f=c.isRenaming?"div":"button",m=c.isRenaming?void 0:"button";return Q.createElement("li",pi({},c.itemContainerWithChildrenProps,{className:qs("rct-tree-item-li",r.isFolder&&"rct-tree-item-li-isFolder",c.isSelected&&"rct-tree-item-li-selected",c.isExpanded&&"rct-tree-item-li-expanded",c.isFocused&&"rct-tree-item-li-focused",c.isDraggingOver&&"rct-tree-item-li-dragging-over",c.isSearchMatching&&"rct-tree-item-li-search-match")}),Q.createElement("div",pi({},c.itemContainerWithoutChildrenProps,{style:{"--depthOffset":"".concat((i+1)*e,"px")},className:qs("rct-tree-item-title-container",r.isFolder&&"rct-tree-item-title-container-isFolder",c.isSelected&&"rct-tree-item-title-container-selected",c.isExpanded&&"rct-tree-item-title-container-expanded",c.isFocused&&"rct-tree-item-title-container-focused",c.isDraggingOver&&"rct-tree-item-title-container-dragging-over",c.isSearchMatching&&"rct-tree-item-title-container-search-match")}),d,Q.createElement(f,pi({type:m},c.interactiveElementProps,{className:qs("rct-tree-item-button",r.isFolder&&"rct-tree-item-button-isFolder",c.isSelected&&"rct-tree-item-button-selected",c.isExpanded&&"rct-tree-item-button-expanded",c.isFocused&&"rct-tree-item-button-focused",c.isDraggingOver&&"rct-tree-item-button-dragging-over",c.isSearchMatching&&"rct-tree-item-button-search-match")}),a)),o)},renderRenameInput:function(n){var r=n.inputProps,i=n.inputRef,o=n.submitButtonProps,a=n.submitButtonRef,c=n.formProps;return Q.createElement("form",pi({},c,{className:"rct-tree-item-renaming-form"}),Q.createElement("input",pi({},r,{ref:i,className:"rct-tree-item-renaming-input"})),Q.createElement("input",pi({},o,{ref:a,type:"submit",className:"rct-tree-item-renaming-submit-button",value:"🗸"})))},renderTreeContainer:function(n){var r=n.children,i=n.containerProps,o=n.info;return Q.createElement("div",{className:qs("rct-tree-root",o.isFocused&&"rct-tree-root-focus",o.isRenaming&&"rct-tree-root-renaming",o.areItemsSelected&&"rct-tree-root-itemsselected",t)},Q.createElement("div",pi({},i,{style:pi({minHeight:"30px"},i.style)}),r))},renderItemsContainer:function(n){var r=n.children,i=n.containerProps;return Q.createElement("ul",pi({},i,{className:"rct-tree-items-container"}),r)},renderDragBetweenLine:function(n){var r=n.draggingPosition,i=n.lineProps;return Q.createElement("div",pi({},i,{style:{left:"".concat(r.depth*e,"px")},className:qs("rct-tree-drag-between-line",r.targetType==="between-items"&&r.linePosition==="top"&&"rct-tree-drag-between-line-top",r.targetType==="between-items"&&r.linePosition==="bottom"&&"rct-tree-drag-between-line-bottom")}))},renderSearchInput:function(n){var r=n.inputProps;return Q.createElement("div",{className:qs("rct-tree-search-input-container")},Q.createElement("span",{className:"rct-tree-input-icon"}),Q.createElement("input",pi({},r,{className:qs("rct-tree-search-input")})))},renderLiveDescriptorContainer:function(n){var r=n.tree,i=n.children;return Q.createElement("div",{id:"rct-livedescription-".concat(r.treeId),style:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",width:"1px"}},i)},renderDepthOffset:e}},$ke=function(e){var t=e.renderItem,n=e.renderItemTitle,r=e.renderItemArrow,i=e.renderRenameInput,o=e.renderItemsContainer,a=e.renderTreeContainer,c=e.renderDragBetweenLine,d=e.renderSearchInput,f=e.renderLiveDescriptorContainer,m=e.renderDepthOffset,h=b.useMemo(function(){return Dke(m??10)},[m]),v={renderItem:t,renderItemTitle:n,renderItemArrow:r,renderRenameInput:i,renderItemsContainer:o,renderTreeContainer:a,renderDragBetweenLine:c,renderSearchInput:d,renderLiveDescriptorContainer:f,renderDepthOffset:m},y=Object.entries(h).reduce(function(x,S){var C=S[0],k=S[1],E=C;return v[E]?x[E]=v[E]:x[E]=k,x},{});return y.renderItem.displayName="RenderItem",y.renderItemTitle.displayName="RenderItemTitle",y.renderItemArrow.displayName="RenderItemArrow",y.renderRenameInput.displayName="RenderRenameInput",y.renderItemsContainer.displayName="RenderItemsContainer",y.renderTreeContainer.displayName="RenderTreeContainer",y.renderDragBetweenLine.displayName="RenderDragBetweenLine",y.renderSearchInput.displayName="RenderSearchInput",y},jI=function(e,t,n,r){var i,o,a;r===void 0&&(r=0);for(var c=[],d=0,f=(o=(i=n[e])===null||i===void 0?void 0:i.children)!==null&&o!==void 0?o:[];d<f.length;d++){var m=f[d],h=n[m];c.push({item:m,depth:r}),h&&h.isFolder&&h.children&&(!((a=t.expandedItems)===null||a===void 0)&&a.includes(m))&&c.push.apply(c,jI(m,t,n,r+1))}return c},uc=function(){return uc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},uc.apply(this,arguments)},Pke=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Mke=function(e){var t=e.onExpandItem,n=e.onCollapseItem,r=e.onDrop,i=Pke(e,["onExpandItem","onCollapseItem","onDrop"]),o=b.useState({}),a=o[0],c=o[1],d=b.useState(),f=d[0],m=d[1],h=b.useMemo(function(){return Object.keys(a)},[a]),v=i.onFocusItem,y=i.autoFocus,x=i.onRegisterTree,S=i.onUnregisterTree,C=i.items,k=i.viewState,E=db(v),j=db(k),R=b.useMemo(function(){return Wq(h,function(U){var H;return jI(a[U].rootItem,(H=k[U])!==null&&H!==void 0?H:{},C)})},[a,C,h,k]),T=b.useCallback(function(U,H,z){var W,F,te,D,$,V,A,J,fe;if(z===void 0&&(z=!0),(y??!0)&&z){var ge=(F=(W=wo())===null||W===void 0?void 0:W.querySelector('[data-rct-tree="'.concat(H,'"] [data-rct-item-id="').concat(U.index,'"]')))!==null&&F!==void 0?F:(te=wo())===null||te===void 0?void 0:te.querySelector('[data-rct-tree="'.concat(H,'"] [data-rct-item-id]'));((V=($=(D=wo())===null||D===void 0?void 0:D.activeElement)===null||$===void 0?void 0:$.attributes.getNamedItem("data-rct-search-input"))===null||V===void 0?void 0:V.value)!=="true"?(A=ge?.focus)===null||A===void 0||A.call(ge):Ake(ge)}((J=j.current[H])===null||J===void 0?void 0:J.focusedItem)!==U.index&&((fe=E.current)===null||fe===void 0||fe.call(E,U,H))},[y,E,j]),N=b.useCallback(function(U){c(function(H){var z;return uc(uc({},H),(z={},z[U.treeId]=U,z))}),x?.(U)},[x]),O=b.useCallback(function(U){S?.(a[U]),delete a[U],c(a)},[S,a]),M=b.useCallback(function(U,H){n?.(U,H),c(function(z){return z})},[n]),L=b.useCallback(function(U,H){t?.(U,H),c(function(z){return z})},[t]),K=b.useCallback(function(U,H){r?.(U,H),c(function(z){return z})},[r]),ee=b.useCallback(function(U){var H,z,W=(H=wo())===null||H===void 0?void 0:H.querySelector('[data-rct-tree="'.concat(U,'"] [data-rct-item-focus="true"]'));(z=W?.focus)===null||z===void 0||z.call(W)},[]),q=b.useCallback(function(U,H){H===void 0&&(H=!0);var z=function(F){var te,D;H&&(y??!0)&&F&&!(!((D=(te=wo())===null||te===void 0?void 0:te.querySelector('[data-rct-tree="'.concat(F,'"]')))===null||D===void 0)&&D.contains(document.activeElement))&&ee(F)};if(typeof U=="function")m(function(F){var te=U(F);return te!==F&&z(te),te});else{var W=U;m(W),z(W)}},[y,ee]),Y=$ke(i);return uc(uc(uc({},Y),i),{onFocusItem:T,registerTree:N,unregisterTree:O,onExpandItem:L,onCollapseItem:M,onDrop:K,setActiveTree:q,treeIds:h,trees:a,activeTreeId:f,linearItems:R})},r7=b.createContext(null),hn=function(){return b.useContext(r7)},zke=b.forwardRef(function(e,t){var n=Mke(e),r=e.viewState,i=e.onFocusItem;return b.useEffect(function(){for(var o,a,c,d=0,f=Object.keys(n.trees);d<f.length;d++){var m=f[d],h=(a=(o=e.items[n.trees[m].rootItem])===null||o===void 0?void 0:o.children)===null||a===void 0?void 0:a[0],v=h&&e.items[h];!(!((c=r[m])===null||c===void 0)&&c.focusedItem)&&n.trees[m]&&v&&i?.(v,m,!1)}},[n.trees,i,e.items,r]),b.createElement(r7.Provider,{value:n},b.createElement(Cke,null,b.createElement(Ike,null,b.createElement(Oke,{ref:t},e.children))))}),Lke=function(e){var t,n=e.treeId,r=Ea(),i=r.draggingPosition,o=r.itemHeight,a=ti().renderers,c=i&&i.targetType==="between-items"&&i.treeId===n;if(!c)return null;var d={onDragOver:function(f){return f.preventDefault()}};return b.createElement("div",{style:{position:"absolute",left:"0",right:"0",top:"".concat(((t=i?.linearIndex)!==null&&t!==void 0?t:0)*o,"px")}},a.renderDragBetweenLine({draggingPosition:i,lineProps:d}))},Xd=function(e,t,n){var r=So(n);b.useEffect(function(){return e?(e.addEventListener(t,r),function(){return e.removeEventListener(t,r)}):function(){}},[e,r,t])},Fke=function(e,t,n){var r=b.useState(!1),i=r[0],o=r[1],a=b.useRef(!1),c=Rf();return Xd(e,"focusin",function(){i||(o(!0),t?.()),a.current&&(a.current=!1)}),Xd(e,"focusout",function(){a.current=!0,c(function(){a.current&&!e?.contains(document.activeElement)&&(n?.(),a.current=!1,o(!1))})}),i},Uv=function(e,t,n){Xd(wo(),"keydown",function(r){n&&n&&e.toLowerCase()===r.key.toLowerCase()&&t(r)})},EP={expandSiblings:["control+*"],moveFocusToFirstItem:["home"],moveFocusToLastItem:["end"],primaryAction:["enter"],renameItem:["f2"],abortRenameItem:["escape"],toggleSelectItem:["control+ "],abortSearch:["escape","enter"],startSearch:[],selectAll:["control+a"],startProgrammaticDnd:["control+shift+d"],completeProgrammaticDnd:["enter"],abortProgrammaticDnd:["escape"]},fb=function(){return fb=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},fb.apply(this,arguments)},i7=function(){var e=hn();return b.useMemo(function(){return e.keyboardBindings?fb(fb({},EP),e.keyboardBindings):EP},[e.keyboardBindings])},Uke=["input","textarea"],mo=function(e,t,n,r){r===void 0&&(r=!1);var i=b.useRef([]),o=i7(),a=Rf(),c=b.useMemo(function(){return o[e].map(function(d){return d.split("+")})},[e,o]);Xd(wo(),"keydown",function(d){var f;if(n!==!1&&!((Uke.includes((f=d.target.tagName)===null||f===void 0?void 0:f.toLowerCase())||d.target.isContentEditable)&&!r)&&!i.current.includes(d.key)){i.current.push(d.key);var m=i.current.map(function(v){return v.toLowerCase()}),h=c.map(function(v){return m.map(function(y){return v.includes(y.toLowerCase())}).reduce(function(y,x){return y&&x},!0)}).reduce(function(v,y){return v||y},!1);h&&(i.current.length>1||!/^[a-zA-Z\s]$/.test(d.key))&&d.preventDefault()}}),Xd(wo(),"keyup",function(d){if(n!==!1){var f=i.current.map(function(h){return h.toLowerCase()}),m=c.map(function(h){return h.map(function(v){return f.includes(v.toLowerCase())}).reduce(function(v,y){return v&&y},!0)}).reduce(function(h,v){return h||v},!1);m&&a(function(){return t(d)}),i.current=i.current.filter(function(h){return h!==d.key})}})},Vh=function(){var e,t=ti().treeId,n=hn().viewState;return(e=n[t])!==null&&e!==void 0?e:{}},L0=function(e){return hn().linearItems[e]},Vke=function(){var e=ti().treeId,t=hn(),n=t.onFocusItem,r=t.items,i=L0(e),o=Vh();return So(function(a){var c,d=(c=i.findIndex(function(v){return v.item===o.focusedItem}))!==null&&c!==void 0?c:0,f=a(d,i),m=Math.max(0,Math.min(i.length-1,f)),h=r[i[m].item];return n?.(h,e),h})},jP=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Bke=function(e){var t=b.useRef({target:e,previous:void 0});return t.current.target!==e&&(t.current.previous=t.current.target,t.current.target=e),t.current.previous},o7=function(e){var t=Vh(),n=ti().treeId,r=L0(n),i=hn().onSelectItems,o=Bke(t.focusedItem);return b.useCallback(function(a,c){var d,f;c===void 0&&(c=!1);var m=a.index,h=function(C,k){var E=jP(jP([],c?[]:C,!0),k.filter(function(j){return c||!C.includes(j)}),!0);i?.(E,n)};if(t&&t.selectedItems&&t.selectedItems.length>0){var v=t.focusedItem===m?o:t.focusedItem,y=e==="last-focus"?r.findIndex(function(C){return v===C.item}):r.findIndex(function(C){var k;return(k=t.selectedItems)===null||k===void 0?void 0:k.includes(C.item)}),x=r.findIndex(function(C){return C.item===m});if(y<x){var S=r.slice(y,x+1).map(function(C){var k=C.item;return k});h((d=t.selectedItems)!==null&&d!==void 0?d:[],S)}else{var S=r.slice(x,y+1).map(function(k){var E=k.item;return E});h((f=t.selectedItems)!==null&&f!==void 0?f:[],S)}}else i?.([m],n)},[t,i,n,e,r,o])},RP=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Hke=function(){var e,t=hn(),n=ti(),r=n.treeId,i=n.setRenamingItem,o=n.setSearch,a=n.renamingItem,c=L0(r),d=Ea(),f=Vh(),m=Vke(),h=o7("first-selected"),v=t.activeTreeId===r,y=!!a,x=t.disableArrowKeys,S=!x&&v&&!y;Uv("arrowdown",function(C){if(C.preventDefault(),d.isProgrammaticallyDragging)d.programmaticDragDown();else{var k=m(function(E){return E+1});C.shiftKey&&h(k)}},S),Uv("arrowup",function(C){if(C.preventDefault(),d.isProgrammaticallyDragging)d.programmaticDragUp();else{var k=m(function(E){return E-1});C.shiftKey&&h(k)}},S),mo("moveFocusToFirstItem",function(C){C.preventDefault(),m(function(){return 0})},v&&!d.isProgrammaticallyDragging&&!y),mo("moveFocusToLastItem",function(C){C.preventDefault(),m(function(k,E){return E.length-1})},v&&!d.isProgrammaticallyDragging&&!y),Uv("arrowright",function(C){C.preventDefault(),m(function(k,E){var j,R,T=t.items[E[k].item];if(T.isFolder){if(!((j=f.expandedItems)===null||j===void 0)&&j.includes(T.index))return k+1;(R=t.onExpandItem)===null||R===void 0||R.call(t,T,r)}return k})},S&&!d.isProgrammaticallyDragging),Uv("arrowleft",function(C){C.preventDefault(),m(function(k,E){var j,R,T=t.items[E[k].item],N=E[k].depth;if(T.isFolder&&(!((j=f.expandedItems)===null||j===void 0)&&j.includes(T.index)))(R=t.onCollapseItem)===null||R===void 0||R.call(t,T,r);else if(N>0){var O=k;for(O;E[O].depth!==N-1;O-=1);return O}return k})},S&&!d.isProgrammaticallyDragging),mo("primaryAction",function(C){var k,E;C.preventDefault(),f.focusedItem!==void 0&&((k=t.onSelectItems)===null||k===void 0||k.call(t,[f.focusedItem],r),(E=t.onPrimaryAction)===null||E===void 0||E.call(t,t.items[f.focusedItem],r))},v&&!d.isProgrammaticallyDragging&&!y),mo("toggleSelectItem",function(C){var k,E,j;C.preventDefault(),C.stopPropagation(),f.focusedItem!==void 0&&(f.selectedItems&&f.selectedItems.includes(f.focusedItem)?(k=t.onSelectItems)===null||k===void 0||k.call(t,f.selectedItems.filter(function(R){return R!==f.focusedItem}),r):(E=t.onSelectItems)===null||E===void 0||E.call(t,RP(RP([],(j=f.selectedItems)!==null&&j!==void 0?j:[],!0),[f.focusedItem],!1),r))},v&&!d.isProgrammaticallyDragging&&!y),mo("selectAll",function(C){var k;C.preventDefault(),(k=t.onSelectItems)===null||k===void 0||k.call(t,c.map(function(E){var j=E.item;return j}),r)},v&&!d.isProgrammaticallyDragging&&!y),mo("renameItem",function(C){var k;if(f.focusedItem!==void 0){C.preventDefault();var E=t.items[f.focusedItem];E.canRename!==!1&&((k=t.onStartRenamingItem)===null||k===void 0||k.call(t,E,r),i(E.index))}},v&&((e=t.canRename)!==null&&e!==void 0?e:!0)&&!y),mo("startSearch",function(C){var k,E;C.preventDefault(),o(""),(E=(k=document.querySelector('[data-rct-search-input="true"]'))===null||k===void 0?void 0:k.focus)===null||E===void 0||E.call(k)},v&&!d.isProgrammaticallyDragging&&!y),mo("startProgrammaticDnd",function(C){C.preventDefault(),d.startProgrammaticDrag()},v&&!y),mo("completeProgrammaticDnd",function(C){C.preventDefault(),d.completeProgrammaticDrag()},v&&d.isProgrammaticallyDragging&&!y),mo("abortProgrammaticDnd",function(C){C.preventDefault(),d.abortProgrammaticDrag()},v&&d.isProgrammaticallyDragging&&!y)},a7=function(e,t,n){return n.toLowerCase().includes(e.toLowerCase())},qke=function(){var e=hn(),t=e.doesSearchMatchItem,n=e.items,r=e.getItemTitle,i=e.onFocusItem,o=ti(),a=o.search,c=o.treeId,d=L0(c),f=Rf();cb(function(){a&&a.length>0&&f(function(){var m=d.find(function(h){var v=h.item;return(t??a7)(a,n[v],r(n[v]))});m&&i?.(n[m.item],c)})},[t,r,d,n,i,a,c,f],[a])},yk=function(){return yk=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},yk.apply(this,arguments)},Kke=function(e){var t,n=e.containerRef,r=ti(),i=r.search,o=r.setSearch,a=r.treeId,c=r.renderers,d=r.renamingItem,f=hn();Vh();var m=f.activeTreeId===a,h=Rf();qke();var v=function(){var y,x,S;if(o(null),!((y=f.autoFocus)!==null&&y!==void 0)||y){var C=(x=wo())===null||x===void 0?void 0:x.querySelector('[data-rct-tree="'.concat(a,'"] [data-rct-item-focus="true"]'));(S=C?.focus)===null||S===void 0||S.call(C)}};return mo("abortSearch",function(){h(function(){v()})},m&&i!==null,!0),Xd(n,"keydown",function(y){var x,S,C=y.key.charCodeAt(0);(!((x=f.canSearch)!==null&&x!==void 0)||x)&&(!((S=f.canSearchByStartingTyping)!==null&&S!==void 0)||S)&&m&&i===null&&!d&&!y.ctrlKey&&!y.shiftKey&&!y.altKey&&!y.metaKey&&(C>=48&&C<=57||C>=97&&C<=122)&&o("")}),!(!((t=f.canSearch)!==null&&t!==void 0)||t)||i===null?null:c.renderSearchInput({inputProps:yk({value:i,onChange:function(y){return o(y.target.value)},onBlur:function(){v()},ref:function(y){var x;(x=y?.focus)===null||x===void 0||x.call(y)},"aria-label":"Search for items"},{"data-rct-search-input":"true"})})},Gke={introduction:`
128
128
  <p>Accessibility guide for tree {treeLabel}.</p>
129
129
  <p>
130
130
  Navigate the tree with the arrow keys. Common tree hotkeys apply. Further keybindings are available:
@@ -206,7 +206,7 @@ type ${y.tableName} @table${k}${E}${j} {${R}
206
206
  focus-visible:ring-1
207
207
  focus-visible:outline-1
208
208
  focus-visible:ring-purple-200
209
- 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 WK="Toggle",XK=b.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:i,...o}=e,[a,c]=qo({prop:n,onChange:i,defaultProp:r??!1,caller:WK});return u.jsx(Ye.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:Re(e.onClick,()=>{e.disabled||c(!a)})})});XK.displayName=WK;var v$e=XK;function y$e({className:e,variant:t,size:n,...r}){return u.jsx(v$e,{"data-slot":"toggle",className:Ue(g$e({variant:t,size:n,className:e})),...r})}function JK(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 FM=["secondary","default","warning","outline","success","destructive"];let UM=0;const H1=new Map,QK=e=>{if(H1.has(e))return H1.get(e);UM++;const t=UM%FM.length,n=FM[t];return H1.set(e,n),n};function b$e({columns:e,data:t,onRowClick:n}){const r=N0({data:t,columns:e,getCoreRowModel:I0()});return u.jsx("div",{className:"rounded-md bg-black-dark logsTable",children:u.jsxs(T0,{className:"text-xs",children:[u.jsx(zh,{children:r.getHeaderGroups().map(i=>u.jsx(Vi,{className:"border-none",children:i.headers.map(o=>u.jsx(_I,{className:"p-4 max-w-96",children:o.isPlaceholder?null:Fc(o.column.columnDef.header,o.getContext())},o.id))},i.id))}),u.jsx(O0,{className:"bg-black",children:r.getRowModel().rows?.length?r.getRowModel().rows.map(i=>u.jsx(Vi,{"data-state":i.getIsSelected()&&"selected",className:Ue("hover:bg-muted/10 data-[state=selected]:bg-muted max-w-full",n&&"cursor-pointer"),onClick:()=>n?.(i),children:i.getVisibleCells().map(o=>u.jsx(us,{className:"p-1",children:Fc(o.column.columnDef.cell,o.getContext())},o.id))},i.id)):u.jsx(Vi,{children:u.jsx(us,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})})}function x$e(e){try{JSON.parse(e)}catch{return!1}return!0}function w$e({setIsModalOpen:e,isModalOpen:t,data:n}){const r=n?QK(n.node):"default";return u.jsx(Fn,{onOpenChange:e,open:t,children:u.jsxs(Un,{"aria-describedby":void 0,children:[u.jsx(gr,{children:u.jsx($n,{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:JK(n.level),children:bo(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($0,{className:"w-full h-72",language:x$e(n.message)?"json":"text",theme:"vs-dark",value:n.message,options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1}})]})]}):u.jsx(eo,{}),u.jsx(Zn,{children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsxs(be,{type:"button",variant:"destructive",className:"rounded-full",children:[u.jsx(Ca,{})," Delete Row"]}),u.jsxs(be,{variant:"submit",className:"rounded-full",children:[u.jsx(jo,{})," Save Changes"]})]})})]})})}function S$e({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 _$e=Dt({limit:nt().optional(),level:Al(["notify","error","warn","info","debug","trace","undefined"]).optional(),from:nt().or(Em()).optional(),until:nt().or(Em()).optional()});function C$e({form:e,resetFilters:t,submitFilters:n}){return u.jsx("div",{children:u.jsx(an,{...e,children:u.jsxs("form",{onSubmit:e.handleSubmit(n),className:"flex-col space-y-5",children:[u.jsx($e,{control:e.control,name:"limit",render:({field:r})=>u.jsxs(Ne,{children:[u.jsx(Te,{children:"Log Limit:"}),u.jsxs(qi,{onValueChange:r.onChange,value:r.value,children:[u.jsx(Gi,{className:"w-full",children:u.jsx(Ki,{placeholder:"Select log limit"})}),u.jsx(Zi,{children:u.jsxs(Yo,{children:[u.jsx(At,{value:"1000",children:"1000"}),u.jsx(At,{value:"500",children:"500"}),u.jsx(At,{value:"250",children:"250"}),u.jsx(At,{value:"100",children:"100"}),u.jsx(At,{value:"10",children:"10"})]})})]}),u.jsx(Oe,{})]})}),u.jsx($e,{control:e.control,name:"level",render:({field:r})=>u.jsxs(Ne,{children:[u.jsx(Te,{children:"Log Level:"}),u.jsxs(qi,{onValueChange:r.onChange,value:r.value,children:[u.jsx(Gi,{className:"w-full",children:u.jsx(Ki,{placeholder:"Select log level"})}),u.jsx(Zi,{children:u.jsxs(Yo,{children:[u.jsx(At,{value:"undefined",children:"All"}),u.jsx(At,{value:"notify",children:"Notify"}),u.jsx(At,{value:"error",children:"Error"}),u.jsx(At,{value:"warn",children:"Warn"}),u.jsx(At,{value:"info",children:"Info"}),u.jsx(At,{value:"debug",children:"Debug"}),u.jsx(At,{value:"trace",children:"Trace"})]})})]}),u.jsx(Oe,{})]})}),u.jsx($e,{control:e.control,name:"from",render:({field:r})=>u.jsxs(Ne,{children:[u.jsx(Te,{children:"Start Date:"}),u.jsx(De,{children:u.jsx(Me,{type:"datetime-local",value:r.value,onChange:r.onChange})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:e.control,name:"until",render:({field:r})=>u.jsxs(Ne,{children:[u.jsx(Te,{children:"End Date:"}),u.jsx(De,{children:u.jsx(Me,{type:"datetime-local",value:r.value,onChange:r.onChange})}),u.jsx(Oe,{})]})}),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 q1={limit:"100",level:"undefined",from:"",until:""},k$e=[{accessorKey:"level",header:"Status",cell:({row:e})=>{const{level:t}=e.original;return u.jsx(Zo,{variant:JK(t),children:bo(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=QK(t);return u.jsx(u.Fragment,{children:t?u.jsxs(dx,{children:[u.jsx(fx,{asChild:!0,children:u.jsxs(Zo,{variant:n,children:[t.split(".")[0],"..."]})}),u.jsx(px,{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})})}}],E$e=(e,t)=>{if(!e&&!t||!e||!t)return!0;const n=new Date(e),r=new Date(t);return n<=r};function j$e(){const[e,t]=b.useState(q1),[n,r]=b.useState(!1),[i,o]=b.useState(),[a,c]=b.useState(!1),d=Zt(),{data:f,isLoading:m,refetch:h,isFetching:v}=Pt(S$e({logFilters:e,...d,replicated:d.entityType==="cluster",isAutoRefreshEnabled:a})),y=on({resolver:mn(_$e),defaultValues:q1,mode:"onChange"}),x=E=>{o(E.original),r(!0)},S=async E=>{if(!E$e(E.from,E.until)){y.setError("from",{type:"onChange",message:"Start date must be before end date"}),y.setError("until",{type:"onChange",message:"End date must be after start date"});return}t(E)},C=async()=>{y.reset(),t(q1)},k=Ml(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(C$e,{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:k,disabled:v||m||a,className:"grow",children:[u.jsx(ba,{}),"Refresh"]}),u.jsxs(y$e,{variant:"outline","aria-label":"Toggle Auto Refresh",onPressedChange:c,children:[u.jsx(ba,{}),"Auto Refresh ",a?"On":"Off"]})]})]}),u.jsx("section",{className:"col-span-1 md:col-span-8 lg:col-span-9",children:m?u.jsx("div",{children:"Loading..."}):u.jsx("div",{children:u.jsx(b$e,{columns:k$e,data:f||[],onRowClick:x})})}),u.jsx(w$e,{isModalOpen:n,setIsModalOpen:r,data:i})]})}function R$e(e){return rt({getParentRoute:()=>e,path:"logs",component:j$e})}function I$e(e){return rt({getParentRoute:()=>e,path:"status",component:Jz(async()=>Jm(()=>import("./index-CLmLLaxk.js"),__vite__mapDeps([3,1])),"StatusIndex")})}function N$e(e){const t=h$e(e),n=[R$e(t),...JOe(t),rke(t),I$e(t),tDe(t),u$e(t)];return t.addChildren(n)}rt({getParentRoute:()=>P0,path:"profile",component:Jz(async()=>Jm(()=>import("./index-CTmvkqOY.js"),[]),"ProfileIndex")});const T$e=tx.addChildren([...obe,P0.addChildren([N$e("local")])]);function O$e({routeTree:e=T$e,authentication:t}){const n=$X();return gQ({routeTree:e,history:n,defaultNotFoundComponent:Sne,defaultErrorComponent:Ey,defaultPreload:_ne()?!1:"intent",trailingSlash:"never",defaultPreloadStaleTime:0,scrollRestoration:!0,context:{queryClient:jy,authentication:t||{}}})}function A$e(){const e=wQ(),t=O$e({authentication:e});return u.jsxs(u.Fragment,{children:[u.jsx(bQ,{router:t,context:{authentication:e}}),!1]})}const D$e=({...e})=>u.jsx(Wne,{className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground font-medium",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground font-medium"}},...e});let VM=!1;function $$e(){b.useEffect(()=>{VM||(VM=!0)},[])}var P$e=function(){return null};function M$e(){return Tfe(),Sde(),$$e(),u.jsxs(u.Fragment,{children:[u.jsxs(vX,{client:jy,children:[u.jsx(A$e,{}),u.jsx(P$e,{buttonPosition:"bottom-right"})]}),u.jsx(D$e,{richColors:!0})]})}var K1={exports:{}},Kp={},G1={exports:{}},Z1={};var BM;function z$e(){return BM||(BM=1,(function(e){function t(z,W){var F=z.length;z.push(W);e:for(;0<F;){var te=F-1>>>1,D=z[te];if(0<i(D,W))z[te]=W,z[F]=D,F=te;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var W=z[0],F=z.pop();if(F!==W){z[0]=F;e:for(var te=0,D=z.length,$=D>>>1;te<$;){var V=2*(te+1)-1,A=z[V],J=V+1,fe=z[J];if(0>i(A,F))J<D&&0>i(fe,A)?(z[te]=fe,z[J]=F,te=J):(z[te]=A,z[V]=F,te=V);else if(J<D&&0>i(fe,F))z[te]=fe,z[J]=F,te=J;else break e}}return W}function i(z,W){var F=z.sortIndex-W.sortIndex;return F!==0?F:z.id-W.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var d=[],f=[],m=1,h=null,v=3,y=!1,x=!1,S=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function R(z){for(var W=n(f);W!==null;){if(W.callback===null)r(f);else if(W.startTime<=z)r(f),W.sortIndex=W.expirationTime,t(d,W);else break;W=n(f)}}function T(z){if(S=!1,R(z),!x)if(n(d)!==null)x=!0,N||(N=!0,q());else{var W=n(f);W!==null&&H(T,W.startTime-z)}}var N=!1,O=-1,M=5,L=-1;function K(){return C?!0:!(e.unstable_now()-L<M)}function ee(){if(C=!1,N){var z=e.unstable_now();L=z;var W=!0;try{e:{x=!1,S&&(S=!1,E(O),O=-1),y=!0;var F=v;try{t:{for(R(z),h=n(d);h!==null&&!(h.expirationTime>z&&K());){var te=h.callback;if(typeof te=="function"){h.callback=null,v=h.priorityLevel;var D=te(h.expirationTime<=z);if(z=e.unstable_now(),typeof D=="function"){h.callback=D,R(z),W=!0;break t}h===n(d)&&r(d),R(z)}else r(d);h=n(d)}if(h!==null)W=!0;else{var $=n(f);$!==null&&H(T,$.startTime-z),W=!1}}break e}finally{h=null,v=F,y=!1}W=void 0}}finally{W?q():N=!1}}}var q;if(typeof j=="function")q=function(){j(ee)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,U=Y.port2;Y.port1.onmessage=ee,q=function(){U.postMessage(null)}}else q=function(){k(ee,0)};function H(z,W){O=k(function(){z(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(z){switch(v){case 1:case 2:case 3:var W=3;break;default:W=v}var F=v;v=W;try{return z()}finally{v=F}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(z,W){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var F=v;v=z;try{return W()}finally{v=F}},e.unstable_scheduleCallback=function(z,W,F){var te=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?te+F:te):F=te,z){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=F+D,z={id:m++,callback:W,priorityLevel:z,startTime:F,expirationTime:D,sortIndex:-1},F>te?(z.sortIndex=F,t(f,z),n(d)===null&&z===n(f)&&(S?(E(O),O=-1):S=!0,H(T,F-te))):(z.sortIndex=D,t(d,z),x||y||(x=!0,N||(N=!0,q()))),z},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(z){var W=v;return function(){var F=v;v=W;try{return z.apply(this,arguments)}finally{v=F}}}})(Z1)),Z1}var HM;function L$e(){return HM||(HM=1,G1.exports=z$e()),G1.exports}var qM;function F$e(){if(qM)return Kp;qM=1;var e=L$e(),t=Vm(),n=Xz();function r(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)l+="&args[]="+encodeURIComponent(arguments[p])}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,p=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(p=l.return),s=l.return;while(s)}return l.tag===3?p: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 p=s,g=l;;){var w=p.return;if(w===null)break;var _=w.alternate;if(_===null){if(g=w.return,g!==null){p=g;continue}break}if(w.child===_.child){for(_=w.child;_;){if(_===p)return d(w),s;if(_===g)return d(w),l;_=_.sibling}throw Error(r(188))}if(p.return!==g.return)p=w,g=_;else{for(var I=!1,P=w.child;P;){if(P===p){I=!0,p=w,g=_;break}if(P===g){I=!0,g=w,p=_;break}P=P.sibling}if(!I){for(P=_.child;P;){if(P===p){I=!0,p=_,g=w;break}if(P===g){I=!0,g=_,p=w;break}P=P.sibling}if(!I)throw Error(r(189))}}if(p.alternate!==g)throw Error(r(190))}if(p.tag!==3)throw Error(r(188));return p.stateNode.current===p?s:l}function m(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s;for(s=s.child;s!==null;){if(l=m(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"),x=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),j=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),ee=Symbol.iterator;function q(s){return s===null||typeof s!="object"?null:(s=ee&&s[ee]||s["@@iterator"],typeof s=="function"?s:null)}var Y=Symbol.for("react.client.reference");function U(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===Y?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case S:return"Fragment";case k:return"Profiler";case C:return"StrictMode";case T:return"Suspense";case N:return"SuspenseList";case L:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case x:return"Portal";case j:return s.displayName||"Context";case E:return(s._context.displayName||"Context")+".Consumer";case R:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case O:return l=s.displayName||null,l!==null?l:U(s.type)||"Memo";case M:l=s._payload,s=s._init;try{return U(s(l))}catch{}}return null}var H=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},te=[],D=-1;function $(s){return{current:s}}function V(s){0>D||(s.current=te[D],te[D]=null,D--)}function A(s,l){D++,te[D]=s.current,s.current=l}var J=$(null),fe=$(null),ge=$(null),B=$(null);function se(s,l){switch(A(ge,l),A(fe,s),A(J,null),l.nodeType){case 9:case 11:s=(s=l.documentElement)&&(s=s.namespaceURI)?pA(s):0;break;default:if(s=l.tagName,l=l.namespaceURI)l=pA(l),s=mA(l,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}V(J),A(J,s)}function _e(){V(J),V(fe),V(ge)}function Ie(s){s.memoizedState!==null&&A(B,s);var l=J.current,p=mA(l,s.type);l!==p&&(A(fe,s),A(J,p))}function Fe(s){fe.current===s&&(V(J),V(fe)),B.current===s&&(V(B),gp._currentValue=F)}var Le,We;function gt(s){if(Le===void 0)try{throw Error()}catch(p){var l=p.stack.trim().match(/\n( *(at )?)/);Le=l&&l[1]||"",We=-1<p.stack.indexOf(`
209
+ 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 WK="Toggle",XK=b.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:i,...o}=e,[a,c]=qo({prop:n,onChange:i,defaultProp:r??!1,caller:WK});return u.jsx(Ye.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:Re(e.onClick,()=>{e.disabled||c(!a)})})});XK.displayName=WK;var v$e=XK;function y$e({className:e,variant:t,size:n,...r}){return u.jsx(v$e,{"data-slot":"toggle",className:Ue(g$e({variant:t,size:n,className:e})),...r})}function JK(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 FM=["secondary","default","warning","outline","success","destructive"];let UM=0;const H1=new Map,QK=e=>{if(H1.has(e))return H1.get(e);UM++;const t=UM%FM.length,n=FM[t];return H1.set(e,n),n};function b$e({columns:e,data:t,onRowClick:n}){const r=N0({data:t,columns:e,getCoreRowModel:I0()});return u.jsx("div",{className:"rounded-md bg-black-dark logsTable",children:u.jsxs(T0,{className:"text-xs",children:[u.jsx(zh,{children:r.getHeaderGroups().map(i=>u.jsx(Vi,{className:"border-none",children:i.headers.map(o=>u.jsx(_I,{className:"p-4 max-w-96",children:o.isPlaceholder?null:Fc(o.column.columnDef.header,o.getContext())},o.id))},i.id))}),u.jsx(O0,{className:"bg-black",children:r.getRowModel().rows?.length?r.getRowModel().rows.map(i=>u.jsx(Vi,{"data-state":i.getIsSelected()&&"selected",className:Ue("hover:bg-muted/10 data-[state=selected]:bg-muted max-w-full",n&&"cursor-pointer"),onClick:()=>n?.(i),children:i.getVisibleCells().map(o=>u.jsx(us,{className:"p-1",children:Fc(o.column.columnDef.cell,o.getContext())},o.id))},i.id)):u.jsx(Vi,{children:u.jsx(us,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})})}function x$e(e){try{JSON.parse(e)}catch{return!1}return!0}function w$e({setIsModalOpen:e,isModalOpen:t,data:n}){const r=n?QK(n.node):"default";return u.jsx(Fn,{onOpenChange:e,open:t,children:u.jsxs(Un,{"aria-describedby":void 0,children:[u.jsx(gr,{children:u.jsx($n,{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:JK(n.level),children:bo(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($0,{className:"w-full h-72",language:x$e(n.message)?"json":"text",theme:"vs-dark",value:n.message,options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1}})]})]}):u.jsx(eo,{}),u.jsx(Zn,{children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsxs(be,{type:"button",variant:"destructive",className:"rounded-full",children:[u.jsx(Ca,{})," Delete Row"]}),u.jsxs(be,{variant:"submit",className:"rounded-full",children:[u.jsx(jo,{})," Save Changes"]})]})})]})})}function S$e({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 _$e=Dt({limit:nt().optional(),level:Al(["notify","error","warn","info","debug","trace","undefined"]).optional(),from:nt().or(Em()).optional(),until:nt().or(Em()).optional()});function C$e({form:e,resetFilters:t,submitFilters:n}){return u.jsx("div",{children:u.jsx(an,{...e,children:u.jsxs("form",{onSubmit:e.handleSubmit(n),className:"flex-col space-y-5",children:[u.jsx($e,{control:e.control,name:"limit",render:({field:r})=>u.jsxs(Ne,{children:[u.jsx(Te,{children:"Log Limit:"}),u.jsxs(qi,{onValueChange:r.onChange,value:r.value,children:[u.jsx(Gi,{className:"w-full",children:u.jsx(Ki,{placeholder:"Select log limit"})}),u.jsx(Zi,{children:u.jsxs(Yo,{children:[u.jsx(At,{value:"1000",children:"1000"}),u.jsx(At,{value:"500",children:"500"}),u.jsx(At,{value:"250",children:"250"}),u.jsx(At,{value:"100",children:"100"}),u.jsx(At,{value:"10",children:"10"})]})})]}),u.jsx(Oe,{})]})}),u.jsx($e,{control:e.control,name:"level",render:({field:r})=>u.jsxs(Ne,{children:[u.jsx(Te,{children:"Log Level:"}),u.jsxs(qi,{onValueChange:r.onChange,value:r.value,children:[u.jsx(Gi,{className:"w-full",children:u.jsx(Ki,{placeholder:"Select log level"})}),u.jsx(Zi,{children:u.jsxs(Yo,{children:[u.jsx(At,{value:"undefined",children:"All"}),u.jsx(At,{value:"notify",children:"Notify"}),u.jsx(At,{value:"error",children:"Error"}),u.jsx(At,{value:"warn",children:"Warn"}),u.jsx(At,{value:"info",children:"Info"}),u.jsx(At,{value:"debug",children:"Debug"}),u.jsx(At,{value:"trace",children:"Trace"})]})})]}),u.jsx(Oe,{})]})}),u.jsx($e,{control:e.control,name:"from",render:({field:r})=>u.jsxs(Ne,{children:[u.jsx(Te,{children:"Start Date:"}),u.jsx(De,{children:u.jsx(Me,{type:"datetime-local",value:r.value,onChange:r.onChange})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:e.control,name:"until",render:({field:r})=>u.jsxs(Ne,{children:[u.jsx(Te,{children:"End Date:"}),u.jsx(De,{children:u.jsx(Me,{type:"datetime-local",value:r.value,onChange:r.onChange})}),u.jsx(Oe,{})]})}),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 q1={limit:"100",level:"undefined",from:"",until:""},k$e=[{accessorKey:"level",header:"Status",cell:({row:e})=>{const{level:t}=e.original;return u.jsx(Zo,{variant:JK(t),children:bo(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=QK(t);return u.jsx(u.Fragment,{children:t?u.jsxs(dx,{children:[u.jsx(fx,{asChild:!0,children:u.jsxs(Zo,{variant:n,children:[t.split(".")[0],"..."]})}),u.jsx(px,{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})})}}],E$e=(e,t)=>{if(!e&&!t||!e||!t)return!0;const n=new Date(e),r=new Date(t);return n<=r};function j$e(){const[e,t]=b.useState(q1),[n,r]=b.useState(!1),[i,o]=b.useState(),[a,c]=b.useState(!1),d=Zt(),{data:f,isLoading:m,refetch:h,isFetching:v}=Pt(S$e({logFilters:e,...d,replicated:d.entityType==="cluster",isAutoRefreshEnabled:a})),y=on({resolver:mn(_$e),defaultValues:q1,mode:"onChange"}),x=E=>{o(E.original),r(!0)},S=async E=>{if(!E$e(E.from,E.until)){y.setError("from",{type:"onChange",message:"Start date must be before end date"}),y.setError("until",{type:"onChange",message:"End date must be after start date"});return}t(E)},C=async()=>{y.reset(),t(q1)},k=Ml(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(C$e,{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:k,disabled:v||m||a,className:"grow",children:[u.jsx(ba,{}),"Refresh"]}),u.jsxs(y$e,{variant:"outline","aria-label":"Toggle Auto Refresh",onPressedChange:c,children:[u.jsx(ba,{}),"Auto Refresh ",a?"On":"Off"]})]})]}),u.jsx("section",{className:"col-span-1 md:col-span-8 lg:col-span-9",children:m?u.jsx("div",{children:"Loading..."}):u.jsx("div",{children:u.jsx(b$e,{columns:k$e,data:f||[],onRowClick:x})})}),u.jsx(w$e,{isModalOpen:n,setIsModalOpen:r,data:i})]})}function R$e(e){return rt({getParentRoute:()=>e,path:"logs",component:j$e})}function I$e(e){return rt({getParentRoute:()=>e,path:"status",component:Jz(async()=>Jm(()=>import("./index-DHFTW4ZU.js"),__vite__mapDeps([3,1])),"StatusIndex")})}function N$e(e){const t=h$e(e),n=[R$e(t),...JOe(t),rke(t),I$e(t),tDe(t),u$e(t)];return t.addChildren(n)}rt({getParentRoute:()=>P0,path:"profile",component:Jz(async()=>Jm(()=>import("./index-DCIk8mGR.js"),[]),"ProfileIndex")});const T$e=tx.addChildren([...obe,P0.addChildren([N$e("local")])]);function O$e({routeTree:e=T$e,authentication:t}){const n=$X();return gQ({routeTree:e,history:n,defaultNotFoundComponent:Sne,defaultErrorComponent:Ey,defaultPreload:_ne()?!1:"intent",trailingSlash:"never",defaultPreloadStaleTime:0,scrollRestoration:!0,context:{queryClient:jy,authentication:t||{}}})}function A$e(){const e=wQ(),t=O$e({authentication:e});return u.jsxs(u.Fragment,{children:[u.jsx(bQ,{router:t,context:{authentication:e}}),!1]})}const D$e=({...e})=>u.jsx(Wne,{className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground font-medium",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground font-medium"}},...e});let VM=!1;function $$e(){b.useEffect(()=>{VM||(VM=!0)},[])}var P$e=function(){return null};function M$e(){return Tfe(),Sde(),$$e(),u.jsxs(u.Fragment,{children:[u.jsxs(vX,{client:jy,children:[u.jsx(A$e,{}),u.jsx(P$e,{buttonPosition:"bottom-right"})]}),u.jsx(D$e,{richColors:!0})]})}var K1={exports:{}},Kp={},G1={exports:{}},Z1={};var BM;function z$e(){return BM||(BM=1,(function(e){function t(z,W){var F=z.length;z.push(W);e:for(;0<F;){var te=F-1>>>1,D=z[te];if(0<i(D,W))z[te]=W,z[F]=D,F=te;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var W=z[0],F=z.pop();if(F!==W){z[0]=F;e:for(var te=0,D=z.length,$=D>>>1;te<$;){var V=2*(te+1)-1,A=z[V],J=V+1,fe=z[J];if(0>i(A,F))J<D&&0>i(fe,A)?(z[te]=fe,z[J]=F,te=J):(z[te]=A,z[V]=F,te=V);else if(J<D&&0>i(fe,F))z[te]=fe,z[J]=F,te=J;else break e}}return W}function i(z,W){var F=z.sortIndex-W.sortIndex;return F!==0?F:z.id-W.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var d=[],f=[],m=1,h=null,v=3,y=!1,x=!1,S=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function R(z){for(var W=n(f);W!==null;){if(W.callback===null)r(f);else if(W.startTime<=z)r(f),W.sortIndex=W.expirationTime,t(d,W);else break;W=n(f)}}function T(z){if(S=!1,R(z),!x)if(n(d)!==null)x=!0,N||(N=!0,q());else{var W=n(f);W!==null&&H(T,W.startTime-z)}}var N=!1,O=-1,M=5,L=-1;function K(){return C?!0:!(e.unstable_now()-L<M)}function ee(){if(C=!1,N){var z=e.unstable_now();L=z;var W=!0;try{e:{x=!1,S&&(S=!1,E(O),O=-1),y=!0;var F=v;try{t:{for(R(z),h=n(d);h!==null&&!(h.expirationTime>z&&K());){var te=h.callback;if(typeof te=="function"){h.callback=null,v=h.priorityLevel;var D=te(h.expirationTime<=z);if(z=e.unstable_now(),typeof D=="function"){h.callback=D,R(z),W=!0;break t}h===n(d)&&r(d),R(z)}else r(d);h=n(d)}if(h!==null)W=!0;else{var $=n(f);$!==null&&H(T,$.startTime-z),W=!1}}break e}finally{h=null,v=F,y=!1}W=void 0}}finally{W?q():N=!1}}}var q;if(typeof j=="function")q=function(){j(ee)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,U=Y.port2;Y.port1.onmessage=ee,q=function(){U.postMessage(null)}}else q=function(){k(ee,0)};function H(z,W){O=k(function(){z(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(z){switch(v){case 1:case 2:case 3:var W=3;break;default:W=v}var F=v;v=W;try{return z()}finally{v=F}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(z,W){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var F=v;v=z;try{return W()}finally{v=F}},e.unstable_scheduleCallback=function(z,W,F){var te=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?te+F:te):F=te,z){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=F+D,z={id:m++,callback:W,priorityLevel:z,startTime:F,expirationTime:D,sortIndex:-1},F>te?(z.sortIndex=F,t(f,z),n(d)===null&&z===n(f)&&(S?(E(O),O=-1):S=!0,H(T,F-te))):(z.sortIndex=D,t(d,z),x||y||(x=!0,N||(N=!0,q()))),z},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(z){var W=v;return function(){var F=v;v=W;try{return z.apply(this,arguments)}finally{v=F}}}})(Z1)),Z1}var HM;function L$e(){return HM||(HM=1,G1.exports=z$e()),G1.exports}var qM;function F$e(){if(qM)return Kp;qM=1;var e=L$e(),t=Vm(),n=Xz();function r(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)l+="&args[]="+encodeURIComponent(arguments[p])}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,p=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(p=l.return),s=l.return;while(s)}return l.tag===3?p: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 p=s,g=l;;){var w=p.return;if(w===null)break;var _=w.alternate;if(_===null){if(g=w.return,g!==null){p=g;continue}break}if(w.child===_.child){for(_=w.child;_;){if(_===p)return d(w),s;if(_===g)return d(w),l;_=_.sibling}throw Error(r(188))}if(p.return!==g.return)p=w,g=_;else{for(var I=!1,P=w.child;P;){if(P===p){I=!0,p=w,g=_;break}if(P===g){I=!0,g=w,p=_;break}P=P.sibling}if(!I){for(P=_.child;P;){if(P===p){I=!0,p=_,g=w;break}if(P===g){I=!0,g=_,p=w;break}P=P.sibling}if(!I)throw Error(r(189))}}if(p.alternate!==g)throw Error(r(190))}if(p.tag!==3)throw Error(r(188));return p.stateNode.current===p?s:l}function m(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s;for(s=s.child;s!==null;){if(l=m(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"),x=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),j=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),ee=Symbol.iterator;function q(s){return s===null||typeof s!="object"?null:(s=ee&&s[ee]||s["@@iterator"],typeof s=="function"?s:null)}var Y=Symbol.for("react.client.reference");function U(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===Y?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case S:return"Fragment";case k:return"Profiler";case C:return"StrictMode";case T:return"Suspense";case N:return"SuspenseList";case L:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case x:return"Portal";case j:return s.displayName||"Context";case E:return(s._context.displayName||"Context")+".Consumer";case R:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case O:return l=s.displayName||null,l!==null?l:U(s.type)||"Memo";case M:l=s._payload,s=s._init;try{return U(s(l))}catch{}}return null}var H=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},te=[],D=-1;function $(s){return{current:s}}function V(s){0>D||(s.current=te[D],te[D]=null,D--)}function A(s,l){D++,te[D]=s.current,s.current=l}var J=$(null),fe=$(null),ge=$(null),B=$(null);function se(s,l){switch(A(ge,l),A(fe,s),A(J,null),l.nodeType){case 9:case 11:s=(s=l.documentElement)&&(s=s.namespaceURI)?pA(s):0;break;default:if(s=l.tagName,l=l.namespaceURI)l=pA(l),s=mA(l,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}V(J),A(J,s)}function _e(){V(J),V(fe),V(ge)}function Ie(s){s.memoizedState!==null&&A(B,s);var l=J.current,p=mA(l,s.type);l!==p&&(A(fe,s),A(J,p))}function Fe(s){fe.current===s&&(V(J),V(fe)),B.current===s&&(V(B),gp._currentValue=F)}var Le,We;function gt(s){if(Le===void 0)try{throw Error()}catch(p){var l=p.stack.trim().match(/\n( *(at )?)/);Le=l&&l[1]||"",We=-1<p.stack.indexOf(`
210
210
  at`)?" (<anonymous>)":-1<p.stack.indexOf("@")?"@unknown:0:0":""}return`
211
211
  `+Le+s+We}var Qt=!1;function Tn(s,l){if(!s||Qt)return"";Qt=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(l){var Se=function(){throw Error()};if(Object.defineProperty(Se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Se,[])}catch(he){var de=he}Reflect.construct(s,[],Se)}else{try{Se.call()}catch(he){de=he}s.call(Se.prototype)}}else{try{throw Error()}catch(he){de=he}(Se=s())&&typeof Se.catch=="function"&&Se.catch(function(){})}}catch(he){if(he&&de&&typeof he.stack=="string")return[he.stack,de.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var w=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");w&&w.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=g.DetermineComponentFrameRoot(),I=_[0],P=_[1];if(I&&P){var Z=I.split(`
212
212
  `),ce=P.split(`