harperdb 4.7.21 → 4.7.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/harperdb.js +1 -1
- package/bin/lite.js +1 -1
- package/launchServiceScripts/launchNatsIngestService.js +1 -1
- package/launchServiceScripts/launchNatsReplyService.js +1 -1
- package/launchServiceScripts/launchUpdateNodes4-0-0.js +1 -1
- package/npm-shrinkwrap.json +41 -82
- package/package.json +1 -1
- package/server/jobs/jobProcess.js +1 -1
- package/server/threads/threadServer.js +1 -1
- package/studio/web/assets/{index-cZbhNKPv.js → index-BlG-cpH9.js} +2 -2
- package/studio/web/assets/{index-cZbhNKPv.js.map → index-BlG-cpH9.js.map} +1 -1
- package/studio/web/assets/{index-BMKHXWrK.js → index-BpmqvC1O.js} +5 -5
- package/studio/web/assets/{index-BMKHXWrK.js.map → index-BpmqvC1O.js.map} +1 -1
- package/studio/web/assets/{index-DP5O80Ld.js → index-DFovvBYL.js} +2 -2
- package/studio/web/assets/{index-DP5O80Ld.js.map → index-DFovvBYL.js.map} +1 -1
- package/studio/web/assets/{index.lazy-_WqXCxX6.js → index.lazy-BhReIK4y.js} +2 -2
- package/studio/web/assets/{index.lazy-_WqXCxX6.js.map → index.lazy-BhReIK4y.js.map} +1 -1
- package/studio/web/assets/{profiler-CiZIC7ZI.js → profiler-BhXa8xgR.js} +2 -2
- package/studio/web/assets/{profiler-CiZIC7ZI.js.map → profiler-BhXa8xgR.js.map} +1 -1
- package/studio/web/assets/{react-redux-D8H6oZRQ.js → react-redux-DkN7OdDj.js} +2 -2
- package/studio/web/assets/{react-redux-D8H6oZRQ.js.map → react-redux-DkN7OdDj.js.map} +1 -1
- package/studio/web/assets/{startRecording-oz3NQO5N.js → startRecording-Da15t52a.js} +2 -2
- package/studio/web/assets/{startRecording-oz3NQO5N.js.map → startRecording-Da15t52a.js.map} +1 -1
- package/studio/web/index.html +1 -1
- package/utility/scripts/restartHdb.js +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.lazy-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.lazy-BhReIK4y.js","assets/react-redux-DkN7OdDj.js","assets/index-jiPwkrsB.css","assets/index-BlG-cpH9.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);var __privateWrapper=(obj,member,setter,getter)=>({set _(value){__privateSet(obj,member,value,setter)},get _(){return __privateGet(obj,member,getter)}});function _mergeNamespaces(n2,m){for(var i2=0;i2<m.length;i2++){const e=m[i2];if(typeof e!="string"&&!Array.isArray(e)){for(const k2 in e)if(k2!=="default"&&!(k2 in n2)){const d=Object.getOwnPropertyDescriptor(e,k2);d&&Object.defineProperty(n2,k2,d.get?d:{enumerable:!0,get:__name(()=>e[k2],"get")})}}}return Object.freeze(Object.defineProperty(n2,Symbol.toStringTag,{value:"Module"}))}__name(_mergeNamespaces,"_mergeNamespaces");__name(function(){const relList=document.createElement("link").relList;if(relList&&relList.supports&&relList.supports("modulepreload"))return;for(const link2 of document.querySelectorAll('link[rel="modulepreload"]'))processPreload(link2);new MutationObserver(mutations=>{for(const mutation of mutations)if(mutation.type==="childList")for(const node2 of mutation.addedNodes)node2.tagName==="LINK"&&node2.rel==="modulepreload"&&processPreload(node2)}).observe(document,{childList:!0,subtree:!0});function getFetchOpts(link2){const fetchOpts={};return link2.integrity&&(fetchOpts.integrity=link2.integrity),link2.referrerPolicy&&(fetchOpts.referrerPolicy=link2.referrerPolicy),link2.crossOrigin==="use-credentials"?fetchOpts.credentials="include":link2.crossOrigin==="anonymous"?fetchOpts.credentials="omit":fetchOpts.credentials="same-origin",fetchOpts}__name(getFetchOpts,"getFetchOpts");function processPreload(link2){if(link2.ep)return;link2.ep=!0;const fetchOpts=getFetchOpts(link2);fetch(link2.href,fetchOpts)}__name(processPreload,"processPreload")},"polyfill")();var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x.default:x}__name(getDefaultExportFromCjs,"getDefaultExportFromCjs");var jsxRuntime={exports:{}},reactJsxRuntime_production={};var hasRequiredReactJsxRuntime_production;function requireReactJsxRuntime_production(){if(hasRequiredReactJsxRuntime_production)return reactJsxRuntime_production;hasRequiredReactJsxRuntime_production=1;var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");function jsxProd(type,config2,maybeKey){var key=null;if(maybeKey!==void 0&&(key=""+maybeKey),config2.key!==void 0&&(key=""+config2.key),"key"in config2){maybeKey={};for(var propName in config2)propName!=="key"&&(maybeKey[propName]=config2[propName])}else maybeKey=config2;return config2=maybeKey.ref,{$$typeof:REACT_ELEMENT_TYPE,type,key,ref:config2!==void 0?config2:null,props:maybeKey}}return __name(jsxProd,"jsxProd"),reactJsxRuntime_production.Fragment=REACT_FRAGMENT_TYPE,reactJsxRuntime_production.jsx=jsxProd,reactJsxRuntime_production.jsxs=jsxProd,reactJsxRuntime_production}__name(requireReactJsxRuntime_production,"requireReactJsxRuntime_production");var hasRequiredJsxRuntime;function requireJsxRuntime(){return hasRequiredJsxRuntime||(hasRequiredJsxRuntime=1,jsxRuntime.exports=requireReactJsxRuntime_production()),jsxRuntime.exports}__name(requireJsxRuntime,"requireJsxRuntime");var jsxRuntimeExports=requireJsxRuntime();const isLocalStudio=!0,localStudioDevUrl="/",defaultOperationsApiPort=9925,defaultClusterUsername="HDB_ADMIN",defaultInstanceRoute="/",defaultInstanceRouteUpOne="../",maxUploadFileSize=1024*1024*1024,maxFabricConnectUploadFileSize=100*1024*1024;function bind(fn,thisArg){return __name(function(){return fn.apply(thisArg,arguments)},"wrap")}__name(bind,"bind");const{toString:toString$3}=Object.prototype,{getPrototypeOf}=Object,{iterator,toStringTag}=Symbol,kindOf=(cache2=>thing=>{const str=toString$3.call(thing);return cache2[str]||(cache2[str]=str.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=__name(type=>(type=type.toLowerCase(),thing=>kindOf(thing)===type),"kindOfTest"),typeOfTest=__name(type=>thing=>typeof thing===type,"typeOfTest"),{isArray}=Array,isUndefined$1=typeOfTest("undefined");function isBuffer(val){return val!==null&&!isUndefined$1(val)&&val.constructor!==null&&!isUndefined$1(val.constructor)&&isFunction$6(val.constructor.isBuffer)&&val.constructor.isBuffer(val)}__name(isBuffer,"isBuffer");const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(val){let result;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?result=ArrayBuffer.isView(val):result=val&&val.buffer&&isArrayBuffer(val.buffer),result}__name(isArrayBufferView,"isArrayBufferView");const isString$2=typeOfTest("string"),isFunction$6=typeOfTest("function"),isNumber$3=typeOfTest("number"),isObject$5=__name(thing=>thing!==null&&typeof thing=="object","isObject$5"),isBoolean$1=__name(thing=>thing===!0||thing===!1,"isBoolean$1"),isPlainObject$5=__name(val=>{if(kindOf(val)!=="object")return!1;const prototype2=getPrototypeOf(val);return(prototype2===null||prototype2===Object.prototype||Object.getPrototypeOf(prototype2)===null)&&!(toStringTag in val)&&!(iterator in val)},"isPlainObject$5"),isEmptyObject$2=__name(val=>{if(!isObject$5(val)||isBuffer(val))return!1;try{return Object.keys(val).length===0&&Object.getPrototypeOf(val)===Object.prototype}catch{return!1}},"isEmptyObject$2"),isDate=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=__name(val=>isObject$5(val)&&isFunction$6(val.pipe),"isStream"),isFormData=__name(thing=>{let kind;return thing&&(typeof FormData=="function"&&thing instanceof FormData||isFunction$6(thing.append)&&((kind=kindOf(thing))==="formdata"||kind==="object"&&isFunction$6(thing.toString)&&thing.toString()==="[object FormData]"))},"isFormData"),isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim=__name(str=>str.trim?str.trim():str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),"trim");function forEach(obj,fn,{allOwnKeys=!1}={}){if(obj===null||typeof obj>"u")return;let i2,l2;if(typeof obj!="object"&&(obj=[obj]),isArray(obj))for(i2=0,l2=obj.length;i2<l2;i2++)fn.call(null,obj[i2],i2,obj);else{if(isBuffer(obj))return;const keys2=allOwnKeys?Object.getOwnPropertyNames(obj):Object.keys(obj),len=keys2.length;let key;for(i2=0;i2<len;i2++)key=keys2[i2],fn.call(null,obj[key],key,obj)}}__name(forEach,"forEach");function findKey(obj,key){if(isBuffer(obj))return null;key=key.toLowerCase();const keys2=Object.keys(obj);let i2=keys2.length,_key;for(;i2-- >0;)if(_key=keys2[i2],key===_key.toLowerCase())return _key;return null}__name(findKey,"findKey");const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,isContextDefined=__name(context=>!isUndefined$1(context)&&context!==_global,"isContextDefined");function merge$3(){const{caseless,skipUndefined}=isContextDefined(this)&&this||{},result={},assignValue=__name((val,key)=>{if(key==="__proto__"||key==="constructor"||key==="prototype")return;const targetKey=caseless&&findKey(result,key)||key;isPlainObject$5(result[targetKey])&&isPlainObject$5(val)?result[targetKey]=merge$3(result[targetKey],val):isPlainObject$5(val)?result[targetKey]=merge$3({},val):isArray(val)?result[targetKey]=val.slice():(!skipUndefined||!isUndefined$1(val))&&(result[targetKey]=val)},"assignValue");for(let i2=0,l2=arguments.length;i2<l2;i2++)arguments[i2]&&forEach(arguments[i2],assignValue);return result}__name(merge$3,"merge$3");const extend$3=__name((a2,b,thisArg,{allOwnKeys}={})=>(forEach(b,(val,key)=>{thisArg&&isFunction$6(val)?Object.defineProperty(a2,key,{value:bind(val,thisArg),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(a2,key,{value:val,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys}),a2),"extend$3"),stripBOM=__name(content2=>(content2.charCodeAt(0)===65279&&(content2=content2.slice(1)),content2),"stripBOM"),inherits=__name((constructor,superConstructor,props,descriptors)=>{constructor.prototype=Object.create(superConstructor.prototype,descriptors),Object.defineProperty(constructor.prototype,"constructor",{value:constructor,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(constructor,"super",{value:superConstructor.prototype}),props&&Object.assign(constructor.prototype,props)},"inherits"),toFlatObject=__name((sourceObj,destObj,filter2,propFilter)=>{let props,i2,prop;const merged={};if(destObj=destObj||{},sourceObj==null)return destObj;do{for(props=Object.getOwnPropertyNames(sourceObj),i2=props.length;i2-- >0;)prop=props[i2],(!propFilter||propFilter(prop,sourceObj,destObj))&&!merged[prop]&&(destObj[prop]=sourceObj[prop],merged[prop]=!0);sourceObj=filter2!==!1&&getPrototypeOf(sourceObj)}while(sourceObj&&(!filter2||filter2(sourceObj,destObj))&&sourceObj!==Object.prototype);return destObj},"toFlatObject"),endsWith=__name((str,searchString,position2)=>{str=String(str),(position2===void 0||position2>str.length)&&(position2=str.length),position2-=searchString.length;const lastIndex=str.indexOf(searchString,position2);return lastIndex!==-1&&lastIndex===position2},"endsWith"),toArray=__name(thing=>{if(!thing)return null;if(isArray(thing))return thing;let i2=thing.length;if(!isNumber$3(i2))return null;const arr=new Array(i2);for(;i2-- >0;)arr[i2]=thing[i2];return arr},"toArray"),isTypedArray=(TypedArray=>thing=>TypedArray&&thing instanceof TypedArray)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=__name((obj,fn)=>{const _iterator=(obj&&obj[iterator]).call(obj);let result;for(;(result=_iterator.next())&&!result.done;){const pair=result.value;fn.call(obj,pair[0],pair[1])}},"forEachEntry"),matchAll=__name((regExp,str)=>{let matches;const arr=[];for(;(matches=regExp.exec(str))!==null;)arr.push(matches);return arr},"matchAll"),isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase$1=__name(str=>str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,__name(function(m,p1,p2){return p1.toUpperCase()+p2},"replacer")),"toCamelCase$1"),hasOwnProperty$2=(({hasOwnProperty:hasOwnProperty2})=>(obj,prop)=>hasOwnProperty2.call(obj,prop))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=__name((obj,reducer2)=>{const descriptors=Object.getOwnPropertyDescriptors(obj),reducedDescriptors={};forEach(descriptors,(descriptor,name2)=>{let ret;(ret=reducer2(descriptor,name2,obj))!==!1&&(reducedDescriptors[name2]=ret||descriptor)}),Object.defineProperties(obj,reducedDescriptors)},"reduceDescriptors"),freezeMethods=__name(obj=>{reduceDescriptors(obj,(descriptor,name2)=>{if(isFunction$6(obj)&&["arguments","caller","callee"].indexOf(name2)!==-1)return!1;const value=obj[name2];if(isFunction$6(value)){if(descriptor.enumerable=!1,"writable"in descriptor){descriptor.writable=!1;return}descriptor.set||(descriptor.set=()=>{throw Error("Can not rewrite read-only method '"+name2+"'")})}})},"freezeMethods"),toObjectSet=__name((arrayOrString,delimiter)=>{const obj={},define=__name(arr=>{arr.forEach(value=>{obj[value]=!0})},"define");return isArray(arrayOrString)?define(arrayOrString):define(String(arrayOrString).split(delimiter)),obj},"toObjectSet"),noop$4=__name(()=>{},"noop$4"),toFiniteNumber=__name((value,defaultValue)=>value!=null&&Number.isFinite(value=+value)?value:defaultValue,"toFiniteNumber");function isSpecCompliantForm(thing){return!!(thing&&isFunction$6(thing.append)&&thing[toStringTag]==="FormData"&&thing[iterator])}__name(isSpecCompliantForm,"isSpecCompliantForm");const toJSONObject=__name(obj=>{const stack=new Array(10),visit2=__name((source,i2)=>{if(isObject$5(source)){if(stack.indexOf(source)>=0)return;if(isBuffer(source))return source;if(!("toJSON"in source)){stack[i2]=source;const target=isArray(source)?[]:{};return forEach(source,(value,key)=>{const reducedValue=visit2(value,i2+1);!isUndefined$1(reducedValue)&&(target[key]=reducedValue)}),stack[i2]=void 0,target}}return source},"visit");return visit2(obj,0)},"toJSONObject"),isAsyncFn=kindOfTest("AsyncFunction"),isThenable=__name(thing=>thing&&(isObject$5(thing)||isFunction$6(thing))&&isFunction$6(thing.then)&&isFunction$6(thing.catch),"isThenable"),_setImmediate=((setImmediateSupported,postMessageSupported)=>setImmediateSupported?setImmediate:postMessageSupported?((token,callbacks)=>(_global.addEventListener("message",({source,data})=>{source===_global&&data===token&&callbacks.length&&callbacks.shift()()},!1),cb=>{callbacks.push(cb),_global.postMessage(token,"*")}))(`axios@${Math.random()}`,[]):cb=>setTimeout(cb))(typeof setImmediate=="function",isFunction$6(_global.postMessage)),asap=typeof queueMicrotask<"u"?queueMicrotask.bind(_global):typeof process<"u"&&process.nextTick||_setImmediate,isIterable=__name(thing=>thing!=null&&isFunction$6(thing[iterator]),"isIterable"),utils$1={isArray,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString:isString$2,isNumber:isNumber$3,isBoolean:isBoolean$1,isObject:isObject$5,isPlainObject:isPlainObject$5,isEmptyObject:isEmptyObject$2,isReadableStream,isRequest,isResponse,isHeaders,isUndefined:isUndefined$1,isDate,isFile,isBlob,isRegExp,isFunction:isFunction$6,isStream,isURLSearchParams,isTypedArray,isFileList,forEach,merge:merge$3,extend:extend$3,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty:hasOwnProperty$2,hasOwnProp:hasOwnProperty$2,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase:toCamelCase$1,noop:noop$4,toFiniteNumber,findKey,global:_global,isContextDefined,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable,setImmediate:_setImmediate,asap,isIterable};var _a;let AxiosError$1=(_a=class extends Error{static from(error2,code2,config2,request,response,customProps){const axiosError=new _a(error2.message,code2||error2.code,config2,request,response);return axiosError.cause=error2,axiosError.name=error2.name,customProps&&Object.assign(axiosError,customProps),axiosError}constructor(message,code2,config2,request,response){super(message),this.name="AxiosError",this.isAxiosError=!0,code2&&(this.code=code2),config2&&(this.config=config2),request&&(this.request=request),response&&(this.response=response,this.status=response.status)}toJSON(){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:utils$1.toJSONObject(this.config),code:this.code,status:this.status}}},__name(_a,"AxiosError"),_a);AxiosError$1.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";AxiosError$1.ERR_BAD_OPTION="ERR_BAD_OPTION";AxiosError$1.ECONNABORTED="ECONNABORTED";AxiosError$1.ETIMEDOUT="ETIMEDOUT";AxiosError$1.ERR_NETWORK="ERR_NETWORK";AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";AxiosError$1.ERR_DEPRECATED="ERR_DEPRECATED";AxiosError$1.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";AxiosError$1.ERR_BAD_REQUEST="ERR_BAD_REQUEST";AxiosError$1.ERR_CANCELED="ERR_CANCELED";AxiosError$1.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";AxiosError$1.ERR_INVALID_URL="ERR_INVALID_URL";const httpAdapter=null;function isVisitable(thing){return utils$1.isPlainObject(thing)||utils$1.isArray(thing)}__name(isVisitable,"isVisitable");function removeBrackets(key){return utils$1.endsWith(key,"[]")?key.slice(0,-2):key}__name(removeBrackets,"removeBrackets");function renderKey(path,key,dots){return path?path.concat(key).map(__name(function(token,i2){return token=removeBrackets(token),!dots&&i2?"["+token+"]":token},"each")).join(dots?".":""):key}__name(renderKey,"renderKey");function isFlatArray(arr){return utils$1.isArray(arr)&&!arr.some(isVisitable)}__name(isFlatArray,"isFlatArray");const predicates=utils$1.toFlatObject(utils$1,{},null,__name(function(prop){return/^is[A-Z]/.test(prop)},"filter"));function toFormData$1(obj,formData,options){if(!utils$1.isObject(obj))throw new TypeError("target must be an object");formData=formData||new FormData,options=utils$1.toFlatObject(options,{metaTokens:!0,dots:!1,indexes:!1},!1,__name(function(option,source){return!utils$1.isUndefined(source[option])},"defined"));const metaTokens=options.metaTokens,visitor=options.visitor||defaultVisitor,dots=options.dots,indexes=options.indexes,useBlob=(options.Blob||typeof Blob<"u"&&Blob)&&utils$1.isSpecCompliantForm(formData);if(!utils$1.isFunction(visitor))throw new TypeError("visitor must be a function");function convertValue(value){if(value===null)return"";if(utils$1.isDate(value))return value.toISOString();if(utils$1.isBoolean(value))return value.toString();if(!useBlob&&utils$1.isBlob(value))throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");return utils$1.isArrayBuffer(value)||utils$1.isTypedArray(value)?useBlob&&typeof Blob=="function"?new Blob([value]):Buffer.from(value):value}__name(convertValue,"convertValue");function defaultVisitor(value,key,path){let arr=value;if(value&&!path&&typeof value=="object"){if(utils$1.endsWith(key,"{}"))key=metaTokens?key:key.slice(0,-2),value=JSON.stringify(value);else if(utils$1.isArray(value)&&isFlatArray(value)||(utils$1.isFileList(value)||utils$1.endsWith(key,"[]"))&&(arr=utils$1.toArray(value)))return key=removeBrackets(key),arr.forEach(__name(function(el,index2){!(utils$1.isUndefined(el)||el===null)&&formData.append(indexes===!0?renderKey([key],index2,dots):indexes===null?key:key+"[]",convertValue(el))},"each")),!1}return isVisitable(value)?!0:(formData.append(renderKey(path,key,dots),convertValue(value)),!1)}__name(defaultVisitor,"defaultVisitor");const stack=[],exposedHelpers=Object.assign(predicates,{defaultVisitor,convertValue,isVisitable});function build(value,path){if(!utils$1.isUndefined(value)){if(stack.indexOf(value)!==-1)throw Error("Circular reference detected in "+path.join("."));stack.push(value),utils$1.forEach(value,__name(function(el,key){(!(utils$1.isUndefined(el)||el===null)&&visitor.call(formData,el,utils$1.isString(key)?key.trim():key,path,exposedHelpers))===!0&&build(el,path?path.concat(key):[key])},"each")),stack.pop()}}if(__name(build,"build"),!utils$1.isObject(obj))throw new TypeError("data must be an object");return build(obj),formData}__name(toFormData$1,"toFormData$1");function encode$4(str){const charMap={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g,__name(function(match){return charMap[match]},"replacer"))}__name(encode$4,"encode$4");function AxiosURLSearchParams(params,options){this._pairs=[],params&&toFormData$1(params,this,options)}__name(AxiosURLSearchParams,"AxiosURLSearchParams");const prototype=AxiosURLSearchParams.prototype;prototype.append=__name(function(name2,value){this._pairs.push([name2,value])},"append");prototype.toString=__name(function(encoder){const _encode2=encoder?function(value){return encoder.call(this,value,encode$4)}:encode$4;return this._pairs.map(__name(function(pair){return _encode2(pair[0])+"="+_encode2(pair[1])},"each"),"").join("&")},"toString");function encode$3(val){return encodeURIComponent(val).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}__name(encode$3,"encode$3");function buildURL(url2,params,options){if(!params)return url2;const _encode2=options&&options.encode||encode$3,_options=utils$1.isFunction(options)?{serialize:options}:options,serializeFn=_options&&_options.serialize;let serializedParams;if(serializeFn?serializedParams=serializeFn(params,_options):serializedParams=utils$1.isURLSearchParams(params)?params.toString():new AxiosURLSearchParams(params,_options).toString(_encode2),serializedParams){const hashmarkIndex=url2.indexOf("#");hashmarkIndex!==-1&&(url2=url2.slice(0,hashmarkIndex)),url2+=(url2.indexOf("?")===-1?"?":"&")+serializedParams}return url2}__name(buildURL,"buildURL");const _InterceptorManager=class _InterceptorManager{constructor(){this.handlers=[]}use(fulfilled,rejected,options){return this.handlers.push({fulfilled,rejected,synchronous:options?options.synchronous:!1,runWhen:options?options.runWhen:null}),this.handlers.length-1}eject(id2){this.handlers[id2]&&(this.handlers[id2]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(fn){utils$1.forEach(this.handlers,__name(function(h2){h2!==null&&fn(h2)},"forEachHandler"))}};__name(_InterceptorManager,"InterceptorManager");let InterceptorManager=_InterceptorManager;const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$2={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",_navigator=typeof navigator=="object"&&navigator||void 0,hasStandardBrowserEnv=hasBrowserEnv&&(!_navigator||["ReactNative","NativeScript","NS"].indexOf(_navigator.product)<0),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",origin=hasBrowserEnv&&window.location.href||"http://localhost",utils=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv,navigator:_navigator,origin},Symbol.toStringTag,{value:"Module"})),platform$1={...utils,...platform$2};function toURLEncodedForm(data,options){return toFormData$1(data,new platform$1.classes.URLSearchParams,{visitor:__name(function(value,key,path,helpers){return platform$1.isNode&&utils$1.isBuffer(value)?(this.append(key,value.toString("base64")),!1):helpers.defaultVisitor.apply(this,arguments)},"visitor"),...options})}__name(toURLEncodedForm,"toURLEncodedForm");function parsePropPath(name2){return utils$1.matchAll(/\w+|\[(\w*)]/g,name2).map(match=>match[0]==="[]"?"":match[1]||match[0])}__name(parsePropPath,"parsePropPath");function arrayToObject(arr){const obj={},keys2=Object.keys(arr);let i2;const len=keys2.length;let key;for(i2=0;i2<len;i2++)key=keys2[i2],obj[key]=arr[key];return obj}__name(arrayToObject,"arrayToObject");function formDataToJSON(formData){function buildPath(path,value,target,index2){let name2=path[index2++];if(name2==="__proto__")return!0;const isNumericKey=Number.isFinite(+name2),isLast=index2>=path.length;return name2=!name2&&utils$1.isArray(target)?target.length:name2,isLast?(utils$1.hasOwnProp(target,name2)?target[name2]=[target[name2],value]:target[name2]=value,!isNumericKey):((!target[name2]||!utils$1.isObject(target[name2]))&&(target[name2]=[]),buildPath(path,value,target[name2],index2)&&utils$1.isArray(target[name2])&&(target[name2]=arrayToObject(target[name2])),!isNumericKey)}if(__name(buildPath,"buildPath"),utils$1.isFormData(formData)&&utils$1.isFunction(formData.entries)){const obj={};return utils$1.forEachEntry(formData,(name2,value)=>{buildPath(parsePropPath(name2),value,obj,0)}),obj}return null}__name(formDataToJSON,"formDataToJSON");function stringifySafely(rawValue,parser,encoder){if(utils$1.isString(rawValue))try{return(parser||JSON.parse)(rawValue),utils$1.trim(rawValue)}catch(e){if(e.name!=="SyntaxError")throw e}return(encoder||JSON.stringify)(rawValue)}__name(stringifySafely,"stringifySafely");const defaults={transitional:transitionalDefaults,adapter:["xhr","http","fetch"],transformRequest:[__name(function(data,headers){const contentType=headers.getContentType()||"",hasJSONContentType=contentType.indexOf("application/json")>-1,isObjectPayload=utils$1.isObject(data);if(isObjectPayload&&utils$1.isHTMLForm(data)&&(data=new FormData(data)),utils$1.isFormData(data))return hasJSONContentType?JSON.stringify(formDataToJSON(data)):data;if(utils$1.isArrayBuffer(data)||utils$1.isBuffer(data)||utils$1.isStream(data)||utils$1.isFile(data)||utils$1.isBlob(data)||utils$1.isReadableStream(data))return data;if(utils$1.isArrayBufferView(data))return data.buffer;if(utils$1.isURLSearchParams(data))return headers.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),data.toString();let isFileList2;if(isObjectPayload){if(contentType.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(data,this.formSerializer).toString();if((isFileList2=utils$1.isFileList(data))||contentType.indexOf("multipart/form-data")>-1){const _FormData=this.env&&this.env.FormData;return toFormData$1(isFileList2?{"files[]":data}:data,_FormData&&new _FormData,this.formSerializer)}}return isObjectPayload||hasJSONContentType?(headers.setContentType("application/json",!1),stringifySafely(data)):data},"transformRequest")],transformResponse:[__name(function(data){const transitional2=this.transitional||defaults.transitional,forcedJSONParsing=transitional2&&transitional2.forcedJSONParsing,JSONRequested=this.responseType==="json";if(utils$1.isResponse(data)||utils$1.isReadableStream(data))return data;if(data&&utils$1.isString(data)&&(forcedJSONParsing&&!this.responseType||JSONRequested)){const strictJSONParsing=!(transitional2&&transitional2.silentJSONParsing)&&JSONRequested;try{return JSON.parse(data,this.parseReviver)}catch(e){if(strictJSONParsing)throw e.name==="SyntaxError"?AxiosError$1.from(e,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response):e}}return data},"transformResponse")],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform$1.classes.FormData,Blob:platform$1.classes.Blob},validateStatus:__name(function(status){return status>=200&&status<300},"validateStatus"),headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$1.forEach(["delete","get","head","post","put","patch"],method=>{defaults.headers[method]={}});const ignoreDuplicateOf=utils$1.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"]),parseHeaders=__name(rawHeaders=>{const parsed={};let key,val,i2;return rawHeaders&&rawHeaders.split(`
|
|
3
3
|
`).forEach(__name(function(line){i2=line.indexOf(":"),key=line.substring(0,i2).trim().toLowerCase(),val=line.substring(i2+1).trim(),!(!key||parsed[key]&&ignoreDuplicateOf[key])&&(key==="set-cookie"?parsed[key]?parsed[key].push(val):parsed[key]=[val]:parsed[key]=parsed[key]?parsed[key]+", "+val:val)},"parser")),parsed},"parseHeaders"),$internals=Symbol("internals");function normalizeHeader(header){return header&&String(header).trim().toLowerCase()}__name(normalizeHeader,"normalizeHeader");function normalizeValue(value){return value===!1||value==null?value:utils$1.isArray(value)?value.map(normalizeValue):String(value)}__name(normalizeValue,"normalizeValue");function parseTokens(str){const tokens=Object.create(null),tokensRE=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let match;for(;match=tokensRE.exec(str);)tokens[match[1]]=match[2];return tokens}__name(parseTokens,"parseTokens");const isValidHeaderName=__name(str=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()),"isValidHeaderName");function matchHeaderValue(context,value,header,filter2,isHeaderNameFilter){if(utils$1.isFunction(filter2))return filter2.call(this,value,header);if(isHeaderNameFilter&&(value=header),!!utils$1.isString(value)){if(utils$1.isString(filter2))return value.indexOf(filter2)!==-1;if(utils$1.isRegExp(filter2))return filter2.test(value)}}__name(matchHeaderValue,"matchHeaderValue");function formatHeader(header){return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(w,char,str)=>char.toUpperCase()+str)}__name(formatHeader,"formatHeader");function buildAccessors(obj,header){const accessorName=utils$1.toCamelCase(" "+header);["get","set","has"].forEach(methodName=>{Object.defineProperty(obj,methodName+accessorName,{value:__name(function(arg1,arg2,arg3){return this[methodName].call(this,header,arg1,arg2,arg3)},"value"),configurable:!0})})}__name(buildAccessors,"buildAccessors");var _a2;let AxiosHeaders$1=(_a2=class{constructor(headers){headers&&this.set(headers)}set(header,valueOrRewrite,rewrite){const self2=this;function setHeader(_value,_header,_rewrite){const lHeader=normalizeHeader(_header);if(!lHeader)throw new Error("header name must be a non-empty string");const key=utils$1.findKey(self2,lHeader);(!key||self2[key]===void 0||_rewrite===!0||_rewrite===void 0&&self2[key]!==!1)&&(self2[key||_header]=normalizeValue(_value))}__name(setHeader,"setHeader");const setHeaders=__name((headers,_rewrite)=>utils$1.forEach(headers,(_value,_header)=>setHeader(_value,_header,_rewrite)),"setHeaders");if(utils$1.isPlainObject(header)||header instanceof this.constructor)setHeaders(header,valueOrRewrite);else if(utils$1.isString(header)&&(header=header.trim())&&!isValidHeaderName(header))setHeaders(parseHeaders(header),valueOrRewrite);else if(utils$1.isObject(header)&&utils$1.isIterable(header)){let obj={},dest,key;for(const entry of header){if(!utils$1.isArray(entry))throw TypeError("Object iterator must return a key-value pair");obj[key=entry[0]]=(dest=obj[key])?utils$1.isArray(dest)?[...dest,entry[1]]:[dest,entry[1]]:entry[1]}setHeaders(obj,valueOrRewrite)}else header!=null&&setHeader(valueOrRewrite,header,rewrite);return this}get(header,parser){if(header=normalizeHeader(header),header){const key=utils$1.findKey(this,header);if(key){const value=this[key];if(!parser)return value;if(parser===!0)return parseTokens(value);if(utils$1.isFunction(parser))return parser.call(this,value,key);if(utils$1.isRegExp(parser))return parser.exec(value);throw new TypeError("parser must be boolean|regexp|function")}}}has(header,matcher){if(header=normalizeHeader(header),header){const key=utils$1.findKey(this,header);return!!(key&&this[key]!==void 0&&(!matcher||matchHeaderValue(this,this[key],key,matcher)))}return!1}delete(header,matcher){const self2=this;let deleted=!1;function deleteHeader(_header){if(_header=normalizeHeader(_header),_header){const key=utils$1.findKey(self2,_header);key&&(!matcher||matchHeaderValue(self2,self2[key],key,matcher))&&(delete self2[key],deleted=!0)}}return __name(deleteHeader,"deleteHeader"),utils$1.isArray(header)?header.forEach(deleteHeader):deleteHeader(header),deleted}clear(matcher){const keys2=Object.keys(this);let i2=keys2.length,deleted=!1;for(;i2--;){const key=keys2[i2];(!matcher||matchHeaderValue(this,this[key],key,matcher,!0))&&(delete this[key],deleted=!0)}return deleted}normalize(format){const self2=this,headers={};return utils$1.forEach(this,(value,header)=>{const key=utils$1.findKey(headers,header);if(key){self2[key]=normalizeValue(value),delete self2[header];return}const normalized=format?formatHeader(header):String(header).trim();normalized!==header&&delete self2[header],self2[normalized]=normalizeValue(value),headers[normalized]=!0}),this}concat(...targets){return this.constructor.concat(this,...targets)}toJSON(asStrings){const obj=Object.create(null);return utils$1.forEach(this,(value,header)=>{value!=null&&value!==!1&&(obj[header]=asStrings&&utils$1.isArray(value)?value.join(", "):value)}),obj}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([header,value])=>header+": "+value).join(`
|
|
4
4
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(thing){return thing instanceof this?thing:new this(thing)}static concat(first,...targets){const computed=new this(first);return targets.forEach(target=>computed.set(target)),computed}static accessor(header){const accessors=(this[$internals]=this[$internals]={accessors:{}}).accessors,prototype2=this.prototype;function defineAccessor(_header){const lHeader=normalizeHeader(_header);accessors[lHeader]||(buildAccessors(prototype2,_header),accessors[lHeader]=!0)}return __name(defineAccessor,"defineAccessor"),utils$1.isArray(header)?header.forEach(defineAccessor):defineAccessor(header),this}},__name(_a2,"AxiosHeaders"),_a2);AxiosHeaders$1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils$1.reduceDescriptors(AxiosHeaders$1.prototype,({value},key)=>{let mapped=key[0].toUpperCase()+key.slice(1);return{get:__name(()=>value,"get"),set(headerValue){this[mapped]=headerValue}}});utils$1.freezeMethods(AxiosHeaders$1);function transformData(fns,response){const config2=this||defaults,context=response||config2,headers=AxiosHeaders$1.from(context.headers);let data=context.data;return utils$1.forEach(fns,__name(function(fn){data=fn.call(config2,data,headers.normalize(),response?response.status:void 0)},"transform")),headers.normalize(),data}__name(transformData,"transformData");function isCancel$1(value){return!!(value&&value.__CANCEL__)}__name(isCancel$1,"isCancel$1");var _a3;let CanceledError$1=(_a3=class extends AxiosError$1{constructor(message,config2,request){super(message??"canceled",AxiosError$1.ERR_CANCELED,config2,request),this.name="CanceledError",this.__CANCEL__=!0}},__name(_a3,"CanceledError"),_a3);function settle(resolve,reject,response){const validateStatus2=response.config.validateStatus;!response.status||!validateStatus2||validateStatus2(response.status)?resolve(response):reject(new AxiosError$1("Request failed with status code "+response.status,[AxiosError$1.ERR_BAD_REQUEST,AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status/100)-4],response.config,response.request,response))}__name(settle,"settle");function parseProtocol(url2){const match=/^([-+\w]{1,25})(:?\/\/|:)/.exec(url2);return match&&match[1]||""}__name(parseProtocol,"parseProtocol");function speedometer(samplesCount,min2){samplesCount=samplesCount||10;const bytes=new Array(samplesCount),timestamps=new Array(samplesCount);let head=0,tail=0,firstSampleTS;return min2=min2!==void 0?min2:1e3,__name(function(chunkLength){const now=Date.now(),startedAt=timestamps[tail];firstSampleTS||(firstSampleTS=now),bytes[head]=chunkLength,timestamps[head]=now;let i2=tail,bytesCount=0;for(;i2!==head;)bytesCount+=bytes[i2++],i2=i2%samplesCount;if(head=(head+1)%samplesCount,head===tail&&(tail=(tail+1)%samplesCount),now-firstSampleTS<min2)return;const passed=startedAt&&now-startedAt;return passed?Math.round(bytesCount*1e3/passed):void 0},"push")}__name(speedometer,"speedometer");function throttle$2(fn,freq){let timestamp=0,threshold=1e3/freq,lastArgs,timer;const invoke=__name((args,now=Date.now())=>{timestamp=now,lastArgs=null,timer&&(clearTimeout(timer),timer=null),fn(...args)},"invoke");return[__name((...args)=>{const now=Date.now(),passed=now-timestamp;passed>=threshold?invoke(args,now):(lastArgs=args,timer||(timer=setTimeout(()=>{timer=null,invoke(lastArgs)},threshold-passed)))},"throttled"),__name(()=>lastArgs&&invoke(lastArgs),"flush")]}__name(throttle$2,"throttle$2");const progressEventReducer=__name((listener,isDownloadStream,freq=3)=>{let bytesNotified=0;const _speedometer=speedometer(50,250);return throttle$2(e=>{const loaded=e.loaded,total=e.lengthComputable?e.total:void 0,progressBytes=loaded-bytesNotified,rate=_speedometer(progressBytes),inRange=loaded<=total;bytesNotified=loaded;const data={loaded,total,progress:total?loaded/total:void 0,bytes:progressBytes,rate:rate||void 0,estimated:rate&&total&&inRange?(total-loaded)/rate:void 0,event:e,lengthComputable:total!=null,[isDownloadStream?"download":"upload"]:!0};listener(data)},freq)},"progressEventReducer"),progressEventDecorator=__name((total,throttled)=>{const lengthComputable=total!=null;return[loaded=>throttled[0]({lengthComputable,total,loaded}),throttled[1]]},"progressEventDecorator"),asyncDecorator=__name(fn=>(...args)=>utils$1.asap(()=>fn(...args)),"asyncDecorator"),isURLSameOrigin=platform$1.hasStandardBrowserEnv?((origin2,isMSIE)=>url2=>(url2=new URL(url2,platform$1.origin),origin2.protocol===url2.protocol&&origin2.host===url2.host&&(isMSIE||origin2.port===url2.port)))(new URL(platform$1.origin),platform$1.navigator&&/(msie|trident)/i.test(platform$1.navigator.userAgent)):()=>!0,cookies=platform$1.hasStandardBrowserEnv?{write(name2,value,expires,path,domain2,secure,sameSite){if(typeof document>"u")return;const cookie=[`${name2}=${encodeURIComponent(value)}`];utils$1.isNumber(expires)&&cookie.push(`expires=${new Date(expires).toUTCString()}`),utils$1.isString(path)&&cookie.push(`path=${path}`),utils$1.isString(domain2)&&cookie.push(`domain=${domain2}`),secure===!0&&cookie.push("secure"),utils$1.isString(sameSite)&&cookie.push(`SameSite=${sameSite}`),document.cookie=cookie.join("; ")},read(name2){if(typeof document>"u")return null;const match=document.cookie.match(new RegExp("(?:^|; )"+name2+"=([^;]*)"));return match?decodeURIComponent(match[1]):null},remove(name2){this.write(name2,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(url2){return typeof url2!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2)}__name(isAbsoluteURL,"isAbsoluteURL");function combineURLs(baseURL,relativeURL){return relativeURL?baseURL.replace(/\/?\/$/,"")+"/"+relativeURL.replace(/^\/+/,""):baseURL}__name(combineURLs,"combineURLs");function buildFullPath(baseURL,requestedURL,allowAbsoluteUrls){let isRelativeUrl=!isAbsoluteURL(requestedURL);return baseURL&&(isRelativeUrl||allowAbsoluteUrls==!1)?combineURLs(baseURL,requestedURL):requestedURL}__name(buildFullPath,"buildFullPath");const headersToObject=__name(thing=>thing instanceof AxiosHeaders$1?{...thing}:thing,"headersToObject");function mergeConfig$1(config1,config2){config2=config2||{};const config3={};function getMergedValue(target,source,prop,caseless){return utils$1.isPlainObject(target)&&utils$1.isPlainObject(source)?utils$1.merge.call({caseless},target,source):utils$1.isPlainObject(source)?utils$1.merge({},source):utils$1.isArray(source)?source.slice():source}__name(getMergedValue,"getMergedValue");function mergeDeepProperties(a2,b,prop,caseless){if(utils$1.isUndefined(b)){if(!utils$1.isUndefined(a2))return getMergedValue(void 0,a2,prop,caseless)}else return getMergedValue(a2,b,prop,caseless)}__name(mergeDeepProperties,"mergeDeepProperties");function valueFromConfig2(a2,b){if(!utils$1.isUndefined(b))return getMergedValue(void 0,b)}__name(valueFromConfig2,"valueFromConfig2");function defaultToConfig2(a2,b){if(utils$1.isUndefined(b)){if(!utils$1.isUndefined(a2))return getMergedValue(void 0,a2)}else return getMergedValue(void 0,b)}__name(defaultToConfig2,"defaultToConfig2");function mergeDirectKeys(a2,b,prop){if(prop in config2)return getMergedValue(a2,b);if(prop in config1)return getMergedValue(void 0,a2)}__name(mergeDirectKeys,"mergeDirectKeys");const mergeMap={url:valueFromConfig2,method:valueFromConfig2,data:valueFromConfig2,baseURL:defaultToConfig2,transformRequest:defaultToConfig2,transformResponse:defaultToConfig2,paramsSerializer:defaultToConfig2,timeout:defaultToConfig2,timeoutMessage:defaultToConfig2,withCredentials:defaultToConfig2,withXSRFToken:defaultToConfig2,adapter:defaultToConfig2,responseType:defaultToConfig2,xsrfCookieName:defaultToConfig2,xsrfHeaderName:defaultToConfig2,onUploadProgress:defaultToConfig2,onDownloadProgress:defaultToConfig2,decompress:defaultToConfig2,maxContentLength:defaultToConfig2,maxBodyLength:defaultToConfig2,beforeRedirect:defaultToConfig2,transport:defaultToConfig2,httpAgent:defaultToConfig2,httpsAgent:defaultToConfig2,cancelToken:defaultToConfig2,socketPath:defaultToConfig2,responseEncoding:defaultToConfig2,validateStatus:mergeDirectKeys,headers:__name((a2,b,prop)=>mergeDeepProperties(headersToObject(a2),headersToObject(b),prop,!0),"headers")};return utils$1.forEach(Object.keys({...config1,...config2}),__name(function(prop){if(prop==="__proto__"||prop==="constructor"||prop==="prototype")return;const merge2=utils$1.hasOwnProp(mergeMap,prop)?mergeMap[prop]:mergeDeepProperties,configValue=merge2(config1[prop],config2[prop],prop);utils$1.isUndefined(configValue)&&merge2!==mergeDirectKeys||(config3[prop]=configValue)},"computeConfigValue")),config3}__name(mergeConfig$1,"mergeConfig$1");const resolveConfig=__name(config2=>{const newConfig=mergeConfig$1({},config2);let{data,withXSRFToken,xsrfHeaderName,xsrfCookieName,headers,auth}=newConfig;if(newConfig.headers=headers=AxiosHeaders$1.from(headers),newConfig.url=buildURL(buildFullPath(newConfig.baseURL,newConfig.url,newConfig.allowAbsoluteUrls),config2.params,config2.paramsSerializer),auth&&headers.set("Authorization","Basic "+btoa((auth.username||"")+":"+(auth.password?unescape(encodeURIComponent(auth.password)):""))),utils$1.isFormData(data)){if(platform$1.hasStandardBrowserEnv||platform$1.hasStandardBrowserWebWorkerEnv)headers.setContentType(void 0);else if(utils$1.isFunction(data.getHeaders)){const formHeaders=data.getHeaders(),allowedHeaders=["content-type","content-length"];Object.entries(formHeaders).forEach(([key,val])=>{allowedHeaders.includes(key.toLowerCase())&&headers.set(key,val)})}}if(platform$1.hasStandardBrowserEnv&&(withXSRFToken&&utils$1.isFunction(withXSRFToken)&&(withXSRFToken=withXSRFToken(newConfig)),withXSRFToken||withXSRFToken!==!1&&isURLSameOrigin(newConfig.url))){const xsrfValue=xsrfHeaderName&&xsrfCookieName&&cookies.read(xsrfCookieName);xsrfValue&&headers.set(xsrfHeaderName,xsrfValue)}return newConfig},"resolveConfig"),isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(config2){return new Promise(__name(function(resolve,reject){const _config=resolveConfig(config2);let requestData=_config.data;const requestHeaders=AxiosHeaders$1.from(_config.headers).normalize();let{responseType,onUploadProgress,onDownloadProgress}=_config,onCanceled,uploadThrottled,downloadThrottled,flushUpload,flushDownload;function done(){flushUpload&&flushUpload(),flushDownload&&flushDownload(),_config.cancelToken&&_config.cancelToken.unsubscribe(onCanceled),_config.signal&&_config.signal.removeEventListener("abort",onCanceled)}__name(done,"done");let request=new XMLHttpRequest;request.open(_config.method.toUpperCase(),_config.url,!0),request.timeout=_config.timeout;function onloadend(){if(!request)return;const responseHeaders=AxiosHeaders$1.from("getAllResponseHeaders"in request&&request.getAllResponseHeaders()),response={data:!responseType||responseType==="text"||responseType==="json"?request.responseText:request.response,status:request.status,statusText:request.statusText,headers:responseHeaders,config:config2,request};settle(__name(function(value){resolve(value),done()},"_resolve"),__name(function(err){reject(err),done()},"_reject"),response),request=null}__name(onloadend,"onloadend"),"onloadend"in request?request.onloadend=onloadend:request.onreadystatechange=__name(function(){!request||request.readyState!==4||request.status===0&&!(request.responseURL&&request.responseURL.indexOf("file:")===0)||setTimeout(onloadend)},"handleLoad"),request.onabort=__name(function(){request&&(reject(new AxiosError$1("Request aborted",AxiosError$1.ECONNABORTED,config2,request)),request=null)},"handleAbort"),request.onerror=__name(function(event){const msg=event&&event.message?event.message:"Network Error",err=new AxiosError$1(msg,AxiosError$1.ERR_NETWORK,config2,request);err.event=event||null,reject(err),request=null},"handleError"),request.ontimeout=__name(function(){let timeoutErrorMessage=_config.timeout?"timeout of "+_config.timeout+"ms exceeded":"timeout exceeded";const transitional2=_config.transitional||transitionalDefaults;_config.timeoutErrorMessage&&(timeoutErrorMessage=_config.timeoutErrorMessage),reject(new AxiosError$1(timeoutErrorMessage,transitional2.clarifyTimeoutError?AxiosError$1.ETIMEDOUT:AxiosError$1.ECONNABORTED,config2,request)),request=null},"handleTimeout"),requestData===void 0&&requestHeaders.setContentType(null),"setRequestHeader"in request&&utils$1.forEach(requestHeaders.toJSON(),__name(function(val,key){request.setRequestHeader(key,val)},"setRequestHeader")),utils$1.isUndefined(_config.withCredentials)||(request.withCredentials=!!_config.withCredentials),responseType&&responseType!=="json"&&(request.responseType=_config.responseType),onDownloadProgress&&([downloadThrottled,flushDownload]=progressEventReducer(onDownloadProgress,!0),request.addEventListener("progress",downloadThrottled)),onUploadProgress&&request.upload&&([uploadThrottled,flushUpload]=progressEventReducer(onUploadProgress),request.upload.addEventListener("progress",uploadThrottled),request.upload.addEventListener("loadend",flushUpload)),(_config.cancelToken||_config.signal)&&(onCanceled=__name(cancel=>{request&&(reject(!cancel||cancel.type?new CanceledError$1(null,config2,request):cancel),request.abort(),request=null)},"onCanceled"),_config.cancelToken&&_config.cancelToken.subscribe(onCanceled),_config.signal&&(_config.signal.aborted?onCanceled():_config.signal.addEventListener("abort",onCanceled)));const protocol=parseProtocol(_config.url);if(protocol&&platform$1.protocols.indexOf(protocol)===-1){reject(new AxiosError$1("Unsupported protocol "+protocol+":",AxiosError$1.ERR_BAD_REQUEST,config2));return}request.send(requestData||null)},"dispatchXhrRequest"))},composeSignals=__name((signals,timeout)=>{const{length}=signals=signals?signals.filter(Boolean):[];if(timeout||length){let controller=new AbortController,aborted2;const onabort=__name(function(reason){if(!aborted2){aborted2=!0,unsubscribe();const err=reason instanceof Error?reason:this.reason;controller.abort(err instanceof AxiosError$1?err:new CanceledError$1(err instanceof Error?err.message:err))}},"onabort");let timer=timeout&&setTimeout(()=>{timer=null,onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`,AxiosError$1.ETIMEDOUT))},timeout);const unsubscribe=__name(()=>{signals&&(timer&&clearTimeout(timer),timer=null,signals.forEach(signal2=>{signal2.unsubscribe?signal2.unsubscribe(onabort):signal2.removeEventListener("abort",onabort)}),signals=null)},"unsubscribe");signals.forEach(signal2=>signal2.addEventListener("abort",onabort));const{signal}=controller;return signal.unsubscribe=()=>utils$1.asap(unsubscribe),signal}},"composeSignals"),streamChunk=__name(function*(chunk,chunkSize){let len=chunk.byteLength;if(len<chunkSize){yield chunk;return}let pos=0,end;for(;pos<len;)end=pos+chunkSize,yield chunk.slice(pos,end),pos=end},"streamChunk"),readBytes=__name(async function*(iterable,chunkSize){for await(const chunk of readStream(iterable))yield*streamChunk(chunk,chunkSize)},"readBytes"),readStream=__name(async function*(stream){if(stream[Symbol.asyncIterator]){yield*stream;return}const reader=stream.getReader();try{for(;;){const{done,value}=await reader.read();if(done)break;yield value}}finally{await reader.cancel()}},"readStream"),trackStream=__name((stream,chunkSize,onProgress,onFinish)=>{const iterator2=readBytes(stream,chunkSize);let bytes=0,done,_onFinish=__name(e=>{done||(done=!0,onFinish&&onFinish(e))},"_onFinish");return new ReadableStream({async pull(controller){try{const{done:done2,value}=await iterator2.next();if(done2){_onFinish(),controller.close();return}let len=value.byteLength;if(onProgress){let loadedBytes=bytes+=len;onProgress(loadedBytes)}controller.enqueue(new Uint8Array(value))}catch(err){throw _onFinish(err),err}},cancel(reason){return _onFinish(reason),iterator2.return()}},{highWaterMark:2})},"trackStream"),DEFAULT_CHUNK_SIZE=64*1024,{isFunction:isFunction$5}=utils$1,globalFetchAPI=(({Request:Request2,Response:Response2})=>({Request:Request2,Response:Response2}))(utils$1.global),{ReadableStream:ReadableStream$1,TextEncoder:TextEncoder$1}=utils$1.global,test=__name((fn,...args)=>{try{return!!fn(...args)}catch{return!1}},"test"),factory=__name(env2=>{env2=utils$1.merge.call({skipUndefined:!0},globalFetchAPI,env2);const{fetch:envFetch,Request:Request2,Response:Response2}=env2,isFetchSupported=envFetch?isFunction$5(envFetch):typeof fetch=="function",isRequestSupported=isFunction$5(Request2),isResponseSupported=isFunction$5(Response2);if(!isFetchSupported)return!1;const isReadableStreamSupported=isFetchSupported&&isFunction$5(ReadableStream$1),encodeText=isFetchSupported&&(typeof TextEncoder$1=="function"?(encoder=>str=>encoder.encode(str))(new TextEncoder$1):async str=>new Uint8Array(await new Request2(str).arrayBuffer())),supportsRequestStream=isRequestSupported&&isReadableStreamSupported&&test(()=>{let duplexAccessed=!1;const hasContentType=new Request2(platform$1.origin,{body:new ReadableStream$1,method:"POST",get duplex(){return duplexAccessed=!0,"half"}}).headers.has("Content-Type");return duplexAccessed&&!hasContentType}),supportsResponseStream=isResponseSupported&&isReadableStreamSupported&&test(()=>utils$1.isReadableStream(new Response2("").body)),resolvers={stream:supportsResponseStream&&(res=>res.body)};isFetchSupported&&["text","arrayBuffer","blob","formData","stream"].forEach(type=>{!resolvers[type]&&(resolvers[type]=(res,config2)=>{let method=res&&res[type];if(method)return method.call(res);throw new AxiosError$1(`Response type '${type}' is not supported`,AxiosError$1.ERR_NOT_SUPPORT,config2)})});const getBodyLength=__name(async body=>{if(body==null)return 0;if(utils$1.isBlob(body))return body.size;if(utils$1.isSpecCompliantForm(body))return(await new Request2(platform$1.origin,{method:"POST",body}).arrayBuffer()).byteLength;if(utils$1.isArrayBufferView(body)||utils$1.isArrayBuffer(body))return body.byteLength;if(utils$1.isURLSearchParams(body)&&(body=body+""),utils$1.isString(body))return(await encodeText(body)).byteLength},"getBodyLength"),resolveBodyLength=__name(async(headers,body)=>{const length=utils$1.toFiniteNumber(headers.getContentLength());return length??getBodyLength(body)},"resolveBodyLength");return async config2=>{let{url:url2,method,data,signal,cancelToken,timeout,onDownloadProgress,onUploadProgress,responseType,headers,withCredentials="same-origin",fetchOptions}=resolveConfig(config2),_fetch=envFetch||fetch;responseType=responseType?(responseType+"").toLowerCase():"text";let composedSignal=composeSignals([signal,cancelToken&&cancelToken.toAbortSignal()],timeout),request=null;const unsubscribe=composedSignal&&composedSignal.unsubscribe&&(()=>{composedSignal.unsubscribe()});let requestContentLength;try{if(onUploadProgress&&supportsRequestStream&&method!=="get"&&method!=="head"&&(requestContentLength=await resolveBodyLength(headers,data))!==0){let _request=new Request2(url2,{method:"POST",body:data,duplex:"half"}),contentTypeHeader;if(utils$1.isFormData(data)&&(contentTypeHeader=_request.headers.get("content-type"))&&headers.setContentType(contentTypeHeader),_request.body){const[onProgress,flush]=progressEventDecorator(requestContentLength,progressEventReducer(asyncDecorator(onUploadProgress)));data=trackStream(_request.body,DEFAULT_CHUNK_SIZE,onProgress,flush)}}utils$1.isString(withCredentials)||(withCredentials=withCredentials?"include":"omit");const isCredentialsSupported=isRequestSupported&&"credentials"in Request2.prototype,resolvedOptions={...fetchOptions,signal:composedSignal,method:method.toUpperCase(),headers:headers.normalize().toJSON(),body:data,duplex:"half",credentials:isCredentialsSupported?withCredentials:void 0};request=isRequestSupported&&new Request2(url2,resolvedOptions);let response=await(isRequestSupported?_fetch(request,fetchOptions):_fetch(url2,resolvedOptions));const isStreamResponse=supportsResponseStream&&(responseType==="stream"||responseType==="response");if(supportsResponseStream&&(onDownloadProgress||isStreamResponse&&unsubscribe)){const options={};["status","statusText","headers"].forEach(prop=>{options[prop]=response[prop]});const responseContentLength=utils$1.toFiniteNumber(response.headers.get("content-length")),[onProgress,flush]=onDownloadProgress&&progressEventDecorator(responseContentLength,progressEventReducer(asyncDecorator(onDownloadProgress),!0))||[];response=new Response2(trackStream(response.body,DEFAULT_CHUNK_SIZE,onProgress,()=>{flush&&flush(),unsubscribe&&unsubscribe()}),options)}responseType=responseType||"text";let responseData=await resolvers[utils$1.findKey(resolvers,responseType)||"text"](response,config2);return!isStreamResponse&&unsubscribe&&unsubscribe(),await new Promise((resolve,reject)=>{settle(resolve,reject,{data:responseData,headers:AxiosHeaders$1.from(response.headers),status:response.status,statusText:response.statusText,config:config2,request})})}catch(err){throw unsubscribe&&unsubscribe(),err&&err.name==="TypeError"&&/Load failed|fetch/i.test(err.message)?Object.assign(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,config2,request,err&&err.response),{cause:err.cause||err}):AxiosError$1.from(err,err&&err.code,config2,request,err&&err.response)}}},"factory"),seedCache=new Map,getFetch=__name(config2=>{let env2=config2&&config2.env||{};const{fetch:fetch2,Request:Request2,Response:Response2}=env2,seeds=[Request2,Response2,fetch2];let len=seeds.length,i2=len,seed,target,map2=seedCache;for(;i2--;)seed=seeds[i2],target=map2.get(seed),target===void 0&&map2.set(seed,target=i2?new Map:factory(env2)),map2=target;return target},"getFetch");getFetch();const knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:{get:getFetch}};utils$1.forEach(knownAdapters,(fn,value)=>{if(fn){try{Object.defineProperty(fn,"name",{value})}catch{}Object.defineProperty(fn,"adapterName",{value})}});const renderReason=__name(reason=>`- ${reason}`,"renderReason"),isResolvedHandle=__name(adapter=>utils$1.isFunction(adapter)||adapter===null||adapter===!1,"isResolvedHandle");function getAdapter$1(adapters2,config2){adapters2=utils$1.isArray(adapters2)?adapters2:[adapters2];const{length}=adapters2;let nameOrAdapter,adapter;const rejectedReasons={};for(let i2=0;i2<length;i2++){nameOrAdapter=adapters2[i2];let id2;if(adapter=nameOrAdapter,!isResolvedHandle(nameOrAdapter)&&(adapter=knownAdapters[(id2=String(nameOrAdapter)).toLowerCase()],adapter===void 0))throw new AxiosError$1(`Unknown adapter '${id2}'`);if(adapter&&(utils$1.isFunction(adapter)||(adapter=adapter.get(config2))))break;rejectedReasons[id2||"#"+i2]=adapter}if(!adapter){const reasons=Object.entries(rejectedReasons).map(([id2,state2])=>`adapter ${id2} `+(state2===!1?"is not supported by the environment":"is not available in the build"));let s2=length?reasons.length>1?`since :
|
|
@@ -35,7 +35,7 @@ ${serializedMessage}`,realMessageBytesCount=>{flushController.notifyAfterAddMess
|
|
|
35
35
|
`);upsertBuffer={};const pageMightExit=isPageExitReason(event.reason),send2=pageMightExit?request.sendOnExit:request.send;if(pageMightExit&&encoder.isAsync){const encoderResult=encoder.finishSync();encoderResult.outputBytesCount&&send2(formatPayloadFromEncoder(encoderResult));const pendingMessages=[encoderResult.pendingData,upsertMessages].filter(Boolean).join(`
|
|
36
36
|
`);pendingMessages&&send2({data:pendingMessages,bytesCount:computeBytesCount(pendingMessages)})}else upsertMessages&&encoder.write(encoder.isEmpty?upsertMessages:`
|
|
37
37
|
${upsertMessages}`),encoder.finish(encoderResult=>{send2(formatPayloadFromEncoder(encoderResult))})}return __name(flush,"flush"),{flushController,add:addOrUpdate,upsert:addOrUpdate,stop:flushSubscription.unsubscribe}}__name(createBatch,"createBatch");function formatPayloadFromEncoder(encoderResult){let data;return typeof encoderResult.output=="string"?data=encoderResult.output:data=new Blob([encoderResult.output],{type:"text/plain"}),{data,bytesCount:encoderResult.outputBytesCount,encoding:encoderResult.encoding}}__name(formatPayloadFromEncoder,"formatPayloadFromEncoder");const FLUSH_DURATION_LIMIT=30*ONE_SECOND,MESSAGES_LIMIT=isWorkerEnvironment?1:50;function createFlushController({pageMayExitObservable,sessionExpireObservable}){const pageMayExitSubscription=pageMayExitObservable.subscribe(event=>flush(event.reason)),sessionExpireSubscription=sessionExpireObservable.subscribe(()=>flush("session_expire")),flushObservable=new Observable(()=>()=>{pageMayExitSubscription.unsubscribe(),sessionExpireSubscription.unsubscribe()});let currentBytesCount=0,currentMessagesCount=0;function flush(flushReason){if(currentMessagesCount===0)return;const messagesCount=currentMessagesCount,bytesCount=currentBytesCount;currentMessagesCount=0,currentBytesCount=0,cancelDurationLimitTimeout(),flushObservable.notify({reason:flushReason,messagesCount,bytesCount})}__name(flush,"flush");let durationLimitTimeoutId;function scheduleDurationLimitTimeout(){durationLimitTimeoutId===void 0&&(durationLimitTimeoutId=setTimeout$1(()=>{flush("duration_limit")},FLUSH_DURATION_LIMIT))}__name(scheduleDurationLimitTimeout,"scheduleDurationLimitTimeout");function cancelDurationLimitTimeout(){clearTimeout$1(durationLimitTimeoutId),durationLimitTimeoutId=void 0}return __name(cancelDurationLimitTimeout,"cancelDurationLimitTimeout"),{flushObservable,get messagesCount(){return currentMessagesCount},notifyBeforeAddMessage(estimatedMessageBytesCount){currentBytesCount+estimatedMessageBytesCount>=RECOMMENDED_REQUEST_BYTES_LIMIT&&flush("bytes_limit"),currentMessagesCount+=1,currentBytesCount+=estimatedMessageBytesCount,scheduleDurationLimitTimeout()},notifyAfterAddMessage(messageBytesCountDiff=0){currentBytesCount+=messageBytesCountDiff,currentMessagesCount>=MESSAGES_LIMIT?flush("messages_limit"):currentBytesCount>=RECOMMENDED_REQUEST_BYTES_LIMIT&&flush("bytes_limit")},notifyAfterRemoveMessage(messageBytesCount){currentBytesCount-=messageBytesCount,currentMessagesCount-=1,currentMessagesCount===0&&cancelDurationLimitTimeout()}}}__name(createFlushController,"createFlushController");function createIdentityEncoder(){let output="",outputBytesCount=0;return{isAsync:!1,get isEmpty(){return!output},write(data,callback){const additionalEncodedBytesCount=computeBytesCount(data);outputBytesCount+=additionalEncodedBytesCount,output+=data,callback&&callback(additionalEncodedBytesCount)},finish(callback){callback(this.finishSync())},finishSync(){const result={output,outputBytesCount,rawBytesCount:outputBytesCount,pendingData:""};return output="",outputBytesCount=0,result},estimateEncodedBytesCount(data){return data.length}}}__name(createIdentityEncoder,"createIdentityEncoder");const DISCARDED="DISCARDED",SKIPPED="SKIPPED";function abstractHooks(){const callbacks={};return{register(hookName,callback){return callbacks[hookName]||(callbacks[hookName]=[]),callbacks[hookName].push(callback),{unregister:__name(()=>{callbacks[hookName]=callbacks[hookName].filter(cb=>cb!==callback)},"unregister")}},triggerHook(hookName,param){const hookCallbacks=callbacks[hookName]||[],results=[];for(const callback of hookCallbacks){const result=callback(param);if(result===DISCARDED)return DISCARDED;result!==SKIPPED&&results.push(result)}return combine(...results)}}}__name(abstractHooks,"abstractHooks");const TelemetryType={LOG:"log",CONFIGURATION:"configuration",USAGE:"usage"},ALLOWED_FRAME_URLS=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],METRIC_SAMPLE_RATE=1,TELEMETRY_EXCLUDED_SITES=[INTAKE_SITE_US1_FED],MAX_TELEMETRY_EVENTS_PER_PAGE=15;let telemetryObservable;function getTelemetryObservable(){return telemetryObservable||(telemetryObservable=new BufferedObservable(100)),telemetryObservable}__name(getTelemetryObservable,"getTelemetryObservable");function startTelemetry(telemetryService,configuration,hooks){const observable=new Observable,{enabled,metricsEnabled}=startTelemetryCollection(telemetryService,configuration,hooks,observable),{stop}=startTelemetryTransport(configuration,observable);return{stop,enabled,metricsEnabled}}__name(startTelemetry,"startTelemetry");function startTelemetryCollection(telemetryService,configuration,hooks,observable,metricSampleRate=METRIC_SAMPLE_RATE,maxTelemetryEventsPerPage=MAX_TELEMETRY_EVENTS_PER_PAGE){const alreadySentEventsByKind={},telemetryEnabled=!TELEMETRY_EXCLUDED_SITES.includes(configuration.site)&&performDraw(configuration.telemetrySampleRate),telemetryEnabledPerType={[TelemetryType.LOG]:telemetryEnabled,[TelemetryType.CONFIGURATION]:telemetryEnabled&&performDraw(configuration.telemetryConfigurationSampleRate),[TelemetryType.USAGE]:telemetryEnabled&&performDraw(configuration.telemetryUsageSampleRate),metric:telemetryEnabled&&performDraw(metricSampleRate)},runtimeEnvInfo=getRuntimeEnvInfo(),telemetryObservable2=getTelemetryObservable();return telemetryObservable2.subscribe(({rawEvent,metricName})=>{if(metricName&&!telemetryEnabledPerType.metric||!telemetryEnabledPerType[rawEvent.type])return;const kind=metricName||rawEvent.status||rawEvent.type;let alreadySentEvents=alreadySentEventsByKind[kind];if(alreadySentEvents||(alreadySentEvents=alreadySentEventsByKind[kind]=new Set),alreadySentEvents.size>=maxTelemetryEventsPerPage)return;const stringifiedEvent=jsonStringify(rawEvent);if(alreadySentEvents.has(stringifiedEvent))return;const defaultTelemetryEventAttributes=hooks.triggerHook(1,{startTime:clocksNow().relative});if(defaultTelemetryEventAttributes===DISCARDED)return;const event=toTelemetryEvent(defaultTelemetryEventAttributes,telemetryService,rawEvent,runtimeEnvInfo);observable.notify(event),sendToExtension("telemetry",event),alreadySentEvents.add(stringifiedEvent)}),telemetryObservable2.unbuffer(),startMonitorErrorCollection(addTelemetryError),{enabled:telemetryEnabled,metricsEnabled:telemetryEnabledPerType.metric};function toTelemetryEvent(defaultTelemetryEventAttributes,telemetryService2,rawEvent,runtimeEnvInfo2){const event={type:"telemetry",date:clocksNow().timeStamp,service:telemetryService2,version:"6.28.1",source:"browser",_dd:{format_version:2},telemetry:combine(rawEvent,{runtime_env:runtimeEnvInfo2,connectivity:getConnectivity(),sdk_setup:"npm"}),ddtags:buildTags(configuration).join(","),experimental_features:Array.from(getExperimentalFeatures())};return combine(event,defaultTelemetryEventAttributes)}__name(toTelemetryEvent,"toTelemetryEvent")}__name(startTelemetryCollection,"startTelemetryCollection");function startTelemetryTransport(configuration,telemetryObservable2){const cleanupTasks2=[];if(canUseEventBridge()){const bridge=getEventBridge(),telemetrySubscription=telemetryObservable2.subscribe(event=>bridge.send("internal_telemetry",event));cleanupTasks2.push(telemetrySubscription.unsubscribe)}else{const endpoints=[configuration.rumEndpointBuilder];configuration.replica&&isTelemetryReplicationAllowed(configuration)&&endpoints.push(configuration.replica.rumEndpointBuilder);const telemetryBatch=createBatch({encoder:createIdentityEncoder(),request:createHttpRequest(endpoints,noop$2),flushController:createFlushController({pageMayExitObservable:createPageMayExitObservable(configuration),sessionExpireObservable:new Observable})});cleanupTasks2.push(telemetryBatch.stop);const telemetrySubscription=telemetryObservable2.subscribe(telemetryBatch.add);cleanupTasks2.push(telemetrySubscription.unsubscribe)}return{stop:__name(()=>cleanupTasks2.forEach(task=>task()),"stop")}}__name(startTelemetryTransport,"startTelemetryTransport");function getRuntimeEnvInfo(){var _a20;return{is_local_file:((_a20=globalObject.location)===null||_a20===void 0?void 0:_a20.protocol)==="file:",is_worker:isWorkerEnvironment}}__name(getRuntimeEnvInfo,"getRuntimeEnvInfo");function isTelemetryReplicationAllowed(configuration){return configuration.site===INTAKE_SITE_STAGING}__name(isTelemetryReplicationAllowed,"isTelemetryReplicationAllowed");function addTelemetryDebug(message,context){displayIfDebugEnabled(ConsoleApiName.debug,message,context),getTelemetryObservable().notify({rawEvent:{type:TelemetryType.LOG,message,status:"debug",...context}})}__name(addTelemetryDebug,"addTelemetryDebug");function addTelemetryError(e,context){getTelemetryObservable().notify({rawEvent:{type:TelemetryType.LOG,status:"error",...formatError$1(e),...context}})}__name(addTelemetryError,"addTelemetryError");function addTelemetryConfiguration(configuration){getTelemetryObservable().notify({rawEvent:{type:TelemetryType.CONFIGURATION,configuration}})}__name(addTelemetryConfiguration,"addTelemetryConfiguration");function addTelemetryMetrics(metricName,context){getTelemetryObservable().notify({rawEvent:{type:TelemetryType.LOG,message:metricName,status:"debug",...context},metricName})}__name(addTelemetryMetrics,"addTelemetryMetrics");function addTelemetryUsage(usage){getTelemetryObservable().notify({rawEvent:{type:TelemetryType.USAGE,usage}})}__name(addTelemetryUsage,"addTelemetryUsage");function formatError$1(e){if(isError(e)){const stackTrace=computeStackTrace(e);return{error:{kind:stackTrace.name,stack:toStackTraceString(scrubCustomerFrames(stackTrace))},message:stackTrace.message}}return{error:{stack:NO_ERROR_STACK_PRESENT_MESSAGE},message:`Uncaught ${jsonStringify(e)}`}}__name(formatError$1,"formatError$1");function scrubCustomerFrames(stackTrace){return stackTrace.stack=stackTrace.stack.filter(frame=>!frame.url||ALLOWED_FRAME_URLS.some(allowedFrameUrl=>frame.url.startsWith(allowedFrameUrl))),stackTrace}__name(scrubCustomerFrames,"scrubCustomerFrames");function removeItem(array2,item){const index2=array2.indexOf(item);index2>=0&&array2.splice(index2,1)}__name(removeItem,"removeItem");function isNonEmptyArray(value){return Array.isArray(value)&&value.length>0}__name(isNonEmptyArray,"isNonEmptyArray");const END_OF_TIMES=1/0,CLEAR_OLD_VALUES_INTERVAL=ONE_MINUTE;let cleanupHistoriesInterval;const cleanupTasks=new Set;function cleanupHistories(){cleanupTasks.forEach(task=>task())}__name(cleanupHistories,"cleanupHistories");function createValueHistory({expireDelay,maxEntries}){let entries=[];cleanupHistoriesInterval||(cleanupHistoriesInterval=setInterval$1(()=>cleanupHistories(),CLEAR_OLD_VALUES_INTERVAL));const clearExpiredValues=__name(()=>{const oldTimeThreshold=relativeNow()-expireDelay;for(;entries.length>0&&entries[entries.length-1].endTime<oldTimeThreshold;)entries.pop()},"clearExpiredValues");cleanupTasks.add(clearExpiredValues);function add(value,startTime){const entry={value,startTime,endTime:END_OF_TIMES,remove:__name(()=>{removeItem(entries,entry)},"remove"),close:__name(endTime2=>{entry.endTime=endTime2},"close")};return maxEntries&&entries.length>=maxEntries&&entries.pop(),entries.unshift(entry),entry}__name(add,"add");function find2(startTime=END_OF_TIMES,options={returnInactive:!1}){for(const entry of entries)if(entry.startTime<=startTime){if(options.returnInactive||startTime<=entry.endTime)return entry.value;break}}__name(find2,"find");function closeActive(endTime2){const latestEntry=entries[0];latestEntry&&latestEntry.endTime===END_OF_TIMES&&latestEntry.close(endTime2)}__name(closeActive,"closeActive");function findAll(startTime=END_OF_TIMES,duration2=0){const endTime2=addDuration(startTime,duration2);return entries.filter(entry=>entry.startTime<=endTime2&&startTime<=entry.endTime).map(entry=>entry.value)}__name(findAll,"findAll");function reset(){entries=[]}__name(reset,"reset");function stop(){cleanupTasks.delete(clearExpiredValues),cleanupTasks.size===0&&cleanupHistoriesInterval&&(clearInterval$1(cleanupHistoriesInterval),cleanupHistoriesInterval=void 0)}return __name(stop,"stop"),{add,find:find2,closeActive,findAll,reset,stop}}__name(createValueHistory,"createValueHistory");const SYNTHETICS_TEST_ID_COOKIE_NAME="datadog-synthetics-public-id",SYNTHETICS_RESULT_ID_COOKIE_NAME="datadog-synthetics-result-id",SYNTHETICS_INJECTS_RUM_COOKIE_NAME="datadog-synthetics-injects-rum";function willSyntheticsInjectRum(){return isWorkerEnvironment?!1:!!(globalObject._DATADOG_SYNTHETICS_INJECTS_RUM||getInitCookie(SYNTHETICS_INJECTS_RUM_COOKIE_NAME))}__name(willSyntheticsInjectRum,"willSyntheticsInjectRum");function getSyntheticsTestId(){const value=window._DATADOG_SYNTHETICS_PUBLIC_ID||getInitCookie(SYNTHETICS_TEST_ID_COOKIE_NAME);return typeof value=="string"?value:void 0}__name(getSyntheticsTestId,"getSyntheticsTestId");function getSyntheticsResultId(){const value=window._DATADOG_SYNTHETICS_RESULT_ID||getInitCookie(SYNTHETICS_RESULT_ID_COOKIE_NAME);return typeof value=="string"?value:void 0}__name(getSyntheticsResultId,"getSyntheticsResultId");function isSyntheticsTest(){return!!(getSyntheticsTestId()&&getSyntheticsResultId())}__name(isSyntheticsTest,"isSyntheticsTest");const VISIBILITY_CHECK_DELAY=ONE_MINUTE,SESSION_CONTEXT_TIMEOUT_DELAY=SESSION_TIME_OUT_DELAY;function startSessionManager(configuration,productKey,computeTrackingType2,trackingConsentState){const renewObservable=new Observable,expireObservable=new Observable,sessionStore=startSessionStore(configuration.sessionStoreStrategyType,configuration,productKey,computeTrackingType2),sessionContextHistory=createValueHistory({expireDelay:SESSION_CONTEXT_TIMEOUT_DELAY});if(sessionStore.renewObservable.subscribe(()=>{sessionContextHistory.add(buildSessionContext(),relativeNow()),renewObservable.notify()}),sessionStore.expireObservable.subscribe(()=>{expireObservable.notify(),sessionContextHistory.closeActive(relativeNow())}),sessionStore.expandOrRenewSession(),sessionContextHistory.add(buildSessionContext(),clocksOrigin().relative),isExperimentalFeatureEnabled(ExperimentalFeature.SHORT_SESSION_INVESTIGATION)){const session=sessionStore.getSession();session&&detectSessionIdChange(configuration,session)}trackingConsentState.observable.subscribe(()=>{trackingConsentState.isGranted()?sessionStore.expandOrRenewSession():sessionStore.expire(!1)}),trackActivity(configuration,()=>{trackingConsentState.isGranted()&&sessionStore.expandOrRenewSession()}),trackVisibility(configuration,()=>sessionStore.expandSession()),trackResume(configuration,()=>sessionStore.restartSession());function buildSessionContext(){const session=sessionStore.getSession();return session?{id:session.id,trackingType:session[productKey],isReplayForced:!!session.forcedReplay,anonymousId:session.anonymousId}:(reportUnexpectedSessionState(configuration).catch(()=>{}),{id:"invalid",trackingType:SESSION_NOT_TRACKED,isReplayForced:!1,anonymousId:void 0})}return __name(buildSessionContext,"buildSessionContext"),{findSession:__name((startTime,options)=>sessionContextHistory.find(startTime,options),"findSession"),renewObservable,expireObservable,sessionStateUpdateObservable:sessionStore.sessionStateUpdateObservable,expire:sessionStore.expire,updateSessionState:sessionStore.updateSessionState}}__name(startSessionManager,"startSessionManager");function trackActivity(configuration,expandOrRenewSession){const{stop}=addEventListeners(configuration,window,["click","touchstart","keydown","scroll"],expandOrRenewSession,{capture:!0,passive:!0})}__name(trackActivity,"trackActivity");function trackVisibility(configuration,expandSession){const expandSessionWhenVisible=__name(()=>{document.visibilityState==="visible"&&expandSession()},"expandSessionWhenVisible"),{stop}=addEventListener(configuration,document,"visibilitychange",expandSessionWhenVisible);setInterval$1(expandSessionWhenVisible,VISIBILITY_CHECK_DELAY)}__name(trackVisibility,"trackVisibility");function trackResume(configuration,cb){const{stop}=addEventListener(configuration,window,"resume",cb,{capture:!0})}__name(trackResume,"trackResume");async function reportUnexpectedSessionState(configuration){const sessionStoreStrategyType=configuration.sessionStoreStrategyType;if(!sessionStoreStrategyType)return;let rawSession,cookieContext;sessionStoreStrategyType.type===SessionPersistence.COOKIE?(rawSession=retrieveSessionCookie(sessionStoreStrategyType.cookieOptions,configuration),cookieContext={cookie:await getSessionCookies(),currentDomain:`${window.location.protocol}//${window.location.hostname}`}):rawSession=retrieveSessionFromLocalStorage(),addTelemetryDebug("Unexpected session state",{sessionStoreStrategyType:sessionStoreStrategyType.type,session:rawSession,isSyntheticsTest:isSyntheticsTest(),createdTimestamp:rawSession?.created,expireTimestamp:rawSession?.expire,...cookieContext})}__name(reportUnexpectedSessionState,"reportUnexpectedSessionState");function detectSessionIdChange(configuration,initialSessionState){if(!window.cookieStore||!initialSessionState.created)return;const sessionCreatedTime=Number(initialSessionState.created),sdkInitTime=dateNow(),{stop}=addEventListener(configuration,cookieStore,"change",listener);function listener(event){const changed=findLast(event.changed,change=>change.name===SESSION_STORE_KEY);if(!changed)return;const sessionAge=dateNow()-sessionCreatedTime;if(sessionAge>14*ONE_MINUTE)stop();else{const newSessionState=toSessionState(changed.value);if(newSessionState.id&&newSessionState.id!==initialSessionState.id){stop();const time2=dateNow()-sdkInitTime;getSessionCookies().then(cookie=>{addTelemetryDebug("Session cookie changed",{time:time2,session_age:sessionAge,old:initialSessionState,new:newSessionState,cookie})}).catch(monitorError)}}}__name(listener,"listener")}__name(detectSessionIdChange,"detectSessionIdChange");async function getSessionCookies(){let sessionCookies;return"cookieStore"in window?sessionCookies=await window.cookieStore.getAll(SESSION_STORE_KEY):sessionCookies=document.cookie.split(/\s*;\s*/).filter(cookie=>cookie.startsWith(SESSION_STORE_KEY)),{count:sessionCookies.length,domain:getCurrentSite()||"undefined",...sessionCookies}}__name(getSessionCookies,"getSessionCookies");const _AbstractLifeCycle=class _AbstractLifeCycle{constructor(){this.callbacks={}}notify(eventType,data){const eventCallbacks=this.callbacks[eventType];eventCallbacks&&eventCallbacks.forEach(callback=>callback(data))}subscribe(eventType,callback){return this.callbacks[eventType]||(this.callbacks[eventType]=[]),this.callbacks[eventType].push(callback),{unsubscribe:__name(()=>{this.callbacks[eventType]=this.callbacks[eventType].filter(other=>callback!==other)},"unsubscribe")}}};__name(_AbstractLifeCycle,"AbstractLifeCycle");let AbstractLifeCycle=_AbstractLifeCycle;const EVENT_RATE_LIMIT=3e3;function createEventRateLimiter(eventType,onLimitReached,limit=EVENT_RATE_LIMIT){let eventCount=0,allowNextEvent=!1;return{isLimitReached(){if(eventCount===0&&setTimeout$1(()=>{eventCount=0},ONE_MINUTE),eventCount+=1,eventCount<=limit||allowNextEvent)return allowNextEvent=!1,!1;if(eventCount===limit+1){allowNextEvent=!0;try{onLimitReached({message:`Reached max number of ${eventType}s by minute: ${limit}`,source:ErrorSource.AGENT,startClocks:clocksNow()})}finally{allowNextEvent=!1}}return!0}}}__name(createEventRateLimiter,"createEventRateLimiter");function runOnReadyState(configuration,expectedReadyState,callback){return document.readyState===expectedReadyState||document.readyState==="complete"?(callback(),{stop:noop$2}):addEventListener(configuration,window,expectedReadyState==="complete"?"load":"DOMContentLoaded",callback,{once:!0})}__name(runOnReadyState,"runOnReadyState");function asyncRunOnReadyState(configuration,expectedReadyState){return new Promise(resolve=>{runOnReadyState(configuration,expectedReadyState,resolve)})}__name(asyncRunOnReadyState,"asyncRunOnReadyState");let xhrObservable;const xhrContexts=new WeakMap;function initXhrObservable(configuration){return xhrObservable||(xhrObservable=createXhrObservable(configuration)),xhrObservable}__name(initXhrObservable,"initXhrObservable");function createXhrObservable(configuration){return new Observable(observable=>{const{stop:stopInstrumentingStart}=instrumentMethod(XMLHttpRequest.prototype,"open",openXhr),{stop:stopInstrumentingSend}=instrumentMethod(XMLHttpRequest.prototype,"send",call=>{sendXhr(call,configuration,observable)},{computeHandlingStack:!0}),{stop:stopInstrumentingAbort}=instrumentMethod(XMLHttpRequest.prototype,"abort",abortXhr);return()=>{stopInstrumentingStart(),stopInstrumentingSend(),stopInstrumentingAbort()}})}__name(createXhrObservable,"createXhrObservable");function openXhr({target:xhr,parameters:[method,url2]}){xhrContexts.set(xhr,{state:"open",method:String(method).toUpperCase(),url:normalizeUrl(String(url2))})}__name(openXhr,"openXhr");function sendXhr({target:xhr,parameters:[body],handlingStack},configuration,observable){const context=xhrContexts.get(xhr);if(!context)return;const startContext=context;startContext.state="start",startContext.startClocks=clocksNow(),startContext.isAborted=!1,startContext.xhr=xhr,startContext.handlingStack=handlingStack,startContext.requestBody=body;let hasBeenReported=!1;const{stop:stopInstrumentingOnReadyStateChange}=instrumentMethod(xhr,"onreadystatechange",()=>{xhr.readyState===XMLHttpRequest.DONE&&onEnd()}),onEnd=__name(()=>{if(unsubscribeLoadEndListener(),stopInstrumentingOnReadyStateChange(),hasBeenReported)return;hasBeenReported=!0;const completeContext=context;completeContext.state="complete",completeContext.duration=elapsed(startContext.startClocks.timeStamp,timeStampNow()),completeContext.status=xhr.status,typeof xhr.response=="string"&&(completeContext.responseBody=xhr.response),observable.notify(shallowClone$1(completeContext))},"onEnd"),{stop:unsubscribeLoadEndListener}=addEventListener(configuration,xhr,"loadend",onEnd);observable.notify(startContext)}__name(sendXhr,"sendXhr");function abortXhr({target:xhr}){const context=xhrContexts.get(xhr);context&&(context.isAborted=!0)}__name(abortXhr,"abortXhr");async function readBytesFromStream(stream,options){const reader=stream.getReader(),chunks=[];for(;;){const result=await reader.read();if(result.done)break;options.collectStreamBody&&chunks.push(result.value)}return reader.cancel().catch(noop$2),options.collectStreamBody?concatBuffers(chunks):void 0}__name(readBytesFromStream,"readBytesFromStream");let fetchObservable;const responseBodyActionGetters=[];function initFetchObservable({responseBodyAction}={}){return responseBodyAction&&responseBodyActionGetters.push(responseBodyAction),fetchObservable||(fetchObservable=createFetchObservable()),fetchObservable}__name(initFetchObservable,"initFetchObservable");function createFetchObservable(){return new Observable(observable=>{if(!globalObject.fetch)return;const{stop}=instrumentMethod(globalObject,"fetch",call=>beforeSend(call,observable),{computeHandlingStack:!0});return stop})}__name(createFetchObservable,"createFetchObservable");function beforeSend({parameters,onPostCall,handlingStack},observable){const[input,init2]=parameters;let methodFromParams=init2&&init2.method;methodFromParams===void 0&&input instanceof Request&&(methodFromParams=input.method);const method=methodFromParams!==void 0?String(methodFromParams).toUpperCase():"GET",url2=input instanceof Request?input.url:normalizeUrl(String(input)),startClocks=clocksNow(),context={state:"start",init:init2,input,method,startClocks,url:url2,handlingStack};observable.notify(context),parameters[0]=context.input,parameters[1]=context.init,onPostCall(responsePromise=>{afterSend(observable,responsePromise,context).catch(monitorError)})}__name(beforeSend,"beforeSend");async function afterSend(observable,responsePromise,startContext){var _a20,_b;const context=startContext;context.state="resolve";let response;try{response=await responsePromise}catch(error2){context.status=0,context.isAborted=((_b=(_a20=context.init)===null||_a20===void 0?void 0:_a20.signal)===null||_b===void 0?void 0:_b.aborted)||error2 instanceof DOMException&&error2.code===DOMException.ABORT_ERR,context.error=error2,observable.notify(context);return}context.response=response,context.status=response.status,context.responseType=response.type,context.isAborted=!1;const responseBodyCondition=responseBodyActionGetters.reduce((action,getter)=>Math.max(action,getter(context)),0);if(responseBodyCondition!==0){const clonedResponse=tryToClone(response);if(clonedResponse&&clonedResponse.body)try{const bytes=await readBytesFromStream(clonedResponse.body,{collectStreamBody:responseBodyCondition===2});context.responseBody=bytes&&new TextDecoder().decode(bytes)}catch{}}observable.notify(context)}__name(afterSend,"afterSend");function requestIdleCallback(callback,opts){if(window.requestIdleCallback&&window.cancelIdleCallback){const id2=window.requestIdleCallback(monitor(callback),opts);return()=>window.cancelIdleCallback(id2)}return requestIdleCallbackShim(callback)}__name(requestIdleCallback,"requestIdleCallback");const MAX_TASK_TIME=50;function requestIdleCallbackShim(callback){const start=dateNow(),timeoutId=setTimeout$1(()=>{callback({didTimeout:!1,timeRemaining:__name(()=>Math.max(0,MAX_TASK_TIME-(dateNow()-start)),"timeRemaining")})},0);return()=>clearTimeout$1(timeoutId)}__name(requestIdleCallbackShim,"requestIdleCallbackShim");const IDLE_CALLBACK_TIMEOUT=ONE_SECOND,MAX_EXECUTION_TIME_ON_TIMEOUT=30;function createTaskQueue(){const pendingTasks=[];function run(deadline){let executionTimeRemaining;if(deadline.didTimeout){const start=performance.now();executionTimeRemaining=__name(()=>MAX_EXECUTION_TIME_ON_TIMEOUT-(performance.now()-start),"executionTimeRemaining")}else executionTimeRemaining=deadline.timeRemaining.bind(deadline);for(;executionTimeRemaining()>0&&pendingTasks.length;)pendingTasks.shift()();pendingTasks.length&&scheduleNextRun()}__name(run,"run");function scheduleNextRun(){requestIdleCallback(run,{timeout:IDLE_CALLBACK_TIMEOUT})}return __name(scheduleNextRun,"scheduleNextRun"),{push(task){pendingTasks.push(task)===1&&scheduleNextRun()},stop(){pendingTasks.length=0}}}__name(createTaskQueue,"createTaskQueue");let consoleObservablesByApi={};function initConsoleObservable(apis){const consoleObservables=apis.map(api=>(consoleObservablesByApi[api]||(consoleObservablesByApi[api]=createConsoleObservable(api)),consoleObservablesByApi[api]));return mergeObservables(...consoleObservables)}__name(initConsoleObservable,"initConsoleObservable");function createConsoleObservable(api){return new Observable(observable=>{const originalConsoleApi=globalConsole[api];return globalConsole[api]=(...params)=>{originalConsoleApi.apply(console,params);const handlingStack=createHandlingStack("console error");callMonitored(()=>{observable.notify(buildConsoleLog(params,api,handlingStack))})},()=>{globalConsole[api]=originalConsoleApi}})}__name(createConsoleObservable,"createConsoleObservable");function buildConsoleLog(params,api,handlingStack){const message=params.map(param=>formatConsoleParameters(param)).join(" ");if(api===ConsoleApiName.error){const firstErrorParam=params.find(isError),rawError=computeRawError({originalError:firstErrorParam,handlingStack,startClocks:clocksNow(),source:ErrorSource.CONSOLE,handling:"handled",nonErrorPrefix:"Provided",useFallbackStack:!1});return rawError.message=message,{api,message,handlingStack,error:rawError}}return{api,message,error:void 0,handlingStack}}__name(buildConsoleLog,"buildConsoleLog");function formatConsoleParameters(param){return typeof param=="string"?sanitize(param):isError(param)?formatErrorMessage(computeStackTrace(param)):jsonStringify(sanitize(param),void 0,2)}__name(formatConsoleParameters,"formatConsoleParameters");const BUFFER_LIMIT$1=500;function createBoundedBuffer(){const buffer=[];return{add:__name(callback=>{buffer.push(callback)>BUFFER_LIMIT$1&&buffer.splice(0,1)},"add"),remove:__name(callback=>{removeItem(buffer,callback)},"remove"),drain:__name(arg=>{buffer.forEach(callback=>callback(arg)),buffer.length=0},"drain")}}__name(createBoundedBuffer,"createBoundedBuffer");function checkContext(maybeContext){const isValid=getType(maybeContext)==="object";return isValid||display.error("Unsupported context:",maybeContext),isValid}__name(checkContext,"checkContext");function ensureProperties(context,propertiesConfig,name2){const newContext={...context};for(const[key,{required:required2,type}]of Object.entries(propertiesConfig))type==="string"&&!isDefined$1(newContext[key])&&(newContext[key]=String(newContext[key])),required2&&isDefined$1(newContext[key])&&display.warn(`The property ${key} of ${name2} is required; context will not be sent to the intake.`);return newContext}__name(ensureProperties,"ensureProperties");function isDefined$1(value){return value==null||value===""}__name(isDefined$1,"isDefined$1");function createContextManager(name2="",{propertiesConfig={}}={}){let context={};const changeObservable=new Observable,contextManager={getContext:__name(()=>deepClone(context),"getContext"),setContext:__name(newContext=>{checkContext(newContext)?context=sanitize(ensureProperties(newContext,propertiesConfig,name2)):contextManager.clearContext(),changeObservable.notify()},"setContext"),setContextProperty:__name((key,property)=>{context=sanitize(ensureProperties({...context,[key]:property},propertiesConfig,name2)),changeObservable.notify()},"setContextProperty"),removeContextProperty:__name(key=>{delete context[key],ensureProperties(context,propertiesConfig,name2),changeObservable.notify()},"removeContextProperty"),clearContext:__name(()=>{context={},changeObservable.notify()},"clearContext"),changeObservable};return contextManager}__name(createContextManager,"createContextManager");function defineContextMethod(getStrategy,contextName,methodName,usage){return monitor((...args)=>(usage&&addTelemetryUsage({feature:usage}),getStrategy()[contextName][methodName](...args)))}__name(defineContextMethod,"defineContextMethod");const CONTEXT_STORE_KEY_PREFIX="_dd_c",storageListeners=[];function storeContextManager(configuration,contextManager,productKey,customerDataType){const storageKey2=buildStorageKey(productKey,customerDataType);storageListeners.push(addEventListener(configuration,window,"storage",({key})=>{storageKey2===key&&synchronizeWithStorage()})),contextManager.changeObservable.subscribe(dumpToStorage);const contextFromStorage=combine(getFromStorage(),contextManager.getContext());isEmptyObject$1(contextFromStorage)||contextManager.setContext(contextFromStorage);function synchronizeWithStorage(){contextManager.setContext(getFromStorage())}__name(synchronizeWithStorage,"synchronizeWithStorage");function dumpToStorage(){localStorage.setItem(storageKey2,JSON.stringify(contextManager.getContext()))}__name(dumpToStorage,"dumpToStorage");function getFromStorage(){const rawContext=localStorage.getItem(storageKey2);return rawContext?JSON.parse(rawContext):{}}__name(getFromStorage,"getFromStorage")}__name(storeContextManager,"storeContextManager");function buildStorageKey(productKey,customerDataType){return`${CONTEXT_STORE_KEY_PREFIX}_${productKey}_${customerDataType}`}__name(buildStorageKey,"buildStorageKey");function startAccountContext(hooks,configuration,productKey){const accountContextManager=buildAccountContextManager();return configuration.storeContextsAcrossPages&&storeContextManager(configuration,accountContextManager,productKey,4),hooks.register(0,()=>{const account=accountContextManager.getContext();return isEmptyObject$1(account)||!account.id?SKIPPED:{account}}),accountContextManager}__name(startAccountContext,"startAccountContext");function buildAccountContextManager(){return createContextManager("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}__name(buildAccountContextManager,"buildAccountContextManager");function startGlobalContext(hooks,configuration,productKey,useContextNamespace){const globalContextManager=buildGlobalContextManager();return configuration.storeContextsAcrossPages&&storeContextManager(configuration,globalContextManager,productKey,2),hooks.register(0,()=>({context:globalContextManager.getContext()})),globalContextManager}__name(startGlobalContext,"startGlobalContext");function buildGlobalContextManager(){return createContextManager("global context")}__name(buildGlobalContextManager,"buildGlobalContextManager");function startUserContext(hooks,configuration,sessionManager,productKey){const userContextManager=buildUserContextManager();return configuration.storeContextsAcrossPages&&storeContextManager(configuration,userContextManager,productKey,1),hooks.register(0,({eventType,startTime})=>{const user=userContextManager.getContext(),session=sessionManager.findTrackedSession(startTime);return session&&session.anonymousId&&!user.anonymous_id&&configuration.trackAnonymousUser&&(user.anonymous_id=session.anonymousId),isEmptyObject$1(user)?SKIPPED:{type:eventType,usr:user}}),hooks.register(1,({startTime})=>{var _a20;return{anonymous_id:(_a20=sessionManager.findTrackedSession(startTime))===null||_a20===void 0?void 0:_a20.anonymousId}}),userContextManager}__name(startUserContext,"startUserContext");function buildUserContextManager(){return createContextManager("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}__name(buildUserContextManager,"buildUserContextManager");const CustomerContextKey={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},ContextManagerMethod={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"},ResourceType={DOCUMENT:"document",XHR:"xhr",BEACON:"beacon",FETCH:"fetch",CSS:"css",JS:"js",IMAGE:"image",FONT:"font",MEDIA:"media",OTHER:"other"},RequestType={FETCH:ResourceType.FETCH,XHR:ResourceType.XHR},BUFFER_LIMIT=500;function startBufferingData(){const observable=new BufferedObservable(BUFFER_LIMIT),runtimeErrorSubscription=trackRuntimeError().subscribe(error2=>{observable.notify({type:0,error:error2})});return{observable,stop:__name(()=>{runtimeErrorSubscription.unsubscribe()},"stop")}}__name(startBufferingData,"startBufferingData");function getTimeZone(){try{return new Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}__name(getTimeZone,"getTimeZone");const RumEventType={ACTION:"action",ERROR:"error",LONG_TASK:"long_task",VIEW:"view",RESOURCE:"resource",VITAL:"vital"},RumLongTaskEntryType={LONG_TASK:"long-task",LONG_ANIMATION_FRAME:"long-animation-frame"},ViewLoadingType={INITIAL_LOAD:"initial_load",ROUTE_CHANGE:"route_change",BF_CACHE:"bf_cache"},ActionType={CLICK:"click",CUSTOM:"custom"},FrustrationType={RAGE_CLICK:"rage_click",ERROR_CLICK:"error_click",DEAD_CLICK:"dead_click"},VitalType={DURATION:"duration",OPERATION_STEP:"operation_step"};function createCustomVitalsState(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}__name(createCustomVitalsState,"createCustomVitalsState");function startVitalCollection(lifeCycle,pageStateHistory,customVitalsState){function isValid(vital){return!pageStateHistory.wasInPageStateDuringPeriod("frozen",vital.startClocks.relative,vital.duration)}__name(isValid,"isValid");function addDurationVital(vital){isValid(vital)&&lifeCycle.notify(12,processVital(vital))}__name(addDurationVital,"addDurationVital");function addOperationStepVital(name2,stepType,options,failureReason){if(!isExperimentalFeatureEnabled(ExperimentalFeature.FEATURE_OPERATION_VITAL))return;const{operationKey,context,description}=options||{},vital={name:name2,type:VitalType.OPERATION_STEP,operationKey,failureReason,stepType,startClocks:clocksNow(),context:sanitize(context),description};lifeCycle.notify(12,processVital(vital))}return __name(addOperationStepVital,"addOperationStepVital"),{addOperationStepVital,addDurationVital,startDurationVital:__name((name2,options={})=>startDurationVital(customVitalsState,name2,options),"startDurationVital"),stopDurationVital:__name((nameOrRef,options={})=>{stopDurationVital(addDurationVital,customVitalsState,nameOrRef,options)},"stopDurationVital")}}__name(startVitalCollection,"startVitalCollection");function startDurationVital({vitalsByName,vitalsByReference},name2,options={}){const vital={name:name2,startClocks:clocksNow(),...options},reference={__dd_vital_reference:!0};return vitalsByName.set(name2,vital),vitalsByReference.set(reference,vital),reference}__name(startDurationVital,"startDurationVital");function stopDurationVital(stopCallback,{vitalsByName,vitalsByReference},nameOrRef,options={}){const vitalStart=typeof nameOrRef=="string"?vitalsByName.get(nameOrRef):vitalsByReference.get(nameOrRef);vitalStart&&(stopCallback(buildDurationVital(vitalStart,vitalStart.startClocks,options,clocksNow())),typeof nameOrRef=="string"?vitalsByName.delete(nameOrRef):vitalsByReference.delete(nameOrRef))}__name(stopDurationVital,"stopDurationVital");function buildDurationVital(vitalStart,startClocks,stopOptions,stopClocks){var _a20;return{name:vitalStart.name,type:VitalType.DURATION,startClocks,duration:elapsed(startClocks.timeStamp,stopClocks.timeStamp),context:combine(vitalStart.context,stopOptions.context),description:(_a20=stopOptions.description)!==null&&_a20!==void 0?_a20:vitalStart.description,handlingStack:vitalStart.handlingStack}}__name(buildDurationVital,"buildDurationVital");function processVital(vital){const{startClocks,type,name:name2,description,context,handlingStack}=vital,vitalData={id:generateUUID(),type,name:name2,description,...type===VitalType.DURATION?{duration:toServerDuration(vital.duration)}:{step_type:vital.stepType,operation_key:vital.operationKey,failure_reason:vital.failureReason}};return{rawRumEvent:{date:startClocks.timeStamp,vital:vitalData,type:RumEventType.VITAL,context},startClocks,duration:type===VitalType.DURATION?vital.duration:void 0,domainContext:handlingStack?{handlingStack}:{}}}__name(processVital,"processVital");function callPluginsMethod(plugins,methodName,parameter){if(plugins)for(const plugin of plugins){const method=plugin[methodName];method&&method(parameter)}}__name(callPluginsMethod,"callPluginsMethod");const createHooks=abstractHooks,DEFAULT_PROPAGATOR_TYPES=["tracecontext","datadog"];function validateAndBuildRumConfiguration(initConfiguration,errorStack){var _a20,_b,_c,_d,_e,_f,_g;if(initConfiguration.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(initConfiguration.trackFeatureFlagsForEvents)&&display.warn("trackFeatureFlagsForEvents should be an array"),!initConfiguration.applicationId){display.error("Application ID is not configured, no RUM data will be collected.");return}if(!isSampleRate(initConfiguration.sessionReplaySampleRate,"Session Replay")||!isSampleRate(initConfiguration.traceSampleRate,"Trace"))return;if(initConfiguration.excludedActivityUrls!==void 0&&!Array.isArray(initConfiguration.excludedActivityUrls)){display.error("Excluded Activity Urls should be an array");return}const allowedTracingUrls=validateAndBuildTracingOptions(initConfiguration);if(!allowedTracingUrls)return;const baseConfiguration=validateAndBuildConfiguration(initConfiguration,errorStack),allowedGraphQlUrls=validateAndBuildGraphQlOptions(initConfiguration);if(!baseConfiguration)return;const sessionReplaySampleRate=(_a20=initConfiguration.sessionReplaySampleRate)!==null&&_a20!==void 0?_a20:0;return{applicationId:initConfiguration.applicationId,actionNameAttribute:initConfiguration.actionNameAttribute,betaTrackActionsInShadowDom:!!initConfiguration.betaTrackActionsInShadowDom,sessionReplaySampleRate,startSessionReplayRecordingManually:initConfiguration.startSessionReplayRecordingManually!==void 0?!!initConfiguration.startSessionReplayRecordingManually:sessionReplaySampleRate===0,traceSampleRate:(_b=initConfiguration.traceSampleRate)!==null&&_b!==void 0?_b:100,rulePsr:isNumber$1(initConfiguration.traceSampleRate)?initConfiguration.traceSampleRate/100:void 0,allowedTracingUrls,excludedActivityUrls:(_c=initConfiguration.excludedActivityUrls)!==null&&_c!==void 0?_c:[],workerUrl:initConfiguration.workerUrl,compressIntakeRequests:!!initConfiguration.compressIntakeRequests,trackUserInteractions:!!(!((_d=initConfiguration.trackUserInteractions)!==null&&_d!==void 0)||_d),trackViewsManually:!!initConfiguration.trackViewsManually,trackResources:!!(!((_e=initConfiguration.trackResources)!==null&&_e!==void 0)||_e),trackLongTasks:!!(!((_f=initConfiguration.trackLongTasks)!==null&&_f!==void 0)||_f),trackBfcacheViews:!!initConfiguration.trackBfcacheViews,trackEarlyRequests:!!initConfiguration.trackEarlyRequests,subdomain:initConfiguration.subdomain,defaultPrivacyLevel:objectHasValue(DefaultPrivacyLevel,initConfiguration.defaultPrivacyLevel)?initConfiguration.defaultPrivacyLevel:DefaultPrivacyLevel.MASK,enablePrivacyForActionName:!!initConfiguration.enablePrivacyForActionName,traceContextInjection:objectHasValue(TraceContextInjection,initConfiguration.traceContextInjection)?initConfiguration.traceContextInjection:TraceContextInjection.SAMPLED,plugins:initConfiguration.plugins||[],trackFeatureFlagsForEvents:initConfiguration.trackFeatureFlagsForEvents||[],profilingSampleRate:(_g=initConfiguration.profilingSampleRate)!==null&&_g!==void 0?_g:0,propagateTraceBaggage:!!initConfiguration.propagateTraceBaggage,allowedGraphQlUrls,...baseConfiguration}}__name(validateAndBuildRumConfiguration,"validateAndBuildRumConfiguration");function validateAndBuildTracingOptions(initConfiguration){if(initConfiguration.allowedTracingUrls===void 0)return[];if(!Array.isArray(initConfiguration.allowedTracingUrls)){display.error("Allowed Tracing URLs should be an array");return}if(initConfiguration.allowedTracingUrls.length!==0&&initConfiguration.service===void 0){display.error("Service needs to be configured when tracing is enabled");return}const tracingOptions=[];return initConfiguration.allowedTracingUrls.forEach(option=>{const normalizedOption=normalizeTracingOption(option);normalizedOption?tracingOptions.push(normalizedOption):display.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",option)}),tracingOptions}__name(validateAndBuildTracingOptions,"validateAndBuildTracingOptions");function getSelectedTracingPropagators(configuration){const usedTracingPropagators=new Set;return isNonEmptyArray(configuration.allowedTracingUrls)&&configuration.allowedTracingUrls.forEach(option=>{var _a20;(_a20=normalizeTracingOption(option))===null||_a20===void 0||_a20.propagatorTypes.forEach(propagatorType=>usedTracingPropagators.add(propagatorType))}),Array.from(usedTracingPropagators)}__name(getSelectedTracingPropagators,"getSelectedTracingPropagators");function normalizeTracingOption(option){if(isMatchOption(option))return{match:option,propagatorTypes:DEFAULT_PROPAGATOR_TYPES};if(isIndexableObject(option)&&isMatchOption(option.match)&&(option.propagatorTypes===null||option.propagatorTypes===void 0||Array.isArray(option.propagatorTypes)))return{match:option.match,propagatorTypes:option.propagatorTypes||DEFAULT_PROPAGATOR_TYPES}}__name(normalizeTracingOption,"normalizeTracingOption");function validateAndBuildGraphQlOptions(initConfiguration){if(!initConfiguration.allowedGraphQlUrls)return[];if(!Array.isArray(initConfiguration.allowedGraphQlUrls))return display.warn("allowedGraphQlUrls should be an array"),[];const graphQlOptions=[];return initConfiguration.allowedGraphQlUrls.forEach(option=>{isMatchOption(option)?graphQlOptions.push({match:option,trackPayload:!1,trackResponseErrors:!1}):isIndexableObject(option)&&isMatchOption(option.match)&&graphQlOptions.push({match:option.match,trackPayload:!!option.trackPayload,trackResponseErrors:!!option.trackResponseErrors})}),graphQlOptions}__name(validateAndBuildGraphQlOptions,"validateAndBuildGraphQlOptions");function hasGraphQlPayloadTracking(allowedGraphQlUrls){return isNonEmptyArray(allowedGraphQlUrls)&&allowedGraphQlUrls.some(option=>isIndexableObject(option)&&option.trackPayload)}__name(hasGraphQlPayloadTracking,"hasGraphQlPayloadTracking");function hasGraphQlResponseErrorsTracking(allowedGraphQlUrls){return isNonEmptyArray(allowedGraphQlUrls)&&allowedGraphQlUrls.some(option=>isIndexableObject(option)&&option.trackResponseErrors)}__name(hasGraphQlResponseErrorsTracking,"hasGraphQlResponseErrorsTracking");function serializeRumConfiguration(configuration){var _a20;const baseSerializedConfiguration=serializeConfiguration(configuration);return{session_replay_sample_rate:configuration.sessionReplaySampleRate,start_session_replay_recording_manually:configuration.startSessionReplayRecordingManually,trace_sample_rate:configuration.traceSampleRate,trace_context_injection:configuration.traceContextInjection,propagate_trace_baggage:configuration.propagateTraceBaggage,action_name_attribute:configuration.actionNameAttribute,use_allowed_tracing_urls:isNonEmptyArray(configuration.allowedTracingUrls),use_allowed_graph_ql_urls:isNonEmptyArray(configuration.allowedGraphQlUrls),use_track_graph_ql_payload:hasGraphQlPayloadTracking(configuration.allowedGraphQlUrls),use_track_graph_ql_response_errors:hasGraphQlResponseErrorsTracking(configuration.allowedGraphQlUrls),selected_tracing_propagators:getSelectedTracingPropagators(configuration),default_privacy_level:configuration.defaultPrivacyLevel,enable_privacy_for_action_name:configuration.enablePrivacyForActionName,use_excluded_activity_urls:isNonEmptyArray(configuration.excludedActivityUrls),use_worker_url:!!configuration.workerUrl,compress_intake_requests:configuration.compressIntakeRequests,track_views_manually:configuration.trackViewsManually,track_user_interactions:configuration.trackUserInteractions,track_resources:configuration.trackResources,track_long_task:configuration.trackLongTasks,track_bfcache_views:configuration.trackBfcacheViews,track_early_requests:configuration.trackEarlyRequests,plugins:(_a20=configuration.plugins)===null||_a20===void 0?void 0:_a20.map(plugin=>{var _a21;return{name:plugin.name,...(_a21=plugin.getConfigurationTelemetry)===null||_a21===void 0?void 0:_a21.call(plugin)}}),track_feature_flags_for_events:configuration.trackFeatureFlagsForEvents,remote_configuration_id:configuration.remoteConfigurationId,profiling_sample_rate:configuration.profilingSampleRate,use_remote_configuration_proxy:!!configuration.remoteConfigurationProxy,...baseSerializedConfiguration}}__name(serializeRumConfiguration,"serializeRumConfiguration");function parseJsonPath(path){const selectors=[];let previousToken=0,currentToken;const parsingContext={quote:void 0,escapeSequence:void 0};let currentSelector="";for(const char of path){if(currentToken=ALLOWED_NEXT_TOKENS[previousToken].find(token=>TOKEN_PREDICATE[token](char,parsingContext)),!currentToken)return[];if(parsingContext.escapeSequence!==void 0&¤tToken!==12){if(!isValidEscapeSequence(parsingContext.escapeSequence))return[];currentSelector+=resolveEscapeSequence(parsingContext.escapeSequence),parsingContext.escapeSequence=void 0}ALLOWED_SELECTOR_TOKENS.includes(currentToken)?currentSelector+=char:ALLOWED_SELECTOR_DELIMITER_TOKENS.includes(currentToken)&¤tSelector!==""?(selectors.push(currentSelector),currentSelector=""):currentToken===12?parsingContext.escapeSequence=parsingContext.escapeSequence?`${parsingContext.escapeSequence}${char}`:char:currentToken===8?parsingContext.quote=char:currentToken===9&&(parsingContext.quote=void 0),previousToken=currentToken}return ALLOWED_NEXT_TOKENS[previousToken].includes(1)?(currentSelector!==""&&selectors.push(currentSelector),selectors):[]}__name(parseJsonPath,"parseJsonPath");const NAME_SHORTHAND_FIRST_CHAR_REGEX=/[a-zA-Z_$]/,NAME_SHORTHAND_CHAR_REGEX=/[a-zA-Z0-9_$]/,DIGIT_REGEX=/[0-9]/,UNICODE_CHAR_REGEX=/[a-fA-F0-9]/,QUOTE_CHARS=`'"`,TOKEN_PREDICATE={0:()=>!1,1:()=>!1,2:char=>NAME_SHORTHAND_FIRST_CHAR_REGEX.test(char),3:char=>NAME_SHORTHAND_CHAR_REGEX.test(char),4:char=>char===".",5:char=>char==="[",6:char=>char==="]",7:char=>DIGIT_REGEX.test(char),8:char=>QUOTE_CHARS.includes(char),9:(char,parsingContext)=>char===parsingContext.quote,10:()=>!0,11:char=>char==="\\",12:(char,parsingContext)=>parsingContext.escapeSequence===void 0?`${parsingContext.quote}/\\bfnrtu`.includes(char):parsingContext.escapeSequence.startsWith("u")&&parsingContext.escapeSequence.length<5?UNICODE_CHAR_REGEX.test(char):!1},ALLOWED_NEXT_TOKENS={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]},ALLOWED_SELECTOR_TOKENS=[2,3,7,10],ALLOWED_SELECTOR_DELIMITER_TOKENS=[4,5,6];function isValidEscapeSequence(escapeSequence){return`"'/\\bfnrt`.includes(escapeSequence)||escapeSequence.startsWith("u")&&escapeSequence.length===5}__name(isValidEscapeSequence,"isValidEscapeSequence");const ESCAPED_CHARS={'"':'"',"'":"'","/":"/","\\":"\\",b:"\b",f:"\f",n:`
|
|
38
|
-
`,r:"\r",t:" "};function resolveEscapeSequence(escapeSequence){return escapeSequence.startsWith("u")?String.fromCharCode(parseInt(escapeSequence.slice(1),16)):ESCAPED_CHARS[escapeSequence]}__name(resolveEscapeSequence,"resolveEscapeSequence");const REMOTE_CONFIGURATION_VERSION="v1",SUPPORTED_FIELDS=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function fetchAndApplyRemoteConfiguration(initConfiguration,supportedContextManagers){let rumInitConfiguration;const metrics=initMetrics(),fetchResult=await fetchRemoteConfiguration(initConfiguration);return fetchResult.ok?(metrics.increment("fetch","success"),rumInitConfiguration=applyRemoteConfiguration(initConfiguration,fetchResult.value,supportedContextManagers,metrics)):(metrics.increment("fetch","failure"),display.error(fetchResult.error)),addTelemetryMetrics("remote configuration metrics",{metrics:metrics.get()}),rumInitConfiguration}__name(fetchAndApplyRemoteConfiguration,"fetchAndApplyRemoteConfiguration");function applyRemoteConfiguration(initConfiguration,rumRemoteConfiguration,supportedContextManagers,metrics){const appliedConfiguration={...initConfiguration};return SUPPORTED_FIELDS.forEach(option=>{option in rumRemoteConfiguration&&(appliedConfiguration[option]=resolveConfigurationProperty(rumRemoteConfiguration[option]))}),Object.keys(supportedContextManagers).forEach(context=>{rumRemoteConfiguration[context]!==void 0&&resolveContextProperty(supportedContextManagers[context],rumRemoteConfiguration[context])}),appliedConfiguration;function resolveConfigurationProperty(property){if(Array.isArray(property))return property.map(resolveConfigurationProperty);if(isIndexableObject(property)){if(isSerializedOption(property)){const type=property.rcSerializedType;switch(type){case"string":return property.value;case"regex":return resolveRegex(property.value);case"dynamic":return resolveDynamicOption(property);default:display.error(`Unsupported remote configuration: "rcSerializedType": "${type}"`);return}}return mapValues(property,resolveConfigurationProperty)}return property}__name(resolveConfigurationProperty,"resolveConfigurationProperty");function resolveContextProperty(contextManager,contextItems){contextItems.forEach(({key,value})=>{contextManager.setContextProperty(key,resolveConfigurationProperty(value))})}__name(resolveContextProperty,"resolveContextProperty");function resolveDynamicOption(property){const strategy=property.strategy;let resolvedValue;switch(strategy){case"cookie":resolvedValue=resolveCookieValue(property);break;case"dom":resolvedValue=resolveDomValue(property);break;case"js":resolvedValue=resolveJsValue(property);break;case"localStorage":resolvedValue=resolveLocalStorageValue(property);break;default:display.error(`Unsupported remote configuration: "strategy": "${strategy}"`);return}const extractor=property.extractor;return extractor!==void 0&&typeof resolvedValue=="string"?extractValue(extractor,resolvedValue):resolvedValue}__name(resolveDynamicOption,"resolveDynamicOption");function resolveCookieValue({name:name2}){const value=getCookie(name2);return metrics.increment("cookie",value!==void 0?"success":"missing"),value}__name(resolveCookieValue,"resolveCookieValue");function resolveLocalStorageValue({key}){let value;try{value=localStorage.getItem(key)}catch{metrics.increment("localStorage","failure");return}return metrics.increment("localStorage",value!==null?"success":"missing"),value??void 0}__name(resolveLocalStorageValue,"resolveLocalStorageValue");function resolveDomValue({selector,attribute}){let element2;try{element2=document.querySelector(selector)}catch{display.error(`Invalid selector in the remote configuration: '${selector}'`),metrics.increment("dom","failure");return}if(!element2){metrics.increment("dom","missing");return}if(isForbidden(element2,attribute)){display.error(`Forbidden element selected by the remote configuration: '${selector}'`),metrics.increment("dom","failure");return}const domValue=attribute!==void 0?element2.getAttribute(attribute):element2.textContent;if(domValue===null){metrics.increment("dom","missing");return}return metrics.increment("dom","success"),domValue}__name(resolveDomValue,"resolveDomValue");function isForbidden(element2,attribute){return element2.getAttribute("type")==="password"&&attribute==="value"}__name(isForbidden,"isForbidden");function resolveJsValue({path}){let current=window;const pathParts=parseJsonPath(path);if(pathParts.length===0){display.error(`Invalid JSON path in the remote configuration: '${path}'`),metrics.increment("js","failure");return}for(const pathPart of pathParts){if(!(pathPart in current)){metrics.increment("js","missing");return}try{current=current[pathPart]}catch(e){display.error(`Error accessing: '${path}'`,e),metrics.increment("js","failure");return}}return metrics.increment("js","success"),current}__name(resolveJsValue,"resolveJsValue")}__name(applyRemoteConfiguration,"applyRemoteConfiguration");function initMetrics(){const metrics={fetch:{}};return{get:__name(()=>metrics,"get"),increment:__name((metricName,type)=>{metrics[metricName]||(metrics[metricName]={}),metrics[metricName][type]||(metrics[metricName][type]=0),metrics[metricName][type]=metrics[metricName][type]+1},"increment")}}__name(initMetrics,"initMetrics");function isSerializedOption(value){return"rcSerializedType"in value}__name(isSerializedOption,"isSerializedOption");function resolveRegex(pattern){try{return new RegExp(pattern)}catch{display.error(`Invalid regex in the remote configuration: '${pattern}'`)}}__name(resolveRegex,"resolveRegex");function extractValue(extractor,candidate){const resolvedExtractor=resolveRegex(extractor.value);if(resolvedExtractor===void 0)return;const regexResult=resolvedExtractor.exec(candidate);if(regexResult===null)return;const[match,capture]=regexResult;return capture||match}__name(extractValue,"extractValue");async function fetchRemoteConfiguration(configuration){let response;try{response=await fetch$1(buildEndpoint(configuration))}catch{response=void 0}if(!response||!response.ok)return{ok:!1,error:new Error("Error fetching the remote configuration.")};const remoteConfiguration=await response.json();return remoteConfiguration.rum?{ok:!0,value:remoteConfiguration.rum}:{ok:!1,error:new Error("No remote configuration for RUM.")}}__name(fetchRemoteConfiguration,"fetchRemoteConfiguration");function buildEndpoint(configuration){return configuration.remoteConfigurationProxy?configuration.remoteConfigurationProxy:`https://sdk-configuration.${buildEndpointHost("rum",configuration)}/${REMOTE_CONFIGURATION_VERSION}/${encodeURIComponent(configuration.remoteConfigurationId)}.json`}__name(buildEndpoint,"buildEndpoint");function createPreStartStrategy$1({ignoreInitIfSyntheticsWillInjectRum=!0,startDeflateWorker:startDeflateWorker2},trackingConsentState,customVitalsState,doStartRum){const bufferApiCalls=createBoundedBuffer(),globalContext=buildGlobalContextManager();bufferContextCalls(globalContext,CustomerContextKey.globalContext,bufferApiCalls);const userContext=buildUserContextManager();bufferContextCalls(userContext,CustomerContextKey.userContext,bufferApiCalls);const accountContext=buildAccountContextManager();bufferContextCalls(accountContext,CustomerContextKey.accountContext,bufferApiCalls);let firstStartViewCall,deflateWorker,cachedInitConfiguration,cachedConfiguration,telemetry;const hooks=createHooks(),trackingConsentStateSubscription=trackingConsentState.observable.subscribe(tryStartRum),emptyContext={};function tryStartRum(){if(!cachedInitConfiguration||!cachedConfiguration||!trackingConsentState.isGranted())return;telemetry||(telemetry=startTelemetry("browser-rum-sdk",cachedConfiguration,hooks)),trackingConsentStateSubscription.unsubscribe();let initialViewOptions;if(cachedConfiguration.trackViewsManually){if(!firstStartViewCall)return;bufferApiCalls.remove(firstStartViewCall.callback),initialViewOptions=firstStartViewCall.options}const startRumResult=doStartRum(cachedConfiguration,deflateWorker,initialViewOptions,telemetry,hooks);bufferApiCalls.drain(startRumResult)}__name(tryStartRum,"tryStartRum");function doInit(initConfiguration,errorStack){const eventBridgeAvailable=canUseEventBridge();if(eventBridgeAvailable&&(initConfiguration=overrideInitConfigurationForBridge(initConfiguration)),cachedInitConfiguration=initConfiguration,addTelemetryConfiguration(serializeRumConfiguration(initConfiguration)),cachedConfiguration){displayAlreadyInitializedError("DD_RUM",initConfiguration);return}const configuration=validateAndBuildRumConfiguration(initConfiguration,errorStack);if(configuration){if(!eventBridgeAvailable&&!configuration.sessionStoreStrategyType){display.warn("No storage available for session. We will not send any data.");return}configuration.compressIntakeRequests&&!eventBridgeAvailable&&startDeflateWorker2&&(deflateWorker=startDeflateWorker2(configuration,"Datadog RUM",noop$2),!deflateWorker)||(cachedConfiguration=configuration,initFetchObservable().subscribe(noop$2),trackingConsentState.tryToInit(configuration.trackingConsent),tryStartRum())}}__name(doInit,"doInit");const addDurationVital=__name(vital=>{bufferApiCalls.add(startRumResult=>startRumResult.addDurationVital(vital))},"addDurationVital");return{init(initConfiguration,publicApi,errorStack){if(!initConfiguration){display.error("Missing configuration");return}initFeatureFlags(initConfiguration.enableExperimentalFeatures),cachedInitConfiguration=initConfiguration,!(ignoreInitIfSyntheticsWillInjectRum&&willSyntheticsInjectRum())&&(callPluginsMethod(initConfiguration.plugins,"onInit",{initConfiguration,publicApi}),initConfiguration.remoteConfigurationId?fetchAndApplyRemoteConfiguration(initConfiguration,{user:userContext,context:globalContext}).then(initConfiguration2=>{initConfiguration2&&doInit(initConfiguration2,errorStack)}).catch(monitorError):doInit(initConfiguration,errorStack))},get initConfiguration(){return cachedInitConfiguration},getInternalContext:noop$2,stopSession:noop$2,addTiming(name2,time2=timeStampNow()){bufferApiCalls.add(startRumResult=>startRumResult.addTiming(name2,time2))},startView(options,startClocks=clocksNow()){const callback=__name(startRumResult=>{startRumResult.startView(options,startClocks)},"callback");bufferApiCalls.add(callback),firstStartViewCall||(firstStartViewCall={options,callback},tryStartRum())},setViewName(name2){bufferApiCalls.add(startRumResult=>startRumResult.setViewName(name2))},setViewContext(context){bufferApiCalls.add(startRumResult=>startRumResult.setViewContext(context))},setViewContextProperty(key,value){bufferApiCalls.add(startRumResult=>startRumResult.setViewContextProperty(key,value))},getViewContext:__name(()=>emptyContext,"getViewContext"),globalContext,userContext,accountContext,addAction(action){bufferApiCalls.add(startRumResult=>startRumResult.addAction(action))},startAction(name2,options){const startClocks=clocksNow();bufferApiCalls.add(startRumResult=>startRumResult.startAction(name2,options,startClocks))},stopAction(name2,options){const stopClocks=clocksNow();bufferApiCalls.add(startRumResult=>startRumResult.stopAction(name2,options,stopClocks))},startResource(url2,options){const startClocks=clocksNow();bufferApiCalls.add(startRumResult=>startRumResult.startResource(url2,options,startClocks))},stopResource(url2,options){const stopClocks=clocksNow();bufferApiCalls.add(startRumResult=>startRumResult.stopResource(url2,options,stopClocks))},addError(providedError){bufferApiCalls.add(startRumResult=>startRumResult.addError(providedError))},addFeatureFlagEvaluation(key,value){bufferApiCalls.add(startRumResult=>startRumResult.addFeatureFlagEvaluation(key,value))},startDurationVital(name2,options){return startDurationVital(customVitalsState,name2,options)},stopDurationVital(name2,options){stopDurationVital(addDurationVital,customVitalsState,name2,options)},addDurationVital,addOperationStepVital:__name((name2,stepType,options,failureReason)=>{bufferApiCalls.add(startRumResult=>startRumResult.addOperationStepVital(sanitize(name2),stepType,sanitize(options),sanitize(failureReason)))},"addOperationStepVital")}}__name(createPreStartStrategy$1,"createPreStartStrategy$1");function overrideInitConfigurationForBridge(initConfiguration){var _a20,_b;return{...initConfiguration,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(_a20=initConfiguration.defaultPrivacyLevel)!==null&&_a20!==void 0?_a20:(_b=getEventBridge())===null||_b===void 0?void 0:_b.getPrivacyLevel()}}__name(overrideInitConfigurationForBridge,"overrideInitConfigurationForBridge");function bufferContextCalls(preStartContextManager,name2,bufferApiCalls){preStartContextManager.changeObservable.subscribe(()=>{const context=preStartContextManager.getContext();bufferApiCalls.add(startRumResult=>startRumResult[name2].setContext(context))})}__name(bufferContextCalls,"bufferContextCalls");function createDOMMutationObservable(){const MutationObserver2=getMutationObserverConstructor();return new Observable(observable=>{if(!MutationObserver2)return;const observer2=new MutationObserver2(monitor(records=>observable.notify(records)));return observer2.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>observer2.disconnect()})}__name(createDOMMutationObservable,"createDOMMutationObservable");function getMutationObserverConstructor(){let constructor;const browserWindow=window;if(browserWindow.Zone&&(constructor=getZoneJsOriginalValue(browserWindow,"MutationObserver"),browserWindow.MutationObserver&&constructor===browserWindow.MutationObserver)){const patchedInstance=new browserWindow.MutationObserver(noop$2),originalInstance=getZoneJsOriginalValue(patchedInstance,"originalInstance");constructor=originalInstance&&originalInstance.constructor}return constructor||(constructor=browserWindow.MutationObserver),constructor}__name(getMutationObserverConstructor,"getMutationObserverConstructor");function createWindowOpenObservable(){const observable=new Observable,{stop}=instrumentMethod(window,"open",()=>observable.notify());return{observable,stop}}__name(createWindowOpenObservable,"createWindowOpenObservable");function startInternalContext(applicationId,sessionManager,viewHistory,actionContexts,urlContexts){return{get:__name(startTime=>{const viewContext=viewHistory.findView(startTime),urlContext=urlContexts.findUrl(startTime),session=sessionManager.findTrackedSession(startTime);if(session&&viewContext&&urlContext){const actionId=actionContexts.findActionId(startTime);return{application_id:applicationId,session_id:session.id,user_action:actionId?{id:actionId}:void 0,view:{id:viewContext.id,name:viewContext.name,referrer:urlContext.referrer,url:urlContext.url}}}},"get")}}__name(startInternalContext,"startInternalContext");const LifeCycle=AbstractLifeCycle,VIEW_CONTEXT_TIME_OUT_DELAY=SESSION_TIME_OUT_DELAY;function startViewHistory(lifeCycle){const viewValueHistory=createValueHistory({expireDelay:VIEW_CONTEXT_TIME_OUT_DELAY});lifeCycle.subscribe(1,view=>{viewValueHistory.add(buildViewHistoryEntry(view),view.startClocks.relative)}),lifeCycle.subscribe(6,({endClocks})=>{viewValueHistory.closeActive(endClocks.relative)}),lifeCycle.subscribe(3,viewUpdate=>{const currentView=viewValueHistory.find(viewUpdate.startClocks.relative);currentView&&(viewUpdate.name&&(currentView.name=viewUpdate.name),viewUpdate.context&&(currentView.context=viewUpdate.context),currentView.sessionIsActive=viewUpdate.sessionIsActive)}),lifeCycle.subscribe(10,()=>{viewValueHistory.reset()});function buildViewHistoryEntry(view){return{service:view.service,version:view.version,context:view.context,id:view.id,name:view.name,startClocks:view.startClocks}}return __name(buildViewHistoryEntry,"buildViewHistoryEntry"),{findView:__name(startTime=>viewValueHistory.find(startTime),"findView"),stop:__name(()=>{viewValueHistory.stop()},"stop")}}__name(startViewHistory,"startViewHistory");const FAKE_INITIAL_DOCUMENT="initial_document",RESOURCE_TYPES=[[ResourceType.DOCUMENT,initiatorType=>FAKE_INITIAL_DOCUMENT===initiatorType],[ResourceType.XHR,initiatorType=>initiatorType==="xmlhttprequest"],[ResourceType.FETCH,initiatorType=>initiatorType==="fetch"],[ResourceType.BEACON,initiatorType=>initiatorType==="beacon"],[ResourceType.CSS,(_2,path)=>/\.css$/i.test(path)],[ResourceType.JS,(_2,path)=>/\.js$/i.test(path)],[ResourceType.IMAGE,(initiatorType,path)=>["image","img","icon"].includes(initiatorType)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(path)!==null],[ResourceType.FONT,(_2,path)=>/\.(woff|eot|woff2|ttf)$/i.exec(path)!==null],[ResourceType.MEDIA,(initiatorType,path)=>["audio","video"].includes(initiatorType)||/\.(mp3|mp4)$/i.exec(path)!==null]];function computeResourceEntryType(entry){const url2=entry.name;if(!isValidUrl(url2))return ResourceType.OTHER;const path=getPathName(url2);for(const[type,isType]of RESOURCE_TYPES)if(isType(entry.initiatorType,path))return type;return ResourceType.OTHER}__name(computeResourceEntryType,"computeResourceEntryType");function areInOrder(...numbers){for(let i2=1;i2<numbers.length;i2+=1)if(numbers[i2-1]>numbers[i2])return!1;return!0}__name(areInOrder,"areInOrder");function isResourceEntryRequestType(entry){return entry.initiatorType==="xmlhttprequest"||entry.initiatorType==="fetch"}__name(isResourceEntryRequestType,"isResourceEntryRequestType");function computeResourceEntryDuration(entry){const{duration:duration2,startTime,responseEnd}=entry;return duration2===0&&startTime<responseEnd?elapsed(startTime,responseEnd):duration2}__name(computeResourceEntryDuration,"computeResourceEntryDuration");function computeResourceEntryDetails(entry){if(!hasValidResourceEntryTimings(entry))return;const{startTime,fetchStart,workerStart,redirectStart,redirectEnd,domainLookupStart,domainLookupEnd,connectStart,secureConnectionStart,connectEnd,requestStart,responseStart,responseEnd}=entry,details={download:formatTiming(startTime,responseStart,responseEnd),first_byte:formatTiming(startTime,requestStart,responseStart)};return 0<workerStart&&workerStart<fetchStart&&(details.worker=formatTiming(startTime,workerStart,fetchStart)),fetchStart<connectEnd&&(details.connect=formatTiming(startTime,connectStart,connectEnd),connectStart<=secureConnectionStart&&secureConnectionStart<=connectEnd&&(details.ssl=formatTiming(startTime,secureConnectionStart,connectEnd))),fetchStart<domainLookupEnd&&(details.dns=formatTiming(startTime,domainLookupStart,domainLookupEnd)),startTime<redirectEnd&&(details.redirect=formatTiming(startTime,redirectStart,redirectEnd)),details}__name(computeResourceEntryDetails,"computeResourceEntryDetails");function hasValidResourceEntryDuration(entry){return entry.duration>=0}__name(hasValidResourceEntryDuration,"hasValidResourceEntryDuration");function hasValidResourceEntryTimings(entry){const areCommonTimingsInOrder=areInOrder(entry.startTime,entry.fetchStart,entry.domainLookupStart,entry.domainLookupEnd,entry.connectStart,entry.connectEnd,entry.requestStart,entry.responseStart,entry.responseEnd),areRedirectionTimingsInOrder=hasRedirection(entry)?areInOrder(entry.startTime,entry.redirectStart,entry.redirectEnd,entry.fetchStart):!0;return areCommonTimingsInOrder&&areRedirectionTimingsInOrder}__name(hasValidResourceEntryTimings,"hasValidResourceEntryTimings");function hasRedirection(entry){return entry.redirectEnd>entry.startTime}__name(hasRedirection,"hasRedirection");function formatTiming(origin2,start,end){if(origin2<=start&&start<=end)return{duration:toServerDuration(elapsed(start,end)),start:toServerDuration(elapsed(origin2,start))}}__name(formatTiming,"formatTiming");function computeResourceEntryProtocol(entry){return entry.nextHopProtocol===""?void 0:entry.nextHopProtocol}__name(computeResourceEntryProtocol,"computeResourceEntryProtocol");function computeResourceEntryDeliveryType(entry){return entry.deliveryType===""?"other":entry.deliveryType}__name(computeResourceEntryDeliveryType,"computeResourceEntryDeliveryType");function computeResourceEntrySize(entry){if(entry.startTime<entry.responseStart){const{encodedBodySize,decodedBodySize,transferSize}=entry;return{size:decodedBodySize,encoded_body_size:encodedBodySize,decoded_body_size:decodedBodySize,transfer_size:transferSize}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}__name(computeResourceEntrySize,"computeResourceEntrySize");function isAllowedRequestUrl(url2){return url2&&(!isIntakeUrl(url2)||isExperimentalFeatureEnabled(ExperimentalFeature.TRACK_INTAKE_REQUESTS))}__name(isAllowedRequestUrl,"isAllowedRequestUrl");const DATA_URL_REGEX=/data:(.+)?(;base64)?,/g,MAX_RESOURCE_VALUE_CHAR_LENGTH=24e3;function sanitizeIfLongDataUrl(url2,lengthLimit=MAX_RESOURCE_VALUE_CHAR_LENGTH){if(url2.length<=lengthLimit||!url2.startsWith("data:"))return url2;const dataUrlMatchArray=url2.substring(0,100).match(DATA_URL_REGEX);return dataUrlMatchArray?`${dataUrlMatchArray[0]}[...]`:url2}__name(sanitizeIfLongDataUrl,"sanitizeIfLongDataUrl");const sampleDecisionCache=new Map;function isSampled(sessionId,sampleRate){if(sampleRate===100)return!0;if(sampleRate===0)return!1;const cachedDecision=sampleDecisionCache.get(sampleRate);if(cachedDecision&&sessionId===cachedDecision.sessionId)return cachedDecision.decision;let decision;return window.BigInt?decision=sampleUsingKnuthFactor(BigInt(`0x${sessionId.split("-")[4]}`),sampleRate):decision=performDraw(sampleRate),sampleDecisionCache.set(sampleRate,{sessionId,decision}),decision}__name(isSampled,"isSampled");function sampleUsingKnuthFactor(identifier,sampleRate){const knuthFactor=BigInt("1111111111111111111"),twoPow64=BigInt("0x10000000000000000"),hash2=identifier*knuthFactor%twoPow64;return Number(hash2)<=sampleRate/100*Number(twoPow64)}__name(sampleUsingKnuthFactor,"sampleUsingKnuthFactor");function createTraceIdentifier(){return createIdentifier(64)}__name(createTraceIdentifier,"createTraceIdentifier");function createSpanIdentifier(){return createIdentifier(63)}__name(createSpanIdentifier,"createSpanIdentifier");function createIdentifier(bits){const buffer=crypto.getRandomValues(new Uint32Array(2));return bits===63&&(buffer[buffer.length-1]>>>=1),{toString(radix=10){let high=buffer[1],low=buffer[0],str="";do{const mod=high%radix*4294967296+low;high=Math.floor(high/radix),low=Math.floor(mod/radix),str=(mod%radix).toString(radix)+str}while(high||low);return str}}}__name(createIdentifier,"createIdentifier");function toPaddedHexadecimalString(id2){return id2.toString(16).padStart(16,"0")}__name(toPaddedHexadecimalString,"toPaddedHexadecimalString");function clearTracingIfNeeded(context){context.status===0&&!context.isAborted&&(context.traceId=void 0,context.spanId=void 0,context.traceSampled=void 0)}__name(clearTracingIfNeeded,"clearTracingIfNeeded");function startTracer(configuration,sessionManager,userContext,accountContext){return{clearTracingIfNeeded,traceFetch:__name(context=>injectHeadersIfTracingAllowed(configuration,context,sessionManager,userContext,accountContext,tracingHeaders=>{var _a20;if(context.input instanceof Request&&!(!((_a20=context.init)===null||_a20===void 0)&&_a20.headers))context.input=new Request(context.input),Object.keys(tracingHeaders).forEach(key=>{context.input.headers.append(key,tracingHeaders[key])});else{context.init=shallowClone$1(context.init);const headers=[];context.init.headers instanceof Headers?context.init.headers.forEach((value,key)=>{headers.push([key,value])}):Array.isArray(context.init.headers)?context.init.headers.forEach(header=>{headers.push(header)}):context.init.headers&&Object.keys(context.init.headers).forEach(key=>{headers.push([key,context.init.headers[key]])}),context.init.headers=headers.concat(objectEntries(tracingHeaders))}}),"traceFetch"),traceXhr:__name((context,xhr)=>injectHeadersIfTracingAllowed(configuration,context,sessionManager,userContext,accountContext,tracingHeaders=>{Object.keys(tracingHeaders).forEach(name2=>{xhr.setRequestHeader(name2,tracingHeaders[name2])})}),"traceXhr")}}__name(startTracer,"startTracer");function injectHeadersIfTracingAllowed(configuration,context,sessionManager,userContext,accountContext,inject){const session=sessionManager.findTrackedSession();if(!session)return;const tracingOption=configuration.allowedTracingUrls.find(tracingOption2=>matchList([tracingOption2.match],context.url,!0));if(!tracingOption)return;const traceSampled=isSampled(session.id,configuration.traceSampleRate);(traceSampled||configuration.traceContextInjection===TraceContextInjection.ALL)&&(context.traceSampled=traceSampled,context.traceId=createTraceIdentifier(),context.spanId=createSpanIdentifier(),inject(makeTracingHeaders(context.traceId,context.spanId,context.traceSampled,session.id,tracingOption.propagatorTypes,userContext,accountContext,configuration)))}__name(injectHeadersIfTracingAllowed,"injectHeadersIfTracingAllowed");function makeTracingHeaders(traceId,spanId,traceSampled,sessionId,propagatorTypes,userContext,accountContext,configuration){const tracingHeaders={};if(propagatorTypes.forEach(propagatorType=>{switch(propagatorType){case"datadog":{Object.assign(tracingHeaders,{"x-datadog-origin":"rum","x-datadog-parent-id":spanId.toString(),"x-datadog-sampling-priority":traceSampled?"1":"0","x-datadog-trace-id":traceId.toString()});break}case"tracecontext":{Object.assign(tracingHeaders,{traceparent:`00-0000000000000000${toPaddedHexadecimalString(traceId)}-${toPaddedHexadecimalString(spanId)}-0${traceSampled?"1":"0"}`,tracestate:`dd=s:${traceSampled?"1":"0"};o:rum`});break}case"b3":{Object.assign(tracingHeaders,{b3:`${toPaddedHexadecimalString(traceId)}-${toPaddedHexadecimalString(spanId)}-${traceSampled?"1":"0"}`});break}case"b3multi":{Object.assign(tracingHeaders,{"X-B3-TraceId":toPaddedHexadecimalString(traceId),"X-B3-SpanId":toPaddedHexadecimalString(spanId),"X-B3-Sampled":traceSampled?"1":"0"});break}}}),configuration.propagateTraceBaggage){const baggageItems={"session.id":sessionId},userId=userContext.getContext().id;typeof userId=="string"&&(baggageItems["user.id"]=userId);const accountId=accountContext.getContext().id;typeof accountId=="string"&&(baggageItems["account.id"]=accountId);const baggageHeader=Object.entries(baggageItems).map(([key,value])=>`${key}=${encodeURIComponent(value)}`).join(",");baggageHeader&&(tracingHeaders.baggage=baggageHeader)}return tracingHeaders}__name(makeTracingHeaders,"makeTracingHeaders");const GRAPHQL_PAYLOAD_LIMIT=32*ONE_KIBI_BYTE;function extractGraphQlMetadata(request,graphQlConfig){const metadata=extractGraphQlRequestMetadata(request,graphQlConfig.trackPayload);if(metadata){if(graphQlConfig.trackResponseErrors&&request.responseBody){const responseErrors=parseGraphQlResponse(request.responseBody);responseErrors&&(metadata.error_count=responseErrors.length,metadata.errors=responseErrors)}return metadata}}__name(extractGraphQlMetadata,"extractGraphQlMetadata");function parseGraphQlResponse(responseText){const response=tryJsonParse(responseText);if(!response||typeof response!="object")return;const responseObj=response;return isNonEmptyArray(responseObj.errors)?responseObj.errors.map(error2=>{var _a20;return{message:error2.message,path:error2.path,locations:error2.locations,code:(_a20=error2.extensions)===null||_a20===void 0?void 0:_a20.code}}):void 0}__name(parseGraphQlResponse,"parseGraphQlResponse");function findGraphQlConfiguration(url2,configuration){return configuration.allowedGraphQlUrls.find(graphQlOption=>matchList([graphQlOption.match],url2))}__name(findGraphQlConfiguration,"findGraphQlConfiguration");function extractGraphQlRequestMetadata(request,trackPayload=!1){let rawMetadata;if(request.method==="POST"?rawMetadata=extractFromBody(request.requestBody):request.method==="GET"&&(rawMetadata=extractFromUrlQueryParams(request.url)),!!rawMetadata)return sanitizeGraphQlMetadata(rawMetadata,trackPayload)}__name(extractGraphQlRequestMetadata,"extractGraphQlRequestMetadata");function extractFromBody(requestBody){if(!requestBody||typeof requestBody!="string")return;const graphqlBody=tryJsonParse(requestBody);if(graphqlBody)return{query:graphqlBody.query,operationName:graphqlBody.operationName,variables:graphqlBody.variables?JSON.stringify(graphqlBody.variables):void 0}}__name(extractFromBody,"extractFromBody");function extractFromUrlQueryParams(url2){const searchParams=buildUrl(url2).searchParams,variablesParam=searchParams.get("variables"),variables=variablesParam&&tryJsonParse(variablesParam)!==void 0?variablesParam:void 0;return{query:searchParams.get("query")||void 0,operationName:searchParams.get("operationName")||void 0,variables}}__name(extractFromUrlQueryParams,"extractFromUrlQueryParams");function sanitizeGraphQlMetadata(rawMetadata,trackPayload){let operationType,payload,variables;if(rawMetadata.query){const trimmedQuery=rawMetadata.query.trim();operationType=getOperationType(trimmedQuery),trackPayload&&(payload=safeTruncate(trimmedQuery,GRAPHQL_PAYLOAD_LIMIT,"..."))}return rawMetadata.variables&&(variables=rawMetadata.variables),{operationType,operationName:rawMetadata.operationName,variables,payload}}__name(sanitizeGraphQlMetadata,"sanitizeGraphQlMetadata");function getOperationType(query){var _a20;return(_a20=query.match(/^\s*(query|mutation|subscription)\b/i))===null||_a20===void 0?void 0:_a20[1]}__name(getOperationType,"getOperationType");function tryJsonParse(text2){try{return JSON.parse(text2)}catch{return}}__name(tryJsonParse,"tryJsonParse");let nextRequestIndex=1;function startRequestCollection(lifeCycle,configuration,sessionManager,userContext,accountContext){const tracer=startTracer(configuration,sessionManager,userContext,accountContext);trackXhr(lifeCycle,configuration,tracer),trackFetch(lifeCycle,configuration,tracer)}__name(startRequestCollection,"startRequestCollection");function trackXhr(lifeCycle,configuration,tracer){const subscription=initXhrObservable(configuration).subscribe(rawContext=>{const context=rawContext;if(isAllowedRequestUrl(context.url))switch(context.state){case"start":tracer.traceXhr(context,context.xhr),context.requestIndex=getNextRequestIndex(),lifeCycle.notify(7,{requestIndex:context.requestIndex,url:context.url});break;case"complete":tracer.clearTracingIfNeeded(context),lifeCycle.notify(8,{duration:context.duration,method:context.method,requestIndex:context.requestIndex,spanId:context.spanId,startClocks:context.startClocks,status:context.status,traceId:context.traceId,traceSampled:context.traceSampled,type:RequestType.XHR,url:context.url,xhr:context.xhr,isAborted:context.isAborted,handlingStack:context.handlingStack,requestBody:context.requestBody,responseBody:context.responseBody});break}});return{stop:__name(()=>subscription.unsubscribe(),"stop")}}__name(trackXhr,"trackXhr");function trackFetch(lifeCycle,configuration,tracer){const subscription=initFetchObservable({responseBodyAction:__name(context=>{var _a20;return!((_a20=findGraphQlConfiguration(context.url,configuration))===null||_a20===void 0)&&_a20.trackResponseErrors?2:1},"responseBodyAction")}).subscribe(rawContext=>{var _a20;const context=rawContext;if(isAllowedRequestUrl(context.url))switch(context.state){case"start":tracer.traceFetch(context),context.requestIndex=getNextRequestIndex(),lifeCycle.notify(7,{requestIndex:context.requestIndex,url:context.url});break;case"resolve":tracer.clearTracingIfNeeded(context),lifeCycle.notify(8,{duration:elapsed(context.startClocks.timeStamp,timeStampNow()),method:context.method,requestIndex:context.requestIndex,responseType:context.responseType,spanId:context.spanId,startClocks:context.startClocks,status:context.status,traceId:context.traceId,traceSampled:context.traceSampled,type:RequestType.FETCH,url:context.url,response:context.response,init:context.init,input:context.input,isAborted:context.isAborted,handlingStack:context.handlingStack,requestBody:(_a20=context.init)===null||_a20===void 0?void 0:_a20.body,responseBody:context.responseBody});break}});return{stop:__name(()=>subscription.unsubscribe(),"stop")}}__name(trackFetch,"trackFetch");function getNextRequestIndex(){const result=nextRequestIndex;return nextRequestIndex+=1,result}__name(getNextRequestIndex,"getNextRequestIndex");function discardNegativeDuration(duration2){return isNumber$1(duration2)&&duration2<0?void 0:duration2}__name(discardNegativeDuration,"discardNegativeDuration");function isTextNode(node2){return node2.nodeType===Node.TEXT_NODE}__name(isTextNode,"isTextNode");function isCommentNode(node2){return node2.nodeType===Node.COMMENT_NODE}__name(isCommentNode,"isCommentNode");function isElementNode(node2){return node2.nodeType===Node.ELEMENT_NODE}__name(isElementNode,"isElementNode");function isNodeShadowHost(node2){return isElementNode(node2)&&!!node2.shadowRoot}__name(isNodeShadowHost,"isNodeShadowHost");function isNodeShadowRoot(node2){const shadowRoot=node2;return!!shadowRoot.host&&shadowRoot.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&isElementNode(shadowRoot.host)}__name(isNodeShadowRoot,"isNodeShadowRoot");function hasChildNodes(node2){return node2.childNodes.length>0||isNodeShadowHost(node2)}__name(hasChildNodes,"hasChildNodes");function forEachChildNodes(node2,callback){let child=node2.firstChild;for(;child;)callback(child),child=child.nextSibling;isNodeShadowHost(node2)&&callback(node2.shadowRoot)}__name(forEachChildNodes,"forEachChildNodes");function getParentNode$1(node2){return isNodeShadowRoot(node2)?node2.host:node2.parentNode}__name(getParentNode$1,"getParentNode$1");function getParentElement(element2){if(element2.parentElement)return element2.parentElement;const parentNode=element2.parentNode;return parentNode&&isNodeShadowRoot(parentNode)?parentNode.host:null}__name(getParentElement,"getParentElement");function retrieveFirstInputTiming(configuration,callback){const startTimeStamp=dateNow();let timingSent=!1;const{stop:removeEventListeners}=addEventListeners(configuration,window,["click","mousedown","keydown","touchstart","pointerdown"],evt=>{if(!evt.cancelable)return;const timing={entryType:"first-input",processingStart:relativeNow(),processingEnd:relativeNow(),startTime:evt.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:__name(()=>({}),"toJSON")};evt.type==="pointerdown"?sendTimingIfPointerIsNotCancelled(configuration,timing):sendTiming(timing)},{passive:!0,capture:!0});return{stop:removeEventListeners};function sendTimingIfPointerIsNotCancelled(configuration2,timing){addEventListeners(configuration2,window,["pointerup","pointercancel"],event=>{event.type==="pointerup"&&sendTiming(timing)},{once:!0})}function sendTiming(timing){if(!timingSent){timingSent=!0,removeEventListeners();const delay=timing.processingStart-timing.startTime;delay>=0&&delay<dateNow()-startTimeStamp&&callback(timing)}}}__name(retrieveFirstInputTiming,"retrieveFirstInputTiming");var RumPerformanceEntryType;(function(RumPerformanceEntryType2){RumPerformanceEntryType2.EVENT="event",RumPerformanceEntryType2.FIRST_INPUT="first-input",RumPerformanceEntryType2.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",RumPerformanceEntryType2.LAYOUT_SHIFT="layout-shift",RumPerformanceEntryType2.LONG_TASK="longtask",RumPerformanceEntryType2.LONG_ANIMATION_FRAME="long-animation-frame",RumPerformanceEntryType2.NAVIGATION="navigation",RumPerformanceEntryType2.PAINT="paint",RumPerformanceEntryType2.RESOURCE="resource",RumPerformanceEntryType2.VISIBILITY_STATE="visibility-state"})(RumPerformanceEntryType||(RumPerformanceEntryType={}));function createPerformanceObservable(configuration,options){return new Observable(observable=>{if(!window.PerformanceObserver)return;const handlePerformanceEntries=__name(entries=>{const rumPerformanceEntries=filterRumPerformanceEntries(entries);rumPerformanceEntries.length>0&&observable.notify(rumPerformanceEntries)},"handlePerformanceEntries");let timeoutId,isObserverInitializing=!0;const observer2=new PerformanceObserver(monitor(entries=>{isObserverInitializing?timeoutId=setTimeout$1(()=>handlePerformanceEntries(entries.getEntries())):handlePerformanceEntries(entries.getEntries())}));try{observer2.observe(options)}catch{if([RumPerformanceEntryType.RESOURCE,RumPerformanceEntryType.NAVIGATION,RumPerformanceEntryType.LONG_TASK,RumPerformanceEntryType.PAINT].includes(options.type)){options.buffered&&(timeoutId=setTimeout$1(()=>handlePerformanceEntries(performance.getEntriesByType(options.type))));try{observer2.observe({entryTypes:[options.type]})}catch{return}}}isObserverInitializing=!1,manageResourceTimingBufferFull(configuration);let stopFirstInputTiming;return!supportPerformanceTimingEvent(RumPerformanceEntryType.FIRST_INPUT)&&options.type===RumPerformanceEntryType.FIRST_INPUT&&({stop:stopFirstInputTiming}=retrieveFirstInputTiming(configuration,timing=>{handlePerformanceEntries([timing])})),()=>{observer2.disconnect(),stopFirstInputTiming&&stopFirstInputTiming(),clearTimeout$1(timeoutId)}})}__name(createPerformanceObservable,"createPerformanceObservable");let resourceTimingBufferFullListener;function manageResourceTimingBufferFull(configuration){return!resourceTimingBufferFullListener&&supportPerformanceObject()&&"addEventListener"in performance&&(resourceTimingBufferFullListener=addEventListener(configuration,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{resourceTimingBufferFullListener?.stop()}}__name(manageResourceTimingBufferFull,"manageResourceTimingBufferFull");function supportPerformanceObject(){return window.performance!==void 0&&"getEntries"in performance}__name(supportPerformanceObject,"supportPerformanceObject");function supportPerformanceTimingEvent(entryType){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(entryType)}__name(supportPerformanceTimingEvent,"supportPerformanceTimingEvent");function filterRumPerformanceEntries(entries){return entries.filter(entry=>!isForbiddenResource(entry))}__name(filterRumPerformanceEntries,"filterRumPerformanceEntries");function isForbiddenResource(entry){return entry.entryType===RumPerformanceEntryType.RESOURCE&&(!isAllowedRequestUrl(entry.name)||!hasValidResourceEntryDuration(entry))}__name(isForbiddenResource,"isForbiddenResource");const PAGE_ACTIVITY_VALIDATION_DELAY=100,PAGE_ACTIVITY_END_DELAY=100,EXCLUDED_MUTATIONS_ATTRIBUTE="data-dd-excluded-activity-mutations";function waitPageActivityEnd(lifeCycle,domMutationObservable,windowOpenObservable,configuration,pageActivityEndCallback,maxDuration){const pageActivityObservable=createPageActivityObservable(lifeCycle,domMutationObservable,windowOpenObservable,configuration);let pageActivityEndTimeoutId,hasCompleted=!1;const validationTimeoutId=setTimeout$1(monitor(()=>complete({hadActivity:!1})),PAGE_ACTIVITY_VALIDATION_DELAY),maxDurationTimeoutId=maxDuration!==void 0?setTimeout$1(monitor(()=>complete({hadActivity:!0,end:timeStampNow()})),maxDuration):void 0,pageActivitySubscription=pageActivityObservable.subscribe(({isBusy})=>{clearTimeout$1(validationTimeoutId),clearTimeout$1(pageActivityEndTimeoutId);const lastChangeTime=timeStampNow();isBusy||(pageActivityEndTimeoutId=setTimeout$1(monitor(()=>complete({hadActivity:!0,end:lastChangeTime})),PAGE_ACTIVITY_END_DELAY))}),stop=__name(()=>{hasCompleted=!0,clearTimeout$1(validationTimeoutId),clearTimeout$1(pageActivityEndTimeoutId),clearTimeout$1(maxDurationTimeoutId),pageActivitySubscription.unsubscribe()},"stop");function complete(event){hasCompleted||(stop(),pageActivityEndCallback(event))}return __name(complete,"complete"),{stop}}__name(waitPageActivityEnd,"waitPageActivityEnd");function createPageActivityObservable(lifeCycle,domMutationObservable,windowOpenObservable,configuration){return new Observable(observable=>{const subscriptions=[];let firstRequestIndex,pendingRequestsCount=0;return subscriptions.push(domMutationObservable.subscribe(mutations=>{mutations.every(isExcludedMutation)||notifyPageActivity()}),windowOpenObservable.subscribe(notifyPageActivity),createPerformanceObservable(configuration,{type:RumPerformanceEntryType.RESOURCE}).subscribe(entries=>{entries.some(entry=>!isExcludedUrl(configuration,entry.name))&¬ifyPageActivity()}),lifeCycle.subscribe(7,startEvent=>{isExcludedUrl(configuration,startEvent.url)||(firstRequestIndex===void 0&&(firstRequestIndex=startEvent.requestIndex),pendingRequestsCount+=1,notifyPageActivity())}),lifeCycle.subscribe(8,request=>{isExcludedUrl(configuration,request.url)||firstRequestIndex===void 0||request.requestIndex<firstRequestIndex||(pendingRequestsCount-=1,notifyPageActivity())})),()=>{subscriptions.forEach(s2=>s2.unsubscribe())};function notifyPageActivity(){observable.notify({isBusy:pendingRequestsCount>0})}__name(notifyPageActivity,"notifyPageActivity")})}__name(createPageActivityObservable,"createPageActivityObservable");function isExcludedUrl(configuration,requestUrl){return matchList(configuration.excludedActivityUrls,requestUrl)}__name(isExcludedUrl,"isExcludedUrl");function isExcludedMutation(mutation){const targetElement=mutation.type==="characterData"?mutation.target.parentElement:mutation.target;return!!(targetElement&&isElementNode(targetElement)&&targetElement.matches(`[${EXCLUDED_MUTATIONS_ATTRIBUTE}], [${EXCLUDED_MUTATIONS_ATTRIBUTE}] *`))}__name(isExcludedMutation,"isExcludedMutation");const DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE="data-dd-action-name",ACTION_NAME_PLACEHOLDER="Masked Element",SHADOW_DOM_MARKER="::shadow ",STABLE_ATTRIBUTES=[DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],GLOBALLY_UNIQUE_SELECTOR_GETTERS=[getStableAttributeSelector,getIDSelector],UNIQUE_AMONG_CHILDREN_SELECTOR_GETTERS=[getStableAttributeSelector,getClassSelector,getTagNameSelector];function getSelectorFromElement(targetElement,actionNameAttribute){if(!targetElement.isConnected)return;const subtrees=getAllSubtreeTargets(targetElement),selectorParts=[];for(const{rootNode,target}of subtrees){const selector=getSelectorFromElementWithinSubtree(target,rootNode,actionNameAttribute);if(!selector)return;selectorParts.push(selector)}return selectorParts.join(SHADOW_DOM_MARKER)}__name(getSelectorFromElement,"getSelectorFromElement");function getAllSubtreeTargets(element2){const result=[];let currentTarget=element2;for(;currentTarget;){const rootNode=currentTarget.getRootNode();if(result.push({rootNode,target:currentTarget}),isNodeShadowRoot(rootNode))currentTarget=rootNode.host;else break}return result.reverse()}__name(getAllSubtreeTargets,"getAllSubtreeTargets");function getSelectorFromElementWithinSubtree(targetElement,rootNode,actionNameAttribute){let currentSelector,currentElement=targetElement;for(;currentElement&¤tElement.nodeName!=="HTML";){const globallyUniqueSelector=findSelector(currentElement,rootNode,GLOBALLY_UNIQUE_SELECTOR_GETTERS,isSelectorUniqueWithinRoot,actionNameAttribute,currentSelector);if(globallyUniqueSelector)return combineSelector(globallyUniqueSelector,currentSelector);const elementSelector=findSelector(currentElement,rootNode,UNIQUE_AMONG_CHILDREN_SELECTOR_GETTERS,isSelectorUniqueAmongSiblings,actionNameAttribute,currentSelector)||getPositionSelector(currentElement);currentSelector=combineSelector(elementSelector,currentSelector),currentElement=currentElement.parentElement}return currentSelector}__name(getSelectorFromElementWithinSubtree,"getSelectorFromElementWithinSubtree");function isGeneratedValue(value){return/[0-9]/.test(value)}__name(isGeneratedValue,"isGeneratedValue");function getIDSelector(element2){if(element2.id&&!isGeneratedValue(element2.id))return`#${CSS.escape(element2.id)}`}__name(getIDSelector,"getIDSelector");function getClassSelector(element2){if(element2.tagName==="BODY")return;const classList=element2.classList;for(let i2=0;i2<classList.length;i2+=1){const className=classList[i2];if(!isGeneratedValue(className))return`${CSS.escape(element2.tagName)}.${CSS.escape(className)}`}}__name(getClassSelector,"getClassSelector");function getTagNameSelector(element2){return CSS.escape(element2.tagName)}__name(getTagNameSelector,"getTagNameSelector");function getStableAttributeSelector(element2,actionNameAttribute){if(actionNameAttribute){const selector=getAttributeSelector(actionNameAttribute);if(selector)return selector}for(const attributeName of STABLE_ATTRIBUTES){const selector=getAttributeSelector(attributeName);if(selector)return selector}function getAttributeSelector(attributeName){if(element2.hasAttribute(attributeName))return`${CSS.escape(element2.tagName)}[${attributeName}="${CSS.escape(element2.getAttribute(attributeName))}"]`}__name(getAttributeSelector,"getAttributeSelector")}__name(getStableAttributeSelector,"getStableAttributeSelector");function getPositionSelector(element2){let sibling=element2.parentNode.firstElementChild,elementIndex=1;for(;sibling&&sibling!==element2;)sibling.tagName===element2.tagName&&(elementIndex+=1),sibling=sibling.nextElementSibling;return`${CSS.escape(element2.tagName)}:nth-of-type(${elementIndex})`}__name(getPositionSelector,"getPositionSelector");function findSelector(element2,rootNode,selectorGetters,predicate,actionNameAttribute,childSelector){for(const selectorGetter of selectorGetters){const elementSelector=selectorGetter(element2,actionNameAttribute);if(elementSelector&&predicate(element2,rootNode,elementSelector,childSelector))return elementSelector}}__name(findSelector,"findSelector");function isSelectorUniqueWithinRoot(_element,rootNode,elementSelector,childSelector){return rootNode.querySelectorAll(combineSelector(elementSelector,childSelector)).length===1}__name(isSelectorUniqueWithinRoot,"isSelectorUniqueWithinRoot");function isSelectorUniqueAmongSiblings(currentElement,_rootNode,currentElementSelector,childSelector){let isSiblingMatching;if(childSelector===void 0)isSiblingMatching=__name(sibling2=>sibling2.matches(currentElementSelector),"isSiblingMatching");else{const scopedSelector=combineSelector(`${currentElementSelector}:scope`,childSelector);isSiblingMatching=__name(sibling2=>sibling2.querySelector(scopedSelector)!==null,"isSiblingMatching")}let sibling=currentElement.previousElementSibling;for(;sibling;){if(isSiblingMatching(sibling))return!1;sibling=sibling.previousElementSibling}for(sibling=currentElement.nextElementSibling;sibling;){if(isSiblingMatching(sibling))return!1;sibling=sibling.nextElementSibling}return!0}__name(isSelectorUniqueAmongSiblings,"isSelectorUniqueAmongSiblings");function combineSelector(parent,child){return child?`${parent}>${child}`:parent}__name(combineSelector,"combineSelector");const NodePrivacyLevel={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:DefaultPrivacyLevel.ALLOW,MASK:DefaultPrivacyLevel.MASK,MASK_USER_INPUT:DefaultPrivacyLevel.MASK_USER_INPUT,MASK_UNLESS_ALLOWLISTED:DefaultPrivacyLevel.MASK_UNLESS_ALLOWLISTED},PRIVACY_ATTR_NAME="data-dd-privacy",PRIVACY_ATTR_VALUE_HIDDEN="hidden",PRIVACY_CLASS_PREFIX="dd-privacy-",CENSORED_STRING_MARK="***",CENSORED_IMG_MARK="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",FORM_PRIVATE_TAG_NAMES={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},TEXT_MASKING_CHAR="x";function getPrivacySelector(privacyLevel){return`[${PRIVACY_ATTR_NAME}="${privacyLevel}"], .${PRIVACY_CLASS_PREFIX}${privacyLevel}`}__name(getPrivacySelector,"getPrivacySelector");function getNodePrivacyLevel(node2,defaultPrivacyLevel,cache2){if(cache2&&cache2.has(node2))return cache2.get(node2);const parentNode=getParentNode$1(node2),parentNodePrivacyLevel=parentNode?getNodePrivacyLevel(parentNode,defaultPrivacyLevel,cache2):defaultPrivacyLevel,selfNodePrivacyLevel=getNodeSelfPrivacyLevel(node2),nodePrivacyLevel=reducePrivacyLevel(selfNodePrivacyLevel,parentNodePrivacyLevel);return cache2&&cache2.set(node2,nodePrivacyLevel),nodePrivacyLevel}__name(getNodePrivacyLevel,"getNodePrivacyLevel");function reducePrivacyLevel(childPrivacyLevel,parentNodePrivacyLevel){switch(parentNodePrivacyLevel){case NodePrivacyLevel.HIDDEN:case NodePrivacyLevel.IGNORE:return parentNodePrivacyLevel}switch(childPrivacyLevel){case NodePrivacyLevel.ALLOW:case NodePrivacyLevel.MASK:case NodePrivacyLevel.MASK_USER_INPUT:case NodePrivacyLevel.MASK_UNLESS_ALLOWLISTED:case NodePrivacyLevel.HIDDEN:case NodePrivacyLevel.IGNORE:return childPrivacyLevel;default:return parentNodePrivacyLevel}}__name(reducePrivacyLevel,"reducePrivacyLevel");function getNodeSelfPrivacyLevel(node2){if(isElementNode(node2)){if(node2.tagName==="BASE")return NodePrivacyLevel.ALLOW;if(node2.tagName==="INPUT"){const inputElement=node2;if(inputElement.type==="password"||inputElement.type==="email"||inputElement.type==="tel"||inputElement.type==="hidden")return NodePrivacyLevel.MASK;const autocomplete=inputElement.getAttribute("autocomplete");if(autocomplete&&(autocomplete.startsWith("cc-")||autocomplete.endsWith("-password")))return NodePrivacyLevel.MASK}if(node2.matches(getPrivacySelector(NodePrivacyLevel.HIDDEN)))return NodePrivacyLevel.HIDDEN;if(node2.matches(getPrivacySelector(NodePrivacyLevel.MASK)))return NodePrivacyLevel.MASK;if(node2.matches(getPrivacySelector(NodePrivacyLevel.MASK_UNLESS_ALLOWLISTED)))return NodePrivacyLevel.MASK_UNLESS_ALLOWLISTED;if(node2.matches(getPrivacySelector(NodePrivacyLevel.MASK_USER_INPUT)))return NodePrivacyLevel.MASK_USER_INPUT;if(node2.matches(getPrivacySelector(NodePrivacyLevel.ALLOW)))return NodePrivacyLevel.ALLOW;if(shouldIgnoreElement(node2))return NodePrivacyLevel.IGNORE}}__name(getNodeSelfPrivacyLevel,"getNodeSelfPrivacyLevel");function shouldMaskNode(node2,privacyLevel){switch(privacyLevel){case NodePrivacyLevel.MASK:case NodePrivacyLevel.HIDDEN:case NodePrivacyLevel.IGNORE:return!0;case NodePrivacyLevel.MASK_UNLESS_ALLOWLISTED:return isTextNode(node2)?isFormElement(node2.parentNode)?!0:!isAllowlisted(node2.textContent||""):isFormElement(node2);case NodePrivacyLevel.MASK_USER_INPUT:return isTextNode(node2)?isFormElement(node2.parentNode):isFormElement(node2);default:return!1}}__name(shouldMaskNode,"shouldMaskNode");function shouldMaskAttribute(tagName,attributeName,attributeValue,nodePrivacyLevel,configuration){if(nodePrivacyLevel!==NodePrivacyLevel.MASK&&nodePrivacyLevel!==NodePrivacyLevel.MASK_UNLESS_ALLOWLISTED||attributeName===PRIVACY_ATTR_NAME||STABLE_ATTRIBUTES.includes(attributeName)||attributeName===configuration.actionNameAttribute)return!1;switch(attributeName){case"title":case"alt":case"placeholder":case"aria-label":case"name":return!0}return!!(tagName==="A"&&attributeName==="href"||tagName==="IFRAME"&&attributeName==="srcdoc"||attributeValue&&attributeName.startsWith("data-")||(tagName==="IMG"||tagName==="SOURCE")&&(attributeName==="src"||attributeName==="srcset"))}__name(shouldMaskAttribute,"shouldMaskAttribute");function isFormElement(node2){if(!node2||node2.nodeType!==node2.ELEMENT_NODE)return!1;const element2=node2;if(element2.tagName==="INPUT")switch(element2.type){case"button":case"color":case"reset":case"submit":return!1}return!!FORM_PRIVATE_TAG_NAMES[element2.tagName]}__name(isFormElement,"isFormElement");const censorText=__name(text2=>text2.replace(/\S/g,TEXT_MASKING_CHAR),"censorText");function getTextContent(textNode,parentNodePrivacyLevel){var _a20;const parentTagName=(_a20=textNode.parentElement)===null||_a20===void 0?void 0:_a20.tagName;let textContent=textNode.textContent||"";if(parentTagName==="HEAD"&&!textContent.trim())return;const nodePrivacyLevel=parentNodePrivacyLevel;if(parentTagName==="SCRIPT")textContent=CENSORED_STRING_MARK;else if(nodePrivacyLevel===NodePrivacyLevel.HIDDEN)textContent=CENSORED_STRING_MARK;else if(shouldMaskNode(textNode,nodePrivacyLevel))if(parentTagName==="DATALIST"||parentTagName==="SELECT"||parentTagName==="OPTGROUP"){if(!textContent.trim())return}else parentTagName==="OPTION"?textContent=CENSORED_STRING_MARK:nodePrivacyLevel===NodePrivacyLevel.MASK_UNLESS_ALLOWLISTED?textContent=maskDisallowedTextContent(textContent):textContent=censorText(textContent);return textContent}__name(getTextContent,"getTextContent");function shouldIgnoreElement(element2){if(element2.nodeName==="SCRIPT")return!0;if(element2.nodeName==="LINK"){const relAttribute=getLowerCaseAttribute("rel");return/preload|prefetch/i.test(relAttribute)&&getLowerCaseAttribute("as")==="script"||relAttribute==="shortcut icon"||relAttribute==="icon"}if(element2.nodeName==="META"){const nameAttribute=getLowerCaseAttribute("name"),relAttribute=getLowerCaseAttribute("rel"),propertyAttribute=getLowerCaseAttribute("property");return/^msapplication-tile(image|color)$/.test(nameAttribute)||nameAttribute==="application-name"||relAttribute==="icon"||relAttribute==="apple-touch-icon"||relAttribute==="shortcut icon"||nameAttribute==="keywords"||nameAttribute==="description"||/^(og|twitter|fb):/.test(propertyAttribute)||/^(og|twitter):/.test(nameAttribute)||nameAttribute==="pinterest"||nameAttribute==="robots"||nameAttribute==="googlebot"||nameAttribute==="bingbot"||element2.hasAttribute("http-equiv")||nameAttribute==="author"||nameAttribute==="generator"||nameAttribute==="framework"||nameAttribute==="publisher"||nameAttribute==="progid"||/^article:/.test(propertyAttribute)||/^product:/.test(propertyAttribute)||nameAttribute==="google-site-verification"||nameAttribute==="yandex-verification"||nameAttribute==="csrf-token"||nameAttribute==="p:domain_verify"||nameAttribute==="verify-v1"||nameAttribute==="verification"||nameAttribute==="shopify-checkout-api-token"}function getLowerCaseAttribute(name2){return(element2.getAttribute(name2)||"").toLowerCase()}return __name(getLowerCaseAttribute,"getLowerCaseAttribute"),!1}__name(shouldIgnoreElement,"shouldIgnoreElement");function isAllowlisted(text2){var _a20;return!text2||!text2.trim()?!0:((_a20=window.$DD_ALLOW)===null||_a20===void 0?void 0:_a20.has(text2.toLocaleLowerCase()))||!1}__name(isAllowlisted,"isAllowlisted");function maskDisallowedTextContent(text2,fixedMask){return isAllowlisted(text2)?text2:fixedMask||censorText(text2)}__name(maskDisallowedTextContent,"maskDisallowedTextContent");function trackEventCounts({lifeCycle,isChildEvent,onChange:callback=noop$2}){const eventCounts={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},subscription=lifeCycle.subscribe(13,event=>{var _a20;if(!(event.type==="view"||event.type==="vital"||!isChildEvent(event)))switch(event.type){case RumEventType.ERROR:eventCounts.errorCount+=1,callback();break;case RumEventType.ACTION:eventCounts.actionCount+=1,event.action.frustration&&(eventCounts.frustrationCount+=event.action.frustration.type.length),callback();break;case RumEventType.LONG_TASK:eventCounts.longTaskCount+=1,callback();break;case RumEventType.RESOURCE:!((_a20=event._dd)===null||_a20===void 0)&&_a20.discarded||(eventCounts.resourceCount+=1,callback());break}});return{stop:__name(()=>{subscription.unsubscribe()},"stop"),eventCounts}}__name(trackEventCounts,"trackEventCounts");const EVENT_CONTEXT_TIME_OUT_DELAY=5*ONE_MINUTE;function startEventTracker(lifeCycle){const history2=createValueHistory({expireDelay:EVENT_CONTEXT_TIME_OUT_DELAY}),keyedEvents=new Map;function cleanUpEvent(event){var _a20;keyedEvents.delete(event.key),(_a20=event.eventCounts)===null||_a20===void 0||_a20.stop()}__name(cleanUpEvent,"cleanUpEvent");function discardAll(){keyedEvents.forEach(event=>{cleanUpEvent(event)}),history2.reset()}__name(discardAll,"discardAll");const sessionRenewalSubscription=lifeCycle.subscribe(10,discardAll);function start(key,startClocks,data,options){const id2=generateUUID(),historyEntry=history2.add(id2,startClocks.relative),existing=keyedEvents.get(key);existing&&cleanUpEvent(existing);const eventCounts=options?.isChildEvent?trackEventCounts({lifeCycle,isChildEvent:options.isChildEvent(id2)}):void 0;keyedEvents.set(key,{id:id2,key,startClocks,data,historyEntry,eventCounts})}__name(start,"start");function stop(key,stopClocks,extraData){var _a20;const event=keyedEvents.get(key);if(!event)return;const finalData=extraData?combine(event.data,extraData):event.data;event.historyEntry.close(stopClocks.relative);const duration2=elapsed(event.startClocks.timeStamp,stopClocks.timeStamp),counts=(_a20=event.eventCounts)===null||_a20===void 0?void 0:_a20.eventCounts;return cleanUpEvent(event),{...finalData,id:event.id,startClocks:event.startClocks,duration:duration2,counts}}__name(stop,"stop");function discard(key){var _a20;const event=keyedEvents.get(key);if(!event)return;const counts=(_a20=event.eventCounts)===null||_a20===void 0?void 0:_a20.eventCounts;return cleanUpEvent(event),event.historyEntry.remove(),{...event.data,id:event.id,startClocks:event.startClocks,counts}}__name(discard,"discard");function findId(startTime){return history2.findAll(startTime)}__name(findId,"findId");function getCounts(key){var _a20,_b;return(_b=(_a20=keyedEvents.get(key))===null||_a20===void 0?void 0:_a20.eventCounts)===null||_b===void 0?void 0:_b.eventCounts}__name(getCounts,"getCounts");function stopTracker(){sessionRenewalSubscription.unsubscribe(),discardAll(),history2.stop()}return __name(stopTracker,"stopTracker"),{start,stop,discard,getCounts,findId,stopAll:stopTracker}}__name(startEventTracker,"startEventTracker");const MAX_DURATION_BETWEEN_CLICKS=ONE_SECOND,MAX_DISTANCE_BETWEEN_CLICKS=100;function createClickChain(firstClick,onFinalize){const bufferedClicks=[];let status=0,maxDurationBetweenClicksTimeoutId;appendClick(firstClick);function appendClick(click){click.stopObservable.subscribe(tryFinalize),bufferedClicks.push(click),clearTimeout$1(maxDurationBetweenClicksTimeoutId),maxDurationBetweenClicksTimeoutId=setTimeout$1(dontAcceptMoreClick,MAX_DURATION_BETWEEN_CLICKS)}__name(appendClick,"appendClick");function tryFinalize(){status===1&&bufferedClicks.every(click=>click.isStopped())&&(status=2,onFinalize(bufferedClicks))}__name(tryFinalize,"tryFinalize");function dontAcceptMoreClick(){clearTimeout$1(maxDurationBetweenClicksTimeoutId),status===0&&(status=1,tryFinalize())}return __name(dontAcceptMoreClick,"dontAcceptMoreClick"),{tryAppend:__name(click=>status!==0?!1:bufferedClicks.length>0&&!areEventsSimilar(bufferedClicks[bufferedClicks.length-1].event,click.event)?(dontAcceptMoreClick(),!1):(appendClick(click),!0),"tryAppend"),stop:__name(()=>{dontAcceptMoreClick()},"stop")}}__name(createClickChain,"createClickChain");function areEventsSimilar(first,second){return first.target===second.target&&mouseEventDistance(first,second)<=MAX_DISTANCE_BETWEEN_CLICKS&&first.timeStamp-second.timeStamp<=MAX_DURATION_BETWEEN_CLICKS}__name(areEventsSimilar,"areEventsSimilar");function mouseEventDistance(origin2,other){return Math.sqrt(Math.pow(origin2.clientX-other.clientX,2)+Math.pow(origin2.clientY-other.clientY,2))}__name(mouseEventDistance,"mouseEventDistance");function getActionNameFromElement(element2,rumConfiguration,nodePrivacyLevel=NodePrivacyLevel.ALLOW){const nodePrivacyLevelCache=new Map,{actionNameAttribute:userProgrammaticAttribute}=rumConfiguration,defaultActionName=getActionNameFromElementProgrammatically(element2,DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE)||userProgrammaticAttribute&&getActionNameFromElementProgrammatically(element2,userProgrammaticAttribute);return defaultActionName?{name:defaultActionName,nameSource:"custom_attribute"}:nodePrivacyLevel===NodePrivacyLevel.MASK?{name:ACTION_NAME_PLACEHOLDER,nameSource:"mask_placeholder"}:getActionNameFromElementForStrategies(element2,priorityStrategies,rumConfiguration,nodePrivacyLevelCache)||getActionNameFromElementForStrategies(element2,fallbackStrategies,rumConfiguration,nodePrivacyLevelCache)||{name:"",nameSource:"blank"}}__name(getActionNameFromElement,"getActionNameFromElement");function getActionNameFromElementProgrammatically(targetElement,programmaticAttribute){const elementWithAttribute=closestShadowAware(targetElement,`[${programmaticAttribute}]`);if(!elementWithAttribute)return;const name2=elementWithAttribute.getAttribute(programmaticAttribute);return truncate(normalizeWhitespace(name2.trim()))}__name(getActionNameFromElementProgrammatically,"getActionNameFromElementProgrammatically");function closestShadowAware(element2,selector){let current=element2;for(;current;){if(current.matches(selector))return current;current=getParentElement(current)}return null}__name(closestShadowAware,"closestShadowAware");const priorityStrategies=[(element2,rumConfiguration,nodePrivacyLevelCache)=>{if("labels"in element2&&element2.labels&&element2.labels.length>0)return getActionNameFromTextualContent(element2.labels[0],rumConfiguration,nodePrivacyLevelCache)},element2=>{if(element2.nodeName==="INPUT"){const input=element2,type=input.getAttribute("type");if(type==="button"||type==="submit"||type==="reset")return{name:input.value,nameSource:"text_content"}}},(element2,rumConfiguration,nodePrivacyLevelCache)=>{if(element2.nodeName==="BUTTON"||element2.nodeName==="LABEL"||element2.getAttribute("role")==="button")return getActionNameFromTextualContent(element2,rumConfiguration,nodePrivacyLevelCache)},(element2,rumConfiguration,nodePrivacyLevelCache)=>getActionNameFromStandardAttribute(element2,"aria-label",rumConfiguration,nodePrivacyLevelCache),(element2,rumConfiguration,nodePrivacyLevelCache)=>{const labelledByAttribute=element2.getAttribute("aria-labelledby");if(labelledByAttribute)return{name:labelledByAttribute.split(/\s+/).map(id2=>getElementById(element2,id2)).filter(label=>!!label).map(element3=>getTextualContent(element3,rumConfiguration,nodePrivacyLevelCache)).join(" "),nameSource:"text_content"}},(element2,rumConfiguration,nodePrivacyLevelCache)=>getActionNameFromStandardAttribute(element2,"alt",rumConfiguration,nodePrivacyLevelCache),(element2,rumConfiguration,nodePrivacyLevelCache)=>getActionNameFromStandardAttribute(element2,"name",rumConfiguration,nodePrivacyLevelCache),(element2,rumConfiguration,nodePrivacyLevelCache)=>getActionNameFromStandardAttribute(element2,"title",rumConfiguration,nodePrivacyLevelCache),(element2,rumConfiguration,nodePrivacyLevelCache)=>getActionNameFromStandardAttribute(element2,"placeholder",rumConfiguration,nodePrivacyLevelCache),(element2,rumConfiguration,nodePrivacyLevelCache)=>{if("options"in element2&&element2.options.length>0)return getActionNameFromTextualContent(element2.options[0],rumConfiguration,nodePrivacyLevelCache)}],fallbackStrategies=[(element2,rumConfiguration,nodePrivacyLevelCache)=>getActionNameFromTextualContent(element2,rumConfiguration,nodePrivacyLevelCache)],MAX_PARENTS_TO_CONSIDER=10;function getActionNameFromElementForStrategies(targetElement,strategies,rumConfiguration,nodePrivacyLevelCache){let element2=targetElement,recursionCounter=0;for(;recursionCounter<=MAX_PARENTS_TO_CONSIDER&&element2&&element2.nodeName!=="BODY"&&element2.nodeName!=="HTML"&&element2.nodeName!=="HEAD";){for(const strategy of strategies){const actionName=strategy(element2,rumConfiguration,nodePrivacyLevelCache);if(actionName){const{name:name2,nameSource}=actionName,trimmedName=name2&&name2.trim();if(trimmedName)return{name:truncate(normalizeWhitespace(trimmedName)),nameSource}}}if(element2.nodeName==="FORM")break;element2=getParentElement(element2),recursionCounter+=1}}__name(getActionNameFromElementForStrategies,"getActionNameFromElementForStrategies");function normalizeWhitespace(s2){return s2.replace(/\s+/g," ")}__name(normalizeWhitespace,"normalizeWhitespace");function truncate(s2){return s2.length>100?`${safeTruncate(s2,100)} [...]`:s2}__name(truncate,"truncate");function getElementById(refElement,id2){const rootNode=refElement.getRootNode();if(rootNode instanceof ShadowRoot){const shadowElement=rootNode.getElementById(id2);if(shadowElement)return shadowElement}return refElement.ownerDocument?refElement.ownerDocument.getElementById(id2):null}__name(getElementById,"getElementById");function getActionNameFromStandardAttribute(element2,attribute,rumConfiguration,nodePrivacyLevelCache){const{enablePrivacyForActionName,defaultPrivacyLevel}=rumConfiguration;let attributeValue=element2.getAttribute(attribute);if(attributeValue&&enablePrivacyForActionName){const nodePrivacyLevel=getNodePrivacyLevel(element2,defaultPrivacyLevel,nodePrivacyLevelCache);shouldMaskAttribute(element2.tagName,attribute,attributeValue,nodePrivacyLevel,rumConfiguration)&&(attributeValue=maskDisallowedTextContent(attributeValue,ACTION_NAME_PLACEHOLDER))}else attributeValue||(attributeValue="");return{name:attributeValue,nameSource:"standard_attribute"}}__name(getActionNameFromStandardAttribute,"getActionNameFromStandardAttribute");function getActionNameFromTextualContent(element2,rumConfiguration,nodePrivacyLevelCache){return{name:getTextualContent(element2,rumConfiguration,nodePrivacyLevelCache)||"",nameSource:"text_content"}}__name(getActionNameFromTextualContent,"getActionNameFromTextualContent");function getTextualContent(element2,rumConfiguration,nodePrivacyLevelCache){if(element2.isContentEditable)return;const{enablePrivacyForActionName,actionNameAttribute:userProgrammaticAttribute,defaultPrivacyLevel}=rumConfiguration;if(isExperimentalFeatureEnabled(ExperimentalFeature.USE_TREE_WALKER_FOR_ACTION_NAME))return getTextualContentWithTreeWalker(element2,userProgrammaticAttribute,enablePrivacyForActionName,defaultPrivacyLevel,nodePrivacyLevelCache);if("innerText"in element2){let text2=element2.innerText;const removeTextFromElements=__name(query=>{const list2=element2.querySelectorAll(query);for(let index2=0;index2<list2.length;index2+=1){const element3=list2[index2];if("innerText"in element3){const textToReplace=element3.innerText;textToReplace&&textToReplace.trim().length>0&&(text2=text2.replace(textToReplace,""))}}},"removeTextFromElements");return removeTextFromElements(`[${DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE}]`),userProgrammaticAttribute&&removeTextFromElements(`[${userProgrammaticAttribute}]`),enablePrivacyForActionName&&removeTextFromElements(`${getPrivacySelector(NodePrivacyLevel.HIDDEN)}, ${getPrivacySelector(NodePrivacyLevel.MASK)}`),text2}return element2.textContent}__name(getTextualContent,"getTextualContent");function getTextualContentWithTreeWalker(element2,userProgrammaticAttribute,privacyEnabledActionName,defaultPrivacyLevel,nodePrivacyLevelCache){const walker=document.createTreeWalker(element2,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,rejectInvisibleOrMaskedElementsFilter);let text2="";for(;walker.nextNode();){const node2=walker.currentNode;if(isElementNode(node2)){(node2.nodeName==="BR"||node2.nodeName==="P"||["block","flex","grid","list-item","table","table-caption"].includes(getComputedStyle(node2).display))&&(text2+=" ");continue}text2+=node2.textContent||""}return text2.replace(/\s+/g," ").trim();function rejectInvisibleOrMaskedElementsFilter(node2){const nodeSelfPrivacyLevel=getNodePrivacyLevel(node2,defaultPrivacyLevel,nodePrivacyLevelCache);if(privacyEnabledActionName&&nodeSelfPrivacyLevel&&shouldMaskNode(node2,nodeSelfPrivacyLevel))return NodeFilter.FILTER_REJECT;if(isElementNode(node2)){if(node2.hasAttribute(DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE)||userProgrammaticAttribute&&node2.hasAttribute(userProgrammaticAttribute))return NodeFilter.FILTER_REJECT;const style=getComputedStyle(node2);if(style.visibility!=="visible"||style.display==="none"||style.contentVisibility&&style.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}__name(getTextualContentWithTreeWalker,"getTextualContentWithTreeWalker");function listenActionEvents(configuration,{onPointerDown,onPointerUp}){let selectionEmptyAtPointerDown,userActivity={selection:!1,input:!1,scroll:!1},clickContext;const listeners=[addEventListener(configuration,window,"pointerdown",event=>{isValidPointerEvent(event)&&(selectionEmptyAtPointerDown=isSelectionEmpty(),userActivity={selection:!1,input:!1,scroll:!1},clickContext=onPointerDown(event))},{capture:!0}),addEventListener(configuration,window,"selectionchange",()=>{(!selectionEmptyAtPointerDown||!isSelectionEmpty())&&(userActivity.selection=!0)},{capture:!0}),addEventListener(configuration,window,"scroll",()=>{userActivity.scroll=!0},{capture:!0,passive:!0}),addEventListener(configuration,window,"pointerup",event=>{if(isValidPointerEvent(event)&&clickContext){const localUserActivity=userActivity;onPointerUp(clickContext,event,()=>localUserActivity),clickContext=void 0}},{capture:!0}),addEventListener(configuration,window,"input",()=>{userActivity.input=!0},{capture:!0})];return{stop:__name(()=>{listeners.forEach(listener=>listener.stop())},"stop")}}__name(listenActionEvents,"listenActionEvents");function isSelectionEmpty(){const selection=window.getSelection();return!selection||selection.isCollapsed}__name(isSelectionEmpty,"isSelectionEmpty");function isValidPointerEvent(event){return event.target instanceof Element&&event.isPrimary!==!1}__name(isValidPointerEvent,"isValidPointerEvent");const MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE=3;function computeFrustration(clicks,rageClick){if(isRage(clicks))return rageClick.addFrustration(FrustrationType.RAGE_CLICK),clicks.some(isDead)&&rageClick.addFrustration(FrustrationType.DEAD_CLICK),rageClick.hasError&&rageClick.addFrustration(FrustrationType.ERROR_CLICK),{isRage:!0};const hasSelectionChanged=clicks.some(click=>click.getUserActivity().selection);return clicks.forEach(click=>{click.hasError&&click.addFrustration(FrustrationType.ERROR_CLICK),isDead(click)&&!hasSelectionChanged&&click.addFrustration(FrustrationType.DEAD_CLICK)}),{isRage:!1}}__name(computeFrustration,"computeFrustration");function isRage(clicks){if(clicks.some(click=>click.getUserActivity().selection||click.getUserActivity().scroll))return!1;for(let i2=0;i2<clicks.length-(MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE-1);i2+=1)if(clicks[i2+MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE-1].event.timeStamp-clicks[i2].event.timeStamp<=ONE_SECOND)return!0;return!1}__name(isRage,"isRage");const DEAD_CLICK_EXCLUDE_SELECTOR='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 isDead(click){if(click.hasPageActivity||click.getUserActivity().input||click.getUserActivity().scroll)return!1;let target=click.event.target;return target.tagName==="LABEL"&&target.hasAttribute("for")&&(target=document.getElementById(target.getAttribute("for"))),!target||!target.matches(DEAD_CLICK_EXCLUDE_SELECTOR)}__name(isDead,"isDead");const CLICK_ACTION_MAX_DURATION=10*ONE_SECOND,interactionSelectorCache=new Map;function getInteractionSelector(relativeTimestamp){const selector=interactionSelectorCache.get(relativeTimestamp);return interactionSelectorCache.delete(relativeTimestamp),selector}__name(getInteractionSelector,"getInteractionSelector");function updateInteractionSelector(relativeTimestamp,selector){interactionSelectorCache.set(relativeTimestamp,selector),interactionSelectorCache.forEach((_2,relativeTimestamp2)=>{elapsed(relativeTimestamp2,relativeNow())>CLICK_ACTION_MAX_DURATION&&interactionSelectorCache.delete(relativeTimestamp2)})}__name(updateInteractionSelector,"updateInteractionSelector");function isActionChildEvent(id2){return event=>event.action!==void 0&&event.action.id!==void 0&&event.action.id.includes(id2)}__name(isActionChildEvent,"isActionChildEvent");function trackClickActions(lifeCycle,domMutationObservable,windowOpenObservable,configuration){const actionTracker=startEventTracker(lifeCycle),stopObservable=new Observable;let currentClickChain;lifeCycle.subscribe(5,stopClickChain),lifeCycle.subscribe(11,stopClickChain);const{stop:stopActionEventsListener}=listenActionEvents(configuration,{onPointerDown:__name(pointerDownEvent=>processPointerDown(configuration,lifeCycle,domMutationObservable,pointerDownEvent,windowOpenObservable),"onPointerDown"),onPointerUp:__name(({clickActionBase,hadActivityOnPointerDown},startEvent,getUserActivity)=>{startClickAction(configuration,lifeCycle,domMutationObservable,windowOpenObservable,actionTracker,stopObservable,appendClickToClickChain,clickActionBase,startEvent,getUserActivity,hadActivityOnPointerDown)},"onPointerUp")});return{stop:__name(()=>{stopClickChain(),stopObservable.notify(),stopActionEventsListener(),actionTracker.stopAll()},"stop"),findActionId:actionTracker.findId};function appendClickToClickChain(click){if(!currentClickChain||!currentClickChain.tryAppend(click)){const rageClick=click.clone();currentClickChain=createClickChain(click,clicks=>{finalizeClicks(clicks,rageClick),currentClickChain=void 0})}}function stopClickChain(){currentClickChain&¤tClickChain.stop()}}__name(trackClickActions,"trackClickActions");function processPointerDown(configuration,lifeCycle,domMutationObservable,pointerDownEvent,windowOpenObservable){const targetForPrivacy=configuration.betaTrackActionsInShadowDom?getEventTarget(pointerDownEvent):pointerDownEvent.target;let nodePrivacyLevel;if(configuration.enablePrivacyForActionName?nodePrivacyLevel=getNodePrivacyLevel(targetForPrivacy,configuration.defaultPrivacyLevel):nodePrivacyLevel=NodePrivacyLevel.ALLOW,nodePrivacyLevel===NodePrivacyLevel.HIDDEN)return;const clickActionBase=computeClickActionBase(pointerDownEvent,nodePrivacyLevel,configuration);let hadActivityOnPointerDown=!1;return waitPageActivityEnd(lifeCycle,domMutationObservable,windowOpenObservable,configuration,pageActivityEndEvent=>{hadActivityOnPointerDown=pageActivityEndEvent.hadActivity},PAGE_ACTIVITY_VALIDATION_DELAY),{clickActionBase,hadActivityOnPointerDown:__name(()=>hadActivityOnPointerDown,"hadActivityOnPointerDown")}}__name(processPointerDown,"processPointerDown");function startClickAction(configuration,lifeCycle,domMutationObservable,windowOpenObservable,actionTracker,stopObservable,appendClickToClickChain,clickActionBase,startEvent,getUserActivity,hadActivityOnPointerDown){var _a20;const click=newClick(lifeCycle,actionTracker,getUserActivity,clickActionBase,startEvent);appendClickToClickChain(click);const selector=(_a20=clickActionBase?.target)===null||_a20===void 0?void 0:_a20.selector;selector&&updateInteractionSelector(startEvent.timeStamp,selector);const{stop:stopWaitPageActivityEnd}=waitPageActivityEnd(lifeCycle,domMutationObservable,windowOpenObservable,configuration,pageActivityEndEvent=>{pageActivityEndEvent.hadActivity&&pageActivityEndEvent.end<click.startClocks.timeStamp?click.discard():pageActivityEndEvent.hadActivity?click.stop(pageActivityEndEvent.end):hadActivityOnPointerDown()?click.stop(click.startClocks.timeStamp):click.stop()},CLICK_ACTION_MAX_DURATION),viewEndedSubscription=lifeCycle.subscribe(5,({endClocks})=>{click.stop(endClocks.timeStamp)}),pageMayExitSubscription=lifeCycle.subscribe(11,()=>{click.stop(timeStampNow())}),stopSubscription=stopObservable.subscribe(()=>{click.stop()});click.stopObservable.subscribe(()=>{pageMayExitSubscription.unsubscribe(),viewEndedSubscription.unsubscribe(),stopWaitPageActivityEnd(),stopSubscription.unsubscribe()})}__name(startClickAction,"startClickAction");function computeClickActionBase(event,nodePrivacyLevel,configuration){const target=configuration.betaTrackActionsInShadowDom?getEventTarget(event):event.target,rect=target.getBoundingClientRect(),selector=getSelectorFromElement(target,configuration.actionNameAttribute);selector&&updateInteractionSelector(event.timeStamp,selector);const{name:name2,nameSource}=getActionNameFromElement(target,configuration,nodePrivacyLevel);return{type:ActionType.CLICK,target:{width:Math.round(rect.width),height:Math.round(rect.height),selector},position:{x:Math.round(event.clientX-rect.left),y:Math.round(event.clientY-rect.top)},name:name2,nameSource}}__name(computeClickActionBase,"computeClickActionBase");function getEventTarget(event){if(event.composed&&isNodeShadowHost(event.target)&&typeof event.composedPath=="function"){const composedPath=event.composedPath();if(composedPath.length>0&&composedPath[0]instanceof Element)return composedPath[0]}return event.target}__name(getEventTarget,"getEventTarget");function newClick(lifeCycle,actionTracker,getUserActivity,clickActionBase,startEvent){const clickKey=generateUUID(),startClocks=relativeToClocks(startEvent.timeStamp);actionTracker.start(clickKey,startClocks,clickActionBase,{isChildEvent:isActionChildEvent});let status=0,actionTrackerFinishedEvent;const frustrationTypes=[],stopObservable=new Observable;function stop(activityEndTime){status===0&&(status=1,actionTrackerFinishedEvent=activityEndTime?actionTracker.stop(clickKey,timeStampToClocks(activityEndTime)):actionTracker.discard(clickKey),stopObservable.notify())}return __name(stop,"stop"),{event:startEvent,stop,stopObservable,get hasError(){var _a20;const currentCounts=(_a20=actionTrackerFinishedEvent?.counts)!==null&&_a20!==void 0?_a20:actionTracker.getCounts(clickKey);return currentCounts?currentCounts.errorCount>0:!1},get hasPageActivity(){return actionTrackerFinishedEvent&&"duration"in actionTrackerFinishedEvent},getUserActivity,addFrustration:__name(frustrationType=>{frustrationTypes.push(frustrationType)},"addFrustration"),get startClocks(){return startClocks},isStopped:__name(()=>status===1||status===2,"isStopped"),clone:__name(()=>newClick(lifeCycle,actionTracker,getUserActivity,clickActionBase,startEvent),"clone"),validate:__name(domEvents=>{if(stop(),status!==1||!actionTrackerFinishedEvent)return;const clickAction={frustrationTypes,events:domEvents??[startEvent],event:startEvent,...actionTrackerFinishedEvent,counts:actionTrackerFinishedEvent.counts};lifeCycle.notify(0,clickAction),status=2},"validate"),discard:__name(()=>{stop(),status=2},"discard")}}__name(newClick,"newClick");function finalizeClicks(clicks,rageClick){const{isRage:isRage2}=computeFrustration(clicks,rageClick);isRage2?(clicks.forEach(click=>click.discard()),rageClick.stop(timeStampNow()),rageClick.validate(clicks.map(click=>click.event))):(rageClick.discard(),clicks.forEach(click=>click.validate()))}__name(finalizeClicks,"finalizeClicks");function trackManualActions(lifeCycle,onManualActionCompleted){const actionTracker=startEventTracker(lifeCycle);function startManualAction(name2,options={},startClocks=clocksNow()){var _a20;const lookupKey=(_a20=options.actionKey)!==null&&_a20!==void 0?_a20:name2;actionTracker.start(lookupKey,startClocks,{name:name2,...options},{isChildEvent:isActionChildEvent})}__name(startManualAction,"startManualAction");function stopManualAction(name2,options={},stopClocks=clocksNow()){var _a20;const lookupKey=(_a20=options.actionKey)!==null&&_a20!==void 0?_a20:name2,stopped=actionTracker.stop(lookupKey,stopClocks,options);if(!stopped)return;const frustrationTypes=[];stopped.counts&&stopped.counts.errorCount>0&&frustrationTypes.push(FrustrationType.ERROR_CLICK);const manualAction={...stopped,type:stopped.type||ActionType.CUSTOM,frustrationTypes};onManualActionCompleted(manualAction)}__name(stopManualAction,"stopManualAction");function addInstantAction(action){onManualActionCompleted({id:generateUUID(),frustrationTypes:[],...action})}return __name(addInstantAction,"addInstantAction"),{addAction:addInstantAction,startAction:startManualAction,stopAction:stopManualAction,findActionId:actionTracker.findId,stop:actionTracker.stopAll}}__name(trackManualActions,"trackManualActions");const LONG_TASK_START_TIME_CORRECTION=1;function startActionCollection(lifeCycle,hooks,domMutationObservable,windowOpenObservable,configuration){const{unsubscribe:unsubscribeAutoAction}=lifeCycle.subscribe(0,action=>{lifeCycle.notify(12,processAction(action))});let clickActions;configuration.trackUserInteractions&&(clickActions=trackClickActions(lifeCycle,domMutationObservable,windowOpenObservable,configuration));const manualActions=trackManualActions(lifeCycle,action=>{lifeCycle.notify(12,processAction(action))}),actionContexts={findActionId:__name(startTime=>{var _a20;const manualActionId=manualActions.findActionId(startTime),clickActionId=(_a20=clickActions?.findActionId(startTime))!==null&&_a20!==void 0?_a20:[];return manualActionId.concat(clickActionId)},"findActionId")};return hooks.register(0,({startTime,eventType})=>{if(eventType!==RumEventType.ERROR&&eventType!==RumEventType.RESOURCE&&eventType!==RumEventType.LONG_TASK)return SKIPPED;const correctedStartTime=eventType===RumEventType.LONG_TASK?addDuration(startTime,LONG_TASK_START_TIME_CORRECTION):startTime,actionId=actionContexts.findActionId(correctedStartTime);return actionId.length?{type:eventType,action:{id:actionId}}:SKIPPED}),hooks.register(1,({startTime})=>({action:{id:actionContexts.findActionId(startTime)}})),{addAction:manualActions.addAction,startAction:manualActions.startAction,stopAction:manualActions.stopAction,actionContexts,stop:__name(()=>{unsubscribeAutoAction(),manualActions.stop(),clickActions?.stop()},"stop")}}__name(startActionCollection,"startActionCollection");function processAction(action){const isAuto=isAutoAction(action),loadingTime=discardNegativeDuration(toServerDuration(action.duration));return{rawRumEvent:{type:RumEventType.ACTION,date:action.startClocks.timeStamp,action:{id:action.id,target:{name:action.name},type:action.type,...loadingTime!==void 0&&{loading_time:loadingTime},...action.counts&&{error:{count:action.counts.errorCount},long_task:{count:action.counts.longTaskCount},resource:{count:action.counts.resourceCount}},frustration:{type:action.frustrationTypes}},...isAuto?{_dd:{action:{target:action.target,position:action.position,name_source:action.nameSource}}}:{context:action.context}},duration:action.duration,startClocks:action.startClocks,domainContext:isAuto?{events:action.events}:{handlingStack:action.handlingStack}}}__name(processAction,"processAction");function isAutoAction(action){return"events"in action}__name(isAutoAction,"isAutoAction");function trackConsoleError(errorObservable){const subscription=initConsoleObservable([ConsoleApiName.error]).subscribe(consoleLog=>errorObservable.notify(consoleLog.error));return{stop:__name(()=>{subscription.unsubscribe()},"stop")}}__name(trackConsoleError,"trackConsoleError");function trackReportError(configuration,errorObservable){const subscription=initReportObservable(configuration,[RawReportType.cspViolation,RawReportType.intervention]).subscribe(rawError=>errorObservable.notify(rawError));return{stop:__name(()=>{subscription.unsubscribe()},"stop")}}__name(trackReportError,"trackReportError");function startErrorCollection(lifeCycle,configuration,bufferedDataObservable){const errorObservable=new Observable;return bufferedDataObservable.subscribe(bufferedData=>{bufferedData.type===0&&errorObservable.notify(bufferedData.error)}),trackConsoleError(errorObservable),trackReportError(configuration,errorObservable),errorObservable.subscribe(error2=>lifeCycle.notify(14,{error:error2})),doStartErrorCollection(lifeCycle)}__name(startErrorCollection,"startErrorCollection");function doStartErrorCollection(lifeCycle){return lifeCycle.subscribe(14,({error:error2})=>{lifeCycle.notify(12,processError(error2))}),{addError:__name(({error:error2,handlingStack,componentStack,startClocks,context})=>{const rawError=computeRawError({originalError:error2,handlingStack,componentStack,startClocks,nonErrorPrefix:"Provided",source:ErrorSource.CUSTOM,handling:"handled"});rawError.context=combine(rawError.context,context),lifeCycle.notify(14,{error:rawError})},"addError")}}__name(doStartErrorCollection,"doStartErrorCollection");function processError(error2){const rawRumEvent={date:error2.startClocks.timeStamp,error:{id:generateUUID(),message:error2.message,source:error2.source,stack:error2.stack,handling_stack:error2.handlingStack,component_stack:error2.componentStack,type:error2.type,handling:error2.handling,causes:error2.causes,source_type:"browser",fingerprint:error2.fingerprint,csp:error2.csp},type:RumEventType.ERROR,context:error2.context},domainContext={error:error2.originalError,handlingStack:error2.handlingStack};return{rawRumEvent,startClocks:error2.startClocks,domainContext}}__name(processError,"processError");const alreadyMatchedEntries=new WeakSet;function matchRequestResourceEntry(request){if(!performance||!("getEntriesByName"in performance))return;const sameNameEntries=performance.getEntriesByName(request.url,"resource");if(!sameNameEntries.length||!("toJSON"in sameNameEntries[0]))return;const candidates=sameNameEntries.filter(entry=>!alreadyMatchedEntries.has(entry)).filter(entry=>hasValidResourceEntryDuration(entry)&&hasValidResourceEntryTimings(entry)).filter(entry=>isBetween(entry,request.startClocks.relative,endTime({startTime:request.startClocks.relative,duration:request.duration})));if(candidates.length===1)return alreadyMatchedEntries.add(candidates[0]),candidates[0].toJSON()}__name(matchRequestResourceEntry,"matchRequestResourceEntry");function endTime(timing){return addDuration(timing.startTime,timing.duration)}__name(endTime,"endTime");function isBetween(timing,start,end){return timing.startTime>=start-1&&endTime(timing)<=addDuration(end,1)}__name(isBetween,"isBetween");const INITIAL_DOCUMENT_OUTDATED_TRACE_ID_THRESHOLD=2*ONE_MINUTE;function getDocumentTraceId(document2){const data=getDocumentTraceDataFromMeta(document2)||getDocumentTraceDataFromComment(document2);if(!(!data||data.traceTime<=dateNow()-INITIAL_DOCUMENT_OUTDATED_TRACE_ID_THRESHOLD))return data.traceId}__name(getDocumentTraceId,"getDocumentTraceId");function getDocumentTraceDataFromMeta(document2){const traceIdMeta=document2.querySelector("meta[name=dd-trace-id]"),traceTimeMeta=document2.querySelector("meta[name=dd-trace-time]");return createDocumentTraceData(traceIdMeta&&traceIdMeta.content,traceTimeMeta&&traceTimeMeta.content)}__name(getDocumentTraceDataFromMeta,"getDocumentTraceDataFromMeta");function getDocumentTraceDataFromComment(document2){const comment=findTraceComment(document2);if(comment)return createDocumentTraceData(findCommaSeparatedValue(comment,"trace-id"),findCommaSeparatedValue(comment,"trace-time"))}__name(getDocumentTraceDataFromComment,"getDocumentTraceDataFromComment");function createDocumentTraceData(traceId,rawTraceTime){const traceTime=rawTraceTime&&Number(rawTraceTime);if(!(!traceId||!traceTime))return{traceId,traceTime}}__name(createDocumentTraceData,"createDocumentTraceData");function findTraceComment(document2){for(let i2=0;i2<document2.childNodes.length;i2+=1){const comment=getTraceCommentFromNode(document2.childNodes[i2]);if(comment)return comment}if(document2.body)for(let i2=document2.body.childNodes.length-1;i2>=0;i2-=1){const node2=document2.body.childNodes[i2],comment=getTraceCommentFromNode(node2);if(comment)return comment;if(!isTextNode(node2))break}}__name(findTraceComment,"findTraceComment");function getTraceCommentFromNode(node2){if(node2&&isCommentNode(node2)){const match=/^\s*DATADOG;(.*?)\s*$/.exec(node2.data);if(match)return match[1]}}__name(getTraceCommentFromNode,"getTraceCommentFromNode");function getNavigationEntry(){if(supportPerformanceTimingEvent(RumPerformanceEntryType.NAVIGATION)){const navigationEntry=performance.getEntriesByType(RumPerformanceEntryType.NAVIGATION)[0];if(navigationEntry)return navigationEntry}const timings=computeTimingsFromDeprecatedPerformanceTiming(),entry={entryType:RumPerformanceEntryType.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:timings.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:__name(()=>({...entry,toJSON:void 0}),"toJSON"),...timings};return entry}__name(getNavigationEntry,"getNavigationEntry");function computeTimingsFromDeprecatedPerformanceTiming(){const result={},timing=performance.timing;for(const key in timing)if(isNumber$1(timing[key])){const numberKey=key,timingElement=timing[numberKey];result[numberKey]=timingElement===0?0:getRelativeTime(timingElement)}return result}__name(computeTimingsFromDeprecatedPerformanceTiming,"computeTimingsFromDeprecatedPerformanceTiming");function sanitizeFirstByte(entry){return entry.responseStart>=0&&entry.responseStart<=relativeNow()?entry.responseStart:void 0}__name(sanitizeFirstByte,"sanitizeFirstByte");function getResourceEntries(){if(supportPerformanceTimingEvent(RumPerformanceEntryType.RESOURCE))return performance.getEntriesByType(RumPerformanceEntryType.RESOURCE)}__name(getResourceEntries,"getResourceEntries");function findLcpResourceEntry(resourceUrl,lcpStartTime){const entries=getResourceEntries();if(entries)return findLast(entries,entry=>entry.name===resourceUrl&&entry.startTime<=lcpStartTime)}__name(findLcpResourceEntry,"findLcpResourceEntry");function retrieveInitialDocumentResourceTiming(configuration,callback){runOnReadyState(configuration,"interactive",()=>{const navigationEntry=getNavigationEntry(),entry=Object.assign(navigationEntry.toJSON(),{entryType:RumPerformanceEntryType.RESOURCE,initiatorType:FAKE_INITIAL_DOCUMENT,duration:navigationEntry.responseEnd,traceId:getDocumentTraceId(document),toJSON:__name(()=>({...entry,toJSON:void 0}),"toJSON")});callback(entry)})}__name(retrieveInitialDocumentResourceTiming,"retrieveInitialDocumentResourceTiming");const MAX_REQUESTS=1e3;function createRequestRegistry(lifeCycle){const requests=new Set,subscription=lifeCycle.subscribe(8,request=>{requests.add(request),requests.size>MAX_REQUESTS&&(addTelemetryDebug("Too many requests"),requests.delete(requests.values().next().value))});return{getMatchingRequest(entry){let minTimeDifference=1/0,closestRequest;for(const request of requests){const timeDifference=entry.startTime-request.startClocks.relative;0<=timeDifference&&timeDifference<minTimeDifference&&request.url===entry.name&&(minTimeDifference=Math.abs(timeDifference),closestRequest=request)}return closestRequest&&requests.delete(closestRequest),closestRequest},stop(){subscription.unsubscribe()}}}__name(createRequestRegistry,"createRequestRegistry");function trackManualResources(lifeCycle,resourceTracker){function emitResource(id2,startClocks,data,statusCode,endClocks){const duration2=endClocks?elapsed(startClocks.relative,endClocks.relative):void 0,rawRumEvent={date:startClocks.timeStamp,type:RumEventType.RESOURCE,resource:{id:id2,type:data.type||ResourceType.OTHER,url:sanitizeIfLongDataUrl(data.url),duration:duration2!==void 0?toServerDuration(duration2):void 0,method:data.method,status_code:statusCode},_dd:{},context:data.context};lifeCycle.notify(12,{rawRumEvent,startClocks,duration:duration2,domainContext:{isManual:!0}})}__name(emitResource,"emitResource");function startManualResource(url2,options={},startClocks=clocksNow()){var _a20;const lookupKey=(_a20=options.resourceKey)!==null&&_a20!==void 0?_a20:url2;resourceTracker.start(lookupKey,startClocks,{url:url2,...options})}__name(startManualResource,"startManualResource");function stopManualResource(url2,options={},stopClocks=clocksNow()){var _a20;const lookupKey=(_a20=options.resourceKey)!==null&&_a20!==void 0?_a20:url2,stopped=resourceTracker.stop(lookupKey,stopClocks,{context:options.context});stopped&&emitResource(stopped.id,stopped.startClocks,stopped,options.statusCode,stopClocks)}return __name(stopManualResource,"stopManualResource"),{startResource:startManualResource,stopResource:stopManualResource}}__name(trackManualResources,"trackManualResources");function startResourceCollection(lifeCycle,configuration,pageStateHistory){const taskQueue=createTaskQueue();let requestRegistry;const isEarlyRequestCollectionEnabled=configuration.trackEarlyRequests;isEarlyRequestCollectionEnabled?requestRegistry=createRequestRegistry(lifeCycle):lifeCycle.subscribe(8,request=>{handleResource(()=>processRequest(request,configuration,pageStateHistory))});const performanceResourceSubscription=createPerformanceObservable(configuration,{type:RumPerformanceEntryType.RESOURCE,buffered:!0}).subscribe(entries=>{for(const entry of entries)(isEarlyRequestCollectionEnabled||!isResourceEntryRequestType(entry))&&handleResource(()=>processResourceEntry(entry,configuration,pageStateHistory,requestRegistry))});retrieveInitialDocumentResourceTiming(configuration,timing=>{handleResource(()=>processResourceEntry(timing,configuration,pageStateHistory,requestRegistry))});function handleResource(computeRawEvent){taskQueue.push(()=>{const rawEvent=computeRawEvent();rawEvent&&lifeCycle.notify(12,rawEvent)})}__name(handleResource,"handleResource");const resourceTracker=startEventTracker(lifeCycle),manualResources=trackManualResources(lifeCycle,resourceTracker);return{startResource:manualResources.startResource,stopResource:manualResources.stopResource,stop:__name(()=>{taskQueue.stop(),performanceResourceSubscription.unsubscribe(),resourceTracker.stopAll()},"stop")}}__name(startResourceCollection,"startResourceCollection");function processRequest(request,configuration,pageStateHistory){const matchingTiming=matchRequestResourceEntry(request);return assembleResource(matchingTiming,request,pageStateHistory,configuration)}__name(processRequest,"processRequest");function processResourceEntry(entry,configuration,pageStateHistory,requestRegistry){const matchingRequest=isResourceEntryRequestType(entry)&&requestRegistry?requestRegistry.getMatchingRequest(entry):void 0;return assembleResource(entry,matchingRequest,pageStateHistory,configuration)}__name(processResourceEntry,"processResourceEntry");function assembleResource(entry,request,pageStateHistory,configuration){if(!entry&&!request)return;const tracingInfo=request?computeRequestTracingInfo(request,configuration):computeResourceEntryTracingInfo(entry,configuration);if(!configuration.trackResources&&!tracingInfo)return;const startClocks=entry?relativeToClocks(entry.startTime):request.startClocks,duration2=entry?computeResourceEntryDuration(entry):computeRequestDuration(pageStateHistory,startClocks,request.duration),graphql=request&&computeGraphQlMetaData(request,configuration),resourceEvent=combine({date:startClocks.timeStamp,resource:{id:generateUUID(),duration:toServerDuration(duration2),type:request?request.type===RequestType.XHR?ResourceType.XHR:ResourceType.FETCH:computeResourceEntryType(entry),method:request?request.method:void 0,status_code:request?request.status:discardZeroStatus(entry.responseStatus),url:request?sanitizeIfLongDataUrl(request.url):entry.name,protocol:entry&&computeResourceEntryProtocol(entry),delivery_type:entry&&computeResourceEntryDeliveryType(entry),graphql},type:RumEventType.RESOURCE,_dd:{discarded:!configuration.trackResources}},tracingInfo,entry&&computeResourceEntryMetrics(entry));return{startClocks,duration:duration2,rawRumEvent:resourceEvent,domainContext:getResourceDomainContext(entry,request)}}__name(assembleResource,"assembleResource");function computeGraphQlMetaData(request,configuration){const graphQlConfig=findGraphQlConfiguration(request.url,configuration);if(graphQlConfig)return extractGraphQlMetadata(request,graphQlConfig)}__name(computeGraphQlMetaData,"computeGraphQlMetaData");function getResourceDomainContext(entry,request){if(request){const baseDomainContext={performanceEntry:entry,isAborted:request.isAborted,handlingStack:request.handlingStack};return request.type===RequestType.XHR?{xhr:request.xhr,...baseDomainContext}:{requestInput:request.input,requestInit:request.init,response:request.response,error:request.error,...baseDomainContext}}return{performanceEntry:entry}}__name(getResourceDomainContext,"getResourceDomainContext");function computeResourceEntryMetrics(entry){const{renderBlockingStatus}=entry;return{resource:{render_blocking_status:renderBlockingStatus,...computeResourceEntrySize(entry),...computeResourceEntryDetails(entry)}}}__name(computeResourceEntryMetrics,"computeResourceEntryMetrics");function computeRequestTracingInfo(request,configuration){if(request.traceSampled&&request.traceId&&request.spanId)return{_dd:{span_id:request.spanId.toString(),trace_id:request.traceId.toString(),rule_psr:configuration.rulePsr}}}__name(computeRequestTracingInfo,"computeRequestTracingInfo");function computeResourceEntryTracingInfo(entry,configuration){if(entry.traceId)return{_dd:{trace_id:entry.traceId,span_id:createSpanIdentifier().toString(),rule_psr:configuration.rulePsr}}}__name(computeResourceEntryTracingInfo,"computeResourceEntryTracingInfo");function computeRequestDuration(pageStateHistory,startClocks,duration2){return pageStateHistory.wasInPageStateDuringPeriod("frozen",startClocks.relative,duration2)?void 0:duration2}__name(computeRequestDuration,"computeRequestDuration");function discardZeroStatus(statusCode){return statusCode===0?void 0:statusCode}__name(discardZeroStatus,"discardZeroStatus");function trackViewEventCounts(lifeCycle,viewId,onChange){const{stop,eventCounts}=trackEventCounts({lifeCycle,isChildEvent:__name(event=>event.view.id===viewId,"isChildEvent"),onChange});return{stop,eventCounts}}__name(trackViewEventCounts,"trackViewEventCounts");const FCP_MAXIMUM_DELAY=10*ONE_MINUTE;function trackFirstContentfulPaint(configuration,firstHidden,callback){return{stop:createPerformanceObservable(configuration,{type:RumPerformanceEntryType.PAINT,buffered:!0}).subscribe(entries=>{const fcpEntry=entries.find(entry=>entry.name==="first-contentful-paint"&&entry.startTime<firstHidden.timeStamp&&entry.startTime<FCP_MAXIMUM_DELAY);fcpEntry&&callback(fcpEntry.startTime)}).unsubscribe}}__name(trackFirstContentfulPaint,"trackFirstContentfulPaint");function trackRestoredFirstContentfulPaint(viewStartRelative,callback){requestAnimationFrame(()=>{requestAnimationFrame(()=>{callback(elapsed(viewStartRelative,relativeNow()))})})}__name(trackRestoredFirstContentfulPaint,"trackRestoredFirstContentfulPaint");function trackFirstInput(configuration,firstHidden,callback){const performanceFirstInputSubscription=createPerformanceObservable(configuration,{type:RumPerformanceEntryType.FIRST_INPUT,buffered:!0}).subscribe(entries=>{const firstInputEntry=entries.find(entry=>entry.startTime<firstHidden.timeStamp);if(firstInputEntry){const firstInputDelay=elapsed(firstInputEntry.startTime,firstInputEntry.processingStart);let firstInputTargetSelector;firstInputEntry.target&&isElementNode(firstInputEntry.target)&&(firstInputTargetSelector=getSelectorFromElement(firstInputEntry.target,configuration.actionNameAttribute)),callback({delay:firstInputDelay>=0?firstInputDelay:0,time:firstInputEntry.startTime,targetSelector:firstInputTargetSelector})}});return{stop:__name(()=>{performanceFirstInputSubscription.unsubscribe()},"stop")}}__name(trackFirstInput,"trackFirstInput");function trackNavigationTimings(configuration,callback){return waitAfterLoadEvent(configuration,()=>{const entry=getNavigationEntry();isIncompleteNavigation(entry)||callback(processNavigationEntry(entry))})}__name(trackNavigationTimings,"trackNavigationTimings");function processNavigationEntry(entry){return{domComplete:entry.domComplete,domContentLoaded:entry.domContentLoadedEventEnd,domInteractive:entry.domInteractive,loadEvent:entry.loadEventEnd,firstByte:sanitizeFirstByte(entry)}}__name(processNavigationEntry,"processNavigationEntry");function isIncompleteNavigation(entry){return entry.loadEventEnd<=0}__name(isIncompleteNavigation,"isIncompleteNavigation");function waitAfterLoadEvent(configuration,callback){let timeoutId;const{stop:stopOnReadyState}=runOnReadyState(configuration,"complete",()=>{timeoutId=setTimeout$1(()=>callback())});return{stop:__name(()=>{stopOnReadyState(),clearTimeout$1(timeoutId)},"stop")}}__name(waitAfterLoadEvent,"waitAfterLoadEvent");const LCP_MAXIMUM_DELAY=10*ONE_MINUTE;function trackLargestContentfulPaint(configuration,firstHidden,eventTarget,callback){let firstInteractionTimestamp=1/0;const{stop:stopEventListener}=addEventListeners(configuration,eventTarget,["pointerdown","keydown"],event=>{firstInteractionTimestamp=event.timeStamp},{capture:!0,once:!0});let biggestLcpSize=0;const performanceLcpSubscription=createPerformanceObservable(configuration,{type:RumPerformanceEntryType.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(entries=>{const lcpEntry=findLast(entries,entry=>entry.entryType===RumPerformanceEntryType.LARGEST_CONTENTFUL_PAINT&&entry.startTime<firstInteractionTimestamp&&entry.startTime<firstHidden.timeStamp&&entry.startTime<LCP_MAXIMUM_DELAY&&entry.size>biggestLcpSize);if(lcpEntry){let lcpTargetSelector;lcpEntry.element&&(lcpTargetSelector=getSelectorFromElement(lcpEntry.element,configuration.actionNameAttribute));const resourceUrl=computeLcpEntryUrl(lcpEntry),lcpValue=lcpEntry.startTime,subParts=isExperimentalFeatureEnabled(ExperimentalFeature.LCP_SUBPARTS)?computeLcpSubParts(resourceUrl,lcpValue):void 0;callback({value:lcpValue,targetSelector:lcpTargetSelector,resourceUrl,subParts}),biggestLcpSize=lcpEntry.size}});return{stop:__name(()=>{stopEventListener(),performanceLcpSubscription.unsubscribe()},"stop")}}__name(trackLargestContentfulPaint,"trackLargestContentfulPaint");function computeLcpEntryUrl(entry){return entry.url===""?void 0:entry.url}__name(computeLcpEntryUrl,"computeLcpEntryUrl");function computeLcpSubParts(resourceUrl,lcpValue){const firstByte=sanitizeFirstByte(getNavigationEntry());if(firstByte===void 0)return;const lcpResourceEntry=resourceUrl?findLcpResourceEntry(resourceUrl,lcpValue):void 0,lcpRequestStart=lcpResourceEntry?Math.max(firstByte,lcpResourceEntry.requestStart||lcpResourceEntry.startTime):firstByte,lcpResponseEnd=Math.min(lcpValue,Math.max(lcpRequestStart,lcpResourceEntry?.responseEnd||0));return{loadDelay:lcpRequestStart-firstByte,loadTime:lcpResponseEnd-lcpRequestStart,renderDelay:lcpValue-lcpResponseEnd}}__name(computeLcpSubParts,"computeLcpSubParts");function trackFirstHidden(configuration,viewStart,eventTarget=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:noop$2};if(supportPerformanceTimingEvent(RumPerformanceEntryType.VISIBILITY_STATE)){const firstHiddenEntry=performance.getEntriesByType(RumPerformanceEntryType.VISIBILITY_STATE).filter(entry=>entry.name==="hidden").find(entry=>entry.startTime>=viewStart.relative);if(firstHiddenEntry)return{timeStamp:firstHiddenEntry.startTime,stop:noop$2}}let timeStamp=1/0;const{stop}=addEventListeners(configuration,eventTarget,["pagehide","visibilitychange"],event=>{(event.type==="pagehide"||document.visibilityState==="hidden")&&(timeStamp=event.timeStamp,stop())},{capture:!0});return{get timeStamp(){return timeStamp},stop}}__name(trackFirstHidden,"trackFirstHidden");function trackInitialViewMetrics(configuration,viewStart,setLoadEvent,scheduleViewUpdate){const initialViewMetrics={},{stop:stopNavigationTracking}=trackNavigationTimings(configuration,navigationTimings=>{setLoadEvent(navigationTimings.loadEvent),initialViewMetrics.navigationTimings=navigationTimings,scheduleViewUpdate()}),firstHidden=trackFirstHidden(configuration,viewStart),{stop:stopFCPTracking}=trackFirstContentfulPaint(configuration,firstHidden,firstContentfulPaint=>{initialViewMetrics.firstContentfulPaint=firstContentfulPaint,scheduleViewUpdate()}),{stop:stopLCPTracking}=trackLargestContentfulPaint(configuration,firstHidden,window,largestContentfulPaint=>{initialViewMetrics.largestContentfulPaint=largestContentfulPaint,scheduleViewUpdate()}),{stop:stopFIDTracking}=trackFirstInput(configuration,firstHidden,firstInput=>{initialViewMetrics.firstInput=firstInput,scheduleViewUpdate()});function stop(){stopNavigationTracking(),stopFCPTracking(),stopLCPTracking(),stopFIDTracking(),firstHidden.stop()}return __name(stop,"stop"),{stop,initialViewMetrics}}__name(trackInitialViewMetrics,"trackInitialViewMetrics");const calculateArea=__name((width,height)=>width*height,"calculateArea"),calculateIntersectionArea=__name((rect1,rect2)=>{const left=Math.max(rect1.left,rect2.left),top=Math.max(rect1.top,rect2.top),right=Math.min(rect1.right,rect2.right),bottom=Math.min(rect1.bottom,rect2.bottom);return left>=right||top>=bottom?0:calculateArea(right-left,bottom-top)},"calculateIntersectionArea"),getClsAttributionImpactedArea=__name(source=>{const previousArea=calculateArea(source.previousRect.width,source.previousRect.height),currentArea=calculateArea(source.currentRect.width,source.currentRect.height),intersectionArea=calculateIntersectionArea(source.previousRect,source.currentRect);return previousArea+currentArea-intersectionArea},"getClsAttributionImpactedArea");function trackCumulativeLayoutShift(configuration,viewStart,callback){if(!isLayoutShiftSupported())return{stop:noop$2};let maxClsValue=0,biggestShift;callback({value:0});const slidingWindow=slidingSessionWindow(),performanceSubscription=createPerformanceObservable(configuration,{type:RumPerformanceEntryType.LAYOUT_SHIFT,buffered:!0}).subscribe(entries=>{var _a20;for(const entry of entries){if(entry.hadRecentInput||entry.startTime<viewStart)continue;const{cumulatedValue,isMaxValue}=slidingWindow.update(entry);if(isMaxValue){const attribution=getTopImpactedElement(entry.sources);biggestShift={target:attribution?.node?new WeakRef(attribution.node):void 0,time:elapsed(viewStart,entry.startTime),previousRect:attribution?.previousRect,currentRect:attribution?.currentRect,devicePixelRatio:window.devicePixelRatio}}if(cumulatedValue>maxClsValue){maxClsValue=cumulatedValue;const target=(_a20=biggestShift?.target)===null||_a20===void 0?void 0:_a20.deref();callback({value:round$1(maxClsValue,4),targetSelector:target&&getSelectorFromElement(target,configuration.actionNameAttribute),time:biggestShift?.time,previousRect:biggestShift?.previousRect?asRumRect(biggestShift.previousRect):void 0,currentRect:biggestShift?.currentRect?asRumRect(biggestShift.currentRect):void 0,devicePixelRatio:biggestShift?.devicePixelRatio})}}});return{stop:__name(()=>{performanceSubscription.unsubscribe()},"stop")}}__name(trackCumulativeLayoutShift,"trackCumulativeLayoutShift");function getTopImpactedElement(sources){let topImpactedSource;for(const source of sources)if(source.node&&isElementNode(source.node)){const currentImpactedArea=getClsAttributionImpactedArea(source);(!topImpactedSource||getClsAttributionImpactedArea(topImpactedSource)<currentImpactedArea)&&(topImpactedSource=source)}return topImpactedSource}__name(getTopImpactedElement,"getTopImpactedElement");function asRumRect({x,y,width,height}){return{x,y,width,height}}__name(asRumRect,"asRumRect");const MAX_WINDOW_DURATION=5*ONE_SECOND,MAX_UPDATE_GAP=ONE_SECOND;function slidingSessionWindow(){let cumulatedValue=0,startTime,endTime2,maxValue=0;return{update:__name(entry=>{const shouldCreateNewWindow=startTime===void 0||entry.startTime-endTime2>=MAX_UPDATE_GAP||entry.startTime-startTime>=MAX_WINDOW_DURATION;let isMaxValue;return shouldCreateNewWindow?(startTime=endTime2=entry.startTime,maxValue=cumulatedValue=entry.value,isMaxValue=!0):(cumulatedValue+=entry.value,endTime2=entry.startTime,isMaxValue=entry.value>maxValue,isMaxValue&&(maxValue=entry.value)),{cumulatedValue,isMaxValue}},"update")}}__name(slidingSessionWindow,"slidingSessionWindow");function isLayoutShiftSupported(){return supportPerformanceTimingEvent(RumPerformanceEntryType.LAYOUT_SHIFT)&&"WeakRef"in window}__name(isLayoutShiftSupported,"isLayoutShiftSupported");let observer,interactionCountEstimate=0,minKnownInteractionId=1/0,maxKnownInteractionId=0;function initInteractionCountPolyfill(){"interactionCount"in performance||observer||(observer=new window.PerformanceObserver(monitor(entries=>{entries.getEntries().forEach(e=>{const entry=e;entry.interactionId&&(minKnownInteractionId=Math.min(minKnownInteractionId,entry.interactionId),maxKnownInteractionId=Math.max(maxKnownInteractionId,entry.interactionId),interactionCountEstimate=(maxKnownInteractionId-minKnownInteractionId)/7+1)})})),observer.observe({type:"event",buffered:!0,durationThreshold:0}))}__name(initInteractionCountPolyfill,"initInteractionCountPolyfill");const getInteractionCount=__name(()=>observer?interactionCountEstimate:window.performance.interactionCount||0,"getInteractionCount"),MAX_INTERACTION_ENTRIES=10,MAX_INP_VALUE=1*ONE_MINUTE;function trackInteractionToNextPaint(configuration,viewStart,viewLoadingType){if(!isInteractionToNextPaintSupported())return{getInteractionToNextPaint:__name(()=>{},"getInteractionToNextPaint"),setViewEnd:noop$2,stop:noop$2};const{getViewInteractionCount,stopViewInteractionCount}=trackViewInteractionCount(viewLoadingType);let viewEnd=1/0;const longestInteractions=trackLongestInteractions(getViewInteractionCount);let interactionToNextPaint=-1,interactionToNextPaintTargetSelector,interactionToNextPaintStartTime;function handleEntries(entries){for(const entry of entries)entry.interactionId&&entry.startTime>=viewStart&&entry.startTime<=viewEnd&&longestInteractions.process(entry);const newInteraction=longestInteractions.estimateP98Interaction();newInteraction&&newInteraction.duration!==interactionToNextPaint&&(interactionToNextPaint=newInteraction.duration,interactionToNextPaintStartTime=elapsed(viewStart,newInteraction.startTime),interactionToNextPaintTargetSelector=getInteractionSelector(newInteraction.startTime),!interactionToNextPaintTargetSelector&&newInteraction.target&&isElementNode(newInteraction.target)&&(interactionToNextPaintTargetSelector=getSelectorFromElement(newInteraction.target,configuration.actionNameAttribute)))}__name(handleEntries,"handleEntries");const firstInputSubscription=createPerformanceObservable(configuration,{type:RumPerformanceEntryType.FIRST_INPUT,buffered:!0}).subscribe(handleEntries),eventSubscription=createPerformanceObservable(configuration,{type:RumPerformanceEntryType.EVENT,durationThreshold:40,buffered:!0}).subscribe(handleEntries);return{getInteractionToNextPaint:__name(()=>{if(interactionToNextPaint>=0)return{value:Math.min(interactionToNextPaint,MAX_INP_VALUE),targetSelector:interactionToNextPaintTargetSelector,time:interactionToNextPaintStartTime};if(getViewInteractionCount())return{value:0}},"getInteractionToNextPaint"),setViewEnd:__name(viewEndTime=>{viewEnd=viewEndTime,stopViewInteractionCount()},"setViewEnd"),stop:__name(()=>{eventSubscription.unsubscribe(),firstInputSubscription.unsubscribe()},"stop")}}__name(trackInteractionToNextPaint,"trackInteractionToNextPaint");function trackLongestInteractions(getViewInteractionCount){const longestInteractions=[];function sortAndTrimLongestInteractions(){longestInteractions.sort((a2,b)=>b.duration-a2.duration).splice(MAX_INTERACTION_ENTRIES)}return __name(sortAndTrimLongestInteractions,"sortAndTrimLongestInteractions"),{process(entry){const interactionIndex=longestInteractions.findIndex(interaction=>entry.interactionId===interaction.interactionId),minLongestInteraction=longestInteractions[longestInteractions.length-1];interactionIndex!==-1?entry.duration>longestInteractions[interactionIndex].duration&&(longestInteractions[interactionIndex]=entry,sortAndTrimLongestInteractions()):(longestInteractions.length<MAX_INTERACTION_ENTRIES||entry.duration>minLongestInteraction.duration)&&(longestInteractions.push(entry),sortAndTrimLongestInteractions())},estimateP98Interaction(){const interactionIndex=Math.min(longestInteractions.length-1,Math.floor(getViewInteractionCount()/50));return longestInteractions[interactionIndex]}}}__name(trackLongestInteractions,"trackLongestInteractions");function trackViewInteractionCount(viewLoadingType){initInteractionCountPolyfill();const previousInteractionCount=viewLoadingType===ViewLoadingType.INITIAL_LOAD?0:getInteractionCount();let state2={stopped:!1};function computeViewInteractionCount(){return getInteractionCount()-previousInteractionCount}return __name(computeViewInteractionCount,"computeViewInteractionCount"),{getViewInteractionCount:__name(()=>state2.stopped?state2.interactionCount:computeViewInteractionCount(),"getViewInteractionCount"),stopViewInteractionCount:__name(()=>{state2={stopped:!0,interactionCount:computeViewInteractionCount()}},"stopViewInteractionCount")}}__name(trackViewInteractionCount,"trackViewInteractionCount");function isInteractionToNextPaintSupported(){return supportPerformanceTimingEvent(RumPerformanceEntryType.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}__name(isInteractionToNextPaintSupported,"isInteractionToNextPaintSupported");function trackLoadingTime(lifeCycle,domMutationObservable,windowOpenObservable,configuration,loadType,viewStart,callback){let isWaitingForLoadEvent=loadType===ViewLoadingType.INITIAL_LOAD,isWaitingForActivityLoadingTime=!0;const loadingTimeCandidates=[],firstHidden=trackFirstHidden(configuration,viewStart);function invokeCallbackIfAllCandidatesAreReceived(){if(!isWaitingForActivityLoadingTime&&!isWaitingForLoadEvent&&loadingTimeCandidates.length>0){const loadingTime=Math.max(...loadingTimeCandidates);loadingTime<firstHidden.timeStamp-viewStart.relative&&callback(loadingTime)}}__name(invokeCallbackIfAllCandidatesAreReceived,"invokeCallbackIfAllCandidatesAreReceived");const{stop}=waitPageActivityEnd(lifeCycle,domMutationObservable,windowOpenObservable,configuration,event=>{isWaitingForActivityLoadingTime&&(isWaitingForActivityLoadingTime=!1,event.hadActivity&&loadingTimeCandidates.push(elapsed(viewStart.timeStamp,event.end)),invokeCallbackIfAllCandidatesAreReceived())});return{stop:__name(()=>{stop(),firstHidden.stop()},"stop"),setLoadEvent:__name(loadEvent=>{isWaitingForLoadEvent&&(isWaitingForLoadEvent=!1,loadingTimeCandidates.push(loadEvent),invokeCallbackIfAllCandidatesAreReceived())},"setLoadEvent")}}__name(trackLoadingTime,"trackLoadingTime");function getScrollX(){let scrollX;const visual=window.visualViewport;return visual?scrollX=visual.pageLeft-visual.offsetLeft:window.scrollX!==void 0?scrollX=window.scrollX:scrollX=window.pageXOffset||0,Math.round(scrollX)}__name(getScrollX,"getScrollX");function getScrollY(){let scrollY;const visual=window.visualViewport;return visual?scrollY=visual.pageTop-visual.offsetTop:window.scrollY!==void 0?scrollY=window.scrollY:scrollY=window.pageYOffset||0,Math.round(scrollY)}__name(getScrollY,"getScrollY");let viewportObservable;function initViewportObservable(configuration){return viewportObservable||(viewportObservable=createViewportObservable(configuration)),viewportObservable}__name(initViewportObservable,"initViewportObservable");function createViewportObservable(configuration){return new Observable(observable=>{const{throttled:updateDimension}=throttle(()=>{observable.notify(getViewportDimension())},200);return addEventListener(configuration,window,"resize",updateDimension,{capture:!0,passive:!0}).stop})}__name(createViewportObservable,"createViewportObservable");function getViewportDimension(){const visual=window.visualViewport;return visual?{width:Number(visual.width*visual.scale),height:Number(visual.height*visual.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}__name(getViewportDimension,"getViewportDimension");const THROTTLE_SCROLL_DURATION=ONE_SECOND;function trackScrollMetrics(configuration,viewStart,callback,scrollValues=createScrollValuesObservable(configuration)){let maxScrollDepth=0,maxScrollHeight=0,maxScrollHeightTime=0;const subscription=scrollValues.subscribe(({scrollDepth,scrollTop,scrollHeight})=>{let shouldUpdate=!1;if(scrollDepth>maxScrollDepth&&(maxScrollDepth=scrollDepth,shouldUpdate=!0),scrollHeight>maxScrollHeight){maxScrollHeight=scrollHeight;const now=relativeNow();maxScrollHeightTime=elapsed(viewStart.relative,now),shouldUpdate=!0}shouldUpdate&&callback({maxDepth:Math.min(maxScrollDepth,maxScrollHeight),maxDepthScrollTop:scrollTop,maxScrollHeight,maxScrollHeightTime})});return{stop:__name(()=>subscription.unsubscribe(),"stop")}}__name(trackScrollMetrics,"trackScrollMetrics");function computeScrollValues(){const scrollTop=getScrollY(),{height}=getViewportDimension(),scrollHeight=Math.round((document.scrollingElement||document.documentElement).scrollHeight),scrollDepth=Math.round(height+scrollTop);return{scrollHeight,scrollDepth,scrollTop}}__name(computeScrollValues,"computeScrollValues");function createScrollValuesObservable(configuration,throttleDuration=THROTTLE_SCROLL_DURATION){return new Observable(observable=>{function notify(){observable.notify(computeScrollValues())}if(__name(notify,"notify"),window.ResizeObserver){const throttledNotify=throttle(notify,throttleDuration,{leading:!1,trailing:!0}),observerTarget=document.scrollingElement||document.documentElement,resizeObserver=new ResizeObserver(monitor(throttledNotify.throttled));observerTarget&&resizeObserver.observe(observerTarget);const eventListener=addEventListener(configuration,window,"scroll",throttledNotify.throttled,{passive:!0});return()=>{throttledNotify.cancel(),resizeObserver.disconnect(),eventListener.stop()}}})}__name(createScrollValuesObservable,"createScrollValuesObservable");function trackCommonViewMetrics(lifeCycle,domMutationObservable,windowOpenObservable,configuration,scheduleViewUpdate,loadingType,viewStart){const commonViewMetrics={},{stop:stopLoadingTimeTracking,setLoadEvent}=trackLoadingTime(lifeCycle,domMutationObservable,windowOpenObservable,configuration,loadingType,viewStart,newLoadingTime=>{commonViewMetrics.loadingTime=newLoadingTime,scheduleViewUpdate()}),{stop:stopScrollMetricsTracking}=trackScrollMetrics(configuration,viewStart,newScrollMetrics=>{commonViewMetrics.scroll=newScrollMetrics}),{stop:stopCLSTracking}=trackCumulativeLayoutShift(configuration,viewStart.relative,cumulativeLayoutShift=>{commonViewMetrics.cumulativeLayoutShift=cumulativeLayoutShift,scheduleViewUpdate()}),{stop:stopINPTracking,getInteractionToNextPaint,setViewEnd}=trackInteractionToNextPaint(configuration,viewStart.relative,loadingType);return{stop:__name(()=>{stopLoadingTimeTracking(),stopCLSTracking(),stopScrollMetricsTracking()},"stop"),stopINPTracking,setLoadEvent,setViewEnd,getCommonViewMetrics:__name(()=>(commonViewMetrics.interactionToNextPaint=getInteractionToNextPaint(),commonViewMetrics),"getCommonViewMetrics")}}__name(trackCommonViewMetrics,"trackCommonViewMetrics");function onBFCacheRestore(configuration,callback){const{stop}=addEventListener(configuration,window,"pageshow",event=>{event.persisted&&callback(event)},{capture:!0});return stop}__name(onBFCacheRestore,"onBFCacheRestore");function trackBfcacheMetrics(viewStart,metrics,scheduleViewUpdate){trackRestoredFirstContentfulPaint(viewStart.relative,paintTime=>{metrics.firstContentfulPaint=paintTime,metrics.largestContentfulPaint={value:paintTime},scheduleViewUpdate()})}__name(trackBfcacheMetrics,"trackBfcacheMetrics");const THROTTLE_VIEW_UPDATE_PERIOD=3e3,SESSION_KEEP_ALIVE_INTERVAL=5*ONE_MINUTE,KEEP_TRACKING_AFTER_VIEW_DELAY=5*ONE_MINUTE;function trackViews(lifeCycle,domMutationObservable,windowOpenObservable,configuration,locationChangeObservable,areViewsTrackedAutomatically,initialViewOptions){const activeViews=new Set;let currentView=startNewView(ViewLoadingType.INITIAL_LOAD,clocksOrigin(),initialViewOptions),stopOnBFCacheRestore;startViewLifeCycle();let locationChangeSubscription;areViewsTrackedAutomatically&&(locationChangeSubscription=renewViewOnLocationChange(locationChangeObservable),configuration.trackBfcacheViews&&(stopOnBFCacheRestore=onBFCacheRestore(configuration,pageshowEvent=>{currentView.end();const startClocks=relativeToClocks(pageshowEvent.timeStamp);currentView=startNewView(ViewLoadingType.BF_CACHE,startClocks,void 0)})));function startNewView(loadingType,startClocks,viewOptions){const newlyCreatedView=newView(lifeCycle,domMutationObservable,windowOpenObservable,configuration,loadingType,startClocks,viewOptions);return activeViews.add(newlyCreatedView),newlyCreatedView.stopObservable.subscribe(()=>{activeViews.delete(newlyCreatedView)}),newlyCreatedView}__name(startNewView,"startNewView");function startViewLifeCycle(){lifeCycle.subscribe(10,()=>{currentView=startNewView(ViewLoadingType.ROUTE_CHANGE,void 0,{name:currentView.name,service:currentView.service,version:currentView.version,context:currentView.contextManager.getContext()})}),lifeCycle.subscribe(9,()=>{currentView.end({sessionIsActive:!1})})}__name(startViewLifeCycle,"startViewLifeCycle");function renewViewOnLocationChange(locationChangeObservable2){return locationChangeObservable2.subscribe(({oldLocation,newLocation})=>{areDifferentLocation(oldLocation,newLocation)&&(currentView.end(),currentView=startNewView(ViewLoadingType.ROUTE_CHANGE))})}return __name(renewViewOnLocationChange,"renewViewOnLocationChange"),{addTiming:__name((name2,time2=timeStampNow())=>{currentView.addTiming(name2,time2)},"addTiming"),startView:__name((options,startClocks)=>{currentView.end({endClocks:startClocks}),currentView=startNewView(ViewLoadingType.ROUTE_CHANGE,startClocks,options)},"startView"),setViewContext:__name(context=>{currentView.contextManager.setContext(context)},"setViewContext"),setViewContextProperty:__name((key,value)=>{currentView.contextManager.setContextProperty(key,value)},"setViewContextProperty"),setViewName:__name(name2=>{currentView.setViewName(name2)},"setViewName"),getViewContext:__name(()=>currentView.contextManager.getContext(),"getViewContext"),stop:__name(()=>{locationChangeSubscription&&locationChangeSubscription.unsubscribe(),stopOnBFCacheRestore&&stopOnBFCacheRestore(),currentView.end(),activeViews.forEach(view=>view.stop())},"stop")}}__name(trackViews,"trackViews");function newView(lifeCycle,domMutationObservable,windowOpenObservable,configuration,loadingType,startClocks=clocksNow(),viewOptions){const id2=generateUUID(),stopObservable=new Observable,customTimings={};let documentVersion=0,endClocks;const location2=shallowClone$1(window.location),contextManager=createContextManager();let sessionIsActive=!0,name2=viewOptions?.name;const service=viewOptions?.service||configuration.service,version2=viewOptions?.version||configuration.version,context=viewOptions?.context,handlingStack=viewOptions?.handlingStack;context&&contextManager.setContext(context);const viewCreatedEvent={id:id2,name:name2,startClocks,service,version:version2,context};lifeCycle.notify(1,viewCreatedEvent),lifeCycle.notify(2,viewCreatedEvent);const{throttled,cancel:cancelScheduleViewUpdate}=throttle(triggerViewUpdate,THROTTLE_VIEW_UPDATE_PERIOD,{leading:!1}),{setLoadEvent,setViewEnd,stop:stopCommonViewMetricsTracking,stopINPTracking,getCommonViewMetrics}=trackCommonViewMetrics(lifeCycle,domMutationObservable,windowOpenObservable,configuration,scheduleViewUpdate,loadingType,startClocks),{stop:stopInitialViewMetricsTracking,initialViewMetrics}=loadingType===ViewLoadingType.INITIAL_LOAD?trackInitialViewMetrics(configuration,startClocks,setLoadEvent,scheduleViewUpdate):{stop:noop$2,initialViewMetrics:{}};loadingType===ViewLoadingType.BF_CACHE&&trackBfcacheMetrics(startClocks,initialViewMetrics,scheduleViewUpdate);const{stop:stopEventCountsTracking,eventCounts}=trackViewEventCounts(lifeCycle,id2,scheduleViewUpdate),keepAliveIntervalId=setInterval$1(triggerViewUpdate,SESSION_KEEP_ALIVE_INTERVAL),pageMayExitSubscription=lifeCycle.subscribe(11,pageMayExitEvent=>{pageMayExitEvent.reason===PageExitReason.UNLOADING&&triggerViewUpdate()});triggerViewUpdate(),contextManager.changeObservable.subscribe(scheduleViewUpdate);function triggerBeforeViewUpdate(){lifeCycle.notify(3,{id:id2,name:name2,context:contextManager.getContext(),startClocks,sessionIsActive})}__name(triggerBeforeViewUpdate,"triggerBeforeViewUpdate");function scheduleViewUpdate(){triggerBeforeViewUpdate(),throttled()}__name(scheduleViewUpdate,"scheduleViewUpdate");function triggerViewUpdate(){cancelScheduleViewUpdate(),triggerBeforeViewUpdate(),documentVersion+=1;const currentEnd=endClocks===void 0?timeStampNow():endClocks.timeStamp;lifeCycle.notify(4,{customTimings,documentVersion,id:id2,name:name2,service,version:version2,context:contextManager.getContext(),loadingType,location:location2,handlingStack,startClocks,commonViewMetrics:getCommonViewMetrics(),initialViewMetrics,duration:elapsed(startClocks.timeStamp,currentEnd),isActive:endClocks===void 0,sessionIsActive,eventCounts})}return __name(triggerViewUpdate,"triggerViewUpdate"),{get name(){return name2},service,version:version2,contextManager,stopObservable,end(options={}){var _a20,_b;endClocks||(endClocks=(_a20=options.endClocks)!==null&&_a20!==void 0?_a20:clocksNow(),sessionIsActive=(_b=options.sessionIsActive)!==null&&_b!==void 0?_b:!0,lifeCycle.notify(5,{endClocks}),lifeCycle.notify(6,{endClocks}),clearInterval$1(keepAliveIntervalId),setViewEnd(endClocks.relative),stopCommonViewMetricsTracking(),pageMayExitSubscription.unsubscribe(),triggerViewUpdate(),setTimeout$1(()=>{this.stop()},KEEP_TRACKING_AFTER_VIEW_DELAY))},stop(){stopInitialViewMetricsTracking(),stopEventCountsTracking(),stopINPTracking(),stopObservable.notify()},addTiming(name3,time2){if(endClocks)return;const relativeTime=looksLikeRelativeTime(time2)?time2:elapsed(startClocks.timeStamp,time2);customTimings[sanitizeTiming(name3)]=relativeTime,scheduleViewUpdate()},setViewName(updatedName){name2=updatedName,triggerViewUpdate()}}}__name(newView,"newView");function sanitizeTiming(name2){const sanitized=name2.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return sanitized!==name2&&display.warn(`Invalid timing name: ${name2}, sanitized to: ${sanitized}`),sanitized}__name(sanitizeTiming,"sanitizeTiming");function areDifferentLocation(currentLocation,otherLocation){return currentLocation.pathname!==otherLocation.pathname||!isHashAnAnchor(otherLocation.hash)&&getPathFromHash(otherLocation.hash)!==getPathFromHash(currentLocation.hash)}__name(areDifferentLocation,"areDifferentLocation");function isHashAnAnchor(hash2){const correspondingId=hash2.substring(1);return correspondingId!==""&&!!document.getElementById(correspondingId)}__name(isHashAnAnchor,"isHashAnAnchor");function getPathFromHash(hash2){const index2=hash2.indexOf("?");return index2<0?hash2:hash2.slice(0,index2)}__name(getPathFromHash,"getPathFromHash");function startViewCollection(lifeCycle,hooks,configuration,domMutationObservable,pageOpenObservable,locationChangeObservable,recorderApi2,viewHistory,initialViewOptions){return lifeCycle.subscribe(4,view=>lifeCycle.notify(12,processViewUpdate(view,configuration,recorderApi2))),hooks.register(0,({startTime,eventType})=>{const view=viewHistory.findView(startTime);return view?{type:eventType,service:view.service,version:view.version,context:view.context,view:{id:view.id,name:view.name}}:DISCARDED}),hooks.register(1,({startTime})=>{var _a20;return{view:{id:(_a20=viewHistory.findView(startTime))===null||_a20===void 0?void 0:_a20.id}}}),trackViews(lifeCycle,domMutationObservable,pageOpenObservable,configuration,locationChangeObservable,!configuration.trackViewsManually,initialViewOptions)}__name(startViewCollection,"startViewCollection");function processViewUpdate(view,configuration,recorderApi2){var _a20,_b,_c,_d,_e,_f,_g,_h,_j,_k,_l,_m,_o,_p,_q,_r,_s,_t;const replayStats=recorderApi2.getReplayStats(view.id),clsDevicePixelRatio=(_b=(_a20=view.commonViewMetrics)===null||_a20===void 0?void 0:_a20.cumulativeLayoutShift)===null||_b===void 0?void 0:_b.devicePixelRatio,viewEvent={_dd:{document_version:view.documentVersion,replay_stats:replayStats,cls:clsDevicePixelRatio?{device_pixel_ratio:clsDevicePixelRatio}:void 0,configuration:{start_session_replay_recording_manually:configuration.startSessionReplayRecordingManually}},date:view.startClocks.timeStamp,type:RumEventType.VIEW,view:{action:{count:view.eventCounts.actionCount},frustration:{count:view.eventCounts.frustrationCount},cumulative_layout_shift:(_c=view.commonViewMetrics.cumulativeLayoutShift)===null||_c===void 0?void 0:_c.value,cumulative_layout_shift_time:toServerDuration((_d=view.commonViewMetrics.cumulativeLayoutShift)===null||_d===void 0?void 0:_d.time),cumulative_layout_shift_target_selector:(_e=view.commonViewMetrics.cumulativeLayoutShift)===null||_e===void 0?void 0:_e.targetSelector,first_byte:toServerDuration((_f=view.initialViewMetrics.navigationTimings)===null||_f===void 0?void 0:_f.firstByte),dom_complete:toServerDuration((_g=view.initialViewMetrics.navigationTimings)===null||_g===void 0?void 0:_g.domComplete),dom_content_loaded:toServerDuration((_h=view.initialViewMetrics.navigationTimings)===null||_h===void 0?void 0:_h.domContentLoaded),dom_interactive:toServerDuration((_j=view.initialViewMetrics.navigationTimings)===null||_j===void 0?void 0:_j.domInteractive),error:{count:view.eventCounts.errorCount},first_contentful_paint:toServerDuration(view.initialViewMetrics.firstContentfulPaint),first_input_delay:toServerDuration((_k=view.initialViewMetrics.firstInput)===null||_k===void 0?void 0:_k.delay),first_input_time:toServerDuration((_l=view.initialViewMetrics.firstInput)===null||_l===void 0?void 0:_l.time),first_input_target_selector:(_m=view.initialViewMetrics.firstInput)===null||_m===void 0?void 0:_m.targetSelector,interaction_to_next_paint:toServerDuration((_o=view.commonViewMetrics.interactionToNextPaint)===null||_o===void 0?void 0:_o.value),interaction_to_next_paint_time:toServerDuration((_p=view.commonViewMetrics.interactionToNextPaint)===null||_p===void 0?void 0:_p.time),interaction_to_next_paint_target_selector:(_q=view.commonViewMetrics.interactionToNextPaint)===null||_q===void 0?void 0:_q.targetSelector,is_active:view.isActive,name:view.name,largest_contentful_paint:toServerDuration((_r=view.initialViewMetrics.largestContentfulPaint)===null||_r===void 0?void 0:_r.value),largest_contentful_paint_target_selector:(_s=view.initialViewMetrics.largestContentfulPaint)===null||_s===void 0?void 0:_s.targetSelector,load_event:toServerDuration((_t=view.initialViewMetrics.navigationTimings)===null||_t===void 0?void 0:_t.loadEvent),loading_time:discardNegativeDuration(toServerDuration(view.commonViewMetrics.loadingTime)),loading_type:view.loadingType,long_task:{count:view.eventCounts.longTaskCount},performance:computeViewPerformanceData(view.commonViewMetrics,view.initialViewMetrics),resource:{count:view.eventCounts.resourceCount},time_spent:toServerDuration(view.duration)},display:view.commonViewMetrics.scroll?{scroll:{max_depth:view.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:view.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:view.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:toServerDuration(view.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:configuration.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:getTimeZone()}};return isEmptyObject$1(view.customTimings)||(viewEvent.view.custom_timings=mapValues(view.customTimings,toServerDuration)),{rawRumEvent:viewEvent,startClocks:view.startClocks,duration:view.duration,domainContext:{location:view.location,handlingStack:view.handlingStack}}}__name(processViewUpdate,"processViewUpdate");function computeViewPerformanceData({cumulativeLayoutShift,interactionToNextPaint},{firstContentfulPaint,firstInput,largestContentfulPaint}){return{cls:cumulativeLayoutShift&&{score:cumulativeLayoutShift.value,timestamp:toServerDuration(cumulativeLayoutShift.time),target_selector:cumulativeLayoutShift.targetSelector,previous_rect:cumulativeLayoutShift.previousRect,current_rect:cumulativeLayoutShift.currentRect},fcp:firstContentfulPaint&&{timestamp:toServerDuration(firstContentfulPaint)},fid:firstInput&&{duration:toServerDuration(firstInput.delay),timestamp:toServerDuration(firstInput.time),target_selector:firstInput.targetSelector},inp:interactionToNextPaint&&{duration:toServerDuration(interactionToNextPaint.value),timestamp:toServerDuration(interactionToNextPaint.time),target_selector:interactionToNextPaint.targetSelector},lcp:largestContentfulPaint&&{timestamp:toServerDuration(largestContentfulPaint.value),target_selector:largestContentfulPaint.targetSelector,resource_url:largestContentfulPaint.resourceUrl,sub_parts:largestContentfulPaint.subParts?{load_delay:toServerDuration(largestContentfulPaint.subParts.loadDelay),load_time:toServerDuration(largestContentfulPaint.subParts.loadTime),render_delay:toServerDuration(largestContentfulPaint.subParts.renderDelay)}:void 0}}}__name(computeViewPerformanceData,"computeViewPerformanceData");const RUM_SESSION_KEY="rum";function startRumSessionManager(configuration,lifeCycle,trackingConsentState){const sessionManager=startSessionManager(configuration,RUM_SESSION_KEY,rawTrackingType=>computeTrackingType(configuration,rawTrackingType),trackingConsentState);return sessionManager.expireObservable.subscribe(()=>{lifeCycle.notify(9)}),sessionManager.renewObservable.subscribe(()=>{lifeCycle.notify(10)}),sessionManager.sessionStateUpdateObservable.subscribe(({previousState,newState})=>{if(!previousState.forcedReplay&&newState.forcedReplay){const sessionEntity=sessionManager.findSession();sessionEntity&&(sessionEntity.isReplayForced=!0)}}),{findTrackedSession:__name(startTime=>{const session=sessionManager.findSession(startTime);if(!(!session||session.trackingType==="0"))return{id:session.id,sessionReplay:session.trackingType==="1"?1:session.isReplayForced?2:0,anonymousId:session.anonymousId}},"findTrackedSession"),expire:sessionManager.expire,expireObservable:sessionManager.expireObservable,setForcedReplay:__name(()=>sessionManager.updateSessionState({forcedReplay:"1"}),"setForcedReplay")}}__name(startRumSessionManager,"startRumSessionManager");function startRumSessionManagerStub(){const session={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:bridgeSupports("records")?1:0};return{findTrackedSession:__name(()=>session,"findTrackedSession"),expire:noop$2,expireObservable:new Observable,setForcedReplay:noop$2}}__name(startRumSessionManagerStub,"startRumSessionManagerStub");function computeTrackingType(configuration,rawTrackingType){return hasValidRumSession(rawTrackingType)?rawTrackingType:performDraw(configuration.sessionSampleRate)?performDraw(configuration.sessionReplaySampleRate)?"1":"2":"0"}__name(computeTrackingType,"computeTrackingType");function hasValidRumSession(trackingType){return trackingType==="0"||trackingType==="1"||trackingType==="2"}__name(hasValidRumSession,"hasValidRumSession");function startRumBatch(configuration,lifeCycle,reportError2,pageMayExitObservable,sessionExpireObservable,createEncoder){const endpoints=[configuration.rumEndpointBuilder];configuration.replica&&endpoints.push(configuration.replica.rumEndpointBuilder);const batch2=createBatch({encoder:createEncoder(2),request:createHttpRequest(endpoints,reportError2),flushController:createFlushController({pageMayExitObservable,sessionExpireObservable})});return lifeCycle.subscribe(13,serverRumEvent=>{serverRumEvent.type===RumEventType.VIEW?batch2.upsert(serverRumEvent,serverRumEvent.view.id):batch2.add(serverRumEvent)}),batch2}__name(startRumBatch,"startRumBatch");function startRumEventBridge(lifeCycle){const bridge=getEventBridge();lifeCycle.subscribe(13,serverRumEvent=>{bridge.send("rum",serverRumEvent)})}__name(startRumEventBridge,"startRumEventBridge");const URL_CONTEXT_TIME_OUT_DELAY=SESSION_TIME_OUT_DELAY;function startUrlContexts(lifeCycle,hooks,locationChangeObservable){const urlContextHistory=createValueHistory({expireDelay:URL_CONTEXT_TIME_OUT_DELAY});let previousViewUrl;lifeCycle.subscribe(1,({startClocks})=>{const viewUrl=location.href;urlContextHistory.add(buildUrlContext({url:viewUrl,referrer:previousViewUrl||document.referrer}),startClocks.relative),previousViewUrl=viewUrl}),lifeCycle.subscribe(6,({endClocks})=>{urlContextHistory.closeActive(endClocks.relative)});const locationChangeSubscription=locationChangeObservable.subscribe(({newLocation})=>{const current=urlContextHistory.find();if(current){const changeTime=relativeNow();urlContextHistory.closeActive(changeTime),urlContextHistory.add(buildUrlContext({url:newLocation.href,referrer:current.referrer}),changeTime)}});function buildUrlContext({url:url2,referrer}){return{url:url2,referrer}}return __name(buildUrlContext,"buildUrlContext"),hooks.register(0,({startTime,eventType})=>{const urlContext=urlContextHistory.find(startTime);return urlContext?{type:eventType,view:{url:urlContext.url,referrer:urlContext.referrer}}:DISCARDED}),{findUrl:__name(startTime=>urlContextHistory.find(startTime),"findUrl"),stop:__name(()=>{locationChangeSubscription.unsubscribe(),urlContextHistory.stop()},"stop")}}__name(startUrlContexts,"startUrlContexts");function createLocationChangeObservable(configuration){let currentLocation=shallowClone$1(location);return new Observable(observable=>{const{stop:stopHistoryTracking}=trackHistory(configuration,onLocationChange),{stop:stopHashTracking}=trackHash(configuration,onLocationChange);function onLocationChange(){if(currentLocation.href===location.href)return;const newLocation=shallowClone$1(location);observable.notify({newLocation,oldLocation:currentLocation}),currentLocation=newLocation}return __name(onLocationChange,"onLocationChange"),()=>{stopHistoryTracking(),stopHashTracking()}})}__name(createLocationChangeObservable,"createLocationChangeObservable");function trackHistory(configuration,onHistoryChange){const{stop:stopInstrumentingPushState}=instrumentMethod(getHistoryInstrumentationTarget("pushState"),"pushState",({onPostCall})=>{onPostCall(onHistoryChange)}),{stop:stopInstrumentingReplaceState}=instrumentMethod(getHistoryInstrumentationTarget("replaceState"),"replaceState",({onPostCall})=>{onPostCall(onHistoryChange)}),{stop:removeListener}=addEventListener(configuration,window,"popstate",onHistoryChange);return{stop:__name(()=>{stopInstrumentingPushState(),stopInstrumentingReplaceState(),removeListener()},"stop")}}__name(trackHistory,"trackHistory");function trackHash(configuration,onHashChange){return addEventListener(configuration,window,"hashchange",onHashChange)}__name(trackHash,"trackHash");function getHistoryInstrumentationTarget(methodName){return Object.prototype.hasOwnProperty.call(history,methodName)?history:History.prototype}__name(getHistoryInstrumentationTarget,"getHistoryInstrumentationTarget");const FEATURE_FLAG_CONTEXT_TIME_OUT_DELAY=SESSION_TIME_OUT_DELAY;function startFeatureFlagContexts(lifeCycle,hooks,configuration){const featureFlagContexts=createValueHistory({expireDelay:FEATURE_FLAG_CONTEXT_TIME_OUT_DELAY});return lifeCycle.subscribe(1,({startClocks})=>{featureFlagContexts.add({},startClocks.relative)}),lifeCycle.subscribe(6,({endClocks})=>{featureFlagContexts.closeActive(endClocks.relative)}),hooks.register(0,({startTime,eventType})=>{if(!configuration.trackFeatureFlagsForEvents.concat([RumEventType.VIEW,RumEventType.ERROR]).includes(eventType))return SKIPPED;const featureFlagContext=featureFlagContexts.find(startTime);return!featureFlagContext||isEmptyObject$1(featureFlagContext)?SKIPPED:{type:eventType,feature_flags:featureFlagContext}}),{addFeatureFlagEvaluation:__name((key,value)=>{const currentContext=featureFlagContexts.find();currentContext&&(currentContext[key]=value)},"addFeatureFlagEvaluation")}}__name(startFeatureFlagContexts,"startFeatureFlagContexts");const MEASURES_PERIOD_DURATION=10*ONE_SECOND;let currentPeriodMeasures,batchHasRumEvent;function startCustomerDataTelemetry(telemetry,lifeCycle,batchFlushObservable){telemetry.metricsEnabled&&(initCurrentPeriodMeasures(),batchHasRumEvent=!1,lifeCycle.subscribe(13,()=>{batchHasRumEvent=!0}),batchFlushObservable.subscribe(({bytesCount,messagesCount})=>{batchHasRumEvent&&(batchHasRumEvent=!1,currentPeriodMeasures.batchCount+=1,updateMeasure(currentPeriodMeasures.batchBytesCount,bytesCount),updateMeasure(currentPeriodMeasures.batchMessagesCount,messagesCount))}),setInterval$1(sendCurrentPeriodMeasures,MEASURES_PERIOD_DURATION))}__name(startCustomerDataTelemetry,"startCustomerDataTelemetry");function sendCurrentPeriodMeasures(){currentPeriodMeasures.batchCount!==0&&(addTelemetryMetrics("Customer data measures",currentPeriodMeasures),initCurrentPeriodMeasures())}__name(sendCurrentPeriodMeasures,"sendCurrentPeriodMeasures");function createMeasure(){return{min:1/0,max:0,sum:0}}__name(createMeasure,"createMeasure");function updateMeasure(measure,value){measure.sum+=value,measure.min=Math.min(measure.min,value),measure.max=Math.max(measure.max,value)}__name(updateMeasure,"updateMeasure");function initCurrentPeriodMeasures(){currentPeriodMeasures={batchCount:0,batchBytesCount:createMeasure(),batchMessagesCount:createMeasure()}}__name(initCurrentPeriodMeasures,"initCurrentPeriodMeasures");const MAX_PAGE_STATE_ENTRIES=4e3,MAX_PAGE_STATE_ENTRIES_SELECTABLE=500,PAGE_STATE_CONTEXT_TIME_OUT_DELAY=SESSION_TIME_OUT_DELAY;function startPageStateHistory(hooks,configuration,maxPageStateEntriesSelectable=MAX_PAGE_STATE_ENTRIES_SELECTABLE){const pageStateEntryHistory=createValueHistory({expireDelay:PAGE_STATE_CONTEXT_TIME_OUT_DELAY,maxEntries:MAX_PAGE_STATE_ENTRIES});let currentPageState;supportPerformanceTimingEvent(RumPerformanceEntryType.VISIBILITY_STATE)&&performance.getEntriesByType(RumPerformanceEntryType.VISIBILITY_STATE).forEach(entry=>{const state2=entry.name==="hidden"?"hidden":"active";addPageState(state2,entry.startTime)}),addPageState(getPageState(),relativeNow());const{stop:stopEventListeners}=addEventListeners(configuration,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],event=>{addPageState(computePageState(event),event.timeStamp)},{capture:!0});function addPageState(nextPageState,startTime=relativeNow()){nextPageState!==currentPageState&&(currentPageState=nextPageState,pageStateEntryHistory.closeActive(startTime),pageStateEntryHistory.add({state:currentPageState,startTime},startTime))}__name(addPageState,"addPageState");function wasInPageStateDuringPeriod(state2,startTime,duration2){return pageStateEntryHistory.findAll(startTime,duration2).some(pageState=>pageState.state===state2)}return __name(wasInPageStateDuringPeriod,"wasInPageStateDuringPeriod"),hooks.register(0,({startTime,duration:duration2=0,eventType})=>{if(eventType===RumEventType.VIEW){const pageStates=pageStateEntryHistory.findAll(startTime,duration2);return{type:eventType,_dd:{page_states:processPageStates(pageStates,startTime,maxPageStateEntriesSelectable)}}}return eventType===RumEventType.ACTION||eventType===RumEventType.ERROR?{type:eventType,view:{in_foreground:wasInPageStateDuringPeriod("active",startTime,0)}}:SKIPPED}),{wasInPageStateDuringPeriod,addPageState,stop:__name(()=>{stopEventListeners(),pageStateEntryHistory.stop()},"stop")}}__name(startPageStateHistory,"startPageStateHistory");function processPageStates(pageStateEntries,eventStartTime,maxPageStateEntriesSelectable){if(pageStateEntries.length!==0)return pageStateEntries.slice(-maxPageStateEntriesSelectable).reverse().map(({state:state2,startTime})=>({state:state2,start:toServerDuration(elapsed(eventStartTime,startTime))}))}__name(processPageStates,"processPageStates");function computePageState(event){return event.type==="freeze"?"frozen":event.type==="pagehide"?event.persisted?"frozen":"terminated":getPageState()}__name(computePageState,"computePageState");function getPageState(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}__name(getPageState,"getPageState");function startDisplayContext(hooks,configuration){let viewport;const animationFrameId=requestAnimationFrame(monitor(()=>{viewport=getViewportDimension()})),unsubscribeViewport=initViewportObservable(configuration).subscribe(viewportDimension=>{viewport=viewportDimension}).unsubscribe;return hooks.register(0,({eventType})=>({type:eventType,display:viewport?{viewport}:void 0})),{stop:__name(()=>{unsubscribeViewport(),animationFrameId&&cancelAnimationFrame(animationFrameId)},"stop")}}__name(startDisplayContext,"startDisplayContext");function createCookieObservable(configuration,cookieName){const detectCookieChangeStrategy=window.cookieStore?listenToCookieStoreChange(configuration):watchCookieFallback;return new Observable(observable=>detectCookieChangeStrategy(cookieName,event=>observable.notify(event)))}__name(createCookieObservable,"createCookieObservable");function listenToCookieStoreChange(configuration){return(cookieName,callback)=>addEventListener(configuration,window.cookieStore,"change",event=>{const changeEvent=event.changed.find(event2=>event2.name===cookieName)||event.deleted.find(event2=>event2.name===cookieName);changeEvent&&callback(changeEvent.value)}).stop}__name(listenToCookieStoreChange,"listenToCookieStoreChange");const WATCH_COOKIE_INTERVAL_DELAY=ONE_SECOND;function watchCookieFallback(cookieName,callback){const previousCookieValue=findCommaSeparatedValue(document.cookie,cookieName),watchCookieIntervalId=setInterval$1(()=>{const cookieValue=findCommaSeparatedValue(document.cookie,cookieName);cookieValue!==previousCookieValue&&callback(cookieValue)},WATCH_COOKIE_INTERVAL_DELAY);return()=>{clearInterval$1(watchCookieIntervalId)}}__name(watchCookieFallback,"watchCookieFallback");const CI_VISIBILITY_TEST_ID_COOKIE_NAME="datadog-ci-visibility-test-execution-id";function startCiVisibilityContext(configuration,hooks,cookieObservable=createCookieObservable(configuration,CI_VISIBILITY_TEST_ID_COOKIE_NAME)){var _a20;let testExecutionId=getInitCookie(CI_VISIBILITY_TEST_ID_COOKIE_NAME)||((_a20=window.Cypress)===null||_a20===void 0?void 0:_a20.env("traceId"));const cookieObservableSubscription=cookieObservable.subscribe(value=>{testExecutionId=value});return hooks.register(0,({eventType})=>typeof testExecutionId!="string"?SKIPPED:{type:eventType,session:{type:"ci_test"},ci_test:{test_execution_id:testExecutionId}}),{stop:__name(()=>{cookieObservableSubscription.unsubscribe()},"stop")}}__name(startCiVisibilityContext,"startCiVisibilityContext");function startLongTaskCollection(lifeCycle,configuration){const entryType=supportPerformanceTimingEvent(RumPerformanceEntryType.LONG_ANIMATION_FRAME)?RumPerformanceEntryType.LONG_ANIMATION_FRAME:RumPerformanceEntryType.LONG_TASK,subscription=createPerformanceObservable(configuration,{type:entryType,buffered:!0}).subscribe(entries=>{for(const entry of entries){if(!configuration.trackLongTasks)break;const startClocks=relativeToClocks(entry.startTime),rawRumEvent=processEntry(entry,startClocks);lifeCycle.notify(12,{rawRumEvent,startClocks,duration:entry.duration,domainContext:{performanceEntry:entry}})}});return{stop:__name(()=>subscription.unsubscribe(),"stop")}}__name(startLongTaskCollection,"startLongTaskCollection");function processEntry(entry,startClocks){const id2=generateUUID(),duration2=toServerDuration(entry.duration),baseEvent={date:startClocks.timeStamp,type:RumEventType.LONG_TASK,_dd:{discarded:!1}};return entry.entryType===RumPerformanceEntryType.LONG_TASK?{...baseEvent,long_task:{id:id2,entry_type:RumLongTaskEntryType.LONG_TASK,duration:duration2}}:{...baseEvent,long_task:{id:id2,entry_type:RumLongTaskEntryType.LONG_ANIMATION_FRAME,duration:duration2,blocking_duration:toServerDuration(entry.blockingDuration),first_ui_event_timestamp:toServerDuration(entry.firstUIEventTimestamp),render_start:toServerDuration(entry.renderStart),style_and_layout_start:toServerDuration(entry.styleAndLayoutStart),start_time:toServerDuration(entry.startTime),scripts:entry.scripts.map(script=>({duration:toServerDuration(script.duration),pause_duration:toServerDuration(script.pauseDuration),forced_style_and_layout_duration:toServerDuration(script.forcedStyleAndLayoutDuration),start_time:toServerDuration(script.startTime),execution_start:toServerDuration(script.executionStart),source_url:script.sourceURL,source_function_name:script.sourceFunctionName,source_char_position:script.sourceCharPosition,invoker:script.invoker,invoker_type:script.invokerType,window_attribution:script.windowAttribution}))}}}__name(processEntry,"processEntry");function startSyntheticsContext(hooks){hooks.register(0,({eventType})=>{if(!isSyntheticsTest())return SKIPPED;const testId=getSyntheticsTestId(),resultId=getSyntheticsResultId();return{type:eventType,session:{type:"synthetics"},synthetics:{test_id:testId,result_id:resultId,injected:willSyntheticsInjectRum()}}})}__name(startSyntheticsContext,"startSyntheticsContext");function limitModification(object2,modifiableFieldPaths,modifier){const clone2=deepClone(object2),result=modifier(clone2);return objectEntries(modifiableFieldPaths).forEach(([fieldPath,fieldType])=>setValueAtPath(object2,clone2,fieldPath.split(/\.|(?=\[\])/),fieldType)),result}__name(limitModification,"limitModification");function setValueAtPath(object2,clone2,pathSegments,fieldType){const[field,...restPathSegments]=pathSegments;if(field==="[]"){Array.isArray(object2)&&Array.isArray(clone2)&&object2.forEach((item,i2)=>setValueAtPath(item,clone2[i2],restPathSegments,fieldType));return}if(!(!isValidObject(object2)||!isValidObject(clone2))){if(restPathSegments.length>0)return setValueAtPath(object2[field],clone2[field],restPathSegments,fieldType);setNestedValue(object2,field,clone2[field],fieldType)}}__name(setValueAtPath,"setValueAtPath");function setNestedValue(object2,field,value,fieldType){const newType=getType(value);newType===fieldType?object2[field]=sanitize(value):fieldType==="object"&&(newType==="undefined"||newType==="null")&&(object2[field]={})}__name(setNestedValue,"setNestedValue");function isValidObject(object2){return getType(object2)==="object"}__name(isValidObject,"isValidObject");const VIEW_MODIFIABLE_FIELD_PATHS={"view.name":"string","view.url":"string","view.referrer":"string"},USER_CUSTOMIZABLE_FIELD_PATHS={context:"object"},ROOT_MODIFIABLE_FIELD_PATHS={service:"string",version:"string"};let modifiableFieldPathsByEvent;function startRumAssembly(configuration,lifeCycle,hooks,reportError2,eventRateLimit){modifiableFieldPathsByEvent={[RumEventType.VIEW]:{"view.performance.lcp.resource_url":"string",...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS,...ROOT_MODIFIABLE_FIELD_PATHS},[RumEventType.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS,...ROOT_MODIFIABLE_FIELD_PATHS},[RumEventType.RESOURCE]:{"resource.url":"string","resource.graphql.variables":"string",...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS,...ROOT_MODIFIABLE_FIELD_PATHS},[RumEventType.ACTION]:{"action.target.name":"string",...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS,...ROOT_MODIFIABLE_FIELD_PATHS},[RumEventType.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS,...ROOT_MODIFIABLE_FIELD_PATHS},[RumEventType.VITAL]:{...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS,...ROOT_MODIFIABLE_FIELD_PATHS}};const eventRateLimiters={[RumEventType.ERROR]:createEventRateLimiter(RumEventType.ERROR,reportError2,eventRateLimit),[RumEventType.ACTION]:createEventRateLimiter(RumEventType.ACTION,reportError2,eventRateLimit),[RumEventType.VITAL]:createEventRateLimiter(RumEventType.VITAL,reportError2,eventRateLimit)};lifeCycle.subscribe(12,({startClocks,duration:duration2,rawRumEvent,domainContext})=>{const defaultRumEventAttributes=hooks.triggerHook(0,{eventType:rawRumEvent.type,rawRumEvent,domainContext,startTime:startClocks.relative,duration:duration2});if(defaultRumEventAttributes===DISCARDED)return;const serverRumEvent=combine(defaultRumEventAttributes,rawRumEvent,{ddtags:buildTags(configuration).join(",")});shouldSend(serverRumEvent,configuration.beforeSend,domainContext,eventRateLimiters)&&(isEmptyObject$1(serverRumEvent.context)&&delete serverRumEvent.context,lifeCycle.notify(13,serverRumEvent))})}__name(startRumAssembly,"startRumAssembly");function shouldSend(event,beforeSend2,domainContext,eventRateLimiters){var _a20;if(beforeSend2){const result=limitModification(event,modifiableFieldPathsByEvent[event.type],event2=>beforeSend2(event2,domainContext));if(result===!1&&event.type!==RumEventType.VIEW)return!1;result===!1&&display.warn("Can't dismiss view events using beforeSend!")}return!((_a20=eventRateLimiters[event.type])===null||_a20===void 0?void 0:_a20.isLimitReached())}__name(shouldSend,"shouldSend");function startSessionContext(hooks,sessionManager,recorderApi2,viewHistory){hooks.register(0,({eventType,startTime})=>{const session=sessionManager.findTrackedSession(startTime),view=viewHistory.findView(startTime);if(!session||!view)return DISCARDED;let hasReplay,sampledForReplay,isActive;return eventType===RumEventType.VIEW?(hasReplay=recorderApi2.getReplayStats(view.id)?!0:void 0,sampledForReplay=session.sessionReplay===1,isActive=view.sessionIsActive?void 0:!1):hasReplay=recorderApi2.isRecording()?!0:void 0,{type:eventType,session:{id:session.id,type:"user",has_replay:hasReplay,sampled_for_replay:sampledForReplay,is_active:isActive}}}),hooks.register(1,({startTime})=>{const session=sessionManager.findTrackedSession(startTime);return session?{session:{id:session.id}}:SKIPPED})}__name(startSessionContext,"startSessionContext");function startConnectivityContext(hooks){hooks.register(0,({eventType})=>({type:eventType,connectivity:getConnectivity()}))}__name(startConnectivityContext,"startConnectivityContext");function startDefaultContext(hooks,configuration,sdkName){hooks.register(0,({eventType})=>{const source=configuration.source;return{type:eventType,_dd:{format_version:2,drift:currentDrift(),configuration:{session_sample_rate:round$1(configuration.sessionSampleRate,3),session_replay_sample_rate:round$1(configuration.sessionReplaySampleRate,3),profiling_sample_rate:round$1(configuration.profilingSampleRate,3),trace_sample_rate:round$1(configuration.traceSampleRate,3),beta_encode_cookie_options:configuration.betaEncodeCookieOptions},browser_sdk_version:canUseEventBridge()?"6.28.1":void 0,sdk_name:sdkName},application:{id:configuration.applicationId},date:timeStampNow(),source}}),hooks.register(1,()=>({application:{id:configuration.applicationId}}))}__name(startDefaultContext,"startDefaultContext");function startTrackingConsentContext(hooks,trackingConsentState){hooks.register(1,()=>trackingConsentState.isGranted()?SKIPPED:DISCARDED)}__name(startTrackingConsentContext,"startTrackingConsentContext");const allowedEventTypes=[RumEventType.ACTION,RumEventType.ERROR,RumEventType.LONG_TASK,RumEventType.RESOURCE,RumEventType.VITAL];function startEventCollection(lifeCycle){return{addEvent:__name((startTime,event,domainContext,duration2)=>{allowedEventTypes.includes(event.type)&&lifeCycle.notify(12,{startClocks:relativeToClocks(startTime),rawRumEvent:event,domainContext,duration:duration2})},"addEvent")}}__name(startEventCollection,"startEventCollection");function startInitialViewMetricsTelemetry(lifeCycle,telemetry){if(!telemetry.metricsEnabled)return{stop:noop$2};const{unsubscribe}=lifeCycle.subscribe(4,({initialViewMetrics})=>{!initialViewMetrics.largestContentfulPaint||!initialViewMetrics.navigationTimings||(addTelemetryMetrics("Initial view metrics",{metrics:createCoreInitialViewMetrics(initialViewMetrics.largestContentfulPaint,initialViewMetrics.navigationTimings)}),unsubscribe())});return{stop:unsubscribe}}__name(startInitialViewMetricsTelemetry,"startInitialViewMetricsTelemetry");function createCoreInitialViewMetrics(lcp,navigation2){return{lcp:{value:lcp.value},navigation:{domComplete:navigation2.domComplete,domContentLoaded:navigation2.domContentLoaded,domInteractive:navigation2.domInteractive,firstByte:navigation2.firstByte,loadEvent:navigation2.loadEvent}}}__name(createCoreInitialViewMetrics,"createCoreInitialViewMetrics");function startSourceCodeContext(hooks){if(!isExperimentalFeatureEnabled(ExperimentalFeature.SOURCE_CODE_CONTEXT))return;const browserWindow=window,contextByFile=new Map;function buildContextByFile(){browserWindow.DD_SOURCE_CODE_CONTEXT&&(objectEntries(browserWindow.DD_SOURCE_CODE_CONTEXT).forEach(([stack,context])=>{const firstFrame=computeStackTrace({stack}).stack[0];if(!firstFrame.url){addTelemetryError("Source code context: missing frame url",{stack});return}contextByFile.has(firstFrame.url)||contextByFile.set(firstFrame.url,context)}),browserWindow.DD_SOURCE_CODE_CONTEXT={})}__name(buildContextByFile,"buildContextByFile"),buildContextByFile(),hooks.register(0,({domainContext,rawRumEvent})=>{buildContextByFile();const url2=getSourceUrl(domainContext,rawRumEvent);if(url2){const context=contextByFile.get(url2);if(context)return{type:rawRumEvent.type,service:context.service,version:context.version}}return SKIPPED})}__name(startSourceCodeContext,"startSourceCodeContext");function getSourceUrl(domainContext,rawRumEvent){var _a20,_b;if(rawRumEvent.type==="long_task"&&rawRumEvent.long_task.entry_type==="long-animation-frame")return(_a20=rawRumEvent.long_task.scripts[0])===null||_a20===void 0?void 0:_a20.source_url;let stack;return"handlingStack"in domainContext&&(stack=domainContext.handlingStack),rawRumEvent.type==="error"&&rawRumEvent.error.stack&&(stack=rawRumEvent.error.stack),(_b=computeStackTrace({stack}).stack[0])===null||_b===void 0?void 0:_b.url}__name(getSourceUrl,"getSourceUrl");function startRum(configuration,recorderApi2,profilerApi2,initialViewOptions,createEncoder,trackingConsentState,customVitalsState,bufferedDataObservable,telemetry,hooks,sdkName){const cleanupTasks2=[],lifeCycle=new LifeCycle;lifeCycle.subscribe(13,event=>sendToExtension("rum",event));const reportError2=__name(error2=>{lifeCycle.notify(14,{error:error2}),addTelemetryDebug("Error reported to customer",{"error.message":error2.message})},"reportError"),pageMayExitObservable=createPageMayExitObservable(configuration),pageMayExitSubscription=pageMayExitObservable.subscribe(event=>{lifeCycle.notify(11,event)});cleanupTasks2.push(()=>pageMayExitSubscription.unsubscribe());const session=canUseEventBridge()?startRumSessionManagerStub():startRumSessionManager(configuration,lifeCycle,trackingConsentState);if(canUseEventBridge())startRumEventBridge(lifeCycle);else{const batch2=startRumBatch(configuration,lifeCycle,reportError2,pageMayExitObservable,session.expireObservable,createEncoder);cleanupTasks2.push(()=>batch2.stop()),startCustomerDataTelemetry(telemetry,lifeCycle,batch2.flushController.flushObservable)}startTrackingConsentContext(hooks,trackingConsentState);const{stop:stopInitialViewMetricsTelemetry}=startInitialViewMetricsTelemetry(lifeCycle,telemetry);cleanupTasks2.push(stopInitialViewMetricsTelemetry);const{stop:stopRumEventCollection,...startRumEventCollectionResult}=startRumEventCollection(lifeCycle,hooks,configuration,session,recorderApi2,initialViewOptions,customVitalsState,bufferedDataObservable,sdkName,reportError2);return cleanupTasks2.push(stopRumEventCollection),bufferedDataObservable.unbuffer(),cleanupTasks2.push(()=>profilerApi2.stop()),{...startRumEventCollectionResult,lifeCycle,session,stopSession:__name(()=>session.expire(),"stopSession"),telemetry,stop:__name(()=>{cleanupTasks2.forEach(task=>task())},"stop"),hooks}}__name(startRum,"startRum");function startRumEventCollection(lifeCycle,hooks,configuration,session,recorderApi2,initialViewOptions,customVitalsState,bufferedDataObservable,sdkName,reportError2){const cleanupTasks2=[],domMutationObservable=createDOMMutationObservable(),locationChangeObservable=createLocationChangeObservable(configuration),{observable:windowOpenObservable,stop:stopWindowOpen}=createWindowOpenObservable();cleanupTasks2.push(stopWindowOpen),startDefaultContext(hooks,configuration,sdkName);const pageStateHistory=startPageStateHistory(hooks,configuration);cleanupTasks2.push(()=>pageStateHistory.stop());const viewHistory=startViewHistory(lifeCycle);cleanupTasks2.push(()=>viewHistory.stop());const urlContexts=startUrlContexts(lifeCycle,hooks,locationChangeObservable);cleanupTasks2.push(()=>urlContexts.stop());const featureFlagContexts=startFeatureFlagContexts(lifeCycle,hooks,configuration);startSessionContext(hooks,session,recorderApi2,viewHistory),startConnectivityContext(hooks);const globalContext=startGlobalContext(hooks,configuration,"rum"),userContext=startUserContext(hooks,configuration,session,"rum"),accountContext=startAccountContext(hooks,configuration,"rum"),actionCollection=startActionCollection(lifeCycle,hooks,domMutationObservable,windowOpenObservable,configuration);cleanupTasks2.push(actionCollection.stop);const eventCollection=startEventCollection(lifeCycle),displayContext=startDisplayContext(hooks,configuration);cleanupTasks2.push(displayContext.stop);const ciVisibilityContext=startCiVisibilityContext(configuration,hooks);cleanupTasks2.push(ciVisibilityContext.stop),startSyntheticsContext(hooks),startRumAssembly(configuration,lifeCycle,hooks,reportError2);const{addTiming,startView,setViewName,setViewContext,setViewContextProperty,getViewContext,stop:stopViewCollection}=startViewCollection(lifeCycle,hooks,configuration,domMutationObservable,windowOpenObservable,locationChangeObservable,recorderApi2,viewHistory,initialViewOptions);startSourceCodeContext(hooks),cleanupTasks2.push(stopViewCollection);const resourceCollection=startResourceCollection(lifeCycle,configuration,pageStateHistory);cleanupTasks2.push(resourceCollection.stop);const{stop:stopLongTaskCollection}=startLongTaskCollection(lifeCycle,configuration);cleanupTasks2.push(stopLongTaskCollection);const{addError}=startErrorCollection(lifeCycle,configuration,bufferedDataObservable);startRequestCollection(lifeCycle,configuration,session,userContext,accountContext);const vitalCollection=startVitalCollection(lifeCycle,pageStateHistory,customVitalsState),internalContext=startInternalContext(configuration.applicationId,session,viewHistory,actionCollection.actionContexts,urlContexts);return{addAction:actionCollection.addAction,startAction:actionCollection.startAction,stopAction:actionCollection.stopAction,startResource:resourceCollection.startResource,stopResource:resourceCollection.stopResource,addEvent:eventCollection.addEvent,addError,addTiming,addFeatureFlagEvaluation:featureFlagContexts.addFeatureFlagEvaluation,startView,setViewContext,setViewContextProperty,getViewContext,setViewName,viewHistory,getInternalContext:internalContext.get,startDurationVital:vitalCollection.startDurationVital,stopDurationVital:vitalCollection.stopDurationVital,addDurationVital:vitalCollection.addDurationVital,addOperationStepVital:vitalCollection.addOperationStepVital,globalContext,userContext,accountContext,stop:__name(()=>cleanupTasks2.forEach(task=>task()),"stop")}}__name(startRumEventCollection,"startRumEventCollection");function makeRumPublicApi(recorderApi2,profilerApi2,options={}){const trackingConsentState=createTrackingConsentState(),customVitalsState=createCustomVitalsState(),bufferedDataObservable=startBufferingData().observable;let strategy=createPreStartStrategy$1(options,trackingConsentState,customVitalsState,(configuration,deflateWorker,initialViewOptions,telemetry,hooks)=>{const createEncoder=deflateWorker&&options.createDeflateEncoder?streamId=>options.createDeflateEncoder(configuration,deflateWorker,streamId):createIdentityEncoder,startRumResult=startRum(configuration,recorderApi2,profilerApi2,initialViewOptions,createEncoder,trackingConsentState,customVitalsState,bufferedDataObservable,telemetry,hooks,options.sdkName);return recorderApi2.onRumStart(startRumResult.lifeCycle,configuration,startRumResult.session,startRumResult.viewHistory,deflateWorker,startRumResult.telemetry),profilerApi2.onRumStart(startRumResult.lifeCycle,startRumResult.hooks,configuration,startRumResult.session,startRumResult.viewHistory,createEncoder),strategy=createPostStartStrategy$1(strategy,startRumResult),callPluginsMethod(configuration.plugins,"onRumStart",{strategy,addEvent:startRumResult.addEvent}),startRumResult});const getStrategy=__name(()=>strategy,"getStrategy"),startView=__name(options2=>{const handlingStack=createHandlingStack("view");callMonitored(()=>{const sanitizedOptions=typeof options2=="object"?options2:{name:options2};strategy.startView({...sanitizedOptions,handlingStack}),addTelemetryUsage({feature:"start-view"})})},"startView"),rumPublicApi=makePublicApi({init:__name(initConfiguration=>{const errorStack=new Error().stack;callMonitored(()=>strategy.init(initConfiguration,rumPublicApi,errorStack))},"init"),setTrackingConsent:monitor(trackingConsent=>{trackingConsentState.update(trackingConsent),addTelemetryUsage({feature:"set-tracking-consent",tracking_consent:trackingConsent})}),setViewName:monitor(name2=>{strategy.setViewName(name2),addTelemetryUsage({feature:"set-view-name"})}),setViewContext:monitor(context=>{strategy.setViewContext(context),addTelemetryUsage({feature:"set-view-context"})}),setViewContextProperty:monitor((key,value)=>{strategy.setViewContextProperty(key,value),addTelemetryUsage({feature:"set-view-context-property"})}),getViewContext:monitor(()=>(addTelemetryUsage({feature:"set-view-context-property"}),strategy.getViewContext())),getInternalContext:monitor(startTime=>strategy.getInternalContext(startTime)),getInitConfiguration:monitor(()=>deepClone(strategy.initConfiguration)),addAction:__name((name2,context)=>{const handlingStack=createHandlingStack("action");callMonitored(()=>{strategy.addAction({name:sanitize(name2),context:sanitize(context),startClocks:clocksNow(),type:ActionType.CUSTOM,handlingStack}),addTelemetryUsage({feature:"add-action"})})},"addAction"),startAction:monitor((name2,options2)=>{strategy.initConfiguration&&!isExperimentalFeatureEnabled(ExperimentalFeature.START_STOP_ACTION)||strategy.startAction(sanitize(name2),{type:sanitize(options2&&options2.type),context:sanitize(options2&&options2.context),actionKey:options2&&options2.actionKey})}),stopAction:monitor((name2,options2)=>{strategy.initConfiguration&&!isExperimentalFeatureEnabled(ExperimentalFeature.START_STOP_ACTION)||strategy.stopAction(sanitize(name2),{type:sanitize(options2&&options2.type),context:sanitize(options2&&options2.context),actionKey:options2&&options2.actionKey})}),startResource:monitor((url2,options2)=>{strategy.initConfiguration&&!isExperimentalFeatureEnabled(ExperimentalFeature.START_STOP_RESOURCE)||strategy.startResource(sanitize(url2),{type:sanitize(options2&&options2.type),method:sanitize(options2&&options2.method),context:sanitize(options2&&options2.context),resourceKey:options2&&options2.resourceKey})}),stopResource:monitor((url2,options2)=>{strategy.initConfiguration&&!isExperimentalFeatureEnabled(ExperimentalFeature.START_STOP_RESOURCE)||strategy.stopResource(sanitize(url2),{statusCode:options2&&options2.statusCode,context:sanitize(options2&&options2.context),resourceKey:options2&&options2.resourceKey})}),addError:__name((error2,context)=>{const handlingStack=createHandlingStack("error");callMonitored(()=>{strategy.addError({error:error2,handlingStack,context:sanitize(context),startClocks:clocksNow()}),addTelemetryUsage({feature:"add-error"})})},"addError"),addTiming:monitor((name2,time2)=>{strategy.addTiming(sanitize(name2),time2)}),setGlobalContext:defineContextMethod(getStrategy,CustomerContextKey.globalContext,ContextManagerMethod.setContext,"set-global-context"),getGlobalContext:defineContextMethod(getStrategy,CustomerContextKey.globalContext,ContextManagerMethod.getContext,"get-global-context"),setGlobalContextProperty:defineContextMethod(getStrategy,CustomerContextKey.globalContext,ContextManagerMethod.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:defineContextMethod(getStrategy,CustomerContextKey.globalContext,ContextManagerMethod.removeContextProperty,"remove-global-context-property"),clearGlobalContext:defineContextMethod(getStrategy,CustomerContextKey.globalContext,ContextManagerMethod.clearContext,"clear-global-context"),setUser:defineContextMethod(getStrategy,CustomerContextKey.userContext,ContextManagerMethod.setContext,"set-user"),getUser:defineContextMethod(getStrategy,CustomerContextKey.userContext,ContextManagerMethod.getContext,"get-user"),setUserProperty:defineContextMethod(getStrategy,CustomerContextKey.userContext,ContextManagerMethod.setContextProperty,"set-user-property"),removeUserProperty:defineContextMethod(getStrategy,CustomerContextKey.userContext,ContextManagerMethod.removeContextProperty,"remove-user-property"),clearUser:defineContextMethod(getStrategy,CustomerContextKey.userContext,ContextManagerMethod.clearContext,"clear-user"),setAccount:defineContextMethod(getStrategy,CustomerContextKey.accountContext,ContextManagerMethod.setContext,"set-account"),getAccount:defineContextMethod(getStrategy,CustomerContextKey.accountContext,ContextManagerMethod.getContext,"get-account"),setAccountProperty:defineContextMethod(getStrategy,CustomerContextKey.accountContext,ContextManagerMethod.setContextProperty,"set-account-property"),removeAccountProperty:defineContextMethod(getStrategy,CustomerContextKey.accountContext,ContextManagerMethod.removeContextProperty,"remove-account-property"),clearAccount:defineContextMethod(getStrategy,CustomerContextKey.accountContext,ContextManagerMethod.clearContext,"clear-account"),startView,stopSession:monitor(()=>{strategy.stopSession(),addTelemetryUsage({feature:"stop-session"})}),addFeatureFlagEvaluation:monitor((key,value)=>{strategy.addFeatureFlagEvaluation(sanitize(key),sanitize(value)),addTelemetryUsage({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:monitor(()=>recorderApi2.getSessionReplayLink()),startSessionReplayRecording:monitor(options2=>{recorderApi2.start(options2),addTelemetryUsage({feature:"start-session-replay-recording",force:options2&&options2.force})}),stopSessionReplayRecording:monitor(()=>recorderApi2.stop()),addDurationVital:__name((name2,options2)=>{const handlingStack=createHandlingStack("vital");callMonitored(()=>{addTelemetryUsage({feature:"add-duration-vital"}),strategy.addDurationVital({name:sanitize(name2),type:VitalType.DURATION,startClocks:timeStampToClocks(options2.startTime),duration:options2.duration,context:sanitize(options2&&options2.context),description:sanitize(options2&&options2.description),handlingStack})})},"addDurationVital"),startDurationVital:__name((name2,options2)=>{const handlingStack=createHandlingStack("vital");return callMonitored(()=>(addTelemetryUsage({feature:"start-duration-vital"}),strategy.startDurationVital(sanitize(name2),{context:sanitize(options2&&options2.context),description:sanitize(options2&&options2.description),handlingStack})))},"startDurationVital"),stopDurationVital:monitor((nameOrRef,options2)=>{addTelemetryUsage({feature:"stop-duration-vital"}),strategy.stopDurationVital(typeof nameOrRef=="string"?sanitize(nameOrRef):nameOrRef,{context:sanitize(options2&&options2.context),description:sanitize(options2&&options2.description)})}),startFeatureOperation:monitor((name2,options2)=>{addTelemetryUsage({feature:"add-operation-step-vital",action_type:"start"}),strategy.addOperationStepVital(name2,"start",options2)}),succeedFeatureOperation:monitor((name2,options2)=>{addTelemetryUsage({feature:"add-operation-step-vital",action_type:"succeed"}),strategy.addOperationStepVital(name2,"end",options2)}),failFeatureOperation:monitor((name2,failureReason,options2)=>{addTelemetryUsage({feature:"add-operation-step-vital",action_type:"fail"}),strategy.addOperationStepVital(name2,"end",options2,failureReason)})});return rumPublicApi}__name(makeRumPublicApi,"makeRumPublicApi");function createPostStartStrategy$1(preStartStrategy,startRumResult){return{init:__name(initConfiguration=>{displayAlreadyInitializedError("DD_RUM",initConfiguration)},"init"),initConfiguration:preStartStrategy.initConfiguration,...startRumResult}}__name(createPostStartStrategy$1,"createPostStartStrategy$1");function getSessionReplayUrl(configuration,{session,viewContext,errorType}){const sessionId=session?session.id:"no-session-id",parameters=[];errorType!==void 0&¶meters.push(`error-type=${errorType}`),viewContext&&(parameters.push(`seed=${viewContext.id}`),parameters.push(`from=${viewContext.startClocks.timeStamp}`));const origin2=getDatadogSiteUrl(configuration),path=`/rum/replay/sessions/${sessionId}`;return`${origin2}${path}?${parameters.join("&")}`}__name(getSessionReplayUrl,"getSessionReplayUrl");function getDatadogSiteUrl(rumConfiguration){const site=rumConfiguration.site,subdomain=rumConfiguration.subdomain||getSiteDefaultSubdomain(rumConfiguration);return`https://${subdomain?`${subdomain}.`:""}${site}`}__name(getDatadogSiteUrl,"getDatadogSiteUrl");function getSiteDefaultSubdomain(configuration){switch(configuration.site){case INTAKE_SITE_US1:case INTAKE_SITE_EU1:return"app";case INTAKE_SITE_STAGING:return"dd";default:return}}__name(getSiteDefaultSubdomain,"getSiteDefaultSubdomain");const MAX_STATS_HISTORY=1e3;let statsPerView;function getSegmentsCount(viewId){return getOrCreateReplayStats(viewId).segments_count}__name(getSegmentsCount,"getSegmentsCount");function addSegment(viewId){getOrCreateReplayStats(viewId).segments_count+=1}__name(addSegment,"addSegment");function addRecord(viewId){getOrCreateReplayStats(viewId).records_count+=1}__name(addRecord,"addRecord");function addWroteData(viewId,additionalBytesCount){getOrCreateReplayStats(viewId).segments_total_raw_size+=additionalBytesCount}__name(addWroteData,"addWroteData");function getReplayStats(viewId){return statsPerView?.get(viewId)}__name(getReplayStats,"getReplayStats");function getOrCreateReplayStats(viewId){statsPerView||(statsPerView=new Map);let replayStats;return statsPerView.has(viewId)?replayStats=statsPerView.get(viewId):(replayStats={records_count:0,segments_count:0,segments_total_raw_size:0},statsPerView.set(viewId,replayStats),statsPerView.size>MAX_STATS_HISTORY&&deleteOldestStats()),replayStats}__name(getOrCreateReplayStats,"getOrCreateReplayStats");function deleteOldestStats(){if(!statsPerView)return;const toDelete=statsPerView.keys().next().value;toDelete&&statsPerView.delete(toDelete)}__name(deleteOldestStats,"deleteOldestStats");function createDeflateEncoder(configuration,worker,streamId){let rawBytesCount=0,compressedData=[],compressedDataTrailer,isEmpty2=!0,nextWriteActionId=0;const pendingWriteActions=[],{stop:removeMessageListener}=addEventListener(configuration,worker,"message",({data:workerResponse})=>{if(workerResponse.type!=="wrote"||workerResponse.streamId!==streamId)return;const nextPendingAction=pendingWriteActions[0];nextPendingAction&&(nextPendingAction.id===workerResponse.id?(pendingWriteActions.shift(),rawBytesCount+=workerResponse.additionalBytesCount,compressedData.push(workerResponse.result),compressedDataTrailer=workerResponse.trailer,nextPendingAction.writeCallback?nextPendingAction.writeCallback(workerResponse.result.byteLength):nextPendingAction.finishCallback&&nextPendingAction.finishCallback()):nextPendingAction.id<workerResponse.id&&removeMessageListener())});function consumeResult(){const output=compressedData.length===0?new Uint8Array(0):concatBuffers(compressedData.concat(compressedDataTrailer)),result={rawBytesCount,output,outputBytesCount:output.byteLength,encoding:"deflate"};return rawBytesCount=0,compressedData=[],result}__name(consumeResult,"consumeResult");function sendResetIfNeeded(){isEmpty2||(worker.postMessage({action:"reset",streamId}),isEmpty2=!0)}return __name(sendResetIfNeeded,"sendResetIfNeeded"),{isAsync:!0,get isEmpty(){return isEmpty2},write(data,callback){worker.postMessage({action:"write",id:nextWriteActionId,data,streamId}),pendingWriteActions.push({id:nextWriteActionId,writeCallback:callback,data}),isEmpty2=!1,nextWriteActionId+=1},finish(callback){sendResetIfNeeded(),pendingWriteActions.length?(pendingWriteActions.forEach(pendingWriteAction=>{delete pendingWriteAction.writeCallback}),pendingWriteActions[pendingWriteActions.length-1].finishCallback=()=>callback(consumeResult())):callback(consumeResult())},finishSync(){sendResetIfNeeded();const pendingData=pendingWriteActions.map(pendingWriteAction=>pendingWriteAction.data).join("");return pendingWriteActions.length=0,{...consumeResult(),pendingData}},estimateEncodedBytesCount(data){return data.length/8},stop(){removeMessageListener()}}}__name(createDeflateEncoder,"createDeflateEncoder");function reportScriptLoadingError({configuredUrl,error:error2,source,scriptType}){if(display.error(`${source} failed to start: an error occurred while initializing the ${scriptType}:`,error2),error2 instanceof Event||error2 instanceof Error&&isMessageCspRelated(error2.message)){let baseMessage;configuredUrl?baseMessage=`Please make sure the ${scriptType} URL ${configuredUrl} is correct and CSP is correctly configured.`:baseMessage="Please make sure CSP is correctly configured.",display.error(`${baseMessage} See documentation at ${DOCS_ORIGIN}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else scriptType==="worker"&&addTelemetryError(error2)}__name(reportScriptLoadingError,"reportScriptLoadingError");function isMessageCspRelated(message){return message.includes("Content Security Policy")||message.includes("requires 'TrustedScriptURL'")}__name(isMessageCspRelated,"isMessageCspRelated");const INITIALIZATION_TIME_OUT_DELAY=30*ONE_SECOND;function createDeflateWorker(configuration){return new Worker(configuration.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.28.1"};case"write":{let n=e.get(a.streamId);n||(n=new pt,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:vt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){gt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}})}catch(t){gt(e,t)}}()})();'])))}__name(createDeflateWorker,"createDeflateWorker");let state={status:0};function startDeflateWorker(configuration,source,onInitializationFailure){switch(state.status===0&&doStartDeflateWorker(configuration,source),state.status){case 1:return state.initializationFailureCallbacks.push(onInitializationFailure),state.worker;case 3:return state.worker}}__name(startDeflateWorker,"startDeflateWorker");function getDeflateWorkerStatus(){return state.status}__name(getDeflateWorkerStatus,"getDeflateWorkerStatus");function doStartDeflateWorker(configuration,source){try{const worker=createDeflateWorker(configuration),{stop:removeErrorListener}=addEventListener(configuration,worker,"error",error2=>{onError$1(configuration,source,error2)}),{stop:removeMessageListener}=addEventListener(configuration,worker,"message",({data})=>{data.type==="errored"?onError$1(configuration,source,data.error,data.streamId):data.type==="initialized"&&onInitialized(data.version)});worker.postMessage({action:"init"}),setTimeout$1(()=>onTimeout(source),INITIALIZATION_TIME_OUT_DELAY),state={status:1,worker,stop:__name(()=>{removeErrorListener(),removeMessageListener()},"stop"),initializationFailureCallbacks:[]}}catch(error2){onError$1(configuration,source,error2)}}__name(doStartDeflateWorker,"doStartDeflateWorker");function onTimeout(source){state.status===1&&(display.error(`${source} failed to start: a timeout occurred while initializing the Worker`),state.initializationFailureCallbacks.forEach(callback=>callback()),state={status:2})}__name(onTimeout,"onTimeout");function onInitialized(version2){state.status===1&&(state={status:3,worker:state.worker,stop:state.stop,version:version2})}__name(onInitialized,"onInitialized");function onError$1(configuration,source,error2,streamId){state.status===1||state.status===0?(reportScriptLoadingError({configuredUrl:configuration.workerUrl,error:error2,source,scriptType:"worker"}),state.status===1&&state.initializationFailureCallbacks.forEach(callback=>callback()),state={status:2}):addTelemetryError(error2,{worker_version:state.status===3&&state.version,stream_id:streamId})}__name(onError$1,"onError$1");function isBrowserSupported(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}__name(isBrowserSupported,"isBrowserSupported");function getSessionReplayLink(configuration,sessionManager,viewHistory,isRecordingStarted){const session=sessionManager.findTrackedSession(),errorType=getErrorType(session,isRecordingStarted),viewContext=viewHistory.findView();return getSessionReplayUrl(configuration,{viewContext,errorType,session})}__name(getSessionReplayLink,"getSessionReplayLink");function getErrorType(session,isRecordingStarted){if(!isBrowserSupported())return"browser-not-supported";if(!session)return"rum-not-tracked";if(session.sessionReplay===0)return"incorrect-session-plan";if(!isRecordingStarted)return"replay-not-started"}__name(getErrorType,"getErrorType");function startRecorderInitTelemetry(telemetry,observable){if(!telemetry.metricsEnabled)return{stop:noop$2};let startContext,documentReadyDuration,recorderSettledDuration;const{unsubscribe}=observable.subscribe(event=>{switch(event.type){case"start":startContext={forced:event.forced,timestamp:timeStampNow()},documentReadyDuration=void 0,recorderSettledDuration=void 0;break;case"document-ready":startContext&&(documentReadyDuration=elapsed(startContext.timestamp,timeStampNow()));break;case"recorder-settled":startContext&&(recorderSettledDuration=elapsed(startContext.timestamp,timeStampNow()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":unsubscribe(),startContext&&addTelemetryMetrics("Recorder init metrics",{metrics:createRecorderInitMetrics(startContext.forced,recorderSettledDuration,elapsed(startContext.timestamp,timeStampNow()),event.type,documentReadyDuration)});break}});return{stop:unsubscribe}}__name(startRecorderInitTelemetry,"startRecorderInitTelemetry");function createRecorderInitMetrics(forced,loadRecorderModuleDuration,recorderInitDuration,result,waitForDocReadyDuration){return{forced,loadRecorderModuleDuration,recorderInitDuration,result,waitForDocReadyDuration}}__name(createRecorderInitMetrics,"createRecorderInitMetrics");function createPostStartStrategy(configuration,lifeCycle,sessionManager,viewHistory,loadRecorder,getOrCreateDeflateEncoder,telemetry){let status=0,stopRecording;lifeCycle.subscribe(9,()=>{(status===2||status===3)&&(stop(),status=1)}),lifeCycle.subscribe(10,()=>{status===1&&start()});const observable=new Observable;startRecorderInitTelemetry(telemetry,observable);const doStart=__name(async forced=>{observable.notify({type:"start",forced});const[startRecordingImpl]=await Promise.all([notifyWhenSettled(observable,{type:"recorder-settled"},loadRecorder()),notifyWhenSettled(observable,{type:"document-ready"},asyncRunOnReadyState(configuration,"interactive"))]);if(status!==2){observable.notify({type:"aborted"});return}if(!startRecordingImpl){status=0,observable.notify({type:"recorder-load-failed"});return}const deflateEncoder=getOrCreateDeflateEncoder();if(!deflateEncoder){status=0,observable.notify({type:"deflate-encoder-load-failed"});return}({stop:stopRecording}=startRecordingImpl(lifeCycle,configuration,sessionManager,viewHistory,deflateEncoder,telemetry)),status=3,observable.notify({type:"succeeded"})},"doStart");function start(options){const session=sessionManager.findTrackedSession();if(canStartRecording(session,options)){status=1;return}if(isRecordingInProgress(status))return;status=2;const forced=shouldForceReplay(session,options)||!1;doStart(forced).catch(monitorError),forced&&sessionManager.setForcedReplay()}__name(start,"start");function stop(){status===3&&stopRecording?.(),status=0}return __name(stop,"stop"),{start,stop,getSessionReplayLink(){return getSessionReplayLink(configuration,sessionManager,viewHistory,status!==0)},isRecording:__name(()=>status===3,"isRecording")}}__name(createPostStartStrategy,"createPostStartStrategy");function canStartRecording(session,options){return!session||session.sessionReplay===0&&(!options||!options.force)}__name(canStartRecording,"canStartRecording");function isRecordingInProgress(status){return status===2||status===3}__name(isRecordingInProgress,"isRecordingInProgress");function shouldForceReplay(session,options){return options&&options.force&&session.sessionReplay===0}__name(shouldForceReplay,"shouldForceReplay");async function notifyWhenSettled(observable,event,promise2){try{return await promise2}finally{observable.notify(event)}}__name(notifyWhenSettled,"notifyWhenSettled");function createPreStartStrategy(){let status=0;return{strategy:{start(){status=1},stop(){status=2},isRecording:__name(()=>!1,"isRecording"),getSessionReplayLink:noop$2},shouldStartImmediately(configuration){return status===1||status===0&&!configuration.startSessionReplayRecordingManually}}}__name(createPreStartStrategy,"createPreStartStrategy");function makeRecorderApi(loadRecorder){if(canUseEventBridge()&&!bridgeSupports("records")||!isBrowserSupported())return{start:noop$2,stop:noop$2,getReplayStats:__name(()=>{},"getReplayStats"),onRumStart:noop$2,isRecording:__name(()=>!1,"isRecording"),getSessionReplayLink:__name(()=>{},"getSessionReplayLink")};let{strategy,shouldStartImmediately}=createPreStartStrategy();return{start:__name(options=>strategy.start(options),"start"),stop:__name(()=>strategy.stop(),"stop"),getSessionReplayLink:__name(()=>strategy.getSessionReplayLink(),"getSessionReplayLink"),onRumStart,isRecording:__name(()=>getDeflateWorkerStatus()===3&&strategy.isRecording(),"isRecording"),getReplayStats:__name(viewId=>getDeflateWorkerStatus()===3?getReplayStats(viewId):void 0,"getReplayStats")};function onRumStart(lifeCycle,configuration,sessionManager,viewHistory,worker,telemetry){let cachedDeflateEncoder;function getOrCreateDeflateEncoder(){return cachedDeflateEncoder||(worker??(worker=startDeflateWorker(configuration,"Datadog Session Replay",()=>strategy.stop())),worker&&(cachedDeflateEncoder=createDeflateEncoder(configuration,worker,1))),cachedDeflateEncoder}__name(getOrCreateDeflateEncoder,"getOrCreateDeflateEncoder"),strategy=createPostStartStrategy(configuration,lifeCycle,sessionManager,viewHistory,loadRecorder,getOrCreateDeflateEncoder,telemetry),shouldStartImmediately(configuration)&&strategy.start()}}__name(makeRecorderApi,"makeRecorderApi");const scriptRel="modulepreload",assetsURL=__name(function(dep){return"/"+dep},"assetsURL"),seen={},__vitePreload=__name(function(baseModule,deps,importerUrl){let promise2=Promise.resolve();if(deps&&deps.length>0){let allSettled=function(promises$2){return Promise.all(promises$2.map(p=>Promise.resolve(p).then(value$1=>({status:"fulfilled",value:value$1}),reason=>({status:"rejected",reason}))))};__name(allSettled,"allSettled"),document.getElementsByTagName("link");const cspNonceMeta=document.querySelector("meta[property=csp-nonce]"),cspNonce=cspNonceMeta?.nonce||cspNonceMeta?.getAttribute("nonce");promise2=allSettled(deps.map(dep=>{if(dep=assetsURL(dep),dep in seen)return;seen[dep]=!0;const isCss=dep.endsWith(".css"),cssSelector=isCss?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${dep}"]${cssSelector}`))return;const link2=document.createElement("link");if(link2.rel=isCss?"stylesheet":scriptRel,isCss||(link2.as="script"),link2.crossOrigin="",link2.href=dep,cspNonce&&link2.setAttribute("nonce",cspNonce),document.head.appendChild(link2),isCss)return new Promise((res,rej)=>{link2.addEventListener("load",res),link2.addEventListener("error",()=>rej(new Error(`Unable to preload CSS for ${dep}`)))})}))}function handlePreloadError(err$2){const e$1=new Event("vite:preloadError",{cancelable:!0});if(e$1.payload=err$2,window.dispatchEvent(e$1),!e$1.defaultPrevented)throw err$2}return __name(handlePreloadError,"handlePreloadError"),promise2.then(res=>{for(const item of res||[])item.status==="rejected"&&handlePreloadError(item.reason);return baseModule().catch(handlePreloadError)})},"preload");async function lazyLoadRecorder(){try{return await importRecorder()}catch(error2){reportScriptLoadingError({error:error2,source:"Recorder",scriptType:"module"})}}__name(lazyLoadRecorder,"lazyLoadRecorder");async function importRecorder(){return(await __vitePreload(()=>import("./startRecording-oz3NQO5N.js"),[])).startRecording}__name(importRecorder,"importRecorder");function isProfilingSupported(){return getGlobalObject().Profiler!==void 0}__name(isProfilingSupported,"isProfilingSupported");function startProfilingContext(hooks){let currentContext={status:"starting"};return hooks.register(0,({eventType})=>eventType!==RumEventType.VIEW&&eventType!==RumEventType.LONG_TASK&&eventType!==RumEventType.ACTION&&eventType!==RumEventType.VITAL?SKIPPED:{type:eventType,_dd:{profiling:currentContext}}),{get:__name(()=>currentContext,"get"),set:__name(newContext=>{currentContext=newContext},"set")}}__name(startProfilingContext,"startProfilingContext");async function lazyLoadProfiler(){try{return await importProfiler()}catch(error2){reportScriptLoadingError({error:error2,source:"Profiler",scriptType:"module"})}}__name(lazyLoadProfiler,"lazyLoadProfiler");async function importProfiler(){return(await __vitePreload(()=>import("./profiler-CiZIC7ZI.js"),[])).createRumProfiler}__name(importProfiler,"importProfiler");function makeProfilerApi(){let profiler;function onRumStart(lifeCycle,hooks,configuration,sessionManager,viewHistory,createEncoder){const session=sessionManager.findTrackedSession();if(!session||!isSampled(session.id,configuration.profilingSampleRate))return;const profilingContextManager=startProfilingContext(hooks);if(!isProfilingSupported()){profilingContextManager.set({status:"error",error_reason:"not-supported-by-browser"});return}lazyLoadProfiler().then(createRumProfiler=>{if(!createRumProfiler){profilingContextManager.set({status:"error",error_reason:"failed-to-lazy-load"});return}profiler=createRumProfiler(configuration,lifeCycle,sessionManager,profilingContextManager,createEncoder,viewHistory,void 0),profiler.start()}).catch(monitorError)}return __name(onRumStart,"onRumStart"),{onRumStart,stop:__name(()=>{profiler?.stop()},"stop")}}__name(makeProfilerApi,"makeProfilerApi");const recorderApi=makeRecorderApi(lazyLoadRecorder),profilerApi=makeProfilerApi(),datadogRum=makeRumPublicApi(recorderApi,profilerApi,{startDeflateWorker,createDeflateEncoder,sdkName:"rum"});defineGlobal(getGlobalObject(),"DD_RUM",datadogRum);function addReactError(error2,info){createHandlingStack("react error"),clocksNow()}__name(addReactError,"addReactError");const INITIAL_STATE={didCatch:!1,error:null},_ErrorBoundary=class _ErrorBoundary extends React.Component{constructor(props){super(props),this.resetError=()=>{this.setState(INITIAL_STATE)},this.state=INITIAL_STATE}static getDerivedStateFromError(error2){return{didCatch:!0,error:error2}}componentDidCatch(error2,errorInfo){addReactError()}render(){return this.state.didCatch?React.createElement(this.props.fallback,{error:this.state.error,resetError:this.resetError}):this.props.children}};__name(_ErrorBoundary,"ErrorBoundary");let ErrorBoundary=_ErrorBoundary,initialized$1=!1;function useDatadog(){reactExports.useEffect(()=>{initialized$1||(initialized$1=!0)},[])}__name(useDatadog,"useDatadog");function StudioLocal(){return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Outlet,{})})}__name(StudioLocal,"StudioLocal");const rootRoute=createRootRouteWithContext()({component:StudioLocal});function DiscordLogo(){return jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 126.644 96",width:24,height:24,children:jsxRuntimeExports.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"})})}__name(DiscordLogo,"DiscordLogo");function MainLogo(){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("img",{src:"/harper-studio_white.png",alt:"Harper Studio",className:"w-64 hidden md:inline-block"}),jsxRuntimeExports.jsx("img",{src:"/HDBDogOnly.svg",width:"50px",height:"44px",alt:"Harper",className:"inline-block md:hidden"})]})}__name(MainLogo,"MainLogo");function createContext2(rootComponentName,defaultContext){const Context=reactExports.createContext(defaultContext),Provider2=__name(props=>{const{children,...context}=props,value=reactExports.useMemo(()=>context,Object.values(context));return jsxRuntimeExports.jsx(Context.Provider,{value,children})},"Provider");Provider2.displayName=rootComponentName+"Provider";function useContext2(consumerName){const context=reactExports.useContext(Context);if(context)return context;if(defaultContext!==void 0)return defaultContext;throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``)}return __name(useContext2,"useContext2"),[Provider2,useContext2]}__name(createContext2,"createContext2");function createContextScope(scopeName,createContextScopeDeps=[]){let defaultContexts=[];function createContext3(rootComponentName,defaultContext){const BaseContext=reactExports.createContext(defaultContext),index2=defaultContexts.length;defaultContexts=[...defaultContexts,defaultContext];const Provider2=__name(props=>{const{scope,children,...context}=props,Context=scope?.[scopeName]?.[index2]||BaseContext,value=reactExports.useMemo(()=>context,Object.values(context));return jsxRuntimeExports.jsx(Context.Provider,{value,children})},"Provider");Provider2.displayName=rootComponentName+"Provider";function useContext2(consumerName,scope){const Context=scope?.[scopeName]?.[index2]||BaseContext,context=reactExports.useContext(Context);if(context)return context;if(defaultContext!==void 0)return defaultContext;throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``)}return __name(useContext2,"useContext2"),[Provider2,useContext2]}__name(createContext3,"createContext3");const createScope=__name(()=>{const scopeContexts=defaultContexts.map(defaultContext=>reactExports.createContext(defaultContext));return __name(function(scope){const contexts=scope?.[scopeName]||scopeContexts;return reactExports.useMemo(()=>({[`__scope${scopeName}`]:{...scope,[scopeName]:contexts}}),[scope,contexts])},"useScope")},"createScope");return createScope.scopeName=scopeName,[createContext3,composeContextScopes(createScope,...createContextScopeDeps)]}__name(createContextScope,"createContextScope");function composeContextScopes(...scopes){const baseScope=scopes[0];if(scopes.length===1)return baseScope;const createScope=__name(()=>{const scopeHooks=scopes.map(createScope2=>({useScope:createScope2(),scopeName:createScope2.scopeName}));return __name(function(overrideScopes){const nextScopes=scopeHooks.reduce((nextScopes2,{useScope,scopeName})=>{const currentScope=useScope(overrideScopes)[`__scope${scopeName}`];return{...nextScopes2,...currentScope}},{});return reactExports.useMemo(()=>({[`__scope${baseScope.scopeName}`]:nextScopes}),[nextScopes])},"useComposedScopes")},"createScope");return createScope.scopeName=baseScope.scopeName,createScope}__name(composeContextScopes,"composeContextScopes");function composeEventHandlers$1(originalEventHandler,ourEventHandler,{checkForDefaultPrevented=!0}={}){return __name(function(event){if(originalEventHandler?.(event),checkForDefaultPrevented===!1||!event.defaultPrevented)return ourEventHandler?.(event)},"handleEvent")}__name(composeEventHandlers$1,"composeEventHandlers$1");function createSlot(ownerName){const SlotClone=createSlotClone(ownerName),Slot2=reactExports.forwardRef((props,forwardedRef)=>{const{children,...slotProps}=props,childrenArray=reactExports.Children.toArray(children),slottable=childrenArray.find(isSlottable);if(slottable){const newElement=slottable.props.children,newChildren=childrenArray.map(child=>child===slottable?reactExports.Children.count(newElement)>1?reactExports.Children.only(null):reactExports.isValidElement(newElement)?newElement.props.children:null:child);return jsxRuntimeExports.jsx(SlotClone,{...slotProps,ref:forwardedRef,children:reactExports.isValidElement(newElement)?reactExports.cloneElement(newElement,void 0,newChildren):null})}return jsxRuntimeExports.jsx(SlotClone,{...slotProps,ref:forwardedRef,children})});return Slot2.displayName=`${ownerName}.Slot`,Slot2}__name(createSlot,"createSlot");function createSlotClone(ownerName){const SlotClone=reactExports.forwardRef((props,forwardedRef)=>{const{children,...slotProps}=props;if(reactExports.isValidElement(children)){const childrenRef=getElementRef$1(children),props2=mergeProps(slotProps,children.props);return children.type!==reactExports.Fragment&&(props2.ref=forwardedRef?composeRefs(forwardedRef,childrenRef):childrenRef),reactExports.cloneElement(children,props2)}return reactExports.Children.count(children)>1?reactExports.Children.only(null):null});return SlotClone.displayName=`${ownerName}.SlotClone`,SlotClone}__name(createSlotClone,"createSlotClone");var SLOTTABLE_IDENTIFIER=Symbol("radix.slottable");function createSlottable(ownerName){const Slottable2=__name(({children})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children}),"Slottable2");return Slottable2.displayName=`${ownerName}.Slottable`,Slottable2.__radixId=SLOTTABLE_IDENTIFIER,Slottable2}__name(createSlottable,"createSlottable");function isSlottable(child){return reactExports.isValidElement(child)&&typeof child.type=="function"&&"__radixId"in child.type&&child.type.__radixId===SLOTTABLE_IDENTIFIER}__name(isSlottable,"isSlottable");function mergeProps(slotProps,childProps){const overrideProps={...childProps};for(const propName in childProps){const slotPropValue=slotProps[propName],childPropValue=childProps[propName];/^on[A-Z]/.test(propName)?slotPropValue&&childPropValue?overrideProps[propName]=(...args)=>{const result=childPropValue(...args);return slotPropValue(...args),result}:slotPropValue&&(overrideProps[propName]=slotPropValue):propName==="style"?overrideProps[propName]={...slotPropValue,...childPropValue}:propName==="className"&&(overrideProps[propName]=[slotPropValue,childPropValue].filter(Boolean).join(" "))}return{...slotProps,...overrideProps}}__name(mergeProps,"mergeProps");function getElementRef$1(element2){let getter=Object.getOwnPropertyDescriptor(element2.props,"ref")?.get,mayWarn=getter&&"isReactWarning"in getter&&getter.isReactWarning;return mayWarn?element2.ref:(getter=Object.getOwnPropertyDescriptor(element2,"ref")?.get,mayWarn=getter&&"isReactWarning"in getter&&getter.isReactWarning,mayWarn?element2.props.ref:element2.props.ref||element2.ref)}__name(getElementRef$1,"getElementRef$1");var NODES$1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$1=NODES$1.reduce((primitive,node2)=>{const Slot2=createSlot(`Primitive.${node2}`),Node2=reactExports.forwardRef((props,forwardedRef)=>{const{asChild,...primitiveProps}=props,Comp=asChild?Slot2:node2;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(Comp,{...primitiveProps,ref:forwardedRef})});return Node2.displayName=`Primitive.${node2}`,{...primitive,[node2]:Node2}},{});function dispatchDiscreteCustomEvent(target,event){target&&reactDomExports.flushSync(()=>target.dispatchEvent(event))}__name(dispatchDiscreteCustomEvent,"dispatchDiscreteCustomEvent");var useLayoutEffect2=globalThis?.document?reactExports.useLayoutEffect:()=>{},useInsertionEffect=React$1[" useInsertionEffect ".trim().toString()]||useLayoutEffect2;function useControllableState({prop,defaultProp,onChange=__name(()=>{},"onChange"),caller}){const[uncontrolledProp,setUncontrolledProp,onChangeRef]=useUncontrolledState({defaultProp,onChange}),isControlled=prop!==void 0,value=isControlled?prop:uncontrolledProp;{const isControlledRef=reactExports.useRef(prop!==void 0);reactExports.useEffect(()=>{const wasControlled=isControlledRef.current;wasControlled!==isControlled&&console.warn(`${caller} is changing from ${wasControlled?"controlled":"uncontrolled"} to ${isControlled?"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.`),isControlledRef.current=isControlled},[isControlled,caller])}const setValue=reactExports.useCallback(nextValue=>{if(isControlled){const value2=isFunction$3(nextValue)?nextValue(prop):nextValue;value2!==prop&&onChangeRef.current?.(value2)}else setUncontrolledProp(nextValue)},[isControlled,prop,setUncontrolledProp,onChangeRef]);return[value,setValue]}__name(useControllableState,"useControllableState");function useUncontrolledState({defaultProp,onChange}){const[value,setValue]=reactExports.useState(defaultProp),prevValueRef=reactExports.useRef(value),onChangeRef=reactExports.useRef(onChange);return useInsertionEffect(()=>{onChangeRef.current=onChange},[onChange]),reactExports.useEffect(()=>{prevValueRef.current!==value&&(onChangeRef.current?.(value),prevValueRef.current=value)},[value,prevValueRef]),[value,setValue,onChangeRef]}__name(useUncontrolledState,"useUncontrolledState");function isFunction$3(value){return typeof value=="function"}__name(isFunction$3,"isFunction$3");var DirectionContext=reactExports.createContext(void 0);function useDirection(localDir){const globalDir=reactExports.useContext(DirectionContext);return localDir||globalDir||"ltr"}__name(useDirection,"useDirection");function useStateMachine$1(initialState2,machine){return reactExports.useReducer((state2,event)=>machine[state2][event]??state2,initialState2)}__name(useStateMachine$1,"useStateMachine$1");var Presence=__name(props=>{const{present,children}=props,presence=usePresence(present),child=typeof children=="function"?children({present:presence.isPresent}):reactExports.Children.only(children),ref=useComposedRefs(presence.ref,getElementRef(child));return typeof children=="function"||presence.isPresent?reactExports.cloneElement(child,{ref}):null},"Presence");Presence.displayName="Presence";function usePresence(present){const[node2,setNode]=reactExports.useState(),stylesRef=reactExports.useRef(null),prevPresentRef=reactExports.useRef(present),prevAnimationNameRef=reactExports.useRef("none"),initialState2=present?"mounted":"unmounted",[state2,send2]=useStateMachine$1(initialState2,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return reactExports.useEffect(()=>{const currentAnimationName=getAnimationName(stylesRef.current);prevAnimationNameRef.current=state2==="mounted"?currentAnimationName:"none"},[state2]),useLayoutEffect2(()=>{const styles=stylesRef.current,wasPresent=prevPresentRef.current;if(wasPresent!==present){const prevAnimationName=prevAnimationNameRef.current,currentAnimationName=getAnimationName(styles);present?send2("MOUNT"):currentAnimationName==="none"||styles?.display==="none"?send2("UNMOUNT"):send2(wasPresent&&prevAnimationName!==currentAnimationName?"ANIMATION_OUT":"UNMOUNT"),prevPresentRef.current=present}},[present,send2]),useLayoutEffect2(()=>{if(node2){let timeoutId;const ownerWindow=node2.ownerDocument.defaultView??window,handleAnimationEnd=__name(event=>{const isCurrentAnimation=getAnimationName(stylesRef.current).includes(CSS.escape(event.animationName));if(event.target===node2&&isCurrentAnimation&&(send2("ANIMATION_END"),!prevPresentRef.current)){const currentFillMode=node2.style.animationFillMode;node2.style.animationFillMode="forwards",timeoutId=ownerWindow.setTimeout(()=>{node2.style.animationFillMode==="forwards"&&(node2.style.animationFillMode=currentFillMode)})}},"handleAnimationEnd"),handleAnimationStart=__name(event=>{event.target===node2&&(prevAnimationNameRef.current=getAnimationName(stylesRef.current))},"handleAnimationStart");return node2.addEventListener("animationstart",handleAnimationStart),node2.addEventListener("animationcancel",handleAnimationEnd),node2.addEventListener("animationend",handleAnimationEnd),()=>{ownerWindow.clearTimeout(timeoutId),node2.removeEventListener("animationstart",handleAnimationStart),node2.removeEventListener("animationcancel",handleAnimationEnd),node2.removeEventListener("animationend",handleAnimationEnd)}}else send2("ANIMATION_END")},[node2,send2]),{isPresent:["mounted","unmountSuspended"].includes(state2),ref:reactExports.useCallback(node22=>{stylesRef.current=node22?getComputedStyle(node22):null,setNode(node22)},[])}}__name(usePresence,"usePresence");function getAnimationName(styles){return styles?.animationName||"none"}__name(getAnimationName,"getAnimationName");function getElementRef(element2){let getter=Object.getOwnPropertyDescriptor(element2.props,"ref")?.get,mayWarn=getter&&"isReactWarning"in getter&&getter.isReactWarning;return mayWarn?element2.ref:(getter=Object.getOwnPropertyDescriptor(element2,"ref")?.get,mayWarn=getter&&"isReactWarning"in getter&&getter.isReactWarning,mayWarn?element2.props.ref:element2.props.ref||element2.ref)}__name(getElementRef,"getElementRef");var useReactId=React$1[" useId ".trim().toString()]||(()=>{}),count$2=0;function useId(deterministicId){const[id2,setId]=reactExports.useState(useReactId());return useLayoutEffect2(()=>{setId(reactId=>reactId??String(count$2++))},[deterministicId]),id2?`radix-${id2}`:""}__name(useId,"useId");function createCollection(name2){const PROVIDER_NAME2=name2+"CollectionProvider",[createCollectionContext,createCollectionScope2]=createContextScope(PROVIDER_NAME2),[CollectionProviderImpl,useCollectionContext]=createCollectionContext(PROVIDER_NAME2,{collectionRef:{current:null},itemMap:new Map}),CollectionProvider=__name(props=>{const{scope,children}=props,ref=React.useRef(null),itemMap=React.useRef(new Map).current;return jsxRuntimeExports.jsx(CollectionProviderImpl,{scope,itemMap,collectionRef:ref,children})},"CollectionProvider");CollectionProvider.displayName=PROVIDER_NAME2;const COLLECTION_SLOT_NAME=name2+"CollectionSlot",CollectionSlotImpl=createSlot(COLLECTION_SLOT_NAME),CollectionSlot=React.forwardRef((props,forwardedRef)=>{const{scope,children}=props,context=useCollectionContext(COLLECTION_SLOT_NAME,scope),composedRefs=useComposedRefs(forwardedRef,context.collectionRef);return jsxRuntimeExports.jsx(CollectionSlotImpl,{ref:composedRefs,children})});CollectionSlot.displayName=COLLECTION_SLOT_NAME;const ITEM_SLOT_NAME=name2+"CollectionItemSlot",ITEM_DATA_ATTR="data-radix-collection-item",CollectionItemSlotImpl=createSlot(ITEM_SLOT_NAME),CollectionItemSlot=React.forwardRef((props,forwardedRef)=>{const{scope,children,...itemData}=props,ref=React.useRef(null),composedRefs=useComposedRefs(forwardedRef,ref),context=useCollectionContext(ITEM_SLOT_NAME,scope);return React.useEffect(()=>(context.itemMap.set(ref,{ref,...itemData}),()=>{context.itemMap.delete(ref)})),jsxRuntimeExports.jsx(CollectionItemSlotImpl,{[ITEM_DATA_ATTR]:"",ref:composedRefs,children})});CollectionItemSlot.displayName=ITEM_SLOT_NAME;function useCollection2(scope){const context=useCollectionContext(name2+"CollectionConsumer",scope);return React.useCallback(()=>{const collectionNode=context.collectionRef.current;if(!collectionNode)return[];const orderedNodes=Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));return Array.from(context.itemMap.values()).sort((a2,b)=>orderedNodes.indexOf(a2.ref.current)-orderedNodes.indexOf(b.ref.current))},[context.collectionRef,context.itemMap])}return __name(useCollection2,"useCollection"),[{Provider:CollectionProvider,Slot:CollectionSlot,ItemSlot:CollectionItemSlot},useCollection2,createCollectionScope2]}__name(createCollection,"createCollection");function useCallbackRef$1(callback){const callbackRef=reactExports.useRef(callback);return reactExports.useEffect(()=>{callbackRef.current=callback}),reactExports.useMemo(()=>(...args)=>callbackRef.current?.(...args),[])}__name(useCallbackRef$1,"useCallbackRef$1");function useEscapeKeydown(onEscapeKeyDownProp,ownerDocument=globalThis?.document){const onEscapeKeyDown=useCallbackRef$1(onEscapeKeyDownProp);reactExports.useEffect(()=>{const handleKeyDown=__name(event=>{event.key==="Escape"&&onEscapeKeyDown(event)},"handleKeyDown");return ownerDocument.addEventListener("keydown",handleKeyDown,{capture:!0}),()=>ownerDocument.removeEventListener("keydown",handleKeyDown,{capture:!0})},[onEscapeKeyDown,ownerDocument])}__name(useEscapeKeydown,"useEscapeKeydown");var DISMISSABLE_LAYER_NAME="DismissableLayer",CONTEXT_UPDATE="dismissableLayer.update",POINTER_DOWN_OUTSIDE="dismissableLayer.pointerDownOutside",FOCUS_OUTSIDE="dismissableLayer.focusOutside",originalBodyPointerEvents,DismissableLayerContext=reactExports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),DismissableLayer=reactExports.forwardRef((props,forwardedRef)=>{const{disableOutsidePointerEvents=!1,onEscapeKeyDown,onPointerDownOutside,onFocusOutside,onInteractOutside,onDismiss,...layerProps}=props,context=reactExports.useContext(DismissableLayerContext),[node2,setNode]=reactExports.useState(null),ownerDocument=node2?.ownerDocument??globalThis?.document,[,force]=reactExports.useState({}),composedRefs=useComposedRefs(forwardedRef,node22=>setNode(node22)),layers=Array.from(context.layers),[highestLayerWithOutsidePointerEventsDisabled]=[...context.layersWithOutsidePointerEventsDisabled].slice(-1),highestLayerWithOutsidePointerEventsDisabledIndex=layers.indexOf(highestLayerWithOutsidePointerEventsDisabled),index2=node2?layers.indexOf(node2):-1,isBodyPointerEventsDisabled=context.layersWithOutsidePointerEventsDisabled.size>0,isPointerEventsEnabled=index2>=highestLayerWithOutsidePointerEventsDisabledIndex,pointerDownOutside=usePointerDownOutside(event=>{const target=event.target,isPointerDownOnBranch=[...context.branches].some(branch=>branch.contains(target));!isPointerEventsEnabled||isPointerDownOnBranch||(onPointerDownOutside?.(event),onInteractOutside?.(event),event.defaultPrevented||onDismiss?.())},ownerDocument),focusOutside=useFocusOutside(event=>{const target=event.target;[...context.branches].some(branch=>branch.contains(target))||(onFocusOutside?.(event),onInteractOutside?.(event),event.defaultPrevented||onDismiss?.())},ownerDocument);return useEscapeKeydown(event=>{index2===context.layers.size-1&&(onEscapeKeyDown?.(event),!event.defaultPrevented&&onDismiss&&(event.preventDefault(),onDismiss()))},ownerDocument),reactExports.useEffect(()=>{if(node2)return disableOutsidePointerEvents&&(context.layersWithOutsidePointerEventsDisabled.size===0&&(originalBodyPointerEvents=ownerDocument.body.style.pointerEvents,ownerDocument.body.style.pointerEvents="none"),context.layersWithOutsidePointerEventsDisabled.add(node2)),context.layers.add(node2),dispatchUpdate(),()=>{disableOutsidePointerEvents&&context.layersWithOutsidePointerEventsDisabled.size===1&&(ownerDocument.body.style.pointerEvents=originalBodyPointerEvents)}},[node2,ownerDocument,disableOutsidePointerEvents,context]),reactExports.useEffect(()=>()=>{node2&&(context.layers.delete(node2),context.layersWithOutsidePointerEventsDisabled.delete(node2),dispatchUpdate())},[node2,context]),reactExports.useEffect(()=>{const handleUpdate=__name(()=>force({}),"handleUpdate");return document.addEventListener(CONTEXT_UPDATE,handleUpdate),()=>document.removeEventListener(CONTEXT_UPDATE,handleUpdate)},[]),jsxRuntimeExports.jsx(Primitive$1.div,{...layerProps,ref:composedRefs,style:{pointerEvents:isBodyPointerEventsDisabled?isPointerEventsEnabled?"auto":"none":void 0,...props.style},onFocusCapture:composeEventHandlers$1(props.onFocusCapture,focusOutside.onFocusCapture),onBlurCapture:composeEventHandlers$1(props.onBlurCapture,focusOutside.onBlurCapture),onPointerDownCapture:composeEventHandlers$1(props.onPointerDownCapture,pointerDownOutside.onPointerDownCapture)})});DismissableLayer.displayName=DISMISSABLE_LAYER_NAME;var BRANCH_NAME="DismissableLayerBranch",DismissableLayerBranch=reactExports.forwardRef((props,forwardedRef)=>{const context=reactExports.useContext(DismissableLayerContext),ref=reactExports.useRef(null),composedRefs=useComposedRefs(forwardedRef,ref);return reactExports.useEffect(()=>{const node2=ref.current;if(node2)return context.branches.add(node2),()=>{context.branches.delete(node2)}},[context.branches]),jsxRuntimeExports.jsx(Primitive$1.div,{...props,ref:composedRefs})});DismissableLayerBranch.displayName=BRANCH_NAME;function usePointerDownOutside(onPointerDownOutside,ownerDocument=globalThis?.document){const handlePointerDownOutside=useCallbackRef$1(onPointerDownOutside),isPointerInsideReactTreeRef=reactExports.useRef(!1),handleClickRef=reactExports.useRef(()=>{});return reactExports.useEffect(()=>{const handlePointerDown=__name(event=>{if(event.target&&!isPointerInsideReactTreeRef.current){let handleAndDispatchPointerDownOutsideEvent2=__name(function(){handleAndDispatchCustomEvent(POINTER_DOWN_OUTSIDE,handlePointerDownOutside,eventDetail,{discrete:!0})},"handleAndDispatchPointerDownOutsideEvent2");const eventDetail={originalEvent:event};event.pointerType==="touch"?(ownerDocument.removeEventListener("click",handleClickRef.current),handleClickRef.current=handleAndDispatchPointerDownOutsideEvent2,ownerDocument.addEventListener("click",handleClickRef.current,{once:!0})):handleAndDispatchPointerDownOutsideEvent2()}else ownerDocument.removeEventListener("click",handleClickRef.current);isPointerInsideReactTreeRef.current=!1},"handlePointerDown"),timerId=window.setTimeout(()=>{ownerDocument.addEventListener("pointerdown",handlePointerDown)},0);return()=>{window.clearTimeout(timerId),ownerDocument.removeEventListener("pointerdown",handlePointerDown),ownerDocument.removeEventListener("click",handleClickRef.current)}},[ownerDocument,handlePointerDownOutside]),{onPointerDownCapture:__name(()=>isPointerInsideReactTreeRef.current=!0,"onPointerDownCapture")}}__name(usePointerDownOutside,"usePointerDownOutside");function useFocusOutside(onFocusOutside,ownerDocument=globalThis?.document){const handleFocusOutside=useCallbackRef$1(onFocusOutside),isFocusInsideReactTreeRef=reactExports.useRef(!1);return reactExports.useEffect(()=>{const handleFocus=__name(event=>{event.target&&!isFocusInsideReactTreeRef.current&&handleAndDispatchCustomEvent(FOCUS_OUTSIDE,handleFocusOutside,{originalEvent:event},{discrete:!1})},"handleFocus");return ownerDocument.addEventListener("focusin",handleFocus),()=>ownerDocument.removeEventListener("focusin",handleFocus)},[ownerDocument,handleFocusOutside]),{onFocusCapture:__name(()=>isFocusInsideReactTreeRef.current=!0,"onFocusCapture"),onBlurCapture:__name(()=>isFocusInsideReactTreeRef.current=!1,"onBlurCapture")}}__name(useFocusOutside,"useFocusOutside");function dispatchUpdate(){const event=new CustomEvent(CONTEXT_UPDATE);document.dispatchEvent(event)}__name(dispatchUpdate,"dispatchUpdate");function handleAndDispatchCustomEvent(name2,handler,detail,{discrete}){const target=detail.originalEvent.target,event=new CustomEvent(name2,{bubbles:!1,cancelable:!0,detail});handler&&target.addEventListener(name2,handler,{once:!0}),discrete?dispatchDiscreteCustomEvent(target,event):target.dispatchEvent(event)}__name(handleAndDispatchCustomEvent,"handleAndDispatchCustomEvent");function usePrevious$2(value){const ref=reactExports.useRef({value,previous:value});return reactExports.useMemo(()=>(ref.current.value!==value&&(ref.current.previous=ref.current.value,ref.current.value=value),ref.current.previous),[value])}__name(usePrevious$2,"usePrevious$2");var VISUALLY_HIDDEN_STYLES=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"}),NAME$4="VisuallyHidden",VisuallyHidden=reactExports.forwardRef((props,forwardedRef)=>jsxRuntimeExports.jsx(Primitive$1.span,{...props,ref:forwardedRef,style:{...VISUALLY_HIDDEN_STYLES,...props.style}}));VisuallyHidden.displayName=NAME$4;var Root$8=VisuallyHidden,NAVIGATION_MENU_NAME="NavigationMenu",[Collection$3,useCollection$3,createCollectionScope$3]=createCollection(NAVIGATION_MENU_NAME),[FocusGroupCollection,useFocusGroupCollection,createFocusGroupCollectionScope]=createCollection(NAVIGATION_MENU_NAME),[createNavigationMenuContext]=createContextScope(NAVIGATION_MENU_NAME,[createCollectionScope$3,createFocusGroupCollectionScope]),[NavigationMenuProviderImpl,useNavigationMenuContext]=createNavigationMenuContext(NAVIGATION_MENU_NAME),[ViewportContentProvider,useViewportContentContext]=createNavigationMenuContext(NAVIGATION_MENU_NAME),NavigationMenu$1=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeNavigationMenu,value:valueProp,onValueChange,defaultValue,delayDuration=200,skipDelayDuration=300,orientation="horizontal",dir,...NavigationMenuProps}=props,[navigationMenu,setNavigationMenu]=reactExports.useState(null),composedRef=useComposedRefs(forwardedRef,node2=>setNavigationMenu(node2)),direction=useDirection(dir),openTimerRef=reactExports.useRef(0),closeTimerRef=reactExports.useRef(0),skipDelayTimerRef=reactExports.useRef(0),[isOpenDelayed,setIsOpenDelayed]=reactExports.useState(!0),[value,setValue]=useControllableState({prop:valueProp,onChange:__name(value2=>{const isOpen=value2!=="",hasSkipDelayDuration=skipDelayDuration>0;isOpen?(window.clearTimeout(skipDelayTimerRef.current),hasSkipDelayDuration&&setIsOpenDelayed(!1)):(window.clearTimeout(skipDelayTimerRef.current),skipDelayTimerRef.current=window.setTimeout(()=>setIsOpenDelayed(!0),skipDelayDuration)),onValueChange?.(value2)},"onChange"),defaultProp:defaultValue??"",caller:NAVIGATION_MENU_NAME}),startCloseTimer=reactExports.useCallback(()=>{window.clearTimeout(closeTimerRef.current),closeTimerRef.current=window.setTimeout(()=>setValue(""),150)},[setValue]),handleOpen=reactExports.useCallback(itemValue=>{window.clearTimeout(closeTimerRef.current),setValue(itemValue)},[setValue]),handleDelayedOpen=reactExports.useCallback(itemValue=>{value===itemValue?window.clearTimeout(closeTimerRef.current):openTimerRef.current=window.setTimeout(()=>{window.clearTimeout(closeTimerRef.current),setValue(itemValue)},delayDuration)},[value,setValue,delayDuration]);return reactExports.useEffect(()=>()=>{window.clearTimeout(openTimerRef.current),window.clearTimeout(closeTimerRef.current),window.clearTimeout(skipDelayTimerRef.current)},[]),jsxRuntimeExports.jsx(NavigationMenuProvider,{scope:__scopeNavigationMenu,isRootMenu:!0,value,dir:direction,orientation,rootNavigationMenu:navigationMenu,onTriggerEnter:__name(itemValue=>{window.clearTimeout(openTimerRef.current),isOpenDelayed?handleDelayedOpen(itemValue):handleOpen(itemValue)},"onTriggerEnter"),onTriggerLeave:__name(()=>{window.clearTimeout(openTimerRef.current),startCloseTimer()},"onTriggerLeave"),onContentEnter:__name(()=>window.clearTimeout(closeTimerRef.current),"onContentEnter"),onContentLeave:startCloseTimer,onItemSelect:__name(itemValue=>{setValue(prevValue=>prevValue===itemValue?"":itemValue)},"onItemSelect"),onItemDismiss:__name(()=>setValue(""),"onItemDismiss"),children:jsxRuntimeExports.jsx(Primitive$1.nav,{"aria-label":"Main","data-orientation":orientation,dir:direction,...NavigationMenuProps,ref:composedRef})})});NavigationMenu$1.displayName=NAVIGATION_MENU_NAME;var SUB_NAME$1="NavigationMenuSub",NavigationMenuSub=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeNavigationMenu,value:valueProp,onValueChange,defaultValue,orientation="horizontal",...subProps}=props,context=useNavigationMenuContext(SUB_NAME$1,__scopeNavigationMenu),[value,setValue]=useControllableState({prop:valueProp,onChange:onValueChange,defaultProp:defaultValue??"",caller:SUB_NAME$1});return jsxRuntimeExports.jsx(NavigationMenuProvider,{scope:__scopeNavigationMenu,isRootMenu:!1,value,dir:context.dir,orientation,rootNavigationMenu:context.rootNavigationMenu,onTriggerEnter:__name(itemValue=>setValue(itemValue),"onTriggerEnter"),onItemSelect:__name(itemValue=>setValue(itemValue),"onItemSelect"),onItemDismiss:__name(()=>setValue(""),"onItemDismiss"),children:jsxRuntimeExports.jsx(Primitive$1.div,{"data-orientation":orientation,...subProps,ref:forwardedRef})})});NavigationMenuSub.displayName=SUB_NAME$1;var NavigationMenuProvider=__name(props=>{const{scope,isRootMenu,rootNavigationMenu,dir,orientation,children,value,onItemSelect,onItemDismiss,onTriggerEnter,onTriggerLeave,onContentEnter,onContentLeave}=props,[viewport,setViewport]=reactExports.useState(null),[viewportContent,setViewportContent]=reactExports.useState(new Map),[indicatorTrack,setIndicatorTrack]=reactExports.useState(null);return jsxRuntimeExports.jsx(NavigationMenuProviderImpl,{scope,isRootMenu,rootNavigationMenu,value,previousValue:usePrevious$2(value),baseId:useId(),dir,orientation,viewport,onViewportChange:setViewport,indicatorTrack,onIndicatorTrackChange:setIndicatorTrack,onTriggerEnter:useCallbackRef$1(onTriggerEnter),onTriggerLeave:useCallbackRef$1(onTriggerLeave),onContentEnter:useCallbackRef$1(onContentEnter),onContentLeave:useCallbackRef$1(onContentLeave),onItemSelect:useCallbackRef$1(onItemSelect),onItemDismiss:useCallbackRef$1(onItemDismiss),onViewportContentChange:reactExports.useCallback((contentValue,contentData)=>{setViewportContent(prevContent=>(prevContent.set(contentValue,contentData),new Map(prevContent)))},[]),onViewportContentRemove:reactExports.useCallback(contentValue=>{setViewportContent(prevContent=>prevContent.has(contentValue)?(prevContent.delete(contentValue),new Map(prevContent)):prevContent)},[]),children:jsxRuntimeExports.jsx(Collection$3.Provider,{scope,children:jsxRuntimeExports.jsx(ViewportContentProvider,{scope,items:viewportContent,children})})})},"NavigationMenuProvider"),LIST_NAME="NavigationMenuList",NavigationMenuList$1=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeNavigationMenu,...listProps}=props,context=useNavigationMenuContext(LIST_NAME,__scopeNavigationMenu),list2=jsxRuntimeExports.jsx(Primitive$1.ul,{"data-orientation":context.orientation,...listProps,ref:forwardedRef});return jsxRuntimeExports.jsx(Primitive$1.div,{style:{position:"relative"},ref:context.onIndicatorTrackChange,children:jsxRuntimeExports.jsx(Collection$3.Slot,{scope:__scopeNavigationMenu,children:context.isRootMenu?jsxRuntimeExports.jsx(FocusGroup,{asChild:!0,children:list2}):list2})})});NavigationMenuList$1.displayName=LIST_NAME;var ITEM_NAME$5="NavigationMenuItem",[NavigationMenuItemContextProvider,useNavigationMenuItemContext]=createNavigationMenuContext(ITEM_NAME$5),NavigationMenuItem$1=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeNavigationMenu,value:valueProp,...itemProps}=props,autoValue=useId(),value=valueProp||autoValue||"LEGACY_REACT_AUTO_VALUE",contentRef=reactExports.useRef(null),triggerRef=reactExports.useRef(null),focusProxyRef=reactExports.useRef(null),restoreContentTabOrderRef=reactExports.useRef(()=>{}),wasEscapeCloseRef=reactExports.useRef(!1),handleContentEntry=reactExports.useCallback((side="start")=>{if(contentRef.current){restoreContentTabOrderRef.current();const candidates=getTabbableCandidates$1(contentRef.current);candidates.length&&focusFirst$3(side==="start"?candidates:candidates.reverse())}},[]),handleContentExit=reactExports.useCallback(()=>{if(contentRef.current){const candidates=getTabbableCandidates$1(contentRef.current);candidates.length&&(restoreContentTabOrderRef.current=removeFromTabOrder(candidates))}},[]);return jsxRuntimeExports.jsx(NavigationMenuItemContextProvider,{scope:__scopeNavigationMenu,value,triggerRef,contentRef,focusProxyRef,wasEscapeCloseRef,onEntryKeyDown:handleContentEntry,onFocusProxyEnter:handleContentEntry,onRootContentClose:handleContentExit,onContentFocusOutside:handleContentExit,children:jsxRuntimeExports.jsx(Primitive$1.li,{...itemProps,ref:forwardedRef})})});NavigationMenuItem$1.displayName=ITEM_NAME$5;var TRIGGER_NAME$5="NavigationMenuTrigger",NavigationMenuTrigger=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeNavigationMenu,disabled,...triggerProps}=props,context=useNavigationMenuContext(TRIGGER_NAME$5,props.__scopeNavigationMenu),itemContext=useNavigationMenuItemContext(TRIGGER_NAME$5,props.__scopeNavigationMenu),ref=reactExports.useRef(null),composedRefs=useComposedRefs(ref,itemContext.triggerRef,forwardedRef),triggerId=makeTriggerId$1(context.baseId,itemContext.value),contentId=makeContentId$1(context.baseId,itemContext.value),hasPointerMoveOpenedRef=reactExports.useRef(!1),wasClickCloseRef=reactExports.useRef(!1),open=itemContext.value===context.value;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Collection$3.ItemSlot,{scope:__scopeNavigationMenu,value:itemContext.value,children:jsxRuntimeExports.jsx(FocusGroupItem,{asChild:!0,children:jsxRuntimeExports.jsx(Primitive$1.button,{id:triggerId,disabled,"data-disabled":disabled?"":void 0,"data-state":getOpenState$1(open),"aria-expanded":open,"aria-controls":contentId,...triggerProps,ref:composedRefs,onPointerEnter:composeEventHandlers$1(props.onPointerEnter,()=>{wasClickCloseRef.current=!1,itemContext.wasEscapeCloseRef.current=!1}),onPointerMove:composeEventHandlers$1(props.onPointerMove,whenMouse$1(()=>{disabled||wasClickCloseRef.current||itemContext.wasEscapeCloseRef.current||hasPointerMoveOpenedRef.current||(context.onTriggerEnter(itemContext.value),hasPointerMoveOpenedRef.current=!0)})),onPointerLeave:composeEventHandlers$1(props.onPointerLeave,whenMouse$1(()=>{disabled||(context.onTriggerLeave(),hasPointerMoveOpenedRef.current=!1)})),onClick:composeEventHandlers$1(props.onClick,()=>{context.onItemSelect(itemContext.value),wasClickCloseRef.current=open}),onKeyDown:composeEventHandlers$1(props.onKeyDown,event=>{const entryKey={horizontal:"ArrowDown",vertical:context.dir==="rtl"?"ArrowLeft":"ArrowRight"}[context.orientation];open&&event.key===entryKey&&(itemContext.onEntryKeyDown(),event.preventDefault())})})})}),open&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Root$8,{"aria-hidden":!0,tabIndex:0,ref:itemContext.focusProxyRef,onFocus:__name(event=>{const content2=itemContext.contentRef.current,prevFocusedElement=event.relatedTarget,wasTriggerFocused=prevFocusedElement===ref.current,wasFocusFromContent=content2?.contains(prevFocusedElement);(wasTriggerFocused||!wasFocusFromContent)&&itemContext.onFocusProxyEnter(wasTriggerFocused?"start":"end")},"onFocus")}),context.viewport&&jsxRuntimeExports.jsx("span",{"aria-owns":contentId})]})]})});NavigationMenuTrigger.displayName=TRIGGER_NAME$5;var LINK_NAME="NavigationMenuLink",LINK_SELECT="navigationMenu.linkSelect",NavigationMenuLink$1=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeNavigationMenu,active,onSelect,...linkProps}=props;return jsxRuntimeExports.jsx(FocusGroupItem,{asChild:!0,children:jsxRuntimeExports.jsx(Primitive$1.a,{"data-active":active?"":void 0,"aria-current":active?"page":void 0,...linkProps,ref:forwardedRef,onClick:composeEventHandlers$1(props.onClick,event=>{const target=event.target,linkSelectEvent=new CustomEvent(LINK_SELECT,{bubbles:!0,cancelable:!0});if(target.addEventListener(LINK_SELECT,event2=>onSelect?.(event2),{once:!0}),dispatchDiscreteCustomEvent(target,linkSelectEvent),!linkSelectEvent.defaultPrevented&&!event.metaKey){const rootContentDismissEvent=new CustomEvent(ROOT_CONTENT_DISMISS,{bubbles:!0,cancelable:!0});dispatchDiscreteCustomEvent(target,rootContentDismissEvent)}},{checkForDefaultPrevented:!1})})})});NavigationMenuLink$1.displayName=LINK_NAME;var INDICATOR_NAME$2="NavigationMenuIndicator",NavigationMenuIndicator=reactExports.forwardRef((props,forwardedRef)=>{const{forceMount,...indicatorProps}=props,context=useNavigationMenuContext(INDICATOR_NAME$2,props.__scopeNavigationMenu),isVisible=!!context.value;return context.indicatorTrack?ye.createPortal(jsxRuntimeExports.jsx(Presence,{present:forceMount||isVisible,children:jsxRuntimeExports.jsx(NavigationMenuIndicatorImpl,{...indicatorProps,ref:forwardedRef})}),context.indicatorTrack):null});NavigationMenuIndicator.displayName=INDICATOR_NAME$2;var NavigationMenuIndicatorImpl=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeNavigationMenu,...indicatorProps}=props,context=useNavigationMenuContext(INDICATOR_NAME$2,__scopeNavigationMenu),getItems=useCollection$3(__scopeNavigationMenu),[activeTrigger,setActiveTrigger]=reactExports.useState(null),[position2,setPosition]=reactExports.useState(null),isHorizontal=context.orientation==="horizontal",isVisible=!!context.value;reactExports.useEffect(()=>{const triggerNode=getItems().find(item=>item.value===context.value)?.ref.current;triggerNode&&setActiveTrigger(triggerNode)},[getItems,context.value]);const handlePositionChange=__name(()=>{activeTrigger&&setPosition({size:isHorizontal?activeTrigger.offsetWidth:activeTrigger.offsetHeight,offset:isHorizontal?activeTrigger.offsetLeft:activeTrigger.offsetTop})},"handlePositionChange");return useResizeObserver$1(activeTrigger,handlePositionChange),useResizeObserver$1(context.indicatorTrack,handlePositionChange),position2?jsxRuntimeExports.jsx(Primitive$1.div,{"aria-hidden":!0,"data-state":isVisible?"visible":"hidden","data-orientation":context.orientation,...indicatorProps,ref:forwardedRef,style:{position:"absolute",...isHorizontal?{left:0,width:position2.size+"px",transform:`translateX(${position2.offset}px)`}:{top:0,height:position2.size+"px",transform:`translateY(${position2.offset}px)`},...indicatorProps.style}}):null}),CONTENT_NAME$7="NavigationMenuContent",NavigationMenuContent=reactExports.forwardRef((props,forwardedRef)=>{const{forceMount,...contentProps}=props,context=useNavigationMenuContext(CONTENT_NAME$7,props.__scopeNavigationMenu),itemContext=useNavigationMenuItemContext(CONTENT_NAME$7,props.__scopeNavigationMenu),composedRefs=useComposedRefs(itemContext.contentRef,forwardedRef),open=itemContext.value===context.value,commonProps={value:itemContext.value,triggerRef:itemContext.triggerRef,focusProxyRef:itemContext.focusProxyRef,wasEscapeCloseRef:itemContext.wasEscapeCloseRef,onContentFocusOutside:itemContext.onContentFocusOutside,onRootContentClose:itemContext.onRootContentClose,...contentProps};return context.viewport?jsxRuntimeExports.jsx(ViewportContentMounter,{forceMount,...commonProps,ref:composedRefs}):jsxRuntimeExports.jsx(Presence,{present:forceMount||open,children:jsxRuntimeExports.jsx(NavigationMenuContentImpl,{"data-state":getOpenState$1(open),...commonProps,ref:composedRefs,onPointerEnter:composeEventHandlers$1(props.onPointerEnter,context.onContentEnter),onPointerLeave:composeEventHandlers$1(props.onPointerLeave,whenMouse$1(context.onContentLeave)),style:{pointerEvents:!open&&context.isRootMenu?"none":void 0,...commonProps.style}})})});NavigationMenuContent.displayName=CONTENT_NAME$7;var ViewportContentMounter=reactExports.forwardRef((props,forwardedRef)=>{const context=useNavigationMenuContext(CONTENT_NAME$7,props.__scopeNavigationMenu),{onViewportContentChange,onViewportContentRemove}=context;return useLayoutEffect2(()=>{onViewportContentChange(props.value,{ref:forwardedRef,...props})},[props,forwardedRef,onViewportContentChange]),useLayoutEffect2(()=>()=>onViewportContentRemove(props.value),[props.value,onViewportContentRemove]),null}),ROOT_CONTENT_DISMISS="navigationMenu.rootContentDismiss",NavigationMenuContentImpl=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeNavigationMenu,value,triggerRef,focusProxyRef,wasEscapeCloseRef,onRootContentClose,onContentFocusOutside,...contentProps}=props,context=useNavigationMenuContext(CONTENT_NAME$7,__scopeNavigationMenu),ref=reactExports.useRef(null),composedRefs=useComposedRefs(ref,forwardedRef),triggerId=makeTriggerId$1(context.baseId,value),contentId=makeContentId$1(context.baseId,value),getItems=useCollection$3(__scopeNavigationMenu),prevMotionAttributeRef=reactExports.useRef(null),{onItemDismiss}=context;reactExports.useEffect(()=>{const content2=ref.current;if(context.isRootMenu&&content2){const handleClose=__name(()=>{onItemDismiss(),onRootContentClose(),content2.contains(document.activeElement)&&triggerRef.current?.focus()},"handleClose");return content2.addEventListener(ROOT_CONTENT_DISMISS,handleClose),()=>content2.removeEventListener(ROOT_CONTENT_DISMISS,handleClose)}},[context.isRootMenu,props.value,triggerRef,onItemDismiss,onRootContentClose]);const motionAttribute=reactExports.useMemo(()=>{const values=getItems().map(item=>item.value);context.dir==="rtl"&&values.reverse();const index2=values.indexOf(context.value),prevIndex=values.indexOf(context.previousValue),isSelected=value===context.value,wasSelected=prevIndex===values.indexOf(value);if(!isSelected&&!wasSelected)return prevMotionAttributeRef.current;const attribute=(()=>{if(index2!==prevIndex){if(isSelected&&prevIndex!==-1)return index2>prevIndex?"from-end":"from-start";if(wasSelected&&index2!==-1)return index2>prevIndex?"to-start":"to-end"}return null})();return prevMotionAttributeRef.current=attribute,attribute},[context.previousValue,context.value,context.dir,getItems,value]);return jsxRuntimeExports.jsx(FocusGroup,{asChild:!0,children:jsxRuntimeExports.jsx(DismissableLayer,{id:contentId,"aria-labelledby":triggerId,"data-motion":motionAttribute,"data-orientation":context.orientation,...contentProps,ref:composedRefs,disableOutsidePointerEvents:!1,onDismiss:__name(()=>{const rootContentDismissEvent=new Event(ROOT_CONTENT_DISMISS,{bubbles:!0,cancelable:!0});ref.current?.dispatchEvent(rootContentDismissEvent)},"onDismiss"),onFocusOutside:composeEventHandlers$1(props.onFocusOutside,event=>{onContentFocusOutside();const target=event.target;context.rootNavigationMenu?.contains(target)&&event.preventDefault()}),onPointerDownOutside:composeEventHandlers$1(props.onPointerDownOutside,event=>{const target=event.target,isTrigger=getItems().some(item=>item.ref.current?.contains(target)),isRootViewport=context.isRootMenu&&context.viewport?.contains(target);(isTrigger||isRootViewport||!context.isRootMenu)&&event.preventDefault()}),onKeyDown:composeEventHandlers$1(props.onKeyDown,event=>{const isMetaKey=event.altKey||event.ctrlKey||event.metaKey;if(event.key==="Tab"&&!isMetaKey){const candidates=getTabbableCandidates$1(event.currentTarget),focusedElement=document.activeElement,index2=candidates.findIndex(candidate=>candidate===focusedElement),nextCandidates=event.shiftKey?candidates.slice(0,index2).reverse():candidates.slice(index2+1,candidates.length);focusFirst$3(nextCandidates)?event.preventDefault():focusProxyRef.current?.focus()}}),onEscapeKeyDown:composeEventHandlers$1(props.onEscapeKeyDown,_event=>{wasEscapeCloseRef.current=!0})})})}),VIEWPORT_NAME$2="NavigationMenuViewport",NavigationMenuViewport$1=reactExports.forwardRef((props,forwardedRef)=>{const{forceMount,...viewportProps}=props,open=!!useNavigationMenuContext(VIEWPORT_NAME$2,props.__scopeNavigationMenu).value;return jsxRuntimeExports.jsx(Presence,{present:forceMount||open,children:jsxRuntimeExports.jsx(NavigationMenuViewportImpl,{...viewportProps,ref:forwardedRef})})});NavigationMenuViewport$1.displayName=VIEWPORT_NAME$2;var NavigationMenuViewportImpl=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeNavigationMenu,children,...viewportImplProps}=props,context=useNavigationMenuContext(VIEWPORT_NAME$2,__scopeNavigationMenu),composedRefs=useComposedRefs(forwardedRef,context.onViewportChange),viewportContentContext=useViewportContentContext(CONTENT_NAME$7,props.__scopeNavigationMenu),[size2,setSize]=reactExports.useState(null),[content2,setContent]=reactExports.useState(null),viewportWidth=size2?size2?.width+"px":void 0,viewportHeight=size2?size2?.height+"px":void 0,open=!!context.value,activeContentValue=open?context.value:context.previousValue;return useResizeObserver$1(content2,__name(()=>{content2&&setSize({width:content2.offsetWidth,height:content2.offsetHeight})},"handleSizeChange")),jsxRuntimeExports.jsx(Primitive$1.div,{"data-state":getOpenState$1(open),"data-orientation":context.orientation,...viewportImplProps,ref:composedRefs,style:{pointerEvents:!open&&context.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":viewportWidth,"--radix-navigation-menu-viewport-height":viewportHeight,...viewportImplProps.style},onPointerEnter:composeEventHandlers$1(props.onPointerEnter,context.onContentEnter),onPointerLeave:composeEventHandlers$1(props.onPointerLeave,whenMouse$1(context.onContentLeave)),children:Array.from(viewportContentContext.items).map(([value,{ref,forceMount,...props2}])=>{const isActive=activeContentValue===value;return jsxRuntimeExports.jsx(Presence,{present:forceMount||isActive,children:jsxRuntimeExports.jsx(NavigationMenuContentImpl,{...props2,ref:composeRefs(ref,node2=>{isActive&&node2&&setContent(node2)})})},value)})})}),FOCUS_GROUP_NAME="FocusGroup",FocusGroup=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeNavigationMenu,...groupProps}=props,context=useNavigationMenuContext(FOCUS_GROUP_NAME,__scopeNavigationMenu);return jsxRuntimeExports.jsx(FocusGroupCollection.Provider,{scope:__scopeNavigationMenu,children:jsxRuntimeExports.jsx(FocusGroupCollection.Slot,{scope:__scopeNavigationMenu,children:jsxRuntimeExports.jsx(Primitive$1.div,{dir:context.dir,...groupProps,ref:forwardedRef})})})}),ARROW_KEYS$1=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],FOCUS_GROUP_ITEM_NAME="FocusGroupItem",FocusGroupItem=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeNavigationMenu,...groupProps}=props,getItems=useFocusGroupCollection(__scopeNavigationMenu),context=useNavigationMenuContext(FOCUS_GROUP_ITEM_NAME,__scopeNavigationMenu);return jsxRuntimeExports.jsx(FocusGroupCollection.ItemSlot,{scope:__scopeNavigationMenu,children:jsxRuntimeExports.jsx(Primitive$1.button,{...groupProps,ref:forwardedRef,onKeyDown:composeEventHandlers$1(props.onKeyDown,event=>{if(["Home","End",...ARROW_KEYS$1].includes(event.key)){let candidateNodes=getItems().map(item=>item.ref.current);if([context.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(event.key)&&candidateNodes.reverse(),ARROW_KEYS$1.includes(event.key)){const currentIndex=candidateNodes.indexOf(event.currentTarget);candidateNodes=candidateNodes.slice(currentIndex+1)}setTimeout(()=>focusFirst$3(candidateNodes)),event.preventDefault()}})})})});function getTabbableCandidates$1(container){const nodes=[],walker=document.createTreeWalker(container,NodeFilter.SHOW_ELEMENT,{acceptNode:__name(node2=>{const isHiddenInput=node2.tagName==="INPUT"&&node2.type==="hidden";return node2.disabled||node2.hidden||isHiddenInput?NodeFilter.FILTER_SKIP:node2.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;walker.nextNode();)nodes.push(walker.currentNode);return nodes}__name(getTabbableCandidates$1,"getTabbableCandidates$1");function focusFirst$3(candidates){const previouslyFocusedElement=document.activeElement;return candidates.some(candidate=>candidate===previouslyFocusedElement?!0:(candidate.focus(),document.activeElement!==previouslyFocusedElement))}__name(focusFirst$3,"focusFirst$3");function removeFromTabOrder(candidates){return candidates.forEach(candidate=>{candidate.dataset.tabindex=candidate.getAttribute("tabindex")||"",candidate.setAttribute("tabindex","-1")}),()=>{candidates.forEach(candidate=>{const prevTabIndex=candidate.dataset.tabindex;candidate.setAttribute("tabindex",prevTabIndex)})}}__name(removeFromTabOrder,"removeFromTabOrder");function useResizeObserver$1(element2,onResize){const handleResize=useCallbackRef$1(onResize);useLayoutEffect2(()=>{let rAF=0;if(element2){const resizeObserver=new ResizeObserver(()=>{cancelAnimationFrame(rAF),rAF=window.requestAnimationFrame(handleResize)});return resizeObserver.observe(element2),()=>{window.cancelAnimationFrame(rAF),resizeObserver.unobserve(element2)}}},[element2,handleResize])}__name(useResizeObserver$1,"useResizeObserver$1");function getOpenState$1(open){return open?"open":"closed"}__name(getOpenState$1,"getOpenState$1");function makeTriggerId$1(baseId,value){return`${baseId}-trigger-${value}`}__name(makeTriggerId$1,"makeTriggerId$1");function makeContentId$1(baseId,value){return`${baseId}-content-${value}`}__name(makeContentId$1,"makeContentId$1");function whenMouse$1(handler){return event=>event.pointerType==="mouse"?handler(event):void 0}__name(whenMouse$1,"whenMouse$1");var Root2$5=NavigationMenu$1,List$1=NavigationMenuList$1,Item$2=NavigationMenuItem$1,Link=NavigationMenuLink$1,Viewport$2=NavigationMenuViewport$1;function NavigationMenuViewport({className,...props}){return jsxRuntimeExports.jsx("div",{className:cn$1("absolute top-full left-0 isolate z-50 flex justify-center"),children:jsxRuntimeExports.jsx(Viewport$2,{"data-slot":"navigation-menu-viewport",className:cn$1("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)]",className),...props})})}__name(NavigationMenuViewport,"NavigationMenuViewport");function NavigationMenu({className,children,viewport=!0,...props}){return jsxRuntimeExports.jsxs(Root2$5,{"data-slot":"navigation-menu","data-viewport":viewport,className:cn$1("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",className),...props,children:[children,viewport&&jsxRuntimeExports.jsx(NavigationMenuViewport,{})]})}__name(NavigationMenu,"NavigationMenu");function NavigationMenuItem({className,...props}){return jsxRuntimeExports.jsx(Item$2,{"data-slot":"navigation-menu-item",className:cn$1("relative",className),...props})}__name(NavigationMenuItem,"NavigationMenuItem");function NavigationMenuLink({className,...props}){return jsxRuntimeExports.jsx(Link,{"data-slot":"navigation-menu-link",className:cn$1("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",className),...props})}__name(NavigationMenuLink,"NavigationMenuLink");function NavigationMenuList({className,...props}){return jsxRuntimeExports.jsx(List$1,{"data-slot":"navigation-menu-list",className:cn$1("group flex flex-1 list-none items-center justify-center gap-1",className),...props})}__name(NavigationMenuList,"NavigationMenuList");const badgeVariants=cva("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 Version(){return jsxRuntimeExports.jsx("a",{href:"https://github.com/HarperFast/studio/releases",target:"_blank",rel:"noopener noreferrer",children:jsxRuntimeExports.jsxs("span",{className:cn$1(badgeVariants({variant:"default"}),"text-xs inline-block ml-2 align-text-top"),children:["v4.7.21"," BETA"]})})}__name(Version,"Version");function useInstanceClient(operationsUrl,port,secure){const{instanceId,clusterId}=useParams({strict:!1});return getInstanceClient({id:OverallAppSignIn,operationsUrl,port,secure})}__name(useInstanceClient,"useInstanceClient");function useInstanceClientParams(operationsUrl,port,secure){const{instanceId,clusterId}=useParams({strict:!1});return{instanceClient:getInstanceClient({id:OverallAppSignIn,operationsUrl,port,secure}),entityType:"instance"}}__name(useInstanceClientParams,"useInstanceClientParams");function useInstanceClientIdParams(operationsUrl,port,secure){const params=useParams({strict:!1});return reactExports.useMemo(()=>getInstanceClientIdFromParams({...params,operationsUrl,port,secure}),[params,operationsUrl,port,secure])}__name(useInstanceClientIdParams,"useInstanceClientIdParams");function getInstanceClientIdFromParams({instanceId,clusterId,operationsUrl,port,secure}){const id2=OverallAppSignIn;return{instanceClient:getInstanceClient({id:id2,operationsUrl,port,secure}),entityId:id2,entityType:"instance"}}__name(getInstanceClientIdFromParams,"getInstanceClientIdFromParams");function clearLocalStorage(){localStorage.clear()}__name(clearLocalStorage,"clearLocalStorage");function clearSessionStorage(){sessionStorage.clear()}__name(clearSessionStorage,"clearSessionStorage");async function logoutOnSuccess(){authStore.setUserForEntity(OverallAppSignIn,null),queryClient.getQueryCache().clear(),clearLocalStorage(),clearSessionStorage(),await queryClient.invalidateQueries({refetchType:"none"})}__name(logoutOnSuccess,"logoutOnSuccess");async function onLogoutSubmit(instanceClientConfig){await authStore.signOutFromPotentiallyAuthenticatedInstances(),await onInstanceLogoutSubmit({...instanceClientConfig,entityId:OverallAppSignIn})}__name(onLogoutSubmit,"onLogoutSubmit");function useLogoutMutation(){const instanceClient=useInstanceClient();return useMutation({mutationFn:__name(()=>onLogoutSubmit({instanceClient}),"mutationFn"),onSuccess:logoutOnSuccess})}__name(useLogoutMutation,"useLogoutMutation");function useOrganizationPermissions(orgId){const{user}=useCloudAuth(),{organizationId:orgIdFromRoute}=useParams({strict:!1}),role=user?.roles?.[orgId??orgIdFromRoute];return!role?.permission&&!role?.organization?{update:!1,remove:!1}:role.permission?.super_user?{update:!0,remove:!0}:{update:role.organization.update,remove:role.organization.delete}}__name(useOrganizationPermissions,"useOrganizationPermissions");function useOrganizationRolePermissions(orgId){const{user}=useCloudAuth(),{organizationId:orgIdFromRoute}=useParams({strict:!1}),role=user?.roles?.[orgId??orgIdFromRoute];if(!role?.permission&&!role?.organization?.roles)return{create:!1,remove:!1,update:!1,view:!1};if(role.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const roles=role.organization.roles;return{create:roles.create,remove:roles.delete,update:roles.update,view:roles.view}}__name(useOrganizationRolePermissions,"useOrganizationRolePermissions");function useOrganizationClusterPermissions(orgId,clusterId){const{user}=useCloudAuth(),{organizationId:orgIdFromRoute,clusterId:clusterIdFromRoute}=useParams({strict:!1});return getOrganizationClusterPermissions(user,orgId??orgIdFromRoute,clusterId??clusterIdFromRoute)}__name(useOrganizationClusterPermissions,"useOrganizationClusterPermissions");function getOrganizationClusterPermissions(user,orgId,clusterId){const role=user?.roles?.[orgId];if(!role?.permission&&!role?.organization?.clusters)return{create:!1,remove:!1,update:!1,view:!1};if(role.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const specificRoles=role.organization.clusters.resources?.find(r2=>r2.id===clusterId),genericRoles=role.organization.clusters;return{create:genericRoles.create,remove:specificRoles?specificRoles.delete:genericRoles.delete,update:specificRoles?specificRoles.update:genericRoles.update,view:specificRoles?specificRoles.view:genericRoles.view}}__name(getOrganizationClusterPermissions,"getOrganizationClusterPermissions");function useOrganizationClusterInstancePermissions(orgId,clusterId){const{user}=useCloudAuth(),{organizationId:orgIdFromRoute,clusterId:clusterIdFromRoute}=useParams({strict:!1});return getOrganizationClusterInstancePermissions(user,orgIdFromRoute,clusterIdFromRoute)}__name(useOrganizationClusterInstancePermissions,"useOrganizationClusterInstancePermissions");function getOrganizationClusterInstancePermissions(user,orgId,clusterId){const role=user?.roles?.[orgId];if(!role?.permission&&!role?.organization?.clusters)return{create:!1,remove:!1,update:!1,view:!1};if(role.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const specificRoles=role.organization.clusters.resources?.find(r2=>r2.id===clusterId)?.instances,genericRoles=role.organization.clusters;return{create:specificRoles?specificRoles.create:genericRoles.create,remove:specificRoles?specificRoles.delete:genericRoles.delete,update:specificRoles?specificRoles.update:genericRoles.update,view:specificRoles?specificRoles.view:genericRoles.view}}__name(getOrganizationClusterInstancePermissions,"getOrganizationClusterInstancePermissions");function useInstanceManagePermission(entityId){const{clusterId,instanceId}=useParams({strict:!1}),{user}=useInstanceAuth(),permission=user?.role?.permission;return permission?permission.super_user===!0:!1}__name(useInstanceManagePermission,"useInstanceManagePermission");function useInstanceBrowseManagePermission(entityId){const{clusterId,instanceId}=useParams({strict:!1}),{user}=useInstanceAuth(),permission=user?.role?.permission;return permission?permission.super_user===!0||permission.structure_user===!0:!1}__name(useInstanceBrowseManagePermission,"useInstanceBrowseManagePermission");function useInstanceSchemaTablePermission(entityId,databaseName,tableName,action){const{clusterId,instanceId}=useParams({strict:!1}),{user}=useInstanceAuth(),permission=user?.role?.permission;return permission?permission.super_user===!0||permission.structure_user===!0?!0:permission[databaseName]?.tables?.[tableName][action]===!0:!1}__name(useInstanceSchemaTablePermission,"useInstanceSchemaTablePermission");const activeLinkProps$1={className:"text-white"};function Navbar(){const{mutate:signOut}=useLogoutMutation(),navigate=useNavigate(),{user}=useOverallAuth(),router=useRouter(),{organizationId}=useParams({strict:!1}),{update:canUpdateOrganization}=useOrganizationPermissions(organizationId),{view:showOrgUsersAndRoles}=useOrganizationRolePermissions(organizationId),showBilling=canUpdateOrganization,handleSignOut=reactExports.useCallback(()=>{signOut(void 0,{onSuccess:__name(async()=>{toast.success("Success",{description:"You have been signed out successfully.",action:{label:"Dismiss",onClick:__name(()=>toast.dismiss(),"onClick")}}),navigate({to:"/sign-in"}),router.invalidate()},"onSuccess")})},[signOut,router,navigate]),menuItems=reactExports.useMemo(()=>[!isLocalStudio,!isLocalStudio,!isLocalStudio,{to:"https://docs.harperdb.io/docs",target:"_blank",icon:jsxRuntimeExports.jsx(BookOpenText,{}),text:"Docs",textBreakpoint:"md"},{to:"https://github.com/HarperFast/studio/issues",target:"_blank",icon:jsxRuntimeExports.jsx(Bug,{}),text:"Report an Issue",textBreakpoint:"lg"},{to:"https://discord.gg/VzZuaw3Xay",target:"_blank",icon:jsxRuntimeExports.jsx(DiscordLogo,{}),text:"Discord",textBreakpoint:"lg"},{onClick:handleSignOut,icon:jsxRuntimeExports.jsx(LogOut,{}),text:"Sign Out",textBreakpoint:"md"}].filter(excludeFalsy),[organizationId,showBilling,showOrgUsersAndRoles,handleSignOut]);return user?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(MobileNav,{menuItems}),jsxRuntimeExports.jsx(DesktopNav,{menuItems})]}):jsxRuntimeExports.jsx(AnonymousNav,{})}__name(Navbar,"Navbar");function isMenuGroup(item){return item.items!==void 0}__name(isMenuGroup,"isMenuGroup");function AnonymousNav(){return jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntimeExports.jsxs("div",{className:"inline-block",children:[jsxRuntimeExports.jsx(Link$2,{to:"/sign-in",children:jsxRuntimeExports.jsx(MainLogo,{})}),jsxRuntimeExports.jsx(Version,{})]}),jsxRuntimeExports.jsx(NavigationMenu,{children:jsxRuntimeExports.jsxs(NavigationMenuList,{className:"text-grey-400",children:[jsxRuntimeExports.jsx(NavigationMenuItem,{children:jsxRuntimeExports.jsx(NavigationMenuLink,{asChild:!0,children:jsxRuntimeExports.jsxs(Link$2,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[jsxRuntimeExports.jsx(BookOpenText,{})," ",jsxRuntimeExports.jsx("span",{className:"hidden md:inline-block",children:"Docs"})]})})}),jsxRuntimeExports.jsx(NavigationMenuItem,{children:jsxRuntimeExports.jsx(NavigationMenuLink,{asChild:!0,children:jsxRuntimeExports.jsxs(Link$2,{to:"/sign-in",className:"flex-row items-center",activeProps:activeLinkProps$1,children:[jsxRuntimeExports.jsx(LogIn,{})," Sign In"]})})})]})})]})}__name(AnonymousNav,"AnonymousNav");function DesktopNav({menuItems}){const{user}=useOverallAuth();return getDefaultSignedInCloudRouteForUser(user),jsxRuntimeExports.jsx("div",{className:"hidden md:block",children:jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntimeExports.jsxs("div",{className:"inline-block",children:[jsxRuntimeExports.jsx(Link$2,{to:defaultInstanceRoute,children:jsxRuntimeExports.jsx(MainLogo,{})}),jsxRuntimeExports.jsx(Version,{})]}),jsxRuntimeExports.jsx(NavigationMenu,{children:jsxRuntimeExports.jsx(NavigationMenuList,{className:"text-grey-400",children:menuItems.map(menuItem=>isMenuGroup(menuItem)?!!menuItem.items.length&&jsxRuntimeExports.jsx("div",{className:"bg-black rounded-2xl flex",children:menuItem.items.map(innerMenuItem=>jsxRuntimeExports.jsx(DesktopNavItem,{menuItem:innerMenuItem},innerMenuItem.text))},menuItem.text):jsxRuntimeExports.jsx(DesktopNavItem,{menuItem},menuItem.text))})})]})})}__name(DesktopNav,"DesktopNav");function DesktopNavItem({menuItem}){return jsxRuntimeExports.jsx(NavigationMenuItem,{className:"text-gray-400 hover:text-white",children:jsxRuntimeExports.jsx(NavigationMenuLink,{asChild:!0,children:jsxRuntimeExports.jsxs(Link$2,{to:menuItem.to,onClick:menuItem.onClick,className:"flex-row items-center",target:menuItem.target,activeProps:menuItem.to?activeLinkProps$1:void 0,children:[menuItem.icon,jsxRuntimeExports.jsx("span",{className:`hidden ${menuItem.textBreakpoint}:inline-block`,children:menuItem.text}),jsxRuntimeExports.jsx("span",{className:`${menuItem.textBreakpoint}:hidden`,children:" "})]})})})}__name(DesktopNavItem,"DesktopNavItem");function MobileNav({menuItems}){const{user}=useOverallAuth();getDefaultSignedInCloudRouteForUser(user);const[isMenuOpen,setIsMenuOpen]=reactExports.useState(!1),toggleMenu=reactExports.useCallback(()=>setIsMenuOpen(open=>!open),[]),closeMenu=reactExports.useCallback(()=>setIsMenuOpen(!1),[]);return jsxRuntimeExports.jsxs("div",{className:"md:hidden",id:"mobile-menu",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntimeExports.jsx(Link$2,{to:defaultInstanceRoute,children:jsxRuntimeExports.jsx(MainLogo,{})}),jsxRuntimeExports.jsx(Version,{}),jsxRuntimeExports.jsxs("button",{type:"button",className:"shadow-xs text-grey-400 hover:text-white hover:bg-black-dark",onClick:toggleMenu,children:[jsxRuntimeExports.jsx("span",{className:"sr-only",children:isMenuOpen?"Close menu":"Open menu"}),isMenuOpen?jsxRuntimeExports.jsx(X,{}):jsxRuntimeExports.jsx(Menu$1,{})]})]}),jsxRuntimeExports.jsx("div",{className:`${isMenuOpen?"fixed":"hidden"} top-40 bottom-0 left-0 right-0 bg-black-dark opacity-70`,onClick:closeMenu}),jsxRuntimeExports.jsx("div",{className:`${isMenuOpen?"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:menuItems.map(menuItem=>isMenuGroup(menuItem)?!!menuItem.items.length&&jsxRuntimeExports.jsx("div",{className:"bg-black pl-10 pr-2 py-2",children:menuItem.items.map(innerMenuItem=>jsxRuntimeExports.jsx(MobileNavItem,{menuItem:innerMenuItem,onClick:closeMenu},innerMenuItem.text))},menuItem.text):jsxRuntimeExports.jsx(MobileNavItem,{menuItem,onClick:closeMenu},menuItem.text))})]})}__name(MobileNav,"MobileNav");function MobileNavItem({menuItem,onClick}){const linkOnClick=reactExports.useCallback(()=>{menuItem.onClick?.(),onClick()},[menuItem,onClick]);return jsxRuntimeExports.jsxs(Link$2,{to:menuItem.to,onClick:linkOnClick,target:menuItem.target,className:"flex flex-row px-3 py-2 text-base font-medium rounded-md text-gray-400 hover:text-white",activeProps:menuItem.to?activeLinkProps$1:void 0,children:[menuItem.icon,jsxRuntimeExports.jsx("span",{className:"ml-4",children:menuItem.text})]})}__name(MobileNavItem,"MobileNavItem");function AuthLayout(){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.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:jsxRuntimeExports.jsx(Navbar,{})}),jsxRuntimeExports.jsxs("div",{className:"pt-20 grid h-screen grid-cols-1 md:grid-cols-2",children:[jsxRuntimeExports.jsx("section",{className:"items-center justify-center hidden text-white md:flex px-6 fabricSignupTextContainer",children:jsxRuntimeExports.jsx("img",{className:"object-scale-down max-h-[calc(100vh-80px-40px)] min-h-115",src:"/fabric-signup-text.png",alt:"One Runtime: App, database, Cache and Messaging. Distributed by design, free to deploy, and live in minutes. Deploy!"})}),jsxRuntimeExports.jsx("section",{className:"flex items-center justify-center px-6 bg-linear-(--purple-gradient) dark:bg-linear-(--black-dark-gradient)",children:jsxRuntimeExports.jsx(Outlet,{})})]})]})}__name(AuthLayout,"AuthLayout");function useReo(){reactExports.useEffect(()=>{},[])}__name(useReo,"useReo");const commonProviders=["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 parseCompanyFromEmail(email2){if(!email2||!email2.includes("@"))return null;const domain2=email2.split("@").pop()||"";if(!domain2)return null;for(const provider of commonProviders)if(domain2===provider||domain2.endsWith("."+provider))return null;return domain2}__name(parseCompanyFromEmail,"parseCompanyFromEmail");let checking=null;function CheckOAuth(){const navigate=useNavigate(),router=useRouter(),queryClient2=useQueryClient(),{redirect:redirect2}=useSearch({strict:!1});return reactExports.useEffect(()=>{checking||(checking=(async function(){const user=await getCurrentUser().catch(()=>null);if(!user)toast.error("We were not able to verify your sign-in. Please try signing in again.",{duration:1e4}),await navigate({to:"/sign-in"});else{authStore.setUserForEntity(OverallAppSignIn,user);const defaultCloudRoute=getDefaultSignedInCloudRouteForUser(user);parseCompanyFromEmail(user.email),await queryClient2.invalidateQueries({queryKey:currentUserQueryKey,refetchType:"none"}),await router.invalidate(),await navigate({to:redirect2?.startsWith("/")?redirect2:defaultCloudRoute})}checking=null})())},[]),jsxRuntimeExports.jsxs("div",{className:"text-white w-lg flex flex-col gap-4",children:[jsxRuntimeExports.jsxs("h1",{className:"text-3xl font-light",children:[jsxRuntimeExports.jsx("span",{"aria-hidden":"true",className:"text-2xl animate-flower-dance mr-4",title:"Loading",children:"🌼"}),"Checking..."]}),jsxRuntimeExports.jsx("div",{className:"underline flex gap-4",children:jsxRuntimeExports.jsx(Link$2,{className:"text-sm opacity-50 hover:text-blue-300",to:"/sign-in",children:"Try signing in again"})})]})}__name(CheckOAuth,"CheckOAuth");const sides=["top","right","bottom","left"],min$1=Math.min,max$1=Math.max,round=Math.round,floor=Math.floor,createCoords=__name(v2=>({x:v2,y:v2}),"createCoords"),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp$1(start,value,end){return max$1(start,min$1(value,end))}__name(clamp$1,"clamp$1");function evaluate(value,param){return typeof value=="function"?value(param):value}__name(evaluate,"evaluate");function getSide(placement){return placement.split("-")[0]}__name(getSide,"getSide");function getAlignment(placement){return placement.split("-")[1]}__name(getAlignment,"getAlignment");function getOppositeAxis(axis){return axis==="x"?"y":"x"}__name(getOppositeAxis,"getOppositeAxis");function getAxisLength(axis){return axis==="y"?"height":"width"}__name(getAxisLength,"getAxisLength");const yAxisSides=new Set(["top","bottom"]);function getSideAxis(placement){return yAxisSides.has(getSide(placement))?"y":"x"}__name(getSideAxis,"getSideAxis");function getAlignmentAxis(placement){return getOppositeAxis(getSideAxis(placement))}__name(getAlignmentAxis,"getAlignmentAxis");function getAlignmentSides(placement,rects,rtl){rtl===void 0&&(rtl=!1);const alignment=getAlignment(placement),alignmentAxis=getAlignmentAxis(placement),length=getAxisLength(alignmentAxis);let mainAlignmentSide=alignmentAxis==="x"?alignment===(rtl?"end":"start")?"right":"left":alignment==="start"?"bottom":"top";return rects.reference[length]>rects.floating[length]&&(mainAlignmentSide=getOppositePlacement(mainAlignmentSide)),[mainAlignmentSide,getOppositePlacement(mainAlignmentSide)]}__name(getAlignmentSides,"getAlignmentSides");function getExpandedPlacements(placement){const oppositePlacement=getOppositePlacement(placement);return[getOppositeAlignmentPlacement(placement),oppositePlacement,getOppositeAlignmentPlacement(oppositePlacement)]}__name(getExpandedPlacements,"getExpandedPlacements");function getOppositeAlignmentPlacement(placement){return placement.replace(/start|end/g,alignment=>oppositeAlignmentMap[alignment])}__name(getOppositeAlignmentPlacement,"getOppositeAlignmentPlacement");const lrPlacement=["left","right"],rlPlacement=["right","left"],tbPlacement=["top","bottom"],btPlacement=["bottom","top"];function getSideList(side,isStart,rtl){switch(side){case"top":case"bottom":return rtl?isStart?rlPlacement:lrPlacement:isStart?lrPlacement:rlPlacement;case"left":case"right":return isStart?tbPlacement:btPlacement;default:return[]}}__name(getSideList,"getSideList");function getOppositeAxisPlacements(placement,flipAlignment,direction,rtl){const alignment=getAlignment(placement);let list2=getSideList(getSide(placement),direction==="start",rtl);return alignment&&(list2=list2.map(side=>side+"-"+alignment),flipAlignment&&(list2=list2.concat(list2.map(getOppositeAlignmentPlacement)))),list2}__name(getOppositeAxisPlacements,"getOppositeAxisPlacements");function getOppositePlacement(placement){return placement.replace(/left|right|bottom|top/g,side=>oppositeSideMap[side])}__name(getOppositePlacement,"getOppositePlacement");function expandPaddingObject(padding){return{top:0,right:0,bottom:0,left:0,...padding}}__name(expandPaddingObject,"expandPaddingObject");function getPaddingObject(padding){return typeof padding!="number"?expandPaddingObject(padding):{top:padding,right:padding,bottom:padding,left:padding}}__name(getPaddingObject,"getPaddingObject");function rectToClientRect(rect){const{x,y,width,height}=rect;return{width,height,top:y,left:x,right:x+width,bottom:y+height,x,y}}__name(rectToClientRect,"rectToClientRect");function computeCoordsFromPlacement(_ref,placement,rtl){let{reference,floating}=_ref;const sideAxis=getSideAxis(placement),alignmentAxis=getAlignmentAxis(placement),alignLength=getAxisLength(alignmentAxis),side=getSide(placement),isVertical=sideAxis==="y",commonX=reference.x+reference.width/2-floating.width/2,commonY=reference.y+reference.height/2-floating.height/2,commonAlign=reference[alignLength]/2-floating[alignLength]/2;let coords;switch(side){case"top":coords={x:commonX,y:reference.y-floating.height};break;case"bottom":coords={x:commonX,y:reference.y+reference.height};break;case"right":coords={x:reference.x+reference.width,y:commonY};break;case"left":coords={x:reference.x-floating.width,y:commonY};break;default:coords={x:reference.x,y:reference.y}}switch(getAlignment(placement)){case"start":coords[alignmentAxis]-=commonAlign*(rtl&&isVertical?-1:1);break;case"end":coords[alignmentAxis]+=commonAlign*(rtl&&isVertical?-1:1);break}return coords}__name(computeCoordsFromPlacement,"computeCoordsFromPlacement");const computePosition$1=__name(async(reference,floating,config2)=>{const{placement="bottom",strategy="absolute",middleware=[],platform:platform2}=config2,validMiddleware=middleware.filter(Boolean),rtl=await(platform2.isRTL==null?void 0:platform2.isRTL(floating));let rects=await platform2.getElementRects({reference,floating,strategy}),{x,y}=computeCoordsFromPlacement(rects,placement,rtl),statefulPlacement=placement,middlewareData={},resetCount=0;for(let i2=0;i2<validMiddleware.length;i2++){const{name:name2,fn}=validMiddleware[i2],{x:nextX,y:nextY,data,reset}=await fn({x,y,initialPlacement:placement,placement:statefulPlacement,strategy,middlewareData,rects,platform:platform2,elements:{reference,floating}});x=nextX??x,y=nextY??y,middlewareData={...middlewareData,[name2]:{...middlewareData[name2],...data}},reset&&resetCount<=50&&(resetCount++,typeof reset=="object"&&(reset.placement&&(statefulPlacement=reset.placement),reset.rects&&(rects=reset.rects===!0?await platform2.getElementRects({reference,floating,strategy}):reset.rects),{x,y}=computeCoordsFromPlacement(rects,statefulPlacement,rtl)),i2=-1)}return{x,y,placement:statefulPlacement,strategy,middlewareData}},"computePosition$1");async function detectOverflow(state2,options){var _await$platform$isEle;options===void 0&&(options={});const{x,y,platform:platform2,rects,elements,strategy}=state2,{boundary="clippingAncestors",rootBoundary="viewport",elementContext="floating",altBoundary=!1,padding=0}=evaluate(options,state2),paddingObject=getPaddingObject(padding),element2=elements[altBoundary?elementContext==="floating"?"reference":"floating":elementContext],clippingClientRect=rectToClientRect(await platform2.getClippingRect({element:(_await$platform$isEle=await(platform2.isElement==null?void 0:platform2.isElement(element2)))==null||_await$platform$isEle?element2:element2.contextElement||await(platform2.getDocumentElement==null?void 0:platform2.getDocumentElement(elements.floating)),boundary,rootBoundary,strategy})),rect=elementContext==="floating"?{x,y,width:rects.floating.width,height:rects.floating.height}:rects.reference,offsetParent=await(platform2.getOffsetParent==null?void 0:platform2.getOffsetParent(elements.floating)),offsetScale=await(platform2.isElement==null?void 0:platform2.isElement(offsetParent))?await(platform2.getScale==null?void 0:platform2.getScale(offsetParent))||{x:1,y:1}:{x:1,y:1},elementClientRect=rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect?await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({elements,rect,offsetParent,strategy}):rect);return{top:(clippingClientRect.top-elementClientRect.top+paddingObject.top)/offsetScale.y,bottom:(elementClientRect.bottom-clippingClientRect.bottom+paddingObject.bottom)/offsetScale.y,left:(clippingClientRect.left-elementClientRect.left+paddingObject.left)/offsetScale.x,right:(elementClientRect.right-clippingClientRect.right+paddingObject.right)/offsetScale.x}}__name(detectOverflow,"detectOverflow");const arrow$3=__name(options=>({name:"arrow",options,async fn(state2){const{x,y,placement,rects,platform:platform2,elements,middlewareData}=state2,{element:element2,padding=0}=evaluate(options,state2)||{};if(element2==null)return{};const paddingObject=getPaddingObject(padding),coords={x,y},axis=getAlignmentAxis(placement),length=getAxisLength(axis),arrowDimensions=await platform2.getDimensions(element2),isYAxis=axis==="y",minProp=isYAxis?"top":"left",maxProp=isYAxis?"bottom":"right",clientProp=isYAxis?"clientHeight":"clientWidth",endDiff=rects.reference[length]+rects.reference[axis]-coords[axis]-rects.floating[length],startDiff=coords[axis]-rects.reference[axis],arrowOffsetParent=await(platform2.getOffsetParent==null?void 0:platform2.getOffsetParent(element2));let clientSize=arrowOffsetParent?arrowOffsetParent[clientProp]:0;(!clientSize||!await(platform2.isElement==null?void 0:platform2.isElement(arrowOffsetParent)))&&(clientSize=elements.floating[clientProp]||rects.floating[length]);const centerToReference=endDiff/2-startDiff/2,largestPossiblePadding=clientSize/2-arrowDimensions[length]/2-1,minPadding=min$1(paddingObject[minProp],largestPossiblePadding),maxPadding=min$1(paddingObject[maxProp],largestPossiblePadding),min$1$1=minPadding,max2=clientSize-arrowDimensions[length]-maxPadding,center=clientSize/2-arrowDimensions[length]/2+centerToReference,offset2=clamp$1(min$1$1,center,max2),shouldAddOffset=!middlewareData.arrow&&getAlignment(placement)!=null&¢er!==offset2&&rects.reference[length]/2-(center<min$1$1?minPadding:maxPadding)-arrowDimensions[length]/2<0,alignmentOffset=shouldAddOffset?center<min$1$1?center-min$1$1:center-max2:0;return{[axis]:coords[axis]+alignmentOffset,data:{[axis]:offset2,centerOffset:center-offset2-alignmentOffset,...shouldAddOffset&&{alignmentOffset}},reset:shouldAddOffset}}}),"arrow$3"),flip$2=__name(function(options){return options===void 0&&(options={}),{name:"flip",options,async fn(state2){var _middlewareData$arrow,_middlewareData$flip;const{placement,middlewareData,rects,initialPlacement,platform:platform2,elements}=state2,{mainAxis:checkMainAxis=!0,crossAxis:checkCrossAxis=!0,fallbackPlacements:specifiedFallbackPlacements,fallbackStrategy="bestFit",fallbackAxisSideDirection="none",flipAlignment=!0,...detectOverflowOptions}=evaluate(options,state2);if((_middlewareData$arrow=middlewareData.arrow)!=null&&_middlewareData$arrow.alignmentOffset)return{};const side=getSide(placement),initialSideAxis=getSideAxis(initialPlacement),isBasePlacement=getSide(initialPlacement)===initialPlacement,rtl=await(platform2.isRTL==null?void 0:platform2.isRTL(elements.floating)),fallbackPlacements=specifiedFallbackPlacements||(isBasePlacement||!flipAlignment?[getOppositePlacement(initialPlacement)]:getExpandedPlacements(initialPlacement)),hasFallbackAxisSideDirection=fallbackAxisSideDirection!=="none";!specifiedFallbackPlacements&&hasFallbackAxisSideDirection&&fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement,flipAlignment,fallbackAxisSideDirection,rtl));const placements=[initialPlacement,...fallbackPlacements],overflow=await detectOverflow(state2,detectOverflowOptions),overflows=[];let overflowsData=((_middlewareData$flip=middlewareData.flip)==null?void 0:_middlewareData$flip.overflows)||[];if(checkMainAxis&&overflows.push(overflow[side]),checkCrossAxis){const sides2=getAlignmentSides(placement,rects,rtl);overflows.push(overflow[sides2[0]],overflow[sides2[1]])}if(overflowsData=[...overflowsData,{placement,overflows}],!overflows.every(side2=>side2<=0)){var _middlewareData$flip2,_overflowsData$filter;const nextIndex=(((_middlewareData$flip2=middlewareData.flip)==null?void 0:_middlewareData$flip2.index)||0)+1,nextPlacement=placements[nextIndex];if(nextPlacement&&(!(checkCrossAxis==="alignment"?initialSideAxis!==getSideAxis(nextPlacement):!1)||overflowsData.every(d=>getSideAxis(d.placement)===initialSideAxis?d.overflows[0]>0:!0)))return{data:{index:nextIndex,overflows:overflowsData},reset:{placement:nextPlacement}};let resetPlacement=(_overflowsData$filter=overflowsData.filter(d=>d.overflows[0]<=0).sort((a2,b)=>a2.overflows[1]-b.overflows[1])[0])==null?void 0:_overflowsData$filter.placement;if(!resetPlacement)switch(fallbackStrategy){case"bestFit":{var _overflowsData$filter2;const placement2=(_overflowsData$filter2=overflowsData.filter(d=>{if(hasFallbackAxisSideDirection){const currentSideAxis=getSideAxis(d.placement);return currentSideAxis===initialSideAxis||currentSideAxis==="y"}return!0}).map(d=>[d.placement,d.overflows.filter(overflow2=>overflow2>0).reduce((acc,overflow2)=>acc+overflow2,0)]).sort((a2,b)=>a2[1]-b[1])[0])==null?void 0:_overflowsData$filter2[0];placement2&&(resetPlacement=placement2);break}case"initialPlacement":resetPlacement=initialPlacement;break}if(placement!==resetPlacement)return{reset:{placement:resetPlacement}}}return{}}}},"flip$2");function getSideOffsets(overflow,rect){return{top:overflow.top-rect.height,right:overflow.right-rect.width,bottom:overflow.bottom-rect.height,left:overflow.left-rect.width}}__name(getSideOffsets,"getSideOffsets");function isAnySideFullyClipped(overflow){return sides.some(side=>overflow[side]>=0)}__name(isAnySideFullyClipped,"isAnySideFullyClipped");const hide$2=__name(function(options){return options===void 0&&(options={}),{name:"hide",options,async fn(state2){const{rects}=state2,{strategy="referenceHidden",...detectOverflowOptions}=evaluate(options,state2);switch(strategy){case"referenceHidden":{const overflow=await detectOverflow(state2,{...detectOverflowOptions,elementContext:"reference"}),offsets=getSideOffsets(overflow,rects.reference);return{data:{referenceHiddenOffsets:offsets,referenceHidden:isAnySideFullyClipped(offsets)}}}case"escaped":{const overflow=await detectOverflow(state2,{...detectOverflowOptions,altBoundary:!0}),offsets=getSideOffsets(overflow,rects.floating);return{data:{escapedOffsets:offsets,escaped:isAnySideFullyClipped(offsets)}}}default:return{}}}}},"hide$2"),originSides=new Set(["left","top"]);async function convertValueToCoords(state2,options){const{placement,platform:platform2,elements}=state2,rtl=await(platform2.isRTL==null?void 0:platform2.isRTL(elements.floating)),side=getSide(placement),alignment=getAlignment(placement),isVertical=getSideAxis(placement)==="y",mainAxisMulti=originSides.has(side)?-1:1,crossAxisMulti=rtl&&isVertical?-1:1,rawValue=evaluate(options,state2);let{mainAxis,crossAxis,alignmentAxis}=typeof rawValue=="number"?{mainAxis:rawValue,crossAxis:0,alignmentAxis:null}:{mainAxis:rawValue.mainAxis||0,crossAxis:rawValue.crossAxis||0,alignmentAxis:rawValue.alignmentAxis};return alignment&&typeof alignmentAxis=="number"&&(crossAxis=alignment==="end"?alignmentAxis*-1:alignmentAxis),isVertical?{x:crossAxis*crossAxisMulti,y:mainAxis*mainAxisMulti}:{x:mainAxis*mainAxisMulti,y:crossAxis*crossAxisMulti}}__name(convertValueToCoords,"convertValueToCoords");const offset$2=__name(function(options){return options===void 0&&(options=0),{name:"offset",options,async fn(state2){var _middlewareData$offse,_middlewareData$arrow;const{x,y,placement,middlewareData}=state2,diffCoords=await convertValueToCoords(state2,options);return placement===((_middlewareData$offse=middlewareData.offset)==null?void 0:_middlewareData$offse.placement)&&(_middlewareData$arrow=middlewareData.arrow)!=null&&_middlewareData$arrow.alignmentOffset?{}:{x:x+diffCoords.x,y:y+diffCoords.y,data:{...diffCoords,placement}}}}},"offset$2"),shift$2=__name(function(options){return options===void 0&&(options={}),{name:"shift",options,async fn(state2){const{x,y,placement}=state2,{mainAxis:checkMainAxis=!0,crossAxis:checkCrossAxis=!1,limiter={fn:__name(_ref=>{let{x:x2,y:y2}=_ref;return{x:x2,y:y2}},"fn")},...detectOverflowOptions}=evaluate(options,state2),coords={x,y},overflow=await detectOverflow(state2,detectOverflowOptions),crossAxis=getSideAxis(getSide(placement)),mainAxis=getOppositeAxis(crossAxis);let mainAxisCoord=coords[mainAxis],crossAxisCoord=coords[crossAxis];if(checkMainAxis){const minSide=mainAxis==="y"?"top":"left",maxSide=mainAxis==="y"?"bottom":"right",min2=mainAxisCoord+overflow[minSide],max2=mainAxisCoord-overflow[maxSide];mainAxisCoord=clamp$1(min2,mainAxisCoord,max2)}if(checkCrossAxis){const minSide=crossAxis==="y"?"top":"left",maxSide=crossAxis==="y"?"bottom":"right",min2=crossAxisCoord+overflow[minSide],max2=crossAxisCoord-overflow[maxSide];crossAxisCoord=clamp$1(min2,crossAxisCoord,max2)}const limitedCoords=limiter.fn({...state2,[mainAxis]:mainAxisCoord,[crossAxis]:crossAxisCoord});return{...limitedCoords,data:{x:limitedCoords.x-x,y:limitedCoords.y-y,enabled:{[mainAxis]:checkMainAxis,[crossAxis]:checkCrossAxis}}}}}},"shift$2"),limitShift$2=__name(function(options){return options===void 0&&(options={}),{options,fn(state2){const{x,y,placement,rects,middlewareData}=state2,{offset:offset2=0,mainAxis:checkMainAxis=!0,crossAxis:checkCrossAxis=!0}=evaluate(options,state2),coords={x,y},crossAxis=getSideAxis(placement),mainAxis=getOppositeAxis(crossAxis);let mainAxisCoord=coords[mainAxis],crossAxisCoord=coords[crossAxis];const rawOffset=evaluate(offset2,state2),computedOffset=typeof rawOffset=="number"?{mainAxis:rawOffset,crossAxis:0}:{mainAxis:0,crossAxis:0,...rawOffset};if(checkMainAxis){const len=mainAxis==="y"?"height":"width",limitMin=rects.reference[mainAxis]-rects.floating[len]+computedOffset.mainAxis,limitMax=rects.reference[mainAxis]+rects.reference[len]-computedOffset.mainAxis;mainAxisCoord<limitMin?mainAxisCoord=limitMin:mainAxisCoord>limitMax&&(mainAxisCoord=limitMax)}if(checkCrossAxis){var _middlewareData$offse,_middlewareData$offse2;const len=mainAxis==="y"?"width":"height",isOriginSide=originSides.has(getSide(placement)),limitMin=rects.reference[crossAxis]-rects.floating[len]+(isOriginSide&&((_middlewareData$offse=middlewareData.offset)==null?void 0:_middlewareData$offse[crossAxis])||0)+(isOriginSide?0:computedOffset.crossAxis),limitMax=rects.reference[crossAxis]+rects.reference[len]+(isOriginSide?0:((_middlewareData$offse2=middlewareData.offset)==null?void 0:_middlewareData$offse2[crossAxis])||0)-(isOriginSide?computedOffset.crossAxis:0);crossAxisCoord<limitMin?crossAxisCoord=limitMin:crossAxisCoord>limitMax&&(crossAxisCoord=limitMax)}return{[mainAxis]:mainAxisCoord,[crossAxis]:crossAxisCoord}}}},"limitShift$2"),size$2=__name(function(options){return options===void 0&&(options={}),{name:"size",options,async fn(state2){var _state$middlewareData,_state$middlewareData2;const{placement,rects,platform:platform2,elements}=state2,{apply=__name(()=>{},"apply"),...detectOverflowOptions}=evaluate(options,state2),overflow=await detectOverflow(state2,detectOverflowOptions),side=getSide(placement),alignment=getAlignment(placement),isYAxis=getSideAxis(placement)==="y",{width,height}=rects.floating;let heightSide,widthSide;side==="top"||side==="bottom"?(heightSide=side,widthSide=alignment===(await(platform2.isRTL==null?void 0:platform2.isRTL(elements.floating))?"start":"end")?"left":"right"):(widthSide=side,heightSide=alignment==="end"?"top":"bottom");const maximumClippingHeight=height-overflow.top-overflow.bottom,maximumClippingWidth=width-overflow.left-overflow.right,overflowAvailableHeight=min$1(height-overflow[heightSide],maximumClippingHeight),overflowAvailableWidth=min$1(width-overflow[widthSide],maximumClippingWidth),noShift=!state2.middlewareData.shift;let availableHeight=overflowAvailableHeight,availableWidth=overflowAvailableWidth;if((_state$middlewareData=state2.middlewareData.shift)!=null&&_state$middlewareData.enabled.x&&(availableWidth=maximumClippingWidth),(_state$middlewareData2=state2.middlewareData.shift)!=null&&_state$middlewareData2.enabled.y&&(availableHeight=maximumClippingHeight),noShift&&!alignment){const xMin=max$1(overflow.left,0),xMax=max$1(overflow.right,0),yMin=max$1(overflow.top,0),yMax=max$1(overflow.bottom,0);isYAxis?availableWidth=width-2*(xMin!==0||xMax!==0?xMin+xMax:max$1(overflow.left,overflow.right)):availableHeight=height-2*(yMin!==0||yMax!==0?yMin+yMax:max$1(overflow.top,overflow.bottom))}await apply({...state2,availableWidth,availableHeight});const nextDimensions=await platform2.getDimensions(elements.floating);return width!==nextDimensions.width||height!==nextDimensions.height?{reset:{rects:!0}}:{}}}},"size$2");function hasWindow(){return typeof window<"u"}__name(hasWindow,"hasWindow");function getNodeName(node2){return isNode(node2)?(node2.nodeName||"").toLowerCase():"#document"}__name(getNodeName,"getNodeName");function getWindow(node2){var _node$ownerDocument;return(node2==null||(_node$ownerDocument=node2.ownerDocument)==null?void 0:_node$ownerDocument.defaultView)||window}__name(getWindow,"getWindow");function getDocumentElement(node2){var _ref;return(_ref=(isNode(node2)?node2.ownerDocument:node2.document)||window.document)==null?void 0:_ref.documentElement}__name(getDocumentElement,"getDocumentElement");function isNode(value){return hasWindow()?value instanceof Node||value instanceof getWindow(value).Node:!1}__name(isNode,"isNode");function isElement(value){return hasWindow()?value instanceof Element||value instanceof getWindow(value).Element:!1}__name(isElement,"isElement");function isHTMLElement$1(value){return hasWindow()?value instanceof HTMLElement||value instanceof getWindow(value).HTMLElement:!1}__name(isHTMLElement$1,"isHTMLElement$1");function isShadowRoot(value){return!hasWindow()||typeof ShadowRoot>"u"?!1:value instanceof ShadowRoot||value instanceof getWindow(value).ShadowRoot}__name(isShadowRoot,"isShadowRoot");const invalidOverflowDisplayValues=new Set(["inline","contents"]);function isOverflowElement(element2){const{overflow,overflowX,overflowY,display:display2}=getComputedStyle$1(element2);return/auto|scroll|overlay|hidden|clip/.test(overflow+overflowY+overflowX)&&!invalidOverflowDisplayValues.has(display2)}__name(isOverflowElement,"isOverflowElement");const tableElements$1=new Set(["table","td","th"]);function isTableElement(element2){return tableElements$1.has(getNodeName(element2))}__name(isTableElement,"isTableElement");const topLayerSelectors=[":popover-open",":modal"];function isTopLayer(element2){return topLayerSelectors.some(selector=>{try{return element2.matches(selector)}catch{return!1}})}__name(isTopLayer,"isTopLayer");const transformProperties=["transform","translate","scale","rotate","perspective"],willChangeValues=["transform","translate","scale","rotate","perspective","filter"],containValues=["paint","layout","strict","content"];function isContainingBlock(elementOrCss){const webkit=isWebKit(),css=isElement(elementOrCss)?getComputedStyle$1(elementOrCss):elementOrCss;return transformProperties.some(value=>css[value]?css[value]!=="none":!1)||(css.containerType?css.containerType!=="normal":!1)||!webkit&&(css.backdropFilter?css.backdropFilter!=="none":!1)||!webkit&&(css.filter?css.filter!=="none":!1)||willChangeValues.some(value=>(css.willChange||"").includes(value))||containValues.some(value=>(css.contain||"").includes(value))}__name(isContainingBlock,"isContainingBlock");function getContainingBlock(element2){let currentNode=getParentNode(element2);for(;isHTMLElement$1(currentNode)&&!isLastTraversableNode(currentNode);){if(isContainingBlock(currentNode))return currentNode;if(isTopLayer(currentNode))return null;currentNode=getParentNode(currentNode)}return null}__name(getContainingBlock,"getContainingBlock");function isWebKit(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}__name(isWebKit,"isWebKit");const lastTraversableNodeNames=new Set(["html","body","#document"]);function isLastTraversableNode(node2){return lastTraversableNodeNames.has(getNodeName(node2))}__name(isLastTraversableNode,"isLastTraversableNode");function getComputedStyle$1(element2){return getWindow(element2).getComputedStyle(element2)}__name(getComputedStyle$1,"getComputedStyle$1");function getNodeScroll(element2){return isElement(element2)?{scrollLeft:element2.scrollLeft,scrollTop:element2.scrollTop}:{scrollLeft:element2.scrollX,scrollTop:element2.scrollY}}__name(getNodeScroll,"getNodeScroll");function getParentNode(node2){if(getNodeName(node2)==="html")return node2;const result=node2.assignedSlot||node2.parentNode||isShadowRoot(node2)&&node2.host||getDocumentElement(node2);return isShadowRoot(result)?result.host:result}__name(getParentNode,"getParentNode");function getNearestOverflowAncestor(node2){const parentNode=getParentNode(node2);return isLastTraversableNode(parentNode)?node2.ownerDocument?node2.ownerDocument.body:node2.body:isHTMLElement$1(parentNode)&&isOverflowElement(parentNode)?parentNode:getNearestOverflowAncestor(parentNode)}__name(getNearestOverflowAncestor,"getNearestOverflowAncestor");function getOverflowAncestors(node2,list2,traverseIframes){var _node$ownerDocument2;list2===void 0&&(list2=[]),traverseIframes===void 0&&(traverseIframes=!0);const scrollableAncestor=getNearestOverflowAncestor(node2),isBody=scrollableAncestor===((_node$ownerDocument2=node2.ownerDocument)==null?void 0:_node$ownerDocument2.body),win=getWindow(scrollableAncestor);if(isBody){const frameElement=getFrameElement(win);return list2.concat(win,win.visualViewport||[],isOverflowElement(scrollableAncestor)?scrollableAncestor:[],frameElement&&traverseIframes?getOverflowAncestors(frameElement):[])}return list2.concat(scrollableAncestor,getOverflowAncestors(scrollableAncestor,[],traverseIframes))}__name(getOverflowAncestors,"getOverflowAncestors");function getFrameElement(win){return win.parent&&Object.getPrototypeOf(win.parent)?win.frameElement:null}__name(getFrameElement,"getFrameElement");function getCssDimensions(element2){const css=getComputedStyle$1(element2);let width=parseFloat(css.width)||0,height=parseFloat(css.height)||0;const hasOffset=isHTMLElement$1(element2),offsetWidth=hasOffset?element2.offsetWidth:width,offsetHeight=hasOffset?element2.offsetHeight:height,shouldFallback=round(width)!==offsetWidth||round(height)!==offsetHeight;return shouldFallback&&(width=offsetWidth,height=offsetHeight),{width,height,$:shouldFallback}}__name(getCssDimensions,"getCssDimensions");function unwrapElement(element2){return isElement(element2)?element2:element2.contextElement}__name(unwrapElement,"unwrapElement");function getScale(element2){const domElement=unwrapElement(element2);if(!isHTMLElement$1(domElement))return createCoords(1);const rect=domElement.getBoundingClientRect(),{width,height,$:$2}=getCssDimensions(domElement);let x=($2?round(rect.width):rect.width)/width,y=($2?round(rect.height):rect.height)/height;return(!x||!Number.isFinite(x))&&(x=1),(!y||!Number.isFinite(y))&&(y=1),{x,y}}__name(getScale,"getScale");const noOffsets=createCoords(0);function getVisualOffsets(element2){const win=getWindow(element2);return!isWebKit()||!win.visualViewport?noOffsets:{x:win.visualViewport.offsetLeft,y:win.visualViewport.offsetTop}}__name(getVisualOffsets,"getVisualOffsets");function shouldAddVisualOffsets(element2,isFixed,floatingOffsetParent){return isFixed===void 0&&(isFixed=!1),!floatingOffsetParent||isFixed&&floatingOffsetParent!==getWindow(element2)?!1:isFixed}__name(shouldAddVisualOffsets,"shouldAddVisualOffsets");function getBoundingClientRect(element2,includeScale,isFixedStrategy,offsetParent){includeScale===void 0&&(includeScale=!1),isFixedStrategy===void 0&&(isFixedStrategy=!1);const clientRect=element2.getBoundingClientRect(),domElement=unwrapElement(element2);let scale=createCoords(1);includeScale&&(offsetParent?isElement(offsetParent)&&(scale=getScale(offsetParent)):scale=getScale(element2));const visualOffsets=shouldAddVisualOffsets(domElement,isFixedStrategy,offsetParent)?getVisualOffsets(domElement):createCoords(0);let x=(clientRect.left+visualOffsets.x)/scale.x,y=(clientRect.top+visualOffsets.y)/scale.y,width=clientRect.width/scale.x,height=clientRect.height/scale.y;if(domElement){const win=getWindow(domElement),offsetWin=offsetParent&&isElement(offsetParent)?getWindow(offsetParent):offsetParent;let currentWin=win,currentIFrame=getFrameElement(currentWin);for(;currentIFrame&&offsetParent&&offsetWin!==currentWin;){const iframeScale=getScale(currentIFrame),iframeRect=currentIFrame.getBoundingClientRect(),css=getComputedStyle$1(currentIFrame),left=iframeRect.left+(currentIFrame.clientLeft+parseFloat(css.paddingLeft))*iframeScale.x,top=iframeRect.top+(currentIFrame.clientTop+parseFloat(css.paddingTop))*iframeScale.y;x*=iframeScale.x,y*=iframeScale.y,width*=iframeScale.x,height*=iframeScale.y,x+=left,y+=top,currentWin=getWindow(currentIFrame),currentIFrame=getFrameElement(currentWin)}}return rectToClientRect({width,height,x,y})}__name(getBoundingClientRect,"getBoundingClientRect");function getWindowScrollBarX(element2,rect){const leftScroll=getNodeScroll(element2).scrollLeft;return rect?rect.left+leftScroll:getBoundingClientRect(getDocumentElement(element2)).left+leftScroll}__name(getWindowScrollBarX,"getWindowScrollBarX");function getHTMLOffset(documentElement,scroll){const htmlRect=documentElement.getBoundingClientRect(),x=htmlRect.left+scroll.scrollLeft-getWindowScrollBarX(documentElement,htmlRect),y=htmlRect.top+scroll.scrollTop;return{x,y}}__name(getHTMLOffset,"getHTMLOffset");function convertOffsetParentRelativeRectToViewportRelativeRect(_ref){let{elements,rect,offsetParent,strategy}=_ref;const isFixed=strategy==="fixed",documentElement=getDocumentElement(offsetParent),topLayer=elements?isTopLayer(elements.floating):!1;if(offsetParent===documentElement||topLayer&&isFixed)return rect;let scroll={scrollLeft:0,scrollTop:0},scale=createCoords(1);const offsets=createCoords(0),isOffsetParentAnElement=isHTMLElement$1(offsetParent);if((isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed)&&((getNodeName(offsetParent)!=="body"||isOverflowElement(documentElement))&&(scroll=getNodeScroll(offsetParent)),isHTMLElement$1(offsetParent))){const offsetRect=getBoundingClientRect(offsetParent);scale=getScale(offsetParent),offsets.x=offsetRect.x+offsetParent.clientLeft,offsets.y=offsetRect.y+offsetParent.clientTop}const htmlOffset=documentElement&&!isOffsetParentAnElement&&!isFixed?getHTMLOffset(documentElement,scroll):createCoords(0);return{width:rect.width*scale.x,height:rect.height*scale.y,x:rect.x*scale.x-scroll.scrollLeft*scale.x+offsets.x+htmlOffset.x,y:rect.y*scale.y-scroll.scrollTop*scale.y+offsets.y+htmlOffset.y}}__name(convertOffsetParentRelativeRectToViewportRelativeRect,"convertOffsetParentRelativeRectToViewportRelativeRect");function getClientRects(element2){return Array.from(element2.getClientRects())}__name(getClientRects,"getClientRects");function getDocumentRect(element2){const html2=getDocumentElement(element2),scroll=getNodeScroll(element2),body=element2.ownerDocument.body,width=max$1(html2.scrollWidth,html2.clientWidth,body.scrollWidth,body.clientWidth),height=max$1(html2.scrollHeight,html2.clientHeight,body.scrollHeight,body.clientHeight);let x=-scroll.scrollLeft+getWindowScrollBarX(element2);const y=-scroll.scrollTop;return getComputedStyle$1(body).direction==="rtl"&&(x+=max$1(html2.clientWidth,body.clientWidth)-width),{width,height,x,y}}__name(getDocumentRect,"getDocumentRect");const SCROLLBAR_MAX=25;function getViewportRect(element2,strategy){const win=getWindow(element2),html2=getDocumentElement(element2),visualViewport=win.visualViewport;let width=html2.clientWidth,height=html2.clientHeight,x=0,y=0;if(visualViewport){width=visualViewport.width,height=visualViewport.height;const visualViewportBased=isWebKit();(!visualViewportBased||visualViewportBased&&strategy==="fixed")&&(x=visualViewport.offsetLeft,y=visualViewport.offsetTop)}const windowScrollbarX=getWindowScrollBarX(html2);if(windowScrollbarX<=0){const doc=html2.ownerDocument,body=doc.body,bodyStyles=getComputedStyle(body),bodyMarginInline=doc.compatMode==="CSS1Compat"&&parseFloat(bodyStyles.marginLeft)+parseFloat(bodyStyles.marginRight)||0,clippingStableScrollbarWidth=Math.abs(html2.clientWidth-body.clientWidth-bodyMarginInline);clippingStableScrollbarWidth<=SCROLLBAR_MAX&&(width-=clippingStableScrollbarWidth)}else windowScrollbarX<=SCROLLBAR_MAX&&(width+=windowScrollbarX);return{width,height,x,y}}__name(getViewportRect,"getViewportRect");const absoluteOrFixed=new Set(["absolute","fixed"]);function getInnerBoundingClientRect(element2,strategy){const clientRect=getBoundingClientRect(element2,!0,strategy==="fixed"),top=clientRect.top+element2.clientTop,left=clientRect.left+element2.clientLeft,scale=isHTMLElement$1(element2)?getScale(element2):createCoords(1),width=element2.clientWidth*scale.x,height=element2.clientHeight*scale.y,x=left*scale.x,y=top*scale.y;return{width,height,x,y}}__name(getInnerBoundingClientRect,"getInnerBoundingClientRect");function getClientRectFromClippingAncestor(element2,clippingAncestor,strategy){let rect;if(clippingAncestor==="viewport")rect=getViewportRect(element2,strategy);else if(clippingAncestor==="document")rect=getDocumentRect(getDocumentElement(element2));else if(isElement(clippingAncestor))rect=getInnerBoundingClientRect(clippingAncestor,strategy);else{const visualOffsets=getVisualOffsets(element2);rect={x:clippingAncestor.x-visualOffsets.x,y:clippingAncestor.y-visualOffsets.y,width:clippingAncestor.width,height:clippingAncestor.height}}return rectToClientRect(rect)}__name(getClientRectFromClippingAncestor,"getClientRectFromClippingAncestor");function hasFixedPositionAncestor(element2,stopNode){const parentNode=getParentNode(element2);return parentNode===stopNode||!isElement(parentNode)||isLastTraversableNode(parentNode)?!1:getComputedStyle$1(parentNode).position==="fixed"||hasFixedPositionAncestor(parentNode,stopNode)}__name(hasFixedPositionAncestor,"hasFixedPositionAncestor");function getClippingElementAncestors(element2,cache2){const cachedResult=cache2.get(element2);if(cachedResult)return cachedResult;let result=getOverflowAncestors(element2,[],!1).filter(el=>isElement(el)&&getNodeName(el)!=="body"),currentContainingBlockComputedStyle=null;const elementIsFixed=getComputedStyle$1(element2).position==="fixed";let currentNode=elementIsFixed?getParentNode(element2):element2;for(;isElement(currentNode)&&!isLastTraversableNode(currentNode);){const computedStyle=getComputedStyle$1(currentNode),currentNodeIsContaining=isContainingBlock(currentNode);!currentNodeIsContaining&&computedStyle.position==="fixed"&&(currentContainingBlockComputedStyle=null),(elementIsFixed?!currentNodeIsContaining&&!currentContainingBlockComputedStyle:!currentNodeIsContaining&&computedStyle.position==="static"&&!!currentContainingBlockComputedStyle&&absoluteOrFixed.has(currentContainingBlockComputedStyle.position)||isOverflowElement(currentNode)&&!currentNodeIsContaining&&hasFixedPositionAncestor(element2,currentNode))?result=result.filter(ancestor=>ancestor!==currentNode):currentContainingBlockComputedStyle=computedStyle,currentNode=getParentNode(currentNode)}return cache2.set(element2,result),result}__name(getClippingElementAncestors,"getClippingElementAncestors");function getClippingRect(_ref){let{element:element2,boundary,rootBoundary,strategy}=_ref;const clippingAncestors=[...boundary==="clippingAncestors"?isTopLayer(element2)?[]:getClippingElementAncestors(element2,this._c):[].concat(boundary),rootBoundary],firstClippingAncestor=clippingAncestors[0],clippingRect=clippingAncestors.reduce((accRect,clippingAncestor)=>{const rect=getClientRectFromClippingAncestor(element2,clippingAncestor,strategy);return accRect.top=max$1(rect.top,accRect.top),accRect.right=min$1(rect.right,accRect.right),accRect.bottom=min$1(rect.bottom,accRect.bottom),accRect.left=max$1(rect.left,accRect.left),accRect},getClientRectFromClippingAncestor(element2,firstClippingAncestor,strategy));return{width:clippingRect.right-clippingRect.left,height:clippingRect.bottom-clippingRect.top,x:clippingRect.left,y:clippingRect.top}}__name(getClippingRect,"getClippingRect");function getDimensions(element2){const{width,height}=getCssDimensions(element2);return{width,height}}__name(getDimensions,"getDimensions");function getRectRelativeToOffsetParent(element2,offsetParent,strategy){const isOffsetParentAnElement=isHTMLElement$1(offsetParent),documentElement=getDocumentElement(offsetParent),isFixed=strategy==="fixed",rect=getBoundingClientRect(element2,!0,isFixed,offsetParent);let scroll={scrollLeft:0,scrollTop:0};const offsets=createCoords(0);function setLeftRTLScrollbarOffset(){offsets.x=getWindowScrollBarX(documentElement)}if(__name(setLeftRTLScrollbarOffset,"setLeftRTLScrollbarOffset"),isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed)if((getNodeName(offsetParent)!=="body"||isOverflowElement(documentElement))&&(scroll=getNodeScroll(offsetParent)),isOffsetParentAnElement){const offsetRect=getBoundingClientRect(offsetParent,!0,isFixed,offsetParent);offsets.x=offsetRect.x+offsetParent.clientLeft,offsets.y=offsetRect.y+offsetParent.clientTop}else documentElement&&setLeftRTLScrollbarOffset();isFixed&&!isOffsetParentAnElement&&documentElement&&setLeftRTLScrollbarOffset();const htmlOffset=documentElement&&!isOffsetParentAnElement&&!isFixed?getHTMLOffset(documentElement,scroll):createCoords(0),x=rect.left+scroll.scrollLeft-offsets.x-htmlOffset.x,y=rect.top+scroll.scrollTop-offsets.y-htmlOffset.y;return{x,y,width:rect.width,height:rect.height}}__name(getRectRelativeToOffsetParent,"getRectRelativeToOffsetParent");function isStaticPositioned(element2){return getComputedStyle$1(element2).position==="static"}__name(isStaticPositioned,"isStaticPositioned");function getTrueOffsetParent(element2,polyfill2){if(!isHTMLElement$1(element2)||getComputedStyle$1(element2).position==="fixed")return null;if(polyfill2)return polyfill2(element2);let rawOffsetParent=element2.offsetParent;return getDocumentElement(element2)===rawOffsetParent&&(rawOffsetParent=rawOffsetParent.ownerDocument.body),rawOffsetParent}__name(getTrueOffsetParent,"getTrueOffsetParent");function getOffsetParent(element2,polyfill2){const win=getWindow(element2);if(isTopLayer(element2))return win;if(!isHTMLElement$1(element2)){let svgOffsetParent=getParentNode(element2);for(;svgOffsetParent&&!isLastTraversableNode(svgOffsetParent);){if(isElement(svgOffsetParent)&&!isStaticPositioned(svgOffsetParent))return svgOffsetParent;svgOffsetParent=getParentNode(svgOffsetParent)}return win}let offsetParent=getTrueOffsetParent(element2,polyfill2);for(;offsetParent&&isTableElement(offsetParent)&&isStaticPositioned(offsetParent);)offsetParent=getTrueOffsetParent(offsetParent,polyfill2);return offsetParent&&isLastTraversableNode(offsetParent)&&isStaticPositioned(offsetParent)&&!isContainingBlock(offsetParent)?win:offsetParent||getContainingBlock(element2)||win}__name(getOffsetParent,"getOffsetParent");const getElementRects=__name(async function(data){const getOffsetParentFn=this.getOffsetParent||getOffsetParent,getDimensionsFn=this.getDimensions,floatingDimensions=await getDimensionsFn(data.floating);return{reference:getRectRelativeToOffsetParent(data.reference,await getOffsetParentFn(data.floating),data.strategy),floating:{x:0,y:0,width:floatingDimensions.width,height:floatingDimensions.height}}},"getElementRects");function isRTL(element2){return getComputedStyle$1(element2).direction==="rtl"}__name(isRTL,"isRTL");const platform={convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement,getClippingRect,getOffsetParent,getElementRects,getClientRects,getDimensions,getScale,isElement,isRTL};function rectsAreEqual(a2,b){return a2.x===b.x&&a2.y===b.y&&a2.width===b.width&&a2.height===b.height}__name(rectsAreEqual,"rectsAreEqual");function observeMove(element2,onMove){let io=null,timeoutId;const root2=getDocumentElement(element2);function cleanup(){var _io;clearTimeout(timeoutId),(_io=io)==null||_io.disconnect(),io=null}__name(cleanup,"cleanup");function refresh(skip,threshold){skip===void 0&&(skip=!1),threshold===void 0&&(threshold=1),cleanup();const elementRectForRootMargin=element2.getBoundingClientRect(),{left,top,width,height}=elementRectForRootMargin;if(skip||onMove(),!width||!height)return;const insetTop=floor(top),insetRight=floor(root2.clientWidth-(left+width)),insetBottom=floor(root2.clientHeight-(top+height)),insetLeft=floor(left),options={rootMargin:-insetTop+"px "+-insetRight+"px "+-insetBottom+"px "+-insetLeft+"px",threshold:max$1(0,min$1(1,threshold))||1};let isFirstUpdate=!0;function handleObserve(entries){const ratio=entries[0].intersectionRatio;if(ratio!==threshold){if(!isFirstUpdate)return refresh();ratio?refresh(!1,ratio):timeoutId=setTimeout(()=>{refresh(!1,1e-7)},1e3)}ratio===1&&!rectsAreEqual(elementRectForRootMargin,element2.getBoundingClientRect())&&refresh(),isFirstUpdate=!1}__name(handleObserve,"handleObserve");try{io=new IntersectionObserver(handleObserve,{...options,root:root2.ownerDocument})}catch{io=new IntersectionObserver(handleObserve,options)}io.observe(element2)}return __name(refresh,"refresh"),refresh(!0),cleanup}__name(observeMove,"observeMove");function autoUpdate(reference,floating,update,options){options===void 0&&(options={});const{ancestorScroll=!0,ancestorResize=!0,elementResize=typeof ResizeObserver=="function",layoutShift=typeof IntersectionObserver=="function",animationFrame=!1}=options,referenceEl=unwrapElement(reference),ancestors=ancestorScroll||ancestorResize?[...referenceEl?getOverflowAncestors(referenceEl):[],...getOverflowAncestors(floating)]:[];ancestors.forEach(ancestor=>{ancestorScroll&&ancestor.addEventListener("scroll",update,{passive:!0}),ancestorResize&&ancestor.addEventListener("resize",update)});const cleanupIo=referenceEl&&layoutShift?observeMove(referenceEl,update):null;let reobserveFrame=-1,resizeObserver=null;elementResize&&(resizeObserver=new ResizeObserver(_ref=>{let[firstEntry]=_ref;firstEntry&&firstEntry.target===referenceEl&&resizeObserver&&(resizeObserver.unobserve(floating),cancelAnimationFrame(reobserveFrame),reobserveFrame=requestAnimationFrame(()=>{var _resizeObserver;(_resizeObserver=resizeObserver)==null||_resizeObserver.observe(floating)})),update()}),referenceEl&&!animationFrame&&resizeObserver.observe(referenceEl),resizeObserver.observe(floating));let frameId,prevRefRect=animationFrame?getBoundingClientRect(reference):null;animationFrame&&frameLoop();function frameLoop(){const nextRefRect=getBoundingClientRect(reference);prevRefRect&&!rectsAreEqual(prevRefRect,nextRefRect)&&update(),prevRefRect=nextRefRect,frameId=requestAnimationFrame(frameLoop)}return __name(frameLoop,"frameLoop"),update(),()=>{var _resizeObserver2;ancestors.forEach(ancestor=>{ancestorScroll&&ancestor.removeEventListener("scroll",update),ancestorResize&&ancestor.removeEventListener("resize",update)}),cleanupIo?.(),(_resizeObserver2=resizeObserver)==null||_resizeObserver2.disconnect(),resizeObserver=null,animationFrame&&cancelAnimationFrame(frameId)}}__name(autoUpdate,"autoUpdate");const offset$1=offset$2,shift$1=shift$2,flip$1=flip$2,size$1=size$2,hide$1=hide$2,arrow$2=arrow$3,limitShift$1=limitShift$2,computePosition=__name((reference,floating,options)=>{const cache2=new Map,mergedOptions={platform,...options},platformWithCache={...mergedOptions.platform,_c:cache2};return computePosition$1(reference,floating,{...mergedOptions,platform:platformWithCache})},"computePosition");var isClient=typeof document<"u",noop$1=__name(function(){},"noop"),index$4=isClient?reactExports.useLayoutEffect:noop$1;function deepEqual$1(a2,b){if(a2===b)return!0;if(typeof a2!=typeof b)return!1;if(typeof a2=="function"&&a2.toString()===b.toString())return!0;let length,i2,keys2;if(a2&&b&&typeof a2=="object"){if(Array.isArray(a2)){if(length=a2.length,length!==b.length)return!1;for(i2=length;i2--!==0;)if(!deepEqual$1(a2[i2],b[i2]))return!1;return!0}if(keys2=Object.keys(a2),length=keys2.length,length!==Object.keys(b).length)return!1;for(i2=length;i2--!==0;)if(!{}.hasOwnProperty.call(b,keys2[i2]))return!1;for(i2=length;i2--!==0;){const key=keys2[i2];if(!(key==="_owner"&&a2.$$typeof)&&!deepEqual$1(a2[key],b[key]))return!1}return!0}return a2!==a2&&b!==b}__name(deepEqual$1,"deepEqual$1");function getDPR(element2){return typeof window>"u"?1:(element2.ownerDocument.defaultView||window).devicePixelRatio||1}__name(getDPR,"getDPR");function roundByDPR(element2,value){const dpr=getDPR(element2);return Math.round(value*dpr)/dpr}__name(roundByDPR,"roundByDPR");function useLatestRef(value){const ref=reactExports.useRef(value);return index$4(()=>{ref.current=value}),ref}__name(useLatestRef,"useLatestRef");function useFloating(options){options===void 0&&(options={});const{placement="bottom",strategy="absolute",middleware=[],platform:platform2,elements:{reference:externalReference,floating:externalFloating}={},transform:transform2=!0,whileElementsMounted,open}=options,[data,setData]=reactExports.useState({x:0,y:0,strategy,placement,middlewareData:{},isPositioned:!1}),[latestMiddleware,setLatestMiddleware]=reactExports.useState(middleware);deepEqual$1(latestMiddleware,middleware)||setLatestMiddleware(middleware);const[_reference,_setReference]=reactExports.useState(null),[_floating,_setFloating]=reactExports.useState(null),setReference=reactExports.useCallback(node2=>{node2!==referenceRef.current&&(referenceRef.current=node2,_setReference(node2))},[]),setFloating=reactExports.useCallback(node2=>{node2!==floatingRef.current&&(floatingRef.current=node2,_setFloating(node2))},[]),referenceEl=externalReference||_reference,floatingEl=externalFloating||_floating,referenceRef=reactExports.useRef(null),floatingRef=reactExports.useRef(null),dataRef=reactExports.useRef(data),hasWhileElementsMounted=whileElementsMounted!=null,whileElementsMountedRef=useLatestRef(whileElementsMounted),platformRef=useLatestRef(platform2),openRef=useLatestRef(open),update=reactExports.useCallback(()=>{if(!referenceRef.current||!floatingRef.current)return;const config2={placement,strategy,middleware:latestMiddleware};platformRef.current&&(config2.platform=platformRef.current),computePosition(referenceRef.current,floatingRef.current,config2).then(data2=>{const fullData={...data2,isPositioned:openRef.current!==!1};isMountedRef.current&&!deepEqual$1(dataRef.current,fullData)&&(dataRef.current=fullData,reactDomExports.flushSync(()=>{setData(fullData)}))})},[latestMiddleware,placement,strategy,platformRef,openRef]);index$4(()=>{open===!1&&dataRef.current.isPositioned&&(dataRef.current.isPositioned=!1,setData(data2=>({...data2,isPositioned:!1})))},[open]);const isMountedRef=reactExports.useRef(!1);index$4(()=>(isMountedRef.current=!0,()=>{isMountedRef.current=!1}),[]),index$4(()=>{if(referenceEl&&(referenceRef.current=referenceEl),floatingEl&&(floatingRef.current=floatingEl),referenceEl&&floatingEl){if(whileElementsMountedRef.current)return whileElementsMountedRef.current(referenceEl,floatingEl,update);update()}},[referenceEl,floatingEl,update,whileElementsMountedRef,hasWhileElementsMounted]);const refs=reactExports.useMemo(()=>({reference:referenceRef,floating:floatingRef,setReference,setFloating}),[setReference,setFloating]),elements=reactExports.useMemo(()=>({reference:referenceEl,floating:floatingEl}),[referenceEl,floatingEl]),floatingStyles=reactExports.useMemo(()=>{const initialStyles={position:strategy,left:0,top:0};if(!elements.floating)return initialStyles;const x=roundByDPR(elements.floating,data.x),y=roundByDPR(elements.floating,data.y);return transform2?{...initialStyles,transform:"translate("+x+"px, "+y+"px)",...getDPR(elements.floating)>=1.5&&{willChange:"transform"}}:{position:strategy,left:x,top:y}},[strategy,transform2,elements.floating,data.x,data.y]);return reactExports.useMemo(()=>({...data,update,refs,elements,floatingStyles}),[data,update,refs,elements,floatingStyles])}__name(useFloating,"useFloating");const arrow$1=__name(options=>{function isRef(value){return{}.hasOwnProperty.call(value,"current")}return __name(isRef,"isRef"),{name:"arrow",options,fn(state2){const{element:element2,padding}=typeof options=="function"?options(state2):options;return element2&&isRef(element2)?element2.current!=null?arrow$2({element:element2.current,padding}).fn(state2):{}:element2?arrow$2({element:element2,padding}).fn(state2):{}}}},"arrow$1"),offset=__name((options,deps)=>({...offset$1(options),options:[options,deps]}),"offset"),shift=__name((options,deps)=>({...shift$1(options),options:[options,deps]}),"shift"),limitShift=__name((options,deps)=>({...limitShift$1(options),options:[options,deps]}),"limitShift"),flip=__name((options,deps)=>({...flip$1(options),options:[options,deps]}),"flip"),size=__name((options,deps)=>({...size$1(options),options:[options,deps]}),"size"),hide=__name((options,deps)=>({...hide$1(options),options:[options,deps]}),"hide"),arrow=__name((options,deps)=>({...arrow$1(options),options:[options,deps]}),"arrow");var NAME$3="Arrow",Arrow$1=reactExports.forwardRef((props,forwardedRef)=>{const{children,width=10,height=5,...arrowProps}=props;return jsxRuntimeExports.jsx(Primitive$1.svg,{...arrowProps,ref:forwardedRef,width,height,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:props.asChild?children:jsxRuntimeExports.jsx("polygon",{points:"0,0 30,0 15,10"})})});Arrow$1.displayName=NAME$3;var Root$7=Arrow$1;function useSize(element2){const[size2,setSize]=reactExports.useState(void 0);return useLayoutEffect2(()=>{if(element2){setSize({width:element2.offsetWidth,height:element2.offsetHeight});const resizeObserver=new ResizeObserver(entries=>{if(!Array.isArray(entries)||!entries.length)return;const entry=entries[0];let width,height;if("borderBoxSize"in entry){const borderSizeEntry=entry.borderBoxSize,borderSize=Array.isArray(borderSizeEntry)?borderSizeEntry[0]:borderSizeEntry;width=borderSize.inlineSize,height=borderSize.blockSize}else width=element2.offsetWidth,height=element2.offsetHeight;setSize({width,height})});return resizeObserver.observe(element2,{box:"border-box"}),()=>resizeObserver.unobserve(element2)}else setSize(void 0)},[element2]),size2}__name(useSize,"useSize");var POPPER_NAME="Popper",[createPopperContext,createPopperScope]=createContextScope(POPPER_NAME),[PopperProvider,usePopperContext]=createPopperContext(POPPER_NAME),Popper=__name(props=>{const{__scopePopper,children}=props,[anchor,setAnchor]=reactExports.useState(null);return jsxRuntimeExports.jsx(PopperProvider,{scope:__scopePopper,anchor,onAnchorChange:setAnchor,children})},"Popper");Popper.displayName=POPPER_NAME;var ANCHOR_NAME$1="PopperAnchor",PopperAnchor=reactExports.forwardRef((props,forwardedRef)=>{const{__scopePopper,virtualRef,...anchorProps}=props,context=usePopperContext(ANCHOR_NAME$1,__scopePopper),ref=reactExports.useRef(null),composedRefs=useComposedRefs(forwardedRef,ref),anchorRef=reactExports.useRef(null);return reactExports.useEffect(()=>{const previousAnchor=anchorRef.current;anchorRef.current=virtualRef?.current||ref.current,previousAnchor!==anchorRef.current&&context.onAnchorChange(anchorRef.current)}),virtualRef?null:jsxRuntimeExports.jsx(Primitive$1.div,{...anchorProps,ref:composedRefs})});PopperAnchor.displayName=ANCHOR_NAME$1;var CONTENT_NAME$6="PopperContent",[PopperContentProvider,useContentContext]=createPopperContext(CONTENT_NAME$6),PopperContent=reactExports.forwardRef((props,forwardedRef)=>{const{__scopePopper,side="bottom",sideOffset=0,align="center",alignOffset=0,arrowPadding=0,avoidCollisions=!0,collisionBoundary=[],collisionPadding:collisionPaddingProp=0,sticky="partial",hideWhenDetached=!1,updatePositionStrategy="optimized",onPlaced,...contentProps}=props,context=usePopperContext(CONTENT_NAME$6,__scopePopper),[content2,setContent]=reactExports.useState(null),composedRefs=useComposedRefs(forwardedRef,node2=>setContent(node2)),[arrow$12,setArrow]=reactExports.useState(null),arrowSize=useSize(arrow$12),arrowWidth=arrowSize?.width??0,arrowHeight=arrowSize?.height??0,desiredPlacement=side+(align!=="center"?"-"+align:""),collisionPadding=typeof collisionPaddingProp=="number"?collisionPaddingProp:{top:0,right:0,bottom:0,left:0,...collisionPaddingProp},boundary=Array.isArray(collisionBoundary)?collisionBoundary:[collisionBoundary],hasExplicitBoundaries=boundary.length>0,detectOverflowOptions={padding:collisionPadding,boundary:boundary.filter(isNotNull),altBoundary:hasExplicitBoundaries},{refs,floatingStyles,placement,isPositioned,middlewareData}=useFloating({strategy:"fixed",placement:desiredPlacement,whileElementsMounted:__name((...args)=>autoUpdate(...args,{animationFrame:updatePositionStrategy==="always"}),"whileElementsMounted"),elements:{reference:context.anchor},middleware:[offset({mainAxis:sideOffset+arrowHeight,alignmentAxis:alignOffset}),avoidCollisions&&shift({mainAxis:!0,crossAxis:!1,limiter:sticky==="partial"?limitShift():void 0,...detectOverflowOptions}),avoidCollisions&&flip({...detectOverflowOptions}),size({...detectOverflowOptions,apply:__name(({elements,rects,availableWidth,availableHeight})=>{const{width:anchorWidth,height:anchorHeight}=rects.reference,contentStyle=elements.floating.style;contentStyle.setProperty("--radix-popper-available-width",`${availableWidth}px`),contentStyle.setProperty("--radix-popper-available-height",`${availableHeight}px`),contentStyle.setProperty("--radix-popper-anchor-width",`${anchorWidth}px`),contentStyle.setProperty("--radix-popper-anchor-height",`${anchorHeight}px`)},"apply")}),arrow$12&&arrow({element:arrow$12,padding:arrowPadding}),transformOrigin({arrowWidth,arrowHeight}),hideWhenDetached&&hide({strategy:"referenceHidden",...detectOverflowOptions})]}),[placedSide,placedAlign]=getSideAndAlignFromPlacement(placement),handlePlaced=useCallbackRef$1(onPlaced);useLayoutEffect2(()=>{isPositioned&&handlePlaced?.()},[isPositioned,handlePlaced]);const arrowX=middlewareData.arrow?.x,arrowY=middlewareData.arrow?.y,cannotCenterArrow=middlewareData.arrow?.centerOffset!==0,[contentZIndex,setContentZIndex]=reactExports.useState();return useLayoutEffect2(()=>{content2&&setContentZIndex(window.getComputedStyle(content2).zIndex)},[content2]),jsxRuntimeExports.jsx("div",{ref:refs.setFloating,"data-radix-popper-content-wrapper":"",style:{...floatingStyles,transform:isPositioned?floatingStyles.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:contentZIndex,"--radix-popper-transform-origin":[middlewareData.transformOrigin?.x,middlewareData.transformOrigin?.y].join(" "),...middlewareData.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:props.dir,children:jsxRuntimeExports.jsx(PopperContentProvider,{scope:__scopePopper,placedSide,onArrowChange:setArrow,arrowX,arrowY,shouldHideArrow:cannotCenterArrow,children:jsxRuntimeExports.jsx(Primitive$1.div,{"data-side":placedSide,"data-align":placedAlign,...contentProps,ref:composedRefs,style:{...contentProps.style,animation:isPositioned?void 0:"none"}})})})});PopperContent.displayName=CONTENT_NAME$6;var ARROW_NAME$4="PopperArrow",OPPOSITE_SIDE={top:"bottom",right:"left",bottom:"top",left:"right"},PopperArrow=reactExports.forwardRef(__name(function(props,forwardedRef){const{__scopePopper,...arrowProps}=props,contentContext=useContentContext(ARROW_NAME$4,__scopePopper),baseSide=OPPOSITE_SIDE[contentContext.placedSide];return jsxRuntimeExports.jsx("span",{ref:contentContext.onArrowChange,style:{position:"absolute",left:contentContext.arrowX,top:contentContext.arrowY,[baseSide]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[contentContext.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[contentContext.placedSide],visibility:contentContext.shouldHideArrow?"hidden":void 0},children:jsxRuntimeExports.jsx(Root$7,{...arrowProps,ref:forwardedRef,style:{...arrowProps.style,display:"block"}})})},"PopperArrow2"));PopperArrow.displayName=ARROW_NAME$4;function isNotNull(value){return value!==null}__name(isNotNull,"isNotNull");var transformOrigin=__name(options=>({name:"transformOrigin",options,fn(data){const{placement,rects,middlewareData}=data,isArrowHidden=middlewareData.arrow?.centerOffset!==0,arrowWidth=isArrowHidden?0:options.arrowWidth,arrowHeight=isArrowHidden?0:options.arrowHeight,[placedSide,placedAlign]=getSideAndAlignFromPlacement(placement),noArrowAlign={start:"0%",center:"50%",end:"100%"}[placedAlign],arrowXCenter=(middlewareData.arrow?.x??0)+arrowWidth/2,arrowYCenter=(middlewareData.arrow?.y??0)+arrowHeight/2;let x="",y="";return placedSide==="bottom"?(x=isArrowHidden?noArrowAlign:`${arrowXCenter}px`,y=`${-arrowHeight}px`):placedSide==="top"?(x=isArrowHidden?noArrowAlign:`${arrowXCenter}px`,y=`${rects.floating.height+arrowHeight}px`):placedSide==="right"?(x=`${-arrowHeight}px`,y=isArrowHidden?noArrowAlign:`${arrowYCenter}px`):placedSide==="left"&&(x=`${rects.floating.width+arrowHeight}px`,y=isArrowHidden?noArrowAlign:`${arrowYCenter}px`),{data:{x,y}}}}),"transformOrigin");function getSideAndAlignFromPlacement(placement){const[side,align="center"]=placement.split("-");return[side,align]}__name(getSideAndAlignFromPlacement,"getSideAndAlignFromPlacement");var Root2$4=Popper,Anchor=PopperAnchor,Content$2=PopperContent,Arrow=PopperArrow,PORTAL_NAME$5="Portal",Portal$4=reactExports.forwardRef((props,forwardedRef)=>{const{container:containerProp,...portalProps}=props,[mounted,setMounted]=reactExports.useState(!1);useLayoutEffect2(()=>setMounted(!0),[]);const container=containerProp||mounted&&globalThis?.document?.body;return container?ye.createPortal(jsxRuntimeExports.jsx(Primitive$1.div,{...portalProps,ref:forwardedRef}),container):null});Portal$4.displayName=PORTAL_NAME$5;var[createTooltipContext]=createContextScope("Tooltip",[createPopperScope]),usePopperScope$2=createPopperScope(),PROVIDER_NAME="TooltipProvider",DEFAULT_DELAY_DURATION=700,TOOLTIP_OPEN="tooltip.open",[TooltipProviderContextProvider,useTooltipProviderContext]=createTooltipContext(PROVIDER_NAME),TooltipProvider$1=__name(props=>{const{__scopeTooltip,delayDuration=DEFAULT_DELAY_DURATION,skipDelayDuration=300,disableHoverableContent=!1,children}=props,isOpenDelayedRef=reactExports.useRef(!0),isPointerInTransitRef=reactExports.useRef(!1),skipDelayTimerRef=reactExports.useRef(0);return reactExports.useEffect(()=>{const skipDelayTimer=skipDelayTimerRef.current;return()=>window.clearTimeout(skipDelayTimer)},[]),jsxRuntimeExports.jsx(TooltipProviderContextProvider,{scope:__scopeTooltip,isOpenDelayedRef,delayDuration,onOpen:reactExports.useCallback(()=>{window.clearTimeout(skipDelayTimerRef.current),isOpenDelayedRef.current=!1},[]),onClose:reactExports.useCallback(()=>{window.clearTimeout(skipDelayTimerRef.current),skipDelayTimerRef.current=window.setTimeout(()=>isOpenDelayedRef.current=!0,skipDelayDuration)},[skipDelayDuration]),isPointerInTransitRef,onPointerInTransitChange:reactExports.useCallback(inTransit=>{isPointerInTransitRef.current=inTransit},[]),disableHoverableContent,children})},"TooltipProvider$1");TooltipProvider$1.displayName=PROVIDER_NAME;var TOOLTIP_NAME="Tooltip",[TooltipContextProvider,useTooltipContext]=createTooltipContext(TOOLTIP_NAME),Tooltip$1=__name(props=>{const{__scopeTooltip,children,open:openProp,defaultOpen,onOpenChange,disableHoverableContent:disableHoverableContentProp,delayDuration:delayDurationProp}=props,providerContext=useTooltipProviderContext(TOOLTIP_NAME,props.__scopeTooltip),popperScope=usePopperScope$2(__scopeTooltip),[trigger,setTrigger]=reactExports.useState(null),contentId=useId(),openTimerRef=reactExports.useRef(0),disableHoverableContent=disableHoverableContentProp??providerContext.disableHoverableContent,delayDuration=delayDurationProp??providerContext.delayDuration,wasOpenDelayedRef=reactExports.useRef(!1),[open,setOpen]=useControllableState({prop:openProp,defaultProp:defaultOpen??!1,onChange:__name(open2=>{open2?(providerContext.onOpen(),document.dispatchEvent(new CustomEvent(TOOLTIP_OPEN))):providerContext.onClose(),onOpenChange?.(open2)},"onChange"),caller:TOOLTIP_NAME}),stateAttribute=reactExports.useMemo(()=>open?wasOpenDelayedRef.current?"delayed-open":"instant-open":"closed",[open]),handleOpen=reactExports.useCallback(()=>{window.clearTimeout(openTimerRef.current),openTimerRef.current=0,wasOpenDelayedRef.current=!1,setOpen(!0)},[setOpen]),handleClose=reactExports.useCallback(()=>{window.clearTimeout(openTimerRef.current),openTimerRef.current=0,setOpen(!1)},[setOpen]),handleDelayedOpen=reactExports.useCallback(()=>{window.clearTimeout(openTimerRef.current),openTimerRef.current=window.setTimeout(()=>{wasOpenDelayedRef.current=!0,setOpen(!0),openTimerRef.current=0},delayDuration)},[delayDuration,setOpen]);return reactExports.useEffect(()=>()=>{openTimerRef.current&&(window.clearTimeout(openTimerRef.current),openTimerRef.current=0)},[]),jsxRuntimeExports.jsx(Root2$4,{...popperScope,children:jsxRuntimeExports.jsx(TooltipContextProvider,{scope:__scopeTooltip,contentId,open,stateAttribute,trigger,onTriggerChange:setTrigger,onTriggerEnter:reactExports.useCallback(()=>{providerContext.isOpenDelayedRef.current?handleDelayedOpen():handleOpen()},[providerContext.isOpenDelayedRef,handleDelayedOpen,handleOpen]),onTriggerLeave:reactExports.useCallback(()=>{disableHoverableContent?handleClose():(window.clearTimeout(openTimerRef.current),openTimerRef.current=0)},[handleClose,disableHoverableContent]),onOpen:handleOpen,onClose:handleClose,disableHoverableContent,children})})},"Tooltip$1");Tooltip$1.displayName=TOOLTIP_NAME;var TRIGGER_NAME$4="TooltipTrigger",TooltipTrigger$1=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeTooltip,...triggerProps}=props,context=useTooltipContext(TRIGGER_NAME$4,__scopeTooltip),providerContext=useTooltipProviderContext(TRIGGER_NAME$4,__scopeTooltip),popperScope=usePopperScope$2(__scopeTooltip),ref=reactExports.useRef(null),composedRefs=useComposedRefs(forwardedRef,ref,context.onTriggerChange),isPointerDownRef=reactExports.useRef(!1),hasPointerMoveOpenedRef=reactExports.useRef(!1),handlePointerUp=reactExports.useCallback(()=>isPointerDownRef.current=!1,[]);return reactExports.useEffect(()=>()=>document.removeEventListener("pointerup",handlePointerUp),[handlePointerUp]),jsxRuntimeExports.jsx(Anchor,{asChild:!0,...popperScope,children:jsxRuntimeExports.jsx(Primitive$1.button,{"aria-describedby":context.open?context.contentId:void 0,"data-state":context.stateAttribute,...triggerProps,ref:composedRefs,onPointerMove:composeEventHandlers$1(props.onPointerMove,event=>{event.pointerType!=="touch"&&!hasPointerMoveOpenedRef.current&&!providerContext.isPointerInTransitRef.current&&(context.onTriggerEnter(),hasPointerMoveOpenedRef.current=!0)}),onPointerLeave:composeEventHandlers$1(props.onPointerLeave,()=>{context.onTriggerLeave(),hasPointerMoveOpenedRef.current=!1}),onPointerDown:composeEventHandlers$1(props.onPointerDown,()=>{context.open&&context.onClose(),isPointerDownRef.current=!0,document.addEventListener("pointerup",handlePointerUp,{once:!0})}),onFocus:composeEventHandlers$1(props.onFocus,()=>{isPointerDownRef.current||context.onOpen()}),onBlur:composeEventHandlers$1(props.onBlur,context.onClose),onClick:composeEventHandlers$1(props.onClick,context.onClose)})})});TooltipTrigger$1.displayName=TRIGGER_NAME$4;var PORTAL_NAME$4="TooltipPortal",[PortalProvider$2,usePortalContext$2]=createTooltipContext(PORTAL_NAME$4,{forceMount:void 0}),TooltipPortal=__name(props=>{const{__scopeTooltip,forceMount,children,container}=props,context=useTooltipContext(PORTAL_NAME$4,__scopeTooltip);return jsxRuntimeExports.jsx(PortalProvider$2,{scope:__scopeTooltip,forceMount,children:jsxRuntimeExports.jsx(Presence,{present:forceMount||context.open,children:jsxRuntimeExports.jsx(Portal$4,{asChild:!0,container,children})})})},"TooltipPortal");TooltipPortal.displayName=PORTAL_NAME$4;var CONTENT_NAME$5="TooltipContent",TooltipContent$1=reactExports.forwardRef((props,forwardedRef)=>{const portalContext=usePortalContext$2(CONTENT_NAME$5,props.__scopeTooltip),{forceMount=portalContext.forceMount,side="top",...contentProps}=props,context=useTooltipContext(CONTENT_NAME$5,props.__scopeTooltip);return jsxRuntimeExports.jsx(Presence,{present:forceMount||context.open,children:context.disableHoverableContent?jsxRuntimeExports.jsx(TooltipContentImpl,{side,...contentProps,ref:forwardedRef}):jsxRuntimeExports.jsx(TooltipContentHoverable,{side,...contentProps,ref:forwardedRef})})}),TooltipContentHoverable=reactExports.forwardRef((props,forwardedRef)=>{const context=useTooltipContext(CONTENT_NAME$5,props.__scopeTooltip),providerContext=useTooltipProviderContext(CONTENT_NAME$5,props.__scopeTooltip),ref=reactExports.useRef(null),composedRefs=useComposedRefs(forwardedRef,ref),[pointerGraceArea,setPointerGraceArea]=reactExports.useState(null),{trigger,onClose}=context,content2=ref.current,{onPointerInTransitChange}=providerContext,handleRemoveGraceArea=reactExports.useCallback(()=>{setPointerGraceArea(null),onPointerInTransitChange(!1)},[onPointerInTransitChange]),handleCreateGraceArea=reactExports.useCallback((event,hoverTarget)=>{const currentTarget=event.currentTarget,exitPoint={x:event.clientX,y:event.clientY},exitSide=getExitSideFromRect(exitPoint,currentTarget.getBoundingClientRect()),paddedExitPoints=getPaddedExitPoints(exitPoint,exitSide),hoverTargetPoints=getPointsFromRect(hoverTarget.getBoundingClientRect()),graceArea=getHull([...paddedExitPoints,...hoverTargetPoints]);setPointerGraceArea(graceArea),onPointerInTransitChange(!0)},[onPointerInTransitChange]);return reactExports.useEffect(()=>()=>handleRemoveGraceArea(),[handleRemoveGraceArea]),reactExports.useEffect(()=>{if(trigger&&content2){const handleTriggerLeave=__name(event=>handleCreateGraceArea(event,content2),"handleTriggerLeave"),handleContentLeave=__name(event=>handleCreateGraceArea(event,trigger),"handleContentLeave");return trigger.addEventListener("pointerleave",handleTriggerLeave),content2.addEventListener("pointerleave",handleContentLeave),()=>{trigger.removeEventListener("pointerleave",handleTriggerLeave),content2.removeEventListener("pointerleave",handleContentLeave)}}},[trigger,content2,handleCreateGraceArea,handleRemoveGraceArea]),reactExports.useEffect(()=>{if(pointerGraceArea){const handleTrackPointerGrace=__name(event=>{const target=event.target,pointerPosition={x:event.clientX,y:event.clientY},hasEnteredTarget=trigger?.contains(target)||content2?.contains(target),isPointerOutsideGraceArea=!isPointInPolygon$1(pointerPosition,pointerGraceArea);hasEnteredTarget?handleRemoveGraceArea():isPointerOutsideGraceArea&&(handleRemoveGraceArea(),onClose())},"handleTrackPointerGrace");return document.addEventListener("pointermove",handleTrackPointerGrace),()=>document.removeEventListener("pointermove",handleTrackPointerGrace)}},[trigger,content2,pointerGraceArea,onClose,handleRemoveGraceArea]),jsxRuntimeExports.jsx(TooltipContentImpl,{...props,ref:composedRefs})}),[VisuallyHiddenContentContextProvider,useVisuallyHiddenContentContext]=createTooltipContext(TOOLTIP_NAME,{isInside:!1}),Slottable=createSlottable("TooltipContent"),TooltipContentImpl=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeTooltip,children,"aria-label":ariaLabel,onEscapeKeyDown,onPointerDownOutside,...contentProps}=props,context=useTooltipContext(CONTENT_NAME$5,__scopeTooltip),popperScope=usePopperScope$2(__scopeTooltip),{onClose}=context;return reactExports.useEffect(()=>(document.addEventListener(TOOLTIP_OPEN,onClose),()=>document.removeEventListener(TOOLTIP_OPEN,onClose)),[onClose]),reactExports.useEffect(()=>{if(context.trigger){const handleScroll2=__name(event=>{event.target?.contains(context.trigger)&&onClose()},"handleScroll");return window.addEventListener("scroll",handleScroll2,{capture:!0}),()=>window.removeEventListener("scroll",handleScroll2,{capture:!0})}},[context.trigger,onClose]),jsxRuntimeExports.jsx(DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown,onPointerDownOutside,onFocusOutside:__name(event=>event.preventDefault(),"onFocusOutside"),onDismiss:onClose,children:jsxRuntimeExports.jsxs(Content$2,{"data-state":context.stateAttribute,...popperScope,...contentProps,ref:forwardedRef,style:{...contentProps.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:[jsxRuntimeExports.jsx(Slottable,{children}),jsxRuntimeExports.jsx(VisuallyHiddenContentContextProvider,{scope:__scopeTooltip,isInside:!0,children:jsxRuntimeExports.jsx(Root$8,{id:context.contentId,role:"tooltip",children:ariaLabel||children})})]})})});TooltipContent$1.displayName=CONTENT_NAME$5;var ARROW_NAME$3="TooltipArrow",TooltipArrow=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeTooltip,...arrowProps}=props,popperScope=usePopperScope$2(__scopeTooltip);return useVisuallyHiddenContentContext(ARROW_NAME$3,__scopeTooltip).isInside?null:jsxRuntimeExports.jsx(Arrow,{...popperScope,...arrowProps,ref:forwardedRef})});TooltipArrow.displayName=ARROW_NAME$3;function getExitSideFromRect(point2,rect){const top=Math.abs(rect.top-point2.y),bottom=Math.abs(rect.bottom-point2.y),right=Math.abs(rect.right-point2.x),left=Math.abs(rect.left-point2.x);switch(Math.min(top,bottom,right,left)){case left:return"left";case right:return"right";case top:return"top";case bottom:return"bottom";default:throw new Error("unreachable")}}__name(getExitSideFromRect,"getExitSideFromRect");function getPaddedExitPoints(exitPoint,exitSide,padding=5){const paddedExitPoints=[];switch(exitSide){case"top":paddedExitPoints.push({x:exitPoint.x-padding,y:exitPoint.y+padding},{x:exitPoint.x+padding,y:exitPoint.y+padding});break;case"bottom":paddedExitPoints.push({x:exitPoint.x-padding,y:exitPoint.y-padding},{x:exitPoint.x+padding,y:exitPoint.y-padding});break;case"left":paddedExitPoints.push({x:exitPoint.x+padding,y:exitPoint.y-padding},{x:exitPoint.x+padding,y:exitPoint.y+padding});break;case"right":paddedExitPoints.push({x:exitPoint.x-padding,y:exitPoint.y-padding},{x:exitPoint.x-padding,y:exitPoint.y+padding});break}return paddedExitPoints}__name(getPaddedExitPoints,"getPaddedExitPoints");function getPointsFromRect(rect){const{top,right,bottom,left}=rect;return[{x:left,y:top},{x:right,y:top},{x:right,y:bottom},{x:left,y:bottom}]}__name(getPointsFromRect,"getPointsFromRect");function isPointInPolygon$1(point2,polygon){const{x,y}=point2;let inside=!1;for(let i2=0,j=polygon.length-1;i2<polygon.length;j=i2++){const ii=polygon[i2],jj=polygon[j],xi=ii.x,yi=ii.y,xj=jj.x,yj=jj.y;yi>y!=yj>y&&x<(xj-xi)*(y-yi)/(yj-yi)+xi&&(inside=!inside)}return inside}__name(isPointInPolygon$1,"isPointInPolygon$1");function getHull(points){const newPoints=points.slice();return newPoints.sort((a2,b)=>a2.x<b.x?-1:a2.x>b.x?1:a2.y<b.y?-1:a2.y>b.y?1:0),getHullPresorted(newPoints)}__name(getHull,"getHull");function getHullPresorted(points){if(points.length<=1)return points.slice();const upperHull=[];for(let i2=0;i2<points.length;i2++){const p=points[i2];for(;upperHull.length>=2;){const q2=upperHull[upperHull.length-1],r2=upperHull[upperHull.length-2];if((q2.x-r2.x)*(p.y-r2.y)>=(q2.y-r2.y)*(p.x-r2.x))upperHull.pop();else break}upperHull.push(p)}upperHull.pop();const lowerHull=[];for(let i2=points.length-1;i2>=0;i2--){const p=points[i2];for(;lowerHull.length>=2;){const q2=lowerHull[lowerHull.length-1],r2=lowerHull[lowerHull.length-2];if((q2.x-r2.x)*(p.y-r2.y)>=(q2.y-r2.y)*(p.x-r2.x))lowerHull.pop();else break}lowerHull.push(p)}return lowerHull.pop(),upperHull.length===1&&lowerHull.length===1&&upperHull[0].x===lowerHull[0].x&&upperHull[0].y===lowerHull[0].y?upperHull:upperHull.concat(lowerHull)}__name(getHullPresorted,"getHullPresorted");var Provider=TooltipProvider$1,Root3$1=Tooltip$1,Trigger$4=TooltipTrigger$1,Portal$3=TooltipPortal,Content2$3=TooltipContent$1,Arrow2$1=TooltipArrow;function TooltipProvider({delayDuration=0,...props}){return jsxRuntimeExports.jsx(Provider,{"data-slot":"tooltip-provider",delayDuration,...props})}__name(TooltipProvider,"TooltipProvider");function Tooltip({...props}){return jsxRuntimeExports.jsx(TooltipProvider,{children:jsxRuntimeExports.jsx(Root3$1,{"data-slot":"tooltip",...props})})}__name(Tooltip,"Tooltip");function TooltipTrigger({...props}){return jsxRuntimeExports.jsx(Trigger$4,{"data-slot":"tooltip-trigger",...props})}__name(TooltipTrigger,"TooltipTrigger");function TooltipContent({className,sideOffset=0,arrowClassName,children,...props}){return jsxRuntimeExports.jsx(Portal$3,{children:jsxRuntimeExports.jsxs(Content2$3,{"data-slot":"tooltip-content",sideOffset,className:cn$1("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",className),...props,children:[children,jsxRuntimeExports.jsx(Arrow2$1,{className:cn$1("bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",arrowClassName)})]})})}__name(TooltipContent,"TooltipContent");const capitalizedCache=new Map;function capitalizeWords(name2){if(!name2)return"";if(capitalizedCache.has(name2))return capitalizedCache.get(name2);const s2=name2.replace(/[-_]+/g," ").replace(/\s+/g," ").trim();if(!s2)return capitalizedCache.set(name2,""),"";const baseTokens=s2.match(/([A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+|[0-9]+)/g);if(!baseTokens)return capitalizedCache.set(name2,""),"";const tokens=[];for(let i2=0;i2<baseTokens.length;i2++){const token=baseTokens[i2],next2=i2+1<baseTokens.length?baseTokens[i2+1]:void 0;/^[A-Z]{2,}$/.test(token)&&next2&&/[A-Z]*s$/.test(next2)||/^[A-Z]$/.test(token)&&next2!==void 0&&/^[A-Z]s$/.test(next2)?(tokens.push(token+next2),i2++):tokens.push(token)}const result=tokens.map(capitalizeTokenWordsAppropriately).join(" ");return capitalizedCache.set(name2,result),result}__name(capitalizeWords,"capitalizeWords");function capitalizeTokenWordsAppropriately(t2){return/^[A-Z]{2,3}s?$/.test(t2)||/^[0-9]+$/.test(t2)?t2:t2.charAt(0).toUpperCase()+t2.slice(1).toLowerCase()}__name(capitalizeTokenWordsAppropriately,"capitalizeTokenWordsAppropriately");function Breadcrumbs({restartRequired}){const location2=useLocation(),{organization,instance,cluster}=useRouteContext({strict:!1}),targetNoun="Instance",breadcrumbs=reactExports.useMemo(()=>{const routeHistory=location2.pathname.split("/").filter(x=>x&&x.length>0),breadcrumbs2=[jsxRuntimeExports.jsxs(Link$2,{to:"/",children:[jsxRuntimeExports.jsx(House,{"aria-hidden":"true",className:"size-5 shrink-0"}),jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Home"})]},"home")];for(let index2=0;index2<routeHistory.length;index2++){const route=routeHistory[index2];if(route==="instance")continue;let path=`/${routeHistory.slice(0,index2+1).join("/")}`,name2=capitalizeWords(route),id2;route==="databases"&&routeHistory.length===index2+3?(name2=routeHistory[index2+2],index2+=2):name2.startsWith("Org ")?name2=organization?.name||"Org":name2.startsWith("Clu ")?(name2=cluster?.name||"Cluster",routeHistory[index2+1]==="instance"&&(path+="/instances")):name2.startsWith("Ins ")?name2=instance?.name?.split(".")?.shift()||"Instance":name2==="Apis"&&(name2="APIs"),breadcrumbs2.push(jsxRuntimeExports.jsx("svg",{fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true",className:"size-5 shrink-0 text-grey",children:jsxRuntimeExports.jsx("path",{d:"M5.555 17.776l8-16 .894.448-8 16-.894-.448z"})}),jsxRuntimeExports.jsxs(Link$2,{to:path,className:"text-xs md:text-sm font-medium hover:text-grey truncate max-w-48",children:[name2,id2]}))}return breadcrumbs2},[location2.pathname,cluster?.name,instance?.name,organization?.name]);return jsxRuntimeExports.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:[...breadcrumbs,restartRequired&&jsxRuntimeExports.jsxs(Tooltip,{children:[jsxRuntimeExports.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntimeExports.jsxs("div",{className:"text-xs italic text-muted-foreground",children:["* Restart ",jsxRuntimeExports.jsx("span",{className:"hidden lg:inline-block",children:"Requested"})]})}),jsxRuntimeExports.jsxs(TooltipContent,{side:"bottom",children:["This ",targetNoun," is requesting a restart, when convenient, to apply your latest changes.",jsxRuntimeExports.jsx("br",{}),"You can do this from the Apps or Config pages."]})]})]})}__name(Breadcrumbs,"Breadcrumbs");var isCheckBoxInput=__name(element2=>element2.type==="checkbox","isCheckBoxInput"),isDateObject=__name(value=>value instanceof Date,"isDateObject"),isNullOrUndefined=__name(value=>value==null,"isNullOrUndefined");const isObjectType=__name(value=>typeof value=="object","isObjectType");var isObject$4=__name(value=>!isNullOrUndefined(value)&&!Array.isArray(value)&&isObjectType(value)&&!isDateObject(value),"isObject$4"),getEventValue=__name(event=>isObject$4(event)&&event.target?isCheckBoxInput(event.target)?event.target.checked:event.target.value:event,"getEventValue"),getNodeParentName=__name(name2=>name2.substring(0,name2.search(/\.\d+(\.|$)/))||name2,"getNodeParentName"),isNameInFieldArray=__name((names,name2)=>names.has(getNodeParentName(name2)),"isNameInFieldArray"),isPlainObject$2=__name(tempObject=>{const prototypeCopy=tempObject.constructor&&tempObject.constructor.prototype;return isObject$4(prototypeCopy)&&prototypeCopy.hasOwnProperty("isPrototypeOf")},"isPlainObject$2"),isWeb=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function cloneObject(data){if(data instanceof Date)return new Date(data);const isFileListInstance=typeof FileList<"u"&&data instanceof FileList;if(isWeb&&(data instanceof Blob||isFileListInstance))return data;const isArray2=Array.isArray(data);if(!isArray2&&!(isObject$4(data)&&isPlainObject$2(data)))return data;const copy=isArray2?[]:Object.create(Object.getPrototypeOf(data));for(const key in data)Object.prototype.hasOwnProperty.call(data,key)&&(copy[key]=cloneObject(data[key]));return copy}__name(cloneObject,"cloneObject");var isKey=__name(value=>/^\w*$/.test(value),"isKey"),isUndefined=__name(val=>val===void 0,"isUndefined"),compact=__name(value=>Array.isArray(value)?value.filter(Boolean):[],"compact"),stringToPath=__name(input=>compact(input.replace(/["|']|\]/g,"").split(/\.|\[/)),"stringToPath"),get=__name((object2,path,defaultValue)=>{if(!path||!isObject$4(object2))return defaultValue;const result=(isKey(path)?[path]:stringToPath(path)).reduce((result2,key)=>isNullOrUndefined(result2)?result2:result2[key],object2);return isUndefined(result)||result===object2?isUndefined(object2[path])?defaultValue:object2[path]:result},"get"),isBoolean=__name(value=>typeof value=="boolean","isBoolean"),isFunction$2=__name(value=>typeof value=="function","isFunction$2"),set$1=__name((object2,path,value)=>{let index2=-1;const tempPath=isKey(path)?[path]:stringToPath(path),length=tempPath.length,lastIndex=length-1;for(;++index2<length;){const key=tempPath[index2];let newValue=value;if(index2!==lastIndex){const objValue=object2[key];newValue=isObject$4(objValue)||Array.isArray(objValue)?objValue:isNaN(+tempPath[index2+1])?{}:[]}if(key==="__proto__"||key==="constructor"||key==="prototype")return;object2[key]=newValue,object2=object2[key]}},"set$1");const EVENTS={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},VALIDATION_MODE={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},INPUT_VALIDATION_RULES={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},HookFormControlContext=React.createContext(null);HookFormControlContext.displayName="HookFormControlContext";const useFormControlContext=__name(()=>React.useContext(HookFormControlContext),"useFormControlContext");var getProxyFormState=__name((formState,control,localProxyFormState,isRoot=!0)=>{const result={defaultValues:control._defaultValues};for(const key in formState)Object.defineProperty(result,key,{get:__name(()=>{const _key=key;return control._proxyFormState[_key]!==VALIDATION_MODE.all&&(control._proxyFormState[_key]=!isRoot||VALIDATION_MODE.all),localProxyFormState&&(localProxyFormState[_key]=!0),formState[_key]},"get")});return result},"getProxyFormState");const useIsomorphicLayoutEffect$1=typeof window<"u"?React.useLayoutEffect:React.useEffect;function useFormState(props){const formControl=useFormControlContext(),{control=formControl,disabled,name:name2,exact}=props||{},[formState,updateFormState]=React.useState(control._formState),_localProxyFormState=React.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return useIsomorphicLayoutEffect$1(()=>control._subscribe({name:name2,formState:_localProxyFormState.current,exact,callback:__name(formState2=>{!disabled&&updateFormState({...control._formState,...formState2})},"callback")}),[name2,disabled,exact]),React.useEffect(()=>{_localProxyFormState.current.isValid&&control._setValid(!0)},[control]),React.useMemo(()=>getProxyFormState(formState,control,_localProxyFormState.current,!1),[formState,control])}__name(useFormState,"useFormState");var isString=__name(value=>typeof value=="string","isString"),generateWatchOutput=__name((names,_names,formValues,isGlobal,defaultValue)=>isString(names)?(isGlobal&&_names.watch.add(names),get(formValues,names,defaultValue)):Array.isArray(names)?names.map(fieldName=>(isGlobal&&_names.watch.add(fieldName),get(formValues,fieldName))):(isGlobal&&(_names.watchAll=!0),formValues),"generateWatchOutput"),isPrimitive=__name(value=>isNullOrUndefined(value)||!isObjectType(value),"isPrimitive");function deepEqual(object1,object2,_internal_visited=new WeakSet){if(isPrimitive(object1)||isPrimitive(object2))return Object.is(object1,object2);if(isDateObject(object1)&&isDateObject(object2))return Object.is(object1.getTime(),object2.getTime());const keys1=Object.keys(object1),keys2=Object.keys(object2);if(keys1.length!==keys2.length)return!1;if(_internal_visited.has(object1)||_internal_visited.has(object2))return!0;_internal_visited.add(object1),_internal_visited.add(object2);for(const key of keys1){const val1=object1[key];if(!keys2.includes(key))return!1;if(key!=="ref"){const val2=object2[key];if(isDateObject(val1)&&isDateObject(val2)||isObject$4(val1)&&isObject$4(val2)||Array.isArray(val1)&&Array.isArray(val2)?!deepEqual(val1,val2,_internal_visited):!Object.is(val1,val2))return!1}}return!0}__name(deepEqual,"deepEqual");function useWatch(props){const formControl=useFormControlContext(),{control=formControl,name:name2,defaultValue,disabled,exact,compute}=props||{},_defaultValue=React.useRef(defaultValue),_compute=React.useRef(compute),_computeFormValues=React.useRef(void 0),_prevControl=React.useRef(control),_prevName=React.useRef(name2);_compute.current=compute;const[value,updateValue]=React.useState(()=>{const defaultValue2=control._getWatch(name2,_defaultValue.current);return _compute.current?_compute.current(defaultValue2):defaultValue2}),getCurrentOutput=React.useCallback(values=>{const formValues=generateWatchOutput(name2,control._names,values||control._formValues,!1,_defaultValue.current);return _compute.current?_compute.current(formValues):formValues},[control._formValues,control._names,name2]),refreshValue=React.useCallback(values=>{if(!disabled){const formValues=generateWatchOutput(name2,control._names,values||control._formValues,!1,_defaultValue.current);if(_compute.current){const computedFormValues=_compute.current(formValues);deepEqual(computedFormValues,_computeFormValues.current)||(updateValue(computedFormValues),_computeFormValues.current=computedFormValues)}else updateValue(formValues)}},[control._formValues,control._names,disabled,name2]);useIsomorphicLayoutEffect$1(()=>((_prevControl.current!==control||!deepEqual(_prevName.current,name2))&&(_prevControl.current=control,_prevName.current=name2,refreshValue()),control._subscribe({name:name2,formState:{values:!0},exact,callback:__name(formState=>{refreshValue(formState.values)},"callback")})),[control,exact,name2,refreshValue]),React.useEffect(()=>control._removeUnmounted());const controlChanged=_prevControl.current!==control,prevName=_prevName.current,computedOutput=React.useMemo(()=>{if(disabled)return null;const nameChanged=!controlChanged&&!deepEqual(prevName,name2);return controlChanged||nameChanged?getCurrentOutput():null},[disabled,controlChanged,name2,prevName,getCurrentOutput]);return computedOutput!==null?computedOutput:value}__name(useWatch,"useWatch");function useController(props){const formControl=useFormControlContext(),{name:name2,disabled,control=formControl,shouldUnregister,defaultValue,exact=!0}=props,isArrayField=isNameInFieldArray(control._names.array,name2),defaultValueMemo=React.useMemo(()=>get(control._formValues,name2,get(control._defaultValues,name2,defaultValue)),[control,name2,defaultValue]),value=useWatch({control,name:name2,defaultValue:defaultValueMemo,exact}),formState=useFormState({control,name:name2,exact}),_props=React.useRef(props),_previousNameRef=React.useRef(void 0),_registerProps=React.useRef(control.register(name2,{...props.rules,value,...isBoolean(props.disabled)?{disabled:props.disabled}:{}}));_props.current=props;const fieldState=React.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:__name(()=>!!get(formState.errors,name2),"get")},isDirty:{enumerable:!0,get:__name(()=>!!get(formState.dirtyFields,name2),"get")},isTouched:{enumerable:!0,get:__name(()=>!!get(formState.touchedFields,name2),"get")},isValidating:{enumerable:!0,get:__name(()=>!!get(formState.validatingFields,name2),"get")},error:{enumerable:!0,get:__name(()=>get(formState.errors,name2),"get")}}),[formState,name2]),onChange=React.useCallback(event=>_registerProps.current.onChange({target:{value:getEventValue(event),name:name2},type:EVENTS.CHANGE}),[name2]),onBlur=React.useCallback(()=>_registerProps.current.onBlur({target:{value:get(control._formValues,name2),name:name2},type:EVENTS.BLUR}),[name2,control._formValues]),ref=React.useCallback(elm=>{const field2=get(control._fields,name2);field2&&field2._f&&elm&&(field2._f.ref={focus:__name(()=>isFunction$2(elm.focus)&&elm.focus(),"focus"),select:__name(()=>isFunction$2(elm.select)&&elm.select(),"select"),setCustomValidity:__name(message=>isFunction$2(elm.setCustomValidity)&&elm.setCustomValidity(message),"setCustomValidity"),reportValidity:__name(()=>isFunction$2(elm.reportValidity)&&elm.reportValidity(),"reportValidity")})},[control._fields,name2]),field=React.useMemo(()=>({name:name2,value,...isBoolean(disabled)||formState.disabled?{disabled:formState.disabled||disabled}:{},onChange,onBlur,ref}),[name2,disabled,formState.disabled,onChange,onBlur,ref,value]);return React.useEffect(()=>{const _shouldUnregisterField=control._options.shouldUnregister||shouldUnregister,previousName=_previousNameRef.current;previousName&&previousName!==name2&&!isArrayField&&control.unregister(previousName),control.register(name2,{..._props.current.rules,...isBoolean(_props.current.disabled)?{disabled:_props.current.disabled}:{}});const updateMounted=__name((name3,value2)=>{const field2=get(control._fields,name3);field2&&field2._f&&(field2._f.mount=value2)},"updateMounted");if(updateMounted(name2,!0),_shouldUnregisterField){const value2=cloneObject(get(control._options.defaultValues,name2,_props.current.defaultValue));set$1(control._defaultValues,name2,value2),isUndefined(get(control._formValues,name2))&&set$1(control._formValues,name2,value2)}return!isArrayField&&control.register(name2),_previousNameRef.current=name2,()=>{(isArrayField?_shouldUnregisterField&&!control._state.action:_shouldUnregisterField)?control.unregister(name2):updateMounted(name2,!1)}},[name2,control,isArrayField,shouldUnregister]),React.useEffect(()=>{control._setDisabledField({disabled,name:name2})},[disabled,name2,control]),React.useMemo(()=>({field,formState,fieldState}),[field,formState,fieldState])}__name(useController,"useController");const Controller=__name(props=>props.render(useController(props)),"Controller"),HookFormContext=React.createContext(null);HookFormContext.displayName="HookFormContext";const useFormContext=__name(()=>React.useContext(HookFormContext),"useFormContext"),FormProvider=__name(props=>{const{children,watch,getValues,getFieldState,setError,clearErrors,setValue,trigger,formState,resetField,reset,handleSubmit,unregister,control,register,setFocus,subscribe:subscribe2}=props;return React.createElement(HookFormContext.Provider,{value:React.useMemo(()=>({watch,getValues,getFieldState,setError,clearErrors,setValue,trigger,formState,resetField,reset,handleSubmit,unregister,control,register,setFocus,subscribe:subscribe2}),[clearErrors,control,formState,getFieldState,getValues,handleSubmit,register,reset,resetField,setError,setFocus,setValue,subscribe2,trigger,unregister,watch])},React.createElement(HookFormControlContext.Provider,{value:control},children))},"FormProvider");var appendErrors=__name((name2,validateAllFieldCriteria,errors,type,message)=>validateAllFieldCriteria?{...errors[name2],types:{...errors[name2]&&errors[name2].types?errors[name2].types:{},[type]:message||!0}}:{},"appendErrors"),convertToArrayPayload=__name(value=>Array.isArray(value)?value:[value],"convertToArrayPayload"),createSubject=__name(()=>{let _observers2=[];return{get observers(){return _observers2},next:__name(value=>{for(const observer2 of _observers2)observer2.next&&observer2.next(value)},"next"),subscribe:__name(observer2=>(_observers2.push(observer2),{unsubscribe:__name(()=>{_observers2=_observers2.filter(o2=>o2!==observer2)},"unsubscribe")}),"subscribe"),unsubscribe:__name(()=>{_observers2=[]},"unsubscribe")}},"createSubject");function extractFormValues(fieldsState,formValues){const values={};for(const key in fieldsState)if(fieldsState.hasOwnProperty(key)){const fieldState=fieldsState[key],fieldValue=formValues[key];if(fieldState&&isObject$4(fieldState)&&fieldValue){const nestedFieldsState=extractFormValues(fieldState,fieldValue);isObject$4(nestedFieldsState)&&(values[key]=nestedFieldsState)}else fieldsState[key]&&(values[key]=fieldValue)}return values}__name(extractFormValues,"extractFormValues");var isEmptyObject=__name(value=>isObject$4(value)&&!Object.keys(value).length,"isEmptyObject"),isFileInput=__name(element2=>element2.type==="file","isFileInput"),isHTMLElement=__name(value=>{if(!isWeb)return!1;const owner=value?value.ownerDocument:0;return value instanceof(owner&&owner.defaultView?owner.defaultView.HTMLElement:HTMLElement)},"isHTMLElement"),isMultipleSelect=__name(element2=>element2.type==="select-multiple","isMultipleSelect"),isRadioInput=__name(element2=>element2.type==="radio","isRadioInput"),isRadioOrCheckbox=__name(ref=>isRadioInput(ref)||isCheckBoxInput(ref),"isRadioOrCheckbox"),live=__name(ref=>isHTMLElement(ref)&&ref.isConnected,"live");function baseGet(object2,updatePath){const length=updatePath.slice(0,-1).length;let index2=0;for(;index2<length;)object2=isUndefined(object2)?index2++:object2[updatePath[index2++]];return object2}__name(baseGet,"baseGet");function isEmptyArray(obj){for(const key in obj)if(obj.hasOwnProperty(key)&&!isUndefined(obj[key]))return!1;return!0}__name(isEmptyArray,"isEmptyArray");function unset(object2,path){const paths=Array.isArray(path)?path:isKey(path)?[path]:stringToPath(path),childObject=paths.length===1?object2:baseGet(object2,paths),index2=paths.length-1,key=paths[index2];return childObject&&delete childObject[key],index2!==0&&(isObject$4(childObject)&&isEmptyObject(childObject)||Array.isArray(childObject)&&isEmptyArray(childObject))&&unset(object2,paths.slice(0,-1)),object2}__name(unset,"unset");var objectHasFunction=__name(data=>{for(const key in data)if(isFunction$2(data[key]))return!0;return!1},"objectHasFunction");function isTraversable(value){return Array.isArray(value)||isObject$4(value)&&!objectHasFunction(value)}__name(isTraversable,"isTraversable");function markFieldsDirty(data,fields={}){for(const key in data){const value=data[key];isTraversable(value)?(fields[key]=Array.isArray(value)?[]:{},markFieldsDirty(value,fields[key])):isUndefined(value)||(fields[key]=!0)}return fields}__name(markFieldsDirty,"markFieldsDirty");function getDirtyFields(data,formValues,dirtyFieldsFromValues){dirtyFieldsFromValues||(dirtyFieldsFromValues=markFieldsDirty(formValues));for(const key in data){const value=data[key];if(isTraversable(value))isUndefined(formValues)||isPrimitive(dirtyFieldsFromValues[key])?dirtyFieldsFromValues[key]=markFieldsDirty(value,Array.isArray(value)?[]:{}):getDirtyFields(value,isNullOrUndefined(formValues)?{}:formValues[key],dirtyFieldsFromValues[key]);else{const formValue=formValues[key];dirtyFieldsFromValues[key]=!deepEqual(value,formValue)}}return dirtyFieldsFromValues}__name(getDirtyFields,"getDirtyFields");const defaultResult={value:!1,isValid:!1},validResult={value:!0,isValid:!0};var getCheckboxValue=__name(options=>{if(Array.isArray(options)){if(options.length>1){const values=options.filter(option=>option&&option.checked&&!option.disabled).map(option=>option.value);return{value:values,isValid:!!values.length}}return options[0].checked&&!options[0].disabled?options[0].attributes&&!isUndefined(options[0].attributes.value)?isUndefined(options[0].value)||options[0].value===""?validResult:{value:options[0].value,isValid:!0}:validResult:defaultResult}return defaultResult},"getCheckboxValue"),getFieldValueAs=__name((value,{valueAsNumber,valueAsDate,setValueAs})=>isUndefined(value)?value:valueAsNumber?value===""?NaN:value&&+value:valueAsDate&&isString(value)?new Date(value):setValueAs?setValueAs(value):value,"getFieldValueAs");const defaultReturn={isValid:!1,value:null};var getRadioValue=__name(options=>Array.isArray(options)?options.reduce((previous2,option)=>option&&option.checked&&!option.disabled?{isValid:!0,value:option.value}:previous2,defaultReturn):defaultReturn,"getRadioValue");function getFieldValue(_f){const ref=_f.ref;return isFileInput(ref)?ref.files:isRadioInput(ref)?getRadioValue(_f.refs).value:isMultipleSelect(ref)?[...ref.selectedOptions].map(({value})=>value):isCheckBoxInput(ref)?getCheckboxValue(_f.refs).value:getFieldValueAs(isUndefined(ref.value)?_f.ref.value:ref.value,_f)}__name(getFieldValue,"getFieldValue");var getResolverOptions=__name((fieldsNames,_fields,criteriaMode,shouldUseNativeValidation)=>{const fields={};for(const name2 of fieldsNames){const field=get(_fields,name2);field&&set$1(fields,name2,field._f)}return{criteriaMode,names:[...fieldsNames],fields,shouldUseNativeValidation}},"getResolverOptions"),isRegex=__name(value=>value instanceof RegExp,"isRegex"),getRuleValue=__name(rule=>isUndefined(rule)?rule:isRegex(rule)?rule.source:isObject$4(rule)?isRegex(rule.value)?rule.value.source:rule.value:rule,"getRuleValue"),getValidationModes=__name(mode=>({isOnSubmit:!mode||mode===VALIDATION_MODE.onSubmit,isOnBlur:mode===VALIDATION_MODE.onBlur,isOnChange:mode===VALIDATION_MODE.onChange,isOnAll:mode===VALIDATION_MODE.all,isOnTouch:mode===VALIDATION_MODE.onTouched}),"getValidationModes");const ASYNC_FUNCTION="AsyncFunction";var hasPromiseValidation=__name(fieldReference=>!!fieldReference&&!!fieldReference.validate&&!!(isFunction$2(fieldReference.validate)&&fieldReference.validate.constructor.name===ASYNC_FUNCTION||isObject$4(fieldReference.validate)&&Object.values(fieldReference.validate).find(validateFunction=>validateFunction.constructor.name===ASYNC_FUNCTION)),"hasPromiseValidation"),hasValidation=__name(options=>options.mount&&(options.required||options.min||options.max||options.maxLength||options.minLength||options.pattern||options.validate),"hasValidation"),isWatched=__name((name2,_names,isBlurEvent)=>!isBlurEvent&&(_names.watchAll||_names.watch.has(name2)||[..._names.watch].some(watchName=>name2.startsWith(watchName)&&/^\.\w+/.test(name2.slice(watchName.length)))),"isWatched");const iterateFieldsByAction=__name((fields,action,fieldsNames,abortEarly)=>{for(const key of fieldsNames||Object.keys(fields)){const field=get(fields,key);if(field){const{_f,...currentField}=field;if(_f){if(_f.refs&&_f.refs[0]&&action(_f.refs[0],key)&&!abortEarly)return!0;if(_f.ref&&action(_f.ref,_f.name)&&!abortEarly)return!0;if(iterateFieldsByAction(currentField,action))break}else if(isObject$4(currentField)&&iterateFieldsByAction(currentField,action))break}}},"iterateFieldsByAction");function schemaErrorLookup(errors,_fields,name2){const error2=get(errors,name2);if(error2||isKey(name2))return{error:error2,name:name2};const names=name2.split(".");for(;names.length;){const fieldName=names.join("."),field=get(_fields,fieldName),foundError=get(errors,fieldName);if(field&&!Array.isArray(field)&&name2!==fieldName)return{name:name2};if(foundError&&foundError.type)return{name:fieldName,error:foundError};if(foundError&&foundError.root&&foundError.root.type)return{name:`${fieldName}.root`,error:foundError.root};names.pop()}return{name:name2}}__name(schemaErrorLookup,"schemaErrorLookup");var shouldRenderFormState=__name((formStateData,_proxyFormState,updateFormState,isRoot)=>{updateFormState(formStateData);const{name:name2,...formState}=formStateData;return isEmptyObject(formState)||Object.keys(formState).length>=Object.keys(_proxyFormState).length||Object.keys(formState).find(key=>_proxyFormState[key]===(!isRoot||VALIDATION_MODE.all))},"shouldRenderFormState"),shouldSubscribeByName=__name((name2,signalName,exact)=>!name2||!signalName||name2===signalName||convertToArrayPayload(name2).some(currentName=>currentName&&(exact?currentName===signalName:currentName.startsWith(signalName)||signalName.startsWith(currentName))),"shouldSubscribeByName"),skipValidation=__name((isBlurEvent,isTouched,isSubmitted,reValidateMode,mode)=>mode.isOnAll?!1:!isSubmitted&&mode.isOnTouch?!(isTouched||isBlurEvent):(isSubmitted?reValidateMode.isOnBlur:mode.isOnBlur)?!isBlurEvent:(isSubmitted?reValidateMode.isOnChange:mode.isOnChange)?isBlurEvent:!0,"skipValidation"),unsetEmptyArray=__name((ref,name2)=>!compact(get(ref,name2)).length&&unset(ref,name2),"unsetEmptyArray"),updateFieldArrayRootError=__name((errors,error2,name2)=>{const fieldArrayErrors=convertToArrayPayload(get(errors,name2));return set$1(fieldArrayErrors,"root",error2[name2]),set$1(errors,name2,fieldArrayErrors),errors},"updateFieldArrayRootError");function getValidateError(result,ref,type="validate"){if(isString(result)||Array.isArray(result)&&result.every(isString)||isBoolean(result)&&!result)return{type,message:isString(result)?result:"",ref}}__name(getValidateError,"getValidateError");var getValueAndMessage=__name(validationData=>isObject$4(validationData)&&!isRegex(validationData)?validationData:{value:validationData,message:""},"getValueAndMessage"),validateField=__name(async(field,disabledFieldNames,formValues,validateAllFieldCriteria,shouldUseNativeValidation,isFieldArray)=>{const{ref,refs,required:required2,maxLength,minLength,min:min2,max:max2,pattern,validate,name:name2,valueAsNumber,mount}=field._f,inputValue=get(formValues,name2);if(!mount||disabledFieldNames.has(name2))return{};const inputRef=refs?refs[0]:ref,setCustomValidity=__name(message=>{shouldUseNativeValidation&&inputRef.reportValidity&&(inputRef.setCustomValidity(isBoolean(message)?"":message||""),inputRef.reportValidity())},"setCustomValidity"),error2={},isRadio=isRadioInput(ref),isCheckBox=isCheckBoxInput(ref),isRadioOrCheckbox2=isRadio||isCheckBox,isEmpty2=(valueAsNumber||isFileInput(ref))&&isUndefined(ref.value)&&isUndefined(inputValue)||isHTMLElement(ref)&&ref.value===""||inputValue===""||Array.isArray(inputValue)&&!inputValue.length,appendErrorsCurry=appendErrors.bind(null,name2,validateAllFieldCriteria,error2),getMinMaxMessage=__name((exceedMax,maxLengthMessage,minLengthMessage,maxType=INPUT_VALIDATION_RULES.maxLength,minType=INPUT_VALIDATION_RULES.minLength)=>{const message=exceedMax?maxLengthMessage:minLengthMessage;error2[name2]={type:exceedMax?maxType:minType,message,ref,...appendErrorsCurry(exceedMax?maxType:minType,message)}},"getMinMaxMessage");if(isFieldArray?!Array.isArray(inputValue)||!inputValue.length:required2&&(!isRadioOrCheckbox2&&(isEmpty2||isNullOrUndefined(inputValue))||isBoolean(inputValue)&&!inputValue||isCheckBox&&!getCheckboxValue(refs).isValid||isRadio&&!getRadioValue(refs).isValid)){const{value,message}=isString(required2)?{value:!!required2,message:required2}:getValueAndMessage(required2);if(value&&(error2[name2]={type:INPUT_VALIDATION_RULES.required,message,ref:inputRef,...appendErrorsCurry(INPUT_VALIDATION_RULES.required,message)},!validateAllFieldCriteria))return setCustomValidity(message),error2}if(!isEmpty2&&(!isNullOrUndefined(min2)||!isNullOrUndefined(max2))){let exceedMax,exceedMin;const maxOutput=getValueAndMessage(max2),minOutput=getValueAndMessage(min2);if(!isNullOrUndefined(inputValue)&&!isNaN(inputValue)){const valueNumber=ref.valueAsNumber||inputValue&&+inputValue;isNullOrUndefined(maxOutput.value)||(exceedMax=valueNumber>maxOutput.value),isNullOrUndefined(minOutput.value)||(exceedMin=valueNumber<minOutput.value)}else{const valueDate=ref.valueAsDate||new Date(inputValue),convertTimeToDate=__name(time2=>new Date(new Date().toDateString()+" "+time2),"convertTimeToDate"),isTime=ref.type=="time",isWeek=ref.type=="week";isString(maxOutput.value)&&inputValue&&(exceedMax=isTime?convertTimeToDate(inputValue)>convertTimeToDate(maxOutput.value):isWeek?inputValue>maxOutput.value:valueDate>new Date(maxOutput.value)),isString(minOutput.value)&&inputValue&&(exceedMin=isTime?convertTimeToDate(inputValue)<convertTimeToDate(minOutput.value):isWeek?inputValue<minOutput.value:valueDate<new Date(minOutput.value))}if((exceedMax||exceedMin)&&(getMinMaxMessage(!!exceedMax,maxOutput.message,minOutput.message,INPUT_VALIDATION_RULES.max,INPUT_VALIDATION_RULES.min),!validateAllFieldCriteria))return setCustomValidity(error2[name2].message),error2}if((maxLength||minLength)&&!isEmpty2&&(isString(inputValue)||isFieldArray&&Array.isArray(inputValue))){const maxLengthOutput=getValueAndMessage(maxLength),minLengthOutput=getValueAndMessage(minLength),exceedMax=!isNullOrUndefined(maxLengthOutput.value)&&inputValue.length>+maxLengthOutput.value,exceedMin=!isNullOrUndefined(minLengthOutput.value)&&inputValue.length<+minLengthOutput.value;if((exceedMax||exceedMin)&&(getMinMaxMessage(exceedMax,maxLengthOutput.message,minLengthOutput.message),!validateAllFieldCriteria))return setCustomValidity(error2[name2].message),error2}if(pattern&&!isEmpty2&&isString(inputValue)){const{value:patternValue,message}=getValueAndMessage(pattern);if(isRegex(patternValue)&&!inputValue.match(patternValue)&&(error2[name2]={type:INPUT_VALIDATION_RULES.pattern,message,ref,...appendErrorsCurry(INPUT_VALIDATION_RULES.pattern,message)},!validateAllFieldCriteria))return setCustomValidity(message),error2}if(validate){if(isFunction$2(validate)){const result=await validate(inputValue,formValues),validateError=getValidateError(result,inputRef);if(validateError&&(error2[name2]={...validateError,...appendErrorsCurry(INPUT_VALIDATION_RULES.validate,validateError.message)},!validateAllFieldCriteria))return setCustomValidity(validateError.message),error2}else if(isObject$4(validate)){let validationResult={};for(const key in validate){if(!isEmptyObject(validationResult)&&!validateAllFieldCriteria)break;const validateError=getValidateError(await validate[key](inputValue,formValues),inputRef,key);validateError&&(validationResult={...validateError,...appendErrorsCurry(key,validateError.message)},setCustomValidity(validateError.message),validateAllFieldCriteria&&(error2[name2]=validationResult))}if(!isEmptyObject(validationResult)&&(error2[name2]={ref:inputRef,...validationResult},!validateAllFieldCriteria))return error2}}return setCustomValidity(!0),error2},"validateField");const defaultOptions={mode:VALIDATION_MODE.onSubmit,reValidateMode:VALIDATION_MODE.onChange,shouldFocusError:!0};function createFormControl(props={}){let _options={...defaultOptions,...props},_formState={submitCount:0,isDirty:!1,isReady:!1,isLoading:isFunction$2(_options.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:_options.errors||{},disabled:_options.disabled||!1},_fields={},_defaultValues=isObject$4(_options.defaultValues)||isObject$4(_options.values)?cloneObject(_options.defaultValues||_options.values)||{}:{},_formValues=_options.shouldUnregister?{}:cloneObject(_defaultValues),_state={action:!1,mount:!1,watch:!1,keepIsValid:!1},_names={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},delayErrorCallback,timer=0;const defaultProxyFormState={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},_proxyFormState={...defaultProxyFormState};let _proxySubscribeFormState={..._proxyFormState};const _subjects={array:createSubject(),state:createSubject()},shouldDisplayAllAssociatedErrors=_options.criteriaMode===VALIDATION_MODE.all,debounce=__name(callback=>wait=>{clearTimeout(timer),timer=setTimeout(callback,wait)},"debounce"),_setValid=__name(async shouldUpdateValid=>{if(!_state.keepIsValid&&!_options.disabled&&(_proxyFormState.isValid||_proxySubscribeFormState.isValid||shouldUpdateValid)){let isValid;_options.resolver?(isValid=isEmptyObject((await _runSchema()).errors),_updateIsValidating()):isValid=await executeBuiltInValidation(_fields,!0),isValid!==_formState.isValid&&_subjects.state.next({isValid})}},"_setValid"),_updateIsValidating=__name((names,isValidating)=>{!_options.disabled&&(_proxyFormState.isValidating||_proxyFormState.validatingFields||_proxySubscribeFormState.isValidating||_proxySubscribeFormState.validatingFields)&&((names||Array.from(_names.mount)).forEach(name2=>{name2&&(isValidating?set$1(_formState.validatingFields,name2,isValidating):unset(_formState.validatingFields,name2))}),_subjects.state.next({validatingFields:_formState.validatingFields,isValidating:!isEmptyObject(_formState.validatingFields)}))},"_updateIsValidating"),_setFieldArray=__name((name2,values=[],method,args,shouldSetValues=!0,shouldUpdateFieldsAndState=!0)=>{if(args&&method&&!_options.disabled){if(_state.action=!0,shouldUpdateFieldsAndState&&Array.isArray(get(_fields,name2))){const fieldValues=method(get(_fields,name2),args.argA,args.argB);shouldSetValues&&set$1(_fields,name2,fieldValues)}if(shouldUpdateFieldsAndState&&Array.isArray(get(_formState.errors,name2))){const errors=method(get(_formState.errors,name2),args.argA,args.argB);shouldSetValues&&set$1(_formState.errors,name2,errors),unsetEmptyArray(_formState.errors,name2)}if((_proxyFormState.touchedFields||_proxySubscribeFormState.touchedFields)&&shouldUpdateFieldsAndState&&Array.isArray(get(_formState.touchedFields,name2))){const touchedFields=method(get(_formState.touchedFields,name2),args.argA,args.argB);shouldSetValues&&set$1(_formState.touchedFields,name2,touchedFields)}(_proxyFormState.dirtyFields||_proxySubscribeFormState.dirtyFields)&&(_formState.dirtyFields=getDirtyFields(_defaultValues,_formValues)),_subjects.state.next({name:name2,isDirty:_getDirty(name2,values),dirtyFields:_formState.dirtyFields,errors:_formState.errors,isValid:_formState.isValid})}else set$1(_formValues,name2,values)},"_setFieldArray"),updateErrors=__name((name2,error2)=>{set$1(_formState.errors,name2,error2),_subjects.state.next({errors:_formState.errors})},"updateErrors"),_setErrors=__name(errors=>{_formState.errors=errors,_subjects.state.next({errors:_formState.errors,isValid:!1})},"_setErrors"),updateValidAndValue=__name((name2,shouldSkipSetValueAs,value,ref)=>{const field=get(_fields,name2);if(field){const defaultValue=get(_formValues,name2,isUndefined(value)?get(_defaultValues,name2):value);isUndefined(defaultValue)||ref&&ref.defaultChecked||shouldSkipSetValueAs?set$1(_formValues,name2,shouldSkipSetValueAs?defaultValue:getFieldValue(field._f)):setFieldValue(name2,defaultValue),_state.mount&&!_state.action&&_setValid()}},"updateValidAndValue"),updateTouchAndDirty=__name((name2,fieldValue,isBlurEvent,shouldDirty,shouldRender)=>{let shouldUpdateField=!1,isPreviousDirty=!1;const output={name:name2};if(!_options.disabled){if(!isBlurEvent||shouldDirty){(_proxyFormState.isDirty||_proxySubscribeFormState.isDirty)&&(isPreviousDirty=_formState.isDirty,_formState.isDirty=output.isDirty=_getDirty(),shouldUpdateField=isPreviousDirty!==output.isDirty);const isCurrentFieldPristine=deepEqual(get(_defaultValues,name2),fieldValue);isPreviousDirty=!!get(_formState.dirtyFields,name2),isCurrentFieldPristine?unset(_formState.dirtyFields,name2):set$1(_formState.dirtyFields,name2,!0),output.dirtyFields=_formState.dirtyFields,shouldUpdateField=shouldUpdateField||(_proxyFormState.dirtyFields||_proxySubscribeFormState.dirtyFields)&&isPreviousDirty!==!isCurrentFieldPristine}if(isBlurEvent){const isPreviousFieldTouched=get(_formState.touchedFields,name2);isPreviousFieldTouched||(set$1(_formState.touchedFields,name2,isBlurEvent),output.touchedFields=_formState.touchedFields,shouldUpdateField=shouldUpdateField||(_proxyFormState.touchedFields||_proxySubscribeFormState.touchedFields)&&isPreviousFieldTouched!==isBlurEvent)}shouldUpdateField&&shouldRender&&_subjects.state.next(output)}return shouldUpdateField?output:{}},"updateTouchAndDirty"),shouldRenderByError=__name((name2,isValid,error2,fieldState)=>{const previousFieldError=get(_formState.errors,name2),shouldUpdateValid=(_proxyFormState.isValid||_proxySubscribeFormState.isValid)&&isBoolean(isValid)&&_formState.isValid!==isValid;if(_options.delayError&&error2?(delayErrorCallback=debounce(()=>updateErrors(name2,error2)),delayErrorCallback(_options.delayError)):(clearTimeout(timer),delayErrorCallback=null,error2?set$1(_formState.errors,name2,error2):unset(_formState.errors,name2)),(error2?!deepEqual(previousFieldError,error2):previousFieldError)||!isEmptyObject(fieldState)||shouldUpdateValid){const updatedFormState={...fieldState,...shouldUpdateValid&&isBoolean(isValid)?{isValid}:{},errors:_formState.errors,name:name2};_formState={..._formState,...updatedFormState},_subjects.state.next(updatedFormState)}},"shouldRenderByError"),_runSchema=__name(async name2=>(_updateIsValidating(name2,!0),await _options.resolver(_formValues,_options.context,getResolverOptions(name2||_names.mount,_fields,_options.criteriaMode,_options.shouldUseNativeValidation))),"_runSchema"),executeSchemaAndUpdateState=__name(async names=>{const{errors}=await _runSchema(names);if(_updateIsValidating(names),names)for(const name2 of names){const error2=get(errors,name2);error2?set$1(_formState.errors,name2,error2):unset(_formState.errors,name2)}else _formState.errors=errors;return errors},"executeSchemaAndUpdateState"),executeBuiltInValidation=__name(async(fields,shouldOnlyCheckValid,context={valid:!0})=>{for(const name2 in fields){const field=fields[name2];if(field){const{_f,...fieldValue}=field;if(_f){const isFieldArrayRoot=_names.array.has(_f.name),isPromiseFunction=field._f&&hasPromiseValidation(field._f);isPromiseFunction&&_proxyFormState.validatingFields&&_updateIsValidating([_f.name],!0);const fieldError=await validateField(field,_names.disabled,_formValues,shouldDisplayAllAssociatedErrors,_options.shouldUseNativeValidation&&!shouldOnlyCheckValid,isFieldArrayRoot);if(isPromiseFunction&&_proxyFormState.validatingFields&&_updateIsValidating([_f.name]),fieldError[_f.name]&&(context.valid=!1,shouldOnlyCheckValid||props.shouldUseNativeValidation))break;!shouldOnlyCheckValid&&(get(fieldError,_f.name)?isFieldArrayRoot?updateFieldArrayRootError(_formState.errors,fieldError,_f.name):set$1(_formState.errors,_f.name,fieldError[_f.name]):unset(_formState.errors,_f.name))}!isEmptyObject(fieldValue)&&await executeBuiltInValidation(fieldValue,shouldOnlyCheckValid,context)}}return context.valid},"executeBuiltInValidation"),_removeUnmounted=__name(()=>{for(const name2 of _names.unMount){const field=get(_fields,name2);field&&(field._f.refs?field._f.refs.every(ref=>!live(ref)):!live(field._f.ref))&&unregister(name2)}_names.unMount=new Set},"_removeUnmounted"),_getDirty=__name((name2,data)=>!_options.disabled&&(name2&&data&&set$1(_formValues,name2,data),!deepEqual(getValues(),_defaultValues)),"_getDirty"),_getWatch=__name((names,defaultValue,isGlobal)=>generateWatchOutput(names,_names,{..._state.mount?_formValues:isUndefined(defaultValue)?_defaultValues:isString(names)?{[names]:defaultValue}:defaultValue},isGlobal,defaultValue),"_getWatch"),_getFieldArray=__name(name2=>compact(get(_state.mount?_formValues:_defaultValues,name2,_options.shouldUnregister?get(_defaultValues,name2,[]):[])),"_getFieldArray"),setFieldValue=__name((name2,value,options={})=>{const field=get(_fields,name2);let fieldValue=value;if(field){const fieldReference=field._f;fieldReference&&(!fieldReference.disabled&&set$1(_formValues,name2,getFieldValueAs(value,fieldReference)),fieldValue=isHTMLElement(fieldReference.ref)&&isNullOrUndefined(value)?"":value,isMultipleSelect(fieldReference.ref)?[...fieldReference.ref.options].forEach(optionRef=>optionRef.selected=fieldValue.includes(optionRef.value)):fieldReference.refs?isCheckBoxInput(fieldReference.ref)?fieldReference.refs.forEach(checkboxRef=>{(!checkboxRef.defaultChecked||!checkboxRef.disabled)&&(Array.isArray(fieldValue)?checkboxRef.checked=!!fieldValue.find(data=>data===checkboxRef.value):checkboxRef.checked=fieldValue===checkboxRef.value||!!fieldValue)}):fieldReference.refs.forEach(radioRef=>radioRef.checked=radioRef.value===fieldValue):isFileInput(fieldReference.ref)?fieldReference.ref.value="":(fieldReference.ref.value=fieldValue,fieldReference.ref.type||_subjects.state.next({name:name2,values:cloneObject(_formValues)})))}(options.shouldDirty||options.shouldTouch)&&updateTouchAndDirty(name2,fieldValue,options.shouldTouch,options.shouldDirty,!0),options.shouldValidate&&trigger(name2)},"setFieldValue"),setValues=__name((name2,value,options)=>{for(const fieldKey in value){if(!value.hasOwnProperty(fieldKey))return;const fieldValue=value[fieldKey],fieldName=name2+"."+fieldKey,field=get(_fields,fieldName);(_names.array.has(name2)||isObject$4(fieldValue)||field&&!field._f)&&!isDateObject(fieldValue)?setValues(fieldName,fieldValue,options):setFieldValue(fieldName,fieldValue,options)}},"setValues"),setValue=__name((name2,value,options={})=>{const field=get(_fields,name2),isFieldArray=_names.array.has(name2),cloneValue=cloneObject(value);set$1(_formValues,name2,cloneValue),isFieldArray?(_subjects.array.next({name:name2,values:cloneObject(_formValues)}),(_proxyFormState.isDirty||_proxyFormState.dirtyFields||_proxySubscribeFormState.isDirty||_proxySubscribeFormState.dirtyFields)&&options.shouldDirty&&_subjects.state.next({name:name2,dirtyFields:getDirtyFields(_defaultValues,_formValues),isDirty:_getDirty(name2,cloneValue)})):field&&!field._f&&!isNullOrUndefined(cloneValue)?setValues(name2,cloneValue,options):setFieldValue(name2,cloneValue,options),isWatched(name2,_names)?_subjects.state.next({..._formState,name:name2,values:cloneObject(_formValues)}):_subjects.state.next({name:_state.mount?name2:void 0,values:cloneObject(_formValues)})},"setValue"),onChange=__name(async event=>{_state.mount=!0;const target=event.target;let name2=target.name,isFieldValueUpdated=!0;const field=get(_fields,name2),_updateIsFieldValueUpdated=__name(fieldValue=>{isFieldValueUpdated=Number.isNaN(fieldValue)||isDateObject(fieldValue)&&isNaN(fieldValue.getTime())||deepEqual(fieldValue,get(_formValues,name2,fieldValue))},"_updateIsFieldValueUpdated"),validationModeBeforeSubmit=getValidationModes(_options.mode),validationModeAfterSubmit=getValidationModes(_options.reValidateMode);if(field){let error2,isValid;const fieldValue=target.type?getFieldValue(field._f):getEventValue(event),isBlurEvent=event.type===EVENTS.BLUR||event.type===EVENTS.FOCUS_OUT,shouldSkipValidation=!hasValidation(field._f)&&!_options.resolver&&!get(_formState.errors,name2)&&!field._f.deps||skipValidation(isBlurEvent,get(_formState.touchedFields,name2),_formState.isSubmitted,validationModeAfterSubmit,validationModeBeforeSubmit),watched=isWatched(name2,_names,isBlurEvent);set$1(_formValues,name2,fieldValue),isBlurEvent?(!target||!target.readOnly)&&(field._f.onBlur&&field._f.onBlur(event),delayErrorCallback&&delayErrorCallback(0)):field._f.onChange&&field._f.onChange(event);const fieldState=updateTouchAndDirty(name2,fieldValue,isBlurEvent),shouldRender=!isEmptyObject(fieldState)||watched;if(!isBlurEvent&&_subjects.state.next({name:name2,type:event.type,values:cloneObject(_formValues)}),shouldSkipValidation)return(_proxyFormState.isValid||_proxySubscribeFormState.isValid)&&(_options.mode==="onBlur"?isBlurEvent&&_setValid():isBlurEvent||_setValid()),shouldRender&&_subjects.state.next({name:name2,...watched?{}:fieldState});if(!isBlurEvent&&watched&&_subjects.state.next({..._formState}),_options.resolver){const{errors}=await _runSchema([name2]);if(_updateIsValidating([name2]),_updateIsFieldValueUpdated(fieldValue),isFieldValueUpdated){const previousErrorLookupResult=schemaErrorLookup(_formState.errors,_fields,name2),errorLookupResult=schemaErrorLookup(errors,_fields,previousErrorLookupResult.name||name2);error2=errorLookupResult.error,name2=errorLookupResult.name,isValid=isEmptyObject(errors)}}else _updateIsValidating([name2],!0),error2=(await validateField(field,_names.disabled,_formValues,shouldDisplayAllAssociatedErrors,_options.shouldUseNativeValidation))[name2],_updateIsValidating([name2]),_updateIsFieldValueUpdated(fieldValue),isFieldValueUpdated&&(error2?isValid=!1:(_proxyFormState.isValid||_proxySubscribeFormState.isValid)&&(isValid=await executeBuiltInValidation(_fields,!0)));isFieldValueUpdated&&(field._f.deps&&(!Array.isArray(field._f.deps)||field._f.deps.length>0)&&trigger(field._f.deps),shouldRenderByError(name2,isValid,error2,fieldState))}},"onChange"),_focusInput=__name((ref,key)=>{if(get(_formState.errors,key)&&ref.focus)return ref.focus(),1},"_focusInput"),trigger=__name(async(name2,options={})=>{let isValid,validationResult;const fieldNames=convertToArrayPayload(name2);if(_options.resolver){const errors=await executeSchemaAndUpdateState(isUndefined(name2)?name2:fieldNames);isValid=isEmptyObject(errors),validationResult=name2?!fieldNames.some(name3=>get(errors,name3)):isValid}else name2?(validationResult=(await Promise.all(fieldNames.map(async fieldName=>{const field=get(_fields,fieldName);return await executeBuiltInValidation(field&&field._f?{[fieldName]:field}:field)}))).every(Boolean),!(!validationResult&&!_formState.isValid)&&_setValid()):validationResult=isValid=await executeBuiltInValidation(_fields);return _subjects.state.next({...!isString(name2)||(_proxyFormState.isValid||_proxySubscribeFormState.isValid)&&isValid!==_formState.isValid?{}:{name:name2},..._options.resolver||!name2?{isValid}:{},errors:_formState.errors}),options.shouldFocus&&!validationResult&&iterateFieldsByAction(_fields,_focusInput,name2?fieldNames:_names.mount),validationResult},"trigger"),getValues=__name((fieldNames,config2)=>{let values={..._state.mount?_formValues:_defaultValues};return config2&&(values=extractFormValues(config2.dirtyFields?_formState.dirtyFields:_formState.touchedFields,values)),isUndefined(fieldNames)?values:isString(fieldNames)?get(values,fieldNames):fieldNames.map(name2=>get(values,name2))},"getValues"),getFieldState=__name((name2,formState)=>({invalid:!!get((formState||_formState).errors,name2),isDirty:!!get((formState||_formState).dirtyFields,name2),error:get((formState||_formState).errors,name2),isValidating:!!get(_formState.validatingFields,name2),isTouched:!!get((formState||_formState).touchedFields,name2)}),"getFieldState"),clearErrors=__name(name2=>{const names=name2?convertToArrayPayload(name2):void 0;names?.forEach(inputName=>unset(_formState.errors,inputName)),names?names.forEach(inputName=>{_subjects.state.next({name:inputName,errors:_formState.errors})}):_subjects.state.next({errors:{}})},"clearErrors"),setError=__name((name2,error2,options)=>{const ref=(get(_fields,name2,{_f:{}})._f||{}).ref,currentError=get(_formState.errors,name2)||{},{ref:currentRef,message,type,...restOfErrorTree}=currentError;set$1(_formState.errors,name2,{...restOfErrorTree,...error2,ref}),_subjects.state.next({name:name2,errors:_formState.errors,isValid:!1}),options&&options.shouldFocus&&ref&&ref.focus&&ref.focus()},"setError"),watch=__name((name2,defaultValue)=>isFunction$2(name2)?_subjects.state.subscribe({next:__name(payload=>"values"in payload&&name2(_getWatch(void 0,defaultValue),payload),"next")}):_getWatch(name2,defaultValue,!0),"watch"),_subscribe=__name(props2=>_subjects.state.subscribe({next:__name(formState=>{shouldSubscribeByName(props2.name,formState.name,props2.exact)&&shouldRenderFormState(formState,props2.formState||_proxyFormState,_setFormState,props2.reRenderRoot)&&props2.callback({values:{..._formValues},..._formState,...formState,defaultValues:_defaultValues})},"next")}).unsubscribe,"_subscribe"),subscribe2=__name(props2=>(_state.mount=!0,_proxySubscribeFormState={..._proxySubscribeFormState,...props2.formState},_subscribe({...props2,formState:{...defaultProxyFormState,...props2.formState}})),"subscribe"),unregister=__name((name2,options={})=>{for(const fieldName of name2?convertToArrayPayload(name2):_names.mount)_names.mount.delete(fieldName),_names.array.delete(fieldName),options.keepValue||(unset(_fields,fieldName),unset(_formValues,fieldName)),!options.keepError&&unset(_formState.errors,fieldName),!options.keepDirty&&unset(_formState.dirtyFields,fieldName),!options.keepTouched&&unset(_formState.touchedFields,fieldName),!options.keepIsValidating&&unset(_formState.validatingFields,fieldName),!_options.shouldUnregister&&!options.keepDefaultValue&&unset(_defaultValues,fieldName);_subjects.state.next({values:cloneObject(_formValues)}),_subjects.state.next({..._formState,...options.keepDirty?{isDirty:_getDirty()}:{}}),!options.keepIsValid&&_setValid()},"unregister"),_setDisabledField=__name(({disabled,name:name2})=>{if(isBoolean(disabled)&&_state.mount||disabled||_names.disabled.has(name2)){const disabledStateChanged=_names.disabled.has(name2)!==!!disabled;disabled?_names.disabled.add(name2):_names.disabled.delete(name2),disabledStateChanged&&_state.mount&&!_state.action&&_setValid()}},"_setDisabledField"),register=__name((name2,options={})=>{let field=get(_fields,name2);const disabledIsDefined=isBoolean(options.disabled)||isBoolean(_options.disabled);return set$1(_fields,name2,{...field||{},_f:{...field&&field._f?field._f:{ref:{name:name2}},name:name2,mount:!0,...options}}),_names.mount.add(name2),field?_setDisabledField({disabled:isBoolean(options.disabled)?options.disabled:_options.disabled,name:name2}):updateValidAndValue(name2,!0,options.value),{...disabledIsDefined?{disabled:options.disabled||_options.disabled}:{},..._options.progressive?{required:!!options.required,min:getRuleValue(options.min),max:getRuleValue(options.max),minLength:getRuleValue(options.minLength),maxLength:getRuleValue(options.maxLength),pattern:getRuleValue(options.pattern)}:{},name:name2,onChange,onBlur:onChange,ref:__name(ref=>{if(ref){register(name2,options),field=get(_fields,name2);const fieldRef=isUndefined(ref.value)&&ref.querySelectorAll&&ref.querySelectorAll("input,select,textarea")[0]||ref,radioOrCheckbox=isRadioOrCheckbox(fieldRef),refs=field._f.refs||[];if(radioOrCheckbox?refs.find(option=>option===fieldRef):fieldRef===field._f.ref)return;set$1(_fields,name2,{_f:{...field._f,...radioOrCheckbox?{refs:[...refs.filter(live),fieldRef,...Array.isArray(get(_defaultValues,name2))?[{}]:[]],ref:{type:fieldRef.type,name:name2}}:{ref:fieldRef}}}),updateValidAndValue(name2,!1,void 0,fieldRef)}else field=get(_fields,name2,{}),field._f&&(field._f.mount=!1),(_options.shouldUnregister||options.shouldUnregister)&&!(isNameInFieldArray(_names.array,name2)&&_state.action)&&_names.unMount.add(name2)},"ref")}},"register"),_focusError=__name(()=>_options.shouldFocusError&&iterateFieldsByAction(_fields,_focusInput,_names.mount),"_focusError"),_disableForm=__name(disabled=>{isBoolean(disabled)&&(_subjects.state.next({disabled}),iterateFieldsByAction(_fields,(ref,name2)=>{const currentField=get(_fields,name2);currentField&&(ref.disabled=currentField._f.disabled||disabled,Array.isArray(currentField._f.refs)&¤tField._f.refs.forEach(inputRef=>{inputRef.disabled=currentField._f.disabled||disabled}))},0,!1))},"_disableForm"),handleSubmit=__name((onValid,onInvalid)=>async e=>{let onValidError;e&&(e.preventDefault&&e.preventDefault(),e.persist&&e.persist());let fieldValues=cloneObject(_formValues);if(_subjects.state.next({isSubmitting:!0}),_options.resolver){const{errors,values}=await _runSchema();_updateIsValidating(),_formState.errors=errors,fieldValues=cloneObject(values)}else await executeBuiltInValidation(_fields);if(_names.disabled.size)for(const name2 of _names.disabled)unset(fieldValues,name2);if(unset(_formState.errors,"root"),isEmptyObject(_formState.errors)){_subjects.state.next({errors:{}});try{await onValid(fieldValues,e)}catch(error2){onValidError=error2}}else onInvalid&&await onInvalid({..._formState.errors},e),_focusError(),setTimeout(_focusError);if(_subjects.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:isEmptyObject(_formState.errors)&&!onValidError,submitCount:_formState.submitCount+1,errors:_formState.errors}),onValidError)throw onValidError},"handleSubmit"),resetField=__name((name2,options={})=>{get(_fields,name2)&&(isUndefined(options.defaultValue)?setValue(name2,cloneObject(get(_defaultValues,name2))):(setValue(name2,options.defaultValue),set$1(_defaultValues,name2,cloneObject(options.defaultValue))),options.keepTouched||unset(_formState.touchedFields,name2),options.keepDirty||(unset(_formState.dirtyFields,name2),_formState.isDirty=options.defaultValue?_getDirty(name2,cloneObject(get(_defaultValues,name2))):_getDirty()),options.keepError||(unset(_formState.errors,name2),_proxyFormState.isValid&&_setValid()),_subjects.state.next({..._formState}))},"resetField"),_reset=__name((formValues,keepStateOptions={})=>{const updatedValues=formValues?cloneObject(formValues):_defaultValues,cloneUpdatedValues=cloneObject(updatedValues),isEmptyResetValues=isEmptyObject(formValues),values=isEmptyResetValues?_defaultValues:cloneUpdatedValues;if(keepStateOptions.keepDefaultValues||(_defaultValues=updatedValues),!keepStateOptions.keepValues){if(keepStateOptions.keepDirtyValues){const fieldsToCheck=new Set([..._names.mount,...Object.keys(getDirtyFields(_defaultValues,_formValues))]);for(const fieldName of Array.from(fieldsToCheck)){const isDirty=get(_formState.dirtyFields,fieldName),existingValue=get(_formValues,fieldName),newValue=get(values,fieldName);isDirty&&!isUndefined(existingValue)?set$1(values,fieldName,existingValue):!isDirty&&!isUndefined(newValue)&&setValue(fieldName,newValue)}}else{if(isWeb&&isUndefined(formValues))for(const name2 of _names.mount){const field=get(_fields,name2);if(field&&field._f){const fieldReference=Array.isArray(field._f.refs)?field._f.refs[0]:field._f.ref;if(isHTMLElement(fieldReference)){const form=fieldReference.closest("form");if(form){form.reset();break}}}}if(keepStateOptions.keepFieldsRef)for(const fieldName of _names.mount)setValue(fieldName,get(values,fieldName));else _fields={}}_formValues=_options.shouldUnregister?keepStateOptions.keepDefaultValues?cloneObject(_defaultValues):{}:cloneObject(values),_subjects.array.next({values:{...values}}),_subjects.state.next({values:{...values}})}_names={mount:keepStateOptions.keepDirtyValues?_names.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},_state.mount=!_proxyFormState.isValid||!!keepStateOptions.keepIsValid||!!keepStateOptions.keepDirtyValues||!_options.shouldUnregister&&!isEmptyObject(values),_state.watch=!!_options.shouldUnregister,_state.keepIsValid=!!keepStateOptions.keepIsValid,_state.action=!1,keepStateOptions.keepErrors||(_formState.errors={}),_subjects.state.next({submitCount:keepStateOptions.keepSubmitCount?_formState.submitCount:0,isDirty:isEmptyResetValues?!1:keepStateOptions.keepDirty?_formState.isDirty:!!(keepStateOptions.keepDefaultValues&&!deepEqual(formValues,_defaultValues)),isSubmitted:keepStateOptions.keepIsSubmitted?_formState.isSubmitted:!1,dirtyFields:isEmptyResetValues?{}:keepStateOptions.keepDirtyValues?keepStateOptions.keepDefaultValues&&_formValues?getDirtyFields(_defaultValues,_formValues):_formState.dirtyFields:keepStateOptions.keepDefaultValues&&formValues?getDirtyFields(_defaultValues,formValues):keepStateOptions.keepDirty?_formState.dirtyFields:{},touchedFields:keepStateOptions.keepTouched?_formState.touchedFields:{},errors:keepStateOptions.keepErrors?_formState.errors:{},isSubmitSuccessful:keepStateOptions.keepIsSubmitSuccessful?_formState.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:_defaultValues})},"_reset"),reset=__name((formValues,keepStateOptions)=>_reset(isFunction$2(formValues)?formValues(_formValues):formValues,{..._options.resetOptions,...keepStateOptions}),"reset"),setFocus=__name((name2,options={})=>{const field=get(_fields,name2),fieldReference=field&&field._f;if(fieldReference){const fieldRef=fieldReference.refs?fieldReference.refs[0]:fieldReference.ref;fieldRef.focus&&setTimeout(()=>{fieldRef.focus(),options.shouldSelect&&isFunction$2(fieldRef.select)&&fieldRef.select()})}},"setFocus"),_setFormState=__name(updatedFormState=>{_formState={..._formState,...updatedFormState}},"_setFormState"),methods={control:{register,unregister,getFieldState,handleSubmit,setError,_subscribe,_runSchema,_updateIsValidating,_focusError,_getWatch,_getDirty,_setValid,_setFieldArray,_setDisabledField,_setErrors,_getFieldArray,_reset,_resetDefaultValues:__name(()=>isFunction$2(_options.defaultValues)&&_options.defaultValues().then(values=>{reset(values,_options.resetOptions),_subjects.state.next({isLoading:!1})}),"_resetDefaultValues"),_removeUnmounted,_disableForm,_subjects,_proxyFormState,get _fields(){return _fields},get _formValues(){return _formValues},get _state(){return _state},set _state(value){_state=value},get _defaultValues(){return _defaultValues},get _names(){return _names},set _names(value){_names=value},get _formState(){return _formState},get _options(){return _options},set _options(value){_options={..._options,...value}}},subscribe:subscribe2,trigger,register,handleSubmit,watch,setValue,getValues,reset,resetField,clearErrors,unregister,setError,setFocus,getFieldState};return{...methods,formControl:methods}}__name(createFormControl,"createFormControl");var generateId=__name(()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const d=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,c=>{const r2=(Math.random()*16+d)%16|0;return(c=="x"?r2:r2&3|8).toString(16)})},"generateId"),getFocusFieldName=__name((name2,index2,options={})=>options.shouldFocus||isUndefined(options.shouldFocus)?options.focusName||`${name2}.${isUndefined(options.focusIndex)?index2:options.focusIndex}.`:"","getFocusFieldName"),appendAt=__name((data,value)=>[...data,...convertToArrayPayload(value)],"appendAt"),fillEmptyArray=__name(value=>Array.isArray(value)?value.map(()=>{}):void 0,"fillEmptyArray");function insert(data,index2,value){return[...data.slice(0,index2),...convertToArrayPayload(value),...data.slice(index2)]}__name(insert,"insert");var moveArrayAt=__name((data,from,to)=>Array.isArray(data)?(isUndefined(data[to])&&(data[to]=void 0),data.splice(to,0,data.splice(from,1)[0]),data):[],"moveArrayAt"),prependAt=__name((data,value)=>[...convertToArrayPayload(value),...convertToArrayPayload(data)],"prependAt");function removeAtIndexes(data,indexes){let i2=0;const temp=[...data];for(const index2 of indexes)temp.splice(index2-i2,1),i2++;return compact(temp).length?temp:[]}__name(removeAtIndexes,"removeAtIndexes");var removeArrayAt=__name((data,index2)=>isUndefined(index2)?[]:removeAtIndexes(data,convertToArrayPayload(index2).sort((a2,b)=>a2-b)),"removeArrayAt"),swapArrayAt=__name((data,indexA,indexB)=>{[data[indexA],data[indexB]]=[data[indexB],data[indexA]]},"swapArrayAt"),updateAt=__name((fieldValues,index2,value)=>(fieldValues[index2]=value,fieldValues),"updateAt");function useFieldArray(props){const formControl=useFormControlContext(),{control=formControl,name:name2,keyName="id",shouldUnregister,rules}=props,[fields,setFields]=React.useState(control._getFieldArray(name2)),ids=React.useRef(control._getFieldArray(name2).map(generateId)),_actioned=React.useRef(!1);control._names.array.add(name2),React.useMemo(()=>rules&&fields.length>=0&&control.register(name2,rules),[control,name2,fields.length,rules]),useIsomorphicLayoutEffect$1(()=>control._subjects.array.subscribe({next:__name(({values,name:fieldArrayName})=>{if(fieldArrayName===name2||!fieldArrayName){const fieldValues=get(values,name2);Array.isArray(fieldValues)&&(setFields(fieldValues),ids.current=fieldValues.map(generateId))}},"next")}).unsubscribe,[control,name2]);const updateValues=React.useCallback(updatedFieldArrayValues=>{_actioned.current=!0,control._setFieldArray(name2,updatedFieldArrayValues)},[control,name2]),append2=__name((value,options)=>{const appendValue=convertToArrayPayload(cloneObject(value)),updatedFieldArrayValues=appendAt(control._getFieldArray(name2),appendValue);control._names.focus=getFocusFieldName(name2,updatedFieldArrayValues.length-1,options),ids.current=appendAt(ids.current,appendValue.map(generateId)),updateValues(updatedFieldArrayValues),setFields(updatedFieldArrayValues),control._setFieldArray(name2,updatedFieldArrayValues,appendAt,{argA:fillEmptyArray(value)})},"append"),prepend=__name((value,options)=>{const prependValue=convertToArrayPayload(cloneObject(value)),updatedFieldArrayValues=prependAt(control._getFieldArray(name2),prependValue);control._names.focus=getFocusFieldName(name2,0,options),ids.current=prependAt(ids.current,prependValue.map(generateId)),updateValues(updatedFieldArrayValues),setFields(updatedFieldArrayValues),control._setFieldArray(name2,updatedFieldArrayValues,prependAt,{argA:fillEmptyArray(value)})},"prepend"),remove=__name(index2=>{const updatedFieldArrayValues=removeArrayAt(control._getFieldArray(name2),index2);ids.current=removeArrayAt(ids.current,index2),updateValues(updatedFieldArrayValues),setFields(updatedFieldArrayValues),!Array.isArray(get(control._fields,name2))&&set$1(control._fields,name2,void 0),control._setFieldArray(name2,updatedFieldArrayValues,removeArrayAt,{argA:index2})},"remove"),insert$1=__name((index2,value,options)=>{const insertValue=convertToArrayPayload(cloneObject(value)),updatedFieldArrayValues=insert(control._getFieldArray(name2),index2,insertValue);control._names.focus=getFocusFieldName(name2,index2,options),ids.current=insert(ids.current,index2,insertValue.map(generateId)),updateValues(updatedFieldArrayValues),setFields(updatedFieldArrayValues),control._setFieldArray(name2,updatedFieldArrayValues,insert,{argA:index2,argB:fillEmptyArray(value)})},"insert$1"),swap=__name((indexA,indexB)=>{const updatedFieldArrayValues=control._getFieldArray(name2);swapArrayAt(updatedFieldArrayValues,indexA,indexB),swapArrayAt(ids.current,indexA,indexB),updateValues(updatedFieldArrayValues),setFields(updatedFieldArrayValues),control._setFieldArray(name2,updatedFieldArrayValues,swapArrayAt,{argA:indexA,argB:indexB},!1)},"swap"),move=__name((from,to)=>{const updatedFieldArrayValues=control._getFieldArray(name2);moveArrayAt(updatedFieldArrayValues,from,to),moveArrayAt(ids.current,from,to),updateValues(updatedFieldArrayValues),setFields(updatedFieldArrayValues),control._setFieldArray(name2,updatedFieldArrayValues,moveArrayAt,{argA:from,argB:to},!1)},"move"),update=__name((index2,value)=>{const updateValue=cloneObject(value),updatedFieldArrayValues=updateAt(control._getFieldArray(name2),index2,updateValue);ids.current=[...updatedFieldArrayValues].map((item,i2)=>!item||i2===index2?generateId():ids.current[i2]),updateValues(updatedFieldArrayValues),setFields([...updatedFieldArrayValues]),control._setFieldArray(name2,updatedFieldArrayValues,updateAt,{argA:index2,argB:updateValue},!0,!1)},"update"),replace=__name(value=>{const updatedFieldArrayValues=convertToArrayPayload(cloneObject(value));ids.current=updatedFieldArrayValues.map(generateId),updateValues([...updatedFieldArrayValues]),setFields([...updatedFieldArrayValues]),control._setFieldArray(name2,[...updatedFieldArrayValues],data=>data,{},!0,!1)},"replace");return React.useEffect(()=>{if(control._state.action=!1,isWatched(name2,control._names)&&control._subjects.state.next({...control._formState}),_actioned.current&&(!getValidationModes(control._options.mode).isOnSubmit||control._formState.isSubmitted)&&!getValidationModes(control._options.reValidateMode).isOnSubmit)if(control._options.resolver)control._runSchema([name2]).then(result=>{control._updateIsValidating([name2]);const error2=get(result.errors,name2),existingError=get(control._formState.errors,name2);(existingError?!error2&&existingError.type||error2&&(existingError.type!==error2.type||existingError.message!==error2.message):error2&&error2.type)&&(error2?set$1(control._formState.errors,name2,error2):unset(control._formState.errors,name2),control._subjects.state.next({errors:control._formState.errors}))});else{const field=get(control._fields,name2);field&&field._f&&!(getValidationModes(control._options.reValidateMode).isOnSubmit&&getValidationModes(control._options.mode).isOnSubmit)&&validateField(field,control._names.disabled,control._formValues,control._options.criteriaMode===VALIDATION_MODE.all,control._options.shouldUseNativeValidation,!0).then(error2=>!isEmptyObject(error2)&&control._subjects.state.next({errors:updateFieldArrayRootError(control._formState.errors,error2,name2)}))}control._subjects.state.next({name:name2,values:cloneObject(control._formValues)}),control._names.focus&&iterateFieldsByAction(control._fields,(ref,key)=>{if(control._names.focus&&key.startsWith(control._names.focus)&&ref.focus)return ref.focus(),1}),control._names.focus="",control._setValid(),_actioned.current=!1},[fields,name2,control]),React.useEffect(()=>(!get(control._formValues,name2)&&control._setFieldArray(name2),()=>{const updateMounted=__name((name3,value)=>{const field=get(control._fields,name3);field&&field._f&&(field._f.mount=value)},"updateMounted");control._options.shouldUnregister||shouldUnregister?control.unregister(name2):updateMounted(name2,!1)}),[name2,control,keyName,shouldUnregister]),{swap:React.useCallback(swap,[updateValues,name2,control]),move:React.useCallback(move,[updateValues,name2,control]),prepend:React.useCallback(prepend,[updateValues,name2,control]),append:React.useCallback(append2,[updateValues,name2,control]),remove:React.useCallback(remove,[updateValues,name2,control]),insert:React.useCallback(insert$1,[updateValues,name2,control]),update:React.useCallback(update,[updateValues,name2,control]),replace:React.useCallback(replace,[updateValues,name2,control]),fields:React.useMemo(()=>fields.map((field,index2)=>({...field,[keyName]:ids.current[index2]||generateId()})),[fields,keyName])}}__name(useFieldArray,"useFieldArray");function useForm(props={}){const _formControl=React.useRef(void 0),_values=React.useRef(void 0),[formState,updateFormState]=React.useState({isDirty:!1,isValidating:!1,isLoading:isFunction$2(props.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:props.errors||{},disabled:props.disabled||!1,isReady:!1,defaultValues:isFunction$2(props.defaultValues)?void 0:props.defaultValues});if(!_formControl.current)if(props.formControl)_formControl.current={...props.formControl,formState},props.defaultValues&&!isFunction$2(props.defaultValues)&&props.formControl.reset(props.defaultValues,props.resetOptions);else{const{formControl,...rest}=createFormControl(props);_formControl.current={...rest,formState}}const control=_formControl.current.control;return control._options=props,useIsomorphicLayoutEffect$1(()=>{const sub=control._subscribe({formState:control._proxyFormState,callback:__name(()=>updateFormState({...control._formState}),"callback"),reRenderRoot:!0});return updateFormState(data=>({...data,isReady:!0})),control._formState.isReady=!0,sub},[control]),React.useEffect(()=>control._disableForm(props.disabled),[control,props.disabled]),React.useEffect(()=>{props.mode&&(control._options.mode=props.mode),props.reValidateMode&&(control._options.reValidateMode=props.reValidateMode)},[control,props.mode,props.reValidateMode]),React.useEffect(()=>{props.errors&&(control._setErrors(props.errors),control._focusError())},[control,props.errors]),React.useEffect(()=>{props.shouldUnregister&&control._subjects.state.next({values:control._getWatch()})},[control,props.shouldUnregister]),React.useEffect(()=>{if(control._proxyFormState.isDirty){const isDirty=control._getDirty();isDirty!==formState.isDirty&&control._subjects.state.next({isDirty})}},[control,formState.isDirty]),React.useEffect(()=>{var _a20;props.values&&!deepEqual(props.values,_values.current)?(control._reset(props.values,{keepFieldsRef:!0,...control._options.resetOptions}),!((_a20=control._options.resetOptions)===null||_a20===void 0)&&_a20.keepIsValid||control._setValid(),_values.current=props.values,updateFormState(state2=>({...state2}))):control._resetDefaultValues()},[control,props.values]),React.useEffect(()=>{control._state.mount||(control._setValid(),control._state.mount=!0),control._state.watch&&(control._state.watch=!1,control._subjects.state.next({...control._formState})),control._removeUnmounted()}),_formControl.current.formState=React.useMemo(()=>getProxyFormState(formState,control),[control,formState]),_formControl.current}__name(useForm,"useForm");const Form=FormProvider,FormFieldContext=reactExports.createContext({}),FormItemContext=reactExports.createContext({});function useFormField(){const fieldContext=reactExports.useContext(FormFieldContext),itemContext=reactExports.useContext(FormItemContext),{getFieldState}=useFormContext(),formState=useFormState({name:fieldContext.name}),fieldState=getFieldState(fieldContext.name,formState);if(!fieldContext)throw new Error("useFormField should be used within <FormField>");const{id:id2}=itemContext;return{id:id2,name:fieldContext.name,formItemId:`${id2}-form-item`,formDescriptionId:`${id2}-form-item-description`,formMessageId:`${id2}-form-item-message`,...fieldState}}__name(useFormField,"useFormField");function FormControl({...props}){const{error:error2,formItemId,formDescriptionId,formMessageId}=useFormField();return jsxRuntimeExports.jsx(Slot$3,{"data-slot":"form-control",id:formItemId,"aria-describedby":error2?`${formDescriptionId} ${formMessageId}`:`${formDescriptionId}`,"aria-invalid":!!error2,...props})}__name(FormControl,"FormControl");function FormField({...props}){return jsxRuntimeExports.jsx(FormFieldContext,{value:{name:props.name},children:jsxRuntimeExports.jsx(Controller,{...props})})}__name(FormField,"FormField");function FormItem({className,...props}){const id2=reactExports.useId();return jsxRuntimeExports.jsx(FormItemContext,{value:{id:id2},children:jsxRuntimeExports.jsx("div",{"data-slot":"form-item",className:cn$1("grid gap-2",className),...props})})}__name(FormItem,"FormItem");var NODES=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive=NODES.reduce((primitive,node2)=>{const Slot2=createSlot$1(`Primitive.${node2}`),Node2=reactExports.forwardRef((props,forwardedRef)=>{const{asChild,...primitiveProps}=props,Comp=asChild?Slot2:node2;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(Comp,{...primitiveProps,ref:forwardedRef})});return Node2.displayName=`Primitive.${node2}`,{...primitive,[node2]:Node2}},{}),NAME$2="Label",Label$3=reactExports.forwardRef((props,forwardedRef)=>jsxRuntimeExports.jsx(Primitive.label,{...props,ref:forwardedRef,onMouseDown:__name(event=>{event.target.closest("button, input, select, textarea")||(props.onMouseDown?.(event),!event.defaultPrevented&&event.detail>1&&event.preventDefault())},"onMouseDown")}));Label$3.displayName=NAME$2;var Root$6=Label$3;function Label$2({className,...props}){return jsxRuntimeExports.jsx(Root$6,{"data-slot":"label",className:cn$1("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",className),...props})}__name(Label$2,"Label$2");function FormLabel({className,...props}){const{error:error2,formItemId}=useFormField();return jsxRuntimeExports.jsx(Label$2,{"data-slot":"form-label","data-error":!!error2,className:cn$1("data-[error=true]:text-destructive",className),htmlFor:formItemId,...props})}__name(FormLabel,"FormLabel");function FormMessage({className,...props}){const{error:error2,formMessageId}=useFormField(),body=error2?String(error2?.message):props.children;return body?jsxRuntimeExports.jsx("p",{"data-slot":"form-message",id:formMessageId,className:cn$1("text-destructive text-sm",className),...props,children:body}):null}__name(FormMessage,"FormMessage");function Input({className,type,...props}){return jsxRuntimeExports.jsx("input",{type,"data-slot":"input",className:cn$1(`border-input file:text-foreground placeholder:text-muted-foreground selection:bg-purple
|
|
38
|
+
`,r:"\r",t:" "};function resolveEscapeSequence(escapeSequence){return escapeSequence.startsWith("u")?String.fromCharCode(parseInt(escapeSequence.slice(1),16)):ESCAPED_CHARS[escapeSequence]}__name(resolveEscapeSequence,"resolveEscapeSequence");const REMOTE_CONFIGURATION_VERSION="v1",SUPPORTED_FIELDS=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function fetchAndApplyRemoteConfiguration(initConfiguration,supportedContextManagers){let rumInitConfiguration;const metrics=initMetrics(),fetchResult=await fetchRemoteConfiguration(initConfiguration);return fetchResult.ok?(metrics.increment("fetch","success"),rumInitConfiguration=applyRemoteConfiguration(initConfiguration,fetchResult.value,supportedContextManagers,metrics)):(metrics.increment("fetch","failure"),display.error(fetchResult.error)),addTelemetryMetrics("remote configuration metrics",{metrics:metrics.get()}),rumInitConfiguration}__name(fetchAndApplyRemoteConfiguration,"fetchAndApplyRemoteConfiguration");function applyRemoteConfiguration(initConfiguration,rumRemoteConfiguration,supportedContextManagers,metrics){const appliedConfiguration={...initConfiguration};return SUPPORTED_FIELDS.forEach(option=>{option in rumRemoteConfiguration&&(appliedConfiguration[option]=resolveConfigurationProperty(rumRemoteConfiguration[option]))}),Object.keys(supportedContextManagers).forEach(context=>{rumRemoteConfiguration[context]!==void 0&&resolveContextProperty(supportedContextManagers[context],rumRemoteConfiguration[context])}),appliedConfiguration;function resolveConfigurationProperty(property){if(Array.isArray(property))return property.map(resolveConfigurationProperty);if(isIndexableObject(property)){if(isSerializedOption(property)){const type=property.rcSerializedType;switch(type){case"string":return property.value;case"regex":return resolveRegex(property.value);case"dynamic":return resolveDynamicOption(property);default:display.error(`Unsupported remote configuration: "rcSerializedType": "${type}"`);return}}return mapValues(property,resolveConfigurationProperty)}return property}__name(resolveConfigurationProperty,"resolveConfigurationProperty");function resolveContextProperty(contextManager,contextItems){contextItems.forEach(({key,value})=>{contextManager.setContextProperty(key,resolveConfigurationProperty(value))})}__name(resolveContextProperty,"resolveContextProperty");function resolveDynamicOption(property){const strategy=property.strategy;let resolvedValue;switch(strategy){case"cookie":resolvedValue=resolveCookieValue(property);break;case"dom":resolvedValue=resolveDomValue(property);break;case"js":resolvedValue=resolveJsValue(property);break;case"localStorage":resolvedValue=resolveLocalStorageValue(property);break;default:display.error(`Unsupported remote configuration: "strategy": "${strategy}"`);return}const extractor=property.extractor;return extractor!==void 0&&typeof resolvedValue=="string"?extractValue(extractor,resolvedValue):resolvedValue}__name(resolveDynamicOption,"resolveDynamicOption");function resolveCookieValue({name:name2}){const value=getCookie(name2);return metrics.increment("cookie",value!==void 0?"success":"missing"),value}__name(resolveCookieValue,"resolveCookieValue");function resolveLocalStorageValue({key}){let value;try{value=localStorage.getItem(key)}catch{metrics.increment("localStorage","failure");return}return metrics.increment("localStorage",value!==null?"success":"missing"),value??void 0}__name(resolveLocalStorageValue,"resolveLocalStorageValue");function resolveDomValue({selector,attribute}){let element2;try{element2=document.querySelector(selector)}catch{display.error(`Invalid selector in the remote configuration: '${selector}'`),metrics.increment("dom","failure");return}if(!element2){metrics.increment("dom","missing");return}if(isForbidden(element2,attribute)){display.error(`Forbidden element selected by the remote configuration: '${selector}'`),metrics.increment("dom","failure");return}const domValue=attribute!==void 0?element2.getAttribute(attribute):element2.textContent;if(domValue===null){metrics.increment("dom","missing");return}return metrics.increment("dom","success"),domValue}__name(resolveDomValue,"resolveDomValue");function isForbidden(element2,attribute){return element2.getAttribute("type")==="password"&&attribute==="value"}__name(isForbidden,"isForbidden");function resolveJsValue({path}){let current=window;const pathParts=parseJsonPath(path);if(pathParts.length===0){display.error(`Invalid JSON path in the remote configuration: '${path}'`),metrics.increment("js","failure");return}for(const pathPart of pathParts){if(!(pathPart in current)){metrics.increment("js","missing");return}try{current=current[pathPart]}catch(e){display.error(`Error accessing: '${path}'`,e),metrics.increment("js","failure");return}}return metrics.increment("js","success"),current}__name(resolveJsValue,"resolveJsValue")}__name(applyRemoteConfiguration,"applyRemoteConfiguration");function initMetrics(){const metrics={fetch:{}};return{get:__name(()=>metrics,"get"),increment:__name((metricName,type)=>{metrics[metricName]||(metrics[metricName]={}),metrics[metricName][type]||(metrics[metricName][type]=0),metrics[metricName][type]=metrics[metricName][type]+1},"increment")}}__name(initMetrics,"initMetrics");function isSerializedOption(value){return"rcSerializedType"in value}__name(isSerializedOption,"isSerializedOption");function resolveRegex(pattern){try{return new RegExp(pattern)}catch{display.error(`Invalid regex in the remote configuration: '${pattern}'`)}}__name(resolveRegex,"resolveRegex");function extractValue(extractor,candidate){const resolvedExtractor=resolveRegex(extractor.value);if(resolvedExtractor===void 0)return;const regexResult=resolvedExtractor.exec(candidate);if(regexResult===null)return;const[match,capture]=regexResult;return capture||match}__name(extractValue,"extractValue");async function fetchRemoteConfiguration(configuration){let response;try{response=await fetch$1(buildEndpoint(configuration))}catch{response=void 0}if(!response||!response.ok)return{ok:!1,error:new Error("Error fetching the remote configuration.")};const remoteConfiguration=await response.json();return remoteConfiguration.rum?{ok:!0,value:remoteConfiguration.rum}:{ok:!1,error:new Error("No remote configuration for RUM.")}}__name(fetchRemoteConfiguration,"fetchRemoteConfiguration");function buildEndpoint(configuration){return configuration.remoteConfigurationProxy?configuration.remoteConfigurationProxy:`https://sdk-configuration.${buildEndpointHost("rum",configuration)}/${REMOTE_CONFIGURATION_VERSION}/${encodeURIComponent(configuration.remoteConfigurationId)}.json`}__name(buildEndpoint,"buildEndpoint");function createPreStartStrategy$1({ignoreInitIfSyntheticsWillInjectRum=!0,startDeflateWorker:startDeflateWorker2},trackingConsentState,customVitalsState,doStartRum){const bufferApiCalls=createBoundedBuffer(),globalContext=buildGlobalContextManager();bufferContextCalls(globalContext,CustomerContextKey.globalContext,bufferApiCalls);const userContext=buildUserContextManager();bufferContextCalls(userContext,CustomerContextKey.userContext,bufferApiCalls);const accountContext=buildAccountContextManager();bufferContextCalls(accountContext,CustomerContextKey.accountContext,bufferApiCalls);let firstStartViewCall,deflateWorker,cachedInitConfiguration,cachedConfiguration,telemetry;const hooks=createHooks(),trackingConsentStateSubscription=trackingConsentState.observable.subscribe(tryStartRum),emptyContext={};function tryStartRum(){if(!cachedInitConfiguration||!cachedConfiguration||!trackingConsentState.isGranted())return;telemetry||(telemetry=startTelemetry("browser-rum-sdk",cachedConfiguration,hooks)),trackingConsentStateSubscription.unsubscribe();let initialViewOptions;if(cachedConfiguration.trackViewsManually){if(!firstStartViewCall)return;bufferApiCalls.remove(firstStartViewCall.callback),initialViewOptions=firstStartViewCall.options}const startRumResult=doStartRum(cachedConfiguration,deflateWorker,initialViewOptions,telemetry,hooks);bufferApiCalls.drain(startRumResult)}__name(tryStartRum,"tryStartRum");function doInit(initConfiguration,errorStack){const eventBridgeAvailable=canUseEventBridge();if(eventBridgeAvailable&&(initConfiguration=overrideInitConfigurationForBridge(initConfiguration)),cachedInitConfiguration=initConfiguration,addTelemetryConfiguration(serializeRumConfiguration(initConfiguration)),cachedConfiguration){displayAlreadyInitializedError("DD_RUM",initConfiguration);return}const configuration=validateAndBuildRumConfiguration(initConfiguration,errorStack);if(configuration){if(!eventBridgeAvailable&&!configuration.sessionStoreStrategyType){display.warn("No storage available for session. We will not send any data.");return}configuration.compressIntakeRequests&&!eventBridgeAvailable&&startDeflateWorker2&&(deflateWorker=startDeflateWorker2(configuration,"Datadog RUM",noop$2),!deflateWorker)||(cachedConfiguration=configuration,initFetchObservable().subscribe(noop$2),trackingConsentState.tryToInit(configuration.trackingConsent),tryStartRum())}}__name(doInit,"doInit");const addDurationVital=__name(vital=>{bufferApiCalls.add(startRumResult=>startRumResult.addDurationVital(vital))},"addDurationVital");return{init(initConfiguration,publicApi,errorStack){if(!initConfiguration){display.error("Missing configuration");return}initFeatureFlags(initConfiguration.enableExperimentalFeatures),cachedInitConfiguration=initConfiguration,!(ignoreInitIfSyntheticsWillInjectRum&&willSyntheticsInjectRum())&&(callPluginsMethod(initConfiguration.plugins,"onInit",{initConfiguration,publicApi}),initConfiguration.remoteConfigurationId?fetchAndApplyRemoteConfiguration(initConfiguration,{user:userContext,context:globalContext}).then(initConfiguration2=>{initConfiguration2&&doInit(initConfiguration2,errorStack)}).catch(monitorError):doInit(initConfiguration,errorStack))},get initConfiguration(){return cachedInitConfiguration},getInternalContext:noop$2,stopSession:noop$2,addTiming(name2,time2=timeStampNow()){bufferApiCalls.add(startRumResult=>startRumResult.addTiming(name2,time2))},startView(options,startClocks=clocksNow()){const callback=__name(startRumResult=>{startRumResult.startView(options,startClocks)},"callback");bufferApiCalls.add(callback),firstStartViewCall||(firstStartViewCall={options,callback},tryStartRum())},setViewName(name2){bufferApiCalls.add(startRumResult=>startRumResult.setViewName(name2))},setViewContext(context){bufferApiCalls.add(startRumResult=>startRumResult.setViewContext(context))},setViewContextProperty(key,value){bufferApiCalls.add(startRumResult=>startRumResult.setViewContextProperty(key,value))},getViewContext:__name(()=>emptyContext,"getViewContext"),globalContext,userContext,accountContext,addAction(action){bufferApiCalls.add(startRumResult=>startRumResult.addAction(action))},startAction(name2,options){const startClocks=clocksNow();bufferApiCalls.add(startRumResult=>startRumResult.startAction(name2,options,startClocks))},stopAction(name2,options){const stopClocks=clocksNow();bufferApiCalls.add(startRumResult=>startRumResult.stopAction(name2,options,stopClocks))},startResource(url2,options){const startClocks=clocksNow();bufferApiCalls.add(startRumResult=>startRumResult.startResource(url2,options,startClocks))},stopResource(url2,options){const stopClocks=clocksNow();bufferApiCalls.add(startRumResult=>startRumResult.stopResource(url2,options,stopClocks))},addError(providedError){bufferApiCalls.add(startRumResult=>startRumResult.addError(providedError))},addFeatureFlagEvaluation(key,value){bufferApiCalls.add(startRumResult=>startRumResult.addFeatureFlagEvaluation(key,value))},startDurationVital(name2,options){return startDurationVital(customVitalsState,name2,options)},stopDurationVital(name2,options){stopDurationVital(addDurationVital,customVitalsState,name2,options)},addDurationVital,addOperationStepVital:__name((name2,stepType,options,failureReason)=>{bufferApiCalls.add(startRumResult=>startRumResult.addOperationStepVital(sanitize(name2),stepType,sanitize(options),sanitize(failureReason)))},"addOperationStepVital")}}__name(createPreStartStrategy$1,"createPreStartStrategy$1");function overrideInitConfigurationForBridge(initConfiguration){var _a20,_b;return{...initConfiguration,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(_a20=initConfiguration.defaultPrivacyLevel)!==null&&_a20!==void 0?_a20:(_b=getEventBridge())===null||_b===void 0?void 0:_b.getPrivacyLevel()}}__name(overrideInitConfigurationForBridge,"overrideInitConfigurationForBridge");function bufferContextCalls(preStartContextManager,name2,bufferApiCalls){preStartContextManager.changeObservable.subscribe(()=>{const context=preStartContextManager.getContext();bufferApiCalls.add(startRumResult=>startRumResult[name2].setContext(context))})}__name(bufferContextCalls,"bufferContextCalls");function createDOMMutationObservable(){const MutationObserver2=getMutationObserverConstructor();return new Observable(observable=>{if(!MutationObserver2)return;const observer2=new MutationObserver2(monitor(records=>observable.notify(records)));return observer2.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>observer2.disconnect()})}__name(createDOMMutationObservable,"createDOMMutationObservable");function getMutationObserverConstructor(){let constructor;const browserWindow=window;if(browserWindow.Zone&&(constructor=getZoneJsOriginalValue(browserWindow,"MutationObserver"),browserWindow.MutationObserver&&constructor===browserWindow.MutationObserver)){const patchedInstance=new browserWindow.MutationObserver(noop$2),originalInstance=getZoneJsOriginalValue(patchedInstance,"originalInstance");constructor=originalInstance&&originalInstance.constructor}return constructor||(constructor=browserWindow.MutationObserver),constructor}__name(getMutationObserverConstructor,"getMutationObserverConstructor");function createWindowOpenObservable(){const observable=new Observable,{stop}=instrumentMethod(window,"open",()=>observable.notify());return{observable,stop}}__name(createWindowOpenObservable,"createWindowOpenObservable");function startInternalContext(applicationId,sessionManager,viewHistory,actionContexts,urlContexts){return{get:__name(startTime=>{const viewContext=viewHistory.findView(startTime),urlContext=urlContexts.findUrl(startTime),session=sessionManager.findTrackedSession(startTime);if(session&&viewContext&&urlContext){const actionId=actionContexts.findActionId(startTime);return{application_id:applicationId,session_id:session.id,user_action:actionId?{id:actionId}:void 0,view:{id:viewContext.id,name:viewContext.name,referrer:urlContext.referrer,url:urlContext.url}}}},"get")}}__name(startInternalContext,"startInternalContext");const LifeCycle=AbstractLifeCycle,VIEW_CONTEXT_TIME_OUT_DELAY=SESSION_TIME_OUT_DELAY;function startViewHistory(lifeCycle){const viewValueHistory=createValueHistory({expireDelay:VIEW_CONTEXT_TIME_OUT_DELAY});lifeCycle.subscribe(1,view=>{viewValueHistory.add(buildViewHistoryEntry(view),view.startClocks.relative)}),lifeCycle.subscribe(6,({endClocks})=>{viewValueHistory.closeActive(endClocks.relative)}),lifeCycle.subscribe(3,viewUpdate=>{const currentView=viewValueHistory.find(viewUpdate.startClocks.relative);currentView&&(viewUpdate.name&&(currentView.name=viewUpdate.name),viewUpdate.context&&(currentView.context=viewUpdate.context),currentView.sessionIsActive=viewUpdate.sessionIsActive)}),lifeCycle.subscribe(10,()=>{viewValueHistory.reset()});function buildViewHistoryEntry(view){return{service:view.service,version:view.version,context:view.context,id:view.id,name:view.name,startClocks:view.startClocks}}return __name(buildViewHistoryEntry,"buildViewHistoryEntry"),{findView:__name(startTime=>viewValueHistory.find(startTime),"findView"),stop:__name(()=>{viewValueHistory.stop()},"stop")}}__name(startViewHistory,"startViewHistory");const FAKE_INITIAL_DOCUMENT="initial_document",RESOURCE_TYPES=[[ResourceType.DOCUMENT,initiatorType=>FAKE_INITIAL_DOCUMENT===initiatorType],[ResourceType.XHR,initiatorType=>initiatorType==="xmlhttprequest"],[ResourceType.FETCH,initiatorType=>initiatorType==="fetch"],[ResourceType.BEACON,initiatorType=>initiatorType==="beacon"],[ResourceType.CSS,(_2,path)=>/\.css$/i.test(path)],[ResourceType.JS,(_2,path)=>/\.js$/i.test(path)],[ResourceType.IMAGE,(initiatorType,path)=>["image","img","icon"].includes(initiatorType)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(path)!==null],[ResourceType.FONT,(_2,path)=>/\.(woff|eot|woff2|ttf)$/i.exec(path)!==null],[ResourceType.MEDIA,(initiatorType,path)=>["audio","video"].includes(initiatorType)||/\.(mp3|mp4)$/i.exec(path)!==null]];function computeResourceEntryType(entry){const url2=entry.name;if(!isValidUrl(url2))return ResourceType.OTHER;const path=getPathName(url2);for(const[type,isType]of RESOURCE_TYPES)if(isType(entry.initiatorType,path))return type;return ResourceType.OTHER}__name(computeResourceEntryType,"computeResourceEntryType");function areInOrder(...numbers){for(let i2=1;i2<numbers.length;i2+=1)if(numbers[i2-1]>numbers[i2])return!1;return!0}__name(areInOrder,"areInOrder");function isResourceEntryRequestType(entry){return entry.initiatorType==="xmlhttprequest"||entry.initiatorType==="fetch"}__name(isResourceEntryRequestType,"isResourceEntryRequestType");function computeResourceEntryDuration(entry){const{duration:duration2,startTime,responseEnd}=entry;return duration2===0&&startTime<responseEnd?elapsed(startTime,responseEnd):duration2}__name(computeResourceEntryDuration,"computeResourceEntryDuration");function computeResourceEntryDetails(entry){if(!hasValidResourceEntryTimings(entry))return;const{startTime,fetchStart,workerStart,redirectStart,redirectEnd,domainLookupStart,domainLookupEnd,connectStart,secureConnectionStart,connectEnd,requestStart,responseStart,responseEnd}=entry,details={download:formatTiming(startTime,responseStart,responseEnd),first_byte:formatTiming(startTime,requestStart,responseStart)};return 0<workerStart&&workerStart<fetchStart&&(details.worker=formatTiming(startTime,workerStart,fetchStart)),fetchStart<connectEnd&&(details.connect=formatTiming(startTime,connectStart,connectEnd),connectStart<=secureConnectionStart&&secureConnectionStart<=connectEnd&&(details.ssl=formatTiming(startTime,secureConnectionStart,connectEnd))),fetchStart<domainLookupEnd&&(details.dns=formatTiming(startTime,domainLookupStart,domainLookupEnd)),startTime<redirectEnd&&(details.redirect=formatTiming(startTime,redirectStart,redirectEnd)),details}__name(computeResourceEntryDetails,"computeResourceEntryDetails");function hasValidResourceEntryDuration(entry){return entry.duration>=0}__name(hasValidResourceEntryDuration,"hasValidResourceEntryDuration");function hasValidResourceEntryTimings(entry){const areCommonTimingsInOrder=areInOrder(entry.startTime,entry.fetchStart,entry.domainLookupStart,entry.domainLookupEnd,entry.connectStart,entry.connectEnd,entry.requestStart,entry.responseStart,entry.responseEnd),areRedirectionTimingsInOrder=hasRedirection(entry)?areInOrder(entry.startTime,entry.redirectStart,entry.redirectEnd,entry.fetchStart):!0;return areCommonTimingsInOrder&&areRedirectionTimingsInOrder}__name(hasValidResourceEntryTimings,"hasValidResourceEntryTimings");function hasRedirection(entry){return entry.redirectEnd>entry.startTime}__name(hasRedirection,"hasRedirection");function formatTiming(origin2,start,end){if(origin2<=start&&start<=end)return{duration:toServerDuration(elapsed(start,end)),start:toServerDuration(elapsed(origin2,start))}}__name(formatTiming,"formatTiming");function computeResourceEntryProtocol(entry){return entry.nextHopProtocol===""?void 0:entry.nextHopProtocol}__name(computeResourceEntryProtocol,"computeResourceEntryProtocol");function computeResourceEntryDeliveryType(entry){return entry.deliveryType===""?"other":entry.deliveryType}__name(computeResourceEntryDeliveryType,"computeResourceEntryDeliveryType");function computeResourceEntrySize(entry){if(entry.startTime<entry.responseStart){const{encodedBodySize,decodedBodySize,transferSize}=entry;return{size:decodedBodySize,encoded_body_size:encodedBodySize,decoded_body_size:decodedBodySize,transfer_size:transferSize}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}__name(computeResourceEntrySize,"computeResourceEntrySize");function isAllowedRequestUrl(url2){return url2&&(!isIntakeUrl(url2)||isExperimentalFeatureEnabled(ExperimentalFeature.TRACK_INTAKE_REQUESTS))}__name(isAllowedRequestUrl,"isAllowedRequestUrl");const DATA_URL_REGEX=/data:(.+)?(;base64)?,/g,MAX_RESOURCE_VALUE_CHAR_LENGTH=24e3;function sanitizeIfLongDataUrl(url2,lengthLimit=MAX_RESOURCE_VALUE_CHAR_LENGTH){if(url2.length<=lengthLimit||!url2.startsWith("data:"))return url2;const dataUrlMatchArray=url2.substring(0,100).match(DATA_URL_REGEX);return dataUrlMatchArray?`${dataUrlMatchArray[0]}[...]`:url2}__name(sanitizeIfLongDataUrl,"sanitizeIfLongDataUrl");const sampleDecisionCache=new Map;function isSampled(sessionId,sampleRate){if(sampleRate===100)return!0;if(sampleRate===0)return!1;const cachedDecision=sampleDecisionCache.get(sampleRate);if(cachedDecision&&sessionId===cachedDecision.sessionId)return cachedDecision.decision;let decision;return window.BigInt?decision=sampleUsingKnuthFactor(BigInt(`0x${sessionId.split("-")[4]}`),sampleRate):decision=performDraw(sampleRate),sampleDecisionCache.set(sampleRate,{sessionId,decision}),decision}__name(isSampled,"isSampled");function sampleUsingKnuthFactor(identifier,sampleRate){const knuthFactor=BigInt("1111111111111111111"),twoPow64=BigInt("0x10000000000000000"),hash2=identifier*knuthFactor%twoPow64;return Number(hash2)<=sampleRate/100*Number(twoPow64)}__name(sampleUsingKnuthFactor,"sampleUsingKnuthFactor");function createTraceIdentifier(){return createIdentifier(64)}__name(createTraceIdentifier,"createTraceIdentifier");function createSpanIdentifier(){return createIdentifier(63)}__name(createSpanIdentifier,"createSpanIdentifier");function createIdentifier(bits){const buffer=crypto.getRandomValues(new Uint32Array(2));return bits===63&&(buffer[buffer.length-1]>>>=1),{toString(radix=10){let high=buffer[1],low=buffer[0],str="";do{const mod=high%radix*4294967296+low;high=Math.floor(high/radix),low=Math.floor(mod/radix),str=(mod%radix).toString(radix)+str}while(high||low);return str}}}__name(createIdentifier,"createIdentifier");function toPaddedHexadecimalString(id2){return id2.toString(16).padStart(16,"0")}__name(toPaddedHexadecimalString,"toPaddedHexadecimalString");function clearTracingIfNeeded(context){context.status===0&&!context.isAborted&&(context.traceId=void 0,context.spanId=void 0,context.traceSampled=void 0)}__name(clearTracingIfNeeded,"clearTracingIfNeeded");function startTracer(configuration,sessionManager,userContext,accountContext){return{clearTracingIfNeeded,traceFetch:__name(context=>injectHeadersIfTracingAllowed(configuration,context,sessionManager,userContext,accountContext,tracingHeaders=>{var _a20;if(context.input instanceof Request&&!(!((_a20=context.init)===null||_a20===void 0)&&_a20.headers))context.input=new Request(context.input),Object.keys(tracingHeaders).forEach(key=>{context.input.headers.append(key,tracingHeaders[key])});else{context.init=shallowClone$1(context.init);const headers=[];context.init.headers instanceof Headers?context.init.headers.forEach((value,key)=>{headers.push([key,value])}):Array.isArray(context.init.headers)?context.init.headers.forEach(header=>{headers.push(header)}):context.init.headers&&Object.keys(context.init.headers).forEach(key=>{headers.push([key,context.init.headers[key]])}),context.init.headers=headers.concat(objectEntries(tracingHeaders))}}),"traceFetch"),traceXhr:__name((context,xhr)=>injectHeadersIfTracingAllowed(configuration,context,sessionManager,userContext,accountContext,tracingHeaders=>{Object.keys(tracingHeaders).forEach(name2=>{xhr.setRequestHeader(name2,tracingHeaders[name2])})}),"traceXhr")}}__name(startTracer,"startTracer");function injectHeadersIfTracingAllowed(configuration,context,sessionManager,userContext,accountContext,inject){const session=sessionManager.findTrackedSession();if(!session)return;const tracingOption=configuration.allowedTracingUrls.find(tracingOption2=>matchList([tracingOption2.match],context.url,!0));if(!tracingOption)return;const traceSampled=isSampled(session.id,configuration.traceSampleRate);(traceSampled||configuration.traceContextInjection===TraceContextInjection.ALL)&&(context.traceSampled=traceSampled,context.traceId=createTraceIdentifier(),context.spanId=createSpanIdentifier(),inject(makeTracingHeaders(context.traceId,context.spanId,context.traceSampled,session.id,tracingOption.propagatorTypes,userContext,accountContext,configuration)))}__name(injectHeadersIfTracingAllowed,"injectHeadersIfTracingAllowed");function makeTracingHeaders(traceId,spanId,traceSampled,sessionId,propagatorTypes,userContext,accountContext,configuration){const tracingHeaders={};if(propagatorTypes.forEach(propagatorType=>{switch(propagatorType){case"datadog":{Object.assign(tracingHeaders,{"x-datadog-origin":"rum","x-datadog-parent-id":spanId.toString(),"x-datadog-sampling-priority":traceSampled?"1":"0","x-datadog-trace-id":traceId.toString()});break}case"tracecontext":{Object.assign(tracingHeaders,{traceparent:`00-0000000000000000${toPaddedHexadecimalString(traceId)}-${toPaddedHexadecimalString(spanId)}-0${traceSampled?"1":"0"}`,tracestate:`dd=s:${traceSampled?"1":"0"};o:rum`});break}case"b3":{Object.assign(tracingHeaders,{b3:`${toPaddedHexadecimalString(traceId)}-${toPaddedHexadecimalString(spanId)}-${traceSampled?"1":"0"}`});break}case"b3multi":{Object.assign(tracingHeaders,{"X-B3-TraceId":toPaddedHexadecimalString(traceId),"X-B3-SpanId":toPaddedHexadecimalString(spanId),"X-B3-Sampled":traceSampled?"1":"0"});break}}}),configuration.propagateTraceBaggage){const baggageItems={"session.id":sessionId},userId=userContext.getContext().id;typeof userId=="string"&&(baggageItems["user.id"]=userId);const accountId=accountContext.getContext().id;typeof accountId=="string"&&(baggageItems["account.id"]=accountId);const baggageHeader=Object.entries(baggageItems).map(([key,value])=>`${key}=${encodeURIComponent(value)}`).join(",");baggageHeader&&(tracingHeaders.baggage=baggageHeader)}return tracingHeaders}__name(makeTracingHeaders,"makeTracingHeaders");const GRAPHQL_PAYLOAD_LIMIT=32*ONE_KIBI_BYTE;function extractGraphQlMetadata(request,graphQlConfig){const metadata=extractGraphQlRequestMetadata(request,graphQlConfig.trackPayload);if(metadata){if(graphQlConfig.trackResponseErrors&&request.responseBody){const responseErrors=parseGraphQlResponse(request.responseBody);responseErrors&&(metadata.error_count=responseErrors.length,metadata.errors=responseErrors)}return metadata}}__name(extractGraphQlMetadata,"extractGraphQlMetadata");function parseGraphQlResponse(responseText){const response=tryJsonParse(responseText);if(!response||typeof response!="object")return;const responseObj=response;return isNonEmptyArray(responseObj.errors)?responseObj.errors.map(error2=>{var _a20;return{message:error2.message,path:error2.path,locations:error2.locations,code:(_a20=error2.extensions)===null||_a20===void 0?void 0:_a20.code}}):void 0}__name(parseGraphQlResponse,"parseGraphQlResponse");function findGraphQlConfiguration(url2,configuration){return configuration.allowedGraphQlUrls.find(graphQlOption=>matchList([graphQlOption.match],url2))}__name(findGraphQlConfiguration,"findGraphQlConfiguration");function extractGraphQlRequestMetadata(request,trackPayload=!1){let rawMetadata;if(request.method==="POST"?rawMetadata=extractFromBody(request.requestBody):request.method==="GET"&&(rawMetadata=extractFromUrlQueryParams(request.url)),!!rawMetadata)return sanitizeGraphQlMetadata(rawMetadata,trackPayload)}__name(extractGraphQlRequestMetadata,"extractGraphQlRequestMetadata");function extractFromBody(requestBody){if(!requestBody||typeof requestBody!="string")return;const graphqlBody=tryJsonParse(requestBody);if(graphqlBody)return{query:graphqlBody.query,operationName:graphqlBody.operationName,variables:graphqlBody.variables?JSON.stringify(graphqlBody.variables):void 0}}__name(extractFromBody,"extractFromBody");function extractFromUrlQueryParams(url2){const searchParams=buildUrl(url2).searchParams,variablesParam=searchParams.get("variables"),variables=variablesParam&&tryJsonParse(variablesParam)!==void 0?variablesParam:void 0;return{query:searchParams.get("query")||void 0,operationName:searchParams.get("operationName")||void 0,variables}}__name(extractFromUrlQueryParams,"extractFromUrlQueryParams");function sanitizeGraphQlMetadata(rawMetadata,trackPayload){let operationType,payload,variables;if(rawMetadata.query){const trimmedQuery=rawMetadata.query.trim();operationType=getOperationType(trimmedQuery),trackPayload&&(payload=safeTruncate(trimmedQuery,GRAPHQL_PAYLOAD_LIMIT,"..."))}return rawMetadata.variables&&(variables=rawMetadata.variables),{operationType,operationName:rawMetadata.operationName,variables,payload}}__name(sanitizeGraphQlMetadata,"sanitizeGraphQlMetadata");function getOperationType(query){var _a20;return(_a20=query.match(/^\s*(query|mutation|subscription)\b/i))===null||_a20===void 0?void 0:_a20[1]}__name(getOperationType,"getOperationType");function tryJsonParse(text2){try{return JSON.parse(text2)}catch{return}}__name(tryJsonParse,"tryJsonParse");let nextRequestIndex=1;function startRequestCollection(lifeCycle,configuration,sessionManager,userContext,accountContext){const tracer=startTracer(configuration,sessionManager,userContext,accountContext);trackXhr(lifeCycle,configuration,tracer),trackFetch(lifeCycle,configuration,tracer)}__name(startRequestCollection,"startRequestCollection");function trackXhr(lifeCycle,configuration,tracer){const subscription=initXhrObservable(configuration).subscribe(rawContext=>{const context=rawContext;if(isAllowedRequestUrl(context.url))switch(context.state){case"start":tracer.traceXhr(context,context.xhr),context.requestIndex=getNextRequestIndex(),lifeCycle.notify(7,{requestIndex:context.requestIndex,url:context.url});break;case"complete":tracer.clearTracingIfNeeded(context),lifeCycle.notify(8,{duration:context.duration,method:context.method,requestIndex:context.requestIndex,spanId:context.spanId,startClocks:context.startClocks,status:context.status,traceId:context.traceId,traceSampled:context.traceSampled,type:RequestType.XHR,url:context.url,xhr:context.xhr,isAborted:context.isAborted,handlingStack:context.handlingStack,requestBody:context.requestBody,responseBody:context.responseBody});break}});return{stop:__name(()=>subscription.unsubscribe(),"stop")}}__name(trackXhr,"trackXhr");function trackFetch(lifeCycle,configuration,tracer){const subscription=initFetchObservable({responseBodyAction:__name(context=>{var _a20;return!((_a20=findGraphQlConfiguration(context.url,configuration))===null||_a20===void 0)&&_a20.trackResponseErrors?2:1},"responseBodyAction")}).subscribe(rawContext=>{var _a20;const context=rawContext;if(isAllowedRequestUrl(context.url))switch(context.state){case"start":tracer.traceFetch(context),context.requestIndex=getNextRequestIndex(),lifeCycle.notify(7,{requestIndex:context.requestIndex,url:context.url});break;case"resolve":tracer.clearTracingIfNeeded(context),lifeCycle.notify(8,{duration:elapsed(context.startClocks.timeStamp,timeStampNow()),method:context.method,requestIndex:context.requestIndex,responseType:context.responseType,spanId:context.spanId,startClocks:context.startClocks,status:context.status,traceId:context.traceId,traceSampled:context.traceSampled,type:RequestType.FETCH,url:context.url,response:context.response,init:context.init,input:context.input,isAborted:context.isAborted,handlingStack:context.handlingStack,requestBody:(_a20=context.init)===null||_a20===void 0?void 0:_a20.body,responseBody:context.responseBody});break}});return{stop:__name(()=>subscription.unsubscribe(),"stop")}}__name(trackFetch,"trackFetch");function getNextRequestIndex(){const result=nextRequestIndex;return nextRequestIndex+=1,result}__name(getNextRequestIndex,"getNextRequestIndex");function discardNegativeDuration(duration2){return isNumber$1(duration2)&&duration2<0?void 0:duration2}__name(discardNegativeDuration,"discardNegativeDuration");function isTextNode(node2){return node2.nodeType===Node.TEXT_NODE}__name(isTextNode,"isTextNode");function isCommentNode(node2){return node2.nodeType===Node.COMMENT_NODE}__name(isCommentNode,"isCommentNode");function isElementNode(node2){return node2.nodeType===Node.ELEMENT_NODE}__name(isElementNode,"isElementNode");function isNodeShadowHost(node2){return isElementNode(node2)&&!!node2.shadowRoot}__name(isNodeShadowHost,"isNodeShadowHost");function isNodeShadowRoot(node2){const shadowRoot=node2;return!!shadowRoot.host&&shadowRoot.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&isElementNode(shadowRoot.host)}__name(isNodeShadowRoot,"isNodeShadowRoot");function hasChildNodes(node2){return node2.childNodes.length>0||isNodeShadowHost(node2)}__name(hasChildNodes,"hasChildNodes");function forEachChildNodes(node2,callback){let child=node2.firstChild;for(;child;)callback(child),child=child.nextSibling;isNodeShadowHost(node2)&&callback(node2.shadowRoot)}__name(forEachChildNodes,"forEachChildNodes");function getParentNode$1(node2){return isNodeShadowRoot(node2)?node2.host:node2.parentNode}__name(getParentNode$1,"getParentNode$1");function getParentElement(element2){if(element2.parentElement)return element2.parentElement;const parentNode=element2.parentNode;return parentNode&&isNodeShadowRoot(parentNode)?parentNode.host:null}__name(getParentElement,"getParentElement");function retrieveFirstInputTiming(configuration,callback){const startTimeStamp=dateNow();let timingSent=!1;const{stop:removeEventListeners}=addEventListeners(configuration,window,["click","mousedown","keydown","touchstart","pointerdown"],evt=>{if(!evt.cancelable)return;const timing={entryType:"first-input",processingStart:relativeNow(),processingEnd:relativeNow(),startTime:evt.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:__name(()=>({}),"toJSON")};evt.type==="pointerdown"?sendTimingIfPointerIsNotCancelled(configuration,timing):sendTiming(timing)},{passive:!0,capture:!0});return{stop:removeEventListeners};function sendTimingIfPointerIsNotCancelled(configuration2,timing){addEventListeners(configuration2,window,["pointerup","pointercancel"],event=>{event.type==="pointerup"&&sendTiming(timing)},{once:!0})}function sendTiming(timing){if(!timingSent){timingSent=!0,removeEventListeners();const delay=timing.processingStart-timing.startTime;delay>=0&&delay<dateNow()-startTimeStamp&&callback(timing)}}}__name(retrieveFirstInputTiming,"retrieveFirstInputTiming");var RumPerformanceEntryType;(function(RumPerformanceEntryType2){RumPerformanceEntryType2.EVENT="event",RumPerformanceEntryType2.FIRST_INPUT="first-input",RumPerformanceEntryType2.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",RumPerformanceEntryType2.LAYOUT_SHIFT="layout-shift",RumPerformanceEntryType2.LONG_TASK="longtask",RumPerformanceEntryType2.LONG_ANIMATION_FRAME="long-animation-frame",RumPerformanceEntryType2.NAVIGATION="navigation",RumPerformanceEntryType2.PAINT="paint",RumPerformanceEntryType2.RESOURCE="resource",RumPerformanceEntryType2.VISIBILITY_STATE="visibility-state"})(RumPerformanceEntryType||(RumPerformanceEntryType={}));function createPerformanceObservable(configuration,options){return new Observable(observable=>{if(!window.PerformanceObserver)return;const handlePerformanceEntries=__name(entries=>{const rumPerformanceEntries=filterRumPerformanceEntries(entries);rumPerformanceEntries.length>0&&observable.notify(rumPerformanceEntries)},"handlePerformanceEntries");let timeoutId,isObserverInitializing=!0;const observer2=new PerformanceObserver(monitor(entries=>{isObserverInitializing?timeoutId=setTimeout$1(()=>handlePerformanceEntries(entries.getEntries())):handlePerformanceEntries(entries.getEntries())}));try{observer2.observe(options)}catch{if([RumPerformanceEntryType.RESOURCE,RumPerformanceEntryType.NAVIGATION,RumPerformanceEntryType.LONG_TASK,RumPerformanceEntryType.PAINT].includes(options.type)){options.buffered&&(timeoutId=setTimeout$1(()=>handlePerformanceEntries(performance.getEntriesByType(options.type))));try{observer2.observe({entryTypes:[options.type]})}catch{return}}}isObserverInitializing=!1,manageResourceTimingBufferFull(configuration);let stopFirstInputTiming;return!supportPerformanceTimingEvent(RumPerformanceEntryType.FIRST_INPUT)&&options.type===RumPerformanceEntryType.FIRST_INPUT&&({stop:stopFirstInputTiming}=retrieveFirstInputTiming(configuration,timing=>{handlePerformanceEntries([timing])})),()=>{observer2.disconnect(),stopFirstInputTiming&&stopFirstInputTiming(),clearTimeout$1(timeoutId)}})}__name(createPerformanceObservable,"createPerformanceObservable");let resourceTimingBufferFullListener;function manageResourceTimingBufferFull(configuration){return!resourceTimingBufferFullListener&&supportPerformanceObject()&&"addEventListener"in performance&&(resourceTimingBufferFullListener=addEventListener(configuration,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{resourceTimingBufferFullListener?.stop()}}__name(manageResourceTimingBufferFull,"manageResourceTimingBufferFull");function supportPerformanceObject(){return window.performance!==void 0&&"getEntries"in performance}__name(supportPerformanceObject,"supportPerformanceObject");function supportPerformanceTimingEvent(entryType){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(entryType)}__name(supportPerformanceTimingEvent,"supportPerformanceTimingEvent");function filterRumPerformanceEntries(entries){return entries.filter(entry=>!isForbiddenResource(entry))}__name(filterRumPerformanceEntries,"filterRumPerformanceEntries");function isForbiddenResource(entry){return entry.entryType===RumPerformanceEntryType.RESOURCE&&(!isAllowedRequestUrl(entry.name)||!hasValidResourceEntryDuration(entry))}__name(isForbiddenResource,"isForbiddenResource");const PAGE_ACTIVITY_VALIDATION_DELAY=100,PAGE_ACTIVITY_END_DELAY=100,EXCLUDED_MUTATIONS_ATTRIBUTE="data-dd-excluded-activity-mutations";function waitPageActivityEnd(lifeCycle,domMutationObservable,windowOpenObservable,configuration,pageActivityEndCallback,maxDuration){const pageActivityObservable=createPageActivityObservable(lifeCycle,domMutationObservable,windowOpenObservable,configuration);let pageActivityEndTimeoutId,hasCompleted=!1;const validationTimeoutId=setTimeout$1(monitor(()=>complete({hadActivity:!1})),PAGE_ACTIVITY_VALIDATION_DELAY),maxDurationTimeoutId=maxDuration!==void 0?setTimeout$1(monitor(()=>complete({hadActivity:!0,end:timeStampNow()})),maxDuration):void 0,pageActivitySubscription=pageActivityObservable.subscribe(({isBusy})=>{clearTimeout$1(validationTimeoutId),clearTimeout$1(pageActivityEndTimeoutId);const lastChangeTime=timeStampNow();isBusy||(pageActivityEndTimeoutId=setTimeout$1(monitor(()=>complete({hadActivity:!0,end:lastChangeTime})),PAGE_ACTIVITY_END_DELAY))}),stop=__name(()=>{hasCompleted=!0,clearTimeout$1(validationTimeoutId),clearTimeout$1(pageActivityEndTimeoutId),clearTimeout$1(maxDurationTimeoutId),pageActivitySubscription.unsubscribe()},"stop");function complete(event){hasCompleted||(stop(),pageActivityEndCallback(event))}return __name(complete,"complete"),{stop}}__name(waitPageActivityEnd,"waitPageActivityEnd");function createPageActivityObservable(lifeCycle,domMutationObservable,windowOpenObservable,configuration){return new Observable(observable=>{const subscriptions=[];let firstRequestIndex,pendingRequestsCount=0;return subscriptions.push(domMutationObservable.subscribe(mutations=>{mutations.every(isExcludedMutation)||notifyPageActivity()}),windowOpenObservable.subscribe(notifyPageActivity),createPerformanceObservable(configuration,{type:RumPerformanceEntryType.RESOURCE}).subscribe(entries=>{entries.some(entry=>!isExcludedUrl(configuration,entry.name))&¬ifyPageActivity()}),lifeCycle.subscribe(7,startEvent=>{isExcludedUrl(configuration,startEvent.url)||(firstRequestIndex===void 0&&(firstRequestIndex=startEvent.requestIndex),pendingRequestsCount+=1,notifyPageActivity())}),lifeCycle.subscribe(8,request=>{isExcludedUrl(configuration,request.url)||firstRequestIndex===void 0||request.requestIndex<firstRequestIndex||(pendingRequestsCount-=1,notifyPageActivity())})),()=>{subscriptions.forEach(s2=>s2.unsubscribe())};function notifyPageActivity(){observable.notify({isBusy:pendingRequestsCount>0})}__name(notifyPageActivity,"notifyPageActivity")})}__name(createPageActivityObservable,"createPageActivityObservable");function isExcludedUrl(configuration,requestUrl){return matchList(configuration.excludedActivityUrls,requestUrl)}__name(isExcludedUrl,"isExcludedUrl");function isExcludedMutation(mutation){const targetElement=mutation.type==="characterData"?mutation.target.parentElement:mutation.target;return!!(targetElement&&isElementNode(targetElement)&&targetElement.matches(`[${EXCLUDED_MUTATIONS_ATTRIBUTE}], [${EXCLUDED_MUTATIONS_ATTRIBUTE}] *`))}__name(isExcludedMutation,"isExcludedMutation");const DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE="data-dd-action-name",ACTION_NAME_PLACEHOLDER="Masked Element",SHADOW_DOM_MARKER="::shadow ",STABLE_ATTRIBUTES=[DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],GLOBALLY_UNIQUE_SELECTOR_GETTERS=[getStableAttributeSelector,getIDSelector],UNIQUE_AMONG_CHILDREN_SELECTOR_GETTERS=[getStableAttributeSelector,getClassSelector,getTagNameSelector];function getSelectorFromElement(targetElement,actionNameAttribute){if(!targetElement.isConnected)return;const subtrees=getAllSubtreeTargets(targetElement),selectorParts=[];for(const{rootNode,target}of subtrees){const selector=getSelectorFromElementWithinSubtree(target,rootNode,actionNameAttribute);if(!selector)return;selectorParts.push(selector)}return selectorParts.join(SHADOW_DOM_MARKER)}__name(getSelectorFromElement,"getSelectorFromElement");function getAllSubtreeTargets(element2){const result=[];let currentTarget=element2;for(;currentTarget;){const rootNode=currentTarget.getRootNode();if(result.push({rootNode,target:currentTarget}),isNodeShadowRoot(rootNode))currentTarget=rootNode.host;else break}return result.reverse()}__name(getAllSubtreeTargets,"getAllSubtreeTargets");function getSelectorFromElementWithinSubtree(targetElement,rootNode,actionNameAttribute){let currentSelector,currentElement=targetElement;for(;currentElement&¤tElement.nodeName!=="HTML";){const globallyUniqueSelector=findSelector(currentElement,rootNode,GLOBALLY_UNIQUE_SELECTOR_GETTERS,isSelectorUniqueWithinRoot,actionNameAttribute,currentSelector);if(globallyUniqueSelector)return combineSelector(globallyUniqueSelector,currentSelector);const elementSelector=findSelector(currentElement,rootNode,UNIQUE_AMONG_CHILDREN_SELECTOR_GETTERS,isSelectorUniqueAmongSiblings,actionNameAttribute,currentSelector)||getPositionSelector(currentElement);currentSelector=combineSelector(elementSelector,currentSelector),currentElement=currentElement.parentElement}return currentSelector}__name(getSelectorFromElementWithinSubtree,"getSelectorFromElementWithinSubtree");function isGeneratedValue(value){return/[0-9]/.test(value)}__name(isGeneratedValue,"isGeneratedValue");function getIDSelector(element2){if(element2.id&&!isGeneratedValue(element2.id))return`#${CSS.escape(element2.id)}`}__name(getIDSelector,"getIDSelector");function getClassSelector(element2){if(element2.tagName==="BODY")return;const classList=element2.classList;for(let i2=0;i2<classList.length;i2+=1){const className=classList[i2];if(!isGeneratedValue(className))return`${CSS.escape(element2.tagName)}.${CSS.escape(className)}`}}__name(getClassSelector,"getClassSelector");function getTagNameSelector(element2){return CSS.escape(element2.tagName)}__name(getTagNameSelector,"getTagNameSelector");function getStableAttributeSelector(element2,actionNameAttribute){if(actionNameAttribute){const selector=getAttributeSelector(actionNameAttribute);if(selector)return selector}for(const attributeName of STABLE_ATTRIBUTES){const selector=getAttributeSelector(attributeName);if(selector)return selector}function getAttributeSelector(attributeName){if(element2.hasAttribute(attributeName))return`${CSS.escape(element2.tagName)}[${attributeName}="${CSS.escape(element2.getAttribute(attributeName))}"]`}__name(getAttributeSelector,"getAttributeSelector")}__name(getStableAttributeSelector,"getStableAttributeSelector");function getPositionSelector(element2){let sibling=element2.parentNode.firstElementChild,elementIndex=1;for(;sibling&&sibling!==element2;)sibling.tagName===element2.tagName&&(elementIndex+=1),sibling=sibling.nextElementSibling;return`${CSS.escape(element2.tagName)}:nth-of-type(${elementIndex})`}__name(getPositionSelector,"getPositionSelector");function findSelector(element2,rootNode,selectorGetters,predicate,actionNameAttribute,childSelector){for(const selectorGetter of selectorGetters){const elementSelector=selectorGetter(element2,actionNameAttribute);if(elementSelector&&predicate(element2,rootNode,elementSelector,childSelector))return elementSelector}}__name(findSelector,"findSelector");function isSelectorUniqueWithinRoot(_element,rootNode,elementSelector,childSelector){return rootNode.querySelectorAll(combineSelector(elementSelector,childSelector)).length===1}__name(isSelectorUniqueWithinRoot,"isSelectorUniqueWithinRoot");function isSelectorUniqueAmongSiblings(currentElement,_rootNode,currentElementSelector,childSelector){let isSiblingMatching;if(childSelector===void 0)isSiblingMatching=__name(sibling2=>sibling2.matches(currentElementSelector),"isSiblingMatching");else{const scopedSelector=combineSelector(`${currentElementSelector}:scope`,childSelector);isSiblingMatching=__name(sibling2=>sibling2.querySelector(scopedSelector)!==null,"isSiblingMatching")}let sibling=currentElement.previousElementSibling;for(;sibling;){if(isSiblingMatching(sibling))return!1;sibling=sibling.previousElementSibling}for(sibling=currentElement.nextElementSibling;sibling;){if(isSiblingMatching(sibling))return!1;sibling=sibling.nextElementSibling}return!0}__name(isSelectorUniqueAmongSiblings,"isSelectorUniqueAmongSiblings");function combineSelector(parent,child){return child?`${parent}>${child}`:parent}__name(combineSelector,"combineSelector");const NodePrivacyLevel={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:DefaultPrivacyLevel.ALLOW,MASK:DefaultPrivacyLevel.MASK,MASK_USER_INPUT:DefaultPrivacyLevel.MASK_USER_INPUT,MASK_UNLESS_ALLOWLISTED:DefaultPrivacyLevel.MASK_UNLESS_ALLOWLISTED},PRIVACY_ATTR_NAME="data-dd-privacy",PRIVACY_ATTR_VALUE_HIDDEN="hidden",PRIVACY_CLASS_PREFIX="dd-privacy-",CENSORED_STRING_MARK="***",CENSORED_IMG_MARK="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",FORM_PRIVATE_TAG_NAMES={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},TEXT_MASKING_CHAR="x";function getPrivacySelector(privacyLevel){return`[${PRIVACY_ATTR_NAME}="${privacyLevel}"], .${PRIVACY_CLASS_PREFIX}${privacyLevel}`}__name(getPrivacySelector,"getPrivacySelector");function getNodePrivacyLevel(node2,defaultPrivacyLevel,cache2){if(cache2&&cache2.has(node2))return cache2.get(node2);const parentNode=getParentNode$1(node2),parentNodePrivacyLevel=parentNode?getNodePrivacyLevel(parentNode,defaultPrivacyLevel,cache2):defaultPrivacyLevel,selfNodePrivacyLevel=getNodeSelfPrivacyLevel(node2),nodePrivacyLevel=reducePrivacyLevel(selfNodePrivacyLevel,parentNodePrivacyLevel);return cache2&&cache2.set(node2,nodePrivacyLevel),nodePrivacyLevel}__name(getNodePrivacyLevel,"getNodePrivacyLevel");function reducePrivacyLevel(childPrivacyLevel,parentNodePrivacyLevel){switch(parentNodePrivacyLevel){case NodePrivacyLevel.HIDDEN:case NodePrivacyLevel.IGNORE:return parentNodePrivacyLevel}switch(childPrivacyLevel){case NodePrivacyLevel.ALLOW:case NodePrivacyLevel.MASK:case NodePrivacyLevel.MASK_USER_INPUT:case NodePrivacyLevel.MASK_UNLESS_ALLOWLISTED:case NodePrivacyLevel.HIDDEN:case NodePrivacyLevel.IGNORE:return childPrivacyLevel;default:return parentNodePrivacyLevel}}__name(reducePrivacyLevel,"reducePrivacyLevel");function getNodeSelfPrivacyLevel(node2){if(isElementNode(node2)){if(node2.tagName==="BASE")return NodePrivacyLevel.ALLOW;if(node2.tagName==="INPUT"){const inputElement=node2;if(inputElement.type==="password"||inputElement.type==="email"||inputElement.type==="tel"||inputElement.type==="hidden")return NodePrivacyLevel.MASK;const autocomplete=inputElement.getAttribute("autocomplete");if(autocomplete&&(autocomplete.startsWith("cc-")||autocomplete.endsWith("-password")))return NodePrivacyLevel.MASK}if(node2.matches(getPrivacySelector(NodePrivacyLevel.HIDDEN)))return NodePrivacyLevel.HIDDEN;if(node2.matches(getPrivacySelector(NodePrivacyLevel.MASK)))return NodePrivacyLevel.MASK;if(node2.matches(getPrivacySelector(NodePrivacyLevel.MASK_UNLESS_ALLOWLISTED)))return NodePrivacyLevel.MASK_UNLESS_ALLOWLISTED;if(node2.matches(getPrivacySelector(NodePrivacyLevel.MASK_USER_INPUT)))return NodePrivacyLevel.MASK_USER_INPUT;if(node2.matches(getPrivacySelector(NodePrivacyLevel.ALLOW)))return NodePrivacyLevel.ALLOW;if(shouldIgnoreElement(node2))return NodePrivacyLevel.IGNORE}}__name(getNodeSelfPrivacyLevel,"getNodeSelfPrivacyLevel");function shouldMaskNode(node2,privacyLevel){switch(privacyLevel){case NodePrivacyLevel.MASK:case NodePrivacyLevel.HIDDEN:case NodePrivacyLevel.IGNORE:return!0;case NodePrivacyLevel.MASK_UNLESS_ALLOWLISTED:return isTextNode(node2)?isFormElement(node2.parentNode)?!0:!isAllowlisted(node2.textContent||""):isFormElement(node2);case NodePrivacyLevel.MASK_USER_INPUT:return isTextNode(node2)?isFormElement(node2.parentNode):isFormElement(node2);default:return!1}}__name(shouldMaskNode,"shouldMaskNode");function shouldMaskAttribute(tagName,attributeName,attributeValue,nodePrivacyLevel,configuration){if(nodePrivacyLevel!==NodePrivacyLevel.MASK&&nodePrivacyLevel!==NodePrivacyLevel.MASK_UNLESS_ALLOWLISTED||attributeName===PRIVACY_ATTR_NAME||STABLE_ATTRIBUTES.includes(attributeName)||attributeName===configuration.actionNameAttribute)return!1;switch(attributeName){case"title":case"alt":case"placeholder":case"aria-label":case"name":return!0}return!!(tagName==="A"&&attributeName==="href"||tagName==="IFRAME"&&attributeName==="srcdoc"||attributeValue&&attributeName.startsWith("data-")||(tagName==="IMG"||tagName==="SOURCE")&&(attributeName==="src"||attributeName==="srcset"))}__name(shouldMaskAttribute,"shouldMaskAttribute");function isFormElement(node2){if(!node2||node2.nodeType!==node2.ELEMENT_NODE)return!1;const element2=node2;if(element2.tagName==="INPUT")switch(element2.type){case"button":case"color":case"reset":case"submit":return!1}return!!FORM_PRIVATE_TAG_NAMES[element2.tagName]}__name(isFormElement,"isFormElement");const censorText=__name(text2=>text2.replace(/\S/g,TEXT_MASKING_CHAR),"censorText");function getTextContent(textNode,parentNodePrivacyLevel){var _a20;const parentTagName=(_a20=textNode.parentElement)===null||_a20===void 0?void 0:_a20.tagName;let textContent=textNode.textContent||"";if(parentTagName==="HEAD"&&!textContent.trim())return;const nodePrivacyLevel=parentNodePrivacyLevel;if(parentTagName==="SCRIPT")textContent=CENSORED_STRING_MARK;else if(nodePrivacyLevel===NodePrivacyLevel.HIDDEN)textContent=CENSORED_STRING_MARK;else if(shouldMaskNode(textNode,nodePrivacyLevel))if(parentTagName==="DATALIST"||parentTagName==="SELECT"||parentTagName==="OPTGROUP"){if(!textContent.trim())return}else parentTagName==="OPTION"?textContent=CENSORED_STRING_MARK:nodePrivacyLevel===NodePrivacyLevel.MASK_UNLESS_ALLOWLISTED?textContent=maskDisallowedTextContent(textContent):textContent=censorText(textContent);return textContent}__name(getTextContent,"getTextContent");function shouldIgnoreElement(element2){if(element2.nodeName==="SCRIPT")return!0;if(element2.nodeName==="LINK"){const relAttribute=getLowerCaseAttribute("rel");return/preload|prefetch/i.test(relAttribute)&&getLowerCaseAttribute("as")==="script"||relAttribute==="shortcut icon"||relAttribute==="icon"}if(element2.nodeName==="META"){const nameAttribute=getLowerCaseAttribute("name"),relAttribute=getLowerCaseAttribute("rel"),propertyAttribute=getLowerCaseAttribute("property");return/^msapplication-tile(image|color)$/.test(nameAttribute)||nameAttribute==="application-name"||relAttribute==="icon"||relAttribute==="apple-touch-icon"||relAttribute==="shortcut icon"||nameAttribute==="keywords"||nameAttribute==="description"||/^(og|twitter|fb):/.test(propertyAttribute)||/^(og|twitter):/.test(nameAttribute)||nameAttribute==="pinterest"||nameAttribute==="robots"||nameAttribute==="googlebot"||nameAttribute==="bingbot"||element2.hasAttribute("http-equiv")||nameAttribute==="author"||nameAttribute==="generator"||nameAttribute==="framework"||nameAttribute==="publisher"||nameAttribute==="progid"||/^article:/.test(propertyAttribute)||/^product:/.test(propertyAttribute)||nameAttribute==="google-site-verification"||nameAttribute==="yandex-verification"||nameAttribute==="csrf-token"||nameAttribute==="p:domain_verify"||nameAttribute==="verify-v1"||nameAttribute==="verification"||nameAttribute==="shopify-checkout-api-token"}function getLowerCaseAttribute(name2){return(element2.getAttribute(name2)||"").toLowerCase()}return __name(getLowerCaseAttribute,"getLowerCaseAttribute"),!1}__name(shouldIgnoreElement,"shouldIgnoreElement");function isAllowlisted(text2){var _a20;return!text2||!text2.trim()?!0:((_a20=window.$DD_ALLOW)===null||_a20===void 0?void 0:_a20.has(text2.toLocaleLowerCase()))||!1}__name(isAllowlisted,"isAllowlisted");function maskDisallowedTextContent(text2,fixedMask){return isAllowlisted(text2)?text2:fixedMask||censorText(text2)}__name(maskDisallowedTextContent,"maskDisallowedTextContent");function trackEventCounts({lifeCycle,isChildEvent,onChange:callback=noop$2}){const eventCounts={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},subscription=lifeCycle.subscribe(13,event=>{var _a20;if(!(event.type==="view"||event.type==="vital"||!isChildEvent(event)))switch(event.type){case RumEventType.ERROR:eventCounts.errorCount+=1,callback();break;case RumEventType.ACTION:eventCounts.actionCount+=1,event.action.frustration&&(eventCounts.frustrationCount+=event.action.frustration.type.length),callback();break;case RumEventType.LONG_TASK:eventCounts.longTaskCount+=1,callback();break;case RumEventType.RESOURCE:!((_a20=event._dd)===null||_a20===void 0)&&_a20.discarded||(eventCounts.resourceCount+=1,callback());break}});return{stop:__name(()=>{subscription.unsubscribe()},"stop"),eventCounts}}__name(trackEventCounts,"trackEventCounts");const EVENT_CONTEXT_TIME_OUT_DELAY=5*ONE_MINUTE;function startEventTracker(lifeCycle){const history2=createValueHistory({expireDelay:EVENT_CONTEXT_TIME_OUT_DELAY}),keyedEvents=new Map;function cleanUpEvent(event){var _a20;keyedEvents.delete(event.key),(_a20=event.eventCounts)===null||_a20===void 0||_a20.stop()}__name(cleanUpEvent,"cleanUpEvent");function discardAll(){keyedEvents.forEach(event=>{cleanUpEvent(event)}),history2.reset()}__name(discardAll,"discardAll");const sessionRenewalSubscription=lifeCycle.subscribe(10,discardAll);function start(key,startClocks,data,options){const id2=generateUUID(),historyEntry=history2.add(id2,startClocks.relative),existing=keyedEvents.get(key);existing&&cleanUpEvent(existing);const eventCounts=options?.isChildEvent?trackEventCounts({lifeCycle,isChildEvent:options.isChildEvent(id2)}):void 0;keyedEvents.set(key,{id:id2,key,startClocks,data,historyEntry,eventCounts})}__name(start,"start");function stop(key,stopClocks,extraData){var _a20;const event=keyedEvents.get(key);if(!event)return;const finalData=extraData?combine(event.data,extraData):event.data;event.historyEntry.close(stopClocks.relative);const duration2=elapsed(event.startClocks.timeStamp,stopClocks.timeStamp),counts=(_a20=event.eventCounts)===null||_a20===void 0?void 0:_a20.eventCounts;return cleanUpEvent(event),{...finalData,id:event.id,startClocks:event.startClocks,duration:duration2,counts}}__name(stop,"stop");function discard(key){var _a20;const event=keyedEvents.get(key);if(!event)return;const counts=(_a20=event.eventCounts)===null||_a20===void 0?void 0:_a20.eventCounts;return cleanUpEvent(event),event.historyEntry.remove(),{...event.data,id:event.id,startClocks:event.startClocks,counts}}__name(discard,"discard");function findId(startTime){return history2.findAll(startTime)}__name(findId,"findId");function getCounts(key){var _a20,_b;return(_b=(_a20=keyedEvents.get(key))===null||_a20===void 0?void 0:_a20.eventCounts)===null||_b===void 0?void 0:_b.eventCounts}__name(getCounts,"getCounts");function stopTracker(){sessionRenewalSubscription.unsubscribe(),discardAll(),history2.stop()}return __name(stopTracker,"stopTracker"),{start,stop,discard,getCounts,findId,stopAll:stopTracker}}__name(startEventTracker,"startEventTracker");const MAX_DURATION_BETWEEN_CLICKS=ONE_SECOND,MAX_DISTANCE_BETWEEN_CLICKS=100;function createClickChain(firstClick,onFinalize){const bufferedClicks=[];let status=0,maxDurationBetweenClicksTimeoutId;appendClick(firstClick);function appendClick(click){click.stopObservable.subscribe(tryFinalize),bufferedClicks.push(click),clearTimeout$1(maxDurationBetweenClicksTimeoutId),maxDurationBetweenClicksTimeoutId=setTimeout$1(dontAcceptMoreClick,MAX_DURATION_BETWEEN_CLICKS)}__name(appendClick,"appendClick");function tryFinalize(){status===1&&bufferedClicks.every(click=>click.isStopped())&&(status=2,onFinalize(bufferedClicks))}__name(tryFinalize,"tryFinalize");function dontAcceptMoreClick(){clearTimeout$1(maxDurationBetweenClicksTimeoutId),status===0&&(status=1,tryFinalize())}return __name(dontAcceptMoreClick,"dontAcceptMoreClick"),{tryAppend:__name(click=>status!==0?!1:bufferedClicks.length>0&&!areEventsSimilar(bufferedClicks[bufferedClicks.length-1].event,click.event)?(dontAcceptMoreClick(),!1):(appendClick(click),!0),"tryAppend"),stop:__name(()=>{dontAcceptMoreClick()},"stop")}}__name(createClickChain,"createClickChain");function areEventsSimilar(first,second){return first.target===second.target&&mouseEventDistance(first,second)<=MAX_DISTANCE_BETWEEN_CLICKS&&first.timeStamp-second.timeStamp<=MAX_DURATION_BETWEEN_CLICKS}__name(areEventsSimilar,"areEventsSimilar");function mouseEventDistance(origin2,other){return Math.sqrt(Math.pow(origin2.clientX-other.clientX,2)+Math.pow(origin2.clientY-other.clientY,2))}__name(mouseEventDistance,"mouseEventDistance");function getActionNameFromElement(element2,rumConfiguration,nodePrivacyLevel=NodePrivacyLevel.ALLOW){const nodePrivacyLevelCache=new Map,{actionNameAttribute:userProgrammaticAttribute}=rumConfiguration,defaultActionName=getActionNameFromElementProgrammatically(element2,DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE)||userProgrammaticAttribute&&getActionNameFromElementProgrammatically(element2,userProgrammaticAttribute);return defaultActionName?{name:defaultActionName,nameSource:"custom_attribute"}:nodePrivacyLevel===NodePrivacyLevel.MASK?{name:ACTION_NAME_PLACEHOLDER,nameSource:"mask_placeholder"}:getActionNameFromElementForStrategies(element2,priorityStrategies,rumConfiguration,nodePrivacyLevelCache)||getActionNameFromElementForStrategies(element2,fallbackStrategies,rumConfiguration,nodePrivacyLevelCache)||{name:"",nameSource:"blank"}}__name(getActionNameFromElement,"getActionNameFromElement");function getActionNameFromElementProgrammatically(targetElement,programmaticAttribute){const elementWithAttribute=closestShadowAware(targetElement,`[${programmaticAttribute}]`);if(!elementWithAttribute)return;const name2=elementWithAttribute.getAttribute(programmaticAttribute);return truncate(normalizeWhitespace(name2.trim()))}__name(getActionNameFromElementProgrammatically,"getActionNameFromElementProgrammatically");function closestShadowAware(element2,selector){let current=element2;for(;current;){if(current.matches(selector))return current;current=getParentElement(current)}return null}__name(closestShadowAware,"closestShadowAware");const priorityStrategies=[(element2,rumConfiguration,nodePrivacyLevelCache)=>{if("labels"in element2&&element2.labels&&element2.labels.length>0)return getActionNameFromTextualContent(element2.labels[0],rumConfiguration,nodePrivacyLevelCache)},element2=>{if(element2.nodeName==="INPUT"){const input=element2,type=input.getAttribute("type");if(type==="button"||type==="submit"||type==="reset")return{name:input.value,nameSource:"text_content"}}},(element2,rumConfiguration,nodePrivacyLevelCache)=>{if(element2.nodeName==="BUTTON"||element2.nodeName==="LABEL"||element2.getAttribute("role")==="button")return getActionNameFromTextualContent(element2,rumConfiguration,nodePrivacyLevelCache)},(element2,rumConfiguration,nodePrivacyLevelCache)=>getActionNameFromStandardAttribute(element2,"aria-label",rumConfiguration,nodePrivacyLevelCache),(element2,rumConfiguration,nodePrivacyLevelCache)=>{const labelledByAttribute=element2.getAttribute("aria-labelledby");if(labelledByAttribute)return{name:labelledByAttribute.split(/\s+/).map(id2=>getElementById(element2,id2)).filter(label=>!!label).map(element3=>getTextualContent(element3,rumConfiguration,nodePrivacyLevelCache)).join(" "),nameSource:"text_content"}},(element2,rumConfiguration,nodePrivacyLevelCache)=>getActionNameFromStandardAttribute(element2,"alt",rumConfiguration,nodePrivacyLevelCache),(element2,rumConfiguration,nodePrivacyLevelCache)=>getActionNameFromStandardAttribute(element2,"name",rumConfiguration,nodePrivacyLevelCache),(element2,rumConfiguration,nodePrivacyLevelCache)=>getActionNameFromStandardAttribute(element2,"title",rumConfiguration,nodePrivacyLevelCache),(element2,rumConfiguration,nodePrivacyLevelCache)=>getActionNameFromStandardAttribute(element2,"placeholder",rumConfiguration,nodePrivacyLevelCache),(element2,rumConfiguration,nodePrivacyLevelCache)=>{if("options"in element2&&element2.options.length>0)return getActionNameFromTextualContent(element2.options[0],rumConfiguration,nodePrivacyLevelCache)}],fallbackStrategies=[(element2,rumConfiguration,nodePrivacyLevelCache)=>getActionNameFromTextualContent(element2,rumConfiguration,nodePrivacyLevelCache)],MAX_PARENTS_TO_CONSIDER=10;function getActionNameFromElementForStrategies(targetElement,strategies,rumConfiguration,nodePrivacyLevelCache){let element2=targetElement,recursionCounter=0;for(;recursionCounter<=MAX_PARENTS_TO_CONSIDER&&element2&&element2.nodeName!=="BODY"&&element2.nodeName!=="HTML"&&element2.nodeName!=="HEAD";){for(const strategy of strategies){const actionName=strategy(element2,rumConfiguration,nodePrivacyLevelCache);if(actionName){const{name:name2,nameSource}=actionName,trimmedName=name2&&name2.trim();if(trimmedName)return{name:truncate(normalizeWhitespace(trimmedName)),nameSource}}}if(element2.nodeName==="FORM")break;element2=getParentElement(element2),recursionCounter+=1}}__name(getActionNameFromElementForStrategies,"getActionNameFromElementForStrategies");function normalizeWhitespace(s2){return s2.replace(/\s+/g," ")}__name(normalizeWhitespace,"normalizeWhitespace");function truncate(s2){return s2.length>100?`${safeTruncate(s2,100)} [...]`:s2}__name(truncate,"truncate");function getElementById(refElement,id2){const rootNode=refElement.getRootNode();if(rootNode instanceof ShadowRoot){const shadowElement=rootNode.getElementById(id2);if(shadowElement)return shadowElement}return refElement.ownerDocument?refElement.ownerDocument.getElementById(id2):null}__name(getElementById,"getElementById");function getActionNameFromStandardAttribute(element2,attribute,rumConfiguration,nodePrivacyLevelCache){const{enablePrivacyForActionName,defaultPrivacyLevel}=rumConfiguration;let attributeValue=element2.getAttribute(attribute);if(attributeValue&&enablePrivacyForActionName){const nodePrivacyLevel=getNodePrivacyLevel(element2,defaultPrivacyLevel,nodePrivacyLevelCache);shouldMaskAttribute(element2.tagName,attribute,attributeValue,nodePrivacyLevel,rumConfiguration)&&(attributeValue=maskDisallowedTextContent(attributeValue,ACTION_NAME_PLACEHOLDER))}else attributeValue||(attributeValue="");return{name:attributeValue,nameSource:"standard_attribute"}}__name(getActionNameFromStandardAttribute,"getActionNameFromStandardAttribute");function getActionNameFromTextualContent(element2,rumConfiguration,nodePrivacyLevelCache){return{name:getTextualContent(element2,rumConfiguration,nodePrivacyLevelCache)||"",nameSource:"text_content"}}__name(getActionNameFromTextualContent,"getActionNameFromTextualContent");function getTextualContent(element2,rumConfiguration,nodePrivacyLevelCache){if(element2.isContentEditable)return;const{enablePrivacyForActionName,actionNameAttribute:userProgrammaticAttribute,defaultPrivacyLevel}=rumConfiguration;if(isExperimentalFeatureEnabled(ExperimentalFeature.USE_TREE_WALKER_FOR_ACTION_NAME))return getTextualContentWithTreeWalker(element2,userProgrammaticAttribute,enablePrivacyForActionName,defaultPrivacyLevel,nodePrivacyLevelCache);if("innerText"in element2){let text2=element2.innerText;const removeTextFromElements=__name(query=>{const list2=element2.querySelectorAll(query);for(let index2=0;index2<list2.length;index2+=1){const element3=list2[index2];if("innerText"in element3){const textToReplace=element3.innerText;textToReplace&&textToReplace.trim().length>0&&(text2=text2.replace(textToReplace,""))}}},"removeTextFromElements");return removeTextFromElements(`[${DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE}]`),userProgrammaticAttribute&&removeTextFromElements(`[${userProgrammaticAttribute}]`),enablePrivacyForActionName&&removeTextFromElements(`${getPrivacySelector(NodePrivacyLevel.HIDDEN)}, ${getPrivacySelector(NodePrivacyLevel.MASK)}`),text2}return element2.textContent}__name(getTextualContent,"getTextualContent");function getTextualContentWithTreeWalker(element2,userProgrammaticAttribute,privacyEnabledActionName,defaultPrivacyLevel,nodePrivacyLevelCache){const walker=document.createTreeWalker(element2,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,rejectInvisibleOrMaskedElementsFilter);let text2="";for(;walker.nextNode();){const node2=walker.currentNode;if(isElementNode(node2)){(node2.nodeName==="BR"||node2.nodeName==="P"||["block","flex","grid","list-item","table","table-caption"].includes(getComputedStyle(node2).display))&&(text2+=" ");continue}text2+=node2.textContent||""}return text2.replace(/\s+/g," ").trim();function rejectInvisibleOrMaskedElementsFilter(node2){const nodeSelfPrivacyLevel=getNodePrivacyLevel(node2,defaultPrivacyLevel,nodePrivacyLevelCache);if(privacyEnabledActionName&&nodeSelfPrivacyLevel&&shouldMaskNode(node2,nodeSelfPrivacyLevel))return NodeFilter.FILTER_REJECT;if(isElementNode(node2)){if(node2.hasAttribute(DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE)||userProgrammaticAttribute&&node2.hasAttribute(userProgrammaticAttribute))return NodeFilter.FILTER_REJECT;const style=getComputedStyle(node2);if(style.visibility!=="visible"||style.display==="none"||style.contentVisibility&&style.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}__name(getTextualContentWithTreeWalker,"getTextualContentWithTreeWalker");function listenActionEvents(configuration,{onPointerDown,onPointerUp}){let selectionEmptyAtPointerDown,userActivity={selection:!1,input:!1,scroll:!1},clickContext;const listeners=[addEventListener(configuration,window,"pointerdown",event=>{isValidPointerEvent(event)&&(selectionEmptyAtPointerDown=isSelectionEmpty(),userActivity={selection:!1,input:!1,scroll:!1},clickContext=onPointerDown(event))},{capture:!0}),addEventListener(configuration,window,"selectionchange",()=>{(!selectionEmptyAtPointerDown||!isSelectionEmpty())&&(userActivity.selection=!0)},{capture:!0}),addEventListener(configuration,window,"scroll",()=>{userActivity.scroll=!0},{capture:!0,passive:!0}),addEventListener(configuration,window,"pointerup",event=>{if(isValidPointerEvent(event)&&clickContext){const localUserActivity=userActivity;onPointerUp(clickContext,event,()=>localUserActivity),clickContext=void 0}},{capture:!0}),addEventListener(configuration,window,"input",()=>{userActivity.input=!0},{capture:!0})];return{stop:__name(()=>{listeners.forEach(listener=>listener.stop())},"stop")}}__name(listenActionEvents,"listenActionEvents");function isSelectionEmpty(){const selection=window.getSelection();return!selection||selection.isCollapsed}__name(isSelectionEmpty,"isSelectionEmpty");function isValidPointerEvent(event){return event.target instanceof Element&&event.isPrimary!==!1}__name(isValidPointerEvent,"isValidPointerEvent");const MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE=3;function computeFrustration(clicks,rageClick){if(isRage(clicks))return rageClick.addFrustration(FrustrationType.RAGE_CLICK),clicks.some(isDead)&&rageClick.addFrustration(FrustrationType.DEAD_CLICK),rageClick.hasError&&rageClick.addFrustration(FrustrationType.ERROR_CLICK),{isRage:!0};const hasSelectionChanged=clicks.some(click=>click.getUserActivity().selection);return clicks.forEach(click=>{click.hasError&&click.addFrustration(FrustrationType.ERROR_CLICK),isDead(click)&&!hasSelectionChanged&&click.addFrustration(FrustrationType.DEAD_CLICK)}),{isRage:!1}}__name(computeFrustration,"computeFrustration");function isRage(clicks){if(clicks.some(click=>click.getUserActivity().selection||click.getUserActivity().scroll))return!1;for(let i2=0;i2<clicks.length-(MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE-1);i2+=1)if(clicks[i2+MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE-1].event.timeStamp-clicks[i2].event.timeStamp<=ONE_SECOND)return!0;return!1}__name(isRage,"isRage");const DEAD_CLICK_EXCLUDE_SELECTOR='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 isDead(click){if(click.hasPageActivity||click.getUserActivity().input||click.getUserActivity().scroll)return!1;let target=click.event.target;return target.tagName==="LABEL"&&target.hasAttribute("for")&&(target=document.getElementById(target.getAttribute("for"))),!target||!target.matches(DEAD_CLICK_EXCLUDE_SELECTOR)}__name(isDead,"isDead");const CLICK_ACTION_MAX_DURATION=10*ONE_SECOND,interactionSelectorCache=new Map;function getInteractionSelector(relativeTimestamp){const selector=interactionSelectorCache.get(relativeTimestamp);return interactionSelectorCache.delete(relativeTimestamp),selector}__name(getInteractionSelector,"getInteractionSelector");function updateInteractionSelector(relativeTimestamp,selector){interactionSelectorCache.set(relativeTimestamp,selector),interactionSelectorCache.forEach((_2,relativeTimestamp2)=>{elapsed(relativeTimestamp2,relativeNow())>CLICK_ACTION_MAX_DURATION&&interactionSelectorCache.delete(relativeTimestamp2)})}__name(updateInteractionSelector,"updateInteractionSelector");function isActionChildEvent(id2){return event=>event.action!==void 0&&event.action.id!==void 0&&event.action.id.includes(id2)}__name(isActionChildEvent,"isActionChildEvent");function trackClickActions(lifeCycle,domMutationObservable,windowOpenObservable,configuration){const actionTracker=startEventTracker(lifeCycle),stopObservable=new Observable;let currentClickChain;lifeCycle.subscribe(5,stopClickChain),lifeCycle.subscribe(11,stopClickChain);const{stop:stopActionEventsListener}=listenActionEvents(configuration,{onPointerDown:__name(pointerDownEvent=>processPointerDown(configuration,lifeCycle,domMutationObservable,pointerDownEvent,windowOpenObservable),"onPointerDown"),onPointerUp:__name(({clickActionBase,hadActivityOnPointerDown},startEvent,getUserActivity)=>{startClickAction(configuration,lifeCycle,domMutationObservable,windowOpenObservable,actionTracker,stopObservable,appendClickToClickChain,clickActionBase,startEvent,getUserActivity,hadActivityOnPointerDown)},"onPointerUp")});return{stop:__name(()=>{stopClickChain(),stopObservable.notify(),stopActionEventsListener(),actionTracker.stopAll()},"stop"),findActionId:actionTracker.findId};function appendClickToClickChain(click){if(!currentClickChain||!currentClickChain.tryAppend(click)){const rageClick=click.clone();currentClickChain=createClickChain(click,clicks=>{finalizeClicks(clicks,rageClick),currentClickChain=void 0})}}function stopClickChain(){currentClickChain&¤tClickChain.stop()}}__name(trackClickActions,"trackClickActions");function processPointerDown(configuration,lifeCycle,domMutationObservable,pointerDownEvent,windowOpenObservable){const targetForPrivacy=configuration.betaTrackActionsInShadowDom?getEventTarget(pointerDownEvent):pointerDownEvent.target;let nodePrivacyLevel;if(configuration.enablePrivacyForActionName?nodePrivacyLevel=getNodePrivacyLevel(targetForPrivacy,configuration.defaultPrivacyLevel):nodePrivacyLevel=NodePrivacyLevel.ALLOW,nodePrivacyLevel===NodePrivacyLevel.HIDDEN)return;const clickActionBase=computeClickActionBase(pointerDownEvent,nodePrivacyLevel,configuration);let hadActivityOnPointerDown=!1;return waitPageActivityEnd(lifeCycle,domMutationObservable,windowOpenObservable,configuration,pageActivityEndEvent=>{hadActivityOnPointerDown=pageActivityEndEvent.hadActivity},PAGE_ACTIVITY_VALIDATION_DELAY),{clickActionBase,hadActivityOnPointerDown:__name(()=>hadActivityOnPointerDown,"hadActivityOnPointerDown")}}__name(processPointerDown,"processPointerDown");function startClickAction(configuration,lifeCycle,domMutationObservable,windowOpenObservable,actionTracker,stopObservable,appendClickToClickChain,clickActionBase,startEvent,getUserActivity,hadActivityOnPointerDown){var _a20;const click=newClick(lifeCycle,actionTracker,getUserActivity,clickActionBase,startEvent);appendClickToClickChain(click);const selector=(_a20=clickActionBase?.target)===null||_a20===void 0?void 0:_a20.selector;selector&&updateInteractionSelector(startEvent.timeStamp,selector);const{stop:stopWaitPageActivityEnd}=waitPageActivityEnd(lifeCycle,domMutationObservable,windowOpenObservable,configuration,pageActivityEndEvent=>{pageActivityEndEvent.hadActivity&&pageActivityEndEvent.end<click.startClocks.timeStamp?click.discard():pageActivityEndEvent.hadActivity?click.stop(pageActivityEndEvent.end):hadActivityOnPointerDown()?click.stop(click.startClocks.timeStamp):click.stop()},CLICK_ACTION_MAX_DURATION),viewEndedSubscription=lifeCycle.subscribe(5,({endClocks})=>{click.stop(endClocks.timeStamp)}),pageMayExitSubscription=lifeCycle.subscribe(11,()=>{click.stop(timeStampNow())}),stopSubscription=stopObservable.subscribe(()=>{click.stop()});click.stopObservable.subscribe(()=>{pageMayExitSubscription.unsubscribe(),viewEndedSubscription.unsubscribe(),stopWaitPageActivityEnd(),stopSubscription.unsubscribe()})}__name(startClickAction,"startClickAction");function computeClickActionBase(event,nodePrivacyLevel,configuration){const target=configuration.betaTrackActionsInShadowDom?getEventTarget(event):event.target,rect=target.getBoundingClientRect(),selector=getSelectorFromElement(target,configuration.actionNameAttribute);selector&&updateInteractionSelector(event.timeStamp,selector);const{name:name2,nameSource}=getActionNameFromElement(target,configuration,nodePrivacyLevel);return{type:ActionType.CLICK,target:{width:Math.round(rect.width),height:Math.round(rect.height),selector},position:{x:Math.round(event.clientX-rect.left),y:Math.round(event.clientY-rect.top)},name:name2,nameSource}}__name(computeClickActionBase,"computeClickActionBase");function getEventTarget(event){if(event.composed&&isNodeShadowHost(event.target)&&typeof event.composedPath=="function"){const composedPath=event.composedPath();if(composedPath.length>0&&composedPath[0]instanceof Element)return composedPath[0]}return event.target}__name(getEventTarget,"getEventTarget");function newClick(lifeCycle,actionTracker,getUserActivity,clickActionBase,startEvent){const clickKey=generateUUID(),startClocks=relativeToClocks(startEvent.timeStamp);actionTracker.start(clickKey,startClocks,clickActionBase,{isChildEvent:isActionChildEvent});let status=0,actionTrackerFinishedEvent;const frustrationTypes=[],stopObservable=new Observable;function stop(activityEndTime){status===0&&(status=1,actionTrackerFinishedEvent=activityEndTime?actionTracker.stop(clickKey,timeStampToClocks(activityEndTime)):actionTracker.discard(clickKey),stopObservable.notify())}return __name(stop,"stop"),{event:startEvent,stop,stopObservable,get hasError(){var _a20;const currentCounts=(_a20=actionTrackerFinishedEvent?.counts)!==null&&_a20!==void 0?_a20:actionTracker.getCounts(clickKey);return currentCounts?currentCounts.errorCount>0:!1},get hasPageActivity(){return actionTrackerFinishedEvent&&"duration"in actionTrackerFinishedEvent},getUserActivity,addFrustration:__name(frustrationType=>{frustrationTypes.push(frustrationType)},"addFrustration"),get startClocks(){return startClocks},isStopped:__name(()=>status===1||status===2,"isStopped"),clone:__name(()=>newClick(lifeCycle,actionTracker,getUserActivity,clickActionBase,startEvent),"clone"),validate:__name(domEvents=>{if(stop(),status!==1||!actionTrackerFinishedEvent)return;const clickAction={frustrationTypes,events:domEvents??[startEvent],event:startEvent,...actionTrackerFinishedEvent,counts:actionTrackerFinishedEvent.counts};lifeCycle.notify(0,clickAction),status=2},"validate"),discard:__name(()=>{stop(),status=2},"discard")}}__name(newClick,"newClick");function finalizeClicks(clicks,rageClick){const{isRage:isRage2}=computeFrustration(clicks,rageClick);isRage2?(clicks.forEach(click=>click.discard()),rageClick.stop(timeStampNow()),rageClick.validate(clicks.map(click=>click.event))):(rageClick.discard(),clicks.forEach(click=>click.validate()))}__name(finalizeClicks,"finalizeClicks");function trackManualActions(lifeCycle,onManualActionCompleted){const actionTracker=startEventTracker(lifeCycle);function startManualAction(name2,options={},startClocks=clocksNow()){var _a20;const lookupKey=(_a20=options.actionKey)!==null&&_a20!==void 0?_a20:name2;actionTracker.start(lookupKey,startClocks,{name:name2,...options},{isChildEvent:isActionChildEvent})}__name(startManualAction,"startManualAction");function stopManualAction(name2,options={},stopClocks=clocksNow()){var _a20;const lookupKey=(_a20=options.actionKey)!==null&&_a20!==void 0?_a20:name2,stopped=actionTracker.stop(lookupKey,stopClocks,options);if(!stopped)return;const frustrationTypes=[];stopped.counts&&stopped.counts.errorCount>0&&frustrationTypes.push(FrustrationType.ERROR_CLICK);const manualAction={...stopped,type:stopped.type||ActionType.CUSTOM,frustrationTypes};onManualActionCompleted(manualAction)}__name(stopManualAction,"stopManualAction");function addInstantAction(action){onManualActionCompleted({id:generateUUID(),frustrationTypes:[],...action})}return __name(addInstantAction,"addInstantAction"),{addAction:addInstantAction,startAction:startManualAction,stopAction:stopManualAction,findActionId:actionTracker.findId,stop:actionTracker.stopAll}}__name(trackManualActions,"trackManualActions");const LONG_TASK_START_TIME_CORRECTION=1;function startActionCollection(lifeCycle,hooks,domMutationObservable,windowOpenObservable,configuration){const{unsubscribe:unsubscribeAutoAction}=lifeCycle.subscribe(0,action=>{lifeCycle.notify(12,processAction(action))});let clickActions;configuration.trackUserInteractions&&(clickActions=trackClickActions(lifeCycle,domMutationObservable,windowOpenObservable,configuration));const manualActions=trackManualActions(lifeCycle,action=>{lifeCycle.notify(12,processAction(action))}),actionContexts={findActionId:__name(startTime=>{var _a20;const manualActionId=manualActions.findActionId(startTime),clickActionId=(_a20=clickActions?.findActionId(startTime))!==null&&_a20!==void 0?_a20:[];return manualActionId.concat(clickActionId)},"findActionId")};return hooks.register(0,({startTime,eventType})=>{if(eventType!==RumEventType.ERROR&&eventType!==RumEventType.RESOURCE&&eventType!==RumEventType.LONG_TASK)return SKIPPED;const correctedStartTime=eventType===RumEventType.LONG_TASK?addDuration(startTime,LONG_TASK_START_TIME_CORRECTION):startTime,actionId=actionContexts.findActionId(correctedStartTime);return actionId.length?{type:eventType,action:{id:actionId}}:SKIPPED}),hooks.register(1,({startTime})=>({action:{id:actionContexts.findActionId(startTime)}})),{addAction:manualActions.addAction,startAction:manualActions.startAction,stopAction:manualActions.stopAction,actionContexts,stop:__name(()=>{unsubscribeAutoAction(),manualActions.stop(),clickActions?.stop()},"stop")}}__name(startActionCollection,"startActionCollection");function processAction(action){const isAuto=isAutoAction(action),loadingTime=discardNegativeDuration(toServerDuration(action.duration));return{rawRumEvent:{type:RumEventType.ACTION,date:action.startClocks.timeStamp,action:{id:action.id,target:{name:action.name},type:action.type,...loadingTime!==void 0&&{loading_time:loadingTime},...action.counts&&{error:{count:action.counts.errorCount},long_task:{count:action.counts.longTaskCount},resource:{count:action.counts.resourceCount}},frustration:{type:action.frustrationTypes}},...isAuto?{_dd:{action:{target:action.target,position:action.position,name_source:action.nameSource}}}:{context:action.context}},duration:action.duration,startClocks:action.startClocks,domainContext:isAuto?{events:action.events}:{handlingStack:action.handlingStack}}}__name(processAction,"processAction");function isAutoAction(action){return"events"in action}__name(isAutoAction,"isAutoAction");function trackConsoleError(errorObservable){const subscription=initConsoleObservable([ConsoleApiName.error]).subscribe(consoleLog=>errorObservable.notify(consoleLog.error));return{stop:__name(()=>{subscription.unsubscribe()},"stop")}}__name(trackConsoleError,"trackConsoleError");function trackReportError(configuration,errorObservable){const subscription=initReportObservable(configuration,[RawReportType.cspViolation,RawReportType.intervention]).subscribe(rawError=>errorObservable.notify(rawError));return{stop:__name(()=>{subscription.unsubscribe()},"stop")}}__name(trackReportError,"trackReportError");function startErrorCollection(lifeCycle,configuration,bufferedDataObservable){const errorObservable=new Observable;return bufferedDataObservable.subscribe(bufferedData=>{bufferedData.type===0&&errorObservable.notify(bufferedData.error)}),trackConsoleError(errorObservable),trackReportError(configuration,errorObservable),errorObservable.subscribe(error2=>lifeCycle.notify(14,{error:error2})),doStartErrorCollection(lifeCycle)}__name(startErrorCollection,"startErrorCollection");function doStartErrorCollection(lifeCycle){return lifeCycle.subscribe(14,({error:error2})=>{lifeCycle.notify(12,processError(error2))}),{addError:__name(({error:error2,handlingStack,componentStack,startClocks,context})=>{const rawError=computeRawError({originalError:error2,handlingStack,componentStack,startClocks,nonErrorPrefix:"Provided",source:ErrorSource.CUSTOM,handling:"handled"});rawError.context=combine(rawError.context,context),lifeCycle.notify(14,{error:rawError})},"addError")}}__name(doStartErrorCollection,"doStartErrorCollection");function processError(error2){const rawRumEvent={date:error2.startClocks.timeStamp,error:{id:generateUUID(),message:error2.message,source:error2.source,stack:error2.stack,handling_stack:error2.handlingStack,component_stack:error2.componentStack,type:error2.type,handling:error2.handling,causes:error2.causes,source_type:"browser",fingerprint:error2.fingerprint,csp:error2.csp},type:RumEventType.ERROR,context:error2.context},domainContext={error:error2.originalError,handlingStack:error2.handlingStack};return{rawRumEvent,startClocks:error2.startClocks,domainContext}}__name(processError,"processError");const alreadyMatchedEntries=new WeakSet;function matchRequestResourceEntry(request){if(!performance||!("getEntriesByName"in performance))return;const sameNameEntries=performance.getEntriesByName(request.url,"resource");if(!sameNameEntries.length||!("toJSON"in sameNameEntries[0]))return;const candidates=sameNameEntries.filter(entry=>!alreadyMatchedEntries.has(entry)).filter(entry=>hasValidResourceEntryDuration(entry)&&hasValidResourceEntryTimings(entry)).filter(entry=>isBetween(entry,request.startClocks.relative,endTime({startTime:request.startClocks.relative,duration:request.duration})));if(candidates.length===1)return alreadyMatchedEntries.add(candidates[0]),candidates[0].toJSON()}__name(matchRequestResourceEntry,"matchRequestResourceEntry");function endTime(timing){return addDuration(timing.startTime,timing.duration)}__name(endTime,"endTime");function isBetween(timing,start,end){return timing.startTime>=start-1&&endTime(timing)<=addDuration(end,1)}__name(isBetween,"isBetween");const INITIAL_DOCUMENT_OUTDATED_TRACE_ID_THRESHOLD=2*ONE_MINUTE;function getDocumentTraceId(document2){const data=getDocumentTraceDataFromMeta(document2)||getDocumentTraceDataFromComment(document2);if(!(!data||data.traceTime<=dateNow()-INITIAL_DOCUMENT_OUTDATED_TRACE_ID_THRESHOLD))return data.traceId}__name(getDocumentTraceId,"getDocumentTraceId");function getDocumentTraceDataFromMeta(document2){const traceIdMeta=document2.querySelector("meta[name=dd-trace-id]"),traceTimeMeta=document2.querySelector("meta[name=dd-trace-time]");return createDocumentTraceData(traceIdMeta&&traceIdMeta.content,traceTimeMeta&&traceTimeMeta.content)}__name(getDocumentTraceDataFromMeta,"getDocumentTraceDataFromMeta");function getDocumentTraceDataFromComment(document2){const comment=findTraceComment(document2);if(comment)return createDocumentTraceData(findCommaSeparatedValue(comment,"trace-id"),findCommaSeparatedValue(comment,"trace-time"))}__name(getDocumentTraceDataFromComment,"getDocumentTraceDataFromComment");function createDocumentTraceData(traceId,rawTraceTime){const traceTime=rawTraceTime&&Number(rawTraceTime);if(!(!traceId||!traceTime))return{traceId,traceTime}}__name(createDocumentTraceData,"createDocumentTraceData");function findTraceComment(document2){for(let i2=0;i2<document2.childNodes.length;i2+=1){const comment=getTraceCommentFromNode(document2.childNodes[i2]);if(comment)return comment}if(document2.body)for(let i2=document2.body.childNodes.length-1;i2>=0;i2-=1){const node2=document2.body.childNodes[i2],comment=getTraceCommentFromNode(node2);if(comment)return comment;if(!isTextNode(node2))break}}__name(findTraceComment,"findTraceComment");function getTraceCommentFromNode(node2){if(node2&&isCommentNode(node2)){const match=/^\s*DATADOG;(.*?)\s*$/.exec(node2.data);if(match)return match[1]}}__name(getTraceCommentFromNode,"getTraceCommentFromNode");function getNavigationEntry(){if(supportPerformanceTimingEvent(RumPerformanceEntryType.NAVIGATION)){const navigationEntry=performance.getEntriesByType(RumPerformanceEntryType.NAVIGATION)[0];if(navigationEntry)return navigationEntry}const timings=computeTimingsFromDeprecatedPerformanceTiming(),entry={entryType:RumPerformanceEntryType.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:timings.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:__name(()=>({...entry,toJSON:void 0}),"toJSON"),...timings};return entry}__name(getNavigationEntry,"getNavigationEntry");function computeTimingsFromDeprecatedPerformanceTiming(){const result={},timing=performance.timing;for(const key in timing)if(isNumber$1(timing[key])){const numberKey=key,timingElement=timing[numberKey];result[numberKey]=timingElement===0?0:getRelativeTime(timingElement)}return result}__name(computeTimingsFromDeprecatedPerformanceTiming,"computeTimingsFromDeprecatedPerformanceTiming");function sanitizeFirstByte(entry){return entry.responseStart>=0&&entry.responseStart<=relativeNow()?entry.responseStart:void 0}__name(sanitizeFirstByte,"sanitizeFirstByte");function getResourceEntries(){if(supportPerformanceTimingEvent(RumPerformanceEntryType.RESOURCE))return performance.getEntriesByType(RumPerformanceEntryType.RESOURCE)}__name(getResourceEntries,"getResourceEntries");function findLcpResourceEntry(resourceUrl,lcpStartTime){const entries=getResourceEntries();if(entries)return findLast(entries,entry=>entry.name===resourceUrl&&entry.startTime<=lcpStartTime)}__name(findLcpResourceEntry,"findLcpResourceEntry");function retrieveInitialDocumentResourceTiming(configuration,callback){runOnReadyState(configuration,"interactive",()=>{const navigationEntry=getNavigationEntry(),entry=Object.assign(navigationEntry.toJSON(),{entryType:RumPerformanceEntryType.RESOURCE,initiatorType:FAKE_INITIAL_DOCUMENT,duration:navigationEntry.responseEnd,traceId:getDocumentTraceId(document),toJSON:__name(()=>({...entry,toJSON:void 0}),"toJSON")});callback(entry)})}__name(retrieveInitialDocumentResourceTiming,"retrieveInitialDocumentResourceTiming");const MAX_REQUESTS=1e3;function createRequestRegistry(lifeCycle){const requests=new Set,subscription=lifeCycle.subscribe(8,request=>{requests.add(request),requests.size>MAX_REQUESTS&&(addTelemetryDebug("Too many requests"),requests.delete(requests.values().next().value))});return{getMatchingRequest(entry){let minTimeDifference=1/0,closestRequest;for(const request of requests){const timeDifference=entry.startTime-request.startClocks.relative;0<=timeDifference&&timeDifference<minTimeDifference&&request.url===entry.name&&(minTimeDifference=Math.abs(timeDifference),closestRequest=request)}return closestRequest&&requests.delete(closestRequest),closestRequest},stop(){subscription.unsubscribe()}}}__name(createRequestRegistry,"createRequestRegistry");function trackManualResources(lifeCycle,resourceTracker){function emitResource(id2,startClocks,data,statusCode,endClocks){const duration2=endClocks?elapsed(startClocks.relative,endClocks.relative):void 0,rawRumEvent={date:startClocks.timeStamp,type:RumEventType.RESOURCE,resource:{id:id2,type:data.type||ResourceType.OTHER,url:sanitizeIfLongDataUrl(data.url),duration:duration2!==void 0?toServerDuration(duration2):void 0,method:data.method,status_code:statusCode},_dd:{},context:data.context};lifeCycle.notify(12,{rawRumEvent,startClocks,duration:duration2,domainContext:{isManual:!0}})}__name(emitResource,"emitResource");function startManualResource(url2,options={},startClocks=clocksNow()){var _a20;const lookupKey=(_a20=options.resourceKey)!==null&&_a20!==void 0?_a20:url2;resourceTracker.start(lookupKey,startClocks,{url:url2,...options})}__name(startManualResource,"startManualResource");function stopManualResource(url2,options={},stopClocks=clocksNow()){var _a20;const lookupKey=(_a20=options.resourceKey)!==null&&_a20!==void 0?_a20:url2,stopped=resourceTracker.stop(lookupKey,stopClocks,{context:options.context});stopped&&emitResource(stopped.id,stopped.startClocks,stopped,options.statusCode,stopClocks)}return __name(stopManualResource,"stopManualResource"),{startResource:startManualResource,stopResource:stopManualResource}}__name(trackManualResources,"trackManualResources");function startResourceCollection(lifeCycle,configuration,pageStateHistory){const taskQueue=createTaskQueue();let requestRegistry;const isEarlyRequestCollectionEnabled=configuration.trackEarlyRequests;isEarlyRequestCollectionEnabled?requestRegistry=createRequestRegistry(lifeCycle):lifeCycle.subscribe(8,request=>{handleResource(()=>processRequest(request,configuration,pageStateHistory))});const performanceResourceSubscription=createPerformanceObservable(configuration,{type:RumPerformanceEntryType.RESOURCE,buffered:!0}).subscribe(entries=>{for(const entry of entries)(isEarlyRequestCollectionEnabled||!isResourceEntryRequestType(entry))&&handleResource(()=>processResourceEntry(entry,configuration,pageStateHistory,requestRegistry))});retrieveInitialDocumentResourceTiming(configuration,timing=>{handleResource(()=>processResourceEntry(timing,configuration,pageStateHistory,requestRegistry))});function handleResource(computeRawEvent){taskQueue.push(()=>{const rawEvent=computeRawEvent();rawEvent&&lifeCycle.notify(12,rawEvent)})}__name(handleResource,"handleResource");const resourceTracker=startEventTracker(lifeCycle),manualResources=trackManualResources(lifeCycle,resourceTracker);return{startResource:manualResources.startResource,stopResource:manualResources.stopResource,stop:__name(()=>{taskQueue.stop(),performanceResourceSubscription.unsubscribe(),resourceTracker.stopAll()},"stop")}}__name(startResourceCollection,"startResourceCollection");function processRequest(request,configuration,pageStateHistory){const matchingTiming=matchRequestResourceEntry(request);return assembleResource(matchingTiming,request,pageStateHistory,configuration)}__name(processRequest,"processRequest");function processResourceEntry(entry,configuration,pageStateHistory,requestRegistry){const matchingRequest=isResourceEntryRequestType(entry)&&requestRegistry?requestRegistry.getMatchingRequest(entry):void 0;return assembleResource(entry,matchingRequest,pageStateHistory,configuration)}__name(processResourceEntry,"processResourceEntry");function assembleResource(entry,request,pageStateHistory,configuration){if(!entry&&!request)return;const tracingInfo=request?computeRequestTracingInfo(request,configuration):computeResourceEntryTracingInfo(entry,configuration);if(!configuration.trackResources&&!tracingInfo)return;const startClocks=entry?relativeToClocks(entry.startTime):request.startClocks,duration2=entry?computeResourceEntryDuration(entry):computeRequestDuration(pageStateHistory,startClocks,request.duration),graphql=request&&computeGraphQlMetaData(request,configuration),resourceEvent=combine({date:startClocks.timeStamp,resource:{id:generateUUID(),duration:toServerDuration(duration2),type:request?request.type===RequestType.XHR?ResourceType.XHR:ResourceType.FETCH:computeResourceEntryType(entry),method:request?request.method:void 0,status_code:request?request.status:discardZeroStatus(entry.responseStatus),url:request?sanitizeIfLongDataUrl(request.url):entry.name,protocol:entry&&computeResourceEntryProtocol(entry),delivery_type:entry&&computeResourceEntryDeliveryType(entry),graphql},type:RumEventType.RESOURCE,_dd:{discarded:!configuration.trackResources}},tracingInfo,entry&&computeResourceEntryMetrics(entry));return{startClocks,duration:duration2,rawRumEvent:resourceEvent,domainContext:getResourceDomainContext(entry,request)}}__name(assembleResource,"assembleResource");function computeGraphQlMetaData(request,configuration){const graphQlConfig=findGraphQlConfiguration(request.url,configuration);if(graphQlConfig)return extractGraphQlMetadata(request,graphQlConfig)}__name(computeGraphQlMetaData,"computeGraphQlMetaData");function getResourceDomainContext(entry,request){if(request){const baseDomainContext={performanceEntry:entry,isAborted:request.isAborted,handlingStack:request.handlingStack};return request.type===RequestType.XHR?{xhr:request.xhr,...baseDomainContext}:{requestInput:request.input,requestInit:request.init,response:request.response,error:request.error,...baseDomainContext}}return{performanceEntry:entry}}__name(getResourceDomainContext,"getResourceDomainContext");function computeResourceEntryMetrics(entry){const{renderBlockingStatus}=entry;return{resource:{render_blocking_status:renderBlockingStatus,...computeResourceEntrySize(entry),...computeResourceEntryDetails(entry)}}}__name(computeResourceEntryMetrics,"computeResourceEntryMetrics");function computeRequestTracingInfo(request,configuration){if(request.traceSampled&&request.traceId&&request.spanId)return{_dd:{span_id:request.spanId.toString(),trace_id:request.traceId.toString(),rule_psr:configuration.rulePsr}}}__name(computeRequestTracingInfo,"computeRequestTracingInfo");function computeResourceEntryTracingInfo(entry,configuration){if(entry.traceId)return{_dd:{trace_id:entry.traceId,span_id:createSpanIdentifier().toString(),rule_psr:configuration.rulePsr}}}__name(computeResourceEntryTracingInfo,"computeResourceEntryTracingInfo");function computeRequestDuration(pageStateHistory,startClocks,duration2){return pageStateHistory.wasInPageStateDuringPeriod("frozen",startClocks.relative,duration2)?void 0:duration2}__name(computeRequestDuration,"computeRequestDuration");function discardZeroStatus(statusCode){return statusCode===0?void 0:statusCode}__name(discardZeroStatus,"discardZeroStatus");function trackViewEventCounts(lifeCycle,viewId,onChange){const{stop,eventCounts}=trackEventCounts({lifeCycle,isChildEvent:__name(event=>event.view.id===viewId,"isChildEvent"),onChange});return{stop,eventCounts}}__name(trackViewEventCounts,"trackViewEventCounts");const FCP_MAXIMUM_DELAY=10*ONE_MINUTE;function trackFirstContentfulPaint(configuration,firstHidden,callback){return{stop:createPerformanceObservable(configuration,{type:RumPerformanceEntryType.PAINT,buffered:!0}).subscribe(entries=>{const fcpEntry=entries.find(entry=>entry.name==="first-contentful-paint"&&entry.startTime<firstHidden.timeStamp&&entry.startTime<FCP_MAXIMUM_DELAY);fcpEntry&&callback(fcpEntry.startTime)}).unsubscribe}}__name(trackFirstContentfulPaint,"trackFirstContentfulPaint");function trackRestoredFirstContentfulPaint(viewStartRelative,callback){requestAnimationFrame(()=>{requestAnimationFrame(()=>{callback(elapsed(viewStartRelative,relativeNow()))})})}__name(trackRestoredFirstContentfulPaint,"trackRestoredFirstContentfulPaint");function trackFirstInput(configuration,firstHidden,callback){const performanceFirstInputSubscription=createPerformanceObservable(configuration,{type:RumPerformanceEntryType.FIRST_INPUT,buffered:!0}).subscribe(entries=>{const firstInputEntry=entries.find(entry=>entry.startTime<firstHidden.timeStamp);if(firstInputEntry){const firstInputDelay=elapsed(firstInputEntry.startTime,firstInputEntry.processingStart);let firstInputTargetSelector;firstInputEntry.target&&isElementNode(firstInputEntry.target)&&(firstInputTargetSelector=getSelectorFromElement(firstInputEntry.target,configuration.actionNameAttribute)),callback({delay:firstInputDelay>=0?firstInputDelay:0,time:firstInputEntry.startTime,targetSelector:firstInputTargetSelector})}});return{stop:__name(()=>{performanceFirstInputSubscription.unsubscribe()},"stop")}}__name(trackFirstInput,"trackFirstInput");function trackNavigationTimings(configuration,callback){return waitAfterLoadEvent(configuration,()=>{const entry=getNavigationEntry();isIncompleteNavigation(entry)||callback(processNavigationEntry(entry))})}__name(trackNavigationTimings,"trackNavigationTimings");function processNavigationEntry(entry){return{domComplete:entry.domComplete,domContentLoaded:entry.domContentLoadedEventEnd,domInteractive:entry.domInteractive,loadEvent:entry.loadEventEnd,firstByte:sanitizeFirstByte(entry)}}__name(processNavigationEntry,"processNavigationEntry");function isIncompleteNavigation(entry){return entry.loadEventEnd<=0}__name(isIncompleteNavigation,"isIncompleteNavigation");function waitAfterLoadEvent(configuration,callback){let timeoutId;const{stop:stopOnReadyState}=runOnReadyState(configuration,"complete",()=>{timeoutId=setTimeout$1(()=>callback())});return{stop:__name(()=>{stopOnReadyState(),clearTimeout$1(timeoutId)},"stop")}}__name(waitAfterLoadEvent,"waitAfterLoadEvent");const LCP_MAXIMUM_DELAY=10*ONE_MINUTE;function trackLargestContentfulPaint(configuration,firstHidden,eventTarget,callback){let firstInteractionTimestamp=1/0;const{stop:stopEventListener}=addEventListeners(configuration,eventTarget,["pointerdown","keydown"],event=>{firstInteractionTimestamp=event.timeStamp},{capture:!0,once:!0});let biggestLcpSize=0;const performanceLcpSubscription=createPerformanceObservable(configuration,{type:RumPerformanceEntryType.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(entries=>{const lcpEntry=findLast(entries,entry=>entry.entryType===RumPerformanceEntryType.LARGEST_CONTENTFUL_PAINT&&entry.startTime<firstInteractionTimestamp&&entry.startTime<firstHidden.timeStamp&&entry.startTime<LCP_MAXIMUM_DELAY&&entry.size>biggestLcpSize);if(lcpEntry){let lcpTargetSelector;lcpEntry.element&&(lcpTargetSelector=getSelectorFromElement(lcpEntry.element,configuration.actionNameAttribute));const resourceUrl=computeLcpEntryUrl(lcpEntry),lcpValue=lcpEntry.startTime,subParts=isExperimentalFeatureEnabled(ExperimentalFeature.LCP_SUBPARTS)?computeLcpSubParts(resourceUrl,lcpValue):void 0;callback({value:lcpValue,targetSelector:lcpTargetSelector,resourceUrl,subParts}),biggestLcpSize=lcpEntry.size}});return{stop:__name(()=>{stopEventListener(),performanceLcpSubscription.unsubscribe()},"stop")}}__name(trackLargestContentfulPaint,"trackLargestContentfulPaint");function computeLcpEntryUrl(entry){return entry.url===""?void 0:entry.url}__name(computeLcpEntryUrl,"computeLcpEntryUrl");function computeLcpSubParts(resourceUrl,lcpValue){const firstByte=sanitizeFirstByte(getNavigationEntry());if(firstByte===void 0)return;const lcpResourceEntry=resourceUrl?findLcpResourceEntry(resourceUrl,lcpValue):void 0,lcpRequestStart=lcpResourceEntry?Math.max(firstByte,lcpResourceEntry.requestStart||lcpResourceEntry.startTime):firstByte,lcpResponseEnd=Math.min(lcpValue,Math.max(lcpRequestStart,lcpResourceEntry?.responseEnd||0));return{loadDelay:lcpRequestStart-firstByte,loadTime:lcpResponseEnd-lcpRequestStart,renderDelay:lcpValue-lcpResponseEnd}}__name(computeLcpSubParts,"computeLcpSubParts");function trackFirstHidden(configuration,viewStart,eventTarget=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:noop$2};if(supportPerformanceTimingEvent(RumPerformanceEntryType.VISIBILITY_STATE)){const firstHiddenEntry=performance.getEntriesByType(RumPerformanceEntryType.VISIBILITY_STATE).filter(entry=>entry.name==="hidden").find(entry=>entry.startTime>=viewStart.relative);if(firstHiddenEntry)return{timeStamp:firstHiddenEntry.startTime,stop:noop$2}}let timeStamp=1/0;const{stop}=addEventListeners(configuration,eventTarget,["pagehide","visibilitychange"],event=>{(event.type==="pagehide"||document.visibilityState==="hidden")&&(timeStamp=event.timeStamp,stop())},{capture:!0});return{get timeStamp(){return timeStamp},stop}}__name(trackFirstHidden,"trackFirstHidden");function trackInitialViewMetrics(configuration,viewStart,setLoadEvent,scheduleViewUpdate){const initialViewMetrics={},{stop:stopNavigationTracking}=trackNavigationTimings(configuration,navigationTimings=>{setLoadEvent(navigationTimings.loadEvent),initialViewMetrics.navigationTimings=navigationTimings,scheduleViewUpdate()}),firstHidden=trackFirstHidden(configuration,viewStart),{stop:stopFCPTracking}=trackFirstContentfulPaint(configuration,firstHidden,firstContentfulPaint=>{initialViewMetrics.firstContentfulPaint=firstContentfulPaint,scheduleViewUpdate()}),{stop:stopLCPTracking}=trackLargestContentfulPaint(configuration,firstHidden,window,largestContentfulPaint=>{initialViewMetrics.largestContentfulPaint=largestContentfulPaint,scheduleViewUpdate()}),{stop:stopFIDTracking}=trackFirstInput(configuration,firstHidden,firstInput=>{initialViewMetrics.firstInput=firstInput,scheduleViewUpdate()});function stop(){stopNavigationTracking(),stopFCPTracking(),stopLCPTracking(),stopFIDTracking(),firstHidden.stop()}return __name(stop,"stop"),{stop,initialViewMetrics}}__name(trackInitialViewMetrics,"trackInitialViewMetrics");const calculateArea=__name((width,height)=>width*height,"calculateArea"),calculateIntersectionArea=__name((rect1,rect2)=>{const left=Math.max(rect1.left,rect2.left),top=Math.max(rect1.top,rect2.top),right=Math.min(rect1.right,rect2.right),bottom=Math.min(rect1.bottom,rect2.bottom);return left>=right||top>=bottom?0:calculateArea(right-left,bottom-top)},"calculateIntersectionArea"),getClsAttributionImpactedArea=__name(source=>{const previousArea=calculateArea(source.previousRect.width,source.previousRect.height),currentArea=calculateArea(source.currentRect.width,source.currentRect.height),intersectionArea=calculateIntersectionArea(source.previousRect,source.currentRect);return previousArea+currentArea-intersectionArea},"getClsAttributionImpactedArea");function trackCumulativeLayoutShift(configuration,viewStart,callback){if(!isLayoutShiftSupported())return{stop:noop$2};let maxClsValue=0,biggestShift;callback({value:0});const slidingWindow=slidingSessionWindow(),performanceSubscription=createPerformanceObservable(configuration,{type:RumPerformanceEntryType.LAYOUT_SHIFT,buffered:!0}).subscribe(entries=>{var _a20;for(const entry of entries){if(entry.hadRecentInput||entry.startTime<viewStart)continue;const{cumulatedValue,isMaxValue}=slidingWindow.update(entry);if(isMaxValue){const attribution=getTopImpactedElement(entry.sources);biggestShift={target:attribution?.node?new WeakRef(attribution.node):void 0,time:elapsed(viewStart,entry.startTime),previousRect:attribution?.previousRect,currentRect:attribution?.currentRect,devicePixelRatio:window.devicePixelRatio}}if(cumulatedValue>maxClsValue){maxClsValue=cumulatedValue;const target=(_a20=biggestShift?.target)===null||_a20===void 0?void 0:_a20.deref();callback({value:round$1(maxClsValue,4),targetSelector:target&&getSelectorFromElement(target,configuration.actionNameAttribute),time:biggestShift?.time,previousRect:biggestShift?.previousRect?asRumRect(biggestShift.previousRect):void 0,currentRect:biggestShift?.currentRect?asRumRect(biggestShift.currentRect):void 0,devicePixelRatio:biggestShift?.devicePixelRatio})}}});return{stop:__name(()=>{performanceSubscription.unsubscribe()},"stop")}}__name(trackCumulativeLayoutShift,"trackCumulativeLayoutShift");function getTopImpactedElement(sources){let topImpactedSource;for(const source of sources)if(source.node&&isElementNode(source.node)){const currentImpactedArea=getClsAttributionImpactedArea(source);(!topImpactedSource||getClsAttributionImpactedArea(topImpactedSource)<currentImpactedArea)&&(topImpactedSource=source)}return topImpactedSource}__name(getTopImpactedElement,"getTopImpactedElement");function asRumRect({x,y,width,height}){return{x,y,width,height}}__name(asRumRect,"asRumRect");const MAX_WINDOW_DURATION=5*ONE_SECOND,MAX_UPDATE_GAP=ONE_SECOND;function slidingSessionWindow(){let cumulatedValue=0,startTime,endTime2,maxValue=0;return{update:__name(entry=>{const shouldCreateNewWindow=startTime===void 0||entry.startTime-endTime2>=MAX_UPDATE_GAP||entry.startTime-startTime>=MAX_WINDOW_DURATION;let isMaxValue;return shouldCreateNewWindow?(startTime=endTime2=entry.startTime,maxValue=cumulatedValue=entry.value,isMaxValue=!0):(cumulatedValue+=entry.value,endTime2=entry.startTime,isMaxValue=entry.value>maxValue,isMaxValue&&(maxValue=entry.value)),{cumulatedValue,isMaxValue}},"update")}}__name(slidingSessionWindow,"slidingSessionWindow");function isLayoutShiftSupported(){return supportPerformanceTimingEvent(RumPerformanceEntryType.LAYOUT_SHIFT)&&"WeakRef"in window}__name(isLayoutShiftSupported,"isLayoutShiftSupported");let observer,interactionCountEstimate=0,minKnownInteractionId=1/0,maxKnownInteractionId=0;function initInteractionCountPolyfill(){"interactionCount"in performance||observer||(observer=new window.PerformanceObserver(monitor(entries=>{entries.getEntries().forEach(e=>{const entry=e;entry.interactionId&&(minKnownInteractionId=Math.min(minKnownInteractionId,entry.interactionId),maxKnownInteractionId=Math.max(maxKnownInteractionId,entry.interactionId),interactionCountEstimate=(maxKnownInteractionId-minKnownInteractionId)/7+1)})})),observer.observe({type:"event",buffered:!0,durationThreshold:0}))}__name(initInteractionCountPolyfill,"initInteractionCountPolyfill");const getInteractionCount=__name(()=>observer?interactionCountEstimate:window.performance.interactionCount||0,"getInteractionCount"),MAX_INTERACTION_ENTRIES=10,MAX_INP_VALUE=1*ONE_MINUTE;function trackInteractionToNextPaint(configuration,viewStart,viewLoadingType){if(!isInteractionToNextPaintSupported())return{getInteractionToNextPaint:__name(()=>{},"getInteractionToNextPaint"),setViewEnd:noop$2,stop:noop$2};const{getViewInteractionCount,stopViewInteractionCount}=trackViewInteractionCount(viewLoadingType);let viewEnd=1/0;const longestInteractions=trackLongestInteractions(getViewInteractionCount);let interactionToNextPaint=-1,interactionToNextPaintTargetSelector,interactionToNextPaintStartTime;function handleEntries(entries){for(const entry of entries)entry.interactionId&&entry.startTime>=viewStart&&entry.startTime<=viewEnd&&longestInteractions.process(entry);const newInteraction=longestInteractions.estimateP98Interaction();newInteraction&&newInteraction.duration!==interactionToNextPaint&&(interactionToNextPaint=newInteraction.duration,interactionToNextPaintStartTime=elapsed(viewStart,newInteraction.startTime),interactionToNextPaintTargetSelector=getInteractionSelector(newInteraction.startTime),!interactionToNextPaintTargetSelector&&newInteraction.target&&isElementNode(newInteraction.target)&&(interactionToNextPaintTargetSelector=getSelectorFromElement(newInteraction.target,configuration.actionNameAttribute)))}__name(handleEntries,"handleEntries");const firstInputSubscription=createPerformanceObservable(configuration,{type:RumPerformanceEntryType.FIRST_INPUT,buffered:!0}).subscribe(handleEntries),eventSubscription=createPerformanceObservable(configuration,{type:RumPerformanceEntryType.EVENT,durationThreshold:40,buffered:!0}).subscribe(handleEntries);return{getInteractionToNextPaint:__name(()=>{if(interactionToNextPaint>=0)return{value:Math.min(interactionToNextPaint,MAX_INP_VALUE),targetSelector:interactionToNextPaintTargetSelector,time:interactionToNextPaintStartTime};if(getViewInteractionCount())return{value:0}},"getInteractionToNextPaint"),setViewEnd:__name(viewEndTime=>{viewEnd=viewEndTime,stopViewInteractionCount()},"setViewEnd"),stop:__name(()=>{eventSubscription.unsubscribe(),firstInputSubscription.unsubscribe()},"stop")}}__name(trackInteractionToNextPaint,"trackInteractionToNextPaint");function trackLongestInteractions(getViewInteractionCount){const longestInteractions=[];function sortAndTrimLongestInteractions(){longestInteractions.sort((a2,b)=>b.duration-a2.duration).splice(MAX_INTERACTION_ENTRIES)}return __name(sortAndTrimLongestInteractions,"sortAndTrimLongestInteractions"),{process(entry){const interactionIndex=longestInteractions.findIndex(interaction=>entry.interactionId===interaction.interactionId),minLongestInteraction=longestInteractions[longestInteractions.length-1];interactionIndex!==-1?entry.duration>longestInteractions[interactionIndex].duration&&(longestInteractions[interactionIndex]=entry,sortAndTrimLongestInteractions()):(longestInteractions.length<MAX_INTERACTION_ENTRIES||entry.duration>minLongestInteraction.duration)&&(longestInteractions.push(entry),sortAndTrimLongestInteractions())},estimateP98Interaction(){const interactionIndex=Math.min(longestInteractions.length-1,Math.floor(getViewInteractionCount()/50));return longestInteractions[interactionIndex]}}}__name(trackLongestInteractions,"trackLongestInteractions");function trackViewInteractionCount(viewLoadingType){initInteractionCountPolyfill();const previousInteractionCount=viewLoadingType===ViewLoadingType.INITIAL_LOAD?0:getInteractionCount();let state2={stopped:!1};function computeViewInteractionCount(){return getInteractionCount()-previousInteractionCount}return __name(computeViewInteractionCount,"computeViewInteractionCount"),{getViewInteractionCount:__name(()=>state2.stopped?state2.interactionCount:computeViewInteractionCount(),"getViewInteractionCount"),stopViewInteractionCount:__name(()=>{state2={stopped:!0,interactionCount:computeViewInteractionCount()}},"stopViewInteractionCount")}}__name(trackViewInteractionCount,"trackViewInteractionCount");function isInteractionToNextPaintSupported(){return supportPerformanceTimingEvent(RumPerformanceEntryType.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}__name(isInteractionToNextPaintSupported,"isInteractionToNextPaintSupported");function trackLoadingTime(lifeCycle,domMutationObservable,windowOpenObservable,configuration,loadType,viewStart,callback){let isWaitingForLoadEvent=loadType===ViewLoadingType.INITIAL_LOAD,isWaitingForActivityLoadingTime=!0;const loadingTimeCandidates=[],firstHidden=trackFirstHidden(configuration,viewStart);function invokeCallbackIfAllCandidatesAreReceived(){if(!isWaitingForActivityLoadingTime&&!isWaitingForLoadEvent&&loadingTimeCandidates.length>0){const loadingTime=Math.max(...loadingTimeCandidates);loadingTime<firstHidden.timeStamp-viewStart.relative&&callback(loadingTime)}}__name(invokeCallbackIfAllCandidatesAreReceived,"invokeCallbackIfAllCandidatesAreReceived");const{stop}=waitPageActivityEnd(lifeCycle,domMutationObservable,windowOpenObservable,configuration,event=>{isWaitingForActivityLoadingTime&&(isWaitingForActivityLoadingTime=!1,event.hadActivity&&loadingTimeCandidates.push(elapsed(viewStart.timeStamp,event.end)),invokeCallbackIfAllCandidatesAreReceived())});return{stop:__name(()=>{stop(),firstHidden.stop()},"stop"),setLoadEvent:__name(loadEvent=>{isWaitingForLoadEvent&&(isWaitingForLoadEvent=!1,loadingTimeCandidates.push(loadEvent),invokeCallbackIfAllCandidatesAreReceived())},"setLoadEvent")}}__name(trackLoadingTime,"trackLoadingTime");function getScrollX(){let scrollX;const visual=window.visualViewport;return visual?scrollX=visual.pageLeft-visual.offsetLeft:window.scrollX!==void 0?scrollX=window.scrollX:scrollX=window.pageXOffset||0,Math.round(scrollX)}__name(getScrollX,"getScrollX");function getScrollY(){let scrollY;const visual=window.visualViewport;return visual?scrollY=visual.pageTop-visual.offsetTop:window.scrollY!==void 0?scrollY=window.scrollY:scrollY=window.pageYOffset||0,Math.round(scrollY)}__name(getScrollY,"getScrollY");let viewportObservable;function initViewportObservable(configuration){return viewportObservable||(viewportObservable=createViewportObservable(configuration)),viewportObservable}__name(initViewportObservable,"initViewportObservable");function createViewportObservable(configuration){return new Observable(observable=>{const{throttled:updateDimension}=throttle(()=>{observable.notify(getViewportDimension())},200);return addEventListener(configuration,window,"resize",updateDimension,{capture:!0,passive:!0}).stop})}__name(createViewportObservable,"createViewportObservable");function getViewportDimension(){const visual=window.visualViewport;return visual?{width:Number(visual.width*visual.scale),height:Number(visual.height*visual.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}__name(getViewportDimension,"getViewportDimension");const THROTTLE_SCROLL_DURATION=ONE_SECOND;function trackScrollMetrics(configuration,viewStart,callback,scrollValues=createScrollValuesObservable(configuration)){let maxScrollDepth=0,maxScrollHeight=0,maxScrollHeightTime=0;const subscription=scrollValues.subscribe(({scrollDepth,scrollTop,scrollHeight})=>{let shouldUpdate=!1;if(scrollDepth>maxScrollDepth&&(maxScrollDepth=scrollDepth,shouldUpdate=!0),scrollHeight>maxScrollHeight){maxScrollHeight=scrollHeight;const now=relativeNow();maxScrollHeightTime=elapsed(viewStart.relative,now),shouldUpdate=!0}shouldUpdate&&callback({maxDepth:Math.min(maxScrollDepth,maxScrollHeight),maxDepthScrollTop:scrollTop,maxScrollHeight,maxScrollHeightTime})});return{stop:__name(()=>subscription.unsubscribe(),"stop")}}__name(trackScrollMetrics,"trackScrollMetrics");function computeScrollValues(){const scrollTop=getScrollY(),{height}=getViewportDimension(),scrollHeight=Math.round((document.scrollingElement||document.documentElement).scrollHeight),scrollDepth=Math.round(height+scrollTop);return{scrollHeight,scrollDepth,scrollTop}}__name(computeScrollValues,"computeScrollValues");function createScrollValuesObservable(configuration,throttleDuration=THROTTLE_SCROLL_DURATION){return new Observable(observable=>{function notify(){observable.notify(computeScrollValues())}if(__name(notify,"notify"),window.ResizeObserver){const throttledNotify=throttle(notify,throttleDuration,{leading:!1,trailing:!0}),observerTarget=document.scrollingElement||document.documentElement,resizeObserver=new ResizeObserver(monitor(throttledNotify.throttled));observerTarget&&resizeObserver.observe(observerTarget);const eventListener=addEventListener(configuration,window,"scroll",throttledNotify.throttled,{passive:!0});return()=>{throttledNotify.cancel(),resizeObserver.disconnect(),eventListener.stop()}}})}__name(createScrollValuesObservable,"createScrollValuesObservable");function trackCommonViewMetrics(lifeCycle,domMutationObservable,windowOpenObservable,configuration,scheduleViewUpdate,loadingType,viewStart){const commonViewMetrics={},{stop:stopLoadingTimeTracking,setLoadEvent}=trackLoadingTime(lifeCycle,domMutationObservable,windowOpenObservable,configuration,loadingType,viewStart,newLoadingTime=>{commonViewMetrics.loadingTime=newLoadingTime,scheduleViewUpdate()}),{stop:stopScrollMetricsTracking}=trackScrollMetrics(configuration,viewStart,newScrollMetrics=>{commonViewMetrics.scroll=newScrollMetrics}),{stop:stopCLSTracking}=trackCumulativeLayoutShift(configuration,viewStart.relative,cumulativeLayoutShift=>{commonViewMetrics.cumulativeLayoutShift=cumulativeLayoutShift,scheduleViewUpdate()}),{stop:stopINPTracking,getInteractionToNextPaint,setViewEnd}=trackInteractionToNextPaint(configuration,viewStart.relative,loadingType);return{stop:__name(()=>{stopLoadingTimeTracking(),stopCLSTracking(),stopScrollMetricsTracking()},"stop"),stopINPTracking,setLoadEvent,setViewEnd,getCommonViewMetrics:__name(()=>(commonViewMetrics.interactionToNextPaint=getInteractionToNextPaint(),commonViewMetrics),"getCommonViewMetrics")}}__name(trackCommonViewMetrics,"trackCommonViewMetrics");function onBFCacheRestore(configuration,callback){const{stop}=addEventListener(configuration,window,"pageshow",event=>{event.persisted&&callback(event)},{capture:!0});return stop}__name(onBFCacheRestore,"onBFCacheRestore");function trackBfcacheMetrics(viewStart,metrics,scheduleViewUpdate){trackRestoredFirstContentfulPaint(viewStart.relative,paintTime=>{metrics.firstContentfulPaint=paintTime,metrics.largestContentfulPaint={value:paintTime},scheduleViewUpdate()})}__name(trackBfcacheMetrics,"trackBfcacheMetrics");const THROTTLE_VIEW_UPDATE_PERIOD=3e3,SESSION_KEEP_ALIVE_INTERVAL=5*ONE_MINUTE,KEEP_TRACKING_AFTER_VIEW_DELAY=5*ONE_MINUTE;function trackViews(lifeCycle,domMutationObservable,windowOpenObservable,configuration,locationChangeObservable,areViewsTrackedAutomatically,initialViewOptions){const activeViews=new Set;let currentView=startNewView(ViewLoadingType.INITIAL_LOAD,clocksOrigin(),initialViewOptions),stopOnBFCacheRestore;startViewLifeCycle();let locationChangeSubscription;areViewsTrackedAutomatically&&(locationChangeSubscription=renewViewOnLocationChange(locationChangeObservable),configuration.trackBfcacheViews&&(stopOnBFCacheRestore=onBFCacheRestore(configuration,pageshowEvent=>{currentView.end();const startClocks=relativeToClocks(pageshowEvent.timeStamp);currentView=startNewView(ViewLoadingType.BF_CACHE,startClocks,void 0)})));function startNewView(loadingType,startClocks,viewOptions){const newlyCreatedView=newView(lifeCycle,domMutationObservable,windowOpenObservable,configuration,loadingType,startClocks,viewOptions);return activeViews.add(newlyCreatedView),newlyCreatedView.stopObservable.subscribe(()=>{activeViews.delete(newlyCreatedView)}),newlyCreatedView}__name(startNewView,"startNewView");function startViewLifeCycle(){lifeCycle.subscribe(10,()=>{currentView=startNewView(ViewLoadingType.ROUTE_CHANGE,void 0,{name:currentView.name,service:currentView.service,version:currentView.version,context:currentView.contextManager.getContext()})}),lifeCycle.subscribe(9,()=>{currentView.end({sessionIsActive:!1})})}__name(startViewLifeCycle,"startViewLifeCycle");function renewViewOnLocationChange(locationChangeObservable2){return locationChangeObservable2.subscribe(({oldLocation,newLocation})=>{areDifferentLocation(oldLocation,newLocation)&&(currentView.end(),currentView=startNewView(ViewLoadingType.ROUTE_CHANGE))})}return __name(renewViewOnLocationChange,"renewViewOnLocationChange"),{addTiming:__name((name2,time2=timeStampNow())=>{currentView.addTiming(name2,time2)},"addTiming"),startView:__name((options,startClocks)=>{currentView.end({endClocks:startClocks}),currentView=startNewView(ViewLoadingType.ROUTE_CHANGE,startClocks,options)},"startView"),setViewContext:__name(context=>{currentView.contextManager.setContext(context)},"setViewContext"),setViewContextProperty:__name((key,value)=>{currentView.contextManager.setContextProperty(key,value)},"setViewContextProperty"),setViewName:__name(name2=>{currentView.setViewName(name2)},"setViewName"),getViewContext:__name(()=>currentView.contextManager.getContext(),"getViewContext"),stop:__name(()=>{locationChangeSubscription&&locationChangeSubscription.unsubscribe(),stopOnBFCacheRestore&&stopOnBFCacheRestore(),currentView.end(),activeViews.forEach(view=>view.stop())},"stop")}}__name(trackViews,"trackViews");function newView(lifeCycle,domMutationObservable,windowOpenObservable,configuration,loadingType,startClocks=clocksNow(),viewOptions){const id2=generateUUID(),stopObservable=new Observable,customTimings={};let documentVersion=0,endClocks;const location2=shallowClone$1(window.location),contextManager=createContextManager();let sessionIsActive=!0,name2=viewOptions?.name;const service=viewOptions?.service||configuration.service,version2=viewOptions?.version||configuration.version,context=viewOptions?.context,handlingStack=viewOptions?.handlingStack;context&&contextManager.setContext(context);const viewCreatedEvent={id:id2,name:name2,startClocks,service,version:version2,context};lifeCycle.notify(1,viewCreatedEvent),lifeCycle.notify(2,viewCreatedEvent);const{throttled,cancel:cancelScheduleViewUpdate}=throttle(triggerViewUpdate,THROTTLE_VIEW_UPDATE_PERIOD,{leading:!1}),{setLoadEvent,setViewEnd,stop:stopCommonViewMetricsTracking,stopINPTracking,getCommonViewMetrics}=trackCommonViewMetrics(lifeCycle,domMutationObservable,windowOpenObservable,configuration,scheduleViewUpdate,loadingType,startClocks),{stop:stopInitialViewMetricsTracking,initialViewMetrics}=loadingType===ViewLoadingType.INITIAL_LOAD?trackInitialViewMetrics(configuration,startClocks,setLoadEvent,scheduleViewUpdate):{stop:noop$2,initialViewMetrics:{}};loadingType===ViewLoadingType.BF_CACHE&&trackBfcacheMetrics(startClocks,initialViewMetrics,scheduleViewUpdate);const{stop:stopEventCountsTracking,eventCounts}=trackViewEventCounts(lifeCycle,id2,scheduleViewUpdate),keepAliveIntervalId=setInterval$1(triggerViewUpdate,SESSION_KEEP_ALIVE_INTERVAL),pageMayExitSubscription=lifeCycle.subscribe(11,pageMayExitEvent=>{pageMayExitEvent.reason===PageExitReason.UNLOADING&&triggerViewUpdate()});triggerViewUpdate(),contextManager.changeObservable.subscribe(scheduleViewUpdate);function triggerBeforeViewUpdate(){lifeCycle.notify(3,{id:id2,name:name2,context:contextManager.getContext(),startClocks,sessionIsActive})}__name(triggerBeforeViewUpdate,"triggerBeforeViewUpdate");function scheduleViewUpdate(){triggerBeforeViewUpdate(),throttled()}__name(scheduleViewUpdate,"scheduleViewUpdate");function triggerViewUpdate(){cancelScheduleViewUpdate(),triggerBeforeViewUpdate(),documentVersion+=1;const currentEnd=endClocks===void 0?timeStampNow():endClocks.timeStamp;lifeCycle.notify(4,{customTimings,documentVersion,id:id2,name:name2,service,version:version2,context:contextManager.getContext(),loadingType,location:location2,handlingStack,startClocks,commonViewMetrics:getCommonViewMetrics(),initialViewMetrics,duration:elapsed(startClocks.timeStamp,currentEnd),isActive:endClocks===void 0,sessionIsActive,eventCounts})}return __name(triggerViewUpdate,"triggerViewUpdate"),{get name(){return name2},service,version:version2,contextManager,stopObservable,end(options={}){var _a20,_b;endClocks||(endClocks=(_a20=options.endClocks)!==null&&_a20!==void 0?_a20:clocksNow(),sessionIsActive=(_b=options.sessionIsActive)!==null&&_b!==void 0?_b:!0,lifeCycle.notify(5,{endClocks}),lifeCycle.notify(6,{endClocks}),clearInterval$1(keepAliveIntervalId),setViewEnd(endClocks.relative),stopCommonViewMetricsTracking(),pageMayExitSubscription.unsubscribe(),triggerViewUpdate(),setTimeout$1(()=>{this.stop()},KEEP_TRACKING_AFTER_VIEW_DELAY))},stop(){stopInitialViewMetricsTracking(),stopEventCountsTracking(),stopINPTracking(),stopObservable.notify()},addTiming(name3,time2){if(endClocks)return;const relativeTime=looksLikeRelativeTime(time2)?time2:elapsed(startClocks.timeStamp,time2);customTimings[sanitizeTiming(name3)]=relativeTime,scheduleViewUpdate()},setViewName(updatedName){name2=updatedName,triggerViewUpdate()}}}__name(newView,"newView");function sanitizeTiming(name2){const sanitized=name2.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return sanitized!==name2&&display.warn(`Invalid timing name: ${name2}, sanitized to: ${sanitized}`),sanitized}__name(sanitizeTiming,"sanitizeTiming");function areDifferentLocation(currentLocation,otherLocation){return currentLocation.pathname!==otherLocation.pathname||!isHashAnAnchor(otherLocation.hash)&&getPathFromHash(otherLocation.hash)!==getPathFromHash(currentLocation.hash)}__name(areDifferentLocation,"areDifferentLocation");function isHashAnAnchor(hash2){const correspondingId=hash2.substring(1);return correspondingId!==""&&!!document.getElementById(correspondingId)}__name(isHashAnAnchor,"isHashAnAnchor");function getPathFromHash(hash2){const index2=hash2.indexOf("?");return index2<0?hash2:hash2.slice(0,index2)}__name(getPathFromHash,"getPathFromHash");function startViewCollection(lifeCycle,hooks,configuration,domMutationObservable,pageOpenObservable,locationChangeObservable,recorderApi2,viewHistory,initialViewOptions){return lifeCycle.subscribe(4,view=>lifeCycle.notify(12,processViewUpdate(view,configuration,recorderApi2))),hooks.register(0,({startTime,eventType})=>{const view=viewHistory.findView(startTime);return view?{type:eventType,service:view.service,version:view.version,context:view.context,view:{id:view.id,name:view.name}}:DISCARDED}),hooks.register(1,({startTime})=>{var _a20;return{view:{id:(_a20=viewHistory.findView(startTime))===null||_a20===void 0?void 0:_a20.id}}}),trackViews(lifeCycle,domMutationObservable,pageOpenObservable,configuration,locationChangeObservable,!configuration.trackViewsManually,initialViewOptions)}__name(startViewCollection,"startViewCollection");function processViewUpdate(view,configuration,recorderApi2){var _a20,_b,_c,_d,_e,_f,_g,_h,_j,_k,_l,_m,_o,_p,_q,_r,_s,_t;const replayStats=recorderApi2.getReplayStats(view.id),clsDevicePixelRatio=(_b=(_a20=view.commonViewMetrics)===null||_a20===void 0?void 0:_a20.cumulativeLayoutShift)===null||_b===void 0?void 0:_b.devicePixelRatio,viewEvent={_dd:{document_version:view.documentVersion,replay_stats:replayStats,cls:clsDevicePixelRatio?{device_pixel_ratio:clsDevicePixelRatio}:void 0,configuration:{start_session_replay_recording_manually:configuration.startSessionReplayRecordingManually}},date:view.startClocks.timeStamp,type:RumEventType.VIEW,view:{action:{count:view.eventCounts.actionCount},frustration:{count:view.eventCounts.frustrationCount},cumulative_layout_shift:(_c=view.commonViewMetrics.cumulativeLayoutShift)===null||_c===void 0?void 0:_c.value,cumulative_layout_shift_time:toServerDuration((_d=view.commonViewMetrics.cumulativeLayoutShift)===null||_d===void 0?void 0:_d.time),cumulative_layout_shift_target_selector:(_e=view.commonViewMetrics.cumulativeLayoutShift)===null||_e===void 0?void 0:_e.targetSelector,first_byte:toServerDuration((_f=view.initialViewMetrics.navigationTimings)===null||_f===void 0?void 0:_f.firstByte),dom_complete:toServerDuration((_g=view.initialViewMetrics.navigationTimings)===null||_g===void 0?void 0:_g.domComplete),dom_content_loaded:toServerDuration((_h=view.initialViewMetrics.navigationTimings)===null||_h===void 0?void 0:_h.domContentLoaded),dom_interactive:toServerDuration((_j=view.initialViewMetrics.navigationTimings)===null||_j===void 0?void 0:_j.domInteractive),error:{count:view.eventCounts.errorCount},first_contentful_paint:toServerDuration(view.initialViewMetrics.firstContentfulPaint),first_input_delay:toServerDuration((_k=view.initialViewMetrics.firstInput)===null||_k===void 0?void 0:_k.delay),first_input_time:toServerDuration((_l=view.initialViewMetrics.firstInput)===null||_l===void 0?void 0:_l.time),first_input_target_selector:(_m=view.initialViewMetrics.firstInput)===null||_m===void 0?void 0:_m.targetSelector,interaction_to_next_paint:toServerDuration((_o=view.commonViewMetrics.interactionToNextPaint)===null||_o===void 0?void 0:_o.value),interaction_to_next_paint_time:toServerDuration((_p=view.commonViewMetrics.interactionToNextPaint)===null||_p===void 0?void 0:_p.time),interaction_to_next_paint_target_selector:(_q=view.commonViewMetrics.interactionToNextPaint)===null||_q===void 0?void 0:_q.targetSelector,is_active:view.isActive,name:view.name,largest_contentful_paint:toServerDuration((_r=view.initialViewMetrics.largestContentfulPaint)===null||_r===void 0?void 0:_r.value),largest_contentful_paint_target_selector:(_s=view.initialViewMetrics.largestContentfulPaint)===null||_s===void 0?void 0:_s.targetSelector,load_event:toServerDuration((_t=view.initialViewMetrics.navigationTimings)===null||_t===void 0?void 0:_t.loadEvent),loading_time:discardNegativeDuration(toServerDuration(view.commonViewMetrics.loadingTime)),loading_type:view.loadingType,long_task:{count:view.eventCounts.longTaskCount},performance:computeViewPerformanceData(view.commonViewMetrics,view.initialViewMetrics),resource:{count:view.eventCounts.resourceCount},time_spent:toServerDuration(view.duration)},display:view.commonViewMetrics.scroll?{scroll:{max_depth:view.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:view.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:view.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:toServerDuration(view.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:configuration.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:getTimeZone()}};return isEmptyObject$1(view.customTimings)||(viewEvent.view.custom_timings=mapValues(view.customTimings,toServerDuration)),{rawRumEvent:viewEvent,startClocks:view.startClocks,duration:view.duration,domainContext:{location:view.location,handlingStack:view.handlingStack}}}__name(processViewUpdate,"processViewUpdate");function computeViewPerformanceData({cumulativeLayoutShift,interactionToNextPaint},{firstContentfulPaint,firstInput,largestContentfulPaint}){return{cls:cumulativeLayoutShift&&{score:cumulativeLayoutShift.value,timestamp:toServerDuration(cumulativeLayoutShift.time),target_selector:cumulativeLayoutShift.targetSelector,previous_rect:cumulativeLayoutShift.previousRect,current_rect:cumulativeLayoutShift.currentRect},fcp:firstContentfulPaint&&{timestamp:toServerDuration(firstContentfulPaint)},fid:firstInput&&{duration:toServerDuration(firstInput.delay),timestamp:toServerDuration(firstInput.time),target_selector:firstInput.targetSelector},inp:interactionToNextPaint&&{duration:toServerDuration(interactionToNextPaint.value),timestamp:toServerDuration(interactionToNextPaint.time),target_selector:interactionToNextPaint.targetSelector},lcp:largestContentfulPaint&&{timestamp:toServerDuration(largestContentfulPaint.value),target_selector:largestContentfulPaint.targetSelector,resource_url:largestContentfulPaint.resourceUrl,sub_parts:largestContentfulPaint.subParts?{load_delay:toServerDuration(largestContentfulPaint.subParts.loadDelay),load_time:toServerDuration(largestContentfulPaint.subParts.loadTime),render_delay:toServerDuration(largestContentfulPaint.subParts.renderDelay)}:void 0}}}__name(computeViewPerformanceData,"computeViewPerformanceData");const RUM_SESSION_KEY="rum";function startRumSessionManager(configuration,lifeCycle,trackingConsentState){const sessionManager=startSessionManager(configuration,RUM_SESSION_KEY,rawTrackingType=>computeTrackingType(configuration,rawTrackingType),trackingConsentState);return sessionManager.expireObservable.subscribe(()=>{lifeCycle.notify(9)}),sessionManager.renewObservable.subscribe(()=>{lifeCycle.notify(10)}),sessionManager.sessionStateUpdateObservable.subscribe(({previousState,newState})=>{if(!previousState.forcedReplay&&newState.forcedReplay){const sessionEntity=sessionManager.findSession();sessionEntity&&(sessionEntity.isReplayForced=!0)}}),{findTrackedSession:__name(startTime=>{const session=sessionManager.findSession(startTime);if(!(!session||session.trackingType==="0"))return{id:session.id,sessionReplay:session.trackingType==="1"?1:session.isReplayForced?2:0,anonymousId:session.anonymousId}},"findTrackedSession"),expire:sessionManager.expire,expireObservable:sessionManager.expireObservable,setForcedReplay:__name(()=>sessionManager.updateSessionState({forcedReplay:"1"}),"setForcedReplay")}}__name(startRumSessionManager,"startRumSessionManager");function startRumSessionManagerStub(){const session={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:bridgeSupports("records")?1:0};return{findTrackedSession:__name(()=>session,"findTrackedSession"),expire:noop$2,expireObservable:new Observable,setForcedReplay:noop$2}}__name(startRumSessionManagerStub,"startRumSessionManagerStub");function computeTrackingType(configuration,rawTrackingType){return hasValidRumSession(rawTrackingType)?rawTrackingType:performDraw(configuration.sessionSampleRate)?performDraw(configuration.sessionReplaySampleRate)?"1":"2":"0"}__name(computeTrackingType,"computeTrackingType");function hasValidRumSession(trackingType){return trackingType==="0"||trackingType==="1"||trackingType==="2"}__name(hasValidRumSession,"hasValidRumSession");function startRumBatch(configuration,lifeCycle,reportError2,pageMayExitObservable,sessionExpireObservable,createEncoder){const endpoints=[configuration.rumEndpointBuilder];configuration.replica&&endpoints.push(configuration.replica.rumEndpointBuilder);const batch2=createBatch({encoder:createEncoder(2),request:createHttpRequest(endpoints,reportError2),flushController:createFlushController({pageMayExitObservable,sessionExpireObservable})});return lifeCycle.subscribe(13,serverRumEvent=>{serverRumEvent.type===RumEventType.VIEW?batch2.upsert(serverRumEvent,serverRumEvent.view.id):batch2.add(serverRumEvent)}),batch2}__name(startRumBatch,"startRumBatch");function startRumEventBridge(lifeCycle){const bridge=getEventBridge();lifeCycle.subscribe(13,serverRumEvent=>{bridge.send("rum",serverRumEvent)})}__name(startRumEventBridge,"startRumEventBridge");const URL_CONTEXT_TIME_OUT_DELAY=SESSION_TIME_OUT_DELAY;function startUrlContexts(lifeCycle,hooks,locationChangeObservable){const urlContextHistory=createValueHistory({expireDelay:URL_CONTEXT_TIME_OUT_DELAY});let previousViewUrl;lifeCycle.subscribe(1,({startClocks})=>{const viewUrl=location.href;urlContextHistory.add(buildUrlContext({url:viewUrl,referrer:previousViewUrl||document.referrer}),startClocks.relative),previousViewUrl=viewUrl}),lifeCycle.subscribe(6,({endClocks})=>{urlContextHistory.closeActive(endClocks.relative)});const locationChangeSubscription=locationChangeObservable.subscribe(({newLocation})=>{const current=urlContextHistory.find();if(current){const changeTime=relativeNow();urlContextHistory.closeActive(changeTime),urlContextHistory.add(buildUrlContext({url:newLocation.href,referrer:current.referrer}),changeTime)}});function buildUrlContext({url:url2,referrer}){return{url:url2,referrer}}return __name(buildUrlContext,"buildUrlContext"),hooks.register(0,({startTime,eventType})=>{const urlContext=urlContextHistory.find(startTime);return urlContext?{type:eventType,view:{url:urlContext.url,referrer:urlContext.referrer}}:DISCARDED}),{findUrl:__name(startTime=>urlContextHistory.find(startTime),"findUrl"),stop:__name(()=>{locationChangeSubscription.unsubscribe(),urlContextHistory.stop()},"stop")}}__name(startUrlContexts,"startUrlContexts");function createLocationChangeObservable(configuration){let currentLocation=shallowClone$1(location);return new Observable(observable=>{const{stop:stopHistoryTracking}=trackHistory(configuration,onLocationChange),{stop:stopHashTracking}=trackHash(configuration,onLocationChange);function onLocationChange(){if(currentLocation.href===location.href)return;const newLocation=shallowClone$1(location);observable.notify({newLocation,oldLocation:currentLocation}),currentLocation=newLocation}return __name(onLocationChange,"onLocationChange"),()=>{stopHistoryTracking(),stopHashTracking()}})}__name(createLocationChangeObservable,"createLocationChangeObservable");function trackHistory(configuration,onHistoryChange){const{stop:stopInstrumentingPushState}=instrumentMethod(getHistoryInstrumentationTarget("pushState"),"pushState",({onPostCall})=>{onPostCall(onHistoryChange)}),{stop:stopInstrumentingReplaceState}=instrumentMethod(getHistoryInstrumentationTarget("replaceState"),"replaceState",({onPostCall})=>{onPostCall(onHistoryChange)}),{stop:removeListener}=addEventListener(configuration,window,"popstate",onHistoryChange);return{stop:__name(()=>{stopInstrumentingPushState(),stopInstrumentingReplaceState(),removeListener()},"stop")}}__name(trackHistory,"trackHistory");function trackHash(configuration,onHashChange){return addEventListener(configuration,window,"hashchange",onHashChange)}__name(trackHash,"trackHash");function getHistoryInstrumentationTarget(methodName){return Object.prototype.hasOwnProperty.call(history,methodName)?history:History.prototype}__name(getHistoryInstrumentationTarget,"getHistoryInstrumentationTarget");const FEATURE_FLAG_CONTEXT_TIME_OUT_DELAY=SESSION_TIME_OUT_DELAY;function startFeatureFlagContexts(lifeCycle,hooks,configuration){const featureFlagContexts=createValueHistory({expireDelay:FEATURE_FLAG_CONTEXT_TIME_OUT_DELAY});return lifeCycle.subscribe(1,({startClocks})=>{featureFlagContexts.add({},startClocks.relative)}),lifeCycle.subscribe(6,({endClocks})=>{featureFlagContexts.closeActive(endClocks.relative)}),hooks.register(0,({startTime,eventType})=>{if(!configuration.trackFeatureFlagsForEvents.concat([RumEventType.VIEW,RumEventType.ERROR]).includes(eventType))return SKIPPED;const featureFlagContext=featureFlagContexts.find(startTime);return!featureFlagContext||isEmptyObject$1(featureFlagContext)?SKIPPED:{type:eventType,feature_flags:featureFlagContext}}),{addFeatureFlagEvaluation:__name((key,value)=>{const currentContext=featureFlagContexts.find();currentContext&&(currentContext[key]=value)},"addFeatureFlagEvaluation")}}__name(startFeatureFlagContexts,"startFeatureFlagContexts");const MEASURES_PERIOD_DURATION=10*ONE_SECOND;let currentPeriodMeasures,batchHasRumEvent;function startCustomerDataTelemetry(telemetry,lifeCycle,batchFlushObservable){telemetry.metricsEnabled&&(initCurrentPeriodMeasures(),batchHasRumEvent=!1,lifeCycle.subscribe(13,()=>{batchHasRumEvent=!0}),batchFlushObservable.subscribe(({bytesCount,messagesCount})=>{batchHasRumEvent&&(batchHasRumEvent=!1,currentPeriodMeasures.batchCount+=1,updateMeasure(currentPeriodMeasures.batchBytesCount,bytesCount),updateMeasure(currentPeriodMeasures.batchMessagesCount,messagesCount))}),setInterval$1(sendCurrentPeriodMeasures,MEASURES_PERIOD_DURATION))}__name(startCustomerDataTelemetry,"startCustomerDataTelemetry");function sendCurrentPeriodMeasures(){currentPeriodMeasures.batchCount!==0&&(addTelemetryMetrics("Customer data measures",currentPeriodMeasures),initCurrentPeriodMeasures())}__name(sendCurrentPeriodMeasures,"sendCurrentPeriodMeasures");function createMeasure(){return{min:1/0,max:0,sum:0}}__name(createMeasure,"createMeasure");function updateMeasure(measure,value){measure.sum+=value,measure.min=Math.min(measure.min,value),measure.max=Math.max(measure.max,value)}__name(updateMeasure,"updateMeasure");function initCurrentPeriodMeasures(){currentPeriodMeasures={batchCount:0,batchBytesCount:createMeasure(),batchMessagesCount:createMeasure()}}__name(initCurrentPeriodMeasures,"initCurrentPeriodMeasures");const MAX_PAGE_STATE_ENTRIES=4e3,MAX_PAGE_STATE_ENTRIES_SELECTABLE=500,PAGE_STATE_CONTEXT_TIME_OUT_DELAY=SESSION_TIME_OUT_DELAY;function startPageStateHistory(hooks,configuration,maxPageStateEntriesSelectable=MAX_PAGE_STATE_ENTRIES_SELECTABLE){const pageStateEntryHistory=createValueHistory({expireDelay:PAGE_STATE_CONTEXT_TIME_OUT_DELAY,maxEntries:MAX_PAGE_STATE_ENTRIES});let currentPageState;supportPerformanceTimingEvent(RumPerformanceEntryType.VISIBILITY_STATE)&&performance.getEntriesByType(RumPerformanceEntryType.VISIBILITY_STATE).forEach(entry=>{const state2=entry.name==="hidden"?"hidden":"active";addPageState(state2,entry.startTime)}),addPageState(getPageState(),relativeNow());const{stop:stopEventListeners}=addEventListeners(configuration,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],event=>{addPageState(computePageState(event),event.timeStamp)},{capture:!0});function addPageState(nextPageState,startTime=relativeNow()){nextPageState!==currentPageState&&(currentPageState=nextPageState,pageStateEntryHistory.closeActive(startTime),pageStateEntryHistory.add({state:currentPageState,startTime},startTime))}__name(addPageState,"addPageState");function wasInPageStateDuringPeriod(state2,startTime,duration2){return pageStateEntryHistory.findAll(startTime,duration2).some(pageState=>pageState.state===state2)}return __name(wasInPageStateDuringPeriod,"wasInPageStateDuringPeriod"),hooks.register(0,({startTime,duration:duration2=0,eventType})=>{if(eventType===RumEventType.VIEW){const pageStates=pageStateEntryHistory.findAll(startTime,duration2);return{type:eventType,_dd:{page_states:processPageStates(pageStates,startTime,maxPageStateEntriesSelectable)}}}return eventType===RumEventType.ACTION||eventType===RumEventType.ERROR?{type:eventType,view:{in_foreground:wasInPageStateDuringPeriod("active",startTime,0)}}:SKIPPED}),{wasInPageStateDuringPeriod,addPageState,stop:__name(()=>{stopEventListeners(),pageStateEntryHistory.stop()},"stop")}}__name(startPageStateHistory,"startPageStateHistory");function processPageStates(pageStateEntries,eventStartTime,maxPageStateEntriesSelectable){if(pageStateEntries.length!==0)return pageStateEntries.slice(-maxPageStateEntriesSelectable).reverse().map(({state:state2,startTime})=>({state:state2,start:toServerDuration(elapsed(eventStartTime,startTime))}))}__name(processPageStates,"processPageStates");function computePageState(event){return event.type==="freeze"?"frozen":event.type==="pagehide"?event.persisted?"frozen":"terminated":getPageState()}__name(computePageState,"computePageState");function getPageState(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}__name(getPageState,"getPageState");function startDisplayContext(hooks,configuration){let viewport;const animationFrameId=requestAnimationFrame(monitor(()=>{viewport=getViewportDimension()})),unsubscribeViewport=initViewportObservable(configuration).subscribe(viewportDimension=>{viewport=viewportDimension}).unsubscribe;return hooks.register(0,({eventType})=>({type:eventType,display:viewport?{viewport}:void 0})),{stop:__name(()=>{unsubscribeViewport(),animationFrameId&&cancelAnimationFrame(animationFrameId)},"stop")}}__name(startDisplayContext,"startDisplayContext");function createCookieObservable(configuration,cookieName){const detectCookieChangeStrategy=window.cookieStore?listenToCookieStoreChange(configuration):watchCookieFallback;return new Observable(observable=>detectCookieChangeStrategy(cookieName,event=>observable.notify(event)))}__name(createCookieObservable,"createCookieObservable");function listenToCookieStoreChange(configuration){return(cookieName,callback)=>addEventListener(configuration,window.cookieStore,"change",event=>{const changeEvent=event.changed.find(event2=>event2.name===cookieName)||event.deleted.find(event2=>event2.name===cookieName);changeEvent&&callback(changeEvent.value)}).stop}__name(listenToCookieStoreChange,"listenToCookieStoreChange");const WATCH_COOKIE_INTERVAL_DELAY=ONE_SECOND;function watchCookieFallback(cookieName,callback){const previousCookieValue=findCommaSeparatedValue(document.cookie,cookieName),watchCookieIntervalId=setInterval$1(()=>{const cookieValue=findCommaSeparatedValue(document.cookie,cookieName);cookieValue!==previousCookieValue&&callback(cookieValue)},WATCH_COOKIE_INTERVAL_DELAY);return()=>{clearInterval$1(watchCookieIntervalId)}}__name(watchCookieFallback,"watchCookieFallback");const CI_VISIBILITY_TEST_ID_COOKIE_NAME="datadog-ci-visibility-test-execution-id";function startCiVisibilityContext(configuration,hooks,cookieObservable=createCookieObservable(configuration,CI_VISIBILITY_TEST_ID_COOKIE_NAME)){var _a20;let testExecutionId=getInitCookie(CI_VISIBILITY_TEST_ID_COOKIE_NAME)||((_a20=window.Cypress)===null||_a20===void 0?void 0:_a20.env("traceId"));const cookieObservableSubscription=cookieObservable.subscribe(value=>{testExecutionId=value});return hooks.register(0,({eventType})=>typeof testExecutionId!="string"?SKIPPED:{type:eventType,session:{type:"ci_test"},ci_test:{test_execution_id:testExecutionId}}),{stop:__name(()=>{cookieObservableSubscription.unsubscribe()},"stop")}}__name(startCiVisibilityContext,"startCiVisibilityContext");function startLongTaskCollection(lifeCycle,configuration){const entryType=supportPerformanceTimingEvent(RumPerformanceEntryType.LONG_ANIMATION_FRAME)?RumPerformanceEntryType.LONG_ANIMATION_FRAME:RumPerformanceEntryType.LONG_TASK,subscription=createPerformanceObservable(configuration,{type:entryType,buffered:!0}).subscribe(entries=>{for(const entry of entries){if(!configuration.trackLongTasks)break;const startClocks=relativeToClocks(entry.startTime),rawRumEvent=processEntry(entry,startClocks);lifeCycle.notify(12,{rawRumEvent,startClocks,duration:entry.duration,domainContext:{performanceEntry:entry}})}});return{stop:__name(()=>subscription.unsubscribe(),"stop")}}__name(startLongTaskCollection,"startLongTaskCollection");function processEntry(entry,startClocks){const id2=generateUUID(),duration2=toServerDuration(entry.duration),baseEvent={date:startClocks.timeStamp,type:RumEventType.LONG_TASK,_dd:{discarded:!1}};return entry.entryType===RumPerformanceEntryType.LONG_TASK?{...baseEvent,long_task:{id:id2,entry_type:RumLongTaskEntryType.LONG_TASK,duration:duration2}}:{...baseEvent,long_task:{id:id2,entry_type:RumLongTaskEntryType.LONG_ANIMATION_FRAME,duration:duration2,blocking_duration:toServerDuration(entry.blockingDuration),first_ui_event_timestamp:toServerDuration(entry.firstUIEventTimestamp),render_start:toServerDuration(entry.renderStart),style_and_layout_start:toServerDuration(entry.styleAndLayoutStart),start_time:toServerDuration(entry.startTime),scripts:entry.scripts.map(script=>({duration:toServerDuration(script.duration),pause_duration:toServerDuration(script.pauseDuration),forced_style_and_layout_duration:toServerDuration(script.forcedStyleAndLayoutDuration),start_time:toServerDuration(script.startTime),execution_start:toServerDuration(script.executionStart),source_url:script.sourceURL,source_function_name:script.sourceFunctionName,source_char_position:script.sourceCharPosition,invoker:script.invoker,invoker_type:script.invokerType,window_attribution:script.windowAttribution}))}}}__name(processEntry,"processEntry");function startSyntheticsContext(hooks){hooks.register(0,({eventType})=>{if(!isSyntheticsTest())return SKIPPED;const testId=getSyntheticsTestId(),resultId=getSyntheticsResultId();return{type:eventType,session:{type:"synthetics"},synthetics:{test_id:testId,result_id:resultId,injected:willSyntheticsInjectRum()}}})}__name(startSyntheticsContext,"startSyntheticsContext");function limitModification(object2,modifiableFieldPaths,modifier){const clone2=deepClone(object2),result=modifier(clone2);return objectEntries(modifiableFieldPaths).forEach(([fieldPath,fieldType])=>setValueAtPath(object2,clone2,fieldPath.split(/\.|(?=\[\])/),fieldType)),result}__name(limitModification,"limitModification");function setValueAtPath(object2,clone2,pathSegments,fieldType){const[field,...restPathSegments]=pathSegments;if(field==="[]"){Array.isArray(object2)&&Array.isArray(clone2)&&object2.forEach((item,i2)=>setValueAtPath(item,clone2[i2],restPathSegments,fieldType));return}if(!(!isValidObject(object2)||!isValidObject(clone2))){if(restPathSegments.length>0)return setValueAtPath(object2[field],clone2[field],restPathSegments,fieldType);setNestedValue(object2,field,clone2[field],fieldType)}}__name(setValueAtPath,"setValueAtPath");function setNestedValue(object2,field,value,fieldType){const newType=getType(value);newType===fieldType?object2[field]=sanitize(value):fieldType==="object"&&(newType==="undefined"||newType==="null")&&(object2[field]={})}__name(setNestedValue,"setNestedValue");function isValidObject(object2){return getType(object2)==="object"}__name(isValidObject,"isValidObject");const VIEW_MODIFIABLE_FIELD_PATHS={"view.name":"string","view.url":"string","view.referrer":"string"},USER_CUSTOMIZABLE_FIELD_PATHS={context:"object"},ROOT_MODIFIABLE_FIELD_PATHS={service:"string",version:"string"};let modifiableFieldPathsByEvent;function startRumAssembly(configuration,lifeCycle,hooks,reportError2,eventRateLimit){modifiableFieldPathsByEvent={[RumEventType.VIEW]:{"view.performance.lcp.resource_url":"string",...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS,...ROOT_MODIFIABLE_FIELD_PATHS},[RumEventType.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS,...ROOT_MODIFIABLE_FIELD_PATHS},[RumEventType.RESOURCE]:{"resource.url":"string","resource.graphql.variables":"string",...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS,...ROOT_MODIFIABLE_FIELD_PATHS},[RumEventType.ACTION]:{"action.target.name":"string",...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS,...ROOT_MODIFIABLE_FIELD_PATHS},[RumEventType.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS,...ROOT_MODIFIABLE_FIELD_PATHS},[RumEventType.VITAL]:{...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS,...ROOT_MODIFIABLE_FIELD_PATHS}};const eventRateLimiters={[RumEventType.ERROR]:createEventRateLimiter(RumEventType.ERROR,reportError2,eventRateLimit),[RumEventType.ACTION]:createEventRateLimiter(RumEventType.ACTION,reportError2,eventRateLimit),[RumEventType.VITAL]:createEventRateLimiter(RumEventType.VITAL,reportError2,eventRateLimit)};lifeCycle.subscribe(12,({startClocks,duration:duration2,rawRumEvent,domainContext})=>{const defaultRumEventAttributes=hooks.triggerHook(0,{eventType:rawRumEvent.type,rawRumEvent,domainContext,startTime:startClocks.relative,duration:duration2});if(defaultRumEventAttributes===DISCARDED)return;const serverRumEvent=combine(defaultRumEventAttributes,rawRumEvent,{ddtags:buildTags(configuration).join(",")});shouldSend(serverRumEvent,configuration.beforeSend,domainContext,eventRateLimiters)&&(isEmptyObject$1(serverRumEvent.context)&&delete serverRumEvent.context,lifeCycle.notify(13,serverRumEvent))})}__name(startRumAssembly,"startRumAssembly");function shouldSend(event,beforeSend2,domainContext,eventRateLimiters){var _a20;if(beforeSend2){const result=limitModification(event,modifiableFieldPathsByEvent[event.type],event2=>beforeSend2(event2,domainContext));if(result===!1&&event.type!==RumEventType.VIEW)return!1;result===!1&&display.warn("Can't dismiss view events using beforeSend!")}return!((_a20=eventRateLimiters[event.type])===null||_a20===void 0?void 0:_a20.isLimitReached())}__name(shouldSend,"shouldSend");function startSessionContext(hooks,sessionManager,recorderApi2,viewHistory){hooks.register(0,({eventType,startTime})=>{const session=sessionManager.findTrackedSession(startTime),view=viewHistory.findView(startTime);if(!session||!view)return DISCARDED;let hasReplay,sampledForReplay,isActive;return eventType===RumEventType.VIEW?(hasReplay=recorderApi2.getReplayStats(view.id)?!0:void 0,sampledForReplay=session.sessionReplay===1,isActive=view.sessionIsActive?void 0:!1):hasReplay=recorderApi2.isRecording()?!0:void 0,{type:eventType,session:{id:session.id,type:"user",has_replay:hasReplay,sampled_for_replay:sampledForReplay,is_active:isActive}}}),hooks.register(1,({startTime})=>{const session=sessionManager.findTrackedSession(startTime);return session?{session:{id:session.id}}:SKIPPED})}__name(startSessionContext,"startSessionContext");function startConnectivityContext(hooks){hooks.register(0,({eventType})=>({type:eventType,connectivity:getConnectivity()}))}__name(startConnectivityContext,"startConnectivityContext");function startDefaultContext(hooks,configuration,sdkName){hooks.register(0,({eventType})=>{const source=configuration.source;return{type:eventType,_dd:{format_version:2,drift:currentDrift(),configuration:{session_sample_rate:round$1(configuration.sessionSampleRate,3),session_replay_sample_rate:round$1(configuration.sessionReplaySampleRate,3),profiling_sample_rate:round$1(configuration.profilingSampleRate,3),trace_sample_rate:round$1(configuration.traceSampleRate,3),beta_encode_cookie_options:configuration.betaEncodeCookieOptions},browser_sdk_version:canUseEventBridge()?"6.28.1":void 0,sdk_name:sdkName},application:{id:configuration.applicationId},date:timeStampNow(),source}}),hooks.register(1,()=>({application:{id:configuration.applicationId}}))}__name(startDefaultContext,"startDefaultContext");function startTrackingConsentContext(hooks,trackingConsentState){hooks.register(1,()=>trackingConsentState.isGranted()?SKIPPED:DISCARDED)}__name(startTrackingConsentContext,"startTrackingConsentContext");const allowedEventTypes=[RumEventType.ACTION,RumEventType.ERROR,RumEventType.LONG_TASK,RumEventType.RESOURCE,RumEventType.VITAL];function startEventCollection(lifeCycle){return{addEvent:__name((startTime,event,domainContext,duration2)=>{allowedEventTypes.includes(event.type)&&lifeCycle.notify(12,{startClocks:relativeToClocks(startTime),rawRumEvent:event,domainContext,duration:duration2})},"addEvent")}}__name(startEventCollection,"startEventCollection");function startInitialViewMetricsTelemetry(lifeCycle,telemetry){if(!telemetry.metricsEnabled)return{stop:noop$2};const{unsubscribe}=lifeCycle.subscribe(4,({initialViewMetrics})=>{!initialViewMetrics.largestContentfulPaint||!initialViewMetrics.navigationTimings||(addTelemetryMetrics("Initial view metrics",{metrics:createCoreInitialViewMetrics(initialViewMetrics.largestContentfulPaint,initialViewMetrics.navigationTimings)}),unsubscribe())});return{stop:unsubscribe}}__name(startInitialViewMetricsTelemetry,"startInitialViewMetricsTelemetry");function createCoreInitialViewMetrics(lcp,navigation2){return{lcp:{value:lcp.value},navigation:{domComplete:navigation2.domComplete,domContentLoaded:navigation2.domContentLoaded,domInteractive:navigation2.domInteractive,firstByte:navigation2.firstByte,loadEvent:navigation2.loadEvent}}}__name(createCoreInitialViewMetrics,"createCoreInitialViewMetrics");function startSourceCodeContext(hooks){if(!isExperimentalFeatureEnabled(ExperimentalFeature.SOURCE_CODE_CONTEXT))return;const browserWindow=window,contextByFile=new Map;function buildContextByFile(){browserWindow.DD_SOURCE_CODE_CONTEXT&&(objectEntries(browserWindow.DD_SOURCE_CODE_CONTEXT).forEach(([stack,context])=>{const firstFrame=computeStackTrace({stack}).stack[0];if(!firstFrame.url){addTelemetryError("Source code context: missing frame url",{stack});return}contextByFile.has(firstFrame.url)||contextByFile.set(firstFrame.url,context)}),browserWindow.DD_SOURCE_CODE_CONTEXT={})}__name(buildContextByFile,"buildContextByFile"),buildContextByFile(),hooks.register(0,({domainContext,rawRumEvent})=>{buildContextByFile();const url2=getSourceUrl(domainContext,rawRumEvent);if(url2){const context=contextByFile.get(url2);if(context)return{type:rawRumEvent.type,service:context.service,version:context.version}}return SKIPPED})}__name(startSourceCodeContext,"startSourceCodeContext");function getSourceUrl(domainContext,rawRumEvent){var _a20,_b;if(rawRumEvent.type==="long_task"&&rawRumEvent.long_task.entry_type==="long-animation-frame")return(_a20=rawRumEvent.long_task.scripts[0])===null||_a20===void 0?void 0:_a20.source_url;let stack;return"handlingStack"in domainContext&&(stack=domainContext.handlingStack),rawRumEvent.type==="error"&&rawRumEvent.error.stack&&(stack=rawRumEvent.error.stack),(_b=computeStackTrace({stack}).stack[0])===null||_b===void 0?void 0:_b.url}__name(getSourceUrl,"getSourceUrl");function startRum(configuration,recorderApi2,profilerApi2,initialViewOptions,createEncoder,trackingConsentState,customVitalsState,bufferedDataObservable,telemetry,hooks,sdkName){const cleanupTasks2=[],lifeCycle=new LifeCycle;lifeCycle.subscribe(13,event=>sendToExtension("rum",event));const reportError2=__name(error2=>{lifeCycle.notify(14,{error:error2}),addTelemetryDebug("Error reported to customer",{"error.message":error2.message})},"reportError"),pageMayExitObservable=createPageMayExitObservable(configuration),pageMayExitSubscription=pageMayExitObservable.subscribe(event=>{lifeCycle.notify(11,event)});cleanupTasks2.push(()=>pageMayExitSubscription.unsubscribe());const session=canUseEventBridge()?startRumSessionManagerStub():startRumSessionManager(configuration,lifeCycle,trackingConsentState);if(canUseEventBridge())startRumEventBridge(lifeCycle);else{const batch2=startRumBatch(configuration,lifeCycle,reportError2,pageMayExitObservable,session.expireObservable,createEncoder);cleanupTasks2.push(()=>batch2.stop()),startCustomerDataTelemetry(telemetry,lifeCycle,batch2.flushController.flushObservable)}startTrackingConsentContext(hooks,trackingConsentState);const{stop:stopInitialViewMetricsTelemetry}=startInitialViewMetricsTelemetry(lifeCycle,telemetry);cleanupTasks2.push(stopInitialViewMetricsTelemetry);const{stop:stopRumEventCollection,...startRumEventCollectionResult}=startRumEventCollection(lifeCycle,hooks,configuration,session,recorderApi2,initialViewOptions,customVitalsState,bufferedDataObservable,sdkName,reportError2);return cleanupTasks2.push(stopRumEventCollection),bufferedDataObservable.unbuffer(),cleanupTasks2.push(()=>profilerApi2.stop()),{...startRumEventCollectionResult,lifeCycle,session,stopSession:__name(()=>session.expire(),"stopSession"),telemetry,stop:__name(()=>{cleanupTasks2.forEach(task=>task())},"stop"),hooks}}__name(startRum,"startRum");function startRumEventCollection(lifeCycle,hooks,configuration,session,recorderApi2,initialViewOptions,customVitalsState,bufferedDataObservable,sdkName,reportError2){const cleanupTasks2=[],domMutationObservable=createDOMMutationObservable(),locationChangeObservable=createLocationChangeObservable(configuration),{observable:windowOpenObservable,stop:stopWindowOpen}=createWindowOpenObservable();cleanupTasks2.push(stopWindowOpen),startDefaultContext(hooks,configuration,sdkName);const pageStateHistory=startPageStateHistory(hooks,configuration);cleanupTasks2.push(()=>pageStateHistory.stop());const viewHistory=startViewHistory(lifeCycle);cleanupTasks2.push(()=>viewHistory.stop());const urlContexts=startUrlContexts(lifeCycle,hooks,locationChangeObservable);cleanupTasks2.push(()=>urlContexts.stop());const featureFlagContexts=startFeatureFlagContexts(lifeCycle,hooks,configuration);startSessionContext(hooks,session,recorderApi2,viewHistory),startConnectivityContext(hooks);const globalContext=startGlobalContext(hooks,configuration,"rum"),userContext=startUserContext(hooks,configuration,session,"rum"),accountContext=startAccountContext(hooks,configuration,"rum"),actionCollection=startActionCollection(lifeCycle,hooks,domMutationObservable,windowOpenObservable,configuration);cleanupTasks2.push(actionCollection.stop);const eventCollection=startEventCollection(lifeCycle),displayContext=startDisplayContext(hooks,configuration);cleanupTasks2.push(displayContext.stop);const ciVisibilityContext=startCiVisibilityContext(configuration,hooks);cleanupTasks2.push(ciVisibilityContext.stop),startSyntheticsContext(hooks),startRumAssembly(configuration,lifeCycle,hooks,reportError2);const{addTiming,startView,setViewName,setViewContext,setViewContextProperty,getViewContext,stop:stopViewCollection}=startViewCollection(lifeCycle,hooks,configuration,domMutationObservable,windowOpenObservable,locationChangeObservable,recorderApi2,viewHistory,initialViewOptions);startSourceCodeContext(hooks),cleanupTasks2.push(stopViewCollection);const resourceCollection=startResourceCollection(lifeCycle,configuration,pageStateHistory);cleanupTasks2.push(resourceCollection.stop);const{stop:stopLongTaskCollection}=startLongTaskCollection(lifeCycle,configuration);cleanupTasks2.push(stopLongTaskCollection);const{addError}=startErrorCollection(lifeCycle,configuration,bufferedDataObservable);startRequestCollection(lifeCycle,configuration,session,userContext,accountContext);const vitalCollection=startVitalCollection(lifeCycle,pageStateHistory,customVitalsState),internalContext=startInternalContext(configuration.applicationId,session,viewHistory,actionCollection.actionContexts,urlContexts);return{addAction:actionCollection.addAction,startAction:actionCollection.startAction,stopAction:actionCollection.stopAction,startResource:resourceCollection.startResource,stopResource:resourceCollection.stopResource,addEvent:eventCollection.addEvent,addError,addTiming,addFeatureFlagEvaluation:featureFlagContexts.addFeatureFlagEvaluation,startView,setViewContext,setViewContextProperty,getViewContext,setViewName,viewHistory,getInternalContext:internalContext.get,startDurationVital:vitalCollection.startDurationVital,stopDurationVital:vitalCollection.stopDurationVital,addDurationVital:vitalCollection.addDurationVital,addOperationStepVital:vitalCollection.addOperationStepVital,globalContext,userContext,accountContext,stop:__name(()=>cleanupTasks2.forEach(task=>task()),"stop")}}__name(startRumEventCollection,"startRumEventCollection");function makeRumPublicApi(recorderApi2,profilerApi2,options={}){const trackingConsentState=createTrackingConsentState(),customVitalsState=createCustomVitalsState(),bufferedDataObservable=startBufferingData().observable;let strategy=createPreStartStrategy$1(options,trackingConsentState,customVitalsState,(configuration,deflateWorker,initialViewOptions,telemetry,hooks)=>{const createEncoder=deflateWorker&&options.createDeflateEncoder?streamId=>options.createDeflateEncoder(configuration,deflateWorker,streamId):createIdentityEncoder,startRumResult=startRum(configuration,recorderApi2,profilerApi2,initialViewOptions,createEncoder,trackingConsentState,customVitalsState,bufferedDataObservable,telemetry,hooks,options.sdkName);return recorderApi2.onRumStart(startRumResult.lifeCycle,configuration,startRumResult.session,startRumResult.viewHistory,deflateWorker,startRumResult.telemetry),profilerApi2.onRumStart(startRumResult.lifeCycle,startRumResult.hooks,configuration,startRumResult.session,startRumResult.viewHistory,createEncoder),strategy=createPostStartStrategy$1(strategy,startRumResult),callPluginsMethod(configuration.plugins,"onRumStart",{strategy,addEvent:startRumResult.addEvent}),startRumResult});const getStrategy=__name(()=>strategy,"getStrategy"),startView=__name(options2=>{const handlingStack=createHandlingStack("view");callMonitored(()=>{const sanitizedOptions=typeof options2=="object"?options2:{name:options2};strategy.startView({...sanitizedOptions,handlingStack}),addTelemetryUsage({feature:"start-view"})})},"startView"),rumPublicApi=makePublicApi({init:__name(initConfiguration=>{const errorStack=new Error().stack;callMonitored(()=>strategy.init(initConfiguration,rumPublicApi,errorStack))},"init"),setTrackingConsent:monitor(trackingConsent=>{trackingConsentState.update(trackingConsent),addTelemetryUsage({feature:"set-tracking-consent",tracking_consent:trackingConsent})}),setViewName:monitor(name2=>{strategy.setViewName(name2),addTelemetryUsage({feature:"set-view-name"})}),setViewContext:monitor(context=>{strategy.setViewContext(context),addTelemetryUsage({feature:"set-view-context"})}),setViewContextProperty:monitor((key,value)=>{strategy.setViewContextProperty(key,value),addTelemetryUsage({feature:"set-view-context-property"})}),getViewContext:monitor(()=>(addTelemetryUsage({feature:"set-view-context-property"}),strategy.getViewContext())),getInternalContext:monitor(startTime=>strategy.getInternalContext(startTime)),getInitConfiguration:monitor(()=>deepClone(strategy.initConfiguration)),addAction:__name((name2,context)=>{const handlingStack=createHandlingStack("action");callMonitored(()=>{strategy.addAction({name:sanitize(name2),context:sanitize(context),startClocks:clocksNow(),type:ActionType.CUSTOM,handlingStack}),addTelemetryUsage({feature:"add-action"})})},"addAction"),startAction:monitor((name2,options2)=>{strategy.initConfiguration&&!isExperimentalFeatureEnabled(ExperimentalFeature.START_STOP_ACTION)||strategy.startAction(sanitize(name2),{type:sanitize(options2&&options2.type),context:sanitize(options2&&options2.context),actionKey:options2&&options2.actionKey})}),stopAction:monitor((name2,options2)=>{strategy.initConfiguration&&!isExperimentalFeatureEnabled(ExperimentalFeature.START_STOP_ACTION)||strategy.stopAction(sanitize(name2),{type:sanitize(options2&&options2.type),context:sanitize(options2&&options2.context),actionKey:options2&&options2.actionKey})}),startResource:monitor((url2,options2)=>{strategy.initConfiguration&&!isExperimentalFeatureEnabled(ExperimentalFeature.START_STOP_RESOURCE)||strategy.startResource(sanitize(url2),{type:sanitize(options2&&options2.type),method:sanitize(options2&&options2.method),context:sanitize(options2&&options2.context),resourceKey:options2&&options2.resourceKey})}),stopResource:monitor((url2,options2)=>{strategy.initConfiguration&&!isExperimentalFeatureEnabled(ExperimentalFeature.START_STOP_RESOURCE)||strategy.stopResource(sanitize(url2),{statusCode:options2&&options2.statusCode,context:sanitize(options2&&options2.context),resourceKey:options2&&options2.resourceKey})}),addError:__name((error2,context)=>{const handlingStack=createHandlingStack("error");callMonitored(()=>{strategy.addError({error:error2,handlingStack,context:sanitize(context),startClocks:clocksNow()}),addTelemetryUsage({feature:"add-error"})})},"addError"),addTiming:monitor((name2,time2)=>{strategy.addTiming(sanitize(name2),time2)}),setGlobalContext:defineContextMethod(getStrategy,CustomerContextKey.globalContext,ContextManagerMethod.setContext,"set-global-context"),getGlobalContext:defineContextMethod(getStrategy,CustomerContextKey.globalContext,ContextManagerMethod.getContext,"get-global-context"),setGlobalContextProperty:defineContextMethod(getStrategy,CustomerContextKey.globalContext,ContextManagerMethod.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:defineContextMethod(getStrategy,CustomerContextKey.globalContext,ContextManagerMethod.removeContextProperty,"remove-global-context-property"),clearGlobalContext:defineContextMethod(getStrategy,CustomerContextKey.globalContext,ContextManagerMethod.clearContext,"clear-global-context"),setUser:defineContextMethod(getStrategy,CustomerContextKey.userContext,ContextManagerMethod.setContext,"set-user"),getUser:defineContextMethod(getStrategy,CustomerContextKey.userContext,ContextManagerMethod.getContext,"get-user"),setUserProperty:defineContextMethod(getStrategy,CustomerContextKey.userContext,ContextManagerMethod.setContextProperty,"set-user-property"),removeUserProperty:defineContextMethod(getStrategy,CustomerContextKey.userContext,ContextManagerMethod.removeContextProperty,"remove-user-property"),clearUser:defineContextMethod(getStrategy,CustomerContextKey.userContext,ContextManagerMethod.clearContext,"clear-user"),setAccount:defineContextMethod(getStrategy,CustomerContextKey.accountContext,ContextManagerMethod.setContext,"set-account"),getAccount:defineContextMethod(getStrategy,CustomerContextKey.accountContext,ContextManagerMethod.getContext,"get-account"),setAccountProperty:defineContextMethod(getStrategy,CustomerContextKey.accountContext,ContextManagerMethod.setContextProperty,"set-account-property"),removeAccountProperty:defineContextMethod(getStrategy,CustomerContextKey.accountContext,ContextManagerMethod.removeContextProperty,"remove-account-property"),clearAccount:defineContextMethod(getStrategy,CustomerContextKey.accountContext,ContextManagerMethod.clearContext,"clear-account"),startView,stopSession:monitor(()=>{strategy.stopSession(),addTelemetryUsage({feature:"stop-session"})}),addFeatureFlagEvaluation:monitor((key,value)=>{strategy.addFeatureFlagEvaluation(sanitize(key),sanitize(value)),addTelemetryUsage({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:monitor(()=>recorderApi2.getSessionReplayLink()),startSessionReplayRecording:monitor(options2=>{recorderApi2.start(options2),addTelemetryUsage({feature:"start-session-replay-recording",force:options2&&options2.force})}),stopSessionReplayRecording:monitor(()=>recorderApi2.stop()),addDurationVital:__name((name2,options2)=>{const handlingStack=createHandlingStack("vital");callMonitored(()=>{addTelemetryUsage({feature:"add-duration-vital"}),strategy.addDurationVital({name:sanitize(name2),type:VitalType.DURATION,startClocks:timeStampToClocks(options2.startTime),duration:options2.duration,context:sanitize(options2&&options2.context),description:sanitize(options2&&options2.description),handlingStack})})},"addDurationVital"),startDurationVital:__name((name2,options2)=>{const handlingStack=createHandlingStack("vital");return callMonitored(()=>(addTelemetryUsage({feature:"start-duration-vital"}),strategy.startDurationVital(sanitize(name2),{context:sanitize(options2&&options2.context),description:sanitize(options2&&options2.description),handlingStack})))},"startDurationVital"),stopDurationVital:monitor((nameOrRef,options2)=>{addTelemetryUsage({feature:"stop-duration-vital"}),strategy.stopDurationVital(typeof nameOrRef=="string"?sanitize(nameOrRef):nameOrRef,{context:sanitize(options2&&options2.context),description:sanitize(options2&&options2.description)})}),startFeatureOperation:monitor((name2,options2)=>{addTelemetryUsage({feature:"add-operation-step-vital",action_type:"start"}),strategy.addOperationStepVital(name2,"start",options2)}),succeedFeatureOperation:monitor((name2,options2)=>{addTelemetryUsage({feature:"add-operation-step-vital",action_type:"succeed"}),strategy.addOperationStepVital(name2,"end",options2)}),failFeatureOperation:monitor((name2,failureReason,options2)=>{addTelemetryUsage({feature:"add-operation-step-vital",action_type:"fail"}),strategy.addOperationStepVital(name2,"end",options2,failureReason)})});return rumPublicApi}__name(makeRumPublicApi,"makeRumPublicApi");function createPostStartStrategy$1(preStartStrategy,startRumResult){return{init:__name(initConfiguration=>{displayAlreadyInitializedError("DD_RUM",initConfiguration)},"init"),initConfiguration:preStartStrategy.initConfiguration,...startRumResult}}__name(createPostStartStrategy$1,"createPostStartStrategy$1");function getSessionReplayUrl(configuration,{session,viewContext,errorType}){const sessionId=session?session.id:"no-session-id",parameters=[];errorType!==void 0&¶meters.push(`error-type=${errorType}`),viewContext&&(parameters.push(`seed=${viewContext.id}`),parameters.push(`from=${viewContext.startClocks.timeStamp}`));const origin2=getDatadogSiteUrl(configuration),path=`/rum/replay/sessions/${sessionId}`;return`${origin2}${path}?${parameters.join("&")}`}__name(getSessionReplayUrl,"getSessionReplayUrl");function getDatadogSiteUrl(rumConfiguration){const site=rumConfiguration.site,subdomain=rumConfiguration.subdomain||getSiteDefaultSubdomain(rumConfiguration);return`https://${subdomain?`${subdomain}.`:""}${site}`}__name(getDatadogSiteUrl,"getDatadogSiteUrl");function getSiteDefaultSubdomain(configuration){switch(configuration.site){case INTAKE_SITE_US1:case INTAKE_SITE_EU1:return"app";case INTAKE_SITE_STAGING:return"dd";default:return}}__name(getSiteDefaultSubdomain,"getSiteDefaultSubdomain");const MAX_STATS_HISTORY=1e3;let statsPerView;function getSegmentsCount(viewId){return getOrCreateReplayStats(viewId).segments_count}__name(getSegmentsCount,"getSegmentsCount");function addSegment(viewId){getOrCreateReplayStats(viewId).segments_count+=1}__name(addSegment,"addSegment");function addRecord(viewId){getOrCreateReplayStats(viewId).records_count+=1}__name(addRecord,"addRecord");function addWroteData(viewId,additionalBytesCount){getOrCreateReplayStats(viewId).segments_total_raw_size+=additionalBytesCount}__name(addWroteData,"addWroteData");function getReplayStats(viewId){return statsPerView?.get(viewId)}__name(getReplayStats,"getReplayStats");function getOrCreateReplayStats(viewId){statsPerView||(statsPerView=new Map);let replayStats;return statsPerView.has(viewId)?replayStats=statsPerView.get(viewId):(replayStats={records_count:0,segments_count:0,segments_total_raw_size:0},statsPerView.set(viewId,replayStats),statsPerView.size>MAX_STATS_HISTORY&&deleteOldestStats()),replayStats}__name(getOrCreateReplayStats,"getOrCreateReplayStats");function deleteOldestStats(){if(!statsPerView)return;const toDelete=statsPerView.keys().next().value;toDelete&&statsPerView.delete(toDelete)}__name(deleteOldestStats,"deleteOldestStats");function createDeflateEncoder(configuration,worker,streamId){let rawBytesCount=0,compressedData=[],compressedDataTrailer,isEmpty2=!0,nextWriteActionId=0;const pendingWriteActions=[],{stop:removeMessageListener}=addEventListener(configuration,worker,"message",({data:workerResponse})=>{if(workerResponse.type!=="wrote"||workerResponse.streamId!==streamId)return;const nextPendingAction=pendingWriteActions[0];nextPendingAction&&(nextPendingAction.id===workerResponse.id?(pendingWriteActions.shift(),rawBytesCount+=workerResponse.additionalBytesCount,compressedData.push(workerResponse.result),compressedDataTrailer=workerResponse.trailer,nextPendingAction.writeCallback?nextPendingAction.writeCallback(workerResponse.result.byteLength):nextPendingAction.finishCallback&&nextPendingAction.finishCallback()):nextPendingAction.id<workerResponse.id&&removeMessageListener())});function consumeResult(){const output=compressedData.length===0?new Uint8Array(0):concatBuffers(compressedData.concat(compressedDataTrailer)),result={rawBytesCount,output,outputBytesCount:output.byteLength,encoding:"deflate"};return rawBytesCount=0,compressedData=[],result}__name(consumeResult,"consumeResult");function sendResetIfNeeded(){isEmpty2||(worker.postMessage({action:"reset",streamId}),isEmpty2=!0)}return __name(sendResetIfNeeded,"sendResetIfNeeded"),{isAsync:!0,get isEmpty(){return isEmpty2},write(data,callback){worker.postMessage({action:"write",id:nextWriteActionId,data,streamId}),pendingWriteActions.push({id:nextWriteActionId,writeCallback:callback,data}),isEmpty2=!1,nextWriteActionId+=1},finish(callback){sendResetIfNeeded(),pendingWriteActions.length?(pendingWriteActions.forEach(pendingWriteAction=>{delete pendingWriteAction.writeCallback}),pendingWriteActions[pendingWriteActions.length-1].finishCallback=()=>callback(consumeResult())):callback(consumeResult())},finishSync(){sendResetIfNeeded();const pendingData=pendingWriteActions.map(pendingWriteAction=>pendingWriteAction.data).join("");return pendingWriteActions.length=0,{...consumeResult(),pendingData}},estimateEncodedBytesCount(data){return data.length/8},stop(){removeMessageListener()}}}__name(createDeflateEncoder,"createDeflateEncoder");function reportScriptLoadingError({configuredUrl,error:error2,source,scriptType}){if(display.error(`${source} failed to start: an error occurred while initializing the ${scriptType}:`,error2),error2 instanceof Event||error2 instanceof Error&&isMessageCspRelated(error2.message)){let baseMessage;configuredUrl?baseMessage=`Please make sure the ${scriptType} URL ${configuredUrl} is correct and CSP is correctly configured.`:baseMessage="Please make sure CSP is correctly configured.",display.error(`${baseMessage} See documentation at ${DOCS_ORIGIN}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else scriptType==="worker"&&addTelemetryError(error2)}__name(reportScriptLoadingError,"reportScriptLoadingError");function isMessageCspRelated(message){return message.includes("Content Security Policy")||message.includes("requires 'TrustedScriptURL'")}__name(isMessageCspRelated,"isMessageCspRelated");const INITIALIZATION_TIME_OUT_DELAY=30*ONE_SECOND;function createDeflateWorker(configuration){return new Worker(configuration.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.28.1"};case"write":{let n=e.get(a.streamId);n||(n=new pt,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:vt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){gt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}})}catch(t){gt(e,t)}}()})();'])))}__name(createDeflateWorker,"createDeflateWorker");let state={status:0};function startDeflateWorker(configuration,source,onInitializationFailure){switch(state.status===0&&doStartDeflateWorker(configuration,source),state.status){case 1:return state.initializationFailureCallbacks.push(onInitializationFailure),state.worker;case 3:return state.worker}}__name(startDeflateWorker,"startDeflateWorker");function getDeflateWorkerStatus(){return state.status}__name(getDeflateWorkerStatus,"getDeflateWorkerStatus");function doStartDeflateWorker(configuration,source){try{const worker=createDeflateWorker(configuration),{stop:removeErrorListener}=addEventListener(configuration,worker,"error",error2=>{onError$1(configuration,source,error2)}),{stop:removeMessageListener}=addEventListener(configuration,worker,"message",({data})=>{data.type==="errored"?onError$1(configuration,source,data.error,data.streamId):data.type==="initialized"&&onInitialized(data.version)});worker.postMessage({action:"init"}),setTimeout$1(()=>onTimeout(source),INITIALIZATION_TIME_OUT_DELAY),state={status:1,worker,stop:__name(()=>{removeErrorListener(),removeMessageListener()},"stop"),initializationFailureCallbacks:[]}}catch(error2){onError$1(configuration,source,error2)}}__name(doStartDeflateWorker,"doStartDeflateWorker");function onTimeout(source){state.status===1&&(display.error(`${source} failed to start: a timeout occurred while initializing the Worker`),state.initializationFailureCallbacks.forEach(callback=>callback()),state={status:2})}__name(onTimeout,"onTimeout");function onInitialized(version2){state.status===1&&(state={status:3,worker:state.worker,stop:state.stop,version:version2})}__name(onInitialized,"onInitialized");function onError$1(configuration,source,error2,streamId){state.status===1||state.status===0?(reportScriptLoadingError({configuredUrl:configuration.workerUrl,error:error2,source,scriptType:"worker"}),state.status===1&&state.initializationFailureCallbacks.forEach(callback=>callback()),state={status:2}):addTelemetryError(error2,{worker_version:state.status===3&&state.version,stream_id:streamId})}__name(onError$1,"onError$1");function isBrowserSupported(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}__name(isBrowserSupported,"isBrowserSupported");function getSessionReplayLink(configuration,sessionManager,viewHistory,isRecordingStarted){const session=sessionManager.findTrackedSession(),errorType=getErrorType(session,isRecordingStarted),viewContext=viewHistory.findView();return getSessionReplayUrl(configuration,{viewContext,errorType,session})}__name(getSessionReplayLink,"getSessionReplayLink");function getErrorType(session,isRecordingStarted){if(!isBrowserSupported())return"browser-not-supported";if(!session)return"rum-not-tracked";if(session.sessionReplay===0)return"incorrect-session-plan";if(!isRecordingStarted)return"replay-not-started"}__name(getErrorType,"getErrorType");function startRecorderInitTelemetry(telemetry,observable){if(!telemetry.metricsEnabled)return{stop:noop$2};let startContext,documentReadyDuration,recorderSettledDuration;const{unsubscribe}=observable.subscribe(event=>{switch(event.type){case"start":startContext={forced:event.forced,timestamp:timeStampNow()},documentReadyDuration=void 0,recorderSettledDuration=void 0;break;case"document-ready":startContext&&(documentReadyDuration=elapsed(startContext.timestamp,timeStampNow()));break;case"recorder-settled":startContext&&(recorderSettledDuration=elapsed(startContext.timestamp,timeStampNow()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":unsubscribe(),startContext&&addTelemetryMetrics("Recorder init metrics",{metrics:createRecorderInitMetrics(startContext.forced,recorderSettledDuration,elapsed(startContext.timestamp,timeStampNow()),event.type,documentReadyDuration)});break}});return{stop:unsubscribe}}__name(startRecorderInitTelemetry,"startRecorderInitTelemetry");function createRecorderInitMetrics(forced,loadRecorderModuleDuration,recorderInitDuration,result,waitForDocReadyDuration){return{forced,loadRecorderModuleDuration,recorderInitDuration,result,waitForDocReadyDuration}}__name(createRecorderInitMetrics,"createRecorderInitMetrics");function createPostStartStrategy(configuration,lifeCycle,sessionManager,viewHistory,loadRecorder,getOrCreateDeflateEncoder,telemetry){let status=0,stopRecording;lifeCycle.subscribe(9,()=>{(status===2||status===3)&&(stop(),status=1)}),lifeCycle.subscribe(10,()=>{status===1&&start()});const observable=new Observable;startRecorderInitTelemetry(telemetry,observable);const doStart=__name(async forced=>{observable.notify({type:"start",forced});const[startRecordingImpl]=await Promise.all([notifyWhenSettled(observable,{type:"recorder-settled"},loadRecorder()),notifyWhenSettled(observable,{type:"document-ready"},asyncRunOnReadyState(configuration,"interactive"))]);if(status!==2){observable.notify({type:"aborted"});return}if(!startRecordingImpl){status=0,observable.notify({type:"recorder-load-failed"});return}const deflateEncoder=getOrCreateDeflateEncoder();if(!deflateEncoder){status=0,observable.notify({type:"deflate-encoder-load-failed"});return}({stop:stopRecording}=startRecordingImpl(lifeCycle,configuration,sessionManager,viewHistory,deflateEncoder,telemetry)),status=3,observable.notify({type:"succeeded"})},"doStart");function start(options){const session=sessionManager.findTrackedSession();if(canStartRecording(session,options)){status=1;return}if(isRecordingInProgress(status))return;status=2;const forced=shouldForceReplay(session,options)||!1;doStart(forced).catch(monitorError),forced&&sessionManager.setForcedReplay()}__name(start,"start");function stop(){status===3&&stopRecording?.(),status=0}return __name(stop,"stop"),{start,stop,getSessionReplayLink(){return getSessionReplayLink(configuration,sessionManager,viewHistory,status!==0)},isRecording:__name(()=>status===3,"isRecording")}}__name(createPostStartStrategy,"createPostStartStrategy");function canStartRecording(session,options){return!session||session.sessionReplay===0&&(!options||!options.force)}__name(canStartRecording,"canStartRecording");function isRecordingInProgress(status){return status===2||status===3}__name(isRecordingInProgress,"isRecordingInProgress");function shouldForceReplay(session,options){return options&&options.force&&session.sessionReplay===0}__name(shouldForceReplay,"shouldForceReplay");async function notifyWhenSettled(observable,event,promise2){try{return await promise2}finally{observable.notify(event)}}__name(notifyWhenSettled,"notifyWhenSettled");function createPreStartStrategy(){let status=0;return{strategy:{start(){status=1},stop(){status=2},isRecording:__name(()=>!1,"isRecording"),getSessionReplayLink:noop$2},shouldStartImmediately(configuration){return status===1||status===0&&!configuration.startSessionReplayRecordingManually}}}__name(createPreStartStrategy,"createPreStartStrategy");function makeRecorderApi(loadRecorder){if(canUseEventBridge()&&!bridgeSupports("records")||!isBrowserSupported())return{start:noop$2,stop:noop$2,getReplayStats:__name(()=>{},"getReplayStats"),onRumStart:noop$2,isRecording:__name(()=>!1,"isRecording"),getSessionReplayLink:__name(()=>{},"getSessionReplayLink")};let{strategy,shouldStartImmediately}=createPreStartStrategy();return{start:__name(options=>strategy.start(options),"start"),stop:__name(()=>strategy.stop(),"stop"),getSessionReplayLink:__name(()=>strategy.getSessionReplayLink(),"getSessionReplayLink"),onRumStart,isRecording:__name(()=>getDeflateWorkerStatus()===3&&strategy.isRecording(),"isRecording"),getReplayStats:__name(viewId=>getDeflateWorkerStatus()===3?getReplayStats(viewId):void 0,"getReplayStats")};function onRumStart(lifeCycle,configuration,sessionManager,viewHistory,worker,telemetry){let cachedDeflateEncoder;function getOrCreateDeflateEncoder(){return cachedDeflateEncoder||(worker??(worker=startDeflateWorker(configuration,"Datadog Session Replay",()=>strategy.stop())),worker&&(cachedDeflateEncoder=createDeflateEncoder(configuration,worker,1))),cachedDeflateEncoder}__name(getOrCreateDeflateEncoder,"getOrCreateDeflateEncoder"),strategy=createPostStartStrategy(configuration,lifeCycle,sessionManager,viewHistory,loadRecorder,getOrCreateDeflateEncoder,telemetry),shouldStartImmediately(configuration)&&strategy.start()}}__name(makeRecorderApi,"makeRecorderApi");const scriptRel="modulepreload",assetsURL=__name(function(dep){return"/"+dep},"assetsURL"),seen={},__vitePreload=__name(function(baseModule,deps,importerUrl){let promise2=Promise.resolve();if(deps&&deps.length>0){let allSettled=function(promises$2){return Promise.all(promises$2.map(p=>Promise.resolve(p).then(value$1=>({status:"fulfilled",value:value$1}),reason=>({status:"rejected",reason}))))};__name(allSettled,"allSettled"),document.getElementsByTagName("link");const cspNonceMeta=document.querySelector("meta[property=csp-nonce]"),cspNonce=cspNonceMeta?.nonce||cspNonceMeta?.getAttribute("nonce");promise2=allSettled(deps.map(dep=>{if(dep=assetsURL(dep),dep in seen)return;seen[dep]=!0;const isCss=dep.endsWith(".css"),cssSelector=isCss?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${dep}"]${cssSelector}`))return;const link2=document.createElement("link");if(link2.rel=isCss?"stylesheet":scriptRel,isCss||(link2.as="script"),link2.crossOrigin="",link2.href=dep,cspNonce&&link2.setAttribute("nonce",cspNonce),document.head.appendChild(link2),isCss)return new Promise((res,rej)=>{link2.addEventListener("load",res),link2.addEventListener("error",()=>rej(new Error(`Unable to preload CSS for ${dep}`)))})}))}function handlePreloadError(err$2){const e$1=new Event("vite:preloadError",{cancelable:!0});if(e$1.payload=err$2,window.dispatchEvent(e$1),!e$1.defaultPrevented)throw err$2}return __name(handlePreloadError,"handlePreloadError"),promise2.then(res=>{for(const item of res||[])item.status==="rejected"&&handlePreloadError(item.reason);return baseModule().catch(handlePreloadError)})},"preload");async function lazyLoadRecorder(){try{return await importRecorder()}catch(error2){reportScriptLoadingError({error:error2,source:"Recorder",scriptType:"module"})}}__name(lazyLoadRecorder,"lazyLoadRecorder");async function importRecorder(){return(await __vitePreload(()=>import("./startRecording-Da15t52a.js"),[])).startRecording}__name(importRecorder,"importRecorder");function isProfilingSupported(){return getGlobalObject().Profiler!==void 0}__name(isProfilingSupported,"isProfilingSupported");function startProfilingContext(hooks){let currentContext={status:"starting"};return hooks.register(0,({eventType})=>eventType!==RumEventType.VIEW&&eventType!==RumEventType.LONG_TASK&&eventType!==RumEventType.ACTION&&eventType!==RumEventType.VITAL?SKIPPED:{type:eventType,_dd:{profiling:currentContext}}),{get:__name(()=>currentContext,"get"),set:__name(newContext=>{currentContext=newContext},"set")}}__name(startProfilingContext,"startProfilingContext");async function lazyLoadProfiler(){try{return await importProfiler()}catch(error2){reportScriptLoadingError({error:error2,source:"Profiler",scriptType:"module"})}}__name(lazyLoadProfiler,"lazyLoadProfiler");async function importProfiler(){return(await __vitePreload(()=>import("./profiler-BhXa8xgR.js"),[])).createRumProfiler}__name(importProfiler,"importProfiler");function makeProfilerApi(){let profiler;function onRumStart(lifeCycle,hooks,configuration,sessionManager,viewHistory,createEncoder){const session=sessionManager.findTrackedSession();if(!session||!isSampled(session.id,configuration.profilingSampleRate))return;const profilingContextManager=startProfilingContext(hooks);if(!isProfilingSupported()){profilingContextManager.set({status:"error",error_reason:"not-supported-by-browser"});return}lazyLoadProfiler().then(createRumProfiler=>{if(!createRumProfiler){profilingContextManager.set({status:"error",error_reason:"failed-to-lazy-load"});return}profiler=createRumProfiler(configuration,lifeCycle,sessionManager,profilingContextManager,createEncoder,viewHistory,void 0),profiler.start()}).catch(monitorError)}return __name(onRumStart,"onRumStart"),{onRumStart,stop:__name(()=>{profiler?.stop()},"stop")}}__name(makeProfilerApi,"makeProfilerApi");const recorderApi=makeRecorderApi(lazyLoadRecorder),profilerApi=makeProfilerApi(),datadogRum=makeRumPublicApi(recorderApi,profilerApi,{startDeflateWorker,createDeflateEncoder,sdkName:"rum"});defineGlobal(getGlobalObject(),"DD_RUM",datadogRum);function addReactError(error2,info){createHandlingStack("react error"),clocksNow()}__name(addReactError,"addReactError");const INITIAL_STATE={didCatch:!1,error:null},_ErrorBoundary=class _ErrorBoundary extends React.Component{constructor(props){super(props),this.resetError=()=>{this.setState(INITIAL_STATE)},this.state=INITIAL_STATE}static getDerivedStateFromError(error2){return{didCatch:!0,error:error2}}componentDidCatch(error2,errorInfo){addReactError()}render(){return this.state.didCatch?React.createElement(this.props.fallback,{error:this.state.error,resetError:this.resetError}):this.props.children}};__name(_ErrorBoundary,"ErrorBoundary");let ErrorBoundary=_ErrorBoundary,initialized$1=!1;function useDatadog(){reactExports.useEffect(()=>{initialized$1||(initialized$1=!0)},[])}__name(useDatadog,"useDatadog");function StudioLocal(){return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Outlet,{})})}__name(StudioLocal,"StudioLocal");const rootRoute=createRootRouteWithContext()({component:StudioLocal});function DiscordLogo(){return jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 126.644 96",width:24,height:24,children:jsxRuntimeExports.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"})})}__name(DiscordLogo,"DiscordLogo");function MainLogo(){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("img",{src:"/harper-studio_white.png",alt:"Harper Studio",className:"w-64 hidden md:inline-block"}),jsxRuntimeExports.jsx("img",{src:"/HDBDogOnly.svg",width:"50px",height:"44px",alt:"Harper",className:"inline-block md:hidden"})]})}__name(MainLogo,"MainLogo");function createContext2(rootComponentName,defaultContext){const Context=reactExports.createContext(defaultContext),Provider2=__name(props=>{const{children,...context}=props,value=reactExports.useMemo(()=>context,Object.values(context));return jsxRuntimeExports.jsx(Context.Provider,{value,children})},"Provider");Provider2.displayName=rootComponentName+"Provider";function useContext2(consumerName){const context=reactExports.useContext(Context);if(context)return context;if(defaultContext!==void 0)return defaultContext;throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``)}return __name(useContext2,"useContext2"),[Provider2,useContext2]}__name(createContext2,"createContext2");function createContextScope(scopeName,createContextScopeDeps=[]){let defaultContexts=[];function createContext3(rootComponentName,defaultContext){const BaseContext=reactExports.createContext(defaultContext),index2=defaultContexts.length;defaultContexts=[...defaultContexts,defaultContext];const Provider2=__name(props=>{const{scope,children,...context}=props,Context=scope?.[scopeName]?.[index2]||BaseContext,value=reactExports.useMemo(()=>context,Object.values(context));return jsxRuntimeExports.jsx(Context.Provider,{value,children})},"Provider");Provider2.displayName=rootComponentName+"Provider";function useContext2(consumerName,scope){const Context=scope?.[scopeName]?.[index2]||BaseContext,context=reactExports.useContext(Context);if(context)return context;if(defaultContext!==void 0)return defaultContext;throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``)}return __name(useContext2,"useContext2"),[Provider2,useContext2]}__name(createContext3,"createContext3");const createScope=__name(()=>{const scopeContexts=defaultContexts.map(defaultContext=>reactExports.createContext(defaultContext));return __name(function(scope){const contexts=scope?.[scopeName]||scopeContexts;return reactExports.useMemo(()=>({[`__scope${scopeName}`]:{...scope,[scopeName]:contexts}}),[scope,contexts])},"useScope")},"createScope");return createScope.scopeName=scopeName,[createContext3,composeContextScopes(createScope,...createContextScopeDeps)]}__name(createContextScope,"createContextScope");function composeContextScopes(...scopes){const baseScope=scopes[0];if(scopes.length===1)return baseScope;const createScope=__name(()=>{const scopeHooks=scopes.map(createScope2=>({useScope:createScope2(),scopeName:createScope2.scopeName}));return __name(function(overrideScopes){const nextScopes=scopeHooks.reduce((nextScopes2,{useScope,scopeName})=>{const currentScope=useScope(overrideScopes)[`__scope${scopeName}`];return{...nextScopes2,...currentScope}},{});return reactExports.useMemo(()=>({[`__scope${baseScope.scopeName}`]:nextScopes}),[nextScopes])},"useComposedScopes")},"createScope");return createScope.scopeName=baseScope.scopeName,createScope}__name(composeContextScopes,"composeContextScopes");function composeEventHandlers$1(originalEventHandler,ourEventHandler,{checkForDefaultPrevented=!0}={}){return __name(function(event){if(originalEventHandler?.(event),checkForDefaultPrevented===!1||!event.defaultPrevented)return ourEventHandler?.(event)},"handleEvent")}__name(composeEventHandlers$1,"composeEventHandlers$1");function createSlot(ownerName){const SlotClone=createSlotClone(ownerName),Slot2=reactExports.forwardRef((props,forwardedRef)=>{const{children,...slotProps}=props,childrenArray=reactExports.Children.toArray(children),slottable=childrenArray.find(isSlottable);if(slottable){const newElement=slottable.props.children,newChildren=childrenArray.map(child=>child===slottable?reactExports.Children.count(newElement)>1?reactExports.Children.only(null):reactExports.isValidElement(newElement)?newElement.props.children:null:child);return jsxRuntimeExports.jsx(SlotClone,{...slotProps,ref:forwardedRef,children:reactExports.isValidElement(newElement)?reactExports.cloneElement(newElement,void 0,newChildren):null})}return jsxRuntimeExports.jsx(SlotClone,{...slotProps,ref:forwardedRef,children})});return Slot2.displayName=`${ownerName}.Slot`,Slot2}__name(createSlot,"createSlot");function createSlotClone(ownerName){const SlotClone=reactExports.forwardRef((props,forwardedRef)=>{const{children,...slotProps}=props;if(reactExports.isValidElement(children)){const childrenRef=getElementRef$1(children),props2=mergeProps(slotProps,children.props);return children.type!==reactExports.Fragment&&(props2.ref=forwardedRef?composeRefs(forwardedRef,childrenRef):childrenRef),reactExports.cloneElement(children,props2)}return reactExports.Children.count(children)>1?reactExports.Children.only(null):null});return SlotClone.displayName=`${ownerName}.SlotClone`,SlotClone}__name(createSlotClone,"createSlotClone");var SLOTTABLE_IDENTIFIER=Symbol("radix.slottable");function createSlottable(ownerName){const Slottable2=__name(({children})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children}),"Slottable2");return Slottable2.displayName=`${ownerName}.Slottable`,Slottable2.__radixId=SLOTTABLE_IDENTIFIER,Slottable2}__name(createSlottable,"createSlottable");function isSlottable(child){return reactExports.isValidElement(child)&&typeof child.type=="function"&&"__radixId"in child.type&&child.type.__radixId===SLOTTABLE_IDENTIFIER}__name(isSlottable,"isSlottable");function mergeProps(slotProps,childProps){const overrideProps={...childProps};for(const propName in childProps){const slotPropValue=slotProps[propName],childPropValue=childProps[propName];/^on[A-Z]/.test(propName)?slotPropValue&&childPropValue?overrideProps[propName]=(...args)=>{const result=childPropValue(...args);return slotPropValue(...args),result}:slotPropValue&&(overrideProps[propName]=slotPropValue):propName==="style"?overrideProps[propName]={...slotPropValue,...childPropValue}:propName==="className"&&(overrideProps[propName]=[slotPropValue,childPropValue].filter(Boolean).join(" "))}return{...slotProps,...overrideProps}}__name(mergeProps,"mergeProps");function getElementRef$1(element2){let getter=Object.getOwnPropertyDescriptor(element2.props,"ref")?.get,mayWarn=getter&&"isReactWarning"in getter&&getter.isReactWarning;return mayWarn?element2.ref:(getter=Object.getOwnPropertyDescriptor(element2,"ref")?.get,mayWarn=getter&&"isReactWarning"in getter&&getter.isReactWarning,mayWarn?element2.props.ref:element2.props.ref||element2.ref)}__name(getElementRef$1,"getElementRef$1");var NODES$1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$1=NODES$1.reduce((primitive,node2)=>{const Slot2=createSlot(`Primitive.${node2}`),Node2=reactExports.forwardRef((props,forwardedRef)=>{const{asChild,...primitiveProps}=props,Comp=asChild?Slot2:node2;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(Comp,{...primitiveProps,ref:forwardedRef})});return Node2.displayName=`Primitive.${node2}`,{...primitive,[node2]:Node2}},{});function dispatchDiscreteCustomEvent(target,event){target&&reactDomExports.flushSync(()=>target.dispatchEvent(event))}__name(dispatchDiscreteCustomEvent,"dispatchDiscreteCustomEvent");var useLayoutEffect2=globalThis?.document?reactExports.useLayoutEffect:()=>{},useInsertionEffect=React$1[" useInsertionEffect ".trim().toString()]||useLayoutEffect2;function useControllableState({prop,defaultProp,onChange=__name(()=>{},"onChange"),caller}){const[uncontrolledProp,setUncontrolledProp,onChangeRef]=useUncontrolledState({defaultProp,onChange}),isControlled=prop!==void 0,value=isControlled?prop:uncontrolledProp;{const isControlledRef=reactExports.useRef(prop!==void 0);reactExports.useEffect(()=>{const wasControlled=isControlledRef.current;wasControlled!==isControlled&&console.warn(`${caller} is changing from ${wasControlled?"controlled":"uncontrolled"} to ${isControlled?"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.`),isControlledRef.current=isControlled},[isControlled,caller])}const setValue=reactExports.useCallback(nextValue=>{if(isControlled){const value2=isFunction$3(nextValue)?nextValue(prop):nextValue;value2!==prop&&onChangeRef.current?.(value2)}else setUncontrolledProp(nextValue)},[isControlled,prop,setUncontrolledProp,onChangeRef]);return[value,setValue]}__name(useControllableState,"useControllableState");function useUncontrolledState({defaultProp,onChange}){const[value,setValue]=reactExports.useState(defaultProp),prevValueRef=reactExports.useRef(value),onChangeRef=reactExports.useRef(onChange);return useInsertionEffect(()=>{onChangeRef.current=onChange},[onChange]),reactExports.useEffect(()=>{prevValueRef.current!==value&&(onChangeRef.current?.(value),prevValueRef.current=value)},[value,prevValueRef]),[value,setValue,onChangeRef]}__name(useUncontrolledState,"useUncontrolledState");function isFunction$3(value){return typeof value=="function"}__name(isFunction$3,"isFunction$3");var DirectionContext=reactExports.createContext(void 0);function useDirection(localDir){const globalDir=reactExports.useContext(DirectionContext);return localDir||globalDir||"ltr"}__name(useDirection,"useDirection");function useStateMachine$1(initialState2,machine){return reactExports.useReducer((state2,event)=>machine[state2][event]??state2,initialState2)}__name(useStateMachine$1,"useStateMachine$1");var Presence=__name(props=>{const{present,children}=props,presence=usePresence(present),child=typeof children=="function"?children({present:presence.isPresent}):reactExports.Children.only(children),ref=useComposedRefs(presence.ref,getElementRef(child));return typeof children=="function"||presence.isPresent?reactExports.cloneElement(child,{ref}):null},"Presence");Presence.displayName="Presence";function usePresence(present){const[node2,setNode]=reactExports.useState(),stylesRef=reactExports.useRef(null),prevPresentRef=reactExports.useRef(present),prevAnimationNameRef=reactExports.useRef("none"),initialState2=present?"mounted":"unmounted",[state2,send2]=useStateMachine$1(initialState2,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return reactExports.useEffect(()=>{const currentAnimationName=getAnimationName(stylesRef.current);prevAnimationNameRef.current=state2==="mounted"?currentAnimationName:"none"},[state2]),useLayoutEffect2(()=>{const styles=stylesRef.current,wasPresent=prevPresentRef.current;if(wasPresent!==present){const prevAnimationName=prevAnimationNameRef.current,currentAnimationName=getAnimationName(styles);present?send2("MOUNT"):currentAnimationName==="none"||styles?.display==="none"?send2("UNMOUNT"):send2(wasPresent&&prevAnimationName!==currentAnimationName?"ANIMATION_OUT":"UNMOUNT"),prevPresentRef.current=present}},[present,send2]),useLayoutEffect2(()=>{if(node2){let timeoutId;const ownerWindow=node2.ownerDocument.defaultView??window,handleAnimationEnd=__name(event=>{const isCurrentAnimation=getAnimationName(stylesRef.current).includes(CSS.escape(event.animationName));if(event.target===node2&&isCurrentAnimation&&(send2("ANIMATION_END"),!prevPresentRef.current)){const currentFillMode=node2.style.animationFillMode;node2.style.animationFillMode="forwards",timeoutId=ownerWindow.setTimeout(()=>{node2.style.animationFillMode==="forwards"&&(node2.style.animationFillMode=currentFillMode)})}},"handleAnimationEnd"),handleAnimationStart=__name(event=>{event.target===node2&&(prevAnimationNameRef.current=getAnimationName(stylesRef.current))},"handleAnimationStart");return node2.addEventListener("animationstart",handleAnimationStart),node2.addEventListener("animationcancel",handleAnimationEnd),node2.addEventListener("animationend",handleAnimationEnd),()=>{ownerWindow.clearTimeout(timeoutId),node2.removeEventListener("animationstart",handleAnimationStart),node2.removeEventListener("animationcancel",handleAnimationEnd),node2.removeEventListener("animationend",handleAnimationEnd)}}else send2("ANIMATION_END")},[node2,send2]),{isPresent:["mounted","unmountSuspended"].includes(state2),ref:reactExports.useCallback(node22=>{stylesRef.current=node22?getComputedStyle(node22):null,setNode(node22)},[])}}__name(usePresence,"usePresence");function getAnimationName(styles){return styles?.animationName||"none"}__name(getAnimationName,"getAnimationName");function getElementRef(element2){let getter=Object.getOwnPropertyDescriptor(element2.props,"ref")?.get,mayWarn=getter&&"isReactWarning"in getter&&getter.isReactWarning;return mayWarn?element2.ref:(getter=Object.getOwnPropertyDescriptor(element2,"ref")?.get,mayWarn=getter&&"isReactWarning"in getter&&getter.isReactWarning,mayWarn?element2.props.ref:element2.props.ref||element2.ref)}__name(getElementRef,"getElementRef");var useReactId=React$1[" useId ".trim().toString()]||(()=>{}),count$2=0;function useId(deterministicId){const[id2,setId]=reactExports.useState(useReactId());return useLayoutEffect2(()=>{setId(reactId=>reactId??String(count$2++))},[deterministicId]),id2?`radix-${id2}`:""}__name(useId,"useId");function createCollection(name2){const PROVIDER_NAME2=name2+"CollectionProvider",[createCollectionContext,createCollectionScope2]=createContextScope(PROVIDER_NAME2),[CollectionProviderImpl,useCollectionContext]=createCollectionContext(PROVIDER_NAME2,{collectionRef:{current:null},itemMap:new Map}),CollectionProvider=__name(props=>{const{scope,children}=props,ref=React.useRef(null),itemMap=React.useRef(new Map).current;return jsxRuntimeExports.jsx(CollectionProviderImpl,{scope,itemMap,collectionRef:ref,children})},"CollectionProvider");CollectionProvider.displayName=PROVIDER_NAME2;const COLLECTION_SLOT_NAME=name2+"CollectionSlot",CollectionSlotImpl=createSlot(COLLECTION_SLOT_NAME),CollectionSlot=React.forwardRef((props,forwardedRef)=>{const{scope,children}=props,context=useCollectionContext(COLLECTION_SLOT_NAME,scope),composedRefs=useComposedRefs(forwardedRef,context.collectionRef);return jsxRuntimeExports.jsx(CollectionSlotImpl,{ref:composedRefs,children})});CollectionSlot.displayName=COLLECTION_SLOT_NAME;const ITEM_SLOT_NAME=name2+"CollectionItemSlot",ITEM_DATA_ATTR="data-radix-collection-item",CollectionItemSlotImpl=createSlot(ITEM_SLOT_NAME),CollectionItemSlot=React.forwardRef((props,forwardedRef)=>{const{scope,children,...itemData}=props,ref=React.useRef(null),composedRefs=useComposedRefs(forwardedRef,ref),context=useCollectionContext(ITEM_SLOT_NAME,scope);return React.useEffect(()=>(context.itemMap.set(ref,{ref,...itemData}),()=>{context.itemMap.delete(ref)})),jsxRuntimeExports.jsx(CollectionItemSlotImpl,{[ITEM_DATA_ATTR]:"",ref:composedRefs,children})});CollectionItemSlot.displayName=ITEM_SLOT_NAME;function useCollection2(scope){const context=useCollectionContext(name2+"CollectionConsumer",scope);return React.useCallback(()=>{const collectionNode=context.collectionRef.current;if(!collectionNode)return[];const orderedNodes=Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));return Array.from(context.itemMap.values()).sort((a2,b)=>orderedNodes.indexOf(a2.ref.current)-orderedNodes.indexOf(b.ref.current))},[context.collectionRef,context.itemMap])}return __name(useCollection2,"useCollection"),[{Provider:CollectionProvider,Slot:CollectionSlot,ItemSlot:CollectionItemSlot},useCollection2,createCollectionScope2]}__name(createCollection,"createCollection");function useCallbackRef$1(callback){const callbackRef=reactExports.useRef(callback);return reactExports.useEffect(()=>{callbackRef.current=callback}),reactExports.useMemo(()=>(...args)=>callbackRef.current?.(...args),[])}__name(useCallbackRef$1,"useCallbackRef$1");function useEscapeKeydown(onEscapeKeyDownProp,ownerDocument=globalThis?.document){const onEscapeKeyDown=useCallbackRef$1(onEscapeKeyDownProp);reactExports.useEffect(()=>{const handleKeyDown=__name(event=>{event.key==="Escape"&&onEscapeKeyDown(event)},"handleKeyDown");return ownerDocument.addEventListener("keydown",handleKeyDown,{capture:!0}),()=>ownerDocument.removeEventListener("keydown",handleKeyDown,{capture:!0})},[onEscapeKeyDown,ownerDocument])}__name(useEscapeKeydown,"useEscapeKeydown");var DISMISSABLE_LAYER_NAME="DismissableLayer",CONTEXT_UPDATE="dismissableLayer.update",POINTER_DOWN_OUTSIDE="dismissableLayer.pointerDownOutside",FOCUS_OUTSIDE="dismissableLayer.focusOutside",originalBodyPointerEvents,DismissableLayerContext=reactExports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),DismissableLayer=reactExports.forwardRef((props,forwardedRef)=>{const{disableOutsidePointerEvents=!1,onEscapeKeyDown,onPointerDownOutside,onFocusOutside,onInteractOutside,onDismiss,...layerProps}=props,context=reactExports.useContext(DismissableLayerContext),[node2,setNode]=reactExports.useState(null),ownerDocument=node2?.ownerDocument??globalThis?.document,[,force]=reactExports.useState({}),composedRefs=useComposedRefs(forwardedRef,node22=>setNode(node22)),layers=Array.from(context.layers),[highestLayerWithOutsidePointerEventsDisabled]=[...context.layersWithOutsidePointerEventsDisabled].slice(-1),highestLayerWithOutsidePointerEventsDisabledIndex=layers.indexOf(highestLayerWithOutsidePointerEventsDisabled),index2=node2?layers.indexOf(node2):-1,isBodyPointerEventsDisabled=context.layersWithOutsidePointerEventsDisabled.size>0,isPointerEventsEnabled=index2>=highestLayerWithOutsidePointerEventsDisabledIndex,pointerDownOutside=usePointerDownOutside(event=>{const target=event.target,isPointerDownOnBranch=[...context.branches].some(branch=>branch.contains(target));!isPointerEventsEnabled||isPointerDownOnBranch||(onPointerDownOutside?.(event),onInteractOutside?.(event),event.defaultPrevented||onDismiss?.())},ownerDocument),focusOutside=useFocusOutside(event=>{const target=event.target;[...context.branches].some(branch=>branch.contains(target))||(onFocusOutside?.(event),onInteractOutside?.(event),event.defaultPrevented||onDismiss?.())},ownerDocument);return useEscapeKeydown(event=>{index2===context.layers.size-1&&(onEscapeKeyDown?.(event),!event.defaultPrevented&&onDismiss&&(event.preventDefault(),onDismiss()))},ownerDocument),reactExports.useEffect(()=>{if(node2)return disableOutsidePointerEvents&&(context.layersWithOutsidePointerEventsDisabled.size===0&&(originalBodyPointerEvents=ownerDocument.body.style.pointerEvents,ownerDocument.body.style.pointerEvents="none"),context.layersWithOutsidePointerEventsDisabled.add(node2)),context.layers.add(node2),dispatchUpdate(),()=>{disableOutsidePointerEvents&&context.layersWithOutsidePointerEventsDisabled.size===1&&(ownerDocument.body.style.pointerEvents=originalBodyPointerEvents)}},[node2,ownerDocument,disableOutsidePointerEvents,context]),reactExports.useEffect(()=>()=>{node2&&(context.layers.delete(node2),context.layersWithOutsidePointerEventsDisabled.delete(node2),dispatchUpdate())},[node2,context]),reactExports.useEffect(()=>{const handleUpdate=__name(()=>force({}),"handleUpdate");return document.addEventListener(CONTEXT_UPDATE,handleUpdate),()=>document.removeEventListener(CONTEXT_UPDATE,handleUpdate)},[]),jsxRuntimeExports.jsx(Primitive$1.div,{...layerProps,ref:composedRefs,style:{pointerEvents:isBodyPointerEventsDisabled?isPointerEventsEnabled?"auto":"none":void 0,...props.style},onFocusCapture:composeEventHandlers$1(props.onFocusCapture,focusOutside.onFocusCapture),onBlurCapture:composeEventHandlers$1(props.onBlurCapture,focusOutside.onBlurCapture),onPointerDownCapture:composeEventHandlers$1(props.onPointerDownCapture,pointerDownOutside.onPointerDownCapture)})});DismissableLayer.displayName=DISMISSABLE_LAYER_NAME;var BRANCH_NAME="DismissableLayerBranch",DismissableLayerBranch=reactExports.forwardRef((props,forwardedRef)=>{const context=reactExports.useContext(DismissableLayerContext),ref=reactExports.useRef(null),composedRefs=useComposedRefs(forwardedRef,ref);return reactExports.useEffect(()=>{const node2=ref.current;if(node2)return context.branches.add(node2),()=>{context.branches.delete(node2)}},[context.branches]),jsxRuntimeExports.jsx(Primitive$1.div,{...props,ref:composedRefs})});DismissableLayerBranch.displayName=BRANCH_NAME;function usePointerDownOutside(onPointerDownOutside,ownerDocument=globalThis?.document){const handlePointerDownOutside=useCallbackRef$1(onPointerDownOutside),isPointerInsideReactTreeRef=reactExports.useRef(!1),handleClickRef=reactExports.useRef(()=>{});return reactExports.useEffect(()=>{const handlePointerDown=__name(event=>{if(event.target&&!isPointerInsideReactTreeRef.current){let handleAndDispatchPointerDownOutsideEvent2=__name(function(){handleAndDispatchCustomEvent(POINTER_DOWN_OUTSIDE,handlePointerDownOutside,eventDetail,{discrete:!0})},"handleAndDispatchPointerDownOutsideEvent2");const eventDetail={originalEvent:event};event.pointerType==="touch"?(ownerDocument.removeEventListener("click",handleClickRef.current),handleClickRef.current=handleAndDispatchPointerDownOutsideEvent2,ownerDocument.addEventListener("click",handleClickRef.current,{once:!0})):handleAndDispatchPointerDownOutsideEvent2()}else ownerDocument.removeEventListener("click",handleClickRef.current);isPointerInsideReactTreeRef.current=!1},"handlePointerDown"),timerId=window.setTimeout(()=>{ownerDocument.addEventListener("pointerdown",handlePointerDown)},0);return()=>{window.clearTimeout(timerId),ownerDocument.removeEventListener("pointerdown",handlePointerDown),ownerDocument.removeEventListener("click",handleClickRef.current)}},[ownerDocument,handlePointerDownOutside]),{onPointerDownCapture:__name(()=>isPointerInsideReactTreeRef.current=!0,"onPointerDownCapture")}}__name(usePointerDownOutside,"usePointerDownOutside");function useFocusOutside(onFocusOutside,ownerDocument=globalThis?.document){const handleFocusOutside=useCallbackRef$1(onFocusOutside),isFocusInsideReactTreeRef=reactExports.useRef(!1);return reactExports.useEffect(()=>{const handleFocus=__name(event=>{event.target&&!isFocusInsideReactTreeRef.current&&handleAndDispatchCustomEvent(FOCUS_OUTSIDE,handleFocusOutside,{originalEvent:event},{discrete:!1})},"handleFocus");return ownerDocument.addEventListener("focusin",handleFocus),()=>ownerDocument.removeEventListener("focusin",handleFocus)},[ownerDocument,handleFocusOutside]),{onFocusCapture:__name(()=>isFocusInsideReactTreeRef.current=!0,"onFocusCapture"),onBlurCapture:__name(()=>isFocusInsideReactTreeRef.current=!1,"onBlurCapture")}}__name(useFocusOutside,"useFocusOutside");function dispatchUpdate(){const event=new CustomEvent(CONTEXT_UPDATE);document.dispatchEvent(event)}__name(dispatchUpdate,"dispatchUpdate");function handleAndDispatchCustomEvent(name2,handler,detail,{discrete}){const target=detail.originalEvent.target,event=new CustomEvent(name2,{bubbles:!1,cancelable:!0,detail});handler&&target.addEventListener(name2,handler,{once:!0}),discrete?dispatchDiscreteCustomEvent(target,event):target.dispatchEvent(event)}__name(handleAndDispatchCustomEvent,"handleAndDispatchCustomEvent");function usePrevious$2(value){const ref=reactExports.useRef({value,previous:value});return reactExports.useMemo(()=>(ref.current.value!==value&&(ref.current.previous=ref.current.value,ref.current.value=value),ref.current.previous),[value])}__name(usePrevious$2,"usePrevious$2");var VISUALLY_HIDDEN_STYLES=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"}),NAME$4="VisuallyHidden",VisuallyHidden=reactExports.forwardRef((props,forwardedRef)=>jsxRuntimeExports.jsx(Primitive$1.span,{...props,ref:forwardedRef,style:{...VISUALLY_HIDDEN_STYLES,...props.style}}));VisuallyHidden.displayName=NAME$4;var Root$8=VisuallyHidden,NAVIGATION_MENU_NAME="NavigationMenu",[Collection$3,useCollection$3,createCollectionScope$3]=createCollection(NAVIGATION_MENU_NAME),[FocusGroupCollection,useFocusGroupCollection,createFocusGroupCollectionScope]=createCollection(NAVIGATION_MENU_NAME),[createNavigationMenuContext]=createContextScope(NAVIGATION_MENU_NAME,[createCollectionScope$3,createFocusGroupCollectionScope]),[NavigationMenuProviderImpl,useNavigationMenuContext]=createNavigationMenuContext(NAVIGATION_MENU_NAME),[ViewportContentProvider,useViewportContentContext]=createNavigationMenuContext(NAVIGATION_MENU_NAME),NavigationMenu$1=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeNavigationMenu,value:valueProp,onValueChange,defaultValue,delayDuration=200,skipDelayDuration=300,orientation="horizontal",dir,...NavigationMenuProps}=props,[navigationMenu,setNavigationMenu]=reactExports.useState(null),composedRef=useComposedRefs(forwardedRef,node2=>setNavigationMenu(node2)),direction=useDirection(dir),openTimerRef=reactExports.useRef(0),closeTimerRef=reactExports.useRef(0),skipDelayTimerRef=reactExports.useRef(0),[isOpenDelayed,setIsOpenDelayed]=reactExports.useState(!0),[value,setValue]=useControllableState({prop:valueProp,onChange:__name(value2=>{const isOpen=value2!=="",hasSkipDelayDuration=skipDelayDuration>0;isOpen?(window.clearTimeout(skipDelayTimerRef.current),hasSkipDelayDuration&&setIsOpenDelayed(!1)):(window.clearTimeout(skipDelayTimerRef.current),skipDelayTimerRef.current=window.setTimeout(()=>setIsOpenDelayed(!0),skipDelayDuration)),onValueChange?.(value2)},"onChange"),defaultProp:defaultValue??"",caller:NAVIGATION_MENU_NAME}),startCloseTimer=reactExports.useCallback(()=>{window.clearTimeout(closeTimerRef.current),closeTimerRef.current=window.setTimeout(()=>setValue(""),150)},[setValue]),handleOpen=reactExports.useCallback(itemValue=>{window.clearTimeout(closeTimerRef.current),setValue(itemValue)},[setValue]),handleDelayedOpen=reactExports.useCallback(itemValue=>{value===itemValue?window.clearTimeout(closeTimerRef.current):openTimerRef.current=window.setTimeout(()=>{window.clearTimeout(closeTimerRef.current),setValue(itemValue)},delayDuration)},[value,setValue,delayDuration]);return reactExports.useEffect(()=>()=>{window.clearTimeout(openTimerRef.current),window.clearTimeout(closeTimerRef.current),window.clearTimeout(skipDelayTimerRef.current)},[]),jsxRuntimeExports.jsx(NavigationMenuProvider,{scope:__scopeNavigationMenu,isRootMenu:!0,value,dir:direction,orientation,rootNavigationMenu:navigationMenu,onTriggerEnter:__name(itemValue=>{window.clearTimeout(openTimerRef.current),isOpenDelayed?handleDelayedOpen(itemValue):handleOpen(itemValue)},"onTriggerEnter"),onTriggerLeave:__name(()=>{window.clearTimeout(openTimerRef.current),startCloseTimer()},"onTriggerLeave"),onContentEnter:__name(()=>window.clearTimeout(closeTimerRef.current),"onContentEnter"),onContentLeave:startCloseTimer,onItemSelect:__name(itemValue=>{setValue(prevValue=>prevValue===itemValue?"":itemValue)},"onItemSelect"),onItemDismiss:__name(()=>setValue(""),"onItemDismiss"),children:jsxRuntimeExports.jsx(Primitive$1.nav,{"aria-label":"Main","data-orientation":orientation,dir:direction,...NavigationMenuProps,ref:composedRef})})});NavigationMenu$1.displayName=NAVIGATION_MENU_NAME;var SUB_NAME$1="NavigationMenuSub",NavigationMenuSub=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeNavigationMenu,value:valueProp,onValueChange,defaultValue,orientation="horizontal",...subProps}=props,context=useNavigationMenuContext(SUB_NAME$1,__scopeNavigationMenu),[value,setValue]=useControllableState({prop:valueProp,onChange:onValueChange,defaultProp:defaultValue??"",caller:SUB_NAME$1});return jsxRuntimeExports.jsx(NavigationMenuProvider,{scope:__scopeNavigationMenu,isRootMenu:!1,value,dir:context.dir,orientation,rootNavigationMenu:context.rootNavigationMenu,onTriggerEnter:__name(itemValue=>setValue(itemValue),"onTriggerEnter"),onItemSelect:__name(itemValue=>setValue(itemValue),"onItemSelect"),onItemDismiss:__name(()=>setValue(""),"onItemDismiss"),children:jsxRuntimeExports.jsx(Primitive$1.div,{"data-orientation":orientation,...subProps,ref:forwardedRef})})});NavigationMenuSub.displayName=SUB_NAME$1;var NavigationMenuProvider=__name(props=>{const{scope,isRootMenu,rootNavigationMenu,dir,orientation,children,value,onItemSelect,onItemDismiss,onTriggerEnter,onTriggerLeave,onContentEnter,onContentLeave}=props,[viewport,setViewport]=reactExports.useState(null),[viewportContent,setViewportContent]=reactExports.useState(new Map),[indicatorTrack,setIndicatorTrack]=reactExports.useState(null);return jsxRuntimeExports.jsx(NavigationMenuProviderImpl,{scope,isRootMenu,rootNavigationMenu,value,previousValue:usePrevious$2(value),baseId:useId(),dir,orientation,viewport,onViewportChange:setViewport,indicatorTrack,onIndicatorTrackChange:setIndicatorTrack,onTriggerEnter:useCallbackRef$1(onTriggerEnter),onTriggerLeave:useCallbackRef$1(onTriggerLeave),onContentEnter:useCallbackRef$1(onContentEnter),onContentLeave:useCallbackRef$1(onContentLeave),onItemSelect:useCallbackRef$1(onItemSelect),onItemDismiss:useCallbackRef$1(onItemDismiss),onViewportContentChange:reactExports.useCallback((contentValue,contentData)=>{setViewportContent(prevContent=>(prevContent.set(contentValue,contentData),new Map(prevContent)))},[]),onViewportContentRemove:reactExports.useCallback(contentValue=>{setViewportContent(prevContent=>prevContent.has(contentValue)?(prevContent.delete(contentValue),new Map(prevContent)):prevContent)},[]),children:jsxRuntimeExports.jsx(Collection$3.Provider,{scope,children:jsxRuntimeExports.jsx(ViewportContentProvider,{scope,items:viewportContent,children})})})},"NavigationMenuProvider"),LIST_NAME="NavigationMenuList",NavigationMenuList$1=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeNavigationMenu,...listProps}=props,context=useNavigationMenuContext(LIST_NAME,__scopeNavigationMenu),list2=jsxRuntimeExports.jsx(Primitive$1.ul,{"data-orientation":context.orientation,...listProps,ref:forwardedRef});return jsxRuntimeExports.jsx(Primitive$1.div,{style:{position:"relative"},ref:context.onIndicatorTrackChange,children:jsxRuntimeExports.jsx(Collection$3.Slot,{scope:__scopeNavigationMenu,children:context.isRootMenu?jsxRuntimeExports.jsx(FocusGroup,{asChild:!0,children:list2}):list2})})});NavigationMenuList$1.displayName=LIST_NAME;var ITEM_NAME$5="NavigationMenuItem",[NavigationMenuItemContextProvider,useNavigationMenuItemContext]=createNavigationMenuContext(ITEM_NAME$5),NavigationMenuItem$1=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeNavigationMenu,value:valueProp,...itemProps}=props,autoValue=useId(),value=valueProp||autoValue||"LEGACY_REACT_AUTO_VALUE",contentRef=reactExports.useRef(null),triggerRef=reactExports.useRef(null),focusProxyRef=reactExports.useRef(null),restoreContentTabOrderRef=reactExports.useRef(()=>{}),wasEscapeCloseRef=reactExports.useRef(!1),handleContentEntry=reactExports.useCallback((side="start")=>{if(contentRef.current){restoreContentTabOrderRef.current();const candidates=getTabbableCandidates$1(contentRef.current);candidates.length&&focusFirst$3(side==="start"?candidates:candidates.reverse())}},[]),handleContentExit=reactExports.useCallback(()=>{if(contentRef.current){const candidates=getTabbableCandidates$1(contentRef.current);candidates.length&&(restoreContentTabOrderRef.current=removeFromTabOrder(candidates))}},[]);return jsxRuntimeExports.jsx(NavigationMenuItemContextProvider,{scope:__scopeNavigationMenu,value,triggerRef,contentRef,focusProxyRef,wasEscapeCloseRef,onEntryKeyDown:handleContentEntry,onFocusProxyEnter:handleContentEntry,onRootContentClose:handleContentExit,onContentFocusOutside:handleContentExit,children:jsxRuntimeExports.jsx(Primitive$1.li,{...itemProps,ref:forwardedRef})})});NavigationMenuItem$1.displayName=ITEM_NAME$5;var TRIGGER_NAME$5="NavigationMenuTrigger",NavigationMenuTrigger=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeNavigationMenu,disabled,...triggerProps}=props,context=useNavigationMenuContext(TRIGGER_NAME$5,props.__scopeNavigationMenu),itemContext=useNavigationMenuItemContext(TRIGGER_NAME$5,props.__scopeNavigationMenu),ref=reactExports.useRef(null),composedRefs=useComposedRefs(ref,itemContext.triggerRef,forwardedRef),triggerId=makeTriggerId$1(context.baseId,itemContext.value),contentId=makeContentId$1(context.baseId,itemContext.value),hasPointerMoveOpenedRef=reactExports.useRef(!1),wasClickCloseRef=reactExports.useRef(!1),open=itemContext.value===context.value;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Collection$3.ItemSlot,{scope:__scopeNavigationMenu,value:itemContext.value,children:jsxRuntimeExports.jsx(FocusGroupItem,{asChild:!0,children:jsxRuntimeExports.jsx(Primitive$1.button,{id:triggerId,disabled,"data-disabled":disabled?"":void 0,"data-state":getOpenState$1(open),"aria-expanded":open,"aria-controls":contentId,...triggerProps,ref:composedRefs,onPointerEnter:composeEventHandlers$1(props.onPointerEnter,()=>{wasClickCloseRef.current=!1,itemContext.wasEscapeCloseRef.current=!1}),onPointerMove:composeEventHandlers$1(props.onPointerMove,whenMouse$1(()=>{disabled||wasClickCloseRef.current||itemContext.wasEscapeCloseRef.current||hasPointerMoveOpenedRef.current||(context.onTriggerEnter(itemContext.value),hasPointerMoveOpenedRef.current=!0)})),onPointerLeave:composeEventHandlers$1(props.onPointerLeave,whenMouse$1(()=>{disabled||(context.onTriggerLeave(),hasPointerMoveOpenedRef.current=!1)})),onClick:composeEventHandlers$1(props.onClick,()=>{context.onItemSelect(itemContext.value),wasClickCloseRef.current=open}),onKeyDown:composeEventHandlers$1(props.onKeyDown,event=>{const entryKey={horizontal:"ArrowDown",vertical:context.dir==="rtl"?"ArrowLeft":"ArrowRight"}[context.orientation];open&&event.key===entryKey&&(itemContext.onEntryKeyDown(),event.preventDefault())})})})}),open&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Root$8,{"aria-hidden":!0,tabIndex:0,ref:itemContext.focusProxyRef,onFocus:__name(event=>{const content2=itemContext.contentRef.current,prevFocusedElement=event.relatedTarget,wasTriggerFocused=prevFocusedElement===ref.current,wasFocusFromContent=content2?.contains(prevFocusedElement);(wasTriggerFocused||!wasFocusFromContent)&&itemContext.onFocusProxyEnter(wasTriggerFocused?"start":"end")},"onFocus")}),context.viewport&&jsxRuntimeExports.jsx("span",{"aria-owns":contentId})]})]})});NavigationMenuTrigger.displayName=TRIGGER_NAME$5;var LINK_NAME="NavigationMenuLink",LINK_SELECT="navigationMenu.linkSelect",NavigationMenuLink$1=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeNavigationMenu,active,onSelect,...linkProps}=props;return jsxRuntimeExports.jsx(FocusGroupItem,{asChild:!0,children:jsxRuntimeExports.jsx(Primitive$1.a,{"data-active":active?"":void 0,"aria-current":active?"page":void 0,...linkProps,ref:forwardedRef,onClick:composeEventHandlers$1(props.onClick,event=>{const target=event.target,linkSelectEvent=new CustomEvent(LINK_SELECT,{bubbles:!0,cancelable:!0});if(target.addEventListener(LINK_SELECT,event2=>onSelect?.(event2),{once:!0}),dispatchDiscreteCustomEvent(target,linkSelectEvent),!linkSelectEvent.defaultPrevented&&!event.metaKey){const rootContentDismissEvent=new CustomEvent(ROOT_CONTENT_DISMISS,{bubbles:!0,cancelable:!0});dispatchDiscreteCustomEvent(target,rootContentDismissEvent)}},{checkForDefaultPrevented:!1})})})});NavigationMenuLink$1.displayName=LINK_NAME;var INDICATOR_NAME$2="NavigationMenuIndicator",NavigationMenuIndicator=reactExports.forwardRef((props,forwardedRef)=>{const{forceMount,...indicatorProps}=props,context=useNavigationMenuContext(INDICATOR_NAME$2,props.__scopeNavigationMenu),isVisible=!!context.value;return context.indicatorTrack?ye.createPortal(jsxRuntimeExports.jsx(Presence,{present:forceMount||isVisible,children:jsxRuntimeExports.jsx(NavigationMenuIndicatorImpl,{...indicatorProps,ref:forwardedRef})}),context.indicatorTrack):null});NavigationMenuIndicator.displayName=INDICATOR_NAME$2;var NavigationMenuIndicatorImpl=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeNavigationMenu,...indicatorProps}=props,context=useNavigationMenuContext(INDICATOR_NAME$2,__scopeNavigationMenu),getItems=useCollection$3(__scopeNavigationMenu),[activeTrigger,setActiveTrigger]=reactExports.useState(null),[position2,setPosition]=reactExports.useState(null),isHorizontal=context.orientation==="horizontal",isVisible=!!context.value;reactExports.useEffect(()=>{const triggerNode=getItems().find(item=>item.value===context.value)?.ref.current;triggerNode&&setActiveTrigger(triggerNode)},[getItems,context.value]);const handlePositionChange=__name(()=>{activeTrigger&&setPosition({size:isHorizontal?activeTrigger.offsetWidth:activeTrigger.offsetHeight,offset:isHorizontal?activeTrigger.offsetLeft:activeTrigger.offsetTop})},"handlePositionChange");return useResizeObserver$1(activeTrigger,handlePositionChange),useResizeObserver$1(context.indicatorTrack,handlePositionChange),position2?jsxRuntimeExports.jsx(Primitive$1.div,{"aria-hidden":!0,"data-state":isVisible?"visible":"hidden","data-orientation":context.orientation,...indicatorProps,ref:forwardedRef,style:{position:"absolute",...isHorizontal?{left:0,width:position2.size+"px",transform:`translateX(${position2.offset}px)`}:{top:0,height:position2.size+"px",transform:`translateY(${position2.offset}px)`},...indicatorProps.style}}):null}),CONTENT_NAME$7="NavigationMenuContent",NavigationMenuContent=reactExports.forwardRef((props,forwardedRef)=>{const{forceMount,...contentProps}=props,context=useNavigationMenuContext(CONTENT_NAME$7,props.__scopeNavigationMenu),itemContext=useNavigationMenuItemContext(CONTENT_NAME$7,props.__scopeNavigationMenu),composedRefs=useComposedRefs(itemContext.contentRef,forwardedRef),open=itemContext.value===context.value,commonProps={value:itemContext.value,triggerRef:itemContext.triggerRef,focusProxyRef:itemContext.focusProxyRef,wasEscapeCloseRef:itemContext.wasEscapeCloseRef,onContentFocusOutside:itemContext.onContentFocusOutside,onRootContentClose:itemContext.onRootContentClose,...contentProps};return context.viewport?jsxRuntimeExports.jsx(ViewportContentMounter,{forceMount,...commonProps,ref:composedRefs}):jsxRuntimeExports.jsx(Presence,{present:forceMount||open,children:jsxRuntimeExports.jsx(NavigationMenuContentImpl,{"data-state":getOpenState$1(open),...commonProps,ref:composedRefs,onPointerEnter:composeEventHandlers$1(props.onPointerEnter,context.onContentEnter),onPointerLeave:composeEventHandlers$1(props.onPointerLeave,whenMouse$1(context.onContentLeave)),style:{pointerEvents:!open&&context.isRootMenu?"none":void 0,...commonProps.style}})})});NavigationMenuContent.displayName=CONTENT_NAME$7;var ViewportContentMounter=reactExports.forwardRef((props,forwardedRef)=>{const context=useNavigationMenuContext(CONTENT_NAME$7,props.__scopeNavigationMenu),{onViewportContentChange,onViewportContentRemove}=context;return useLayoutEffect2(()=>{onViewportContentChange(props.value,{ref:forwardedRef,...props})},[props,forwardedRef,onViewportContentChange]),useLayoutEffect2(()=>()=>onViewportContentRemove(props.value),[props.value,onViewportContentRemove]),null}),ROOT_CONTENT_DISMISS="navigationMenu.rootContentDismiss",NavigationMenuContentImpl=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeNavigationMenu,value,triggerRef,focusProxyRef,wasEscapeCloseRef,onRootContentClose,onContentFocusOutside,...contentProps}=props,context=useNavigationMenuContext(CONTENT_NAME$7,__scopeNavigationMenu),ref=reactExports.useRef(null),composedRefs=useComposedRefs(ref,forwardedRef),triggerId=makeTriggerId$1(context.baseId,value),contentId=makeContentId$1(context.baseId,value),getItems=useCollection$3(__scopeNavigationMenu),prevMotionAttributeRef=reactExports.useRef(null),{onItemDismiss}=context;reactExports.useEffect(()=>{const content2=ref.current;if(context.isRootMenu&&content2){const handleClose=__name(()=>{onItemDismiss(),onRootContentClose(),content2.contains(document.activeElement)&&triggerRef.current?.focus()},"handleClose");return content2.addEventListener(ROOT_CONTENT_DISMISS,handleClose),()=>content2.removeEventListener(ROOT_CONTENT_DISMISS,handleClose)}},[context.isRootMenu,props.value,triggerRef,onItemDismiss,onRootContentClose]);const motionAttribute=reactExports.useMemo(()=>{const values=getItems().map(item=>item.value);context.dir==="rtl"&&values.reverse();const index2=values.indexOf(context.value),prevIndex=values.indexOf(context.previousValue),isSelected=value===context.value,wasSelected=prevIndex===values.indexOf(value);if(!isSelected&&!wasSelected)return prevMotionAttributeRef.current;const attribute=(()=>{if(index2!==prevIndex){if(isSelected&&prevIndex!==-1)return index2>prevIndex?"from-end":"from-start";if(wasSelected&&index2!==-1)return index2>prevIndex?"to-start":"to-end"}return null})();return prevMotionAttributeRef.current=attribute,attribute},[context.previousValue,context.value,context.dir,getItems,value]);return jsxRuntimeExports.jsx(FocusGroup,{asChild:!0,children:jsxRuntimeExports.jsx(DismissableLayer,{id:contentId,"aria-labelledby":triggerId,"data-motion":motionAttribute,"data-orientation":context.orientation,...contentProps,ref:composedRefs,disableOutsidePointerEvents:!1,onDismiss:__name(()=>{const rootContentDismissEvent=new Event(ROOT_CONTENT_DISMISS,{bubbles:!0,cancelable:!0});ref.current?.dispatchEvent(rootContentDismissEvent)},"onDismiss"),onFocusOutside:composeEventHandlers$1(props.onFocusOutside,event=>{onContentFocusOutside();const target=event.target;context.rootNavigationMenu?.contains(target)&&event.preventDefault()}),onPointerDownOutside:composeEventHandlers$1(props.onPointerDownOutside,event=>{const target=event.target,isTrigger=getItems().some(item=>item.ref.current?.contains(target)),isRootViewport=context.isRootMenu&&context.viewport?.contains(target);(isTrigger||isRootViewport||!context.isRootMenu)&&event.preventDefault()}),onKeyDown:composeEventHandlers$1(props.onKeyDown,event=>{const isMetaKey=event.altKey||event.ctrlKey||event.metaKey;if(event.key==="Tab"&&!isMetaKey){const candidates=getTabbableCandidates$1(event.currentTarget),focusedElement=document.activeElement,index2=candidates.findIndex(candidate=>candidate===focusedElement),nextCandidates=event.shiftKey?candidates.slice(0,index2).reverse():candidates.slice(index2+1,candidates.length);focusFirst$3(nextCandidates)?event.preventDefault():focusProxyRef.current?.focus()}}),onEscapeKeyDown:composeEventHandlers$1(props.onEscapeKeyDown,_event=>{wasEscapeCloseRef.current=!0})})})}),VIEWPORT_NAME$2="NavigationMenuViewport",NavigationMenuViewport$1=reactExports.forwardRef((props,forwardedRef)=>{const{forceMount,...viewportProps}=props,open=!!useNavigationMenuContext(VIEWPORT_NAME$2,props.__scopeNavigationMenu).value;return jsxRuntimeExports.jsx(Presence,{present:forceMount||open,children:jsxRuntimeExports.jsx(NavigationMenuViewportImpl,{...viewportProps,ref:forwardedRef})})});NavigationMenuViewport$1.displayName=VIEWPORT_NAME$2;var NavigationMenuViewportImpl=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeNavigationMenu,children,...viewportImplProps}=props,context=useNavigationMenuContext(VIEWPORT_NAME$2,__scopeNavigationMenu),composedRefs=useComposedRefs(forwardedRef,context.onViewportChange),viewportContentContext=useViewportContentContext(CONTENT_NAME$7,props.__scopeNavigationMenu),[size2,setSize]=reactExports.useState(null),[content2,setContent]=reactExports.useState(null),viewportWidth=size2?size2?.width+"px":void 0,viewportHeight=size2?size2?.height+"px":void 0,open=!!context.value,activeContentValue=open?context.value:context.previousValue;return useResizeObserver$1(content2,__name(()=>{content2&&setSize({width:content2.offsetWidth,height:content2.offsetHeight})},"handleSizeChange")),jsxRuntimeExports.jsx(Primitive$1.div,{"data-state":getOpenState$1(open),"data-orientation":context.orientation,...viewportImplProps,ref:composedRefs,style:{pointerEvents:!open&&context.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":viewportWidth,"--radix-navigation-menu-viewport-height":viewportHeight,...viewportImplProps.style},onPointerEnter:composeEventHandlers$1(props.onPointerEnter,context.onContentEnter),onPointerLeave:composeEventHandlers$1(props.onPointerLeave,whenMouse$1(context.onContentLeave)),children:Array.from(viewportContentContext.items).map(([value,{ref,forceMount,...props2}])=>{const isActive=activeContentValue===value;return jsxRuntimeExports.jsx(Presence,{present:forceMount||isActive,children:jsxRuntimeExports.jsx(NavigationMenuContentImpl,{...props2,ref:composeRefs(ref,node2=>{isActive&&node2&&setContent(node2)})})},value)})})}),FOCUS_GROUP_NAME="FocusGroup",FocusGroup=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeNavigationMenu,...groupProps}=props,context=useNavigationMenuContext(FOCUS_GROUP_NAME,__scopeNavigationMenu);return jsxRuntimeExports.jsx(FocusGroupCollection.Provider,{scope:__scopeNavigationMenu,children:jsxRuntimeExports.jsx(FocusGroupCollection.Slot,{scope:__scopeNavigationMenu,children:jsxRuntimeExports.jsx(Primitive$1.div,{dir:context.dir,...groupProps,ref:forwardedRef})})})}),ARROW_KEYS$1=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],FOCUS_GROUP_ITEM_NAME="FocusGroupItem",FocusGroupItem=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeNavigationMenu,...groupProps}=props,getItems=useFocusGroupCollection(__scopeNavigationMenu),context=useNavigationMenuContext(FOCUS_GROUP_ITEM_NAME,__scopeNavigationMenu);return jsxRuntimeExports.jsx(FocusGroupCollection.ItemSlot,{scope:__scopeNavigationMenu,children:jsxRuntimeExports.jsx(Primitive$1.button,{...groupProps,ref:forwardedRef,onKeyDown:composeEventHandlers$1(props.onKeyDown,event=>{if(["Home","End",...ARROW_KEYS$1].includes(event.key)){let candidateNodes=getItems().map(item=>item.ref.current);if([context.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(event.key)&&candidateNodes.reverse(),ARROW_KEYS$1.includes(event.key)){const currentIndex=candidateNodes.indexOf(event.currentTarget);candidateNodes=candidateNodes.slice(currentIndex+1)}setTimeout(()=>focusFirst$3(candidateNodes)),event.preventDefault()}})})})});function getTabbableCandidates$1(container){const nodes=[],walker=document.createTreeWalker(container,NodeFilter.SHOW_ELEMENT,{acceptNode:__name(node2=>{const isHiddenInput=node2.tagName==="INPUT"&&node2.type==="hidden";return node2.disabled||node2.hidden||isHiddenInput?NodeFilter.FILTER_SKIP:node2.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;walker.nextNode();)nodes.push(walker.currentNode);return nodes}__name(getTabbableCandidates$1,"getTabbableCandidates$1");function focusFirst$3(candidates){const previouslyFocusedElement=document.activeElement;return candidates.some(candidate=>candidate===previouslyFocusedElement?!0:(candidate.focus(),document.activeElement!==previouslyFocusedElement))}__name(focusFirst$3,"focusFirst$3");function removeFromTabOrder(candidates){return candidates.forEach(candidate=>{candidate.dataset.tabindex=candidate.getAttribute("tabindex")||"",candidate.setAttribute("tabindex","-1")}),()=>{candidates.forEach(candidate=>{const prevTabIndex=candidate.dataset.tabindex;candidate.setAttribute("tabindex",prevTabIndex)})}}__name(removeFromTabOrder,"removeFromTabOrder");function useResizeObserver$1(element2,onResize){const handleResize=useCallbackRef$1(onResize);useLayoutEffect2(()=>{let rAF=0;if(element2){const resizeObserver=new ResizeObserver(()=>{cancelAnimationFrame(rAF),rAF=window.requestAnimationFrame(handleResize)});return resizeObserver.observe(element2),()=>{window.cancelAnimationFrame(rAF),resizeObserver.unobserve(element2)}}},[element2,handleResize])}__name(useResizeObserver$1,"useResizeObserver$1");function getOpenState$1(open){return open?"open":"closed"}__name(getOpenState$1,"getOpenState$1");function makeTriggerId$1(baseId,value){return`${baseId}-trigger-${value}`}__name(makeTriggerId$1,"makeTriggerId$1");function makeContentId$1(baseId,value){return`${baseId}-content-${value}`}__name(makeContentId$1,"makeContentId$1");function whenMouse$1(handler){return event=>event.pointerType==="mouse"?handler(event):void 0}__name(whenMouse$1,"whenMouse$1");var Root2$5=NavigationMenu$1,List$1=NavigationMenuList$1,Item$2=NavigationMenuItem$1,Link=NavigationMenuLink$1,Viewport$2=NavigationMenuViewport$1;function NavigationMenuViewport({className,...props}){return jsxRuntimeExports.jsx("div",{className:cn$1("absolute top-full left-0 isolate z-50 flex justify-center"),children:jsxRuntimeExports.jsx(Viewport$2,{"data-slot":"navigation-menu-viewport",className:cn$1("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)]",className),...props})})}__name(NavigationMenuViewport,"NavigationMenuViewport");function NavigationMenu({className,children,viewport=!0,...props}){return jsxRuntimeExports.jsxs(Root2$5,{"data-slot":"navigation-menu","data-viewport":viewport,className:cn$1("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",className),...props,children:[children,viewport&&jsxRuntimeExports.jsx(NavigationMenuViewport,{})]})}__name(NavigationMenu,"NavigationMenu");function NavigationMenuItem({className,...props}){return jsxRuntimeExports.jsx(Item$2,{"data-slot":"navigation-menu-item",className:cn$1("relative",className),...props})}__name(NavigationMenuItem,"NavigationMenuItem");function NavigationMenuLink({className,...props}){return jsxRuntimeExports.jsx(Link,{"data-slot":"navigation-menu-link",className:cn$1("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",className),...props})}__name(NavigationMenuLink,"NavigationMenuLink");function NavigationMenuList({className,...props}){return jsxRuntimeExports.jsx(List$1,{"data-slot":"navigation-menu-list",className:cn$1("group flex flex-1 list-none items-center justify-center gap-1",className),...props})}__name(NavigationMenuList,"NavigationMenuList");const badgeVariants=cva("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 Version(){return jsxRuntimeExports.jsx("a",{href:"https://github.com/HarperFast/studio/releases",target:"_blank",rel:"noopener noreferrer",children:jsxRuntimeExports.jsxs("span",{className:cn$1(badgeVariants({variant:"default"}),"text-xs inline-block ml-2 align-text-top"),children:["v4.7.22"," BETA"]})})}__name(Version,"Version");function useInstanceClient(operationsUrl,port,secure){const{instanceId,clusterId}=useParams({strict:!1});return getInstanceClient({id:OverallAppSignIn,operationsUrl,port,secure})}__name(useInstanceClient,"useInstanceClient");function useInstanceClientParams(operationsUrl,port,secure){const{instanceId,clusterId}=useParams({strict:!1});return{instanceClient:getInstanceClient({id:OverallAppSignIn,operationsUrl,port,secure}),entityType:"instance"}}__name(useInstanceClientParams,"useInstanceClientParams");function useInstanceClientIdParams(operationsUrl,port,secure){const params=useParams({strict:!1});return reactExports.useMemo(()=>getInstanceClientIdFromParams({...params,operationsUrl,port,secure}),[params,operationsUrl,port,secure])}__name(useInstanceClientIdParams,"useInstanceClientIdParams");function getInstanceClientIdFromParams({instanceId,clusterId,operationsUrl,port,secure}){const id2=OverallAppSignIn;return{instanceClient:getInstanceClient({id:id2,operationsUrl,port,secure}),entityId:id2,entityType:"instance"}}__name(getInstanceClientIdFromParams,"getInstanceClientIdFromParams");function clearLocalStorage(){localStorage.clear()}__name(clearLocalStorage,"clearLocalStorage");function clearSessionStorage(){sessionStorage.clear()}__name(clearSessionStorage,"clearSessionStorage");async function logoutOnSuccess(){authStore.setUserForEntity(OverallAppSignIn,null),queryClient.getQueryCache().clear(),clearLocalStorage(),clearSessionStorage(),await queryClient.invalidateQueries({refetchType:"none"})}__name(logoutOnSuccess,"logoutOnSuccess");async function onLogoutSubmit(instanceClientConfig){await authStore.signOutFromPotentiallyAuthenticatedInstances(),await onInstanceLogoutSubmit({...instanceClientConfig,entityId:OverallAppSignIn})}__name(onLogoutSubmit,"onLogoutSubmit");function useLogoutMutation(){const instanceClient=useInstanceClient();return useMutation({mutationFn:__name(()=>onLogoutSubmit({instanceClient}),"mutationFn"),onSuccess:logoutOnSuccess})}__name(useLogoutMutation,"useLogoutMutation");function useOrganizationPermissions(orgId){const{user}=useCloudAuth(),{organizationId:orgIdFromRoute}=useParams({strict:!1}),role=user?.roles?.[orgId??orgIdFromRoute];return!role?.permission&&!role?.organization?{update:!1,remove:!1}:role.permission?.super_user?{update:!0,remove:!0}:{update:role.organization.update,remove:role.organization.delete}}__name(useOrganizationPermissions,"useOrganizationPermissions");function useOrganizationRolePermissions(orgId){const{user}=useCloudAuth(),{organizationId:orgIdFromRoute}=useParams({strict:!1}),role=user?.roles?.[orgId??orgIdFromRoute];if(!role?.permission&&!role?.organization?.roles)return{create:!1,remove:!1,update:!1,view:!1};if(role.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const roles=role.organization.roles;return{create:roles.create,remove:roles.delete,update:roles.update,view:roles.view}}__name(useOrganizationRolePermissions,"useOrganizationRolePermissions");function useOrganizationClusterPermissions(orgId,clusterId){const{user}=useCloudAuth(),{organizationId:orgIdFromRoute,clusterId:clusterIdFromRoute}=useParams({strict:!1});return getOrganizationClusterPermissions(user,orgId??orgIdFromRoute,clusterId??clusterIdFromRoute)}__name(useOrganizationClusterPermissions,"useOrganizationClusterPermissions");function getOrganizationClusterPermissions(user,orgId,clusterId){const role=user?.roles?.[orgId];if(!role?.permission&&!role?.organization?.clusters)return{create:!1,remove:!1,update:!1,view:!1};if(role.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const specificRoles=role.organization.clusters.resources?.find(r2=>r2.id===clusterId),genericRoles=role.organization.clusters;return{create:genericRoles.create,remove:specificRoles?specificRoles.delete:genericRoles.delete,update:specificRoles?specificRoles.update:genericRoles.update,view:specificRoles?specificRoles.view:genericRoles.view}}__name(getOrganizationClusterPermissions,"getOrganizationClusterPermissions");function useOrganizationClusterInstancePermissions(orgId,clusterId){const{user}=useCloudAuth(),{organizationId:orgIdFromRoute,clusterId:clusterIdFromRoute}=useParams({strict:!1});return getOrganizationClusterInstancePermissions(user,orgIdFromRoute,clusterIdFromRoute)}__name(useOrganizationClusterInstancePermissions,"useOrganizationClusterInstancePermissions");function getOrganizationClusterInstancePermissions(user,orgId,clusterId){const role=user?.roles?.[orgId];if(!role?.permission&&!role?.organization?.clusters)return{create:!1,remove:!1,update:!1,view:!1};if(role.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const specificRoles=role.organization.clusters.resources?.find(r2=>r2.id===clusterId)?.instances,genericRoles=role.organization.clusters;return{create:specificRoles?specificRoles.create:genericRoles.create,remove:specificRoles?specificRoles.delete:genericRoles.delete,update:specificRoles?specificRoles.update:genericRoles.update,view:specificRoles?specificRoles.view:genericRoles.view}}__name(getOrganizationClusterInstancePermissions,"getOrganizationClusterInstancePermissions");function useInstanceManagePermission(entityId){const{clusterId,instanceId}=useParams({strict:!1}),{user}=useInstanceAuth(),permission=user?.role?.permission;return permission?permission.super_user===!0:!1}__name(useInstanceManagePermission,"useInstanceManagePermission");function useInstanceBrowseManagePermission(entityId){const{clusterId,instanceId}=useParams({strict:!1}),{user}=useInstanceAuth(),permission=user?.role?.permission;return permission?permission.super_user===!0||permission.structure_user===!0:!1}__name(useInstanceBrowseManagePermission,"useInstanceBrowseManagePermission");function useInstanceSchemaTablePermission(entityId,databaseName,tableName,action){const{clusterId,instanceId}=useParams({strict:!1}),{user}=useInstanceAuth(),permission=user?.role?.permission;return permission?permission.super_user===!0||permission.structure_user===!0?!0:permission[databaseName]?.tables?.[tableName][action]===!0:!1}__name(useInstanceSchemaTablePermission,"useInstanceSchemaTablePermission");const activeLinkProps$1={className:"text-white"};function Navbar(){const{mutate:signOut}=useLogoutMutation(),navigate=useNavigate(),{user}=useOverallAuth(),router=useRouter(),{organizationId}=useParams({strict:!1}),{update:canUpdateOrganization}=useOrganizationPermissions(organizationId),{view:showOrgUsersAndRoles}=useOrganizationRolePermissions(organizationId),showBilling=canUpdateOrganization,handleSignOut=reactExports.useCallback(()=>{signOut(void 0,{onSuccess:__name(async()=>{toast.success("Success",{description:"You have been signed out successfully.",action:{label:"Dismiss",onClick:__name(()=>toast.dismiss(),"onClick")}}),navigate({to:"/sign-in"}),router.invalidate()},"onSuccess")})},[signOut,router,navigate]),menuItems=reactExports.useMemo(()=>[!isLocalStudio,!isLocalStudio,!isLocalStudio,{to:"https://docs.harperdb.io/docs",target:"_blank",icon:jsxRuntimeExports.jsx(BookOpenText,{}),text:"Docs",textBreakpoint:"md"},{to:"https://github.com/HarperFast/studio/issues",target:"_blank",icon:jsxRuntimeExports.jsx(Bug,{}),text:"Report an Issue",textBreakpoint:"lg"},{to:"https://discord.gg/VzZuaw3Xay",target:"_blank",icon:jsxRuntimeExports.jsx(DiscordLogo,{}),text:"Discord",textBreakpoint:"lg"},{onClick:handleSignOut,icon:jsxRuntimeExports.jsx(LogOut,{}),text:"Sign Out",textBreakpoint:"md"}].filter(excludeFalsy),[organizationId,showBilling,showOrgUsersAndRoles,handleSignOut]);return user?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(MobileNav,{menuItems}),jsxRuntimeExports.jsx(DesktopNav,{menuItems})]}):jsxRuntimeExports.jsx(AnonymousNav,{})}__name(Navbar,"Navbar");function isMenuGroup(item){return item.items!==void 0}__name(isMenuGroup,"isMenuGroup");function AnonymousNav(){return jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntimeExports.jsxs("div",{className:"inline-block",children:[jsxRuntimeExports.jsx(Link$2,{to:"/sign-in",children:jsxRuntimeExports.jsx(MainLogo,{})}),jsxRuntimeExports.jsx(Version,{})]}),jsxRuntimeExports.jsx(NavigationMenu,{children:jsxRuntimeExports.jsxs(NavigationMenuList,{className:"text-grey-400",children:[jsxRuntimeExports.jsx(NavigationMenuItem,{children:jsxRuntimeExports.jsx(NavigationMenuLink,{asChild:!0,children:jsxRuntimeExports.jsxs(Link$2,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[jsxRuntimeExports.jsx(BookOpenText,{})," ",jsxRuntimeExports.jsx("span",{className:"hidden md:inline-block",children:"Docs"})]})})}),jsxRuntimeExports.jsx(NavigationMenuItem,{children:jsxRuntimeExports.jsx(NavigationMenuLink,{asChild:!0,children:jsxRuntimeExports.jsxs(Link$2,{to:"/sign-in",className:"flex-row items-center",activeProps:activeLinkProps$1,children:[jsxRuntimeExports.jsx(LogIn,{})," Sign In"]})})})]})})]})}__name(AnonymousNav,"AnonymousNav");function DesktopNav({menuItems}){const{user}=useOverallAuth();return getDefaultSignedInCloudRouteForUser(user),jsxRuntimeExports.jsx("div",{className:"hidden md:block",children:jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntimeExports.jsxs("div",{className:"inline-block",children:[jsxRuntimeExports.jsx(Link$2,{to:defaultInstanceRoute,children:jsxRuntimeExports.jsx(MainLogo,{})}),jsxRuntimeExports.jsx(Version,{})]}),jsxRuntimeExports.jsx(NavigationMenu,{children:jsxRuntimeExports.jsx(NavigationMenuList,{className:"text-grey-400",children:menuItems.map(menuItem=>isMenuGroup(menuItem)?!!menuItem.items.length&&jsxRuntimeExports.jsx("div",{className:"bg-black rounded-2xl flex",children:menuItem.items.map(innerMenuItem=>jsxRuntimeExports.jsx(DesktopNavItem,{menuItem:innerMenuItem},innerMenuItem.text))},menuItem.text):jsxRuntimeExports.jsx(DesktopNavItem,{menuItem},menuItem.text))})})]})})}__name(DesktopNav,"DesktopNav");function DesktopNavItem({menuItem}){return jsxRuntimeExports.jsx(NavigationMenuItem,{className:"text-gray-400 hover:text-white",children:jsxRuntimeExports.jsx(NavigationMenuLink,{asChild:!0,children:jsxRuntimeExports.jsxs(Link$2,{to:menuItem.to,onClick:menuItem.onClick,className:"flex-row items-center",target:menuItem.target,activeProps:menuItem.to?activeLinkProps$1:void 0,children:[menuItem.icon,jsxRuntimeExports.jsx("span",{className:`hidden ${menuItem.textBreakpoint}:inline-block`,children:menuItem.text}),jsxRuntimeExports.jsx("span",{className:`${menuItem.textBreakpoint}:hidden`,children:" "})]})})})}__name(DesktopNavItem,"DesktopNavItem");function MobileNav({menuItems}){const{user}=useOverallAuth();getDefaultSignedInCloudRouteForUser(user);const[isMenuOpen,setIsMenuOpen]=reactExports.useState(!1),toggleMenu=reactExports.useCallback(()=>setIsMenuOpen(open=>!open),[]),closeMenu=reactExports.useCallback(()=>setIsMenuOpen(!1),[]);return jsxRuntimeExports.jsxs("div",{className:"md:hidden",id:"mobile-menu",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntimeExports.jsx(Link$2,{to:defaultInstanceRoute,children:jsxRuntimeExports.jsx(MainLogo,{})}),jsxRuntimeExports.jsx(Version,{}),jsxRuntimeExports.jsxs("button",{type:"button",className:"shadow-xs text-grey-400 hover:text-white hover:bg-black-dark",onClick:toggleMenu,children:[jsxRuntimeExports.jsx("span",{className:"sr-only",children:isMenuOpen?"Close menu":"Open menu"}),isMenuOpen?jsxRuntimeExports.jsx(X,{}):jsxRuntimeExports.jsx(Menu$1,{})]})]}),jsxRuntimeExports.jsx("div",{className:`${isMenuOpen?"fixed":"hidden"} top-40 bottom-0 left-0 right-0 bg-black-dark opacity-70`,onClick:closeMenu}),jsxRuntimeExports.jsx("div",{className:`${isMenuOpen?"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:menuItems.map(menuItem=>isMenuGroup(menuItem)?!!menuItem.items.length&&jsxRuntimeExports.jsx("div",{className:"bg-black pl-10 pr-2 py-2",children:menuItem.items.map(innerMenuItem=>jsxRuntimeExports.jsx(MobileNavItem,{menuItem:innerMenuItem,onClick:closeMenu},innerMenuItem.text))},menuItem.text):jsxRuntimeExports.jsx(MobileNavItem,{menuItem,onClick:closeMenu},menuItem.text))})]})}__name(MobileNav,"MobileNav");function MobileNavItem({menuItem,onClick}){const linkOnClick=reactExports.useCallback(()=>{menuItem.onClick?.(),onClick()},[menuItem,onClick]);return jsxRuntimeExports.jsxs(Link$2,{to:menuItem.to,onClick:linkOnClick,target:menuItem.target,className:"flex flex-row px-3 py-2 text-base font-medium rounded-md text-gray-400 hover:text-white",activeProps:menuItem.to?activeLinkProps$1:void 0,children:[menuItem.icon,jsxRuntimeExports.jsx("span",{className:"ml-4",children:menuItem.text})]})}__name(MobileNavItem,"MobileNavItem");function AuthLayout(){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.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:jsxRuntimeExports.jsx(Navbar,{})}),jsxRuntimeExports.jsxs("div",{className:"pt-20 grid h-screen grid-cols-1 md:grid-cols-2",children:[jsxRuntimeExports.jsx("section",{className:"items-center justify-center hidden text-white md:flex px-6 fabricSignupTextContainer",children:jsxRuntimeExports.jsx("img",{className:"object-scale-down max-h-[calc(100vh-80px-40px)] min-h-115",src:"/fabric-signup-text.png",alt:"One Runtime: App, database, Cache and Messaging. Distributed by design, free to deploy, and live in minutes. Deploy!"})}),jsxRuntimeExports.jsx("section",{className:"flex items-center justify-center px-6 bg-linear-(--purple-gradient) dark:bg-linear-(--black-dark-gradient)",children:jsxRuntimeExports.jsx(Outlet,{})})]})]})}__name(AuthLayout,"AuthLayout");function useReo(){reactExports.useEffect(()=>{},[])}__name(useReo,"useReo");const commonProviders=["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 parseCompanyFromEmail(email2){if(!email2||!email2.includes("@"))return null;const domain2=email2.split("@").pop()||"";if(!domain2)return null;for(const provider of commonProviders)if(domain2===provider||domain2.endsWith("."+provider))return null;return domain2}__name(parseCompanyFromEmail,"parseCompanyFromEmail");let checking=null;function CheckOAuth(){const navigate=useNavigate(),router=useRouter(),queryClient2=useQueryClient(),{redirect:redirect2}=useSearch({strict:!1});return reactExports.useEffect(()=>{checking||(checking=(async function(){const user=await getCurrentUser().catch(()=>null);if(!user)toast.error("We were not able to verify your sign-in. Please try signing in again.",{duration:1e4}),await navigate({to:"/sign-in"});else{authStore.setUserForEntity(OverallAppSignIn,user);const defaultCloudRoute=getDefaultSignedInCloudRouteForUser(user);parseCompanyFromEmail(user.email),await queryClient2.invalidateQueries({queryKey:currentUserQueryKey,refetchType:"none"}),await router.invalidate(),await navigate({to:redirect2?.startsWith("/")?redirect2:defaultCloudRoute})}checking=null})())},[]),jsxRuntimeExports.jsxs("div",{className:"text-white w-lg flex flex-col gap-4",children:[jsxRuntimeExports.jsxs("h1",{className:"text-3xl font-light",children:[jsxRuntimeExports.jsx("span",{"aria-hidden":"true",className:"text-2xl animate-flower-dance mr-4",title:"Loading",children:"🌼"}),"Checking..."]}),jsxRuntimeExports.jsx("div",{className:"underline flex gap-4",children:jsxRuntimeExports.jsx(Link$2,{className:"text-sm opacity-50 hover:text-blue-300",to:"/sign-in",children:"Try signing in again"})})]})}__name(CheckOAuth,"CheckOAuth");const sides=["top","right","bottom","left"],min$1=Math.min,max$1=Math.max,round=Math.round,floor=Math.floor,createCoords=__name(v2=>({x:v2,y:v2}),"createCoords"),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp$1(start,value,end){return max$1(start,min$1(value,end))}__name(clamp$1,"clamp$1");function evaluate(value,param){return typeof value=="function"?value(param):value}__name(evaluate,"evaluate");function getSide(placement){return placement.split("-")[0]}__name(getSide,"getSide");function getAlignment(placement){return placement.split("-")[1]}__name(getAlignment,"getAlignment");function getOppositeAxis(axis){return axis==="x"?"y":"x"}__name(getOppositeAxis,"getOppositeAxis");function getAxisLength(axis){return axis==="y"?"height":"width"}__name(getAxisLength,"getAxisLength");const yAxisSides=new Set(["top","bottom"]);function getSideAxis(placement){return yAxisSides.has(getSide(placement))?"y":"x"}__name(getSideAxis,"getSideAxis");function getAlignmentAxis(placement){return getOppositeAxis(getSideAxis(placement))}__name(getAlignmentAxis,"getAlignmentAxis");function getAlignmentSides(placement,rects,rtl){rtl===void 0&&(rtl=!1);const alignment=getAlignment(placement),alignmentAxis=getAlignmentAxis(placement),length=getAxisLength(alignmentAxis);let mainAlignmentSide=alignmentAxis==="x"?alignment===(rtl?"end":"start")?"right":"left":alignment==="start"?"bottom":"top";return rects.reference[length]>rects.floating[length]&&(mainAlignmentSide=getOppositePlacement(mainAlignmentSide)),[mainAlignmentSide,getOppositePlacement(mainAlignmentSide)]}__name(getAlignmentSides,"getAlignmentSides");function getExpandedPlacements(placement){const oppositePlacement=getOppositePlacement(placement);return[getOppositeAlignmentPlacement(placement),oppositePlacement,getOppositeAlignmentPlacement(oppositePlacement)]}__name(getExpandedPlacements,"getExpandedPlacements");function getOppositeAlignmentPlacement(placement){return placement.replace(/start|end/g,alignment=>oppositeAlignmentMap[alignment])}__name(getOppositeAlignmentPlacement,"getOppositeAlignmentPlacement");const lrPlacement=["left","right"],rlPlacement=["right","left"],tbPlacement=["top","bottom"],btPlacement=["bottom","top"];function getSideList(side,isStart,rtl){switch(side){case"top":case"bottom":return rtl?isStart?rlPlacement:lrPlacement:isStart?lrPlacement:rlPlacement;case"left":case"right":return isStart?tbPlacement:btPlacement;default:return[]}}__name(getSideList,"getSideList");function getOppositeAxisPlacements(placement,flipAlignment,direction,rtl){const alignment=getAlignment(placement);let list2=getSideList(getSide(placement),direction==="start",rtl);return alignment&&(list2=list2.map(side=>side+"-"+alignment),flipAlignment&&(list2=list2.concat(list2.map(getOppositeAlignmentPlacement)))),list2}__name(getOppositeAxisPlacements,"getOppositeAxisPlacements");function getOppositePlacement(placement){return placement.replace(/left|right|bottom|top/g,side=>oppositeSideMap[side])}__name(getOppositePlacement,"getOppositePlacement");function expandPaddingObject(padding){return{top:0,right:0,bottom:0,left:0,...padding}}__name(expandPaddingObject,"expandPaddingObject");function getPaddingObject(padding){return typeof padding!="number"?expandPaddingObject(padding):{top:padding,right:padding,bottom:padding,left:padding}}__name(getPaddingObject,"getPaddingObject");function rectToClientRect(rect){const{x,y,width,height}=rect;return{width,height,top:y,left:x,right:x+width,bottom:y+height,x,y}}__name(rectToClientRect,"rectToClientRect");function computeCoordsFromPlacement(_ref,placement,rtl){let{reference,floating}=_ref;const sideAxis=getSideAxis(placement),alignmentAxis=getAlignmentAxis(placement),alignLength=getAxisLength(alignmentAxis),side=getSide(placement),isVertical=sideAxis==="y",commonX=reference.x+reference.width/2-floating.width/2,commonY=reference.y+reference.height/2-floating.height/2,commonAlign=reference[alignLength]/2-floating[alignLength]/2;let coords;switch(side){case"top":coords={x:commonX,y:reference.y-floating.height};break;case"bottom":coords={x:commonX,y:reference.y+reference.height};break;case"right":coords={x:reference.x+reference.width,y:commonY};break;case"left":coords={x:reference.x-floating.width,y:commonY};break;default:coords={x:reference.x,y:reference.y}}switch(getAlignment(placement)){case"start":coords[alignmentAxis]-=commonAlign*(rtl&&isVertical?-1:1);break;case"end":coords[alignmentAxis]+=commonAlign*(rtl&&isVertical?-1:1);break}return coords}__name(computeCoordsFromPlacement,"computeCoordsFromPlacement");const computePosition$1=__name(async(reference,floating,config2)=>{const{placement="bottom",strategy="absolute",middleware=[],platform:platform2}=config2,validMiddleware=middleware.filter(Boolean),rtl=await(platform2.isRTL==null?void 0:platform2.isRTL(floating));let rects=await platform2.getElementRects({reference,floating,strategy}),{x,y}=computeCoordsFromPlacement(rects,placement,rtl),statefulPlacement=placement,middlewareData={},resetCount=0;for(let i2=0;i2<validMiddleware.length;i2++){const{name:name2,fn}=validMiddleware[i2],{x:nextX,y:nextY,data,reset}=await fn({x,y,initialPlacement:placement,placement:statefulPlacement,strategy,middlewareData,rects,platform:platform2,elements:{reference,floating}});x=nextX??x,y=nextY??y,middlewareData={...middlewareData,[name2]:{...middlewareData[name2],...data}},reset&&resetCount<=50&&(resetCount++,typeof reset=="object"&&(reset.placement&&(statefulPlacement=reset.placement),reset.rects&&(rects=reset.rects===!0?await platform2.getElementRects({reference,floating,strategy}):reset.rects),{x,y}=computeCoordsFromPlacement(rects,statefulPlacement,rtl)),i2=-1)}return{x,y,placement:statefulPlacement,strategy,middlewareData}},"computePosition$1");async function detectOverflow(state2,options){var _await$platform$isEle;options===void 0&&(options={});const{x,y,platform:platform2,rects,elements,strategy}=state2,{boundary="clippingAncestors",rootBoundary="viewport",elementContext="floating",altBoundary=!1,padding=0}=evaluate(options,state2),paddingObject=getPaddingObject(padding),element2=elements[altBoundary?elementContext==="floating"?"reference":"floating":elementContext],clippingClientRect=rectToClientRect(await platform2.getClippingRect({element:(_await$platform$isEle=await(platform2.isElement==null?void 0:platform2.isElement(element2)))==null||_await$platform$isEle?element2:element2.contextElement||await(platform2.getDocumentElement==null?void 0:platform2.getDocumentElement(elements.floating)),boundary,rootBoundary,strategy})),rect=elementContext==="floating"?{x,y,width:rects.floating.width,height:rects.floating.height}:rects.reference,offsetParent=await(platform2.getOffsetParent==null?void 0:platform2.getOffsetParent(elements.floating)),offsetScale=await(platform2.isElement==null?void 0:platform2.isElement(offsetParent))?await(platform2.getScale==null?void 0:platform2.getScale(offsetParent))||{x:1,y:1}:{x:1,y:1},elementClientRect=rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect?await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({elements,rect,offsetParent,strategy}):rect);return{top:(clippingClientRect.top-elementClientRect.top+paddingObject.top)/offsetScale.y,bottom:(elementClientRect.bottom-clippingClientRect.bottom+paddingObject.bottom)/offsetScale.y,left:(clippingClientRect.left-elementClientRect.left+paddingObject.left)/offsetScale.x,right:(elementClientRect.right-clippingClientRect.right+paddingObject.right)/offsetScale.x}}__name(detectOverflow,"detectOverflow");const arrow$3=__name(options=>({name:"arrow",options,async fn(state2){const{x,y,placement,rects,platform:platform2,elements,middlewareData}=state2,{element:element2,padding=0}=evaluate(options,state2)||{};if(element2==null)return{};const paddingObject=getPaddingObject(padding),coords={x,y},axis=getAlignmentAxis(placement),length=getAxisLength(axis),arrowDimensions=await platform2.getDimensions(element2),isYAxis=axis==="y",minProp=isYAxis?"top":"left",maxProp=isYAxis?"bottom":"right",clientProp=isYAxis?"clientHeight":"clientWidth",endDiff=rects.reference[length]+rects.reference[axis]-coords[axis]-rects.floating[length],startDiff=coords[axis]-rects.reference[axis],arrowOffsetParent=await(platform2.getOffsetParent==null?void 0:platform2.getOffsetParent(element2));let clientSize=arrowOffsetParent?arrowOffsetParent[clientProp]:0;(!clientSize||!await(platform2.isElement==null?void 0:platform2.isElement(arrowOffsetParent)))&&(clientSize=elements.floating[clientProp]||rects.floating[length]);const centerToReference=endDiff/2-startDiff/2,largestPossiblePadding=clientSize/2-arrowDimensions[length]/2-1,minPadding=min$1(paddingObject[minProp],largestPossiblePadding),maxPadding=min$1(paddingObject[maxProp],largestPossiblePadding),min$1$1=minPadding,max2=clientSize-arrowDimensions[length]-maxPadding,center=clientSize/2-arrowDimensions[length]/2+centerToReference,offset2=clamp$1(min$1$1,center,max2),shouldAddOffset=!middlewareData.arrow&&getAlignment(placement)!=null&¢er!==offset2&&rects.reference[length]/2-(center<min$1$1?minPadding:maxPadding)-arrowDimensions[length]/2<0,alignmentOffset=shouldAddOffset?center<min$1$1?center-min$1$1:center-max2:0;return{[axis]:coords[axis]+alignmentOffset,data:{[axis]:offset2,centerOffset:center-offset2-alignmentOffset,...shouldAddOffset&&{alignmentOffset}},reset:shouldAddOffset}}}),"arrow$3"),flip$2=__name(function(options){return options===void 0&&(options={}),{name:"flip",options,async fn(state2){var _middlewareData$arrow,_middlewareData$flip;const{placement,middlewareData,rects,initialPlacement,platform:platform2,elements}=state2,{mainAxis:checkMainAxis=!0,crossAxis:checkCrossAxis=!0,fallbackPlacements:specifiedFallbackPlacements,fallbackStrategy="bestFit",fallbackAxisSideDirection="none",flipAlignment=!0,...detectOverflowOptions}=evaluate(options,state2);if((_middlewareData$arrow=middlewareData.arrow)!=null&&_middlewareData$arrow.alignmentOffset)return{};const side=getSide(placement),initialSideAxis=getSideAxis(initialPlacement),isBasePlacement=getSide(initialPlacement)===initialPlacement,rtl=await(platform2.isRTL==null?void 0:platform2.isRTL(elements.floating)),fallbackPlacements=specifiedFallbackPlacements||(isBasePlacement||!flipAlignment?[getOppositePlacement(initialPlacement)]:getExpandedPlacements(initialPlacement)),hasFallbackAxisSideDirection=fallbackAxisSideDirection!=="none";!specifiedFallbackPlacements&&hasFallbackAxisSideDirection&&fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement,flipAlignment,fallbackAxisSideDirection,rtl));const placements=[initialPlacement,...fallbackPlacements],overflow=await detectOverflow(state2,detectOverflowOptions),overflows=[];let overflowsData=((_middlewareData$flip=middlewareData.flip)==null?void 0:_middlewareData$flip.overflows)||[];if(checkMainAxis&&overflows.push(overflow[side]),checkCrossAxis){const sides2=getAlignmentSides(placement,rects,rtl);overflows.push(overflow[sides2[0]],overflow[sides2[1]])}if(overflowsData=[...overflowsData,{placement,overflows}],!overflows.every(side2=>side2<=0)){var _middlewareData$flip2,_overflowsData$filter;const nextIndex=(((_middlewareData$flip2=middlewareData.flip)==null?void 0:_middlewareData$flip2.index)||0)+1,nextPlacement=placements[nextIndex];if(nextPlacement&&(!(checkCrossAxis==="alignment"?initialSideAxis!==getSideAxis(nextPlacement):!1)||overflowsData.every(d=>getSideAxis(d.placement)===initialSideAxis?d.overflows[0]>0:!0)))return{data:{index:nextIndex,overflows:overflowsData},reset:{placement:nextPlacement}};let resetPlacement=(_overflowsData$filter=overflowsData.filter(d=>d.overflows[0]<=0).sort((a2,b)=>a2.overflows[1]-b.overflows[1])[0])==null?void 0:_overflowsData$filter.placement;if(!resetPlacement)switch(fallbackStrategy){case"bestFit":{var _overflowsData$filter2;const placement2=(_overflowsData$filter2=overflowsData.filter(d=>{if(hasFallbackAxisSideDirection){const currentSideAxis=getSideAxis(d.placement);return currentSideAxis===initialSideAxis||currentSideAxis==="y"}return!0}).map(d=>[d.placement,d.overflows.filter(overflow2=>overflow2>0).reduce((acc,overflow2)=>acc+overflow2,0)]).sort((a2,b)=>a2[1]-b[1])[0])==null?void 0:_overflowsData$filter2[0];placement2&&(resetPlacement=placement2);break}case"initialPlacement":resetPlacement=initialPlacement;break}if(placement!==resetPlacement)return{reset:{placement:resetPlacement}}}return{}}}},"flip$2");function getSideOffsets(overflow,rect){return{top:overflow.top-rect.height,right:overflow.right-rect.width,bottom:overflow.bottom-rect.height,left:overflow.left-rect.width}}__name(getSideOffsets,"getSideOffsets");function isAnySideFullyClipped(overflow){return sides.some(side=>overflow[side]>=0)}__name(isAnySideFullyClipped,"isAnySideFullyClipped");const hide$2=__name(function(options){return options===void 0&&(options={}),{name:"hide",options,async fn(state2){const{rects}=state2,{strategy="referenceHidden",...detectOverflowOptions}=evaluate(options,state2);switch(strategy){case"referenceHidden":{const overflow=await detectOverflow(state2,{...detectOverflowOptions,elementContext:"reference"}),offsets=getSideOffsets(overflow,rects.reference);return{data:{referenceHiddenOffsets:offsets,referenceHidden:isAnySideFullyClipped(offsets)}}}case"escaped":{const overflow=await detectOverflow(state2,{...detectOverflowOptions,altBoundary:!0}),offsets=getSideOffsets(overflow,rects.floating);return{data:{escapedOffsets:offsets,escaped:isAnySideFullyClipped(offsets)}}}default:return{}}}}},"hide$2"),originSides=new Set(["left","top"]);async function convertValueToCoords(state2,options){const{placement,platform:platform2,elements}=state2,rtl=await(platform2.isRTL==null?void 0:platform2.isRTL(elements.floating)),side=getSide(placement),alignment=getAlignment(placement),isVertical=getSideAxis(placement)==="y",mainAxisMulti=originSides.has(side)?-1:1,crossAxisMulti=rtl&&isVertical?-1:1,rawValue=evaluate(options,state2);let{mainAxis,crossAxis,alignmentAxis}=typeof rawValue=="number"?{mainAxis:rawValue,crossAxis:0,alignmentAxis:null}:{mainAxis:rawValue.mainAxis||0,crossAxis:rawValue.crossAxis||0,alignmentAxis:rawValue.alignmentAxis};return alignment&&typeof alignmentAxis=="number"&&(crossAxis=alignment==="end"?alignmentAxis*-1:alignmentAxis),isVertical?{x:crossAxis*crossAxisMulti,y:mainAxis*mainAxisMulti}:{x:mainAxis*mainAxisMulti,y:crossAxis*crossAxisMulti}}__name(convertValueToCoords,"convertValueToCoords");const offset$2=__name(function(options){return options===void 0&&(options=0),{name:"offset",options,async fn(state2){var _middlewareData$offse,_middlewareData$arrow;const{x,y,placement,middlewareData}=state2,diffCoords=await convertValueToCoords(state2,options);return placement===((_middlewareData$offse=middlewareData.offset)==null?void 0:_middlewareData$offse.placement)&&(_middlewareData$arrow=middlewareData.arrow)!=null&&_middlewareData$arrow.alignmentOffset?{}:{x:x+diffCoords.x,y:y+diffCoords.y,data:{...diffCoords,placement}}}}},"offset$2"),shift$2=__name(function(options){return options===void 0&&(options={}),{name:"shift",options,async fn(state2){const{x,y,placement}=state2,{mainAxis:checkMainAxis=!0,crossAxis:checkCrossAxis=!1,limiter={fn:__name(_ref=>{let{x:x2,y:y2}=_ref;return{x:x2,y:y2}},"fn")},...detectOverflowOptions}=evaluate(options,state2),coords={x,y},overflow=await detectOverflow(state2,detectOverflowOptions),crossAxis=getSideAxis(getSide(placement)),mainAxis=getOppositeAxis(crossAxis);let mainAxisCoord=coords[mainAxis],crossAxisCoord=coords[crossAxis];if(checkMainAxis){const minSide=mainAxis==="y"?"top":"left",maxSide=mainAxis==="y"?"bottom":"right",min2=mainAxisCoord+overflow[minSide],max2=mainAxisCoord-overflow[maxSide];mainAxisCoord=clamp$1(min2,mainAxisCoord,max2)}if(checkCrossAxis){const minSide=crossAxis==="y"?"top":"left",maxSide=crossAxis==="y"?"bottom":"right",min2=crossAxisCoord+overflow[minSide],max2=crossAxisCoord-overflow[maxSide];crossAxisCoord=clamp$1(min2,crossAxisCoord,max2)}const limitedCoords=limiter.fn({...state2,[mainAxis]:mainAxisCoord,[crossAxis]:crossAxisCoord});return{...limitedCoords,data:{x:limitedCoords.x-x,y:limitedCoords.y-y,enabled:{[mainAxis]:checkMainAxis,[crossAxis]:checkCrossAxis}}}}}},"shift$2"),limitShift$2=__name(function(options){return options===void 0&&(options={}),{options,fn(state2){const{x,y,placement,rects,middlewareData}=state2,{offset:offset2=0,mainAxis:checkMainAxis=!0,crossAxis:checkCrossAxis=!0}=evaluate(options,state2),coords={x,y},crossAxis=getSideAxis(placement),mainAxis=getOppositeAxis(crossAxis);let mainAxisCoord=coords[mainAxis],crossAxisCoord=coords[crossAxis];const rawOffset=evaluate(offset2,state2),computedOffset=typeof rawOffset=="number"?{mainAxis:rawOffset,crossAxis:0}:{mainAxis:0,crossAxis:0,...rawOffset};if(checkMainAxis){const len=mainAxis==="y"?"height":"width",limitMin=rects.reference[mainAxis]-rects.floating[len]+computedOffset.mainAxis,limitMax=rects.reference[mainAxis]+rects.reference[len]-computedOffset.mainAxis;mainAxisCoord<limitMin?mainAxisCoord=limitMin:mainAxisCoord>limitMax&&(mainAxisCoord=limitMax)}if(checkCrossAxis){var _middlewareData$offse,_middlewareData$offse2;const len=mainAxis==="y"?"width":"height",isOriginSide=originSides.has(getSide(placement)),limitMin=rects.reference[crossAxis]-rects.floating[len]+(isOriginSide&&((_middlewareData$offse=middlewareData.offset)==null?void 0:_middlewareData$offse[crossAxis])||0)+(isOriginSide?0:computedOffset.crossAxis),limitMax=rects.reference[crossAxis]+rects.reference[len]+(isOriginSide?0:((_middlewareData$offse2=middlewareData.offset)==null?void 0:_middlewareData$offse2[crossAxis])||0)-(isOriginSide?computedOffset.crossAxis:0);crossAxisCoord<limitMin?crossAxisCoord=limitMin:crossAxisCoord>limitMax&&(crossAxisCoord=limitMax)}return{[mainAxis]:mainAxisCoord,[crossAxis]:crossAxisCoord}}}},"limitShift$2"),size$2=__name(function(options){return options===void 0&&(options={}),{name:"size",options,async fn(state2){var _state$middlewareData,_state$middlewareData2;const{placement,rects,platform:platform2,elements}=state2,{apply=__name(()=>{},"apply"),...detectOverflowOptions}=evaluate(options,state2),overflow=await detectOverflow(state2,detectOverflowOptions),side=getSide(placement),alignment=getAlignment(placement),isYAxis=getSideAxis(placement)==="y",{width,height}=rects.floating;let heightSide,widthSide;side==="top"||side==="bottom"?(heightSide=side,widthSide=alignment===(await(platform2.isRTL==null?void 0:platform2.isRTL(elements.floating))?"start":"end")?"left":"right"):(widthSide=side,heightSide=alignment==="end"?"top":"bottom");const maximumClippingHeight=height-overflow.top-overflow.bottom,maximumClippingWidth=width-overflow.left-overflow.right,overflowAvailableHeight=min$1(height-overflow[heightSide],maximumClippingHeight),overflowAvailableWidth=min$1(width-overflow[widthSide],maximumClippingWidth),noShift=!state2.middlewareData.shift;let availableHeight=overflowAvailableHeight,availableWidth=overflowAvailableWidth;if((_state$middlewareData=state2.middlewareData.shift)!=null&&_state$middlewareData.enabled.x&&(availableWidth=maximumClippingWidth),(_state$middlewareData2=state2.middlewareData.shift)!=null&&_state$middlewareData2.enabled.y&&(availableHeight=maximumClippingHeight),noShift&&!alignment){const xMin=max$1(overflow.left,0),xMax=max$1(overflow.right,0),yMin=max$1(overflow.top,0),yMax=max$1(overflow.bottom,0);isYAxis?availableWidth=width-2*(xMin!==0||xMax!==0?xMin+xMax:max$1(overflow.left,overflow.right)):availableHeight=height-2*(yMin!==0||yMax!==0?yMin+yMax:max$1(overflow.top,overflow.bottom))}await apply({...state2,availableWidth,availableHeight});const nextDimensions=await platform2.getDimensions(elements.floating);return width!==nextDimensions.width||height!==nextDimensions.height?{reset:{rects:!0}}:{}}}},"size$2");function hasWindow(){return typeof window<"u"}__name(hasWindow,"hasWindow");function getNodeName(node2){return isNode(node2)?(node2.nodeName||"").toLowerCase():"#document"}__name(getNodeName,"getNodeName");function getWindow(node2){var _node$ownerDocument;return(node2==null||(_node$ownerDocument=node2.ownerDocument)==null?void 0:_node$ownerDocument.defaultView)||window}__name(getWindow,"getWindow");function getDocumentElement(node2){var _ref;return(_ref=(isNode(node2)?node2.ownerDocument:node2.document)||window.document)==null?void 0:_ref.documentElement}__name(getDocumentElement,"getDocumentElement");function isNode(value){return hasWindow()?value instanceof Node||value instanceof getWindow(value).Node:!1}__name(isNode,"isNode");function isElement(value){return hasWindow()?value instanceof Element||value instanceof getWindow(value).Element:!1}__name(isElement,"isElement");function isHTMLElement$1(value){return hasWindow()?value instanceof HTMLElement||value instanceof getWindow(value).HTMLElement:!1}__name(isHTMLElement$1,"isHTMLElement$1");function isShadowRoot(value){return!hasWindow()||typeof ShadowRoot>"u"?!1:value instanceof ShadowRoot||value instanceof getWindow(value).ShadowRoot}__name(isShadowRoot,"isShadowRoot");const invalidOverflowDisplayValues=new Set(["inline","contents"]);function isOverflowElement(element2){const{overflow,overflowX,overflowY,display:display2}=getComputedStyle$1(element2);return/auto|scroll|overlay|hidden|clip/.test(overflow+overflowY+overflowX)&&!invalidOverflowDisplayValues.has(display2)}__name(isOverflowElement,"isOverflowElement");const tableElements$1=new Set(["table","td","th"]);function isTableElement(element2){return tableElements$1.has(getNodeName(element2))}__name(isTableElement,"isTableElement");const topLayerSelectors=[":popover-open",":modal"];function isTopLayer(element2){return topLayerSelectors.some(selector=>{try{return element2.matches(selector)}catch{return!1}})}__name(isTopLayer,"isTopLayer");const transformProperties=["transform","translate","scale","rotate","perspective"],willChangeValues=["transform","translate","scale","rotate","perspective","filter"],containValues=["paint","layout","strict","content"];function isContainingBlock(elementOrCss){const webkit=isWebKit(),css=isElement(elementOrCss)?getComputedStyle$1(elementOrCss):elementOrCss;return transformProperties.some(value=>css[value]?css[value]!=="none":!1)||(css.containerType?css.containerType!=="normal":!1)||!webkit&&(css.backdropFilter?css.backdropFilter!=="none":!1)||!webkit&&(css.filter?css.filter!=="none":!1)||willChangeValues.some(value=>(css.willChange||"").includes(value))||containValues.some(value=>(css.contain||"").includes(value))}__name(isContainingBlock,"isContainingBlock");function getContainingBlock(element2){let currentNode=getParentNode(element2);for(;isHTMLElement$1(currentNode)&&!isLastTraversableNode(currentNode);){if(isContainingBlock(currentNode))return currentNode;if(isTopLayer(currentNode))return null;currentNode=getParentNode(currentNode)}return null}__name(getContainingBlock,"getContainingBlock");function isWebKit(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}__name(isWebKit,"isWebKit");const lastTraversableNodeNames=new Set(["html","body","#document"]);function isLastTraversableNode(node2){return lastTraversableNodeNames.has(getNodeName(node2))}__name(isLastTraversableNode,"isLastTraversableNode");function getComputedStyle$1(element2){return getWindow(element2).getComputedStyle(element2)}__name(getComputedStyle$1,"getComputedStyle$1");function getNodeScroll(element2){return isElement(element2)?{scrollLeft:element2.scrollLeft,scrollTop:element2.scrollTop}:{scrollLeft:element2.scrollX,scrollTop:element2.scrollY}}__name(getNodeScroll,"getNodeScroll");function getParentNode(node2){if(getNodeName(node2)==="html")return node2;const result=node2.assignedSlot||node2.parentNode||isShadowRoot(node2)&&node2.host||getDocumentElement(node2);return isShadowRoot(result)?result.host:result}__name(getParentNode,"getParentNode");function getNearestOverflowAncestor(node2){const parentNode=getParentNode(node2);return isLastTraversableNode(parentNode)?node2.ownerDocument?node2.ownerDocument.body:node2.body:isHTMLElement$1(parentNode)&&isOverflowElement(parentNode)?parentNode:getNearestOverflowAncestor(parentNode)}__name(getNearestOverflowAncestor,"getNearestOverflowAncestor");function getOverflowAncestors(node2,list2,traverseIframes){var _node$ownerDocument2;list2===void 0&&(list2=[]),traverseIframes===void 0&&(traverseIframes=!0);const scrollableAncestor=getNearestOverflowAncestor(node2),isBody=scrollableAncestor===((_node$ownerDocument2=node2.ownerDocument)==null?void 0:_node$ownerDocument2.body),win=getWindow(scrollableAncestor);if(isBody){const frameElement=getFrameElement(win);return list2.concat(win,win.visualViewport||[],isOverflowElement(scrollableAncestor)?scrollableAncestor:[],frameElement&&traverseIframes?getOverflowAncestors(frameElement):[])}return list2.concat(scrollableAncestor,getOverflowAncestors(scrollableAncestor,[],traverseIframes))}__name(getOverflowAncestors,"getOverflowAncestors");function getFrameElement(win){return win.parent&&Object.getPrototypeOf(win.parent)?win.frameElement:null}__name(getFrameElement,"getFrameElement");function getCssDimensions(element2){const css=getComputedStyle$1(element2);let width=parseFloat(css.width)||0,height=parseFloat(css.height)||0;const hasOffset=isHTMLElement$1(element2),offsetWidth=hasOffset?element2.offsetWidth:width,offsetHeight=hasOffset?element2.offsetHeight:height,shouldFallback=round(width)!==offsetWidth||round(height)!==offsetHeight;return shouldFallback&&(width=offsetWidth,height=offsetHeight),{width,height,$:shouldFallback}}__name(getCssDimensions,"getCssDimensions");function unwrapElement(element2){return isElement(element2)?element2:element2.contextElement}__name(unwrapElement,"unwrapElement");function getScale(element2){const domElement=unwrapElement(element2);if(!isHTMLElement$1(domElement))return createCoords(1);const rect=domElement.getBoundingClientRect(),{width,height,$:$2}=getCssDimensions(domElement);let x=($2?round(rect.width):rect.width)/width,y=($2?round(rect.height):rect.height)/height;return(!x||!Number.isFinite(x))&&(x=1),(!y||!Number.isFinite(y))&&(y=1),{x,y}}__name(getScale,"getScale");const noOffsets=createCoords(0);function getVisualOffsets(element2){const win=getWindow(element2);return!isWebKit()||!win.visualViewport?noOffsets:{x:win.visualViewport.offsetLeft,y:win.visualViewport.offsetTop}}__name(getVisualOffsets,"getVisualOffsets");function shouldAddVisualOffsets(element2,isFixed,floatingOffsetParent){return isFixed===void 0&&(isFixed=!1),!floatingOffsetParent||isFixed&&floatingOffsetParent!==getWindow(element2)?!1:isFixed}__name(shouldAddVisualOffsets,"shouldAddVisualOffsets");function getBoundingClientRect(element2,includeScale,isFixedStrategy,offsetParent){includeScale===void 0&&(includeScale=!1),isFixedStrategy===void 0&&(isFixedStrategy=!1);const clientRect=element2.getBoundingClientRect(),domElement=unwrapElement(element2);let scale=createCoords(1);includeScale&&(offsetParent?isElement(offsetParent)&&(scale=getScale(offsetParent)):scale=getScale(element2));const visualOffsets=shouldAddVisualOffsets(domElement,isFixedStrategy,offsetParent)?getVisualOffsets(domElement):createCoords(0);let x=(clientRect.left+visualOffsets.x)/scale.x,y=(clientRect.top+visualOffsets.y)/scale.y,width=clientRect.width/scale.x,height=clientRect.height/scale.y;if(domElement){const win=getWindow(domElement),offsetWin=offsetParent&&isElement(offsetParent)?getWindow(offsetParent):offsetParent;let currentWin=win,currentIFrame=getFrameElement(currentWin);for(;currentIFrame&&offsetParent&&offsetWin!==currentWin;){const iframeScale=getScale(currentIFrame),iframeRect=currentIFrame.getBoundingClientRect(),css=getComputedStyle$1(currentIFrame),left=iframeRect.left+(currentIFrame.clientLeft+parseFloat(css.paddingLeft))*iframeScale.x,top=iframeRect.top+(currentIFrame.clientTop+parseFloat(css.paddingTop))*iframeScale.y;x*=iframeScale.x,y*=iframeScale.y,width*=iframeScale.x,height*=iframeScale.y,x+=left,y+=top,currentWin=getWindow(currentIFrame),currentIFrame=getFrameElement(currentWin)}}return rectToClientRect({width,height,x,y})}__name(getBoundingClientRect,"getBoundingClientRect");function getWindowScrollBarX(element2,rect){const leftScroll=getNodeScroll(element2).scrollLeft;return rect?rect.left+leftScroll:getBoundingClientRect(getDocumentElement(element2)).left+leftScroll}__name(getWindowScrollBarX,"getWindowScrollBarX");function getHTMLOffset(documentElement,scroll){const htmlRect=documentElement.getBoundingClientRect(),x=htmlRect.left+scroll.scrollLeft-getWindowScrollBarX(documentElement,htmlRect),y=htmlRect.top+scroll.scrollTop;return{x,y}}__name(getHTMLOffset,"getHTMLOffset");function convertOffsetParentRelativeRectToViewportRelativeRect(_ref){let{elements,rect,offsetParent,strategy}=_ref;const isFixed=strategy==="fixed",documentElement=getDocumentElement(offsetParent),topLayer=elements?isTopLayer(elements.floating):!1;if(offsetParent===documentElement||topLayer&&isFixed)return rect;let scroll={scrollLeft:0,scrollTop:0},scale=createCoords(1);const offsets=createCoords(0),isOffsetParentAnElement=isHTMLElement$1(offsetParent);if((isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed)&&((getNodeName(offsetParent)!=="body"||isOverflowElement(documentElement))&&(scroll=getNodeScroll(offsetParent)),isHTMLElement$1(offsetParent))){const offsetRect=getBoundingClientRect(offsetParent);scale=getScale(offsetParent),offsets.x=offsetRect.x+offsetParent.clientLeft,offsets.y=offsetRect.y+offsetParent.clientTop}const htmlOffset=documentElement&&!isOffsetParentAnElement&&!isFixed?getHTMLOffset(documentElement,scroll):createCoords(0);return{width:rect.width*scale.x,height:rect.height*scale.y,x:rect.x*scale.x-scroll.scrollLeft*scale.x+offsets.x+htmlOffset.x,y:rect.y*scale.y-scroll.scrollTop*scale.y+offsets.y+htmlOffset.y}}__name(convertOffsetParentRelativeRectToViewportRelativeRect,"convertOffsetParentRelativeRectToViewportRelativeRect");function getClientRects(element2){return Array.from(element2.getClientRects())}__name(getClientRects,"getClientRects");function getDocumentRect(element2){const html2=getDocumentElement(element2),scroll=getNodeScroll(element2),body=element2.ownerDocument.body,width=max$1(html2.scrollWidth,html2.clientWidth,body.scrollWidth,body.clientWidth),height=max$1(html2.scrollHeight,html2.clientHeight,body.scrollHeight,body.clientHeight);let x=-scroll.scrollLeft+getWindowScrollBarX(element2);const y=-scroll.scrollTop;return getComputedStyle$1(body).direction==="rtl"&&(x+=max$1(html2.clientWidth,body.clientWidth)-width),{width,height,x,y}}__name(getDocumentRect,"getDocumentRect");const SCROLLBAR_MAX=25;function getViewportRect(element2,strategy){const win=getWindow(element2),html2=getDocumentElement(element2),visualViewport=win.visualViewport;let width=html2.clientWidth,height=html2.clientHeight,x=0,y=0;if(visualViewport){width=visualViewport.width,height=visualViewport.height;const visualViewportBased=isWebKit();(!visualViewportBased||visualViewportBased&&strategy==="fixed")&&(x=visualViewport.offsetLeft,y=visualViewport.offsetTop)}const windowScrollbarX=getWindowScrollBarX(html2);if(windowScrollbarX<=0){const doc=html2.ownerDocument,body=doc.body,bodyStyles=getComputedStyle(body),bodyMarginInline=doc.compatMode==="CSS1Compat"&&parseFloat(bodyStyles.marginLeft)+parseFloat(bodyStyles.marginRight)||0,clippingStableScrollbarWidth=Math.abs(html2.clientWidth-body.clientWidth-bodyMarginInline);clippingStableScrollbarWidth<=SCROLLBAR_MAX&&(width-=clippingStableScrollbarWidth)}else windowScrollbarX<=SCROLLBAR_MAX&&(width+=windowScrollbarX);return{width,height,x,y}}__name(getViewportRect,"getViewportRect");const absoluteOrFixed=new Set(["absolute","fixed"]);function getInnerBoundingClientRect(element2,strategy){const clientRect=getBoundingClientRect(element2,!0,strategy==="fixed"),top=clientRect.top+element2.clientTop,left=clientRect.left+element2.clientLeft,scale=isHTMLElement$1(element2)?getScale(element2):createCoords(1),width=element2.clientWidth*scale.x,height=element2.clientHeight*scale.y,x=left*scale.x,y=top*scale.y;return{width,height,x,y}}__name(getInnerBoundingClientRect,"getInnerBoundingClientRect");function getClientRectFromClippingAncestor(element2,clippingAncestor,strategy){let rect;if(clippingAncestor==="viewport")rect=getViewportRect(element2,strategy);else if(clippingAncestor==="document")rect=getDocumentRect(getDocumentElement(element2));else if(isElement(clippingAncestor))rect=getInnerBoundingClientRect(clippingAncestor,strategy);else{const visualOffsets=getVisualOffsets(element2);rect={x:clippingAncestor.x-visualOffsets.x,y:clippingAncestor.y-visualOffsets.y,width:clippingAncestor.width,height:clippingAncestor.height}}return rectToClientRect(rect)}__name(getClientRectFromClippingAncestor,"getClientRectFromClippingAncestor");function hasFixedPositionAncestor(element2,stopNode){const parentNode=getParentNode(element2);return parentNode===stopNode||!isElement(parentNode)||isLastTraversableNode(parentNode)?!1:getComputedStyle$1(parentNode).position==="fixed"||hasFixedPositionAncestor(parentNode,stopNode)}__name(hasFixedPositionAncestor,"hasFixedPositionAncestor");function getClippingElementAncestors(element2,cache2){const cachedResult=cache2.get(element2);if(cachedResult)return cachedResult;let result=getOverflowAncestors(element2,[],!1).filter(el=>isElement(el)&&getNodeName(el)!=="body"),currentContainingBlockComputedStyle=null;const elementIsFixed=getComputedStyle$1(element2).position==="fixed";let currentNode=elementIsFixed?getParentNode(element2):element2;for(;isElement(currentNode)&&!isLastTraversableNode(currentNode);){const computedStyle=getComputedStyle$1(currentNode),currentNodeIsContaining=isContainingBlock(currentNode);!currentNodeIsContaining&&computedStyle.position==="fixed"&&(currentContainingBlockComputedStyle=null),(elementIsFixed?!currentNodeIsContaining&&!currentContainingBlockComputedStyle:!currentNodeIsContaining&&computedStyle.position==="static"&&!!currentContainingBlockComputedStyle&&absoluteOrFixed.has(currentContainingBlockComputedStyle.position)||isOverflowElement(currentNode)&&!currentNodeIsContaining&&hasFixedPositionAncestor(element2,currentNode))?result=result.filter(ancestor=>ancestor!==currentNode):currentContainingBlockComputedStyle=computedStyle,currentNode=getParentNode(currentNode)}return cache2.set(element2,result),result}__name(getClippingElementAncestors,"getClippingElementAncestors");function getClippingRect(_ref){let{element:element2,boundary,rootBoundary,strategy}=_ref;const clippingAncestors=[...boundary==="clippingAncestors"?isTopLayer(element2)?[]:getClippingElementAncestors(element2,this._c):[].concat(boundary),rootBoundary],firstClippingAncestor=clippingAncestors[0],clippingRect=clippingAncestors.reduce((accRect,clippingAncestor)=>{const rect=getClientRectFromClippingAncestor(element2,clippingAncestor,strategy);return accRect.top=max$1(rect.top,accRect.top),accRect.right=min$1(rect.right,accRect.right),accRect.bottom=min$1(rect.bottom,accRect.bottom),accRect.left=max$1(rect.left,accRect.left),accRect},getClientRectFromClippingAncestor(element2,firstClippingAncestor,strategy));return{width:clippingRect.right-clippingRect.left,height:clippingRect.bottom-clippingRect.top,x:clippingRect.left,y:clippingRect.top}}__name(getClippingRect,"getClippingRect");function getDimensions(element2){const{width,height}=getCssDimensions(element2);return{width,height}}__name(getDimensions,"getDimensions");function getRectRelativeToOffsetParent(element2,offsetParent,strategy){const isOffsetParentAnElement=isHTMLElement$1(offsetParent),documentElement=getDocumentElement(offsetParent),isFixed=strategy==="fixed",rect=getBoundingClientRect(element2,!0,isFixed,offsetParent);let scroll={scrollLeft:0,scrollTop:0};const offsets=createCoords(0);function setLeftRTLScrollbarOffset(){offsets.x=getWindowScrollBarX(documentElement)}if(__name(setLeftRTLScrollbarOffset,"setLeftRTLScrollbarOffset"),isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed)if((getNodeName(offsetParent)!=="body"||isOverflowElement(documentElement))&&(scroll=getNodeScroll(offsetParent)),isOffsetParentAnElement){const offsetRect=getBoundingClientRect(offsetParent,!0,isFixed,offsetParent);offsets.x=offsetRect.x+offsetParent.clientLeft,offsets.y=offsetRect.y+offsetParent.clientTop}else documentElement&&setLeftRTLScrollbarOffset();isFixed&&!isOffsetParentAnElement&&documentElement&&setLeftRTLScrollbarOffset();const htmlOffset=documentElement&&!isOffsetParentAnElement&&!isFixed?getHTMLOffset(documentElement,scroll):createCoords(0),x=rect.left+scroll.scrollLeft-offsets.x-htmlOffset.x,y=rect.top+scroll.scrollTop-offsets.y-htmlOffset.y;return{x,y,width:rect.width,height:rect.height}}__name(getRectRelativeToOffsetParent,"getRectRelativeToOffsetParent");function isStaticPositioned(element2){return getComputedStyle$1(element2).position==="static"}__name(isStaticPositioned,"isStaticPositioned");function getTrueOffsetParent(element2,polyfill2){if(!isHTMLElement$1(element2)||getComputedStyle$1(element2).position==="fixed")return null;if(polyfill2)return polyfill2(element2);let rawOffsetParent=element2.offsetParent;return getDocumentElement(element2)===rawOffsetParent&&(rawOffsetParent=rawOffsetParent.ownerDocument.body),rawOffsetParent}__name(getTrueOffsetParent,"getTrueOffsetParent");function getOffsetParent(element2,polyfill2){const win=getWindow(element2);if(isTopLayer(element2))return win;if(!isHTMLElement$1(element2)){let svgOffsetParent=getParentNode(element2);for(;svgOffsetParent&&!isLastTraversableNode(svgOffsetParent);){if(isElement(svgOffsetParent)&&!isStaticPositioned(svgOffsetParent))return svgOffsetParent;svgOffsetParent=getParentNode(svgOffsetParent)}return win}let offsetParent=getTrueOffsetParent(element2,polyfill2);for(;offsetParent&&isTableElement(offsetParent)&&isStaticPositioned(offsetParent);)offsetParent=getTrueOffsetParent(offsetParent,polyfill2);return offsetParent&&isLastTraversableNode(offsetParent)&&isStaticPositioned(offsetParent)&&!isContainingBlock(offsetParent)?win:offsetParent||getContainingBlock(element2)||win}__name(getOffsetParent,"getOffsetParent");const getElementRects=__name(async function(data){const getOffsetParentFn=this.getOffsetParent||getOffsetParent,getDimensionsFn=this.getDimensions,floatingDimensions=await getDimensionsFn(data.floating);return{reference:getRectRelativeToOffsetParent(data.reference,await getOffsetParentFn(data.floating),data.strategy),floating:{x:0,y:0,width:floatingDimensions.width,height:floatingDimensions.height}}},"getElementRects");function isRTL(element2){return getComputedStyle$1(element2).direction==="rtl"}__name(isRTL,"isRTL");const platform={convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement,getClippingRect,getOffsetParent,getElementRects,getClientRects,getDimensions,getScale,isElement,isRTL};function rectsAreEqual(a2,b){return a2.x===b.x&&a2.y===b.y&&a2.width===b.width&&a2.height===b.height}__name(rectsAreEqual,"rectsAreEqual");function observeMove(element2,onMove){let io=null,timeoutId;const root2=getDocumentElement(element2);function cleanup(){var _io;clearTimeout(timeoutId),(_io=io)==null||_io.disconnect(),io=null}__name(cleanup,"cleanup");function refresh(skip,threshold){skip===void 0&&(skip=!1),threshold===void 0&&(threshold=1),cleanup();const elementRectForRootMargin=element2.getBoundingClientRect(),{left,top,width,height}=elementRectForRootMargin;if(skip||onMove(),!width||!height)return;const insetTop=floor(top),insetRight=floor(root2.clientWidth-(left+width)),insetBottom=floor(root2.clientHeight-(top+height)),insetLeft=floor(left),options={rootMargin:-insetTop+"px "+-insetRight+"px "+-insetBottom+"px "+-insetLeft+"px",threshold:max$1(0,min$1(1,threshold))||1};let isFirstUpdate=!0;function handleObserve(entries){const ratio=entries[0].intersectionRatio;if(ratio!==threshold){if(!isFirstUpdate)return refresh();ratio?refresh(!1,ratio):timeoutId=setTimeout(()=>{refresh(!1,1e-7)},1e3)}ratio===1&&!rectsAreEqual(elementRectForRootMargin,element2.getBoundingClientRect())&&refresh(),isFirstUpdate=!1}__name(handleObserve,"handleObserve");try{io=new IntersectionObserver(handleObserve,{...options,root:root2.ownerDocument})}catch{io=new IntersectionObserver(handleObserve,options)}io.observe(element2)}return __name(refresh,"refresh"),refresh(!0),cleanup}__name(observeMove,"observeMove");function autoUpdate(reference,floating,update,options){options===void 0&&(options={});const{ancestorScroll=!0,ancestorResize=!0,elementResize=typeof ResizeObserver=="function",layoutShift=typeof IntersectionObserver=="function",animationFrame=!1}=options,referenceEl=unwrapElement(reference),ancestors=ancestorScroll||ancestorResize?[...referenceEl?getOverflowAncestors(referenceEl):[],...getOverflowAncestors(floating)]:[];ancestors.forEach(ancestor=>{ancestorScroll&&ancestor.addEventListener("scroll",update,{passive:!0}),ancestorResize&&ancestor.addEventListener("resize",update)});const cleanupIo=referenceEl&&layoutShift?observeMove(referenceEl,update):null;let reobserveFrame=-1,resizeObserver=null;elementResize&&(resizeObserver=new ResizeObserver(_ref=>{let[firstEntry]=_ref;firstEntry&&firstEntry.target===referenceEl&&resizeObserver&&(resizeObserver.unobserve(floating),cancelAnimationFrame(reobserveFrame),reobserveFrame=requestAnimationFrame(()=>{var _resizeObserver;(_resizeObserver=resizeObserver)==null||_resizeObserver.observe(floating)})),update()}),referenceEl&&!animationFrame&&resizeObserver.observe(referenceEl),resizeObserver.observe(floating));let frameId,prevRefRect=animationFrame?getBoundingClientRect(reference):null;animationFrame&&frameLoop();function frameLoop(){const nextRefRect=getBoundingClientRect(reference);prevRefRect&&!rectsAreEqual(prevRefRect,nextRefRect)&&update(),prevRefRect=nextRefRect,frameId=requestAnimationFrame(frameLoop)}return __name(frameLoop,"frameLoop"),update(),()=>{var _resizeObserver2;ancestors.forEach(ancestor=>{ancestorScroll&&ancestor.removeEventListener("scroll",update),ancestorResize&&ancestor.removeEventListener("resize",update)}),cleanupIo?.(),(_resizeObserver2=resizeObserver)==null||_resizeObserver2.disconnect(),resizeObserver=null,animationFrame&&cancelAnimationFrame(frameId)}}__name(autoUpdate,"autoUpdate");const offset$1=offset$2,shift$1=shift$2,flip$1=flip$2,size$1=size$2,hide$1=hide$2,arrow$2=arrow$3,limitShift$1=limitShift$2,computePosition=__name((reference,floating,options)=>{const cache2=new Map,mergedOptions={platform,...options},platformWithCache={...mergedOptions.platform,_c:cache2};return computePosition$1(reference,floating,{...mergedOptions,platform:platformWithCache})},"computePosition");var isClient=typeof document<"u",noop$1=__name(function(){},"noop"),index$4=isClient?reactExports.useLayoutEffect:noop$1;function deepEqual$1(a2,b){if(a2===b)return!0;if(typeof a2!=typeof b)return!1;if(typeof a2=="function"&&a2.toString()===b.toString())return!0;let length,i2,keys2;if(a2&&b&&typeof a2=="object"){if(Array.isArray(a2)){if(length=a2.length,length!==b.length)return!1;for(i2=length;i2--!==0;)if(!deepEqual$1(a2[i2],b[i2]))return!1;return!0}if(keys2=Object.keys(a2),length=keys2.length,length!==Object.keys(b).length)return!1;for(i2=length;i2--!==0;)if(!{}.hasOwnProperty.call(b,keys2[i2]))return!1;for(i2=length;i2--!==0;){const key=keys2[i2];if(!(key==="_owner"&&a2.$$typeof)&&!deepEqual$1(a2[key],b[key]))return!1}return!0}return a2!==a2&&b!==b}__name(deepEqual$1,"deepEqual$1");function getDPR(element2){return typeof window>"u"?1:(element2.ownerDocument.defaultView||window).devicePixelRatio||1}__name(getDPR,"getDPR");function roundByDPR(element2,value){const dpr=getDPR(element2);return Math.round(value*dpr)/dpr}__name(roundByDPR,"roundByDPR");function useLatestRef(value){const ref=reactExports.useRef(value);return index$4(()=>{ref.current=value}),ref}__name(useLatestRef,"useLatestRef");function useFloating(options){options===void 0&&(options={});const{placement="bottom",strategy="absolute",middleware=[],platform:platform2,elements:{reference:externalReference,floating:externalFloating}={},transform:transform2=!0,whileElementsMounted,open}=options,[data,setData]=reactExports.useState({x:0,y:0,strategy,placement,middlewareData:{},isPositioned:!1}),[latestMiddleware,setLatestMiddleware]=reactExports.useState(middleware);deepEqual$1(latestMiddleware,middleware)||setLatestMiddleware(middleware);const[_reference,_setReference]=reactExports.useState(null),[_floating,_setFloating]=reactExports.useState(null),setReference=reactExports.useCallback(node2=>{node2!==referenceRef.current&&(referenceRef.current=node2,_setReference(node2))},[]),setFloating=reactExports.useCallback(node2=>{node2!==floatingRef.current&&(floatingRef.current=node2,_setFloating(node2))},[]),referenceEl=externalReference||_reference,floatingEl=externalFloating||_floating,referenceRef=reactExports.useRef(null),floatingRef=reactExports.useRef(null),dataRef=reactExports.useRef(data),hasWhileElementsMounted=whileElementsMounted!=null,whileElementsMountedRef=useLatestRef(whileElementsMounted),platformRef=useLatestRef(platform2),openRef=useLatestRef(open),update=reactExports.useCallback(()=>{if(!referenceRef.current||!floatingRef.current)return;const config2={placement,strategy,middleware:latestMiddleware};platformRef.current&&(config2.platform=platformRef.current),computePosition(referenceRef.current,floatingRef.current,config2).then(data2=>{const fullData={...data2,isPositioned:openRef.current!==!1};isMountedRef.current&&!deepEqual$1(dataRef.current,fullData)&&(dataRef.current=fullData,reactDomExports.flushSync(()=>{setData(fullData)}))})},[latestMiddleware,placement,strategy,platformRef,openRef]);index$4(()=>{open===!1&&dataRef.current.isPositioned&&(dataRef.current.isPositioned=!1,setData(data2=>({...data2,isPositioned:!1})))},[open]);const isMountedRef=reactExports.useRef(!1);index$4(()=>(isMountedRef.current=!0,()=>{isMountedRef.current=!1}),[]),index$4(()=>{if(referenceEl&&(referenceRef.current=referenceEl),floatingEl&&(floatingRef.current=floatingEl),referenceEl&&floatingEl){if(whileElementsMountedRef.current)return whileElementsMountedRef.current(referenceEl,floatingEl,update);update()}},[referenceEl,floatingEl,update,whileElementsMountedRef,hasWhileElementsMounted]);const refs=reactExports.useMemo(()=>({reference:referenceRef,floating:floatingRef,setReference,setFloating}),[setReference,setFloating]),elements=reactExports.useMemo(()=>({reference:referenceEl,floating:floatingEl}),[referenceEl,floatingEl]),floatingStyles=reactExports.useMemo(()=>{const initialStyles={position:strategy,left:0,top:0};if(!elements.floating)return initialStyles;const x=roundByDPR(elements.floating,data.x),y=roundByDPR(elements.floating,data.y);return transform2?{...initialStyles,transform:"translate("+x+"px, "+y+"px)",...getDPR(elements.floating)>=1.5&&{willChange:"transform"}}:{position:strategy,left:x,top:y}},[strategy,transform2,elements.floating,data.x,data.y]);return reactExports.useMemo(()=>({...data,update,refs,elements,floatingStyles}),[data,update,refs,elements,floatingStyles])}__name(useFloating,"useFloating");const arrow$1=__name(options=>{function isRef(value){return{}.hasOwnProperty.call(value,"current")}return __name(isRef,"isRef"),{name:"arrow",options,fn(state2){const{element:element2,padding}=typeof options=="function"?options(state2):options;return element2&&isRef(element2)?element2.current!=null?arrow$2({element:element2.current,padding}).fn(state2):{}:element2?arrow$2({element:element2,padding}).fn(state2):{}}}},"arrow$1"),offset=__name((options,deps)=>({...offset$1(options),options:[options,deps]}),"offset"),shift=__name((options,deps)=>({...shift$1(options),options:[options,deps]}),"shift"),limitShift=__name((options,deps)=>({...limitShift$1(options),options:[options,deps]}),"limitShift"),flip=__name((options,deps)=>({...flip$1(options),options:[options,deps]}),"flip"),size=__name((options,deps)=>({...size$1(options),options:[options,deps]}),"size"),hide=__name((options,deps)=>({...hide$1(options),options:[options,deps]}),"hide"),arrow=__name((options,deps)=>({...arrow$1(options),options:[options,deps]}),"arrow");var NAME$3="Arrow",Arrow$1=reactExports.forwardRef((props,forwardedRef)=>{const{children,width=10,height=5,...arrowProps}=props;return jsxRuntimeExports.jsx(Primitive$1.svg,{...arrowProps,ref:forwardedRef,width,height,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:props.asChild?children:jsxRuntimeExports.jsx("polygon",{points:"0,0 30,0 15,10"})})});Arrow$1.displayName=NAME$3;var Root$7=Arrow$1;function useSize(element2){const[size2,setSize]=reactExports.useState(void 0);return useLayoutEffect2(()=>{if(element2){setSize({width:element2.offsetWidth,height:element2.offsetHeight});const resizeObserver=new ResizeObserver(entries=>{if(!Array.isArray(entries)||!entries.length)return;const entry=entries[0];let width,height;if("borderBoxSize"in entry){const borderSizeEntry=entry.borderBoxSize,borderSize=Array.isArray(borderSizeEntry)?borderSizeEntry[0]:borderSizeEntry;width=borderSize.inlineSize,height=borderSize.blockSize}else width=element2.offsetWidth,height=element2.offsetHeight;setSize({width,height})});return resizeObserver.observe(element2,{box:"border-box"}),()=>resizeObserver.unobserve(element2)}else setSize(void 0)},[element2]),size2}__name(useSize,"useSize");var POPPER_NAME="Popper",[createPopperContext,createPopperScope]=createContextScope(POPPER_NAME),[PopperProvider,usePopperContext]=createPopperContext(POPPER_NAME),Popper=__name(props=>{const{__scopePopper,children}=props,[anchor,setAnchor]=reactExports.useState(null);return jsxRuntimeExports.jsx(PopperProvider,{scope:__scopePopper,anchor,onAnchorChange:setAnchor,children})},"Popper");Popper.displayName=POPPER_NAME;var ANCHOR_NAME$1="PopperAnchor",PopperAnchor=reactExports.forwardRef((props,forwardedRef)=>{const{__scopePopper,virtualRef,...anchorProps}=props,context=usePopperContext(ANCHOR_NAME$1,__scopePopper),ref=reactExports.useRef(null),composedRefs=useComposedRefs(forwardedRef,ref),anchorRef=reactExports.useRef(null);return reactExports.useEffect(()=>{const previousAnchor=anchorRef.current;anchorRef.current=virtualRef?.current||ref.current,previousAnchor!==anchorRef.current&&context.onAnchorChange(anchorRef.current)}),virtualRef?null:jsxRuntimeExports.jsx(Primitive$1.div,{...anchorProps,ref:composedRefs})});PopperAnchor.displayName=ANCHOR_NAME$1;var CONTENT_NAME$6="PopperContent",[PopperContentProvider,useContentContext]=createPopperContext(CONTENT_NAME$6),PopperContent=reactExports.forwardRef((props,forwardedRef)=>{const{__scopePopper,side="bottom",sideOffset=0,align="center",alignOffset=0,arrowPadding=0,avoidCollisions=!0,collisionBoundary=[],collisionPadding:collisionPaddingProp=0,sticky="partial",hideWhenDetached=!1,updatePositionStrategy="optimized",onPlaced,...contentProps}=props,context=usePopperContext(CONTENT_NAME$6,__scopePopper),[content2,setContent]=reactExports.useState(null),composedRefs=useComposedRefs(forwardedRef,node2=>setContent(node2)),[arrow$12,setArrow]=reactExports.useState(null),arrowSize=useSize(arrow$12),arrowWidth=arrowSize?.width??0,arrowHeight=arrowSize?.height??0,desiredPlacement=side+(align!=="center"?"-"+align:""),collisionPadding=typeof collisionPaddingProp=="number"?collisionPaddingProp:{top:0,right:0,bottom:0,left:0,...collisionPaddingProp},boundary=Array.isArray(collisionBoundary)?collisionBoundary:[collisionBoundary],hasExplicitBoundaries=boundary.length>0,detectOverflowOptions={padding:collisionPadding,boundary:boundary.filter(isNotNull),altBoundary:hasExplicitBoundaries},{refs,floatingStyles,placement,isPositioned,middlewareData}=useFloating({strategy:"fixed",placement:desiredPlacement,whileElementsMounted:__name((...args)=>autoUpdate(...args,{animationFrame:updatePositionStrategy==="always"}),"whileElementsMounted"),elements:{reference:context.anchor},middleware:[offset({mainAxis:sideOffset+arrowHeight,alignmentAxis:alignOffset}),avoidCollisions&&shift({mainAxis:!0,crossAxis:!1,limiter:sticky==="partial"?limitShift():void 0,...detectOverflowOptions}),avoidCollisions&&flip({...detectOverflowOptions}),size({...detectOverflowOptions,apply:__name(({elements,rects,availableWidth,availableHeight})=>{const{width:anchorWidth,height:anchorHeight}=rects.reference,contentStyle=elements.floating.style;contentStyle.setProperty("--radix-popper-available-width",`${availableWidth}px`),contentStyle.setProperty("--radix-popper-available-height",`${availableHeight}px`),contentStyle.setProperty("--radix-popper-anchor-width",`${anchorWidth}px`),contentStyle.setProperty("--radix-popper-anchor-height",`${anchorHeight}px`)},"apply")}),arrow$12&&arrow({element:arrow$12,padding:arrowPadding}),transformOrigin({arrowWidth,arrowHeight}),hideWhenDetached&&hide({strategy:"referenceHidden",...detectOverflowOptions})]}),[placedSide,placedAlign]=getSideAndAlignFromPlacement(placement),handlePlaced=useCallbackRef$1(onPlaced);useLayoutEffect2(()=>{isPositioned&&handlePlaced?.()},[isPositioned,handlePlaced]);const arrowX=middlewareData.arrow?.x,arrowY=middlewareData.arrow?.y,cannotCenterArrow=middlewareData.arrow?.centerOffset!==0,[contentZIndex,setContentZIndex]=reactExports.useState();return useLayoutEffect2(()=>{content2&&setContentZIndex(window.getComputedStyle(content2).zIndex)},[content2]),jsxRuntimeExports.jsx("div",{ref:refs.setFloating,"data-radix-popper-content-wrapper":"",style:{...floatingStyles,transform:isPositioned?floatingStyles.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:contentZIndex,"--radix-popper-transform-origin":[middlewareData.transformOrigin?.x,middlewareData.transformOrigin?.y].join(" "),...middlewareData.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:props.dir,children:jsxRuntimeExports.jsx(PopperContentProvider,{scope:__scopePopper,placedSide,onArrowChange:setArrow,arrowX,arrowY,shouldHideArrow:cannotCenterArrow,children:jsxRuntimeExports.jsx(Primitive$1.div,{"data-side":placedSide,"data-align":placedAlign,...contentProps,ref:composedRefs,style:{...contentProps.style,animation:isPositioned?void 0:"none"}})})})});PopperContent.displayName=CONTENT_NAME$6;var ARROW_NAME$4="PopperArrow",OPPOSITE_SIDE={top:"bottom",right:"left",bottom:"top",left:"right"},PopperArrow=reactExports.forwardRef(__name(function(props,forwardedRef){const{__scopePopper,...arrowProps}=props,contentContext=useContentContext(ARROW_NAME$4,__scopePopper),baseSide=OPPOSITE_SIDE[contentContext.placedSide];return jsxRuntimeExports.jsx("span",{ref:contentContext.onArrowChange,style:{position:"absolute",left:contentContext.arrowX,top:contentContext.arrowY,[baseSide]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[contentContext.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[contentContext.placedSide],visibility:contentContext.shouldHideArrow?"hidden":void 0},children:jsxRuntimeExports.jsx(Root$7,{...arrowProps,ref:forwardedRef,style:{...arrowProps.style,display:"block"}})})},"PopperArrow2"));PopperArrow.displayName=ARROW_NAME$4;function isNotNull(value){return value!==null}__name(isNotNull,"isNotNull");var transformOrigin=__name(options=>({name:"transformOrigin",options,fn(data){const{placement,rects,middlewareData}=data,isArrowHidden=middlewareData.arrow?.centerOffset!==0,arrowWidth=isArrowHidden?0:options.arrowWidth,arrowHeight=isArrowHidden?0:options.arrowHeight,[placedSide,placedAlign]=getSideAndAlignFromPlacement(placement),noArrowAlign={start:"0%",center:"50%",end:"100%"}[placedAlign],arrowXCenter=(middlewareData.arrow?.x??0)+arrowWidth/2,arrowYCenter=(middlewareData.arrow?.y??0)+arrowHeight/2;let x="",y="";return placedSide==="bottom"?(x=isArrowHidden?noArrowAlign:`${arrowXCenter}px`,y=`${-arrowHeight}px`):placedSide==="top"?(x=isArrowHidden?noArrowAlign:`${arrowXCenter}px`,y=`${rects.floating.height+arrowHeight}px`):placedSide==="right"?(x=`${-arrowHeight}px`,y=isArrowHidden?noArrowAlign:`${arrowYCenter}px`):placedSide==="left"&&(x=`${rects.floating.width+arrowHeight}px`,y=isArrowHidden?noArrowAlign:`${arrowYCenter}px`),{data:{x,y}}}}),"transformOrigin");function getSideAndAlignFromPlacement(placement){const[side,align="center"]=placement.split("-");return[side,align]}__name(getSideAndAlignFromPlacement,"getSideAndAlignFromPlacement");var Root2$4=Popper,Anchor=PopperAnchor,Content$2=PopperContent,Arrow=PopperArrow,PORTAL_NAME$5="Portal",Portal$4=reactExports.forwardRef((props,forwardedRef)=>{const{container:containerProp,...portalProps}=props,[mounted,setMounted]=reactExports.useState(!1);useLayoutEffect2(()=>setMounted(!0),[]);const container=containerProp||mounted&&globalThis?.document?.body;return container?ye.createPortal(jsxRuntimeExports.jsx(Primitive$1.div,{...portalProps,ref:forwardedRef}),container):null});Portal$4.displayName=PORTAL_NAME$5;var[createTooltipContext]=createContextScope("Tooltip",[createPopperScope]),usePopperScope$2=createPopperScope(),PROVIDER_NAME="TooltipProvider",DEFAULT_DELAY_DURATION=700,TOOLTIP_OPEN="tooltip.open",[TooltipProviderContextProvider,useTooltipProviderContext]=createTooltipContext(PROVIDER_NAME),TooltipProvider$1=__name(props=>{const{__scopeTooltip,delayDuration=DEFAULT_DELAY_DURATION,skipDelayDuration=300,disableHoverableContent=!1,children}=props,isOpenDelayedRef=reactExports.useRef(!0),isPointerInTransitRef=reactExports.useRef(!1),skipDelayTimerRef=reactExports.useRef(0);return reactExports.useEffect(()=>{const skipDelayTimer=skipDelayTimerRef.current;return()=>window.clearTimeout(skipDelayTimer)},[]),jsxRuntimeExports.jsx(TooltipProviderContextProvider,{scope:__scopeTooltip,isOpenDelayedRef,delayDuration,onOpen:reactExports.useCallback(()=>{window.clearTimeout(skipDelayTimerRef.current),isOpenDelayedRef.current=!1},[]),onClose:reactExports.useCallback(()=>{window.clearTimeout(skipDelayTimerRef.current),skipDelayTimerRef.current=window.setTimeout(()=>isOpenDelayedRef.current=!0,skipDelayDuration)},[skipDelayDuration]),isPointerInTransitRef,onPointerInTransitChange:reactExports.useCallback(inTransit=>{isPointerInTransitRef.current=inTransit},[]),disableHoverableContent,children})},"TooltipProvider$1");TooltipProvider$1.displayName=PROVIDER_NAME;var TOOLTIP_NAME="Tooltip",[TooltipContextProvider,useTooltipContext]=createTooltipContext(TOOLTIP_NAME),Tooltip$1=__name(props=>{const{__scopeTooltip,children,open:openProp,defaultOpen,onOpenChange,disableHoverableContent:disableHoverableContentProp,delayDuration:delayDurationProp}=props,providerContext=useTooltipProviderContext(TOOLTIP_NAME,props.__scopeTooltip),popperScope=usePopperScope$2(__scopeTooltip),[trigger,setTrigger]=reactExports.useState(null),contentId=useId(),openTimerRef=reactExports.useRef(0),disableHoverableContent=disableHoverableContentProp??providerContext.disableHoverableContent,delayDuration=delayDurationProp??providerContext.delayDuration,wasOpenDelayedRef=reactExports.useRef(!1),[open,setOpen]=useControllableState({prop:openProp,defaultProp:defaultOpen??!1,onChange:__name(open2=>{open2?(providerContext.onOpen(),document.dispatchEvent(new CustomEvent(TOOLTIP_OPEN))):providerContext.onClose(),onOpenChange?.(open2)},"onChange"),caller:TOOLTIP_NAME}),stateAttribute=reactExports.useMemo(()=>open?wasOpenDelayedRef.current?"delayed-open":"instant-open":"closed",[open]),handleOpen=reactExports.useCallback(()=>{window.clearTimeout(openTimerRef.current),openTimerRef.current=0,wasOpenDelayedRef.current=!1,setOpen(!0)},[setOpen]),handleClose=reactExports.useCallback(()=>{window.clearTimeout(openTimerRef.current),openTimerRef.current=0,setOpen(!1)},[setOpen]),handleDelayedOpen=reactExports.useCallback(()=>{window.clearTimeout(openTimerRef.current),openTimerRef.current=window.setTimeout(()=>{wasOpenDelayedRef.current=!0,setOpen(!0),openTimerRef.current=0},delayDuration)},[delayDuration,setOpen]);return reactExports.useEffect(()=>()=>{openTimerRef.current&&(window.clearTimeout(openTimerRef.current),openTimerRef.current=0)},[]),jsxRuntimeExports.jsx(Root2$4,{...popperScope,children:jsxRuntimeExports.jsx(TooltipContextProvider,{scope:__scopeTooltip,contentId,open,stateAttribute,trigger,onTriggerChange:setTrigger,onTriggerEnter:reactExports.useCallback(()=>{providerContext.isOpenDelayedRef.current?handleDelayedOpen():handleOpen()},[providerContext.isOpenDelayedRef,handleDelayedOpen,handleOpen]),onTriggerLeave:reactExports.useCallback(()=>{disableHoverableContent?handleClose():(window.clearTimeout(openTimerRef.current),openTimerRef.current=0)},[handleClose,disableHoverableContent]),onOpen:handleOpen,onClose:handleClose,disableHoverableContent,children})})},"Tooltip$1");Tooltip$1.displayName=TOOLTIP_NAME;var TRIGGER_NAME$4="TooltipTrigger",TooltipTrigger$1=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeTooltip,...triggerProps}=props,context=useTooltipContext(TRIGGER_NAME$4,__scopeTooltip),providerContext=useTooltipProviderContext(TRIGGER_NAME$4,__scopeTooltip),popperScope=usePopperScope$2(__scopeTooltip),ref=reactExports.useRef(null),composedRefs=useComposedRefs(forwardedRef,ref,context.onTriggerChange),isPointerDownRef=reactExports.useRef(!1),hasPointerMoveOpenedRef=reactExports.useRef(!1),handlePointerUp=reactExports.useCallback(()=>isPointerDownRef.current=!1,[]);return reactExports.useEffect(()=>()=>document.removeEventListener("pointerup",handlePointerUp),[handlePointerUp]),jsxRuntimeExports.jsx(Anchor,{asChild:!0,...popperScope,children:jsxRuntimeExports.jsx(Primitive$1.button,{"aria-describedby":context.open?context.contentId:void 0,"data-state":context.stateAttribute,...triggerProps,ref:composedRefs,onPointerMove:composeEventHandlers$1(props.onPointerMove,event=>{event.pointerType!=="touch"&&!hasPointerMoveOpenedRef.current&&!providerContext.isPointerInTransitRef.current&&(context.onTriggerEnter(),hasPointerMoveOpenedRef.current=!0)}),onPointerLeave:composeEventHandlers$1(props.onPointerLeave,()=>{context.onTriggerLeave(),hasPointerMoveOpenedRef.current=!1}),onPointerDown:composeEventHandlers$1(props.onPointerDown,()=>{context.open&&context.onClose(),isPointerDownRef.current=!0,document.addEventListener("pointerup",handlePointerUp,{once:!0})}),onFocus:composeEventHandlers$1(props.onFocus,()=>{isPointerDownRef.current||context.onOpen()}),onBlur:composeEventHandlers$1(props.onBlur,context.onClose),onClick:composeEventHandlers$1(props.onClick,context.onClose)})})});TooltipTrigger$1.displayName=TRIGGER_NAME$4;var PORTAL_NAME$4="TooltipPortal",[PortalProvider$2,usePortalContext$2]=createTooltipContext(PORTAL_NAME$4,{forceMount:void 0}),TooltipPortal=__name(props=>{const{__scopeTooltip,forceMount,children,container}=props,context=useTooltipContext(PORTAL_NAME$4,__scopeTooltip);return jsxRuntimeExports.jsx(PortalProvider$2,{scope:__scopeTooltip,forceMount,children:jsxRuntimeExports.jsx(Presence,{present:forceMount||context.open,children:jsxRuntimeExports.jsx(Portal$4,{asChild:!0,container,children})})})},"TooltipPortal");TooltipPortal.displayName=PORTAL_NAME$4;var CONTENT_NAME$5="TooltipContent",TooltipContent$1=reactExports.forwardRef((props,forwardedRef)=>{const portalContext=usePortalContext$2(CONTENT_NAME$5,props.__scopeTooltip),{forceMount=portalContext.forceMount,side="top",...contentProps}=props,context=useTooltipContext(CONTENT_NAME$5,props.__scopeTooltip);return jsxRuntimeExports.jsx(Presence,{present:forceMount||context.open,children:context.disableHoverableContent?jsxRuntimeExports.jsx(TooltipContentImpl,{side,...contentProps,ref:forwardedRef}):jsxRuntimeExports.jsx(TooltipContentHoverable,{side,...contentProps,ref:forwardedRef})})}),TooltipContentHoverable=reactExports.forwardRef((props,forwardedRef)=>{const context=useTooltipContext(CONTENT_NAME$5,props.__scopeTooltip),providerContext=useTooltipProviderContext(CONTENT_NAME$5,props.__scopeTooltip),ref=reactExports.useRef(null),composedRefs=useComposedRefs(forwardedRef,ref),[pointerGraceArea,setPointerGraceArea]=reactExports.useState(null),{trigger,onClose}=context,content2=ref.current,{onPointerInTransitChange}=providerContext,handleRemoveGraceArea=reactExports.useCallback(()=>{setPointerGraceArea(null),onPointerInTransitChange(!1)},[onPointerInTransitChange]),handleCreateGraceArea=reactExports.useCallback((event,hoverTarget)=>{const currentTarget=event.currentTarget,exitPoint={x:event.clientX,y:event.clientY},exitSide=getExitSideFromRect(exitPoint,currentTarget.getBoundingClientRect()),paddedExitPoints=getPaddedExitPoints(exitPoint,exitSide),hoverTargetPoints=getPointsFromRect(hoverTarget.getBoundingClientRect()),graceArea=getHull([...paddedExitPoints,...hoverTargetPoints]);setPointerGraceArea(graceArea),onPointerInTransitChange(!0)},[onPointerInTransitChange]);return reactExports.useEffect(()=>()=>handleRemoveGraceArea(),[handleRemoveGraceArea]),reactExports.useEffect(()=>{if(trigger&&content2){const handleTriggerLeave=__name(event=>handleCreateGraceArea(event,content2),"handleTriggerLeave"),handleContentLeave=__name(event=>handleCreateGraceArea(event,trigger),"handleContentLeave");return trigger.addEventListener("pointerleave",handleTriggerLeave),content2.addEventListener("pointerleave",handleContentLeave),()=>{trigger.removeEventListener("pointerleave",handleTriggerLeave),content2.removeEventListener("pointerleave",handleContentLeave)}}},[trigger,content2,handleCreateGraceArea,handleRemoveGraceArea]),reactExports.useEffect(()=>{if(pointerGraceArea){const handleTrackPointerGrace=__name(event=>{const target=event.target,pointerPosition={x:event.clientX,y:event.clientY},hasEnteredTarget=trigger?.contains(target)||content2?.contains(target),isPointerOutsideGraceArea=!isPointInPolygon$1(pointerPosition,pointerGraceArea);hasEnteredTarget?handleRemoveGraceArea():isPointerOutsideGraceArea&&(handleRemoveGraceArea(),onClose())},"handleTrackPointerGrace");return document.addEventListener("pointermove",handleTrackPointerGrace),()=>document.removeEventListener("pointermove",handleTrackPointerGrace)}},[trigger,content2,pointerGraceArea,onClose,handleRemoveGraceArea]),jsxRuntimeExports.jsx(TooltipContentImpl,{...props,ref:composedRefs})}),[VisuallyHiddenContentContextProvider,useVisuallyHiddenContentContext]=createTooltipContext(TOOLTIP_NAME,{isInside:!1}),Slottable=createSlottable("TooltipContent"),TooltipContentImpl=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeTooltip,children,"aria-label":ariaLabel,onEscapeKeyDown,onPointerDownOutside,...contentProps}=props,context=useTooltipContext(CONTENT_NAME$5,__scopeTooltip),popperScope=usePopperScope$2(__scopeTooltip),{onClose}=context;return reactExports.useEffect(()=>(document.addEventListener(TOOLTIP_OPEN,onClose),()=>document.removeEventListener(TOOLTIP_OPEN,onClose)),[onClose]),reactExports.useEffect(()=>{if(context.trigger){const handleScroll2=__name(event=>{event.target?.contains(context.trigger)&&onClose()},"handleScroll");return window.addEventListener("scroll",handleScroll2,{capture:!0}),()=>window.removeEventListener("scroll",handleScroll2,{capture:!0})}},[context.trigger,onClose]),jsxRuntimeExports.jsx(DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown,onPointerDownOutside,onFocusOutside:__name(event=>event.preventDefault(),"onFocusOutside"),onDismiss:onClose,children:jsxRuntimeExports.jsxs(Content$2,{"data-state":context.stateAttribute,...popperScope,...contentProps,ref:forwardedRef,style:{...contentProps.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:[jsxRuntimeExports.jsx(Slottable,{children}),jsxRuntimeExports.jsx(VisuallyHiddenContentContextProvider,{scope:__scopeTooltip,isInside:!0,children:jsxRuntimeExports.jsx(Root$8,{id:context.contentId,role:"tooltip",children:ariaLabel||children})})]})})});TooltipContent$1.displayName=CONTENT_NAME$5;var ARROW_NAME$3="TooltipArrow",TooltipArrow=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeTooltip,...arrowProps}=props,popperScope=usePopperScope$2(__scopeTooltip);return useVisuallyHiddenContentContext(ARROW_NAME$3,__scopeTooltip).isInside?null:jsxRuntimeExports.jsx(Arrow,{...popperScope,...arrowProps,ref:forwardedRef})});TooltipArrow.displayName=ARROW_NAME$3;function getExitSideFromRect(point2,rect){const top=Math.abs(rect.top-point2.y),bottom=Math.abs(rect.bottom-point2.y),right=Math.abs(rect.right-point2.x),left=Math.abs(rect.left-point2.x);switch(Math.min(top,bottom,right,left)){case left:return"left";case right:return"right";case top:return"top";case bottom:return"bottom";default:throw new Error("unreachable")}}__name(getExitSideFromRect,"getExitSideFromRect");function getPaddedExitPoints(exitPoint,exitSide,padding=5){const paddedExitPoints=[];switch(exitSide){case"top":paddedExitPoints.push({x:exitPoint.x-padding,y:exitPoint.y+padding},{x:exitPoint.x+padding,y:exitPoint.y+padding});break;case"bottom":paddedExitPoints.push({x:exitPoint.x-padding,y:exitPoint.y-padding},{x:exitPoint.x+padding,y:exitPoint.y-padding});break;case"left":paddedExitPoints.push({x:exitPoint.x+padding,y:exitPoint.y-padding},{x:exitPoint.x+padding,y:exitPoint.y+padding});break;case"right":paddedExitPoints.push({x:exitPoint.x-padding,y:exitPoint.y-padding},{x:exitPoint.x-padding,y:exitPoint.y+padding});break}return paddedExitPoints}__name(getPaddedExitPoints,"getPaddedExitPoints");function getPointsFromRect(rect){const{top,right,bottom,left}=rect;return[{x:left,y:top},{x:right,y:top},{x:right,y:bottom},{x:left,y:bottom}]}__name(getPointsFromRect,"getPointsFromRect");function isPointInPolygon$1(point2,polygon){const{x,y}=point2;let inside=!1;for(let i2=0,j=polygon.length-1;i2<polygon.length;j=i2++){const ii=polygon[i2],jj=polygon[j],xi=ii.x,yi=ii.y,xj=jj.x,yj=jj.y;yi>y!=yj>y&&x<(xj-xi)*(y-yi)/(yj-yi)+xi&&(inside=!inside)}return inside}__name(isPointInPolygon$1,"isPointInPolygon$1");function getHull(points){const newPoints=points.slice();return newPoints.sort((a2,b)=>a2.x<b.x?-1:a2.x>b.x?1:a2.y<b.y?-1:a2.y>b.y?1:0),getHullPresorted(newPoints)}__name(getHull,"getHull");function getHullPresorted(points){if(points.length<=1)return points.slice();const upperHull=[];for(let i2=0;i2<points.length;i2++){const p=points[i2];for(;upperHull.length>=2;){const q2=upperHull[upperHull.length-1],r2=upperHull[upperHull.length-2];if((q2.x-r2.x)*(p.y-r2.y)>=(q2.y-r2.y)*(p.x-r2.x))upperHull.pop();else break}upperHull.push(p)}upperHull.pop();const lowerHull=[];for(let i2=points.length-1;i2>=0;i2--){const p=points[i2];for(;lowerHull.length>=2;){const q2=lowerHull[lowerHull.length-1],r2=lowerHull[lowerHull.length-2];if((q2.x-r2.x)*(p.y-r2.y)>=(q2.y-r2.y)*(p.x-r2.x))lowerHull.pop();else break}lowerHull.push(p)}return lowerHull.pop(),upperHull.length===1&&lowerHull.length===1&&upperHull[0].x===lowerHull[0].x&&upperHull[0].y===lowerHull[0].y?upperHull:upperHull.concat(lowerHull)}__name(getHullPresorted,"getHullPresorted");var Provider=TooltipProvider$1,Root3$1=Tooltip$1,Trigger$4=TooltipTrigger$1,Portal$3=TooltipPortal,Content2$3=TooltipContent$1,Arrow2$1=TooltipArrow;function TooltipProvider({delayDuration=0,...props}){return jsxRuntimeExports.jsx(Provider,{"data-slot":"tooltip-provider",delayDuration,...props})}__name(TooltipProvider,"TooltipProvider");function Tooltip({...props}){return jsxRuntimeExports.jsx(TooltipProvider,{children:jsxRuntimeExports.jsx(Root3$1,{"data-slot":"tooltip",...props})})}__name(Tooltip,"Tooltip");function TooltipTrigger({...props}){return jsxRuntimeExports.jsx(Trigger$4,{"data-slot":"tooltip-trigger",...props})}__name(TooltipTrigger,"TooltipTrigger");function TooltipContent({className,sideOffset=0,arrowClassName,children,...props}){return jsxRuntimeExports.jsx(Portal$3,{children:jsxRuntimeExports.jsxs(Content2$3,{"data-slot":"tooltip-content",sideOffset,className:cn$1("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",className),...props,children:[children,jsxRuntimeExports.jsx(Arrow2$1,{className:cn$1("bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",arrowClassName)})]})})}__name(TooltipContent,"TooltipContent");const capitalizedCache=new Map;function capitalizeWords(name2){if(!name2)return"";if(capitalizedCache.has(name2))return capitalizedCache.get(name2);const s2=name2.replace(/[-_]+/g," ").replace(/\s+/g," ").trim();if(!s2)return capitalizedCache.set(name2,""),"";const baseTokens=s2.match(/([A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+|[0-9]+)/g);if(!baseTokens)return capitalizedCache.set(name2,""),"";const tokens=[];for(let i2=0;i2<baseTokens.length;i2++){const token=baseTokens[i2],next2=i2+1<baseTokens.length?baseTokens[i2+1]:void 0;/^[A-Z]{2,}$/.test(token)&&next2&&/[A-Z]*s$/.test(next2)||/^[A-Z]$/.test(token)&&next2!==void 0&&/^[A-Z]s$/.test(next2)?(tokens.push(token+next2),i2++):tokens.push(token)}const result=tokens.map(capitalizeTokenWordsAppropriately).join(" ");return capitalizedCache.set(name2,result),result}__name(capitalizeWords,"capitalizeWords");function capitalizeTokenWordsAppropriately(t2){return/^[A-Z]{2,3}s?$/.test(t2)||/^[0-9]+$/.test(t2)?t2:t2.charAt(0).toUpperCase()+t2.slice(1).toLowerCase()}__name(capitalizeTokenWordsAppropriately,"capitalizeTokenWordsAppropriately");function Breadcrumbs({restartRequired}){const location2=useLocation(),{organization,instance,cluster}=useRouteContext({strict:!1}),targetNoun="Instance",breadcrumbs=reactExports.useMemo(()=>{const routeHistory=location2.pathname.split("/").filter(x=>x&&x.length>0),breadcrumbs2=[jsxRuntimeExports.jsxs(Link$2,{to:"/",children:[jsxRuntimeExports.jsx(House,{"aria-hidden":"true",className:"size-5 shrink-0"}),jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Home"})]},"home")];for(let index2=0;index2<routeHistory.length;index2++){const route=routeHistory[index2];if(route==="instance")continue;let path=`/${routeHistory.slice(0,index2+1).join("/")}`,name2=capitalizeWords(route),id2;route==="databases"&&routeHistory.length===index2+3?(name2=routeHistory[index2+2],index2+=2):name2.startsWith("Org ")?name2=organization?.name||"Org":name2.startsWith("Clu ")?(name2=cluster?.name||"Cluster",routeHistory[index2+1]==="instance"&&(path+="/instances")):name2.startsWith("Ins ")?name2=instance?.name?.split(".")?.shift()||"Instance":name2==="Apis"&&(name2="APIs"),breadcrumbs2.push(jsxRuntimeExports.jsx("svg",{fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true",className:"size-5 shrink-0 text-grey",children:jsxRuntimeExports.jsx("path",{d:"M5.555 17.776l8-16 .894.448-8 16-.894-.448z"})}),jsxRuntimeExports.jsxs(Link$2,{to:path,className:"text-xs md:text-sm font-medium hover:text-grey truncate max-w-48",children:[name2,id2]}))}return breadcrumbs2},[location2.pathname,cluster?.name,instance?.name,organization?.name]);return jsxRuntimeExports.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:[...breadcrumbs,restartRequired&&jsxRuntimeExports.jsxs(Tooltip,{children:[jsxRuntimeExports.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntimeExports.jsxs("div",{className:"text-xs italic text-muted-foreground",children:["* Restart ",jsxRuntimeExports.jsx("span",{className:"hidden lg:inline-block",children:"Requested"})]})}),jsxRuntimeExports.jsxs(TooltipContent,{side:"bottom",children:["This ",targetNoun," is requesting a restart, when convenient, to apply your latest changes.",jsxRuntimeExports.jsx("br",{}),"You can do this from the Apps or Config pages."]})]})]})}__name(Breadcrumbs,"Breadcrumbs");var isCheckBoxInput=__name(element2=>element2.type==="checkbox","isCheckBoxInput"),isDateObject=__name(value=>value instanceof Date,"isDateObject"),isNullOrUndefined=__name(value=>value==null,"isNullOrUndefined");const isObjectType=__name(value=>typeof value=="object","isObjectType");var isObject$4=__name(value=>!isNullOrUndefined(value)&&!Array.isArray(value)&&isObjectType(value)&&!isDateObject(value),"isObject$4"),getEventValue=__name(event=>isObject$4(event)&&event.target?isCheckBoxInput(event.target)?event.target.checked:event.target.value:event,"getEventValue"),getNodeParentName=__name(name2=>name2.substring(0,name2.search(/\.\d+(\.|$)/))||name2,"getNodeParentName"),isNameInFieldArray=__name((names,name2)=>names.has(getNodeParentName(name2)),"isNameInFieldArray"),isPlainObject$2=__name(tempObject=>{const prototypeCopy=tempObject.constructor&&tempObject.constructor.prototype;return isObject$4(prototypeCopy)&&prototypeCopy.hasOwnProperty("isPrototypeOf")},"isPlainObject$2"),isWeb=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function cloneObject(data){if(data instanceof Date)return new Date(data);const isFileListInstance=typeof FileList<"u"&&data instanceof FileList;if(isWeb&&(data instanceof Blob||isFileListInstance))return data;const isArray2=Array.isArray(data);if(!isArray2&&!(isObject$4(data)&&isPlainObject$2(data)))return data;const copy=isArray2?[]:Object.create(Object.getPrototypeOf(data));for(const key in data)Object.prototype.hasOwnProperty.call(data,key)&&(copy[key]=cloneObject(data[key]));return copy}__name(cloneObject,"cloneObject");var isKey=__name(value=>/^\w*$/.test(value),"isKey"),isUndefined=__name(val=>val===void 0,"isUndefined"),compact=__name(value=>Array.isArray(value)?value.filter(Boolean):[],"compact"),stringToPath=__name(input=>compact(input.replace(/["|']|\]/g,"").split(/\.|\[/)),"stringToPath"),get=__name((object2,path,defaultValue)=>{if(!path||!isObject$4(object2))return defaultValue;const result=(isKey(path)?[path]:stringToPath(path)).reduce((result2,key)=>isNullOrUndefined(result2)?result2:result2[key],object2);return isUndefined(result)||result===object2?isUndefined(object2[path])?defaultValue:object2[path]:result},"get"),isBoolean=__name(value=>typeof value=="boolean","isBoolean"),isFunction$2=__name(value=>typeof value=="function","isFunction$2"),set$1=__name((object2,path,value)=>{let index2=-1;const tempPath=isKey(path)?[path]:stringToPath(path),length=tempPath.length,lastIndex=length-1;for(;++index2<length;){const key=tempPath[index2];let newValue=value;if(index2!==lastIndex){const objValue=object2[key];newValue=isObject$4(objValue)||Array.isArray(objValue)?objValue:isNaN(+tempPath[index2+1])?{}:[]}if(key==="__proto__"||key==="constructor"||key==="prototype")return;object2[key]=newValue,object2=object2[key]}},"set$1");const EVENTS={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},VALIDATION_MODE={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},INPUT_VALIDATION_RULES={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},HookFormControlContext=React.createContext(null);HookFormControlContext.displayName="HookFormControlContext";const useFormControlContext=__name(()=>React.useContext(HookFormControlContext),"useFormControlContext");var getProxyFormState=__name((formState,control,localProxyFormState,isRoot=!0)=>{const result={defaultValues:control._defaultValues};for(const key in formState)Object.defineProperty(result,key,{get:__name(()=>{const _key=key;return control._proxyFormState[_key]!==VALIDATION_MODE.all&&(control._proxyFormState[_key]=!isRoot||VALIDATION_MODE.all),localProxyFormState&&(localProxyFormState[_key]=!0),formState[_key]},"get")});return result},"getProxyFormState");const useIsomorphicLayoutEffect$1=typeof window<"u"?React.useLayoutEffect:React.useEffect;function useFormState(props){const formControl=useFormControlContext(),{control=formControl,disabled,name:name2,exact}=props||{},[formState,updateFormState]=React.useState(control._formState),_localProxyFormState=React.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return useIsomorphicLayoutEffect$1(()=>control._subscribe({name:name2,formState:_localProxyFormState.current,exact,callback:__name(formState2=>{!disabled&&updateFormState({...control._formState,...formState2})},"callback")}),[name2,disabled,exact]),React.useEffect(()=>{_localProxyFormState.current.isValid&&control._setValid(!0)},[control]),React.useMemo(()=>getProxyFormState(formState,control,_localProxyFormState.current,!1),[formState,control])}__name(useFormState,"useFormState");var isString=__name(value=>typeof value=="string","isString"),generateWatchOutput=__name((names,_names,formValues,isGlobal,defaultValue)=>isString(names)?(isGlobal&&_names.watch.add(names),get(formValues,names,defaultValue)):Array.isArray(names)?names.map(fieldName=>(isGlobal&&_names.watch.add(fieldName),get(formValues,fieldName))):(isGlobal&&(_names.watchAll=!0),formValues),"generateWatchOutput"),isPrimitive=__name(value=>isNullOrUndefined(value)||!isObjectType(value),"isPrimitive");function deepEqual(object1,object2,_internal_visited=new WeakSet){if(isPrimitive(object1)||isPrimitive(object2))return Object.is(object1,object2);if(isDateObject(object1)&&isDateObject(object2))return Object.is(object1.getTime(),object2.getTime());const keys1=Object.keys(object1),keys2=Object.keys(object2);if(keys1.length!==keys2.length)return!1;if(_internal_visited.has(object1)||_internal_visited.has(object2))return!0;_internal_visited.add(object1),_internal_visited.add(object2);for(const key of keys1){const val1=object1[key];if(!keys2.includes(key))return!1;if(key!=="ref"){const val2=object2[key];if(isDateObject(val1)&&isDateObject(val2)||isObject$4(val1)&&isObject$4(val2)||Array.isArray(val1)&&Array.isArray(val2)?!deepEqual(val1,val2,_internal_visited):!Object.is(val1,val2))return!1}}return!0}__name(deepEqual,"deepEqual");function useWatch(props){const formControl=useFormControlContext(),{control=formControl,name:name2,defaultValue,disabled,exact,compute}=props||{},_defaultValue=React.useRef(defaultValue),_compute=React.useRef(compute),_computeFormValues=React.useRef(void 0),_prevControl=React.useRef(control),_prevName=React.useRef(name2);_compute.current=compute;const[value,updateValue]=React.useState(()=>{const defaultValue2=control._getWatch(name2,_defaultValue.current);return _compute.current?_compute.current(defaultValue2):defaultValue2}),getCurrentOutput=React.useCallback(values=>{const formValues=generateWatchOutput(name2,control._names,values||control._formValues,!1,_defaultValue.current);return _compute.current?_compute.current(formValues):formValues},[control._formValues,control._names,name2]),refreshValue=React.useCallback(values=>{if(!disabled){const formValues=generateWatchOutput(name2,control._names,values||control._formValues,!1,_defaultValue.current);if(_compute.current){const computedFormValues=_compute.current(formValues);deepEqual(computedFormValues,_computeFormValues.current)||(updateValue(computedFormValues),_computeFormValues.current=computedFormValues)}else updateValue(formValues)}},[control._formValues,control._names,disabled,name2]);useIsomorphicLayoutEffect$1(()=>((_prevControl.current!==control||!deepEqual(_prevName.current,name2))&&(_prevControl.current=control,_prevName.current=name2,refreshValue()),control._subscribe({name:name2,formState:{values:!0},exact,callback:__name(formState=>{refreshValue(formState.values)},"callback")})),[control,exact,name2,refreshValue]),React.useEffect(()=>control._removeUnmounted());const controlChanged=_prevControl.current!==control,prevName=_prevName.current,computedOutput=React.useMemo(()=>{if(disabled)return null;const nameChanged=!controlChanged&&!deepEqual(prevName,name2);return controlChanged||nameChanged?getCurrentOutput():null},[disabled,controlChanged,name2,prevName,getCurrentOutput]);return computedOutput!==null?computedOutput:value}__name(useWatch,"useWatch");function useController(props){const formControl=useFormControlContext(),{name:name2,disabled,control=formControl,shouldUnregister,defaultValue,exact=!0}=props,isArrayField=isNameInFieldArray(control._names.array,name2),defaultValueMemo=React.useMemo(()=>get(control._formValues,name2,get(control._defaultValues,name2,defaultValue)),[control,name2,defaultValue]),value=useWatch({control,name:name2,defaultValue:defaultValueMemo,exact}),formState=useFormState({control,name:name2,exact}),_props=React.useRef(props),_previousNameRef=React.useRef(void 0),_registerProps=React.useRef(control.register(name2,{...props.rules,value,...isBoolean(props.disabled)?{disabled:props.disabled}:{}}));_props.current=props;const fieldState=React.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:__name(()=>!!get(formState.errors,name2),"get")},isDirty:{enumerable:!0,get:__name(()=>!!get(formState.dirtyFields,name2),"get")},isTouched:{enumerable:!0,get:__name(()=>!!get(formState.touchedFields,name2),"get")},isValidating:{enumerable:!0,get:__name(()=>!!get(formState.validatingFields,name2),"get")},error:{enumerable:!0,get:__name(()=>get(formState.errors,name2),"get")}}),[formState,name2]),onChange=React.useCallback(event=>_registerProps.current.onChange({target:{value:getEventValue(event),name:name2},type:EVENTS.CHANGE}),[name2]),onBlur=React.useCallback(()=>_registerProps.current.onBlur({target:{value:get(control._formValues,name2),name:name2},type:EVENTS.BLUR}),[name2,control._formValues]),ref=React.useCallback(elm=>{const field2=get(control._fields,name2);field2&&field2._f&&elm&&(field2._f.ref={focus:__name(()=>isFunction$2(elm.focus)&&elm.focus(),"focus"),select:__name(()=>isFunction$2(elm.select)&&elm.select(),"select"),setCustomValidity:__name(message=>isFunction$2(elm.setCustomValidity)&&elm.setCustomValidity(message),"setCustomValidity"),reportValidity:__name(()=>isFunction$2(elm.reportValidity)&&elm.reportValidity(),"reportValidity")})},[control._fields,name2]),field=React.useMemo(()=>({name:name2,value,...isBoolean(disabled)||formState.disabled?{disabled:formState.disabled||disabled}:{},onChange,onBlur,ref}),[name2,disabled,formState.disabled,onChange,onBlur,ref,value]);return React.useEffect(()=>{const _shouldUnregisterField=control._options.shouldUnregister||shouldUnregister,previousName=_previousNameRef.current;previousName&&previousName!==name2&&!isArrayField&&control.unregister(previousName),control.register(name2,{..._props.current.rules,...isBoolean(_props.current.disabled)?{disabled:_props.current.disabled}:{}});const updateMounted=__name((name3,value2)=>{const field2=get(control._fields,name3);field2&&field2._f&&(field2._f.mount=value2)},"updateMounted");if(updateMounted(name2,!0),_shouldUnregisterField){const value2=cloneObject(get(control._options.defaultValues,name2,_props.current.defaultValue));set$1(control._defaultValues,name2,value2),isUndefined(get(control._formValues,name2))&&set$1(control._formValues,name2,value2)}return!isArrayField&&control.register(name2),_previousNameRef.current=name2,()=>{(isArrayField?_shouldUnregisterField&&!control._state.action:_shouldUnregisterField)?control.unregister(name2):updateMounted(name2,!1)}},[name2,control,isArrayField,shouldUnregister]),React.useEffect(()=>{control._setDisabledField({disabled,name:name2})},[disabled,name2,control]),React.useMemo(()=>({field,formState,fieldState}),[field,formState,fieldState])}__name(useController,"useController");const Controller=__name(props=>props.render(useController(props)),"Controller"),HookFormContext=React.createContext(null);HookFormContext.displayName="HookFormContext";const useFormContext=__name(()=>React.useContext(HookFormContext),"useFormContext"),FormProvider=__name(props=>{const{children,watch,getValues,getFieldState,setError,clearErrors,setValue,trigger,formState,resetField,reset,handleSubmit,unregister,control,register,setFocus,subscribe:subscribe2}=props;return React.createElement(HookFormContext.Provider,{value:React.useMemo(()=>({watch,getValues,getFieldState,setError,clearErrors,setValue,trigger,formState,resetField,reset,handleSubmit,unregister,control,register,setFocus,subscribe:subscribe2}),[clearErrors,control,formState,getFieldState,getValues,handleSubmit,register,reset,resetField,setError,setFocus,setValue,subscribe2,trigger,unregister,watch])},React.createElement(HookFormControlContext.Provider,{value:control},children))},"FormProvider");var appendErrors=__name((name2,validateAllFieldCriteria,errors,type,message)=>validateAllFieldCriteria?{...errors[name2],types:{...errors[name2]&&errors[name2].types?errors[name2].types:{},[type]:message||!0}}:{},"appendErrors"),convertToArrayPayload=__name(value=>Array.isArray(value)?value:[value],"convertToArrayPayload"),createSubject=__name(()=>{let _observers2=[];return{get observers(){return _observers2},next:__name(value=>{for(const observer2 of _observers2)observer2.next&&observer2.next(value)},"next"),subscribe:__name(observer2=>(_observers2.push(observer2),{unsubscribe:__name(()=>{_observers2=_observers2.filter(o2=>o2!==observer2)},"unsubscribe")}),"subscribe"),unsubscribe:__name(()=>{_observers2=[]},"unsubscribe")}},"createSubject");function extractFormValues(fieldsState,formValues){const values={};for(const key in fieldsState)if(fieldsState.hasOwnProperty(key)){const fieldState=fieldsState[key],fieldValue=formValues[key];if(fieldState&&isObject$4(fieldState)&&fieldValue){const nestedFieldsState=extractFormValues(fieldState,fieldValue);isObject$4(nestedFieldsState)&&(values[key]=nestedFieldsState)}else fieldsState[key]&&(values[key]=fieldValue)}return values}__name(extractFormValues,"extractFormValues");var isEmptyObject=__name(value=>isObject$4(value)&&!Object.keys(value).length,"isEmptyObject"),isFileInput=__name(element2=>element2.type==="file","isFileInput"),isHTMLElement=__name(value=>{if(!isWeb)return!1;const owner=value?value.ownerDocument:0;return value instanceof(owner&&owner.defaultView?owner.defaultView.HTMLElement:HTMLElement)},"isHTMLElement"),isMultipleSelect=__name(element2=>element2.type==="select-multiple","isMultipleSelect"),isRadioInput=__name(element2=>element2.type==="radio","isRadioInput"),isRadioOrCheckbox=__name(ref=>isRadioInput(ref)||isCheckBoxInput(ref),"isRadioOrCheckbox"),live=__name(ref=>isHTMLElement(ref)&&ref.isConnected,"live");function baseGet(object2,updatePath){const length=updatePath.slice(0,-1).length;let index2=0;for(;index2<length;)object2=isUndefined(object2)?index2++:object2[updatePath[index2++]];return object2}__name(baseGet,"baseGet");function isEmptyArray(obj){for(const key in obj)if(obj.hasOwnProperty(key)&&!isUndefined(obj[key]))return!1;return!0}__name(isEmptyArray,"isEmptyArray");function unset(object2,path){const paths=Array.isArray(path)?path:isKey(path)?[path]:stringToPath(path),childObject=paths.length===1?object2:baseGet(object2,paths),index2=paths.length-1,key=paths[index2];return childObject&&delete childObject[key],index2!==0&&(isObject$4(childObject)&&isEmptyObject(childObject)||Array.isArray(childObject)&&isEmptyArray(childObject))&&unset(object2,paths.slice(0,-1)),object2}__name(unset,"unset");var objectHasFunction=__name(data=>{for(const key in data)if(isFunction$2(data[key]))return!0;return!1},"objectHasFunction");function isTraversable(value){return Array.isArray(value)||isObject$4(value)&&!objectHasFunction(value)}__name(isTraversable,"isTraversable");function markFieldsDirty(data,fields={}){for(const key in data){const value=data[key];isTraversable(value)?(fields[key]=Array.isArray(value)?[]:{},markFieldsDirty(value,fields[key])):isUndefined(value)||(fields[key]=!0)}return fields}__name(markFieldsDirty,"markFieldsDirty");function getDirtyFields(data,formValues,dirtyFieldsFromValues){dirtyFieldsFromValues||(dirtyFieldsFromValues=markFieldsDirty(formValues));for(const key in data){const value=data[key];if(isTraversable(value))isUndefined(formValues)||isPrimitive(dirtyFieldsFromValues[key])?dirtyFieldsFromValues[key]=markFieldsDirty(value,Array.isArray(value)?[]:{}):getDirtyFields(value,isNullOrUndefined(formValues)?{}:formValues[key],dirtyFieldsFromValues[key]);else{const formValue=formValues[key];dirtyFieldsFromValues[key]=!deepEqual(value,formValue)}}return dirtyFieldsFromValues}__name(getDirtyFields,"getDirtyFields");const defaultResult={value:!1,isValid:!1},validResult={value:!0,isValid:!0};var getCheckboxValue=__name(options=>{if(Array.isArray(options)){if(options.length>1){const values=options.filter(option=>option&&option.checked&&!option.disabled).map(option=>option.value);return{value:values,isValid:!!values.length}}return options[0].checked&&!options[0].disabled?options[0].attributes&&!isUndefined(options[0].attributes.value)?isUndefined(options[0].value)||options[0].value===""?validResult:{value:options[0].value,isValid:!0}:validResult:defaultResult}return defaultResult},"getCheckboxValue"),getFieldValueAs=__name((value,{valueAsNumber,valueAsDate,setValueAs})=>isUndefined(value)?value:valueAsNumber?value===""?NaN:value&&+value:valueAsDate&&isString(value)?new Date(value):setValueAs?setValueAs(value):value,"getFieldValueAs");const defaultReturn={isValid:!1,value:null};var getRadioValue=__name(options=>Array.isArray(options)?options.reduce((previous2,option)=>option&&option.checked&&!option.disabled?{isValid:!0,value:option.value}:previous2,defaultReturn):defaultReturn,"getRadioValue");function getFieldValue(_f){const ref=_f.ref;return isFileInput(ref)?ref.files:isRadioInput(ref)?getRadioValue(_f.refs).value:isMultipleSelect(ref)?[...ref.selectedOptions].map(({value})=>value):isCheckBoxInput(ref)?getCheckboxValue(_f.refs).value:getFieldValueAs(isUndefined(ref.value)?_f.ref.value:ref.value,_f)}__name(getFieldValue,"getFieldValue");var getResolverOptions=__name((fieldsNames,_fields,criteriaMode,shouldUseNativeValidation)=>{const fields={};for(const name2 of fieldsNames){const field=get(_fields,name2);field&&set$1(fields,name2,field._f)}return{criteriaMode,names:[...fieldsNames],fields,shouldUseNativeValidation}},"getResolverOptions"),isRegex=__name(value=>value instanceof RegExp,"isRegex"),getRuleValue=__name(rule=>isUndefined(rule)?rule:isRegex(rule)?rule.source:isObject$4(rule)?isRegex(rule.value)?rule.value.source:rule.value:rule,"getRuleValue"),getValidationModes=__name(mode=>({isOnSubmit:!mode||mode===VALIDATION_MODE.onSubmit,isOnBlur:mode===VALIDATION_MODE.onBlur,isOnChange:mode===VALIDATION_MODE.onChange,isOnAll:mode===VALIDATION_MODE.all,isOnTouch:mode===VALIDATION_MODE.onTouched}),"getValidationModes");const ASYNC_FUNCTION="AsyncFunction";var hasPromiseValidation=__name(fieldReference=>!!fieldReference&&!!fieldReference.validate&&!!(isFunction$2(fieldReference.validate)&&fieldReference.validate.constructor.name===ASYNC_FUNCTION||isObject$4(fieldReference.validate)&&Object.values(fieldReference.validate).find(validateFunction=>validateFunction.constructor.name===ASYNC_FUNCTION)),"hasPromiseValidation"),hasValidation=__name(options=>options.mount&&(options.required||options.min||options.max||options.maxLength||options.minLength||options.pattern||options.validate),"hasValidation"),isWatched=__name((name2,_names,isBlurEvent)=>!isBlurEvent&&(_names.watchAll||_names.watch.has(name2)||[..._names.watch].some(watchName=>name2.startsWith(watchName)&&/^\.\w+/.test(name2.slice(watchName.length)))),"isWatched");const iterateFieldsByAction=__name((fields,action,fieldsNames,abortEarly)=>{for(const key of fieldsNames||Object.keys(fields)){const field=get(fields,key);if(field){const{_f,...currentField}=field;if(_f){if(_f.refs&&_f.refs[0]&&action(_f.refs[0],key)&&!abortEarly)return!0;if(_f.ref&&action(_f.ref,_f.name)&&!abortEarly)return!0;if(iterateFieldsByAction(currentField,action))break}else if(isObject$4(currentField)&&iterateFieldsByAction(currentField,action))break}}},"iterateFieldsByAction");function schemaErrorLookup(errors,_fields,name2){const error2=get(errors,name2);if(error2||isKey(name2))return{error:error2,name:name2};const names=name2.split(".");for(;names.length;){const fieldName=names.join("."),field=get(_fields,fieldName),foundError=get(errors,fieldName);if(field&&!Array.isArray(field)&&name2!==fieldName)return{name:name2};if(foundError&&foundError.type)return{name:fieldName,error:foundError};if(foundError&&foundError.root&&foundError.root.type)return{name:`${fieldName}.root`,error:foundError.root};names.pop()}return{name:name2}}__name(schemaErrorLookup,"schemaErrorLookup");var shouldRenderFormState=__name((formStateData,_proxyFormState,updateFormState,isRoot)=>{updateFormState(formStateData);const{name:name2,...formState}=formStateData;return isEmptyObject(formState)||Object.keys(formState).length>=Object.keys(_proxyFormState).length||Object.keys(formState).find(key=>_proxyFormState[key]===(!isRoot||VALIDATION_MODE.all))},"shouldRenderFormState"),shouldSubscribeByName=__name((name2,signalName,exact)=>!name2||!signalName||name2===signalName||convertToArrayPayload(name2).some(currentName=>currentName&&(exact?currentName===signalName:currentName.startsWith(signalName)||signalName.startsWith(currentName))),"shouldSubscribeByName"),skipValidation=__name((isBlurEvent,isTouched,isSubmitted,reValidateMode,mode)=>mode.isOnAll?!1:!isSubmitted&&mode.isOnTouch?!(isTouched||isBlurEvent):(isSubmitted?reValidateMode.isOnBlur:mode.isOnBlur)?!isBlurEvent:(isSubmitted?reValidateMode.isOnChange:mode.isOnChange)?isBlurEvent:!0,"skipValidation"),unsetEmptyArray=__name((ref,name2)=>!compact(get(ref,name2)).length&&unset(ref,name2),"unsetEmptyArray"),updateFieldArrayRootError=__name((errors,error2,name2)=>{const fieldArrayErrors=convertToArrayPayload(get(errors,name2));return set$1(fieldArrayErrors,"root",error2[name2]),set$1(errors,name2,fieldArrayErrors),errors},"updateFieldArrayRootError");function getValidateError(result,ref,type="validate"){if(isString(result)||Array.isArray(result)&&result.every(isString)||isBoolean(result)&&!result)return{type,message:isString(result)?result:"",ref}}__name(getValidateError,"getValidateError");var getValueAndMessage=__name(validationData=>isObject$4(validationData)&&!isRegex(validationData)?validationData:{value:validationData,message:""},"getValueAndMessage"),validateField=__name(async(field,disabledFieldNames,formValues,validateAllFieldCriteria,shouldUseNativeValidation,isFieldArray)=>{const{ref,refs,required:required2,maxLength,minLength,min:min2,max:max2,pattern,validate,name:name2,valueAsNumber,mount}=field._f,inputValue=get(formValues,name2);if(!mount||disabledFieldNames.has(name2))return{};const inputRef=refs?refs[0]:ref,setCustomValidity=__name(message=>{shouldUseNativeValidation&&inputRef.reportValidity&&(inputRef.setCustomValidity(isBoolean(message)?"":message||""),inputRef.reportValidity())},"setCustomValidity"),error2={},isRadio=isRadioInput(ref),isCheckBox=isCheckBoxInput(ref),isRadioOrCheckbox2=isRadio||isCheckBox,isEmpty2=(valueAsNumber||isFileInput(ref))&&isUndefined(ref.value)&&isUndefined(inputValue)||isHTMLElement(ref)&&ref.value===""||inputValue===""||Array.isArray(inputValue)&&!inputValue.length,appendErrorsCurry=appendErrors.bind(null,name2,validateAllFieldCriteria,error2),getMinMaxMessage=__name((exceedMax,maxLengthMessage,minLengthMessage,maxType=INPUT_VALIDATION_RULES.maxLength,minType=INPUT_VALIDATION_RULES.minLength)=>{const message=exceedMax?maxLengthMessage:minLengthMessage;error2[name2]={type:exceedMax?maxType:minType,message,ref,...appendErrorsCurry(exceedMax?maxType:minType,message)}},"getMinMaxMessage");if(isFieldArray?!Array.isArray(inputValue)||!inputValue.length:required2&&(!isRadioOrCheckbox2&&(isEmpty2||isNullOrUndefined(inputValue))||isBoolean(inputValue)&&!inputValue||isCheckBox&&!getCheckboxValue(refs).isValid||isRadio&&!getRadioValue(refs).isValid)){const{value,message}=isString(required2)?{value:!!required2,message:required2}:getValueAndMessage(required2);if(value&&(error2[name2]={type:INPUT_VALIDATION_RULES.required,message,ref:inputRef,...appendErrorsCurry(INPUT_VALIDATION_RULES.required,message)},!validateAllFieldCriteria))return setCustomValidity(message),error2}if(!isEmpty2&&(!isNullOrUndefined(min2)||!isNullOrUndefined(max2))){let exceedMax,exceedMin;const maxOutput=getValueAndMessage(max2),minOutput=getValueAndMessage(min2);if(!isNullOrUndefined(inputValue)&&!isNaN(inputValue)){const valueNumber=ref.valueAsNumber||inputValue&&+inputValue;isNullOrUndefined(maxOutput.value)||(exceedMax=valueNumber>maxOutput.value),isNullOrUndefined(minOutput.value)||(exceedMin=valueNumber<minOutput.value)}else{const valueDate=ref.valueAsDate||new Date(inputValue),convertTimeToDate=__name(time2=>new Date(new Date().toDateString()+" "+time2),"convertTimeToDate"),isTime=ref.type=="time",isWeek=ref.type=="week";isString(maxOutput.value)&&inputValue&&(exceedMax=isTime?convertTimeToDate(inputValue)>convertTimeToDate(maxOutput.value):isWeek?inputValue>maxOutput.value:valueDate>new Date(maxOutput.value)),isString(minOutput.value)&&inputValue&&(exceedMin=isTime?convertTimeToDate(inputValue)<convertTimeToDate(minOutput.value):isWeek?inputValue<minOutput.value:valueDate<new Date(minOutput.value))}if((exceedMax||exceedMin)&&(getMinMaxMessage(!!exceedMax,maxOutput.message,minOutput.message,INPUT_VALIDATION_RULES.max,INPUT_VALIDATION_RULES.min),!validateAllFieldCriteria))return setCustomValidity(error2[name2].message),error2}if((maxLength||minLength)&&!isEmpty2&&(isString(inputValue)||isFieldArray&&Array.isArray(inputValue))){const maxLengthOutput=getValueAndMessage(maxLength),minLengthOutput=getValueAndMessage(minLength),exceedMax=!isNullOrUndefined(maxLengthOutput.value)&&inputValue.length>+maxLengthOutput.value,exceedMin=!isNullOrUndefined(minLengthOutput.value)&&inputValue.length<+minLengthOutput.value;if((exceedMax||exceedMin)&&(getMinMaxMessage(exceedMax,maxLengthOutput.message,minLengthOutput.message),!validateAllFieldCriteria))return setCustomValidity(error2[name2].message),error2}if(pattern&&!isEmpty2&&isString(inputValue)){const{value:patternValue,message}=getValueAndMessage(pattern);if(isRegex(patternValue)&&!inputValue.match(patternValue)&&(error2[name2]={type:INPUT_VALIDATION_RULES.pattern,message,ref,...appendErrorsCurry(INPUT_VALIDATION_RULES.pattern,message)},!validateAllFieldCriteria))return setCustomValidity(message),error2}if(validate){if(isFunction$2(validate)){const result=await validate(inputValue,formValues),validateError=getValidateError(result,inputRef);if(validateError&&(error2[name2]={...validateError,...appendErrorsCurry(INPUT_VALIDATION_RULES.validate,validateError.message)},!validateAllFieldCriteria))return setCustomValidity(validateError.message),error2}else if(isObject$4(validate)){let validationResult={};for(const key in validate){if(!isEmptyObject(validationResult)&&!validateAllFieldCriteria)break;const validateError=getValidateError(await validate[key](inputValue,formValues),inputRef,key);validateError&&(validationResult={...validateError,...appendErrorsCurry(key,validateError.message)},setCustomValidity(validateError.message),validateAllFieldCriteria&&(error2[name2]=validationResult))}if(!isEmptyObject(validationResult)&&(error2[name2]={ref:inputRef,...validationResult},!validateAllFieldCriteria))return error2}}return setCustomValidity(!0),error2},"validateField");const defaultOptions={mode:VALIDATION_MODE.onSubmit,reValidateMode:VALIDATION_MODE.onChange,shouldFocusError:!0};function createFormControl(props={}){let _options={...defaultOptions,...props},_formState={submitCount:0,isDirty:!1,isReady:!1,isLoading:isFunction$2(_options.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:_options.errors||{},disabled:_options.disabled||!1},_fields={},_defaultValues=isObject$4(_options.defaultValues)||isObject$4(_options.values)?cloneObject(_options.defaultValues||_options.values)||{}:{},_formValues=_options.shouldUnregister?{}:cloneObject(_defaultValues),_state={action:!1,mount:!1,watch:!1,keepIsValid:!1},_names={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},delayErrorCallback,timer=0;const defaultProxyFormState={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},_proxyFormState={...defaultProxyFormState};let _proxySubscribeFormState={..._proxyFormState};const _subjects={array:createSubject(),state:createSubject()},shouldDisplayAllAssociatedErrors=_options.criteriaMode===VALIDATION_MODE.all,debounce=__name(callback=>wait=>{clearTimeout(timer),timer=setTimeout(callback,wait)},"debounce"),_setValid=__name(async shouldUpdateValid=>{if(!_state.keepIsValid&&!_options.disabled&&(_proxyFormState.isValid||_proxySubscribeFormState.isValid||shouldUpdateValid)){let isValid;_options.resolver?(isValid=isEmptyObject((await _runSchema()).errors),_updateIsValidating()):isValid=await executeBuiltInValidation(_fields,!0),isValid!==_formState.isValid&&_subjects.state.next({isValid})}},"_setValid"),_updateIsValidating=__name((names,isValidating)=>{!_options.disabled&&(_proxyFormState.isValidating||_proxyFormState.validatingFields||_proxySubscribeFormState.isValidating||_proxySubscribeFormState.validatingFields)&&((names||Array.from(_names.mount)).forEach(name2=>{name2&&(isValidating?set$1(_formState.validatingFields,name2,isValidating):unset(_formState.validatingFields,name2))}),_subjects.state.next({validatingFields:_formState.validatingFields,isValidating:!isEmptyObject(_formState.validatingFields)}))},"_updateIsValidating"),_setFieldArray=__name((name2,values=[],method,args,shouldSetValues=!0,shouldUpdateFieldsAndState=!0)=>{if(args&&method&&!_options.disabled){if(_state.action=!0,shouldUpdateFieldsAndState&&Array.isArray(get(_fields,name2))){const fieldValues=method(get(_fields,name2),args.argA,args.argB);shouldSetValues&&set$1(_fields,name2,fieldValues)}if(shouldUpdateFieldsAndState&&Array.isArray(get(_formState.errors,name2))){const errors=method(get(_formState.errors,name2),args.argA,args.argB);shouldSetValues&&set$1(_formState.errors,name2,errors),unsetEmptyArray(_formState.errors,name2)}if((_proxyFormState.touchedFields||_proxySubscribeFormState.touchedFields)&&shouldUpdateFieldsAndState&&Array.isArray(get(_formState.touchedFields,name2))){const touchedFields=method(get(_formState.touchedFields,name2),args.argA,args.argB);shouldSetValues&&set$1(_formState.touchedFields,name2,touchedFields)}(_proxyFormState.dirtyFields||_proxySubscribeFormState.dirtyFields)&&(_formState.dirtyFields=getDirtyFields(_defaultValues,_formValues)),_subjects.state.next({name:name2,isDirty:_getDirty(name2,values),dirtyFields:_formState.dirtyFields,errors:_formState.errors,isValid:_formState.isValid})}else set$1(_formValues,name2,values)},"_setFieldArray"),updateErrors=__name((name2,error2)=>{set$1(_formState.errors,name2,error2),_subjects.state.next({errors:_formState.errors})},"updateErrors"),_setErrors=__name(errors=>{_formState.errors=errors,_subjects.state.next({errors:_formState.errors,isValid:!1})},"_setErrors"),updateValidAndValue=__name((name2,shouldSkipSetValueAs,value,ref)=>{const field=get(_fields,name2);if(field){const defaultValue=get(_formValues,name2,isUndefined(value)?get(_defaultValues,name2):value);isUndefined(defaultValue)||ref&&ref.defaultChecked||shouldSkipSetValueAs?set$1(_formValues,name2,shouldSkipSetValueAs?defaultValue:getFieldValue(field._f)):setFieldValue(name2,defaultValue),_state.mount&&!_state.action&&_setValid()}},"updateValidAndValue"),updateTouchAndDirty=__name((name2,fieldValue,isBlurEvent,shouldDirty,shouldRender)=>{let shouldUpdateField=!1,isPreviousDirty=!1;const output={name:name2};if(!_options.disabled){if(!isBlurEvent||shouldDirty){(_proxyFormState.isDirty||_proxySubscribeFormState.isDirty)&&(isPreviousDirty=_formState.isDirty,_formState.isDirty=output.isDirty=_getDirty(),shouldUpdateField=isPreviousDirty!==output.isDirty);const isCurrentFieldPristine=deepEqual(get(_defaultValues,name2),fieldValue);isPreviousDirty=!!get(_formState.dirtyFields,name2),isCurrentFieldPristine?unset(_formState.dirtyFields,name2):set$1(_formState.dirtyFields,name2,!0),output.dirtyFields=_formState.dirtyFields,shouldUpdateField=shouldUpdateField||(_proxyFormState.dirtyFields||_proxySubscribeFormState.dirtyFields)&&isPreviousDirty!==!isCurrentFieldPristine}if(isBlurEvent){const isPreviousFieldTouched=get(_formState.touchedFields,name2);isPreviousFieldTouched||(set$1(_formState.touchedFields,name2,isBlurEvent),output.touchedFields=_formState.touchedFields,shouldUpdateField=shouldUpdateField||(_proxyFormState.touchedFields||_proxySubscribeFormState.touchedFields)&&isPreviousFieldTouched!==isBlurEvent)}shouldUpdateField&&shouldRender&&_subjects.state.next(output)}return shouldUpdateField?output:{}},"updateTouchAndDirty"),shouldRenderByError=__name((name2,isValid,error2,fieldState)=>{const previousFieldError=get(_formState.errors,name2),shouldUpdateValid=(_proxyFormState.isValid||_proxySubscribeFormState.isValid)&&isBoolean(isValid)&&_formState.isValid!==isValid;if(_options.delayError&&error2?(delayErrorCallback=debounce(()=>updateErrors(name2,error2)),delayErrorCallback(_options.delayError)):(clearTimeout(timer),delayErrorCallback=null,error2?set$1(_formState.errors,name2,error2):unset(_formState.errors,name2)),(error2?!deepEqual(previousFieldError,error2):previousFieldError)||!isEmptyObject(fieldState)||shouldUpdateValid){const updatedFormState={...fieldState,...shouldUpdateValid&&isBoolean(isValid)?{isValid}:{},errors:_formState.errors,name:name2};_formState={..._formState,...updatedFormState},_subjects.state.next(updatedFormState)}},"shouldRenderByError"),_runSchema=__name(async name2=>(_updateIsValidating(name2,!0),await _options.resolver(_formValues,_options.context,getResolverOptions(name2||_names.mount,_fields,_options.criteriaMode,_options.shouldUseNativeValidation))),"_runSchema"),executeSchemaAndUpdateState=__name(async names=>{const{errors}=await _runSchema(names);if(_updateIsValidating(names),names)for(const name2 of names){const error2=get(errors,name2);error2?set$1(_formState.errors,name2,error2):unset(_formState.errors,name2)}else _formState.errors=errors;return errors},"executeSchemaAndUpdateState"),executeBuiltInValidation=__name(async(fields,shouldOnlyCheckValid,context={valid:!0})=>{for(const name2 in fields){const field=fields[name2];if(field){const{_f,...fieldValue}=field;if(_f){const isFieldArrayRoot=_names.array.has(_f.name),isPromiseFunction=field._f&&hasPromiseValidation(field._f);isPromiseFunction&&_proxyFormState.validatingFields&&_updateIsValidating([_f.name],!0);const fieldError=await validateField(field,_names.disabled,_formValues,shouldDisplayAllAssociatedErrors,_options.shouldUseNativeValidation&&!shouldOnlyCheckValid,isFieldArrayRoot);if(isPromiseFunction&&_proxyFormState.validatingFields&&_updateIsValidating([_f.name]),fieldError[_f.name]&&(context.valid=!1,shouldOnlyCheckValid||props.shouldUseNativeValidation))break;!shouldOnlyCheckValid&&(get(fieldError,_f.name)?isFieldArrayRoot?updateFieldArrayRootError(_formState.errors,fieldError,_f.name):set$1(_formState.errors,_f.name,fieldError[_f.name]):unset(_formState.errors,_f.name))}!isEmptyObject(fieldValue)&&await executeBuiltInValidation(fieldValue,shouldOnlyCheckValid,context)}}return context.valid},"executeBuiltInValidation"),_removeUnmounted=__name(()=>{for(const name2 of _names.unMount){const field=get(_fields,name2);field&&(field._f.refs?field._f.refs.every(ref=>!live(ref)):!live(field._f.ref))&&unregister(name2)}_names.unMount=new Set},"_removeUnmounted"),_getDirty=__name((name2,data)=>!_options.disabled&&(name2&&data&&set$1(_formValues,name2,data),!deepEqual(getValues(),_defaultValues)),"_getDirty"),_getWatch=__name((names,defaultValue,isGlobal)=>generateWatchOutput(names,_names,{..._state.mount?_formValues:isUndefined(defaultValue)?_defaultValues:isString(names)?{[names]:defaultValue}:defaultValue},isGlobal,defaultValue),"_getWatch"),_getFieldArray=__name(name2=>compact(get(_state.mount?_formValues:_defaultValues,name2,_options.shouldUnregister?get(_defaultValues,name2,[]):[])),"_getFieldArray"),setFieldValue=__name((name2,value,options={})=>{const field=get(_fields,name2);let fieldValue=value;if(field){const fieldReference=field._f;fieldReference&&(!fieldReference.disabled&&set$1(_formValues,name2,getFieldValueAs(value,fieldReference)),fieldValue=isHTMLElement(fieldReference.ref)&&isNullOrUndefined(value)?"":value,isMultipleSelect(fieldReference.ref)?[...fieldReference.ref.options].forEach(optionRef=>optionRef.selected=fieldValue.includes(optionRef.value)):fieldReference.refs?isCheckBoxInput(fieldReference.ref)?fieldReference.refs.forEach(checkboxRef=>{(!checkboxRef.defaultChecked||!checkboxRef.disabled)&&(Array.isArray(fieldValue)?checkboxRef.checked=!!fieldValue.find(data=>data===checkboxRef.value):checkboxRef.checked=fieldValue===checkboxRef.value||!!fieldValue)}):fieldReference.refs.forEach(radioRef=>radioRef.checked=radioRef.value===fieldValue):isFileInput(fieldReference.ref)?fieldReference.ref.value="":(fieldReference.ref.value=fieldValue,fieldReference.ref.type||_subjects.state.next({name:name2,values:cloneObject(_formValues)})))}(options.shouldDirty||options.shouldTouch)&&updateTouchAndDirty(name2,fieldValue,options.shouldTouch,options.shouldDirty,!0),options.shouldValidate&&trigger(name2)},"setFieldValue"),setValues=__name((name2,value,options)=>{for(const fieldKey in value){if(!value.hasOwnProperty(fieldKey))return;const fieldValue=value[fieldKey],fieldName=name2+"."+fieldKey,field=get(_fields,fieldName);(_names.array.has(name2)||isObject$4(fieldValue)||field&&!field._f)&&!isDateObject(fieldValue)?setValues(fieldName,fieldValue,options):setFieldValue(fieldName,fieldValue,options)}},"setValues"),setValue=__name((name2,value,options={})=>{const field=get(_fields,name2),isFieldArray=_names.array.has(name2),cloneValue=cloneObject(value);set$1(_formValues,name2,cloneValue),isFieldArray?(_subjects.array.next({name:name2,values:cloneObject(_formValues)}),(_proxyFormState.isDirty||_proxyFormState.dirtyFields||_proxySubscribeFormState.isDirty||_proxySubscribeFormState.dirtyFields)&&options.shouldDirty&&_subjects.state.next({name:name2,dirtyFields:getDirtyFields(_defaultValues,_formValues),isDirty:_getDirty(name2,cloneValue)})):field&&!field._f&&!isNullOrUndefined(cloneValue)?setValues(name2,cloneValue,options):setFieldValue(name2,cloneValue,options),isWatched(name2,_names)?_subjects.state.next({..._formState,name:name2,values:cloneObject(_formValues)}):_subjects.state.next({name:_state.mount?name2:void 0,values:cloneObject(_formValues)})},"setValue"),onChange=__name(async event=>{_state.mount=!0;const target=event.target;let name2=target.name,isFieldValueUpdated=!0;const field=get(_fields,name2),_updateIsFieldValueUpdated=__name(fieldValue=>{isFieldValueUpdated=Number.isNaN(fieldValue)||isDateObject(fieldValue)&&isNaN(fieldValue.getTime())||deepEqual(fieldValue,get(_formValues,name2,fieldValue))},"_updateIsFieldValueUpdated"),validationModeBeforeSubmit=getValidationModes(_options.mode),validationModeAfterSubmit=getValidationModes(_options.reValidateMode);if(field){let error2,isValid;const fieldValue=target.type?getFieldValue(field._f):getEventValue(event),isBlurEvent=event.type===EVENTS.BLUR||event.type===EVENTS.FOCUS_OUT,shouldSkipValidation=!hasValidation(field._f)&&!_options.resolver&&!get(_formState.errors,name2)&&!field._f.deps||skipValidation(isBlurEvent,get(_formState.touchedFields,name2),_formState.isSubmitted,validationModeAfterSubmit,validationModeBeforeSubmit),watched=isWatched(name2,_names,isBlurEvent);set$1(_formValues,name2,fieldValue),isBlurEvent?(!target||!target.readOnly)&&(field._f.onBlur&&field._f.onBlur(event),delayErrorCallback&&delayErrorCallback(0)):field._f.onChange&&field._f.onChange(event);const fieldState=updateTouchAndDirty(name2,fieldValue,isBlurEvent),shouldRender=!isEmptyObject(fieldState)||watched;if(!isBlurEvent&&_subjects.state.next({name:name2,type:event.type,values:cloneObject(_formValues)}),shouldSkipValidation)return(_proxyFormState.isValid||_proxySubscribeFormState.isValid)&&(_options.mode==="onBlur"?isBlurEvent&&_setValid():isBlurEvent||_setValid()),shouldRender&&_subjects.state.next({name:name2,...watched?{}:fieldState});if(!isBlurEvent&&watched&&_subjects.state.next({..._formState}),_options.resolver){const{errors}=await _runSchema([name2]);if(_updateIsValidating([name2]),_updateIsFieldValueUpdated(fieldValue),isFieldValueUpdated){const previousErrorLookupResult=schemaErrorLookup(_formState.errors,_fields,name2),errorLookupResult=schemaErrorLookup(errors,_fields,previousErrorLookupResult.name||name2);error2=errorLookupResult.error,name2=errorLookupResult.name,isValid=isEmptyObject(errors)}}else _updateIsValidating([name2],!0),error2=(await validateField(field,_names.disabled,_formValues,shouldDisplayAllAssociatedErrors,_options.shouldUseNativeValidation))[name2],_updateIsValidating([name2]),_updateIsFieldValueUpdated(fieldValue),isFieldValueUpdated&&(error2?isValid=!1:(_proxyFormState.isValid||_proxySubscribeFormState.isValid)&&(isValid=await executeBuiltInValidation(_fields,!0)));isFieldValueUpdated&&(field._f.deps&&(!Array.isArray(field._f.deps)||field._f.deps.length>0)&&trigger(field._f.deps),shouldRenderByError(name2,isValid,error2,fieldState))}},"onChange"),_focusInput=__name((ref,key)=>{if(get(_formState.errors,key)&&ref.focus)return ref.focus(),1},"_focusInput"),trigger=__name(async(name2,options={})=>{let isValid,validationResult;const fieldNames=convertToArrayPayload(name2);if(_options.resolver){const errors=await executeSchemaAndUpdateState(isUndefined(name2)?name2:fieldNames);isValid=isEmptyObject(errors),validationResult=name2?!fieldNames.some(name3=>get(errors,name3)):isValid}else name2?(validationResult=(await Promise.all(fieldNames.map(async fieldName=>{const field=get(_fields,fieldName);return await executeBuiltInValidation(field&&field._f?{[fieldName]:field}:field)}))).every(Boolean),!(!validationResult&&!_formState.isValid)&&_setValid()):validationResult=isValid=await executeBuiltInValidation(_fields);return _subjects.state.next({...!isString(name2)||(_proxyFormState.isValid||_proxySubscribeFormState.isValid)&&isValid!==_formState.isValid?{}:{name:name2},..._options.resolver||!name2?{isValid}:{},errors:_formState.errors}),options.shouldFocus&&!validationResult&&iterateFieldsByAction(_fields,_focusInput,name2?fieldNames:_names.mount),validationResult},"trigger"),getValues=__name((fieldNames,config2)=>{let values={..._state.mount?_formValues:_defaultValues};return config2&&(values=extractFormValues(config2.dirtyFields?_formState.dirtyFields:_formState.touchedFields,values)),isUndefined(fieldNames)?values:isString(fieldNames)?get(values,fieldNames):fieldNames.map(name2=>get(values,name2))},"getValues"),getFieldState=__name((name2,formState)=>({invalid:!!get((formState||_formState).errors,name2),isDirty:!!get((formState||_formState).dirtyFields,name2),error:get((formState||_formState).errors,name2),isValidating:!!get(_formState.validatingFields,name2),isTouched:!!get((formState||_formState).touchedFields,name2)}),"getFieldState"),clearErrors=__name(name2=>{const names=name2?convertToArrayPayload(name2):void 0;names?.forEach(inputName=>unset(_formState.errors,inputName)),names?names.forEach(inputName=>{_subjects.state.next({name:inputName,errors:_formState.errors})}):_subjects.state.next({errors:{}})},"clearErrors"),setError=__name((name2,error2,options)=>{const ref=(get(_fields,name2,{_f:{}})._f||{}).ref,currentError=get(_formState.errors,name2)||{},{ref:currentRef,message,type,...restOfErrorTree}=currentError;set$1(_formState.errors,name2,{...restOfErrorTree,...error2,ref}),_subjects.state.next({name:name2,errors:_formState.errors,isValid:!1}),options&&options.shouldFocus&&ref&&ref.focus&&ref.focus()},"setError"),watch=__name((name2,defaultValue)=>isFunction$2(name2)?_subjects.state.subscribe({next:__name(payload=>"values"in payload&&name2(_getWatch(void 0,defaultValue),payload),"next")}):_getWatch(name2,defaultValue,!0),"watch"),_subscribe=__name(props2=>_subjects.state.subscribe({next:__name(formState=>{shouldSubscribeByName(props2.name,formState.name,props2.exact)&&shouldRenderFormState(formState,props2.formState||_proxyFormState,_setFormState,props2.reRenderRoot)&&props2.callback({values:{..._formValues},..._formState,...formState,defaultValues:_defaultValues})},"next")}).unsubscribe,"_subscribe"),subscribe2=__name(props2=>(_state.mount=!0,_proxySubscribeFormState={..._proxySubscribeFormState,...props2.formState},_subscribe({...props2,formState:{...defaultProxyFormState,...props2.formState}})),"subscribe"),unregister=__name((name2,options={})=>{for(const fieldName of name2?convertToArrayPayload(name2):_names.mount)_names.mount.delete(fieldName),_names.array.delete(fieldName),options.keepValue||(unset(_fields,fieldName),unset(_formValues,fieldName)),!options.keepError&&unset(_formState.errors,fieldName),!options.keepDirty&&unset(_formState.dirtyFields,fieldName),!options.keepTouched&&unset(_formState.touchedFields,fieldName),!options.keepIsValidating&&unset(_formState.validatingFields,fieldName),!_options.shouldUnregister&&!options.keepDefaultValue&&unset(_defaultValues,fieldName);_subjects.state.next({values:cloneObject(_formValues)}),_subjects.state.next({..._formState,...options.keepDirty?{isDirty:_getDirty()}:{}}),!options.keepIsValid&&_setValid()},"unregister"),_setDisabledField=__name(({disabled,name:name2})=>{if(isBoolean(disabled)&&_state.mount||disabled||_names.disabled.has(name2)){const disabledStateChanged=_names.disabled.has(name2)!==!!disabled;disabled?_names.disabled.add(name2):_names.disabled.delete(name2),disabledStateChanged&&_state.mount&&!_state.action&&_setValid()}},"_setDisabledField"),register=__name((name2,options={})=>{let field=get(_fields,name2);const disabledIsDefined=isBoolean(options.disabled)||isBoolean(_options.disabled);return set$1(_fields,name2,{...field||{},_f:{...field&&field._f?field._f:{ref:{name:name2}},name:name2,mount:!0,...options}}),_names.mount.add(name2),field?_setDisabledField({disabled:isBoolean(options.disabled)?options.disabled:_options.disabled,name:name2}):updateValidAndValue(name2,!0,options.value),{...disabledIsDefined?{disabled:options.disabled||_options.disabled}:{},..._options.progressive?{required:!!options.required,min:getRuleValue(options.min),max:getRuleValue(options.max),minLength:getRuleValue(options.minLength),maxLength:getRuleValue(options.maxLength),pattern:getRuleValue(options.pattern)}:{},name:name2,onChange,onBlur:onChange,ref:__name(ref=>{if(ref){register(name2,options),field=get(_fields,name2);const fieldRef=isUndefined(ref.value)&&ref.querySelectorAll&&ref.querySelectorAll("input,select,textarea")[0]||ref,radioOrCheckbox=isRadioOrCheckbox(fieldRef),refs=field._f.refs||[];if(radioOrCheckbox?refs.find(option=>option===fieldRef):fieldRef===field._f.ref)return;set$1(_fields,name2,{_f:{...field._f,...radioOrCheckbox?{refs:[...refs.filter(live),fieldRef,...Array.isArray(get(_defaultValues,name2))?[{}]:[]],ref:{type:fieldRef.type,name:name2}}:{ref:fieldRef}}}),updateValidAndValue(name2,!1,void 0,fieldRef)}else field=get(_fields,name2,{}),field._f&&(field._f.mount=!1),(_options.shouldUnregister||options.shouldUnregister)&&!(isNameInFieldArray(_names.array,name2)&&_state.action)&&_names.unMount.add(name2)},"ref")}},"register"),_focusError=__name(()=>_options.shouldFocusError&&iterateFieldsByAction(_fields,_focusInput,_names.mount),"_focusError"),_disableForm=__name(disabled=>{isBoolean(disabled)&&(_subjects.state.next({disabled}),iterateFieldsByAction(_fields,(ref,name2)=>{const currentField=get(_fields,name2);currentField&&(ref.disabled=currentField._f.disabled||disabled,Array.isArray(currentField._f.refs)&¤tField._f.refs.forEach(inputRef=>{inputRef.disabled=currentField._f.disabled||disabled}))},0,!1))},"_disableForm"),handleSubmit=__name((onValid,onInvalid)=>async e=>{let onValidError;e&&(e.preventDefault&&e.preventDefault(),e.persist&&e.persist());let fieldValues=cloneObject(_formValues);if(_subjects.state.next({isSubmitting:!0}),_options.resolver){const{errors,values}=await _runSchema();_updateIsValidating(),_formState.errors=errors,fieldValues=cloneObject(values)}else await executeBuiltInValidation(_fields);if(_names.disabled.size)for(const name2 of _names.disabled)unset(fieldValues,name2);if(unset(_formState.errors,"root"),isEmptyObject(_formState.errors)){_subjects.state.next({errors:{}});try{await onValid(fieldValues,e)}catch(error2){onValidError=error2}}else onInvalid&&await onInvalid({..._formState.errors},e),_focusError(),setTimeout(_focusError);if(_subjects.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:isEmptyObject(_formState.errors)&&!onValidError,submitCount:_formState.submitCount+1,errors:_formState.errors}),onValidError)throw onValidError},"handleSubmit"),resetField=__name((name2,options={})=>{get(_fields,name2)&&(isUndefined(options.defaultValue)?setValue(name2,cloneObject(get(_defaultValues,name2))):(setValue(name2,options.defaultValue),set$1(_defaultValues,name2,cloneObject(options.defaultValue))),options.keepTouched||unset(_formState.touchedFields,name2),options.keepDirty||(unset(_formState.dirtyFields,name2),_formState.isDirty=options.defaultValue?_getDirty(name2,cloneObject(get(_defaultValues,name2))):_getDirty()),options.keepError||(unset(_formState.errors,name2),_proxyFormState.isValid&&_setValid()),_subjects.state.next({..._formState}))},"resetField"),_reset=__name((formValues,keepStateOptions={})=>{const updatedValues=formValues?cloneObject(formValues):_defaultValues,cloneUpdatedValues=cloneObject(updatedValues),isEmptyResetValues=isEmptyObject(formValues),values=isEmptyResetValues?_defaultValues:cloneUpdatedValues;if(keepStateOptions.keepDefaultValues||(_defaultValues=updatedValues),!keepStateOptions.keepValues){if(keepStateOptions.keepDirtyValues){const fieldsToCheck=new Set([..._names.mount,...Object.keys(getDirtyFields(_defaultValues,_formValues))]);for(const fieldName of Array.from(fieldsToCheck)){const isDirty=get(_formState.dirtyFields,fieldName),existingValue=get(_formValues,fieldName),newValue=get(values,fieldName);isDirty&&!isUndefined(existingValue)?set$1(values,fieldName,existingValue):!isDirty&&!isUndefined(newValue)&&setValue(fieldName,newValue)}}else{if(isWeb&&isUndefined(formValues))for(const name2 of _names.mount){const field=get(_fields,name2);if(field&&field._f){const fieldReference=Array.isArray(field._f.refs)?field._f.refs[0]:field._f.ref;if(isHTMLElement(fieldReference)){const form=fieldReference.closest("form");if(form){form.reset();break}}}}if(keepStateOptions.keepFieldsRef)for(const fieldName of _names.mount)setValue(fieldName,get(values,fieldName));else _fields={}}_formValues=_options.shouldUnregister?keepStateOptions.keepDefaultValues?cloneObject(_defaultValues):{}:cloneObject(values),_subjects.array.next({values:{...values}}),_subjects.state.next({values:{...values}})}_names={mount:keepStateOptions.keepDirtyValues?_names.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},_state.mount=!_proxyFormState.isValid||!!keepStateOptions.keepIsValid||!!keepStateOptions.keepDirtyValues||!_options.shouldUnregister&&!isEmptyObject(values),_state.watch=!!_options.shouldUnregister,_state.keepIsValid=!!keepStateOptions.keepIsValid,_state.action=!1,keepStateOptions.keepErrors||(_formState.errors={}),_subjects.state.next({submitCount:keepStateOptions.keepSubmitCount?_formState.submitCount:0,isDirty:isEmptyResetValues?!1:keepStateOptions.keepDirty?_formState.isDirty:!!(keepStateOptions.keepDefaultValues&&!deepEqual(formValues,_defaultValues)),isSubmitted:keepStateOptions.keepIsSubmitted?_formState.isSubmitted:!1,dirtyFields:isEmptyResetValues?{}:keepStateOptions.keepDirtyValues?keepStateOptions.keepDefaultValues&&_formValues?getDirtyFields(_defaultValues,_formValues):_formState.dirtyFields:keepStateOptions.keepDefaultValues&&formValues?getDirtyFields(_defaultValues,formValues):keepStateOptions.keepDirty?_formState.dirtyFields:{},touchedFields:keepStateOptions.keepTouched?_formState.touchedFields:{},errors:keepStateOptions.keepErrors?_formState.errors:{},isSubmitSuccessful:keepStateOptions.keepIsSubmitSuccessful?_formState.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:_defaultValues})},"_reset"),reset=__name((formValues,keepStateOptions)=>_reset(isFunction$2(formValues)?formValues(_formValues):formValues,{..._options.resetOptions,...keepStateOptions}),"reset"),setFocus=__name((name2,options={})=>{const field=get(_fields,name2),fieldReference=field&&field._f;if(fieldReference){const fieldRef=fieldReference.refs?fieldReference.refs[0]:fieldReference.ref;fieldRef.focus&&setTimeout(()=>{fieldRef.focus(),options.shouldSelect&&isFunction$2(fieldRef.select)&&fieldRef.select()})}},"setFocus"),_setFormState=__name(updatedFormState=>{_formState={..._formState,...updatedFormState}},"_setFormState"),methods={control:{register,unregister,getFieldState,handleSubmit,setError,_subscribe,_runSchema,_updateIsValidating,_focusError,_getWatch,_getDirty,_setValid,_setFieldArray,_setDisabledField,_setErrors,_getFieldArray,_reset,_resetDefaultValues:__name(()=>isFunction$2(_options.defaultValues)&&_options.defaultValues().then(values=>{reset(values,_options.resetOptions),_subjects.state.next({isLoading:!1})}),"_resetDefaultValues"),_removeUnmounted,_disableForm,_subjects,_proxyFormState,get _fields(){return _fields},get _formValues(){return _formValues},get _state(){return _state},set _state(value){_state=value},get _defaultValues(){return _defaultValues},get _names(){return _names},set _names(value){_names=value},get _formState(){return _formState},get _options(){return _options},set _options(value){_options={..._options,...value}}},subscribe:subscribe2,trigger,register,handleSubmit,watch,setValue,getValues,reset,resetField,clearErrors,unregister,setError,setFocus,getFieldState};return{...methods,formControl:methods}}__name(createFormControl,"createFormControl");var generateId=__name(()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const d=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,c=>{const r2=(Math.random()*16+d)%16|0;return(c=="x"?r2:r2&3|8).toString(16)})},"generateId"),getFocusFieldName=__name((name2,index2,options={})=>options.shouldFocus||isUndefined(options.shouldFocus)?options.focusName||`${name2}.${isUndefined(options.focusIndex)?index2:options.focusIndex}.`:"","getFocusFieldName"),appendAt=__name((data,value)=>[...data,...convertToArrayPayload(value)],"appendAt"),fillEmptyArray=__name(value=>Array.isArray(value)?value.map(()=>{}):void 0,"fillEmptyArray");function insert(data,index2,value){return[...data.slice(0,index2),...convertToArrayPayload(value),...data.slice(index2)]}__name(insert,"insert");var moveArrayAt=__name((data,from,to)=>Array.isArray(data)?(isUndefined(data[to])&&(data[to]=void 0),data.splice(to,0,data.splice(from,1)[0]),data):[],"moveArrayAt"),prependAt=__name((data,value)=>[...convertToArrayPayload(value),...convertToArrayPayload(data)],"prependAt");function removeAtIndexes(data,indexes){let i2=0;const temp=[...data];for(const index2 of indexes)temp.splice(index2-i2,1),i2++;return compact(temp).length?temp:[]}__name(removeAtIndexes,"removeAtIndexes");var removeArrayAt=__name((data,index2)=>isUndefined(index2)?[]:removeAtIndexes(data,convertToArrayPayload(index2).sort((a2,b)=>a2-b)),"removeArrayAt"),swapArrayAt=__name((data,indexA,indexB)=>{[data[indexA],data[indexB]]=[data[indexB],data[indexA]]},"swapArrayAt"),updateAt=__name((fieldValues,index2,value)=>(fieldValues[index2]=value,fieldValues),"updateAt");function useFieldArray(props){const formControl=useFormControlContext(),{control=formControl,name:name2,keyName="id",shouldUnregister,rules}=props,[fields,setFields]=React.useState(control._getFieldArray(name2)),ids=React.useRef(control._getFieldArray(name2).map(generateId)),_actioned=React.useRef(!1);control._names.array.add(name2),React.useMemo(()=>rules&&fields.length>=0&&control.register(name2,rules),[control,name2,fields.length,rules]),useIsomorphicLayoutEffect$1(()=>control._subjects.array.subscribe({next:__name(({values,name:fieldArrayName})=>{if(fieldArrayName===name2||!fieldArrayName){const fieldValues=get(values,name2);Array.isArray(fieldValues)&&(setFields(fieldValues),ids.current=fieldValues.map(generateId))}},"next")}).unsubscribe,[control,name2]);const updateValues=React.useCallback(updatedFieldArrayValues=>{_actioned.current=!0,control._setFieldArray(name2,updatedFieldArrayValues)},[control,name2]),append2=__name((value,options)=>{const appendValue=convertToArrayPayload(cloneObject(value)),updatedFieldArrayValues=appendAt(control._getFieldArray(name2),appendValue);control._names.focus=getFocusFieldName(name2,updatedFieldArrayValues.length-1,options),ids.current=appendAt(ids.current,appendValue.map(generateId)),updateValues(updatedFieldArrayValues),setFields(updatedFieldArrayValues),control._setFieldArray(name2,updatedFieldArrayValues,appendAt,{argA:fillEmptyArray(value)})},"append"),prepend=__name((value,options)=>{const prependValue=convertToArrayPayload(cloneObject(value)),updatedFieldArrayValues=prependAt(control._getFieldArray(name2),prependValue);control._names.focus=getFocusFieldName(name2,0,options),ids.current=prependAt(ids.current,prependValue.map(generateId)),updateValues(updatedFieldArrayValues),setFields(updatedFieldArrayValues),control._setFieldArray(name2,updatedFieldArrayValues,prependAt,{argA:fillEmptyArray(value)})},"prepend"),remove=__name(index2=>{const updatedFieldArrayValues=removeArrayAt(control._getFieldArray(name2),index2);ids.current=removeArrayAt(ids.current,index2),updateValues(updatedFieldArrayValues),setFields(updatedFieldArrayValues),!Array.isArray(get(control._fields,name2))&&set$1(control._fields,name2,void 0),control._setFieldArray(name2,updatedFieldArrayValues,removeArrayAt,{argA:index2})},"remove"),insert$1=__name((index2,value,options)=>{const insertValue=convertToArrayPayload(cloneObject(value)),updatedFieldArrayValues=insert(control._getFieldArray(name2),index2,insertValue);control._names.focus=getFocusFieldName(name2,index2,options),ids.current=insert(ids.current,index2,insertValue.map(generateId)),updateValues(updatedFieldArrayValues),setFields(updatedFieldArrayValues),control._setFieldArray(name2,updatedFieldArrayValues,insert,{argA:index2,argB:fillEmptyArray(value)})},"insert$1"),swap=__name((indexA,indexB)=>{const updatedFieldArrayValues=control._getFieldArray(name2);swapArrayAt(updatedFieldArrayValues,indexA,indexB),swapArrayAt(ids.current,indexA,indexB),updateValues(updatedFieldArrayValues),setFields(updatedFieldArrayValues),control._setFieldArray(name2,updatedFieldArrayValues,swapArrayAt,{argA:indexA,argB:indexB},!1)},"swap"),move=__name((from,to)=>{const updatedFieldArrayValues=control._getFieldArray(name2);moveArrayAt(updatedFieldArrayValues,from,to),moveArrayAt(ids.current,from,to),updateValues(updatedFieldArrayValues),setFields(updatedFieldArrayValues),control._setFieldArray(name2,updatedFieldArrayValues,moveArrayAt,{argA:from,argB:to},!1)},"move"),update=__name((index2,value)=>{const updateValue=cloneObject(value),updatedFieldArrayValues=updateAt(control._getFieldArray(name2),index2,updateValue);ids.current=[...updatedFieldArrayValues].map((item,i2)=>!item||i2===index2?generateId():ids.current[i2]),updateValues(updatedFieldArrayValues),setFields([...updatedFieldArrayValues]),control._setFieldArray(name2,updatedFieldArrayValues,updateAt,{argA:index2,argB:updateValue},!0,!1)},"update"),replace=__name(value=>{const updatedFieldArrayValues=convertToArrayPayload(cloneObject(value));ids.current=updatedFieldArrayValues.map(generateId),updateValues([...updatedFieldArrayValues]),setFields([...updatedFieldArrayValues]),control._setFieldArray(name2,[...updatedFieldArrayValues],data=>data,{},!0,!1)},"replace");return React.useEffect(()=>{if(control._state.action=!1,isWatched(name2,control._names)&&control._subjects.state.next({...control._formState}),_actioned.current&&(!getValidationModes(control._options.mode).isOnSubmit||control._formState.isSubmitted)&&!getValidationModes(control._options.reValidateMode).isOnSubmit)if(control._options.resolver)control._runSchema([name2]).then(result=>{control._updateIsValidating([name2]);const error2=get(result.errors,name2),existingError=get(control._formState.errors,name2);(existingError?!error2&&existingError.type||error2&&(existingError.type!==error2.type||existingError.message!==error2.message):error2&&error2.type)&&(error2?set$1(control._formState.errors,name2,error2):unset(control._formState.errors,name2),control._subjects.state.next({errors:control._formState.errors}))});else{const field=get(control._fields,name2);field&&field._f&&!(getValidationModes(control._options.reValidateMode).isOnSubmit&&getValidationModes(control._options.mode).isOnSubmit)&&validateField(field,control._names.disabled,control._formValues,control._options.criteriaMode===VALIDATION_MODE.all,control._options.shouldUseNativeValidation,!0).then(error2=>!isEmptyObject(error2)&&control._subjects.state.next({errors:updateFieldArrayRootError(control._formState.errors,error2,name2)}))}control._subjects.state.next({name:name2,values:cloneObject(control._formValues)}),control._names.focus&&iterateFieldsByAction(control._fields,(ref,key)=>{if(control._names.focus&&key.startsWith(control._names.focus)&&ref.focus)return ref.focus(),1}),control._names.focus="",control._setValid(),_actioned.current=!1},[fields,name2,control]),React.useEffect(()=>(!get(control._formValues,name2)&&control._setFieldArray(name2),()=>{const updateMounted=__name((name3,value)=>{const field=get(control._fields,name3);field&&field._f&&(field._f.mount=value)},"updateMounted");control._options.shouldUnregister||shouldUnregister?control.unregister(name2):updateMounted(name2,!1)}),[name2,control,keyName,shouldUnregister]),{swap:React.useCallback(swap,[updateValues,name2,control]),move:React.useCallback(move,[updateValues,name2,control]),prepend:React.useCallback(prepend,[updateValues,name2,control]),append:React.useCallback(append2,[updateValues,name2,control]),remove:React.useCallback(remove,[updateValues,name2,control]),insert:React.useCallback(insert$1,[updateValues,name2,control]),update:React.useCallback(update,[updateValues,name2,control]),replace:React.useCallback(replace,[updateValues,name2,control]),fields:React.useMemo(()=>fields.map((field,index2)=>({...field,[keyName]:ids.current[index2]||generateId()})),[fields,keyName])}}__name(useFieldArray,"useFieldArray");function useForm(props={}){const _formControl=React.useRef(void 0),_values=React.useRef(void 0),[formState,updateFormState]=React.useState({isDirty:!1,isValidating:!1,isLoading:isFunction$2(props.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:props.errors||{},disabled:props.disabled||!1,isReady:!1,defaultValues:isFunction$2(props.defaultValues)?void 0:props.defaultValues});if(!_formControl.current)if(props.formControl)_formControl.current={...props.formControl,formState},props.defaultValues&&!isFunction$2(props.defaultValues)&&props.formControl.reset(props.defaultValues,props.resetOptions);else{const{formControl,...rest}=createFormControl(props);_formControl.current={...rest,formState}}const control=_formControl.current.control;return control._options=props,useIsomorphicLayoutEffect$1(()=>{const sub=control._subscribe({formState:control._proxyFormState,callback:__name(()=>updateFormState({...control._formState}),"callback"),reRenderRoot:!0});return updateFormState(data=>({...data,isReady:!0})),control._formState.isReady=!0,sub},[control]),React.useEffect(()=>control._disableForm(props.disabled),[control,props.disabled]),React.useEffect(()=>{props.mode&&(control._options.mode=props.mode),props.reValidateMode&&(control._options.reValidateMode=props.reValidateMode)},[control,props.mode,props.reValidateMode]),React.useEffect(()=>{props.errors&&(control._setErrors(props.errors),control._focusError())},[control,props.errors]),React.useEffect(()=>{props.shouldUnregister&&control._subjects.state.next({values:control._getWatch()})},[control,props.shouldUnregister]),React.useEffect(()=>{if(control._proxyFormState.isDirty){const isDirty=control._getDirty();isDirty!==formState.isDirty&&control._subjects.state.next({isDirty})}},[control,formState.isDirty]),React.useEffect(()=>{var _a20;props.values&&!deepEqual(props.values,_values.current)?(control._reset(props.values,{keepFieldsRef:!0,...control._options.resetOptions}),!((_a20=control._options.resetOptions)===null||_a20===void 0)&&_a20.keepIsValid||control._setValid(),_values.current=props.values,updateFormState(state2=>({...state2}))):control._resetDefaultValues()},[control,props.values]),React.useEffect(()=>{control._state.mount||(control._setValid(),control._state.mount=!0),control._state.watch&&(control._state.watch=!1,control._subjects.state.next({...control._formState})),control._removeUnmounted()}),_formControl.current.formState=React.useMemo(()=>getProxyFormState(formState,control),[control,formState]),_formControl.current}__name(useForm,"useForm");const Form=FormProvider,FormFieldContext=reactExports.createContext({}),FormItemContext=reactExports.createContext({});function useFormField(){const fieldContext=reactExports.useContext(FormFieldContext),itemContext=reactExports.useContext(FormItemContext),{getFieldState}=useFormContext(),formState=useFormState({name:fieldContext.name}),fieldState=getFieldState(fieldContext.name,formState);if(!fieldContext)throw new Error("useFormField should be used within <FormField>");const{id:id2}=itemContext;return{id:id2,name:fieldContext.name,formItemId:`${id2}-form-item`,formDescriptionId:`${id2}-form-item-description`,formMessageId:`${id2}-form-item-message`,...fieldState}}__name(useFormField,"useFormField");function FormControl({...props}){const{error:error2,formItemId,formDescriptionId,formMessageId}=useFormField();return jsxRuntimeExports.jsx(Slot$3,{"data-slot":"form-control",id:formItemId,"aria-describedby":error2?`${formDescriptionId} ${formMessageId}`:`${formDescriptionId}`,"aria-invalid":!!error2,...props})}__name(FormControl,"FormControl");function FormField({...props}){return jsxRuntimeExports.jsx(FormFieldContext,{value:{name:props.name},children:jsxRuntimeExports.jsx(Controller,{...props})})}__name(FormField,"FormField");function FormItem({className,...props}){const id2=reactExports.useId();return jsxRuntimeExports.jsx(FormItemContext,{value:{id:id2},children:jsxRuntimeExports.jsx("div",{"data-slot":"form-item",className:cn$1("grid gap-2",className),...props})})}__name(FormItem,"FormItem");var NODES=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive=NODES.reduce((primitive,node2)=>{const Slot2=createSlot$1(`Primitive.${node2}`),Node2=reactExports.forwardRef((props,forwardedRef)=>{const{asChild,...primitiveProps}=props,Comp=asChild?Slot2:node2;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(Comp,{...primitiveProps,ref:forwardedRef})});return Node2.displayName=`Primitive.${node2}`,{...primitive,[node2]:Node2}},{}),NAME$2="Label",Label$3=reactExports.forwardRef((props,forwardedRef)=>jsxRuntimeExports.jsx(Primitive.label,{...props,ref:forwardedRef,onMouseDown:__name(event=>{event.target.closest("button, input, select, textarea")||(props.onMouseDown?.(event),!event.defaultPrevented&&event.detail>1&&event.preventDefault())},"onMouseDown")}));Label$3.displayName=NAME$2;var Root$6=Label$3;function Label$2({className,...props}){return jsxRuntimeExports.jsx(Root$6,{"data-slot":"label",className:cn$1("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",className),...props})}__name(Label$2,"Label$2");function FormLabel({className,...props}){const{error:error2,formItemId}=useFormField();return jsxRuntimeExports.jsx(Label$2,{"data-slot":"form-label","data-error":!!error2,className:cn$1("data-[error=true]:text-destructive",className),htmlFor:formItemId,...props})}__name(FormLabel,"FormLabel");function FormMessage({className,...props}){const{error:error2,formMessageId}=useFormField(),body=error2?String(error2?.message):props.children;return body?jsxRuntimeExports.jsx("p",{"data-slot":"form-message",id:formMessageId,className:cn$1("text-destructive text-sm",className),...props,children:body}):null}__name(FormMessage,"FormMessage");function Input({className,type,...props}){return jsxRuntimeExports.jsx("input",{type,"data-slot":"input",className:cn$1(`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
|
|
@@ -141,7 +141,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
141
141
|
monaco.config({ paths: { vs: '...' } })
|
|
142
142
|
|
|
143
143
|
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
144
|
-
`},errorHandler=curry(throwError)(errorMessages),validators={config:validateConfig},compose=__name(function(){for(var _len=arguments.length,fns=new Array(_len),_key=0;_key<_len;_key++)fns[_key]=arguments[_key];return function(x){return fns.reduceRight(function(y,f){return f(y)},x)}},"compose");function merge$1(target,source){return Object.keys(source).forEach(function(key){source[key]instanceof Object&&target[key]&&Object.assign(source[key],merge$1(target[key],source[key]))}),_objectSpread2$1(_objectSpread2$1({},target),source)}__name(merge$1,"merge$1");var CANCELATION_MESSAGE={type:"cancelation",msg:"operation is manually canceled"};function makeCancelable(promise2){var hasCanceled_=!1,wrappedPromise=new Promise(function(resolve,reject){promise2.then(function(val){return hasCanceled_?reject(CANCELATION_MESSAGE):resolve(val)}),promise2.catch(reject)});return wrappedPromise.cancel=function(){return hasCanceled_=!0},wrappedPromise}__name(makeCancelable,"makeCancelable");var _state$create=index$1.create({config:config$1,isInitialized:!1,resolve:null,reject:null,monaco:null}),_state$create2=_slicedToArray$2(_state$create,2),getState$2=_state$create2[0],setState=_state$create2[1];function config(globalConfig2){var _validators$config=validators.config(globalConfig2),monaco=_validators$config.monaco,config2=_objectWithoutProperties$1(_validators$config,["monaco"]);setState(function(state2){return{config:merge$1(state2.config,config2),monaco}})}__name(config,"config");function init(){var state2=getState$2(function(_ref){var monaco=_ref.monaco,isInitialized=_ref.isInitialized,resolve=_ref.resolve;return{monaco,isInitialized,resolve}});if(!state2.isInitialized){if(setState({isInitialized:!0}),state2.monaco)return state2.resolve(state2.monaco),makeCancelable(wrapperPromise);if(window.monaco&&window.monaco.editor)return storeMonacoInstance(window.monaco),state2.resolve(window.monaco),makeCancelable(wrapperPromise);compose(injectScripts,getMonacoLoaderScript)(configureLoader)}return makeCancelable(wrapperPromise)}__name(init,"init");function injectScripts(script){return document.body.appendChild(script)}__name(injectScripts,"injectScripts");function createScript(src){var script=document.createElement("script");return src&&(script.src=src),script}__name(createScript,"createScript");function getMonacoLoaderScript(configureLoader2){var state2=getState$2(function(_ref2){var config2=_ref2.config,reject=_ref2.reject;return{config:config2,reject}}),loaderScript=createScript("".concat(state2.config.paths.vs,"/loader.js"));return loaderScript.onload=function(){return configureLoader2()},loaderScript.onerror=state2.reject,loaderScript}__name(getMonacoLoaderScript,"getMonacoLoaderScript");function configureLoader(){var state2=getState$2(function(_ref3){var config2=_ref3.config,resolve=_ref3.resolve,reject=_ref3.reject;return{config:config2,resolve,reject}}),require2=window.require;require2.config(state2.config),require2(["vs/editor/editor.main"],function(monaco){storeMonacoInstance(monaco),state2.resolve(monaco)},function(error2){state2.reject(error2)})}__name(configureLoader,"configureLoader");function storeMonacoInstance(monaco){getState$2().monaco||setState({monaco})}__name(storeMonacoInstance,"storeMonacoInstance");function __getMonacoInstance(){return getState$2(function(_ref4){var monaco=_ref4.monaco;return monaco})}__name(__getMonacoInstance,"__getMonacoInstance");var wrapperPromise=new Promise(function(resolve,reject){return setState({resolve,reject})}),loader={config,init,__getMonacoInstance},le={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},v=le,ae={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Y=ae;function Me({children:e}){return React.createElement("div",{style:Y.container},e)}__name(Me,"Me");var Z=Me,$=Z;function Ee({width:e,height:r2,isEditorReady:n2,loading:t2,_ref:a2,className:m,wrapperProps:E}){return React.createElement("section",{style:{...v.wrapper,width:e,height:r2},...E},!n2&&React.createElement($,null,t2),React.createElement("div",{ref:a2,style:{...v.fullWidth,...!n2&&v.hide},className:m}))}__name(Ee,"Ee");var ee=Ee,H=reactExports.memo(ee);function Ce(e){reactExports.useEffect(e,[])}__name(Ce,"Ce");var k=Ce;function he(e,r2,n2=!0){let t2=reactExports.useRef(!0);reactExports.useEffect(t2.current||!n2?()=>{t2.current=!1}:e,r2)}__name(he,"he");var l=he;function D(){}__name(D,"D");function h(e,r2,n2,t2){return De(e,t2)||be(e,r2,n2,t2)}__name(h,"h");function De(e,r2){return e.editor.getModel(te(e,r2))}__name(De,"De");function be(e,r2,n2,t2){return e.editor.createModel(r2,n2,t2?te(e,t2):void 0)}__name(be,"be");function te(e,r2){return e.Uri.parse(r2)}__name(te,"te");function Oe({original:e,modified:r2,language:n2,originalLanguage:t2,modifiedLanguage:a2,originalModelPath:m,modifiedModelPath:E,keepCurrentOriginalModel:g=!1,keepCurrentModifiedModel:N=!1,theme:x="light",loading:P="Loading...",options:y={},height:V="100%",width:z2="100%",className:F,wrapperProps:j={},beforeMount:A=D,onMount:q2=D}){let[M,O]=reactExports.useState(!1),[T,s2]=reactExports.useState(!0),u=reactExports.useRef(null),c=reactExports.useRef(null),w=reactExports.useRef(null),d=reactExports.useRef(q2),o2=reactExports.useRef(A),b=reactExports.useRef(!1);k(()=>{let i2=loader.init();return i2.then(f=>(c.current=f)&&s2(!1)).catch(f=>f?.type!=="cancelation"&&console.error("Monaco initialization: error:",f)),()=>u.current?I():i2.cancel()}),l(()=>{if(u.current&&c.current){let i2=u.current.getOriginalEditor(),f=h(c.current,e||"",t2||n2||"text",m||"");f!==i2.getModel()&&i2.setModel(f)}},[m],M),l(()=>{if(u.current&&c.current){let i2=u.current.getModifiedEditor(),f=h(c.current,r2||"",a2||n2||"text",E||"");f!==i2.getModel()&&i2.setModel(f)}},[E],M),l(()=>{let i2=u.current.getModifiedEditor();i2.getOption(c.current.editor.EditorOption.readOnly)?i2.setValue(r2||""):r2!==i2.getValue()&&(i2.executeEdits("",[{range:i2.getModel().getFullModelRange(),text:r2||"",forceMoveMarkers:!0}]),i2.pushUndoStop())},[r2],M),l(()=>{u.current?.getModel()?.original.setValue(e||"")},[e],M),l(()=>{let{original:i2,modified:f}=u.current.getModel();c.current.editor.setModelLanguage(i2,t2||n2||"text"),c.current.editor.setModelLanguage(f,a2||n2||"text")},[n2,t2,a2],M),l(()=>{c.current?.editor.setTheme(x)},[x],M),l(()=>{u.current?.updateOptions(y)},[y],M);let L=reactExports.useCallback(()=>{if(!c.current)return;o2.current(c.current);let i2=h(c.current,e||"",t2||n2||"text",m||""),f=h(c.current,r2||"",a2||n2||"text",E||"");u.current?.setModel({original:i2,modified:f})},[n2,r2,a2,e,t2,m,E]),U=reactExports.useCallback(()=>{!b.current&&w.current&&(u.current=c.current.editor.createDiffEditor(w.current,{automaticLayout:!0,...y}),L(),c.current?.editor.setTheme(x),O(!0),b.current=!0)},[y,x,L]);reactExports.useEffect(()=>{M&&d.current(u.current,c.current)},[M]),reactExports.useEffect(()=>{!T&&!M&&U()},[T,M,U]);function I(){let i2=u.current?.getModel();g||i2?.original?.dispose(),N||i2?.modified?.dispose(),u.current?.dispose()}return __name(I,"I"),React.createElement(H,{width:z2,height:V,isEditorReady:M,loading:P,_ref:w,className:F,wrapperProps:j})}__name(Oe,"Oe");var ie=Oe;reactExports.memo(ie);function He(e){let r2=reactExports.useRef();return reactExports.useEffect(()=>{r2.current=e},[e]),r2.current}__name(He,"He");var se=He,_=new Map;function Ve({defaultValue:e,defaultLanguage:r2,defaultPath:n2,value:t2,language:a2,path:m,theme:E="light",line:g,loading:N="Loading...",options:x={},overrideServices:P={},saveViewState:y=!0,keepCurrentModel:V=!1,width:z2="100%",height:F="100%",className:j,wrapperProps:A={},beforeMount:q2=D,onMount:M=D,onChange:O,onValidate:T=D}){let[s2,u]=reactExports.useState(!1),[c,w]=reactExports.useState(!0),d=reactExports.useRef(null),o2=reactExports.useRef(null),b=reactExports.useRef(null),L=reactExports.useRef(M),U=reactExports.useRef(q2),I=reactExports.useRef(),i2=reactExports.useRef(t2),f=se(m),Q=reactExports.useRef(!1),B=reactExports.useRef(!1);k(()=>{let p=loader.init();return p.then(R=>(d.current=R)&&w(!1)).catch(R=>R?.type!=="cancelation"&&console.error("Monaco initialization: error:",R)),()=>o2.current?pe():p.cancel()}),l(()=>{let p=h(d.current,e||t2||"",r2||a2||"",m||n2||"");p!==o2.current?.getModel()&&(y&&_.set(f,o2.current?.saveViewState()),o2.current?.setModel(p),y&&o2.current?.restoreViewState(_.get(m)))},[m],s2),l(()=>{o2.current?.updateOptions(x)},[x],s2),l(()=>{!o2.current||t2===void 0||(o2.current.getOption(d.current.editor.EditorOption.readOnly)?o2.current.setValue(t2):t2!==o2.current.getValue()&&(B.current=!0,o2.current.executeEdits("",[{range:o2.current.getModel().getFullModelRange(),text:t2,forceMoveMarkers:!0}]),o2.current.pushUndoStop(),B.current=!1))},[t2],s2),l(()=>{let p=o2.current?.getModel();p&&a2&&d.current?.editor.setModelLanguage(p,a2)},[a2],s2),l(()=>{g!==void 0&&o2.current?.revealLine(g)},[g],s2),l(()=>{d.current?.editor.setTheme(E)},[E],s2);let X2=reactExports.useCallback(()=>{if(!(!b.current||!d.current)&&!Q.current){U.current(d.current);let p=m||n2,R=h(d.current,t2||e||"",r2||a2||"",p||"");o2.current=d.current?.editor.create(b.current,{model:R,automaticLayout:!0,...x},P),y&&o2.current.restoreViewState(_.get(p)),d.current.editor.setTheme(E),g!==void 0&&o2.current.revealLine(g),u(!0),Q.current=!0}},[e,r2,n2,t2,a2,m,x,P,y,E,g]);reactExports.useEffect(()=>{s2&&L.current(o2.current,d.current)},[s2]),reactExports.useEffect(()=>{!c&&!s2&&X2()},[c,s2,X2]),i2.current=t2,reactExports.useEffect(()=>{s2&&O&&(I.current?.dispose(),I.current=o2.current?.onDidChangeModelContent(p=>{B.current||O(o2.current.getValue(),p)}))},[s2,O]),reactExports.useEffect(()=>{if(s2){let p=d.current.editor.onDidChangeMarkers(R=>{let G=o2.current.getModel()?.uri;if(G&&R.find(J=>J.path===G.path)){let J=d.current.editor.getModelMarkers({resource:G});T?.(J)}});return()=>{p?.dispose()}}return()=>{}},[s2,T]);function pe(){I.current?.dispose(),V?y&&_.set(m,o2.current.saveViewState()):o2.current.getModel()?.dispose(),o2.current.dispose()}return __name(pe,"pe"),React.createElement(H,{width:z2,height:F,isEditorReady:s2,loading:N,_ref:b,className:j,wrapperProps:A})}__name(Ve,"Ve");var fe=Ve,de=reactExports.memo(fe),Ft=de;const defaultPermissions={roles:{create:!0,view:!0,update:!0,delete:!0},clusters:{create:!0,view:!0,update:!0,delete:!0,resources:[]}};function AddOrganizationRoleModal({isModalOpen,setIsModalOpen}){const queryClient2=useQueryClient(),{organizationId}=useParams({strict:!1}),[isValidJSON,setIsValidJSON]=reactExports.useState(!0),[updatedPermissions,setUpdatedPermissions]=reactExports.useState(JSON.stringify(defaultPermissions,null,2)),{mutate:addOrganizationRole,isPending}=useAddOrganizationRole(),form=useForm({resolver:a(OrganizationRoleOverviewSchema),defaultValues:{name:"",update:!1,delete:!1}}),onValidate=reactExports.useCallback(markers=>{setIsValidJSON(markers.length===0)},[setIsValidJSON]),onSubmitRoleEdits=reactExports.useCallback(async formData=>{const parsedPermissions=safeParse(updatedPermissions);if(!parsedPermissions)return;const updatedFormData={...formData,...parsedPermissions,organizationId};formData&&isValidJSON&&addOrganizationRole(updatedFormData,{onSuccess:__name(()=>{toast.success("Organization role added successfully!"),setIsModalOpen(!1),queryClient2.invalidateQueries({queryKey:[organizationId,"roles"],refetchType:"active"}),form.reset()},"onSuccess"),onError:__name(error2=>{toast.error(`Failed to add organization role: ${error2.message}`)},"onError")})},[isValidJSON,updatedPermissions,addOrganizationRole,form,queryClient2,setIsModalOpen,organizationId]);return jsxRuntimeExports.jsx(Dialog,{onOpenChange:setIsModalOpen,open:isModalOpen,children:jsxRuntimeExports.jsxs(DialogContent,{children:[jsxRuntimeExports.jsx(DialogTitle,{children:"Add New Organization Role"}),jsxRuntimeExports.jsx(DialogDescription,{children:"Set the new organization role permissions."}),jsxRuntimeExports.jsx(Form,{...form,children:jsxRuntimeExports.jsxs("form",{id:"org-add-role-form",name:"org-add-role-form",className:"grid grid-cols-2 gap-4 my-4",onSubmit:form.handleSubmit(onSubmitRoleEdits),children:[jsxRuntimeExports.jsx(FormField,{control:form.control,name:"name",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{className:"col-span-2",children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"Role Name"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"text",className:"",...field})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(FormField,{control:form.control,name:"update",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"Can Update Organization"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"checkbox",className:"w-6 ml-2",checked:field.value,onChange:__name(e=>field.onChange(e.target.checked),"onChange")})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(FormField,{control:form.control,name:"delete",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"Can Delete Organization"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"checkbox",className:"w-6 ml-2",checked:field.value,onChange:__name(e=>field.onChange(e.target.checked),"onChange")})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx("div",{className:"col-span-2",children:jsxRuntimeExports.jsx(de,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate,onChange:__name(value=>{value&&setUpdatedPermissions(value)},"onChange"),defaultValue:JSON.stringify(defaultPermissions,null,2)})}),jsxRuntimeExports.jsx(DialogFooter,{className:"col-span-2",children:jsxRuntimeExports.jsxs("div",{className:"flex justify-between w-full",children:[jsxRuntimeExports.jsx(Button,{variant:"destructiveOutline",className:"rounded-full",type:"button",onClick:__name(()=>setIsModalOpen(!1),"onClick"),disabled:isPending,children:"Cancel"}),jsxRuntimeExports.jsx(Button,{variant:"submit",className:"rounded-full",disabled:isPending||!isValidJSON||!form.formState.isValid,children:"Save Changes"})]})})]})})]})})}__name(AddOrganizationRoleModal,"AddOrganizationRoleModal");async function onDeleteOrganizationRole({roleId}){const{data}=await apiClient.delete(`/Role/${roleId}`,{id:roleId,deleted:!0});return data}__name(onDeleteOrganizationRole,"onDeleteOrganizationRole");function useDeleteOrganizationRole(){return useMutation({mutationFn:__name(({roleId})=>onDeleteOrganizationRole({roleId}),"mutationFn")})}__name(useDeleteOrganizationRole,"useDeleteOrganizationRole");async function onUpdateOrganizationRole({roleId,updatedRoleInfo}){const{data}=await apiClient.put(`/Role/${roleId}`,updatedRoleInfo);return data}__name(onUpdateOrganizationRole,"onUpdateOrganizationRole");function useUpdateOrganizationRole(){return useMutation({mutationFn:__name(({roleId,updatedRoleInfo})=>onUpdateOrganizationRole({roleId,updatedRoleInfo}),"mutationFn")})}__name(useUpdateOrganizationRole,"useUpdateOrganizationRole");function getOrganizationRoleInfoQueryOptions({organizationId,roleId}){return{queryKey:[organizationId,"roles",roleId],queryFn:__name(()=>getOrganizationRoleInfo(roleId),"queryFn"),refetchInterval:10*1e3}}__name(getOrganizationRoleInfoQueryOptions,"getOrganizationRoleInfoQueryOptions");async function getOrganizationRoleInfo(roleId){const{data}=await apiClient.get(`/Role/${roleId}`);return data}__name(getOrganizationRoleInfo,"getOrganizationRoleInfo");function ConfirmDeletionContent({onRoleDeleteClick,setIsConfirmingRoleDeletion,isRoleDeletionPending}){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(DialogTitle,{children:"Confirm Role Deletion"}),jsxRuntimeExports.jsx(DialogDescription,{children:"Are you sure you want to delete this role? This action cannot be undone."}),jsxRuntimeExports.jsxs(DialogFooter,{children:[jsxRuntimeExports.jsx(Button,{type:"button",variant:"defaultOutline",className:"rounded-full",onClick:__name(()=>setIsConfirmingRoleDeletion(!1),"onClick"),children:"Cancel"}),jsxRuntimeExports.jsx(Button,{variant:"destructiveOutline",className:"rounded-full",onClick:onRoleDeleteClick,disabled:isRoleDeletionPending,children:isRoleDeletionPending?"Deleting...":"Delete Role"})]})]})}__name(ConfirmDeletionContent,"ConfirmDeletionContent");function EditOrganizationRoleModal({data,isModalOpen,closeModal}){const queryClient2=useQueryClient(),{data:roleInfo}=useSuspenseQuery(getOrganizationRoleInfoQueryOptions({roleId:data.id,organizationId:data.organizationId})),auth=useCloudAuth(),isSelf=auth.user&&auth.user?.roles?.[data.organizationId]?.role===data.roleName,{update,remove}=useOrganizationRolePermissions(data.organizationId),{mutate:updateOrganizationRole,isPending:isRoleUpdatePending}=useUpdateOrganizationRole(),{mutate:deleteOrganizationRole,isPending:isRoleDeletionPending}=useDeleteOrganizationRole(),[isConfirmingRoleDeletion,setIsConfirmingRoleDeletion]=reactExports.useState(!1),form=useForm({resolver:a(OrganizationRoleOverviewSchema),defaultValues:{name:data.roleName,update:roleInfo.organization.update||!1,delete:roleInfo.organization.delete||!1}}),onRoleDeleteClick=reactExports.useCallback(()=>{deleteOrganizationRole({roleId:data.id},{onSuccess:__name(()=>{toast.success("Role deleted successfully!"),closeModal(!0),form.reset()},"onSuccess"),onError:__name(error2=>{toast.error("Error",{description:`Failed to delete role: ${error2 instanceof Error?error2.message:String(error2)}.`,action:{label:"Dismiss",onClick:__name(()=>toast.dismiss(),"onClick")}})},"onError")})},[data.id,deleteOrganizationRole,form,closeModal]),[isValidJSON,setIsValidJSON]=reactExports.useState(!0),[updatedPermissions,setUpdatedPermissions]=reactExports.useState(JSON.stringify({roles:{...roleInfo.organization.roles},clusters:{...roleInfo.organization.clusters}},null,2)),onValidate=reactExports.useCallback(markers=>{setIsValidJSON(markers.length===0)},[setIsValidJSON]),onSubmitRoleEdits=reactExports.useCallback(async formData=>{if(!update)return;const parsedPermissions=safeParse(updatedPermissions);if(!parsedPermissions)return;const updatedFormData={...formData,...parsedPermissions,organizationId:data.organizationId};updatedPermissions&&isValidJSON&&updateOrganizationRole({roleId:data.id,updatedRoleInfo:updatedFormData},{onSuccess:__name(async()=>{toast.success("Role updated successfully!"),await queryClient2.invalidateQueries({queryKey:[data.organizationId,"roles",data.id]}),closeModal(!1),form.reset()},"onSuccess"),onError:__name(error2=>{toast.error("Error",{description:`Failed to update role: ${error2 instanceof Error?error2.message:String(error2)}.`,action:{label:"Dismiss",onClick:__name(()=>toast.dismiss(),"onClick")}})},"onError")})},[closeModal,data.id,data.organizationId,form,isValidJSON,queryClient2,roleInfo,update,updatedPermissions,updateOrganizationRole]),onOpenChanges=reactExports.useCallback(()=>closeModal(!1),[closeModal]);return jsxRuntimeExports.jsx(Dialog,{onOpenChange:onOpenChanges,open:isModalOpen,children:jsxRuntimeExports.jsx(DialogContent,{children:isConfirmingRoleDeletion?jsxRuntimeExports.jsx(ConfirmDeletionContent,{onRoleDeleteClick,setIsConfirmingRoleDeletion,isRoleDeletionPending}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(DialogTitle,{children:[isSelf||!update?"View":"Edit",' Organization Role "',data.roleName,'"']}),jsxRuntimeExports.jsx(Form,{...form,children:jsxRuntimeExports.jsxs("form",{id:"org-edit-role-form",name:"org-edit-role-form",className:"grid grid-cols-2 gap-4 my-4",onSubmit:form.handleSubmit(onSubmitRoleEdits),children:[jsxRuntimeExports.jsx(FormField,{control:form.control,name:"name",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{className:"col-span-2",children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"Role Name"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"text",className:"",...field,disabled:!0,readOnly:!0})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(FormField,{control:form.control,name:"update",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"Can Update Organization"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"checkbox",className:"w-6 ml-2",disabled:isSelf||!update,readOnly:isSelf||!update,checked:field.value,onChange:__name(e=>field.onChange(e.target.checked),"onChange")})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(FormField,{control:form.control,name:"delete",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"Can Delete Organization"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"checkbox",className:"w-6 ml-2",disabled:isSelf||!update,readOnly:isSelf||!update,checked:field.value,onChange:__name(e=>field.onChange(e.target.checked),"onChange")})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx("div",{className:"col-span-2",children:jsxRuntimeExports.jsx(de,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate,onChange:__name(value=>{value&&setUpdatedPermissions(value)},"onChange"),options:isSelf||!update?{readOnly:!0}:void 0,defaultValue:updatedPermissions})}),!isSelf&&(remove||update)&&jsxRuntimeExports.jsx(DialogFooter,{className:"col-span-2",children:jsxRuntimeExports.jsxs("div",{className:"flex justify-between w-full",children:[remove&&jsxRuntimeExports.jsx(Button,{type:"button",variant:"destructiveOutline",className:"rounded-full",onClick:__name(()=>setIsConfirmingRoleDeletion(!0),"onClick"),disabled:isRoleUpdatePending,children:"Delete Role"}),update&&jsxRuntimeExports.jsx(Button,{variant:"submit",className:"rounded-full",disabled:!isValidJSON||isRoleUpdatePending||!form.formState.isValid||!form.formState.isDirty,children:"Save Changes"})]})})]})})]})})})}__name(EditOrganizationRoleModal,"EditOrganizationRoleModal");function OrgConfigRolesIndex(){const navigate=useNavigate(),queryClient2=useQueryClient(),{organizationId,orgRoleId}=useParams({strict:!1}),{create:create2}=useOrganizationRolePermissions(organizationId),{data:orgRoles,refetch,isFetching,isRefetching}=useSuspenseQuery(getOrganizationRolesQueryOptions(organizationId)),selectedOrgRole=reactExports.useMemo(()=>orgRoles&&orgRoles?.find(role=>role.id===orgRoleId),[orgRoles,orgRoleId]),isEditOrgRoleModalOpen=!!orgRoleId&&!!selectedOrgRole,[isAddModalOpen,setIsAddModalOpen]=reactExports.useState(!1),onSelectOrgRole=reactExports.useCallback(async(newOrgRole,madeChanges)=>{const parts=[orgRoleId?"..":"",newOrgRole].filter(Boolean);await navigate({to:parts.join("/")}),madeChanges&&await queryClient2.invalidateQueries({queryKey:[organizationId,"roles"],refetchType:"active"})},[orgRoleId,navigate,queryClient2]),onAddClicked=reactExports.useCallback(()=>{setIsAddModalOpen(!0)},[setIsAddModalOpen]),onRowClick=reactExports.useCallback(rowData=>onSelectOrgRole(rowData.original.id,!1),[onSelectOrgRole]),closeEditModal=reactExports.useCallback(madeChanges=>onSelectOrgRole(void 0,madeChanges),[onSelectOrgRole]),onRefreshClick=useRefreshClick(refetch);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SubNavMenu,{}),jsxRuntimeExports.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-(--spacing(32)))]",children:jsxRuntimeExports.jsxs(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(Loading,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[jsxRuntimeExports.jsxs(SimpleBrowseDataTable,{data:orgRoles,columns:dataTableColumns$5,onRowClick,children:[jsxRuntimeExports.jsxs(Button,{variant:"defaultOutline",onClick:onRefreshClick,accessKey:"r",disabled:isFetching||isRefetching,children:[jsxRuntimeExports.jsx(RefreshCw,{}),jsxRuntimeExports.jsxs("span",{className:"hidden lg:inline-block",children:[jsxRuntimeExports.jsx("u",{children:"R"}),"efresh"]})]}),create2&&jsxRuntimeExports.jsxs(Button,{variant:"positiveOutline",onClick:onAddClicked,accessKey:"a",disabled:isAddModalOpen,children:[jsxRuntimeExports.jsx(Plus,{}),jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsx("u",{children:"A"}),"dd"]})]})]}),create2&&jsxRuntimeExports.jsx(AddOrganizationRoleModal,{isModalOpen:isAddModalOpen,setIsModalOpen:setIsAddModalOpen}),isEditOrgRoleModalOpen&&jsxRuntimeExports.jsx(EditOrganizationRoleModal,{data:selectedOrgRole,isModalOpen:isEditOrgRoleModalOpen,closeModal:closeEditModal})]})})]})}__name(OrgConfigRolesIndex,"OrgConfigRolesIndex");const columnHelper$4=createColumnHelper(),dataTableColumns$4=[{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},columnHelper$4.display({header:"Roles",enableSorting:!1,id:"roles",cell:__name(props=>props.row.original.roles?.map(r2=>r2.roleName)?.sort()?.join(", "),"cell")}),{header:"Status",accessorKey:"status",enableSorting:!1},{header:"Verified",accessorKey:"isVerified",enableSorting:!1}],AddOrganizationRoleSchema=z.object({email:zodRequireEmail.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:z.string().nonempty({error:"Please select a role."})});async function onAddUserToOrganizationRoleSubmit(formData){const{data}=await apiClient.post("/OrganizationRole/",formData);return data}__name(onAddUserToOrganizationRoleSubmit,"onAddUserToOrganizationRoleSubmit");function useAddUserToOrganizationRole(){return useMutation({mutationFn:__name(formData=>onAddUserToOrganizationRoleSubmit(formData),"mutationFn")})}__name(useAddUserToOrganizationRole,"useAddUserToOrganizationRole");z.object({email:zodRequireEmail.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:z.string().nonempty({error:"Please select a role."})});async function onInviteUserToOrganizationRoleSubmit(formData){const{data}=await apiClient.post("/UserInvite/",formData);return data}__name(onInviteUserToOrganizationRoleSubmit,"onInviteUserToOrganizationRoleSubmit");function useInviteUserToOrganizationRole(){return useMutation({mutationFn:__name(formData=>onInviteUserToOrganizationRoleSubmit(formData),"mutationFn")})}__name(useInviteUserToOrganizationRole,"useInviteUserToOrganizationRole");function AddUserModal$1({isModalOpen,onChangesSaved,setIsModalOpen}){const{organizationId}=useParams({strict:!1}),{data:orgRoles}=useSuspenseQuery(getOrganizationRolesQueryOptions(organizationId)),[shouldInvite,setShouldInvite]=reactExports.useState(!1),form=useForm({resolver:a(AddOrganizationRoleSchema),defaultValues:{email:"",roleId:""}}),{mutate:addUser,isPending:isAddPending}=useAddUserToOrganizationRole(),{mutate:inviteUser,isPending:isInvitePending}=useInviteUserToOrganizationRole(),onSubmitClick=reactExports.useCallback(async formData=>{formData&&(shouldInvite?inviteUser:addUser)(formData,{onSuccess:__name(()=>{const lastRole=formData.roleId;form.reset(),form.setValue("roleId",lastRole),onChangesSaved(),toast.success("User invited successfully!"),setIsModalOpen(!1),setShouldInvite(!1)},"onSuccess"),onError:__name(error2=>{error2?.status===404&&setShouldInvite(!0)},"onError")})},[addUser,form,inviteUser,onChangesSaved,setIsModalOpen,shouldInvite]);return jsxRuntimeExports.jsx(Dialog,{onOpenChange:__name(()=>{setIsModalOpen(!1),setShouldInvite(!1),form.reset()},"onOpenChange"),open:isModalOpen,children:jsxRuntimeExports.jsx(DialogContent,{"aria-describedby":void 0,children:jsxRuntimeExports.jsx(Form,{...form,children:jsxRuntimeExports.jsxs("form",{id:"org-add-user-form",name:"org-add-user-form",onSubmit:form.handleSubmit(onSubmitClick),className:"grid gap-4 my-4",children:[jsxRuntimeExports.jsx(DialogHeader,{children:jsxRuntimeExports.jsx(DialogTitle,{children:shouldInvite?"Invite User":"Add User"})}),jsxRuntimeExports.jsx(FormField,{control:form.control,name:"email",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"Email"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"email",enterKeyHint:"next",autoComplete:"email",...field})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(FormField,{control:form.control,name:"roleId",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"Roles"}),jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(TextLoadingSkeleton,{}),children:jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsxs(Select,{...field,onValueChange:__name(role=>field.onChange(role),"onValueChange"),children:[jsxRuntimeExports.jsx(SelectTrigger,{className:"w-full",children:jsxRuntimeExports.jsx(SelectValue,{placeholder:"Choose Role"})}),jsxRuntimeExports.jsx(SelectContent,{children:jsxRuntimeExports.jsxs(SelectGroup,{children:[jsxRuntimeExports.jsx(SelectLabel,{children:"Role"}),orgRoles?.map(role=>jsxRuntimeExports.jsx(SelectItem,{value:role.id,children:role.roleName},role.id))]})})]})})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),shouldInvite&&jsxRuntimeExports.jsxs(DialogDescription,{className:"p-3 my-5 text-white rounded-md bg-amber-600 flex",children:[jsxRuntimeExports.jsx(MailWarning,{className:"inline-block size-12 pr-2"}),jsxRuntimeExports.jsx("span",{children:"This person doesn’t have a Fabric account. Do you want to invite them?"})]}),jsxRuntimeExports.jsx(DialogFooter,{children:jsxRuntimeExports.jsx("div",{className:"flex justify-between w-full",children:jsxRuntimeExports.jsxs(Button,{type:"submit",variant:"submit",className:"rounded-full",disabled:isAddPending||isInvitePending,children:[jsxRuntimeExports.jsx(Save,{})," ",shouldInvite?"Invite User":"Add User"]})})})]})})})})}__name(AddUserModal$1,"AddUserModal$1");async function onRemoveUserFromOrganizationRole({roleId,userId}){const{data}=await apiClient.delete(`/OrganizationRole/role/${roleId}/user/${userId}`);return data}__name(onRemoveUserFromOrganizationRole,"onRemoveUserFromOrganizationRole");function useRemoveUserFromOrganizationRole(){return useMutation({mutationFn:__name(({roleId,userId})=>onRemoveUserFromOrganizationRole({roleId,userId}),"mutationFn")})}__name(useRemoveUserFromOrganizationRole,"useRemoveUserFromOrganizationRole");function useCheckboxCallback(defaultValue){const[state2,setState2]=reactExports.useState(defaultValue||!1),onClick=reactExports.useCallback(e=>{setState2(typeof e=="boolean"?e:e.target.checked)},[]);return[state2,onClick]}__name(useCheckboxCallback,"useCheckboxCallback");function OrgUserRoleCheckbox({data,readOnly,canRemove,orgRole,selectedRoles,setChangesMade}){const{mutate:addUser,isPending:isAddPending}=useAddUserToOrganizationRole(),{mutate:removeUser,isPending:isRemovePending}=useRemoveUserFromOrganizationRole(),userIsInRole=!!selectedRoles[orgRole.roleName],[wasChecked,setWasChecked]=reactExports.useState(userIsInRole),[isChecked,onCheckedChanged]=useCheckboxCallback(userIsInRole);return reactExports.useEffect(()=>{isChecked!==wasChecked&&(isChecked?addUser({email:data.email,roleId:orgRole.id},{onSuccess:__name(()=>{setWasChecked(isChecked),setChangesMade(!0),toast.success("Role added successfully")},"onSuccess")}):removeUser({userId:data.id,roleId:orgRole.id},{onSuccess:__name(()=>{setWasChecked(isChecked),setChangesMade(!0),toast.success("Role removed successfully")},"onSuccess")}))},[addUser,data.email,data.id,isChecked,orgRole.id,removeUser,setChangesMade,wasChecked]),jsxRuntimeExports.jsxs(Label$2,{className:"flex",children:[jsxRuntimeExports.jsx(Input,{type:"checkbox",className:"w-6",disabled:readOnly||isAddPending||isRemovePending||!canRemove&&isChecked,checked:isChecked,onChange:onCheckedChanged}),jsxRuntimeExports.jsx("span",{className:"pl-4 pr-8 flex-1 py-2.5",children:orgRole.roleName})]},orgRole.id)}__name(OrgUserRoleCheckbox,"OrgUserRoleCheckbox");function EditUserModal$1({closeModal,data,isModalOpen,onUserUpdated}){const{organizationId}=useParams({strict:!1}),auth=useCloudAuth(),{update,remove}=useOrganizationRolePermissions(organizationId),isSelf=auth.user?.email===data.email,{data:orgRoles}=useSuspenseQuery(getOrganizationRolesQueryOptions(organizationId)),selectedRoles=reactExports.useMemo(()=>data.roles?keyBy(data.roles,"roleName"):{},[data]),[changesMade,setChangesMade]=reactExports.useState(!1);return jsxRuntimeExports.jsx(Dialog,{onOpenChange:changesMade?onUserUpdated:closeModal,open:isModalOpen,children:jsxRuntimeExports.jsxs(DialogContent,{className:"sm:max-w-[750px]",children:[jsxRuntimeExports.jsx(DialogHeader,{children:jsxRuntimeExports.jsxs(DialogTitle,{children:[update?"Edit ":"View "," ",data.email," ",isSelf?"(yourself)":""]})}),update&&jsxRuntimeExports.jsxs(DialogDescription,{children:["To remove ",isSelf?"your self":"this user"," from the organization, uncheck all of the boxes below."]}),orgRoles.map(orgRole=>jsxRuntimeExports.jsx(OrgUserRoleCheckbox,{readOnly:!update,canRemove:remove,data,orgRole,selectedRoles,setChangesMade},orgRole.id))]})})}__name(EditUserModal$1,"EditUserModal$1");function sortByEmail(a2,b){return a2.email>b.email?1:-1}__name(sortByEmail,"sortByEmail");function OrgConfigUsersIndex(){const navigate=useNavigate(),{organizationId,orgUserId}=useParams({strict:!1}),{update}=useOrganizationRolePermissions(organizationId),{data:organizationRoles,refetch,isFetching,isRefetching}=useSuspenseQuery(getOrganizationRolesQueryOptions(organizationId)),cloudUsers=reactExports.useMemo(()=>{const users={};for(const organizationRole of organizationRoles)if(organizationRole.users)for(const user of organizationRole.users)users[user.id]||(users[user.id]={...user,roles:[]}),users[user.id].roles.push(organizationRole);return Object.values(users).sort(sortByEmail)},[organizationRoles]),selectedUser=reactExports.useMemo(()=>cloudUsers?.find(user=>user.id===orgUserId),[cloudUsers,orgUserId]),onSelectUser=reactExports.useCallback(newUserId=>{const parts=[orgUserId?"..":"",newUserId].filter(Boolean);navigate({to:parts.join("/")})},[orgUserId,navigate]),isEditModalOpen=!!orgUserId&&!!selectedUser,[isAddModalOpen,setIsAddModalOpen]=reactExports.useState(!1),[sortTableDataParams]=reactExports.useState({attribute:"email",descending:!1}),sortingState=reactExports.useMemo(()=>[{desc:sortTableDataParams.descending,id:sortTableDataParams.attribute}],[sortTableDataParams]),onAddClicked=reactExports.useCallback(()=>{setIsAddModalOpen(!0)},[setIsAddModalOpen]),onUsedAdded=reactExports.useCallback(()=>{refetch(),setIsAddModalOpen(!1)},[refetch,setIsAddModalOpen]),onRowClick=reactExports.useCallback(rowData=>{onSelectUser(rowData.original.id)},[onSelectUser]),closeEditModal=reactExports.useCallback(()=>{onSelectUser(void 0)},[onSelectUser]),onUserUpdated=reactExports.useCallback(()=>{refetch(),onSelectUser(void 0)},[onSelectUser,refetch]),onRefreshClick=useRefreshClick(refetch);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SubNavMenu,{}),jsxRuntimeExports.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:jsxRuntimeExports.jsxs(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(Loading,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[jsxRuntimeExports.jsxs(SimpleBrowseDataTable,{data:cloudUsers,isFetching:isFetching||isRefetching,columns:dataTableColumns$4,onRowClick,sortingState,children:[jsxRuntimeExports.jsxs(Button,{variant:"defaultOutline",onClick:onRefreshClick,accessKey:"r",disabled:isFetching||isRefetching,children:[jsxRuntimeExports.jsx(RefreshCw,{})," ",jsxRuntimeExports.jsxs("span",{className:"hidden lg:inline-block",children:[jsxRuntimeExports.jsx("u",{children:"R"}),"efresh"]})]}),update&&jsxRuntimeExports.jsxs(Button,{variant:"positiveOutline",onClick:onAddClicked,accessKey:"a",disabled:isAddModalOpen,children:[jsxRuntimeExports.jsx(Plus,{})," ",jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsx("u",{children:"A"}),"dd"]})]})]}),update&&jsxRuntimeExports.jsx(AddUserModal$1,{isModalOpen:isAddModalOpen,onChangesSaved:onUsedAdded,setIsModalOpen:setIsAddModalOpen}),isEditModalOpen&&jsxRuntimeExports.jsx(EditUserModal$1,{closeModal:closeEditModal,data:selectedUser,isModalOpen:isEditModalOpen,onUserUpdated})]})})]})}__name(OrgConfigUsersIndex,"OrgConfigUsersIndex");function OrgCard({organizationRole,onDeleteOrgModal}){const{organizationId,organizationName,roleName}=organizationRole,{remove,update:canUpdateOrganization}=useOrganizationPermissions(organizationId),showBilling=canUpdateOrganization,{view:showOrgUsersAndRoles}=useOrganizationRolePermissions(organizationId),onDeleteClick=reactExports.useCallback(()=>{onDeleteOrgModal(organizationRole)},[onDeleteOrgModal,organizationRole]);return jsxRuntimeExports.jsxs(Card,{className:"relative h-full justify-between",children:[jsxRuntimeExports.jsxs(CardHeader,{children:[jsxRuntimeExports.jsxs(CardDescription,{className:"flex items-center justify-between",children:[jsxRuntimeExports.jsx("span",{className:"truncate",children:organizationId}),remove&&jsxRuntimeExports.jsxs(DropdownMenu,{children:[jsxRuntimeExports.jsx(DropdownMenuTrigger,{className:"p-4 -m-4 -mr-6 hover:text-white",children:jsxRuntimeExports.jsx(Ellipsis,{"aria-label":"Options"})}),jsxRuntimeExports.jsxs(DropdownMenuContent,{children:[jsxRuntimeExports.jsx(DropdownMenuLabel,{className:"text-gray-600 text-xs",children:"Options"}),jsxRuntimeExports.jsx(DropdownMenuSeparator,{}),jsxRuntimeExports.jsx(Link$2,{to:`${organizationId}`,children:jsxRuntimeExports.jsx(DropdownMenuItem,{children:"Clusters"})}),showOrgUsersAndRoles&&jsxRuntimeExports.jsx(Link$2,{to:`${organizationId}/roles`,children:jsxRuntimeExports.jsx(DropdownMenuItem,{children:"Roles"})}),showOrgUsersAndRoles&&jsxRuntimeExports.jsx(Link$2,{to:`${organizationId}/users`,children:jsxRuntimeExports.jsx(DropdownMenuItem,{children:"Users"})}),showBilling&&jsxRuntimeExports.jsx(Link$2,{to:`${organizationId}/billing`,children:jsxRuntimeExports.jsx(DropdownMenuItem,{children:"Billing"})}),jsxRuntimeExports.jsx(DropdownMenuSeparator,{}),remove&&jsxRuntimeExports.jsx(DropdownMenuItem,{className:"focus:bg-red/70 focus:text-white",onClick:onDeleteClick,children:"Delete"})]})]})]}),jsxRuntimeExports.jsx(CardTitle,{children:jsxRuntimeExports.jsx("h2",{children:organizationName})})]}),jsxRuntimeExports.jsxs(CardContent,{className:"flex justify-between",children:[jsxRuntimeExports.jsx(Badge,{children:capitalizeWords(roleName)}),jsxRuntimeExports.jsx(Link$2,{to:organizationId,className:"text-sm","aria-label":`View ${organizationName}`,title:`View ${organizationName}`,children:jsxRuntimeExports.jsxs("span",{className:"py-2 transition-all duration-100 ease-in-out border-0 hover:border-b-2",children:["View ",jsxRuntimeExports.jsx(ArrowRight,{className:"inline-block"})]})})]})]})}__name(OrgCard,"OrgCard");async function onDeleteOrganization(orgId){const{data}=await apiClient.delete(`/Organization/${orgId}`);return data}__name(onDeleteOrganization,"onDeleteOrganization");function useDeleteOrganizationMutation(){return useMutation({mutationFn:__name(orgId=>onDeleteOrganization(orgId),"mutationFn")})}__name(useDeleteOrganizationMutation,"useDeleteOrganizationMutation");async function onNewOrganizationSubmit(newOrg){const{data}=await apiClient.post("/Organization/",{...newOrg});return data}__name(onNewOrganizationSubmit,"onNewOrganizationSubmit");function useCreateNewOrganizationMutation(){return useMutation({mutationFn:__name(clusterInfo=>onNewOrganizationSubmit(clusterInfo),"mutationFn")})}__name(useCreateNewOrganizationMutation,"useCreateNewOrganizationMutation");const specifiedSubdomain=string$3().max(62,{error:"Must be at most 62 characters long."}).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/,{error:"Please only use lowercase letters, digits and dashes (-) in the subdomain. Must not start or end with a dash."}),NewOrganizationSchema=object({name:string$3().max(255,{error:"Name cannot be longer than 255 characters."}),subdomain:union([literal(""),_undefined(),specifiedSubdomain])});function NewOrgForm(){const{user}=useCloudAuth(),navigate=useNavigate(),form=useForm({resolver:a(NewOrganizationSchema),defaultValues:{name:"",subdomain:""}}),{setFocus,watch}=form;reactExports.useEffect(()=>{setFocus("name")},[setFocus]);const defaultName=`${user?.firstname} ${user?.lastname} Org`,name2=watch("name")||defaultName,subdomain=watch("subdomain"),calculatedNames=reactExports.useMemo(()=>{const suggestedSubdomain=collapseKebabsToMaxLength(toKebabCase(name2),specifiedSubdomain.maxLength);return{suggestedSubdomain,fullHostName:`future-cluster-names.${subdomain||suggestedSubdomain}.harperfabric.com`}},[name2,subdomain]),{mutate:submitNewOrganizationData,isPending}=useCreateNewOrganizationMutation(),queryClient2=useQueryClient(),submitForm=reactExports.useCallback(async formData=>{submitNewOrganizationData({name:formData.name||defaultName,subdomain:formData.subdomain||calculatedNames.suggestedSubdomain},{onSuccess:__name(newOrg=>{queryClient2.invalidateQueries({queryKey:currentUserQueryKey,refetchType:"active"}),authStore.reloadUser(OverallAppSignIn),navigate({to:`/${newOrg.id}`})},"onSuccess")})},[calculatedNames.suggestedSubdomain,queryClient2,submitNewOrganizationData,defaultName,navigate]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Form,{...form,children:jsxRuntimeExports.jsxs("form",{id:"org-add-form",name:"org-add-form",onSubmit:form.handleSubmit(submitForm),className:"grid gap-6 text-white max-w-xl",children:[jsxRuntimeExports.jsx(FormField,{control:form.control,name:"name",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"Name"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"text",maxLength:NewOrganizationSchema.shape.name.maxLength,autoCapitalize:"words",placeholder:defaultName,...field})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(FormField,{control:form.control,name:"subdomain",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"Subdomain"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"text",maxLength:specifiedSubdomain.maxLength,autoCapitalize:"none",placeholder:calculatedNames.suggestedSubdomain,...field})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"Full Host Name"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx("span",{children:calculatedNames.fullHostName})}),jsxRuntimeExports.jsx(FormMessage,{})]}),jsxRuntimeExports.jsx(DialogFooter,{children:jsxRuntimeExports.jsxs(Button,{type:"submit",variant:"submit",className:"rounded-full",disabled:isPending,children:["Create New Organization ",jsxRuntimeExports.jsx(ArrowRight,{})]})})]})})})}__name(NewOrgForm,"NewOrgForm");function NewOrg(){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SubNavMenu,{}),jsxRuntimeExports.jsx("section",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:jsxRuntimeExports.jsx(NewOrgForm,{})})]})}__name(NewOrg,"NewOrg");function OrganizationsIndex(){const queryClient2=useQueryClient(),{data:user}=useSuspenseQuery(getCurrentUserQueryOptions()),{mutate:deleteOrg,isPending:isDeletingOrgPending}=useDeleteOrganizationMutation(),[isDeleteOrgModalOpen,setIsDeleteOrgModalOpen]=reactExports.useState(!1),[deleteOrgInfo,setDeleteOrgInfo]=reactExports.useState(null),[filterByNameValue,setFilterByNameValue]=reactExports.useState(""),clearFilterByNameValue=reactExports.useCallback(()=>setFilterByNameValue(""),[]),organizationRoles=reactExports.useMemo(()=>{const roles=user?.roles||{},organizations=Object.values(roles);return Object.keys(roles).map((organizationId,index2)=>({organizationId,organizationName:organizations[index2].organizationName,roleName:organizations[index2].role})).filter(curryFilterByFuzzySearch(["organizationId","organizationName"],filterByNameValue)).sort((a2,b)=>(a2.organizationName||"")>(b.organizationName||"")?1:-1)||[]},[filterByNameValue,user?.roles]),onFilterByNameChanged=reactExports.useCallback(e=>{setFilterByNameValue(e.currentTarget.value?.toLowerCase()||"")},[]),handleDeleteOrg=reactExports.useCallback(org=>{org?.organizationId&&deleteOrg(org.organizationId,{onSuccess:__name(()=>{toast.success("Success",{description:"Organization successfully deleted.",duration:5e3,action:{label:"Dismiss",onClick:__name(()=>toast.dismiss(),"onClick")}}),queryClient2.invalidateQueries({queryKey:[]}),setIsDeleteOrgModalOpen(!1)},"onSuccess"),onError:__name(()=>setIsDeleteOrgModalOpen(!1),"onError")})},[deleteOrg,queryClient2,setIsDeleteOrgModalOpen]),onDeleteOrgModal=reactExports.useCallback(orgRole=>{setDeleteOrgInfo(orgRole),setIsDeleteOrgModalOpen(!0)},[]),{createCluster}=useSearch({strict:!1});return organizationRoles.length===1&&!filterByNameValue.length&&createCluster?jsxRuntimeExports.jsx(Navigate,{to:`/${organizationRoles[0].organizationId}/new-cluster`,replace:!0}):!organizationRoles.length&&!filterByNameValue.length?jsxRuntimeExports.jsx(NewOrg,{}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SubNavMenu,{children:jsxRuntimeExports.jsxs("div",{className:"flex w-full justify-end gap-2",children:[jsxRuntimeExports.jsx(Input,{placeholder:"Filter by name",className:"inline-block w-full text-xs",value:filterByNameValue,onChange:onFilterByNameChanged}),jsxRuntimeExports.jsx(Link$2,{to:"/new-org",children:jsxRuntimeExports.jsxs(Button,{variant:"positive",accessKey:"n",children:[jsxRuntimeExports.jsx(Plus,{}),jsxRuntimeExports.jsxs("span",{className:"hidden sm:inline-block",children:[jsxRuntimeExports.jsx("u",{children:"N"}),"ew ",jsxRuntimeExports.jsx("span",{className:"hidden md:inline-block",children:"Organization"})]})]})})]})}),jsxRuntimeExports.jsx("section",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-12",children:[organizationRoles.map(organizationRole=>jsxRuntimeExports.jsx("div",{className:"col-span-1 md:col-span-4 lg:col-span-3 2xl:col-span-2",children:jsxRuntimeExports.jsx(OrgCard,{organizationRole,onDeleteOrgModal})},organizationRole.organizationId)),!organizationRoles.length&&jsxRuntimeExports.jsxs("div",{className:"col-span-1 md:col-span-12 text-center",children:[jsxRuntimeExports.jsx("h2",{className:"my-4 text-xl",children:"No matches found."}),jsxRuntimeExports.jsx(Button,{variant:"outline",onClick:clearFilterByNameValue,children:"Clear Filters"})]})]})}),deleteOrgInfo&&jsxRuntimeExports.jsx(ConfirmDeletionModal,{typeOfThingBeingDeleted:"organization",nameOfThingBeingDeleted:deleteOrgInfo.organizationName,isModalOpen:isDeleteOrgModalOpen,setIsModalOpen:__name(()=>setIsDeleteOrgModalOpen(!1),"setIsModalOpen"),deletionConfirmed:__name(()=>handleDeleteOrg(deleteOrgInfo),"deletionConfirmed"),deletionPending:isDeletingOrgPending})]})}__name(OrganizationsIndex,"OrganizationsIndex");function Dashboard(){const{isLoading:isUserLoading}=useOverallAuth(),{createCluster}=useSearch({strict:!1}),[,setSavedClusterState]=useLocalStorage(LocalStorageKeys.SavedClusterState,null);return reactExports.useEffect(()=>{createCluster&&setSavedClusterState(createCluster)},[createCluster,setSavedClusterState]),isUserLoading?jsxRuntimeExports.jsx(Loading,{className:"fixed z-50 translate-1/2"}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.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:jsxRuntimeExports.jsx(Navbar,{})}),jsxRuntimeExports.jsx("main",{children:jsxRuntimeExports.jsx(Outlet,{})})]})}__name(Dashboard,"Dashboard");const ignoredUrls=["/","/forgot-password","/reset-password","/sign-in","/sign-up","/verify-email"];function buildRedirectInSearch(){const url2=currentUrlAfterHash();return!ignoredUrls.includes(url2)&&{redirect:url2}}__name(buildRedirectInSearch,"buildRedirectInSearch");const dashboardLayout=createRoute({getParentRoute:__name(()=>rootRoute,"getParentRoute"),id:"_dashboardLayout",component:Dashboard,beforeLoad:__name(({context})=>{const auth=context.authentication[OverallAppSignIn];if(auth&&!auth.isLoading&&!auth.user)throw redirect({to:"/sign-in",search:buildRedirectInSearch()})},"beforeLoad")}),orgsLayoutRoute=createRoute({getParentRoute:__name(()=>dashboardLayout,"getParentRoute"),id:"_orgsLayout"});createRoute({getParentRoute:__name(()=>orgsLayoutRoute,"getParentRoute"),path:"/",component:OrganizationsIndex});createRoute({getParentRoute:__name(()=>orgsLayoutRoute,"getParentRoute"),path:"/new-org",component:NewOrg});const orgLayoutRoute=createRoute({getParentRoute:__name(()=>orgsLayoutRoute,"getParentRoute"),path:"$organizationId",beforeLoad:__name(async opts=>({organization:await opts.context.queryClient.ensureQueryData(getOrganizationQueryOptions(opts.params.organizationId))}),"beforeLoad")}),orgRolesRoute=createRoute({getParentRoute:__name(()=>orgLayoutRoute,"getParentRoute"),path:"/roles",component:OrgConfigRolesIndex}),orgRoleRoute=createRoute({getParentRoute:__name(()=>orgLayoutRoute,"getParentRoute"),path:"/roles/$orgRoleId",component:OrgConfigRolesIndex}),orgUsersRoute=createRoute({getParentRoute:__name(()=>orgLayoutRoute,"getParentRoute"),path:"/users",component:OrgConfigUsersIndex}),orgUserRoute=createRoute({getParentRoute:__name(()=>orgLayoutRoute,"getParentRoute"),path:"/users/$orgUserId",component:OrgConfigUsersIndex});createBillingRouteTree(orgLayoutRoute);const clustersLayoutRoute=createRoute({getParentRoute:__name(()=>orgLayoutRoute,"getParentRoute"),id:"_clusterLayout"});createRoute({getParentRoute:__name(()=>clustersLayoutRoute,"getParentRoute"),path:"/",component:ClustersList});createRoute({getParentRoute:__name(()=>orgLayoutRoute,"getParentRoute"),path:"/new-cluster",component:UpsertCluster});createRoute({getParentRoute:__name(()=>clusterLayoutRoute,"getParentRoute"),path:"/edit",component:UpsertCluster});function ClusterLayout(){return jsxRuntimeExports.jsx(Outlet,{})}__name(ClusterLayout,"ClusterLayout");const clusterLayoutRoute=createRoute({getParentRoute:__name(()=>clustersLayoutRoute,"getParentRoute"),path:"$clusterId",component:ClusterLayout,beforeLoad:__name(async({context,params})=>({cluster:await context.queryClient.ensureQueryData(getClusterInfoQueryOptions(params.clusterId))}),"beforeLoad")});function NestedContentWithSubNavMenu({children,className}){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SubNavMenu,{}),jsxRuntimeExports.jsx("div",{className:cx$1("mt-32 px-4 py-4 md:px-12 min-h-[calc(100vh-(--spacing(32)))] flex justify-center",className),children})]})}__name(NestedContentWithSubNavMenu,"NestedContentWithSubNavMenu");var SWITCH_NAME="Switch",[createSwitchContext]=createContextScope(SWITCH_NAME),[SwitchProvider,useSwitchContext]=createSwitchContext(SWITCH_NAME),Switch$1=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeSwitch,name:name2,checked:checkedProp,defaultChecked,required:required2,disabled,value="on",onCheckedChange,form,...switchProps}=props,[button,setButton]=reactExports.useState(null),composedRefs=useComposedRefs(forwardedRef,node2=>setButton(node2)),hasConsumerStoppedPropagationRef=reactExports.useRef(!1),isFormControl=button?form||!!button.closest("form"):!0,[checked,setChecked]=useControllableState({prop:checkedProp,defaultProp:defaultChecked??!1,onChange:onCheckedChange,caller:SWITCH_NAME});return jsxRuntimeExports.jsxs(SwitchProvider,{scope:__scopeSwitch,checked,disabled,children:[jsxRuntimeExports.jsx(Primitive$1.button,{type:"button",role:"switch","aria-checked":checked,"aria-required":required2,"data-state":getState$1(checked),"data-disabled":disabled?"":void 0,disabled,value,...switchProps,ref:composedRefs,onClick:composeEventHandlers$1(props.onClick,event=>{setChecked(prevChecked=>!prevChecked),isFormControl&&(hasConsumerStoppedPropagationRef.current=event.isPropagationStopped(),hasConsumerStoppedPropagationRef.current||event.stopPropagation())})}),isFormControl&&jsxRuntimeExports.jsx(SwitchBubbleInput,{control:button,bubbles:!hasConsumerStoppedPropagationRef.current,name:name2,value,checked,required:required2,disabled,form,style:{transform:"translateX(-100%)"}})]})});Switch$1.displayName=SWITCH_NAME;var THUMB_NAME$1="SwitchThumb",SwitchThumb=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeSwitch,...thumbProps}=props,context=useSwitchContext(THUMB_NAME$1,__scopeSwitch);return jsxRuntimeExports.jsx(Primitive$1.span,{"data-state":getState$1(context.checked),"data-disabled":context.disabled?"":void 0,...thumbProps,ref:forwardedRef})});SwitchThumb.displayName=THUMB_NAME$1;var BUBBLE_INPUT_NAME$1="SwitchBubbleInput",SwitchBubbleInput=reactExports.forwardRef(({__scopeSwitch,control,checked,bubbles=!0,...props},forwardedRef)=>{const ref=reactExports.useRef(null),composedRefs=useComposedRefs(ref,forwardedRef),prevChecked=usePrevious$2(checked),controlSize=useSize(control);return reactExports.useEffect(()=>{const input=ref.current;if(!input)return;const inputProto=window.HTMLInputElement.prototype,setChecked=Object.getOwnPropertyDescriptor(inputProto,"checked").set;if(prevChecked!==checked&&setChecked){const event=new Event("click",{bubbles});setChecked.call(input,checked),input.dispatchEvent(event)}},[prevChecked,checked,bubbles]),jsxRuntimeExports.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:checked,...props,tabIndex:-1,ref:composedRefs,style:{...props.style,...controlSize,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});SwitchBubbleInput.displayName=BUBBLE_INPUT_NAME$1;function getState$1(checked){return checked?"checked":"unchecked"}__name(getState$1,"getState$1");var Root$3=Switch$1,Thumb=SwitchThumb;function Switch({className,...props}){return jsxRuntimeExports.jsx(Root$3,{"data-slot":"switch",className:cn$1("peer data-[state=checked]:bg-green data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",className),...props,children:jsxRuntimeExports.jsx(Thumb,{"data-slot":"switch-thumb",className:cn$1("bg-white dark:data-[state=unchecked]:bg-white dark:data-[state=checked]:bg-white pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}__name(Switch,"Switch");const COMMON_SLDS=new Set(["com","co","org","net","edu","gov","mil","me","biz","info","ac","or","ne","go","lg","asn","id","nom","sch","ltd","plc"]);function extractDomainFromTLD(domain2){const parts=domain2.split(".");if(parts.length<=2)return"@";const lastPart=parts[parts.length-1],secondToLastPart=parts[parts.length-2],rootPartCount=lastPart.length===2&&COMMON_SLDS.has(secondToLastPart)?3:2;return parts.length<=rootPartCount?"@":parts.slice(0,-rootPartCount).join(".")}__name(extractDomainFromTLD,"extractDomainFromTLD");function AssociateDomainWithCluster({cluster:{fqdn},disabled,domain:{domain:domain2,id:id2},bindDomain}){const[generateDomainCerts,onGenerateDomainCerts]=useCheckboxCallback(!0),recordName=extractDomainFromTLD(domain2),[onCopyName,onCopyTarget]=useCopyToClipboard(recordName,fqdn||""),onClick=reactExports.useCallback(()=>bindDomain(generateDomainCerts),[bindDomain,generateDomainCerts]);return jsxRuntimeExports.jsxs("div",{className:"grid gap-4 grid-cols-1 md:grid-cols-[80px_1fr] pb-6",children:[jsxRuntimeExports.jsx("div",{className:"text-muted-foreground md:col-span-2 text-wrap",children:"This domain has been verified! Now to associate it with this cluster, add the following to your DNS registrar:"}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"Type:"}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"CNAME or ALIAS"}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"Name:"}),jsxRuntimeExports.jsxs("div",{className:"col-span-1 flex gap-2",children:[jsxRuntimeExports.jsx("input",{className:"py-1 px-3 bg-gray-700 rounded-md w-full",type:"text",readOnly:!0,name:"recordName",value:recordName,onClick:onCopyName}),jsxRuntimeExports.jsx(Button,{type:"button",size:"sm",onClick:onCopyName,children:jsxRuntimeExports.jsx(Copy,{className:"w-4 h-4"})})]}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"TTL:"}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"Auto"}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"Target:"}),jsxRuntimeExports.jsxs("div",{className:"col-span-1 flex gap-2",children:[jsxRuntimeExports.jsx("input",{className:"py-1 px-3 bg-gray-700 rounded-md w-full",type:"text",readOnly:!0,name:"recordTarget",value:fqdn,onClick:onCopyTarget}),jsxRuntimeExports.jsx(Button,{type:"button",size:"sm",onClick:onCopyTarget,children:jsxRuntimeExports.jsx(Copy,{className:"w-4 h-4"})})]}),jsxRuntimeExports.jsx("div",{className:"text-muted-foreground md:col-span-2 text-wrap",children:"Once you've completed the above steps, you are ready to bind the domain to this cluster. A domain can only be bound to a single cluster."}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:jsxRuntimeExports.jsx("label",{htmlFor:"generateDomainCerts",children:"Certs:"})}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:jsxRuntimeExports.jsxs("label",{htmlFor:"generateDomainCerts",className:"-m-2 p-2",children:["Should we generate SSL certificates with LetsEncrypt?",jsxRuntimeExports.jsxs("div",{className:"flex mt-2",children:[jsxRuntimeExports.jsx(Switch,{id:"generateDomainCerts",checked:generateDomainCerts,className:"mr-2",onCheckedChange:onGenerateDomainCerts}),generateDomainCerts?"Yes":"No, I will add my own certificates, thank you very much."]})]})}),jsxRuntimeExports.jsx("div",{className:"col-span-1"}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:jsxRuntimeExports.jsxs(Button,{type:"button",variant:"submit","data-id":id2,onClick,disabled,children:[jsxRuntimeExports.jsx(Save,{})," Bind to This Cluster"]})})]})}__name(AssociateDomainWithCluster,"AssociateDomainWithCluster");function VerifyDomainOwnership({domain:{challengeToken,challengeTxtRecord}}){const[onCopyTxtRecord,onCopyToken]=useCopyToClipboard(challengeTxtRecord,challengeToken);return jsxRuntimeExports.jsxs("div",{className:"grid gap-2 grid-cols-1 md:grid-cols-[80px_1fr] pb-6",children:[jsxRuntimeExports.jsx("div",{className:"text-muted-foreground md:col-span-2 text-wrap",children:"Prove that you own this domain by adding the following to your DNS registrar:"}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"Type:"}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"TXT"}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"Name:"}),jsxRuntimeExports.jsxs("div",{className:"col-span-1 flex gap-2",children:[jsxRuntimeExports.jsx("input",{className:"py-1 px-3 bg-gray-700 rounded-md w-full",type:"text",readOnly:!0,name:"challengeName",value:challengeTxtRecord,onClick:onCopyTxtRecord}),jsxRuntimeExports.jsx(Button,{type:"button",size:"sm",onClick:onCopyTxtRecord,children:jsxRuntimeExports.jsx(Copy,{className:"w-4 h-4"})})]}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"TTL:"}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"Auto"}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"Content:"}),jsxRuntimeExports.jsxs("div",{className:"col-span-1 flex gap-2",children:[jsxRuntimeExports.jsx("input",{className:"py-1 px-3 bg-gray-700 rounded-md w-full",type:"text",readOnly:!0,name:"challengeToken",value:challengeToken,onClick:onCopyToken}),jsxRuntimeExports.jsx(Button,{type:"button",size:"sm",onClick:onCopyToken,children:jsxRuntimeExports.jsx(Copy,{className:"w-4 h-4"})})]}),jsxRuntimeExports.jsx("div",{className:"text-muted-foreground md:col-span-2 text-wrap",children:'Then after your DNS TTL elapses, click the "Validate" button above.'})]})}__name(VerifyDomainOwnership,"VerifyDomainOwnership");async function setDomainIdsOnCluster({clusterId,domainIds,generateDomainCerts}){const{data}=await apiClient.put(`/Cluster/${clusterId}`,{domainIds,generateDomainCerts},{timeout:0});return data}__name(setDomainIdsOnCluster,"setDomainIdsOnCluster");function useSetDomainIdsOnCluster(){return useMutation({mutationFn:__name(params=>setDomainIdsOnCluster(params),"mutationFn")})}__name(useSetDomainIdsOnCluster,"useSetDomainIdsOnCluster");z.object({domainId:z.string()});async function deleteDomainSubmit(formData){const{data}=await apiClient.delete(`/Domain/${formData.domainId}`);return data}__name(deleteDomainSubmit,"deleteDomainSubmit");function useDeleteDomain(){return useMutation({mutationFn:__name(formData=>deleteDomainSubmit(formData),"mutationFn")})}__name(useDeleteDomain,"useDeleteDomain");function unique(arr){return[...new Set(arr)]}__name(unique,"unique");const columnHelper$3=createColumnHelper();function useDataTableColumns(cluster){const{mutate:setDomainIds,isPending:addPending}=useSetDomainIdsOnCluster(),{mutate:deleteDomain,isPending:deletePending}=useDeleteDomain(),isPending=addPending||deletePending,bindDomainToThisCluster=reactExports.useCallback((domainId,generateDomainCerts)=>{if(!isRunning(cluster.status)){toast.error("Cluster is currently "+cluster.status,{description:"To bind a domain, it must be running."});return}setDomainIds({clusterId:cluster.id,domainIds:unique((cluster.domainIds?.slice()||[]).concat([domainId])),generateDomainCerts},{onSuccess:__name(()=>{queryClient.invalidateQueries({queryKey:[cluster.organizationId],refetchType:"active"}),toast.success("Domain bound!"+(generateDomainCerts?" Certificates are being generated in the background now.":""))},"onSuccess")})},[setDomainIds,cluster]),deleteDomainById=reactExports.useCallback(domainId=>{deleteDomain({domainId},{onSuccess:__name(()=>{queryClient.invalidateQueries({queryKey:[cluster.organizationId,"domains"],refetchType:"active"}),toast.success("Domain removed!")},"onSuccess")})},[deleteDomain]),unbindDomainById=reactExports.useCallback(domainId=>{setDomainIds({clusterId:cluster.id,domainIds:(cluster.domainIds?.slice()||[]).filter(id2=>id2!==domainId),generateDomainCerts:!1},{onSuccess:__name(()=>{queryClient.invalidateQueries({queryKey:[cluster.organizationId],refetchType:"active"}),toast.success("Domain unbound!")},"onSuccess")})},[deleteDomain]);return reactExports.useMemo(()=>[columnHelper$3.display({header:"Domains",id:"domain",enableSorting:!1,size:150,cell:__name(props=>{const domain2=props.row.original;return jsxRuntimeExports.jsxs(Tooltip,{children:[jsxRuntimeExports.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{children:domain2.domain}),jsxRuntimeExports.jsx(Button,{variant:"destructiveGhost",className:"text-muted-foreground text-xs",disabled:isPending||!!domain2.clusterId,onClick:__name(()=>deleteDomainById(domain2.id),"onClick"),children:"Remove Domain"})]})}),jsxRuntimeExports.jsx(TooltipContent,{side:"bottom",align:"center",children:domain2.clusterId?"To delete this domain, please unbind it from all clusters first.":"Remember to clean up your DNS records!"})]})},"cell")}),columnHelper$3.display({header:"Next Steps",enableSorting:!1,size:500,id:"nextSteps",cell:__name(props=>{const domain2=props.row.original;return domain2.status==="ACTIVE"&&domain2.clusterId?cluster.id===domain2.clusterId?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{children:"Bound to this cluster"}),jsxRuntimeExports.jsx(Button,{variant:"destructiveGhost",className:"text-muted-foreground text-xs",disabled:isPending,onClick:__name(()=>unbindDomainById(domain2.id),"onClick"),children:"Unbind Domain"})]}):`Bound to cluster ${domain2.clusterId}`:domain2.status==="PENDING_VALIDATION"?jsxRuntimeExports.jsx(VerifyDomainOwnership,{domain:domain2}):clusterIsSelfManaged(cluster)?"Cannot be associated with this self-managed cluster.":domain2.status==="ACTIVE"&&!domain2.clusterId?jsxRuntimeExports.jsx(AssociateDomainWithCluster,{cluster,domain:domain2,bindDomain:__name(generateDomainCerts=>bindDomainToThisCluster(domain2.id,generateDomainCerts),"bindDomain"),disabled:isPending}):domain2.status},"cell")})],[cluster,bindDomainToThisCluster,isPending])}__name(useDataTableColumns,"useDataTableColumns");const AddOrganizationDomainSchema=z.object({domain:z.string(),organizationId:z.string()});async function onAddDomainToOrganizationSubmit(formData){const{data}=await apiClient.post("/Domain/",formData);return data}__name(onAddDomainToOrganizationSubmit,"onAddDomainToOrganizationSubmit");function useAddDomainToOrganization(){return useMutation({mutationFn:__name(formData=>onAddDomainToOrganizationSubmit(formData),"mutationFn")})}__name(useAddDomainToOrganization,"useAddDomainToOrganization");async function validateDomainInOrganization(domainId){const{data}=await apiClient.post(`/Domain/${domainId}/validate`);return data}__name(validateDomainInOrganization,"validateDomainInOrganization");async function getOrganizationDomains(organizationId){const{data}=await apiClient.get(`/Domain/?organizationId=${organizationId}`);return data}__name(getOrganizationDomains,"getOrganizationDomains");function getOrganizationDomainsQueryOptions(organizationId){return{queryKey:[organizationId,"domains"],queryFn:__name(()=>getOrganizationDomains(organizationId),"queryFn")}}__name(getOrganizationDomainsQueryOptions,"getOrganizationDomainsQueryOptions");function DomainsManagement(){const{organizationId,clusterId}=useParams({strict:!1}),{data:cluster}=useSuspenseQuery(getClusterInfoQueryOptions(clusterId,!0)),{update}=useOrganizationRolePermissions(organizationId),{data:organizationDomains,refetch,isFetching,isRefetching}=useQuery(getOrganizationDomainsQueryOptions(organizationId)),pendingDomains=reactExports.useMemo(()=>organizationDomains?.filter(o2=>o2.status==="PENDING_VALIDATION")||[],[organizationDomains]),[sortTableDataParams]=reactExports.useState({attribute:"domain",descending:!1}),sortingState=reactExports.useMemo(()=>[{desc:sortTableDataParams.descending,id:sortTableDataParams.attribute}],[sortTableDataParams]),onRefreshClick=useRefreshClick(refetch),{mutate:addDomain,isPending:isAddPending}=useAddDomainToOrganization(),form=useForm({resolver:a(AddOrganizationDomainSchema),defaultValues:{domain:"",organizationId}}),onSubmitClick=reactExports.useCallback(async formData=>{formData&&addDomain(formData,{onSuccess:__name(()=>{form.reset(),refetch(),toast.success("Domain added! Please add the txt record above to your domain registrar.")},"onSuccess")})},[addDomain,form,refetch]),onValidateClick=reactExports.useCallback(async()=>{const message=`Validating ${pluralize(pendingDomains.length,"domain","domains")}...`,id2="validatingDomains";let checked=0,failed=0;for(const pendingDomain of pendingDomains)try{toast.loading(message,{description:`${checked++} of ${pendingDomains.length} checked`,id:id2}),await validateDomainInOrganization(pendingDomain.id)}catch{failed+=1}failed>0?toast.error("Validation failed!",{description:"Please make sure the TXT record has been put in place. You may need to wait a bit for the DNS change to propagate.",id:id2}):(await refetch(),toast.success("Validation succeeded!",{description:"Please take a look at the next steps for newly verified domains.",id:id2}))},[pendingDomains]),dataTableColumns2=useDataTableColumns(cluster);return jsxRuntimeExports.jsx(SimpleBrowseDataTable,{data:organizationDomains||[],isFetching:isFetching||isRefetching,columns:dataTableColumns2,sortingState,children:jsxRuntimeExports.jsxs("div",{className:"w-full flex flex-col md:flex-row justify-between md:items-center md:space-x-2 space-y-2 md:space-y-0",children:[update&&jsxRuntimeExports.jsx(Form,{...form,children:jsxRuntimeExports.jsxs("form",{id:"cluster-add-domain-form",name:"cluster-add-domain-form",onSubmit:form.handleSubmit(onSubmitClick),className:"flex gap-1 flex-col md:flex-row",children:[jsxRuntimeExports.jsx(FormField,{control:form.control,name:"domain",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{className:"flex-1",children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"New Domain Name"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"text",enterKeyHint:"done",autoComplete:"off",...field})}),jsxRuntimeExports.jsx(FormMessage,{children:jsxRuntimeExports.jsx("span",{className:"text-muted-foreground italic",children:"Type in a domain like example.com or your.example.com, and you'll be guided through validating and binding your cluster to it."})})]}),"render")}),jsxRuntimeExports.jsx("div",{className:"flex-0 self-start md:pt-6.5",children:jsxRuntimeExports.jsxs(Button,{type:"submit",variant:"submit",disabled:isAddPending,children:[jsxRuntimeExports.jsx(Plus,{})," Add"]})})]})}),pendingDomains.length>0&&jsxRuntimeExports.jsxs(Button,{variant:"positiveOutline",onClick:onValidateClick,accessKey:"r",disabled:isFetching||isRefetching,children:[jsxRuntimeExports.jsx(ListTodo,{})," ",jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsx("u",{children:"V"}),"alidate"]})]}),jsxRuntimeExports.jsxs(Button,{variant:"defaultOutline",onClick:onRefreshClick,accessKey:"r",disabled:isFetching||isRefetching,children:[jsxRuntimeExports.jsx(RefreshCw,{})," ",jsxRuntimeExports.jsxs("span",{className:"hidden lg:inline-block",children:[jsxRuntimeExports.jsx("u",{children:"R"}),"efresh"]})]})]})})}__name(DomainsManagement,"DomainsManagement");function DomainsPage(){return jsxRuntimeExports.jsx(NestedContentWithSubNavMenu,{className:"flex flex-col justify-start max-w-4xl",children:jsxRuntimeExports.jsx(DomainsManagement,{})})}__name(DomainsPage,"DomainsPage");const AddUserFormSchema=object({username:zodRequireUsername,role:string$3().nonempty({error:"Please select a role."}),password:zodRequirePassword.min(8,{error:"Password must be at least 8 characters long."}),confirmPassword:string$3()}).refine(data=>data.password===data.confirmPassword,{error:"Passwords do not match.",path:["confirmPassword"]});async function resetPasswordUpdater(clusterId){await apiClient.patch(`/ResetPasswordUpdater/${clusterId}`)}__name(resetPasswordUpdater,"resetPasswordUpdater");async function onAddUserSubmit(formData){const{instanceClient,...userData}=formData,{data}=await instanceClient.post("/",{operation:"add_user",...userData});return data}__name(onAddUserSubmit,"onAddUserSubmit");function useAddUserMutation(){return useMutation({mutationFn:onAddUserSubmit})}__name(useAddUserMutation,"useAddUserMutation");async function onAlterUser({username,password,role,active,instanceClient}){const{data}=await instanceClient.post("/",{operation:"alter_user",username,password,role,active});return data}__name(onAlterUser,"onAlterUser");function useAlterUser(){return useMutation({mutationFn:onAlterUser})}__name(useAlterUser,"useAlterUser");async function onDeleteUser({username,instanceClient}){const{data}=await instanceClient.post("/",{operation:"drop_user",username});return data}__name(onDeleteUser,"onDeleteUser");function useDeleteUserMutation(){return useMutation({mutationFn:onDeleteUser})}__name(useDeleteUserMutation,"useDeleteUserMutation");async function onInstanceResetPassword({clusterId,initialUsername,desiredUsername,newPassword,tempPassword,instanceClient:initialInstanceClient}){if(!tempPassword)throw new Error("You may not have permission to set the password on this cluster.");let instanceClient=initialInstanceClient;try{const loginResponse=await onInstanceLoginSubmit({username:initialUsername,password:tempPassword,instanceClient,entityId:clusterId});return loginResponse.instanceClient&&(instanceClient=loginResponse.instanceClient),desiredUsername===defaultClusterUsername?await onAlterUser({username:desiredUsername,password:newPassword,instanceClient}):(await onAddUserSubmit({username:desiredUsername,password:newPassword,role:"super_user",active:!0,instanceClient}),await onInstanceLoginSubmit({username:desiredUsername,password:newPassword,instanceClient,entityId:clusterId}),await onDeleteUser({username:defaultClusterUsername,instanceClient})),await resetPasswordUpdater(clusterId),loginResponse}catch(err){throw await onInstanceLogoutSubmit({entityId:clusterId,instanceClient}),err}}__name(onInstanceResetPassword,"onInstanceResetPassword");function useInstanceResetPasswordMutation(){return useMutation({mutationFn:onInstanceResetPassword})}__name(useInstanceResetPasswordMutation,"useInstanceResetPasswordMutation");function FinishSetup(){const{user}=useCloudAuth(),{clusterId}=useParams({strict:!1}),{data:cluster}=useQuery(getClusterInfoQueryOptions(clusterId,!0)),navigate=useNavigate(),operationsUrl=reactExports.useMemo(()=>getOperationsUrlForCluster(cluster),[cluster]),instanceClient=useInstanceClient(operationsUrl),{redirect:redirect2}=useSearch({strict:!1}),router=useRouter(),methods=useForm({resolver:a(AddUserFormSchema),defaultValues:{confirmPassword:"",password:"",role:"super_user",username:user?.email??""}}),{setFocus,control,handleSubmit}=methods;reactExports.useEffect(()=>{setFocus("password")},[setFocus]);const tempPassword=cluster?.instances?.find(i2=>i2.tempPassword)?.tempPassword,{mutate:submitInstanceResetPassword,isPending}=useInstanceResetPasswordMutation(),submitForm=reactExports.useCallback(async formData=>{if(!operationsUrl){toast.error("Cluster is not yet fully loaded, please wait a moment before trying to sign in.");return}submitInstanceResetPassword({instanceClient,clusterId,newPassword:formData.password,tempPassword,initialUsername:defaultClusterUsername,desiredUsername:formData.username},{onSuccess:__name(async({message,user:user2})=>{toast.success(message),authStore.setUserForEntity(cluster,user2),router.invalidate(),await navigate({to:redirect2?.startsWith("/")?redirect2:defaultInstanceRouteUpOne})},"onSuccess")})},[cluster,clusterId,instanceClient,navigate,operationsUrl,redirect2,router,submitInstanceResetPassword,tempPassword]);return cluster&&!cluster.resetPassword?jsxRuntimeExports.jsx(Navigate,{to:"../sign-in",replace:!0}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("nav",{className:"fixed top-20 w-full h-12 z-39 px-4 md:px-12 bg-grey-700 flex items-center",children:jsxRuntimeExports.jsx(Breadcrumbs,{})}),jsxRuntimeExports.jsx("div",{className:"items-center justify-center flex mt-32 py-4 min-h-[calc(100vh-(--spacing(32)))]",children:jsxRuntimeExports.jsxs("div",{className:"text-white w-xs",children:[jsxRuntimeExports.jsx("h2",{className:"text-2xl font-light",children:"Create Admin User"}),jsxRuntimeExports.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."}),jsxRuntimeExports.jsx(Form,{...methods,children:jsxRuntimeExports.jsxs("form",{id:"cluster-create-admin-form",name:"cluster-create-admin-form",onSubmit:handleSubmit(submitForm),className:"my-4",children:[jsxRuntimeExports.jsx(FormField,{control,name:"username",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{className:"my-4",children:[jsxRuntimeExports.jsx(FormLabel,{children:"Username"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{autoComplete:"username",type:"text",...field})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(FormField,{control,name:"password",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{className:"my-4",children:[jsxRuntimeExports.jsx(FormLabel,{children:"Password"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"password",...field})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(FormField,{control,name:"confirmPassword",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{className:"my-4",children:[jsxRuntimeExports.jsx(FormLabel,{children:"Confirm Password"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"password",...field})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(Button,{disabled:isPending,type:"submit",variant:"submit",className:"w-full my-2 rounded-full",children:"Create Admin User"})]})}),jsxRuntimeExports.jsxs("p",{className:"text-muted-foreground flex gap-2 align-middle",children:[jsxRuntimeExports.jsx(Activity,{size:36,className:"flex-none"}),jsxRuntimeExports.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."})]})]})})]})}__name(FinishSetup,"FinishSetup");function DataTable({columns:columns2,data}){const table2=useReactTable({data,columns:columns2,getCoreRowModel:getCoreRowModel()});return jsxRuntimeExports.jsx("div",{className:"bg-black-dark rounded-md",children:jsxRuntimeExports.jsxs(Table,{children:[jsxRuntimeExports.jsx(TableHeader,{children:table2.getHeaderGroups().map(headerGroup=>jsxRuntimeExports.jsx(TableRow,{className:"border-none",children:headerGroup.headers.map(header=>jsxRuntimeExports.jsx(TableHead,{className:"p-4",style:{width:`${header.getSize()}%`},children:header.isPlaceholder?null:flexRender(header.column.columnDef.header,header.getContext())},header.id))},headerGroup.id))}),jsxRuntimeExports.jsx(TableBody,{className:"bg-black",children:table2.getRowModel().rows?.length?table2.getRowModel().rows.map(row=>jsxRuntimeExports.jsx(TableRow,{"data-state":row.getIsSelected()&&"selected",className:"hover:bg-muted/10 data-[state=selected]:bg-muted",children:row.getVisibleCells().map(cell=>jsxRuntimeExports.jsx(TableCell,{className:"p-4",style:{width:`${cell.column.getSize()}%`},children:flexRender(cell.column.columnDef.cell,cell.getContext())},cell.id))},row.id)):jsxRuntimeExports.jsx(TableRow,{children:jsxRuntimeExports.jsx(TableCell,{colSpan:columns2.length,className:"h-24 text-center",children:"No results."})})})]})})}__name(DataTable,"DataTable");function EmptyCluster(){return jsxRuntimeExports.jsx("div",{className:"flex-col items-center justify-center px-16 space-y-3 text-center pt-30",children:jsxRuntimeExports.jsx("p",{children:"No instances found."})})}__name(EmptyCluster,"EmptyCluster");function InstanceLogInCell({isSelfManaged,instance}){const{user:instanceUser,isLoading:instanceAuthIsLoading}=useInstanceAuth(instance.id),operationsUrl=reactExports.useMemo(()=>getOperationsUrlForInstance(instance),[instance]),instanceClient=useInstanceClient(operationsUrl),{update}=useOrganizationClusterInstancePermissions(),isFabricConnect=authStore.checkForFabricConnect(instance.id),onSignOutClick=reactExports.useCallback(async()=>{await onInstanceLogoutSubmit({instanceClient,entityId:instance.id}),authStore.setUserForEntity(instance,null)},[instance,instanceClient]);return instanceAuthIsLoading||!["CLONE_READY","RUNNING","UPDATED"].includes(instance.status)?jsxRuntimeExports.jsx(LoaderCircle,{className:"animate-spin",color:"gray"}):!instanceUser||isFabricConnect?jsxRuntimeExports.jsxs("span",{className:"flex gap-4",children:[update&&!isSelfManaged&&jsxRuntimeExports.jsx(Link$2,{to:`../instance/${instance.id}${defaultInstanceRoute}`,className:"text-sm","aria-label":`Connect to ${instance.name} instance`,title:`Connect to ${instance.name} instance`,children:jsxRuntimeExports.jsx(Button,{variant:"positiveOutline",children:"Fabric Connect"})}),jsxRuntimeExports.jsx(Link$2,{to:`../instance/${instance.id}/sign-in`,className:"text-sm","aria-label":`Sign in to ${instance.name} instance`,title:`Sign in to ${instance.name} instance`,children:jsxRuntimeExports.jsx(Button,{variant:update?"defaultOutline":"positiveOutline",children:"Direct Sign In"})})]}):jsxRuntimeExports.jsxs("span",{className:"flex gap-4",children:[jsxRuntimeExports.jsx(Link$2,{to:`../instance/${instance.id}${defaultInstanceRoute}`,className:"text-sm","aria-label":`Go to ${instance.name} instance`,title:`Go to ${instance.name} instance`,children:jsxRuntimeExports.jsx(Button,{variant:"positiveOutline",children:"Direct Connect"})}),jsxRuntimeExports.jsx(Button,{variant:"destructiveOutline",className:"text-sm","aria-label":`Sign out from ${instance.name} instance`,title:`Sign out from ${instance.name} instance`,onClick:onSignOutClick,children:"Direct Sign Out"})]})}__name(InstanceLogInCell,"InstanceLogInCell");function Instances(){const{clusterId}=useParams({strict:!1}),{data:cluster,isLoading:clusterIsLoading}=useQuery(getClusterInfoQueryOptions(clusterId,!0)),isSelfManaged=clusterIsSelfManaged(cluster),columns2=reactExports.useMemo(()=>[{id:"instanceActions",size:1,minSize:1,cell:__name(cell=>jsxRuntimeExports.jsx("div",{className:"flex justify-end",children:jsxRuntimeExports.jsx(InstanceLogInCell,{isSelfManaged,instance:cell.row.original})}),"cell")},isSelfManaged&&{accessorKey:"instanceFqdn",size:90,header:"URL",cell:__name(cell=>calculateInstanceFQDN({secure:cell.row.original.operationsApiSecure?"true":"false",port:cell.row.original.operationsApiPort,fqdn:cell.row.original.instanceFqdn}),"cell")},!isSelfManaged&&{accessorKey:"name",size:90,header:"Name"},!isSelfManaged&&{accessorKey:"status",header:"Status",size:1,minSize:1,cell:__name(cell=>{const status=cell.getValue();return jsxRuntimeExports.jsx(Badge,{variant:renderBadgeStatusVariant(status),children:capitalizeWords(status)})},"cell")},!isSelfManaged&&{accessorKey:"version",size:1,minSize:1,header:"Version"},!isSelfManaged&&{accessorKey:"storageGb",size:1,minSize:1,header:"Storage",cell:__name(cell=>{const value=cell.getValue();return humanFileSize(value,Math.pow(1024,3))},"cell")},!isSelfManaged&&{accessorKey:"cpuCores",size:1,minSize:1,header:"Cores/Threads",cell:__name(cell=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[cell.row.original.cpuCores," / ",cell.row.original.threads]}),"cell")},!isSelfManaged&&{accessorKey:"memoryMb",size:1,minSize:1,header:"Memory",cell:__name(cell=>{const value=cell.getValue();return humanFileSize(value,Math.pow(1024,2))},"cell")}].filter(excludeFalsy),[isSelfManaged]),instances=reactExports.useMemo(()=>cluster?.instances?cluster.instances.filter(instance=>instance.status&&!deletedClusterStatuses.includes(instance.status)).sort(byInstanceFqdnThenPort):[],[cluster]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SubNavMenu,{}),jsxRuntimeExports.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:jsxRuntimeExports.jsx(Card,{className:"p-0 mt-4 min-h-96",children:jsxRuntimeExports.jsx(CardContent,{className:"p-0 min-h-96",children:clusterIsLoading?jsxRuntimeExports.jsx(TextLoadingSkeleton,{}):instances.length?jsxRuntimeExports.jsx(DataTable,{data:instances,columns:columns2}):jsxRuntimeExports.jsx(EmptyCluster,{})})})})]})}__name(Instances,"Instances");function Scaling(){const{clusterId}=useParams({strict:!1}),{data:cluster,isLoading:clusterIsLoading}=useQuery(getClusterInfoQueryOptions(clusterId,2e3)),status=cluster?.status,clusterIsActive=reactExports.useMemo(()=>status&&activeClusterStatuses.includes(status),[status]);return clusterIsLoading||!cluster?jsxRuntimeExports.jsx(NestedContentWithSubNavMenu,{className:"flex justify-center",children:jsxRuntimeExports.jsx(TextLoadingSkeleton,{})}):clusterIsActive?jsxRuntimeExports.jsx(NestedContentWithSubNavMenu,{className:"flex justify-center",children:jsxRuntimeExports.jsxs("div",{className:"center w-2xl flex flex-col gap-4",children:[jsxRuntimeExports.jsx("h1",{className:"text-xl text-center",children:"All done!"}),jsxRuntimeExports.jsx(ClusterProgress,{cluster,forceProgressBarVisible:!0}),jsxRuntimeExports.jsx("p",{children:"Your cluster finished updating, and is ready for interaction."}),jsxRuntimeExports.jsx("div",{className:"text-center",children:jsxRuntimeExports.jsx(ClusterCardAction,{cluster})})]})}):jsxRuntimeExports.jsx(NestedContentWithSubNavMenu,{className:"flex justify-center",children:jsxRuntimeExports.jsxs("div",{className:"center w-2xl flex flex-col gap-4",children:[jsxRuntimeExports.jsx("h1",{className:"text-xl text-center",children:"Here we go!"}),jsxRuntimeExports.jsx(ClusterProgress,{cluster,forceProgressBarVisible:!0}),jsxRuntimeExports.jsxs("p",{children:["Your cluster is updating with the latest changes. This includes waiting several minutes to let traffic drain safely."," ",jsxRuntimeExports.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"," ",jsxRuntimeExports.jsx("a",{href:"https://discord.gg/VzZuaw3Xay",target:"_blank",rel:"noreferrer",className:"underline hover:text-blue-300",children:"Discord"}),"! Get real-time help from our engineers, see feature drops early, and connect with others building on Fabric."]})]})]})})}__name(Scaling,"Scaling");function StartingUp(){const router=useRouter(),{clusterId}=useParams({strict:!1}),{data:cluster,isLoading:clusterIsLoading}=useQuery(getClusterInfoQueryOptions(clusterId,2e3)),status=cluster?.status,clusterIsActive=reactExports.useMemo(()=>status&&activeClusterStatuses.includes(status),[status]),clusterHasFailed=isFailed(status),[,setSavedClusterState]=useLocalStorage(LocalStorageKeys.SavedClusterState,null),onTryAgainClick=reactExports.useCallback(()=>{setSavedClusterState(cluster),router.navigate({to:`/${cluster.organizationId}/new-cluster`})},[cluster,router,setSavedClusterState]);return clusterIsLoading||!cluster?jsxRuntimeExports.jsx(NestedContentWithSubNavMenu,{className:"flex justify-center",children:jsxRuntimeExports.jsx(TextLoadingSkeleton,{})}):clusterHasFailed?jsxRuntimeExports.jsx(NestedContentWithSubNavMenu,{className:"flex justify-center",children:jsxRuntimeExports.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4 items-center",children:[jsxRuntimeExports.jsx(CloudAlert,{className:"w-24 h-24"}),jsxRuntimeExports.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. ",jsxRuntimeExports.jsx(ContactUs,{})," if you want more help."]}),jsxRuntimeExports.jsx(Button,{type:"button",variant:"positiveOutline",onClick:onTryAgainClick,children:"Try Again"})]})}):clusterIsActive?jsxRuntimeExports.jsx(NestedContentWithSubNavMenu,{className:"flex justify-center",children:jsxRuntimeExports.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4",children:[jsxRuntimeExports.jsx("h1",{className:"text-xl text-center",children:"It's ready!"}),jsxRuntimeExports.jsx(ClusterProgress,{cluster,forceProgressBarVisible:!0}),jsxRuntimeExports.jsxs("p",{children:["Let's set up your secure, browser-to-cluster connection now."," ",jsxRuntimeExports.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 ",jsxRuntimeExports.jsx("em",{children:"Direct Connect"}),"! Once you create your user, you will have the option to"," ",jsxRuntimeExports.jsx("em",{children:"Fabric Connect"})," from your Fabric account without having to sign in again."]})]}),jsxRuntimeExports.jsx("div",{className:"text-center",children:jsxRuntimeExports.jsx(ClusterCardAction,{cluster})})]})}):jsxRuntimeExports.jsx(NestedContentWithSubNavMenu,{className:"flex justify-center",children:jsxRuntimeExports.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4",children:[jsxRuntimeExports.jsx("h1",{className:"text-xl text-center",children:"Here we go!"}),jsxRuntimeExports.jsx(ClusterProgress,{cluster,forceProgressBarVisible:!0}),jsxRuntimeExports.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."," ",jsxRuntimeExports.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"," ",jsxRuntimeExports.jsx("a",{href:"https://discord.gg/VzZuaw3Xay",target:"_blank",rel:"noreferrer",className:"underline hover:text-blue-300",children:"Discord"}),"! Get real-time help from our engineers, see feature drops early, and connect with others building on Fabric."]})]})]})})}__name(StartingUp,"StartingUp");createRoute({getParentRoute:__name(()=>clusterLayoutRoute,"getParentRoute"),path:"instances",component:Instances});createRoute({getParentRoute:__name(()=>clusterLayoutRoute,"getParentRoute"),path:"starting-up",component:StartingUp});createRoute({getParentRoute:__name(()=>clusterLayoutRoute,"getParentRoute"),path:"scaling",component:Scaling});createRoute({getParentRoute:__name(()=>clusterLayoutRoute,"getParentRoute"),path:"domains",component:DomainsPage});createRoute({getParentRoute:__name(()=>clusterLayoutRoute,"getParentRoute"),path:"sign-in",component:ClusterInstanceSignIn,beforeLoad:__name(({context,location:location2,params})=>{const isFabricConnect=authStore.checkForFabricConnect(params.clusterId);if(context.authentication[params.clusterId]?.user&&!isFabricConnect){const search2=location2?.search;throw redirect({to:search2?.redirect?.startsWith("/")?search2.redirect:defaultInstanceRouteUpOne})}},"beforeLoad")});createRoute({getParentRoute:__name(()=>clusterLayoutRoute,"getParentRoute"),path:"instance/$instanceId/sign-in",component:ClusterInstanceSignIn,beforeLoad:__name(({context,location:location2,params})=>{if(!(authStore.checkForFabricConnect(params.clusterId)||authStore.checkForFabricConnect(params.instanceId))&&context.authentication[params.instanceId]?.user){const search2=location2?.search;throw redirect({to:search2?.redirect?.startsWith("/")?search2.redirect:defaultInstanceRouteUpOne})}},"beforeLoad")});createRoute({getParentRoute:__name(()=>clusterLayoutRoute,"getParentRoute"),path:"finish-setup",component:FinishSetup});function createAPIsRouteTree(instanceLayoutRoute){return createRoute({getParentRoute:__name(()=>instanceLayoutRoute,"getParentRoute"),path:"apis"}).lazy(()=>__vitePreload(()=>import("./index.lazy-_WqXCxX6.js"),__vite__mapDeps([0,1,2])).then(d=>d.route))}__name(createAPIsRouteTree,"createAPIsRouteTree");function shallowCompareObjects(a2,b){if(a2===b)return!0;if(!a2||!b)return!1;const aKeys=Object.keys(a2),bKeys=Object.keys(b);if(aKeys.length!==bKeys.length)return!1;for(const key of aKeys)if(!bKeys.includes(key)||a2[key]!==b[key])return!1;return!0}__name(shallowCompareObjects,"shallowCompareObjects");function useEffectedState(initialState2,deps){const[currentDeps,setDeps]=reactExports.useState(deps),[currentState,setCurrentState]=reactExports.useState(initialState2);return reactExports.useEffect(()=>{shallowCompareObjects(currentDeps,deps)||(setDeps(deps),setCurrentState(initialState2))},[currentDeps,deps,initialState2]),shallowCompareObjects(currentDeps,deps)?[currentState,setCurrentState]:[initialState2,setCurrentState]}__name(useEffectedState,"useEffectedState");const listenersMap={};function useListener(name2,listener,deps){const callback=reactExports.useCallback((newValue,trigger)=>listener(newValue,trigger),[deps]);reactExports.useEffect(()=>(listenersMap[name2]||(listenersMap[name2]=[]),listenersMap[name2].push(callback),__name(function(){const index2=listenersMap[name2].indexOf(callback);index2>=0&&listenersMap[name2].splice(index2,1)},"cleanUp")),[name2,listener,callback])}__name(useListener,"useListener");function emitToListeners(name2,value,trigger){const listeners=listenersMap[name2];if(listeners)for(const listener of listeners)listener(value,trigger)}__name(emitToListeners,"emitToListeners");function curryEmitToListeners(name2,value,trigger){return e=>emitToListeners(name2,value,e)}__name(curryEmitToListeners,"curryEmitToListeners");function useEmitToListeners(name2,value,trigger){return reactExports.useCallback(e=>emitToListeners(name2,value,e),[name2,value,trigger])}__name(useEmitToListeners,"useEmitToListeners");function getSessionStorage(key,defaultValue){return safeParse(sessionStorage.getItem(String(key)))??defaultValue}__name(getSessionStorage,"getSessionStorage");function setSessionStorage(key,current){current==null?sessionStorage.removeItem(String(key)):sessionStorage.setItem(String(key),JSON.stringify(current))}__name(setSessionStorage,"setSessionStorage");function useSessionStorage(key,defaultValue){const state2=useEffectedState(getSessionStorage(key,defaultValue),[key]),[current,setCurrent]=state2;return reactExports.useEffect(()=>{setSessionStorage(key,current),emitToListeners(`Session:${key}`,current)},[key,current]),useListener(`Session:${key}`,__name(function(newValue){current!==newValue&&setCurrent(newValue)},"watchForInternalStorageChanges"),[current,key,defaultValue]),reactExports.useEffect(__name(function(){const storageListener=__name(event=>{event.key===key&&setCurrent(getSessionStorage(key,defaultValue))},"storageListener");return window.addEventListener("storage",storageListener),()=>{window.removeEventListener("storage",storageListener)}},"watchForExternalStorageChanges"),[key,setCurrent,defaultValue]),state2}__name(useSessionStorage,"useSessionStorage");function useSessionToggler(key,defaultValue=!1){const[toggled,setToggled]=useSessionStorage(key,defaultValue),toggle=reactExports.useCallback(e=>{e?.preventDefault?.(),setToggled(checked=>!checked)},[setToggled]),toggleOn=reactExports.useCallback(e=>{e?.preventDefault?.(),setToggled(!0)},[setToggled]),toggleOff=reactExports.useCallback(e=>{e?.preventDefault?.(),setToggled(!1)},[setToggled]);return reactExports.useMemo(()=>({toggled,setToggled,toggle,toggleOn,toggleOff}),[toggle,setToggled,toggleOff,toggleOn,toggled])}__name(useSessionToggler,"useSessionToggler");const EditorViewContext=reactExports.createContext(null);function useEditorView(){return reactExports.useContext(EditorViewContext)}__name(useEditorView,"useEditorView");async function dropComponent({file:file2,project,entityType,instanceClient}){const{data}=await instanceClient.post("/",{operation:"drop_component",file:file2||void 0,project,replicated:entityType==="cluster"});return data}__name(dropComponent,"dropComponent");function parseFileExtension(filename){const parts=(filename||"")?.split(".");return parts.length>1?parts.slice(-1)[0]:""}__name(parseFileExtension,"parseFileExtension");function hasImageFileExtension(filename){switch(parseFileExtension(filename).toLowerCase()){case"jpg":case"jpeg":case"gif":case"png":case"pneg":case"webp":return!0;default:return!1}}__name(hasImageFileExtension,"hasImageFileExtension");async function getComponentFile({instanceClient,file:file2,project,encoding}){const{data}=await instanceClient.post("/",{operation:"get_component_file",file:file2,project,encoding:encoding??(hasImageFileExtension(file2)?"base64":"utf8")});return{file:file2,project,...data}}__name(getComponentFile,"getComponentFile");function getComponentFileQueryOptions(params){return{queryKey:getComponentFileQueryKey(params),queryFn:__name(()=>getComponentFile(params),"queryFn"),enabled:!!params.file&&!!params.project,retry:!1}}__name(getComponentFileQueryOptions,"getComponentFileQueryOptions");function getComponentFileQueryKey(params){return[params.entityId,"get_component_file",params.file,params.project,params.encoding]}__name(getComponentFileQueryKey,"getComponentFileQueryKey");async function setComponentFile({file:file2,payload,project,entityType,instanceClient,encoding}){const{data}=await instanceClient.post("/",{operation:"set_component_file",file:file2,payload,project,encoding,replicated:entityType==="cluster"},{timeout:3e5});return data}__name(setComponentFile,"setComponentFile");function useSetComponentFile(){return useMutation({mutationFn:setComponentFile})}__name(useSetComponentFile,"useSetComponentFile");function useRenameFiles(){const{reloadRootEntries,setFocusedItem,setSelectedItems}=useEditorView(),instanceParams=useInstanceClientIdParams();return reactExports.useCallback(async changes=>{let canceled=!1;const actualChanges=changes.filter(change=>change.from!==change.to);if(actualChanges.length===0)return;const toastTitle=`Renaming ${pluralize(actualChanges.length,"File","Files")}`,toastConfig={duration:6e4,action:{label:"Cancel",onClick:__name(()=>{canceled=!0},"onClick")}};toastConfig.id=toast.loading(toastTitle,{...toastConfig,description:jsxRuntimeExports.jsx(ProgressBar,{animated:!0,width:"0%"})});const totalSteps=actualChanges.length*3;let currentStep=0;function stepForward(){currentStep+=1,toast.loading(toastTitle,{...toastConfig,description:jsxRuntimeExports.jsx(ProgressBar,{animated:!0,width:(currentStep===0?0:currentStep/totalSteps*100)+"%"})})}__name(stepForward,"stepForward");for(const change of actualChanges){const oldParts=change.from.split("/"),oldProject=oldParts.shift(),oldFile=oldParts.join("/"),newParts=change.to.split("/"),newProject=newParts.shift(),newFile=newParts.join("/"),fileContents=await getComponentFile({...instanceParams,file:oldFile,project:oldProject,encoding:"base64"});if(canceled||(stepForward(),await setComponentFile({...instanceParams,file:newFile,project:newProject,encoding:"base64",payload:fileContents.message}),canceled)||(stepForward(),await dropComponent({...instanceParams,file:oldFile,project:oldProject}),canceled))break;stepForward()}currentStep>=totalSteps?toast.success(`Renamed ${pluralize(actualChanges.length,"File","Files")}`,{id:toastConfig.id,description:"All done!",duration:3e3,action:{label:"OK",onClick:__name(()=>{},"onClick")}}):toast.warning("Rename Cancelled",{id:toastConfig.id,description:`${currentStep} of ${totalSteps} steps completed.`,duration:1e4,action:{label:"OK",onClick:__name(()=>{},"onClick")}}),reloadRootEntries(),setSelectedItems(selectedItems=>{const updatedSelectedItems=selectedItems.slice();for(const change of actualChanges){const existingIndex=updatedSelectedItems.indexOf(change.from);existingIndex>=0?updatedSelectedItems.splice(existingIndex,1,change.to):updatedSelectedItems.push(change.to)}return updatedSelectedItems}),setFocusedItem(focusedItem=>{for(const change of actualChanges)if(focusedItem===change.from)return change.to;return focusedItem})},[instanceParams,reloadRootEntries,setFocusedItem,setSelectedItems])}__name(useRenameFiles,"useRenameFiles");function itemKeyIsDefined(item,key){return item[key]!==void 0}__name(itemKeyIsDefined,"itemKeyIsDefined");function excludePropertyFalsy(key){return item=>itemKeyIsDefined(item,key)}__name(excludePropertyFalsy,"excludePropertyFalsy");function useWatchedValue(name2,defaultValue){const[value,setValue]=reactExports.useState({value:defaultValue});return useListener(name2,(newValue,trigger)=>setValue({value:newValue,trigger}),[setValue]),value}__name(useWatchedValue,"useWatchedValue");function setWatchedValue(name2,value,trigger){emitToListeners(name2,value,trigger)}__name(setWatchedValue,"setWatchedValue");function currySetWatchedValue(name2,value,trigger){return e=>setWatchedValue(name2,value,e)}__name(currySetWatchedValue,"currySetWatchedValue");function useSetWatchedValue(name2,value,trigger){return reactExports.useCallback(e=>{setWatchedValue(name2,value,e)},[name2,value,trigger])}__name(useSetWatchedValue,"useSetWatchedValue");const deleteShortcut={handleGlobal(key,modifiers){if((modifiers.cmd||modifiers.ctrl)&&key==="Delete")return setWatchedValue("ShowDeleteDirectoryOrFileModal",!0),!0},addEditorAction(monaco){return{id:"delete-file",label:"Delete File",keybindings:[monaco.KeyMod.CtrlCmd|monaco.KeyCode.Delete],run:currySetWatchedValue("ShowDeleteDirectoryOrFileModal",!0)}}},newDirectoryShortcut={handleGlobal(key,modifiers){if(modifiers.ctrl&&modifiers.alt&&modifiers.shift&&key==="˜")return setWatchedValue("ShowAddDirectoryOrFileModalType","directory"),!0},addEditorAction(monaco){return{id:"new-directory",label:"New Directory",keybindings:[monaco.KeyMod.WinCtrl|monaco.KeyMod.Alt|monaco.KeyMod.Shift|monaco.KeyCode.KeyN],run:currySetWatchedValue("ShowAddDirectoryOrFileModalType","directory")}}},newFileShortcut={handleGlobal(key,modifiers){if(modifiers.ctrl&&key==="n")return setWatchedValue("ShowAddDirectoryOrFileModalType","file"),!0},addEditorAction(monaco){return{id:"new-file",label:"New File",keybindings:[monaco.KeyMod.WinCtrl|monaco.KeyCode.KeyN],run:currySetWatchedValue("ShowAddDirectoryOrFileModalType","file")}}},renameFileShortcut={handleGlobal(key){if(key==="F2")return setWatchedValue("ShowRenameFileModal","file"),!0},addEditorAction(monaco){return{id:"rename-file",label:"Rename File",keybindings:[monaco.KeyMod.WinCtrl|monaco.KeyMod.Alt|monaco.KeyCode.KeyR,monaco.KeyCode.F2],run:currySetWatchedValue("ShowRenameFileModal",!0)}}},revertFileShortcut={addEditorAction(){return{id:"revert-file",label:"Revert File",run:curryEmitToListeners("RevertChanges",!0)}}},saveChangesShortcut={handleGlobal(key,modifiers){if(modifiers.cmd&&key==="s")return emitToListeners("SaveFile",!0),!0},addEditorAction(monaco){return{id:"save-file",label:"Save Changes",keybindings:[monaco.KeyMod.CtrlCmd|monaco.KeyCode.KeyS],run:curryEmitToListeners("SaveFile",!0)}}},shortcuts=[deleteShortcut,newDirectoryShortcut,newFileShortcut,renameFileShortcut,revertFileShortcut,saveChangesShortcut],editorShortcuts=shortcuts.filter(excludePropertyFalsy("addEditorAction")),globalShortcuts=shortcuts.filter(excludePropertyFalsy("handleGlobal"));function registerWithEditor(mounted){const[editor,monaco]=mounted,disposables=editorShortcuts.map(shortcut=>editor.addAction(shortcut.addEditorAction(monaco)));return()=>{for(const disposable of disposables)disposable?.dispose()}}__name(registerWithEditor,"registerWithEditor");function useGlobalShortcutKeys(){reactExports.useEffect(()=>(document.addEventListener("keydown",keyDownHandler),()=>{document.removeEventListener("keydown",keyDownHandler)}),[])}__name(useGlobalShortcutKeys,"useGlobalShortcutKeys");function keyDownHandler(e){const cmd=e.getModifierState("Meta"),alt=e.getModifierState("Alt"),shift2=e.getModifierState("Shift"),ctrl=e.getModifierState("Control"),modifiers={cmd,alt,shift:shift2,ctrl};for(const globalShortcut of globalShortcuts)if(globalShortcut.handleGlobal(e.key,modifiers)){e.preventDefault();return}}__name(keyDownHandler,"keyDownHandler");function extractFileNameFromPath(path){return path.split("/").pop()}__name(extractFileNameFromPath,"extractFileNameFromPath");function joinPath(...parts){return parts.flat(1).join("/")}__name(joinPath,"joinPath");var InteractionMode;(function(InteractionMode2){InteractionMode2.DoubleClickItemToExpand="double-click-item-to-expand",InteractionMode2.ClickItemToExpand="click-item-to-expand",InteractionMode2.ClickArrowToExpand="click-arrow-to-expand"})(InteractionMode||(InteractionMode={}));var __assign$a=function(){return __assign$a=Object.assign||function(t2){for(var s2,i2=1,n2=arguments.length;i2<n2;i2++){s2=arguments[i2];for(var p in s2)Object.prototype.hasOwnProperty.call(s2,p)&&(t2[p]=s2[p])}return t2},__assign$a.apply(this,arguments)},mergeInteractionManagers=__name(function(main,fallback){return{mode:main.mode,createInteractiveElementProps:__name(function(item,treeId,actions,renderFlags){return __assign$a(__assign$a({},fallback.createInteractiveElementProps(item,treeId,actions,renderFlags)),main.createInteractiveElementProps(item,treeId,actions,renderFlags))},"createInteractiveElementProps")}},"mergeInteractionManagers"),isControlKey=__name(function(e){return e.ctrlKey||navigator.platform.toUpperCase().indexOf("MAC")>=0&&e.metaKey},"isControlKey"),DoubleClickItemToExpandInteractionManager=(function(){function DoubleClickItemToExpandInteractionManager2(environment){this.mode=InteractionMode.DoubleClickItemToExpand,this.environment=environment}return __name(DoubleClickItemToExpandInteractionManager2,"DoubleClickItemToExpandInteractionManager"),DoubleClickItemToExpandInteractionManager2.prototype.createInteractiveElementProps=function(item,treeId,actions,renderFlags){var _this=this;return{onClick:__name(function(e){var isSpacebarEvent=e.detail===0;actions.focusItem(),e.shiftKey&&!isSpacebarEvent?actions.selectUpTo(!isControlKey(e)):isControlKey(e)&&!isSpacebarEvent?renderFlags.isSelected?actions.unselectItem():actions.addToSelectedItems():actions.selectItem()},"onClick"),onDoubleClick:__name(function(){actions.focusItem(),actions.selectItem(),item.isFolder&&actions.toggleExpandedState(),(!item.isFolder||_this.environment.canInvokePrimaryActionOnItemContainer)&&actions.primaryAction()},"onDoubleClick"),onFocus:__name(function(){actions.focusItem()},"onFocus"),onDragStart:__name(function(e){e.dataTransfer.dropEffect="move",actions.startDragging()},"onDragStart"),onDragOver:__name(function(e){e.preventDefault()},"onDragOver"),draggable:renderFlags.canDrag&&!renderFlags.isRenaming,tabIndex:renderFlags.isRenaming?void 0:renderFlags.isFocused?0:-1}},DoubleClickItemToExpandInteractionManager2})(),ClickItemToExpandInteractionManager=(function(){function ClickItemToExpandInteractionManager2(environment){this.mode=InteractionMode.ClickItemToExpand,this.environment=environment}return __name(ClickItemToExpandInteractionManager2,"ClickItemToExpandInteractionManager"),ClickItemToExpandInteractionManager2.prototype.createInteractiveElementProps=function(item,treeId,actions,renderFlags){var _this=this;return{onClick:__name(function(e){var isSpacebarEvent=e.detail===0;actions.focusItem(),e.shiftKey&&!isSpacebarEvent?actions.selectUpTo(!isControlKey(e)):isControlKey(e)&&!isSpacebarEvent?renderFlags.isSelected?actions.unselectItem():actions.addToSelectedItems():(item.isFolder&&actions.toggleExpandedState(),actions.selectItem(),(!item.isFolder||_this.environment.canInvokePrimaryActionOnItemContainer)&&actions.primaryAction())},"onClick"),onFocus:__name(function(){actions.focusItem()},"onFocus"),onDragStart:__name(function(e){e.dataTransfer.dropEffect="move",actions.startDragging()},"onDragStart"),onDragOver:__name(function(e){e.preventDefault()},"onDragOver"),draggable:renderFlags.canDrag&&!renderFlags.isRenaming,tabIndex:renderFlags.isRenaming?void 0:renderFlags.isFocused?0:-1}},ClickItemToExpandInteractionManager2})(),ClickArrowToExpandInteractionManager=(function(){function ClickArrowToExpandInteractionManager2(environment){this.mode=InteractionMode.ClickItemToExpand,this.environment=environment}return __name(ClickArrowToExpandInteractionManager2,"ClickArrowToExpandInteractionManager"),ClickArrowToExpandInteractionManager2.prototype.createInteractiveElementProps=function(item,treeId,actions,renderFlags){var _this=this;return{onClick:__name(function(e){var isSpacebarEvent=e.detail===0;actions.focusItem(),e.shiftKey&&!isSpacebarEvent?actions.selectUpTo(!isControlKey(e)):isControlKey(e)&&!isSpacebarEvent?renderFlags.isSelected?actions.unselectItem():actions.addToSelectedItems():(actions.selectItem(),(!item.isFolder||_this.environment.canInvokePrimaryActionOnItemContainer)&&actions.primaryAction())},"onClick"),onFocus:__name(function(){actions.focusItem()},"onFocus"),onDragStart:__name(function(e){e.dataTransfer.dropEffect="move",actions.startDragging()},"onDragStart"),onDragOver:__name(function(e){e.preventDefault()},"onDragOver"),draggable:renderFlags.canDrag&&!renderFlags.isRenaming,tabIndex:renderFlags.isRenaming?void 0:renderFlags.isFocused?0:-1}},ClickArrowToExpandInteractionManager2})(),buildInteractionMode=__name(function(mode,environment){switch(mode){case InteractionMode.DoubleClickItemToExpand:return new DoubleClickItemToExpandInteractionManager(environment);case InteractionMode.ClickItemToExpand:return new ClickItemToExpandInteractionManager(environment);case InteractionMode.ClickArrowToExpand:return new ClickArrowToExpandInteractionManager(environment);default:throw Error("Unknown interaction mode ".concat(mode))}},"buildInteractionMode"),InteractionManagerContext=reactExports.createContext(null),useInteractionManager=__name(function(){return reactExports.useContext(InteractionManagerContext)},"useInteractionManager"),InteractionManagerProvider=__name(function(_a20){var children=_a20.children,environment=useTreeEnvironment(),defaultInteractionMode=environment.defaultInteractionMode,interactionManager=reactExports.useMemo(function(){var _a21;return defaultInteractionMode&&typeof defaultInteractionMode!="string"?defaultInteractionMode.extends?mergeInteractionManagers(defaultInteractionMode,buildInteractionMode(defaultInteractionMode.extends,environment)):defaultInteractionMode:buildInteractionMode((_a21=defaultInteractionMode)!==null&&_a21!==void 0?_a21:InteractionMode.ClickItemToExpand,environment)},[]);return reactExports.createElement(InteractionManagerContext.Provider,{value:interactionManager},children)},"InteractionManagerProvider"),useCanDropAt=__name(function(){var environment=useTreeEnvironment();return reactExports.useCallback(function(draggingPosition,draggingItems){if(draggingPosition.targetType==="between-items"){if(!environment.canReorderItems)return!1}else if(draggingPosition.targetType==="root"){if(!environment.canDropOnFolder)return!1}else{var resolvedItem=environment.items[draggingPosition.targetItem];if(!resolvedItem||!environment.canDropOnFolder&&resolvedItem.isFolder||!environment.canDropOnNonFolder&&!resolvedItem.isFolder||draggingItems.some(function(draggingItem){return draggingItem.index===draggingPosition.targetItem}))return!1}return!(environment.canDropAt&&(!draggingItems||!environment.canDropAt(draggingItems,draggingPosition)))},[environment])},"useCanDropAt"),useGetGetParentOfLinearItem=__name(function(){var environment=useTreeEnvironment();return reactExports.useCallback(function(itemLinearIndex,treeId){for(var linearItems=environment.linearItems[treeId],depth=linearItems[itemLinearIndex].depth,parentLinearIndex=itemLinearIndex;linearItems[parentLinearIndex]&&linearItems[parentLinearIndex].depth!==depth-1;parentLinearIndex-=1);var parent=linearItems[parentLinearIndex];return parent||(parent={item:environment.trees[treeId].rootItem,depth:0},parentLinearIndex=0),{parent,parentLinearIndex}},[environment.linearItems,environment.trees])},"useGetGetParentOfLinearItem"),useGetViableDragPositions=__name(function(){var environment=useTreeEnvironment(),getParentOfLinearItem=useGetGetParentOfLinearItem(),canDropAt=useCanDropAt(),isDescendant=reactExports.useCallback(function(treeId,itemLinearIndex,potentialParents){var _a20=getParentOfLinearItem(itemLinearIndex,treeId),parent=_a20.parent,parentLinearIndex=_a20.parentLinearIndex;return potentialParents.some(function(p){return p.index===parent.item})?!0:parent.depth===0?!1:isDescendant(treeId,parentLinearIndex,potentialParents)},[getParentOfLinearItem]);return reactExports.useCallback(function(treeId,draggingItems){for(var _a20,_b,_c,_d,linearItems=environment.linearItems[treeId],targets=[],skipUntilDepthIsLowerThan=-1,linearIndex=0;linearIndex<linearItems.length;linearIndex++){var _e=linearItems[linearIndex],item=_e.item,depth=_e.depth;if(!(skipUntilDepthIsLowerThan!==-1&&depth>skipUntilDepthIsLowerThan)){skipUntilDepthIsLowerThan=-1;var parent_1=getParentOfLinearItem(linearIndex,treeId).parent,childIndex=environment.items[parent_1.item].children.indexOf(item);if(isDescendant(treeId,linearIndex,draggingItems)){skipUntilDepthIsLowerThan=depth+1;continue}var itemPosition={targetType:"item",parentItem:parent_1.item,targetItem:item,linearIndex,depth,treeId},topPosition={targetType:"between-items",parentItem:parent_1.item,linePosition:"top",childIndex,depth,treeId,linearIndex},bottomPosition={targetType:"between-items",parentItem:parent_1.item,linePosition:"bottom",linearIndex:linearIndex+1,childIndex:childIndex+1,depth,treeId},depthOfItemAbove=(_b=(_a20=linearItems[linearIndex-1])===null||_a20===void 0?void 0:_a20.depth)!==null&&_b!==void 0?_b:-1,depthOfItemBelow=(_d=(_c=linearItems[linearIndex+1])===null||_c===void 0?void 0:_c.depth)!==null&&_d!==void 0?_d:-1,isWithinFolder=depth===depthOfItemAbove,isBelowOpenFolder=depth===depthOfItemBelow-1;!isWithinFolder&&canDropAt(topPosition,draggingItems)&&targets.push(topPosition),canDropAt(itemPosition,draggingItems)&&targets.push(itemPosition),!isBelowOpenFolder&&canDropAt(bottomPosition,draggingItems)&&targets.push(bottomPosition)}}return targets},[canDropAt,environment.items,environment.linearItems,getParentOfLinearItem,isDescendant])},"useGetViableDragPositions"),__spreadArray$4=function(to,from,pack){if(pack||arguments.length===2)for(var i2=0,l2=from.length,ar2;i2<l2;i2++)(ar2||!(i2 in from))&&(ar2||(ar2=Array.prototype.slice.call(from,0,i2)),ar2[i2]=from[i2]);return to.concat(ar2||Array.prototype.slice.call(from))},useSideEffect=__name(function(effect,deps,changeOn){var previousRef=reactExports.useRef();reactExports.useEffect(function(){if(!previousRef.current)previousRef.current=__spreadArray$4([],changeOn,!0),effect();else{var changed=previousRef.current.some(function(v2,i2){return v2!==changeOn[i2]});changed&&(previousRef.current=__spreadArray$4([],changeOn,!0),effect())}},__spreadArray$4(__spreadArray$4([],deps,!0),changeOn,!0))},"useSideEffect"),__assign$9=function(){return __assign$9=Object.assign||function(t2){for(var s2,i2=1,n2=arguments.length;i2<n2;i2++){s2=arguments[i2];for(var p in s2)Object.prototype.hasOwnProperty.call(s2,p)&&(t2[p]=s2[p])}return t2},__assign$9.apply(this,arguments)},buildMapForTrees=__name(function(treeIds,build){return treeIds.map(function(id2){return[id2,build(id2)]}).reduce(function(a2,_a20){var _b,id2=_a20[0],obj=_a20[1];return __assign$9(__assign$9({},a2),(_b={},_b[id2]=obj,_b))},{})},"buildMapForTrees"),getDocument=__name(function(){return typeof document<"u"?document:void 0},"getDocument");function useCallSoon(dontClean){dontClean===void 0&&(dontClean=!1);var handleRef=reactExports.useRef(new Array);return reactExports.useEffect(function(){if(dontClean)return function(){};var handles=handleRef.current;return function(){return handles.forEach(function(handle){return cancelAnimationFrame(handle)})}},[dontClean,handleRef]),reactExports.useCallback(function(callback){var handle=requestAnimationFrame(function(){handleRef.current.splice(handleRef.current.indexOf(handle),1),callback()});handleRef.current.push(handle)},[handleRef])}__name(useCallSoon,"useCallSoon");var useRefCopy=__name(function(value){var ref=reactExports.useRef(value);return ref.current=value,ref},"useRefCopy"),useStableHandler=__name(function(handler){var handlerRef=useRefCopy(handler);return reactExports.useCallback((function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];return handlerRef.current.apply(handlerRef,args)}),[handlerRef])},"useStableHandler"),useGetOriginalItemOrder=__name(function(){var env2=useTreeEnvironment();return useStableHandler(function(treeId,items){return items.map(function(item){return[item,env2.linearItems[treeId].findIndex(function(linearItem){return linearItem.item===item.index})]}).sort(function(_a20,_b){_a20[0];var aPos=_a20[1];_b[0];var bPos=_b[1];return aPos-bPos}).map(function(_a20){var item=_a20[0];return item})})},"useGetOriginalItemOrder"),computeItemHeight=__name(function(treeId){var _a20,firstItem=(_a20=getDocument())===null||_a20===void 0?void 0:_a20.querySelector('[data-rct-tree="'.concat(treeId,'"] [data-rct-item-container="true"]'));if(firstItem){var style=getComputedStyle(firstItem);return firstItem.offsetHeight+Math.max(parseFloat(style.marginTop),parseFloat(style.marginBottom))}return 5},"computeItemHeight"),isOutsideOfContainer=__name(function(e,treeBb){return e.clientX<=treeBb.left||e.clientX>=treeBb.right||e.clientY<=treeBb.top||e.clientY>=treeBb.bottom},"isOutsideOfContainer"),DraggingPositionEvaluation=(function(){function DraggingPositionEvaluation2(env2,e,treeId,hoveringPosition,draggingItems,getParentOfLinearItem){this.env=env2,this.e=e,this.treeId=treeId,this.linearIndex=hoveringPosition.linearIndex,this.offset=hoveringPosition.offset,this.indentation=hoveringPosition.indentation,this.targetItem=this.env.linearItems[this.treeId][this.linearIndex],this.getParentOfLinearItem=getParentOfLinearItem,this.draggingItems=draggingItems}return __name(DraggingPositionEvaluation2,"DraggingPositionEvaluation"),DraggingPositionEvaluation2.prototype.getEmptyTreeDragPosition=function(){return{targetType:"root",treeId:this.treeId,depth:0,linearIndex:0,targetItem:this.env.trees[this.treeId].rootItem}},DraggingPositionEvaluation2.prototype.maybeRedirectToParent=function(){var redirectTargetToParent=!this.env.canReorderItems&&!this.env.canDropOnNonFolder&&!this.env.items[this.targetItem.item].isFolder;if(redirectTargetToParent){var _a20=this.getParentOfLinearItem(this.linearIndex,this.treeId),parentLinearIndex=_a20.parentLinearIndex,parent_1=_a20.parent;this.targetItem=parent_1,this.linearIndex=parentLinearIndex}},DraggingPositionEvaluation2.prototype.maybeReparentUpwards=function(){var _a20,_b;if(this.indentation!==void 0){var treeLinearItems=this.env.linearItems[this.treeId],deepestDepth=treeLinearItems[this.linearIndex].depth,legalDropDepthCount=deepestDepth-((_b=(_a20=treeLinearItems[this.linearIndex+1])===null||_a20===void 0?void 0:_a20.depth)!==null&&_b!==void 0?_b:0),canReparentUpwards=this.offset==="bottom"&&legalDropDepthCount>0;if(canReparentUpwards){for(var droppingIndent=Math.max(deepestDepth-legalDropDepthCount,this.indentation),newParent={parentLinearIndex:this.linearIndex,parent:this.targetItem},insertionItemAbove,i2=deepestDepth;i2>=droppingIndent;i2-=1)insertionItemAbove=newParent,newParent=this.getParentOfLinearItem(newParent.parentLinearIndex,this.treeId);if(this.indentation!==treeLinearItems[this.linearIndex].depth&&insertionItemAbove){var reparentedChildIndex=this.env.items[newParent.parent.item].children.indexOf(insertionItemAbove.parent.item)+1;if(!(this.draggingItems&&this.isDescendant(this.treeId,newParent.parentLinearIndex+1,this.draggingItems)))return{targetType:"between-items",treeId:this.treeId,parentItem:newParent.parent.item,depth:droppingIndent,linearIndex:this.linearIndex+1,childIndex:reparentedChildIndex,linePosition:"bottom"}}}}},DraggingPositionEvaluation2.prototype.maybeRedirectInsideOpenFolder=function(){var nextItem=this.env.linearItems[this.treeId][this.linearIndex+1],redirectInsideOpenFolder=!this.env.canDropBelowOpenFolders&&nextItem&&this.targetItem.depth===nextItem.depth-1&&this.offset==="bottom";redirectInsideOpenFolder&&(this.targetItem=nextItem,this.linearIndex+=1,this.offset="top")},DraggingPositionEvaluation2.prototype.maybeMapToBottomOffset=function(){var priorItem=this.env.linearItems[this.treeId][this.linearIndex-1];if(!(!priorItem||priorItem?.depth===void 0)){var depthDistanceToPrior=priorItem.depth-this.targetItem.depth;this.offset==="top"&&(depthDistanceToPrior===0||depthDistanceToPrior>0&&this.indentation!==void 0)&&(this.offset="bottom",this.linearIndex-=1,this.targetItem=this.env.linearItems[this.treeId][this.linearIndex])}},DraggingPositionEvaluation2.prototype.canDropAtCurrentTarget=function(){var _this=this,_a20,targetItemData=this.env.items[this.targetItem.item];return!(!this.offset&&!this.env.canDropOnNonFolder&&!targetItemData.isFolder||!this.offset&&!this.env.canDropOnFolder&&targetItemData.isFolder||this.offset&&!this.env.canReorderItems||!((_a20=this.draggingItems)===null||_a20===void 0)&&_a20.some(function(draggingItem){return draggingItem.index===_this.targetItem.item}))},DraggingPositionEvaluation2.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 reparented=this.maybeReparentUpwards();if(reparented)return reparented;if(this.areDraggingItemsDescendantOfTarget()||!this.canDropAtCurrentTarget())return"invalid";var parent=this.getParentOfLinearItem(this.linearIndex,this.treeId).parent,newChildIndex=this.env.items[parent.item].children.indexOf(this.targetItem.item)+(this.offset==="top"?0:1);return this.offset?{targetType:"between-items",treeId:this.treeId,parentItem:parent.item,depth:this.targetItem.depth,linearIndex:this.linearIndex+(this.offset==="top"?0:1),childIndex:newChildIndex,linePosition:this.offset}:{targetType:"item",treeId:this.treeId,parentItem:parent.item,targetItem:this.targetItem.item,depth:this.targetItem.depth,linearIndex:this.linearIndex}}},DraggingPositionEvaluation2.prototype.isDescendant=function(treeId,itemLinearIndex,potentialParents){var _a20=this.getParentOfLinearItem(itemLinearIndex,treeId),parentLinearIndex=_a20.parentLinearIndex,parent=_a20.parent;return potentialParents.some(function(p){return p.index===parent.item})?!0:parent.depth===0?!1:this.isDescendant(treeId,parentLinearIndex,potentialParents)},DraggingPositionEvaluation2.prototype.areDraggingItemsDescendantOfTarget=function(){return this.draggingItems&&this.isDescendant(this.treeId,this.linearIndex,this.draggingItems)},DraggingPositionEvaluation2})(),useDraggingPosition=__name(function(){var dragCode=reactExports.useRef("initial"),_a20=reactExports.useState(void 0),draggingItems=_a20[0],setDraggingItems=_a20[1],itemHeight=reactExports.useRef(0),env2=useTreeEnvironment(),getParentOfLinearItem=useGetGetParentOfLinearItem(),isNewDragPosition=useStableHandler(function(e,treeId,hoveringPosition){if(!hoveringPosition)return!1;var offset2=hoveringPosition.offset,linearIndex=hoveringPosition.linearIndex,newDragCode="".concat(treeId,"__").concat(linearIndex,"__").concat(offset2??"","__").concat(hoveringPosition.indentation);return newDragCode!==dragCode.current?(dragCode.current=newDragCode,!0):!1}),getHoveringPosition=useStableHandler(function(e,treeId,containerRef){if(containerRef.current){var treeBb=containerRef.current.getBoundingClientRect();if(!isOutsideOfContainer(e,treeBb)){var hoveringPosition=(e.clientY-treeBb.top)/itemHeight.current,treeLinearItems=env2.linearItems[treeId],linearIndex=Math.min(Math.max(0,Math.floor(hoveringPosition)),treeLinearItems.length-1);if(treeLinearItems.length===0)return{linearIndex:0,offset:"bottom",indentation:0};var targetLinearItem=treeLinearItems[linearIndex],targetItem=env2.items[targetLinearItem.item],indentation=env2.renderDepthOffset?Math.max(Math.floor((e.clientX-treeBb.left)/env2.renderDepthOffset),0):void 0,offset2,lineThreshold=env2.canReorderItems?targetItem?.isFolder&&env2.canDropOnFolder||env2.canDropOnNonFolder?.2:.5:0;return hoveringPosition-.5>=treeLinearItems.length-1?offset2="bottom":hoveringPosition%1<lineThreshold?offset2="top":hoveringPosition%1>1-lineThreshold&&(offset2="bottom"),{linearIndex,offset:offset2,indentation}}}}),getDraggingPosition=useStableHandler(function(e,treeId,containerRef){var hoveringPosition=getHoveringPosition(e,treeId,containerRef);if(isNewDragPosition(e,treeId,hoveringPosition))return!draggingItems||!env2.canDragAndDrop||!hoveringPosition||e.clientX<0||e.clientY<0?"invalid":new DraggingPositionEvaluation(env2,e,treeId,hoveringPosition,draggingItems,getParentOfLinearItem).getDraggingPosition()}),initiateDraggingPosition=useStableHandler(function(treeId,items){setDraggingItems(items),dragCode.current="initial",itemHeight.current=computeItemHeight(treeId)}),resetDraggingPosition=useStableHandler(function(){setDraggingItems(void 0),dragCode.current="initial",itemHeight.current=0});return{initiateDraggingPosition,resetDraggingPosition,draggingItems,getDraggingPosition,itemHeight}},"useDraggingPosition"),DragAndDropContext=reactExports.createContext(null),useDragAndDrop=__name(function(){return reactExports.useContext(DragAndDropContext)},"useDragAndDrop"),DragAndDropProvider=__name(function(_a20){var children=_a20.children,environment=useTreeEnvironment(),_b=reactExports.useState(!1),isProgrammaticallyDragging=_b[0],setIsProgrammaticallyDragging=_b[1],_c=reactExports.useState({}),viableDragPositions=_c[0],setViableDragPositions=_c[1],_d=reactExports.useState(0),programmaticDragIndex=_d[0],setProgrammaticDragIndex=_d[1],_e=reactExports.useState(),draggingPosition=_e[0],setDraggingPosition=_e[1],getViableDragPositions=useGetViableDragPositions(),callSoon=useCallSoon(),getOriginalItemOrder=useGetOriginalItemOrder(),_f=useDraggingPosition(),initiateDraggingPosition=_f.initiateDraggingPosition,resetDraggingPosition=_f.resetDraggingPosition,draggingItems=_f.draggingItems,getDraggingPosition=_f.getDraggingPosition,itemHeight=_f.itemHeight,resetProgrammaticDragIndexForCurrentTree=reactExports.useCallback(function(viableDragPositions2,draggingItems2){var _a21;if(environment.activeTreeId&&(!((_a21=environment.viewState[environment.activeTreeId])===null||_a21===void 0)&&_a21.focusedItem)&&environment.linearItems&&draggingItems2){var focusItem_1=environment.viewState[environment.activeTreeId].focusedItem,treeDragPositions=getViableDragPositions(environment.activeTreeId,draggingItems2),newPos=treeDragPositions.findIndex(function(pos){return pos.targetType==="item"?pos.targetItem===focusItem_1:pos.targetType==="between-items"?environment.items[pos.parentItem].children[pos.childIndex]===focusItem_1:!1});setProgrammaticDragIndex(newPos?Math.min(newPos+1,treeDragPositions.length-1):0)}else setProgrammaticDragIndex(0)},[environment.activeTreeId,environment.items,environment.linearItems,environment.viewState,getViableDragPositions]),resetState=useStableHandler(function(){setIsProgrammaticallyDragging(!1),setViableDragPositions({}),setProgrammaticDragIndex(0),setDraggingPosition(void 0),resetDraggingPosition()});useSideEffect(function(){environment.activeTreeId&&environment.linearItems[environment.activeTreeId]&&viableDragPositions[environment.activeTreeId]&&resetProgrammaticDragIndexForCurrentTree(viableDragPositions[environment.activeTreeId],draggingItems)},[draggingItems,environment.activeTreeId,environment.linearItems,resetProgrammaticDragIndexForCurrentTree,viableDragPositions],[environment.activeTreeId]),useSideEffect(function(){isProgrammaticallyDragging&&environment.activeTreeId&&setDraggingPosition(viableDragPositions[environment.activeTreeId][programmaticDragIndex])},[programmaticDragIndex,environment.activeTreeId,isProgrammaticallyDragging,viableDragPositions],[programmaticDragIndex,environment.activeTreeId]);var canDropAt=useCanDropAt(),performDrag=__name(function(draggingPosition2){var _a21;draggingItems&&!canDropAt(draggingPosition2,draggingItems)||(setDraggingPosition(draggingPosition2),environment.setActiveTree(draggingPosition2.treeId),draggingItems&&environment.activeTreeId!==draggingPosition2.treeId&&((_a21=environment.onSelectItems)===null||_a21===void 0||_a21.call(environment,draggingItems.map(function(item){return item.index}),draggingPosition2.treeId)))},"performDrag"),onDragOverTreeHandler=useStableHandler(function(e,treeId,containerRef){if(draggingItems){var newDraggingPosition=getDraggingPosition(e,treeId,containerRef);if(newDraggingPosition){if(newDraggingPosition==="invalid"){setDraggingPosition(void 0);return}performDrag(newDraggingPosition)}}}),onDragLeaveContainerHandler=useStableHandler(function(e,containerRef){containerRef.current&&isOutsideOfContainer(e,containerRef.current.getBoundingClientRect())&&setDraggingPosition(void 0)}),onDropHandler=useStableHandler(function(){!draggingItems||!draggingPosition||!environment.onDrop||(environment.onDrop(draggingItems,draggingPosition),callSoon(function(){var _a21;(_a21=environment.onFocusItem)===null||_a21===void 0||_a21.call(environment,draggingItems[0],draggingPosition.treeId),resetState()}))}),onStartDraggingItems=reactExports.useCallback(function(items,treeId){var treeViableDragPositions=buildMapForTrees(environment.treeIds,function(treeId2){return getViableDragPositions(treeId2,items)});initiateDraggingPosition(treeId,items),setViableDragPositions(treeViableDragPositions),environment.activeTreeId&&resetProgrammaticDragIndexForCurrentTree(treeViableDragPositions[environment.activeTreeId],items)},[environment.activeTreeId,environment.treeIds,getViableDragPositions,initiateDraggingPosition,resetProgrammaticDragIndexForCurrentTree]),startProgrammaticDrag=reactExports.useCallback(function(){var _a21,_b2,_c2;if(environment.canDragAndDrop&&environment.activeTreeId){var draggingItems_1=(_b2=(_a21=environment.viewState[environment.activeTreeId])===null||_a21===void 0?void 0:_a21.selectedItems)!==null&&_b2!==void 0?_b2:[(_c2=environment.viewState[environment.activeTreeId])===null||_c2===void 0?void 0:_c2.focusedItem];if(draggingItems_1.length===0||draggingItems_1[0]===void 0)return;var resolvedDraggingItems=getOriginalItemOrder(environment.activeTreeId,draggingItems_1.map(function(id2){return environment.items[id2]}));if(environment.canDrag&&!environment.canDrag(resolvedDraggingItems))return;onStartDraggingItems(resolvedDraggingItems,environment.activeTreeId),setTimeout(function(){setIsProgrammaticallyDragging(!0)})}},[environment,getOriginalItemOrder,onStartDraggingItems]),abortProgrammaticDrag=reactExports.useCallback(function(){resetState()},[resetState]),completeProgrammaticDrag=reactExports.useCallback(function(){onDropHandler(),resetState()},[onDropHandler,resetState]),programmaticDragUp=reactExports.useCallback(function(){setProgrammaticDragIndex(function(oldIndex){return Math.max(0,oldIndex-1)})},[]),programmaticDragDown=reactExports.useCallback(function(){environment.activeTreeId&&setProgrammaticDragIndex(function(oldIndex){return Math.min(viableDragPositions[environment.activeTreeId].length-1,oldIndex+1)})},[environment.activeTreeId,viableDragPositions]),dnd=reactExports.useMemo(function(){return{onStartDraggingItems,startProgrammaticDrag,abortProgrammaticDrag,completeProgrammaticDrag,programmaticDragUp,programmaticDragDown,draggingItems,draggingPosition,itemHeight:itemHeight.current,isProgrammaticallyDragging,onDragOverTreeHandler,onDragLeaveContainerHandler,viableDragPositions}},[abortProgrammaticDrag,completeProgrammaticDrag,draggingItems,draggingPosition,isProgrammaticallyDragging,itemHeight,onDragOverTreeHandler,onDragLeaveContainerHandler,onStartDraggingItems,programmaticDragDown,programmaticDragUp,startProgrammaticDrag,viableDragPositions]);return reactExports.useEffect(function(){return window.addEventListener("dragend",resetState),window.addEventListener("drop",onDropHandler),function(){window.removeEventListener("dragend",resetState),window.removeEventListener("drop",onDropHandler)}},[onDropHandler,resetState]),reactExports.createElement(DragAndDropContext.Provider,{value:dnd},children)},"DragAndDropProvider"),__assign$8=function(){return __assign$8=Object.assign||function(t2){for(var s2,i2=1,n2=arguments.length;i2<n2;i2++){s2=arguments[i2];for(var p in s2)Object.prototype.hasOwnProperty.call(s2,p)&&(t2[p]=s2[p])}return t2},__assign$8.apply(this,arguments)},useCreatedEnvironmentRef=__name(function(ref,actions){var environment=useTreeEnvironment(),dnd=useDragAndDrop();reactExports.useImperativeHandle(ref,function(){return __assign$8(__assign$8(__assign$8({},actions),environment),{treeEnvironmentContext:environment,dragAndDropContext:dnd})})},"useCreatedEnvironmentRef"),waitFor=__name(function(check2,intervalMs,timeoutMs){return intervalMs===void 0&&(intervalMs=50),timeoutMs===void 0&&(timeoutMs=1e4),new Promise(function(resolve){check2()&&resolve();var complete,interval=setInterval(function(){check2()&&complete()},intervalMs),timeout=setTimeout(function(){complete()},timeoutMs);complete=__name(function(){clearInterval(interval),clearTimeout(timeout),resolve()},"complete")})},"waitFor"),__awaiter=function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}return __name(adopt,"adopt"),new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}__name(fulfilled,"fulfilled");function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}__name(rejected,"rejected");function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}__name(step,"step"),step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=function(thisArg,body){var _2={label:0,sent:__name(function(){if(t2[0]&1)throw t2[1];return t2[1]},"sent"),trys:[],ops:[]},f,y,t2,g;return g={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n2){return function(v2){return step([n2,v2])}}function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_2=0)),_2;)try{if(f=1,y&&(t2=op[0]&2?y.return:op[0]?y.throw||((t2=y.return)&&t2.call(y),0):y.next)&&!(t2=t2.call(y,op[1])).done)return t2;switch(y=0,t2&&(op=[op[0]&2,t2.value]),op[0]){case 0:case 1:t2=op;break;case 4:return _2.label++,{value:op[1],done:!1};case 5:_2.label++,y=op[1],op=[0];continue;case 7:op=_2.ops.pop(),_2.trys.pop();continue;default:if(t2=_2.trys,!(t2=t2.length>0&&t2[t2.length-1])&&(op[0]===6||op[0]===2)){_2=0;continue}if(op[0]===3&&(!t2||op[1]>t2[0]&&op[1]<t2[3])){_2.label=op[1];break}if(op[0]===6&&_2.label<t2[1]){_2.label=t2[1],t2=op;break}if(t2&&_2.label<t2[2]){_2.label=t2[2],_2.ops.push(op);break}t2[2]&&_2.ops.pop(),_2.trys.pop();continue}op=body.call(thisArg,_2)}catch(e){op=[6,e],y=0}finally{f=t2=0}if(op[0]&5)throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}},__spreadArray$3=function(to,from,pack){if(pack||arguments.length===2)for(var i2=0,l2=from.length,ar2;i2<l2;i2++)(ar2||!(i2 in from))&&(ar2||(ar2=Array.prototype.slice.call(from,0,i2)),ar2[i2]=from[i2]);return to.concat(ar2||Array.prototype.slice.call(from))},EnvironmentActionsContext$1=reactExports.createContext(null),useEnvironmentActions=__name(function(){return reactExports.useContext(EnvironmentActionsContext$1)},"useEnvironmentActions"),recursiveExpand=__name(function(itemId,items,onExpand){return __awaiter(void 0,void 0,void 0,function(){var _loop_1,_i,_a20,childId,_b,_c,_d;return __generator(this,function(_e){for(_loop_1=__name(function(childId2){waitFor(function(){var _a21;return!!(!((_a21=items.current)===null||_a21===void 0)&&_a21[childId2])}).then(function(){var _a21,item=(_a21=items.current)===null||_a21===void 0?void 0:_a21[childId2];item?.isFolder&&(onExpand(item),recursiveExpand(childId2,items,onExpand))})},"_loop_1"),_i=0,_a20=(_d=(_c=(_b=items.current)===null||_b===void 0?void 0:_b[itemId])===null||_c===void 0?void 0:_c.children)!==null&&_d!==void 0?_d:[];_i<_a20.length;_i++)childId=_a20[_i],_loop_1(childId);return[2]})})},"recursiveExpand"),EnvironmentActionsProvider=reactExports.forwardRef(function(props,ref){var _a20=useTreeEnvironment(),onCollapseItem=_a20.onCollapseItem,items=_a20.items,trees=_a20.trees,viewState=_a20.viewState,onExpandItem=_a20.onExpandItem,onFocusItem=_a20.onFocusItem,setActiveTree=_a20.setActiveTree,onRenameItem=_a20.onRenameItem,onSelectItems=_a20.onSelectItems,onPrimaryAction=_a20.onPrimaryAction,linearItems=_a20.linearItems,_b=useDragAndDrop(),abortProgrammaticDrag=_b.abortProgrammaticDrag,completeProgrammaticDrag=_b.completeProgrammaticDrag,programmaticDragDown=_b.programmaticDragDown,programmaticDragUp=_b.programmaticDragUp,startProgrammaticDrag=_b.startProgrammaticDrag,itemsRef=useRefCopy(items),collapseItem=reactExports.useCallback(function(itemId,treeId){onCollapseItem?.(items[itemId],treeId)},[items,onCollapseItem]),expandItem=reactExports.useCallback(function(itemId,treeId){onExpandItem?.(items[itemId],treeId)},[items,onExpandItem]),focusItem=reactExports.useCallback(function(itemId,treeId,setDomFocus){setDomFocus===void 0&&(setDomFocus=!0),onFocusItem?.(items[itemId],treeId,setDomFocus)},[items,onFocusItem]),focusTree=reactExports.useCallback(function(treeId,autoFocus){autoFocus===void 0&&(autoFocus=!0),setActiveTree(treeId,autoFocus)},[setActiveTree]),moveFocusDown=reactExports.useCallback(function(treeId){var treeLinearItems=linearItems[treeId],currentFocusIndex=treeLinearItems.findIndex(function(_a21){var _b2,item=_a21.item;return item===((_b2=viewState[treeId])===null||_b2===void 0?void 0:_b2.focusedItem)}),newIndex=currentFocusIndex!==void 0?Math.min(treeLinearItems.length-1,currentFocusIndex+1):0,newItem=items[treeLinearItems[newIndex].item];onFocusItem?.(newItem,treeId)},[items,linearItems,onFocusItem,viewState]),moveFocusUp=reactExports.useCallback(function(treeId){var treeLinearItems=linearItems[treeId],currentFocusIndex=treeLinearItems.findIndex(function(_a21){var _b2,item=_a21.item;return item===((_b2=viewState[treeId])===null||_b2===void 0?void 0:_b2.focusedItem)}),newIndex=currentFocusIndex!==void 0?Math.max(0,currentFocusIndex-1):0,newItem=items[treeLinearItems[newIndex].item];onFocusItem?.(newItem,treeId)},[items,linearItems,onFocusItem,viewState]),renameItem=reactExports.useCallback(function(itemId,name2,treeId){onRenameItem?.(items[itemId],name2,treeId)},[items,onRenameItem]),selectItems=reactExports.useCallback(function(itemsIds,treeId){onSelectItems?.(itemsIds,treeId)},[onSelectItems]),toggleItemExpandedState=reactExports.useCallback(function(itemId,treeId){var _a21,_b2;!((_b2=(_a21=viewState[treeId])===null||_a21===void 0?void 0:_a21.expandedItems)===null||_b2===void 0)&&_b2.includes(itemId)?onCollapseItem?.(items[itemId],treeId):onExpandItem?.(items[itemId],treeId)},[items,onCollapseItem,onExpandItem,viewState]),toggleItemSelectStatus=reactExports.useCallback(function(itemId,treeId){var _a21,_b2,_c,_d,_e;!((_b2=(_a21=viewState[treeId])===null||_a21===void 0?void 0:_a21.selectedItems)===null||_b2===void 0)&&_b2.includes(itemId)?onSelectItems?.((_d=(_c=viewState[treeId].selectedItems)===null||_c===void 0?void 0:_c.filter(function(item){return item!==itemId}))!==null&&_d!==void 0?_d:[],treeId):onSelectItems?.(__spreadArray$3(__spreadArray$3([],(_e=viewState[treeId].selectedItems)!==null&&_e!==void 0?_e:[],!0),[itemId],!1),treeId)},[onSelectItems,viewState]),invokePrimaryAction=reactExports.useCallback(function(itemId,treeId){onPrimaryAction?.(items[itemId],treeId)},[items,onPrimaryAction]),expandSubsequently=reactExports.useCallback(function(treeId,itemIds){return __awaiter(void 0,void 0,void 0,function(){var current,rest;return __generator(this,function(_a21){switch(_a21.label){case 0:return current=itemIds[0],rest=itemIds.slice(1),[4,waitFor(function(){var _a22;return!!(!((_a22=itemsRef.current)===null||_a22===void 0)&&_a22[current])}).then(function(){var item=itemsRef.current[current];return item?(onExpandItem?.(item,treeId),rest.length>0?expandSubsequently(treeId,rest):Promise.resolve()):Promise.resolve()})];case 1:return _a21.sent(),[2]}})})},[itemsRef,onExpandItem]),expandAll=reactExports.useCallback(function(treeId){return __awaiter(void 0,void 0,void 0,function(){return __generator(this,function(_a21){switch(_a21.label){case 0:return[4,recursiveExpand(trees[treeId].rootItem,itemsRef,function(item){return onExpandItem?.(item,treeId)})];case 1:return _a21.sent(),[2]}})})},[itemsRef,onExpandItem,trees]),collapseAll=reactExports.useCallback(function(treeId){for(var _a21,_b2,_i=0,_c=(_b2=(_a21=viewState[treeId])===null||_a21===void 0?void 0:_a21.expandedItems)!==null&&_b2!==void 0?_b2:[];_i<_c.length;_i++){var itemId=_c[_i];onCollapseItem?.(items[itemId],treeId)}},[items,onCollapseItem,viewState]),actions=reactExports.useMemo(function(){return{collapseItem,expandItem,focusItem,focusTree,moveFocusDown,moveFocusUp,renameItem,selectItems,toggleItemExpandedState,toggleItemSelectStatus,invokePrimaryAction,expandAll,expandSubsequently,collapseAll,abortProgrammaticDrag,completeProgrammaticDrag,moveProgrammaticDragPositionDown:programmaticDragDown,moveProgrammaticDragPositionUp:programmaticDragUp,startProgrammaticDrag}},[collapseItem,expandItem,focusItem,focusTree,moveFocusDown,moveFocusUp,renameItem,selectItems,toggleItemExpandedState,toggleItemSelectStatus,invokePrimaryAction,expandAll,expandSubsequently,collapseAll,abortProgrammaticDrag,completeProgrammaticDrag,programmaticDragDown,programmaticDragUp,startProgrammaticDrag]);return useCreatedEnvironmentRef(ref,actions),reactExports.createElement(EnvironmentActionsContext$1.Provider,{value:actions},props.children)}),scrollIntoView=__name(function(element2){var _a20,_b,_c,_d;if(element2)if(element2.scrollIntoViewIfNeeded)element2.scrollIntoViewIfNeeded();else{var boundingBox=element2.getBoundingClientRect(),isElementInViewport=boundingBox.top>=0&&boundingBox.left>=0&&boundingBox.bottom<=(window.innerHeight||!!(!((_b=(_a20=getDocument())===null||_a20===void 0?void 0:_a20.documentElement)===null||_b===void 0)&&_b.clientHeight))&&boundingBox.right<=(window.innerWidth||!!(!((_d=(_c=getDocument())===null||_c===void 0?void 0:_c.documentElement)===null||_d===void 0)&&_d.clientWidth));isElementInViewport||element2.scrollIntoView()}},"scrollIntoView"),__assign$7=function(){return __assign$7=Object.assign||function(t2){for(var s2,i2=1,n2=arguments.length;i2<n2;i2++){s2=arguments[i2];for(var p in s2)Object.prototype.hasOwnProperty.call(s2,p)&&(t2[p]=s2[p])}return t2},__assign$7.apply(this,arguments)},cx=__name(function(){for(var classNames=[],_i=0;_i<arguments.length;_i++)classNames[_i]=arguments[_i];return classNames.filter(function(cn2){return!!cn2}).join(" ")},"cx"),createDefaultRenderers=__name(function(renderDepthOffset,rtl){return{renderItemTitle:__name(function(_a20){var title=_a20.title,context=_a20.context,info=_a20.info;if(!info.isSearching||!context.isSearchMatching)return title;var startIndex=title.toLowerCase().indexOf(info.search.toLowerCase());return React.createElement(React.Fragment,null,startIndex>0&&React.createElement("span",null,title.slice(0,startIndex)),React.createElement("span",{className:"rct-tree-item-search-highlight"},title.slice(startIndex,startIndex+info.search.length)),startIndex+info.search.length<title.length&&React.createElement("span",null,title.slice(startIndex+info.search.length,title.length)))},"renderItemTitle"),renderItemArrow:__name(function(_a20){var item=_a20.item,context=_a20.context;return React.createElement("div",__assign$7({className:cx(item.isFolder&&"rct-tree-item-arrow-isFolder",context.isExpanded&&"rct-tree-item-arrow-expanded","rct-tree-item-arrow")},context.arrowProps),item.isFolder&&(context.isExpanded?React.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"},React.createElement("g",null,React.createElement("g",null,React.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"})))):React.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"},React.createElement("g",null,React.createElement("g",null,React.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"}))))))},"renderItemArrow"),renderItem:__name(function(_a20){var item=_a20.item,depth=_a20.depth,children=_a20.children,title=_a20.title,context=_a20.context,arrow2=_a20.arrow,InteractiveComponent=context.isRenaming?"div":"button",type=context.isRenaming?void 0:"button";return React.createElement("li",__assign$7({},context.itemContainerWithChildrenProps,{className:cx("rct-tree-item-li",item.isFolder&&"rct-tree-item-li-isFolder",context.isSelected&&"rct-tree-item-li-selected",context.isExpanded&&"rct-tree-item-li-expanded",context.isFocused&&"rct-tree-item-li-focused",context.isDraggingOver&&"rct-tree-item-li-dragging-over",context.isSearchMatching&&"rct-tree-item-li-search-match")}),React.createElement("div",__assign$7({},context.itemContainerWithoutChildrenProps,{style:{"--depthOffset":"".concat((depth+1)*renderDepthOffset,"px")},className:cx("rct-tree-item-title-container",item.isFolder&&"rct-tree-item-title-container-isFolder",context.isSelected&&"rct-tree-item-title-container-selected",context.isExpanded&&"rct-tree-item-title-container-expanded",context.isFocused&&"rct-tree-item-title-container-focused",context.isDraggingOver&&"rct-tree-item-title-container-dragging-over",context.isSearchMatching&&"rct-tree-item-title-container-search-match")}),arrow2,React.createElement(InteractiveComponent,__assign$7({type},context.interactiveElementProps,{className:cx("rct-tree-item-button",item.isFolder&&"rct-tree-item-button-isFolder",context.isSelected&&"rct-tree-item-button-selected",context.isExpanded&&"rct-tree-item-button-expanded",context.isFocused&&"rct-tree-item-button-focused",context.isDraggingOver&&"rct-tree-item-button-dragging-over",context.isSearchMatching&&"rct-tree-item-button-search-match")}),title)),children)},"renderItem"),renderRenameInput:__name(function(_a20){var inputProps=_a20.inputProps,inputRef=_a20.inputRef,submitButtonProps=_a20.submitButtonProps,submitButtonRef=_a20.submitButtonRef,formProps=_a20.formProps;return React.createElement("form",__assign$7({},formProps,{className:"rct-tree-item-renaming-form"}),React.createElement("input",__assign$7({},inputProps,{ref:inputRef,className:"rct-tree-item-renaming-input"})),React.createElement("input",__assign$7({},submitButtonProps,{ref:submitButtonRef,type:"submit",className:"rct-tree-item-renaming-submit-button",value:"🗸"})))},"renderRenameInput"),renderTreeContainer:__name(function(_a20){var children=_a20.children,containerProps=_a20.containerProps,info=_a20.info;return React.createElement("div",{className:cx("rct-tree-root",info.isFocused&&"rct-tree-root-focus",info.isRenaming&&"rct-tree-root-renaming",info.areItemsSelected&&"rct-tree-root-itemsselected",rtl)},React.createElement("div",__assign$7({},containerProps,{style:__assign$7({minHeight:"30px"},containerProps.style)}),children))},"renderTreeContainer"),renderItemsContainer:__name(function(_a20){var children=_a20.children,containerProps=_a20.containerProps;return React.createElement("ul",__assign$7({},containerProps,{className:"rct-tree-items-container"}),children)},"renderItemsContainer"),renderDragBetweenLine:__name(function(_a20){var draggingPosition=_a20.draggingPosition,lineProps=_a20.lineProps;return React.createElement("div",__assign$7({},lineProps,{style:{left:"".concat(draggingPosition.depth*renderDepthOffset,"px")},className:cx("rct-tree-drag-between-line",draggingPosition.targetType==="between-items"&&draggingPosition.linePosition==="top"&&"rct-tree-drag-between-line-top",draggingPosition.targetType==="between-items"&&draggingPosition.linePosition==="bottom"&&"rct-tree-drag-between-line-bottom")}))},"renderDragBetweenLine"),renderSearchInput:__name(function(_a20){var inputProps=_a20.inputProps;return React.createElement("div",{className:cx("rct-tree-search-input-container")},React.createElement("span",{className:"rct-tree-input-icon"}),React.createElement("input",__assign$7({},inputProps,{className:cx("rct-tree-search-input")})))},"renderSearchInput"),renderLiveDescriptorContainer:__name(function(_a20){var tree=_a20.tree,children=_a20.children;return React.createElement("div",{id:"rct-livedescription-".concat(tree.treeId),style:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",width:"1px"}},children)},"renderLiveDescriptorContainer"),renderDepthOffset}},"createDefaultRenderers"),useRenderers=__name(function(_a20){var renderItem=_a20.renderItem,renderItemTitle=_a20.renderItemTitle,renderItemArrow=_a20.renderItemArrow,renderRenameInput=_a20.renderRenameInput,renderItemsContainer=_a20.renderItemsContainer,renderTreeContainer=_a20.renderTreeContainer,renderDragBetweenLine=_a20.renderDragBetweenLine,renderSearchInput=_a20.renderSearchInput,renderLiveDescriptorContainer=_a20.renderLiveDescriptorContainer,renderDepthOffset=_a20.renderDepthOffset,defaultRenderers=reactExports.useMemo(function(){return createDefaultRenderers(renderDepthOffset??10)},[renderDepthOffset]),customRenderers={renderItem,renderItemTitle,renderItemArrow,renderRenameInput,renderItemsContainer,renderTreeContainer,renderDragBetweenLine,renderSearchInput,renderLiveDescriptorContainer,renderDepthOffset},renderers=Object.entries(defaultRenderers).reduce(function(acc,_a21){var key=_a21[0],value=_a21[1],keyMapped=key;return customRenderers[keyMapped]?acc[keyMapped]=customRenderers[keyMapped]:acc[keyMapped]=value,acc},{});return renderers.renderItem.displayName="RenderItem",renderers.renderItemTitle.displayName="RenderItemTitle",renderers.renderItemArrow.displayName="RenderItemArrow",renderers.renderRenameInput.displayName="RenderRenameInput",renderers.renderItemsContainer.displayName="RenderItemsContainer",renderers.renderTreeContainer.displayName="RenderTreeContainer",renderers.renderDragBetweenLine.displayName="RenderDragBetweenLine",renderers.renderSearchInput.displayName="RenderSearchInput",renderers},"useRenderers"),getItemsLinearly=__name(function(rootItem,viewState,items,depth){var _a20,_b,_c;depth===void 0&&(depth=0);for(var itemIds=[],_i=0,_d=(_b=(_a20=items[rootItem])===null||_a20===void 0?void 0:_a20.children)!==null&&_b!==void 0?_b:[];_i<_d.length;_i++){var itemId=_d[_i],item=items[itemId];itemIds.push({item:itemId,depth}),item&&item.isFolder&&item.children&&(!((_c=viewState.expandedItems)===null||_c===void 0)&&_c.includes(itemId))&&itemIds.push.apply(itemIds,getItemsLinearly(itemId,viewState,items,depth+1))}return itemIds},"getItemsLinearly"),__assign$6=function(){return __assign$6=Object.assign||function(t2){for(var s2,i2=1,n2=arguments.length;i2<n2;i2++){s2=arguments[i2];for(var p in s2)Object.prototype.hasOwnProperty.call(s2,p)&&(t2[p]=s2[p])}return t2},__assign$6.apply(this,arguments)},__rest=function(s2,e){var t2={};for(var p in s2)Object.prototype.hasOwnProperty.call(s2,p)&&e.indexOf(p)<0&&(t2[p]=s2[p]);if(s2!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i2=0,p=Object.getOwnPropertySymbols(s2);i2<p.length;i2++)e.indexOf(p[i2])<0&&Object.prototype.propertyIsEnumerable.call(s2,p[i2])&&(t2[p[i2]]=s2[p[i2]]);return t2},useControlledTreeEnvironmentProps=__name(function(_a20){var onExpandItemProp=_a20.onExpandItem,onCollapseProp=_a20.onCollapseItem,onDropProp=_a20.onDrop,props=__rest(_a20,["onExpandItem","onCollapseItem","onDrop"]),_b=reactExports.useState({}),trees=_b[0],setTrees=_b[1],_c=reactExports.useState(),activeTreeId=_c[0],setActiveTreeId=_c[1],treeIds=reactExports.useMemo(function(){return Object.keys(trees)},[trees]),onFocusItem=props.onFocusItem,autoFocus=props.autoFocus,onRegisterTree=props.onRegisterTree,onUnregisterTree=props.onUnregisterTree,items=props.items,viewState=props.viewState,onFocusItemRef=useRefCopy(onFocusItem),viewStateRef=useRefCopy(viewState),linearItems=reactExports.useMemo(function(){return buildMapForTrees(treeIds,function(treeId){var _a21;return getItemsLinearly(trees[treeId].rootItem,(_a21=viewState[treeId])!==null&&_a21!==void 0?_a21:{},items)})},[trees,items,treeIds,viewState]),onFocusItemHandler=reactExports.useCallback(function(item,treeId,setDomFocus){var _a21,_b2,_c2,_d,_e,_f,_g,_h,_j;if(setDomFocus===void 0&&(setDomFocus=!0),(autoFocus??!0)&&setDomFocus){var newItem=(_b2=(_a21=getDocument())===null||_a21===void 0?void 0:_a21.querySelector('[data-rct-tree="'.concat(treeId,'"] [data-rct-item-id="').concat(item.index,'"]')))!==null&&_b2!==void 0?_b2:(_c2=getDocument())===null||_c2===void 0?void 0:_c2.querySelector('[data-rct-tree="'.concat(treeId,'"] [data-rct-item-id]'));((_f=(_e=(_d=getDocument())===null||_d===void 0?void 0:_d.activeElement)===null||_e===void 0?void 0:_e.attributes.getNamedItem("data-rct-search-input"))===null||_f===void 0?void 0:_f.value)!=="true"?(_g=newItem?.focus)===null||_g===void 0||_g.call(newItem):scrollIntoView(newItem)}((_h=viewStateRef.current[treeId])===null||_h===void 0?void 0:_h.focusedItem)!==item.index&&((_j=onFocusItemRef.current)===null||_j===void 0||_j.call(onFocusItemRef,item,treeId))},[autoFocus,onFocusItemRef,viewStateRef]),registerTree=reactExports.useCallback(function(tree){setTrees(function(trees2){var _a21;return __assign$6(__assign$6({},trees2),(_a21={},_a21[tree.treeId]=tree,_a21))}),onRegisterTree?.(tree)},[onRegisterTree]),unregisterTree=reactExports.useCallback(function(treeId){onUnregisterTree?.(trees[treeId]),delete trees[treeId],setTrees(trees)},[onUnregisterTree,trees]),onCollapseItem=reactExports.useCallback(function(item,treeId){onCollapseProp?.(item,treeId),setTrees(function(trees2){return trees2})},[onCollapseProp]),onExpandItem=reactExports.useCallback(function(item,treeId){onExpandItemProp?.(item,treeId),setTrees(function(trees2){return trees2})},[onExpandItemProp]),onDrop=reactExports.useCallback(function(items2,target){onDropProp?.(items2,target),setTrees(function(trees2){return trees2})},[onDropProp]),focusTree=reactExports.useCallback(function(treeId){var _a21,_b2,focusItem=(_a21=getDocument())===null||_a21===void 0?void 0:_a21.querySelector('[data-rct-tree="'.concat(treeId,'"] [data-rct-item-focus="true"]'));(_b2=focusItem?.focus)===null||_b2===void 0||_b2.call(focusItem)},[]),setActiveTree=reactExports.useCallback(function(treeIdOrSetStateFunction,autoFocusTree){autoFocusTree===void 0&&(autoFocusTree=!0);var maybeFocusTree=__name(function(treeId2){var _a21,_b2;autoFocusTree&&(autoFocus??!0)&&treeId2&&!(!((_b2=(_a21=getDocument())===null||_a21===void 0?void 0:_a21.querySelector('[data-rct-tree="'.concat(treeId2,'"]')))===null||_b2===void 0)&&_b2.contains(document.activeElement))&&focusTree(treeId2)},"maybeFocusTree");if(typeof treeIdOrSetStateFunction=="function")setActiveTreeId(function(oldValue){var treeId2=treeIdOrSetStateFunction(oldValue);return treeId2!==oldValue&&maybeFocusTree(treeId2),treeId2});else{var treeId=treeIdOrSetStateFunction;setActiveTreeId(treeId),maybeFocusTree(treeId)}},[autoFocus,focusTree]),renderers=useRenderers(props);return __assign$6(__assign$6(__assign$6({},renderers),props),{onFocusItem:onFocusItemHandler,registerTree,unregisterTree,onExpandItem,onCollapseItem,onDrop,setActiveTree,treeIds,trees,activeTreeId,linearItems})},"useControlledTreeEnvironmentProps"),TreeEnvironmentContext=reactExports.createContext(null),useTreeEnvironment=__name(function(){return reactExports.useContext(TreeEnvironmentContext)},"useTreeEnvironment"),ControlledTreeEnvironment=reactExports.forwardRef(function(props,ref){var environmentContextProps=useControlledTreeEnvironmentProps(props),viewState=props.viewState,onFocusItem=props.onFocusItem;return reactExports.useEffect(function(){for(var _a20,_b,_c,_i=0,_d=Object.keys(environmentContextProps.trees);_i<_d.length;_i++){var treeId=_d[_i],firstItemIndex=(_b=(_a20=props.items[environmentContextProps.trees[treeId].rootItem])===null||_a20===void 0?void 0:_a20.children)===null||_b===void 0?void 0:_b[0],firstItem=firstItemIndex&&props.items[firstItemIndex];!(!((_c=viewState[treeId])===null||_c===void 0)&&_c.focusedItem)&&environmentContextProps.trees[treeId]&&firstItem&&onFocusItem?.(firstItem,treeId,!1)}},[environmentContextProps.trees,onFocusItem,props.items,viewState]),reactExports.createElement(TreeEnvironmentContext.Provider,{value:environmentContextProps},reactExports.createElement(InteractionManagerProvider,null,reactExports.createElement(DragAndDropProvider,null,reactExports.createElement(EnvironmentActionsProvider,{ref},props.children))))}),DragBetweenLine=__name(function(_a20){var _b,treeId=_a20.treeId,_c=useDragAndDrop(),draggingPosition=_c.draggingPosition,itemHeight=_c.itemHeight,renderers=useTree().renderers,shouldDisplay=draggingPosition&&draggingPosition.targetType==="between-items"&&draggingPosition.treeId===treeId;if(!shouldDisplay)return null;var lineProps={onDragOver:__name(function(e){return e.preventDefault()},"onDragOver")};return reactExports.createElement("div",{style:{position:"absolute",left:"0",right:"0",top:"".concat(((_b=draggingPosition?.linearIndex)!==null&&_b!==void 0?_b:0)*itemHeight,"px")}},renderers.renderDragBetweenLine({draggingPosition,lineProps}))},"DragBetweenLine"),useHtmlElementEventListener=__name(function(element2,type,listener){var stableListener=useStableHandler(listener);reactExports.useEffect(function(){return element2?(element2.addEventListener(type,stableListener),function(){return element2.removeEventListener(type,stableListener)}):function(){}},[element2,stableListener,type])},"useHtmlElementEventListener"),useFocusWithin=__name(function(element2,onFocusIn,onFocusOut){var _a20=reactExports.useState(!1),focusWithin=_a20[0],setFocusWithin=_a20[1],isLoosingFocusFlag=reactExports.useRef(!1),callSoon=useCallSoon();return useHtmlElementEventListener(element2,"focusin",function(){focusWithin||(setFocusWithin(!0),onFocusIn?.()),isLoosingFocusFlag.current&&(isLoosingFocusFlag.current=!1)}),useHtmlElementEventListener(element2,"focusout",function(){isLoosingFocusFlag.current=!0,callSoon(function(){isLoosingFocusFlag.current&&!element2?.contains(document.activeElement)&&(onFocusOut?.(),isLoosingFocusFlag.current=!1,setFocusWithin(!1))})}),focusWithin},"useFocusWithin"),useKey=__name(function(key,onHit,active){useHtmlElementEventListener(getDocument(),"keydown",function(e){active&&active&&key.toLowerCase()===e.key.toLowerCase()&&onHit(e)})},"useKey"),defaultKeyboardBindings={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"]},__assign$5=function(){return __assign$5=Object.assign||function(t2){for(var s2,i2=1,n2=arguments.length;i2<n2;i2++){s2=arguments[i2];for(var p in s2)Object.prototype.hasOwnProperty.call(s2,p)&&(t2[p]=s2[p])}return t2},__assign$5.apply(this,arguments)},useKeyboardBindings=__name(function(){var environment=useTreeEnvironment();return reactExports.useMemo(function(){return environment.keyboardBindings?__assign$5(__assign$5({},defaultKeyboardBindings),environment.keyboardBindings):defaultKeyboardBindings},[environment.keyboardBindings])},"useKeyboardBindings"),elementsThatCanTakeText=["input","textarea"],useHotkey=__name(function(combinationName,onHit,active,activatableWhileFocusingInput){activatableWhileFocusingInput===void 0&&(activatableWhileFocusingInput=!1);var pressedKeys=reactExports.useRef([]),keyboardBindings=useKeyboardBindings(),callSoon=useCallSoon(),possibleCombinations=reactExports.useMemo(function(){return keyboardBindings[combinationName].map(function(combination){return combination.split("+")})},[combinationName,keyboardBindings]);useHtmlElementEventListener(getDocument(),"keydown",function(e){var _a20;if(active!==!1&&!((elementsThatCanTakeText.includes((_a20=e.target.tagName)===null||_a20===void 0?void 0:_a20.toLowerCase())||e.target.isContentEditable)&&!activatableWhileFocusingInput)&&!pressedKeys.current.includes(e.key)){pressedKeys.current.push(e.key);var pressedKeysLowercase_1=pressedKeys.current.map(function(key){return key.toLowerCase()}),partialMatch=possibleCombinations.map(function(combination){return pressedKeysLowercase_1.map(function(key){return combination.includes(key.toLowerCase())}).reduce(function(a2,b){return a2&&b},!0)}).reduce(function(a2,b){return a2||b},!1);partialMatch&&(pressedKeys.current.length>1||!/^[a-zA-Z\s]$/.test(e.key))&&e.preventDefault()}}),useHtmlElementEventListener(getDocument(),"keyup",function(e){if(active!==!1){var pressedKeysLowercase=pressedKeys.current.map(function(key){return key.toLowerCase()}),match=possibleCombinations.map(function(combination){return combination.map(function(key){return pressedKeysLowercase.includes(key.toLowerCase())}).reduce(function(a2,b){return a2&&b},!0)}).reduce(function(a2,b){return a2||b},!1);match&&callSoon(function(){return onHit(e)}),pressedKeys.current=pressedKeys.current.filter(function(key){return key!==e.key})}})},"useHotkey"),useViewState=__name(function(){var _a20,treeId=useTree().treeId,viewState=useTreeEnvironment().viewState;return(_a20=viewState[treeId])!==null&&_a20!==void 0?_a20:{}},"useViewState"),useLinearItems=__name(function(treeId){return useTreeEnvironment().linearItems[treeId]},"useLinearItems"),useMoveFocusToIndex=__name(function(){var treeId=useTree().treeId,_a20=useTreeEnvironment(),onFocusItem=_a20.onFocusItem,items=_a20.items,linearItems=useLinearItems(treeId),viewState=useViewState();return useStableHandler(function(computeNewIndex){var _a21,currentIndex=(_a21=linearItems.findIndex(function(item){return item.item===viewState.focusedItem}))!==null&&_a21!==void 0?_a21:0,newIndex=computeNewIndex(currentIndex,linearItems),newIndexBounded=Math.max(0,Math.min(linearItems.length-1,newIndex)),newFocusItem=items[linearItems[newIndexBounded].item];return onFocusItem?.(newFocusItem,treeId),newFocusItem})},"useMoveFocusToIndex"),__spreadArray$2=function(to,from,pack){if(pack||arguments.length===2)for(var i2=0,l2=from.length,ar2;i2<l2;i2++)(ar2||!(i2 in from))&&(ar2||(ar2=Array.prototype.slice.call(from,0,i2)),ar2[i2]=from[i2]);return to.concat(ar2||Array.prototype.slice.call(from))},usePrevious2=__name(function(value){var ref=reactExports.useRef({target:value,previous:void 0});return ref.current.target!==value&&(ref.current.previous=ref.current.target,ref.current.target=value),ref.current.previous},"usePrevious"),useSelectUpTo=__name(function(startingAt){var viewState=useViewState(),treeId=useTree().treeId,linearItems=useLinearItems(treeId),onSelectItems=useTreeEnvironment().onSelectItems,focusedItemPrevious=usePrevious2(viewState.focusedItem);return reactExports.useCallback(function(item,overrideOldSelection){var _a20,_b;overrideOldSelection===void 0&&(overrideOldSelection=!1);var itemIndex=item.index,selectMergedItems=__name(function(oldSelection,newSelection){var merged=__spreadArray$2(__spreadArray$2([],overrideOldSelection?[]:oldSelection,!0),newSelection.filter(function(i2){return overrideOldSelection||!oldSelection.includes(i2)}),!0);onSelectItems?.(merged,treeId)},"selectMergedItems");if(viewState&&viewState.selectedItems&&viewState.selectedItems.length>0){var lastFocus_1=viewState.focusedItem===itemIndex?focusedItemPrevious:viewState.focusedItem,selectionStart=startingAt==="last-focus"?linearItems.findIndex(function(linearItem){return lastFocus_1===linearItem.item}):linearItems.findIndex(function(linearItem){var _a21;return(_a21=viewState.selectedItems)===null||_a21===void 0?void 0:_a21.includes(linearItem.item)}),selectionEnd=linearItems.findIndex(function(linearItem){return linearItem.item===itemIndex});if(selectionStart<selectionEnd){var selection=linearItems.slice(selectionStart,selectionEnd+1).map(function(_a21){var item2=_a21.item;return item2});selectMergedItems((_a20=viewState.selectedItems)!==null&&_a20!==void 0?_a20:[],selection)}else{var selection=linearItems.slice(selectionEnd,selectionStart+1).map(function(_a21){var item2=_a21.item;return item2});selectMergedItems((_b=viewState.selectedItems)!==null&&_b!==void 0?_b:[],selection)}}else onSelectItems?.([itemIndex],treeId)},[viewState,onSelectItems,treeId,startingAt,linearItems,focusedItemPrevious])},"useSelectUpTo"),__spreadArray$1=function(to,from,pack){if(pack||arguments.length===2)for(var i2=0,l2=from.length,ar2;i2<l2;i2++)(ar2||!(i2 in from))&&(ar2||(ar2=Array.prototype.slice.call(from,0,i2)),ar2[i2]=from[i2]);return to.concat(ar2||Array.prototype.slice.call(from))},useTreeKeyboardBindings=__name(function(){var _a20,environment=useTreeEnvironment(),_b=useTree(),treeId=_b.treeId,setRenamingItem=_b.setRenamingItem,setSearch=_b.setSearch,renamingItem=_b.renamingItem,linearItems=useLinearItems(treeId),dnd=useDragAndDrop(),viewState=useViewState(),moveFocusToIndex=useMoveFocusToIndex(),selectUpTo=useSelectUpTo("first-selected"),isActiveTree=environment.activeTreeId===treeId,isRenaming=!!renamingItem,disableArrowKeys=environment.disableArrowKeys,enableArrowKeys=!disableArrowKeys&&isActiveTree&&!isRenaming;useKey("arrowdown",function(e){if(e.preventDefault(),dnd.isProgrammaticallyDragging)dnd.programmaticDragDown();else{var newFocusItem=moveFocusToIndex(function(currentIndex){return currentIndex+1});e.shiftKey&&selectUpTo(newFocusItem)}},enableArrowKeys),useKey("arrowup",function(e){if(e.preventDefault(),dnd.isProgrammaticallyDragging)dnd.programmaticDragUp();else{var newFocusItem=moveFocusToIndex(function(currentIndex){return currentIndex-1});e.shiftKey&&selectUpTo(newFocusItem)}},enableArrowKeys),useHotkey("moveFocusToFirstItem",function(e){e.preventDefault(),moveFocusToIndex(function(){return 0})},isActiveTree&&!dnd.isProgrammaticallyDragging&&!isRenaming),useHotkey("moveFocusToLastItem",function(e){e.preventDefault(),moveFocusToIndex(function(currentIndex,linearItems2){return linearItems2.length-1})},isActiveTree&&!dnd.isProgrammaticallyDragging&&!isRenaming),useKey("arrowright",function(e){e.preventDefault(),moveFocusToIndex(function(currentIndex,linearItems2){var _a21,_b2,item=environment.items[linearItems2[currentIndex].item];if(item.isFolder){if(!((_a21=viewState.expandedItems)===null||_a21===void 0)&&_a21.includes(item.index))return currentIndex+1;(_b2=environment.onExpandItem)===null||_b2===void 0||_b2.call(environment,item,treeId)}return currentIndex})},enableArrowKeys&&!dnd.isProgrammaticallyDragging),useKey("arrowleft",function(e){e.preventDefault(),moveFocusToIndex(function(currentIndex,linearItems2){var _a21,_b2,item=environment.items[linearItems2[currentIndex].item],itemDepth=linearItems2[currentIndex].depth;if(item.isFolder&&(!((_a21=viewState.expandedItems)===null||_a21===void 0)&&_a21.includes(item.index)))(_b2=environment.onCollapseItem)===null||_b2===void 0||_b2.call(environment,item,treeId);else if(itemDepth>0){var parentIndex=currentIndex;for(parentIndex;linearItems2[parentIndex].depth!==itemDepth-1;parentIndex-=1);return parentIndex}return currentIndex})},enableArrowKeys&&!dnd.isProgrammaticallyDragging),useHotkey("primaryAction",function(e){var _a21,_b2;e.preventDefault(),viewState.focusedItem!==void 0&&((_a21=environment.onSelectItems)===null||_a21===void 0||_a21.call(environment,[viewState.focusedItem],treeId),(_b2=environment.onPrimaryAction)===null||_b2===void 0||_b2.call(environment,environment.items[viewState.focusedItem],treeId))},isActiveTree&&!dnd.isProgrammaticallyDragging&&!isRenaming),useHotkey("toggleSelectItem",function(e){var _a21,_b2,_c;e.preventDefault(),e.stopPropagation(),viewState.focusedItem!==void 0&&(viewState.selectedItems&&viewState.selectedItems.includes(viewState.focusedItem)?(_a21=environment.onSelectItems)===null||_a21===void 0||_a21.call(environment,viewState.selectedItems.filter(function(item){return item!==viewState.focusedItem}),treeId):(_b2=environment.onSelectItems)===null||_b2===void 0||_b2.call(environment,__spreadArray$1(__spreadArray$1([],(_c=viewState.selectedItems)!==null&&_c!==void 0?_c:[],!0),[viewState.focusedItem],!1),treeId))},isActiveTree&&!dnd.isProgrammaticallyDragging&&!isRenaming),useHotkey("selectAll",function(e){var _a21;e.preventDefault(),(_a21=environment.onSelectItems)===null||_a21===void 0||_a21.call(environment,linearItems.map(function(_a22){var item=_a22.item;return item}),treeId)},isActiveTree&&!dnd.isProgrammaticallyDragging&&!isRenaming),useHotkey("renameItem",function(e){var _a21;if(viewState.focusedItem!==void 0){e.preventDefault();var item=environment.items[viewState.focusedItem];item.canRename!==!1&&((_a21=environment.onStartRenamingItem)===null||_a21===void 0||_a21.call(environment,item,treeId),setRenamingItem(item.index))}},isActiveTree&&((_a20=environment.canRename)!==null&&_a20!==void 0?_a20:!0)&&!isRenaming),useHotkey("startSearch",function(e){var _a21,_b2;e.preventDefault(),setSearch(""),(_b2=(_a21=document.querySelector('[data-rct-search-input="true"]'))===null||_a21===void 0?void 0:_a21.focus)===null||_b2===void 0||_b2.call(_a21)},isActiveTree&&!dnd.isProgrammaticallyDragging&&!isRenaming),useHotkey("startProgrammaticDnd",function(e){e.preventDefault(),dnd.startProgrammaticDrag()},isActiveTree&&!isRenaming),useHotkey("completeProgrammaticDnd",function(e){e.preventDefault(),dnd.completeProgrammaticDrag()},isActiveTree&&dnd.isProgrammaticallyDragging&&!isRenaming),useHotkey("abortProgrammaticDnd",function(e){e.preventDefault(),dnd.abortProgrammaticDrag()},isActiveTree&&dnd.isProgrammaticallyDragging&&!isRenaming)},"useTreeKeyboardBindings"),defaultMatcher=__name(function(search2,item,itemTitle){return itemTitle.toLowerCase().includes(search2.toLowerCase())},"defaultMatcher"),useSearchMatchFocus=__name(function(){var _a20=useTreeEnvironment(),doesSearchMatchItem=_a20.doesSearchMatchItem,items=_a20.items,getItemTitle2=_a20.getItemTitle,onFocusItem=_a20.onFocusItem,_b=useTree(),search2=_b.search,treeId=_b.treeId,linearItems=useLinearItems(treeId),callSoon=useCallSoon();useSideEffect(function(){search2&&search2.length>0&&callSoon(function(){var focusItem=linearItems.find(function(_a21){var item=_a21.item;return(doesSearchMatchItem??defaultMatcher)(search2,items[item],getItemTitle2(items[item]))});focusItem&&onFocusItem?.(items[focusItem.item],treeId)})},[doesSearchMatchItem,getItemTitle2,linearItems,items,onFocusItem,search2,treeId,callSoon],[search2])},"useSearchMatchFocus"),__assign$4=function(){return __assign$4=Object.assign||function(t2){for(var s2,i2=1,n2=arguments.length;i2<n2;i2++){s2=arguments[i2];for(var p in s2)Object.prototype.hasOwnProperty.call(s2,p)&&(t2[p]=s2[p])}return t2},__assign$4.apply(this,arguments)},SearchInput=__name(function(_a20){var _b,containerRef=_a20.containerRef,_c=useTree(),search2=_c.search,setSearch=_c.setSearch,treeId=_c.treeId,renderers=_c.renderers,renamingItem=_c.renamingItem,environment=useTreeEnvironment();useViewState();var isActiveTree=environment.activeTreeId===treeId,callSoon=useCallSoon();useSearchMatchFocus();var clearSearch=__name(function(){var _a21,_b2,_c2;if(setSearch(null),!((_a21=environment.autoFocus)!==null&&_a21!==void 0)||_a21){var focusItem=(_b2=getDocument())===null||_b2===void 0?void 0:_b2.querySelector('[data-rct-tree="'.concat(treeId,'"] [data-rct-item-focus="true"]'));(_c2=focusItem?.focus)===null||_c2===void 0||_c2.call(focusItem)}},"clearSearch");return useHotkey("abortSearch",function(){callSoon(function(){clearSearch()})},isActiveTree&&search2!==null,!0),useHtmlElementEventListener(containerRef,"keydown",function(e){var _a21,_b2,unicode=e.key.charCodeAt(0);(!((_a21=environment.canSearch)!==null&&_a21!==void 0)||_a21)&&(!((_b2=environment.canSearchByStartingTyping)!==null&&_b2!==void 0)||_b2)&&isActiveTree&&search2===null&&!renamingItem&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey&&(unicode>=48&&unicode<=57||unicode>=97&&unicode<=122)&&setSearch("")}),!(!((_b=environment.canSearch)!==null&&_b!==void 0)||_b)||search2===null?null:renderers.renderSearchInput({inputProps:__assign$4({value:search2,onChange:__name(function(e){return setSearch(e.target.value)},"onChange"),onBlur:__name(function(){clearSearch()},"onBlur"),ref:__name(function(el){var _a21;(_a21=el?.focus)===null||_a21===void 0||_a21.call(el)},"ref"),"aria-label":"Search for items"},{"data-rct-search-input":"true"})})},"SearchInput"),defaultLiveDescriptors={introduction:`
|
|
144
|
+
`},errorHandler=curry(throwError)(errorMessages),validators={config:validateConfig},compose=__name(function(){for(var _len=arguments.length,fns=new Array(_len),_key=0;_key<_len;_key++)fns[_key]=arguments[_key];return function(x){return fns.reduceRight(function(y,f){return f(y)},x)}},"compose");function merge$1(target,source){return Object.keys(source).forEach(function(key){source[key]instanceof Object&&target[key]&&Object.assign(source[key],merge$1(target[key],source[key]))}),_objectSpread2$1(_objectSpread2$1({},target),source)}__name(merge$1,"merge$1");var CANCELATION_MESSAGE={type:"cancelation",msg:"operation is manually canceled"};function makeCancelable(promise2){var hasCanceled_=!1,wrappedPromise=new Promise(function(resolve,reject){promise2.then(function(val){return hasCanceled_?reject(CANCELATION_MESSAGE):resolve(val)}),promise2.catch(reject)});return wrappedPromise.cancel=function(){return hasCanceled_=!0},wrappedPromise}__name(makeCancelable,"makeCancelable");var _state$create=index$1.create({config:config$1,isInitialized:!1,resolve:null,reject:null,monaco:null}),_state$create2=_slicedToArray$2(_state$create,2),getState$2=_state$create2[0],setState=_state$create2[1];function config(globalConfig2){var _validators$config=validators.config(globalConfig2),monaco=_validators$config.monaco,config2=_objectWithoutProperties$1(_validators$config,["monaco"]);setState(function(state2){return{config:merge$1(state2.config,config2),monaco}})}__name(config,"config");function init(){var state2=getState$2(function(_ref){var monaco=_ref.monaco,isInitialized=_ref.isInitialized,resolve=_ref.resolve;return{monaco,isInitialized,resolve}});if(!state2.isInitialized){if(setState({isInitialized:!0}),state2.monaco)return state2.resolve(state2.monaco),makeCancelable(wrapperPromise);if(window.monaco&&window.monaco.editor)return storeMonacoInstance(window.monaco),state2.resolve(window.monaco),makeCancelable(wrapperPromise);compose(injectScripts,getMonacoLoaderScript)(configureLoader)}return makeCancelable(wrapperPromise)}__name(init,"init");function injectScripts(script){return document.body.appendChild(script)}__name(injectScripts,"injectScripts");function createScript(src){var script=document.createElement("script");return src&&(script.src=src),script}__name(createScript,"createScript");function getMonacoLoaderScript(configureLoader2){var state2=getState$2(function(_ref2){var config2=_ref2.config,reject=_ref2.reject;return{config:config2,reject}}),loaderScript=createScript("".concat(state2.config.paths.vs,"/loader.js"));return loaderScript.onload=function(){return configureLoader2()},loaderScript.onerror=state2.reject,loaderScript}__name(getMonacoLoaderScript,"getMonacoLoaderScript");function configureLoader(){var state2=getState$2(function(_ref3){var config2=_ref3.config,resolve=_ref3.resolve,reject=_ref3.reject;return{config:config2,resolve,reject}}),require2=window.require;require2.config(state2.config),require2(["vs/editor/editor.main"],function(monaco){storeMonacoInstance(monaco),state2.resolve(monaco)},function(error2){state2.reject(error2)})}__name(configureLoader,"configureLoader");function storeMonacoInstance(monaco){getState$2().monaco||setState({monaco})}__name(storeMonacoInstance,"storeMonacoInstance");function __getMonacoInstance(){return getState$2(function(_ref4){var monaco=_ref4.monaco;return monaco})}__name(__getMonacoInstance,"__getMonacoInstance");var wrapperPromise=new Promise(function(resolve,reject){return setState({resolve,reject})}),loader={config,init,__getMonacoInstance},le={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},v=le,ae={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Y=ae;function Me({children:e}){return React.createElement("div",{style:Y.container},e)}__name(Me,"Me");var Z=Me,$=Z;function Ee({width:e,height:r2,isEditorReady:n2,loading:t2,_ref:a2,className:m,wrapperProps:E}){return React.createElement("section",{style:{...v.wrapper,width:e,height:r2},...E},!n2&&React.createElement($,null,t2),React.createElement("div",{ref:a2,style:{...v.fullWidth,...!n2&&v.hide},className:m}))}__name(Ee,"Ee");var ee=Ee,H=reactExports.memo(ee);function Ce(e){reactExports.useEffect(e,[])}__name(Ce,"Ce");var k=Ce;function he(e,r2,n2=!0){let t2=reactExports.useRef(!0);reactExports.useEffect(t2.current||!n2?()=>{t2.current=!1}:e,r2)}__name(he,"he");var l=he;function D(){}__name(D,"D");function h(e,r2,n2,t2){return De(e,t2)||be(e,r2,n2,t2)}__name(h,"h");function De(e,r2){return e.editor.getModel(te(e,r2))}__name(De,"De");function be(e,r2,n2,t2){return e.editor.createModel(r2,n2,t2?te(e,t2):void 0)}__name(be,"be");function te(e,r2){return e.Uri.parse(r2)}__name(te,"te");function Oe({original:e,modified:r2,language:n2,originalLanguage:t2,modifiedLanguage:a2,originalModelPath:m,modifiedModelPath:E,keepCurrentOriginalModel:g=!1,keepCurrentModifiedModel:N=!1,theme:x="light",loading:P="Loading...",options:y={},height:V="100%",width:z2="100%",className:F,wrapperProps:j={},beforeMount:A=D,onMount:q2=D}){let[M,O]=reactExports.useState(!1),[T,s2]=reactExports.useState(!0),u=reactExports.useRef(null),c=reactExports.useRef(null),w=reactExports.useRef(null),d=reactExports.useRef(q2),o2=reactExports.useRef(A),b=reactExports.useRef(!1);k(()=>{let i2=loader.init();return i2.then(f=>(c.current=f)&&s2(!1)).catch(f=>f?.type!=="cancelation"&&console.error("Monaco initialization: error:",f)),()=>u.current?I():i2.cancel()}),l(()=>{if(u.current&&c.current){let i2=u.current.getOriginalEditor(),f=h(c.current,e||"",t2||n2||"text",m||"");f!==i2.getModel()&&i2.setModel(f)}},[m],M),l(()=>{if(u.current&&c.current){let i2=u.current.getModifiedEditor(),f=h(c.current,r2||"",a2||n2||"text",E||"");f!==i2.getModel()&&i2.setModel(f)}},[E],M),l(()=>{let i2=u.current.getModifiedEditor();i2.getOption(c.current.editor.EditorOption.readOnly)?i2.setValue(r2||""):r2!==i2.getValue()&&(i2.executeEdits("",[{range:i2.getModel().getFullModelRange(),text:r2||"",forceMoveMarkers:!0}]),i2.pushUndoStop())},[r2],M),l(()=>{u.current?.getModel()?.original.setValue(e||"")},[e],M),l(()=>{let{original:i2,modified:f}=u.current.getModel();c.current.editor.setModelLanguage(i2,t2||n2||"text"),c.current.editor.setModelLanguage(f,a2||n2||"text")},[n2,t2,a2],M),l(()=>{c.current?.editor.setTheme(x)},[x],M),l(()=>{u.current?.updateOptions(y)},[y],M);let L=reactExports.useCallback(()=>{if(!c.current)return;o2.current(c.current);let i2=h(c.current,e||"",t2||n2||"text",m||""),f=h(c.current,r2||"",a2||n2||"text",E||"");u.current?.setModel({original:i2,modified:f})},[n2,r2,a2,e,t2,m,E]),U=reactExports.useCallback(()=>{!b.current&&w.current&&(u.current=c.current.editor.createDiffEditor(w.current,{automaticLayout:!0,...y}),L(),c.current?.editor.setTheme(x),O(!0),b.current=!0)},[y,x,L]);reactExports.useEffect(()=>{M&&d.current(u.current,c.current)},[M]),reactExports.useEffect(()=>{!T&&!M&&U()},[T,M,U]);function I(){let i2=u.current?.getModel();g||i2?.original?.dispose(),N||i2?.modified?.dispose(),u.current?.dispose()}return __name(I,"I"),React.createElement(H,{width:z2,height:V,isEditorReady:M,loading:P,_ref:w,className:F,wrapperProps:j})}__name(Oe,"Oe");var ie=Oe;reactExports.memo(ie);function He(e){let r2=reactExports.useRef();return reactExports.useEffect(()=>{r2.current=e},[e]),r2.current}__name(He,"He");var se=He,_=new Map;function Ve({defaultValue:e,defaultLanguage:r2,defaultPath:n2,value:t2,language:a2,path:m,theme:E="light",line:g,loading:N="Loading...",options:x={},overrideServices:P={},saveViewState:y=!0,keepCurrentModel:V=!1,width:z2="100%",height:F="100%",className:j,wrapperProps:A={},beforeMount:q2=D,onMount:M=D,onChange:O,onValidate:T=D}){let[s2,u]=reactExports.useState(!1),[c,w]=reactExports.useState(!0),d=reactExports.useRef(null),o2=reactExports.useRef(null),b=reactExports.useRef(null),L=reactExports.useRef(M),U=reactExports.useRef(q2),I=reactExports.useRef(),i2=reactExports.useRef(t2),f=se(m),Q=reactExports.useRef(!1),B=reactExports.useRef(!1);k(()=>{let p=loader.init();return p.then(R=>(d.current=R)&&w(!1)).catch(R=>R?.type!=="cancelation"&&console.error("Monaco initialization: error:",R)),()=>o2.current?pe():p.cancel()}),l(()=>{let p=h(d.current,e||t2||"",r2||a2||"",m||n2||"");p!==o2.current?.getModel()&&(y&&_.set(f,o2.current?.saveViewState()),o2.current?.setModel(p),y&&o2.current?.restoreViewState(_.get(m)))},[m],s2),l(()=>{o2.current?.updateOptions(x)},[x],s2),l(()=>{!o2.current||t2===void 0||(o2.current.getOption(d.current.editor.EditorOption.readOnly)?o2.current.setValue(t2):t2!==o2.current.getValue()&&(B.current=!0,o2.current.executeEdits("",[{range:o2.current.getModel().getFullModelRange(),text:t2,forceMoveMarkers:!0}]),o2.current.pushUndoStop(),B.current=!1))},[t2],s2),l(()=>{let p=o2.current?.getModel();p&&a2&&d.current?.editor.setModelLanguage(p,a2)},[a2],s2),l(()=>{g!==void 0&&o2.current?.revealLine(g)},[g],s2),l(()=>{d.current?.editor.setTheme(E)},[E],s2);let X2=reactExports.useCallback(()=>{if(!(!b.current||!d.current)&&!Q.current){U.current(d.current);let p=m||n2,R=h(d.current,t2||e||"",r2||a2||"",p||"");o2.current=d.current?.editor.create(b.current,{model:R,automaticLayout:!0,...x},P),y&&o2.current.restoreViewState(_.get(p)),d.current.editor.setTheme(E),g!==void 0&&o2.current.revealLine(g),u(!0),Q.current=!0}},[e,r2,n2,t2,a2,m,x,P,y,E,g]);reactExports.useEffect(()=>{s2&&L.current(o2.current,d.current)},[s2]),reactExports.useEffect(()=>{!c&&!s2&&X2()},[c,s2,X2]),i2.current=t2,reactExports.useEffect(()=>{s2&&O&&(I.current?.dispose(),I.current=o2.current?.onDidChangeModelContent(p=>{B.current||O(o2.current.getValue(),p)}))},[s2,O]),reactExports.useEffect(()=>{if(s2){let p=d.current.editor.onDidChangeMarkers(R=>{let G=o2.current.getModel()?.uri;if(G&&R.find(J=>J.path===G.path)){let J=d.current.editor.getModelMarkers({resource:G});T?.(J)}});return()=>{p?.dispose()}}return()=>{}},[s2,T]);function pe(){I.current?.dispose(),V?y&&_.set(m,o2.current.saveViewState()):o2.current.getModel()?.dispose(),o2.current.dispose()}return __name(pe,"pe"),React.createElement(H,{width:z2,height:F,isEditorReady:s2,loading:N,_ref:b,className:j,wrapperProps:A})}__name(Ve,"Ve");var fe=Ve,de=reactExports.memo(fe),Ft=de;const defaultPermissions={roles:{create:!0,view:!0,update:!0,delete:!0},clusters:{create:!0,view:!0,update:!0,delete:!0,resources:[]}};function AddOrganizationRoleModal({isModalOpen,setIsModalOpen}){const queryClient2=useQueryClient(),{organizationId}=useParams({strict:!1}),[isValidJSON,setIsValidJSON]=reactExports.useState(!0),[updatedPermissions,setUpdatedPermissions]=reactExports.useState(JSON.stringify(defaultPermissions,null,2)),{mutate:addOrganizationRole,isPending}=useAddOrganizationRole(),form=useForm({resolver:a(OrganizationRoleOverviewSchema),defaultValues:{name:"",update:!1,delete:!1}}),onValidate=reactExports.useCallback(markers=>{setIsValidJSON(markers.length===0)},[setIsValidJSON]),onSubmitRoleEdits=reactExports.useCallback(async formData=>{const parsedPermissions=safeParse(updatedPermissions);if(!parsedPermissions)return;const updatedFormData={...formData,...parsedPermissions,organizationId};formData&&isValidJSON&&addOrganizationRole(updatedFormData,{onSuccess:__name(()=>{toast.success("Organization role added successfully!"),setIsModalOpen(!1),queryClient2.invalidateQueries({queryKey:[organizationId,"roles"],refetchType:"active"}),form.reset()},"onSuccess"),onError:__name(error2=>{toast.error(`Failed to add organization role: ${error2.message}`)},"onError")})},[isValidJSON,updatedPermissions,addOrganizationRole,form,queryClient2,setIsModalOpen,organizationId]);return jsxRuntimeExports.jsx(Dialog,{onOpenChange:setIsModalOpen,open:isModalOpen,children:jsxRuntimeExports.jsxs(DialogContent,{children:[jsxRuntimeExports.jsx(DialogTitle,{children:"Add New Organization Role"}),jsxRuntimeExports.jsx(DialogDescription,{children:"Set the new organization role permissions."}),jsxRuntimeExports.jsx(Form,{...form,children:jsxRuntimeExports.jsxs("form",{id:"org-add-role-form",name:"org-add-role-form",className:"grid grid-cols-2 gap-4 my-4",onSubmit:form.handleSubmit(onSubmitRoleEdits),children:[jsxRuntimeExports.jsx(FormField,{control:form.control,name:"name",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{className:"col-span-2",children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"Role Name"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"text",className:"",...field})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(FormField,{control:form.control,name:"update",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"Can Update Organization"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"checkbox",className:"w-6 ml-2",checked:field.value,onChange:__name(e=>field.onChange(e.target.checked),"onChange")})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(FormField,{control:form.control,name:"delete",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"Can Delete Organization"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"checkbox",className:"w-6 ml-2",checked:field.value,onChange:__name(e=>field.onChange(e.target.checked),"onChange")})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx("div",{className:"col-span-2",children:jsxRuntimeExports.jsx(de,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate,onChange:__name(value=>{value&&setUpdatedPermissions(value)},"onChange"),defaultValue:JSON.stringify(defaultPermissions,null,2)})}),jsxRuntimeExports.jsx(DialogFooter,{className:"col-span-2",children:jsxRuntimeExports.jsxs("div",{className:"flex justify-between w-full",children:[jsxRuntimeExports.jsx(Button,{variant:"destructiveOutline",className:"rounded-full",type:"button",onClick:__name(()=>setIsModalOpen(!1),"onClick"),disabled:isPending,children:"Cancel"}),jsxRuntimeExports.jsx(Button,{variant:"submit",className:"rounded-full",disabled:isPending||!isValidJSON||!form.formState.isValid,children:"Save Changes"})]})})]})})]})})}__name(AddOrganizationRoleModal,"AddOrganizationRoleModal");async function onDeleteOrganizationRole({roleId}){const{data}=await apiClient.delete(`/Role/${roleId}`,{id:roleId,deleted:!0});return data}__name(onDeleteOrganizationRole,"onDeleteOrganizationRole");function useDeleteOrganizationRole(){return useMutation({mutationFn:__name(({roleId})=>onDeleteOrganizationRole({roleId}),"mutationFn")})}__name(useDeleteOrganizationRole,"useDeleteOrganizationRole");async function onUpdateOrganizationRole({roleId,updatedRoleInfo}){const{data}=await apiClient.put(`/Role/${roleId}`,updatedRoleInfo);return data}__name(onUpdateOrganizationRole,"onUpdateOrganizationRole");function useUpdateOrganizationRole(){return useMutation({mutationFn:__name(({roleId,updatedRoleInfo})=>onUpdateOrganizationRole({roleId,updatedRoleInfo}),"mutationFn")})}__name(useUpdateOrganizationRole,"useUpdateOrganizationRole");function getOrganizationRoleInfoQueryOptions({organizationId,roleId}){return{queryKey:[organizationId,"roles",roleId],queryFn:__name(()=>getOrganizationRoleInfo(roleId),"queryFn"),refetchInterval:10*1e3}}__name(getOrganizationRoleInfoQueryOptions,"getOrganizationRoleInfoQueryOptions");async function getOrganizationRoleInfo(roleId){const{data}=await apiClient.get(`/Role/${roleId}`);return data}__name(getOrganizationRoleInfo,"getOrganizationRoleInfo");function ConfirmDeletionContent({onRoleDeleteClick,setIsConfirmingRoleDeletion,isRoleDeletionPending}){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(DialogTitle,{children:"Confirm Role Deletion"}),jsxRuntimeExports.jsx(DialogDescription,{children:"Are you sure you want to delete this role? This action cannot be undone."}),jsxRuntimeExports.jsxs(DialogFooter,{children:[jsxRuntimeExports.jsx(Button,{type:"button",variant:"defaultOutline",className:"rounded-full",onClick:__name(()=>setIsConfirmingRoleDeletion(!1),"onClick"),children:"Cancel"}),jsxRuntimeExports.jsx(Button,{variant:"destructiveOutline",className:"rounded-full",onClick:onRoleDeleteClick,disabled:isRoleDeletionPending,children:isRoleDeletionPending?"Deleting...":"Delete Role"})]})]})}__name(ConfirmDeletionContent,"ConfirmDeletionContent");function EditOrganizationRoleModal({data,isModalOpen,closeModal}){const queryClient2=useQueryClient(),{data:roleInfo}=useSuspenseQuery(getOrganizationRoleInfoQueryOptions({roleId:data.id,organizationId:data.organizationId})),auth=useCloudAuth(),isSelf=auth.user&&auth.user?.roles?.[data.organizationId]?.role===data.roleName,{update,remove}=useOrganizationRolePermissions(data.organizationId),{mutate:updateOrganizationRole,isPending:isRoleUpdatePending}=useUpdateOrganizationRole(),{mutate:deleteOrganizationRole,isPending:isRoleDeletionPending}=useDeleteOrganizationRole(),[isConfirmingRoleDeletion,setIsConfirmingRoleDeletion]=reactExports.useState(!1),form=useForm({resolver:a(OrganizationRoleOverviewSchema),defaultValues:{name:data.roleName,update:roleInfo.organization.update||!1,delete:roleInfo.organization.delete||!1}}),onRoleDeleteClick=reactExports.useCallback(()=>{deleteOrganizationRole({roleId:data.id},{onSuccess:__name(()=>{toast.success("Role deleted successfully!"),closeModal(!0),form.reset()},"onSuccess"),onError:__name(error2=>{toast.error("Error",{description:`Failed to delete role: ${error2 instanceof Error?error2.message:String(error2)}.`,action:{label:"Dismiss",onClick:__name(()=>toast.dismiss(),"onClick")}})},"onError")})},[data.id,deleteOrganizationRole,form,closeModal]),[isValidJSON,setIsValidJSON]=reactExports.useState(!0),[updatedPermissions,setUpdatedPermissions]=reactExports.useState(JSON.stringify({roles:{...roleInfo.organization.roles},clusters:{...roleInfo.organization.clusters}},null,2)),onValidate=reactExports.useCallback(markers=>{setIsValidJSON(markers.length===0)},[setIsValidJSON]),onSubmitRoleEdits=reactExports.useCallback(async formData=>{if(!update)return;const parsedPermissions=safeParse(updatedPermissions);if(!parsedPermissions)return;const updatedFormData={...formData,...parsedPermissions,organizationId:data.organizationId};updatedPermissions&&isValidJSON&&updateOrganizationRole({roleId:data.id,updatedRoleInfo:updatedFormData},{onSuccess:__name(async()=>{toast.success("Role updated successfully!"),await queryClient2.invalidateQueries({queryKey:[data.organizationId,"roles",data.id]}),closeModal(!1),form.reset()},"onSuccess"),onError:__name(error2=>{toast.error("Error",{description:`Failed to update role: ${error2 instanceof Error?error2.message:String(error2)}.`,action:{label:"Dismiss",onClick:__name(()=>toast.dismiss(),"onClick")}})},"onError")})},[closeModal,data.id,data.organizationId,form,isValidJSON,queryClient2,roleInfo,update,updatedPermissions,updateOrganizationRole]),onOpenChanges=reactExports.useCallback(()=>closeModal(!1),[closeModal]);return jsxRuntimeExports.jsx(Dialog,{onOpenChange:onOpenChanges,open:isModalOpen,children:jsxRuntimeExports.jsx(DialogContent,{children:isConfirmingRoleDeletion?jsxRuntimeExports.jsx(ConfirmDeletionContent,{onRoleDeleteClick,setIsConfirmingRoleDeletion,isRoleDeletionPending}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(DialogTitle,{children:[isSelf||!update?"View":"Edit",' Organization Role "',data.roleName,'"']}),jsxRuntimeExports.jsx(Form,{...form,children:jsxRuntimeExports.jsxs("form",{id:"org-edit-role-form",name:"org-edit-role-form",className:"grid grid-cols-2 gap-4 my-4",onSubmit:form.handleSubmit(onSubmitRoleEdits),children:[jsxRuntimeExports.jsx(FormField,{control:form.control,name:"name",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{className:"col-span-2",children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"Role Name"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"text",className:"",...field,disabled:!0,readOnly:!0})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(FormField,{control:form.control,name:"update",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"Can Update Organization"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"checkbox",className:"w-6 ml-2",disabled:isSelf||!update,readOnly:isSelf||!update,checked:field.value,onChange:__name(e=>field.onChange(e.target.checked),"onChange")})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(FormField,{control:form.control,name:"delete",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"Can Delete Organization"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"checkbox",className:"w-6 ml-2",disabled:isSelf||!update,readOnly:isSelf||!update,checked:field.value,onChange:__name(e=>field.onChange(e.target.checked),"onChange")})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx("div",{className:"col-span-2",children:jsxRuntimeExports.jsx(de,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate,onChange:__name(value=>{value&&setUpdatedPermissions(value)},"onChange"),options:isSelf||!update?{readOnly:!0}:void 0,defaultValue:updatedPermissions})}),!isSelf&&(remove||update)&&jsxRuntimeExports.jsx(DialogFooter,{className:"col-span-2",children:jsxRuntimeExports.jsxs("div",{className:"flex justify-between w-full",children:[remove&&jsxRuntimeExports.jsx(Button,{type:"button",variant:"destructiveOutline",className:"rounded-full",onClick:__name(()=>setIsConfirmingRoleDeletion(!0),"onClick"),disabled:isRoleUpdatePending,children:"Delete Role"}),update&&jsxRuntimeExports.jsx(Button,{variant:"submit",className:"rounded-full",disabled:!isValidJSON||isRoleUpdatePending||!form.formState.isValid||!form.formState.isDirty,children:"Save Changes"})]})})]})})]})})})}__name(EditOrganizationRoleModal,"EditOrganizationRoleModal");function OrgConfigRolesIndex(){const navigate=useNavigate(),queryClient2=useQueryClient(),{organizationId,orgRoleId}=useParams({strict:!1}),{create:create2}=useOrganizationRolePermissions(organizationId),{data:orgRoles,refetch,isFetching,isRefetching}=useSuspenseQuery(getOrganizationRolesQueryOptions(organizationId)),selectedOrgRole=reactExports.useMemo(()=>orgRoles&&orgRoles?.find(role=>role.id===orgRoleId),[orgRoles,orgRoleId]),isEditOrgRoleModalOpen=!!orgRoleId&&!!selectedOrgRole,[isAddModalOpen,setIsAddModalOpen]=reactExports.useState(!1),onSelectOrgRole=reactExports.useCallback(async(newOrgRole,madeChanges)=>{const parts=[orgRoleId?"..":"",newOrgRole].filter(Boolean);await navigate({to:parts.join("/")}),madeChanges&&await queryClient2.invalidateQueries({queryKey:[organizationId,"roles"],refetchType:"active"})},[orgRoleId,navigate,queryClient2]),onAddClicked=reactExports.useCallback(()=>{setIsAddModalOpen(!0)},[setIsAddModalOpen]),onRowClick=reactExports.useCallback(rowData=>onSelectOrgRole(rowData.original.id,!1),[onSelectOrgRole]),closeEditModal=reactExports.useCallback(madeChanges=>onSelectOrgRole(void 0,madeChanges),[onSelectOrgRole]),onRefreshClick=useRefreshClick(refetch);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SubNavMenu,{}),jsxRuntimeExports.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-(--spacing(32)))]",children:jsxRuntimeExports.jsxs(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(Loading,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[jsxRuntimeExports.jsxs(SimpleBrowseDataTable,{data:orgRoles,columns:dataTableColumns$5,onRowClick,children:[jsxRuntimeExports.jsxs(Button,{variant:"defaultOutline",onClick:onRefreshClick,accessKey:"r",disabled:isFetching||isRefetching,children:[jsxRuntimeExports.jsx(RefreshCw,{}),jsxRuntimeExports.jsxs("span",{className:"hidden lg:inline-block",children:[jsxRuntimeExports.jsx("u",{children:"R"}),"efresh"]})]}),create2&&jsxRuntimeExports.jsxs(Button,{variant:"positiveOutline",onClick:onAddClicked,accessKey:"a",disabled:isAddModalOpen,children:[jsxRuntimeExports.jsx(Plus,{}),jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsx("u",{children:"A"}),"dd"]})]})]}),create2&&jsxRuntimeExports.jsx(AddOrganizationRoleModal,{isModalOpen:isAddModalOpen,setIsModalOpen:setIsAddModalOpen}),isEditOrgRoleModalOpen&&jsxRuntimeExports.jsx(EditOrganizationRoleModal,{data:selectedOrgRole,isModalOpen:isEditOrgRoleModalOpen,closeModal:closeEditModal})]})})]})}__name(OrgConfigRolesIndex,"OrgConfigRolesIndex");const columnHelper$4=createColumnHelper(),dataTableColumns$4=[{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},columnHelper$4.display({header:"Roles",enableSorting:!1,id:"roles",cell:__name(props=>props.row.original.roles?.map(r2=>r2.roleName)?.sort()?.join(", "),"cell")}),{header:"Status",accessorKey:"status",enableSorting:!1},{header:"Verified",accessorKey:"isVerified",enableSorting:!1}],AddOrganizationRoleSchema=z.object({email:zodRequireEmail.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:z.string().nonempty({error:"Please select a role."})});async function onAddUserToOrganizationRoleSubmit(formData){const{data}=await apiClient.post("/OrganizationRole/",formData);return data}__name(onAddUserToOrganizationRoleSubmit,"onAddUserToOrganizationRoleSubmit");function useAddUserToOrganizationRole(){return useMutation({mutationFn:__name(formData=>onAddUserToOrganizationRoleSubmit(formData),"mutationFn")})}__name(useAddUserToOrganizationRole,"useAddUserToOrganizationRole");z.object({email:zodRequireEmail.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:z.string().nonempty({error:"Please select a role."})});async function onInviteUserToOrganizationRoleSubmit(formData){const{data}=await apiClient.post("/UserInvite/",formData);return data}__name(onInviteUserToOrganizationRoleSubmit,"onInviteUserToOrganizationRoleSubmit");function useInviteUserToOrganizationRole(){return useMutation({mutationFn:__name(formData=>onInviteUserToOrganizationRoleSubmit(formData),"mutationFn")})}__name(useInviteUserToOrganizationRole,"useInviteUserToOrganizationRole");function AddUserModal$1({isModalOpen,onChangesSaved,setIsModalOpen}){const{organizationId}=useParams({strict:!1}),{data:orgRoles}=useSuspenseQuery(getOrganizationRolesQueryOptions(organizationId)),[shouldInvite,setShouldInvite]=reactExports.useState(!1),form=useForm({resolver:a(AddOrganizationRoleSchema),defaultValues:{email:"",roleId:""}}),{mutate:addUser,isPending:isAddPending}=useAddUserToOrganizationRole(),{mutate:inviteUser,isPending:isInvitePending}=useInviteUserToOrganizationRole(),onSubmitClick=reactExports.useCallback(async formData=>{formData&&(shouldInvite?inviteUser:addUser)(formData,{onSuccess:__name(()=>{const lastRole=formData.roleId;form.reset(),form.setValue("roleId",lastRole),onChangesSaved(),toast.success("User invited successfully!"),setIsModalOpen(!1),setShouldInvite(!1)},"onSuccess"),onError:__name(error2=>{error2?.status===404&&setShouldInvite(!0)},"onError")})},[addUser,form,inviteUser,onChangesSaved,setIsModalOpen,shouldInvite]);return jsxRuntimeExports.jsx(Dialog,{onOpenChange:__name(()=>{setIsModalOpen(!1),setShouldInvite(!1),form.reset()},"onOpenChange"),open:isModalOpen,children:jsxRuntimeExports.jsx(DialogContent,{"aria-describedby":void 0,children:jsxRuntimeExports.jsx(Form,{...form,children:jsxRuntimeExports.jsxs("form",{id:"org-add-user-form",name:"org-add-user-form",onSubmit:form.handleSubmit(onSubmitClick),className:"grid gap-4 my-4",children:[jsxRuntimeExports.jsx(DialogHeader,{children:jsxRuntimeExports.jsx(DialogTitle,{children:shouldInvite?"Invite User":"Add User"})}),jsxRuntimeExports.jsx(FormField,{control:form.control,name:"email",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"Email"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"email",enterKeyHint:"next",autoComplete:"email",...field})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(FormField,{control:form.control,name:"roleId",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"Roles"}),jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(TextLoadingSkeleton,{}),children:jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsxs(Select,{...field,onValueChange:__name(role=>field.onChange(role),"onValueChange"),children:[jsxRuntimeExports.jsx(SelectTrigger,{className:"w-full",children:jsxRuntimeExports.jsx(SelectValue,{placeholder:"Choose Role"})}),jsxRuntimeExports.jsx(SelectContent,{children:jsxRuntimeExports.jsxs(SelectGroup,{children:[jsxRuntimeExports.jsx(SelectLabel,{children:"Role"}),orgRoles?.map(role=>jsxRuntimeExports.jsx(SelectItem,{value:role.id,children:role.roleName},role.id))]})})]})})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),shouldInvite&&jsxRuntimeExports.jsxs(DialogDescription,{className:"p-3 my-5 text-white rounded-md bg-amber-600 flex",children:[jsxRuntimeExports.jsx(MailWarning,{className:"inline-block size-12 pr-2"}),jsxRuntimeExports.jsx("span",{children:"This person doesn’t have a Fabric account. Do you want to invite them?"})]}),jsxRuntimeExports.jsx(DialogFooter,{children:jsxRuntimeExports.jsx("div",{className:"flex justify-between w-full",children:jsxRuntimeExports.jsxs(Button,{type:"submit",variant:"submit",className:"rounded-full",disabled:isAddPending||isInvitePending,children:[jsxRuntimeExports.jsx(Save,{})," ",shouldInvite?"Invite User":"Add User"]})})})]})})})})}__name(AddUserModal$1,"AddUserModal$1");async function onRemoveUserFromOrganizationRole({roleId,userId}){const{data}=await apiClient.delete(`/OrganizationRole/role/${roleId}/user/${userId}`);return data}__name(onRemoveUserFromOrganizationRole,"onRemoveUserFromOrganizationRole");function useRemoveUserFromOrganizationRole(){return useMutation({mutationFn:__name(({roleId,userId})=>onRemoveUserFromOrganizationRole({roleId,userId}),"mutationFn")})}__name(useRemoveUserFromOrganizationRole,"useRemoveUserFromOrganizationRole");function useCheckboxCallback(defaultValue){const[state2,setState2]=reactExports.useState(defaultValue||!1),onClick=reactExports.useCallback(e=>{setState2(typeof e=="boolean"?e:e.target.checked)},[]);return[state2,onClick]}__name(useCheckboxCallback,"useCheckboxCallback");function OrgUserRoleCheckbox({data,readOnly,canRemove,orgRole,selectedRoles,setChangesMade}){const{mutate:addUser,isPending:isAddPending}=useAddUserToOrganizationRole(),{mutate:removeUser,isPending:isRemovePending}=useRemoveUserFromOrganizationRole(),userIsInRole=!!selectedRoles[orgRole.roleName],[wasChecked,setWasChecked]=reactExports.useState(userIsInRole),[isChecked,onCheckedChanged]=useCheckboxCallback(userIsInRole);return reactExports.useEffect(()=>{isChecked!==wasChecked&&(isChecked?addUser({email:data.email,roleId:orgRole.id},{onSuccess:__name(()=>{setWasChecked(isChecked),setChangesMade(!0),toast.success("Role added successfully")},"onSuccess")}):removeUser({userId:data.id,roleId:orgRole.id},{onSuccess:__name(()=>{setWasChecked(isChecked),setChangesMade(!0),toast.success("Role removed successfully")},"onSuccess")}))},[addUser,data.email,data.id,isChecked,orgRole.id,removeUser,setChangesMade,wasChecked]),jsxRuntimeExports.jsxs(Label$2,{className:"flex",children:[jsxRuntimeExports.jsx(Input,{type:"checkbox",className:"w-6",disabled:readOnly||isAddPending||isRemovePending||!canRemove&&isChecked,checked:isChecked,onChange:onCheckedChanged}),jsxRuntimeExports.jsx("span",{className:"pl-4 pr-8 flex-1 py-2.5",children:orgRole.roleName})]},orgRole.id)}__name(OrgUserRoleCheckbox,"OrgUserRoleCheckbox");function EditUserModal$1({closeModal,data,isModalOpen,onUserUpdated}){const{organizationId}=useParams({strict:!1}),auth=useCloudAuth(),{update,remove}=useOrganizationRolePermissions(organizationId),isSelf=auth.user?.email===data.email,{data:orgRoles}=useSuspenseQuery(getOrganizationRolesQueryOptions(organizationId)),selectedRoles=reactExports.useMemo(()=>data.roles?keyBy(data.roles,"roleName"):{},[data]),[changesMade,setChangesMade]=reactExports.useState(!1);return jsxRuntimeExports.jsx(Dialog,{onOpenChange:changesMade?onUserUpdated:closeModal,open:isModalOpen,children:jsxRuntimeExports.jsxs(DialogContent,{className:"sm:max-w-[750px]",children:[jsxRuntimeExports.jsx(DialogHeader,{children:jsxRuntimeExports.jsxs(DialogTitle,{children:[update?"Edit ":"View "," ",data.email," ",isSelf?"(yourself)":""]})}),update&&jsxRuntimeExports.jsxs(DialogDescription,{children:["To remove ",isSelf?"your self":"this user"," from the organization, uncheck all of the boxes below."]}),orgRoles.map(orgRole=>jsxRuntimeExports.jsx(OrgUserRoleCheckbox,{readOnly:!update,canRemove:remove,data,orgRole,selectedRoles,setChangesMade},orgRole.id))]})})}__name(EditUserModal$1,"EditUserModal$1");function sortByEmail(a2,b){return a2.email>b.email?1:-1}__name(sortByEmail,"sortByEmail");function OrgConfigUsersIndex(){const navigate=useNavigate(),{organizationId,orgUserId}=useParams({strict:!1}),{update}=useOrganizationRolePermissions(organizationId),{data:organizationRoles,refetch,isFetching,isRefetching}=useSuspenseQuery(getOrganizationRolesQueryOptions(organizationId)),cloudUsers=reactExports.useMemo(()=>{const users={};for(const organizationRole of organizationRoles)if(organizationRole.users)for(const user of organizationRole.users)users[user.id]||(users[user.id]={...user,roles:[]}),users[user.id].roles.push(organizationRole);return Object.values(users).sort(sortByEmail)},[organizationRoles]),selectedUser=reactExports.useMemo(()=>cloudUsers?.find(user=>user.id===orgUserId),[cloudUsers,orgUserId]),onSelectUser=reactExports.useCallback(newUserId=>{const parts=[orgUserId?"..":"",newUserId].filter(Boolean);navigate({to:parts.join("/")})},[orgUserId,navigate]),isEditModalOpen=!!orgUserId&&!!selectedUser,[isAddModalOpen,setIsAddModalOpen]=reactExports.useState(!1),[sortTableDataParams]=reactExports.useState({attribute:"email",descending:!1}),sortingState=reactExports.useMemo(()=>[{desc:sortTableDataParams.descending,id:sortTableDataParams.attribute}],[sortTableDataParams]),onAddClicked=reactExports.useCallback(()=>{setIsAddModalOpen(!0)},[setIsAddModalOpen]),onUsedAdded=reactExports.useCallback(()=>{refetch(),setIsAddModalOpen(!1)},[refetch,setIsAddModalOpen]),onRowClick=reactExports.useCallback(rowData=>{onSelectUser(rowData.original.id)},[onSelectUser]),closeEditModal=reactExports.useCallback(()=>{onSelectUser(void 0)},[onSelectUser]),onUserUpdated=reactExports.useCallback(()=>{refetch(),onSelectUser(void 0)},[onSelectUser,refetch]),onRefreshClick=useRefreshClick(refetch);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SubNavMenu,{}),jsxRuntimeExports.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:jsxRuntimeExports.jsxs(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(Loading,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[jsxRuntimeExports.jsxs(SimpleBrowseDataTable,{data:cloudUsers,isFetching:isFetching||isRefetching,columns:dataTableColumns$4,onRowClick,sortingState,children:[jsxRuntimeExports.jsxs(Button,{variant:"defaultOutline",onClick:onRefreshClick,accessKey:"r",disabled:isFetching||isRefetching,children:[jsxRuntimeExports.jsx(RefreshCw,{})," ",jsxRuntimeExports.jsxs("span",{className:"hidden lg:inline-block",children:[jsxRuntimeExports.jsx("u",{children:"R"}),"efresh"]})]}),update&&jsxRuntimeExports.jsxs(Button,{variant:"positiveOutline",onClick:onAddClicked,accessKey:"a",disabled:isAddModalOpen,children:[jsxRuntimeExports.jsx(Plus,{})," ",jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsx("u",{children:"A"}),"dd"]})]})]}),update&&jsxRuntimeExports.jsx(AddUserModal$1,{isModalOpen:isAddModalOpen,onChangesSaved:onUsedAdded,setIsModalOpen:setIsAddModalOpen}),isEditModalOpen&&jsxRuntimeExports.jsx(EditUserModal$1,{closeModal:closeEditModal,data:selectedUser,isModalOpen:isEditModalOpen,onUserUpdated})]})})]})}__name(OrgConfigUsersIndex,"OrgConfigUsersIndex");function OrgCard({organizationRole,onDeleteOrgModal}){const{organizationId,organizationName,roleName}=organizationRole,{remove,update:canUpdateOrganization}=useOrganizationPermissions(organizationId),showBilling=canUpdateOrganization,{view:showOrgUsersAndRoles}=useOrganizationRolePermissions(organizationId),onDeleteClick=reactExports.useCallback(()=>{onDeleteOrgModal(organizationRole)},[onDeleteOrgModal,organizationRole]);return jsxRuntimeExports.jsxs(Card,{className:"relative h-full justify-between",children:[jsxRuntimeExports.jsxs(CardHeader,{children:[jsxRuntimeExports.jsxs(CardDescription,{className:"flex items-center justify-between",children:[jsxRuntimeExports.jsx("span",{className:"truncate",children:organizationId}),remove&&jsxRuntimeExports.jsxs(DropdownMenu,{children:[jsxRuntimeExports.jsx(DropdownMenuTrigger,{className:"p-4 -m-4 -mr-6 hover:text-white",children:jsxRuntimeExports.jsx(Ellipsis,{"aria-label":"Options"})}),jsxRuntimeExports.jsxs(DropdownMenuContent,{children:[jsxRuntimeExports.jsx(DropdownMenuLabel,{className:"text-gray-600 text-xs",children:"Options"}),jsxRuntimeExports.jsx(DropdownMenuSeparator,{}),jsxRuntimeExports.jsx(Link$2,{to:`${organizationId}`,children:jsxRuntimeExports.jsx(DropdownMenuItem,{children:"Clusters"})}),showOrgUsersAndRoles&&jsxRuntimeExports.jsx(Link$2,{to:`${organizationId}/roles`,children:jsxRuntimeExports.jsx(DropdownMenuItem,{children:"Roles"})}),showOrgUsersAndRoles&&jsxRuntimeExports.jsx(Link$2,{to:`${organizationId}/users`,children:jsxRuntimeExports.jsx(DropdownMenuItem,{children:"Users"})}),showBilling&&jsxRuntimeExports.jsx(Link$2,{to:`${organizationId}/billing`,children:jsxRuntimeExports.jsx(DropdownMenuItem,{children:"Billing"})}),jsxRuntimeExports.jsx(DropdownMenuSeparator,{}),remove&&jsxRuntimeExports.jsx(DropdownMenuItem,{className:"focus:bg-red/70 focus:text-white",onClick:onDeleteClick,children:"Delete"})]})]})]}),jsxRuntimeExports.jsx(CardTitle,{children:jsxRuntimeExports.jsx("h2",{children:organizationName})})]}),jsxRuntimeExports.jsxs(CardContent,{className:"flex justify-between",children:[jsxRuntimeExports.jsx(Badge,{children:capitalizeWords(roleName)}),jsxRuntimeExports.jsx(Link$2,{to:organizationId,className:"text-sm","aria-label":`View ${organizationName}`,title:`View ${organizationName}`,children:jsxRuntimeExports.jsxs("span",{className:"py-2 transition-all duration-100 ease-in-out border-0 hover:border-b-2",children:["View ",jsxRuntimeExports.jsx(ArrowRight,{className:"inline-block"})]})})]})]})}__name(OrgCard,"OrgCard");async function onDeleteOrganization(orgId){const{data}=await apiClient.delete(`/Organization/${orgId}`);return data}__name(onDeleteOrganization,"onDeleteOrganization");function useDeleteOrganizationMutation(){return useMutation({mutationFn:__name(orgId=>onDeleteOrganization(orgId),"mutationFn")})}__name(useDeleteOrganizationMutation,"useDeleteOrganizationMutation");async function onNewOrganizationSubmit(newOrg){const{data}=await apiClient.post("/Organization/",{...newOrg});return data}__name(onNewOrganizationSubmit,"onNewOrganizationSubmit");function useCreateNewOrganizationMutation(){return useMutation({mutationFn:__name(clusterInfo=>onNewOrganizationSubmit(clusterInfo),"mutationFn")})}__name(useCreateNewOrganizationMutation,"useCreateNewOrganizationMutation");const specifiedSubdomain=string$3().max(62,{error:"Must be at most 62 characters long."}).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/,{error:"Please only use lowercase letters, digits and dashes (-) in the subdomain. Must not start or end with a dash."}),NewOrganizationSchema=object({name:string$3().max(255,{error:"Name cannot be longer than 255 characters."}),subdomain:union([literal(""),_undefined(),specifiedSubdomain])});function NewOrgForm(){const{user}=useCloudAuth(),navigate=useNavigate(),form=useForm({resolver:a(NewOrganizationSchema),defaultValues:{name:"",subdomain:""}}),{setFocus,watch}=form;reactExports.useEffect(()=>{setFocus("name")},[setFocus]);const defaultName=`${user?.firstname} ${user?.lastname} Org`,name2=watch("name")||defaultName,subdomain=watch("subdomain"),calculatedNames=reactExports.useMemo(()=>{const suggestedSubdomain=collapseKebabsToMaxLength(toKebabCase(name2),specifiedSubdomain.maxLength);return{suggestedSubdomain,fullHostName:`future-cluster-names.${subdomain||suggestedSubdomain}.harperfabric.com`}},[name2,subdomain]),{mutate:submitNewOrganizationData,isPending}=useCreateNewOrganizationMutation(),queryClient2=useQueryClient(),submitForm=reactExports.useCallback(async formData=>{submitNewOrganizationData({name:formData.name||defaultName,subdomain:formData.subdomain||calculatedNames.suggestedSubdomain},{onSuccess:__name(newOrg=>{queryClient2.invalidateQueries({queryKey:currentUserQueryKey,refetchType:"active"}),authStore.reloadUser(OverallAppSignIn),navigate({to:`/${newOrg.id}`})},"onSuccess")})},[calculatedNames.suggestedSubdomain,queryClient2,submitNewOrganizationData,defaultName,navigate]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Form,{...form,children:jsxRuntimeExports.jsxs("form",{id:"org-add-form",name:"org-add-form",onSubmit:form.handleSubmit(submitForm),className:"grid gap-6 text-white max-w-xl",children:[jsxRuntimeExports.jsx(FormField,{control:form.control,name:"name",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"Name"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"text",maxLength:NewOrganizationSchema.shape.name.maxLength,autoCapitalize:"words",placeholder:defaultName,...field})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(FormField,{control:form.control,name:"subdomain",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"Subdomain"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"text",maxLength:specifiedSubdomain.maxLength,autoCapitalize:"none",placeholder:calculatedNames.suggestedSubdomain,...field})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"Full Host Name"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx("span",{children:calculatedNames.fullHostName})}),jsxRuntimeExports.jsx(FormMessage,{})]}),jsxRuntimeExports.jsx(DialogFooter,{children:jsxRuntimeExports.jsxs(Button,{type:"submit",variant:"submit",className:"rounded-full",disabled:isPending,children:["Create New Organization ",jsxRuntimeExports.jsx(ArrowRight,{})]})})]})})})}__name(NewOrgForm,"NewOrgForm");function NewOrg(){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SubNavMenu,{}),jsxRuntimeExports.jsx("section",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:jsxRuntimeExports.jsx(NewOrgForm,{})})]})}__name(NewOrg,"NewOrg");function OrganizationsIndex(){const queryClient2=useQueryClient(),{data:user}=useSuspenseQuery(getCurrentUserQueryOptions()),{mutate:deleteOrg,isPending:isDeletingOrgPending}=useDeleteOrganizationMutation(),[isDeleteOrgModalOpen,setIsDeleteOrgModalOpen]=reactExports.useState(!1),[deleteOrgInfo,setDeleteOrgInfo]=reactExports.useState(null),[filterByNameValue,setFilterByNameValue]=reactExports.useState(""),clearFilterByNameValue=reactExports.useCallback(()=>setFilterByNameValue(""),[]),organizationRoles=reactExports.useMemo(()=>{const roles=user?.roles||{},organizations=Object.values(roles);return Object.keys(roles).map((organizationId,index2)=>({organizationId,organizationName:organizations[index2].organizationName,roleName:organizations[index2].role})).filter(curryFilterByFuzzySearch(["organizationId","organizationName"],filterByNameValue)).sort((a2,b)=>(a2.organizationName||"")>(b.organizationName||"")?1:-1)||[]},[filterByNameValue,user?.roles]),onFilterByNameChanged=reactExports.useCallback(e=>{setFilterByNameValue(e.currentTarget.value?.toLowerCase()||"")},[]),handleDeleteOrg=reactExports.useCallback(org=>{org?.organizationId&&deleteOrg(org.organizationId,{onSuccess:__name(()=>{toast.success("Success",{description:"Organization successfully deleted.",duration:5e3,action:{label:"Dismiss",onClick:__name(()=>toast.dismiss(),"onClick")}}),queryClient2.invalidateQueries({queryKey:[]}),setIsDeleteOrgModalOpen(!1)},"onSuccess"),onError:__name(()=>setIsDeleteOrgModalOpen(!1),"onError")})},[deleteOrg,queryClient2,setIsDeleteOrgModalOpen]),onDeleteOrgModal=reactExports.useCallback(orgRole=>{setDeleteOrgInfo(orgRole),setIsDeleteOrgModalOpen(!0)},[]),{createCluster}=useSearch({strict:!1});return organizationRoles.length===1&&!filterByNameValue.length&&createCluster?jsxRuntimeExports.jsx(Navigate,{to:`/${organizationRoles[0].organizationId}/new-cluster`,replace:!0}):!organizationRoles.length&&!filterByNameValue.length?jsxRuntimeExports.jsx(NewOrg,{}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SubNavMenu,{children:jsxRuntimeExports.jsxs("div",{className:"flex w-full justify-end gap-2",children:[jsxRuntimeExports.jsx(Input,{placeholder:"Filter by name",className:"inline-block w-full text-xs",value:filterByNameValue,onChange:onFilterByNameChanged}),jsxRuntimeExports.jsx(Link$2,{to:"/new-org",children:jsxRuntimeExports.jsxs(Button,{variant:"positive",accessKey:"n",children:[jsxRuntimeExports.jsx(Plus,{}),jsxRuntimeExports.jsxs("span",{className:"hidden sm:inline-block",children:[jsxRuntimeExports.jsx("u",{children:"N"}),"ew ",jsxRuntimeExports.jsx("span",{className:"hidden md:inline-block",children:"Organization"})]})]})})]})}),jsxRuntimeExports.jsx("section",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-12",children:[organizationRoles.map(organizationRole=>jsxRuntimeExports.jsx("div",{className:"col-span-1 md:col-span-4 lg:col-span-3 2xl:col-span-2",children:jsxRuntimeExports.jsx(OrgCard,{organizationRole,onDeleteOrgModal})},organizationRole.organizationId)),!organizationRoles.length&&jsxRuntimeExports.jsxs("div",{className:"col-span-1 md:col-span-12 text-center",children:[jsxRuntimeExports.jsx("h2",{className:"my-4 text-xl",children:"No matches found."}),jsxRuntimeExports.jsx(Button,{variant:"outline",onClick:clearFilterByNameValue,children:"Clear Filters"})]})]})}),deleteOrgInfo&&jsxRuntimeExports.jsx(ConfirmDeletionModal,{typeOfThingBeingDeleted:"organization",nameOfThingBeingDeleted:deleteOrgInfo.organizationName,isModalOpen:isDeleteOrgModalOpen,setIsModalOpen:__name(()=>setIsDeleteOrgModalOpen(!1),"setIsModalOpen"),deletionConfirmed:__name(()=>handleDeleteOrg(deleteOrgInfo),"deletionConfirmed"),deletionPending:isDeletingOrgPending})]})}__name(OrganizationsIndex,"OrganizationsIndex");function Dashboard(){const{isLoading:isUserLoading}=useOverallAuth(),{createCluster}=useSearch({strict:!1}),[,setSavedClusterState]=useLocalStorage(LocalStorageKeys.SavedClusterState,null);return reactExports.useEffect(()=>{createCluster&&setSavedClusterState(createCluster)},[createCluster,setSavedClusterState]),isUserLoading?jsxRuntimeExports.jsx(Loading,{className:"fixed z-50 translate-1/2"}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.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:jsxRuntimeExports.jsx(Navbar,{})}),jsxRuntimeExports.jsx("main",{children:jsxRuntimeExports.jsx(Outlet,{})})]})}__name(Dashboard,"Dashboard");const ignoredUrls=["/","/forgot-password","/reset-password","/sign-in","/sign-up","/verify-email"];function buildRedirectInSearch(){const url2=currentUrlAfterHash();return!ignoredUrls.includes(url2)&&{redirect:url2}}__name(buildRedirectInSearch,"buildRedirectInSearch");const dashboardLayout=createRoute({getParentRoute:__name(()=>rootRoute,"getParentRoute"),id:"_dashboardLayout",component:Dashboard,beforeLoad:__name(({context})=>{const auth=context.authentication[OverallAppSignIn];if(auth&&!auth.isLoading&&!auth.user)throw redirect({to:"/sign-in",search:buildRedirectInSearch()})},"beforeLoad")}),orgsLayoutRoute=createRoute({getParentRoute:__name(()=>dashboardLayout,"getParentRoute"),id:"_orgsLayout"});createRoute({getParentRoute:__name(()=>orgsLayoutRoute,"getParentRoute"),path:"/",component:OrganizationsIndex});createRoute({getParentRoute:__name(()=>orgsLayoutRoute,"getParentRoute"),path:"/new-org",component:NewOrg});const orgLayoutRoute=createRoute({getParentRoute:__name(()=>orgsLayoutRoute,"getParentRoute"),path:"$organizationId",beforeLoad:__name(async opts=>({organization:await opts.context.queryClient.ensureQueryData(getOrganizationQueryOptions(opts.params.organizationId))}),"beforeLoad")}),orgRolesRoute=createRoute({getParentRoute:__name(()=>orgLayoutRoute,"getParentRoute"),path:"/roles",component:OrgConfigRolesIndex}),orgRoleRoute=createRoute({getParentRoute:__name(()=>orgLayoutRoute,"getParentRoute"),path:"/roles/$orgRoleId",component:OrgConfigRolesIndex}),orgUsersRoute=createRoute({getParentRoute:__name(()=>orgLayoutRoute,"getParentRoute"),path:"/users",component:OrgConfigUsersIndex}),orgUserRoute=createRoute({getParentRoute:__name(()=>orgLayoutRoute,"getParentRoute"),path:"/users/$orgUserId",component:OrgConfigUsersIndex});createBillingRouteTree(orgLayoutRoute);const clustersLayoutRoute=createRoute({getParentRoute:__name(()=>orgLayoutRoute,"getParentRoute"),id:"_clusterLayout"});createRoute({getParentRoute:__name(()=>clustersLayoutRoute,"getParentRoute"),path:"/",component:ClustersList});createRoute({getParentRoute:__name(()=>orgLayoutRoute,"getParentRoute"),path:"/new-cluster",component:UpsertCluster});createRoute({getParentRoute:__name(()=>clusterLayoutRoute,"getParentRoute"),path:"/edit",component:UpsertCluster});function ClusterLayout(){return jsxRuntimeExports.jsx(Outlet,{})}__name(ClusterLayout,"ClusterLayout");const clusterLayoutRoute=createRoute({getParentRoute:__name(()=>clustersLayoutRoute,"getParentRoute"),path:"$clusterId",component:ClusterLayout,beforeLoad:__name(async({context,params})=>({cluster:await context.queryClient.ensureQueryData(getClusterInfoQueryOptions(params.clusterId))}),"beforeLoad")});function NestedContentWithSubNavMenu({children,className}){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SubNavMenu,{}),jsxRuntimeExports.jsx("div",{className:cx$1("mt-32 px-4 py-4 md:px-12 min-h-[calc(100vh-(--spacing(32)))] flex justify-center",className),children})]})}__name(NestedContentWithSubNavMenu,"NestedContentWithSubNavMenu");var SWITCH_NAME="Switch",[createSwitchContext]=createContextScope(SWITCH_NAME),[SwitchProvider,useSwitchContext]=createSwitchContext(SWITCH_NAME),Switch$1=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeSwitch,name:name2,checked:checkedProp,defaultChecked,required:required2,disabled,value="on",onCheckedChange,form,...switchProps}=props,[button,setButton]=reactExports.useState(null),composedRefs=useComposedRefs(forwardedRef,node2=>setButton(node2)),hasConsumerStoppedPropagationRef=reactExports.useRef(!1),isFormControl=button?form||!!button.closest("form"):!0,[checked,setChecked]=useControllableState({prop:checkedProp,defaultProp:defaultChecked??!1,onChange:onCheckedChange,caller:SWITCH_NAME});return jsxRuntimeExports.jsxs(SwitchProvider,{scope:__scopeSwitch,checked,disabled,children:[jsxRuntimeExports.jsx(Primitive$1.button,{type:"button",role:"switch","aria-checked":checked,"aria-required":required2,"data-state":getState$1(checked),"data-disabled":disabled?"":void 0,disabled,value,...switchProps,ref:composedRefs,onClick:composeEventHandlers$1(props.onClick,event=>{setChecked(prevChecked=>!prevChecked),isFormControl&&(hasConsumerStoppedPropagationRef.current=event.isPropagationStopped(),hasConsumerStoppedPropagationRef.current||event.stopPropagation())})}),isFormControl&&jsxRuntimeExports.jsx(SwitchBubbleInput,{control:button,bubbles:!hasConsumerStoppedPropagationRef.current,name:name2,value,checked,required:required2,disabled,form,style:{transform:"translateX(-100%)"}})]})});Switch$1.displayName=SWITCH_NAME;var THUMB_NAME$1="SwitchThumb",SwitchThumb=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeSwitch,...thumbProps}=props,context=useSwitchContext(THUMB_NAME$1,__scopeSwitch);return jsxRuntimeExports.jsx(Primitive$1.span,{"data-state":getState$1(context.checked),"data-disabled":context.disabled?"":void 0,...thumbProps,ref:forwardedRef})});SwitchThumb.displayName=THUMB_NAME$1;var BUBBLE_INPUT_NAME$1="SwitchBubbleInput",SwitchBubbleInput=reactExports.forwardRef(({__scopeSwitch,control,checked,bubbles=!0,...props},forwardedRef)=>{const ref=reactExports.useRef(null),composedRefs=useComposedRefs(ref,forwardedRef),prevChecked=usePrevious$2(checked),controlSize=useSize(control);return reactExports.useEffect(()=>{const input=ref.current;if(!input)return;const inputProto=window.HTMLInputElement.prototype,setChecked=Object.getOwnPropertyDescriptor(inputProto,"checked").set;if(prevChecked!==checked&&setChecked){const event=new Event("click",{bubbles});setChecked.call(input,checked),input.dispatchEvent(event)}},[prevChecked,checked,bubbles]),jsxRuntimeExports.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:checked,...props,tabIndex:-1,ref:composedRefs,style:{...props.style,...controlSize,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});SwitchBubbleInput.displayName=BUBBLE_INPUT_NAME$1;function getState$1(checked){return checked?"checked":"unchecked"}__name(getState$1,"getState$1");var Root$3=Switch$1,Thumb=SwitchThumb;function Switch({className,...props}){return jsxRuntimeExports.jsx(Root$3,{"data-slot":"switch",className:cn$1("peer data-[state=checked]:bg-green data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",className),...props,children:jsxRuntimeExports.jsx(Thumb,{"data-slot":"switch-thumb",className:cn$1("bg-white dark:data-[state=unchecked]:bg-white dark:data-[state=checked]:bg-white pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}__name(Switch,"Switch");const COMMON_SLDS=new Set(["com","co","org","net","edu","gov","mil","me","biz","info","ac","or","ne","go","lg","asn","id","nom","sch","ltd","plc"]);function extractDomainFromTLD(domain2){const parts=domain2.split(".");if(parts.length<=2)return"@";const lastPart=parts[parts.length-1],secondToLastPart=parts[parts.length-2],rootPartCount=lastPart.length===2&&COMMON_SLDS.has(secondToLastPart)?3:2;return parts.length<=rootPartCount?"@":parts.slice(0,-rootPartCount).join(".")}__name(extractDomainFromTLD,"extractDomainFromTLD");function AssociateDomainWithCluster({cluster:{fqdn},disabled,domain:{domain:domain2,id:id2},bindDomain}){const[generateDomainCerts,onGenerateDomainCerts]=useCheckboxCallback(!0),recordName=extractDomainFromTLD(domain2),[onCopyName,onCopyTarget]=useCopyToClipboard(recordName,fqdn||""),onClick=reactExports.useCallback(()=>bindDomain(generateDomainCerts),[bindDomain,generateDomainCerts]);return jsxRuntimeExports.jsxs("div",{className:"grid gap-4 grid-cols-1 md:grid-cols-[80px_1fr] pb-6",children:[jsxRuntimeExports.jsx("div",{className:"text-muted-foreground md:col-span-2 text-wrap",children:"This domain has been verified! Now to associate it with this cluster, add the following to your DNS registrar:"}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"Type:"}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"CNAME"}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"Name:"}),jsxRuntimeExports.jsxs("div",{className:"col-span-1 flex gap-2",children:[jsxRuntimeExports.jsx("input",{className:"py-1 px-3 bg-gray-700 rounded-md w-full",type:"text",readOnly:!0,name:"recordName",value:recordName,onClick:onCopyName}),jsxRuntimeExports.jsx(Button,{type:"button",size:"sm",onClick:onCopyName,children:jsxRuntimeExports.jsx(Copy,{className:"w-4 h-4"})})]}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"TTL:"}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"Auto"}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"Target:"}),jsxRuntimeExports.jsxs("div",{className:"col-span-1 flex gap-2",children:[jsxRuntimeExports.jsx("input",{className:"py-1 px-3 bg-gray-700 rounded-md w-full",type:"text",readOnly:!0,name:"recordTarget",value:fqdn,onClick:onCopyTarget}),jsxRuntimeExports.jsx(Button,{type:"button",size:"sm",onClick:onCopyTarget,children:jsxRuntimeExports.jsx(Copy,{className:"w-4 h-4"})})]}),jsxRuntimeExports.jsx("div",{className:"text-muted-foreground md:col-span-2 text-wrap",children:"Once you've completed the above steps, you are ready to bind the domain to this cluster. A domain can only be bound to a single cluster."}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:jsxRuntimeExports.jsx("label",{htmlFor:"generateDomainCerts",children:"Certs:"})}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:jsxRuntimeExports.jsxs("label",{htmlFor:"generateDomainCerts",className:"-m-2 p-2",children:["Should we generate SSL certificates with LetsEncrypt?",jsxRuntimeExports.jsxs("div",{className:"flex mt-2",children:[jsxRuntimeExports.jsx(Switch,{id:"generateDomainCerts",checked:generateDomainCerts,className:"mr-2",onCheckedChange:onGenerateDomainCerts}),generateDomainCerts?"Yes":"No, I will add my own certificates, thank you very much."]})]})}),jsxRuntimeExports.jsx("div",{className:"col-span-1"}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:jsxRuntimeExports.jsxs(Button,{type:"button",variant:"submit","data-id":id2,onClick,disabled,children:[jsxRuntimeExports.jsx(Save,{})," Bind to This Cluster"]})})]})}__name(AssociateDomainWithCluster,"AssociateDomainWithCluster");function VerifyDomainOwnership({domain:{challengeToken,challengeTxtRecord}}){const[onCopyTxtRecord,onCopyToken]=useCopyToClipboard(challengeTxtRecord,challengeToken);return jsxRuntimeExports.jsxs("div",{className:"grid gap-2 grid-cols-1 md:grid-cols-[80px_1fr] pb-6",children:[jsxRuntimeExports.jsx("div",{className:"text-muted-foreground md:col-span-2 text-wrap",children:"Prove that you own this domain by adding the following to your DNS registrar:"}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"Type:"}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"TXT"}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"Name:"}),jsxRuntimeExports.jsxs("div",{className:"col-span-1 flex gap-2",children:[jsxRuntimeExports.jsx("input",{className:"py-1 px-3 bg-gray-700 rounded-md w-full",type:"text",readOnly:!0,name:"challengeName",value:challengeTxtRecord,onClick:onCopyTxtRecord}),jsxRuntimeExports.jsx(Button,{type:"button",size:"sm",onClick:onCopyTxtRecord,children:jsxRuntimeExports.jsx(Copy,{className:"w-4 h-4"})})]}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"TTL:"}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"Auto"}),jsxRuntimeExports.jsx("div",{className:"col-span-1",children:"Content:"}),jsxRuntimeExports.jsxs("div",{className:"col-span-1 flex gap-2",children:[jsxRuntimeExports.jsx("input",{className:"py-1 px-3 bg-gray-700 rounded-md w-full",type:"text",readOnly:!0,name:"challengeToken",value:challengeToken,onClick:onCopyToken}),jsxRuntimeExports.jsx(Button,{type:"button",size:"sm",onClick:onCopyToken,children:jsxRuntimeExports.jsx(Copy,{className:"w-4 h-4"})})]}),jsxRuntimeExports.jsx("div",{className:"text-muted-foreground md:col-span-2 text-wrap",children:'Then after your DNS TTL elapses, click the "Validate" button above.'})]})}__name(VerifyDomainOwnership,"VerifyDomainOwnership");async function setDomainIdsOnCluster({clusterId,domainIds,generateDomainCerts}){const{data}=await apiClient.put(`/Cluster/${clusterId}`,{domainIds,generateDomainCerts},{timeout:0});return data}__name(setDomainIdsOnCluster,"setDomainIdsOnCluster");function useSetDomainIdsOnCluster(){return useMutation({mutationFn:__name(params=>setDomainIdsOnCluster(params),"mutationFn")})}__name(useSetDomainIdsOnCluster,"useSetDomainIdsOnCluster");z.object({domainId:z.string()});async function deleteDomainSubmit(formData){const{data}=await apiClient.delete(`/Domain/${formData.domainId}`);return data}__name(deleteDomainSubmit,"deleteDomainSubmit");function useDeleteDomain(){return useMutation({mutationFn:__name(formData=>deleteDomainSubmit(formData),"mutationFn")})}__name(useDeleteDomain,"useDeleteDomain");function unique(arr){return[...new Set(arr)]}__name(unique,"unique");const columnHelper$3=createColumnHelper();function useDataTableColumns(cluster){const{mutate:setDomainIds,isPending:addPending}=useSetDomainIdsOnCluster(),{mutate:deleteDomain,isPending:deletePending}=useDeleteDomain(),isPending=addPending||deletePending,bindDomainToThisCluster=reactExports.useCallback((domainId,generateDomainCerts)=>{if(!isRunning(cluster.status)){toast.error("Cluster is currently "+cluster.status,{description:"To bind a domain, it must be running."});return}setDomainIds({clusterId:cluster.id,domainIds:unique((cluster.domainIds?.slice()||[]).concat([domainId])),generateDomainCerts},{onSuccess:__name(()=>{queryClient.invalidateQueries({queryKey:[cluster.organizationId],refetchType:"active"}),toast.success("Domain bound!"+(generateDomainCerts?" Certificates are being generated in the background now.":""))},"onSuccess")})},[setDomainIds,cluster]),deleteDomainById=reactExports.useCallback(domainId=>{deleteDomain({domainId},{onSuccess:__name(()=>{queryClient.invalidateQueries({queryKey:[cluster.organizationId,"domains"],refetchType:"active"}),toast.success("Domain removed!")},"onSuccess")})},[deleteDomain]),unbindDomainById=reactExports.useCallback(domainId=>{setDomainIds({clusterId:cluster.id,domainIds:(cluster.domainIds?.slice()||[]).filter(id2=>id2!==domainId),generateDomainCerts:!1},{onSuccess:__name(()=>{queryClient.invalidateQueries({queryKey:[cluster.organizationId],refetchType:"active"}),toast.success("Domain unbound!")},"onSuccess")})},[deleteDomain]);return reactExports.useMemo(()=>[columnHelper$3.display({header:"Domains",id:"domain",enableSorting:!1,size:150,cell:__name(props=>{const domain2=props.row.original;return jsxRuntimeExports.jsxs(Tooltip,{children:[jsxRuntimeExports.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{children:domain2.domain}),jsxRuntimeExports.jsx(Button,{variant:"destructiveGhost",className:"text-muted-foreground text-xs",disabled:isPending||!!domain2.clusterId,onClick:__name(()=>deleteDomainById(domain2.id),"onClick"),children:"Remove Domain"})]})}),jsxRuntimeExports.jsx(TooltipContent,{side:"bottom",align:"center",children:domain2.clusterId?"To delete this domain, please unbind it from all clusters first.":"Remember to clean up your DNS records!"})]})},"cell")}),columnHelper$3.display({header:"Next Steps",enableSorting:!1,size:500,id:"nextSteps",cell:__name(props=>{const domain2=props.row.original;return domain2.status==="ACTIVE"&&domain2.clusterId?cluster.id===domain2.clusterId?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{children:"Bound to this cluster"}),jsxRuntimeExports.jsx(Button,{variant:"destructiveGhost",className:"text-muted-foreground text-xs",disabled:isPending,onClick:__name(()=>unbindDomainById(domain2.id),"onClick"),children:"Unbind Domain"})]}):`Bound to cluster ${domain2.clusterId}`:domain2.status==="PENDING_VALIDATION"?jsxRuntimeExports.jsx(VerifyDomainOwnership,{domain:domain2}):clusterIsSelfManaged(cluster)?"Cannot be associated with this self-managed cluster.":domain2.status==="ACTIVE"&&!domain2.clusterId?jsxRuntimeExports.jsx(AssociateDomainWithCluster,{cluster,domain:domain2,bindDomain:__name(generateDomainCerts=>bindDomainToThisCluster(domain2.id,generateDomainCerts),"bindDomain"),disabled:isPending}):domain2.status},"cell")})],[cluster,bindDomainToThisCluster,isPending])}__name(useDataTableColumns,"useDataTableColumns");const AddOrganizationDomainSchema=z.object({domain:z.string(),organizationId:z.string()});async function onAddDomainToOrganizationSubmit(formData){const{data}=await apiClient.post("/Domain/",formData);return data}__name(onAddDomainToOrganizationSubmit,"onAddDomainToOrganizationSubmit");function useAddDomainToOrganization(){return useMutation({mutationFn:__name(formData=>onAddDomainToOrganizationSubmit(formData),"mutationFn")})}__name(useAddDomainToOrganization,"useAddDomainToOrganization");async function validateDomainInOrganization(domainId){const{data}=await apiClient.post(`/Domain/${domainId}/validate`);return data}__name(validateDomainInOrganization,"validateDomainInOrganization");async function getOrganizationDomains(organizationId){const{data}=await apiClient.get(`/Domain/?organizationId=${organizationId}`);return data}__name(getOrganizationDomains,"getOrganizationDomains");function getOrganizationDomainsQueryOptions(organizationId){return{queryKey:[organizationId,"domains"],queryFn:__name(()=>getOrganizationDomains(organizationId),"queryFn")}}__name(getOrganizationDomainsQueryOptions,"getOrganizationDomainsQueryOptions");function DomainsManagement(){const{organizationId,clusterId}=useParams({strict:!1}),{data:cluster}=useSuspenseQuery(getClusterInfoQueryOptions(clusterId,!0)),{update}=useOrganizationRolePermissions(organizationId),{data:organizationDomains,refetch,isFetching,isRefetching}=useQuery(getOrganizationDomainsQueryOptions(organizationId)),pendingDomains=reactExports.useMemo(()=>organizationDomains?.filter(o2=>o2.status==="PENDING_VALIDATION")||[],[organizationDomains]),[sortTableDataParams]=reactExports.useState({attribute:"domain",descending:!1}),sortingState=reactExports.useMemo(()=>[{desc:sortTableDataParams.descending,id:sortTableDataParams.attribute}],[sortTableDataParams]),onRefreshClick=useRefreshClick(refetch),{mutate:addDomain,isPending:isAddPending}=useAddDomainToOrganization(),form=useForm({resolver:a(AddOrganizationDomainSchema),defaultValues:{domain:"",organizationId}}),onSubmitClick=reactExports.useCallback(async formData=>{formData&&addDomain(formData,{onSuccess:__name(()=>{form.reset(),refetch(),toast.success("Domain added! Please add the txt record above to your domain registrar.")},"onSuccess")})},[addDomain,form,refetch]),onValidateClick=reactExports.useCallback(async()=>{const message=`Validating ${pluralize(pendingDomains.length,"domain","domains")}...`,id2="validatingDomains";let checked=0,failed=0;for(const pendingDomain of pendingDomains)try{toast.loading(message,{description:`${checked++} of ${pendingDomains.length} checked`,id:id2}),await validateDomainInOrganization(pendingDomain.id)}catch{failed+=1}failed>0?toast.error("Validation failed!",{description:"Please make sure the TXT record has been put in place. You may need to wait a bit for the DNS change to propagate.",id:id2}):(await refetch(),toast.success("Validation succeeded!",{description:"Please take a look at the next steps for newly verified domains.",id:id2}))},[pendingDomains]),dataTableColumns2=useDataTableColumns(cluster);return jsxRuntimeExports.jsx(SimpleBrowseDataTable,{data:organizationDomains||[],isFetching:isFetching||isRefetching,columns:dataTableColumns2,sortingState,children:jsxRuntimeExports.jsxs("div",{className:"w-full flex flex-col md:flex-row justify-between md:items-center md:space-x-2 space-y-2 md:space-y-0",children:[update&&jsxRuntimeExports.jsx(Form,{...form,children:jsxRuntimeExports.jsxs("form",{id:"cluster-add-domain-form",name:"cluster-add-domain-form",onSubmit:form.handleSubmit(onSubmitClick),className:"flex gap-1 flex-col md:flex-row",children:[jsxRuntimeExports.jsx(FormField,{control:form.control,name:"domain",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{className:"flex-1",children:[jsxRuntimeExports.jsx(FormLabel,{className:"pb-1",children:"New Domain Name"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"text",enterKeyHint:"done",autoComplete:"off",...field})}),jsxRuntimeExports.jsx(FormMessage,{children:jsxRuntimeExports.jsx("span",{className:"text-muted-foreground italic",children:"Type in a domain like example.com or your.example.com, and you'll be guided through validating and binding your cluster to it."})})]}),"render")}),jsxRuntimeExports.jsx("div",{className:"flex-0 self-start md:pt-6.5",children:jsxRuntimeExports.jsxs(Button,{type:"submit",variant:"submit",disabled:isAddPending,children:[jsxRuntimeExports.jsx(Plus,{})," Add"]})})]})}),pendingDomains.length>0&&jsxRuntimeExports.jsxs(Button,{variant:"positiveOutline",onClick:onValidateClick,accessKey:"r",disabled:isFetching||isRefetching,children:[jsxRuntimeExports.jsx(ListTodo,{})," ",jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsx("u",{children:"V"}),"alidate"]})]}),jsxRuntimeExports.jsxs(Button,{variant:"defaultOutline",onClick:onRefreshClick,accessKey:"r",disabled:isFetching||isRefetching,children:[jsxRuntimeExports.jsx(RefreshCw,{})," ",jsxRuntimeExports.jsxs("span",{className:"hidden lg:inline-block",children:[jsxRuntimeExports.jsx("u",{children:"R"}),"efresh"]})]})]})})}__name(DomainsManagement,"DomainsManagement");function DomainsPage(){return jsxRuntimeExports.jsx(NestedContentWithSubNavMenu,{className:"flex flex-col justify-start max-w-4xl",children:jsxRuntimeExports.jsx(DomainsManagement,{})})}__name(DomainsPage,"DomainsPage");const AddUserFormSchema=object({username:zodRequireUsername,role:string$3().nonempty({error:"Please select a role."}),password:zodRequirePassword.min(8,{error:"Password must be at least 8 characters long."}),confirmPassword:string$3()}).refine(data=>data.password===data.confirmPassword,{error:"Passwords do not match.",path:["confirmPassword"]});async function resetPasswordUpdater(clusterId){await apiClient.patch(`/ResetPasswordUpdater/${clusterId}`)}__name(resetPasswordUpdater,"resetPasswordUpdater");async function onAddUserSubmit(formData){const{instanceClient,...userData}=formData,{data}=await instanceClient.post("/",{operation:"add_user",...userData});return data}__name(onAddUserSubmit,"onAddUserSubmit");function useAddUserMutation(){return useMutation({mutationFn:onAddUserSubmit})}__name(useAddUserMutation,"useAddUserMutation");async function onAlterUser({username,password,role,active,instanceClient}){const{data}=await instanceClient.post("/",{operation:"alter_user",username,password,role,active});return data}__name(onAlterUser,"onAlterUser");function useAlterUser(){return useMutation({mutationFn:onAlterUser})}__name(useAlterUser,"useAlterUser");async function onDeleteUser({username,instanceClient}){const{data}=await instanceClient.post("/",{operation:"drop_user",username});return data}__name(onDeleteUser,"onDeleteUser");function useDeleteUserMutation(){return useMutation({mutationFn:onDeleteUser})}__name(useDeleteUserMutation,"useDeleteUserMutation");async function onInstanceResetPassword({clusterId,initialUsername,desiredUsername,newPassword,tempPassword,instanceClient:initialInstanceClient}){if(!tempPassword)throw new Error("You may not have permission to set the password on this cluster.");let instanceClient=initialInstanceClient;try{const loginResponse=await onInstanceLoginSubmit({username:initialUsername,password:tempPassword,instanceClient,entityId:clusterId});return loginResponse.instanceClient&&(instanceClient=loginResponse.instanceClient),desiredUsername===defaultClusterUsername?await onAlterUser({username:desiredUsername,password:newPassword,instanceClient}):(await onAddUserSubmit({username:desiredUsername,password:newPassword,role:"super_user",active:!0,instanceClient}),await onInstanceLoginSubmit({username:desiredUsername,password:newPassword,instanceClient,entityId:clusterId}),await onDeleteUser({username:defaultClusterUsername,instanceClient})),await resetPasswordUpdater(clusterId),loginResponse}catch(err){throw await onInstanceLogoutSubmit({entityId:clusterId,instanceClient}),err}}__name(onInstanceResetPassword,"onInstanceResetPassword");function useInstanceResetPasswordMutation(){return useMutation({mutationFn:onInstanceResetPassword})}__name(useInstanceResetPasswordMutation,"useInstanceResetPasswordMutation");function FinishSetup(){const{user}=useCloudAuth(),{clusterId}=useParams({strict:!1}),{data:cluster}=useQuery(getClusterInfoQueryOptions(clusterId,!0)),navigate=useNavigate(),operationsUrl=reactExports.useMemo(()=>getOperationsUrlForCluster(cluster),[cluster]),instanceClient=useInstanceClient(operationsUrl),{redirect:redirect2}=useSearch({strict:!1}),router=useRouter(),methods=useForm({resolver:a(AddUserFormSchema),defaultValues:{confirmPassword:"",password:"",role:"super_user",username:user?.email??""}}),{setFocus,control,handleSubmit}=methods;reactExports.useEffect(()=>{setFocus("password")},[setFocus]);const tempPassword=cluster?.instances?.find(i2=>i2.tempPassword)?.tempPassword,{mutate:submitInstanceResetPassword,isPending}=useInstanceResetPasswordMutation(),submitForm=reactExports.useCallback(async formData=>{if(!operationsUrl){toast.error("Cluster is not yet fully loaded, please wait a moment before trying to sign in.");return}submitInstanceResetPassword({instanceClient,clusterId,newPassword:formData.password,tempPassword,initialUsername:defaultClusterUsername,desiredUsername:formData.username},{onSuccess:__name(async({message,user:user2})=>{toast.success(message),authStore.setUserForEntity(cluster,user2),router.invalidate(),await navigate({to:redirect2?.startsWith("/")?redirect2:defaultInstanceRouteUpOne})},"onSuccess")})},[cluster,clusterId,instanceClient,navigate,operationsUrl,redirect2,router,submitInstanceResetPassword,tempPassword]);return cluster&&!cluster.resetPassword?jsxRuntimeExports.jsx(Navigate,{to:"../sign-in",replace:!0}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("nav",{className:"fixed top-20 w-full h-12 z-39 px-4 md:px-12 bg-grey-700 flex items-center",children:jsxRuntimeExports.jsx(Breadcrumbs,{})}),jsxRuntimeExports.jsx("div",{className:"items-center justify-center flex mt-32 py-4 min-h-[calc(100vh-(--spacing(32)))]",children:jsxRuntimeExports.jsxs("div",{className:"text-white w-xs",children:[jsxRuntimeExports.jsx("h2",{className:"text-2xl font-light",children:"Create Admin User"}),jsxRuntimeExports.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."}),jsxRuntimeExports.jsx(Form,{...methods,children:jsxRuntimeExports.jsxs("form",{id:"cluster-create-admin-form",name:"cluster-create-admin-form",onSubmit:handleSubmit(submitForm),className:"my-4",children:[jsxRuntimeExports.jsx(FormField,{control,name:"username",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{className:"my-4",children:[jsxRuntimeExports.jsx(FormLabel,{children:"Username"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{autoComplete:"username",type:"text",...field})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(FormField,{control,name:"password",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{className:"my-4",children:[jsxRuntimeExports.jsx(FormLabel,{children:"Password"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"password",...field})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(FormField,{control,name:"confirmPassword",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{className:"my-4",children:[jsxRuntimeExports.jsx(FormLabel,{children:"Confirm Password"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"password",...field})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(Button,{disabled:isPending,type:"submit",variant:"submit",className:"w-full my-2 rounded-full",children:"Create Admin User"})]})}),jsxRuntimeExports.jsxs("p",{className:"text-muted-foreground flex gap-2 align-middle",children:[jsxRuntimeExports.jsx(Activity,{size:36,className:"flex-none"}),jsxRuntimeExports.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."})]})]})})]})}__name(FinishSetup,"FinishSetup");function DataTable({columns:columns2,data}){const table2=useReactTable({data,columns:columns2,getCoreRowModel:getCoreRowModel()});return jsxRuntimeExports.jsx("div",{className:"bg-black-dark rounded-md",children:jsxRuntimeExports.jsxs(Table,{children:[jsxRuntimeExports.jsx(TableHeader,{children:table2.getHeaderGroups().map(headerGroup=>jsxRuntimeExports.jsx(TableRow,{className:"border-none",children:headerGroup.headers.map(header=>jsxRuntimeExports.jsx(TableHead,{className:"p-4",style:{width:`${header.getSize()}%`},children:header.isPlaceholder?null:flexRender(header.column.columnDef.header,header.getContext())},header.id))},headerGroup.id))}),jsxRuntimeExports.jsx(TableBody,{className:"bg-black",children:table2.getRowModel().rows?.length?table2.getRowModel().rows.map(row=>jsxRuntimeExports.jsx(TableRow,{"data-state":row.getIsSelected()&&"selected",className:"hover:bg-muted/10 data-[state=selected]:bg-muted",children:row.getVisibleCells().map(cell=>jsxRuntimeExports.jsx(TableCell,{className:"p-4",style:{width:`${cell.column.getSize()}%`},children:flexRender(cell.column.columnDef.cell,cell.getContext())},cell.id))},row.id)):jsxRuntimeExports.jsx(TableRow,{children:jsxRuntimeExports.jsx(TableCell,{colSpan:columns2.length,className:"h-24 text-center",children:"No results."})})})]})})}__name(DataTable,"DataTable");function EmptyCluster(){return jsxRuntimeExports.jsx("div",{className:"flex-col items-center justify-center px-16 space-y-3 text-center pt-30",children:jsxRuntimeExports.jsx("p",{children:"No instances found."})})}__name(EmptyCluster,"EmptyCluster");function InstanceLogInCell({isSelfManaged,instance}){const{user:instanceUser,isLoading:instanceAuthIsLoading}=useInstanceAuth(instance.id),operationsUrl=reactExports.useMemo(()=>getOperationsUrlForInstance(instance),[instance]),instanceClient=useInstanceClient(operationsUrl),{update}=useOrganizationClusterInstancePermissions(),isFabricConnect=authStore.checkForFabricConnect(instance.id),onSignOutClick=reactExports.useCallback(async()=>{await onInstanceLogoutSubmit({instanceClient,entityId:instance.id}),authStore.setUserForEntity(instance,null)},[instance,instanceClient]);return instanceAuthIsLoading||!["CLONE_READY","RUNNING","UPDATED"].includes(instance.status)?jsxRuntimeExports.jsx(LoaderCircle,{className:"animate-spin",color:"gray"}):!instanceUser||isFabricConnect?jsxRuntimeExports.jsxs("span",{className:"flex gap-4",children:[update&&!isSelfManaged&&jsxRuntimeExports.jsx(Link$2,{to:`../instance/${instance.id}${defaultInstanceRoute}`,className:"text-sm","aria-label":`Connect to ${instance.name} instance`,title:`Connect to ${instance.name} instance`,children:jsxRuntimeExports.jsx(Button,{variant:"positiveOutline",children:"Fabric Connect"})}),jsxRuntimeExports.jsx(Link$2,{to:`../instance/${instance.id}/sign-in`,className:"text-sm","aria-label":`Sign in to ${instance.name} instance`,title:`Sign in to ${instance.name} instance`,children:jsxRuntimeExports.jsx(Button,{variant:update?"defaultOutline":"positiveOutline",children:"Direct Sign In"})})]}):jsxRuntimeExports.jsxs("span",{className:"flex gap-4",children:[jsxRuntimeExports.jsx(Link$2,{to:`../instance/${instance.id}${defaultInstanceRoute}`,className:"text-sm","aria-label":`Go to ${instance.name} instance`,title:`Go to ${instance.name} instance`,children:jsxRuntimeExports.jsx(Button,{variant:"positiveOutline",children:"Direct Connect"})}),jsxRuntimeExports.jsx(Button,{variant:"destructiveOutline",className:"text-sm","aria-label":`Sign out from ${instance.name} instance`,title:`Sign out from ${instance.name} instance`,onClick:onSignOutClick,children:"Direct Sign Out"})]})}__name(InstanceLogInCell,"InstanceLogInCell");function Instances(){const{clusterId}=useParams({strict:!1}),{data:cluster,isLoading:clusterIsLoading}=useQuery(getClusterInfoQueryOptions(clusterId,!0)),isSelfManaged=clusterIsSelfManaged(cluster),columns2=reactExports.useMemo(()=>[{id:"instanceActions",size:1,minSize:1,cell:__name(cell=>jsxRuntimeExports.jsx("div",{className:"flex justify-end",children:jsxRuntimeExports.jsx(InstanceLogInCell,{isSelfManaged,instance:cell.row.original})}),"cell")},isSelfManaged&&{accessorKey:"instanceFqdn",size:90,header:"URL",cell:__name(cell=>calculateInstanceFQDN({secure:cell.row.original.operationsApiSecure?"true":"false",port:cell.row.original.operationsApiPort,fqdn:cell.row.original.instanceFqdn}),"cell")},!isSelfManaged&&{accessorKey:"name",size:90,header:"Name"},!isSelfManaged&&{accessorKey:"status",header:"Status",size:1,minSize:1,cell:__name(cell=>{const status=cell.getValue();return jsxRuntimeExports.jsx(Badge,{variant:renderBadgeStatusVariant(status),children:capitalizeWords(status)})},"cell")},!isSelfManaged&&{accessorKey:"version",size:1,minSize:1,header:"Version"},!isSelfManaged&&{accessorKey:"storageGb",size:1,minSize:1,header:"Storage",cell:__name(cell=>{const value=cell.getValue();return humanFileSize(value,Math.pow(1024,3))},"cell")},!isSelfManaged&&{accessorKey:"cpuCores",size:1,minSize:1,header:"Cores/Threads",cell:__name(cell=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[cell.row.original.cpuCores," / ",cell.row.original.threads]}),"cell")},!isSelfManaged&&{accessorKey:"memoryMb",size:1,minSize:1,header:"Memory",cell:__name(cell=>{const value=cell.getValue();return humanFileSize(value,Math.pow(1024,2))},"cell")}].filter(excludeFalsy),[isSelfManaged]),instances=reactExports.useMemo(()=>cluster?.instances?cluster.instances.filter(instance=>instance.status&&!deletedClusterStatuses.includes(instance.status)).sort(byInstanceFqdnThenPort):[],[cluster]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SubNavMenu,{}),jsxRuntimeExports.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:jsxRuntimeExports.jsx(Card,{className:"p-0 mt-4 min-h-96",children:jsxRuntimeExports.jsx(CardContent,{className:"p-0 min-h-96",children:clusterIsLoading?jsxRuntimeExports.jsx(TextLoadingSkeleton,{}):instances.length?jsxRuntimeExports.jsx(DataTable,{data:instances,columns:columns2}):jsxRuntimeExports.jsx(EmptyCluster,{})})})})]})}__name(Instances,"Instances");function Scaling(){const{clusterId}=useParams({strict:!1}),{data:cluster,isLoading:clusterIsLoading}=useQuery(getClusterInfoQueryOptions(clusterId,2e3)),status=cluster?.status,clusterIsActive=reactExports.useMemo(()=>status&&activeClusterStatuses.includes(status),[status]);return clusterIsLoading||!cluster?jsxRuntimeExports.jsx(NestedContentWithSubNavMenu,{className:"flex justify-center",children:jsxRuntimeExports.jsx(TextLoadingSkeleton,{})}):clusterIsActive?jsxRuntimeExports.jsx(NestedContentWithSubNavMenu,{className:"flex justify-center",children:jsxRuntimeExports.jsxs("div",{className:"center w-2xl flex flex-col gap-4",children:[jsxRuntimeExports.jsx("h1",{className:"text-xl text-center",children:"All done!"}),jsxRuntimeExports.jsx(ClusterProgress,{cluster,forceProgressBarVisible:!0}),jsxRuntimeExports.jsx("p",{children:"Your cluster finished updating, and is ready for interaction."}),jsxRuntimeExports.jsx("div",{className:"text-center",children:jsxRuntimeExports.jsx(ClusterCardAction,{cluster})})]})}):jsxRuntimeExports.jsx(NestedContentWithSubNavMenu,{className:"flex justify-center",children:jsxRuntimeExports.jsxs("div",{className:"center w-2xl flex flex-col gap-4",children:[jsxRuntimeExports.jsx("h1",{className:"text-xl text-center",children:"Here we go!"}),jsxRuntimeExports.jsx(ClusterProgress,{cluster,forceProgressBarVisible:!0}),jsxRuntimeExports.jsxs("p",{children:["Your cluster is updating with the latest changes. This includes waiting several minutes to let traffic drain safely."," ",jsxRuntimeExports.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"," ",jsxRuntimeExports.jsx("a",{href:"https://discord.gg/VzZuaw3Xay",target:"_blank",rel:"noreferrer",className:"underline hover:text-blue-300",children:"Discord"}),"! Get real-time help from our engineers, see feature drops early, and connect with others building on Fabric."]})]})]})})}__name(Scaling,"Scaling");function StartingUp(){const router=useRouter(),{clusterId}=useParams({strict:!1}),{data:cluster,isLoading:clusterIsLoading}=useQuery(getClusterInfoQueryOptions(clusterId,2e3)),status=cluster?.status,clusterIsActive=reactExports.useMemo(()=>status&&activeClusterStatuses.includes(status),[status]),clusterHasFailed=isFailed(status),[,setSavedClusterState]=useLocalStorage(LocalStorageKeys.SavedClusterState,null),onTryAgainClick=reactExports.useCallback(()=>{setSavedClusterState(cluster),router.navigate({to:`/${cluster.organizationId}/new-cluster`})},[cluster,router,setSavedClusterState]);return clusterIsLoading||!cluster?jsxRuntimeExports.jsx(NestedContentWithSubNavMenu,{className:"flex justify-center",children:jsxRuntimeExports.jsx(TextLoadingSkeleton,{})}):clusterHasFailed?jsxRuntimeExports.jsx(NestedContentWithSubNavMenu,{className:"flex justify-center",children:jsxRuntimeExports.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4 items-center",children:[jsxRuntimeExports.jsx(CloudAlert,{className:"w-24 h-24"}),jsxRuntimeExports.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. ",jsxRuntimeExports.jsx(ContactUs,{})," if you want more help."]}),jsxRuntimeExports.jsx(Button,{type:"button",variant:"positiveOutline",onClick:onTryAgainClick,children:"Try Again"})]})}):clusterIsActive?jsxRuntimeExports.jsx(NestedContentWithSubNavMenu,{className:"flex justify-center",children:jsxRuntimeExports.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4",children:[jsxRuntimeExports.jsx("h1",{className:"text-xl text-center",children:"It's ready!"}),jsxRuntimeExports.jsx(ClusterProgress,{cluster,forceProgressBarVisible:!0}),jsxRuntimeExports.jsxs("p",{children:["Let's set up your secure, browser-to-cluster connection now."," ",jsxRuntimeExports.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 ",jsxRuntimeExports.jsx("em",{children:"Direct Connect"}),"! Once you create your user, you will have the option to"," ",jsxRuntimeExports.jsx("em",{children:"Fabric Connect"})," from your Fabric account without having to sign in again."]})]}),jsxRuntimeExports.jsx("div",{className:"text-center",children:jsxRuntimeExports.jsx(ClusterCardAction,{cluster})})]})}):jsxRuntimeExports.jsx(NestedContentWithSubNavMenu,{className:"flex justify-center",children:jsxRuntimeExports.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4",children:[jsxRuntimeExports.jsx("h1",{className:"text-xl text-center",children:"Here we go!"}),jsxRuntimeExports.jsx(ClusterProgress,{cluster,forceProgressBarVisible:!0}),jsxRuntimeExports.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."," ",jsxRuntimeExports.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"," ",jsxRuntimeExports.jsx("a",{href:"https://discord.gg/VzZuaw3Xay",target:"_blank",rel:"noreferrer",className:"underline hover:text-blue-300",children:"Discord"}),"! Get real-time help from our engineers, see feature drops early, and connect with others building on Fabric."]})]})]})})}__name(StartingUp,"StartingUp");createRoute({getParentRoute:__name(()=>clusterLayoutRoute,"getParentRoute"),path:"instances",component:Instances});createRoute({getParentRoute:__name(()=>clusterLayoutRoute,"getParentRoute"),path:"starting-up",component:StartingUp});createRoute({getParentRoute:__name(()=>clusterLayoutRoute,"getParentRoute"),path:"scaling",component:Scaling});createRoute({getParentRoute:__name(()=>clusterLayoutRoute,"getParentRoute"),path:"domains",component:DomainsPage});createRoute({getParentRoute:__name(()=>clusterLayoutRoute,"getParentRoute"),path:"sign-in",component:ClusterInstanceSignIn,beforeLoad:__name(({context,location:location2,params})=>{const isFabricConnect=authStore.checkForFabricConnect(params.clusterId);if(context.authentication[params.clusterId]?.user&&!isFabricConnect){const search2=location2?.search;throw redirect({to:search2?.redirect?.startsWith("/")?search2.redirect:defaultInstanceRouteUpOne})}},"beforeLoad")});createRoute({getParentRoute:__name(()=>clusterLayoutRoute,"getParentRoute"),path:"instance/$instanceId/sign-in",component:ClusterInstanceSignIn,beforeLoad:__name(({context,location:location2,params})=>{if(!(authStore.checkForFabricConnect(params.clusterId)||authStore.checkForFabricConnect(params.instanceId))&&context.authentication[params.instanceId]?.user){const search2=location2?.search;throw redirect({to:search2?.redirect?.startsWith("/")?search2.redirect:defaultInstanceRouteUpOne})}},"beforeLoad")});createRoute({getParentRoute:__name(()=>clusterLayoutRoute,"getParentRoute"),path:"finish-setup",component:FinishSetup});function createAPIsRouteTree(instanceLayoutRoute){return createRoute({getParentRoute:__name(()=>instanceLayoutRoute,"getParentRoute"),path:"apis"}).lazy(()=>__vitePreload(()=>import("./index.lazy-BhReIK4y.js"),__vite__mapDeps([0,1,2])).then(d=>d.route))}__name(createAPIsRouteTree,"createAPIsRouteTree");function shallowCompareObjects(a2,b){if(a2===b)return!0;if(!a2||!b)return!1;const aKeys=Object.keys(a2),bKeys=Object.keys(b);if(aKeys.length!==bKeys.length)return!1;for(const key of aKeys)if(!bKeys.includes(key)||a2[key]!==b[key])return!1;return!0}__name(shallowCompareObjects,"shallowCompareObjects");function useEffectedState(initialState2,deps){const[currentDeps,setDeps]=reactExports.useState(deps),[currentState,setCurrentState]=reactExports.useState(initialState2);return reactExports.useEffect(()=>{shallowCompareObjects(currentDeps,deps)||(setDeps(deps),setCurrentState(initialState2))},[currentDeps,deps,initialState2]),shallowCompareObjects(currentDeps,deps)?[currentState,setCurrentState]:[initialState2,setCurrentState]}__name(useEffectedState,"useEffectedState");const listenersMap={};function useListener(name2,listener,deps){const callback=reactExports.useCallback((newValue,trigger)=>listener(newValue,trigger),[deps]);reactExports.useEffect(()=>(listenersMap[name2]||(listenersMap[name2]=[]),listenersMap[name2].push(callback),__name(function(){const index2=listenersMap[name2].indexOf(callback);index2>=0&&listenersMap[name2].splice(index2,1)},"cleanUp")),[name2,listener,callback])}__name(useListener,"useListener");function emitToListeners(name2,value,trigger){const listeners=listenersMap[name2];if(listeners)for(const listener of listeners)listener(value,trigger)}__name(emitToListeners,"emitToListeners");function curryEmitToListeners(name2,value,trigger){return e=>emitToListeners(name2,value,e)}__name(curryEmitToListeners,"curryEmitToListeners");function useEmitToListeners(name2,value,trigger){return reactExports.useCallback(e=>emitToListeners(name2,value,e),[name2,value,trigger])}__name(useEmitToListeners,"useEmitToListeners");function getSessionStorage(key,defaultValue){return safeParse(sessionStorage.getItem(String(key)))??defaultValue}__name(getSessionStorage,"getSessionStorage");function setSessionStorage(key,current){current==null?sessionStorage.removeItem(String(key)):sessionStorage.setItem(String(key),JSON.stringify(current))}__name(setSessionStorage,"setSessionStorage");function useSessionStorage(key,defaultValue){const state2=useEffectedState(getSessionStorage(key,defaultValue),[key]),[current,setCurrent]=state2;return reactExports.useEffect(()=>{setSessionStorage(key,current),emitToListeners(`Session:${key}`,current)},[key,current]),useListener(`Session:${key}`,__name(function(newValue){current!==newValue&&setCurrent(newValue)},"watchForInternalStorageChanges"),[current,key,defaultValue]),reactExports.useEffect(__name(function(){const storageListener=__name(event=>{event.key===key&&setCurrent(getSessionStorage(key,defaultValue))},"storageListener");return window.addEventListener("storage",storageListener),()=>{window.removeEventListener("storage",storageListener)}},"watchForExternalStorageChanges"),[key,setCurrent,defaultValue]),state2}__name(useSessionStorage,"useSessionStorage");function useSessionToggler(key,defaultValue=!1){const[toggled,setToggled]=useSessionStorage(key,defaultValue),toggle=reactExports.useCallback(e=>{e?.preventDefault?.(),setToggled(checked=>!checked)},[setToggled]),toggleOn=reactExports.useCallback(e=>{e?.preventDefault?.(),setToggled(!0)},[setToggled]),toggleOff=reactExports.useCallback(e=>{e?.preventDefault?.(),setToggled(!1)},[setToggled]);return reactExports.useMemo(()=>({toggled,setToggled,toggle,toggleOn,toggleOff}),[toggle,setToggled,toggleOff,toggleOn,toggled])}__name(useSessionToggler,"useSessionToggler");const EditorViewContext=reactExports.createContext(null);function useEditorView(){return reactExports.useContext(EditorViewContext)}__name(useEditorView,"useEditorView");async function dropComponent({file:file2,project,entityType,instanceClient}){const{data}=await instanceClient.post("/",{operation:"drop_component",file:file2||void 0,project,replicated:entityType==="cluster"});return data}__name(dropComponent,"dropComponent");function parseFileExtension(filename){const parts=(filename||"")?.split(".");return parts.length>1?parts.slice(-1)[0]:""}__name(parseFileExtension,"parseFileExtension");function hasImageFileExtension(filename){switch(parseFileExtension(filename).toLowerCase()){case"jpg":case"jpeg":case"gif":case"png":case"pneg":case"webp":return!0;default:return!1}}__name(hasImageFileExtension,"hasImageFileExtension");async function getComponentFile({instanceClient,file:file2,project,encoding}){const{data}=await instanceClient.post("/",{operation:"get_component_file",file:file2,project,encoding:encoding??(hasImageFileExtension(file2)?"base64":"utf8")});return{file:file2,project,...data}}__name(getComponentFile,"getComponentFile");function getComponentFileQueryOptions(params){return{queryKey:getComponentFileQueryKey(params),queryFn:__name(()=>getComponentFile(params),"queryFn"),enabled:!!params.file&&!!params.project,retry:!1}}__name(getComponentFileQueryOptions,"getComponentFileQueryOptions");function getComponentFileQueryKey(params){return[params.entityId,"get_component_file",params.file,params.project,params.encoding]}__name(getComponentFileQueryKey,"getComponentFileQueryKey");async function setComponentFile({file:file2,payload,project,entityType,instanceClient,encoding}){const{data}=await instanceClient.post("/",{operation:"set_component_file",file:file2,payload,project,encoding,replicated:entityType==="cluster"},{timeout:3e5});return data}__name(setComponentFile,"setComponentFile");function useSetComponentFile(){return useMutation({mutationFn:setComponentFile})}__name(useSetComponentFile,"useSetComponentFile");function useRenameFiles(){const{reloadRootEntries,setFocusedItem,setSelectedItems}=useEditorView(),instanceParams=useInstanceClientIdParams();return reactExports.useCallback(async changes=>{let canceled=!1;const actualChanges=changes.filter(change=>change.from!==change.to);if(actualChanges.length===0)return;const toastTitle=`Renaming ${pluralize(actualChanges.length,"File","Files")}`,toastConfig={duration:6e4,action:{label:"Cancel",onClick:__name(()=>{canceled=!0},"onClick")}};toastConfig.id=toast.loading(toastTitle,{...toastConfig,description:jsxRuntimeExports.jsx(ProgressBar,{animated:!0,width:"0%"})});const totalSteps=actualChanges.length*3;let currentStep=0;function stepForward(){currentStep+=1,toast.loading(toastTitle,{...toastConfig,description:jsxRuntimeExports.jsx(ProgressBar,{animated:!0,width:(currentStep===0?0:currentStep/totalSteps*100)+"%"})})}__name(stepForward,"stepForward");for(const change of actualChanges){const oldParts=change.from.split("/"),oldProject=oldParts.shift(),oldFile=oldParts.join("/"),newParts=change.to.split("/"),newProject=newParts.shift(),newFile=newParts.join("/"),fileContents=await getComponentFile({...instanceParams,file:oldFile,project:oldProject,encoding:"base64"});if(canceled||(stepForward(),await setComponentFile({...instanceParams,file:newFile,project:newProject,encoding:"base64",payload:fileContents.message}),canceled)||(stepForward(),await dropComponent({...instanceParams,file:oldFile,project:oldProject}),canceled))break;stepForward()}currentStep>=totalSteps?toast.success(`Renamed ${pluralize(actualChanges.length,"File","Files")}`,{id:toastConfig.id,description:"All done!",duration:3e3,action:{label:"OK",onClick:__name(()=>{},"onClick")}}):toast.warning("Rename Cancelled",{id:toastConfig.id,description:`${currentStep} of ${totalSteps} steps completed.`,duration:1e4,action:{label:"OK",onClick:__name(()=>{},"onClick")}}),reloadRootEntries(),setSelectedItems(selectedItems=>{const updatedSelectedItems=selectedItems.slice();for(const change of actualChanges){const existingIndex=updatedSelectedItems.indexOf(change.from);existingIndex>=0?updatedSelectedItems.splice(existingIndex,1,change.to):updatedSelectedItems.push(change.to)}return updatedSelectedItems}),setFocusedItem(focusedItem=>{for(const change of actualChanges)if(focusedItem===change.from)return change.to;return focusedItem})},[instanceParams,reloadRootEntries,setFocusedItem,setSelectedItems])}__name(useRenameFiles,"useRenameFiles");function itemKeyIsDefined(item,key){return item[key]!==void 0}__name(itemKeyIsDefined,"itemKeyIsDefined");function excludePropertyFalsy(key){return item=>itemKeyIsDefined(item,key)}__name(excludePropertyFalsy,"excludePropertyFalsy");function useWatchedValue(name2,defaultValue){const[value,setValue]=reactExports.useState({value:defaultValue});return useListener(name2,(newValue,trigger)=>setValue({value:newValue,trigger}),[setValue]),value}__name(useWatchedValue,"useWatchedValue");function setWatchedValue(name2,value,trigger){emitToListeners(name2,value,trigger)}__name(setWatchedValue,"setWatchedValue");function currySetWatchedValue(name2,value,trigger){return e=>setWatchedValue(name2,value,e)}__name(currySetWatchedValue,"currySetWatchedValue");function useSetWatchedValue(name2,value,trigger){return reactExports.useCallback(e=>{setWatchedValue(name2,value,e)},[name2,value,trigger])}__name(useSetWatchedValue,"useSetWatchedValue");const deleteShortcut={handleGlobal(key,modifiers){if((modifiers.cmd||modifiers.ctrl)&&key==="Delete")return setWatchedValue("ShowDeleteDirectoryOrFileModal",!0),!0},addEditorAction(monaco){return{id:"delete-file",label:"Delete File",keybindings:[monaco.KeyMod.CtrlCmd|monaco.KeyCode.Delete],run:currySetWatchedValue("ShowDeleteDirectoryOrFileModal",!0)}}},newDirectoryShortcut={handleGlobal(key,modifiers){if(modifiers.ctrl&&modifiers.alt&&modifiers.shift&&key==="˜")return setWatchedValue("ShowAddDirectoryOrFileModalType","directory"),!0},addEditorAction(monaco){return{id:"new-directory",label:"New Directory",keybindings:[monaco.KeyMod.WinCtrl|monaco.KeyMod.Alt|monaco.KeyMod.Shift|monaco.KeyCode.KeyN],run:currySetWatchedValue("ShowAddDirectoryOrFileModalType","directory")}}},newFileShortcut={handleGlobal(key,modifiers){if(modifiers.ctrl&&key==="n")return setWatchedValue("ShowAddDirectoryOrFileModalType","file"),!0},addEditorAction(monaco){return{id:"new-file",label:"New File",keybindings:[monaco.KeyMod.WinCtrl|monaco.KeyCode.KeyN],run:currySetWatchedValue("ShowAddDirectoryOrFileModalType","file")}}},renameFileShortcut={handleGlobal(key){if(key==="F2")return setWatchedValue("ShowRenameFileModal","file"),!0},addEditorAction(monaco){return{id:"rename-file",label:"Rename File",keybindings:[monaco.KeyMod.WinCtrl|monaco.KeyMod.Alt|monaco.KeyCode.KeyR,monaco.KeyCode.F2],run:currySetWatchedValue("ShowRenameFileModal",!0)}}},revertFileShortcut={addEditorAction(){return{id:"revert-file",label:"Revert File",run:curryEmitToListeners("RevertChanges",!0)}}},saveChangesShortcut={handleGlobal(key,modifiers){if(modifiers.cmd&&key==="s")return emitToListeners("SaveFile",!0),!0},addEditorAction(monaco){return{id:"save-file",label:"Save Changes",keybindings:[monaco.KeyMod.CtrlCmd|monaco.KeyCode.KeyS],run:curryEmitToListeners("SaveFile",!0)}}},shortcuts=[deleteShortcut,newDirectoryShortcut,newFileShortcut,renameFileShortcut,revertFileShortcut,saveChangesShortcut],editorShortcuts=shortcuts.filter(excludePropertyFalsy("addEditorAction")),globalShortcuts=shortcuts.filter(excludePropertyFalsy("handleGlobal"));function registerWithEditor(mounted){const[editor,monaco]=mounted,disposables=editorShortcuts.map(shortcut=>editor.addAction(shortcut.addEditorAction(monaco)));return()=>{for(const disposable of disposables)disposable?.dispose()}}__name(registerWithEditor,"registerWithEditor");function useGlobalShortcutKeys(){reactExports.useEffect(()=>(document.addEventListener("keydown",keyDownHandler),()=>{document.removeEventListener("keydown",keyDownHandler)}),[])}__name(useGlobalShortcutKeys,"useGlobalShortcutKeys");function keyDownHandler(e){const cmd=e.getModifierState("Meta"),alt=e.getModifierState("Alt"),shift2=e.getModifierState("Shift"),ctrl=e.getModifierState("Control"),modifiers={cmd,alt,shift:shift2,ctrl};for(const globalShortcut of globalShortcuts)if(globalShortcut.handleGlobal(e.key,modifiers)){e.preventDefault();return}}__name(keyDownHandler,"keyDownHandler");function extractFileNameFromPath(path){return path.split("/").pop()}__name(extractFileNameFromPath,"extractFileNameFromPath");function joinPath(...parts){return parts.flat(1).join("/")}__name(joinPath,"joinPath");var InteractionMode;(function(InteractionMode2){InteractionMode2.DoubleClickItemToExpand="double-click-item-to-expand",InteractionMode2.ClickItemToExpand="click-item-to-expand",InteractionMode2.ClickArrowToExpand="click-arrow-to-expand"})(InteractionMode||(InteractionMode={}));var __assign$a=function(){return __assign$a=Object.assign||function(t2){for(var s2,i2=1,n2=arguments.length;i2<n2;i2++){s2=arguments[i2];for(var p in s2)Object.prototype.hasOwnProperty.call(s2,p)&&(t2[p]=s2[p])}return t2},__assign$a.apply(this,arguments)},mergeInteractionManagers=__name(function(main,fallback){return{mode:main.mode,createInteractiveElementProps:__name(function(item,treeId,actions,renderFlags){return __assign$a(__assign$a({},fallback.createInteractiveElementProps(item,treeId,actions,renderFlags)),main.createInteractiveElementProps(item,treeId,actions,renderFlags))},"createInteractiveElementProps")}},"mergeInteractionManagers"),isControlKey=__name(function(e){return e.ctrlKey||navigator.platform.toUpperCase().indexOf("MAC")>=0&&e.metaKey},"isControlKey"),DoubleClickItemToExpandInteractionManager=(function(){function DoubleClickItemToExpandInteractionManager2(environment){this.mode=InteractionMode.DoubleClickItemToExpand,this.environment=environment}return __name(DoubleClickItemToExpandInteractionManager2,"DoubleClickItemToExpandInteractionManager"),DoubleClickItemToExpandInteractionManager2.prototype.createInteractiveElementProps=function(item,treeId,actions,renderFlags){var _this=this;return{onClick:__name(function(e){var isSpacebarEvent=e.detail===0;actions.focusItem(),e.shiftKey&&!isSpacebarEvent?actions.selectUpTo(!isControlKey(e)):isControlKey(e)&&!isSpacebarEvent?renderFlags.isSelected?actions.unselectItem():actions.addToSelectedItems():actions.selectItem()},"onClick"),onDoubleClick:__name(function(){actions.focusItem(),actions.selectItem(),item.isFolder&&actions.toggleExpandedState(),(!item.isFolder||_this.environment.canInvokePrimaryActionOnItemContainer)&&actions.primaryAction()},"onDoubleClick"),onFocus:__name(function(){actions.focusItem()},"onFocus"),onDragStart:__name(function(e){e.dataTransfer.dropEffect="move",actions.startDragging()},"onDragStart"),onDragOver:__name(function(e){e.preventDefault()},"onDragOver"),draggable:renderFlags.canDrag&&!renderFlags.isRenaming,tabIndex:renderFlags.isRenaming?void 0:renderFlags.isFocused?0:-1}},DoubleClickItemToExpandInteractionManager2})(),ClickItemToExpandInteractionManager=(function(){function ClickItemToExpandInteractionManager2(environment){this.mode=InteractionMode.ClickItemToExpand,this.environment=environment}return __name(ClickItemToExpandInteractionManager2,"ClickItemToExpandInteractionManager"),ClickItemToExpandInteractionManager2.prototype.createInteractiveElementProps=function(item,treeId,actions,renderFlags){var _this=this;return{onClick:__name(function(e){var isSpacebarEvent=e.detail===0;actions.focusItem(),e.shiftKey&&!isSpacebarEvent?actions.selectUpTo(!isControlKey(e)):isControlKey(e)&&!isSpacebarEvent?renderFlags.isSelected?actions.unselectItem():actions.addToSelectedItems():(item.isFolder&&actions.toggleExpandedState(),actions.selectItem(),(!item.isFolder||_this.environment.canInvokePrimaryActionOnItemContainer)&&actions.primaryAction())},"onClick"),onFocus:__name(function(){actions.focusItem()},"onFocus"),onDragStart:__name(function(e){e.dataTransfer.dropEffect="move",actions.startDragging()},"onDragStart"),onDragOver:__name(function(e){e.preventDefault()},"onDragOver"),draggable:renderFlags.canDrag&&!renderFlags.isRenaming,tabIndex:renderFlags.isRenaming?void 0:renderFlags.isFocused?0:-1}},ClickItemToExpandInteractionManager2})(),ClickArrowToExpandInteractionManager=(function(){function ClickArrowToExpandInteractionManager2(environment){this.mode=InteractionMode.ClickItemToExpand,this.environment=environment}return __name(ClickArrowToExpandInteractionManager2,"ClickArrowToExpandInteractionManager"),ClickArrowToExpandInteractionManager2.prototype.createInteractiveElementProps=function(item,treeId,actions,renderFlags){var _this=this;return{onClick:__name(function(e){var isSpacebarEvent=e.detail===0;actions.focusItem(),e.shiftKey&&!isSpacebarEvent?actions.selectUpTo(!isControlKey(e)):isControlKey(e)&&!isSpacebarEvent?renderFlags.isSelected?actions.unselectItem():actions.addToSelectedItems():(actions.selectItem(),(!item.isFolder||_this.environment.canInvokePrimaryActionOnItemContainer)&&actions.primaryAction())},"onClick"),onFocus:__name(function(){actions.focusItem()},"onFocus"),onDragStart:__name(function(e){e.dataTransfer.dropEffect="move",actions.startDragging()},"onDragStart"),onDragOver:__name(function(e){e.preventDefault()},"onDragOver"),draggable:renderFlags.canDrag&&!renderFlags.isRenaming,tabIndex:renderFlags.isRenaming?void 0:renderFlags.isFocused?0:-1}},ClickArrowToExpandInteractionManager2})(),buildInteractionMode=__name(function(mode,environment){switch(mode){case InteractionMode.DoubleClickItemToExpand:return new DoubleClickItemToExpandInteractionManager(environment);case InteractionMode.ClickItemToExpand:return new ClickItemToExpandInteractionManager(environment);case InteractionMode.ClickArrowToExpand:return new ClickArrowToExpandInteractionManager(environment);default:throw Error("Unknown interaction mode ".concat(mode))}},"buildInteractionMode"),InteractionManagerContext=reactExports.createContext(null),useInteractionManager=__name(function(){return reactExports.useContext(InteractionManagerContext)},"useInteractionManager"),InteractionManagerProvider=__name(function(_a20){var children=_a20.children,environment=useTreeEnvironment(),defaultInteractionMode=environment.defaultInteractionMode,interactionManager=reactExports.useMemo(function(){var _a21;return defaultInteractionMode&&typeof defaultInteractionMode!="string"?defaultInteractionMode.extends?mergeInteractionManagers(defaultInteractionMode,buildInteractionMode(defaultInteractionMode.extends,environment)):defaultInteractionMode:buildInteractionMode((_a21=defaultInteractionMode)!==null&&_a21!==void 0?_a21:InteractionMode.ClickItemToExpand,environment)},[]);return reactExports.createElement(InteractionManagerContext.Provider,{value:interactionManager},children)},"InteractionManagerProvider"),useCanDropAt=__name(function(){var environment=useTreeEnvironment();return reactExports.useCallback(function(draggingPosition,draggingItems){if(draggingPosition.targetType==="between-items"){if(!environment.canReorderItems)return!1}else if(draggingPosition.targetType==="root"){if(!environment.canDropOnFolder)return!1}else{var resolvedItem=environment.items[draggingPosition.targetItem];if(!resolvedItem||!environment.canDropOnFolder&&resolvedItem.isFolder||!environment.canDropOnNonFolder&&!resolvedItem.isFolder||draggingItems.some(function(draggingItem){return draggingItem.index===draggingPosition.targetItem}))return!1}return!(environment.canDropAt&&(!draggingItems||!environment.canDropAt(draggingItems,draggingPosition)))},[environment])},"useCanDropAt"),useGetGetParentOfLinearItem=__name(function(){var environment=useTreeEnvironment();return reactExports.useCallback(function(itemLinearIndex,treeId){for(var linearItems=environment.linearItems[treeId],depth=linearItems[itemLinearIndex].depth,parentLinearIndex=itemLinearIndex;linearItems[parentLinearIndex]&&linearItems[parentLinearIndex].depth!==depth-1;parentLinearIndex-=1);var parent=linearItems[parentLinearIndex];return parent||(parent={item:environment.trees[treeId].rootItem,depth:0},parentLinearIndex=0),{parent,parentLinearIndex}},[environment.linearItems,environment.trees])},"useGetGetParentOfLinearItem"),useGetViableDragPositions=__name(function(){var environment=useTreeEnvironment(),getParentOfLinearItem=useGetGetParentOfLinearItem(),canDropAt=useCanDropAt(),isDescendant=reactExports.useCallback(function(treeId,itemLinearIndex,potentialParents){var _a20=getParentOfLinearItem(itemLinearIndex,treeId),parent=_a20.parent,parentLinearIndex=_a20.parentLinearIndex;return potentialParents.some(function(p){return p.index===parent.item})?!0:parent.depth===0?!1:isDescendant(treeId,parentLinearIndex,potentialParents)},[getParentOfLinearItem]);return reactExports.useCallback(function(treeId,draggingItems){for(var _a20,_b,_c,_d,linearItems=environment.linearItems[treeId],targets=[],skipUntilDepthIsLowerThan=-1,linearIndex=0;linearIndex<linearItems.length;linearIndex++){var _e=linearItems[linearIndex],item=_e.item,depth=_e.depth;if(!(skipUntilDepthIsLowerThan!==-1&&depth>skipUntilDepthIsLowerThan)){skipUntilDepthIsLowerThan=-1;var parent_1=getParentOfLinearItem(linearIndex,treeId).parent,childIndex=environment.items[parent_1.item].children.indexOf(item);if(isDescendant(treeId,linearIndex,draggingItems)){skipUntilDepthIsLowerThan=depth+1;continue}var itemPosition={targetType:"item",parentItem:parent_1.item,targetItem:item,linearIndex,depth,treeId},topPosition={targetType:"between-items",parentItem:parent_1.item,linePosition:"top",childIndex,depth,treeId,linearIndex},bottomPosition={targetType:"between-items",parentItem:parent_1.item,linePosition:"bottom",linearIndex:linearIndex+1,childIndex:childIndex+1,depth,treeId},depthOfItemAbove=(_b=(_a20=linearItems[linearIndex-1])===null||_a20===void 0?void 0:_a20.depth)!==null&&_b!==void 0?_b:-1,depthOfItemBelow=(_d=(_c=linearItems[linearIndex+1])===null||_c===void 0?void 0:_c.depth)!==null&&_d!==void 0?_d:-1,isWithinFolder=depth===depthOfItemAbove,isBelowOpenFolder=depth===depthOfItemBelow-1;!isWithinFolder&&canDropAt(topPosition,draggingItems)&&targets.push(topPosition),canDropAt(itemPosition,draggingItems)&&targets.push(itemPosition),!isBelowOpenFolder&&canDropAt(bottomPosition,draggingItems)&&targets.push(bottomPosition)}}return targets},[canDropAt,environment.items,environment.linearItems,getParentOfLinearItem,isDescendant])},"useGetViableDragPositions"),__spreadArray$4=function(to,from,pack){if(pack||arguments.length===2)for(var i2=0,l2=from.length,ar2;i2<l2;i2++)(ar2||!(i2 in from))&&(ar2||(ar2=Array.prototype.slice.call(from,0,i2)),ar2[i2]=from[i2]);return to.concat(ar2||Array.prototype.slice.call(from))},useSideEffect=__name(function(effect,deps,changeOn){var previousRef=reactExports.useRef();reactExports.useEffect(function(){if(!previousRef.current)previousRef.current=__spreadArray$4([],changeOn,!0),effect();else{var changed=previousRef.current.some(function(v2,i2){return v2!==changeOn[i2]});changed&&(previousRef.current=__spreadArray$4([],changeOn,!0),effect())}},__spreadArray$4(__spreadArray$4([],deps,!0),changeOn,!0))},"useSideEffect"),__assign$9=function(){return __assign$9=Object.assign||function(t2){for(var s2,i2=1,n2=arguments.length;i2<n2;i2++){s2=arguments[i2];for(var p in s2)Object.prototype.hasOwnProperty.call(s2,p)&&(t2[p]=s2[p])}return t2},__assign$9.apply(this,arguments)},buildMapForTrees=__name(function(treeIds,build){return treeIds.map(function(id2){return[id2,build(id2)]}).reduce(function(a2,_a20){var _b,id2=_a20[0],obj=_a20[1];return __assign$9(__assign$9({},a2),(_b={},_b[id2]=obj,_b))},{})},"buildMapForTrees"),getDocument=__name(function(){return typeof document<"u"?document:void 0},"getDocument");function useCallSoon(dontClean){dontClean===void 0&&(dontClean=!1);var handleRef=reactExports.useRef(new Array);return reactExports.useEffect(function(){if(dontClean)return function(){};var handles=handleRef.current;return function(){return handles.forEach(function(handle){return cancelAnimationFrame(handle)})}},[dontClean,handleRef]),reactExports.useCallback(function(callback){var handle=requestAnimationFrame(function(){handleRef.current.splice(handleRef.current.indexOf(handle),1),callback()});handleRef.current.push(handle)},[handleRef])}__name(useCallSoon,"useCallSoon");var useRefCopy=__name(function(value){var ref=reactExports.useRef(value);return ref.current=value,ref},"useRefCopy"),useStableHandler=__name(function(handler){var handlerRef=useRefCopy(handler);return reactExports.useCallback((function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];return handlerRef.current.apply(handlerRef,args)}),[handlerRef])},"useStableHandler"),useGetOriginalItemOrder=__name(function(){var env2=useTreeEnvironment();return useStableHandler(function(treeId,items){return items.map(function(item){return[item,env2.linearItems[treeId].findIndex(function(linearItem){return linearItem.item===item.index})]}).sort(function(_a20,_b){_a20[0];var aPos=_a20[1];_b[0];var bPos=_b[1];return aPos-bPos}).map(function(_a20){var item=_a20[0];return item})})},"useGetOriginalItemOrder"),computeItemHeight=__name(function(treeId){var _a20,firstItem=(_a20=getDocument())===null||_a20===void 0?void 0:_a20.querySelector('[data-rct-tree="'.concat(treeId,'"] [data-rct-item-container="true"]'));if(firstItem){var style=getComputedStyle(firstItem);return firstItem.offsetHeight+Math.max(parseFloat(style.marginTop),parseFloat(style.marginBottom))}return 5},"computeItemHeight"),isOutsideOfContainer=__name(function(e,treeBb){return e.clientX<=treeBb.left||e.clientX>=treeBb.right||e.clientY<=treeBb.top||e.clientY>=treeBb.bottom},"isOutsideOfContainer"),DraggingPositionEvaluation=(function(){function DraggingPositionEvaluation2(env2,e,treeId,hoveringPosition,draggingItems,getParentOfLinearItem){this.env=env2,this.e=e,this.treeId=treeId,this.linearIndex=hoveringPosition.linearIndex,this.offset=hoveringPosition.offset,this.indentation=hoveringPosition.indentation,this.targetItem=this.env.linearItems[this.treeId][this.linearIndex],this.getParentOfLinearItem=getParentOfLinearItem,this.draggingItems=draggingItems}return __name(DraggingPositionEvaluation2,"DraggingPositionEvaluation"),DraggingPositionEvaluation2.prototype.getEmptyTreeDragPosition=function(){return{targetType:"root",treeId:this.treeId,depth:0,linearIndex:0,targetItem:this.env.trees[this.treeId].rootItem}},DraggingPositionEvaluation2.prototype.maybeRedirectToParent=function(){var redirectTargetToParent=!this.env.canReorderItems&&!this.env.canDropOnNonFolder&&!this.env.items[this.targetItem.item].isFolder;if(redirectTargetToParent){var _a20=this.getParentOfLinearItem(this.linearIndex,this.treeId),parentLinearIndex=_a20.parentLinearIndex,parent_1=_a20.parent;this.targetItem=parent_1,this.linearIndex=parentLinearIndex}},DraggingPositionEvaluation2.prototype.maybeReparentUpwards=function(){var _a20,_b;if(this.indentation!==void 0){var treeLinearItems=this.env.linearItems[this.treeId],deepestDepth=treeLinearItems[this.linearIndex].depth,legalDropDepthCount=deepestDepth-((_b=(_a20=treeLinearItems[this.linearIndex+1])===null||_a20===void 0?void 0:_a20.depth)!==null&&_b!==void 0?_b:0),canReparentUpwards=this.offset==="bottom"&&legalDropDepthCount>0;if(canReparentUpwards){for(var droppingIndent=Math.max(deepestDepth-legalDropDepthCount,this.indentation),newParent={parentLinearIndex:this.linearIndex,parent:this.targetItem},insertionItemAbove,i2=deepestDepth;i2>=droppingIndent;i2-=1)insertionItemAbove=newParent,newParent=this.getParentOfLinearItem(newParent.parentLinearIndex,this.treeId);if(this.indentation!==treeLinearItems[this.linearIndex].depth&&insertionItemAbove){var reparentedChildIndex=this.env.items[newParent.parent.item].children.indexOf(insertionItemAbove.parent.item)+1;if(!(this.draggingItems&&this.isDescendant(this.treeId,newParent.parentLinearIndex+1,this.draggingItems)))return{targetType:"between-items",treeId:this.treeId,parentItem:newParent.parent.item,depth:droppingIndent,linearIndex:this.linearIndex+1,childIndex:reparentedChildIndex,linePosition:"bottom"}}}}},DraggingPositionEvaluation2.prototype.maybeRedirectInsideOpenFolder=function(){var nextItem=this.env.linearItems[this.treeId][this.linearIndex+1],redirectInsideOpenFolder=!this.env.canDropBelowOpenFolders&&nextItem&&this.targetItem.depth===nextItem.depth-1&&this.offset==="bottom";redirectInsideOpenFolder&&(this.targetItem=nextItem,this.linearIndex+=1,this.offset="top")},DraggingPositionEvaluation2.prototype.maybeMapToBottomOffset=function(){var priorItem=this.env.linearItems[this.treeId][this.linearIndex-1];if(!(!priorItem||priorItem?.depth===void 0)){var depthDistanceToPrior=priorItem.depth-this.targetItem.depth;this.offset==="top"&&(depthDistanceToPrior===0||depthDistanceToPrior>0&&this.indentation!==void 0)&&(this.offset="bottom",this.linearIndex-=1,this.targetItem=this.env.linearItems[this.treeId][this.linearIndex])}},DraggingPositionEvaluation2.prototype.canDropAtCurrentTarget=function(){var _this=this,_a20,targetItemData=this.env.items[this.targetItem.item];return!(!this.offset&&!this.env.canDropOnNonFolder&&!targetItemData.isFolder||!this.offset&&!this.env.canDropOnFolder&&targetItemData.isFolder||this.offset&&!this.env.canReorderItems||!((_a20=this.draggingItems)===null||_a20===void 0)&&_a20.some(function(draggingItem){return draggingItem.index===_this.targetItem.item}))},DraggingPositionEvaluation2.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 reparented=this.maybeReparentUpwards();if(reparented)return reparented;if(this.areDraggingItemsDescendantOfTarget()||!this.canDropAtCurrentTarget())return"invalid";var parent=this.getParentOfLinearItem(this.linearIndex,this.treeId).parent,newChildIndex=this.env.items[parent.item].children.indexOf(this.targetItem.item)+(this.offset==="top"?0:1);return this.offset?{targetType:"between-items",treeId:this.treeId,parentItem:parent.item,depth:this.targetItem.depth,linearIndex:this.linearIndex+(this.offset==="top"?0:1),childIndex:newChildIndex,linePosition:this.offset}:{targetType:"item",treeId:this.treeId,parentItem:parent.item,targetItem:this.targetItem.item,depth:this.targetItem.depth,linearIndex:this.linearIndex}}},DraggingPositionEvaluation2.prototype.isDescendant=function(treeId,itemLinearIndex,potentialParents){var _a20=this.getParentOfLinearItem(itemLinearIndex,treeId),parentLinearIndex=_a20.parentLinearIndex,parent=_a20.parent;return potentialParents.some(function(p){return p.index===parent.item})?!0:parent.depth===0?!1:this.isDescendant(treeId,parentLinearIndex,potentialParents)},DraggingPositionEvaluation2.prototype.areDraggingItemsDescendantOfTarget=function(){return this.draggingItems&&this.isDescendant(this.treeId,this.linearIndex,this.draggingItems)},DraggingPositionEvaluation2})(),useDraggingPosition=__name(function(){var dragCode=reactExports.useRef("initial"),_a20=reactExports.useState(void 0),draggingItems=_a20[0],setDraggingItems=_a20[1],itemHeight=reactExports.useRef(0),env2=useTreeEnvironment(),getParentOfLinearItem=useGetGetParentOfLinearItem(),isNewDragPosition=useStableHandler(function(e,treeId,hoveringPosition){if(!hoveringPosition)return!1;var offset2=hoveringPosition.offset,linearIndex=hoveringPosition.linearIndex,newDragCode="".concat(treeId,"__").concat(linearIndex,"__").concat(offset2??"","__").concat(hoveringPosition.indentation);return newDragCode!==dragCode.current?(dragCode.current=newDragCode,!0):!1}),getHoveringPosition=useStableHandler(function(e,treeId,containerRef){if(containerRef.current){var treeBb=containerRef.current.getBoundingClientRect();if(!isOutsideOfContainer(e,treeBb)){var hoveringPosition=(e.clientY-treeBb.top)/itemHeight.current,treeLinearItems=env2.linearItems[treeId],linearIndex=Math.min(Math.max(0,Math.floor(hoveringPosition)),treeLinearItems.length-1);if(treeLinearItems.length===0)return{linearIndex:0,offset:"bottom",indentation:0};var targetLinearItem=treeLinearItems[linearIndex],targetItem=env2.items[targetLinearItem.item],indentation=env2.renderDepthOffset?Math.max(Math.floor((e.clientX-treeBb.left)/env2.renderDepthOffset),0):void 0,offset2,lineThreshold=env2.canReorderItems?targetItem?.isFolder&&env2.canDropOnFolder||env2.canDropOnNonFolder?.2:.5:0;return hoveringPosition-.5>=treeLinearItems.length-1?offset2="bottom":hoveringPosition%1<lineThreshold?offset2="top":hoveringPosition%1>1-lineThreshold&&(offset2="bottom"),{linearIndex,offset:offset2,indentation}}}}),getDraggingPosition=useStableHandler(function(e,treeId,containerRef){var hoveringPosition=getHoveringPosition(e,treeId,containerRef);if(isNewDragPosition(e,treeId,hoveringPosition))return!draggingItems||!env2.canDragAndDrop||!hoveringPosition||e.clientX<0||e.clientY<0?"invalid":new DraggingPositionEvaluation(env2,e,treeId,hoveringPosition,draggingItems,getParentOfLinearItem).getDraggingPosition()}),initiateDraggingPosition=useStableHandler(function(treeId,items){setDraggingItems(items),dragCode.current="initial",itemHeight.current=computeItemHeight(treeId)}),resetDraggingPosition=useStableHandler(function(){setDraggingItems(void 0),dragCode.current="initial",itemHeight.current=0});return{initiateDraggingPosition,resetDraggingPosition,draggingItems,getDraggingPosition,itemHeight}},"useDraggingPosition"),DragAndDropContext=reactExports.createContext(null),useDragAndDrop=__name(function(){return reactExports.useContext(DragAndDropContext)},"useDragAndDrop"),DragAndDropProvider=__name(function(_a20){var children=_a20.children,environment=useTreeEnvironment(),_b=reactExports.useState(!1),isProgrammaticallyDragging=_b[0],setIsProgrammaticallyDragging=_b[1],_c=reactExports.useState({}),viableDragPositions=_c[0],setViableDragPositions=_c[1],_d=reactExports.useState(0),programmaticDragIndex=_d[0],setProgrammaticDragIndex=_d[1],_e=reactExports.useState(),draggingPosition=_e[0],setDraggingPosition=_e[1],getViableDragPositions=useGetViableDragPositions(),callSoon=useCallSoon(),getOriginalItemOrder=useGetOriginalItemOrder(),_f=useDraggingPosition(),initiateDraggingPosition=_f.initiateDraggingPosition,resetDraggingPosition=_f.resetDraggingPosition,draggingItems=_f.draggingItems,getDraggingPosition=_f.getDraggingPosition,itemHeight=_f.itemHeight,resetProgrammaticDragIndexForCurrentTree=reactExports.useCallback(function(viableDragPositions2,draggingItems2){var _a21;if(environment.activeTreeId&&(!((_a21=environment.viewState[environment.activeTreeId])===null||_a21===void 0)&&_a21.focusedItem)&&environment.linearItems&&draggingItems2){var focusItem_1=environment.viewState[environment.activeTreeId].focusedItem,treeDragPositions=getViableDragPositions(environment.activeTreeId,draggingItems2),newPos=treeDragPositions.findIndex(function(pos){return pos.targetType==="item"?pos.targetItem===focusItem_1:pos.targetType==="between-items"?environment.items[pos.parentItem].children[pos.childIndex]===focusItem_1:!1});setProgrammaticDragIndex(newPos?Math.min(newPos+1,treeDragPositions.length-1):0)}else setProgrammaticDragIndex(0)},[environment.activeTreeId,environment.items,environment.linearItems,environment.viewState,getViableDragPositions]),resetState=useStableHandler(function(){setIsProgrammaticallyDragging(!1),setViableDragPositions({}),setProgrammaticDragIndex(0),setDraggingPosition(void 0),resetDraggingPosition()});useSideEffect(function(){environment.activeTreeId&&environment.linearItems[environment.activeTreeId]&&viableDragPositions[environment.activeTreeId]&&resetProgrammaticDragIndexForCurrentTree(viableDragPositions[environment.activeTreeId],draggingItems)},[draggingItems,environment.activeTreeId,environment.linearItems,resetProgrammaticDragIndexForCurrentTree,viableDragPositions],[environment.activeTreeId]),useSideEffect(function(){isProgrammaticallyDragging&&environment.activeTreeId&&setDraggingPosition(viableDragPositions[environment.activeTreeId][programmaticDragIndex])},[programmaticDragIndex,environment.activeTreeId,isProgrammaticallyDragging,viableDragPositions],[programmaticDragIndex,environment.activeTreeId]);var canDropAt=useCanDropAt(),performDrag=__name(function(draggingPosition2){var _a21;draggingItems&&!canDropAt(draggingPosition2,draggingItems)||(setDraggingPosition(draggingPosition2),environment.setActiveTree(draggingPosition2.treeId),draggingItems&&environment.activeTreeId!==draggingPosition2.treeId&&((_a21=environment.onSelectItems)===null||_a21===void 0||_a21.call(environment,draggingItems.map(function(item){return item.index}),draggingPosition2.treeId)))},"performDrag"),onDragOverTreeHandler=useStableHandler(function(e,treeId,containerRef){if(draggingItems){var newDraggingPosition=getDraggingPosition(e,treeId,containerRef);if(newDraggingPosition){if(newDraggingPosition==="invalid"){setDraggingPosition(void 0);return}performDrag(newDraggingPosition)}}}),onDragLeaveContainerHandler=useStableHandler(function(e,containerRef){containerRef.current&&isOutsideOfContainer(e,containerRef.current.getBoundingClientRect())&&setDraggingPosition(void 0)}),onDropHandler=useStableHandler(function(){!draggingItems||!draggingPosition||!environment.onDrop||(environment.onDrop(draggingItems,draggingPosition),callSoon(function(){var _a21;(_a21=environment.onFocusItem)===null||_a21===void 0||_a21.call(environment,draggingItems[0],draggingPosition.treeId),resetState()}))}),onStartDraggingItems=reactExports.useCallback(function(items,treeId){var treeViableDragPositions=buildMapForTrees(environment.treeIds,function(treeId2){return getViableDragPositions(treeId2,items)});initiateDraggingPosition(treeId,items),setViableDragPositions(treeViableDragPositions),environment.activeTreeId&&resetProgrammaticDragIndexForCurrentTree(treeViableDragPositions[environment.activeTreeId],items)},[environment.activeTreeId,environment.treeIds,getViableDragPositions,initiateDraggingPosition,resetProgrammaticDragIndexForCurrentTree]),startProgrammaticDrag=reactExports.useCallback(function(){var _a21,_b2,_c2;if(environment.canDragAndDrop&&environment.activeTreeId){var draggingItems_1=(_b2=(_a21=environment.viewState[environment.activeTreeId])===null||_a21===void 0?void 0:_a21.selectedItems)!==null&&_b2!==void 0?_b2:[(_c2=environment.viewState[environment.activeTreeId])===null||_c2===void 0?void 0:_c2.focusedItem];if(draggingItems_1.length===0||draggingItems_1[0]===void 0)return;var resolvedDraggingItems=getOriginalItemOrder(environment.activeTreeId,draggingItems_1.map(function(id2){return environment.items[id2]}));if(environment.canDrag&&!environment.canDrag(resolvedDraggingItems))return;onStartDraggingItems(resolvedDraggingItems,environment.activeTreeId),setTimeout(function(){setIsProgrammaticallyDragging(!0)})}},[environment,getOriginalItemOrder,onStartDraggingItems]),abortProgrammaticDrag=reactExports.useCallback(function(){resetState()},[resetState]),completeProgrammaticDrag=reactExports.useCallback(function(){onDropHandler(),resetState()},[onDropHandler,resetState]),programmaticDragUp=reactExports.useCallback(function(){setProgrammaticDragIndex(function(oldIndex){return Math.max(0,oldIndex-1)})},[]),programmaticDragDown=reactExports.useCallback(function(){environment.activeTreeId&&setProgrammaticDragIndex(function(oldIndex){return Math.min(viableDragPositions[environment.activeTreeId].length-1,oldIndex+1)})},[environment.activeTreeId,viableDragPositions]),dnd=reactExports.useMemo(function(){return{onStartDraggingItems,startProgrammaticDrag,abortProgrammaticDrag,completeProgrammaticDrag,programmaticDragUp,programmaticDragDown,draggingItems,draggingPosition,itemHeight:itemHeight.current,isProgrammaticallyDragging,onDragOverTreeHandler,onDragLeaveContainerHandler,viableDragPositions}},[abortProgrammaticDrag,completeProgrammaticDrag,draggingItems,draggingPosition,isProgrammaticallyDragging,itemHeight,onDragOverTreeHandler,onDragLeaveContainerHandler,onStartDraggingItems,programmaticDragDown,programmaticDragUp,startProgrammaticDrag,viableDragPositions]);return reactExports.useEffect(function(){return window.addEventListener("dragend",resetState),window.addEventListener("drop",onDropHandler),function(){window.removeEventListener("dragend",resetState),window.removeEventListener("drop",onDropHandler)}},[onDropHandler,resetState]),reactExports.createElement(DragAndDropContext.Provider,{value:dnd},children)},"DragAndDropProvider"),__assign$8=function(){return __assign$8=Object.assign||function(t2){for(var s2,i2=1,n2=arguments.length;i2<n2;i2++){s2=arguments[i2];for(var p in s2)Object.prototype.hasOwnProperty.call(s2,p)&&(t2[p]=s2[p])}return t2},__assign$8.apply(this,arguments)},useCreatedEnvironmentRef=__name(function(ref,actions){var environment=useTreeEnvironment(),dnd=useDragAndDrop();reactExports.useImperativeHandle(ref,function(){return __assign$8(__assign$8(__assign$8({},actions),environment),{treeEnvironmentContext:environment,dragAndDropContext:dnd})})},"useCreatedEnvironmentRef"),waitFor=__name(function(check2,intervalMs,timeoutMs){return intervalMs===void 0&&(intervalMs=50),timeoutMs===void 0&&(timeoutMs=1e4),new Promise(function(resolve){check2()&&resolve();var complete,interval=setInterval(function(){check2()&&complete()},intervalMs),timeout=setTimeout(function(){complete()},timeoutMs);complete=__name(function(){clearInterval(interval),clearTimeout(timeout),resolve()},"complete")})},"waitFor"),__awaiter=function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}return __name(adopt,"adopt"),new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}__name(fulfilled,"fulfilled");function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}__name(rejected,"rejected");function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}__name(step,"step"),step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=function(thisArg,body){var _2={label:0,sent:__name(function(){if(t2[0]&1)throw t2[1];return t2[1]},"sent"),trys:[],ops:[]},f,y,t2,g;return g={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n2){return function(v2){return step([n2,v2])}}function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_2=0)),_2;)try{if(f=1,y&&(t2=op[0]&2?y.return:op[0]?y.throw||((t2=y.return)&&t2.call(y),0):y.next)&&!(t2=t2.call(y,op[1])).done)return t2;switch(y=0,t2&&(op=[op[0]&2,t2.value]),op[0]){case 0:case 1:t2=op;break;case 4:return _2.label++,{value:op[1],done:!1};case 5:_2.label++,y=op[1],op=[0];continue;case 7:op=_2.ops.pop(),_2.trys.pop();continue;default:if(t2=_2.trys,!(t2=t2.length>0&&t2[t2.length-1])&&(op[0]===6||op[0]===2)){_2=0;continue}if(op[0]===3&&(!t2||op[1]>t2[0]&&op[1]<t2[3])){_2.label=op[1];break}if(op[0]===6&&_2.label<t2[1]){_2.label=t2[1],t2=op;break}if(t2&&_2.label<t2[2]){_2.label=t2[2],_2.ops.push(op);break}t2[2]&&_2.ops.pop(),_2.trys.pop();continue}op=body.call(thisArg,_2)}catch(e){op=[6,e],y=0}finally{f=t2=0}if(op[0]&5)throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}},__spreadArray$3=function(to,from,pack){if(pack||arguments.length===2)for(var i2=0,l2=from.length,ar2;i2<l2;i2++)(ar2||!(i2 in from))&&(ar2||(ar2=Array.prototype.slice.call(from,0,i2)),ar2[i2]=from[i2]);return to.concat(ar2||Array.prototype.slice.call(from))},EnvironmentActionsContext$1=reactExports.createContext(null),useEnvironmentActions=__name(function(){return reactExports.useContext(EnvironmentActionsContext$1)},"useEnvironmentActions"),recursiveExpand=__name(function(itemId,items,onExpand){return __awaiter(void 0,void 0,void 0,function(){var _loop_1,_i,_a20,childId,_b,_c,_d;return __generator(this,function(_e){for(_loop_1=__name(function(childId2){waitFor(function(){var _a21;return!!(!((_a21=items.current)===null||_a21===void 0)&&_a21[childId2])}).then(function(){var _a21,item=(_a21=items.current)===null||_a21===void 0?void 0:_a21[childId2];item?.isFolder&&(onExpand(item),recursiveExpand(childId2,items,onExpand))})},"_loop_1"),_i=0,_a20=(_d=(_c=(_b=items.current)===null||_b===void 0?void 0:_b[itemId])===null||_c===void 0?void 0:_c.children)!==null&&_d!==void 0?_d:[];_i<_a20.length;_i++)childId=_a20[_i],_loop_1(childId);return[2]})})},"recursiveExpand"),EnvironmentActionsProvider=reactExports.forwardRef(function(props,ref){var _a20=useTreeEnvironment(),onCollapseItem=_a20.onCollapseItem,items=_a20.items,trees=_a20.trees,viewState=_a20.viewState,onExpandItem=_a20.onExpandItem,onFocusItem=_a20.onFocusItem,setActiveTree=_a20.setActiveTree,onRenameItem=_a20.onRenameItem,onSelectItems=_a20.onSelectItems,onPrimaryAction=_a20.onPrimaryAction,linearItems=_a20.linearItems,_b=useDragAndDrop(),abortProgrammaticDrag=_b.abortProgrammaticDrag,completeProgrammaticDrag=_b.completeProgrammaticDrag,programmaticDragDown=_b.programmaticDragDown,programmaticDragUp=_b.programmaticDragUp,startProgrammaticDrag=_b.startProgrammaticDrag,itemsRef=useRefCopy(items),collapseItem=reactExports.useCallback(function(itemId,treeId){onCollapseItem?.(items[itemId],treeId)},[items,onCollapseItem]),expandItem=reactExports.useCallback(function(itemId,treeId){onExpandItem?.(items[itemId],treeId)},[items,onExpandItem]),focusItem=reactExports.useCallback(function(itemId,treeId,setDomFocus){setDomFocus===void 0&&(setDomFocus=!0),onFocusItem?.(items[itemId],treeId,setDomFocus)},[items,onFocusItem]),focusTree=reactExports.useCallback(function(treeId,autoFocus){autoFocus===void 0&&(autoFocus=!0),setActiveTree(treeId,autoFocus)},[setActiveTree]),moveFocusDown=reactExports.useCallback(function(treeId){var treeLinearItems=linearItems[treeId],currentFocusIndex=treeLinearItems.findIndex(function(_a21){var _b2,item=_a21.item;return item===((_b2=viewState[treeId])===null||_b2===void 0?void 0:_b2.focusedItem)}),newIndex=currentFocusIndex!==void 0?Math.min(treeLinearItems.length-1,currentFocusIndex+1):0,newItem=items[treeLinearItems[newIndex].item];onFocusItem?.(newItem,treeId)},[items,linearItems,onFocusItem,viewState]),moveFocusUp=reactExports.useCallback(function(treeId){var treeLinearItems=linearItems[treeId],currentFocusIndex=treeLinearItems.findIndex(function(_a21){var _b2,item=_a21.item;return item===((_b2=viewState[treeId])===null||_b2===void 0?void 0:_b2.focusedItem)}),newIndex=currentFocusIndex!==void 0?Math.max(0,currentFocusIndex-1):0,newItem=items[treeLinearItems[newIndex].item];onFocusItem?.(newItem,treeId)},[items,linearItems,onFocusItem,viewState]),renameItem=reactExports.useCallback(function(itemId,name2,treeId){onRenameItem?.(items[itemId],name2,treeId)},[items,onRenameItem]),selectItems=reactExports.useCallback(function(itemsIds,treeId){onSelectItems?.(itemsIds,treeId)},[onSelectItems]),toggleItemExpandedState=reactExports.useCallback(function(itemId,treeId){var _a21,_b2;!((_b2=(_a21=viewState[treeId])===null||_a21===void 0?void 0:_a21.expandedItems)===null||_b2===void 0)&&_b2.includes(itemId)?onCollapseItem?.(items[itemId],treeId):onExpandItem?.(items[itemId],treeId)},[items,onCollapseItem,onExpandItem,viewState]),toggleItemSelectStatus=reactExports.useCallback(function(itemId,treeId){var _a21,_b2,_c,_d,_e;!((_b2=(_a21=viewState[treeId])===null||_a21===void 0?void 0:_a21.selectedItems)===null||_b2===void 0)&&_b2.includes(itemId)?onSelectItems?.((_d=(_c=viewState[treeId].selectedItems)===null||_c===void 0?void 0:_c.filter(function(item){return item!==itemId}))!==null&&_d!==void 0?_d:[],treeId):onSelectItems?.(__spreadArray$3(__spreadArray$3([],(_e=viewState[treeId].selectedItems)!==null&&_e!==void 0?_e:[],!0),[itemId],!1),treeId)},[onSelectItems,viewState]),invokePrimaryAction=reactExports.useCallback(function(itemId,treeId){onPrimaryAction?.(items[itemId],treeId)},[items,onPrimaryAction]),expandSubsequently=reactExports.useCallback(function(treeId,itemIds){return __awaiter(void 0,void 0,void 0,function(){var current,rest;return __generator(this,function(_a21){switch(_a21.label){case 0:return current=itemIds[0],rest=itemIds.slice(1),[4,waitFor(function(){var _a22;return!!(!((_a22=itemsRef.current)===null||_a22===void 0)&&_a22[current])}).then(function(){var item=itemsRef.current[current];return item?(onExpandItem?.(item,treeId),rest.length>0?expandSubsequently(treeId,rest):Promise.resolve()):Promise.resolve()})];case 1:return _a21.sent(),[2]}})})},[itemsRef,onExpandItem]),expandAll=reactExports.useCallback(function(treeId){return __awaiter(void 0,void 0,void 0,function(){return __generator(this,function(_a21){switch(_a21.label){case 0:return[4,recursiveExpand(trees[treeId].rootItem,itemsRef,function(item){return onExpandItem?.(item,treeId)})];case 1:return _a21.sent(),[2]}})})},[itemsRef,onExpandItem,trees]),collapseAll=reactExports.useCallback(function(treeId){for(var _a21,_b2,_i=0,_c=(_b2=(_a21=viewState[treeId])===null||_a21===void 0?void 0:_a21.expandedItems)!==null&&_b2!==void 0?_b2:[];_i<_c.length;_i++){var itemId=_c[_i];onCollapseItem?.(items[itemId],treeId)}},[items,onCollapseItem,viewState]),actions=reactExports.useMemo(function(){return{collapseItem,expandItem,focusItem,focusTree,moveFocusDown,moveFocusUp,renameItem,selectItems,toggleItemExpandedState,toggleItemSelectStatus,invokePrimaryAction,expandAll,expandSubsequently,collapseAll,abortProgrammaticDrag,completeProgrammaticDrag,moveProgrammaticDragPositionDown:programmaticDragDown,moveProgrammaticDragPositionUp:programmaticDragUp,startProgrammaticDrag}},[collapseItem,expandItem,focusItem,focusTree,moveFocusDown,moveFocusUp,renameItem,selectItems,toggleItemExpandedState,toggleItemSelectStatus,invokePrimaryAction,expandAll,expandSubsequently,collapseAll,abortProgrammaticDrag,completeProgrammaticDrag,programmaticDragDown,programmaticDragUp,startProgrammaticDrag]);return useCreatedEnvironmentRef(ref,actions),reactExports.createElement(EnvironmentActionsContext$1.Provider,{value:actions},props.children)}),scrollIntoView=__name(function(element2){var _a20,_b,_c,_d;if(element2)if(element2.scrollIntoViewIfNeeded)element2.scrollIntoViewIfNeeded();else{var boundingBox=element2.getBoundingClientRect(),isElementInViewport=boundingBox.top>=0&&boundingBox.left>=0&&boundingBox.bottom<=(window.innerHeight||!!(!((_b=(_a20=getDocument())===null||_a20===void 0?void 0:_a20.documentElement)===null||_b===void 0)&&_b.clientHeight))&&boundingBox.right<=(window.innerWidth||!!(!((_d=(_c=getDocument())===null||_c===void 0?void 0:_c.documentElement)===null||_d===void 0)&&_d.clientWidth));isElementInViewport||element2.scrollIntoView()}},"scrollIntoView"),__assign$7=function(){return __assign$7=Object.assign||function(t2){for(var s2,i2=1,n2=arguments.length;i2<n2;i2++){s2=arguments[i2];for(var p in s2)Object.prototype.hasOwnProperty.call(s2,p)&&(t2[p]=s2[p])}return t2},__assign$7.apply(this,arguments)},cx=__name(function(){for(var classNames=[],_i=0;_i<arguments.length;_i++)classNames[_i]=arguments[_i];return classNames.filter(function(cn2){return!!cn2}).join(" ")},"cx"),createDefaultRenderers=__name(function(renderDepthOffset,rtl){return{renderItemTitle:__name(function(_a20){var title=_a20.title,context=_a20.context,info=_a20.info;if(!info.isSearching||!context.isSearchMatching)return title;var startIndex=title.toLowerCase().indexOf(info.search.toLowerCase());return React.createElement(React.Fragment,null,startIndex>0&&React.createElement("span",null,title.slice(0,startIndex)),React.createElement("span",{className:"rct-tree-item-search-highlight"},title.slice(startIndex,startIndex+info.search.length)),startIndex+info.search.length<title.length&&React.createElement("span",null,title.slice(startIndex+info.search.length,title.length)))},"renderItemTitle"),renderItemArrow:__name(function(_a20){var item=_a20.item,context=_a20.context;return React.createElement("div",__assign$7({className:cx(item.isFolder&&"rct-tree-item-arrow-isFolder",context.isExpanded&&"rct-tree-item-arrow-expanded","rct-tree-item-arrow")},context.arrowProps),item.isFolder&&(context.isExpanded?React.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"},React.createElement("g",null,React.createElement("g",null,React.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"})))):React.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"},React.createElement("g",null,React.createElement("g",null,React.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"}))))))},"renderItemArrow"),renderItem:__name(function(_a20){var item=_a20.item,depth=_a20.depth,children=_a20.children,title=_a20.title,context=_a20.context,arrow2=_a20.arrow,InteractiveComponent=context.isRenaming?"div":"button",type=context.isRenaming?void 0:"button";return React.createElement("li",__assign$7({},context.itemContainerWithChildrenProps,{className:cx("rct-tree-item-li",item.isFolder&&"rct-tree-item-li-isFolder",context.isSelected&&"rct-tree-item-li-selected",context.isExpanded&&"rct-tree-item-li-expanded",context.isFocused&&"rct-tree-item-li-focused",context.isDraggingOver&&"rct-tree-item-li-dragging-over",context.isSearchMatching&&"rct-tree-item-li-search-match")}),React.createElement("div",__assign$7({},context.itemContainerWithoutChildrenProps,{style:{"--depthOffset":"".concat((depth+1)*renderDepthOffset,"px")},className:cx("rct-tree-item-title-container",item.isFolder&&"rct-tree-item-title-container-isFolder",context.isSelected&&"rct-tree-item-title-container-selected",context.isExpanded&&"rct-tree-item-title-container-expanded",context.isFocused&&"rct-tree-item-title-container-focused",context.isDraggingOver&&"rct-tree-item-title-container-dragging-over",context.isSearchMatching&&"rct-tree-item-title-container-search-match")}),arrow2,React.createElement(InteractiveComponent,__assign$7({type},context.interactiveElementProps,{className:cx("rct-tree-item-button",item.isFolder&&"rct-tree-item-button-isFolder",context.isSelected&&"rct-tree-item-button-selected",context.isExpanded&&"rct-tree-item-button-expanded",context.isFocused&&"rct-tree-item-button-focused",context.isDraggingOver&&"rct-tree-item-button-dragging-over",context.isSearchMatching&&"rct-tree-item-button-search-match")}),title)),children)},"renderItem"),renderRenameInput:__name(function(_a20){var inputProps=_a20.inputProps,inputRef=_a20.inputRef,submitButtonProps=_a20.submitButtonProps,submitButtonRef=_a20.submitButtonRef,formProps=_a20.formProps;return React.createElement("form",__assign$7({},formProps,{className:"rct-tree-item-renaming-form"}),React.createElement("input",__assign$7({},inputProps,{ref:inputRef,className:"rct-tree-item-renaming-input"})),React.createElement("input",__assign$7({},submitButtonProps,{ref:submitButtonRef,type:"submit",className:"rct-tree-item-renaming-submit-button",value:"🗸"})))},"renderRenameInput"),renderTreeContainer:__name(function(_a20){var children=_a20.children,containerProps=_a20.containerProps,info=_a20.info;return React.createElement("div",{className:cx("rct-tree-root",info.isFocused&&"rct-tree-root-focus",info.isRenaming&&"rct-tree-root-renaming",info.areItemsSelected&&"rct-tree-root-itemsselected",rtl)},React.createElement("div",__assign$7({},containerProps,{style:__assign$7({minHeight:"30px"},containerProps.style)}),children))},"renderTreeContainer"),renderItemsContainer:__name(function(_a20){var children=_a20.children,containerProps=_a20.containerProps;return React.createElement("ul",__assign$7({},containerProps,{className:"rct-tree-items-container"}),children)},"renderItemsContainer"),renderDragBetweenLine:__name(function(_a20){var draggingPosition=_a20.draggingPosition,lineProps=_a20.lineProps;return React.createElement("div",__assign$7({},lineProps,{style:{left:"".concat(draggingPosition.depth*renderDepthOffset,"px")},className:cx("rct-tree-drag-between-line",draggingPosition.targetType==="between-items"&&draggingPosition.linePosition==="top"&&"rct-tree-drag-between-line-top",draggingPosition.targetType==="between-items"&&draggingPosition.linePosition==="bottom"&&"rct-tree-drag-between-line-bottom")}))},"renderDragBetweenLine"),renderSearchInput:__name(function(_a20){var inputProps=_a20.inputProps;return React.createElement("div",{className:cx("rct-tree-search-input-container")},React.createElement("span",{className:"rct-tree-input-icon"}),React.createElement("input",__assign$7({},inputProps,{className:cx("rct-tree-search-input")})))},"renderSearchInput"),renderLiveDescriptorContainer:__name(function(_a20){var tree=_a20.tree,children=_a20.children;return React.createElement("div",{id:"rct-livedescription-".concat(tree.treeId),style:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",width:"1px"}},children)},"renderLiveDescriptorContainer"),renderDepthOffset}},"createDefaultRenderers"),useRenderers=__name(function(_a20){var renderItem=_a20.renderItem,renderItemTitle=_a20.renderItemTitle,renderItemArrow=_a20.renderItemArrow,renderRenameInput=_a20.renderRenameInput,renderItemsContainer=_a20.renderItemsContainer,renderTreeContainer=_a20.renderTreeContainer,renderDragBetweenLine=_a20.renderDragBetweenLine,renderSearchInput=_a20.renderSearchInput,renderLiveDescriptorContainer=_a20.renderLiveDescriptorContainer,renderDepthOffset=_a20.renderDepthOffset,defaultRenderers=reactExports.useMemo(function(){return createDefaultRenderers(renderDepthOffset??10)},[renderDepthOffset]),customRenderers={renderItem,renderItemTitle,renderItemArrow,renderRenameInput,renderItemsContainer,renderTreeContainer,renderDragBetweenLine,renderSearchInput,renderLiveDescriptorContainer,renderDepthOffset},renderers=Object.entries(defaultRenderers).reduce(function(acc,_a21){var key=_a21[0],value=_a21[1],keyMapped=key;return customRenderers[keyMapped]?acc[keyMapped]=customRenderers[keyMapped]:acc[keyMapped]=value,acc},{});return renderers.renderItem.displayName="RenderItem",renderers.renderItemTitle.displayName="RenderItemTitle",renderers.renderItemArrow.displayName="RenderItemArrow",renderers.renderRenameInput.displayName="RenderRenameInput",renderers.renderItemsContainer.displayName="RenderItemsContainer",renderers.renderTreeContainer.displayName="RenderTreeContainer",renderers.renderDragBetweenLine.displayName="RenderDragBetweenLine",renderers.renderSearchInput.displayName="RenderSearchInput",renderers},"useRenderers"),getItemsLinearly=__name(function(rootItem,viewState,items,depth){var _a20,_b,_c;depth===void 0&&(depth=0);for(var itemIds=[],_i=0,_d=(_b=(_a20=items[rootItem])===null||_a20===void 0?void 0:_a20.children)!==null&&_b!==void 0?_b:[];_i<_d.length;_i++){var itemId=_d[_i],item=items[itemId];itemIds.push({item:itemId,depth}),item&&item.isFolder&&item.children&&(!((_c=viewState.expandedItems)===null||_c===void 0)&&_c.includes(itemId))&&itemIds.push.apply(itemIds,getItemsLinearly(itemId,viewState,items,depth+1))}return itemIds},"getItemsLinearly"),__assign$6=function(){return __assign$6=Object.assign||function(t2){for(var s2,i2=1,n2=arguments.length;i2<n2;i2++){s2=arguments[i2];for(var p in s2)Object.prototype.hasOwnProperty.call(s2,p)&&(t2[p]=s2[p])}return t2},__assign$6.apply(this,arguments)},__rest=function(s2,e){var t2={};for(var p in s2)Object.prototype.hasOwnProperty.call(s2,p)&&e.indexOf(p)<0&&(t2[p]=s2[p]);if(s2!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i2=0,p=Object.getOwnPropertySymbols(s2);i2<p.length;i2++)e.indexOf(p[i2])<0&&Object.prototype.propertyIsEnumerable.call(s2,p[i2])&&(t2[p[i2]]=s2[p[i2]]);return t2},useControlledTreeEnvironmentProps=__name(function(_a20){var onExpandItemProp=_a20.onExpandItem,onCollapseProp=_a20.onCollapseItem,onDropProp=_a20.onDrop,props=__rest(_a20,["onExpandItem","onCollapseItem","onDrop"]),_b=reactExports.useState({}),trees=_b[0],setTrees=_b[1],_c=reactExports.useState(),activeTreeId=_c[0],setActiveTreeId=_c[1],treeIds=reactExports.useMemo(function(){return Object.keys(trees)},[trees]),onFocusItem=props.onFocusItem,autoFocus=props.autoFocus,onRegisterTree=props.onRegisterTree,onUnregisterTree=props.onUnregisterTree,items=props.items,viewState=props.viewState,onFocusItemRef=useRefCopy(onFocusItem),viewStateRef=useRefCopy(viewState),linearItems=reactExports.useMemo(function(){return buildMapForTrees(treeIds,function(treeId){var _a21;return getItemsLinearly(trees[treeId].rootItem,(_a21=viewState[treeId])!==null&&_a21!==void 0?_a21:{},items)})},[trees,items,treeIds,viewState]),onFocusItemHandler=reactExports.useCallback(function(item,treeId,setDomFocus){var _a21,_b2,_c2,_d,_e,_f,_g,_h,_j;if(setDomFocus===void 0&&(setDomFocus=!0),(autoFocus??!0)&&setDomFocus){var newItem=(_b2=(_a21=getDocument())===null||_a21===void 0?void 0:_a21.querySelector('[data-rct-tree="'.concat(treeId,'"] [data-rct-item-id="').concat(item.index,'"]')))!==null&&_b2!==void 0?_b2:(_c2=getDocument())===null||_c2===void 0?void 0:_c2.querySelector('[data-rct-tree="'.concat(treeId,'"] [data-rct-item-id]'));((_f=(_e=(_d=getDocument())===null||_d===void 0?void 0:_d.activeElement)===null||_e===void 0?void 0:_e.attributes.getNamedItem("data-rct-search-input"))===null||_f===void 0?void 0:_f.value)!=="true"?(_g=newItem?.focus)===null||_g===void 0||_g.call(newItem):scrollIntoView(newItem)}((_h=viewStateRef.current[treeId])===null||_h===void 0?void 0:_h.focusedItem)!==item.index&&((_j=onFocusItemRef.current)===null||_j===void 0||_j.call(onFocusItemRef,item,treeId))},[autoFocus,onFocusItemRef,viewStateRef]),registerTree=reactExports.useCallback(function(tree){setTrees(function(trees2){var _a21;return __assign$6(__assign$6({},trees2),(_a21={},_a21[tree.treeId]=tree,_a21))}),onRegisterTree?.(tree)},[onRegisterTree]),unregisterTree=reactExports.useCallback(function(treeId){onUnregisterTree?.(trees[treeId]),delete trees[treeId],setTrees(trees)},[onUnregisterTree,trees]),onCollapseItem=reactExports.useCallback(function(item,treeId){onCollapseProp?.(item,treeId),setTrees(function(trees2){return trees2})},[onCollapseProp]),onExpandItem=reactExports.useCallback(function(item,treeId){onExpandItemProp?.(item,treeId),setTrees(function(trees2){return trees2})},[onExpandItemProp]),onDrop=reactExports.useCallback(function(items2,target){onDropProp?.(items2,target),setTrees(function(trees2){return trees2})},[onDropProp]),focusTree=reactExports.useCallback(function(treeId){var _a21,_b2,focusItem=(_a21=getDocument())===null||_a21===void 0?void 0:_a21.querySelector('[data-rct-tree="'.concat(treeId,'"] [data-rct-item-focus="true"]'));(_b2=focusItem?.focus)===null||_b2===void 0||_b2.call(focusItem)},[]),setActiveTree=reactExports.useCallback(function(treeIdOrSetStateFunction,autoFocusTree){autoFocusTree===void 0&&(autoFocusTree=!0);var maybeFocusTree=__name(function(treeId2){var _a21,_b2;autoFocusTree&&(autoFocus??!0)&&treeId2&&!(!((_b2=(_a21=getDocument())===null||_a21===void 0?void 0:_a21.querySelector('[data-rct-tree="'.concat(treeId2,'"]')))===null||_b2===void 0)&&_b2.contains(document.activeElement))&&focusTree(treeId2)},"maybeFocusTree");if(typeof treeIdOrSetStateFunction=="function")setActiveTreeId(function(oldValue){var treeId2=treeIdOrSetStateFunction(oldValue);return treeId2!==oldValue&&maybeFocusTree(treeId2),treeId2});else{var treeId=treeIdOrSetStateFunction;setActiveTreeId(treeId),maybeFocusTree(treeId)}},[autoFocus,focusTree]),renderers=useRenderers(props);return __assign$6(__assign$6(__assign$6({},renderers),props),{onFocusItem:onFocusItemHandler,registerTree,unregisterTree,onExpandItem,onCollapseItem,onDrop,setActiveTree,treeIds,trees,activeTreeId,linearItems})},"useControlledTreeEnvironmentProps"),TreeEnvironmentContext=reactExports.createContext(null),useTreeEnvironment=__name(function(){return reactExports.useContext(TreeEnvironmentContext)},"useTreeEnvironment"),ControlledTreeEnvironment=reactExports.forwardRef(function(props,ref){var environmentContextProps=useControlledTreeEnvironmentProps(props),viewState=props.viewState,onFocusItem=props.onFocusItem;return reactExports.useEffect(function(){for(var _a20,_b,_c,_i=0,_d=Object.keys(environmentContextProps.trees);_i<_d.length;_i++){var treeId=_d[_i],firstItemIndex=(_b=(_a20=props.items[environmentContextProps.trees[treeId].rootItem])===null||_a20===void 0?void 0:_a20.children)===null||_b===void 0?void 0:_b[0],firstItem=firstItemIndex&&props.items[firstItemIndex];!(!((_c=viewState[treeId])===null||_c===void 0)&&_c.focusedItem)&&environmentContextProps.trees[treeId]&&firstItem&&onFocusItem?.(firstItem,treeId,!1)}},[environmentContextProps.trees,onFocusItem,props.items,viewState]),reactExports.createElement(TreeEnvironmentContext.Provider,{value:environmentContextProps},reactExports.createElement(InteractionManagerProvider,null,reactExports.createElement(DragAndDropProvider,null,reactExports.createElement(EnvironmentActionsProvider,{ref},props.children))))}),DragBetweenLine=__name(function(_a20){var _b,treeId=_a20.treeId,_c=useDragAndDrop(),draggingPosition=_c.draggingPosition,itemHeight=_c.itemHeight,renderers=useTree().renderers,shouldDisplay=draggingPosition&&draggingPosition.targetType==="between-items"&&draggingPosition.treeId===treeId;if(!shouldDisplay)return null;var lineProps={onDragOver:__name(function(e){return e.preventDefault()},"onDragOver")};return reactExports.createElement("div",{style:{position:"absolute",left:"0",right:"0",top:"".concat(((_b=draggingPosition?.linearIndex)!==null&&_b!==void 0?_b:0)*itemHeight,"px")}},renderers.renderDragBetweenLine({draggingPosition,lineProps}))},"DragBetweenLine"),useHtmlElementEventListener=__name(function(element2,type,listener){var stableListener=useStableHandler(listener);reactExports.useEffect(function(){return element2?(element2.addEventListener(type,stableListener),function(){return element2.removeEventListener(type,stableListener)}):function(){}},[element2,stableListener,type])},"useHtmlElementEventListener"),useFocusWithin=__name(function(element2,onFocusIn,onFocusOut){var _a20=reactExports.useState(!1),focusWithin=_a20[0],setFocusWithin=_a20[1],isLoosingFocusFlag=reactExports.useRef(!1),callSoon=useCallSoon();return useHtmlElementEventListener(element2,"focusin",function(){focusWithin||(setFocusWithin(!0),onFocusIn?.()),isLoosingFocusFlag.current&&(isLoosingFocusFlag.current=!1)}),useHtmlElementEventListener(element2,"focusout",function(){isLoosingFocusFlag.current=!0,callSoon(function(){isLoosingFocusFlag.current&&!element2?.contains(document.activeElement)&&(onFocusOut?.(),isLoosingFocusFlag.current=!1,setFocusWithin(!1))})}),focusWithin},"useFocusWithin"),useKey=__name(function(key,onHit,active){useHtmlElementEventListener(getDocument(),"keydown",function(e){active&&active&&key.toLowerCase()===e.key.toLowerCase()&&onHit(e)})},"useKey"),defaultKeyboardBindings={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"]},__assign$5=function(){return __assign$5=Object.assign||function(t2){for(var s2,i2=1,n2=arguments.length;i2<n2;i2++){s2=arguments[i2];for(var p in s2)Object.prototype.hasOwnProperty.call(s2,p)&&(t2[p]=s2[p])}return t2},__assign$5.apply(this,arguments)},useKeyboardBindings=__name(function(){var environment=useTreeEnvironment();return reactExports.useMemo(function(){return environment.keyboardBindings?__assign$5(__assign$5({},defaultKeyboardBindings),environment.keyboardBindings):defaultKeyboardBindings},[environment.keyboardBindings])},"useKeyboardBindings"),elementsThatCanTakeText=["input","textarea"],useHotkey=__name(function(combinationName,onHit,active,activatableWhileFocusingInput){activatableWhileFocusingInput===void 0&&(activatableWhileFocusingInput=!1);var pressedKeys=reactExports.useRef([]),keyboardBindings=useKeyboardBindings(),callSoon=useCallSoon(),possibleCombinations=reactExports.useMemo(function(){return keyboardBindings[combinationName].map(function(combination){return combination.split("+")})},[combinationName,keyboardBindings]);useHtmlElementEventListener(getDocument(),"keydown",function(e){var _a20;if(active!==!1&&!((elementsThatCanTakeText.includes((_a20=e.target.tagName)===null||_a20===void 0?void 0:_a20.toLowerCase())||e.target.isContentEditable)&&!activatableWhileFocusingInput)&&!pressedKeys.current.includes(e.key)){pressedKeys.current.push(e.key);var pressedKeysLowercase_1=pressedKeys.current.map(function(key){return key.toLowerCase()}),partialMatch=possibleCombinations.map(function(combination){return pressedKeysLowercase_1.map(function(key){return combination.includes(key.toLowerCase())}).reduce(function(a2,b){return a2&&b},!0)}).reduce(function(a2,b){return a2||b},!1);partialMatch&&(pressedKeys.current.length>1||!/^[a-zA-Z\s]$/.test(e.key))&&e.preventDefault()}}),useHtmlElementEventListener(getDocument(),"keyup",function(e){if(active!==!1){var pressedKeysLowercase=pressedKeys.current.map(function(key){return key.toLowerCase()}),match=possibleCombinations.map(function(combination){return combination.map(function(key){return pressedKeysLowercase.includes(key.toLowerCase())}).reduce(function(a2,b){return a2&&b},!0)}).reduce(function(a2,b){return a2||b},!1);match&&callSoon(function(){return onHit(e)}),pressedKeys.current=pressedKeys.current.filter(function(key){return key!==e.key})}})},"useHotkey"),useViewState=__name(function(){var _a20,treeId=useTree().treeId,viewState=useTreeEnvironment().viewState;return(_a20=viewState[treeId])!==null&&_a20!==void 0?_a20:{}},"useViewState"),useLinearItems=__name(function(treeId){return useTreeEnvironment().linearItems[treeId]},"useLinearItems"),useMoveFocusToIndex=__name(function(){var treeId=useTree().treeId,_a20=useTreeEnvironment(),onFocusItem=_a20.onFocusItem,items=_a20.items,linearItems=useLinearItems(treeId),viewState=useViewState();return useStableHandler(function(computeNewIndex){var _a21,currentIndex=(_a21=linearItems.findIndex(function(item){return item.item===viewState.focusedItem}))!==null&&_a21!==void 0?_a21:0,newIndex=computeNewIndex(currentIndex,linearItems),newIndexBounded=Math.max(0,Math.min(linearItems.length-1,newIndex)),newFocusItem=items[linearItems[newIndexBounded].item];return onFocusItem?.(newFocusItem,treeId),newFocusItem})},"useMoveFocusToIndex"),__spreadArray$2=function(to,from,pack){if(pack||arguments.length===2)for(var i2=0,l2=from.length,ar2;i2<l2;i2++)(ar2||!(i2 in from))&&(ar2||(ar2=Array.prototype.slice.call(from,0,i2)),ar2[i2]=from[i2]);return to.concat(ar2||Array.prototype.slice.call(from))},usePrevious2=__name(function(value){var ref=reactExports.useRef({target:value,previous:void 0});return ref.current.target!==value&&(ref.current.previous=ref.current.target,ref.current.target=value),ref.current.previous},"usePrevious"),useSelectUpTo=__name(function(startingAt){var viewState=useViewState(),treeId=useTree().treeId,linearItems=useLinearItems(treeId),onSelectItems=useTreeEnvironment().onSelectItems,focusedItemPrevious=usePrevious2(viewState.focusedItem);return reactExports.useCallback(function(item,overrideOldSelection){var _a20,_b;overrideOldSelection===void 0&&(overrideOldSelection=!1);var itemIndex=item.index,selectMergedItems=__name(function(oldSelection,newSelection){var merged=__spreadArray$2(__spreadArray$2([],overrideOldSelection?[]:oldSelection,!0),newSelection.filter(function(i2){return overrideOldSelection||!oldSelection.includes(i2)}),!0);onSelectItems?.(merged,treeId)},"selectMergedItems");if(viewState&&viewState.selectedItems&&viewState.selectedItems.length>0){var lastFocus_1=viewState.focusedItem===itemIndex?focusedItemPrevious:viewState.focusedItem,selectionStart=startingAt==="last-focus"?linearItems.findIndex(function(linearItem){return lastFocus_1===linearItem.item}):linearItems.findIndex(function(linearItem){var _a21;return(_a21=viewState.selectedItems)===null||_a21===void 0?void 0:_a21.includes(linearItem.item)}),selectionEnd=linearItems.findIndex(function(linearItem){return linearItem.item===itemIndex});if(selectionStart<selectionEnd){var selection=linearItems.slice(selectionStart,selectionEnd+1).map(function(_a21){var item2=_a21.item;return item2});selectMergedItems((_a20=viewState.selectedItems)!==null&&_a20!==void 0?_a20:[],selection)}else{var selection=linearItems.slice(selectionEnd,selectionStart+1).map(function(_a21){var item2=_a21.item;return item2});selectMergedItems((_b=viewState.selectedItems)!==null&&_b!==void 0?_b:[],selection)}}else onSelectItems?.([itemIndex],treeId)},[viewState,onSelectItems,treeId,startingAt,linearItems,focusedItemPrevious])},"useSelectUpTo"),__spreadArray$1=function(to,from,pack){if(pack||arguments.length===2)for(var i2=0,l2=from.length,ar2;i2<l2;i2++)(ar2||!(i2 in from))&&(ar2||(ar2=Array.prototype.slice.call(from,0,i2)),ar2[i2]=from[i2]);return to.concat(ar2||Array.prototype.slice.call(from))},useTreeKeyboardBindings=__name(function(){var _a20,environment=useTreeEnvironment(),_b=useTree(),treeId=_b.treeId,setRenamingItem=_b.setRenamingItem,setSearch=_b.setSearch,renamingItem=_b.renamingItem,linearItems=useLinearItems(treeId),dnd=useDragAndDrop(),viewState=useViewState(),moveFocusToIndex=useMoveFocusToIndex(),selectUpTo=useSelectUpTo("first-selected"),isActiveTree=environment.activeTreeId===treeId,isRenaming=!!renamingItem,disableArrowKeys=environment.disableArrowKeys,enableArrowKeys=!disableArrowKeys&&isActiveTree&&!isRenaming;useKey("arrowdown",function(e){if(e.preventDefault(),dnd.isProgrammaticallyDragging)dnd.programmaticDragDown();else{var newFocusItem=moveFocusToIndex(function(currentIndex){return currentIndex+1});e.shiftKey&&selectUpTo(newFocusItem)}},enableArrowKeys),useKey("arrowup",function(e){if(e.preventDefault(),dnd.isProgrammaticallyDragging)dnd.programmaticDragUp();else{var newFocusItem=moveFocusToIndex(function(currentIndex){return currentIndex-1});e.shiftKey&&selectUpTo(newFocusItem)}},enableArrowKeys),useHotkey("moveFocusToFirstItem",function(e){e.preventDefault(),moveFocusToIndex(function(){return 0})},isActiveTree&&!dnd.isProgrammaticallyDragging&&!isRenaming),useHotkey("moveFocusToLastItem",function(e){e.preventDefault(),moveFocusToIndex(function(currentIndex,linearItems2){return linearItems2.length-1})},isActiveTree&&!dnd.isProgrammaticallyDragging&&!isRenaming),useKey("arrowright",function(e){e.preventDefault(),moveFocusToIndex(function(currentIndex,linearItems2){var _a21,_b2,item=environment.items[linearItems2[currentIndex].item];if(item.isFolder){if(!((_a21=viewState.expandedItems)===null||_a21===void 0)&&_a21.includes(item.index))return currentIndex+1;(_b2=environment.onExpandItem)===null||_b2===void 0||_b2.call(environment,item,treeId)}return currentIndex})},enableArrowKeys&&!dnd.isProgrammaticallyDragging),useKey("arrowleft",function(e){e.preventDefault(),moveFocusToIndex(function(currentIndex,linearItems2){var _a21,_b2,item=environment.items[linearItems2[currentIndex].item],itemDepth=linearItems2[currentIndex].depth;if(item.isFolder&&(!((_a21=viewState.expandedItems)===null||_a21===void 0)&&_a21.includes(item.index)))(_b2=environment.onCollapseItem)===null||_b2===void 0||_b2.call(environment,item,treeId);else if(itemDepth>0){var parentIndex=currentIndex;for(parentIndex;linearItems2[parentIndex].depth!==itemDepth-1;parentIndex-=1);return parentIndex}return currentIndex})},enableArrowKeys&&!dnd.isProgrammaticallyDragging),useHotkey("primaryAction",function(e){var _a21,_b2;e.preventDefault(),viewState.focusedItem!==void 0&&((_a21=environment.onSelectItems)===null||_a21===void 0||_a21.call(environment,[viewState.focusedItem],treeId),(_b2=environment.onPrimaryAction)===null||_b2===void 0||_b2.call(environment,environment.items[viewState.focusedItem],treeId))},isActiveTree&&!dnd.isProgrammaticallyDragging&&!isRenaming),useHotkey("toggleSelectItem",function(e){var _a21,_b2,_c;e.preventDefault(),e.stopPropagation(),viewState.focusedItem!==void 0&&(viewState.selectedItems&&viewState.selectedItems.includes(viewState.focusedItem)?(_a21=environment.onSelectItems)===null||_a21===void 0||_a21.call(environment,viewState.selectedItems.filter(function(item){return item!==viewState.focusedItem}),treeId):(_b2=environment.onSelectItems)===null||_b2===void 0||_b2.call(environment,__spreadArray$1(__spreadArray$1([],(_c=viewState.selectedItems)!==null&&_c!==void 0?_c:[],!0),[viewState.focusedItem],!1),treeId))},isActiveTree&&!dnd.isProgrammaticallyDragging&&!isRenaming),useHotkey("selectAll",function(e){var _a21;e.preventDefault(),(_a21=environment.onSelectItems)===null||_a21===void 0||_a21.call(environment,linearItems.map(function(_a22){var item=_a22.item;return item}),treeId)},isActiveTree&&!dnd.isProgrammaticallyDragging&&!isRenaming),useHotkey("renameItem",function(e){var _a21;if(viewState.focusedItem!==void 0){e.preventDefault();var item=environment.items[viewState.focusedItem];item.canRename!==!1&&((_a21=environment.onStartRenamingItem)===null||_a21===void 0||_a21.call(environment,item,treeId),setRenamingItem(item.index))}},isActiveTree&&((_a20=environment.canRename)!==null&&_a20!==void 0?_a20:!0)&&!isRenaming),useHotkey("startSearch",function(e){var _a21,_b2;e.preventDefault(),setSearch(""),(_b2=(_a21=document.querySelector('[data-rct-search-input="true"]'))===null||_a21===void 0?void 0:_a21.focus)===null||_b2===void 0||_b2.call(_a21)},isActiveTree&&!dnd.isProgrammaticallyDragging&&!isRenaming),useHotkey("startProgrammaticDnd",function(e){e.preventDefault(),dnd.startProgrammaticDrag()},isActiveTree&&!isRenaming),useHotkey("completeProgrammaticDnd",function(e){e.preventDefault(),dnd.completeProgrammaticDrag()},isActiveTree&&dnd.isProgrammaticallyDragging&&!isRenaming),useHotkey("abortProgrammaticDnd",function(e){e.preventDefault(),dnd.abortProgrammaticDrag()},isActiveTree&&dnd.isProgrammaticallyDragging&&!isRenaming)},"useTreeKeyboardBindings"),defaultMatcher=__name(function(search2,item,itemTitle){return itemTitle.toLowerCase().includes(search2.toLowerCase())},"defaultMatcher"),useSearchMatchFocus=__name(function(){var _a20=useTreeEnvironment(),doesSearchMatchItem=_a20.doesSearchMatchItem,items=_a20.items,getItemTitle2=_a20.getItemTitle,onFocusItem=_a20.onFocusItem,_b=useTree(),search2=_b.search,treeId=_b.treeId,linearItems=useLinearItems(treeId),callSoon=useCallSoon();useSideEffect(function(){search2&&search2.length>0&&callSoon(function(){var focusItem=linearItems.find(function(_a21){var item=_a21.item;return(doesSearchMatchItem??defaultMatcher)(search2,items[item],getItemTitle2(items[item]))});focusItem&&onFocusItem?.(items[focusItem.item],treeId)})},[doesSearchMatchItem,getItemTitle2,linearItems,items,onFocusItem,search2,treeId,callSoon],[search2])},"useSearchMatchFocus"),__assign$4=function(){return __assign$4=Object.assign||function(t2){for(var s2,i2=1,n2=arguments.length;i2<n2;i2++){s2=arguments[i2];for(var p in s2)Object.prototype.hasOwnProperty.call(s2,p)&&(t2[p]=s2[p])}return t2},__assign$4.apply(this,arguments)},SearchInput=__name(function(_a20){var _b,containerRef=_a20.containerRef,_c=useTree(),search2=_c.search,setSearch=_c.setSearch,treeId=_c.treeId,renderers=_c.renderers,renamingItem=_c.renamingItem,environment=useTreeEnvironment();useViewState();var isActiveTree=environment.activeTreeId===treeId,callSoon=useCallSoon();useSearchMatchFocus();var clearSearch=__name(function(){var _a21,_b2,_c2;if(setSearch(null),!((_a21=environment.autoFocus)!==null&&_a21!==void 0)||_a21){var focusItem=(_b2=getDocument())===null||_b2===void 0?void 0:_b2.querySelector('[data-rct-tree="'.concat(treeId,'"] [data-rct-item-focus="true"]'));(_c2=focusItem?.focus)===null||_c2===void 0||_c2.call(focusItem)}},"clearSearch");return useHotkey("abortSearch",function(){callSoon(function(){clearSearch()})},isActiveTree&&search2!==null,!0),useHtmlElementEventListener(containerRef,"keydown",function(e){var _a21,_b2,unicode=e.key.charCodeAt(0);(!((_a21=environment.canSearch)!==null&&_a21!==void 0)||_a21)&&(!((_b2=environment.canSearchByStartingTyping)!==null&&_b2!==void 0)||_b2)&&isActiveTree&&search2===null&&!renamingItem&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey&&(unicode>=48&&unicode<=57||unicode>=97&&unicode<=122)&&setSearch("")}),!(!((_b=environment.canSearch)!==null&&_b!==void 0)||_b)||search2===null?null:renderers.renderSearchInput({inputProps:__assign$4({value:search2,onChange:__name(function(e){return setSearch(e.target.value)},"onChange"),onBlur:__name(function(){clearSearch()},"onBlur"),ref:__name(function(el){var _a21;(_a21=el?.focus)===null||_a21===void 0||_a21.call(el)},"ref"),"aria-label":"Search for items"},{"data-rct-search-input":"true"})})},"SearchInput"),defaultLiveDescriptors={introduction:`
|
|
145
145
|
<p>Accessibility guide for tree {treeLabel}.</p>
|
|
146
146
|
<p>
|
|
147
147
|
Navigate the tree with the arrow keys. Common tree hotkeys apply. Further keybindings are available:
|
|
@@ -223,7 +223,7 @@ type ${formData.tableName} @table${joinedTableParams}${maybeExport}${maybeSealed
|
|
|
223
223
|
focus-visible:ring-1
|
|
224
224
|
focus-visible:outline-1
|
|
225
225
|
focus-visible:ring-purple-200
|
|
226
|
-
aria-invalid:focus-visible:ring-0`,{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",outline:"border bg-default border-primary border-2 text-white shadow-xs hover:-translate-y-1 transition duration-200 hover:bg-grey-700/40"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});var NAME="Toggle",Toggle$1=reactExports.forwardRef((props,forwardedRef)=>{const{pressed:pressedProp,defaultPressed,onPressedChange,...buttonProps}=props,[pressed,setPressed]=useControllableState({prop:pressedProp,onChange:onPressedChange,defaultProp:defaultPressed??!1,caller:NAME});return jsxRuntimeExports.jsx(Primitive$1.button,{type:"button","aria-pressed":pressed,"data-state":pressed?"on":"off","data-disabled":props.disabled?"":void 0,...buttonProps,ref:forwardedRef,onClick:composeEventHandlers$1(props.onClick,()=>{props.disabled||setPressed(!pressed)})})});Toggle$1.displayName=NAME;var Root=Toggle$1;function Toggle({className,variant,size:size2,...props}){return jsxRuntimeExports.jsx(Root,{"data-slot":"toggle",className:cn$1(toggleVariants({variant,size:size2,className})),...props})}__name(Toggle,"Toggle");function renderBadgeLogLevelVariant(value){switch(value){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 value}}__name(renderBadgeLogLevelVariant,"renderBadgeLogLevelVariant");const nodeVariant=["secondary","default","warning","outline","success","destructive"];let nodeEntries=0;const cache=new Map,memoizeNodeNames=__name(nodeName=>{if(cache.has(nodeName))return cache.get(nodeName);nodeEntries++;const nodeVariantIndex=nodeEntries%nodeVariant.length,memoized=nodeVariant[nodeVariantIndex];return cache.set(nodeName,memoized),memoized},"memoizeNodeNames");function LogsDataTable({columns:columns2,data,onRowClick}){const table2=useReactTable({data,columns:columns2,getCoreRowModel:getCoreRowModel()});return jsxRuntimeExports.jsx("div",{className:"rounded-md bg-black-dark logsTable",children:jsxRuntimeExports.jsxs(Table,{className:"text-xs",children:[jsxRuntimeExports.jsx(TableHeader,{children:table2.getHeaderGroups().map(headerGroup=>jsxRuntimeExports.jsx(TableRow,{className:"border-none",children:headerGroup.headers.map(header=>jsxRuntimeExports.jsx(TableHead,{className:"p-4 max-w-96",children:header.isPlaceholder?null:flexRender(header.column.columnDef.header,header.getContext())},header.id))},headerGroup.id))}),jsxRuntimeExports.jsx(TableBody,{className:"bg-black",children:table2.getRowModel().rows?.length?table2.getRowModel().rows.map(row=>jsxRuntimeExports.jsx(TableRow,{"data-state":row.getIsSelected()&&"selected",className:cn$1("hover:bg-muted/10 data-[state=selected]:bg-muted max-w-full",onRowClick&&"cursor-pointer"),onClick:__name(()=>onRowClick?.(row),"onClick"),children:row.getVisibleCells().map(cell=>jsxRuntimeExports.jsx(TableCell,{className:"p-1",children:flexRender(cell.column.columnDef.cell,cell.getContext())},cell.id))},row.id)):jsxRuntimeExports.jsx(TableRow,{children:jsxRuntimeExports.jsx(TableCell,{colSpan:columns2.length,className:"h-24 text-center",children:"No results."})})})]})})}__name(LogsDataTable,"LogsDataTable");function isJsonString(str){try{JSON.parse(str)}catch{return!1}return!0}__name(isJsonString,"isJsonString");function ViewLogModal({setIsModalOpen,isModalOpen,data}){const variant=data?memoizeNodeNames(data.node):"default";return jsxRuntimeExports.jsx(Dialog,{onOpenChange:setIsModalOpen,open:isModalOpen,children:jsxRuntimeExports.jsxs(DialogContent,{"aria-describedby":void 0,children:[jsxRuntimeExports.jsx(DialogHeader,{children:jsxRuntimeExports.jsx(DialogTitle,{children:"Edit Row"})}),data?jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-3 text-white",children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h3",{className:"inline-block pr-2",children:"Level:"}),jsxRuntimeExports.jsx(Badge,{variant:renderBadgeLogLevelVariant(data.level),children:capitalizeWords(data.level)})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h3",{children:"Timestamp:"}),jsxRuntimeExports.jsx("p",{className:"text-sm",children:data.timestamp})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h3",{children:"Thread:"}),jsxRuntimeExports.jsx("p",{className:"text-sm",children:data.thread})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h3",{children:"Node:"}),jsxRuntimeExports.jsx(Badge,{variant,children:data.node})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h3",{children:"Tags:"}),jsxRuntimeExports.jsx("p",{className:"text-sm",children:data.tags&&data.tags.length>0?jsxRuntimeExports.jsx("span",{children:data.tags}):"N/A"})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h3",{className:"text-lg font-bold",children:"Message"}),jsxRuntimeExports.jsx(Ft,{className:"w-full h-72",language:isJsonString(data.message)?"json":"text",theme:"vs-dark",value:data.message,options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1}})]})]}):jsxRuntimeExports.jsx(Loading,{}),jsxRuntimeExports.jsx(DialogFooter,{children:jsxRuntimeExports.jsxs("div",{className:"flex justify-between w-full",children:[jsxRuntimeExports.jsxs(Button,{type:"button",variant:"destructive",className:"rounded-full",children:[jsxRuntimeExports.jsx(Trash,{})," Delete Row"]}),jsxRuntimeExports.jsxs(Button,{variant:"submit",className:"rounded-full",children:[jsxRuntimeExports.jsx(Save,{})," Save Changes"]})]})})]})})}__name(ViewLogModal,"ViewLogModal");function getReadLogQueryOptions({entityId,instanceClient,logFilters,replicated,isAutoRefreshEnabled}){return{queryKey:[entityId,"read_log",logFilters.limit,logFilters.level,logFilters.from,logFilters.until,replicated],queryFn:__name(async()=>{const{data}=await instanceClient.post("/",{operation:"read_log",start:0,replicated,limit:logFilters.limit?parseInt(logFilters.limit,10):void 0,level:logFilters.level!=="undefined"?logFilters.level:void 0,from:logFilters.from?new Date(logFilters.from).toISOString():void 0,until:logFilters.until?new Date(logFilters.until).toISOString():void 0,order:"desc"});return data},"queryFn"),retry:!1,refetchInterval:isAutoRefreshEnabled?5e3:!1}}__name(getReadLogQueryOptions,"getReadLogQueryOptions");const LogFiltersFormSchema=object({limit:string$3().optional(),level:_enum(["notify","error","warn","info","debug","trace","undefined"]).optional(),from:string$3().or(_undefined()).optional(),until:string$3().or(_undefined()).optional()});function LogsFiltersForm({form,resetFilters,submitFilters}){return jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(Form,{...form,children:jsxRuntimeExports.jsxs("form",{id:"instance-edit-log-filters-form",name:"instance-edit-log-filters-form",onSubmit:form.handleSubmit(submitFilters),className:"flex-col space-y-5",children:[jsxRuntimeExports.jsx(FormField,{control:form.control,name:"limit",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{children:"Log Limit:"}),jsxRuntimeExports.jsxs(Select,{onValueChange:field.onChange,value:field.value,children:[jsxRuntimeExports.jsx(SelectTrigger,{className:"w-full",children:jsxRuntimeExports.jsx(SelectValue,{placeholder:"Select log limit"})}),jsxRuntimeExports.jsx(SelectContent,{children:jsxRuntimeExports.jsxs(SelectGroup,{children:[jsxRuntimeExports.jsx(SelectItem,{value:"1000",children:"1000"}),jsxRuntimeExports.jsx(SelectItem,{value:"500",children:"500"}),jsxRuntimeExports.jsx(SelectItem,{value:"250",children:"250"}),jsxRuntimeExports.jsx(SelectItem,{value:"100",children:"100"}),jsxRuntimeExports.jsx(SelectItem,{value:"10",children:"10"})]})})]}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(FormField,{control:form.control,name:"level",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{children:"Log Level:"}),jsxRuntimeExports.jsxs(Select,{onValueChange:field.onChange,value:field.value,children:[jsxRuntimeExports.jsx(SelectTrigger,{className:"w-full",children:jsxRuntimeExports.jsx(SelectValue,{placeholder:"Select log level"})}),jsxRuntimeExports.jsx(SelectContent,{children:jsxRuntimeExports.jsxs(SelectGroup,{children:[jsxRuntimeExports.jsx(SelectItem,{value:"undefined",children:"All"}),jsxRuntimeExports.jsx(SelectItem,{value:"notify",children:"Notify"}),jsxRuntimeExports.jsx(SelectItem,{value:"error",children:"Error"}),jsxRuntimeExports.jsx(SelectItem,{value:"warn",children:"Warn"}),jsxRuntimeExports.jsx(SelectItem,{value:"info",children:"Info"}),jsxRuntimeExports.jsx(SelectItem,{value:"debug",children:"Debug"}),jsxRuntimeExports.jsx(SelectItem,{value:"trace",children:"Trace"})]})})]}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(FormField,{control:form.control,name:"from",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{children:"Start Date:"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"datetime-local",value:field.value,onChange:field.onChange})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(FormField,{control:form.control,name:"until",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{children:"End Date:"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"datetime-local",value:field.value,onChange:field.onChange})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between space-x-2 mt-2",children:[jsxRuntimeExports.jsx(Button,{type:"submit",variant:"positiveOutline",className:"grow",children:"Apply Filters"}),jsxRuntimeExports.jsx(Button,{type:"reset",variant:"destructiveOutline",onClick:__name(()=>resetFilters(),"onClick"),children:"Clear Filters"})]})]})})})}__name(LogsFiltersForm,"LogsFiltersForm");const defaultFormValues={limit:"100",level:"undefined",from:"",until:""},columns=[{accessorKey:"level",header:"Status",cell:__name(({row})=>{const{level}=row.original;return jsxRuntimeExports.jsx(Badge,{variant:renderBadgeLogLevelVariant(level),children:capitalizeWords(level)})},"cell")},{accessorKey:"timestamp",header:"Date",cell:__name(({row})=>{const{timestamp}=row.original;return jsxRuntimeExports.jsx("span",{children:new Date(timestamp).toLocaleDateString()})},"cell")},{accessorKey:"time",header:"Time",cell:__name(({row})=>{const{timestamp}=row.original;return jsxRuntimeExports.jsx("span",{children:new Date(timestamp).toLocaleTimeString()})},"cell")},{accessorKey:"thread",header:"Thread"},{accessorKey:"node",header:"Node",cell:__name(({row})=>{const{node:node2}=row.original,variant=memoizeNodeNames(node2);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:node2?jsxRuntimeExports.jsxs(Tooltip,{children:[jsxRuntimeExports.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntimeExports.jsxs(Badge,{variant,children:[node2.split(".")[0],"..."]})}),jsxRuntimeExports.jsx(TooltipContent,{className:"bg-grey-700",arrowClassName:"bg-grey-700 fill-grey-700",children:node2})]}):null})},"cell")},{accessorKey:"tags",header:"Tags"},{accessorKey:"message",header:"Message",cell:__name(({row})=>{const{message}=row.original;return row.getIsSelected(),jsxRuntimeExports.jsx("pre",{children:jsxRuntimeExports.jsx("code",{children:message})})},"cell")}],isValidDateRange=__name((startDate,endDate)=>{if(!startDate&&!endDate||!startDate||!endDate)return!0;const start=new Date(startDate),end=new Date(endDate);return start<=end},"isValidDateRange");function Logs(){const[logFilters,setLogFilters]=reactExports.useState(defaultFormValues),[isViewLogModalOpen,setIsViewLogModalOpen]=reactExports.useState(!1),[selectedLogData,setSelectedLogData]=reactExports.useState(),[isAutoRefreshEnabled,setIsAutoRefreshEnabled]=reactExports.useState(!1),instanceParams=useInstanceClientIdParams(),{data:instanceLogs,isLoading,refetch:refetchReadLogQueryOptions,isFetching:isFetchingInstanceLogs}=useQuery(getReadLogQueryOptions({logFilters,...instanceParams,replicated:instanceParams.entityType==="cluster",isAutoRefreshEnabled})),form=useForm({resolver:a(LogFiltersFormSchema),defaultValues:defaultFormValues,mode:"onChange"}),onRowClick=__name(rowData=>{setSelectedLogData(rowData.original),setIsViewLogModalOpen(!0)},"onRowClick"),submitFilters=__name(async data=>{if(!isValidDateRange(data.from,data.until)){form.setError("from",{type:"onChange",message:"Start date must be before end date"}),form.setError("until",{type:"onChange",message:"End date must be after start date"});return}setLogFilters(data)},"submitFilters"),resetFilters=__name(async()=>{form.reset(),setLogFilters(defaultFormValues)},"resetFilters"),onRefreshClick=useRefreshClick(refetchReadLogQueryOptions);return jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-1 gap-4 text-white md:grid-cols-12",children:[jsxRuntimeExports.jsxs("section",{className:"col-span-1 md:col-span-4 lg:col-span-3 px-2 pt-4 md:pt-12",children:[jsxRuntimeExports.jsx(LogsFiltersForm,{form,resetFilters,submitFilters}),jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between space-x-2 mt-2",children:[jsxRuntimeExports.jsxs(Button,{variant:"defaultOutline",onClick:onRefreshClick,disabled:isFetchingInstanceLogs||isLoading||isAutoRefreshEnabled,className:"grow",children:[jsxRuntimeExports.jsx(RefreshCw,{}),"Refresh"]}),jsxRuntimeExports.jsxs(Toggle,{variant:"outline","aria-label":"Toggle Auto Refresh",onPressedChange:setIsAutoRefreshEnabled,children:[jsxRuntimeExports.jsx(RefreshCw,{}),"Auto Refresh ",isAutoRefreshEnabled?"On":"Off"]})]})]}),jsxRuntimeExports.jsx("section",{className:"col-span-1 md:col-span-8 lg:col-span-9",children:isLoading?jsxRuntimeExports.jsx("div",{children:"Loading..."}):jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(LogsDataTable,{columns,data:instanceLogs||[],onRowClick})})}),jsxRuntimeExports.jsx(ViewLogModal,{isModalOpen:isViewLogModalOpen,setIsModalOpen:setIsViewLogModalOpen,data:selectedLogData})]})}__name(Logs,"Logs");function createLogRouteTree(instanceLayoutRoute){return createRoute({getParentRoute:__name(()=>instanceLayoutRoute,"getParentRoute"),path:"logs",component:Logs})}__name(createLogRouteTree,"createLogRouteTree");function createStatusRouteTree(instanceLayoutRoute){return createRoute({getParentRoute:__name(()=>instanceLayoutRoute,"getParentRoute"),path:"status",component:lazyRouteComponent(async()=>__vitePreload(()=>import("./index-cZbhNKPv.js"),__vite__mapDeps([3,1])),"StatusIndex")})}__name(createStatusRouteTree,"createStatusRouteTree");function createInstanceRouteTree(mode){const instanceLayoutRoute=createInstanceLayoutRoute(mode),children=[createLogRouteTree(instanceLayoutRoute),...createApplicationsRoutes(instanceLayoutRoute),createAPIsRouteTree(instanceLayoutRoute),createStatusRouteTree(instanceLayoutRoute),createConfigRouteTree(instanceLayoutRoute),createBrowseRouteTree(instanceLayoutRoute)];return instanceLayoutRoute.addChildren(children)}__name(createInstanceRouteTree,"createInstanceRouteTree");createRoute({getParentRoute:__name(()=>dashboardLayout,"getParentRoute"),path:"profile",component:lazyRouteComponent(async()=>__vitePreload(()=>import("./index-DP5O80Ld.js"),[]),"ProfileIndex")});const rootRouteTree=rootRoute.addChildren([...localAuthRoutes,dashboardLayout.addChildren([createInstanceRouteTree("local")])]);function useNewRouter({routeTree=rootRouteTree,authentication}){const hashHistory=createHashHistory();return createRouter({routeTree,history:hashHistory,defaultNotFoundComponent:NotFoundComponent,defaultErrorComponent:ErrorComponent,defaultPreload:browserIsTouchBased()?!1:"intent",trailingSlash:"never",defaultPreloadStaleTime:0,scrollRestoration:!0,context:{queryClient,authentication:authentication||{}}})}__name(useNewRouter,"useNewRouter");function AppRouted(){const authentication=useRootAuthenticationContext(),router=useNewRouter({authentication});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(RouterProvider,{router,context:{authentication}}),!1]})}__name(AppRouted,"AppRouted");const Toaster2=__name(({...props})=>jsxRuntimeExports.jsx(Toaster$1,{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"}},...props}),"Toaster");let initialized=!1;function useGTM(){reactExports.useEffect(()=>{initialized||(initialized=!0)},[])}__name(useGTM,"useGTM");var ReactQueryDevtools2=__name(function(){return null},"ReactQueryDevtools2");function App(){return useReo(),useDatadog(),useGTM(),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(QueryClientProvider,{client:queryClient,children:[jsxRuntimeExports.jsx(AppRouted,{}),jsxRuntimeExports.jsx(ReactQueryDevtools2,{buttonPosition:"bottom-right"})]}),jsxRuntimeExports.jsx(Toaster2,{richColors:!0})]})}__name(App,"App");var client={exports:{}},reactDomClient_production={},scheduler={exports:{}},scheduler_production={};var hasRequiredScheduler_production;function requireScheduler_production(){return hasRequiredScheduler_production||(hasRequiredScheduler_production=1,(function(exports$1){function push2(heap,node2){var index2=heap.length;heap.push(node2);a:for(;0<index2;){var parentIndex=index2-1>>>1,parent=heap[parentIndex];if(0<compare(parent,node2))heap[parentIndex]=node2,heap[index2]=parent,index2=parentIndex;else break a}}__name(push2,"push");function peek(heap){return heap.length===0?null:heap[0]}__name(peek,"peek");function pop(heap){if(heap.length===0)return null;var first=heap[0],last2=heap.pop();if(last2!==first){heap[0]=last2;a:for(var index2=0,length=heap.length,halfLength=length>>>1;index2<halfLength;){var leftIndex=2*(index2+1)-1,left=heap[leftIndex],rightIndex=leftIndex+1,right=heap[rightIndex];if(0>compare(left,last2))rightIndex<length&&0>compare(right,left)?(heap[index2]=right,heap[rightIndex]=last2,index2=rightIndex):(heap[index2]=left,heap[leftIndex]=last2,index2=leftIndex);else if(rightIndex<length&&0>compare(right,last2))heap[index2]=right,heap[rightIndex]=last2,index2=rightIndex;else break a}}return first}__name(pop,"pop");function compare(a2,b){var diff=a2.sortIndex-b.sortIndex;return diff!==0?diff:a2.id-b.id}if(__name(compare,"compare"),exports$1.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var localPerformance=performance;exports$1.unstable_now=function(){return localPerformance.now()}}else{var localDate=Date,initialTime=localDate.now();exports$1.unstable_now=function(){return localDate.now()-initialTime}}var taskQueue=[],timerQueue=[],taskIdCounter=1,currentTask=null,currentPriorityLevel=3,isPerformingWork=!1,isHostCallbackScheduled=!1,isHostTimeoutScheduled=!1,needsPaint=!1,localSetTimeout=typeof setTimeout=="function"?setTimeout:null,localClearTimeout=typeof clearTimeout=="function"?clearTimeout:null,localSetImmediate=typeof setImmediate<"u"?setImmediate:null;function advanceTimers(currentTime){for(var timer=peek(timerQueue);timer!==null;){if(timer.callback===null)pop(timerQueue);else if(timer.startTime<=currentTime)pop(timerQueue),timer.sortIndex=timer.expirationTime,push2(taskQueue,timer);else break;timer=peek(timerQueue)}}__name(advanceTimers,"advanceTimers");function handleTimeout(currentTime){if(isHostTimeoutScheduled=!1,advanceTimers(currentTime),!isHostCallbackScheduled)if(peek(taskQueue)!==null)isHostCallbackScheduled=!0,isMessageLoopRunning||(isMessageLoopRunning=!0,schedulePerformWorkUntilDeadline());else{var firstTimer=peek(timerQueue);firstTimer!==null&&requestHostTimeout(handleTimeout,firstTimer.startTime-currentTime)}}__name(handleTimeout,"handleTimeout");var isMessageLoopRunning=!1,taskTimeoutID=-1,frameInterval=5,startTime=-1;function shouldYieldToHost(){return needsPaint?!0:!(exports$1.unstable_now()-startTime<frameInterval)}__name(shouldYieldToHost,"shouldYieldToHost");function performWorkUntilDeadline(){if(needsPaint=!1,isMessageLoopRunning){var currentTime=exports$1.unstable_now();startTime=currentTime;var hasMoreWork=!0;try{a:{isHostCallbackScheduled=!1,isHostTimeoutScheduled&&(isHostTimeoutScheduled=!1,localClearTimeout(taskTimeoutID),taskTimeoutID=-1),isPerformingWork=!0;var previousPriorityLevel=currentPriorityLevel;try{b:{for(advanceTimers(currentTime),currentTask=peek(taskQueue);currentTask!==null&&!(currentTask.expirationTime>currentTime&&shouldYieldToHost());){var callback=currentTask.callback;if(typeof callback=="function"){currentTask.callback=null,currentPriorityLevel=currentTask.priorityLevel;var continuationCallback=callback(currentTask.expirationTime<=currentTime);if(currentTime=exports$1.unstable_now(),typeof continuationCallback=="function"){currentTask.callback=continuationCallback,advanceTimers(currentTime),hasMoreWork=!0;break b}currentTask===peek(taskQueue)&&pop(taskQueue),advanceTimers(currentTime)}else pop(taskQueue);currentTask=peek(taskQueue)}if(currentTask!==null)hasMoreWork=!0;else{var firstTimer=peek(timerQueue);firstTimer!==null&&requestHostTimeout(handleTimeout,firstTimer.startTime-currentTime),hasMoreWork=!1}}break a}finally{currentTask=null,currentPriorityLevel=previousPriorityLevel,isPerformingWork=!1}hasMoreWork=void 0}}finally{hasMoreWork?schedulePerformWorkUntilDeadline():isMessageLoopRunning=!1}}}__name(performWorkUntilDeadline,"performWorkUntilDeadline");var schedulePerformWorkUntilDeadline;if(typeof localSetImmediate=="function")schedulePerformWorkUntilDeadline=__name(function(){localSetImmediate(performWorkUntilDeadline)},"schedulePerformWorkUntilDeadline");else if(typeof MessageChannel<"u"){var channel=new MessageChannel,port=channel.port2;channel.port1.onmessage=performWorkUntilDeadline,schedulePerformWorkUntilDeadline=__name(function(){port.postMessage(null)},"schedulePerformWorkUntilDeadline")}else schedulePerformWorkUntilDeadline=__name(function(){localSetTimeout(performWorkUntilDeadline,0)},"schedulePerformWorkUntilDeadline");function requestHostTimeout(callback,ms2){taskTimeoutID=localSetTimeout(function(){callback(exports$1.unstable_now())},ms2)}__name(requestHostTimeout,"requestHostTimeout"),exports$1.unstable_IdlePriority=5,exports$1.unstable_ImmediatePriority=1,exports$1.unstable_LowPriority=4,exports$1.unstable_NormalPriority=3,exports$1.unstable_Profiling=null,exports$1.unstable_UserBlockingPriority=2,exports$1.unstable_cancelCallback=function(task){task.callback=null},exports$1.unstable_forceFrameRate=function(fps){0>fps||125<fps?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):frameInterval=0<fps?Math.floor(1e3/fps):5},exports$1.unstable_getCurrentPriorityLevel=function(){return currentPriorityLevel},exports$1.unstable_next=function(eventHandler){switch(currentPriorityLevel){case 1:case 2:case 3:var priorityLevel=3;break;default:priorityLevel=currentPriorityLevel}var previousPriorityLevel=currentPriorityLevel;currentPriorityLevel=priorityLevel;try{return eventHandler()}finally{currentPriorityLevel=previousPriorityLevel}},exports$1.unstable_requestPaint=function(){needsPaint=!0},exports$1.unstable_runWithPriority=function(priorityLevel,eventHandler){switch(priorityLevel){case 1:case 2:case 3:case 4:case 5:break;default:priorityLevel=3}var previousPriorityLevel=currentPriorityLevel;currentPriorityLevel=priorityLevel;try{return eventHandler()}finally{currentPriorityLevel=previousPriorityLevel}},exports$1.unstable_scheduleCallback=function(priorityLevel,callback,options){var currentTime=exports$1.unstable_now();switch(typeof options=="object"&&options!==null?(options=options.delay,options=typeof options=="number"&&0<options?currentTime+options:currentTime):options=currentTime,priorityLevel){case 1:var timeout=-1;break;case 2:timeout=250;break;case 5:timeout=1073741823;break;case 4:timeout=1e4;break;default:timeout=5e3}return timeout=options+timeout,priorityLevel={id:taskIdCounter++,callback,priorityLevel,startTime:options,expirationTime:timeout,sortIndex:-1},options>currentTime?(priorityLevel.sortIndex=options,push2(timerQueue,priorityLevel),peek(taskQueue)===null&&priorityLevel===peek(timerQueue)&&(isHostTimeoutScheduled?(localClearTimeout(taskTimeoutID),taskTimeoutID=-1):isHostTimeoutScheduled=!0,requestHostTimeout(handleTimeout,options-currentTime))):(priorityLevel.sortIndex=timeout,push2(taskQueue,priorityLevel),isHostCallbackScheduled||isPerformingWork||(isHostCallbackScheduled=!0,isMessageLoopRunning||(isMessageLoopRunning=!0,schedulePerformWorkUntilDeadline()))),priorityLevel},exports$1.unstable_shouldYield=shouldYieldToHost,exports$1.unstable_wrapCallback=function(callback){var parentPriorityLevel=currentPriorityLevel;return function(){var previousPriorityLevel=currentPriorityLevel;currentPriorityLevel=parentPriorityLevel;try{return callback.apply(this,arguments)}finally{currentPriorityLevel=previousPriorityLevel}}}})(scheduler_production)),scheduler_production}__name(requireScheduler_production,"requireScheduler_production");var hasRequiredScheduler;function requireScheduler(){return hasRequiredScheduler||(hasRequiredScheduler=1,scheduler.exports=requireScheduler_production()),scheduler.exports}__name(requireScheduler,"requireScheduler");var hasRequiredReactDomClient_production;function requireReactDomClient_production(){if(hasRequiredReactDomClient_production)return reactDomClient_production;hasRequiredReactDomClient_production=1;var Scheduler=requireScheduler(),React2=requireReact(),ReactDOM=requireReactDom();function formatProdErrorMessage(code2){var url2="https://react.dev/errors/"+code2;if(1<arguments.length){url2+="?args[]="+encodeURIComponent(arguments[1]);for(var i2=2;i2<arguments.length;i2++)url2+="&args[]="+encodeURIComponent(arguments[i2])}return"Minified React error #"+code2+"; visit "+url2+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}__name(formatProdErrorMessage,"formatProdErrorMessage");function isValidContainer(node2){return!(!node2||node2.nodeType!==1&&node2.nodeType!==9&&node2.nodeType!==11)}__name(isValidContainer,"isValidContainer");function getNearestMountedFiber(fiber){var node2=fiber,nearestMounted=fiber;if(fiber.alternate)for(;node2.return;)node2=node2.return;else{fiber=node2;do node2=fiber,(node2.flags&4098)!==0&&(nearestMounted=node2.return),fiber=node2.return;while(fiber)}return node2.tag===3?nearestMounted:null}__name(getNearestMountedFiber,"getNearestMountedFiber");function getSuspenseInstanceFromFiber(fiber){if(fiber.tag===13){var suspenseState=fiber.memoizedState;if(suspenseState===null&&(fiber=fiber.alternate,fiber!==null&&(suspenseState=fiber.memoizedState)),suspenseState!==null)return suspenseState.dehydrated}return null}__name(getSuspenseInstanceFromFiber,"getSuspenseInstanceFromFiber");function getActivityInstanceFromFiber(fiber){if(fiber.tag===31){var activityState=fiber.memoizedState;if(activityState===null&&(fiber=fiber.alternate,fiber!==null&&(activityState=fiber.memoizedState)),activityState!==null)return activityState.dehydrated}return null}__name(getActivityInstanceFromFiber,"getActivityInstanceFromFiber");function assertIsMounted(fiber){if(getNearestMountedFiber(fiber)!==fiber)throw Error(formatProdErrorMessage(188))}__name(assertIsMounted,"assertIsMounted");function findCurrentFiberUsingSlowPath(fiber){var alternate=fiber.alternate;if(!alternate){if(alternate=getNearestMountedFiber(fiber),alternate===null)throw Error(formatProdErrorMessage(188));return alternate!==fiber?null:fiber}for(var a2=fiber,b=alternate;;){var parentA=a2.return;if(parentA===null)break;var parentB=parentA.alternate;if(parentB===null){if(b=parentA.return,b!==null){a2=b;continue}break}if(parentA.child===parentB.child){for(parentB=parentA.child;parentB;){if(parentB===a2)return assertIsMounted(parentA),fiber;if(parentB===b)return assertIsMounted(parentA),alternate;parentB=parentB.sibling}throw Error(formatProdErrorMessage(188))}if(a2.return!==b.return)a2=parentA,b=parentB;else{for(var didFindChild=!1,child$0=parentA.child;child$0;){if(child$0===a2){didFindChild=!0,a2=parentA,b=parentB;break}if(child$0===b){didFindChild=!0,b=parentA,a2=parentB;break}child$0=child$0.sibling}if(!didFindChild){for(child$0=parentB.child;child$0;){if(child$0===a2){didFindChild=!0,a2=parentB,b=parentA;break}if(child$0===b){didFindChild=!0,b=parentB,a2=parentA;break}child$0=child$0.sibling}if(!didFindChild)throw Error(formatProdErrorMessage(189))}}if(a2.alternate!==b)throw Error(formatProdErrorMessage(190))}if(a2.tag!==3)throw Error(formatProdErrorMessage(188));return a2.stateNode.current===a2?fiber:alternate}__name(findCurrentFiberUsingSlowPath,"findCurrentFiberUsingSlowPath");function findCurrentHostFiberImpl(node2){var tag=node2.tag;if(tag===5||tag===26||tag===27||tag===6)return node2;for(node2=node2.child;node2!==null;){if(tag=findCurrentHostFiberImpl(node2),tag!==null)return tag;node2=node2.sibling}return null}__name(findCurrentHostFiberImpl,"findCurrentHostFiberImpl");var assign=Object.assign,REACT_LEGACY_ELEMENT_TYPE=Symbol.for("react.element"),REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_PORTAL_TYPE=Symbol.for("react.portal"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment"),REACT_STRICT_MODE_TYPE=Symbol.for("react.strict_mode"),REACT_PROFILER_TYPE=Symbol.for("react.profiler"),REACT_CONSUMER_TYPE=Symbol.for("react.consumer"),REACT_CONTEXT_TYPE=Symbol.for("react.context"),REACT_FORWARD_REF_TYPE=Symbol.for("react.forward_ref"),REACT_SUSPENSE_TYPE=Symbol.for("react.suspense"),REACT_SUSPENSE_LIST_TYPE=Symbol.for("react.suspense_list"),REACT_MEMO_TYPE=Symbol.for("react.memo"),REACT_LAZY_TYPE2=Symbol.for("react.lazy"),REACT_ACTIVITY_TYPE=Symbol.for("react.activity"),REACT_MEMO_CACHE_SENTINEL=Symbol.for("react.memo_cache_sentinel"),MAYBE_ITERATOR_SYMBOL=Symbol.iterator;function getIteratorFn(maybeIterable){return maybeIterable===null||typeof maybeIterable!="object"?null:(maybeIterable=MAYBE_ITERATOR_SYMBOL&&maybeIterable[MAYBE_ITERATOR_SYMBOL]||maybeIterable["@@iterator"],typeof maybeIterable=="function"?maybeIterable:null)}__name(getIteratorFn,"getIteratorFn");var REACT_CLIENT_REFERENCE=Symbol.for("react.client.reference");function getComponentNameFromType(type){if(type==null)return null;if(typeof type=="function")return type.$$typeof===REACT_CLIENT_REFERENCE?null:type.displayName||type.name||null;if(typeof type=="string")return type;switch(type){case REACT_FRAGMENT_TYPE:return"Fragment";case REACT_PROFILER_TYPE:return"Profiler";case REACT_STRICT_MODE_TYPE:return"StrictMode";case REACT_SUSPENSE_TYPE:return"Suspense";case REACT_SUSPENSE_LIST_TYPE:return"SuspenseList";case REACT_ACTIVITY_TYPE:return"Activity"}if(typeof type=="object")switch(type.$$typeof){case REACT_PORTAL_TYPE:return"Portal";case REACT_CONTEXT_TYPE:return type.displayName||"Context";case REACT_CONSUMER_TYPE:return(type._context.displayName||"Context")+".Consumer";case REACT_FORWARD_REF_TYPE:var innerType=type.render;return type=type.displayName,type||(type=innerType.displayName||innerType.name||"",type=type!==""?"ForwardRef("+type+")":"ForwardRef"),type;case REACT_MEMO_TYPE:return innerType=type.displayName||null,innerType!==null?innerType:getComponentNameFromType(type.type)||"Memo";case REACT_LAZY_TYPE2:innerType=type._payload,type=type._init;try{return getComponentNameFromType(type(innerType))}catch{}}return null}__name(getComponentNameFromType,"getComponentNameFromType");var isArrayImpl=Array.isArray,ReactSharedInternals=React2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ReactDOMSharedInternals=ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,sharedNotPendingObject={pending:!1,data:null,method:null,action:null},valueStack=[],index2=-1;function createCursor(defaultValue){return{current:defaultValue}}__name(createCursor,"createCursor");function pop(cursor){0>index2||(cursor.current=valueStack[index2],valueStack[index2]=null,index2--)}__name(pop,"pop");function push2(cursor,value){index2++,valueStack[index2]=cursor.current,cursor.current=value}__name(push2,"push");var contextStackCursor=createCursor(null),contextFiberStackCursor=createCursor(null),rootInstanceStackCursor=createCursor(null),hostTransitionProviderCursor=createCursor(null);function pushHostContainer(fiber,nextRootInstance){switch(push2(rootInstanceStackCursor,nextRootInstance),push2(contextFiberStackCursor,fiber),push2(contextStackCursor,null),nextRootInstance.nodeType){case 9:case 11:fiber=(fiber=nextRootInstance.documentElement)&&(fiber=fiber.namespaceURI)?getOwnHostContext(fiber):0;break;default:if(fiber=nextRootInstance.tagName,nextRootInstance=nextRootInstance.namespaceURI)nextRootInstance=getOwnHostContext(nextRootInstance),fiber=getChildHostContextProd(nextRootInstance,fiber);else switch(fiber){case"svg":fiber=1;break;case"math":fiber=2;break;default:fiber=0}}pop(contextStackCursor),push2(contextStackCursor,fiber)}__name(pushHostContainer,"pushHostContainer");function popHostContainer(){pop(contextStackCursor),pop(contextFiberStackCursor),pop(rootInstanceStackCursor)}__name(popHostContainer,"popHostContainer");function pushHostContext(fiber){fiber.memoizedState!==null&&push2(hostTransitionProviderCursor,fiber);var context=contextStackCursor.current,JSCompiler_inline_result=getChildHostContextProd(context,fiber.type);context!==JSCompiler_inline_result&&(push2(contextFiberStackCursor,fiber),push2(contextStackCursor,JSCompiler_inline_result))}__name(pushHostContext,"pushHostContext");function popHostContext(fiber){contextFiberStackCursor.current===fiber&&(pop(contextStackCursor),pop(contextFiberStackCursor)),hostTransitionProviderCursor.current===fiber&&(pop(hostTransitionProviderCursor),HostTransitionContext._currentValue=sharedNotPendingObject)}__name(popHostContext,"popHostContext");var prefix2,suffix;function describeBuiltInComponentFrame(name2){if(prefix2===void 0)try{throw Error()}catch(x){var match=x.stack.trim().match(/\n( *(at )?)/);prefix2=match&&match[1]||"",suffix=-1<x.stack.indexOf(`
|
|
226
|
+
aria-invalid:focus-visible:ring-0`,{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",outline:"border bg-default border-primary border-2 text-white shadow-xs hover:-translate-y-1 transition duration-200 hover:bg-grey-700/40"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});var NAME="Toggle",Toggle$1=reactExports.forwardRef((props,forwardedRef)=>{const{pressed:pressedProp,defaultPressed,onPressedChange,...buttonProps}=props,[pressed,setPressed]=useControllableState({prop:pressedProp,onChange:onPressedChange,defaultProp:defaultPressed??!1,caller:NAME});return jsxRuntimeExports.jsx(Primitive$1.button,{type:"button","aria-pressed":pressed,"data-state":pressed?"on":"off","data-disabled":props.disabled?"":void 0,...buttonProps,ref:forwardedRef,onClick:composeEventHandlers$1(props.onClick,()=>{props.disabled||setPressed(!pressed)})})});Toggle$1.displayName=NAME;var Root=Toggle$1;function Toggle({className,variant,size:size2,...props}){return jsxRuntimeExports.jsx(Root,{"data-slot":"toggle",className:cn$1(toggleVariants({variant,size:size2,className})),...props})}__name(Toggle,"Toggle");function renderBadgeLogLevelVariant(value){switch(value){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 value}}__name(renderBadgeLogLevelVariant,"renderBadgeLogLevelVariant");const nodeVariant=["secondary","default","warning","outline","success","destructive"];let nodeEntries=0;const cache=new Map,memoizeNodeNames=__name(nodeName=>{if(cache.has(nodeName))return cache.get(nodeName);nodeEntries++;const nodeVariantIndex=nodeEntries%nodeVariant.length,memoized=nodeVariant[nodeVariantIndex];return cache.set(nodeName,memoized),memoized},"memoizeNodeNames");function LogsDataTable({columns:columns2,data,onRowClick}){const table2=useReactTable({data,columns:columns2,getCoreRowModel:getCoreRowModel()});return jsxRuntimeExports.jsx("div",{className:"rounded-md bg-black-dark logsTable",children:jsxRuntimeExports.jsxs(Table,{className:"text-xs",children:[jsxRuntimeExports.jsx(TableHeader,{children:table2.getHeaderGroups().map(headerGroup=>jsxRuntimeExports.jsx(TableRow,{className:"border-none",children:headerGroup.headers.map(header=>jsxRuntimeExports.jsx(TableHead,{className:"p-4 max-w-96",children:header.isPlaceholder?null:flexRender(header.column.columnDef.header,header.getContext())},header.id))},headerGroup.id))}),jsxRuntimeExports.jsx(TableBody,{className:"bg-black",children:table2.getRowModel().rows?.length?table2.getRowModel().rows.map(row=>jsxRuntimeExports.jsx(TableRow,{"data-state":row.getIsSelected()&&"selected",className:cn$1("hover:bg-muted/10 data-[state=selected]:bg-muted max-w-full",onRowClick&&"cursor-pointer"),onClick:__name(()=>onRowClick?.(row),"onClick"),children:row.getVisibleCells().map(cell=>jsxRuntimeExports.jsx(TableCell,{className:"p-1",children:flexRender(cell.column.columnDef.cell,cell.getContext())},cell.id))},row.id)):jsxRuntimeExports.jsx(TableRow,{children:jsxRuntimeExports.jsx(TableCell,{colSpan:columns2.length,className:"h-24 text-center",children:"No results."})})})]})})}__name(LogsDataTable,"LogsDataTable");function isJsonString(str){try{JSON.parse(str)}catch{return!1}return!0}__name(isJsonString,"isJsonString");function ViewLogModal({setIsModalOpen,isModalOpen,data}){const variant=data?memoizeNodeNames(data.node):"default";return jsxRuntimeExports.jsx(Dialog,{onOpenChange:setIsModalOpen,open:isModalOpen,children:jsxRuntimeExports.jsxs(DialogContent,{"aria-describedby":void 0,children:[jsxRuntimeExports.jsx(DialogHeader,{children:jsxRuntimeExports.jsx(DialogTitle,{children:"Edit Row"})}),data?jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-3 text-white",children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h3",{className:"inline-block pr-2",children:"Level:"}),jsxRuntimeExports.jsx(Badge,{variant:renderBadgeLogLevelVariant(data.level),children:capitalizeWords(data.level)})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h3",{children:"Timestamp:"}),jsxRuntimeExports.jsx("p",{className:"text-sm",children:data.timestamp})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h3",{children:"Thread:"}),jsxRuntimeExports.jsx("p",{className:"text-sm",children:data.thread})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h3",{children:"Node:"}),jsxRuntimeExports.jsx(Badge,{variant,children:data.node})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h3",{children:"Tags:"}),jsxRuntimeExports.jsx("p",{className:"text-sm",children:data.tags&&data.tags.length>0?jsxRuntimeExports.jsx("span",{children:data.tags}):"N/A"})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h3",{className:"text-lg font-bold",children:"Message"}),jsxRuntimeExports.jsx(Ft,{className:"w-full h-72",language:isJsonString(data.message)?"json":"text",theme:"vs-dark",value:data.message,options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1}})]})]}):jsxRuntimeExports.jsx(Loading,{}),jsxRuntimeExports.jsx(DialogFooter,{children:jsxRuntimeExports.jsxs("div",{className:"flex justify-between w-full",children:[jsxRuntimeExports.jsxs(Button,{type:"button",variant:"destructive",className:"rounded-full",children:[jsxRuntimeExports.jsx(Trash,{})," Delete Row"]}),jsxRuntimeExports.jsxs(Button,{variant:"submit",className:"rounded-full",children:[jsxRuntimeExports.jsx(Save,{})," Save Changes"]})]})})]})})}__name(ViewLogModal,"ViewLogModal");function getReadLogQueryOptions({entityId,instanceClient,logFilters,replicated,isAutoRefreshEnabled}){return{queryKey:[entityId,"read_log",logFilters.limit,logFilters.level,logFilters.from,logFilters.until,replicated],queryFn:__name(async()=>{const{data}=await instanceClient.post("/",{operation:"read_log",start:0,replicated,limit:logFilters.limit?parseInt(logFilters.limit,10):void 0,level:logFilters.level!=="undefined"?logFilters.level:void 0,from:logFilters.from?new Date(logFilters.from).toISOString():void 0,until:logFilters.until?new Date(logFilters.until).toISOString():void 0,order:"desc"});return data},"queryFn"),retry:!1,refetchInterval:isAutoRefreshEnabled?5e3:!1}}__name(getReadLogQueryOptions,"getReadLogQueryOptions");const LogFiltersFormSchema=object({limit:string$3().optional(),level:_enum(["notify","error","warn","info","debug","trace","undefined"]).optional(),from:string$3().or(_undefined()).optional(),until:string$3().or(_undefined()).optional()});function LogsFiltersForm({form,resetFilters,submitFilters}){return jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(Form,{...form,children:jsxRuntimeExports.jsxs("form",{id:"instance-edit-log-filters-form",name:"instance-edit-log-filters-form",onSubmit:form.handleSubmit(submitFilters),className:"flex-col space-y-5",children:[jsxRuntimeExports.jsx(FormField,{control:form.control,name:"limit",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{children:"Log Limit:"}),jsxRuntimeExports.jsxs(Select,{onValueChange:field.onChange,value:field.value,children:[jsxRuntimeExports.jsx(SelectTrigger,{className:"w-full",children:jsxRuntimeExports.jsx(SelectValue,{placeholder:"Select log limit"})}),jsxRuntimeExports.jsx(SelectContent,{children:jsxRuntimeExports.jsxs(SelectGroup,{children:[jsxRuntimeExports.jsx(SelectItem,{value:"1000",children:"1000"}),jsxRuntimeExports.jsx(SelectItem,{value:"500",children:"500"}),jsxRuntimeExports.jsx(SelectItem,{value:"250",children:"250"}),jsxRuntimeExports.jsx(SelectItem,{value:"100",children:"100"}),jsxRuntimeExports.jsx(SelectItem,{value:"10",children:"10"})]})})]}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(FormField,{control:form.control,name:"level",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{children:"Log Level:"}),jsxRuntimeExports.jsxs(Select,{onValueChange:field.onChange,value:field.value,children:[jsxRuntimeExports.jsx(SelectTrigger,{className:"w-full",children:jsxRuntimeExports.jsx(SelectValue,{placeholder:"Select log level"})}),jsxRuntimeExports.jsx(SelectContent,{children:jsxRuntimeExports.jsxs(SelectGroup,{children:[jsxRuntimeExports.jsx(SelectItem,{value:"undefined",children:"All"}),jsxRuntimeExports.jsx(SelectItem,{value:"notify",children:"Notify"}),jsxRuntimeExports.jsx(SelectItem,{value:"error",children:"Error"}),jsxRuntimeExports.jsx(SelectItem,{value:"warn",children:"Warn"}),jsxRuntimeExports.jsx(SelectItem,{value:"info",children:"Info"}),jsxRuntimeExports.jsx(SelectItem,{value:"debug",children:"Debug"}),jsxRuntimeExports.jsx(SelectItem,{value:"trace",children:"Trace"})]})})]}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(FormField,{control:form.control,name:"from",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{children:"Start Date:"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"datetime-local",value:field.value,onChange:field.onChange})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsx(FormField,{control:form.control,name:"until",render:__name(({field})=>jsxRuntimeExports.jsxs(FormItem,{children:[jsxRuntimeExports.jsx(FormLabel,{children:"End Date:"}),jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(Input,{type:"datetime-local",value:field.value,onChange:field.onChange})}),jsxRuntimeExports.jsx(FormMessage,{})]}),"render")}),jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between space-x-2 mt-2",children:[jsxRuntimeExports.jsx(Button,{type:"submit",variant:"positiveOutline",className:"grow",children:"Apply Filters"}),jsxRuntimeExports.jsx(Button,{type:"reset",variant:"destructiveOutline",onClick:__name(()=>resetFilters(),"onClick"),children:"Clear Filters"})]})]})})})}__name(LogsFiltersForm,"LogsFiltersForm");const defaultFormValues={limit:"100",level:"undefined",from:"",until:""},columns=[{accessorKey:"level",header:"Status",cell:__name(({row})=>{const{level}=row.original;return jsxRuntimeExports.jsx(Badge,{variant:renderBadgeLogLevelVariant(level),children:capitalizeWords(level)})},"cell")},{accessorKey:"timestamp",header:"Date",cell:__name(({row})=>{const{timestamp}=row.original;return jsxRuntimeExports.jsx("span",{children:new Date(timestamp).toLocaleDateString()})},"cell")},{accessorKey:"time",header:"Time",cell:__name(({row})=>{const{timestamp}=row.original;return jsxRuntimeExports.jsx("span",{children:new Date(timestamp).toLocaleTimeString()})},"cell")},{accessorKey:"thread",header:"Thread"},{accessorKey:"node",header:"Node",cell:__name(({row})=>{const{node:node2}=row.original,variant=memoizeNodeNames(node2);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:node2?jsxRuntimeExports.jsxs(Tooltip,{children:[jsxRuntimeExports.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntimeExports.jsxs(Badge,{variant,children:[node2.split(".")[0],"..."]})}),jsxRuntimeExports.jsx(TooltipContent,{className:"bg-grey-700",arrowClassName:"bg-grey-700 fill-grey-700",children:node2})]}):null})},"cell")},{accessorKey:"tags",header:"Tags"},{accessorKey:"message",header:"Message",cell:__name(({row})=>{const{message}=row.original;return row.getIsSelected(),jsxRuntimeExports.jsx("pre",{children:jsxRuntimeExports.jsx("code",{children:message})})},"cell")}],isValidDateRange=__name((startDate,endDate)=>{if(!startDate&&!endDate||!startDate||!endDate)return!0;const start=new Date(startDate),end=new Date(endDate);return start<=end},"isValidDateRange");function Logs(){const[logFilters,setLogFilters]=reactExports.useState(defaultFormValues),[isViewLogModalOpen,setIsViewLogModalOpen]=reactExports.useState(!1),[selectedLogData,setSelectedLogData]=reactExports.useState(),[isAutoRefreshEnabled,setIsAutoRefreshEnabled]=reactExports.useState(!1),instanceParams=useInstanceClientIdParams(),{data:instanceLogs,isLoading,refetch:refetchReadLogQueryOptions,isFetching:isFetchingInstanceLogs}=useQuery(getReadLogQueryOptions({logFilters,...instanceParams,replicated:instanceParams.entityType==="cluster",isAutoRefreshEnabled})),form=useForm({resolver:a(LogFiltersFormSchema),defaultValues:defaultFormValues,mode:"onChange"}),onRowClick=__name(rowData=>{setSelectedLogData(rowData.original),setIsViewLogModalOpen(!0)},"onRowClick"),submitFilters=__name(async data=>{if(!isValidDateRange(data.from,data.until)){form.setError("from",{type:"onChange",message:"Start date must be before end date"}),form.setError("until",{type:"onChange",message:"End date must be after start date"});return}setLogFilters(data)},"submitFilters"),resetFilters=__name(async()=>{form.reset(),setLogFilters(defaultFormValues)},"resetFilters"),onRefreshClick=useRefreshClick(refetchReadLogQueryOptions);return jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-1 gap-4 text-white md:grid-cols-12",children:[jsxRuntimeExports.jsxs("section",{className:"col-span-1 md:col-span-4 lg:col-span-3 px-2 pt-4 md:pt-12",children:[jsxRuntimeExports.jsx(LogsFiltersForm,{form,resetFilters,submitFilters}),jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between space-x-2 mt-2",children:[jsxRuntimeExports.jsxs(Button,{variant:"defaultOutline",onClick:onRefreshClick,disabled:isFetchingInstanceLogs||isLoading||isAutoRefreshEnabled,className:"grow",children:[jsxRuntimeExports.jsx(RefreshCw,{}),"Refresh"]}),jsxRuntimeExports.jsxs(Toggle,{variant:"outline","aria-label":"Toggle Auto Refresh",onPressedChange:setIsAutoRefreshEnabled,children:[jsxRuntimeExports.jsx(RefreshCw,{}),"Auto Refresh ",isAutoRefreshEnabled?"On":"Off"]})]})]}),jsxRuntimeExports.jsx("section",{className:"col-span-1 md:col-span-8 lg:col-span-9",children:isLoading?jsxRuntimeExports.jsx("div",{children:"Loading..."}):jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(LogsDataTable,{columns,data:instanceLogs||[],onRowClick})})}),jsxRuntimeExports.jsx(ViewLogModal,{isModalOpen:isViewLogModalOpen,setIsModalOpen:setIsViewLogModalOpen,data:selectedLogData})]})}__name(Logs,"Logs");function createLogRouteTree(instanceLayoutRoute){return createRoute({getParentRoute:__name(()=>instanceLayoutRoute,"getParentRoute"),path:"logs",component:Logs})}__name(createLogRouteTree,"createLogRouteTree");function createStatusRouteTree(instanceLayoutRoute){return createRoute({getParentRoute:__name(()=>instanceLayoutRoute,"getParentRoute"),path:"status",component:lazyRouteComponent(async()=>__vitePreload(()=>import("./index-BlG-cpH9.js"),__vite__mapDeps([3,1])),"StatusIndex")})}__name(createStatusRouteTree,"createStatusRouteTree");function createInstanceRouteTree(mode){const instanceLayoutRoute=createInstanceLayoutRoute(mode),children=[createLogRouteTree(instanceLayoutRoute),...createApplicationsRoutes(instanceLayoutRoute),createAPIsRouteTree(instanceLayoutRoute),createStatusRouteTree(instanceLayoutRoute),createConfigRouteTree(instanceLayoutRoute),createBrowseRouteTree(instanceLayoutRoute)];return instanceLayoutRoute.addChildren(children)}__name(createInstanceRouteTree,"createInstanceRouteTree");createRoute({getParentRoute:__name(()=>dashboardLayout,"getParentRoute"),path:"profile",component:lazyRouteComponent(async()=>__vitePreload(()=>import("./index-DFovvBYL.js"),[]),"ProfileIndex")});const rootRouteTree=rootRoute.addChildren([...localAuthRoutes,dashboardLayout.addChildren([createInstanceRouteTree("local")])]);function useNewRouter({routeTree=rootRouteTree,authentication}){const hashHistory=createHashHistory();return createRouter({routeTree,history:hashHistory,defaultNotFoundComponent:NotFoundComponent,defaultErrorComponent:ErrorComponent,defaultPreload:browserIsTouchBased()?!1:"intent",trailingSlash:"never",defaultPreloadStaleTime:0,scrollRestoration:!0,context:{queryClient,authentication:authentication||{}}})}__name(useNewRouter,"useNewRouter");function AppRouted(){const authentication=useRootAuthenticationContext(),router=useNewRouter({authentication});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(RouterProvider,{router,context:{authentication}}),!1]})}__name(AppRouted,"AppRouted");const Toaster2=__name(({...props})=>jsxRuntimeExports.jsx(Toaster$1,{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"}},...props}),"Toaster");let initialized=!1;function useGTM(){reactExports.useEffect(()=>{initialized||(initialized=!0)},[])}__name(useGTM,"useGTM");var ReactQueryDevtools2=__name(function(){return null},"ReactQueryDevtools2");function App(){return useReo(),useDatadog(),useGTM(),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(QueryClientProvider,{client:queryClient,children:[jsxRuntimeExports.jsx(AppRouted,{}),jsxRuntimeExports.jsx(ReactQueryDevtools2,{buttonPosition:"bottom-right"})]}),jsxRuntimeExports.jsx(Toaster2,{richColors:!0})]})}__name(App,"App");var client={exports:{}},reactDomClient_production={},scheduler={exports:{}},scheduler_production={};var hasRequiredScheduler_production;function requireScheduler_production(){return hasRequiredScheduler_production||(hasRequiredScheduler_production=1,(function(exports$1){function push2(heap,node2){var index2=heap.length;heap.push(node2);a:for(;0<index2;){var parentIndex=index2-1>>>1,parent=heap[parentIndex];if(0<compare(parent,node2))heap[parentIndex]=node2,heap[index2]=parent,index2=parentIndex;else break a}}__name(push2,"push");function peek(heap){return heap.length===0?null:heap[0]}__name(peek,"peek");function pop(heap){if(heap.length===0)return null;var first=heap[0],last2=heap.pop();if(last2!==first){heap[0]=last2;a:for(var index2=0,length=heap.length,halfLength=length>>>1;index2<halfLength;){var leftIndex=2*(index2+1)-1,left=heap[leftIndex],rightIndex=leftIndex+1,right=heap[rightIndex];if(0>compare(left,last2))rightIndex<length&&0>compare(right,left)?(heap[index2]=right,heap[rightIndex]=last2,index2=rightIndex):(heap[index2]=left,heap[leftIndex]=last2,index2=leftIndex);else if(rightIndex<length&&0>compare(right,last2))heap[index2]=right,heap[rightIndex]=last2,index2=rightIndex;else break a}}return first}__name(pop,"pop");function compare(a2,b){var diff=a2.sortIndex-b.sortIndex;return diff!==0?diff:a2.id-b.id}if(__name(compare,"compare"),exports$1.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var localPerformance=performance;exports$1.unstable_now=function(){return localPerformance.now()}}else{var localDate=Date,initialTime=localDate.now();exports$1.unstable_now=function(){return localDate.now()-initialTime}}var taskQueue=[],timerQueue=[],taskIdCounter=1,currentTask=null,currentPriorityLevel=3,isPerformingWork=!1,isHostCallbackScheduled=!1,isHostTimeoutScheduled=!1,needsPaint=!1,localSetTimeout=typeof setTimeout=="function"?setTimeout:null,localClearTimeout=typeof clearTimeout=="function"?clearTimeout:null,localSetImmediate=typeof setImmediate<"u"?setImmediate:null;function advanceTimers(currentTime){for(var timer=peek(timerQueue);timer!==null;){if(timer.callback===null)pop(timerQueue);else if(timer.startTime<=currentTime)pop(timerQueue),timer.sortIndex=timer.expirationTime,push2(taskQueue,timer);else break;timer=peek(timerQueue)}}__name(advanceTimers,"advanceTimers");function handleTimeout(currentTime){if(isHostTimeoutScheduled=!1,advanceTimers(currentTime),!isHostCallbackScheduled)if(peek(taskQueue)!==null)isHostCallbackScheduled=!0,isMessageLoopRunning||(isMessageLoopRunning=!0,schedulePerformWorkUntilDeadline());else{var firstTimer=peek(timerQueue);firstTimer!==null&&requestHostTimeout(handleTimeout,firstTimer.startTime-currentTime)}}__name(handleTimeout,"handleTimeout");var isMessageLoopRunning=!1,taskTimeoutID=-1,frameInterval=5,startTime=-1;function shouldYieldToHost(){return needsPaint?!0:!(exports$1.unstable_now()-startTime<frameInterval)}__name(shouldYieldToHost,"shouldYieldToHost");function performWorkUntilDeadline(){if(needsPaint=!1,isMessageLoopRunning){var currentTime=exports$1.unstable_now();startTime=currentTime;var hasMoreWork=!0;try{a:{isHostCallbackScheduled=!1,isHostTimeoutScheduled&&(isHostTimeoutScheduled=!1,localClearTimeout(taskTimeoutID),taskTimeoutID=-1),isPerformingWork=!0;var previousPriorityLevel=currentPriorityLevel;try{b:{for(advanceTimers(currentTime),currentTask=peek(taskQueue);currentTask!==null&&!(currentTask.expirationTime>currentTime&&shouldYieldToHost());){var callback=currentTask.callback;if(typeof callback=="function"){currentTask.callback=null,currentPriorityLevel=currentTask.priorityLevel;var continuationCallback=callback(currentTask.expirationTime<=currentTime);if(currentTime=exports$1.unstable_now(),typeof continuationCallback=="function"){currentTask.callback=continuationCallback,advanceTimers(currentTime),hasMoreWork=!0;break b}currentTask===peek(taskQueue)&&pop(taskQueue),advanceTimers(currentTime)}else pop(taskQueue);currentTask=peek(taskQueue)}if(currentTask!==null)hasMoreWork=!0;else{var firstTimer=peek(timerQueue);firstTimer!==null&&requestHostTimeout(handleTimeout,firstTimer.startTime-currentTime),hasMoreWork=!1}}break a}finally{currentTask=null,currentPriorityLevel=previousPriorityLevel,isPerformingWork=!1}hasMoreWork=void 0}}finally{hasMoreWork?schedulePerformWorkUntilDeadline():isMessageLoopRunning=!1}}}__name(performWorkUntilDeadline,"performWorkUntilDeadline");var schedulePerformWorkUntilDeadline;if(typeof localSetImmediate=="function")schedulePerformWorkUntilDeadline=__name(function(){localSetImmediate(performWorkUntilDeadline)},"schedulePerformWorkUntilDeadline");else if(typeof MessageChannel<"u"){var channel=new MessageChannel,port=channel.port2;channel.port1.onmessage=performWorkUntilDeadline,schedulePerformWorkUntilDeadline=__name(function(){port.postMessage(null)},"schedulePerformWorkUntilDeadline")}else schedulePerformWorkUntilDeadline=__name(function(){localSetTimeout(performWorkUntilDeadline,0)},"schedulePerformWorkUntilDeadline");function requestHostTimeout(callback,ms2){taskTimeoutID=localSetTimeout(function(){callback(exports$1.unstable_now())},ms2)}__name(requestHostTimeout,"requestHostTimeout"),exports$1.unstable_IdlePriority=5,exports$1.unstable_ImmediatePriority=1,exports$1.unstable_LowPriority=4,exports$1.unstable_NormalPriority=3,exports$1.unstable_Profiling=null,exports$1.unstable_UserBlockingPriority=2,exports$1.unstable_cancelCallback=function(task){task.callback=null},exports$1.unstable_forceFrameRate=function(fps){0>fps||125<fps?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):frameInterval=0<fps?Math.floor(1e3/fps):5},exports$1.unstable_getCurrentPriorityLevel=function(){return currentPriorityLevel},exports$1.unstable_next=function(eventHandler){switch(currentPriorityLevel){case 1:case 2:case 3:var priorityLevel=3;break;default:priorityLevel=currentPriorityLevel}var previousPriorityLevel=currentPriorityLevel;currentPriorityLevel=priorityLevel;try{return eventHandler()}finally{currentPriorityLevel=previousPriorityLevel}},exports$1.unstable_requestPaint=function(){needsPaint=!0},exports$1.unstable_runWithPriority=function(priorityLevel,eventHandler){switch(priorityLevel){case 1:case 2:case 3:case 4:case 5:break;default:priorityLevel=3}var previousPriorityLevel=currentPriorityLevel;currentPriorityLevel=priorityLevel;try{return eventHandler()}finally{currentPriorityLevel=previousPriorityLevel}},exports$1.unstable_scheduleCallback=function(priorityLevel,callback,options){var currentTime=exports$1.unstable_now();switch(typeof options=="object"&&options!==null?(options=options.delay,options=typeof options=="number"&&0<options?currentTime+options:currentTime):options=currentTime,priorityLevel){case 1:var timeout=-1;break;case 2:timeout=250;break;case 5:timeout=1073741823;break;case 4:timeout=1e4;break;default:timeout=5e3}return timeout=options+timeout,priorityLevel={id:taskIdCounter++,callback,priorityLevel,startTime:options,expirationTime:timeout,sortIndex:-1},options>currentTime?(priorityLevel.sortIndex=options,push2(timerQueue,priorityLevel),peek(taskQueue)===null&&priorityLevel===peek(timerQueue)&&(isHostTimeoutScheduled?(localClearTimeout(taskTimeoutID),taskTimeoutID=-1):isHostTimeoutScheduled=!0,requestHostTimeout(handleTimeout,options-currentTime))):(priorityLevel.sortIndex=timeout,push2(taskQueue,priorityLevel),isHostCallbackScheduled||isPerformingWork||(isHostCallbackScheduled=!0,isMessageLoopRunning||(isMessageLoopRunning=!0,schedulePerformWorkUntilDeadline()))),priorityLevel},exports$1.unstable_shouldYield=shouldYieldToHost,exports$1.unstable_wrapCallback=function(callback){var parentPriorityLevel=currentPriorityLevel;return function(){var previousPriorityLevel=currentPriorityLevel;currentPriorityLevel=parentPriorityLevel;try{return callback.apply(this,arguments)}finally{currentPriorityLevel=previousPriorityLevel}}}})(scheduler_production)),scheduler_production}__name(requireScheduler_production,"requireScheduler_production");var hasRequiredScheduler;function requireScheduler(){return hasRequiredScheduler||(hasRequiredScheduler=1,scheduler.exports=requireScheduler_production()),scheduler.exports}__name(requireScheduler,"requireScheduler");var hasRequiredReactDomClient_production;function requireReactDomClient_production(){if(hasRequiredReactDomClient_production)return reactDomClient_production;hasRequiredReactDomClient_production=1;var Scheduler=requireScheduler(),React2=requireReact(),ReactDOM=requireReactDom();function formatProdErrorMessage(code2){var url2="https://react.dev/errors/"+code2;if(1<arguments.length){url2+="?args[]="+encodeURIComponent(arguments[1]);for(var i2=2;i2<arguments.length;i2++)url2+="&args[]="+encodeURIComponent(arguments[i2])}return"Minified React error #"+code2+"; visit "+url2+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}__name(formatProdErrorMessage,"formatProdErrorMessage");function isValidContainer(node2){return!(!node2||node2.nodeType!==1&&node2.nodeType!==9&&node2.nodeType!==11)}__name(isValidContainer,"isValidContainer");function getNearestMountedFiber(fiber){var node2=fiber,nearestMounted=fiber;if(fiber.alternate)for(;node2.return;)node2=node2.return;else{fiber=node2;do node2=fiber,(node2.flags&4098)!==0&&(nearestMounted=node2.return),fiber=node2.return;while(fiber)}return node2.tag===3?nearestMounted:null}__name(getNearestMountedFiber,"getNearestMountedFiber");function getSuspenseInstanceFromFiber(fiber){if(fiber.tag===13){var suspenseState=fiber.memoizedState;if(suspenseState===null&&(fiber=fiber.alternate,fiber!==null&&(suspenseState=fiber.memoizedState)),suspenseState!==null)return suspenseState.dehydrated}return null}__name(getSuspenseInstanceFromFiber,"getSuspenseInstanceFromFiber");function getActivityInstanceFromFiber(fiber){if(fiber.tag===31){var activityState=fiber.memoizedState;if(activityState===null&&(fiber=fiber.alternate,fiber!==null&&(activityState=fiber.memoizedState)),activityState!==null)return activityState.dehydrated}return null}__name(getActivityInstanceFromFiber,"getActivityInstanceFromFiber");function assertIsMounted(fiber){if(getNearestMountedFiber(fiber)!==fiber)throw Error(formatProdErrorMessage(188))}__name(assertIsMounted,"assertIsMounted");function findCurrentFiberUsingSlowPath(fiber){var alternate=fiber.alternate;if(!alternate){if(alternate=getNearestMountedFiber(fiber),alternate===null)throw Error(formatProdErrorMessage(188));return alternate!==fiber?null:fiber}for(var a2=fiber,b=alternate;;){var parentA=a2.return;if(parentA===null)break;var parentB=parentA.alternate;if(parentB===null){if(b=parentA.return,b!==null){a2=b;continue}break}if(parentA.child===parentB.child){for(parentB=parentA.child;parentB;){if(parentB===a2)return assertIsMounted(parentA),fiber;if(parentB===b)return assertIsMounted(parentA),alternate;parentB=parentB.sibling}throw Error(formatProdErrorMessage(188))}if(a2.return!==b.return)a2=parentA,b=parentB;else{for(var didFindChild=!1,child$0=parentA.child;child$0;){if(child$0===a2){didFindChild=!0,a2=parentA,b=parentB;break}if(child$0===b){didFindChild=!0,b=parentA,a2=parentB;break}child$0=child$0.sibling}if(!didFindChild){for(child$0=parentB.child;child$0;){if(child$0===a2){didFindChild=!0,a2=parentB,b=parentA;break}if(child$0===b){didFindChild=!0,b=parentB,a2=parentA;break}child$0=child$0.sibling}if(!didFindChild)throw Error(formatProdErrorMessage(189))}}if(a2.alternate!==b)throw Error(formatProdErrorMessage(190))}if(a2.tag!==3)throw Error(formatProdErrorMessage(188));return a2.stateNode.current===a2?fiber:alternate}__name(findCurrentFiberUsingSlowPath,"findCurrentFiberUsingSlowPath");function findCurrentHostFiberImpl(node2){var tag=node2.tag;if(tag===5||tag===26||tag===27||tag===6)return node2;for(node2=node2.child;node2!==null;){if(tag=findCurrentHostFiberImpl(node2),tag!==null)return tag;node2=node2.sibling}return null}__name(findCurrentHostFiberImpl,"findCurrentHostFiberImpl");var assign=Object.assign,REACT_LEGACY_ELEMENT_TYPE=Symbol.for("react.element"),REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_PORTAL_TYPE=Symbol.for("react.portal"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment"),REACT_STRICT_MODE_TYPE=Symbol.for("react.strict_mode"),REACT_PROFILER_TYPE=Symbol.for("react.profiler"),REACT_CONSUMER_TYPE=Symbol.for("react.consumer"),REACT_CONTEXT_TYPE=Symbol.for("react.context"),REACT_FORWARD_REF_TYPE=Symbol.for("react.forward_ref"),REACT_SUSPENSE_TYPE=Symbol.for("react.suspense"),REACT_SUSPENSE_LIST_TYPE=Symbol.for("react.suspense_list"),REACT_MEMO_TYPE=Symbol.for("react.memo"),REACT_LAZY_TYPE2=Symbol.for("react.lazy"),REACT_ACTIVITY_TYPE=Symbol.for("react.activity"),REACT_MEMO_CACHE_SENTINEL=Symbol.for("react.memo_cache_sentinel"),MAYBE_ITERATOR_SYMBOL=Symbol.iterator;function getIteratorFn(maybeIterable){return maybeIterable===null||typeof maybeIterable!="object"?null:(maybeIterable=MAYBE_ITERATOR_SYMBOL&&maybeIterable[MAYBE_ITERATOR_SYMBOL]||maybeIterable["@@iterator"],typeof maybeIterable=="function"?maybeIterable:null)}__name(getIteratorFn,"getIteratorFn");var REACT_CLIENT_REFERENCE=Symbol.for("react.client.reference");function getComponentNameFromType(type){if(type==null)return null;if(typeof type=="function")return type.$$typeof===REACT_CLIENT_REFERENCE?null:type.displayName||type.name||null;if(typeof type=="string")return type;switch(type){case REACT_FRAGMENT_TYPE:return"Fragment";case REACT_PROFILER_TYPE:return"Profiler";case REACT_STRICT_MODE_TYPE:return"StrictMode";case REACT_SUSPENSE_TYPE:return"Suspense";case REACT_SUSPENSE_LIST_TYPE:return"SuspenseList";case REACT_ACTIVITY_TYPE:return"Activity"}if(typeof type=="object")switch(type.$$typeof){case REACT_PORTAL_TYPE:return"Portal";case REACT_CONTEXT_TYPE:return type.displayName||"Context";case REACT_CONSUMER_TYPE:return(type._context.displayName||"Context")+".Consumer";case REACT_FORWARD_REF_TYPE:var innerType=type.render;return type=type.displayName,type||(type=innerType.displayName||innerType.name||"",type=type!==""?"ForwardRef("+type+")":"ForwardRef"),type;case REACT_MEMO_TYPE:return innerType=type.displayName||null,innerType!==null?innerType:getComponentNameFromType(type.type)||"Memo";case REACT_LAZY_TYPE2:innerType=type._payload,type=type._init;try{return getComponentNameFromType(type(innerType))}catch{}}return null}__name(getComponentNameFromType,"getComponentNameFromType");var isArrayImpl=Array.isArray,ReactSharedInternals=React2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ReactDOMSharedInternals=ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,sharedNotPendingObject={pending:!1,data:null,method:null,action:null},valueStack=[],index2=-1;function createCursor(defaultValue){return{current:defaultValue}}__name(createCursor,"createCursor");function pop(cursor){0>index2||(cursor.current=valueStack[index2],valueStack[index2]=null,index2--)}__name(pop,"pop");function push2(cursor,value){index2++,valueStack[index2]=cursor.current,cursor.current=value}__name(push2,"push");var contextStackCursor=createCursor(null),contextFiberStackCursor=createCursor(null),rootInstanceStackCursor=createCursor(null),hostTransitionProviderCursor=createCursor(null);function pushHostContainer(fiber,nextRootInstance){switch(push2(rootInstanceStackCursor,nextRootInstance),push2(contextFiberStackCursor,fiber),push2(contextStackCursor,null),nextRootInstance.nodeType){case 9:case 11:fiber=(fiber=nextRootInstance.documentElement)&&(fiber=fiber.namespaceURI)?getOwnHostContext(fiber):0;break;default:if(fiber=nextRootInstance.tagName,nextRootInstance=nextRootInstance.namespaceURI)nextRootInstance=getOwnHostContext(nextRootInstance),fiber=getChildHostContextProd(nextRootInstance,fiber);else switch(fiber){case"svg":fiber=1;break;case"math":fiber=2;break;default:fiber=0}}pop(contextStackCursor),push2(contextStackCursor,fiber)}__name(pushHostContainer,"pushHostContainer");function popHostContainer(){pop(contextStackCursor),pop(contextFiberStackCursor),pop(rootInstanceStackCursor)}__name(popHostContainer,"popHostContainer");function pushHostContext(fiber){fiber.memoizedState!==null&&push2(hostTransitionProviderCursor,fiber);var context=contextStackCursor.current,JSCompiler_inline_result=getChildHostContextProd(context,fiber.type);context!==JSCompiler_inline_result&&(push2(contextFiberStackCursor,fiber),push2(contextStackCursor,JSCompiler_inline_result))}__name(pushHostContext,"pushHostContext");function popHostContext(fiber){contextFiberStackCursor.current===fiber&&(pop(contextStackCursor),pop(contextFiberStackCursor)),hostTransitionProviderCursor.current===fiber&&(pop(hostTransitionProviderCursor),HostTransitionContext._currentValue=sharedNotPendingObject)}__name(popHostContext,"popHostContext");var prefix2,suffix;function describeBuiltInComponentFrame(name2){if(prefix2===void 0)try{throw Error()}catch(x){var match=x.stack.trim().match(/\n( *(at )?)/);prefix2=match&&match[1]||"",suffix=-1<x.stack.indexOf(`
|
|
227
227
|
at`)?" (<anonymous>)":-1<x.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
228
228
|
`+prefix2+name2+suffix}__name(describeBuiltInComponentFrame,"describeBuiltInComponentFrame");var reentry=!1;function describeNativeComponentFrame(fn,construct){if(!fn||reentry)return"";reentry=!0;var previousPrepareStackTrace=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var RunInRootFrame={DetermineComponentFrameRoot:__name(function(){try{if(construct){var Fake=__name(function(){throw Error()},"Fake");if(Object.defineProperty(Fake.prototype,"props",{set:__name(function(){throw Error()},"set")}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Fake,[])}catch(x){var control=x}Reflect.construct(fn,[],Fake)}else{try{Fake.call()}catch(x$1){control=x$1}fn.call(Fake.prototype)}}else{try{throw Error()}catch(x$2){control=x$2}(Fake=fn())&&typeof Fake.catch=="function"&&Fake.catch(function(){})}}catch(sample){if(sample&&control&&typeof sample.stack=="string")return[sample.stack,control.stack]}return[null,null]},"DetermineComponentFrameRoot")};RunInRootFrame.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var namePropDescriptor=Object.getOwnPropertyDescriptor(RunInRootFrame.DetermineComponentFrameRoot,"name");namePropDescriptor&&namePropDescriptor.configurable&&Object.defineProperty(RunInRootFrame.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _RunInRootFrame$Deter=RunInRootFrame.DetermineComponentFrameRoot(),sampleStack=_RunInRootFrame$Deter[0],controlStack=_RunInRootFrame$Deter[1];if(sampleStack&&controlStack){var sampleLines=sampleStack.split(`
|
|
229
229
|
`),controlLines=controlStack.split(`
|
|
@@ -232,4 +232,4 @@ type ${formData.tableName} @table${joinedTableParams}${maybeExport}${maybeSealed
|
|
|
232
232
|
Error generating stack: `+x.message+`
|
|
233
233
|
`+x.stack}}__name(getStackByFiberInDevAndProd,"getStackByFiberInDevAndProd");var hasOwnProperty2=Object.prototype.hasOwnProperty,scheduleCallback$3=Scheduler.unstable_scheduleCallback,cancelCallback$1=Scheduler.unstable_cancelCallback,shouldYield=Scheduler.unstable_shouldYield,requestPaint=Scheduler.unstable_requestPaint,now=Scheduler.unstable_now,getCurrentPriorityLevel=Scheduler.unstable_getCurrentPriorityLevel,ImmediatePriority=Scheduler.unstable_ImmediatePriority,UserBlockingPriority=Scheduler.unstable_UserBlockingPriority,NormalPriority$1=Scheduler.unstable_NormalPriority,LowPriority=Scheduler.unstable_LowPriority,IdlePriority=Scheduler.unstable_IdlePriority,log$1=Scheduler.log,unstable_setDisableYieldValue=Scheduler.unstable_setDisableYieldValue,rendererID=null,injectedHook=null;function setIsStrictModeForDevtools(newIsStrictMode){if(typeof log$1=="function"&&unstable_setDisableYieldValue(newIsStrictMode),injectedHook&&typeof injectedHook.setStrictMode=="function")try{injectedHook.setStrictMode(rendererID,newIsStrictMode)}catch{}}__name(setIsStrictModeForDevtools,"setIsStrictModeForDevtools");var clz32=Math.clz32?Math.clz32:clz32Fallback,log=Math.log,LN2=Math.LN2;function clz32Fallback(x){return x>>>=0,x===0?32:31-(log(x)/LN2|0)|0}__name(clz32Fallback,"clz32Fallback");var nextTransitionUpdateLane=256,nextTransitionDeferredLane=262144,nextRetryLane=4194304;function getHighestPriorityLanes(lanes){var pendingSyncLanes=lanes&42;if(pendingSyncLanes!==0)return pendingSyncLanes;switch(lanes&-lanes){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return lanes&261888;case 262144:case 524288:case 1048576:case 2097152:return lanes&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return lanes&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return lanes}}__name(getHighestPriorityLanes,"getHighestPriorityLanes");function getNextLanes(root3,wipLanes,rootHasPendingCommit){var pendingLanes=root3.pendingLanes;if(pendingLanes===0)return 0;var nextLanes=0,suspendedLanes=root3.suspendedLanes,pingedLanes=root3.pingedLanes;root3=root3.warmLanes;var nonIdlePendingLanes=pendingLanes&134217727;return nonIdlePendingLanes!==0?(pendingLanes=nonIdlePendingLanes&~suspendedLanes,pendingLanes!==0?nextLanes=getHighestPriorityLanes(pendingLanes):(pingedLanes&=nonIdlePendingLanes,pingedLanes!==0?nextLanes=getHighestPriorityLanes(pingedLanes):rootHasPendingCommit||(rootHasPendingCommit=nonIdlePendingLanes&~root3,rootHasPendingCommit!==0&&(nextLanes=getHighestPriorityLanes(rootHasPendingCommit))))):(nonIdlePendingLanes=pendingLanes&~suspendedLanes,nonIdlePendingLanes!==0?nextLanes=getHighestPriorityLanes(nonIdlePendingLanes):pingedLanes!==0?nextLanes=getHighestPriorityLanes(pingedLanes):rootHasPendingCommit||(rootHasPendingCommit=pendingLanes&~root3,rootHasPendingCommit!==0&&(nextLanes=getHighestPriorityLanes(rootHasPendingCommit)))),nextLanes===0?0:wipLanes!==0&&wipLanes!==nextLanes&&(wipLanes&suspendedLanes)===0&&(suspendedLanes=nextLanes&-nextLanes,rootHasPendingCommit=wipLanes&-wipLanes,suspendedLanes>=rootHasPendingCommit||suspendedLanes===32&&(rootHasPendingCommit&4194048)!==0)?wipLanes:nextLanes}__name(getNextLanes,"getNextLanes");function checkIfRootIsPrerendering(root3,renderLanes2){return(root3.pendingLanes&~(root3.suspendedLanes&~root3.pingedLanes)&renderLanes2)===0}__name(checkIfRootIsPrerendering,"checkIfRootIsPrerendering");function computeExpirationTime(lane,currentTime){switch(lane){case 1:case 2:case 4:case 8:case 64:return currentTime+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return currentTime+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}__name(computeExpirationTime,"computeExpirationTime");function claimNextRetryLane(){var lane=nextRetryLane;return nextRetryLane<<=1,(nextRetryLane&62914560)===0&&(nextRetryLane=4194304),lane}__name(claimNextRetryLane,"claimNextRetryLane");function createLaneMap(initial){for(var laneMap=[],i2=0;31>i2;i2++)laneMap.push(initial);return laneMap}__name(createLaneMap,"createLaneMap");function markRootUpdated$1(root3,updateLane){root3.pendingLanes|=updateLane,updateLane!==268435456&&(root3.suspendedLanes=0,root3.pingedLanes=0,root3.warmLanes=0)}__name(markRootUpdated$1,"markRootUpdated$1");function markRootFinished(root3,finishedLanes,remainingLanes,spawnedLane,updatedLanes,suspendedRetryLanes){var previouslyPendingLanes=root3.pendingLanes;root3.pendingLanes=remainingLanes,root3.suspendedLanes=0,root3.pingedLanes=0,root3.warmLanes=0,root3.expiredLanes&=remainingLanes,root3.entangledLanes&=remainingLanes,root3.errorRecoveryDisabledLanes&=remainingLanes,root3.shellSuspendCounter=0;var entanglements=root3.entanglements,expirationTimes=root3.expirationTimes,hiddenUpdates=root3.hiddenUpdates;for(remainingLanes=previouslyPendingLanes&~remainingLanes;0<remainingLanes;){var index$7=31-clz32(remainingLanes),lane=1<<index$7;entanglements[index$7]=0,expirationTimes[index$7]=-1;var hiddenUpdatesForLane=hiddenUpdates[index$7];if(hiddenUpdatesForLane!==null)for(hiddenUpdates[index$7]=null,index$7=0;index$7<hiddenUpdatesForLane.length;index$7++){var update=hiddenUpdatesForLane[index$7];update!==null&&(update.lane&=-536870913)}remainingLanes&=~lane}spawnedLane!==0&&markSpawnedDeferredLane(root3,spawnedLane,0),suspendedRetryLanes!==0&&updatedLanes===0&&root3.tag!==0&&(root3.suspendedLanes|=suspendedRetryLanes&~(previouslyPendingLanes&~finishedLanes))}__name(markRootFinished,"markRootFinished");function markSpawnedDeferredLane(root3,spawnedLane,entangledLanes){root3.pendingLanes|=spawnedLane,root3.suspendedLanes&=~spawnedLane;var spawnedLaneIndex=31-clz32(spawnedLane);root3.entangledLanes|=spawnedLane,root3.entanglements[spawnedLaneIndex]=root3.entanglements[spawnedLaneIndex]|1073741824|entangledLanes&261930}__name(markSpawnedDeferredLane,"markSpawnedDeferredLane");function markRootEntangled(root3,entangledLanes){var rootEntangledLanes=root3.entangledLanes|=entangledLanes;for(root3=root3.entanglements;rootEntangledLanes;){var index$8=31-clz32(rootEntangledLanes),lane=1<<index$8;lane&entangledLanes|root3[index$8]&entangledLanes&&(root3[index$8]|=entangledLanes),rootEntangledLanes&=~lane}}__name(markRootEntangled,"markRootEntangled");function getBumpedLaneForHydration(root3,renderLanes2){var renderLane=renderLanes2&-renderLanes2;return renderLane=(renderLane&42)!==0?1:getBumpedLaneForHydrationByLane(renderLane),(renderLane&(root3.suspendedLanes|renderLanes2))!==0?0:renderLane}__name(getBumpedLaneForHydration,"getBumpedLaneForHydration");function getBumpedLaneForHydrationByLane(lane){switch(lane){case 2:lane=1;break;case 8:lane=4;break;case 32:lane=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:lane=128;break;case 268435456:lane=134217728;break;default:lane=0}return lane}__name(getBumpedLaneForHydrationByLane,"getBumpedLaneForHydrationByLane");function lanesToEventPriority(lanes){return lanes&=-lanes,2<lanes?8<lanes?(lanes&134217727)!==0?32:268435456:8:2}__name(lanesToEventPriority,"lanesToEventPriority");function resolveUpdatePriority(){var updatePriority=ReactDOMSharedInternals.p;return updatePriority!==0?updatePriority:(updatePriority=window.event,updatePriority===void 0?32:getEventPriority(updatePriority.type))}__name(resolveUpdatePriority,"resolveUpdatePriority");function runWithPriority(priority,fn){var previousPriority=ReactDOMSharedInternals.p;try{return ReactDOMSharedInternals.p=priority,fn()}finally{ReactDOMSharedInternals.p=previousPriority}}__name(runWithPriority,"runWithPriority");var randomKey=Math.random().toString(36).slice(2),internalInstanceKey="__reactFiber$"+randomKey,internalPropsKey="__reactProps$"+randomKey,internalContainerInstanceKey="__reactContainer$"+randomKey,internalEventHandlersKey="__reactEvents$"+randomKey,internalEventHandlerListenersKey="__reactListeners$"+randomKey,internalEventHandlesSetKey="__reactHandles$"+randomKey,internalRootNodeResourcesKey="__reactResources$"+randomKey,internalHoistableMarker="__reactMarker$"+randomKey;function detachDeletedInstance(node2){delete node2[internalInstanceKey],delete node2[internalPropsKey],delete node2[internalEventHandlersKey],delete node2[internalEventHandlerListenersKey],delete node2[internalEventHandlesSetKey]}__name(detachDeletedInstance,"detachDeletedInstance");function getClosestInstanceFromNode(targetNode){var targetInst=targetNode[internalInstanceKey];if(targetInst)return targetInst;for(var parentNode=targetNode.parentNode;parentNode;){if(targetInst=parentNode[internalContainerInstanceKey]||parentNode[internalInstanceKey]){if(parentNode=targetInst.alternate,targetInst.child!==null||parentNode!==null&&parentNode.child!==null)for(targetNode=getParentHydrationBoundary(targetNode);targetNode!==null;){if(parentNode=targetNode[internalInstanceKey])return parentNode;targetNode=getParentHydrationBoundary(targetNode)}return targetInst}targetNode=parentNode,parentNode=targetNode.parentNode}return null}__name(getClosestInstanceFromNode,"getClosestInstanceFromNode");function getInstanceFromNode(node2){if(node2=node2[internalInstanceKey]||node2[internalContainerInstanceKey]){var tag=node2.tag;if(tag===5||tag===6||tag===13||tag===31||tag===26||tag===27||tag===3)return node2}return null}__name(getInstanceFromNode,"getInstanceFromNode");function getNodeFromInstance(inst){var tag=inst.tag;if(tag===5||tag===26||tag===27||tag===6)return inst.stateNode;throw Error(formatProdErrorMessage(33))}__name(getNodeFromInstance,"getNodeFromInstance");function getResourcesFromRoot(root3){var resources=root3[internalRootNodeResourcesKey];return resources||(resources=root3[internalRootNodeResourcesKey]={hoistableStyles:new Map,hoistableScripts:new Map}),resources}__name(getResourcesFromRoot,"getResourcesFromRoot");function markNodeAsHoistable(node2){node2[internalHoistableMarker]=!0}__name(markNodeAsHoistable,"markNodeAsHoistable");var allNativeEvents=new Set,registrationNameDependencies={};function registerTwoPhaseEvent(registrationName,dependencies){registerDirectEvent(registrationName,dependencies),registerDirectEvent(registrationName+"Capture",dependencies)}__name(registerTwoPhaseEvent,"registerTwoPhaseEvent");function registerDirectEvent(registrationName,dependencies){for(registrationNameDependencies[registrationName]=dependencies,registrationName=0;registrationName<dependencies.length;registrationName++)allNativeEvents.add(dependencies[registrationName])}__name(registerDirectEvent,"registerDirectEvent");var VALID_ATTRIBUTE_NAME_REGEX=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),illegalAttributeNameCache={},validatedAttributeNameCache={};function isAttributeNameSafe(attributeName){return hasOwnProperty2.call(validatedAttributeNameCache,attributeName)?!0:hasOwnProperty2.call(illegalAttributeNameCache,attributeName)?!1:VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)?validatedAttributeNameCache[attributeName]=!0:(illegalAttributeNameCache[attributeName]=!0,!1)}__name(isAttributeNameSafe,"isAttributeNameSafe");function setValueForAttribute(node2,name2,value){if(isAttributeNameSafe(name2))if(value===null)node2.removeAttribute(name2);else{switch(typeof value){case"undefined":case"function":case"symbol":node2.removeAttribute(name2);return;case"boolean":var prefix$10=name2.toLowerCase().slice(0,5);if(prefix$10!=="data-"&&prefix$10!=="aria-"){node2.removeAttribute(name2);return}}node2.setAttribute(name2,""+value)}}__name(setValueForAttribute,"setValueForAttribute");function setValueForKnownAttribute(node2,name2,value){if(value===null)node2.removeAttribute(name2);else{switch(typeof value){case"undefined":case"function":case"symbol":case"boolean":node2.removeAttribute(name2);return}node2.setAttribute(name2,""+value)}}__name(setValueForKnownAttribute,"setValueForKnownAttribute");function setValueForNamespacedAttribute(node2,namespace,name2,value){if(value===null)node2.removeAttribute(name2);else{switch(typeof value){case"undefined":case"function":case"symbol":case"boolean":node2.removeAttribute(name2);return}node2.setAttributeNS(namespace,name2,""+value)}}__name(setValueForNamespacedAttribute,"setValueForNamespacedAttribute");function getToStringValue(value){switch(typeof value){case"bigint":case"boolean":case"number":case"string":case"undefined":return value;case"object":return value;default:return""}}__name(getToStringValue,"getToStringValue");function isCheckable(elem){var type=elem.type;return(elem=elem.nodeName)&&elem.toLowerCase()==="input"&&(type==="checkbox"||type==="radio")}__name(isCheckable,"isCheckable");function trackValueOnNode(node2,valueField,currentValue){var descriptor=Object.getOwnPropertyDescriptor(node2.constructor.prototype,valueField);if(!node2.hasOwnProperty(valueField)&&typeof descriptor<"u"&&typeof descriptor.get=="function"&&typeof descriptor.set=="function"){var get2=descriptor.get,set2=descriptor.set;return Object.defineProperty(node2,valueField,{configurable:!0,get:__name(function(){return get2.call(this)},"get"),set:__name(function(value){currentValue=""+value,set2.call(this,value)},"set")}),Object.defineProperty(node2,valueField,{enumerable:descriptor.enumerable}),{getValue:__name(function(){return currentValue},"getValue"),setValue:__name(function(value){currentValue=""+value},"setValue"),stopTracking:__name(function(){node2._valueTracker=null,delete node2[valueField]},"stopTracking")}}}__name(trackValueOnNode,"trackValueOnNode");function track(node2){if(!node2._valueTracker){var valueField=isCheckable(node2)?"checked":"value";node2._valueTracker=trackValueOnNode(node2,valueField,""+node2[valueField])}}__name(track,"track");function updateValueIfChanged(node2){if(!node2)return!1;var tracker=node2._valueTracker;if(!tracker)return!0;var lastValue=tracker.getValue(),value="";return node2&&(value=isCheckable(node2)?node2.checked?"true":"false":node2.value),node2=value,node2!==lastValue?(tracker.setValue(node2),!0):!1}__name(updateValueIfChanged,"updateValueIfChanged");function getActiveElement(doc){if(doc=doc||(typeof document<"u"?document:void 0),typeof doc>"u")return null;try{return doc.activeElement||doc.body}catch{return doc.body}}__name(getActiveElement,"getActiveElement");var escapeSelectorAttributeValueInsideDoubleQuotesRegex=/[\n"\\]/g;function escapeSelectorAttributeValueInsideDoubleQuotes(value){return value.replace(escapeSelectorAttributeValueInsideDoubleQuotesRegex,function(ch){return"\\"+ch.charCodeAt(0).toString(16)+" "})}__name(escapeSelectorAttributeValueInsideDoubleQuotes,"escapeSelectorAttributeValueInsideDoubleQuotes");function updateInput(element2,value,defaultValue,lastDefaultValue,checked,defaultChecked,type,name2){element2.name="",type!=null&&typeof type!="function"&&typeof type!="symbol"&&typeof type!="boolean"?element2.type=type:element2.removeAttribute("type"),value!=null?type==="number"?(value===0&&element2.value===""||element2.value!=value)&&(element2.value=""+getToStringValue(value)):element2.value!==""+getToStringValue(value)&&(element2.value=""+getToStringValue(value)):type!=="submit"&&type!=="reset"||element2.removeAttribute("value"),value!=null?setDefaultValue(element2,type,getToStringValue(value)):defaultValue!=null?setDefaultValue(element2,type,getToStringValue(defaultValue)):lastDefaultValue!=null&&element2.removeAttribute("value"),checked==null&&defaultChecked!=null&&(element2.defaultChecked=!!defaultChecked),checked!=null&&(element2.checked=checked&&typeof checked!="function"&&typeof checked!="symbol"),name2!=null&&typeof name2!="function"&&typeof name2!="symbol"&&typeof name2!="boolean"?element2.name=""+getToStringValue(name2):element2.removeAttribute("name")}__name(updateInput,"updateInput");function initInput(element2,value,defaultValue,checked,defaultChecked,type,name2,isHydrating2){if(type!=null&&typeof type!="function"&&typeof type!="symbol"&&typeof type!="boolean"&&(element2.type=type),value!=null||defaultValue!=null){if(!(type!=="submit"&&type!=="reset"||value!=null)){track(element2);return}defaultValue=defaultValue!=null?""+getToStringValue(defaultValue):"",value=value!=null?""+getToStringValue(value):defaultValue,isHydrating2||value===element2.value||(element2.value=value),element2.defaultValue=value}checked=checked??defaultChecked,checked=typeof checked!="function"&&typeof checked!="symbol"&&!!checked,element2.checked=isHydrating2?element2.checked:!!checked,element2.defaultChecked=!!checked,name2!=null&&typeof name2!="function"&&typeof name2!="symbol"&&typeof name2!="boolean"&&(element2.name=name2),track(element2)}__name(initInput,"initInput");function setDefaultValue(node2,type,value){type==="number"&&getActiveElement(node2.ownerDocument)===node2||node2.defaultValue===""+value||(node2.defaultValue=""+value)}__name(setDefaultValue,"setDefaultValue");function updateOptions(node2,multiple,propValue,setDefaultSelected){if(node2=node2.options,multiple){multiple={};for(var i2=0;i2<propValue.length;i2++)multiple["$"+propValue[i2]]=!0;for(propValue=0;propValue<node2.length;propValue++)i2=multiple.hasOwnProperty("$"+node2[propValue].value),node2[propValue].selected!==i2&&(node2[propValue].selected=i2),i2&&setDefaultSelected&&(node2[propValue].defaultSelected=!0)}else{for(propValue=""+getToStringValue(propValue),multiple=null,i2=0;i2<node2.length;i2++){if(node2[i2].value===propValue){node2[i2].selected=!0,setDefaultSelected&&(node2[i2].defaultSelected=!0);return}multiple!==null||node2[i2].disabled||(multiple=node2[i2])}multiple!==null&&(multiple.selected=!0)}}__name(updateOptions,"updateOptions");function updateTextarea(element2,value,defaultValue){if(value!=null&&(value=""+getToStringValue(value),value!==element2.value&&(element2.value=value),defaultValue==null)){element2.defaultValue!==value&&(element2.defaultValue=value);return}element2.defaultValue=defaultValue!=null?""+getToStringValue(defaultValue):""}__name(updateTextarea,"updateTextarea");function initTextarea(element2,value,defaultValue,children){if(value==null){if(children!=null){if(defaultValue!=null)throw Error(formatProdErrorMessage(92));if(isArrayImpl(children)){if(1<children.length)throw Error(formatProdErrorMessage(93));children=children[0]}defaultValue=children}defaultValue==null&&(defaultValue=""),value=defaultValue}defaultValue=getToStringValue(value),element2.defaultValue=defaultValue,children=element2.textContent,children===defaultValue&&children!==""&&children!==null&&(element2.value=children),track(element2)}__name(initTextarea,"initTextarea");function setTextContent(node2,text2){if(text2){var firstChild=node2.firstChild;if(firstChild&&firstChild===node2.lastChild&&firstChild.nodeType===3){firstChild.nodeValue=text2;return}}node2.textContent=text2}__name(setTextContent,"setTextContent");var unitlessNumbers=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function setValueForStyle(style2,styleName,value){var isCustomProperty=styleName.indexOf("--")===0;value==null||typeof value=="boolean"||value===""?isCustomProperty?style2.setProperty(styleName,""):styleName==="float"?style2.cssFloat="":style2[styleName]="":isCustomProperty?style2.setProperty(styleName,value):typeof value!="number"||value===0||unitlessNumbers.has(styleName)?styleName==="float"?style2.cssFloat=value:style2[styleName]=(""+value).trim():style2[styleName]=value+"px"}__name(setValueForStyle,"setValueForStyle");function setValueForStyles(node2,styles,prevStyles){if(styles!=null&&typeof styles!="object")throw Error(formatProdErrorMessage(62));if(node2=node2.style,prevStyles!=null){for(var styleName in prevStyles)!prevStyles.hasOwnProperty(styleName)||styles!=null&&styles.hasOwnProperty(styleName)||(styleName.indexOf("--")===0?node2.setProperty(styleName,""):styleName==="float"?node2.cssFloat="":node2[styleName]="");for(var styleName$16 in styles)styleName=styles[styleName$16],styles.hasOwnProperty(styleName$16)&&prevStyles[styleName$16]!==styleName&&setValueForStyle(node2,styleName$16,styleName)}else for(var styleName$17 in styles)styles.hasOwnProperty(styleName$17)&&setValueForStyle(node2,styleName$17,styles[styleName$17])}__name(setValueForStyles,"setValueForStyles");function isCustomElement(tagName){if(tagName.indexOf("-")===-1)return!1;switch(tagName){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}__name(isCustomElement,"isCustomElement");var aliases=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),isJavaScriptProtocol=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function sanitizeURL(url2){return isJavaScriptProtocol.test(""+url2)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":url2}__name(sanitizeURL,"sanitizeURL");function noop$12(){}__name(noop$12,"noop$1");var currentReplayingEvent=null;function getEventTarget2(nativeEvent){return nativeEvent=nativeEvent.target||nativeEvent.srcElement||window,nativeEvent.correspondingUseElement&&(nativeEvent=nativeEvent.correspondingUseElement),nativeEvent.nodeType===3?nativeEvent.parentNode:nativeEvent}__name(getEventTarget2,"getEventTarget");var restoreTarget=null,restoreQueue=null;function restoreStateOfTarget(target){var internalInstance=getInstanceFromNode(target);if(internalInstance&&(target=internalInstance.stateNode)){var props=target[internalPropsKey]||null;a:switch(target=internalInstance.stateNode,internalInstance.type){case"input":if(updateInput(target,props.value,props.defaultValue,props.defaultValue,props.checked,props.defaultChecked,props.type,props.name),internalInstance=props.name,props.type==="radio"&&internalInstance!=null){for(props=target;props.parentNode;)props=props.parentNode;for(props=props.querySelectorAll('input[name="'+escapeSelectorAttributeValueInsideDoubleQuotes(""+internalInstance)+'"][type="radio"]'),internalInstance=0;internalInstance<props.length;internalInstance++){var otherNode=props[internalInstance];if(otherNode!==target&&otherNode.form===target.form){var otherProps=otherNode[internalPropsKey]||null;if(!otherProps)throw Error(formatProdErrorMessage(90));updateInput(otherNode,otherProps.value,otherProps.defaultValue,otherProps.defaultValue,otherProps.checked,otherProps.defaultChecked,otherProps.type,otherProps.name)}}for(internalInstance=0;internalInstance<props.length;internalInstance++)otherNode=props[internalInstance],otherNode.form===target.form&&updateValueIfChanged(otherNode)}break a;case"textarea":updateTextarea(target,props.value,props.defaultValue);break a;case"select":internalInstance=props.value,internalInstance!=null&&updateOptions(target,!!props.multiple,internalInstance,!1)}}}__name(restoreStateOfTarget,"restoreStateOfTarget");var isInsideEventHandler=!1;function batchedUpdates$1(fn,a2,b){if(isInsideEventHandler)return fn(a2,b);isInsideEventHandler=!0;try{var JSCompiler_inline_result=fn(a2);return JSCompiler_inline_result}finally{if(isInsideEventHandler=!1,(restoreTarget!==null||restoreQueue!==null)&&(flushSyncWork$1(),restoreTarget&&(a2=restoreTarget,fn=restoreQueue,restoreQueue=restoreTarget=null,restoreStateOfTarget(a2),fn)))for(a2=0;a2<fn.length;a2++)restoreStateOfTarget(fn[a2])}}__name(batchedUpdates$1,"batchedUpdates$1");function getListener(inst,registrationName){var stateNode=inst.stateNode;if(stateNode===null)return null;var props=stateNode[internalPropsKey]||null;if(props===null)return null;stateNode=props[registrationName];a:switch(registrationName){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(props=!props.disabled)||(inst=inst.type,props=!(inst==="button"||inst==="input"||inst==="select"||inst==="textarea")),inst=!props;break a;default:inst=!1}if(inst)return null;if(stateNode&&typeof stateNode!="function")throw Error(formatProdErrorMessage(231,registrationName,typeof stateNode));return stateNode}__name(getListener,"getListener");var canUseDOM=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),passiveBrowserEventsSupported=!1;if(canUseDOM)try{var options={};Object.defineProperty(options,"passive",{get:__name(function(){passiveBrowserEventsSupported=!0},"get")}),window.addEventListener("test",options,options),window.removeEventListener("test",options,options)}catch{passiveBrowserEventsSupported=!1}var root2=null,startText=null,fallbackText=null;function getData(){if(fallbackText)return fallbackText;var start,startValue=startText,startLength=startValue.length,end,endValue="value"in root2?root2.value:root2.textContent,endLength=endValue.length;for(start=0;start<startLength&&startValue[start]===endValue[start];start++);var minEnd=startLength-start;for(end=1;end<=minEnd&&startValue[startLength-end]===endValue[endLength-end];end++);return fallbackText=endValue.slice(start,1<end?1-end:void 0)}__name(getData,"getData");function getEventCharCode(nativeEvent){var keyCode=nativeEvent.keyCode;return"charCode"in nativeEvent?(nativeEvent=nativeEvent.charCode,nativeEvent===0&&keyCode===13&&(nativeEvent=13)):nativeEvent=keyCode,nativeEvent===10&&(nativeEvent=13),32<=nativeEvent||nativeEvent===13?nativeEvent:0}__name(getEventCharCode,"getEventCharCode");function functionThatReturnsTrue(){return!0}__name(functionThatReturnsTrue,"functionThatReturnsTrue");function functionThatReturnsFalse(){return!1}__name(functionThatReturnsFalse,"functionThatReturnsFalse");function createSyntheticEvent(Interface){function SyntheticBaseEvent(reactName,reactEventType,targetInst,nativeEvent,nativeEventTarget){this._reactName=reactName,this._targetInst=targetInst,this.type=reactEventType,this.nativeEvent=nativeEvent,this.target=nativeEventTarget,this.currentTarget=null;for(var propName in Interface)Interface.hasOwnProperty(propName)&&(reactName=Interface[propName],this[propName]=reactName?reactName(nativeEvent):nativeEvent[propName]);return this.isDefaultPrevented=(nativeEvent.defaultPrevented!=null?nativeEvent.defaultPrevented:nativeEvent.returnValue===!1)?functionThatReturnsTrue:functionThatReturnsFalse,this.isPropagationStopped=functionThatReturnsFalse,this}return __name(SyntheticBaseEvent,"SyntheticBaseEvent"),assign(SyntheticBaseEvent.prototype,{preventDefault:__name(function(){this.defaultPrevented=!0;var event=this.nativeEvent;event&&(event.preventDefault?event.preventDefault():typeof event.returnValue!="unknown"&&(event.returnValue=!1),this.isDefaultPrevented=functionThatReturnsTrue)},"preventDefault"),stopPropagation:__name(function(){var event=this.nativeEvent;event&&(event.stopPropagation?event.stopPropagation():typeof event.cancelBubble!="unknown"&&(event.cancelBubble=!0),this.isPropagationStopped=functionThatReturnsTrue)},"stopPropagation"),persist:__name(function(){},"persist"),isPersistent:functionThatReturnsTrue}),SyntheticBaseEvent}__name(createSyntheticEvent,"createSyntheticEvent");var EventInterface={eventPhase:0,bubbles:0,cancelable:0,timeStamp:__name(function(event){return event.timeStamp||Date.now()},"timeStamp"),defaultPrevented:0,isTrusted:0},SyntheticEvent=createSyntheticEvent(EventInterface),UIEventInterface=assign({},EventInterface,{view:0,detail:0}),SyntheticUIEvent=createSyntheticEvent(UIEventInterface),lastMovementX,lastMovementY,lastMouseEvent,MouseEventInterface=assign({},UIEventInterface,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:getEventModifierState,button:0,buttons:0,relatedTarget:__name(function(event){return event.relatedTarget===void 0?event.fromElement===event.srcElement?event.toElement:event.fromElement:event.relatedTarget},"relatedTarget"),movementX:__name(function(event){return"movementX"in event?event.movementX:(event!==lastMouseEvent&&(lastMouseEvent&&event.type==="mousemove"?(lastMovementX=event.screenX-lastMouseEvent.screenX,lastMovementY=event.screenY-lastMouseEvent.screenY):lastMovementY=lastMovementX=0,lastMouseEvent=event),lastMovementX)},"movementX"),movementY:__name(function(event){return"movementY"in event?event.movementY:lastMovementY},"movementY")}),SyntheticMouseEvent=createSyntheticEvent(MouseEventInterface),DragEventInterface=assign({},MouseEventInterface,{dataTransfer:0}),SyntheticDragEvent=createSyntheticEvent(DragEventInterface),FocusEventInterface=assign({},UIEventInterface,{relatedTarget:0}),SyntheticFocusEvent=createSyntheticEvent(FocusEventInterface),AnimationEventInterface=assign({},EventInterface,{animationName:0,elapsedTime:0,pseudoElement:0}),SyntheticAnimationEvent=createSyntheticEvent(AnimationEventInterface),ClipboardEventInterface=assign({},EventInterface,{clipboardData:__name(function(event){return"clipboardData"in event?event.clipboardData:window.clipboardData},"clipboardData")}),SyntheticClipboardEvent=createSyntheticEvent(ClipboardEventInterface),CompositionEventInterface=assign({},EventInterface,{data:0}),SyntheticCompositionEvent=createSyntheticEvent(CompositionEventInterface),normalizeKey={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},translateToKey={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},modifierKeyToProp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function modifierStateGetter(keyArg){var nativeEvent=this.nativeEvent;return nativeEvent.getModifierState?nativeEvent.getModifierState(keyArg):(keyArg=modifierKeyToProp[keyArg])?!!nativeEvent[keyArg]:!1}__name(modifierStateGetter,"modifierStateGetter");function getEventModifierState(){return modifierStateGetter}__name(getEventModifierState,"getEventModifierState");var KeyboardEventInterface=assign({},UIEventInterface,{key:__name(function(nativeEvent){if(nativeEvent.key){var key=normalizeKey[nativeEvent.key]||nativeEvent.key;if(key!=="Unidentified")return key}return nativeEvent.type==="keypress"?(nativeEvent=getEventCharCode(nativeEvent),nativeEvent===13?"Enter":String.fromCharCode(nativeEvent)):nativeEvent.type==="keydown"||nativeEvent.type==="keyup"?translateToKey[nativeEvent.keyCode]||"Unidentified":""},"key"),code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:getEventModifierState,charCode:__name(function(event){return event.type==="keypress"?getEventCharCode(event):0},"charCode"),keyCode:__name(function(event){return event.type==="keydown"||event.type==="keyup"?event.keyCode:0},"keyCode"),which:__name(function(event){return event.type==="keypress"?getEventCharCode(event):event.type==="keydown"||event.type==="keyup"?event.keyCode:0},"which")}),SyntheticKeyboardEvent=createSyntheticEvent(KeyboardEventInterface),PointerEventInterface=assign({},MouseEventInterface,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),SyntheticPointerEvent=createSyntheticEvent(PointerEventInterface),TouchEventInterface=assign({},UIEventInterface,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:getEventModifierState}),SyntheticTouchEvent=createSyntheticEvent(TouchEventInterface),TransitionEventInterface=assign({},EventInterface,{propertyName:0,elapsedTime:0,pseudoElement:0}),SyntheticTransitionEvent=createSyntheticEvent(TransitionEventInterface),WheelEventInterface=assign({},MouseEventInterface,{deltaX:__name(function(event){return"deltaX"in event?event.deltaX:"wheelDeltaX"in event?-event.wheelDeltaX:0},"deltaX"),deltaY:__name(function(event){return"deltaY"in event?event.deltaY:"wheelDeltaY"in event?-event.wheelDeltaY:"wheelDelta"in event?-event.wheelDelta:0},"deltaY"),deltaZ:0,deltaMode:0}),SyntheticWheelEvent=createSyntheticEvent(WheelEventInterface),ToggleEventInterface=assign({},EventInterface,{newState:0,oldState:0}),SyntheticToggleEvent=createSyntheticEvent(ToggleEventInterface),END_KEYCODES=[9,13,27,32],canUseCompositionEvent=canUseDOM&&"CompositionEvent"in window,documentMode=null;canUseDOM&&"documentMode"in document&&(documentMode=document.documentMode);var canUseTextInputEvent=canUseDOM&&"TextEvent"in window&&!documentMode,useFallbackCompositionData=canUseDOM&&(!canUseCompositionEvent||documentMode&&8<documentMode&&11>=documentMode),SPACEBAR_CHAR=" ",hasSpaceKeypress=!1;function isFallbackCompositionEnd(domEventName,nativeEvent){switch(domEventName){case"keyup":return END_KEYCODES.indexOf(nativeEvent.keyCode)!==-1;case"keydown":return nativeEvent.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}__name(isFallbackCompositionEnd,"isFallbackCompositionEnd");function getDataFromCustomEvent(nativeEvent){return nativeEvent=nativeEvent.detail,typeof nativeEvent=="object"&&"data"in nativeEvent?nativeEvent.data:null}__name(getDataFromCustomEvent,"getDataFromCustomEvent");var isComposing=!1;function getNativeBeforeInputChars(domEventName,nativeEvent){switch(domEventName){case"compositionend":return getDataFromCustomEvent(nativeEvent);case"keypress":return nativeEvent.which!==32?null:(hasSpaceKeypress=!0,SPACEBAR_CHAR);case"textInput":return domEventName=nativeEvent.data,domEventName===SPACEBAR_CHAR&&hasSpaceKeypress?null:domEventName;default:return null}}__name(getNativeBeforeInputChars,"getNativeBeforeInputChars");function getFallbackBeforeInputChars(domEventName,nativeEvent){if(isComposing)return domEventName==="compositionend"||!canUseCompositionEvent&&isFallbackCompositionEnd(domEventName,nativeEvent)?(domEventName=getData(),fallbackText=startText=root2=null,isComposing=!1,domEventName):null;switch(domEventName){case"paste":return null;case"keypress":if(!(nativeEvent.ctrlKey||nativeEvent.altKey||nativeEvent.metaKey)||nativeEvent.ctrlKey&&nativeEvent.altKey){if(nativeEvent.char&&1<nativeEvent.char.length)return nativeEvent.char;if(nativeEvent.which)return String.fromCharCode(nativeEvent.which)}return null;case"compositionend":return useFallbackCompositionData&&nativeEvent.locale!=="ko"?null:nativeEvent.data;default:return null}}__name(getFallbackBeforeInputChars,"getFallbackBeforeInputChars");var supportedInputTypes={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function isTextInputElement(elem){var nodeName=elem&&elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==="input"?!!supportedInputTypes[elem.type]:nodeName==="textarea"}__name(isTextInputElement,"isTextInputElement");function createAndAccumulateChangeEvent(dispatchQueue,inst,nativeEvent,target){restoreTarget?restoreQueue?restoreQueue.push(target):restoreQueue=[target]:restoreTarget=target,inst=accumulateTwoPhaseListeners(inst,"onChange"),0<inst.length&&(nativeEvent=new SyntheticEvent("onChange","change",null,nativeEvent,target),dispatchQueue.push({event:nativeEvent,listeners:inst}))}__name(createAndAccumulateChangeEvent,"createAndAccumulateChangeEvent");var activeElement$1=null,activeElementInst$1=null;function runEventInBatch(dispatchQueue){processDispatchQueue(dispatchQueue,0)}__name(runEventInBatch,"runEventInBatch");function getInstIfValueChanged(targetInst){var targetNode=getNodeFromInstance(targetInst);if(updateValueIfChanged(targetNode))return targetInst}__name(getInstIfValueChanged,"getInstIfValueChanged");function getTargetInstForChangeEvent(domEventName,targetInst){if(domEventName==="change")return targetInst}__name(getTargetInstForChangeEvent,"getTargetInstForChangeEvent");var isInputEventSupported=!1;if(canUseDOM){var JSCompiler_inline_result$jscomp$286;if(canUseDOM){var isSupported$jscomp$inline_427="oninput"in document;if(!isSupported$jscomp$inline_427){var element$jscomp$inline_428=document.createElement("div");element$jscomp$inline_428.setAttribute("oninput","return;"),isSupported$jscomp$inline_427=typeof element$jscomp$inline_428.oninput=="function"}JSCompiler_inline_result$jscomp$286=isSupported$jscomp$inline_427}else JSCompiler_inline_result$jscomp$286=!1;isInputEventSupported=JSCompiler_inline_result$jscomp$286&&(!document.documentMode||9<document.documentMode)}function stopWatchingForValueChange(){activeElement$1&&(activeElement$1.detachEvent("onpropertychange",handlePropertyChange),activeElementInst$1=activeElement$1=null)}__name(stopWatchingForValueChange,"stopWatchingForValueChange");function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName==="value"&&getInstIfValueChanged(activeElementInst$1)){var dispatchQueue=[];createAndAccumulateChangeEvent(dispatchQueue,activeElementInst$1,nativeEvent,getEventTarget2(nativeEvent)),batchedUpdates$1(runEventInBatch,dispatchQueue)}}__name(handlePropertyChange,"handlePropertyChange");function handleEventsForInputEventPolyfill(domEventName,target,targetInst){domEventName==="focusin"?(stopWatchingForValueChange(),activeElement$1=target,activeElementInst$1=targetInst,activeElement$1.attachEvent("onpropertychange",handlePropertyChange)):domEventName==="focusout"&&stopWatchingForValueChange()}__name(handleEventsForInputEventPolyfill,"handleEventsForInputEventPolyfill");function getTargetInstForInputEventPolyfill(domEventName){if(domEventName==="selectionchange"||domEventName==="keyup"||domEventName==="keydown")return getInstIfValueChanged(activeElementInst$1)}__name(getTargetInstForInputEventPolyfill,"getTargetInstForInputEventPolyfill");function getTargetInstForClickEvent(domEventName,targetInst){if(domEventName==="click")return getInstIfValueChanged(targetInst)}__name(getTargetInstForClickEvent,"getTargetInstForClickEvent");function getTargetInstForInputOrChangeEvent(domEventName,targetInst){if(domEventName==="input"||domEventName==="change")return getInstIfValueChanged(targetInst)}__name(getTargetInstForInputOrChangeEvent,"getTargetInstForInputOrChangeEvent");function is2(x,y){return x===y&&(x!==0||1/x===1/y)||x!==x&&y!==y}__name(is2,"is");var objectIs=typeof Object.is=="function"?Object.is:is2;function shallowEqual(objA,objB){if(objectIs(objA,objB))return!0;if(typeof objA!="object"||objA===null||typeof objB!="object"||objB===null)return!1;var keysA=Object.keys(objA),keysB=Object.keys(objB);if(keysA.length!==keysB.length)return!1;for(keysB=0;keysB<keysA.length;keysB++){var currentKey=keysA[keysB];if(!hasOwnProperty2.call(objB,currentKey)||!objectIs(objA[currentKey],objB[currentKey]))return!1}return!0}__name(shallowEqual,"shallowEqual");function getLeafNode(node2){for(;node2&&node2.firstChild;)node2=node2.firstChild;return node2}__name(getLeafNode,"getLeafNode");function getNodeForCharacterOffset(root3,offset2){var node2=getLeafNode(root3);root3=0;for(var nodeEnd;node2;){if(node2.nodeType===3){if(nodeEnd=root3+node2.textContent.length,root3<=offset2&&nodeEnd>=offset2)return{node:node2,offset:offset2-root3};root3=nodeEnd}a:{for(;node2;){if(node2.nextSibling){node2=node2.nextSibling;break a}node2=node2.parentNode}node2=void 0}node2=getLeafNode(node2)}}__name(getNodeForCharacterOffset,"getNodeForCharacterOffset");function containsNode(outerNode,innerNode){return outerNode&&innerNode?outerNode===innerNode?!0:outerNode&&outerNode.nodeType===3?!1:innerNode&&innerNode.nodeType===3?containsNode(outerNode,innerNode.parentNode):"contains"in outerNode?outerNode.contains(innerNode):outerNode.compareDocumentPosition?!!(outerNode.compareDocumentPosition(innerNode)&16):!1:!1}__name(containsNode,"containsNode");function getActiveElementDeep(containerInfo){containerInfo=containerInfo!=null&&containerInfo.ownerDocument!=null&&containerInfo.ownerDocument.defaultView!=null?containerInfo.ownerDocument.defaultView:window;for(var element2=getActiveElement(containerInfo.document);element2 instanceof containerInfo.HTMLIFrameElement;){try{var JSCompiler_inline_result=typeof element2.contentWindow.location.href=="string"}catch{JSCompiler_inline_result=!1}if(JSCompiler_inline_result)containerInfo=element2.contentWindow;else break;element2=getActiveElement(containerInfo.document)}return element2}__name(getActiveElementDeep,"getActiveElementDeep");function hasSelectionCapabilities(elem){var nodeName=elem&&elem.nodeName&&elem.nodeName.toLowerCase();return nodeName&&(nodeName==="input"&&(elem.type==="text"||elem.type==="search"||elem.type==="tel"||elem.type==="url"||elem.type==="password")||nodeName==="textarea"||elem.contentEditable==="true")}__name(hasSelectionCapabilities,"hasSelectionCapabilities");var skipSelectionChangeEvent=canUseDOM&&"documentMode"in document&&11>=document.documentMode,activeElement=null,activeElementInst=null,lastSelection=null,mouseDown=!1;function constructSelectEvent(dispatchQueue,nativeEvent,nativeEventTarget){var doc=nativeEventTarget.window===nativeEventTarget?nativeEventTarget.document:nativeEventTarget.nodeType===9?nativeEventTarget:nativeEventTarget.ownerDocument;mouseDown||activeElement==null||activeElement!==getActiveElement(doc)||(doc=activeElement,"selectionStart"in doc&&hasSelectionCapabilities(doc)?doc={start:doc.selectionStart,end:doc.selectionEnd}:(doc=(doc.ownerDocument&&doc.ownerDocument.defaultView||window).getSelection(),doc={anchorNode:doc.anchorNode,anchorOffset:doc.anchorOffset,focusNode:doc.focusNode,focusOffset:doc.focusOffset}),lastSelection&&shallowEqual(lastSelection,doc)||(lastSelection=doc,doc=accumulateTwoPhaseListeners(activeElementInst,"onSelect"),0<doc.length&&(nativeEvent=new SyntheticEvent("onSelect","select",null,nativeEvent,nativeEventTarget),dispatchQueue.push({event:nativeEvent,listeners:doc}),nativeEvent.target=activeElement)))}__name(constructSelectEvent,"constructSelectEvent");function makePrefixMap(styleProp,eventName){var prefixes={};return prefixes[styleProp.toLowerCase()]=eventName.toLowerCase(),prefixes["Webkit"+styleProp]="webkit"+eventName,prefixes["Moz"+styleProp]="moz"+eventName,prefixes}__name(makePrefixMap,"makePrefixMap");var vendorPrefixes={animationend:makePrefixMap("Animation","AnimationEnd"),animationiteration:makePrefixMap("Animation","AnimationIteration"),animationstart:makePrefixMap("Animation","AnimationStart"),transitionrun:makePrefixMap("Transition","TransitionRun"),transitionstart:makePrefixMap("Transition","TransitionStart"),transitioncancel:makePrefixMap("Transition","TransitionCancel"),transitionend:makePrefixMap("Transition","TransitionEnd")},prefixedEventNames={},style={};canUseDOM&&(style=document.createElement("div").style,"AnimationEvent"in window||(delete vendorPrefixes.animationend.animation,delete vendorPrefixes.animationiteration.animation,delete vendorPrefixes.animationstart.animation),"TransitionEvent"in window||delete vendorPrefixes.transitionend.transition);function getVendorPrefixedEventName(eventName){if(prefixedEventNames[eventName])return prefixedEventNames[eventName];if(!vendorPrefixes[eventName])return eventName;var prefixMap=vendorPrefixes[eventName],styleProp;for(styleProp in prefixMap)if(prefixMap.hasOwnProperty(styleProp)&&styleProp in style)return prefixedEventNames[eventName]=prefixMap[styleProp];return eventName}__name(getVendorPrefixedEventName,"getVendorPrefixedEventName");var ANIMATION_END=getVendorPrefixedEventName("animationend"),ANIMATION_ITERATION=getVendorPrefixedEventName("animationiteration"),ANIMATION_START=getVendorPrefixedEventName("animationstart"),TRANSITION_RUN=getVendorPrefixedEventName("transitionrun"),TRANSITION_START=getVendorPrefixedEventName("transitionstart"),TRANSITION_CANCEL=getVendorPrefixedEventName("transitioncancel"),TRANSITION_END=getVendorPrefixedEventName("transitionend"),topLevelEventsToReactNames=new Map,simpleEventPluginEvents="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");simpleEventPluginEvents.push("scrollEnd");function registerSimpleEvent(domEventName,reactName){topLevelEventsToReactNames.set(domEventName,reactName),registerTwoPhaseEvent(reactName,[domEventName])}__name(registerSimpleEvent,"registerSimpleEvent");var reportGlobalError=typeof reportError=="function"?reportError:function(error2){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var event=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof error2=="object"&&error2!==null&&typeof error2.message=="string"?String(error2.message):String(error2),error:error2});if(!window.dispatchEvent(event))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",error2);return}console.error(error2)},concurrentQueues=[],concurrentQueuesIndex=0,concurrentlyUpdatedLanes=0;function finishQueueingConcurrentUpdates(){for(var endIndex=concurrentQueuesIndex,i2=concurrentlyUpdatedLanes=concurrentQueuesIndex=0;i2<endIndex;){var fiber=concurrentQueues[i2];concurrentQueues[i2++]=null;var queue=concurrentQueues[i2];concurrentQueues[i2++]=null;var update=concurrentQueues[i2];concurrentQueues[i2++]=null;var lane=concurrentQueues[i2];if(concurrentQueues[i2++]=null,queue!==null&&update!==null){var pending=queue.pending;pending===null?update.next=update:(update.next=pending.next,pending.next=update),queue.pending=update}lane!==0&&markUpdateLaneFromFiberToRoot(fiber,update,lane)}}__name(finishQueueingConcurrentUpdates,"finishQueueingConcurrentUpdates");function enqueueUpdate$1(fiber,queue,update,lane){concurrentQueues[concurrentQueuesIndex++]=fiber,concurrentQueues[concurrentQueuesIndex++]=queue,concurrentQueues[concurrentQueuesIndex++]=update,concurrentQueues[concurrentQueuesIndex++]=lane,concurrentlyUpdatedLanes|=lane,fiber.lanes|=lane,fiber=fiber.alternate,fiber!==null&&(fiber.lanes|=lane)}__name(enqueueUpdate$1,"enqueueUpdate$1");function enqueueConcurrentHookUpdate(fiber,queue,update,lane){return enqueueUpdate$1(fiber,queue,update,lane),getRootForUpdatedFiber(fiber)}__name(enqueueConcurrentHookUpdate,"enqueueConcurrentHookUpdate");function enqueueConcurrentRenderForLane(fiber,lane){return enqueueUpdate$1(fiber,null,null,lane),getRootForUpdatedFiber(fiber)}__name(enqueueConcurrentRenderForLane,"enqueueConcurrentRenderForLane");function markUpdateLaneFromFiberToRoot(sourceFiber,update,lane){sourceFiber.lanes|=lane;var alternate=sourceFiber.alternate;alternate!==null&&(alternate.lanes|=lane);for(var isHidden2=!1,parent=sourceFiber.return;parent!==null;)parent.childLanes|=lane,alternate=parent.alternate,alternate!==null&&(alternate.childLanes|=lane),parent.tag===22&&(sourceFiber=parent.stateNode,sourceFiber===null||sourceFiber._visibility&1||(isHidden2=!0)),sourceFiber=parent,parent=parent.return;return sourceFiber.tag===3?(parent=sourceFiber.stateNode,isHidden2&&update!==null&&(isHidden2=31-clz32(lane),sourceFiber=parent.hiddenUpdates,alternate=sourceFiber[isHidden2],alternate===null?sourceFiber[isHidden2]=[update]:alternate.push(update),update.lane=lane|536870912),parent):null}__name(markUpdateLaneFromFiberToRoot,"markUpdateLaneFromFiberToRoot");function getRootForUpdatedFiber(sourceFiber){if(50<nestedUpdateCount)throw nestedUpdateCount=0,rootWithNestedUpdates=null,Error(formatProdErrorMessage(185));for(var parent=sourceFiber.return;parent!==null;)sourceFiber=parent,parent=sourceFiber.return;return sourceFiber.tag===3?sourceFiber.stateNode:null}__name(getRootForUpdatedFiber,"getRootForUpdatedFiber");var emptyContextObject={};function FiberNode(tag,pendingProps,key,mode){this.tag=tag,this.key=key,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=pendingProps,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=mode,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}__name(FiberNode,"FiberNode");function createFiberImplClass(tag,pendingProps,key,mode){return new FiberNode(tag,pendingProps,key,mode)}__name(createFiberImplClass,"createFiberImplClass");function shouldConstruct(Component){return Component=Component.prototype,!(!Component||!Component.isReactComponent)}__name(shouldConstruct,"shouldConstruct");function createWorkInProgress(current,pendingProps){var workInProgress2=current.alternate;return workInProgress2===null?(workInProgress2=createFiberImplClass(current.tag,pendingProps,current.key,current.mode),workInProgress2.elementType=current.elementType,workInProgress2.type=current.type,workInProgress2.stateNode=current.stateNode,workInProgress2.alternate=current,current.alternate=workInProgress2):(workInProgress2.pendingProps=pendingProps,workInProgress2.type=current.type,workInProgress2.flags=0,workInProgress2.subtreeFlags=0,workInProgress2.deletions=null),workInProgress2.flags=current.flags&65011712,workInProgress2.childLanes=current.childLanes,workInProgress2.lanes=current.lanes,workInProgress2.child=current.child,workInProgress2.memoizedProps=current.memoizedProps,workInProgress2.memoizedState=current.memoizedState,workInProgress2.updateQueue=current.updateQueue,pendingProps=current.dependencies,workInProgress2.dependencies=pendingProps===null?null:{lanes:pendingProps.lanes,firstContext:pendingProps.firstContext},workInProgress2.sibling=current.sibling,workInProgress2.index=current.index,workInProgress2.ref=current.ref,workInProgress2.refCleanup=current.refCleanup,workInProgress2}__name(createWorkInProgress,"createWorkInProgress");function resetWorkInProgress(workInProgress2,renderLanes2){workInProgress2.flags&=65011714;var current=workInProgress2.alternate;return current===null?(workInProgress2.childLanes=0,workInProgress2.lanes=renderLanes2,workInProgress2.child=null,workInProgress2.subtreeFlags=0,workInProgress2.memoizedProps=null,workInProgress2.memoizedState=null,workInProgress2.updateQueue=null,workInProgress2.dependencies=null,workInProgress2.stateNode=null):(workInProgress2.childLanes=current.childLanes,workInProgress2.lanes=current.lanes,workInProgress2.child=current.child,workInProgress2.subtreeFlags=0,workInProgress2.deletions=null,workInProgress2.memoizedProps=current.memoizedProps,workInProgress2.memoizedState=current.memoizedState,workInProgress2.updateQueue=current.updateQueue,workInProgress2.type=current.type,renderLanes2=current.dependencies,workInProgress2.dependencies=renderLanes2===null?null:{lanes:renderLanes2.lanes,firstContext:renderLanes2.firstContext}),workInProgress2}__name(resetWorkInProgress,"resetWorkInProgress");function createFiberFromTypeAndProps(type,key,pendingProps,owner,mode,lanes){var fiberTag=0;if(owner=type,typeof type=="function")shouldConstruct(type)&&(fiberTag=1);else if(typeof type=="string")fiberTag=isHostHoistableType(type,pendingProps,contextStackCursor.current)?26:type==="html"||type==="head"||type==="body"?27:5;else a:switch(type){case REACT_ACTIVITY_TYPE:return type=createFiberImplClass(31,pendingProps,key,mode),type.elementType=REACT_ACTIVITY_TYPE,type.lanes=lanes,type;case REACT_FRAGMENT_TYPE:return createFiberFromFragment(pendingProps.children,mode,lanes,key);case REACT_STRICT_MODE_TYPE:fiberTag=8,mode|=24;break;case REACT_PROFILER_TYPE:return type=createFiberImplClass(12,pendingProps,key,mode|2),type.elementType=REACT_PROFILER_TYPE,type.lanes=lanes,type;case REACT_SUSPENSE_TYPE:return type=createFiberImplClass(13,pendingProps,key,mode),type.elementType=REACT_SUSPENSE_TYPE,type.lanes=lanes,type;case REACT_SUSPENSE_LIST_TYPE:return type=createFiberImplClass(19,pendingProps,key,mode),type.elementType=REACT_SUSPENSE_LIST_TYPE,type.lanes=lanes,type;default:if(typeof type=="object"&&type!==null)switch(type.$$typeof){case REACT_CONTEXT_TYPE:fiberTag=10;break a;case REACT_CONSUMER_TYPE:fiberTag=9;break a;case REACT_FORWARD_REF_TYPE:fiberTag=11;break a;case REACT_MEMO_TYPE:fiberTag=14;break a;case REACT_LAZY_TYPE2:fiberTag=16,owner=null;break a}fiberTag=29,pendingProps=Error(formatProdErrorMessage(130,type===null?"null":typeof type,"")),owner=null}return key=createFiberImplClass(fiberTag,pendingProps,key,mode),key.elementType=type,key.type=owner,key.lanes=lanes,key}__name(createFiberFromTypeAndProps,"createFiberFromTypeAndProps");function createFiberFromFragment(elements,mode,lanes,key){return elements=createFiberImplClass(7,elements,key,mode),elements.lanes=lanes,elements}__name(createFiberFromFragment,"createFiberFromFragment");function createFiberFromText(content2,mode,lanes){return content2=createFiberImplClass(6,content2,null,mode),content2.lanes=lanes,content2}__name(createFiberFromText,"createFiberFromText");function createFiberFromDehydratedFragment(dehydratedNode){var fiber=createFiberImplClass(18,null,null,0);return fiber.stateNode=dehydratedNode,fiber}__name(createFiberFromDehydratedFragment,"createFiberFromDehydratedFragment");function createFiberFromPortal(portal,mode,lanes){return mode=createFiberImplClass(4,portal.children!==null?portal.children:[],portal.key,mode),mode.lanes=lanes,mode.stateNode={containerInfo:portal.containerInfo,pendingChildren:null,implementation:portal.implementation},mode}__name(createFiberFromPortal,"createFiberFromPortal");var CapturedStacks=new WeakMap;function createCapturedValueAtFiber(value,source){if(typeof value=="object"&&value!==null){var existing=CapturedStacks.get(value);return existing!==void 0?existing:(source={value,source,stack:getStackByFiberInDevAndProd(source)},CapturedStacks.set(value,source),source)}return{value,source,stack:getStackByFiberInDevAndProd(source)}}__name(createCapturedValueAtFiber,"createCapturedValueAtFiber");var forkStack=[],forkStackIndex=0,treeForkProvider=null,treeForkCount=0,idStack=[],idStackIndex=0,treeContextProvider=null,treeContextId=1,treeContextOverflow="";function pushTreeFork(workInProgress2,totalChildren){forkStack[forkStackIndex++]=treeForkCount,forkStack[forkStackIndex++]=treeForkProvider,treeForkProvider=workInProgress2,treeForkCount=totalChildren}__name(pushTreeFork,"pushTreeFork");function pushTreeId(workInProgress2,totalChildren,index3){idStack[idStackIndex++]=treeContextId,idStack[idStackIndex++]=treeContextOverflow,idStack[idStackIndex++]=treeContextProvider,treeContextProvider=workInProgress2;var baseIdWithLeadingBit=treeContextId;workInProgress2=treeContextOverflow;var baseLength=32-clz32(baseIdWithLeadingBit)-1;baseIdWithLeadingBit&=~(1<<baseLength),index3+=1;var length=32-clz32(totalChildren)+baseLength;if(30<length){var numberOfOverflowBits=baseLength-baseLength%5;length=(baseIdWithLeadingBit&(1<<numberOfOverflowBits)-1).toString(32),baseIdWithLeadingBit>>=numberOfOverflowBits,baseLength-=numberOfOverflowBits,treeContextId=1<<32-clz32(totalChildren)+baseLength|index3<<baseLength|baseIdWithLeadingBit,treeContextOverflow=length+workInProgress2}else treeContextId=1<<length|index3<<baseLength|baseIdWithLeadingBit,treeContextOverflow=workInProgress2}__name(pushTreeId,"pushTreeId");function pushMaterializedTreeId(workInProgress2){workInProgress2.return!==null&&(pushTreeFork(workInProgress2,1),pushTreeId(workInProgress2,1,0))}__name(pushMaterializedTreeId,"pushMaterializedTreeId");function popTreeContext(workInProgress2){for(;workInProgress2===treeForkProvider;)treeForkProvider=forkStack[--forkStackIndex],forkStack[forkStackIndex]=null,treeForkCount=forkStack[--forkStackIndex],forkStack[forkStackIndex]=null;for(;workInProgress2===treeContextProvider;)treeContextProvider=idStack[--idStackIndex],idStack[idStackIndex]=null,treeContextOverflow=idStack[--idStackIndex],idStack[idStackIndex]=null,treeContextId=idStack[--idStackIndex],idStack[idStackIndex]=null}__name(popTreeContext,"popTreeContext");function restoreSuspendedTreeContext(workInProgress2,suspendedContext){idStack[idStackIndex++]=treeContextId,idStack[idStackIndex++]=treeContextOverflow,idStack[idStackIndex++]=treeContextProvider,treeContextId=suspendedContext.id,treeContextOverflow=suspendedContext.overflow,treeContextProvider=workInProgress2}__name(restoreSuspendedTreeContext,"restoreSuspendedTreeContext");var hydrationParentFiber=null,nextHydratableInstance=null,isHydrating=!1,hydrationErrors=null,rootOrSingletonContext=!1,HydrationMismatchException=Error(formatProdErrorMessage(519));function throwOnHydrationMismatch(fiber){var error2=Error(formatProdErrorMessage(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw queueHydrationError(createCapturedValueAtFiber(error2,fiber)),HydrationMismatchException}__name(throwOnHydrationMismatch,"throwOnHydrationMismatch");function prepareToHydrateHostInstance(fiber){var instance=fiber.stateNode,type=fiber.type,props=fiber.memoizedProps;switch(instance[internalInstanceKey]=fiber,instance[internalPropsKey]=props,type){case"dialog":listenToNonDelegatedEvent("cancel",instance),listenToNonDelegatedEvent("close",instance);break;case"iframe":case"object":case"embed":listenToNonDelegatedEvent("load",instance);break;case"video":case"audio":for(type=0;type<mediaEventTypes.length;type++)listenToNonDelegatedEvent(mediaEventTypes[type],instance);break;case"source":listenToNonDelegatedEvent("error",instance);break;case"img":case"image":case"link":listenToNonDelegatedEvent("error",instance),listenToNonDelegatedEvent("load",instance);break;case"details":listenToNonDelegatedEvent("toggle",instance);break;case"input":listenToNonDelegatedEvent("invalid",instance),initInput(instance,props.value,props.defaultValue,props.checked,props.defaultChecked,props.type,props.name,!0);break;case"select":listenToNonDelegatedEvent("invalid",instance);break;case"textarea":listenToNonDelegatedEvent("invalid",instance),initTextarea(instance,props.value,props.defaultValue,props.children)}type=props.children,typeof type!="string"&&typeof type!="number"&&typeof type!="bigint"||instance.textContent===""+type||props.suppressHydrationWarning===!0||checkForUnmatchedText(instance.textContent,type)?(props.popover!=null&&(listenToNonDelegatedEvent("beforetoggle",instance),listenToNonDelegatedEvent("toggle",instance)),props.onScroll!=null&&listenToNonDelegatedEvent("scroll",instance),props.onScrollEnd!=null&&listenToNonDelegatedEvent("scrollend",instance),props.onClick!=null&&(instance.onclick=noop$12),instance=!0):instance=!1,instance||throwOnHydrationMismatch(fiber,!0)}__name(prepareToHydrateHostInstance,"prepareToHydrateHostInstance");function popToNextHostParent(fiber){for(hydrationParentFiber=fiber.return;hydrationParentFiber;)switch(hydrationParentFiber.tag){case 5:case 31:case 13:rootOrSingletonContext=!1;return;case 27:case 3:rootOrSingletonContext=!0;return;default:hydrationParentFiber=hydrationParentFiber.return}}__name(popToNextHostParent,"popToNextHostParent");function popHydrationState(fiber){if(fiber!==hydrationParentFiber)return!1;if(!isHydrating)return popToNextHostParent(fiber),isHydrating=!0,!1;var tag=fiber.tag,JSCompiler_temp;if((JSCompiler_temp=tag!==3&&tag!==27)&&((JSCompiler_temp=tag===5)&&(JSCompiler_temp=fiber.type,JSCompiler_temp=!(JSCompiler_temp!=="form"&&JSCompiler_temp!=="button")||shouldSetTextContent(fiber.type,fiber.memoizedProps)),JSCompiler_temp=!JSCompiler_temp),JSCompiler_temp&&nextHydratableInstance&&throwOnHydrationMismatch(fiber),popToNextHostParent(fiber),tag===13){if(fiber=fiber.memoizedState,fiber=fiber!==null?fiber.dehydrated:null,!fiber)throw Error(formatProdErrorMessage(317));nextHydratableInstance=getNextHydratableInstanceAfterHydrationBoundary(fiber)}else if(tag===31){if(fiber=fiber.memoizedState,fiber=fiber!==null?fiber.dehydrated:null,!fiber)throw Error(formatProdErrorMessage(317));nextHydratableInstance=getNextHydratableInstanceAfterHydrationBoundary(fiber)}else tag===27?(tag=nextHydratableInstance,isSingletonScope(fiber.type)?(fiber=previousHydratableOnEnteringScopedSingleton,previousHydratableOnEnteringScopedSingleton=null,nextHydratableInstance=fiber):nextHydratableInstance=tag):nextHydratableInstance=hydrationParentFiber?getNextHydratable(fiber.stateNode.nextSibling):null;return!0}__name(popHydrationState,"popHydrationState");function resetHydrationState(){nextHydratableInstance=hydrationParentFiber=null,isHydrating=!1}__name(resetHydrationState,"resetHydrationState");function upgradeHydrationErrorsToRecoverable(){var queuedErrors=hydrationErrors;return queuedErrors!==null&&(workInProgressRootRecoverableErrors===null?workInProgressRootRecoverableErrors=queuedErrors:workInProgressRootRecoverableErrors.push.apply(workInProgressRootRecoverableErrors,queuedErrors),hydrationErrors=null),queuedErrors}__name(upgradeHydrationErrorsToRecoverable,"upgradeHydrationErrorsToRecoverable");function queueHydrationError(error2){hydrationErrors===null?hydrationErrors=[error2]:hydrationErrors.push(error2)}__name(queueHydrationError,"queueHydrationError");var valueCursor=createCursor(null),currentlyRenderingFiber$1=null,lastContextDependency=null;function pushProvider(providerFiber,context,nextValue){push2(valueCursor,context._currentValue),context._currentValue=nextValue}__name(pushProvider,"pushProvider");function popProvider(context){context._currentValue=valueCursor.current,pop(valueCursor)}__name(popProvider,"popProvider");function scheduleContextWorkOnParentPath(parent,renderLanes2,propagationRoot){for(;parent!==null;){var alternate=parent.alternate;if((parent.childLanes&renderLanes2)!==renderLanes2?(parent.childLanes|=renderLanes2,alternate!==null&&(alternate.childLanes|=renderLanes2)):alternate!==null&&(alternate.childLanes&renderLanes2)!==renderLanes2&&(alternate.childLanes|=renderLanes2),parent===propagationRoot)break;parent=parent.return}}__name(scheduleContextWorkOnParentPath,"scheduleContextWorkOnParentPath");function propagateContextChanges(workInProgress2,contexts,renderLanes2,forcePropagateEntireTree){var fiber=workInProgress2.child;for(fiber!==null&&(fiber.return=workInProgress2);fiber!==null;){var list2=fiber.dependencies;if(list2!==null){var nextFiber=fiber.child;list2=list2.firstContext;a:for(;list2!==null;){var dependency=list2;list2=fiber;for(var i2=0;i2<contexts.length;i2++)if(dependency.context===contexts[i2]){list2.lanes|=renderLanes2,dependency=list2.alternate,dependency!==null&&(dependency.lanes|=renderLanes2),scheduleContextWorkOnParentPath(list2.return,renderLanes2,workInProgress2),forcePropagateEntireTree||(nextFiber=null);break a}list2=dependency.next}}else if(fiber.tag===18){if(nextFiber=fiber.return,nextFiber===null)throw Error(formatProdErrorMessage(341));nextFiber.lanes|=renderLanes2,list2=nextFiber.alternate,list2!==null&&(list2.lanes|=renderLanes2),scheduleContextWorkOnParentPath(nextFiber,renderLanes2,workInProgress2),nextFiber=null}else nextFiber=fiber.child;if(nextFiber!==null)nextFiber.return=fiber;else for(nextFiber=fiber;nextFiber!==null;){if(nextFiber===workInProgress2){nextFiber=null;break}if(fiber=nextFiber.sibling,fiber!==null){fiber.return=nextFiber.return,nextFiber=fiber;break}nextFiber=nextFiber.return}fiber=nextFiber}}__name(propagateContextChanges,"propagateContextChanges");function propagateParentContextChanges(current,workInProgress2,renderLanes2,forcePropagateEntireTree){current=null;for(var parent=workInProgress2,isInsidePropagationBailout=!1;parent!==null;){if(!isInsidePropagationBailout){if((parent.flags&524288)!==0)isInsidePropagationBailout=!0;else if((parent.flags&262144)!==0)break}if(parent.tag===10){var currentParent=parent.alternate;if(currentParent===null)throw Error(formatProdErrorMessage(387));if(currentParent=currentParent.memoizedProps,currentParent!==null){var context=parent.type;objectIs(parent.pendingProps.value,currentParent.value)||(current!==null?current.push(context):current=[context])}}else if(parent===hostTransitionProviderCursor.current){if(currentParent=parent.alternate,currentParent===null)throw Error(formatProdErrorMessage(387));currentParent.memoizedState.memoizedState!==parent.memoizedState.memoizedState&&(current!==null?current.push(HostTransitionContext):current=[HostTransitionContext])}parent=parent.return}current!==null&&propagateContextChanges(workInProgress2,current,renderLanes2,forcePropagateEntireTree),workInProgress2.flags|=262144}__name(propagateParentContextChanges,"propagateParentContextChanges");function checkIfContextChanged(currentDependencies){for(currentDependencies=currentDependencies.firstContext;currentDependencies!==null;){if(!objectIs(currentDependencies.context._currentValue,currentDependencies.memoizedValue))return!0;currentDependencies=currentDependencies.next}return!1}__name(checkIfContextChanged,"checkIfContextChanged");function prepareToReadContext(workInProgress2){currentlyRenderingFiber$1=workInProgress2,lastContextDependency=null,workInProgress2=workInProgress2.dependencies,workInProgress2!==null&&(workInProgress2.firstContext=null)}__name(prepareToReadContext,"prepareToReadContext");function readContext(context){return readContextForConsumer(currentlyRenderingFiber$1,context)}__name(readContext,"readContext");function readContextDuringReconciliation(consumer,context){return currentlyRenderingFiber$1===null&&prepareToReadContext(consumer),readContextForConsumer(consumer,context)}__name(readContextDuringReconciliation,"readContextDuringReconciliation");function readContextForConsumer(consumer,context){var value=context._currentValue;if(context={context,memoizedValue:value,next:null},lastContextDependency===null){if(consumer===null)throw Error(formatProdErrorMessage(308));lastContextDependency=context,consumer.dependencies={lanes:0,firstContext:context},consumer.flags|=524288}else lastContextDependency=lastContextDependency.next=context;return value}__name(readContextForConsumer,"readContextForConsumer");var AbortControllerLocal=typeof AbortController<"u"?AbortController:function(){var listeners=[],signal=this.signal={aborted:!1,addEventListener:__name(function(type,listener){listeners.push(listener)},"addEventListener")};this.abort=function(){signal.aborted=!0,listeners.forEach(function(listener){return listener()})}},scheduleCallback$2=Scheduler.unstable_scheduleCallback,NormalPriority=Scheduler.unstable_NormalPriority,CacheContext={$$typeof:REACT_CONTEXT_TYPE,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function createCache(){return{controller:new AbortControllerLocal,data:new Map,refCount:0}}__name(createCache,"createCache");function releaseCache(cache2){cache2.refCount--,cache2.refCount===0&&scheduleCallback$2(NormalPriority,function(){cache2.controller.abort()})}__name(releaseCache,"releaseCache");var currentEntangledListeners=null,currentEntangledPendingCount=0,currentEntangledLane=0,currentEntangledActionThenable=null;function entangleAsyncAction(transition,thenable){if(currentEntangledListeners===null){var entangledListeners=currentEntangledListeners=[];currentEntangledPendingCount=0,currentEntangledLane=requestTransitionLane(),currentEntangledActionThenable={status:"pending",value:void 0,then:__name(function(resolve){entangledListeners.push(resolve)},"then")}}return currentEntangledPendingCount++,thenable.then(pingEngtangledActionScope,pingEngtangledActionScope),thenable}__name(entangleAsyncAction,"entangleAsyncAction");function pingEngtangledActionScope(){if(--currentEntangledPendingCount===0&¤tEntangledListeners!==null){currentEntangledActionThenable!==null&&(currentEntangledActionThenable.status="fulfilled");var listeners=currentEntangledListeners;currentEntangledListeners=null,currentEntangledLane=0,currentEntangledActionThenable=null;for(var i2=0;i2<listeners.length;i2++)(0,listeners[i2])()}}__name(pingEngtangledActionScope,"pingEngtangledActionScope");function chainThenableValue(thenable,result){var listeners=[],thenableWithOverride={status:"pending",value:null,reason:null,then:__name(function(resolve){listeners.push(resolve)},"then")};return thenable.then(function(){thenableWithOverride.status="fulfilled",thenableWithOverride.value=result;for(var i2=0;i2<listeners.length;i2++)(0,listeners[i2])(result)},function(error2){for(thenableWithOverride.status="rejected",thenableWithOverride.reason=error2,error2=0;error2<listeners.length;error2++)(0,listeners[error2])(void 0)}),thenableWithOverride}__name(chainThenableValue,"chainThenableValue");var prevOnStartTransitionFinish=ReactSharedInternals.S;ReactSharedInternals.S=function(transition,returnValue){globalMostRecentTransitionTime=now(),typeof returnValue=="object"&&returnValue!==null&&typeof returnValue.then=="function"&&entangleAsyncAction(transition,returnValue),prevOnStartTransitionFinish!==null&&prevOnStartTransitionFinish(transition,returnValue)};var resumedCache=createCursor(null);function peekCacheFromPool(){var cacheResumedFromPreviousRender=resumedCache.current;return cacheResumedFromPreviousRender!==null?cacheResumedFromPreviousRender:workInProgressRoot.pooledCache}__name(peekCacheFromPool,"peekCacheFromPool");function pushTransition(offscreenWorkInProgress,prevCachePool){prevCachePool===null?push2(resumedCache,resumedCache.current):push2(resumedCache,prevCachePool.pool)}__name(pushTransition,"pushTransition");function getSuspendedCache(){var cacheFromPool=peekCacheFromPool();return cacheFromPool===null?null:{parent:CacheContext._currentValue,pool:cacheFromPool}}__name(getSuspendedCache,"getSuspendedCache");var SuspenseException=Error(formatProdErrorMessage(460)),SuspenseyCommitException=Error(formatProdErrorMessage(474)),SuspenseActionException=Error(formatProdErrorMessage(542)),noopSuspenseyCommitThenable={then:__name(function(){},"then")};function isThenableResolved(thenable){return thenable=thenable.status,thenable==="fulfilled"||thenable==="rejected"}__name(isThenableResolved,"isThenableResolved");function trackUsedThenable(thenableState2,thenable,index3){switch(index3=thenableState2[index3],index3===void 0?thenableState2.push(thenable):index3!==thenable&&(thenable.then(noop$12,noop$12),thenable=index3),thenable.status){case"fulfilled":return thenable.value;case"rejected":throw thenableState2=thenable.reason,checkIfUseWrappedInAsyncCatch(thenableState2),thenableState2;default:if(typeof thenable.status=="string")thenable.then(noop$12,noop$12);else{if(thenableState2=workInProgressRoot,thenableState2!==null&&100<thenableState2.shellSuspendCounter)throw Error(formatProdErrorMessage(482));thenableState2=thenable,thenableState2.status="pending",thenableState2.then(function(fulfilledValue){if(thenable.status==="pending"){var fulfilledThenable=thenable;fulfilledThenable.status="fulfilled",fulfilledThenable.value=fulfilledValue}},function(error2){if(thenable.status==="pending"){var rejectedThenable=thenable;rejectedThenable.status="rejected",rejectedThenable.reason=error2}})}switch(thenable.status){case"fulfilled":return thenable.value;case"rejected":throw thenableState2=thenable.reason,checkIfUseWrappedInAsyncCatch(thenableState2),thenableState2}throw suspendedThenable=thenable,SuspenseException}}__name(trackUsedThenable,"trackUsedThenable");function resolveLazy(lazyType){try{var init2=lazyType._init;return init2(lazyType._payload)}catch(x){throw x!==null&&typeof x=="object"&&typeof x.then=="function"?(suspendedThenable=x,SuspenseException):x}}__name(resolveLazy,"resolveLazy");var suspendedThenable=null;function getSuspendedThenable(){if(suspendedThenable===null)throw Error(formatProdErrorMessage(459));var thenable=suspendedThenable;return suspendedThenable=null,thenable}__name(getSuspendedThenable,"getSuspendedThenable");function checkIfUseWrappedInAsyncCatch(rejectedReason){if(rejectedReason===SuspenseException||rejectedReason===SuspenseActionException)throw Error(formatProdErrorMessage(483))}__name(checkIfUseWrappedInAsyncCatch,"checkIfUseWrappedInAsyncCatch");var thenableState$1=null,thenableIndexCounter$1=0;function unwrapThenable(thenable){var index3=thenableIndexCounter$1;return thenableIndexCounter$1+=1,thenableState$1===null&&(thenableState$1=[]),trackUsedThenable(thenableState$1,thenable,index3)}__name(unwrapThenable,"unwrapThenable");function coerceRef(workInProgress2,element2){element2=element2.props.ref,workInProgress2.ref=element2!==void 0?element2:null}__name(coerceRef,"coerceRef");function throwOnInvalidObjectTypeImpl(returnFiber,newChild){throw newChild.$$typeof===REACT_LEGACY_ELEMENT_TYPE?Error(formatProdErrorMessage(525)):(returnFiber=Object.prototype.toString.call(newChild),Error(formatProdErrorMessage(31,returnFiber==="[object Object]"?"object with keys {"+Object.keys(newChild).join(", ")+"}":returnFiber)))}__name(throwOnInvalidObjectTypeImpl,"throwOnInvalidObjectTypeImpl");function createChildReconciler(shouldTrackSideEffects){function deleteChild(returnFiber,childToDelete){if(shouldTrackSideEffects){var deletions=returnFiber.deletions;deletions===null?(returnFiber.deletions=[childToDelete],returnFiber.flags|=16):deletions.push(childToDelete)}}__name(deleteChild,"deleteChild");function deleteRemainingChildren(returnFiber,currentFirstChild){if(!shouldTrackSideEffects)return null;for(;currentFirstChild!==null;)deleteChild(returnFiber,currentFirstChild),currentFirstChild=currentFirstChild.sibling;return null}__name(deleteRemainingChildren,"deleteRemainingChildren");function mapRemainingChildren(currentFirstChild){for(var existingChildren=new Map;currentFirstChild!==null;)currentFirstChild.key!==null?existingChildren.set(currentFirstChild.key,currentFirstChild):existingChildren.set(currentFirstChild.index,currentFirstChild),currentFirstChild=currentFirstChild.sibling;return existingChildren}__name(mapRemainingChildren,"mapRemainingChildren");function useFiber(fiber,pendingProps){return fiber=createWorkInProgress(fiber,pendingProps),fiber.index=0,fiber.sibling=null,fiber}__name(useFiber,"useFiber");function placeChild(newFiber,lastPlacedIndex,newIndex){return newFiber.index=newIndex,shouldTrackSideEffects?(newIndex=newFiber.alternate,newIndex!==null?(newIndex=newIndex.index,newIndex<lastPlacedIndex?(newFiber.flags|=67108866,lastPlacedIndex):newIndex):(newFiber.flags|=67108866,lastPlacedIndex)):(newFiber.flags|=1048576,lastPlacedIndex)}__name(placeChild,"placeChild");function placeSingleChild(newFiber){return shouldTrackSideEffects&&newFiber.alternate===null&&(newFiber.flags|=67108866),newFiber}__name(placeSingleChild,"placeSingleChild");function updateTextNode(returnFiber,current,textContent,lanes){return current===null||current.tag!==6?(current=createFiberFromText(textContent,returnFiber.mode,lanes),current.return=returnFiber,current):(current=useFiber(current,textContent),current.return=returnFiber,current)}__name(updateTextNode,"updateTextNode");function updateElement(returnFiber,current,element2,lanes){var elementType=element2.type;return elementType===REACT_FRAGMENT_TYPE?updateFragment(returnFiber,current,element2.props.children,lanes,element2.key):current!==null&&(current.elementType===elementType||typeof elementType=="object"&&elementType!==null&&elementType.$$typeof===REACT_LAZY_TYPE2&&resolveLazy(elementType)===current.type)?(current=useFiber(current,element2.props),coerceRef(current,element2),current.return=returnFiber,current):(current=createFiberFromTypeAndProps(element2.type,element2.key,element2.props,null,returnFiber.mode,lanes),coerceRef(current,element2),current.return=returnFiber,current)}__name(updateElement,"updateElement");function updatePortal(returnFiber,current,portal,lanes){return current===null||current.tag!==4||current.stateNode.containerInfo!==portal.containerInfo||current.stateNode.implementation!==portal.implementation?(current=createFiberFromPortal(portal,returnFiber.mode,lanes),current.return=returnFiber,current):(current=useFiber(current,portal.children||[]),current.return=returnFiber,current)}__name(updatePortal,"updatePortal");function updateFragment(returnFiber,current,fragment,lanes,key){return current===null||current.tag!==7?(current=createFiberFromFragment(fragment,returnFiber.mode,lanes,key),current.return=returnFiber,current):(current=useFiber(current,fragment),current.return=returnFiber,current)}__name(updateFragment,"updateFragment");function createChild(returnFiber,newChild,lanes){if(typeof newChild=="string"&&newChild!==""||typeof newChild=="number"||typeof newChild=="bigint")return newChild=createFiberFromText(""+newChild,returnFiber.mode,lanes),newChild.return=returnFiber,newChild;if(typeof newChild=="object"&&newChild!==null){switch(newChild.$$typeof){case REACT_ELEMENT_TYPE:return lanes=createFiberFromTypeAndProps(newChild.type,newChild.key,newChild.props,null,returnFiber.mode,lanes),coerceRef(lanes,newChild),lanes.return=returnFiber,lanes;case REACT_PORTAL_TYPE:return newChild=createFiberFromPortal(newChild,returnFiber.mode,lanes),newChild.return=returnFiber,newChild;case REACT_LAZY_TYPE2:return newChild=resolveLazy(newChild),createChild(returnFiber,newChild,lanes)}if(isArrayImpl(newChild)||getIteratorFn(newChild))return newChild=createFiberFromFragment(newChild,returnFiber.mode,lanes,null),newChild.return=returnFiber,newChild;if(typeof newChild.then=="function")return createChild(returnFiber,unwrapThenable(newChild),lanes);if(newChild.$$typeof===REACT_CONTEXT_TYPE)return createChild(returnFiber,readContextDuringReconciliation(returnFiber,newChild),lanes);throwOnInvalidObjectTypeImpl(returnFiber,newChild)}return null}__name(createChild,"createChild");function updateSlot(returnFiber,oldFiber,newChild,lanes){var key=oldFiber!==null?oldFiber.key:null;if(typeof newChild=="string"&&newChild!==""||typeof newChild=="number"||typeof newChild=="bigint")return key!==null?null:updateTextNode(returnFiber,oldFiber,""+newChild,lanes);if(typeof newChild=="object"&&newChild!==null){switch(newChild.$$typeof){case REACT_ELEMENT_TYPE:return newChild.key===key?updateElement(returnFiber,oldFiber,newChild,lanes):null;case REACT_PORTAL_TYPE:return newChild.key===key?updatePortal(returnFiber,oldFiber,newChild,lanes):null;case REACT_LAZY_TYPE2:return newChild=resolveLazy(newChild),updateSlot(returnFiber,oldFiber,newChild,lanes)}if(isArrayImpl(newChild)||getIteratorFn(newChild))return key!==null?null:updateFragment(returnFiber,oldFiber,newChild,lanes,null);if(typeof newChild.then=="function")return updateSlot(returnFiber,oldFiber,unwrapThenable(newChild),lanes);if(newChild.$$typeof===REACT_CONTEXT_TYPE)return updateSlot(returnFiber,oldFiber,readContextDuringReconciliation(returnFiber,newChild),lanes);throwOnInvalidObjectTypeImpl(returnFiber,newChild)}return null}__name(updateSlot,"updateSlot");function updateFromMap(existingChildren,returnFiber,newIdx,newChild,lanes){if(typeof newChild=="string"&&newChild!==""||typeof newChild=="number"||typeof newChild=="bigint")return existingChildren=existingChildren.get(newIdx)||null,updateTextNode(returnFiber,existingChildren,""+newChild,lanes);if(typeof newChild=="object"&&newChild!==null){switch(newChild.$$typeof){case REACT_ELEMENT_TYPE:return existingChildren=existingChildren.get(newChild.key===null?newIdx:newChild.key)||null,updateElement(returnFiber,existingChildren,newChild,lanes);case REACT_PORTAL_TYPE:return existingChildren=existingChildren.get(newChild.key===null?newIdx:newChild.key)||null,updatePortal(returnFiber,existingChildren,newChild,lanes);case REACT_LAZY_TYPE2:return newChild=resolveLazy(newChild),updateFromMap(existingChildren,returnFiber,newIdx,newChild,lanes)}if(isArrayImpl(newChild)||getIteratorFn(newChild))return existingChildren=existingChildren.get(newIdx)||null,updateFragment(returnFiber,existingChildren,newChild,lanes,null);if(typeof newChild.then=="function")return updateFromMap(existingChildren,returnFiber,newIdx,unwrapThenable(newChild),lanes);if(newChild.$$typeof===REACT_CONTEXT_TYPE)return updateFromMap(existingChildren,returnFiber,newIdx,readContextDuringReconciliation(returnFiber,newChild),lanes);throwOnInvalidObjectTypeImpl(returnFiber,newChild)}return null}__name(updateFromMap,"updateFromMap");function reconcileChildrenArray(returnFiber,currentFirstChild,newChildren,lanes){for(var resultingFirstChild=null,previousNewFiber=null,oldFiber=currentFirstChild,newIdx=currentFirstChild=0,nextOldFiber=null;oldFiber!==null&&newIdx<newChildren.length;newIdx++){oldFiber.index>newIdx?(nextOldFiber=oldFiber,oldFiber=null):nextOldFiber=oldFiber.sibling;var newFiber=updateSlot(returnFiber,oldFiber,newChildren[newIdx],lanes);if(newFiber===null){oldFiber===null&&(oldFiber=nextOldFiber);break}shouldTrackSideEffects&&oldFiber&&newFiber.alternate===null&&deleteChild(returnFiber,oldFiber),currentFirstChild=placeChild(newFiber,currentFirstChild,newIdx),previousNewFiber===null?resultingFirstChild=newFiber:previousNewFiber.sibling=newFiber,previousNewFiber=newFiber,oldFiber=nextOldFiber}if(newIdx===newChildren.length)return deleteRemainingChildren(returnFiber,oldFiber),isHydrating&&pushTreeFork(returnFiber,newIdx),resultingFirstChild;if(oldFiber===null){for(;newIdx<newChildren.length;newIdx++)oldFiber=createChild(returnFiber,newChildren[newIdx],lanes),oldFiber!==null&&(currentFirstChild=placeChild(oldFiber,currentFirstChild,newIdx),previousNewFiber===null?resultingFirstChild=oldFiber:previousNewFiber.sibling=oldFiber,previousNewFiber=oldFiber);return isHydrating&&pushTreeFork(returnFiber,newIdx),resultingFirstChild}for(oldFiber=mapRemainingChildren(oldFiber);newIdx<newChildren.length;newIdx++)nextOldFiber=updateFromMap(oldFiber,returnFiber,newIdx,newChildren[newIdx],lanes),nextOldFiber!==null&&(shouldTrackSideEffects&&nextOldFiber.alternate!==null&&oldFiber.delete(nextOldFiber.key===null?newIdx:nextOldFiber.key),currentFirstChild=placeChild(nextOldFiber,currentFirstChild,newIdx),previousNewFiber===null?resultingFirstChild=nextOldFiber:previousNewFiber.sibling=nextOldFiber,previousNewFiber=nextOldFiber);return shouldTrackSideEffects&&oldFiber.forEach(function(child){return deleteChild(returnFiber,child)}),isHydrating&&pushTreeFork(returnFiber,newIdx),resultingFirstChild}__name(reconcileChildrenArray,"reconcileChildrenArray");function reconcileChildrenIterator(returnFiber,currentFirstChild,newChildren,lanes){if(newChildren==null)throw Error(formatProdErrorMessage(151));for(var resultingFirstChild=null,previousNewFiber=null,oldFiber=currentFirstChild,newIdx=currentFirstChild=0,nextOldFiber=null,step=newChildren.next();oldFiber!==null&&!step.done;newIdx++,step=newChildren.next()){oldFiber.index>newIdx?(nextOldFiber=oldFiber,oldFiber=null):nextOldFiber=oldFiber.sibling;var newFiber=updateSlot(returnFiber,oldFiber,step.value,lanes);if(newFiber===null){oldFiber===null&&(oldFiber=nextOldFiber);break}shouldTrackSideEffects&&oldFiber&&newFiber.alternate===null&&deleteChild(returnFiber,oldFiber),currentFirstChild=placeChild(newFiber,currentFirstChild,newIdx),previousNewFiber===null?resultingFirstChild=newFiber:previousNewFiber.sibling=newFiber,previousNewFiber=newFiber,oldFiber=nextOldFiber}if(step.done)return deleteRemainingChildren(returnFiber,oldFiber),isHydrating&&pushTreeFork(returnFiber,newIdx),resultingFirstChild;if(oldFiber===null){for(;!step.done;newIdx++,step=newChildren.next())step=createChild(returnFiber,step.value,lanes),step!==null&&(currentFirstChild=placeChild(step,currentFirstChild,newIdx),previousNewFiber===null?resultingFirstChild=step:previousNewFiber.sibling=step,previousNewFiber=step);return isHydrating&&pushTreeFork(returnFiber,newIdx),resultingFirstChild}for(oldFiber=mapRemainingChildren(oldFiber);!step.done;newIdx++,step=newChildren.next())step=updateFromMap(oldFiber,returnFiber,newIdx,step.value,lanes),step!==null&&(shouldTrackSideEffects&&step.alternate!==null&&oldFiber.delete(step.key===null?newIdx:step.key),currentFirstChild=placeChild(step,currentFirstChild,newIdx),previousNewFiber===null?resultingFirstChild=step:previousNewFiber.sibling=step,previousNewFiber=step);return shouldTrackSideEffects&&oldFiber.forEach(function(child){return deleteChild(returnFiber,child)}),isHydrating&&pushTreeFork(returnFiber,newIdx),resultingFirstChild}__name(reconcileChildrenIterator,"reconcileChildrenIterator");function reconcileChildFibersImpl(returnFiber,currentFirstChild,newChild,lanes){if(typeof newChild=="object"&&newChild!==null&&newChild.type===REACT_FRAGMENT_TYPE&&newChild.key===null&&(newChild=newChild.props.children),typeof newChild=="object"&&newChild!==null){switch(newChild.$$typeof){case REACT_ELEMENT_TYPE:a:{for(var key=newChild.key;currentFirstChild!==null;){if(currentFirstChild.key===key){if(key=newChild.type,key===REACT_FRAGMENT_TYPE){if(currentFirstChild.tag===7){deleteRemainingChildren(returnFiber,currentFirstChild.sibling),lanes=useFiber(currentFirstChild,newChild.props.children),lanes.return=returnFiber,returnFiber=lanes;break a}}else if(currentFirstChild.elementType===key||typeof key=="object"&&key!==null&&key.$$typeof===REACT_LAZY_TYPE2&&resolveLazy(key)===currentFirstChild.type){deleteRemainingChildren(returnFiber,currentFirstChild.sibling),lanes=useFiber(currentFirstChild,newChild.props),coerceRef(lanes,newChild),lanes.return=returnFiber,returnFiber=lanes;break a}deleteRemainingChildren(returnFiber,currentFirstChild);break}else deleteChild(returnFiber,currentFirstChild);currentFirstChild=currentFirstChild.sibling}newChild.type===REACT_FRAGMENT_TYPE?(lanes=createFiberFromFragment(newChild.props.children,returnFiber.mode,lanes,newChild.key),lanes.return=returnFiber,returnFiber=lanes):(lanes=createFiberFromTypeAndProps(newChild.type,newChild.key,newChild.props,null,returnFiber.mode,lanes),coerceRef(lanes,newChild),lanes.return=returnFiber,returnFiber=lanes)}return placeSingleChild(returnFiber);case REACT_PORTAL_TYPE:a:{for(key=newChild.key;currentFirstChild!==null;){if(currentFirstChild.key===key)if(currentFirstChild.tag===4&¤tFirstChild.stateNode.containerInfo===newChild.containerInfo&¤tFirstChild.stateNode.implementation===newChild.implementation){deleteRemainingChildren(returnFiber,currentFirstChild.sibling),lanes=useFiber(currentFirstChild,newChild.children||[]),lanes.return=returnFiber,returnFiber=lanes;break a}else{deleteRemainingChildren(returnFiber,currentFirstChild);break}else deleteChild(returnFiber,currentFirstChild);currentFirstChild=currentFirstChild.sibling}lanes=createFiberFromPortal(newChild,returnFiber.mode,lanes),lanes.return=returnFiber,returnFiber=lanes}return placeSingleChild(returnFiber);case REACT_LAZY_TYPE2:return newChild=resolveLazy(newChild),reconcileChildFibersImpl(returnFiber,currentFirstChild,newChild,lanes)}if(isArrayImpl(newChild))return reconcileChildrenArray(returnFiber,currentFirstChild,newChild,lanes);if(getIteratorFn(newChild)){if(key=getIteratorFn(newChild),typeof key!="function")throw Error(formatProdErrorMessage(150));return newChild=key.call(newChild),reconcileChildrenIterator(returnFiber,currentFirstChild,newChild,lanes)}if(typeof newChild.then=="function")return reconcileChildFibersImpl(returnFiber,currentFirstChild,unwrapThenable(newChild),lanes);if(newChild.$$typeof===REACT_CONTEXT_TYPE)return reconcileChildFibersImpl(returnFiber,currentFirstChild,readContextDuringReconciliation(returnFiber,newChild),lanes);throwOnInvalidObjectTypeImpl(returnFiber,newChild)}return typeof newChild=="string"&&newChild!==""||typeof newChild=="number"||typeof newChild=="bigint"?(newChild=""+newChild,currentFirstChild!==null&¤tFirstChild.tag===6?(deleteRemainingChildren(returnFiber,currentFirstChild.sibling),lanes=useFiber(currentFirstChild,newChild),lanes.return=returnFiber,returnFiber=lanes):(deleteRemainingChildren(returnFiber,currentFirstChild),lanes=createFiberFromText(newChild,returnFiber.mode,lanes),lanes.return=returnFiber,returnFiber=lanes),placeSingleChild(returnFiber)):deleteRemainingChildren(returnFiber,currentFirstChild)}return __name(reconcileChildFibersImpl,"reconcileChildFibersImpl"),function(returnFiber,currentFirstChild,newChild,lanes){try{thenableIndexCounter$1=0;var firstChildFiber=reconcileChildFibersImpl(returnFiber,currentFirstChild,newChild,lanes);return thenableState$1=null,firstChildFiber}catch(x){if(x===SuspenseException||x===SuspenseActionException)throw x;var fiber=createFiberImplClass(29,x,null,returnFiber.mode);return fiber.lanes=lanes,fiber.return=returnFiber,fiber}}}__name(createChildReconciler,"createChildReconciler");var reconcileChildFibers=createChildReconciler(!0),mountChildFibers=createChildReconciler(!1),hasForceUpdate=!1;function initializeUpdateQueue(fiber){fiber.updateQueue={baseState:fiber.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}__name(initializeUpdateQueue,"initializeUpdateQueue");function cloneUpdateQueue(current,workInProgress2){current=current.updateQueue,workInProgress2.updateQueue===current&&(workInProgress2.updateQueue={baseState:current.baseState,firstBaseUpdate:current.firstBaseUpdate,lastBaseUpdate:current.lastBaseUpdate,shared:current.shared,callbacks:null})}__name(cloneUpdateQueue,"cloneUpdateQueue");function createUpdate(lane){return{lane,tag:0,payload:null,callback:null,next:null}}__name(createUpdate,"createUpdate");function enqueueUpdate(fiber,update,lane){var updateQueue=fiber.updateQueue;if(updateQueue===null)return null;if(updateQueue=updateQueue.shared,(executionContext&2)!==0){var pending=updateQueue.pending;return pending===null?update.next=update:(update.next=pending.next,pending.next=update),updateQueue.pending=update,update=getRootForUpdatedFiber(fiber),markUpdateLaneFromFiberToRoot(fiber,null,lane),update}return enqueueUpdate$1(fiber,updateQueue,update,lane),getRootForUpdatedFiber(fiber)}__name(enqueueUpdate,"enqueueUpdate");function entangleTransitions(root3,fiber,lane){if(fiber=fiber.updateQueue,fiber!==null&&(fiber=fiber.shared,(lane&4194048)!==0)){var queueLanes=fiber.lanes;queueLanes&=root3.pendingLanes,lane|=queueLanes,fiber.lanes=lane,markRootEntangled(root3,lane)}}__name(entangleTransitions,"entangleTransitions");function enqueueCapturedUpdate(workInProgress2,capturedUpdate){var queue=workInProgress2.updateQueue,current=workInProgress2.alternate;if(current!==null&&(current=current.updateQueue,queue===current)){var newFirst=null,newLast=null;if(queue=queue.firstBaseUpdate,queue!==null){do{var clone2={lane:queue.lane,tag:queue.tag,payload:queue.payload,callback:null,next:null};newLast===null?newFirst=newLast=clone2:newLast=newLast.next=clone2,queue=queue.next}while(queue!==null);newLast===null?newFirst=newLast=capturedUpdate:newLast=newLast.next=capturedUpdate}else newFirst=newLast=capturedUpdate;queue={baseState:current.baseState,firstBaseUpdate:newFirst,lastBaseUpdate:newLast,shared:current.shared,callbacks:current.callbacks},workInProgress2.updateQueue=queue;return}workInProgress2=queue.lastBaseUpdate,workInProgress2===null?queue.firstBaseUpdate=capturedUpdate:workInProgress2.next=capturedUpdate,queue.lastBaseUpdate=capturedUpdate}__name(enqueueCapturedUpdate,"enqueueCapturedUpdate");var didReadFromEntangledAsyncAction=!1;function suspendIfUpdateReadFromEntangledAsyncAction(){if(didReadFromEntangledAsyncAction){var entangledActionThenable=currentEntangledActionThenable;if(entangledActionThenable!==null)throw entangledActionThenable}}__name(suspendIfUpdateReadFromEntangledAsyncAction,"suspendIfUpdateReadFromEntangledAsyncAction");function processUpdateQueue(workInProgress$jscomp$0,props,instance$jscomp$0,renderLanes2){didReadFromEntangledAsyncAction=!1;var queue=workInProgress$jscomp$0.updateQueue;hasForceUpdate=!1;var firstBaseUpdate=queue.firstBaseUpdate,lastBaseUpdate=queue.lastBaseUpdate,pendingQueue=queue.shared.pending;if(pendingQueue!==null){queue.shared.pending=null;var lastPendingUpdate=pendingQueue,firstPendingUpdate=lastPendingUpdate.next;lastPendingUpdate.next=null,lastBaseUpdate===null?firstBaseUpdate=firstPendingUpdate:lastBaseUpdate.next=firstPendingUpdate,lastBaseUpdate=lastPendingUpdate;var current=workInProgress$jscomp$0.alternate;current!==null&&(current=current.updateQueue,pendingQueue=current.lastBaseUpdate,pendingQueue!==lastBaseUpdate&&(pendingQueue===null?current.firstBaseUpdate=firstPendingUpdate:pendingQueue.next=firstPendingUpdate,current.lastBaseUpdate=lastPendingUpdate))}if(firstBaseUpdate!==null){var newState=queue.baseState;lastBaseUpdate=0,current=firstPendingUpdate=lastPendingUpdate=null,pendingQueue=firstBaseUpdate;do{var updateLane=pendingQueue.lane&-536870913,isHiddenUpdate=updateLane!==pendingQueue.lane;if(isHiddenUpdate?(workInProgressRootRenderLanes&updateLane)===updateLane:(renderLanes2&updateLane)===updateLane){updateLane!==0&&updateLane===currentEntangledLane&&(didReadFromEntangledAsyncAction=!0),current!==null&&(current=current.next={lane:0,tag:pendingQueue.tag,payload:pendingQueue.payload,callback:null,next:null});a:{var workInProgress2=workInProgress$jscomp$0,update=pendingQueue;updateLane=props;var instance=instance$jscomp$0;switch(update.tag){case 1:if(workInProgress2=update.payload,typeof workInProgress2=="function"){newState=workInProgress2.call(instance,newState,updateLane);break a}newState=workInProgress2;break a;case 3:workInProgress2.flags=workInProgress2.flags&-65537|128;case 0:if(workInProgress2=update.payload,updateLane=typeof workInProgress2=="function"?workInProgress2.call(instance,newState,updateLane):workInProgress2,updateLane==null)break a;newState=assign({},newState,updateLane);break a;case 2:hasForceUpdate=!0}}updateLane=pendingQueue.callback,updateLane!==null&&(workInProgress$jscomp$0.flags|=64,isHiddenUpdate&&(workInProgress$jscomp$0.flags|=8192),isHiddenUpdate=queue.callbacks,isHiddenUpdate===null?queue.callbacks=[updateLane]:isHiddenUpdate.push(updateLane))}else isHiddenUpdate={lane:updateLane,tag:pendingQueue.tag,payload:pendingQueue.payload,callback:pendingQueue.callback,next:null},current===null?(firstPendingUpdate=current=isHiddenUpdate,lastPendingUpdate=newState):current=current.next=isHiddenUpdate,lastBaseUpdate|=updateLane;if(pendingQueue=pendingQueue.next,pendingQueue===null){if(pendingQueue=queue.shared.pending,pendingQueue===null)break;isHiddenUpdate=pendingQueue,pendingQueue=isHiddenUpdate.next,isHiddenUpdate.next=null,queue.lastBaseUpdate=isHiddenUpdate,queue.shared.pending=null}}while(!0);current===null&&(lastPendingUpdate=newState),queue.baseState=lastPendingUpdate,queue.firstBaseUpdate=firstPendingUpdate,queue.lastBaseUpdate=current,firstBaseUpdate===null&&(queue.shared.lanes=0),workInProgressRootSkippedLanes|=lastBaseUpdate,workInProgress$jscomp$0.lanes=lastBaseUpdate,workInProgress$jscomp$0.memoizedState=newState}}__name(processUpdateQueue,"processUpdateQueue");function callCallback(callback,context){if(typeof callback!="function")throw Error(formatProdErrorMessage(191,callback));callback.call(context)}__name(callCallback,"callCallback");function commitCallbacks(updateQueue,context){var callbacks=updateQueue.callbacks;if(callbacks!==null)for(updateQueue.callbacks=null,updateQueue=0;updateQueue<callbacks.length;updateQueue++)callCallback(callbacks[updateQueue],context)}__name(commitCallbacks,"commitCallbacks");var currentTreeHiddenStackCursor=createCursor(null),prevEntangledRenderLanesCursor=createCursor(0);function pushHiddenContext(fiber,context){fiber=entangledRenderLanes,push2(prevEntangledRenderLanesCursor,fiber),push2(currentTreeHiddenStackCursor,context),entangledRenderLanes=fiber|context.baseLanes}__name(pushHiddenContext,"pushHiddenContext");function reuseHiddenContextOnStack(){push2(prevEntangledRenderLanesCursor,entangledRenderLanes),push2(currentTreeHiddenStackCursor,currentTreeHiddenStackCursor.current)}__name(reuseHiddenContextOnStack,"reuseHiddenContextOnStack");function popHiddenContext(){entangledRenderLanes=prevEntangledRenderLanesCursor.current,pop(currentTreeHiddenStackCursor),pop(prevEntangledRenderLanesCursor)}__name(popHiddenContext,"popHiddenContext");var suspenseHandlerStackCursor=createCursor(null),shellBoundary=null;function pushPrimaryTreeSuspenseHandler(handler){var current=handler.alternate;push2(suspenseStackCursor,suspenseStackCursor.current&1),push2(suspenseHandlerStackCursor,handler),shellBoundary===null&&(current===null||currentTreeHiddenStackCursor.current!==null||current.memoizedState!==null)&&(shellBoundary=handler)}__name(pushPrimaryTreeSuspenseHandler,"pushPrimaryTreeSuspenseHandler");function pushDehydratedActivitySuspenseHandler(fiber){push2(suspenseStackCursor,suspenseStackCursor.current),push2(suspenseHandlerStackCursor,fiber),shellBoundary===null&&(shellBoundary=fiber)}__name(pushDehydratedActivitySuspenseHandler,"pushDehydratedActivitySuspenseHandler");function pushOffscreenSuspenseHandler(fiber){fiber.tag===22?(push2(suspenseStackCursor,suspenseStackCursor.current),push2(suspenseHandlerStackCursor,fiber),shellBoundary===null&&(shellBoundary=fiber)):reuseSuspenseHandlerOnStack()}__name(pushOffscreenSuspenseHandler,"pushOffscreenSuspenseHandler");function reuseSuspenseHandlerOnStack(){push2(suspenseStackCursor,suspenseStackCursor.current),push2(suspenseHandlerStackCursor,suspenseHandlerStackCursor.current)}__name(reuseSuspenseHandlerOnStack,"reuseSuspenseHandlerOnStack");function popSuspenseHandler(fiber){pop(suspenseHandlerStackCursor),shellBoundary===fiber&&(shellBoundary=null),pop(suspenseStackCursor)}__name(popSuspenseHandler,"popSuspenseHandler");var suspenseStackCursor=createCursor(0);function findFirstSuspended(row){for(var node2=row;node2!==null;){if(node2.tag===13){var state2=node2.memoizedState;if(state2!==null&&(state2=state2.dehydrated,state2===null||isSuspenseInstancePending(state2)||isSuspenseInstanceFallback(state2)))return node2}else if(node2.tag===19&&(node2.memoizedProps.revealOrder==="forwards"||node2.memoizedProps.revealOrder==="backwards"||node2.memoizedProps.revealOrder==="unstable_legacy-backwards"||node2.memoizedProps.revealOrder==="together")){if((node2.flags&128)!==0)return node2}else if(node2.child!==null){node2.child.return=node2,node2=node2.child;continue}if(node2===row)break;for(;node2.sibling===null;){if(node2.return===null||node2.return===row)return null;node2=node2.return}node2.sibling.return=node2.return,node2=node2.sibling}return null}__name(findFirstSuspended,"findFirstSuspended");var renderLanes=0,currentlyRenderingFiber=null,currentHook=null,workInProgressHook=null,didScheduleRenderPhaseUpdate=!1,didScheduleRenderPhaseUpdateDuringThisPass=!1,shouldDoubleInvokeUserFnsInHooksDEV=!1,localIdCounter=0,thenableIndexCounter=0,thenableState=null,globalClientIdCounter=0;function throwInvalidHookError(){throw Error(formatProdErrorMessage(321))}__name(throwInvalidHookError,"throwInvalidHookError");function areHookInputsEqual(nextDeps,prevDeps){if(prevDeps===null)return!1;for(var i2=0;i2<prevDeps.length&&i2<nextDeps.length;i2++)if(!objectIs(nextDeps[i2],prevDeps[i2]))return!1;return!0}__name(areHookInputsEqual,"areHookInputsEqual");function renderWithHooks(current,workInProgress2,Component,props,secondArg,nextRenderLanes){return renderLanes=nextRenderLanes,currentlyRenderingFiber=workInProgress2,workInProgress2.memoizedState=null,workInProgress2.updateQueue=null,workInProgress2.lanes=0,ReactSharedInternals.H=current===null||current.memoizedState===null?HooksDispatcherOnMount:HooksDispatcherOnUpdate,shouldDoubleInvokeUserFnsInHooksDEV=!1,nextRenderLanes=Component(props,secondArg),shouldDoubleInvokeUserFnsInHooksDEV=!1,didScheduleRenderPhaseUpdateDuringThisPass&&(nextRenderLanes=renderWithHooksAgain(workInProgress2,Component,props,secondArg)),finishRenderingHooks(current),nextRenderLanes}__name(renderWithHooks,"renderWithHooks");function finishRenderingHooks(current){ReactSharedInternals.H=ContextOnlyDispatcher;var didRenderTooFewHooks=currentHook!==null&¤tHook.next!==null;if(renderLanes=0,workInProgressHook=currentHook=currentlyRenderingFiber=null,didScheduleRenderPhaseUpdate=!1,thenableIndexCounter=0,thenableState=null,didRenderTooFewHooks)throw Error(formatProdErrorMessage(300));current===null||didReceiveUpdate||(current=current.dependencies,current!==null&&checkIfContextChanged(current)&&(didReceiveUpdate=!0))}__name(finishRenderingHooks,"finishRenderingHooks");function renderWithHooksAgain(workInProgress2,Component,props,secondArg){currentlyRenderingFiber=workInProgress2;var numberOfReRenders=0;do{if(didScheduleRenderPhaseUpdateDuringThisPass&&(thenableState=null),thenableIndexCounter=0,didScheduleRenderPhaseUpdateDuringThisPass=!1,25<=numberOfReRenders)throw Error(formatProdErrorMessage(301));if(numberOfReRenders+=1,workInProgressHook=currentHook=null,workInProgress2.updateQueue!=null){var children=workInProgress2.updateQueue;children.lastEffect=null,children.events=null,children.stores=null,children.memoCache!=null&&(children.memoCache.index=0)}ReactSharedInternals.H=HooksDispatcherOnRerender,children=Component(props,secondArg)}while(didScheduleRenderPhaseUpdateDuringThisPass);return children}__name(renderWithHooksAgain,"renderWithHooksAgain");function TransitionAwareHostComponent(){var dispatcher=ReactSharedInternals.H,maybeThenable=dispatcher.useState()[0];return maybeThenable=typeof maybeThenable.then=="function"?useThenable(maybeThenable):maybeThenable,dispatcher=dispatcher.useState()[0],(currentHook!==null?currentHook.memoizedState:null)!==dispatcher&&(currentlyRenderingFiber.flags|=1024),maybeThenable}__name(TransitionAwareHostComponent,"TransitionAwareHostComponent");function checkDidRenderIdHook(){var didRenderIdHook=localIdCounter!==0;return localIdCounter=0,didRenderIdHook}__name(checkDidRenderIdHook,"checkDidRenderIdHook");function bailoutHooks(current,workInProgress2,lanes){workInProgress2.updateQueue=current.updateQueue,workInProgress2.flags&=-2053,current.lanes&=~lanes}__name(bailoutHooks,"bailoutHooks");function resetHooksOnUnwind(workInProgress2){if(didScheduleRenderPhaseUpdate){for(workInProgress2=workInProgress2.memoizedState;workInProgress2!==null;){var queue=workInProgress2.queue;queue!==null&&(queue.pending=null),workInProgress2=workInProgress2.next}didScheduleRenderPhaseUpdate=!1}renderLanes=0,workInProgressHook=currentHook=currentlyRenderingFiber=null,didScheduleRenderPhaseUpdateDuringThisPass=!1,thenableIndexCounter=localIdCounter=0,thenableState=null}__name(resetHooksOnUnwind,"resetHooksOnUnwind");function mountWorkInProgressHook(){var hook={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return workInProgressHook===null?currentlyRenderingFiber.memoizedState=workInProgressHook=hook:workInProgressHook=workInProgressHook.next=hook,workInProgressHook}__name(mountWorkInProgressHook,"mountWorkInProgressHook");function updateWorkInProgressHook(){if(currentHook===null){var nextCurrentHook=currentlyRenderingFiber.alternate;nextCurrentHook=nextCurrentHook!==null?nextCurrentHook.memoizedState:null}else nextCurrentHook=currentHook.next;var nextWorkInProgressHook=workInProgressHook===null?currentlyRenderingFiber.memoizedState:workInProgressHook.next;if(nextWorkInProgressHook!==null)workInProgressHook=nextWorkInProgressHook,currentHook=nextCurrentHook;else{if(nextCurrentHook===null)throw currentlyRenderingFiber.alternate===null?Error(formatProdErrorMessage(467)):Error(formatProdErrorMessage(310));currentHook=nextCurrentHook,nextCurrentHook={memoizedState:currentHook.memoizedState,baseState:currentHook.baseState,baseQueue:currentHook.baseQueue,queue:currentHook.queue,next:null},workInProgressHook===null?currentlyRenderingFiber.memoizedState=workInProgressHook=nextCurrentHook:workInProgressHook=workInProgressHook.next=nextCurrentHook}return workInProgressHook}__name(updateWorkInProgressHook,"updateWorkInProgressHook");function createFunctionComponentUpdateQueue(){return{lastEffect:null,events:null,stores:null,memoCache:null}}__name(createFunctionComponentUpdateQueue,"createFunctionComponentUpdateQueue");function useThenable(thenable){var index3=thenableIndexCounter;return thenableIndexCounter+=1,thenableState===null&&(thenableState=[]),thenable=trackUsedThenable(thenableState,thenable,index3),index3=currentlyRenderingFiber,(workInProgressHook===null?index3.memoizedState:workInProgressHook.next)===null&&(index3=index3.alternate,ReactSharedInternals.H=index3===null||index3.memoizedState===null?HooksDispatcherOnMount:HooksDispatcherOnUpdate),thenable}__name(useThenable,"useThenable");function use2(usable){if(usable!==null&&typeof usable=="object"){if(typeof usable.then=="function")return useThenable(usable);if(usable.$$typeof===REACT_CONTEXT_TYPE)return readContext(usable)}throw Error(formatProdErrorMessage(438,String(usable)))}__name(use2,"use");function useMemoCache(size2){var memoCache=null,updateQueue=currentlyRenderingFiber.updateQueue;if(updateQueue!==null&&(memoCache=updateQueue.memoCache),memoCache==null){var current=currentlyRenderingFiber.alternate;current!==null&&(current=current.updateQueue,current!==null&&(current=current.memoCache,current!=null&&(memoCache={data:current.data.map(function(array2){return array2.slice()}),index:0})))}if(memoCache==null&&(memoCache={data:[],index:0}),updateQueue===null&&(updateQueue=createFunctionComponentUpdateQueue(),currentlyRenderingFiber.updateQueue=updateQueue),updateQueue.memoCache=memoCache,updateQueue=memoCache.data[memoCache.index],updateQueue===void 0)for(updateQueue=memoCache.data[memoCache.index]=Array(size2),current=0;current<size2;current++)updateQueue[current]=REACT_MEMO_CACHE_SENTINEL;return memoCache.index++,updateQueue}__name(useMemoCache,"useMemoCache");function basicStateReducer(state2,action){return typeof action=="function"?action(state2):action}__name(basicStateReducer,"basicStateReducer");function updateReducer(reducer2){var hook=updateWorkInProgressHook();return updateReducerImpl(hook,currentHook,reducer2)}__name(updateReducer,"updateReducer");function updateReducerImpl(hook,current,reducer2){var queue=hook.queue;if(queue===null)throw Error(formatProdErrorMessage(311));queue.lastRenderedReducer=reducer2;var baseQueue=hook.baseQueue,pendingQueue=queue.pending;if(pendingQueue!==null){if(baseQueue!==null){var baseFirst=baseQueue.next;baseQueue.next=pendingQueue.next,pendingQueue.next=baseFirst}current.baseQueue=baseQueue=pendingQueue,queue.pending=null}if(pendingQueue=hook.baseState,baseQueue===null)hook.memoizedState=pendingQueue;else{current=baseQueue.next;var newBaseQueueFirst=baseFirst=null,newBaseQueueLast=null,update=current,didReadFromEntangledAsyncAction$60=!1;do{var updateLane=update.lane&-536870913;if(updateLane!==update.lane?(workInProgressRootRenderLanes&updateLane)===updateLane:(renderLanes&updateLane)===updateLane){var revertLane=update.revertLane;if(revertLane===0)newBaseQueueLast!==null&&(newBaseQueueLast=newBaseQueueLast.next={lane:0,revertLane:0,gesture:null,action:update.action,hasEagerState:update.hasEagerState,eagerState:update.eagerState,next:null}),updateLane===currentEntangledLane&&(didReadFromEntangledAsyncAction$60=!0);else if((renderLanes&revertLane)===revertLane){update=update.next,revertLane===currentEntangledLane&&(didReadFromEntangledAsyncAction$60=!0);continue}else updateLane={lane:0,revertLane:update.revertLane,gesture:null,action:update.action,hasEagerState:update.hasEagerState,eagerState:update.eagerState,next:null},newBaseQueueLast===null?(newBaseQueueFirst=newBaseQueueLast=updateLane,baseFirst=pendingQueue):newBaseQueueLast=newBaseQueueLast.next=updateLane,currentlyRenderingFiber.lanes|=revertLane,workInProgressRootSkippedLanes|=revertLane;updateLane=update.action,shouldDoubleInvokeUserFnsInHooksDEV&&reducer2(pendingQueue,updateLane),pendingQueue=update.hasEagerState?update.eagerState:reducer2(pendingQueue,updateLane)}else revertLane={lane:updateLane,revertLane:update.revertLane,gesture:update.gesture,action:update.action,hasEagerState:update.hasEagerState,eagerState:update.eagerState,next:null},newBaseQueueLast===null?(newBaseQueueFirst=newBaseQueueLast=revertLane,baseFirst=pendingQueue):newBaseQueueLast=newBaseQueueLast.next=revertLane,currentlyRenderingFiber.lanes|=updateLane,workInProgressRootSkippedLanes|=updateLane;update=update.next}while(update!==null&&update!==current);if(newBaseQueueLast===null?baseFirst=pendingQueue:newBaseQueueLast.next=newBaseQueueFirst,!objectIs(pendingQueue,hook.memoizedState)&&(didReceiveUpdate=!0,didReadFromEntangledAsyncAction$60&&(reducer2=currentEntangledActionThenable,reducer2!==null)))throw reducer2;hook.memoizedState=pendingQueue,hook.baseState=baseFirst,hook.baseQueue=newBaseQueueLast,queue.lastRenderedState=pendingQueue}return baseQueue===null&&(queue.lanes=0),[hook.memoizedState,queue.dispatch]}__name(updateReducerImpl,"updateReducerImpl");function rerenderReducer(reducer2){var hook=updateWorkInProgressHook(),queue=hook.queue;if(queue===null)throw Error(formatProdErrorMessage(311));queue.lastRenderedReducer=reducer2;var dispatch=queue.dispatch,lastRenderPhaseUpdate=queue.pending,newState=hook.memoizedState;if(lastRenderPhaseUpdate!==null){queue.pending=null;var update=lastRenderPhaseUpdate=lastRenderPhaseUpdate.next;do newState=reducer2(newState,update.action),update=update.next;while(update!==lastRenderPhaseUpdate);objectIs(newState,hook.memoizedState)||(didReceiveUpdate=!0),hook.memoizedState=newState,hook.baseQueue===null&&(hook.baseState=newState),queue.lastRenderedState=newState}return[newState,dispatch]}__name(rerenderReducer,"rerenderReducer");function updateSyncExternalStore(subscribe2,getSnapshot,getServerSnapshot){var fiber=currentlyRenderingFiber,hook=updateWorkInProgressHook(),isHydrating$jscomp$0=isHydrating;if(isHydrating$jscomp$0){if(getServerSnapshot===void 0)throw Error(formatProdErrorMessage(407));getServerSnapshot=getServerSnapshot()}else getServerSnapshot=getSnapshot();var snapshotChanged=!objectIs((currentHook||hook).memoizedState,getServerSnapshot);if(snapshotChanged&&(hook.memoizedState=getServerSnapshot,didReceiveUpdate=!0),hook=hook.queue,updateEffect(subscribeToStore.bind(null,fiber,hook,subscribe2),[subscribe2]),hook.getSnapshot!==getSnapshot||snapshotChanged||workInProgressHook!==null&&workInProgressHook.memoizedState.tag&1){if(fiber.flags|=2048,pushSimpleEffect(9,{destroy:void 0},updateStoreInstance.bind(null,fiber,hook,getServerSnapshot,getSnapshot),null),workInProgressRoot===null)throw Error(formatProdErrorMessage(349));isHydrating$jscomp$0||(renderLanes&127)!==0||pushStoreConsistencyCheck(fiber,getSnapshot,getServerSnapshot)}return getServerSnapshot}__name(updateSyncExternalStore,"updateSyncExternalStore");function pushStoreConsistencyCheck(fiber,getSnapshot,renderedSnapshot){fiber.flags|=16384,fiber={getSnapshot,value:renderedSnapshot},getSnapshot=currentlyRenderingFiber.updateQueue,getSnapshot===null?(getSnapshot=createFunctionComponentUpdateQueue(),currentlyRenderingFiber.updateQueue=getSnapshot,getSnapshot.stores=[fiber]):(renderedSnapshot=getSnapshot.stores,renderedSnapshot===null?getSnapshot.stores=[fiber]:renderedSnapshot.push(fiber))}__name(pushStoreConsistencyCheck,"pushStoreConsistencyCheck");function updateStoreInstance(fiber,inst,nextSnapshot,getSnapshot){inst.value=nextSnapshot,inst.getSnapshot=getSnapshot,checkIfSnapshotChanged(inst)&&forceStoreRerender(fiber)}__name(updateStoreInstance,"updateStoreInstance");function subscribeToStore(fiber,inst,subscribe2){return subscribe2(function(){checkIfSnapshotChanged(inst)&&forceStoreRerender(fiber)})}__name(subscribeToStore,"subscribeToStore");function checkIfSnapshotChanged(inst){var latestGetSnapshot=inst.getSnapshot;inst=inst.value;try{var nextValue=latestGetSnapshot();return!objectIs(inst,nextValue)}catch{return!0}}__name(checkIfSnapshotChanged,"checkIfSnapshotChanged");function forceStoreRerender(fiber){var root3=enqueueConcurrentRenderForLane(fiber,2);root3!==null&&scheduleUpdateOnFiber(root3,fiber,2)}__name(forceStoreRerender,"forceStoreRerender");function mountStateImpl(initialState2){var hook=mountWorkInProgressHook();if(typeof initialState2=="function"){var initialStateInitializer=initialState2;if(initialState2=initialStateInitializer(),shouldDoubleInvokeUserFnsInHooksDEV){setIsStrictModeForDevtools(!0);try{initialStateInitializer()}finally{setIsStrictModeForDevtools(!1)}}}return hook.memoizedState=hook.baseState=initialState2,hook.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:basicStateReducer,lastRenderedState:initialState2},hook}__name(mountStateImpl,"mountStateImpl");function updateOptimisticImpl(hook,current,passthrough,reducer2){return hook.baseState=passthrough,updateReducerImpl(hook,currentHook,typeof reducer2=="function"?reducer2:basicStateReducer)}__name(updateOptimisticImpl,"updateOptimisticImpl");function dispatchActionState(fiber,actionQueue,setPendingState,setState2,payload){if(isRenderPhaseUpdate(fiber))throw Error(formatProdErrorMessage(485));if(fiber=actionQueue.action,fiber!==null){var actionNode={payload,action:fiber,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:__name(function(listener){actionNode.listeners.push(listener)},"then")};ReactSharedInternals.T!==null?setPendingState(!0):actionNode.isTransition=!1,setState2(actionNode),setPendingState=actionQueue.pending,setPendingState===null?(actionNode.next=actionQueue.pending=actionNode,runActionStateAction(actionQueue,actionNode)):(actionNode.next=setPendingState.next,actionQueue.pending=setPendingState.next=actionNode)}}__name(dispatchActionState,"dispatchActionState");function runActionStateAction(actionQueue,node2){var action=node2.action,payload=node2.payload,prevState=actionQueue.state;if(node2.isTransition){var prevTransition=ReactSharedInternals.T,currentTransition={};ReactSharedInternals.T=currentTransition;try{var returnValue=action(prevState,payload),onStartTransitionFinish=ReactSharedInternals.S;onStartTransitionFinish!==null&&onStartTransitionFinish(currentTransition,returnValue),handleActionReturnValue(actionQueue,node2,returnValue)}catch(error2){onActionError(actionQueue,node2,error2)}finally{prevTransition!==null&¤tTransition.types!==null&&(prevTransition.types=currentTransition.types),ReactSharedInternals.T=prevTransition}}else try{prevTransition=action(prevState,payload),handleActionReturnValue(actionQueue,node2,prevTransition)}catch(error$66){onActionError(actionQueue,node2,error$66)}}__name(runActionStateAction,"runActionStateAction");function handleActionReturnValue(actionQueue,node2,returnValue){returnValue!==null&&typeof returnValue=="object"&&typeof returnValue.then=="function"?returnValue.then(function(nextState){onActionSuccess(actionQueue,node2,nextState)},function(error2){return onActionError(actionQueue,node2,error2)}):onActionSuccess(actionQueue,node2,returnValue)}__name(handleActionReturnValue,"handleActionReturnValue");function onActionSuccess(actionQueue,actionNode,nextState){actionNode.status="fulfilled",actionNode.value=nextState,notifyActionListeners(actionNode),actionQueue.state=nextState,actionNode=actionQueue.pending,actionNode!==null&&(nextState=actionNode.next,nextState===actionNode?actionQueue.pending=null:(nextState=nextState.next,actionNode.next=nextState,runActionStateAction(actionQueue,nextState)))}__name(onActionSuccess,"onActionSuccess");function onActionError(actionQueue,actionNode,error2){var last2=actionQueue.pending;if(actionQueue.pending=null,last2!==null){last2=last2.next;do actionNode.status="rejected",actionNode.reason=error2,notifyActionListeners(actionNode),actionNode=actionNode.next;while(actionNode!==last2)}actionQueue.action=null}__name(onActionError,"onActionError");function notifyActionListeners(actionNode){actionNode=actionNode.listeners;for(var i2=0;i2<actionNode.length;i2++)(0,actionNode[i2])()}__name(notifyActionListeners,"notifyActionListeners");function actionStateReducer(oldState,newState){return newState}__name(actionStateReducer,"actionStateReducer");function mountActionState(action,initialStateProp){if(isHydrating){var ssrFormState=workInProgressRoot.formState;if(ssrFormState!==null){a:{var JSCompiler_inline_result=currentlyRenderingFiber;if(isHydrating){if(nextHydratableInstance){b:{for(var JSCompiler_inline_result$jscomp$0=nextHydratableInstance,inRootOrSingleton=rootOrSingletonContext;JSCompiler_inline_result$jscomp$0.nodeType!==8;){if(!inRootOrSingleton){JSCompiler_inline_result$jscomp$0=null;break b}if(JSCompiler_inline_result$jscomp$0=getNextHydratable(JSCompiler_inline_result$jscomp$0.nextSibling),JSCompiler_inline_result$jscomp$0===null){JSCompiler_inline_result$jscomp$0=null;break b}}inRootOrSingleton=JSCompiler_inline_result$jscomp$0.data,JSCompiler_inline_result$jscomp$0=inRootOrSingleton==="F!"||inRootOrSingleton==="F"?JSCompiler_inline_result$jscomp$0:null}if(JSCompiler_inline_result$jscomp$0){nextHydratableInstance=getNextHydratable(JSCompiler_inline_result$jscomp$0.nextSibling),JSCompiler_inline_result=JSCompiler_inline_result$jscomp$0.data==="F!";break a}}throwOnHydrationMismatch(JSCompiler_inline_result)}JSCompiler_inline_result=!1}JSCompiler_inline_result&&(initialStateProp=ssrFormState[0])}}return ssrFormState=mountWorkInProgressHook(),ssrFormState.memoizedState=ssrFormState.baseState=initialStateProp,JSCompiler_inline_result={pending:null,lanes:0,dispatch:null,lastRenderedReducer:actionStateReducer,lastRenderedState:initialStateProp},ssrFormState.queue=JSCompiler_inline_result,ssrFormState=dispatchSetState.bind(null,currentlyRenderingFiber,JSCompiler_inline_result),JSCompiler_inline_result.dispatch=ssrFormState,JSCompiler_inline_result=mountStateImpl(!1),inRootOrSingleton=dispatchOptimisticSetState.bind(null,currentlyRenderingFiber,!1,JSCompiler_inline_result.queue),JSCompiler_inline_result=mountWorkInProgressHook(),JSCompiler_inline_result$jscomp$0={state:initialStateProp,dispatch:null,action,pending:null},JSCompiler_inline_result.queue=JSCompiler_inline_result$jscomp$0,ssrFormState=dispatchActionState.bind(null,currentlyRenderingFiber,JSCompiler_inline_result$jscomp$0,inRootOrSingleton,ssrFormState),JSCompiler_inline_result$jscomp$0.dispatch=ssrFormState,JSCompiler_inline_result.memoizedState=action,[initialStateProp,ssrFormState,!1]}__name(mountActionState,"mountActionState");function updateActionState(action){var stateHook=updateWorkInProgressHook();return updateActionStateImpl(stateHook,currentHook,action)}__name(updateActionState,"updateActionState");function updateActionStateImpl(stateHook,currentStateHook,action){if(currentStateHook=updateReducerImpl(stateHook,currentStateHook,actionStateReducer)[0],stateHook=updateReducer(basicStateReducer)[0],typeof currentStateHook=="object"&¤tStateHook!==null&&typeof currentStateHook.then=="function")try{var state2=useThenable(currentStateHook)}catch(x){throw x===SuspenseException?SuspenseActionException:x}else state2=currentStateHook;currentStateHook=updateWorkInProgressHook();var actionQueue=currentStateHook.queue,dispatch=actionQueue.dispatch;return action!==currentStateHook.memoizedState&&(currentlyRenderingFiber.flags|=2048,pushSimpleEffect(9,{destroy:void 0},actionStateActionEffect.bind(null,actionQueue,action),null)),[state2,dispatch,stateHook]}__name(updateActionStateImpl,"updateActionStateImpl");function actionStateActionEffect(actionQueue,action){actionQueue.action=action}__name(actionStateActionEffect,"actionStateActionEffect");function rerenderActionState(action){var stateHook=updateWorkInProgressHook(),currentStateHook=currentHook;if(currentStateHook!==null)return updateActionStateImpl(stateHook,currentStateHook,action);updateWorkInProgressHook(),stateHook=stateHook.memoizedState,currentStateHook=updateWorkInProgressHook();var dispatch=currentStateHook.queue.dispatch;return currentStateHook.memoizedState=action,[stateHook,dispatch,!1]}__name(rerenderActionState,"rerenderActionState");function pushSimpleEffect(tag,inst,create2,deps){return tag={tag,create:create2,deps,inst,next:null},inst=currentlyRenderingFiber.updateQueue,inst===null&&(inst=createFunctionComponentUpdateQueue(),currentlyRenderingFiber.updateQueue=inst),create2=inst.lastEffect,create2===null?inst.lastEffect=tag.next=tag:(deps=create2.next,create2.next=tag,tag.next=deps,inst.lastEffect=tag),tag}__name(pushSimpleEffect,"pushSimpleEffect");function updateRef(){return updateWorkInProgressHook().memoizedState}__name(updateRef,"updateRef");function mountEffectImpl(fiberFlags,hookFlags,create2,deps){var hook=mountWorkInProgressHook();currentlyRenderingFiber.flags|=fiberFlags,hook.memoizedState=pushSimpleEffect(1|hookFlags,{destroy:void 0},create2,deps===void 0?null:deps)}__name(mountEffectImpl,"mountEffectImpl");function updateEffectImpl(fiberFlags,hookFlags,create2,deps){var hook=updateWorkInProgressHook();deps=deps===void 0?null:deps;var inst=hook.memoizedState.inst;currentHook!==null&&deps!==null&&areHookInputsEqual(deps,currentHook.memoizedState.deps)?hook.memoizedState=pushSimpleEffect(hookFlags,inst,create2,deps):(currentlyRenderingFiber.flags|=fiberFlags,hook.memoizedState=pushSimpleEffect(1|hookFlags,inst,create2,deps))}__name(updateEffectImpl,"updateEffectImpl");function mountEffect(create2,deps){mountEffectImpl(8390656,8,create2,deps)}__name(mountEffect,"mountEffect");function updateEffect(create2,deps){updateEffectImpl(2048,8,create2,deps)}__name(updateEffect,"updateEffect");function useEffectEventImpl(payload){currentlyRenderingFiber.flags|=4;var componentUpdateQueue=currentlyRenderingFiber.updateQueue;if(componentUpdateQueue===null)componentUpdateQueue=createFunctionComponentUpdateQueue(),currentlyRenderingFiber.updateQueue=componentUpdateQueue,componentUpdateQueue.events=[payload];else{var events=componentUpdateQueue.events;events===null?componentUpdateQueue.events=[payload]:events.push(payload)}}__name(useEffectEventImpl,"useEffectEventImpl");function updateEvent(callback){var ref=updateWorkInProgressHook().memoizedState;return useEffectEventImpl({ref,nextImpl:callback}),function(){if((executionContext&2)!==0)throw Error(formatProdErrorMessage(440));return ref.impl.apply(void 0,arguments)}}__name(updateEvent,"updateEvent");function updateInsertionEffect(create2,deps){return updateEffectImpl(4,2,create2,deps)}__name(updateInsertionEffect,"updateInsertionEffect");function updateLayoutEffect(create2,deps){return updateEffectImpl(4,4,create2,deps)}__name(updateLayoutEffect,"updateLayoutEffect");function imperativeHandleEffect(create2,ref){if(typeof ref=="function"){create2=create2();var refCleanup=ref(create2);return function(){typeof refCleanup=="function"?refCleanup():ref(null)}}if(ref!=null)return create2=create2(),ref.current=create2,function(){ref.current=null}}__name(imperativeHandleEffect,"imperativeHandleEffect");function updateImperativeHandle(ref,create2,deps){deps=deps!=null?deps.concat([ref]):null,updateEffectImpl(4,4,imperativeHandleEffect.bind(null,create2,ref),deps)}__name(updateImperativeHandle,"updateImperativeHandle");function mountDebugValue(){}__name(mountDebugValue,"mountDebugValue");function updateCallback(callback,deps){var hook=updateWorkInProgressHook();deps=deps===void 0?null:deps;var prevState=hook.memoizedState;return deps!==null&&areHookInputsEqual(deps,prevState[1])?prevState[0]:(hook.memoizedState=[callback,deps],callback)}__name(updateCallback,"updateCallback");function updateMemo(nextCreate,deps){var hook=updateWorkInProgressHook();deps=deps===void 0?null:deps;var prevState=hook.memoizedState;if(deps!==null&&areHookInputsEqual(deps,prevState[1]))return prevState[0];if(prevState=nextCreate(),shouldDoubleInvokeUserFnsInHooksDEV){setIsStrictModeForDevtools(!0);try{nextCreate()}finally{setIsStrictModeForDevtools(!1)}}return hook.memoizedState=[prevState,deps],prevState}__name(updateMemo,"updateMemo");function mountDeferredValueImpl(hook,value,initialValue){return initialValue===void 0||(renderLanes&1073741824)!==0&&(workInProgressRootRenderLanes&261930)===0?hook.memoizedState=value:(hook.memoizedState=initialValue,hook=requestDeferredLane(),currentlyRenderingFiber.lanes|=hook,workInProgressRootSkippedLanes|=hook,initialValue)}__name(mountDeferredValueImpl,"mountDeferredValueImpl");function updateDeferredValueImpl(hook,prevValue,value,initialValue){return objectIs(value,prevValue)?value:currentTreeHiddenStackCursor.current!==null?(hook=mountDeferredValueImpl(hook,value,initialValue),objectIs(hook,prevValue)||(didReceiveUpdate=!0),hook):(renderLanes&42)===0||(renderLanes&1073741824)!==0&&(workInProgressRootRenderLanes&261930)===0?(didReceiveUpdate=!0,hook.memoizedState=value):(hook=requestDeferredLane(),currentlyRenderingFiber.lanes|=hook,workInProgressRootSkippedLanes|=hook,prevValue)}__name(updateDeferredValueImpl,"updateDeferredValueImpl");function startTransition(fiber,queue,pendingState,finishedState,callback){var previousPriority=ReactDOMSharedInternals.p;ReactDOMSharedInternals.p=previousPriority!==0&&8>previousPriority?previousPriority:8;var prevTransition=ReactSharedInternals.T,currentTransition={};ReactSharedInternals.T=currentTransition,dispatchOptimisticSetState(fiber,!1,queue,pendingState);try{var returnValue=callback(),onStartTransitionFinish=ReactSharedInternals.S;if(onStartTransitionFinish!==null&&onStartTransitionFinish(currentTransition,returnValue),returnValue!==null&&typeof returnValue=="object"&&typeof returnValue.then=="function"){var thenableForFinishedState=chainThenableValue(returnValue,finishedState);dispatchSetStateInternal(fiber,queue,thenableForFinishedState,requestUpdateLane(fiber))}else dispatchSetStateInternal(fiber,queue,finishedState,requestUpdateLane(fiber))}catch(error2){dispatchSetStateInternal(fiber,queue,{then:__name(function(){},"then"),status:"rejected",reason:error2},requestUpdateLane())}finally{ReactDOMSharedInternals.p=previousPriority,prevTransition!==null&¤tTransition.types!==null&&(prevTransition.types=currentTransition.types),ReactSharedInternals.T=prevTransition}}__name(startTransition,"startTransition");function noop3(){}__name(noop3,"noop");function startHostTransition(formFiber,pendingState,action,formData){if(formFiber.tag!==5)throw Error(formatProdErrorMessage(476));var queue=ensureFormComponentIsStateful(formFiber).queue;startTransition(formFiber,queue,pendingState,sharedNotPendingObject,action===null?noop3:function(){return requestFormReset$1(formFiber),action(formData)})}__name(startHostTransition,"startHostTransition");function ensureFormComponentIsStateful(formFiber){var existingStateHook=formFiber.memoizedState;if(existingStateHook!==null)return existingStateHook;existingStateHook={memoizedState:sharedNotPendingObject,baseState:sharedNotPendingObject,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:basicStateReducer,lastRenderedState:sharedNotPendingObject},next:null};var initialResetState={};return existingStateHook.next={memoizedState:initialResetState,baseState:initialResetState,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:basicStateReducer,lastRenderedState:initialResetState},next:null},formFiber.memoizedState=existingStateHook,formFiber=formFiber.alternate,formFiber!==null&&(formFiber.memoizedState=existingStateHook),existingStateHook}__name(ensureFormComponentIsStateful,"ensureFormComponentIsStateful");function requestFormReset$1(formFiber){var stateHook=ensureFormComponentIsStateful(formFiber);stateHook.next===null&&(stateHook=formFiber.alternate.memoizedState),dispatchSetStateInternal(formFiber,stateHook.next.queue,{},requestUpdateLane())}__name(requestFormReset$1,"requestFormReset$1");function useHostTransitionStatus(){return readContext(HostTransitionContext)}__name(useHostTransitionStatus,"useHostTransitionStatus");function updateId(){return updateWorkInProgressHook().memoizedState}__name(updateId,"updateId");function updateRefresh(){return updateWorkInProgressHook().memoizedState}__name(updateRefresh,"updateRefresh");function refreshCache(fiber){for(var provider=fiber.return;provider!==null;){switch(provider.tag){case 24:case 3:var lane=requestUpdateLane();fiber=createUpdate(lane);var root$69=enqueueUpdate(provider,fiber,lane);root$69!==null&&(scheduleUpdateOnFiber(root$69,provider,lane),entangleTransitions(root$69,provider,lane)),provider={cache:createCache()},fiber.payload=provider;return}provider=provider.return}}__name(refreshCache,"refreshCache");function dispatchReducerAction(fiber,queue,action){var lane=requestUpdateLane();action={lane,revertLane:0,gesture:null,action,hasEagerState:!1,eagerState:null,next:null},isRenderPhaseUpdate(fiber)?enqueueRenderPhaseUpdate(queue,action):(action=enqueueConcurrentHookUpdate(fiber,queue,action,lane),action!==null&&(scheduleUpdateOnFiber(action,fiber,lane),entangleTransitionUpdate(action,queue,lane)))}__name(dispatchReducerAction,"dispatchReducerAction");function dispatchSetState(fiber,queue,action){var lane=requestUpdateLane();dispatchSetStateInternal(fiber,queue,action,lane)}__name(dispatchSetState,"dispatchSetState");function dispatchSetStateInternal(fiber,queue,action,lane){var update={lane,revertLane:0,gesture:null,action,hasEagerState:!1,eagerState:null,next:null};if(isRenderPhaseUpdate(fiber))enqueueRenderPhaseUpdate(queue,update);else{var alternate=fiber.alternate;if(fiber.lanes===0&&(alternate===null||alternate.lanes===0)&&(alternate=queue.lastRenderedReducer,alternate!==null))try{var currentState=queue.lastRenderedState,eagerState=alternate(currentState,action);if(update.hasEagerState=!0,update.eagerState=eagerState,objectIs(eagerState,currentState))return enqueueUpdate$1(fiber,queue,update,0),workInProgressRoot===null&&finishQueueingConcurrentUpdates(),!1}catch{}if(action=enqueueConcurrentHookUpdate(fiber,queue,update,lane),action!==null)return scheduleUpdateOnFiber(action,fiber,lane),entangleTransitionUpdate(action,queue,lane),!0}return!1}__name(dispatchSetStateInternal,"dispatchSetStateInternal");function dispatchOptimisticSetState(fiber,throwIfDuringRender,queue,action){if(action={lane:2,revertLane:requestTransitionLane(),gesture:null,action,hasEagerState:!1,eagerState:null,next:null},isRenderPhaseUpdate(fiber)){if(throwIfDuringRender)throw Error(formatProdErrorMessage(479))}else throwIfDuringRender=enqueueConcurrentHookUpdate(fiber,queue,action,2),throwIfDuringRender!==null&&scheduleUpdateOnFiber(throwIfDuringRender,fiber,2)}__name(dispatchOptimisticSetState,"dispatchOptimisticSetState");function isRenderPhaseUpdate(fiber){var alternate=fiber.alternate;return fiber===currentlyRenderingFiber||alternate!==null&&alternate===currentlyRenderingFiber}__name(isRenderPhaseUpdate,"isRenderPhaseUpdate");function enqueueRenderPhaseUpdate(queue,update){didScheduleRenderPhaseUpdateDuringThisPass=didScheduleRenderPhaseUpdate=!0;var pending=queue.pending;pending===null?update.next=update:(update.next=pending.next,pending.next=update),queue.pending=update}__name(enqueueRenderPhaseUpdate,"enqueueRenderPhaseUpdate");function entangleTransitionUpdate(root3,queue,lane){if((lane&4194048)!==0){var queueLanes=queue.lanes;queueLanes&=root3.pendingLanes,lane|=queueLanes,queue.lanes=lane,markRootEntangled(root3,lane)}}__name(entangleTransitionUpdate,"entangleTransitionUpdate");var ContextOnlyDispatcher={readContext,use:use2,useCallback:throwInvalidHookError,useContext:throwInvalidHookError,useEffect:throwInvalidHookError,useImperativeHandle:throwInvalidHookError,useLayoutEffect:throwInvalidHookError,useInsertionEffect:throwInvalidHookError,useMemo:throwInvalidHookError,useReducer:throwInvalidHookError,useRef:throwInvalidHookError,useState:throwInvalidHookError,useDebugValue:throwInvalidHookError,useDeferredValue:throwInvalidHookError,useTransition:throwInvalidHookError,useSyncExternalStore:throwInvalidHookError,useId:throwInvalidHookError,useHostTransitionStatus:throwInvalidHookError,useFormState:throwInvalidHookError,useActionState:throwInvalidHookError,useOptimistic:throwInvalidHookError,useMemoCache:throwInvalidHookError,useCacheRefresh:throwInvalidHookError};ContextOnlyDispatcher.useEffectEvent=throwInvalidHookError;var HooksDispatcherOnMount={readContext,use:use2,useCallback:__name(function(callback,deps){return mountWorkInProgressHook().memoizedState=[callback,deps===void 0?null:deps],callback},"useCallback"),useContext:readContext,useEffect:mountEffect,useImperativeHandle:__name(function(ref,create2,deps){deps=deps!=null?deps.concat([ref]):null,mountEffectImpl(4194308,4,imperativeHandleEffect.bind(null,create2,ref),deps)},"useImperativeHandle"),useLayoutEffect:__name(function(create2,deps){return mountEffectImpl(4194308,4,create2,deps)},"useLayoutEffect"),useInsertionEffect:__name(function(create2,deps){mountEffectImpl(4,2,create2,deps)},"useInsertionEffect"),useMemo:__name(function(nextCreate,deps){var hook=mountWorkInProgressHook();deps=deps===void 0?null:deps;var nextValue=nextCreate();if(shouldDoubleInvokeUserFnsInHooksDEV){setIsStrictModeForDevtools(!0);try{nextCreate()}finally{setIsStrictModeForDevtools(!1)}}return hook.memoizedState=[nextValue,deps],nextValue},"useMemo"),useReducer:__name(function(reducer2,initialArg,init2){var hook=mountWorkInProgressHook();if(init2!==void 0){var initialState2=init2(initialArg);if(shouldDoubleInvokeUserFnsInHooksDEV){setIsStrictModeForDevtools(!0);try{init2(initialArg)}finally{setIsStrictModeForDevtools(!1)}}}else initialState2=initialArg;return hook.memoizedState=hook.baseState=initialState2,reducer2={pending:null,lanes:0,dispatch:null,lastRenderedReducer:reducer2,lastRenderedState:initialState2},hook.queue=reducer2,reducer2=reducer2.dispatch=dispatchReducerAction.bind(null,currentlyRenderingFiber,reducer2),[hook.memoizedState,reducer2]},"useReducer"),useRef:__name(function(initialValue){var hook=mountWorkInProgressHook();return initialValue={current:initialValue},hook.memoizedState=initialValue},"useRef"),useState:__name(function(initialState2){initialState2=mountStateImpl(initialState2);var queue=initialState2.queue,dispatch=dispatchSetState.bind(null,currentlyRenderingFiber,queue);return queue.dispatch=dispatch,[initialState2.memoizedState,dispatch]},"useState"),useDebugValue:mountDebugValue,useDeferredValue:__name(function(value,initialValue){var hook=mountWorkInProgressHook();return mountDeferredValueImpl(hook,value,initialValue)},"useDeferredValue"),useTransition:__name(function(){var stateHook=mountStateImpl(!1);return stateHook=startTransition.bind(null,currentlyRenderingFiber,stateHook.queue,!0,!1),mountWorkInProgressHook().memoizedState=stateHook,[!1,stateHook]},"useTransition"),useSyncExternalStore:__name(function(subscribe2,getSnapshot,getServerSnapshot){var fiber=currentlyRenderingFiber,hook=mountWorkInProgressHook();if(isHydrating){if(getServerSnapshot===void 0)throw Error(formatProdErrorMessage(407));getServerSnapshot=getServerSnapshot()}else{if(getServerSnapshot=getSnapshot(),workInProgressRoot===null)throw Error(formatProdErrorMessage(349));(workInProgressRootRenderLanes&127)!==0||pushStoreConsistencyCheck(fiber,getSnapshot,getServerSnapshot)}hook.memoizedState=getServerSnapshot;var inst={value:getServerSnapshot,getSnapshot};return hook.queue=inst,mountEffect(subscribeToStore.bind(null,fiber,inst,subscribe2),[subscribe2]),fiber.flags|=2048,pushSimpleEffect(9,{destroy:void 0},updateStoreInstance.bind(null,fiber,inst,getServerSnapshot,getSnapshot),null),getServerSnapshot},"useSyncExternalStore"),useId:__name(function(){var hook=mountWorkInProgressHook(),identifierPrefix=workInProgressRoot.identifierPrefix;if(isHydrating){var JSCompiler_inline_result=treeContextOverflow,idWithLeadingBit=treeContextId;JSCompiler_inline_result=(idWithLeadingBit&~(1<<32-clz32(idWithLeadingBit)-1)).toString(32)+JSCompiler_inline_result,identifierPrefix="_"+identifierPrefix+"R_"+JSCompiler_inline_result,JSCompiler_inline_result=localIdCounter++,0<JSCompiler_inline_result&&(identifierPrefix+="H"+JSCompiler_inline_result.toString(32)),identifierPrefix+="_"}else JSCompiler_inline_result=globalClientIdCounter++,identifierPrefix="_"+identifierPrefix+"r_"+JSCompiler_inline_result.toString(32)+"_";return hook.memoizedState=identifierPrefix},"useId"),useHostTransitionStatus,useFormState:mountActionState,useActionState:mountActionState,useOptimistic:__name(function(passthrough){var hook=mountWorkInProgressHook();hook.memoizedState=hook.baseState=passthrough;var queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return hook.queue=queue,hook=dispatchOptimisticSetState.bind(null,currentlyRenderingFiber,!0,queue),queue.dispatch=hook,[passthrough,hook]},"useOptimistic"),useMemoCache,useCacheRefresh:__name(function(){return mountWorkInProgressHook().memoizedState=refreshCache.bind(null,currentlyRenderingFiber)},"useCacheRefresh"),useEffectEvent:__name(function(callback){var hook=mountWorkInProgressHook(),ref={impl:callback};return hook.memoizedState=ref,function(){if((executionContext&2)!==0)throw Error(formatProdErrorMessage(440));return ref.impl.apply(void 0,arguments)}},"useEffectEvent")},HooksDispatcherOnUpdate={readContext,use:use2,useCallback:updateCallback,useContext:readContext,useEffect:updateEffect,useImperativeHandle:updateImperativeHandle,useInsertionEffect:updateInsertionEffect,useLayoutEffect:updateLayoutEffect,useMemo:updateMemo,useReducer:updateReducer,useRef:updateRef,useState:__name(function(){return updateReducer(basicStateReducer)},"useState"),useDebugValue:mountDebugValue,useDeferredValue:__name(function(value,initialValue){var hook=updateWorkInProgressHook();return updateDeferredValueImpl(hook,currentHook.memoizedState,value,initialValue)},"useDeferredValue"),useTransition:__name(function(){var booleanOrThenable=updateReducer(basicStateReducer)[0],start=updateWorkInProgressHook().memoizedState;return[typeof booleanOrThenable=="boolean"?booleanOrThenable:useThenable(booleanOrThenable),start]},"useTransition"),useSyncExternalStore:updateSyncExternalStore,useId:updateId,useHostTransitionStatus,useFormState:updateActionState,useActionState:updateActionState,useOptimistic:__name(function(passthrough,reducer2){var hook=updateWorkInProgressHook();return updateOptimisticImpl(hook,currentHook,passthrough,reducer2)},"useOptimistic"),useMemoCache,useCacheRefresh:updateRefresh};HooksDispatcherOnUpdate.useEffectEvent=updateEvent;var HooksDispatcherOnRerender={readContext,use:use2,useCallback:updateCallback,useContext:readContext,useEffect:updateEffect,useImperativeHandle:updateImperativeHandle,useInsertionEffect:updateInsertionEffect,useLayoutEffect:updateLayoutEffect,useMemo:updateMemo,useReducer:rerenderReducer,useRef:updateRef,useState:__name(function(){return rerenderReducer(basicStateReducer)},"useState"),useDebugValue:mountDebugValue,useDeferredValue:__name(function(value,initialValue){var hook=updateWorkInProgressHook();return currentHook===null?mountDeferredValueImpl(hook,value,initialValue):updateDeferredValueImpl(hook,currentHook.memoizedState,value,initialValue)},"useDeferredValue"),useTransition:__name(function(){var booleanOrThenable=rerenderReducer(basicStateReducer)[0],start=updateWorkInProgressHook().memoizedState;return[typeof booleanOrThenable=="boolean"?booleanOrThenable:useThenable(booleanOrThenable),start]},"useTransition"),useSyncExternalStore:updateSyncExternalStore,useId:updateId,useHostTransitionStatus,useFormState:rerenderActionState,useActionState:rerenderActionState,useOptimistic:__name(function(passthrough,reducer2){var hook=updateWorkInProgressHook();return currentHook!==null?updateOptimisticImpl(hook,currentHook,passthrough,reducer2):(hook.baseState=passthrough,[passthrough,hook.queue.dispatch])},"useOptimistic"),useMemoCache,useCacheRefresh:updateRefresh};HooksDispatcherOnRerender.useEffectEvent=updateEvent;function applyDerivedStateFromProps(workInProgress2,ctor,getDerivedStateFromProps,nextProps){ctor=workInProgress2.memoizedState,getDerivedStateFromProps=getDerivedStateFromProps(nextProps,ctor),getDerivedStateFromProps=getDerivedStateFromProps==null?ctor:assign({},ctor,getDerivedStateFromProps),workInProgress2.memoizedState=getDerivedStateFromProps,workInProgress2.lanes===0&&(workInProgress2.updateQueue.baseState=getDerivedStateFromProps)}__name(applyDerivedStateFromProps,"applyDerivedStateFromProps");var classComponentUpdater={enqueueSetState:__name(function(inst,payload,callback){inst=inst._reactInternals;var lane=requestUpdateLane(),update=createUpdate(lane);update.payload=payload,callback!=null&&(update.callback=callback),payload=enqueueUpdate(inst,update,lane),payload!==null&&(scheduleUpdateOnFiber(payload,inst,lane),entangleTransitions(payload,inst,lane))},"enqueueSetState"),enqueueReplaceState:__name(function(inst,payload,callback){inst=inst._reactInternals;var lane=requestUpdateLane(),update=createUpdate(lane);update.tag=1,update.payload=payload,callback!=null&&(update.callback=callback),payload=enqueueUpdate(inst,update,lane),payload!==null&&(scheduleUpdateOnFiber(payload,inst,lane),entangleTransitions(payload,inst,lane))},"enqueueReplaceState"),enqueueForceUpdate:__name(function(inst,callback){inst=inst._reactInternals;var lane=requestUpdateLane(),update=createUpdate(lane);update.tag=2,callback!=null&&(update.callback=callback),callback=enqueueUpdate(inst,update,lane),callback!==null&&(scheduleUpdateOnFiber(callback,inst,lane),entangleTransitions(callback,inst,lane))},"enqueueForceUpdate")};function checkShouldComponentUpdate(workInProgress2,ctor,oldProps,newProps,oldState,newState,nextContext){return workInProgress2=workInProgress2.stateNode,typeof workInProgress2.shouldComponentUpdate=="function"?workInProgress2.shouldComponentUpdate(newProps,newState,nextContext):ctor.prototype&&ctor.prototype.isPureReactComponent?!shallowEqual(oldProps,newProps)||!shallowEqual(oldState,newState):!0}__name(checkShouldComponentUpdate,"checkShouldComponentUpdate");function callComponentWillReceiveProps(workInProgress2,instance,newProps,nextContext){workInProgress2=instance.state,typeof instance.componentWillReceiveProps=="function"&&instance.componentWillReceiveProps(newProps,nextContext),typeof instance.UNSAFE_componentWillReceiveProps=="function"&&instance.UNSAFE_componentWillReceiveProps(newProps,nextContext),instance.state!==workInProgress2&&classComponentUpdater.enqueueReplaceState(instance,instance.state,null)}__name(callComponentWillReceiveProps,"callComponentWillReceiveProps");function resolveClassComponentProps(Component,baseProps){var newProps=baseProps;if("ref"in baseProps){newProps={};for(var propName in baseProps)propName!=="ref"&&(newProps[propName]=baseProps[propName])}if(Component=Component.defaultProps){newProps===baseProps&&(newProps=assign({},newProps));for(var propName$73 in Component)newProps[propName$73]===void 0&&(newProps[propName$73]=Component[propName$73])}return newProps}__name(resolveClassComponentProps,"resolveClassComponentProps");function defaultOnUncaughtError(error2){reportGlobalError(error2)}__name(defaultOnUncaughtError,"defaultOnUncaughtError");function defaultOnCaughtError(error2){console.error(error2)}__name(defaultOnCaughtError,"defaultOnCaughtError");function defaultOnRecoverableError(error2){reportGlobalError(error2)}__name(defaultOnRecoverableError,"defaultOnRecoverableError");function logUncaughtError(root3,errorInfo){try{var onUncaughtError=root3.onUncaughtError;onUncaughtError(errorInfo.value,{componentStack:errorInfo.stack})}catch(e$74){setTimeout(function(){throw e$74})}}__name(logUncaughtError,"logUncaughtError");function logCaughtError(root3,boundary,errorInfo){try{var onCaughtError=root3.onCaughtError;onCaughtError(errorInfo.value,{componentStack:errorInfo.stack,errorBoundary:boundary.tag===1?boundary.stateNode:null})}catch(e$75){setTimeout(function(){throw e$75})}}__name(logCaughtError,"logCaughtError");function createRootErrorUpdate(root3,errorInfo,lane){return lane=createUpdate(lane),lane.tag=3,lane.payload={element:null},lane.callback=function(){logUncaughtError(root3,errorInfo)},lane}__name(createRootErrorUpdate,"createRootErrorUpdate");function createClassErrorUpdate(lane){return lane=createUpdate(lane),lane.tag=3,lane}__name(createClassErrorUpdate,"createClassErrorUpdate");function initializeClassErrorUpdate(update,root3,fiber,errorInfo){var getDerivedStateFromError=fiber.type.getDerivedStateFromError;if(typeof getDerivedStateFromError=="function"){var error2=errorInfo.value;update.payload=function(){return getDerivedStateFromError(error2)},update.callback=function(){logCaughtError(root3,fiber,errorInfo)}}var inst=fiber.stateNode;inst!==null&&typeof inst.componentDidCatch=="function"&&(update.callback=function(){logCaughtError(root3,fiber,errorInfo),typeof getDerivedStateFromError!="function"&&(legacyErrorBoundariesThatAlreadyFailed===null?legacyErrorBoundariesThatAlreadyFailed=new Set([this]):legacyErrorBoundariesThatAlreadyFailed.add(this));var stack=errorInfo.stack;this.componentDidCatch(errorInfo.value,{componentStack:stack!==null?stack:""})})}__name(initializeClassErrorUpdate,"initializeClassErrorUpdate");function throwException(root3,returnFiber,sourceFiber,value,rootRenderLanes){if(sourceFiber.flags|=32768,value!==null&&typeof value=="object"&&typeof value.then=="function"){if(returnFiber=sourceFiber.alternate,returnFiber!==null&&propagateParentContextChanges(returnFiber,sourceFiber,rootRenderLanes,!0),sourceFiber=suspenseHandlerStackCursor.current,sourceFiber!==null){switch(sourceFiber.tag){case 31:case 13:return shellBoundary===null?renderDidSuspendDelayIfPossible():sourceFiber.alternate===null&&workInProgressRootExitStatus===0&&(workInProgressRootExitStatus=3),sourceFiber.flags&=-257,sourceFiber.flags|=65536,sourceFiber.lanes=rootRenderLanes,value===noopSuspenseyCommitThenable?sourceFiber.flags|=16384:(returnFiber=sourceFiber.updateQueue,returnFiber===null?sourceFiber.updateQueue=new Set([value]):returnFiber.add(value),attachPingListener(root3,value,rootRenderLanes)),!1;case 22:return sourceFiber.flags|=65536,value===noopSuspenseyCommitThenable?sourceFiber.flags|=16384:(returnFiber=sourceFiber.updateQueue,returnFiber===null?(returnFiber={transitions:null,markerInstances:null,retryQueue:new Set([value])},sourceFiber.updateQueue=returnFiber):(sourceFiber=returnFiber.retryQueue,sourceFiber===null?returnFiber.retryQueue=new Set([value]):sourceFiber.add(value)),attachPingListener(root3,value,rootRenderLanes)),!1}throw Error(formatProdErrorMessage(435,sourceFiber.tag))}return attachPingListener(root3,value,rootRenderLanes),renderDidSuspendDelayIfPossible(),!1}if(isHydrating)return returnFiber=suspenseHandlerStackCursor.current,returnFiber!==null?((returnFiber.flags&65536)===0&&(returnFiber.flags|=256),returnFiber.flags|=65536,returnFiber.lanes=rootRenderLanes,value!==HydrationMismatchException&&(root3=Error(formatProdErrorMessage(422),{cause:value}),queueHydrationError(createCapturedValueAtFiber(root3,sourceFiber)))):(value!==HydrationMismatchException&&(returnFiber=Error(formatProdErrorMessage(423),{cause:value}),queueHydrationError(createCapturedValueAtFiber(returnFiber,sourceFiber))),root3=root3.current.alternate,root3.flags|=65536,rootRenderLanes&=-rootRenderLanes,root3.lanes|=rootRenderLanes,value=createCapturedValueAtFiber(value,sourceFiber),rootRenderLanes=createRootErrorUpdate(root3.stateNode,value,rootRenderLanes),enqueueCapturedUpdate(root3,rootRenderLanes),workInProgressRootExitStatus!==4&&(workInProgressRootExitStatus=2)),!1;var wrapperError=Error(formatProdErrorMessage(520),{cause:value});if(wrapperError=createCapturedValueAtFiber(wrapperError,sourceFiber),workInProgressRootConcurrentErrors===null?workInProgressRootConcurrentErrors=[wrapperError]:workInProgressRootConcurrentErrors.push(wrapperError),workInProgressRootExitStatus!==4&&(workInProgressRootExitStatus=2),returnFiber===null)return!0;value=createCapturedValueAtFiber(value,sourceFiber),sourceFiber=returnFiber;do{switch(sourceFiber.tag){case 3:return sourceFiber.flags|=65536,root3=rootRenderLanes&-rootRenderLanes,sourceFiber.lanes|=root3,root3=createRootErrorUpdate(sourceFiber.stateNode,value,root3),enqueueCapturedUpdate(sourceFiber,root3),!1;case 1:if(returnFiber=sourceFiber.type,wrapperError=sourceFiber.stateNode,(sourceFiber.flags&128)===0&&(typeof returnFiber.getDerivedStateFromError=="function"||wrapperError!==null&&typeof wrapperError.componentDidCatch=="function"&&(legacyErrorBoundariesThatAlreadyFailed===null||!legacyErrorBoundariesThatAlreadyFailed.has(wrapperError))))return sourceFiber.flags|=65536,rootRenderLanes&=-rootRenderLanes,sourceFiber.lanes|=rootRenderLanes,rootRenderLanes=createClassErrorUpdate(rootRenderLanes),initializeClassErrorUpdate(rootRenderLanes,root3,sourceFiber,value),enqueueCapturedUpdate(sourceFiber,rootRenderLanes),!1}sourceFiber=sourceFiber.return}while(sourceFiber!==null);return!1}__name(throwException,"throwException");var SelectiveHydrationException=Error(formatProdErrorMessage(461)),didReceiveUpdate=!1;function reconcileChildren(current,workInProgress2,nextChildren,renderLanes2){workInProgress2.child=current===null?mountChildFibers(workInProgress2,null,nextChildren,renderLanes2):reconcileChildFibers(workInProgress2,current.child,nextChildren,renderLanes2)}__name(reconcileChildren,"reconcileChildren");function updateForwardRef(current,workInProgress2,Component,nextProps,renderLanes2){Component=Component.render;var ref=workInProgress2.ref;if("ref"in nextProps){var propsWithoutRef={};for(var key in nextProps)key!=="ref"&&(propsWithoutRef[key]=nextProps[key])}else propsWithoutRef=nextProps;return prepareToReadContext(workInProgress2),nextProps=renderWithHooks(current,workInProgress2,Component,propsWithoutRef,ref,renderLanes2),key=checkDidRenderIdHook(),current!==null&&!didReceiveUpdate?(bailoutHooks(current,workInProgress2,renderLanes2),bailoutOnAlreadyFinishedWork(current,workInProgress2,renderLanes2)):(isHydrating&&key&&pushMaterializedTreeId(workInProgress2),workInProgress2.flags|=1,reconcileChildren(current,workInProgress2,nextProps,renderLanes2),workInProgress2.child)}__name(updateForwardRef,"updateForwardRef");function updateMemoComponent(current,workInProgress2,Component,nextProps,renderLanes2){if(current===null){var type=Component.type;return typeof type=="function"&&!shouldConstruct(type)&&type.defaultProps===void 0&&Component.compare===null?(workInProgress2.tag=15,workInProgress2.type=type,updateSimpleMemoComponent(current,workInProgress2,type,nextProps,renderLanes2)):(current=createFiberFromTypeAndProps(Component.type,null,nextProps,workInProgress2,workInProgress2.mode,renderLanes2),current.ref=workInProgress2.ref,current.return=workInProgress2,workInProgress2.child=current)}if(type=current.child,!checkScheduledUpdateOrContext(current,renderLanes2)){var prevProps=type.memoizedProps;if(Component=Component.compare,Component=Component!==null?Component:shallowEqual,Component(prevProps,nextProps)&¤t.ref===workInProgress2.ref)return bailoutOnAlreadyFinishedWork(current,workInProgress2,renderLanes2)}return workInProgress2.flags|=1,current=createWorkInProgress(type,nextProps),current.ref=workInProgress2.ref,current.return=workInProgress2,workInProgress2.child=current}__name(updateMemoComponent,"updateMemoComponent");function updateSimpleMemoComponent(current,workInProgress2,Component,nextProps,renderLanes2){if(current!==null){var prevProps=current.memoizedProps;if(shallowEqual(prevProps,nextProps)&¤t.ref===workInProgress2.ref)if(didReceiveUpdate=!1,workInProgress2.pendingProps=nextProps=prevProps,checkScheduledUpdateOrContext(current,renderLanes2))(current.flags&131072)!==0&&(didReceiveUpdate=!0);else return workInProgress2.lanes=current.lanes,bailoutOnAlreadyFinishedWork(current,workInProgress2,renderLanes2)}return updateFunctionComponent(current,workInProgress2,Component,nextProps,renderLanes2)}__name(updateSimpleMemoComponent,"updateSimpleMemoComponent");function updateOffscreenComponent(current,workInProgress2,renderLanes2,nextProps){var nextChildren=nextProps.children,prevState=current!==null?current.memoizedState:null;if(current===null&&workInProgress2.stateNode===null&&(workInProgress2.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),nextProps.mode==="hidden"){if((workInProgress2.flags&128)!==0){if(prevState=prevState!==null?prevState.baseLanes|renderLanes2:renderLanes2,current!==null){for(nextProps=workInProgress2.child=current.child,nextChildren=0;nextProps!==null;)nextChildren=nextChildren|nextProps.lanes|nextProps.childLanes,nextProps=nextProps.sibling;nextProps=nextChildren&~prevState}else nextProps=0,workInProgress2.child=null;return deferHiddenOffscreenComponent(current,workInProgress2,prevState,renderLanes2,nextProps)}if((renderLanes2&536870912)!==0)workInProgress2.memoizedState={baseLanes:0,cachePool:null},current!==null&&pushTransition(workInProgress2,prevState!==null?prevState.cachePool:null),prevState!==null?pushHiddenContext(workInProgress2,prevState):reuseHiddenContextOnStack(),pushOffscreenSuspenseHandler(workInProgress2);else return nextProps=workInProgress2.lanes=536870912,deferHiddenOffscreenComponent(current,workInProgress2,prevState!==null?prevState.baseLanes|renderLanes2:renderLanes2,renderLanes2,nextProps)}else prevState!==null?(pushTransition(workInProgress2,prevState.cachePool),pushHiddenContext(workInProgress2,prevState),reuseSuspenseHandlerOnStack(),workInProgress2.memoizedState=null):(current!==null&&pushTransition(workInProgress2,null),reuseHiddenContextOnStack(),reuseSuspenseHandlerOnStack());return reconcileChildren(current,workInProgress2,nextChildren,renderLanes2),workInProgress2.child}__name(updateOffscreenComponent,"updateOffscreenComponent");function bailoutOffscreenComponent(current,workInProgress2){return current!==null&¤t.tag===22||workInProgress2.stateNode!==null||(workInProgress2.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),workInProgress2.sibling}__name(bailoutOffscreenComponent,"bailoutOffscreenComponent");function deferHiddenOffscreenComponent(current,workInProgress2,nextBaseLanes,renderLanes2,remainingChildLanes){var JSCompiler_inline_result=peekCacheFromPool();return JSCompiler_inline_result=JSCompiler_inline_result===null?null:{parent:CacheContext._currentValue,pool:JSCompiler_inline_result},workInProgress2.memoizedState={baseLanes:nextBaseLanes,cachePool:JSCompiler_inline_result},current!==null&&pushTransition(workInProgress2,null),reuseHiddenContextOnStack(),pushOffscreenSuspenseHandler(workInProgress2),current!==null&&propagateParentContextChanges(current,workInProgress2,renderLanes2,!0),workInProgress2.childLanes=remainingChildLanes,null}__name(deferHiddenOffscreenComponent,"deferHiddenOffscreenComponent");function mountActivityChildren(workInProgress2,nextProps){return nextProps=mountWorkInProgressOffscreenFiber({mode:nextProps.mode,children:nextProps.children},workInProgress2.mode),nextProps.ref=workInProgress2.ref,workInProgress2.child=nextProps,nextProps.return=workInProgress2,nextProps}__name(mountActivityChildren,"mountActivityChildren");function retryActivityComponentWithoutHydrating(current,workInProgress2,renderLanes2){return reconcileChildFibers(workInProgress2,current.child,null,renderLanes2),current=mountActivityChildren(workInProgress2,workInProgress2.pendingProps),current.flags|=2,popSuspenseHandler(workInProgress2),workInProgress2.memoizedState=null,current}__name(retryActivityComponentWithoutHydrating,"retryActivityComponentWithoutHydrating");function updateActivityComponent(current,workInProgress2,renderLanes2){var nextProps=workInProgress2.pendingProps,didSuspend=(workInProgress2.flags&128)!==0;if(workInProgress2.flags&=-129,current===null){if(isHydrating){if(nextProps.mode==="hidden")return current=mountActivityChildren(workInProgress2,nextProps),workInProgress2.lanes=536870912,bailoutOffscreenComponent(null,current);if(pushDehydratedActivitySuspenseHandler(workInProgress2),(current=nextHydratableInstance)?(current=canHydrateHydrationBoundary(current,rootOrSingletonContext),current=current!==null&¤t.data==="&"?current:null,current!==null&&(workInProgress2.memoizedState={dehydrated:current,treeContext:treeContextProvider!==null?{id:treeContextId,overflow:treeContextOverflow}:null,retryLane:536870912,hydrationErrors:null},renderLanes2=createFiberFromDehydratedFragment(current),renderLanes2.return=workInProgress2,workInProgress2.child=renderLanes2,hydrationParentFiber=workInProgress2,nextHydratableInstance=null)):current=null,current===null)throw throwOnHydrationMismatch(workInProgress2);return workInProgress2.lanes=536870912,null}return mountActivityChildren(workInProgress2,nextProps)}var prevState=current.memoizedState;if(prevState!==null){var dehydrated=prevState.dehydrated;if(pushDehydratedActivitySuspenseHandler(workInProgress2),didSuspend)if(workInProgress2.flags&256)workInProgress2.flags&=-257,workInProgress2=retryActivityComponentWithoutHydrating(current,workInProgress2,renderLanes2);else if(workInProgress2.memoizedState!==null)workInProgress2.child=current.child,workInProgress2.flags|=128,workInProgress2=null;else throw Error(formatProdErrorMessage(558));else if(didReceiveUpdate||propagateParentContextChanges(current,workInProgress2,renderLanes2,!1),didSuspend=(renderLanes2¤t.childLanes)!==0,didReceiveUpdate||didSuspend){if(nextProps=workInProgressRoot,nextProps!==null&&(dehydrated=getBumpedLaneForHydration(nextProps,renderLanes2),dehydrated!==0&&dehydrated!==prevState.retryLane))throw prevState.retryLane=dehydrated,enqueueConcurrentRenderForLane(current,dehydrated),scheduleUpdateOnFiber(nextProps,current,dehydrated),SelectiveHydrationException;renderDidSuspendDelayIfPossible(),workInProgress2=retryActivityComponentWithoutHydrating(current,workInProgress2,renderLanes2)}else current=prevState.treeContext,nextHydratableInstance=getNextHydratable(dehydrated.nextSibling),hydrationParentFiber=workInProgress2,isHydrating=!0,hydrationErrors=null,rootOrSingletonContext=!1,current!==null&&restoreSuspendedTreeContext(workInProgress2,current),workInProgress2=mountActivityChildren(workInProgress2,nextProps),workInProgress2.flags|=4096;return workInProgress2}return current=createWorkInProgress(current.child,{mode:nextProps.mode,children:nextProps.children}),current.ref=workInProgress2.ref,workInProgress2.child=current,current.return=workInProgress2,current}__name(updateActivityComponent,"updateActivityComponent");function markRef(current,workInProgress2){var ref=workInProgress2.ref;if(ref===null)current!==null&¤t.ref!==null&&(workInProgress2.flags|=4194816);else{if(typeof ref!="function"&&typeof ref!="object")throw Error(formatProdErrorMessage(284));(current===null||current.ref!==ref)&&(workInProgress2.flags|=4194816)}}__name(markRef,"markRef");function updateFunctionComponent(current,workInProgress2,Component,nextProps,renderLanes2){return prepareToReadContext(workInProgress2),Component=renderWithHooks(current,workInProgress2,Component,nextProps,void 0,renderLanes2),nextProps=checkDidRenderIdHook(),current!==null&&!didReceiveUpdate?(bailoutHooks(current,workInProgress2,renderLanes2),bailoutOnAlreadyFinishedWork(current,workInProgress2,renderLanes2)):(isHydrating&&nextProps&&pushMaterializedTreeId(workInProgress2),workInProgress2.flags|=1,reconcileChildren(current,workInProgress2,Component,renderLanes2),workInProgress2.child)}__name(updateFunctionComponent,"updateFunctionComponent");function replayFunctionComponent(current,workInProgress2,nextProps,Component,secondArg,renderLanes2){return prepareToReadContext(workInProgress2),workInProgress2.updateQueue=null,nextProps=renderWithHooksAgain(workInProgress2,Component,nextProps,secondArg),finishRenderingHooks(current),Component=checkDidRenderIdHook(),current!==null&&!didReceiveUpdate?(bailoutHooks(current,workInProgress2,renderLanes2),bailoutOnAlreadyFinishedWork(current,workInProgress2,renderLanes2)):(isHydrating&&Component&&pushMaterializedTreeId(workInProgress2),workInProgress2.flags|=1,reconcileChildren(current,workInProgress2,nextProps,renderLanes2),workInProgress2.child)}__name(replayFunctionComponent,"replayFunctionComponent");function updateClassComponent(current,workInProgress2,Component,nextProps,renderLanes2){if(prepareToReadContext(workInProgress2),workInProgress2.stateNode===null){var context=emptyContextObject,contextType=Component.contextType;typeof contextType=="object"&&contextType!==null&&(context=readContext(contextType)),context=new Component(nextProps,context),workInProgress2.memoizedState=context.state!==null&&context.state!==void 0?context.state:null,context.updater=classComponentUpdater,workInProgress2.stateNode=context,context._reactInternals=workInProgress2,context=workInProgress2.stateNode,context.props=nextProps,context.state=workInProgress2.memoizedState,context.refs={},initializeUpdateQueue(workInProgress2),contextType=Component.contextType,context.context=typeof contextType=="object"&&contextType!==null?readContext(contextType):emptyContextObject,context.state=workInProgress2.memoizedState,contextType=Component.getDerivedStateFromProps,typeof contextType=="function"&&(applyDerivedStateFromProps(workInProgress2,Component,contextType,nextProps),context.state=workInProgress2.memoizedState),typeof Component.getDerivedStateFromProps=="function"||typeof context.getSnapshotBeforeUpdate=="function"||typeof context.UNSAFE_componentWillMount!="function"&&typeof context.componentWillMount!="function"||(contextType=context.state,typeof context.componentWillMount=="function"&&context.componentWillMount(),typeof context.UNSAFE_componentWillMount=="function"&&context.UNSAFE_componentWillMount(),contextType!==context.state&&classComponentUpdater.enqueueReplaceState(context,context.state,null),processUpdateQueue(workInProgress2,nextProps,context,renderLanes2),suspendIfUpdateReadFromEntangledAsyncAction(),context.state=workInProgress2.memoizedState),typeof context.componentDidMount=="function"&&(workInProgress2.flags|=4194308),nextProps=!0}else if(current===null){context=workInProgress2.stateNode;var unresolvedOldProps=workInProgress2.memoizedProps,oldProps=resolveClassComponentProps(Component,unresolvedOldProps);context.props=oldProps;var oldContext=context.context,contextType$jscomp$0=Component.contextType;contextType=emptyContextObject,typeof contextType$jscomp$0=="object"&&contextType$jscomp$0!==null&&(contextType=readContext(contextType$jscomp$0));var getDerivedStateFromProps=Component.getDerivedStateFromProps;contextType$jscomp$0=typeof getDerivedStateFromProps=="function"||typeof context.getSnapshotBeforeUpdate=="function",unresolvedOldProps=workInProgress2.pendingProps!==unresolvedOldProps,contextType$jscomp$0||typeof context.UNSAFE_componentWillReceiveProps!="function"&&typeof context.componentWillReceiveProps!="function"||(unresolvedOldProps||oldContext!==contextType)&&callComponentWillReceiveProps(workInProgress2,context,nextProps,contextType),hasForceUpdate=!1;var oldState=workInProgress2.memoizedState;context.state=oldState,processUpdateQueue(workInProgress2,nextProps,context,renderLanes2),suspendIfUpdateReadFromEntangledAsyncAction(),oldContext=workInProgress2.memoizedState,unresolvedOldProps||oldState!==oldContext||hasForceUpdate?(typeof getDerivedStateFromProps=="function"&&(applyDerivedStateFromProps(workInProgress2,Component,getDerivedStateFromProps,nextProps),oldContext=workInProgress2.memoizedState),(oldProps=hasForceUpdate||checkShouldComponentUpdate(workInProgress2,Component,oldProps,nextProps,oldState,oldContext,contextType))?(contextType$jscomp$0||typeof context.UNSAFE_componentWillMount!="function"&&typeof context.componentWillMount!="function"||(typeof context.componentWillMount=="function"&&context.componentWillMount(),typeof context.UNSAFE_componentWillMount=="function"&&context.UNSAFE_componentWillMount()),typeof context.componentDidMount=="function"&&(workInProgress2.flags|=4194308)):(typeof context.componentDidMount=="function"&&(workInProgress2.flags|=4194308),workInProgress2.memoizedProps=nextProps,workInProgress2.memoizedState=oldContext),context.props=nextProps,context.state=oldContext,context.context=contextType,nextProps=oldProps):(typeof context.componentDidMount=="function"&&(workInProgress2.flags|=4194308),nextProps=!1)}else{context=workInProgress2.stateNode,cloneUpdateQueue(current,workInProgress2),contextType=workInProgress2.memoizedProps,contextType$jscomp$0=resolveClassComponentProps(Component,contextType),context.props=contextType$jscomp$0,getDerivedStateFromProps=workInProgress2.pendingProps,oldState=context.context,oldContext=Component.contextType,oldProps=emptyContextObject,typeof oldContext=="object"&&oldContext!==null&&(oldProps=readContext(oldContext)),unresolvedOldProps=Component.getDerivedStateFromProps,(oldContext=typeof unresolvedOldProps=="function"||typeof context.getSnapshotBeforeUpdate=="function")||typeof context.UNSAFE_componentWillReceiveProps!="function"&&typeof context.componentWillReceiveProps!="function"||(contextType!==getDerivedStateFromProps||oldState!==oldProps)&&callComponentWillReceiveProps(workInProgress2,context,nextProps,oldProps),hasForceUpdate=!1,oldState=workInProgress2.memoizedState,context.state=oldState,processUpdateQueue(workInProgress2,nextProps,context,renderLanes2),suspendIfUpdateReadFromEntangledAsyncAction();var newState=workInProgress2.memoizedState;contextType!==getDerivedStateFromProps||oldState!==newState||hasForceUpdate||current!==null&¤t.dependencies!==null&&checkIfContextChanged(current.dependencies)?(typeof unresolvedOldProps=="function"&&(applyDerivedStateFromProps(workInProgress2,Component,unresolvedOldProps,nextProps),newState=workInProgress2.memoizedState),(contextType$jscomp$0=hasForceUpdate||checkShouldComponentUpdate(workInProgress2,Component,contextType$jscomp$0,nextProps,oldState,newState,oldProps)||current!==null&¤t.dependencies!==null&&checkIfContextChanged(current.dependencies))?(oldContext||typeof context.UNSAFE_componentWillUpdate!="function"&&typeof context.componentWillUpdate!="function"||(typeof context.componentWillUpdate=="function"&&context.componentWillUpdate(nextProps,newState,oldProps),typeof context.UNSAFE_componentWillUpdate=="function"&&context.UNSAFE_componentWillUpdate(nextProps,newState,oldProps)),typeof context.componentDidUpdate=="function"&&(workInProgress2.flags|=4),typeof context.getSnapshotBeforeUpdate=="function"&&(workInProgress2.flags|=1024)):(typeof context.componentDidUpdate!="function"||contextType===current.memoizedProps&&oldState===current.memoizedState||(workInProgress2.flags|=4),typeof context.getSnapshotBeforeUpdate!="function"||contextType===current.memoizedProps&&oldState===current.memoizedState||(workInProgress2.flags|=1024),workInProgress2.memoizedProps=nextProps,workInProgress2.memoizedState=newState),context.props=nextProps,context.state=newState,context.context=oldProps,nextProps=contextType$jscomp$0):(typeof context.componentDidUpdate!="function"||contextType===current.memoizedProps&&oldState===current.memoizedState||(workInProgress2.flags|=4),typeof context.getSnapshotBeforeUpdate!="function"||contextType===current.memoizedProps&&oldState===current.memoizedState||(workInProgress2.flags|=1024),nextProps=!1)}return context=nextProps,markRef(current,workInProgress2),nextProps=(workInProgress2.flags&128)!==0,context||nextProps?(context=workInProgress2.stateNode,Component=nextProps&&typeof Component.getDerivedStateFromError!="function"?null:context.render(),workInProgress2.flags|=1,current!==null&&nextProps?(workInProgress2.child=reconcileChildFibers(workInProgress2,current.child,null,renderLanes2),workInProgress2.child=reconcileChildFibers(workInProgress2,null,Component,renderLanes2)):reconcileChildren(current,workInProgress2,Component,renderLanes2),workInProgress2.memoizedState=context.state,current=workInProgress2.child):current=bailoutOnAlreadyFinishedWork(current,workInProgress2,renderLanes2),current}__name(updateClassComponent,"updateClassComponent");function mountHostRootWithoutHydrating(current,workInProgress2,nextChildren,renderLanes2){return resetHydrationState(),workInProgress2.flags|=256,reconcileChildren(current,workInProgress2,nextChildren,renderLanes2),workInProgress2.child}__name(mountHostRootWithoutHydrating,"mountHostRootWithoutHydrating");var SUSPENDED_MARKER={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mountSuspenseOffscreenState(renderLanes2){return{baseLanes:renderLanes2,cachePool:getSuspendedCache()}}__name(mountSuspenseOffscreenState,"mountSuspenseOffscreenState");function getRemainingWorkInPrimaryTree(current,primaryTreeDidDefer,renderLanes2){return current=current!==null?current.childLanes&~renderLanes2:0,primaryTreeDidDefer&&(current|=workInProgressDeferredLane),current}__name(getRemainingWorkInPrimaryTree,"getRemainingWorkInPrimaryTree");function updateSuspenseComponent(current,workInProgress2,renderLanes2){var nextProps=workInProgress2.pendingProps,showFallback=!1,didSuspend=(workInProgress2.flags&128)!==0,JSCompiler_temp;if((JSCompiler_temp=didSuspend)||(JSCompiler_temp=current!==null&¤t.memoizedState===null?!1:(suspenseStackCursor.current&2)!==0),JSCompiler_temp&&(showFallback=!0,workInProgress2.flags&=-129),JSCompiler_temp=(workInProgress2.flags&32)!==0,workInProgress2.flags&=-33,current===null){if(isHydrating){if(showFallback?pushPrimaryTreeSuspenseHandler(workInProgress2):reuseSuspenseHandlerOnStack(),(current=nextHydratableInstance)?(current=canHydrateHydrationBoundary(current,rootOrSingletonContext),current=current!==null&¤t.data!=="&"?current:null,current!==null&&(workInProgress2.memoizedState={dehydrated:current,treeContext:treeContextProvider!==null?{id:treeContextId,overflow:treeContextOverflow}:null,retryLane:536870912,hydrationErrors:null},renderLanes2=createFiberFromDehydratedFragment(current),renderLanes2.return=workInProgress2,workInProgress2.child=renderLanes2,hydrationParentFiber=workInProgress2,nextHydratableInstance=null)):current=null,current===null)throw throwOnHydrationMismatch(workInProgress2);return isSuspenseInstanceFallback(current)?workInProgress2.lanes=32:workInProgress2.lanes=536870912,null}var nextPrimaryChildren=nextProps.children;return nextProps=nextProps.fallback,showFallback?(reuseSuspenseHandlerOnStack(),showFallback=workInProgress2.mode,nextPrimaryChildren=mountWorkInProgressOffscreenFiber({mode:"hidden",children:nextPrimaryChildren},showFallback),nextProps=createFiberFromFragment(nextProps,showFallback,renderLanes2,null),nextPrimaryChildren.return=workInProgress2,nextProps.return=workInProgress2,nextPrimaryChildren.sibling=nextProps,workInProgress2.child=nextPrimaryChildren,nextProps=workInProgress2.child,nextProps.memoizedState=mountSuspenseOffscreenState(renderLanes2),nextProps.childLanes=getRemainingWorkInPrimaryTree(current,JSCompiler_temp,renderLanes2),workInProgress2.memoizedState=SUSPENDED_MARKER,bailoutOffscreenComponent(null,nextProps)):(pushPrimaryTreeSuspenseHandler(workInProgress2),mountSuspensePrimaryChildren(workInProgress2,nextPrimaryChildren))}var prevState=current.memoizedState;if(prevState!==null&&(nextPrimaryChildren=prevState.dehydrated,nextPrimaryChildren!==null)){if(didSuspend)workInProgress2.flags&256?(pushPrimaryTreeSuspenseHandler(workInProgress2),workInProgress2.flags&=-257,workInProgress2=retrySuspenseComponentWithoutHydrating(current,workInProgress2,renderLanes2)):workInProgress2.memoizedState!==null?(reuseSuspenseHandlerOnStack(),workInProgress2.child=current.child,workInProgress2.flags|=128,workInProgress2=null):(reuseSuspenseHandlerOnStack(),nextPrimaryChildren=nextProps.fallback,showFallback=workInProgress2.mode,nextProps=mountWorkInProgressOffscreenFiber({mode:"visible",children:nextProps.children},showFallback),nextPrimaryChildren=createFiberFromFragment(nextPrimaryChildren,showFallback,renderLanes2,null),nextPrimaryChildren.flags|=2,nextProps.return=workInProgress2,nextPrimaryChildren.return=workInProgress2,nextProps.sibling=nextPrimaryChildren,workInProgress2.child=nextProps,reconcileChildFibers(workInProgress2,current.child,null,renderLanes2),nextProps=workInProgress2.child,nextProps.memoizedState=mountSuspenseOffscreenState(renderLanes2),nextProps.childLanes=getRemainingWorkInPrimaryTree(current,JSCompiler_temp,renderLanes2),workInProgress2.memoizedState=SUSPENDED_MARKER,workInProgress2=bailoutOffscreenComponent(null,nextProps));else if(pushPrimaryTreeSuspenseHandler(workInProgress2),isSuspenseInstanceFallback(nextPrimaryChildren)){if(JSCompiler_temp=nextPrimaryChildren.nextSibling&&nextPrimaryChildren.nextSibling.dataset,JSCompiler_temp)var digest=JSCompiler_temp.dgst;JSCompiler_temp=digest,nextProps=Error(formatProdErrorMessage(419)),nextProps.stack="",nextProps.digest=JSCompiler_temp,queueHydrationError({value:nextProps,source:null,stack:null}),workInProgress2=retrySuspenseComponentWithoutHydrating(current,workInProgress2,renderLanes2)}else if(didReceiveUpdate||propagateParentContextChanges(current,workInProgress2,renderLanes2,!1),JSCompiler_temp=(renderLanes2¤t.childLanes)!==0,didReceiveUpdate||JSCompiler_temp){if(JSCompiler_temp=workInProgressRoot,JSCompiler_temp!==null&&(nextProps=getBumpedLaneForHydration(JSCompiler_temp,renderLanes2),nextProps!==0&&nextProps!==prevState.retryLane))throw prevState.retryLane=nextProps,enqueueConcurrentRenderForLane(current,nextProps),scheduleUpdateOnFiber(JSCompiler_temp,current,nextProps),SelectiveHydrationException;isSuspenseInstancePending(nextPrimaryChildren)||renderDidSuspendDelayIfPossible(),workInProgress2=retrySuspenseComponentWithoutHydrating(current,workInProgress2,renderLanes2)}else isSuspenseInstancePending(nextPrimaryChildren)?(workInProgress2.flags|=192,workInProgress2.child=current.child,workInProgress2=null):(current=prevState.treeContext,nextHydratableInstance=getNextHydratable(nextPrimaryChildren.nextSibling),hydrationParentFiber=workInProgress2,isHydrating=!0,hydrationErrors=null,rootOrSingletonContext=!1,current!==null&&restoreSuspendedTreeContext(workInProgress2,current),workInProgress2=mountSuspensePrimaryChildren(workInProgress2,nextProps.children),workInProgress2.flags|=4096);return workInProgress2}return showFallback?(reuseSuspenseHandlerOnStack(),nextPrimaryChildren=nextProps.fallback,showFallback=workInProgress2.mode,prevState=current.child,digest=prevState.sibling,nextProps=createWorkInProgress(prevState,{mode:"hidden",children:nextProps.children}),nextProps.subtreeFlags=prevState.subtreeFlags&65011712,digest!==null?nextPrimaryChildren=createWorkInProgress(digest,nextPrimaryChildren):(nextPrimaryChildren=createFiberFromFragment(nextPrimaryChildren,showFallback,renderLanes2,null),nextPrimaryChildren.flags|=2),nextPrimaryChildren.return=workInProgress2,nextProps.return=workInProgress2,nextProps.sibling=nextPrimaryChildren,workInProgress2.child=nextProps,bailoutOffscreenComponent(null,nextProps),nextProps=workInProgress2.child,nextPrimaryChildren=current.child.memoizedState,nextPrimaryChildren===null?nextPrimaryChildren=mountSuspenseOffscreenState(renderLanes2):(showFallback=nextPrimaryChildren.cachePool,showFallback!==null?(prevState=CacheContext._currentValue,showFallback=showFallback.parent!==prevState?{parent:prevState,pool:prevState}:showFallback):showFallback=getSuspendedCache(),nextPrimaryChildren={baseLanes:nextPrimaryChildren.baseLanes|renderLanes2,cachePool:showFallback}),nextProps.memoizedState=nextPrimaryChildren,nextProps.childLanes=getRemainingWorkInPrimaryTree(current,JSCompiler_temp,renderLanes2),workInProgress2.memoizedState=SUSPENDED_MARKER,bailoutOffscreenComponent(current.child,nextProps)):(pushPrimaryTreeSuspenseHandler(workInProgress2),renderLanes2=current.child,current=renderLanes2.sibling,renderLanes2=createWorkInProgress(renderLanes2,{mode:"visible",children:nextProps.children}),renderLanes2.return=workInProgress2,renderLanes2.sibling=null,current!==null&&(JSCompiler_temp=workInProgress2.deletions,JSCompiler_temp===null?(workInProgress2.deletions=[current],workInProgress2.flags|=16):JSCompiler_temp.push(current)),workInProgress2.child=renderLanes2,workInProgress2.memoizedState=null,renderLanes2)}__name(updateSuspenseComponent,"updateSuspenseComponent");function mountSuspensePrimaryChildren(workInProgress2,primaryChildren){return primaryChildren=mountWorkInProgressOffscreenFiber({mode:"visible",children:primaryChildren},workInProgress2.mode),primaryChildren.return=workInProgress2,workInProgress2.child=primaryChildren}__name(mountSuspensePrimaryChildren,"mountSuspensePrimaryChildren");function mountWorkInProgressOffscreenFiber(offscreenProps,mode){return offscreenProps=createFiberImplClass(22,offscreenProps,null,mode),offscreenProps.lanes=0,offscreenProps}__name(mountWorkInProgressOffscreenFiber,"mountWorkInProgressOffscreenFiber");function retrySuspenseComponentWithoutHydrating(current,workInProgress2,renderLanes2){return reconcileChildFibers(workInProgress2,current.child,null,renderLanes2),current=mountSuspensePrimaryChildren(workInProgress2,workInProgress2.pendingProps.children),current.flags|=2,workInProgress2.memoizedState=null,current}__name(retrySuspenseComponentWithoutHydrating,"retrySuspenseComponentWithoutHydrating");function scheduleSuspenseWorkOnFiber(fiber,renderLanes2,propagationRoot){fiber.lanes|=renderLanes2;var alternate=fiber.alternate;alternate!==null&&(alternate.lanes|=renderLanes2),scheduleContextWorkOnParentPath(fiber.return,renderLanes2,propagationRoot)}__name(scheduleSuspenseWorkOnFiber,"scheduleSuspenseWorkOnFiber");function initSuspenseListRenderState(workInProgress2,isBackwards,tail,lastContentRow,tailMode,treeForkCount2){var renderState=workInProgress2.memoizedState;renderState===null?workInProgress2.memoizedState={isBackwards,rendering:null,renderingStartTime:0,last:lastContentRow,tail,tailMode,treeForkCount:treeForkCount2}:(renderState.isBackwards=isBackwards,renderState.rendering=null,renderState.renderingStartTime=0,renderState.last=lastContentRow,renderState.tail=tail,renderState.tailMode=tailMode,renderState.treeForkCount=treeForkCount2)}__name(initSuspenseListRenderState,"initSuspenseListRenderState");function updateSuspenseListComponent(current,workInProgress2,renderLanes2){var nextProps=workInProgress2.pendingProps,revealOrder=nextProps.revealOrder,tailMode=nextProps.tail;nextProps=nextProps.children;var suspenseContext=suspenseStackCursor.current,shouldForceFallback=(suspenseContext&2)!==0;if(shouldForceFallback?(suspenseContext=suspenseContext&1|2,workInProgress2.flags|=128):suspenseContext&=1,push2(suspenseStackCursor,suspenseContext),reconcileChildren(current,workInProgress2,nextProps,renderLanes2),nextProps=isHydrating?treeForkCount:0,!shouldForceFallback&¤t!==null&&(current.flags&128)!==0)a:for(current=workInProgress2.child;current!==null;){if(current.tag===13)current.memoizedState!==null&&scheduleSuspenseWorkOnFiber(current,renderLanes2,workInProgress2);else if(current.tag===19)scheduleSuspenseWorkOnFiber(current,renderLanes2,workInProgress2);else if(current.child!==null){current.child.return=current,current=current.child;continue}if(current===workInProgress2)break a;for(;current.sibling===null;){if(current.return===null||current.return===workInProgress2)break a;current=current.return}current.sibling.return=current.return,current=current.sibling}switch(revealOrder){case"forwards":for(renderLanes2=workInProgress2.child,revealOrder=null;renderLanes2!==null;)current=renderLanes2.alternate,current!==null&&findFirstSuspended(current)===null&&(revealOrder=renderLanes2),renderLanes2=renderLanes2.sibling;renderLanes2=revealOrder,renderLanes2===null?(revealOrder=workInProgress2.child,workInProgress2.child=null):(revealOrder=renderLanes2.sibling,renderLanes2.sibling=null),initSuspenseListRenderState(workInProgress2,!1,revealOrder,renderLanes2,tailMode,nextProps);break;case"backwards":case"unstable_legacy-backwards":for(renderLanes2=null,revealOrder=workInProgress2.child,workInProgress2.child=null;revealOrder!==null;){if(current=revealOrder.alternate,current!==null&&findFirstSuspended(current)===null){workInProgress2.child=revealOrder;break}current=revealOrder.sibling,revealOrder.sibling=renderLanes2,renderLanes2=revealOrder,revealOrder=current}initSuspenseListRenderState(workInProgress2,!0,renderLanes2,null,tailMode,nextProps);break;case"together":initSuspenseListRenderState(workInProgress2,!1,null,null,void 0,nextProps);break;default:workInProgress2.memoizedState=null}return workInProgress2.child}__name(updateSuspenseListComponent,"updateSuspenseListComponent");function bailoutOnAlreadyFinishedWork(current,workInProgress2,renderLanes2){if(current!==null&&(workInProgress2.dependencies=current.dependencies),workInProgressRootSkippedLanes|=workInProgress2.lanes,(renderLanes2&workInProgress2.childLanes)===0)if(current!==null){if(propagateParentContextChanges(current,workInProgress2,renderLanes2,!1),(renderLanes2&workInProgress2.childLanes)===0)return null}else return null;if(current!==null&&workInProgress2.child!==current.child)throw Error(formatProdErrorMessage(153));if(workInProgress2.child!==null){for(current=workInProgress2.child,renderLanes2=createWorkInProgress(current,current.pendingProps),workInProgress2.child=renderLanes2,renderLanes2.return=workInProgress2;current.sibling!==null;)current=current.sibling,renderLanes2=renderLanes2.sibling=createWorkInProgress(current,current.pendingProps),renderLanes2.return=workInProgress2;renderLanes2.sibling=null}return workInProgress2.child}__name(bailoutOnAlreadyFinishedWork,"bailoutOnAlreadyFinishedWork");function checkScheduledUpdateOrContext(current,renderLanes2){return(current.lanes&renderLanes2)!==0?!0:(current=current.dependencies,!!(current!==null&&checkIfContextChanged(current)))}__name(checkScheduledUpdateOrContext,"checkScheduledUpdateOrContext");function attemptEarlyBailoutIfNoScheduledUpdate(current,workInProgress2,renderLanes2){switch(workInProgress2.tag){case 3:pushHostContainer(workInProgress2,workInProgress2.stateNode.containerInfo),pushProvider(workInProgress2,CacheContext,current.memoizedState.cache),resetHydrationState();break;case 27:case 5:pushHostContext(workInProgress2);break;case 4:pushHostContainer(workInProgress2,workInProgress2.stateNode.containerInfo);break;case 10:pushProvider(workInProgress2,workInProgress2.type,workInProgress2.memoizedProps.value);break;case 31:if(workInProgress2.memoizedState!==null)return workInProgress2.flags|=128,pushDehydratedActivitySuspenseHandler(workInProgress2),null;break;case 13:var state$102=workInProgress2.memoizedState;if(state$102!==null)return state$102.dehydrated!==null?(pushPrimaryTreeSuspenseHandler(workInProgress2),workInProgress2.flags|=128,null):(renderLanes2&workInProgress2.child.childLanes)!==0?updateSuspenseComponent(current,workInProgress2,renderLanes2):(pushPrimaryTreeSuspenseHandler(workInProgress2),current=bailoutOnAlreadyFinishedWork(current,workInProgress2,renderLanes2),current!==null?current.sibling:null);pushPrimaryTreeSuspenseHandler(workInProgress2);break;case 19:var didSuspendBefore=(current.flags&128)!==0;if(state$102=(renderLanes2&workInProgress2.childLanes)!==0,state$102||(propagateParentContextChanges(current,workInProgress2,renderLanes2,!1),state$102=(renderLanes2&workInProgress2.childLanes)!==0),didSuspendBefore){if(state$102)return updateSuspenseListComponent(current,workInProgress2,renderLanes2);workInProgress2.flags|=128}if(didSuspendBefore=workInProgress2.memoizedState,didSuspendBefore!==null&&(didSuspendBefore.rendering=null,didSuspendBefore.tail=null,didSuspendBefore.lastEffect=null),push2(suspenseStackCursor,suspenseStackCursor.current),state$102)break;return null;case 22:return workInProgress2.lanes=0,updateOffscreenComponent(current,workInProgress2,renderLanes2,workInProgress2.pendingProps);case 24:pushProvider(workInProgress2,CacheContext,current.memoizedState.cache)}return bailoutOnAlreadyFinishedWork(current,workInProgress2,renderLanes2)}__name(attemptEarlyBailoutIfNoScheduledUpdate,"attemptEarlyBailoutIfNoScheduledUpdate");function beginWork(current,workInProgress2,renderLanes2){if(current!==null)if(current.memoizedProps!==workInProgress2.pendingProps)didReceiveUpdate=!0;else{if(!checkScheduledUpdateOrContext(current,renderLanes2)&&(workInProgress2.flags&128)===0)return didReceiveUpdate=!1,attemptEarlyBailoutIfNoScheduledUpdate(current,workInProgress2,renderLanes2);didReceiveUpdate=(current.flags&131072)!==0}else didReceiveUpdate=!1,isHydrating&&(workInProgress2.flags&1048576)!==0&&pushTreeId(workInProgress2,treeForkCount,workInProgress2.index);switch(workInProgress2.lanes=0,workInProgress2.tag){case 16:a:{var props=workInProgress2.pendingProps;if(current=resolveLazy(workInProgress2.elementType),workInProgress2.type=current,typeof current=="function")shouldConstruct(current)?(props=resolveClassComponentProps(current,props),workInProgress2.tag=1,workInProgress2=updateClassComponent(null,workInProgress2,current,props,renderLanes2)):(workInProgress2.tag=0,workInProgress2=updateFunctionComponent(null,workInProgress2,current,props,renderLanes2));else{if(current!=null){var $$typeof=current.$$typeof;if($$typeof===REACT_FORWARD_REF_TYPE){workInProgress2.tag=11,workInProgress2=updateForwardRef(null,workInProgress2,current,props,renderLanes2);break a}else if($$typeof===REACT_MEMO_TYPE){workInProgress2.tag=14,workInProgress2=updateMemoComponent(null,workInProgress2,current,props,renderLanes2);break a}}throw workInProgress2=getComponentNameFromType(current)||current,Error(formatProdErrorMessage(306,workInProgress2,""))}}return workInProgress2;case 0:return updateFunctionComponent(current,workInProgress2,workInProgress2.type,workInProgress2.pendingProps,renderLanes2);case 1:return props=workInProgress2.type,$$typeof=resolveClassComponentProps(props,workInProgress2.pendingProps),updateClassComponent(current,workInProgress2,props,$$typeof,renderLanes2);case 3:a:{if(pushHostContainer(workInProgress2,workInProgress2.stateNode.containerInfo),current===null)throw Error(formatProdErrorMessage(387));props=workInProgress2.pendingProps;var prevState=workInProgress2.memoizedState;$$typeof=prevState.element,cloneUpdateQueue(current,workInProgress2),processUpdateQueue(workInProgress2,props,null,renderLanes2);var nextState=workInProgress2.memoizedState;if(props=nextState.cache,pushProvider(workInProgress2,CacheContext,props),props!==prevState.cache&&propagateContextChanges(workInProgress2,[CacheContext],renderLanes2,!0),suspendIfUpdateReadFromEntangledAsyncAction(),props=nextState.element,prevState.isDehydrated)if(prevState={element:props,isDehydrated:!1,cache:nextState.cache},workInProgress2.updateQueue.baseState=prevState,workInProgress2.memoizedState=prevState,workInProgress2.flags&256){workInProgress2=mountHostRootWithoutHydrating(current,workInProgress2,props,renderLanes2);break a}else if(props!==$$typeof){$$typeof=createCapturedValueAtFiber(Error(formatProdErrorMessage(424)),workInProgress2),queueHydrationError($$typeof),workInProgress2=mountHostRootWithoutHydrating(current,workInProgress2,props,renderLanes2);break a}else for(current=workInProgress2.stateNode.containerInfo,current.nodeType===9?current=current.body:current=current.nodeName==="HTML"?current.ownerDocument.body:current,nextHydratableInstance=getNextHydratable(current.firstChild),hydrationParentFiber=workInProgress2,isHydrating=!0,hydrationErrors=null,rootOrSingletonContext=!0,renderLanes2=mountChildFibers(workInProgress2,null,props,renderLanes2),workInProgress2.child=renderLanes2;renderLanes2;)renderLanes2.flags=renderLanes2.flags&-3|4096,renderLanes2=renderLanes2.sibling;else{if(resetHydrationState(),props===$$typeof){workInProgress2=bailoutOnAlreadyFinishedWork(current,workInProgress2,renderLanes2);break a}reconcileChildren(current,workInProgress2,props,renderLanes2)}workInProgress2=workInProgress2.child}return workInProgress2;case 26:return markRef(current,workInProgress2),current===null?(renderLanes2=getResource(workInProgress2.type,null,workInProgress2.pendingProps,null))?workInProgress2.memoizedState=renderLanes2:isHydrating||(renderLanes2=workInProgress2.type,current=workInProgress2.pendingProps,props=getOwnerDocumentFromRootContainer(rootInstanceStackCursor.current).createElement(renderLanes2),props[internalInstanceKey]=workInProgress2,props[internalPropsKey]=current,setInitialProperties(props,renderLanes2,current),markNodeAsHoistable(props),workInProgress2.stateNode=props):workInProgress2.memoizedState=getResource(workInProgress2.type,current.memoizedProps,workInProgress2.pendingProps,current.memoizedState),null;case 27:return pushHostContext(workInProgress2),current===null&&isHydrating&&(props=workInProgress2.stateNode=resolveSingletonInstance(workInProgress2.type,workInProgress2.pendingProps,rootInstanceStackCursor.current),hydrationParentFiber=workInProgress2,rootOrSingletonContext=!0,$$typeof=nextHydratableInstance,isSingletonScope(workInProgress2.type)?(previousHydratableOnEnteringScopedSingleton=$$typeof,nextHydratableInstance=getNextHydratable(props.firstChild)):nextHydratableInstance=$$typeof),reconcileChildren(current,workInProgress2,workInProgress2.pendingProps.children,renderLanes2),markRef(current,workInProgress2),current===null&&(workInProgress2.flags|=4194304),workInProgress2.child;case 5:return current===null&&isHydrating&&(($$typeof=props=nextHydratableInstance)&&(props=canHydrateInstance(props,workInProgress2.type,workInProgress2.pendingProps,rootOrSingletonContext),props!==null?(workInProgress2.stateNode=props,hydrationParentFiber=workInProgress2,nextHydratableInstance=getNextHydratable(props.firstChild),rootOrSingletonContext=!1,$$typeof=!0):$$typeof=!1),$$typeof||throwOnHydrationMismatch(workInProgress2)),pushHostContext(workInProgress2),$$typeof=workInProgress2.type,prevState=workInProgress2.pendingProps,nextState=current!==null?current.memoizedProps:null,props=prevState.children,shouldSetTextContent($$typeof,prevState)?props=null:nextState!==null&&shouldSetTextContent($$typeof,nextState)&&(workInProgress2.flags|=32),workInProgress2.memoizedState!==null&&($$typeof=renderWithHooks(current,workInProgress2,TransitionAwareHostComponent,null,null,renderLanes2),HostTransitionContext._currentValue=$$typeof),markRef(current,workInProgress2),reconcileChildren(current,workInProgress2,props,renderLanes2),workInProgress2.child;case 6:return current===null&&isHydrating&&((current=renderLanes2=nextHydratableInstance)&&(renderLanes2=canHydrateTextInstance(renderLanes2,workInProgress2.pendingProps,rootOrSingletonContext),renderLanes2!==null?(workInProgress2.stateNode=renderLanes2,hydrationParentFiber=workInProgress2,nextHydratableInstance=null,current=!0):current=!1),current||throwOnHydrationMismatch(workInProgress2)),null;case 13:return updateSuspenseComponent(current,workInProgress2,renderLanes2);case 4:return pushHostContainer(workInProgress2,workInProgress2.stateNode.containerInfo),props=workInProgress2.pendingProps,current===null?workInProgress2.child=reconcileChildFibers(workInProgress2,null,props,renderLanes2):reconcileChildren(current,workInProgress2,props,renderLanes2),workInProgress2.child;case 11:return updateForwardRef(current,workInProgress2,workInProgress2.type,workInProgress2.pendingProps,renderLanes2);case 7:return reconcileChildren(current,workInProgress2,workInProgress2.pendingProps,renderLanes2),workInProgress2.child;case 8:return reconcileChildren(current,workInProgress2,workInProgress2.pendingProps.children,renderLanes2),workInProgress2.child;case 12:return reconcileChildren(current,workInProgress2,workInProgress2.pendingProps.children,renderLanes2),workInProgress2.child;case 10:return props=workInProgress2.pendingProps,pushProvider(workInProgress2,workInProgress2.type,props.value),reconcileChildren(current,workInProgress2,props.children,renderLanes2),workInProgress2.child;case 9:return $$typeof=workInProgress2.type._context,props=workInProgress2.pendingProps.children,prepareToReadContext(workInProgress2),$$typeof=readContext($$typeof),props=props($$typeof),workInProgress2.flags|=1,reconcileChildren(current,workInProgress2,props,renderLanes2),workInProgress2.child;case 14:return updateMemoComponent(current,workInProgress2,workInProgress2.type,workInProgress2.pendingProps,renderLanes2);case 15:return updateSimpleMemoComponent(current,workInProgress2,workInProgress2.type,workInProgress2.pendingProps,renderLanes2);case 19:return updateSuspenseListComponent(current,workInProgress2,renderLanes2);case 31:return updateActivityComponent(current,workInProgress2,renderLanes2);case 22:return updateOffscreenComponent(current,workInProgress2,renderLanes2,workInProgress2.pendingProps);case 24:return prepareToReadContext(workInProgress2),props=readContext(CacheContext),current===null?($$typeof=peekCacheFromPool(),$$typeof===null&&($$typeof=workInProgressRoot,prevState=createCache(),$$typeof.pooledCache=prevState,prevState.refCount++,prevState!==null&&($$typeof.pooledCacheLanes|=renderLanes2),$$typeof=prevState),workInProgress2.memoizedState={parent:props,cache:$$typeof},initializeUpdateQueue(workInProgress2),pushProvider(workInProgress2,CacheContext,$$typeof)):((current.lanes&renderLanes2)!==0&&(cloneUpdateQueue(current,workInProgress2),processUpdateQueue(workInProgress2,null,null,renderLanes2),suspendIfUpdateReadFromEntangledAsyncAction()),$$typeof=current.memoizedState,prevState=workInProgress2.memoizedState,$$typeof.parent!==props?($$typeof={parent:props,cache:props},workInProgress2.memoizedState=$$typeof,workInProgress2.lanes===0&&(workInProgress2.memoizedState=workInProgress2.updateQueue.baseState=$$typeof),pushProvider(workInProgress2,CacheContext,props)):(props=prevState.cache,pushProvider(workInProgress2,CacheContext,props),props!==$$typeof.cache&&propagateContextChanges(workInProgress2,[CacheContext],renderLanes2,!0))),reconcileChildren(current,workInProgress2,workInProgress2.pendingProps.children,renderLanes2),workInProgress2.child;case 29:throw workInProgress2.pendingProps}throw Error(formatProdErrorMessage(156,workInProgress2.tag))}__name(beginWork,"beginWork");function markUpdate(workInProgress2){workInProgress2.flags|=4}__name(markUpdate,"markUpdate");function preloadInstanceAndSuspendIfNeeded(workInProgress2,type,oldProps,newProps,renderLanes2){if((type=(workInProgress2.mode&32)!==0)&&(type=!1),type){if(workInProgress2.flags|=16777216,(renderLanes2&335544128)===renderLanes2)if(workInProgress2.stateNode.complete)workInProgress2.flags|=8192;else if(shouldRemainOnPreviousScreen())workInProgress2.flags|=8192;else throw suspendedThenable=noopSuspenseyCommitThenable,SuspenseyCommitException}else workInProgress2.flags&=-16777217}__name(preloadInstanceAndSuspendIfNeeded,"preloadInstanceAndSuspendIfNeeded");function preloadResourceAndSuspendIfNeeded(workInProgress2,resource){if(resource.type!=="stylesheet"||(resource.state.loading&4)!==0)workInProgress2.flags&=-16777217;else if(workInProgress2.flags|=16777216,!preloadResource(resource))if(shouldRemainOnPreviousScreen())workInProgress2.flags|=8192;else throw suspendedThenable=noopSuspenseyCommitThenable,SuspenseyCommitException}__name(preloadResourceAndSuspendIfNeeded,"preloadResourceAndSuspendIfNeeded");function scheduleRetryEffect(workInProgress2,retryQueue){retryQueue!==null&&(workInProgress2.flags|=4),workInProgress2.flags&16384&&(retryQueue=workInProgress2.tag!==22?claimNextRetryLane():536870912,workInProgress2.lanes|=retryQueue,workInProgressSuspendedRetryLanes|=retryQueue)}__name(scheduleRetryEffect,"scheduleRetryEffect");function cutOffTailIfNeeded(renderState,hasRenderedATailFallback){if(!isHydrating)switch(renderState.tailMode){case"hidden":hasRenderedATailFallback=renderState.tail;for(var lastTailNode=null;hasRenderedATailFallback!==null;)hasRenderedATailFallback.alternate!==null&&(lastTailNode=hasRenderedATailFallback),hasRenderedATailFallback=hasRenderedATailFallback.sibling;lastTailNode===null?renderState.tail=null:lastTailNode.sibling=null;break;case"collapsed":lastTailNode=renderState.tail;for(var lastTailNode$106=null;lastTailNode!==null;)lastTailNode.alternate!==null&&(lastTailNode$106=lastTailNode),lastTailNode=lastTailNode.sibling;lastTailNode$106===null?hasRenderedATailFallback||renderState.tail===null?renderState.tail=null:renderState.tail.sibling=null:lastTailNode$106.sibling=null}}__name(cutOffTailIfNeeded,"cutOffTailIfNeeded");function bubbleProperties(completedWork){var didBailout=completedWork.alternate!==null&&completedWork.alternate.child===completedWork.child,newChildLanes=0,subtreeFlags=0;if(didBailout)for(var child$107=completedWork.child;child$107!==null;)newChildLanes|=child$107.lanes|child$107.childLanes,subtreeFlags|=child$107.subtreeFlags&65011712,subtreeFlags|=child$107.flags&65011712,child$107.return=completedWork,child$107=child$107.sibling;else for(child$107=completedWork.child;child$107!==null;)newChildLanes|=child$107.lanes|child$107.childLanes,subtreeFlags|=child$107.subtreeFlags,subtreeFlags|=child$107.flags,child$107.return=completedWork,child$107=child$107.sibling;return completedWork.subtreeFlags|=subtreeFlags,completedWork.childLanes=newChildLanes,didBailout}__name(bubbleProperties,"bubbleProperties");function completeWork(current,workInProgress2,renderLanes2){var newProps=workInProgress2.pendingProps;switch(popTreeContext(workInProgress2),workInProgress2.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bubbleProperties(workInProgress2),null;case 1:return bubbleProperties(workInProgress2),null;case 3:return renderLanes2=workInProgress2.stateNode,newProps=null,current!==null&&(newProps=current.memoizedState.cache),workInProgress2.memoizedState.cache!==newProps&&(workInProgress2.flags|=2048),popProvider(CacheContext),popHostContainer(),renderLanes2.pendingContext&&(renderLanes2.context=renderLanes2.pendingContext,renderLanes2.pendingContext=null),(current===null||current.child===null)&&(popHydrationState(workInProgress2)?markUpdate(workInProgress2):current===null||current.memoizedState.isDehydrated&&(workInProgress2.flags&256)===0||(workInProgress2.flags|=1024,upgradeHydrationErrorsToRecoverable())),bubbleProperties(workInProgress2),null;case 26:var type=workInProgress2.type,nextResource=workInProgress2.memoizedState;return current===null?(markUpdate(workInProgress2),nextResource!==null?(bubbleProperties(workInProgress2),preloadResourceAndSuspendIfNeeded(workInProgress2,nextResource)):(bubbleProperties(workInProgress2),preloadInstanceAndSuspendIfNeeded(workInProgress2,type,null,newProps,renderLanes2))):nextResource?nextResource!==current.memoizedState?(markUpdate(workInProgress2),bubbleProperties(workInProgress2),preloadResourceAndSuspendIfNeeded(workInProgress2,nextResource)):(bubbleProperties(workInProgress2),workInProgress2.flags&=-16777217):(current=current.memoizedProps,current!==newProps&&markUpdate(workInProgress2),bubbleProperties(workInProgress2),preloadInstanceAndSuspendIfNeeded(workInProgress2,type,current,newProps,renderLanes2)),null;case 27:if(popHostContext(workInProgress2),renderLanes2=rootInstanceStackCursor.current,type=workInProgress2.type,current!==null&&workInProgress2.stateNode!=null)current.memoizedProps!==newProps&&markUpdate(workInProgress2);else{if(!newProps){if(workInProgress2.stateNode===null)throw Error(formatProdErrorMessage(166));return bubbleProperties(workInProgress2),null}current=contextStackCursor.current,popHydrationState(workInProgress2)?prepareToHydrateHostInstance(workInProgress2):(current=resolveSingletonInstance(type,newProps,renderLanes2),workInProgress2.stateNode=current,markUpdate(workInProgress2))}return bubbleProperties(workInProgress2),null;case 5:if(popHostContext(workInProgress2),type=workInProgress2.type,current!==null&&workInProgress2.stateNode!=null)current.memoizedProps!==newProps&&markUpdate(workInProgress2);else{if(!newProps){if(workInProgress2.stateNode===null)throw Error(formatProdErrorMessage(166));return bubbleProperties(workInProgress2),null}if(nextResource=contextStackCursor.current,popHydrationState(workInProgress2))prepareToHydrateHostInstance(workInProgress2);else{var ownerDocument=getOwnerDocumentFromRootContainer(rootInstanceStackCursor.current);switch(nextResource){case 1:nextResource=ownerDocument.createElementNS("http://www.w3.org/2000/svg",type);break;case 2:nextResource=ownerDocument.createElementNS("http://www.w3.org/1998/Math/MathML",type);break;default:switch(type){case"svg":nextResource=ownerDocument.createElementNS("http://www.w3.org/2000/svg",type);break;case"math":nextResource=ownerDocument.createElementNS("http://www.w3.org/1998/Math/MathML",type);break;case"script":nextResource=ownerDocument.createElement("div"),nextResource.innerHTML="<script><\/script>",nextResource=nextResource.removeChild(nextResource.firstChild);break;case"select":nextResource=typeof newProps.is=="string"?ownerDocument.createElement("select",{is:newProps.is}):ownerDocument.createElement("select"),newProps.multiple?nextResource.multiple=!0:newProps.size&&(nextResource.size=newProps.size);break;default:nextResource=typeof newProps.is=="string"?ownerDocument.createElement(type,{is:newProps.is}):ownerDocument.createElement(type)}}nextResource[internalInstanceKey]=workInProgress2,nextResource[internalPropsKey]=newProps;a:for(ownerDocument=workInProgress2.child;ownerDocument!==null;){if(ownerDocument.tag===5||ownerDocument.tag===6)nextResource.appendChild(ownerDocument.stateNode);else if(ownerDocument.tag!==4&&ownerDocument.tag!==27&&ownerDocument.child!==null){ownerDocument.child.return=ownerDocument,ownerDocument=ownerDocument.child;continue}if(ownerDocument===workInProgress2)break a;for(;ownerDocument.sibling===null;){if(ownerDocument.return===null||ownerDocument.return===workInProgress2)break a;ownerDocument=ownerDocument.return}ownerDocument.sibling.return=ownerDocument.return,ownerDocument=ownerDocument.sibling}workInProgress2.stateNode=nextResource;a:switch(setInitialProperties(nextResource,type,newProps),type){case"button":case"input":case"select":case"textarea":newProps=!!newProps.autoFocus;break a;case"img":newProps=!0;break a;default:newProps=!1}newProps&&markUpdate(workInProgress2)}}return bubbleProperties(workInProgress2),preloadInstanceAndSuspendIfNeeded(workInProgress2,workInProgress2.type,current===null?null:current.memoizedProps,workInProgress2.pendingProps,renderLanes2),null;case 6:if(current&&workInProgress2.stateNode!=null)current.memoizedProps!==newProps&&markUpdate(workInProgress2);else{if(typeof newProps!="string"&&workInProgress2.stateNode===null)throw Error(formatProdErrorMessage(166));if(current=rootInstanceStackCursor.current,popHydrationState(workInProgress2)){if(current=workInProgress2.stateNode,renderLanes2=workInProgress2.memoizedProps,newProps=null,type=hydrationParentFiber,type!==null)switch(type.tag){case 27:case 5:newProps=type.memoizedProps}current[internalInstanceKey]=workInProgress2,current=!!(current.nodeValue===renderLanes2||newProps!==null&&newProps.suppressHydrationWarning===!0||checkForUnmatchedText(current.nodeValue,renderLanes2)),current||throwOnHydrationMismatch(workInProgress2,!0)}else current=getOwnerDocumentFromRootContainer(current).createTextNode(newProps),current[internalInstanceKey]=workInProgress2,workInProgress2.stateNode=current}return bubbleProperties(workInProgress2),null;case 31:if(renderLanes2=workInProgress2.memoizedState,current===null||current.memoizedState!==null){if(newProps=popHydrationState(workInProgress2),renderLanes2!==null){if(current===null){if(!newProps)throw Error(formatProdErrorMessage(318));if(current=workInProgress2.memoizedState,current=current!==null?current.dehydrated:null,!current)throw Error(formatProdErrorMessage(557));current[internalInstanceKey]=workInProgress2}else resetHydrationState(),(workInProgress2.flags&128)===0&&(workInProgress2.memoizedState=null),workInProgress2.flags|=4;bubbleProperties(workInProgress2),current=!1}else renderLanes2=upgradeHydrationErrorsToRecoverable(),current!==null&¤t.memoizedState!==null&&(current.memoizedState.hydrationErrors=renderLanes2),current=!0;if(!current)return workInProgress2.flags&256?(popSuspenseHandler(workInProgress2),workInProgress2):(popSuspenseHandler(workInProgress2),null);if((workInProgress2.flags&128)!==0)throw Error(formatProdErrorMessage(558))}return bubbleProperties(workInProgress2),null;case 13:if(newProps=workInProgress2.memoizedState,current===null||current.memoizedState!==null&¤t.memoizedState.dehydrated!==null){if(type=popHydrationState(workInProgress2),newProps!==null&&newProps.dehydrated!==null){if(current===null){if(!type)throw Error(formatProdErrorMessage(318));if(type=workInProgress2.memoizedState,type=type!==null?type.dehydrated:null,!type)throw Error(formatProdErrorMessage(317));type[internalInstanceKey]=workInProgress2}else resetHydrationState(),(workInProgress2.flags&128)===0&&(workInProgress2.memoizedState=null),workInProgress2.flags|=4;bubbleProperties(workInProgress2),type=!1}else type=upgradeHydrationErrorsToRecoverable(),current!==null&¤t.memoizedState!==null&&(current.memoizedState.hydrationErrors=type),type=!0;if(!type)return workInProgress2.flags&256?(popSuspenseHandler(workInProgress2),workInProgress2):(popSuspenseHandler(workInProgress2),null)}return popSuspenseHandler(workInProgress2),(workInProgress2.flags&128)!==0?(workInProgress2.lanes=renderLanes2,workInProgress2):(renderLanes2=newProps!==null,current=current!==null&¤t.memoizedState!==null,renderLanes2&&(newProps=workInProgress2.child,type=null,newProps.alternate!==null&&newProps.alternate.memoizedState!==null&&newProps.alternate.memoizedState.cachePool!==null&&(type=newProps.alternate.memoizedState.cachePool.pool),nextResource=null,newProps.memoizedState!==null&&newProps.memoizedState.cachePool!==null&&(nextResource=newProps.memoizedState.cachePool.pool),nextResource!==type&&(newProps.flags|=2048)),renderLanes2!==current&&renderLanes2&&(workInProgress2.child.flags|=8192),scheduleRetryEffect(workInProgress2,workInProgress2.updateQueue),bubbleProperties(workInProgress2),null);case 4:return popHostContainer(),current===null&&listenToAllSupportedEvents(workInProgress2.stateNode.containerInfo),bubbleProperties(workInProgress2),null;case 10:return popProvider(workInProgress2.type),bubbleProperties(workInProgress2),null;case 19:if(pop(suspenseStackCursor),newProps=workInProgress2.memoizedState,newProps===null)return bubbleProperties(workInProgress2),null;if(type=(workInProgress2.flags&128)!==0,nextResource=newProps.rendering,nextResource===null)if(type)cutOffTailIfNeeded(newProps,!1);else{if(workInProgressRootExitStatus!==0||current!==null&&(current.flags&128)!==0)for(current=workInProgress2.child;current!==null;){if(nextResource=findFirstSuspended(current),nextResource!==null){for(workInProgress2.flags|=128,cutOffTailIfNeeded(newProps,!1),current=nextResource.updateQueue,workInProgress2.updateQueue=current,scheduleRetryEffect(workInProgress2,current),workInProgress2.subtreeFlags=0,current=renderLanes2,renderLanes2=workInProgress2.child;renderLanes2!==null;)resetWorkInProgress(renderLanes2,current),renderLanes2=renderLanes2.sibling;return push2(suspenseStackCursor,suspenseStackCursor.current&1|2),isHydrating&&pushTreeFork(workInProgress2,newProps.treeForkCount),workInProgress2.child}current=current.sibling}newProps.tail!==null&&now()>workInProgressRootRenderTargetTime&&(workInProgress2.flags|=128,type=!0,cutOffTailIfNeeded(newProps,!1),workInProgress2.lanes=4194304)}else{if(!type)if(current=findFirstSuspended(nextResource),current!==null){if(workInProgress2.flags|=128,type=!0,current=current.updateQueue,workInProgress2.updateQueue=current,scheduleRetryEffect(workInProgress2,current),cutOffTailIfNeeded(newProps,!0),newProps.tail===null&&newProps.tailMode==="hidden"&&!nextResource.alternate&&!isHydrating)return bubbleProperties(workInProgress2),null}else 2*now()-newProps.renderingStartTime>workInProgressRootRenderTargetTime&&renderLanes2!==536870912&&(workInProgress2.flags|=128,type=!0,cutOffTailIfNeeded(newProps,!1),workInProgress2.lanes=4194304);newProps.isBackwards?(nextResource.sibling=workInProgress2.child,workInProgress2.child=nextResource):(current=newProps.last,current!==null?current.sibling=nextResource:workInProgress2.child=nextResource,newProps.last=nextResource)}return newProps.tail!==null?(current=newProps.tail,newProps.rendering=current,newProps.tail=current.sibling,newProps.renderingStartTime=now(),current.sibling=null,renderLanes2=suspenseStackCursor.current,push2(suspenseStackCursor,type?renderLanes2&1|2:renderLanes2&1),isHydrating&&pushTreeFork(workInProgress2,newProps.treeForkCount),current):(bubbleProperties(workInProgress2),null);case 22:case 23:return popSuspenseHandler(workInProgress2),popHiddenContext(),newProps=workInProgress2.memoizedState!==null,current!==null?current.memoizedState!==null!==newProps&&(workInProgress2.flags|=8192):newProps&&(workInProgress2.flags|=8192),newProps?(renderLanes2&536870912)!==0&&(workInProgress2.flags&128)===0&&(bubbleProperties(workInProgress2),workInProgress2.subtreeFlags&6&&(workInProgress2.flags|=8192)):bubbleProperties(workInProgress2),renderLanes2=workInProgress2.updateQueue,renderLanes2!==null&&scheduleRetryEffect(workInProgress2,renderLanes2.retryQueue),renderLanes2=null,current!==null&¤t.memoizedState!==null&¤t.memoizedState.cachePool!==null&&(renderLanes2=current.memoizedState.cachePool.pool),newProps=null,workInProgress2.memoizedState!==null&&workInProgress2.memoizedState.cachePool!==null&&(newProps=workInProgress2.memoizedState.cachePool.pool),newProps!==renderLanes2&&(workInProgress2.flags|=2048),current!==null&&pop(resumedCache),null;case 24:return renderLanes2=null,current!==null&&(renderLanes2=current.memoizedState.cache),workInProgress2.memoizedState.cache!==renderLanes2&&(workInProgress2.flags|=2048),popProvider(CacheContext),bubbleProperties(workInProgress2),null;case 25:return null;case 30:return null}throw Error(formatProdErrorMessage(156,workInProgress2.tag))}__name(completeWork,"completeWork");function unwindWork(current,workInProgress2){switch(popTreeContext(workInProgress2),workInProgress2.tag){case 1:return current=workInProgress2.flags,current&65536?(workInProgress2.flags=current&-65537|128,workInProgress2):null;case 3:return popProvider(CacheContext),popHostContainer(),current=workInProgress2.flags,(current&65536)!==0&&(current&128)===0?(workInProgress2.flags=current&-65537|128,workInProgress2):null;case 26:case 27:case 5:return popHostContext(workInProgress2),null;case 31:if(workInProgress2.memoizedState!==null){if(popSuspenseHandler(workInProgress2),workInProgress2.alternate===null)throw Error(formatProdErrorMessage(340));resetHydrationState()}return current=workInProgress2.flags,current&65536?(workInProgress2.flags=current&-65537|128,workInProgress2):null;case 13:if(popSuspenseHandler(workInProgress2),current=workInProgress2.memoizedState,current!==null&¤t.dehydrated!==null){if(workInProgress2.alternate===null)throw Error(formatProdErrorMessage(340));resetHydrationState()}return current=workInProgress2.flags,current&65536?(workInProgress2.flags=current&-65537|128,workInProgress2):null;case 19:return pop(suspenseStackCursor),null;case 4:return popHostContainer(),null;case 10:return popProvider(workInProgress2.type),null;case 22:case 23:return popSuspenseHandler(workInProgress2),popHiddenContext(),current!==null&&pop(resumedCache),current=workInProgress2.flags,current&65536?(workInProgress2.flags=current&-65537|128,workInProgress2):null;case 24:return popProvider(CacheContext),null;case 25:return null;default:return null}}__name(unwindWork,"unwindWork");function unwindInterruptedWork(current,interruptedWork){switch(popTreeContext(interruptedWork),interruptedWork.tag){case 3:popProvider(CacheContext),popHostContainer();break;case 26:case 27:case 5:popHostContext(interruptedWork);break;case 4:popHostContainer();break;case 31:interruptedWork.memoizedState!==null&&popSuspenseHandler(interruptedWork);break;case 13:popSuspenseHandler(interruptedWork);break;case 19:pop(suspenseStackCursor);break;case 10:popProvider(interruptedWork.type);break;case 22:case 23:popSuspenseHandler(interruptedWork),popHiddenContext(),current!==null&&pop(resumedCache);break;case 24:popProvider(CacheContext)}}__name(unwindInterruptedWork,"unwindInterruptedWork");function commitHookEffectListMount(flags,finishedWork){try{var updateQueue=finishedWork.updateQueue,lastEffect=updateQueue!==null?updateQueue.lastEffect:null;if(lastEffect!==null){var firstEffect=lastEffect.next;updateQueue=firstEffect;do{if((updateQueue.tag&flags)===flags){lastEffect=void 0;var create2=updateQueue.create,inst=updateQueue.inst;lastEffect=create2(),inst.destroy=lastEffect}updateQueue=updateQueue.next}while(updateQueue!==firstEffect)}}catch(error2){captureCommitPhaseError(finishedWork,finishedWork.return,error2)}}__name(commitHookEffectListMount,"commitHookEffectListMount");function commitHookEffectListUnmount(flags,finishedWork,nearestMountedAncestor$jscomp$0){try{var updateQueue=finishedWork.updateQueue,lastEffect=updateQueue!==null?updateQueue.lastEffect:null;if(lastEffect!==null){var firstEffect=lastEffect.next;updateQueue=firstEffect;do{if((updateQueue.tag&flags)===flags){var inst=updateQueue.inst,destroy=inst.destroy;if(destroy!==void 0){inst.destroy=void 0,lastEffect=finishedWork;var nearestMountedAncestor=nearestMountedAncestor$jscomp$0,destroy_=destroy;try{destroy_()}catch(error2){captureCommitPhaseError(lastEffect,nearestMountedAncestor,error2)}}}updateQueue=updateQueue.next}while(updateQueue!==firstEffect)}}catch(error2){captureCommitPhaseError(finishedWork,finishedWork.return,error2)}}__name(commitHookEffectListUnmount,"commitHookEffectListUnmount");function commitClassCallbacks(finishedWork){var updateQueue=finishedWork.updateQueue;if(updateQueue!==null){var instance=finishedWork.stateNode;try{commitCallbacks(updateQueue,instance)}catch(error2){captureCommitPhaseError(finishedWork,finishedWork.return,error2)}}}__name(commitClassCallbacks,"commitClassCallbacks");function safelyCallComponentWillUnmount(current,nearestMountedAncestor,instance){instance.props=resolveClassComponentProps(current.type,current.memoizedProps),instance.state=current.memoizedState;try{instance.componentWillUnmount()}catch(error2){captureCommitPhaseError(current,nearestMountedAncestor,error2)}}__name(safelyCallComponentWillUnmount,"safelyCallComponentWillUnmount");function safelyAttachRef(current,nearestMountedAncestor){try{var ref=current.ref;if(ref!==null){switch(current.tag){case 26:case 27:case 5:var instanceToUse=current.stateNode;break;case 30:instanceToUse=current.stateNode;break;default:instanceToUse=current.stateNode}typeof ref=="function"?current.refCleanup=ref(instanceToUse):ref.current=instanceToUse}}catch(error2){captureCommitPhaseError(current,nearestMountedAncestor,error2)}}__name(safelyAttachRef,"safelyAttachRef");function safelyDetachRef(current,nearestMountedAncestor){var ref=current.ref,refCleanup=current.refCleanup;if(ref!==null)if(typeof refCleanup=="function")try{refCleanup()}catch(error2){captureCommitPhaseError(current,nearestMountedAncestor,error2)}finally{current.refCleanup=null,current=current.alternate,current!=null&&(current.refCleanup=null)}else if(typeof ref=="function")try{ref(null)}catch(error$140){captureCommitPhaseError(current,nearestMountedAncestor,error$140)}else ref.current=null}__name(safelyDetachRef,"safelyDetachRef");function commitHostMount(finishedWork){var type=finishedWork.type,props=finishedWork.memoizedProps,instance=finishedWork.stateNode;try{a:switch(type){case"button":case"input":case"select":case"textarea":props.autoFocus&&instance.focus();break a;case"img":props.src?instance.src=props.src:props.srcSet&&(instance.srcset=props.srcSet)}}catch(error2){captureCommitPhaseError(finishedWork,finishedWork.return,error2)}}__name(commitHostMount,"commitHostMount");function commitHostUpdate(finishedWork,newProps,oldProps){try{var domElement=finishedWork.stateNode;updateProperties(domElement,finishedWork.type,oldProps,newProps),domElement[internalPropsKey]=newProps}catch(error2){captureCommitPhaseError(finishedWork,finishedWork.return,error2)}}__name(commitHostUpdate,"commitHostUpdate");function isHostParent(fiber){return fiber.tag===5||fiber.tag===3||fiber.tag===26||fiber.tag===27&&isSingletonScope(fiber.type)||fiber.tag===4}__name(isHostParent,"isHostParent");function getHostSibling(fiber){a:for(;;){for(;fiber.sibling===null;){if(fiber.return===null||isHostParent(fiber.return))return null;fiber=fiber.return}for(fiber.sibling.return=fiber.return,fiber=fiber.sibling;fiber.tag!==5&&fiber.tag!==6&&fiber.tag!==18;){if(fiber.tag===27&&isSingletonScope(fiber.type)||fiber.flags&2||fiber.child===null||fiber.tag===4)continue a;fiber.child.return=fiber,fiber=fiber.child}if(!(fiber.flags&2))return fiber.stateNode}}__name(getHostSibling,"getHostSibling");function insertOrAppendPlacementNodeIntoContainer(node2,before,parent){var tag=node2.tag;if(tag===5||tag===6)node2=node2.stateNode,before?(parent.nodeType===9?parent.body:parent.nodeName==="HTML"?parent.ownerDocument.body:parent).insertBefore(node2,before):(before=parent.nodeType===9?parent.body:parent.nodeName==="HTML"?parent.ownerDocument.body:parent,before.appendChild(node2),parent=parent._reactRootContainer,parent!=null||before.onclick!==null||(before.onclick=noop$12));else if(tag!==4&&(tag===27&&isSingletonScope(node2.type)&&(parent=node2.stateNode,before=null),node2=node2.child,node2!==null))for(insertOrAppendPlacementNodeIntoContainer(node2,before,parent),node2=node2.sibling;node2!==null;)insertOrAppendPlacementNodeIntoContainer(node2,before,parent),node2=node2.sibling}__name(insertOrAppendPlacementNodeIntoContainer,"insertOrAppendPlacementNodeIntoContainer");function insertOrAppendPlacementNode(node2,before,parent){var tag=node2.tag;if(tag===5||tag===6)node2=node2.stateNode,before?parent.insertBefore(node2,before):parent.appendChild(node2);else if(tag!==4&&(tag===27&&isSingletonScope(node2.type)&&(parent=node2.stateNode),node2=node2.child,node2!==null))for(insertOrAppendPlacementNode(node2,before,parent),node2=node2.sibling;node2!==null;)insertOrAppendPlacementNode(node2,before,parent),node2=node2.sibling}__name(insertOrAppendPlacementNode,"insertOrAppendPlacementNode");function commitHostSingletonAcquisition(finishedWork){var singleton=finishedWork.stateNode,props=finishedWork.memoizedProps;try{for(var type=finishedWork.type,attributes=singleton.attributes;attributes.length;)singleton.removeAttributeNode(attributes[0]);setInitialProperties(singleton,type,props),singleton[internalInstanceKey]=finishedWork,singleton[internalPropsKey]=props}catch(error2){captureCommitPhaseError(finishedWork,finishedWork.return,error2)}}__name(commitHostSingletonAcquisition,"commitHostSingletonAcquisition");var offscreenSubtreeIsHidden=!1,offscreenSubtreeWasHidden=!1,needsFormReset=!1,PossiblyWeakSet=typeof WeakSet=="function"?WeakSet:Set,nextEffect=null;function commitBeforeMutationEffects(root3,firstChild){if(root3=root3.containerInfo,eventsEnabled=_enabled,root3=getActiveElementDeep(root3),hasSelectionCapabilities(root3)){if("selectionStart"in root3)var JSCompiler_temp={start:root3.selectionStart,end:root3.selectionEnd};else a:{JSCompiler_temp=(JSCompiler_temp=root3.ownerDocument)&&JSCompiler_temp.defaultView||window;var selection=JSCompiler_temp.getSelection&&JSCompiler_temp.getSelection();if(selection&&selection.rangeCount!==0){JSCompiler_temp=selection.anchorNode;var anchorOffset=selection.anchorOffset,focusNode=selection.focusNode;selection=selection.focusOffset;try{JSCompiler_temp.nodeType,focusNode.nodeType}catch{JSCompiler_temp=null;break a}var length=0,start=-1,end=-1,indexWithinAnchor=0,indexWithinFocus=0,node2=root3,parentNode=null;b:for(;;){for(var next2;node2!==JSCompiler_temp||anchorOffset!==0&&node2.nodeType!==3||(start=length+anchorOffset),node2!==focusNode||selection!==0&&node2.nodeType!==3||(end=length+selection),node2.nodeType===3&&(length+=node2.nodeValue.length),(next2=node2.firstChild)!==null;)parentNode=node2,node2=next2;for(;;){if(node2===root3)break b;if(parentNode===JSCompiler_temp&&++indexWithinAnchor===anchorOffset&&(start=length),parentNode===focusNode&&++indexWithinFocus===selection&&(end=length),(next2=node2.nextSibling)!==null)break;node2=parentNode,parentNode=node2.parentNode}node2=next2}JSCompiler_temp=start===-1||end===-1?null:{start,end}}else JSCompiler_temp=null}JSCompiler_temp=JSCompiler_temp||{start:0,end:0}}else JSCompiler_temp=null;for(selectionInformation={focusedElem:root3,selectionRange:JSCompiler_temp},_enabled=!1,nextEffect=firstChild;nextEffect!==null;)if(firstChild=nextEffect,root3=firstChild.child,(firstChild.subtreeFlags&1028)!==0&&root3!==null)root3.return=firstChild,nextEffect=root3;else for(;nextEffect!==null;){switch(firstChild=nextEffect,focusNode=firstChild.alternate,root3=firstChild.flags,firstChild.tag){case 0:if((root3&4)!==0&&(root3=firstChild.updateQueue,root3=root3!==null?root3.events:null,root3!==null))for(JSCompiler_temp=0;JSCompiler_temp<root3.length;JSCompiler_temp++)anchorOffset=root3[JSCompiler_temp],anchorOffset.ref.impl=anchorOffset.nextImpl;break;case 11:case 15:break;case 1:if((root3&1024)!==0&&focusNode!==null){root3=void 0,JSCompiler_temp=firstChild,anchorOffset=focusNode.memoizedProps,focusNode=focusNode.memoizedState,selection=JSCompiler_temp.stateNode;try{var resolvedPrevProps=resolveClassComponentProps(JSCompiler_temp.type,anchorOffset);root3=selection.getSnapshotBeforeUpdate(resolvedPrevProps,focusNode),selection.__reactInternalSnapshotBeforeUpdate=root3}catch(error2){captureCommitPhaseError(JSCompiler_temp,JSCompiler_temp.return,error2)}}break;case 3:if((root3&1024)!==0){if(root3=firstChild.stateNode.containerInfo,JSCompiler_temp=root3.nodeType,JSCompiler_temp===9)clearContainerSparingly(root3);else if(JSCompiler_temp===1)switch(root3.nodeName){case"HEAD":case"HTML":case"BODY":clearContainerSparingly(root3);break;default:root3.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((root3&1024)!==0)throw Error(formatProdErrorMessage(163))}if(root3=firstChild.sibling,root3!==null){root3.return=firstChild.return,nextEffect=root3;break}nextEffect=firstChild.return}}__name(commitBeforeMutationEffects,"commitBeforeMutationEffects");function commitLayoutEffectOnFiber(finishedRoot,current,finishedWork){var flags=finishedWork.flags;switch(finishedWork.tag){case 0:case 11:case 15:recursivelyTraverseLayoutEffects(finishedRoot,finishedWork),flags&4&&commitHookEffectListMount(5,finishedWork);break;case 1:if(recursivelyTraverseLayoutEffects(finishedRoot,finishedWork),flags&4)if(finishedRoot=finishedWork.stateNode,current===null)try{finishedRoot.componentDidMount()}catch(error2){captureCommitPhaseError(finishedWork,finishedWork.return,error2)}else{var prevProps=resolveClassComponentProps(finishedWork.type,current.memoizedProps);current=current.memoizedState;try{finishedRoot.componentDidUpdate(prevProps,current,finishedRoot.__reactInternalSnapshotBeforeUpdate)}catch(error$139){captureCommitPhaseError(finishedWork,finishedWork.return,error$139)}}flags&64&&commitClassCallbacks(finishedWork),flags&512&&safelyAttachRef(finishedWork,finishedWork.return);break;case 3:if(recursivelyTraverseLayoutEffects(finishedRoot,finishedWork),flags&64&&(finishedRoot=finishedWork.updateQueue,finishedRoot!==null)){if(current=null,finishedWork.child!==null)switch(finishedWork.child.tag){case 27:case 5:current=finishedWork.child.stateNode;break;case 1:current=finishedWork.child.stateNode}try{commitCallbacks(finishedRoot,current)}catch(error2){captureCommitPhaseError(finishedWork,finishedWork.return,error2)}}break;case 27:current===null&&flags&4&&commitHostSingletonAcquisition(finishedWork);case 26:case 5:recursivelyTraverseLayoutEffects(finishedRoot,finishedWork),current===null&&flags&4&&commitHostMount(finishedWork),flags&512&&safelyAttachRef(finishedWork,finishedWork.return);break;case 12:recursivelyTraverseLayoutEffects(finishedRoot,finishedWork);break;case 31:recursivelyTraverseLayoutEffects(finishedRoot,finishedWork),flags&4&&commitActivityHydrationCallbacks(finishedRoot,finishedWork);break;case 13:recursivelyTraverseLayoutEffects(finishedRoot,finishedWork),flags&4&&commitSuspenseHydrationCallbacks(finishedRoot,finishedWork),flags&64&&(finishedRoot=finishedWork.memoizedState,finishedRoot!==null&&(finishedRoot=finishedRoot.dehydrated,finishedRoot!==null&&(finishedWork=retryDehydratedSuspenseBoundary.bind(null,finishedWork),registerSuspenseInstanceRetry(finishedRoot,finishedWork))));break;case 22:if(flags=finishedWork.memoizedState!==null||offscreenSubtreeIsHidden,!flags){current=current!==null&¤t.memoizedState!==null||offscreenSubtreeWasHidden,prevProps=offscreenSubtreeIsHidden;var prevOffscreenSubtreeWasHidden=offscreenSubtreeWasHidden;offscreenSubtreeIsHidden=flags,(offscreenSubtreeWasHidden=current)&&!prevOffscreenSubtreeWasHidden?recursivelyTraverseReappearLayoutEffects(finishedRoot,finishedWork,(finishedWork.subtreeFlags&8772)!==0):recursivelyTraverseLayoutEffects(finishedRoot,finishedWork),offscreenSubtreeIsHidden=prevProps,offscreenSubtreeWasHidden=prevOffscreenSubtreeWasHidden}break;case 30:break;default:recursivelyTraverseLayoutEffects(finishedRoot,finishedWork)}}__name(commitLayoutEffectOnFiber,"commitLayoutEffectOnFiber");function detachFiberAfterEffects(fiber){var alternate=fiber.alternate;alternate!==null&&(fiber.alternate=null,detachFiberAfterEffects(alternate)),fiber.child=null,fiber.deletions=null,fiber.sibling=null,fiber.tag===5&&(alternate=fiber.stateNode,alternate!==null&&detachDeletedInstance(alternate)),fiber.stateNode=null,fiber.return=null,fiber.dependencies=null,fiber.memoizedProps=null,fiber.memoizedState=null,fiber.pendingProps=null,fiber.stateNode=null,fiber.updateQueue=null}__name(detachFiberAfterEffects,"detachFiberAfterEffects");var hostParent=null,hostParentIsContainer=!1;function recursivelyTraverseDeletionEffects(finishedRoot,nearestMountedAncestor,parent){for(parent=parent.child;parent!==null;)commitDeletionEffectsOnFiber(finishedRoot,nearestMountedAncestor,parent),parent=parent.sibling}__name(recursivelyTraverseDeletionEffects,"recursivelyTraverseDeletionEffects");function commitDeletionEffectsOnFiber(finishedRoot,nearestMountedAncestor,deletedFiber){if(injectedHook&&typeof injectedHook.onCommitFiberUnmount=="function")try{injectedHook.onCommitFiberUnmount(rendererID,deletedFiber)}catch{}switch(deletedFiber.tag){case 26:offscreenSubtreeWasHidden||safelyDetachRef(deletedFiber,nearestMountedAncestor),recursivelyTraverseDeletionEffects(finishedRoot,nearestMountedAncestor,deletedFiber),deletedFiber.memoizedState?deletedFiber.memoizedState.count--:deletedFiber.stateNode&&(deletedFiber=deletedFiber.stateNode,deletedFiber.parentNode.removeChild(deletedFiber));break;case 27:offscreenSubtreeWasHidden||safelyDetachRef(deletedFiber,nearestMountedAncestor);var prevHostParent=hostParent,prevHostParentIsContainer=hostParentIsContainer;isSingletonScope(deletedFiber.type)&&(hostParent=deletedFiber.stateNode,hostParentIsContainer=!1),recursivelyTraverseDeletionEffects(finishedRoot,nearestMountedAncestor,deletedFiber),releaseSingletonInstance(deletedFiber.stateNode),hostParent=prevHostParent,hostParentIsContainer=prevHostParentIsContainer;break;case 5:offscreenSubtreeWasHidden||safelyDetachRef(deletedFiber,nearestMountedAncestor);case 6:if(prevHostParent=hostParent,prevHostParentIsContainer=hostParentIsContainer,hostParent=null,recursivelyTraverseDeletionEffects(finishedRoot,nearestMountedAncestor,deletedFiber),hostParent=prevHostParent,hostParentIsContainer=prevHostParentIsContainer,hostParent!==null)if(hostParentIsContainer)try{(hostParent.nodeType===9?hostParent.body:hostParent.nodeName==="HTML"?hostParent.ownerDocument.body:hostParent).removeChild(deletedFiber.stateNode)}catch(error2){captureCommitPhaseError(deletedFiber,nearestMountedAncestor,error2)}else try{hostParent.removeChild(deletedFiber.stateNode)}catch(error2){captureCommitPhaseError(deletedFiber,nearestMountedAncestor,error2)}break;case 18:hostParent!==null&&(hostParentIsContainer?(finishedRoot=hostParent,clearHydrationBoundary(finishedRoot.nodeType===9?finishedRoot.body:finishedRoot.nodeName==="HTML"?finishedRoot.ownerDocument.body:finishedRoot,deletedFiber.stateNode),retryIfBlockedOn(finishedRoot)):clearHydrationBoundary(hostParent,deletedFiber.stateNode));break;case 4:prevHostParent=hostParent,prevHostParentIsContainer=hostParentIsContainer,hostParent=deletedFiber.stateNode.containerInfo,hostParentIsContainer=!0,recursivelyTraverseDeletionEffects(finishedRoot,nearestMountedAncestor,deletedFiber),hostParent=prevHostParent,hostParentIsContainer=prevHostParentIsContainer;break;case 0:case 11:case 14:case 15:commitHookEffectListUnmount(2,deletedFiber,nearestMountedAncestor),offscreenSubtreeWasHidden||commitHookEffectListUnmount(4,deletedFiber,nearestMountedAncestor),recursivelyTraverseDeletionEffects(finishedRoot,nearestMountedAncestor,deletedFiber);break;case 1:offscreenSubtreeWasHidden||(safelyDetachRef(deletedFiber,nearestMountedAncestor),prevHostParent=deletedFiber.stateNode,typeof prevHostParent.componentWillUnmount=="function"&&safelyCallComponentWillUnmount(deletedFiber,nearestMountedAncestor,prevHostParent)),recursivelyTraverseDeletionEffects(finishedRoot,nearestMountedAncestor,deletedFiber);break;case 21:recursivelyTraverseDeletionEffects(finishedRoot,nearestMountedAncestor,deletedFiber);break;case 22:offscreenSubtreeWasHidden=(prevHostParent=offscreenSubtreeWasHidden)||deletedFiber.memoizedState!==null,recursivelyTraverseDeletionEffects(finishedRoot,nearestMountedAncestor,deletedFiber),offscreenSubtreeWasHidden=prevHostParent;break;default:recursivelyTraverseDeletionEffects(finishedRoot,nearestMountedAncestor,deletedFiber)}}__name(commitDeletionEffectsOnFiber,"commitDeletionEffectsOnFiber");function commitActivityHydrationCallbacks(finishedRoot,finishedWork){if(finishedWork.memoizedState===null&&(finishedRoot=finishedWork.alternate,finishedRoot!==null&&(finishedRoot=finishedRoot.memoizedState,finishedRoot!==null))){finishedRoot=finishedRoot.dehydrated;try{retryIfBlockedOn(finishedRoot)}catch(error2){captureCommitPhaseError(finishedWork,finishedWork.return,error2)}}}__name(commitActivityHydrationCallbacks,"commitActivityHydrationCallbacks");function commitSuspenseHydrationCallbacks(finishedRoot,finishedWork){if(finishedWork.memoizedState===null&&(finishedRoot=finishedWork.alternate,finishedRoot!==null&&(finishedRoot=finishedRoot.memoizedState,finishedRoot!==null&&(finishedRoot=finishedRoot.dehydrated,finishedRoot!==null))))try{retryIfBlockedOn(finishedRoot)}catch(error2){captureCommitPhaseError(finishedWork,finishedWork.return,error2)}}__name(commitSuspenseHydrationCallbacks,"commitSuspenseHydrationCallbacks");function getRetryCache(finishedWork){switch(finishedWork.tag){case 31:case 13:case 19:var retryCache=finishedWork.stateNode;return retryCache===null&&(retryCache=finishedWork.stateNode=new PossiblyWeakSet),retryCache;case 22:return finishedWork=finishedWork.stateNode,retryCache=finishedWork._retryCache,retryCache===null&&(retryCache=finishedWork._retryCache=new PossiblyWeakSet),retryCache;default:throw Error(formatProdErrorMessage(435,finishedWork.tag))}}__name(getRetryCache,"getRetryCache");function attachSuspenseRetryListeners(finishedWork,wakeables){var retryCache=getRetryCache(finishedWork);wakeables.forEach(function(wakeable){if(!retryCache.has(wakeable)){retryCache.add(wakeable);var retry=resolveRetryWakeable.bind(null,finishedWork,wakeable);wakeable.then(retry,retry)}})}__name(attachSuspenseRetryListeners,"attachSuspenseRetryListeners");function recursivelyTraverseMutationEffects(root$jscomp$0,parentFiber){var deletions=parentFiber.deletions;if(deletions!==null)for(var i2=0;i2<deletions.length;i2++){var childToDelete=deletions[i2],root3=root$jscomp$0,returnFiber=parentFiber,parent=returnFiber;a:for(;parent!==null;){switch(parent.tag){case 27:if(isSingletonScope(parent.type)){hostParent=parent.stateNode,hostParentIsContainer=!1;break a}break;case 5:hostParent=parent.stateNode,hostParentIsContainer=!1;break a;case 3:case 4:hostParent=parent.stateNode.containerInfo,hostParentIsContainer=!0;break a}parent=parent.return}if(hostParent===null)throw Error(formatProdErrorMessage(160));commitDeletionEffectsOnFiber(root3,returnFiber,childToDelete),hostParent=null,hostParentIsContainer=!1,root3=childToDelete.alternate,root3!==null&&(root3.return=null),childToDelete.return=null}if(parentFiber.subtreeFlags&13886)for(parentFiber=parentFiber.child;parentFiber!==null;)commitMutationEffectsOnFiber(parentFiber,root$jscomp$0),parentFiber=parentFiber.sibling}__name(recursivelyTraverseMutationEffects,"recursivelyTraverseMutationEffects");var currentHoistableRoot=null;function commitMutationEffectsOnFiber(finishedWork,root3){var current=finishedWork.alternate,flags=finishedWork.flags;switch(finishedWork.tag){case 0:case 11:case 14:case 15:recursivelyTraverseMutationEffects(root3,finishedWork),commitReconciliationEffects(finishedWork),flags&4&&(commitHookEffectListUnmount(3,finishedWork,finishedWork.return),commitHookEffectListMount(3,finishedWork),commitHookEffectListUnmount(5,finishedWork,finishedWork.return));break;case 1:recursivelyTraverseMutationEffects(root3,finishedWork),commitReconciliationEffects(finishedWork),flags&512&&(offscreenSubtreeWasHidden||current===null||safelyDetachRef(current,current.return)),flags&64&&offscreenSubtreeIsHidden&&(finishedWork=finishedWork.updateQueue,finishedWork!==null&&(flags=finishedWork.callbacks,flags!==null&&(current=finishedWork.shared.hiddenCallbacks,finishedWork.shared.hiddenCallbacks=current===null?flags:current.concat(flags))));break;case 26:var hoistableRoot=currentHoistableRoot;if(recursivelyTraverseMutationEffects(root3,finishedWork),commitReconciliationEffects(finishedWork),flags&512&&(offscreenSubtreeWasHidden||current===null||safelyDetachRef(current,current.return)),flags&4){var currentResource=current!==null?current.memoizedState:null;if(flags=finishedWork.memoizedState,current===null)if(flags===null)if(finishedWork.stateNode===null){a:{flags=finishedWork.type,current=finishedWork.memoizedProps,hoistableRoot=hoistableRoot.ownerDocument||hoistableRoot;b:switch(flags){case"title":currentResource=hoistableRoot.getElementsByTagName("title")[0],(!currentResource||currentResource[internalHoistableMarker]||currentResource[internalInstanceKey]||currentResource.namespaceURI==="http://www.w3.org/2000/svg"||currentResource.hasAttribute("itemprop"))&&(currentResource=hoistableRoot.createElement(flags),hoistableRoot.head.insertBefore(currentResource,hoistableRoot.querySelector("head > title"))),setInitialProperties(currentResource,flags,current),currentResource[internalInstanceKey]=finishedWork,markNodeAsHoistable(currentResource),flags=currentResource;break a;case"link":var maybeNodes=getHydratableHoistableCache("link","href",hoistableRoot).get(flags+(current.href||""));if(maybeNodes){for(var i2=0;i2<maybeNodes.length;i2++)if(currentResource=maybeNodes[i2],currentResource.getAttribute("href")===(current.href==null||current.href===""?null:current.href)&¤tResource.getAttribute("rel")===(current.rel==null?null:current.rel)&¤tResource.getAttribute("title")===(current.title==null?null:current.title)&¤tResource.getAttribute("crossorigin")===(current.crossOrigin==null?null:current.crossOrigin)){maybeNodes.splice(i2,1);break b}}currentResource=hoistableRoot.createElement(flags),setInitialProperties(currentResource,flags,current),hoistableRoot.head.appendChild(currentResource);break;case"meta":if(maybeNodes=getHydratableHoistableCache("meta","content",hoistableRoot).get(flags+(current.content||""))){for(i2=0;i2<maybeNodes.length;i2++)if(currentResource=maybeNodes[i2],currentResource.getAttribute("content")===(current.content==null?null:""+current.content)&¤tResource.getAttribute("name")===(current.name==null?null:current.name)&¤tResource.getAttribute("property")===(current.property==null?null:current.property)&¤tResource.getAttribute("http-equiv")===(current.httpEquiv==null?null:current.httpEquiv)&¤tResource.getAttribute("charset")===(current.charSet==null?null:current.charSet)){maybeNodes.splice(i2,1);break b}}currentResource=hoistableRoot.createElement(flags),setInitialProperties(currentResource,flags,current),hoistableRoot.head.appendChild(currentResource);break;default:throw Error(formatProdErrorMessage(468,flags))}currentResource[internalInstanceKey]=finishedWork,markNodeAsHoistable(currentResource),flags=currentResource}finishedWork.stateNode=flags}else mountHoistable(hoistableRoot,finishedWork.type,finishedWork.stateNode);else finishedWork.stateNode=acquireResource(hoistableRoot,flags,finishedWork.memoizedProps);else currentResource!==flags?(currentResource===null?current.stateNode!==null&&(current=current.stateNode,current.parentNode.removeChild(current)):currentResource.count--,flags===null?mountHoistable(hoistableRoot,finishedWork.type,finishedWork.stateNode):acquireResource(hoistableRoot,flags,finishedWork.memoizedProps)):flags===null&&finishedWork.stateNode!==null&&commitHostUpdate(finishedWork,finishedWork.memoizedProps,current.memoizedProps)}break;case 27:recursivelyTraverseMutationEffects(root3,finishedWork),commitReconciliationEffects(finishedWork),flags&512&&(offscreenSubtreeWasHidden||current===null||safelyDetachRef(current,current.return)),current!==null&&flags&4&&commitHostUpdate(finishedWork,finishedWork.memoizedProps,current.memoizedProps);break;case 5:if(recursivelyTraverseMutationEffects(root3,finishedWork),commitReconciliationEffects(finishedWork),flags&512&&(offscreenSubtreeWasHidden||current===null||safelyDetachRef(current,current.return)),finishedWork.flags&32){hoistableRoot=finishedWork.stateNode;try{setTextContent(hoistableRoot,"")}catch(error2){captureCommitPhaseError(finishedWork,finishedWork.return,error2)}}flags&4&&finishedWork.stateNode!=null&&(hoistableRoot=finishedWork.memoizedProps,commitHostUpdate(finishedWork,hoistableRoot,current!==null?current.memoizedProps:hoistableRoot)),flags&1024&&(needsFormReset=!0);break;case 6:if(recursivelyTraverseMutationEffects(root3,finishedWork),commitReconciliationEffects(finishedWork),flags&4){if(finishedWork.stateNode===null)throw Error(formatProdErrorMessage(162));flags=finishedWork.memoizedProps,current=finishedWork.stateNode;try{current.nodeValue=flags}catch(error2){captureCommitPhaseError(finishedWork,finishedWork.return,error2)}}break;case 3:if(tagCaches=null,hoistableRoot=currentHoistableRoot,currentHoistableRoot=getHoistableRoot(root3.containerInfo),recursivelyTraverseMutationEffects(root3,finishedWork),currentHoistableRoot=hoistableRoot,commitReconciliationEffects(finishedWork),flags&4&¤t!==null&¤t.memoizedState.isDehydrated)try{retryIfBlockedOn(root3.containerInfo)}catch(error2){captureCommitPhaseError(finishedWork,finishedWork.return,error2)}needsFormReset&&(needsFormReset=!1,recursivelyResetForms(finishedWork));break;case 4:flags=currentHoistableRoot,currentHoistableRoot=getHoistableRoot(finishedWork.stateNode.containerInfo),recursivelyTraverseMutationEffects(root3,finishedWork),commitReconciliationEffects(finishedWork),currentHoistableRoot=flags;break;case 12:recursivelyTraverseMutationEffects(root3,finishedWork),commitReconciliationEffects(finishedWork);break;case 31:recursivelyTraverseMutationEffects(root3,finishedWork),commitReconciliationEffects(finishedWork),flags&4&&(flags=finishedWork.updateQueue,flags!==null&&(finishedWork.updateQueue=null,attachSuspenseRetryListeners(finishedWork,flags)));break;case 13:recursivelyTraverseMutationEffects(root3,finishedWork),commitReconciliationEffects(finishedWork),finishedWork.child.flags&8192&&finishedWork.memoizedState!==null!=(current!==null&¤t.memoizedState!==null)&&(globalMostRecentFallbackTime=now()),flags&4&&(flags=finishedWork.updateQueue,flags!==null&&(finishedWork.updateQueue=null,attachSuspenseRetryListeners(finishedWork,flags)));break;case 22:hoistableRoot=finishedWork.memoizedState!==null;var wasHidden=current!==null&¤t.memoizedState!==null,prevOffscreenSubtreeIsHidden=offscreenSubtreeIsHidden,prevOffscreenSubtreeWasHidden=offscreenSubtreeWasHidden;if(offscreenSubtreeIsHidden=prevOffscreenSubtreeIsHidden||hoistableRoot,offscreenSubtreeWasHidden=prevOffscreenSubtreeWasHidden||wasHidden,recursivelyTraverseMutationEffects(root3,finishedWork),offscreenSubtreeWasHidden=prevOffscreenSubtreeWasHidden,offscreenSubtreeIsHidden=prevOffscreenSubtreeIsHidden,commitReconciliationEffects(finishedWork),flags&8192)a:for(root3=finishedWork.stateNode,root3._visibility=hoistableRoot?root3._visibility&-2:root3._visibility|1,hoistableRoot&&(current===null||wasHidden||offscreenSubtreeIsHidden||offscreenSubtreeWasHidden||recursivelyTraverseDisappearLayoutEffects(finishedWork)),current=null,root3=finishedWork;;){if(root3.tag===5||root3.tag===26){if(current===null){wasHidden=current=root3;try{if(currentResource=wasHidden.stateNode,hoistableRoot)maybeNodes=currentResource.style,typeof maybeNodes.setProperty=="function"?maybeNodes.setProperty("display","none","important"):maybeNodes.display="none";else{i2=wasHidden.stateNode;var styleProp=wasHidden.memoizedProps.style,display2=styleProp!=null&&styleProp.hasOwnProperty("display")?styleProp.display:null;i2.style.display=display2==null||typeof display2=="boolean"?"":(""+display2).trim()}}catch(error2){captureCommitPhaseError(wasHidden,wasHidden.return,error2)}}}else if(root3.tag===6){if(current===null){wasHidden=root3;try{wasHidden.stateNode.nodeValue=hoistableRoot?"":wasHidden.memoizedProps}catch(error2){captureCommitPhaseError(wasHidden,wasHidden.return,error2)}}}else if(root3.tag===18){if(current===null){wasHidden=root3;try{var instance=wasHidden.stateNode;hoistableRoot?hideOrUnhideDehydratedBoundary(instance,!0):hideOrUnhideDehydratedBoundary(wasHidden.stateNode,!1)}catch(error2){captureCommitPhaseError(wasHidden,wasHidden.return,error2)}}}else if((root3.tag!==22&&root3.tag!==23||root3.memoizedState===null||root3===finishedWork)&&root3.child!==null){root3.child.return=root3,root3=root3.child;continue}if(root3===finishedWork)break a;for(;root3.sibling===null;){if(root3.return===null||root3.return===finishedWork)break a;current===root3&&(current=null),root3=root3.return}current===root3&&(current=null),root3.sibling.return=root3.return,root3=root3.sibling}flags&4&&(flags=finishedWork.updateQueue,flags!==null&&(current=flags.retryQueue,current!==null&&(flags.retryQueue=null,attachSuspenseRetryListeners(finishedWork,current))));break;case 19:recursivelyTraverseMutationEffects(root3,finishedWork),commitReconciliationEffects(finishedWork),flags&4&&(flags=finishedWork.updateQueue,flags!==null&&(finishedWork.updateQueue=null,attachSuspenseRetryListeners(finishedWork,flags)));break;case 30:break;case 21:break;default:recursivelyTraverseMutationEffects(root3,finishedWork),commitReconciliationEffects(finishedWork)}}__name(commitMutationEffectsOnFiber,"commitMutationEffectsOnFiber");function commitReconciliationEffects(finishedWork){var flags=finishedWork.flags;if(flags&2){try{for(var hostParentFiber,parentFiber=finishedWork.return;parentFiber!==null;){if(isHostParent(parentFiber)){hostParentFiber=parentFiber;break}parentFiber=parentFiber.return}if(hostParentFiber==null)throw Error(formatProdErrorMessage(160));switch(hostParentFiber.tag){case 27:var parent=hostParentFiber.stateNode,before=getHostSibling(finishedWork);insertOrAppendPlacementNode(finishedWork,before,parent);break;case 5:var parent$141=hostParentFiber.stateNode;hostParentFiber.flags&32&&(setTextContent(parent$141,""),hostParentFiber.flags&=-33);var before$142=getHostSibling(finishedWork);insertOrAppendPlacementNode(finishedWork,before$142,parent$141);break;case 3:case 4:var parent$143=hostParentFiber.stateNode.containerInfo,before$144=getHostSibling(finishedWork);insertOrAppendPlacementNodeIntoContainer(finishedWork,before$144,parent$143);break;default:throw Error(formatProdErrorMessage(161))}}catch(error2){captureCommitPhaseError(finishedWork,finishedWork.return,error2)}finishedWork.flags&=-3}flags&4096&&(finishedWork.flags&=-4097)}__name(commitReconciliationEffects,"commitReconciliationEffects");function recursivelyResetForms(parentFiber){if(parentFiber.subtreeFlags&1024)for(parentFiber=parentFiber.child;parentFiber!==null;){var fiber=parentFiber;recursivelyResetForms(fiber),fiber.tag===5&&fiber.flags&1024&&fiber.stateNode.reset(),parentFiber=parentFiber.sibling}}__name(recursivelyResetForms,"recursivelyResetForms");function recursivelyTraverseLayoutEffects(root3,parentFiber){if(parentFiber.subtreeFlags&8772)for(parentFiber=parentFiber.child;parentFiber!==null;)commitLayoutEffectOnFiber(root3,parentFiber.alternate,parentFiber),parentFiber=parentFiber.sibling}__name(recursivelyTraverseLayoutEffects,"recursivelyTraverseLayoutEffects");function recursivelyTraverseDisappearLayoutEffects(parentFiber){for(parentFiber=parentFiber.child;parentFiber!==null;){var finishedWork=parentFiber;switch(finishedWork.tag){case 0:case 11:case 14:case 15:commitHookEffectListUnmount(4,finishedWork,finishedWork.return),recursivelyTraverseDisappearLayoutEffects(finishedWork);break;case 1:safelyDetachRef(finishedWork,finishedWork.return);var instance=finishedWork.stateNode;typeof instance.componentWillUnmount=="function"&&safelyCallComponentWillUnmount(finishedWork,finishedWork.return,instance),recursivelyTraverseDisappearLayoutEffects(finishedWork);break;case 27:releaseSingletonInstance(finishedWork.stateNode);case 26:case 5:safelyDetachRef(finishedWork,finishedWork.return),recursivelyTraverseDisappearLayoutEffects(finishedWork);break;case 22:finishedWork.memoizedState===null&&recursivelyTraverseDisappearLayoutEffects(finishedWork);break;case 30:recursivelyTraverseDisappearLayoutEffects(finishedWork);break;default:recursivelyTraverseDisappearLayoutEffects(finishedWork)}parentFiber=parentFiber.sibling}}__name(recursivelyTraverseDisappearLayoutEffects,"recursivelyTraverseDisappearLayoutEffects");function recursivelyTraverseReappearLayoutEffects(finishedRoot$jscomp$0,parentFiber,includeWorkInProgressEffects){for(includeWorkInProgressEffects=includeWorkInProgressEffects&&(parentFiber.subtreeFlags&8772)!==0,parentFiber=parentFiber.child;parentFiber!==null;){var current=parentFiber.alternate,finishedRoot=finishedRoot$jscomp$0,finishedWork=parentFiber,flags=finishedWork.flags;switch(finishedWork.tag){case 0:case 11:case 15:recursivelyTraverseReappearLayoutEffects(finishedRoot,finishedWork,includeWorkInProgressEffects),commitHookEffectListMount(4,finishedWork);break;case 1:if(recursivelyTraverseReappearLayoutEffects(finishedRoot,finishedWork,includeWorkInProgressEffects),current=finishedWork,finishedRoot=current.stateNode,typeof finishedRoot.componentDidMount=="function")try{finishedRoot.componentDidMount()}catch(error2){captureCommitPhaseError(current,current.return,error2)}if(current=finishedWork,finishedRoot=current.updateQueue,finishedRoot!==null){var instance=current.stateNode;try{var hiddenCallbacks=finishedRoot.shared.hiddenCallbacks;if(hiddenCallbacks!==null)for(finishedRoot.shared.hiddenCallbacks=null,finishedRoot=0;finishedRoot<hiddenCallbacks.length;finishedRoot++)callCallback(hiddenCallbacks[finishedRoot],instance)}catch(error2){captureCommitPhaseError(current,current.return,error2)}}includeWorkInProgressEffects&&flags&64&&commitClassCallbacks(finishedWork),safelyAttachRef(finishedWork,finishedWork.return);break;case 27:commitHostSingletonAcquisition(finishedWork);case 26:case 5:recursivelyTraverseReappearLayoutEffects(finishedRoot,finishedWork,includeWorkInProgressEffects),includeWorkInProgressEffects&¤t===null&&flags&4&&commitHostMount(finishedWork),safelyAttachRef(finishedWork,finishedWork.return);break;case 12:recursivelyTraverseReappearLayoutEffects(finishedRoot,finishedWork,includeWorkInProgressEffects);break;case 31:recursivelyTraverseReappearLayoutEffects(finishedRoot,finishedWork,includeWorkInProgressEffects),includeWorkInProgressEffects&&flags&4&&commitActivityHydrationCallbacks(finishedRoot,finishedWork);break;case 13:recursivelyTraverseReappearLayoutEffects(finishedRoot,finishedWork,includeWorkInProgressEffects),includeWorkInProgressEffects&&flags&4&&commitSuspenseHydrationCallbacks(finishedRoot,finishedWork);break;case 22:finishedWork.memoizedState===null&&recursivelyTraverseReappearLayoutEffects(finishedRoot,finishedWork,includeWorkInProgressEffects),safelyAttachRef(finishedWork,finishedWork.return);break;case 30:break;default:recursivelyTraverseReappearLayoutEffects(finishedRoot,finishedWork,includeWorkInProgressEffects)}parentFiber=parentFiber.sibling}}__name(recursivelyTraverseReappearLayoutEffects,"recursivelyTraverseReappearLayoutEffects");function commitOffscreenPassiveMountEffects(current,finishedWork){var previousCache=null;current!==null&¤t.memoizedState!==null&¤t.memoizedState.cachePool!==null&&(previousCache=current.memoizedState.cachePool.pool),current=null,finishedWork.memoizedState!==null&&finishedWork.memoizedState.cachePool!==null&&(current=finishedWork.memoizedState.cachePool.pool),current!==previousCache&&(current!=null&¤t.refCount++,previousCache!=null&&releaseCache(previousCache))}__name(commitOffscreenPassiveMountEffects,"commitOffscreenPassiveMountEffects");function commitCachePassiveMountEffect(current,finishedWork){current=null,finishedWork.alternate!==null&&(current=finishedWork.alternate.memoizedState.cache),finishedWork=finishedWork.memoizedState.cache,finishedWork!==current&&(finishedWork.refCount++,current!=null&&releaseCache(current))}__name(commitCachePassiveMountEffect,"commitCachePassiveMountEffect");function recursivelyTraversePassiveMountEffects(root3,parentFiber,committedLanes,committedTransitions){if(parentFiber.subtreeFlags&10256)for(parentFiber=parentFiber.child;parentFiber!==null;)commitPassiveMountOnFiber(root3,parentFiber,committedLanes,committedTransitions),parentFiber=parentFiber.sibling}__name(recursivelyTraversePassiveMountEffects,"recursivelyTraversePassiveMountEffects");function commitPassiveMountOnFiber(finishedRoot,finishedWork,committedLanes,committedTransitions){var flags=finishedWork.flags;switch(finishedWork.tag){case 0:case 11:case 15:recursivelyTraversePassiveMountEffects(finishedRoot,finishedWork,committedLanes,committedTransitions),flags&2048&&commitHookEffectListMount(9,finishedWork);break;case 1:recursivelyTraversePassiveMountEffects(finishedRoot,finishedWork,committedLanes,committedTransitions);break;case 3:recursivelyTraversePassiveMountEffects(finishedRoot,finishedWork,committedLanes,committedTransitions),flags&2048&&(finishedRoot=null,finishedWork.alternate!==null&&(finishedRoot=finishedWork.alternate.memoizedState.cache),finishedWork=finishedWork.memoizedState.cache,finishedWork!==finishedRoot&&(finishedWork.refCount++,finishedRoot!=null&&releaseCache(finishedRoot)));break;case 12:if(flags&2048){recursivelyTraversePassiveMountEffects(finishedRoot,finishedWork,committedLanes,committedTransitions),finishedRoot=finishedWork.stateNode;try{var _finishedWork$memoize2=finishedWork.memoizedProps,id2=_finishedWork$memoize2.id,onPostCommit=_finishedWork$memoize2.onPostCommit;typeof onPostCommit=="function"&&onPostCommit(id2,finishedWork.alternate===null?"mount":"update",finishedRoot.passiveEffectDuration,-0)}catch(error2){captureCommitPhaseError(finishedWork,finishedWork.return,error2)}}else recursivelyTraversePassiveMountEffects(finishedRoot,finishedWork,committedLanes,committedTransitions);break;case 31:recursivelyTraversePassiveMountEffects(finishedRoot,finishedWork,committedLanes,committedTransitions);break;case 13:recursivelyTraversePassiveMountEffects(finishedRoot,finishedWork,committedLanes,committedTransitions);break;case 23:break;case 22:_finishedWork$memoize2=finishedWork.stateNode,id2=finishedWork.alternate,finishedWork.memoizedState!==null?_finishedWork$memoize2._visibility&2?recursivelyTraversePassiveMountEffects(finishedRoot,finishedWork,committedLanes,committedTransitions):recursivelyTraverseAtomicPassiveEffects(finishedRoot,finishedWork):_finishedWork$memoize2._visibility&2?recursivelyTraversePassiveMountEffects(finishedRoot,finishedWork,committedLanes,committedTransitions):(_finishedWork$memoize2._visibility|=2,recursivelyTraverseReconnectPassiveEffects(finishedRoot,finishedWork,committedLanes,committedTransitions,(finishedWork.subtreeFlags&10256)!==0||!1)),flags&2048&&commitOffscreenPassiveMountEffects(id2,finishedWork);break;case 24:recursivelyTraversePassiveMountEffects(finishedRoot,finishedWork,committedLanes,committedTransitions),flags&2048&&commitCachePassiveMountEffect(finishedWork.alternate,finishedWork);break;default:recursivelyTraversePassiveMountEffects(finishedRoot,finishedWork,committedLanes,committedTransitions)}}__name(commitPassiveMountOnFiber,"commitPassiveMountOnFiber");function recursivelyTraverseReconnectPassiveEffects(finishedRoot$jscomp$0,parentFiber,committedLanes$jscomp$0,committedTransitions$jscomp$0,includeWorkInProgressEffects){for(includeWorkInProgressEffects=includeWorkInProgressEffects&&((parentFiber.subtreeFlags&10256)!==0||!1),parentFiber=parentFiber.child;parentFiber!==null;){var finishedRoot=finishedRoot$jscomp$0,finishedWork=parentFiber,committedLanes=committedLanes$jscomp$0,committedTransitions=committedTransitions$jscomp$0,flags=finishedWork.flags;switch(finishedWork.tag){case 0:case 11:case 15:recursivelyTraverseReconnectPassiveEffects(finishedRoot,finishedWork,committedLanes,committedTransitions,includeWorkInProgressEffects),commitHookEffectListMount(8,finishedWork);break;case 23:break;case 22:var instance=finishedWork.stateNode;finishedWork.memoizedState!==null?instance._visibility&2?recursivelyTraverseReconnectPassiveEffects(finishedRoot,finishedWork,committedLanes,committedTransitions,includeWorkInProgressEffects):recursivelyTraverseAtomicPassiveEffects(finishedRoot,finishedWork):(instance._visibility|=2,recursivelyTraverseReconnectPassiveEffects(finishedRoot,finishedWork,committedLanes,committedTransitions,includeWorkInProgressEffects)),includeWorkInProgressEffects&&flags&2048&&commitOffscreenPassiveMountEffects(finishedWork.alternate,finishedWork);break;case 24:recursivelyTraverseReconnectPassiveEffects(finishedRoot,finishedWork,committedLanes,committedTransitions,includeWorkInProgressEffects),includeWorkInProgressEffects&&flags&2048&&commitCachePassiveMountEffect(finishedWork.alternate,finishedWork);break;default:recursivelyTraverseReconnectPassiveEffects(finishedRoot,finishedWork,committedLanes,committedTransitions,includeWorkInProgressEffects)}parentFiber=parentFiber.sibling}}__name(recursivelyTraverseReconnectPassiveEffects,"recursivelyTraverseReconnectPassiveEffects");function recursivelyTraverseAtomicPassiveEffects(finishedRoot$jscomp$0,parentFiber){if(parentFiber.subtreeFlags&10256)for(parentFiber=parentFiber.child;parentFiber!==null;){var finishedRoot=finishedRoot$jscomp$0,finishedWork=parentFiber,flags=finishedWork.flags;switch(finishedWork.tag){case 22:recursivelyTraverseAtomicPassiveEffects(finishedRoot,finishedWork),flags&2048&&commitOffscreenPassiveMountEffects(finishedWork.alternate,finishedWork);break;case 24:recursivelyTraverseAtomicPassiveEffects(finishedRoot,finishedWork),flags&2048&&commitCachePassiveMountEffect(finishedWork.alternate,finishedWork);break;default:recursivelyTraverseAtomicPassiveEffects(finishedRoot,finishedWork)}parentFiber=parentFiber.sibling}}__name(recursivelyTraverseAtomicPassiveEffects,"recursivelyTraverseAtomicPassiveEffects");var suspenseyCommitFlag=8192;function recursivelyAccumulateSuspenseyCommit(parentFiber,committedLanes,suspendedState){if(parentFiber.subtreeFlags&suspenseyCommitFlag)for(parentFiber=parentFiber.child;parentFiber!==null;)accumulateSuspenseyCommitOnFiber(parentFiber,committedLanes,suspendedState),parentFiber=parentFiber.sibling}__name(recursivelyAccumulateSuspenseyCommit,"recursivelyAccumulateSuspenseyCommit");function accumulateSuspenseyCommitOnFiber(fiber,committedLanes,suspendedState){switch(fiber.tag){case 26:recursivelyAccumulateSuspenseyCommit(fiber,committedLanes,suspendedState),fiber.flags&suspenseyCommitFlag&&fiber.memoizedState!==null&&suspendResource(suspendedState,currentHoistableRoot,fiber.memoizedState,fiber.memoizedProps);break;case 5:recursivelyAccumulateSuspenseyCommit(fiber,committedLanes,suspendedState);break;case 3:case 4:var previousHoistableRoot=currentHoistableRoot;currentHoistableRoot=getHoistableRoot(fiber.stateNode.containerInfo),recursivelyAccumulateSuspenseyCommit(fiber,committedLanes,suspendedState),currentHoistableRoot=previousHoistableRoot;break;case 22:fiber.memoizedState===null&&(previousHoistableRoot=fiber.alternate,previousHoistableRoot!==null&&previousHoistableRoot.memoizedState!==null?(previousHoistableRoot=suspenseyCommitFlag,suspenseyCommitFlag=16777216,recursivelyAccumulateSuspenseyCommit(fiber,committedLanes,suspendedState),suspenseyCommitFlag=previousHoistableRoot):recursivelyAccumulateSuspenseyCommit(fiber,committedLanes,suspendedState));break;default:recursivelyAccumulateSuspenseyCommit(fiber,committedLanes,suspendedState)}}__name(accumulateSuspenseyCommitOnFiber,"accumulateSuspenseyCommitOnFiber");function detachAlternateSiblings(parentFiber){var previousFiber=parentFiber.alternate;if(previousFiber!==null&&(parentFiber=previousFiber.child,parentFiber!==null)){previousFiber.child=null;do previousFiber=parentFiber.sibling,parentFiber.sibling=null,parentFiber=previousFiber;while(parentFiber!==null)}}__name(detachAlternateSiblings,"detachAlternateSiblings");function recursivelyTraversePassiveUnmountEffects(parentFiber){var deletions=parentFiber.deletions;if((parentFiber.flags&16)!==0){if(deletions!==null)for(var i2=0;i2<deletions.length;i2++){var childToDelete=deletions[i2];nextEffect=childToDelete,commitPassiveUnmountEffectsInsideOfDeletedTree_begin(childToDelete,parentFiber)}detachAlternateSiblings(parentFiber)}if(parentFiber.subtreeFlags&10256)for(parentFiber=parentFiber.child;parentFiber!==null;)commitPassiveUnmountOnFiber(parentFiber),parentFiber=parentFiber.sibling}__name(recursivelyTraversePassiveUnmountEffects,"recursivelyTraversePassiveUnmountEffects");function commitPassiveUnmountOnFiber(finishedWork){switch(finishedWork.tag){case 0:case 11:case 15:recursivelyTraversePassiveUnmountEffects(finishedWork),finishedWork.flags&2048&&commitHookEffectListUnmount(9,finishedWork,finishedWork.return);break;case 3:recursivelyTraversePassiveUnmountEffects(finishedWork);break;case 12:recursivelyTraversePassiveUnmountEffects(finishedWork);break;case 22:var instance=finishedWork.stateNode;finishedWork.memoizedState!==null&&instance._visibility&2&&(finishedWork.return===null||finishedWork.return.tag!==13)?(instance._visibility&=-3,recursivelyTraverseDisconnectPassiveEffects(finishedWork)):recursivelyTraversePassiveUnmountEffects(finishedWork);break;default:recursivelyTraversePassiveUnmountEffects(finishedWork)}}__name(commitPassiveUnmountOnFiber,"commitPassiveUnmountOnFiber");function recursivelyTraverseDisconnectPassiveEffects(parentFiber){var deletions=parentFiber.deletions;if((parentFiber.flags&16)!==0){if(deletions!==null)for(var i2=0;i2<deletions.length;i2++){var childToDelete=deletions[i2];nextEffect=childToDelete,commitPassiveUnmountEffectsInsideOfDeletedTree_begin(childToDelete,parentFiber)}detachAlternateSiblings(parentFiber)}for(parentFiber=parentFiber.child;parentFiber!==null;){switch(deletions=parentFiber,deletions.tag){case 0:case 11:case 15:commitHookEffectListUnmount(8,deletions,deletions.return),recursivelyTraverseDisconnectPassiveEffects(deletions);break;case 22:i2=deletions.stateNode,i2._visibility&2&&(i2._visibility&=-3,recursivelyTraverseDisconnectPassiveEffects(deletions));break;default:recursivelyTraverseDisconnectPassiveEffects(deletions)}parentFiber=parentFiber.sibling}}__name(recursivelyTraverseDisconnectPassiveEffects,"recursivelyTraverseDisconnectPassiveEffects");function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(deletedSubtreeRoot,nearestMountedAncestor){for(;nextEffect!==null;){var fiber=nextEffect;switch(fiber.tag){case 0:case 11:case 15:commitHookEffectListUnmount(8,fiber,nearestMountedAncestor);break;case 23:case 22:if(fiber.memoizedState!==null&&fiber.memoizedState.cachePool!==null){var cache2=fiber.memoizedState.cachePool.pool;cache2!=null&&cache2.refCount++}break;case 24:releaseCache(fiber.memoizedState.cache)}if(cache2=fiber.child,cache2!==null)cache2.return=fiber,nextEffect=cache2;else a:for(fiber=deletedSubtreeRoot;nextEffect!==null;){cache2=nextEffect;var sibling=cache2.sibling,returnFiber=cache2.return;if(detachFiberAfterEffects(cache2),cache2===fiber){nextEffect=null;break a}if(sibling!==null){sibling.return=returnFiber,nextEffect=sibling;break a}nextEffect=returnFiber}}}__name(commitPassiveUnmountEffectsInsideOfDeletedTree_begin,"commitPassiveUnmountEffectsInsideOfDeletedTree_begin");var DefaultAsyncDispatcher={getCacheForType:__name(function(resourceType){var cache2=readContext(CacheContext),cacheForType=cache2.data.get(resourceType);return cacheForType===void 0&&(cacheForType=resourceType(),cache2.data.set(resourceType,cacheForType)),cacheForType},"getCacheForType"),cacheSignal:__name(function(){return readContext(CacheContext).controller.signal},"cacheSignal")},PossiblyWeakMap=typeof WeakMap=="function"?WeakMap:Map,executionContext=0,workInProgressRoot=null,workInProgress=null,workInProgressRootRenderLanes=0,workInProgressSuspendedReason=0,workInProgressThrownValue=null,workInProgressRootDidSkipSuspendedSiblings=!1,workInProgressRootIsPrerendering=!1,workInProgressRootDidAttachPingListener=!1,entangledRenderLanes=0,workInProgressRootExitStatus=0,workInProgressRootSkippedLanes=0,workInProgressRootInterleavedUpdatedLanes=0,workInProgressRootPingedLanes=0,workInProgressDeferredLane=0,workInProgressSuspendedRetryLanes=0,workInProgressRootConcurrentErrors=null,workInProgressRootRecoverableErrors=null,workInProgressRootDidIncludeRecursiveRenderUpdate=!1,globalMostRecentFallbackTime=0,globalMostRecentTransitionTime=0,workInProgressRootRenderTargetTime=1/0,workInProgressTransitions=null,legacyErrorBoundariesThatAlreadyFailed=null,pendingEffectsStatus=0,pendingEffectsRoot=null,pendingFinishedWork=null,pendingEffectsLanes=0,pendingEffectsRemainingLanes=0,pendingPassiveTransitions=null,pendingRecoverableErrors=null,nestedUpdateCount=0,rootWithNestedUpdates=null;function requestUpdateLane(){return(executionContext&2)!==0&&workInProgressRootRenderLanes!==0?workInProgressRootRenderLanes&-workInProgressRootRenderLanes:ReactSharedInternals.T!==null?requestTransitionLane():resolveUpdatePriority()}__name(requestUpdateLane,"requestUpdateLane");function requestDeferredLane(){if(workInProgressDeferredLane===0)if((workInProgressRootRenderLanes&536870912)===0||isHydrating){var lane=nextTransitionDeferredLane;nextTransitionDeferredLane<<=1,(nextTransitionDeferredLane&3932160)===0&&(nextTransitionDeferredLane=262144),workInProgressDeferredLane=lane}else workInProgressDeferredLane=536870912;return lane=suspenseHandlerStackCursor.current,lane!==null&&(lane.flags|=32),workInProgressDeferredLane}__name(requestDeferredLane,"requestDeferredLane");function scheduleUpdateOnFiber(root3,fiber,lane){(root3===workInProgressRoot&&(workInProgressSuspendedReason===2||workInProgressSuspendedReason===9)||root3.cancelPendingCommit!==null)&&(prepareFreshStack(root3,0),markRootSuspended(root3,workInProgressRootRenderLanes,workInProgressDeferredLane,!1)),markRootUpdated$1(root3,lane),((executionContext&2)===0||root3!==workInProgressRoot)&&(root3===workInProgressRoot&&((executionContext&2)===0&&(workInProgressRootInterleavedUpdatedLanes|=lane),workInProgressRootExitStatus===4&&markRootSuspended(root3,workInProgressRootRenderLanes,workInProgressDeferredLane,!1)),ensureRootIsScheduled(root3))}__name(scheduleUpdateOnFiber,"scheduleUpdateOnFiber");function performWorkOnRoot(root$jscomp$0,lanes,forceSync){if((executionContext&6)!==0)throw Error(formatProdErrorMessage(327));var shouldTimeSlice=!forceSync&&(lanes&127)===0&&(lanes&root$jscomp$0.expiredLanes)===0||checkIfRootIsPrerendering(root$jscomp$0,lanes),exitStatus=shouldTimeSlice?renderRootConcurrent(root$jscomp$0,lanes):renderRootSync(root$jscomp$0,lanes,!0),renderWasConcurrent=shouldTimeSlice;do{if(exitStatus===0){workInProgressRootIsPrerendering&&!shouldTimeSlice&&markRootSuspended(root$jscomp$0,lanes,0,!1);break}else{if(forceSync=root$jscomp$0.current.alternate,renderWasConcurrent&&!isRenderConsistentWithExternalStores(forceSync)){exitStatus=renderRootSync(root$jscomp$0,lanes,!1),renderWasConcurrent=!1;continue}if(exitStatus===2){if(renderWasConcurrent=lanes,root$jscomp$0.errorRecoveryDisabledLanes&renderWasConcurrent)var JSCompiler_inline_result=0;else JSCompiler_inline_result=root$jscomp$0.pendingLanes&-536870913,JSCompiler_inline_result=JSCompiler_inline_result!==0?JSCompiler_inline_result:JSCompiler_inline_result&536870912?536870912:0;if(JSCompiler_inline_result!==0){lanes=JSCompiler_inline_result;a:{var root3=root$jscomp$0;exitStatus=workInProgressRootConcurrentErrors;var wasRootDehydrated=root3.current.memoizedState.isDehydrated;if(wasRootDehydrated&&(prepareFreshStack(root3,JSCompiler_inline_result).flags|=256),JSCompiler_inline_result=renderRootSync(root3,JSCompiler_inline_result,!1),JSCompiler_inline_result!==2){if(workInProgressRootDidAttachPingListener&&!wasRootDehydrated){root3.errorRecoveryDisabledLanes|=renderWasConcurrent,workInProgressRootInterleavedUpdatedLanes|=renderWasConcurrent,exitStatus=4;break a}renderWasConcurrent=workInProgressRootRecoverableErrors,workInProgressRootRecoverableErrors=exitStatus,renderWasConcurrent!==null&&(workInProgressRootRecoverableErrors===null?workInProgressRootRecoverableErrors=renderWasConcurrent:workInProgressRootRecoverableErrors.push.apply(workInProgressRootRecoverableErrors,renderWasConcurrent))}exitStatus=JSCompiler_inline_result}if(renderWasConcurrent=!1,exitStatus!==2)continue}}if(exitStatus===1){prepareFreshStack(root$jscomp$0,0),markRootSuspended(root$jscomp$0,lanes,0,!0);break}a:{switch(shouldTimeSlice=root$jscomp$0,renderWasConcurrent=exitStatus,renderWasConcurrent){case 0:case 1:throw Error(formatProdErrorMessage(345));case 4:if((lanes&4194048)!==lanes)break;case 6:markRootSuspended(shouldTimeSlice,lanes,workInProgressDeferredLane,!workInProgressRootDidSkipSuspendedSiblings);break a;case 2:workInProgressRootRecoverableErrors=null;break;case 3:case 5:break;default:throw Error(formatProdErrorMessage(329))}if((lanes&62914560)===lanes&&(exitStatus=globalMostRecentFallbackTime+300-now(),10<exitStatus)){if(markRootSuspended(shouldTimeSlice,lanes,workInProgressDeferredLane,!workInProgressRootDidSkipSuspendedSiblings),getNextLanes(shouldTimeSlice,0,!0)!==0)break a;pendingEffectsLanes=lanes,shouldTimeSlice.timeoutHandle=scheduleTimeout(commitRootWhenReady.bind(null,shouldTimeSlice,forceSync,workInProgressRootRecoverableErrors,workInProgressTransitions,workInProgressRootDidIncludeRecursiveRenderUpdate,lanes,workInProgressDeferredLane,workInProgressRootInterleavedUpdatedLanes,workInProgressSuspendedRetryLanes,workInProgressRootDidSkipSuspendedSiblings,renderWasConcurrent,"Throttled",-0,0),exitStatus);break a}commitRootWhenReady(shouldTimeSlice,forceSync,workInProgressRootRecoverableErrors,workInProgressTransitions,workInProgressRootDidIncludeRecursiveRenderUpdate,lanes,workInProgressDeferredLane,workInProgressRootInterleavedUpdatedLanes,workInProgressSuspendedRetryLanes,workInProgressRootDidSkipSuspendedSiblings,renderWasConcurrent,null,-0,0)}}break}while(!0);ensureRootIsScheduled(root$jscomp$0)}__name(performWorkOnRoot,"performWorkOnRoot");function commitRootWhenReady(root3,finishedWork,recoverableErrors,transitions,didIncludeRenderPhaseUpdate,lanes,spawnedLane,updatedLanes,suspendedRetryLanes,didSkipSuspendedSiblings,exitStatus,suspendedCommitReason,completedRenderStartTime,completedRenderEndTime){if(root3.timeoutHandle=-1,suspendedCommitReason=finishedWork.subtreeFlags,suspendedCommitReason&8192||(suspendedCommitReason&16785408)===16785408){suspendedCommitReason={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:noop$12},accumulateSuspenseyCommitOnFiber(finishedWork,lanes,suspendedCommitReason);var timeoutOffset=(lanes&62914560)===lanes?globalMostRecentFallbackTime-now():(lanes&4194048)===lanes?globalMostRecentTransitionTime-now():0;if(timeoutOffset=waitForCommitToBeReady(suspendedCommitReason,timeoutOffset),timeoutOffset!==null){pendingEffectsLanes=lanes,root3.cancelPendingCommit=timeoutOffset(commitRoot.bind(null,root3,finishedWork,lanes,recoverableErrors,transitions,didIncludeRenderPhaseUpdate,spawnedLane,updatedLanes,suspendedRetryLanes,exitStatus,suspendedCommitReason,null,completedRenderStartTime,completedRenderEndTime)),markRootSuspended(root3,lanes,spawnedLane,!didSkipSuspendedSiblings);return}}commitRoot(root3,finishedWork,lanes,recoverableErrors,transitions,didIncludeRenderPhaseUpdate,spawnedLane,updatedLanes,suspendedRetryLanes)}__name(commitRootWhenReady,"commitRootWhenReady");function isRenderConsistentWithExternalStores(finishedWork){for(var node2=finishedWork;;){var tag=node2.tag;if((tag===0||tag===11||tag===15)&&node2.flags&16384&&(tag=node2.updateQueue,tag!==null&&(tag=tag.stores,tag!==null)))for(var i2=0;i2<tag.length;i2++){var check2=tag[i2],getSnapshot=check2.getSnapshot;check2=check2.value;try{if(!objectIs(getSnapshot(),check2))return!1}catch{return!1}}if(tag=node2.child,node2.subtreeFlags&16384&&tag!==null)tag.return=node2,node2=tag;else{if(node2===finishedWork)break;for(;node2.sibling===null;){if(node2.return===null||node2.return===finishedWork)return!0;node2=node2.return}node2.sibling.return=node2.return,node2=node2.sibling}}return!0}__name(isRenderConsistentWithExternalStores,"isRenderConsistentWithExternalStores");function markRootSuspended(root3,suspendedLanes,spawnedLane,didAttemptEntireTree){suspendedLanes&=~workInProgressRootPingedLanes,suspendedLanes&=~workInProgressRootInterleavedUpdatedLanes,root3.suspendedLanes|=suspendedLanes,root3.pingedLanes&=~suspendedLanes,didAttemptEntireTree&&(root3.warmLanes|=suspendedLanes),didAttemptEntireTree=root3.expirationTimes;for(var lanes=suspendedLanes;0<lanes;){var index$6=31-clz32(lanes),lane=1<<index$6;didAttemptEntireTree[index$6]=-1,lanes&=~lane}spawnedLane!==0&&markSpawnedDeferredLane(root3,spawnedLane,suspendedLanes)}__name(markRootSuspended,"markRootSuspended");function flushSyncWork$1(){return(executionContext&6)===0?(flushSyncWorkAcrossRoots_impl(0),!1):!0}__name(flushSyncWork$1,"flushSyncWork$1");function resetWorkInProgressStack(){if(workInProgress!==null){if(workInProgressSuspendedReason===0)var interruptedWork=workInProgress.return;else interruptedWork=workInProgress,lastContextDependency=currentlyRenderingFiber$1=null,resetHooksOnUnwind(interruptedWork),thenableState$1=null,thenableIndexCounter$1=0,interruptedWork=workInProgress;for(;interruptedWork!==null;)unwindInterruptedWork(interruptedWork.alternate,interruptedWork),interruptedWork=interruptedWork.return;workInProgress=null}}__name(resetWorkInProgressStack,"resetWorkInProgressStack");function prepareFreshStack(root3,lanes){var timeoutHandle=root3.timeoutHandle;timeoutHandle!==-1&&(root3.timeoutHandle=-1,cancelTimeout(timeoutHandle)),timeoutHandle=root3.cancelPendingCommit,timeoutHandle!==null&&(root3.cancelPendingCommit=null,timeoutHandle()),pendingEffectsLanes=0,resetWorkInProgressStack(),workInProgressRoot=root3,workInProgress=timeoutHandle=createWorkInProgress(root3.current,null),workInProgressRootRenderLanes=lanes,workInProgressSuspendedReason=0,workInProgressThrownValue=null,workInProgressRootDidSkipSuspendedSiblings=!1,workInProgressRootIsPrerendering=checkIfRootIsPrerendering(root3,lanes),workInProgressRootDidAttachPingListener=!1,workInProgressSuspendedRetryLanes=workInProgressDeferredLane=workInProgressRootPingedLanes=workInProgressRootInterleavedUpdatedLanes=workInProgressRootSkippedLanes=workInProgressRootExitStatus=0,workInProgressRootRecoverableErrors=workInProgressRootConcurrentErrors=null,workInProgressRootDidIncludeRecursiveRenderUpdate=!1,(lanes&8)!==0&&(lanes|=lanes&32);var allEntangledLanes=root3.entangledLanes;if(allEntangledLanes!==0)for(root3=root3.entanglements,allEntangledLanes&=lanes;0<allEntangledLanes;){var index$42=31-clz32(allEntangledLanes),lane=1<<index$42;lanes|=root3[index$42],allEntangledLanes&=~lane}return entangledRenderLanes=lanes,finishQueueingConcurrentUpdates(),timeoutHandle}__name(prepareFreshStack,"prepareFreshStack");function handleThrow(root3,thrownValue){currentlyRenderingFiber=null,ReactSharedInternals.H=ContextOnlyDispatcher,thrownValue===SuspenseException||thrownValue===SuspenseActionException?(thrownValue=getSuspendedThenable(),workInProgressSuspendedReason=3):thrownValue===SuspenseyCommitException?(thrownValue=getSuspendedThenable(),workInProgressSuspendedReason=4):workInProgressSuspendedReason=thrownValue===SelectiveHydrationException?8:thrownValue!==null&&typeof thrownValue=="object"&&typeof thrownValue.then=="function"?6:1,workInProgressThrownValue=thrownValue,workInProgress===null&&(workInProgressRootExitStatus=1,logUncaughtError(root3,createCapturedValueAtFiber(thrownValue,root3.current)))}__name(handleThrow,"handleThrow");function shouldRemainOnPreviousScreen(){var handler=suspenseHandlerStackCursor.current;return handler===null?!0:(workInProgressRootRenderLanes&4194048)===workInProgressRootRenderLanes?shellBoundary===null:(workInProgressRootRenderLanes&62914560)===workInProgressRootRenderLanes||(workInProgressRootRenderLanes&536870912)!==0?handler===shellBoundary:!1}__name(shouldRemainOnPreviousScreen,"shouldRemainOnPreviousScreen");function pushDispatcher(){var prevDispatcher=ReactSharedInternals.H;return ReactSharedInternals.H=ContextOnlyDispatcher,prevDispatcher===null?ContextOnlyDispatcher:prevDispatcher}__name(pushDispatcher,"pushDispatcher");function pushAsyncDispatcher(){var prevAsyncDispatcher=ReactSharedInternals.A;return ReactSharedInternals.A=DefaultAsyncDispatcher,prevAsyncDispatcher}__name(pushAsyncDispatcher,"pushAsyncDispatcher");function renderDidSuspendDelayIfPossible(){workInProgressRootExitStatus=4,workInProgressRootDidSkipSuspendedSiblings||(workInProgressRootRenderLanes&4194048)!==workInProgressRootRenderLanes&&suspenseHandlerStackCursor.current!==null||(workInProgressRootIsPrerendering=!0),(workInProgressRootSkippedLanes&134217727)===0&&(workInProgressRootInterleavedUpdatedLanes&134217727)===0||workInProgressRoot===null||markRootSuspended(workInProgressRoot,workInProgressRootRenderLanes,workInProgressDeferredLane,!1)}__name(renderDidSuspendDelayIfPossible,"renderDidSuspendDelayIfPossible");function renderRootSync(root3,lanes,shouldYieldForPrerendering){var prevExecutionContext=executionContext;executionContext|=2;var prevDispatcher=pushDispatcher(),prevAsyncDispatcher=pushAsyncDispatcher();(workInProgressRoot!==root3||workInProgressRootRenderLanes!==lanes)&&(workInProgressTransitions=null,prepareFreshStack(root3,lanes)),lanes=!1;var exitStatus=workInProgressRootExitStatus;a:do try{if(workInProgressSuspendedReason!==0&&workInProgress!==null){var unitOfWork=workInProgress,thrownValue=workInProgressThrownValue;switch(workInProgressSuspendedReason){case 8:resetWorkInProgressStack(),exitStatus=6;break a;case 3:case 2:case 9:case 6:suspenseHandlerStackCursor.current===null&&(lanes=!0);var reason=workInProgressSuspendedReason;if(workInProgressSuspendedReason=0,workInProgressThrownValue=null,throwAndUnwindWorkLoop(root3,unitOfWork,thrownValue,reason),shouldYieldForPrerendering&&workInProgressRootIsPrerendering){exitStatus=0;break a}break;default:reason=workInProgressSuspendedReason,workInProgressSuspendedReason=0,workInProgressThrownValue=null,throwAndUnwindWorkLoop(root3,unitOfWork,thrownValue,reason)}}workLoopSync(),exitStatus=workInProgressRootExitStatus;break}catch(thrownValue$165){handleThrow(root3,thrownValue$165)}while(!0);return lanes&&root3.shellSuspendCounter++,lastContextDependency=currentlyRenderingFiber$1=null,executionContext=prevExecutionContext,ReactSharedInternals.H=prevDispatcher,ReactSharedInternals.A=prevAsyncDispatcher,workInProgress===null&&(workInProgressRoot=null,workInProgressRootRenderLanes=0,finishQueueingConcurrentUpdates()),exitStatus}__name(renderRootSync,"renderRootSync");function workLoopSync(){for(;workInProgress!==null;)performUnitOfWork(workInProgress)}__name(workLoopSync,"workLoopSync");function renderRootConcurrent(root3,lanes){var prevExecutionContext=executionContext;executionContext|=2;var prevDispatcher=pushDispatcher(),prevAsyncDispatcher=pushAsyncDispatcher();workInProgressRoot!==root3||workInProgressRootRenderLanes!==lanes?(workInProgressTransitions=null,workInProgressRootRenderTargetTime=now()+500,prepareFreshStack(root3,lanes)):workInProgressRootIsPrerendering=checkIfRootIsPrerendering(root3,lanes);a:do try{if(workInProgressSuspendedReason!==0&&workInProgress!==null){lanes=workInProgress;var thrownValue=workInProgressThrownValue;b:switch(workInProgressSuspendedReason){case 1:workInProgressSuspendedReason=0,workInProgressThrownValue=null,throwAndUnwindWorkLoop(root3,lanes,thrownValue,1);break;case 2:case 9:if(isThenableResolved(thrownValue)){workInProgressSuspendedReason=0,workInProgressThrownValue=null,replaySuspendedUnitOfWork(lanes);break}lanes=__name(function(){workInProgressSuspendedReason!==2&&workInProgressSuspendedReason!==9||workInProgressRoot!==root3||(workInProgressSuspendedReason=7),ensureRootIsScheduled(root3)},"lanes"),thrownValue.then(lanes,lanes);break a;case 3:workInProgressSuspendedReason=7;break a;case 4:workInProgressSuspendedReason=5;break a;case 7:isThenableResolved(thrownValue)?(workInProgressSuspendedReason=0,workInProgressThrownValue=null,replaySuspendedUnitOfWork(lanes)):(workInProgressSuspendedReason=0,workInProgressThrownValue=null,throwAndUnwindWorkLoop(root3,lanes,thrownValue,7));break;case 5:var resource=null;switch(workInProgress.tag){case 26:resource=workInProgress.memoizedState;case 5:case 27:var hostFiber=workInProgress;if(resource?preloadResource(resource):hostFiber.stateNode.complete){workInProgressSuspendedReason=0,workInProgressThrownValue=null;var sibling=hostFiber.sibling;if(sibling!==null)workInProgress=sibling;else{var returnFiber=hostFiber.return;returnFiber!==null?(workInProgress=returnFiber,completeUnitOfWork(returnFiber)):workInProgress=null}break b}}workInProgressSuspendedReason=0,workInProgressThrownValue=null,throwAndUnwindWorkLoop(root3,lanes,thrownValue,5);break;case 6:workInProgressSuspendedReason=0,workInProgressThrownValue=null,throwAndUnwindWorkLoop(root3,lanes,thrownValue,6);break;case 8:resetWorkInProgressStack(),workInProgressRootExitStatus=6;break a;default:throw Error(formatProdErrorMessage(462))}}workLoopConcurrentByScheduler();break}catch(thrownValue$167){handleThrow(root3,thrownValue$167)}while(!0);return lastContextDependency=currentlyRenderingFiber$1=null,ReactSharedInternals.H=prevDispatcher,ReactSharedInternals.A=prevAsyncDispatcher,executionContext=prevExecutionContext,workInProgress!==null?0:(workInProgressRoot=null,workInProgressRootRenderLanes=0,finishQueueingConcurrentUpdates(),workInProgressRootExitStatus)}__name(renderRootConcurrent,"renderRootConcurrent");function workLoopConcurrentByScheduler(){for(;workInProgress!==null&&!shouldYield();)performUnitOfWork(workInProgress)}__name(workLoopConcurrentByScheduler,"workLoopConcurrentByScheduler");function performUnitOfWork(unitOfWork){var next2=beginWork(unitOfWork.alternate,unitOfWork,entangledRenderLanes);unitOfWork.memoizedProps=unitOfWork.pendingProps,next2===null?completeUnitOfWork(unitOfWork):workInProgress=next2}__name(performUnitOfWork,"performUnitOfWork");function replaySuspendedUnitOfWork(unitOfWork){var next2=unitOfWork,current=next2.alternate;switch(next2.tag){case 15:case 0:next2=replayFunctionComponent(current,next2,next2.pendingProps,next2.type,void 0,workInProgressRootRenderLanes);break;case 11:next2=replayFunctionComponent(current,next2,next2.pendingProps,next2.type.render,next2.ref,workInProgressRootRenderLanes);break;case 5:resetHooksOnUnwind(next2);default:unwindInterruptedWork(current,next2),next2=workInProgress=resetWorkInProgress(next2,entangledRenderLanes),next2=beginWork(current,next2,entangledRenderLanes)}unitOfWork.memoizedProps=unitOfWork.pendingProps,next2===null?completeUnitOfWork(unitOfWork):workInProgress=next2}__name(replaySuspendedUnitOfWork,"replaySuspendedUnitOfWork");function throwAndUnwindWorkLoop(root3,unitOfWork,thrownValue,suspendedReason){lastContextDependency=currentlyRenderingFiber$1=null,resetHooksOnUnwind(unitOfWork),thenableState$1=null,thenableIndexCounter$1=0;var returnFiber=unitOfWork.return;try{if(throwException(root3,returnFiber,unitOfWork,thrownValue,workInProgressRootRenderLanes)){workInProgressRootExitStatus=1,logUncaughtError(root3,createCapturedValueAtFiber(thrownValue,root3.current)),workInProgress=null;return}}catch(error2){if(returnFiber!==null)throw workInProgress=returnFiber,error2;workInProgressRootExitStatus=1,logUncaughtError(root3,createCapturedValueAtFiber(thrownValue,root3.current)),workInProgress=null;return}unitOfWork.flags&32768?(isHydrating||suspendedReason===1?root3=!0:workInProgressRootIsPrerendering||(workInProgressRootRenderLanes&536870912)!==0?root3=!1:(workInProgressRootDidSkipSuspendedSiblings=root3=!0,(suspendedReason===2||suspendedReason===9||suspendedReason===3||suspendedReason===6)&&(suspendedReason=suspenseHandlerStackCursor.current,suspendedReason!==null&&suspendedReason.tag===13&&(suspendedReason.flags|=16384))),unwindUnitOfWork(unitOfWork,root3)):completeUnitOfWork(unitOfWork)}__name(throwAndUnwindWorkLoop,"throwAndUnwindWorkLoop");function completeUnitOfWork(unitOfWork){var completedWork=unitOfWork;do{if((completedWork.flags&32768)!==0){unwindUnitOfWork(completedWork,workInProgressRootDidSkipSuspendedSiblings);return}unitOfWork=completedWork.return;var next2=completeWork(completedWork.alternate,completedWork,entangledRenderLanes);if(next2!==null){workInProgress=next2;return}if(completedWork=completedWork.sibling,completedWork!==null){workInProgress=completedWork;return}workInProgress=completedWork=unitOfWork}while(completedWork!==null);workInProgressRootExitStatus===0&&(workInProgressRootExitStatus=5)}__name(completeUnitOfWork,"completeUnitOfWork");function unwindUnitOfWork(unitOfWork,skipSiblings){do{var next2=unwindWork(unitOfWork.alternate,unitOfWork);if(next2!==null){next2.flags&=32767,workInProgress=next2;return}if(next2=unitOfWork.return,next2!==null&&(next2.flags|=32768,next2.subtreeFlags=0,next2.deletions=null),!skipSiblings&&(unitOfWork=unitOfWork.sibling,unitOfWork!==null)){workInProgress=unitOfWork;return}workInProgress=unitOfWork=next2}while(unitOfWork!==null);workInProgressRootExitStatus=6,workInProgress=null}__name(unwindUnitOfWork,"unwindUnitOfWork");function commitRoot(root3,finishedWork,lanes,recoverableErrors,transitions,didIncludeRenderPhaseUpdate,spawnedLane,updatedLanes,suspendedRetryLanes){root3.cancelPendingCommit=null;do flushPendingEffects();while(pendingEffectsStatus!==0);if((executionContext&6)!==0)throw Error(formatProdErrorMessage(327));if(finishedWork!==null){if(finishedWork===root3.current)throw Error(formatProdErrorMessage(177));if(didIncludeRenderPhaseUpdate=finishedWork.lanes|finishedWork.childLanes,didIncludeRenderPhaseUpdate|=concurrentlyUpdatedLanes,markRootFinished(root3,lanes,didIncludeRenderPhaseUpdate,spawnedLane,updatedLanes,suspendedRetryLanes),root3===workInProgressRoot&&(workInProgress=workInProgressRoot=null,workInProgressRootRenderLanes=0),pendingFinishedWork=finishedWork,pendingEffectsRoot=root3,pendingEffectsLanes=lanes,pendingEffectsRemainingLanes=didIncludeRenderPhaseUpdate,pendingPassiveTransitions=transitions,pendingRecoverableErrors=recoverableErrors,(finishedWork.subtreeFlags&10256)!==0||(finishedWork.flags&10256)!==0?(root3.callbackNode=null,root3.callbackPriority=0,scheduleCallback$1(NormalPriority$1,function(){return flushPassiveEffects(),null})):(root3.callbackNode=null,root3.callbackPriority=0),recoverableErrors=(finishedWork.flags&13878)!==0,(finishedWork.subtreeFlags&13878)!==0||recoverableErrors){recoverableErrors=ReactSharedInternals.T,ReactSharedInternals.T=null,transitions=ReactDOMSharedInternals.p,ReactDOMSharedInternals.p=2,spawnedLane=executionContext,executionContext|=4;try{commitBeforeMutationEffects(root3,finishedWork,lanes)}finally{executionContext=spawnedLane,ReactDOMSharedInternals.p=transitions,ReactSharedInternals.T=recoverableErrors}}pendingEffectsStatus=1,flushMutationEffects(),flushLayoutEffects(),flushSpawnedWork()}}__name(commitRoot,"commitRoot");function flushMutationEffects(){if(pendingEffectsStatus===1){pendingEffectsStatus=0;var root3=pendingEffectsRoot,finishedWork=pendingFinishedWork,rootMutationHasEffect=(finishedWork.flags&13878)!==0;if((finishedWork.subtreeFlags&13878)!==0||rootMutationHasEffect){rootMutationHasEffect=ReactSharedInternals.T,ReactSharedInternals.T=null;var previousPriority=ReactDOMSharedInternals.p;ReactDOMSharedInternals.p=2;var prevExecutionContext=executionContext;executionContext|=4;try{commitMutationEffectsOnFiber(finishedWork,root3);var priorSelectionInformation=selectionInformation,curFocusedElem=getActiveElementDeep(root3.containerInfo),priorFocusedElem=priorSelectionInformation.focusedElem,priorSelectionRange=priorSelectionInformation.selectionRange;if(curFocusedElem!==priorFocusedElem&&priorFocusedElem&&priorFocusedElem.ownerDocument&&containsNode(priorFocusedElem.ownerDocument.documentElement,priorFocusedElem)){if(priorSelectionRange!==null&&hasSelectionCapabilities(priorFocusedElem)){var start=priorSelectionRange.start,end=priorSelectionRange.end;if(end===void 0&&(end=start),"selectionStart"in priorFocusedElem)priorFocusedElem.selectionStart=start,priorFocusedElem.selectionEnd=Math.min(end,priorFocusedElem.value.length);else{var doc=priorFocusedElem.ownerDocument||document,win=doc&&doc.defaultView||window;if(win.getSelection){var selection=win.getSelection(),length=priorFocusedElem.textContent.length,start$jscomp$0=Math.min(priorSelectionRange.start,length),end$jscomp$0=priorSelectionRange.end===void 0?start$jscomp$0:Math.min(priorSelectionRange.end,length);!selection.extend&&start$jscomp$0>end$jscomp$0&&(curFocusedElem=end$jscomp$0,end$jscomp$0=start$jscomp$0,start$jscomp$0=curFocusedElem);var startMarker=getNodeForCharacterOffset(priorFocusedElem,start$jscomp$0),endMarker=getNodeForCharacterOffset(priorFocusedElem,end$jscomp$0);if(startMarker&&endMarker&&(selection.rangeCount!==1||selection.anchorNode!==startMarker.node||selection.anchorOffset!==startMarker.offset||selection.focusNode!==endMarker.node||selection.focusOffset!==endMarker.offset)){var range=doc.createRange();range.setStart(startMarker.node,startMarker.offset),selection.removeAllRanges(),start$jscomp$0>end$jscomp$0?(selection.addRange(range),selection.extend(endMarker.node,endMarker.offset)):(range.setEnd(endMarker.node,endMarker.offset),selection.addRange(range))}}}}for(doc=[],selection=priorFocusedElem;selection=selection.parentNode;)selection.nodeType===1&&doc.push({element:selection,left:selection.scrollLeft,top:selection.scrollTop});for(typeof priorFocusedElem.focus=="function"&&priorFocusedElem.focus(),priorFocusedElem=0;priorFocusedElem<doc.length;priorFocusedElem++){var info=doc[priorFocusedElem];info.element.scrollLeft=info.left,info.element.scrollTop=info.top}}_enabled=!!eventsEnabled,selectionInformation=eventsEnabled=null}finally{executionContext=prevExecutionContext,ReactDOMSharedInternals.p=previousPriority,ReactSharedInternals.T=rootMutationHasEffect}}root3.current=finishedWork,pendingEffectsStatus=2}}__name(flushMutationEffects,"flushMutationEffects");function flushLayoutEffects(){if(pendingEffectsStatus===2){pendingEffectsStatus=0;var root3=pendingEffectsRoot,finishedWork=pendingFinishedWork,rootHasLayoutEffect=(finishedWork.flags&8772)!==0;if((finishedWork.subtreeFlags&8772)!==0||rootHasLayoutEffect){rootHasLayoutEffect=ReactSharedInternals.T,ReactSharedInternals.T=null;var previousPriority=ReactDOMSharedInternals.p;ReactDOMSharedInternals.p=2;var prevExecutionContext=executionContext;executionContext|=4;try{commitLayoutEffectOnFiber(root3,finishedWork.alternate,finishedWork)}finally{executionContext=prevExecutionContext,ReactDOMSharedInternals.p=previousPriority,ReactSharedInternals.T=rootHasLayoutEffect}}pendingEffectsStatus=3}}__name(flushLayoutEffects,"flushLayoutEffects");function flushSpawnedWork(){if(pendingEffectsStatus===4||pendingEffectsStatus===3){pendingEffectsStatus=0,requestPaint();var root3=pendingEffectsRoot,finishedWork=pendingFinishedWork,lanes=pendingEffectsLanes,recoverableErrors=pendingRecoverableErrors;(finishedWork.subtreeFlags&10256)!==0||(finishedWork.flags&10256)!==0?pendingEffectsStatus=5:(pendingEffectsStatus=0,pendingFinishedWork=pendingEffectsRoot=null,releaseRootPooledCache(root3,root3.pendingLanes));var remainingLanes=root3.pendingLanes;if(remainingLanes===0&&(legacyErrorBoundariesThatAlreadyFailed=null),lanesToEventPriority(lanes),finishedWork=finishedWork.stateNode,injectedHook&&typeof injectedHook.onCommitFiberRoot=="function")try{injectedHook.onCommitFiberRoot(rendererID,finishedWork,void 0,(finishedWork.current.flags&128)===128)}catch{}if(recoverableErrors!==null){finishedWork=ReactSharedInternals.T,remainingLanes=ReactDOMSharedInternals.p,ReactDOMSharedInternals.p=2,ReactSharedInternals.T=null;try{for(var onRecoverableError=root3.onRecoverableError,i2=0;i2<recoverableErrors.length;i2++){var recoverableError=recoverableErrors[i2];onRecoverableError(recoverableError.value,{componentStack:recoverableError.stack})}}finally{ReactSharedInternals.T=finishedWork,ReactDOMSharedInternals.p=remainingLanes}}(pendingEffectsLanes&3)!==0&&flushPendingEffects(),ensureRootIsScheduled(root3),remainingLanes=root3.pendingLanes,(lanes&261930)!==0&&(remainingLanes&42)!==0?root3===rootWithNestedUpdates?nestedUpdateCount++:(nestedUpdateCount=0,rootWithNestedUpdates=root3):nestedUpdateCount=0,flushSyncWorkAcrossRoots_impl(0)}}__name(flushSpawnedWork,"flushSpawnedWork");function releaseRootPooledCache(root3,remainingLanes){(root3.pooledCacheLanes&=remainingLanes)===0&&(remainingLanes=root3.pooledCache,remainingLanes!=null&&(root3.pooledCache=null,releaseCache(remainingLanes)))}__name(releaseRootPooledCache,"releaseRootPooledCache");function flushPendingEffects(){return flushMutationEffects(),flushLayoutEffects(),flushSpawnedWork(),flushPassiveEffects()}__name(flushPendingEffects,"flushPendingEffects");function flushPassiveEffects(){if(pendingEffectsStatus!==5)return!1;var root3=pendingEffectsRoot,remainingLanes=pendingEffectsRemainingLanes;pendingEffectsRemainingLanes=0;var renderPriority=lanesToEventPriority(pendingEffectsLanes),prevTransition=ReactSharedInternals.T,previousPriority=ReactDOMSharedInternals.p;try{ReactDOMSharedInternals.p=32>renderPriority?32:renderPriority,ReactSharedInternals.T=null,renderPriority=pendingPassiveTransitions,pendingPassiveTransitions=null;var root$jscomp$0=pendingEffectsRoot,lanes=pendingEffectsLanes;if(pendingEffectsStatus=0,pendingFinishedWork=pendingEffectsRoot=null,pendingEffectsLanes=0,(executionContext&6)!==0)throw Error(formatProdErrorMessage(331));var prevExecutionContext=executionContext;if(executionContext|=4,commitPassiveUnmountOnFiber(root$jscomp$0.current),commitPassiveMountOnFiber(root$jscomp$0,root$jscomp$0.current,lanes,renderPriority),executionContext=prevExecutionContext,flushSyncWorkAcrossRoots_impl(0,!1),injectedHook&&typeof injectedHook.onPostCommitFiberRoot=="function")try{injectedHook.onPostCommitFiberRoot(rendererID,root$jscomp$0)}catch{}return!0}finally{ReactDOMSharedInternals.p=previousPriority,ReactSharedInternals.T=prevTransition,releaseRootPooledCache(root3,remainingLanes)}}__name(flushPassiveEffects,"flushPassiveEffects");function captureCommitPhaseErrorOnRoot(rootFiber,sourceFiber,error2){sourceFiber=createCapturedValueAtFiber(error2,sourceFiber),sourceFiber=createRootErrorUpdate(rootFiber.stateNode,sourceFiber,2),rootFiber=enqueueUpdate(rootFiber,sourceFiber,2),rootFiber!==null&&(markRootUpdated$1(rootFiber,2),ensureRootIsScheduled(rootFiber))}__name(captureCommitPhaseErrorOnRoot,"captureCommitPhaseErrorOnRoot");function captureCommitPhaseError(sourceFiber,nearestMountedAncestor,error2){if(sourceFiber.tag===3)captureCommitPhaseErrorOnRoot(sourceFiber,sourceFiber,error2);else for(;nearestMountedAncestor!==null;){if(nearestMountedAncestor.tag===3){captureCommitPhaseErrorOnRoot(nearestMountedAncestor,sourceFiber,error2);break}else if(nearestMountedAncestor.tag===1){var instance=nearestMountedAncestor.stateNode;if(typeof nearestMountedAncestor.type.getDerivedStateFromError=="function"||typeof instance.componentDidCatch=="function"&&(legacyErrorBoundariesThatAlreadyFailed===null||!legacyErrorBoundariesThatAlreadyFailed.has(instance))){sourceFiber=createCapturedValueAtFiber(error2,sourceFiber),error2=createClassErrorUpdate(2),instance=enqueueUpdate(nearestMountedAncestor,error2,2),instance!==null&&(initializeClassErrorUpdate(error2,instance,nearestMountedAncestor,sourceFiber),markRootUpdated$1(instance,2),ensureRootIsScheduled(instance));break}}nearestMountedAncestor=nearestMountedAncestor.return}}__name(captureCommitPhaseError,"captureCommitPhaseError");function attachPingListener(root3,wakeable,lanes){var pingCache=root3.pingCache;if(pingCache===null){pingCache=root3.pingCache=new PossiblyWeakMap;var threadIDs=new Set;pingCache.set(wakeable,threadIDs)}else threadIDs=pingCache.get(wakeable),threadIDs===void 0&&(threadIDs=new Set,pingCache.set(wakeable,threadIDs));threadIDs.has(lanes)||(workInProgressRootDidAttachPingListener=!0,threadIDs.add(lanes),root3=pingSuspendedRoot.bind(null,root3,wakeable,lanes),wakeable.then(root3,root3))}__name(attachPingListener,"attachPingListener");function pingSuspendedRoot(root3,wakeable,pingedLanes){var pingCache=root3.pingCache;pingCache!==null&&pingCache.delete(wakeable),root3.pingedLanes|=root3.suspendedLanes&pingedLanes,root3.warmLanes&=~pingedLanes,workInProgressRoot===root3&&(workInProgressRootRenderLanes&pingedLanes)===pingedLanes&&(workInProgressRootExitStatus===4||workInProgressRootExitStatus===3&&(workInProgressRootRenderLanes&62914560)===workInProgressRootRenderLanes&&300>now()-globalMostRecentFallbackTime?(executionContext&2)===0&&prepareFreshStack(root3,0):workInProgressRootPingedLanes|=pingedLanes,workInProgressSuspendedRetryLanes===workInProgressRootRenderLanes&&(workInProgressSuspendedRetryLanes=0)),ensureRootIsScheduled(root3)}__name(pingSuspendedRoot,"pingSuspendedRoot");function retryTimedOutBoundary(boundaryFiber,retryLane){retryLane===0&&(retryLane=claimNextRetryLane()),boundaryFiber=enqueueConcurrentRenderForLane(boundaryFiber,retryLane),boundaryFiber!==null&&(markRootUpdated$1(boundaryFiber,retryLane),ensureRootIsScheduled(boundaryFiber))}__name(retryTimedOutBoundary,"retryTimedOutBoundary");function retryDehydratedSuspenseBoundary(boundaryFiber){var suspenseState=boundaryFiber.memoizedState,retryLane=0;suspenseState!==null&&(retryLane=suspenseState.retryLane),retryTimedOutBoundary(boundaryFiber,retryLane)}__name(retryDehydratedSuspenseBoundary,"retryDehydratedSuspenseBoundary");function resolveRetryWakeable(boundaryFiber,wakeable){var retryLane=0;switch(boundaryFiber.tag){case 31:case 13:var retryCache=boundaryFiber.stateNode,suspenseState=boundaryFiber.memoizedState;suspenseState!==null&&(retryLane=suspenseState.retryLane);break;case 19:retryCache=boundaryFiber.stateNode;break;case 22:retryCache=boundaryFiber.stateNode._retryCache;break;default:throw Error(formatProdErrorMessage(314))}retryCache!==null&&retryCache.delete(wakeable),retryTimedOutBoundary(boundaryFiber,retryLane)}__name(resolveRetryWakeable,"resolveRetryWakeable");function scheduleCallback$1(priorityLevel,callback){return scheduleCallback$3(priorityLevel,callback)}__name(scheduleCallback$1,"scheduleCallback$1");var firstScheduledRoot=null,lastScheduledRoot=null,didScheduleMicrotask=!1,mightHavePendingSyncWork=!1,isFlushingWork=!1,currentEventTransitionLane=0;function ensureRootIsScheduled(root3){root3!==lastScheduledRoot&&root3.next===null&&(lastScheduledRoot===null?firstScheduledRoot=lastScheduledRoot=root3:lastScheduledRoot=lastScheduledRoot.next=root3),mightHavePendingSyncWork=!0,didScheduleMicrotask||(didScheduleMicrotask=!0,scheduleImmediateRootScheduleTask())}__name(ensureRootIsScheduled,"ensureRootIsScheduled");function flushSyncWorkAcrossRoots_impl(syncTransitionLanes,onlyLegacy){if(!isFlushingWork&&mightHavePendingSyncWork){isFlushingWork=!0;do for(var didPerformSomeWork=!1,root$170=firstScheduledRoot;root$170!==null;){if(syncTransitionLanes!==0){var pendingLanes=root$170.pendingLanes;if(pendingLanes===0)var JSCompiler_inline_result=0;else{var suspendedLanes=root$170.suspendedLanes,pingedLanes=root$170.pingedLanes;JSCompiler_inline_result=(1<<31-clz32(42|syncTransitionLanes)+1)-1,JSCompiler_inline_result&=pendingLanes&~(suspendedLanes&~pingedLanes),JSCompiler_inline_result=JSCompiler_inline_result&201326741?JSCompiler_inline_result&201326741|1:JSCompiler_inline_result?JSCompiler_inline_result|2:0}JSCompiler_inline_result!==0&&(didPerformSomeWork=!0,performSyncWorkOnRoot(root$170,JSCompiler_inline_result))}else JSCompiler_inline_result=workInProgressRootRenderLanes,JSCompiler_inline_result=getNextLanes(root$170,root$170===workInProgressRoot?JSCompiler_inline_result:0,root$170.cancelPendingCommit!==null||root$170.timeoutHandle!==-1),(JSCompiler_inline_result&3)===0||checkIfRootIsPrerendering(root$170,JSCompiler_inline_result)||(didPerformSomeWork=!0,performSyncWorkOnRoot(root$170,JSCompiler_inline_result));root$170=root$170.next}while(didPerformSomeWork);isFlushingWork=!1}}__name(flushSyncWorkAcrossRoots_impl,"flushSyncWorkAcrossRoots_impl");function processRootScheduleInImmediateTask(){processRootScheduleInMicrotask()}__name(processRootScheduleInImmediateTask,"processRootScheduleInImmediateTask");function processRootScheduleInMicrotask(){mightHavePendingSyncWork=didScheduleMicrotask=!1;var syncTransitionLanes=0;currentEventTransitionLane!==0&&shouldAttemptEagerTransition()&&(syncTransitionLanes=currentEventTransitionLane);for(var currentTime=now(),prev=null,root3=firstScheduledRoot;root3!==null;){var next2=root3.next,nextLanes=scheduleTaskForRootDuringMicrotask(root3,currentTime);nextLanes===0?(root3.next=null,prev===null?firstScheduledRoot=next2:prev.next=next2,next2===null&&(lastScheduledRoot=prev)):(prev=root3,(syncTransitionLanes!==0||(nextLanes&3)!==0)&&(mightHavePendingSyncWork=!0)),root3=next2}pendingEffectsStatus!==0&&pendingEffectsStatus!==5||flushSyncWorkAcrossRoots_impl(syncTransitionLanes),currentEventTransitionLane!==0&&(currentEventTransitionLane=0)}__name(processRootScheduleInMicrotask,"processRootScheduleInMicrotask");function scheduleTaskForRootDuringMicrotask(root3,currentTime){for(var suspendedLanes=root3.suspendedLanes,pingedLanes=root3.pingedLanes,expirationTimes=root3.expirationTimes,lanes=root3.pendingLanes&-62914561;0<lanes;){var index$5=31-clz32(lanes),lane=1<<index$5,expirationTime=expirationTimes[index$5];expirationTime===-1?((lane&suspendedLanes)===0||(lane&pingedLanes)!==0)&&(expirationTimes[index$5]=computeExpirationTime(lane,currentTime)):expirationTime<=currentTime&&(root3.expiredLanes|=lane),lanes&=~lane}if(currentTime=workInProgressRoot,suspendedLanes=workInProgressRootRenderLanes,suspendedLanes=getNextLanes(root3,root3===currentTime?suspendedLanes:0,root3.cancelPendingCommit!==null||root3.timeoutHandle!==-1),pingedLanes=root3.callbackNode,suspendedLanes===0||root3===currentTime&&(workInProgressSuspendedReason===2||workInProgressSuspendedReason===9)||root3.cancelPendingCommit!==null)return pingedLanes!==null&&pingedLanes!==null&&cancelCallback$1(pingedLanes),root3.callbackNode=null,root3.callbackPriority=0;if((suspendedLanes&3)===0||checkIfRootIsPrerendering(root3,suspendedLanes)){if(currentTime=suspendedLanes&-suspendedLanes,currentTime===root3.callbackPriority)return currentTime;switch(pingedLanes!==null&&cancelCallback$1(pingedLanes),lanesToEventPriority(suspendedLanes)){case 2:case 8:suspendedLanes=UserBlockingPriority;break;case 32:suspendedLanes=NormalPriority$1;break;case 268435456:suspendedLanes=IdlePriority;break;default:suspendedLanes=NormalPriority$1}return pingedLanes=performWorkOnRootViaSchedulerTask.bind(null,root3),suspendedLanes=scheduleCallback$3(suspendedLanes,pingedLanes),root3.callbackPriority=currentTime,root3.callbackNode=suspendedLanes,currentTime}return pingedLanes!==null&&pingedLanes!==null&&cancelCallback$1(pingedLanes),root3.callbackPriority=2,root3.callbackNode=null,2}__name(scheduleTaskForRootDuringMicrotask,"scheduleTaskForRootDuringMicrotask");function performWorkOnRootViaSchedulerTask(root3,didTimeout){if(pendingEffectsStatus!==0&&pendingEffectsStatus!==5)return root3.callbackNode=null,root3.callbackPriority=0,null;var originalCallbackNode=root3.callbackNode;if(flushPendingEffects()&&root3.callbackNode!==originalCallbackNode)return null;var workInProgressRootRenderLanes$jscomp$0=workInProgressRootRenderLanes;return workInProgressRootRenderLanes$jscomp$0=getNextLanes(root3,root3===workInProgressRoot?workInProgressRootRenderLanes$jscomp$0:0,root3.cancelPendingCommit!==null||root3.timeoutHandle!==-1),workInProgressRootRenderLanes$jscomp$0===0?null:(performWorkOnRoot(root3,workInProgressRootRenderLanes$jscomp$0,didTimeout),scheduleTaskForRootDuringMicrotask(root3,now()),root3.callbackNode!=null&&root3.callbackNode===originalCallbackNode?performWorkOnRootViaSchedulerTask.bind(null,root3):null)}__name(performWorkOnRootViaSchedulerTask,"performWorkOnRootViaSchedulerTask");function performSyncWorkOnRoot(root3,lanes){if(flushPendingEffects())return null;performWorkOnRoot(root3,lanes,!0)}__name(performSyncWorkOnRoot,"performSyncWorkOnRoot");function scheduleImmediateRootScheduleTask(){scheduleMicrotask(function(){(executionContext&6)!==0?scheduleCallback$3(ImmediatePriority,processRootScheduleInImmediateTask):processRootScheduleInMicrotask()})}__name(scheduleImmediateRootScheduleTask,"scheduleImmediateRootScheduleTask");function requestTransitionLane(){if(currentEventTransitionLane===0){var actionScopeLane=currentEntangledLane;actionScopeLane===0&&(actionScopeLane=nextTransitionUpdateLane,nextTransitionUpdateLane<<=1,(nextTransitionUpdateLane&261888)===0&&(nextTransitionUpdateLane=256)),currentEventTransitionLane=actionScopeLane}return currentEventTransitionLane}__name(requestTransitionLane,"requestTransitionLane");function coerceFormActionProp(actionProp){return actionProp==null||typeof actionProp=="symbol"||typeof actionProp=="boolean"?null:typeof actionProp=="function"?actionProp:sanitizeURL(""+actionProp)}__name(coerceFormActionProp,"coerceFormActionProp");function createFormDataWithSubmitter(form,submitter){var temp=submitter.ownerDocument.createElement("input");return temp.name=submitter.name,temp.value=submitter.value,form.id&&temp.setAttribute("form",form.id),submitter.parentNode.insertBefore(temp,submitter),form=new FormData(form),temp.parentNode.removeChild(temp),form}__name(createFormDataWithSubmitter,"createFormDataWithSubmitter");function extractEvents$1(dispatchQueue,domEventName,maybeTargetInst,nativeEvent,nativeEventTarget){if(domEventName==="submit"&&maybeTargetInst&&maybeTargetInst.stateNode===nativeEventTarget){var action=coerceFormActionProp((nativeEventTarget[internalPropsKey]||null).action),submitter=nativeEvent.submitter;submitter&&(domEventName=(domEventName=submitter[internalPropsKey]||null)?coerceFormActionProp(domEventName.formAction):submitter.getAttribute("formAction"),domEventName!==null&&(action=domEventName,submitter=null));var event=new SyntheticEvent("action","action",null,nativeEvent,nativeEventTarget);dispatchQueue.push({event,listeners:[{instance:null,listener:__name(function(){if(nativeEvent.defaultPrevented){if(currentEventTransitionLane!==0){var formData=submitter?createFormDataWithSubmitter(nativeEventTarget,submitter):new FormData(nativeEventTarget);startHostTransition(maybeTargetInst,{pending:!0,data:formData,method:nativeEventTarget.method,action},null,formData)}}else typeof action=="function"&&(event.preventDefault(),formData=submitter?createFormDataWithSubmitter(nativeEventTarget,submitter):new FormData(nativeEventTarget),startHostTransition(maybeTargetInst,{pending:!0,data:formData,method:nativeEventTarget.method,action},action,formData))},"listener"),currentTarget:nativeEventTarget}]})}}__name(extractEvents$1,"extractEvents$1");for(var i$jscomp$inline_1577=0;i$jscomp$inline_1577<simpleEventPluginEvents.length;i$jscomp$inline_1577++){var eventName$jscomp$inline_1578=simpleEventPluginEvents[i$jscomp$inline_1577],domEventName$jscomp$inline_1579=eventName$jscomp$inline_1578.toLowerCase(),capitalizedEvent$jscomp$inline_1580=eventName$jscomp$inline_1578[0].toUpperCase()+eventName$jscomp$inline_1578.slice(1);registerSimpleEvent(domEventName$jscomp$inline_1579,"on"+capitalizedEvent$jscomp$inline_1580)}registerSimpleEvent(ANIMATION_END,"onAnimationEnd"),registerSimpleEvent(ANIMATION_ITERATION,"onAnimationIteration"),registerSimpleEvent(ANIMATION_START,"onAnimationStart"),registerSimpleEvent("dblclick","onDoubleClick"),registerSimpleEvent("focusin","onFocus"),registerSimpleEvent("focusout","onBlur"),registerSimpleEvent(TRANSITION_RUN,"onTransitionRun"),registerSimpleEvent(TRANSITION_START,"onTransitionStart"),registerSimpleEvent(TRANSITION_CANCEL,"onTransitionCancel"),registerSimpleEvent(TRANSITION_END,"onTransitionEnd"),registerDirectEvent("onMouseEnter",["mouseout","mouseover"]),registerDirectEvent("onMouseLeave",["mouseout","mouseover"]),registerDirectEvent("onPointerEnter",["pointerout","pointerover"]),registerDirectEvent("onPointerLeave",["pointerout","pointerover"]),registerTwoPhaseEvent("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),registerTwoPhaseEvent("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),registerTwoPhaseEvent("onBeforeInput",["compositionend","keypress","textInput","paste"]),registerTwoPhaseEvent("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),registerTwoPhaseEvent("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),registerTwoPhaseEvent("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var mediaEventTypes="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),nonDelegatedEvents=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(mediaEventTypes));function processDispatchQueue(dispatchQueue,eventSystemFlags){eventSystemFlags=(eventSystemFlags&4)!==0;for(var i2=0;i2<dispatchQueue.length;i2++){var _dispatchQueue$i=dispatchQueue[i2],event=_dispatchQueue$i.event;_dispatchQueue$i=_dispatchQueue$i.listeners;a:{var previousInstance=void 0;if(eventSystemFlags)for(var i$jscomp$0=_dispatchQueue$i.length-1;0<=i$jscomp$0;i$jscomp$0--){var _dispatchListeners$i=_dispatchQueue$i[i$jscomp$0],instance=_dispatchListeners$i.instance,currentTarget=_dispatchListeners$i.currentTarget;if(_dispatchListeners$i=_dispatchListeners$i.listener,instance!==previousInstance&&event.isPropagationStopped())break a;previousInstance=_dispatchListeners$i,event.currentTarget=currentTarget;try{previousInstance(event)}catch(error2){reportGlobalError(error2)}event.currentTarget=null,previousInstance=instance}else for(i$jscomp$0=0;i$jscomp$0<_dispatchQueue$i.length;i$jscomp$0++){if(_dispatchListeners$i=_dispatchQueue$i[i$jscomp$0],instance=_dispatchListeners$i.instance,currentTarget=_dispatchListeners$i.currentTarget,_dispatchListeners$i=_dispatchListeners$i.listener,instance!==previousInstance&&event.isPropagationStopped())break a;previousInstance=_dispatchListeners$i,event.currentTarget=currentTarget;try{previousInstance(event)}catch(error2){reportGlobalError(error2)}event.currentTarget=null,previousInstance=instance}}}}__name(processDispatchQueue,"processDispatchQueue");function listenToNonDelegatedEvent(domEventName,targetElement){var JSCompiler_inline_result=targetElement[internalEventHandlersKey];JSCompiler_inline_result===void 0&&(JSCompiler_inline_result=targetElement[internalEventHandlersKey]=new Set);var listenerSetKey=domEventName+"__bubble";JSCompiler_inline_result.has(listenerSetKey)||(addTrappedEventListener(targetElement,domEventName,2,!1),JSCompiler_inline_result.add(listenerSetKey))}__name(listenToNonDelegatedEvent,"listenToNonDelegatedEvent");function listenToNativeEvent(domEventName,isCapturePhaseListener,target){var eventSystemFlags=0;isCapturePhaseListener&&(eventSystemFlags|=4),addTrappedEventListener(target,domEventName,eventSystemFlags,isCapturePhaseListener)}__name(listenToNativeEvent,"listenToNativeEvent");var listeningMarker="_reactListening"+Math.random().toString(36).slice(2);function listenToAllSupportedEvents(rootContainerElement){if(!rootContainerElement[listeningMarker]){rootContainerElement[listeningMarker]=!0,allNativeEvents.forEach(function(domEventName){domEventName!=="selectionchange"&&(nonDelegatedEvents.has(domEventName)||listenToNativeEvent(domEventName,!1,rootContainerElement),listenToNativeEvent(domEventName,!0,rootContainerElement))});var ownerDocument=rootContainerElement.nodeType===9?rootContainerElement:rootContainerElement.ownerDocument;ownerDocument===null||ownerDocument[listeningMarker]||(ownerDocument[listeningMarker]=!0,listenToNativeEvent("selectionchange",!1,ownerDocument))}}__name(listenToAllSupportedEvents,"listenToAllSupportedEvents");function addTrappedEventListener(targetContainer,domEventName,eventSystemFlags,isCapturePhaseListener){switch(getEventPriority(domEventName)){case 2:var listenerWrapper=dispatchDiscreteEvent;break;case 8:listenerWrapper=dispatchContinuousEvent;break;default:listenerWrapper=dispatchEvent}eventSystemFlags=listenerWrapper.bind(null,domEventName,eventSystemFlags,targetContainer),listenerWrapper=void 0,!passiveBrowserEventsSupported||domEventName!=="touchstart"&&domEventName!=="touchmove"&&domEventName!=="wheel"||(listenerWrapper=!0),isCapturePhaseListener?listenerWrapper!==void 0?targetContainer.addEventListener(domEventName,eventSystemFlags,{capture:!0,passive:listenerWrapper}):targetContainer.addEventListener(domEventName,eventSystemFlags,!0):listenerWrapper!==void 0?targetContainer.addEventListener(domEventName,eventSystemFlags,{passive:listenerWrapper}):targetContainer.addEventListener(domEventName,eventSystemFlags,!1)}__name(addTrappedEventListener,"addTrappedEventListener");function dispatchEventForPluginEventSystem(domEventName,eventSystemFlags,nativeEvent,targetInst$jscomp$0,targetContainer){var ancestorInst=targetInst$jscomp$0;if((eventSystemFlags&1)===0&&(eventSystemFlags&2)===0&&targetInst$jscomp$0!==null)a:for(;;){if(targetInst$jscomp$0===null)return;var nodeTag=targetInst$jscomp$0.tag;if(nodeTag===3||nodeTag===4){var container=targetInst$jscomp$0.stateNode.containerInfo;if(container===targetContainer)break;if(nodeTag===4)for(nodeTag=targetInst$jscomp$0.return;nodeTag!==null;){var grandTag=nodeTag.tag;if((grandTag===3||grandTag===4)&&nodeTag.stateNode.containerInfo===targetContainer)return;nodeTag=nodeTag.return}for(;container!==null;){if(nodeTag=getClosestInstanceFromNode(container),nodeTag===null)return;if(grandTag=nodeTag.tag,grandTag===5||grandTag===6||grandTag===26||grandTag===27){targetInst$jscomp$0=ancestorInst=nodeTag;continue a}container=container.parentNode}}targetInst$jscomp$0=targetInst$jscomp$0.return}batchedUpdates$1(function(){var targetInst=ancestorInst,nativeEventTarget=getEventTarget2(nativeEvent),dispatchQueue=[];a:{var reactName=topLevelEventsToReactNames.get(domEventName);if(reactName!==void 0){var SyntheticEventCtor=SyntheticEvent,reactEventType=domEventName;switch(domEventName){case"keypress":if(getEventCharCode(nativeEvent)===0)break a;case"keydown":case"keyup":SyntheticEventCtor=SyntheticKeyboardEvent;break;case"focusin":reactEventType="focus",SyntheticEventCtor=SyntheticFocusEvent;break;case"focusout":reactEventType="blur",SyntheticEventCtor=SyntheticFocusEvent;break;case"beforeblur":case"afterblur":SyntheticEventCtor=SyntheticFocusEvent;break;case"click":if(nativeEvent.button===2)break a;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":SyntheticEventCtor=SyntheticMouseEvent;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":SyntheticEventCtor=SyntheticDragEvent;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":SyntheticEventCtor=SyntheticTouchEvent;break;case ANIMATION_END:case ANIMATION_ITERATION:case ANIMATION_START:SyntheticEventCtor=SyntheticAnimationEvent;break;case TRANSITION_END:SyntheticEventCtor=SyntheticTransitionEvent;break;case"scroll":case"scrollend":SyntheticEventCtor=SyntheticUIEvent;break;case"wheel":SyntheticEventCtor=SyntheticWheelEvent;break;case"copy":case"cut":case"paste":SyntheticEventCtor=SyntheticClipboardEvent;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":SyntheticEventCtor=SyntheticPointerEvent;break;case"toggle":case"beforetoggle":SyntheticEventCtor=SyntheticToggleEvent}var inCapturePhase=(eventSystemFlags&4)!==0,accumulateTargetOnly=!inCapturePhase&&(domEventName==="scroll"||domEventName==="scrollend"),reactEventName=inCapturePhase?reactName!==null?reactName+"Capture":null:reactName;inCapturePhase=[];for(var instance=targetInst,lastHostComponent;instance!==null;){var _instance=instance;if(lastHostComponent=_instance.stateNode,_instance=_instance.tag,_instance!==5&&_instance!==26&&_instance!==27||lastHostComponent===null||reactEventName===null||(_instance=getListener(instance,reactEventName),_instance!=null&&inCapturePhase.push(createDispatchListener(instance,_instance,lastHostComponent))),accumulateTargetOnly)break;instance=instance.return}0<inCapturePhase.length&&(reactName=new SyntheticEventCtor(reactName,reactEventType,null,nativeEvent,nativeEventTarget),dispatchQueue.push({event:reactName,listeners:inCapturePhase}))}}if((eventSystemFlags&7)===0){a:{if(reactName=domEventName==="mouseover"||domEventName==="pointerover",SyntheticEventCtor=domEventName==="mouseout"||domEventName==="pointerout",reactName&&nativeEvent!==currentReplayingEvent&&(reactEventType=nativeEvent.relatedTarget||nativeEvent.fromElement)&&(getClosestInstanceFromNode(reactEventType)||reactEventType[internalContainerInstanceKey]))break a;if((SyntheticEventCtor||reactName)&&(reactName=nativeEventTarget.window===nativeEventTarget?nativeEventTarget:(reactName=nativeEventTarget.ownerDocument)?reactName.defaultView||reactName.parentWindow:window,SyntheticEventCtor?(reactEventType=nativeEvent.relatedTarget||nativeEvent.toElement,SyntheticEventCtor=targetInst,reactEventType=reactEventType?getClosestInstanceFromNode(reactEventType):null,reactEventType!==null&&(accumulateTargetOnly=getNearestMountedFiber(reactEventType),inCapturePhase=reactEventType.tag,reactEventType!==accumulateTargetOnly||inCapturePhase!==5&&inCapturePhase!==27&&inCapturePhase!==6)&&(reactEventType=null)):(SyntheticEventCtor=null,reactEventType=targetInst),SyntheticEventCtor!==reactEventType)){if(inCapturePhase=SyntheticMouseEvent,_instance="onMouseLeave",reactEventName="onMouseEnter",instance="mouse",(domEventName==="pointerout"||domEventName==="pointerover")&&(inCapturePhase=SyntheticPointerEvent,_instance="onPointerLeave",reactEventName="onPointerEnter",instance="pointer"),accumulateTargetOnly=SyntheticEventCtor==null?reactName:getNodeFromInstance(SyntheticEventCtor),lastHostComponent=reactEventType==null?reactName:getNodeFromInstance(reactEventType),reactName=new inCapturePhase(_instance,instance+"leave",SyntheticEventCtor,nativeEvent,nativeEventTarget),reactName.target=accumulateTargetOnly,reactName.relatedTarget=lastHostComponent,_instance=null,getClosestInstanceFromNode(nativeEventTarget)===targetInst&&(inCapturePhase=new inCapturePhase(reactEventName,instance+"enter",reactEventType,nativeEvent,nativeEventTarget),inCapturePhase.target=lastHostComponent,inCapturePhase.relatedTarget=accumulateTargetOnly,_instance=inCapturePhase),accumulateTargetOnly=_instance,SyntheticEventCtor&&reactEventType)b:{for(inCapturePhase=getParent,reactEventName=SyntheticEventCtor,instance=reactEventType,lastHostComponent=0,_instance=reactEventName;_instance;_instance=inCapturePhase(_instance))lastHostComponent++;_instance=0;for(var tempB=instance;tempB;tempB=inCapturePhase(tempB))_instance++;for(;0<lastHostComponent-_instance;)reactEventName=inCapturePhase(reactEventName),lastHostComponent--;for(;0<_instance-lastHostComponent;)instance=inCapturePhase(instance),_instance--;for(;lastHostComponent--;){if(reactEventName===instance||instance!==null&&reactEventName===instance.alternate){inCapturePhase=reactEventName;break b}reactEventName=inCapturePhase(reactEventName),instance=inCapturePhase(instance)}inCapturePhase=null}else inCapturePhase=null;SyntheticEventCtor!==null&&accumulateEnterLeaveListenersForEvent(dispatchQueue,reactName,SyntheticEventCtor,inCapturePhase,!1),reactEventType!==null&&accumulateTargetOnly!==null&&accumulateEnterLeaveListenersForEvent(dispatchQueue,accumulateTargetOnly,reactEventType,inCapturePhase,!0)}}a:{if(reactName=targetInst?getNodeFromInstance(targetInst):window,SyntheticEventCtor=reactName.nodeName&&reactName.nodeName.toLowerCase(),SyntheticEventCtor==="select"||SyntheticEventCtor==="input"&&reactName.type==="file")var getTargetInstFunc=getTargetInstForChangeEvent;else if(isTextInputElement(reactName))if(isInputEventSupported)getTargetInstFunc=getTargetInstForInputOrChangeEvent;else{getTargetInstFunc=getTargetInstForInputEventPolyfill;var handleEventFunc=handleEventsForInputEventPolyfill}else SyntheticEventCtor=reactName.nodeName,!SyntheticEventCtor||SyntheticEventCtor.toLowerCase()!=="input"||reactName.type!=="checkbox"&&reactName.type!=="radio"?targetInst&&isCustomElement(targetInst.elementType)&&(getTargetInstFunc=getTargetInstForChangeEvent):getTargetInstFunc=getTargetInstForClickEvent;if(getTargetInstFunc&&(getTargetInstFunc=getTargetInstFunc(domEventName,targetInst))){createAndAccumulateChangeEvent(dispatchQueue,getTargetInstFunc,nativeEvent,nativeEventTarget);break a}handleEventFunc&&handleEventFunc(domEventName,reactName,targetInst),domEventName==="focusout"&&targetInst&&reactName.type==="number"&&targetInst.memoizedProps.value!=null&&setDefaultValue(reactName,"number",reactName.value)}switch(handleEventFunc=targetInst?getNodeFromInstance(targetInst):window,domEventName){case"focusin":(isTextInputElement(handleEventFunc)||handleEventFunc.contentEditable==="true")&&(activeElement=handleEventFunc,activeElementInst=targetInst,lastSelection=null);break;case"focusout":lastSelection=activeElementInst=activeElement=null;break;case"mousedown":mouseDown=!0;break;case"contextmenu":case"mouseup":case"dragend":mouseDown=!1,constructSelectEvent(dispatchQueue,nativeEvent,nativeEventTarget);break;case"selectionchange":if(skipSelectionChangeEvent)break;case"keydown":case"keyup":constructSelectEvent(dispatchQueue,nativeEvent,nativeEventTarget)}var fallbackData;if(canUseCompositionEvent)b:{switch(domEventName){case"compositionstart":var eventType="onCompositionStart";break b;case"compositionend":eventType="onCompositionEnd";break b;case"compositionupdate":eventType="onCompositionUpdate";break b}eventType=void 0}else isComposing?isFallbackCompositionEnd(domEventName,nativeEvent)&&(eventType="onCompositionEnd"):domEventName==="keydown"&&nativeEvent.keyCode===229&&(eventType="onCompositionStart");eventType&&(useFallbackCompositionData&&nativeEvent.locale!=="ko"&&(isComposing||eventType!=="onCompositionStart"?eventType==="onCompositionEnd"&&isComposing&&(fallbackData=getData()):(root2=nativeEventTarget,startText="value"in root2?root2.value:root2.textContent,isComposing=!0)),handleEventFunc=accumulateTwoPhaseListeners(targetInst,eventType),0<handleEventFunc.length&&(eventType=new SyntheticCompositionEvent(eventType,domEventName,null,nativeEvent,nativeEventTarget),dispatchQueue.push({event:eventType,listeners:handleEventFunc}),fallbackData?eventType.data=fallbackData:(fallbackData=getDataFromCustomEvent(nativeEvent),fallbackData!==null&&(eventType.data=fallbackData)))),(fallbackData=canUseTextInputEvent?getNativeBeforeInputChars(domEventName,nativeEvent):getFallbackBeforeInputChars(domEventName,nativeEvent))&&(eventType=accumulateTwoPhaseListeners(targetInst,"onBeforeInput"),0<eventType.length&&(handleEventFunc=new SyntheticCompositionEvent("onBeforeInput","beforeinput",null,nativeEvent,nativeEventTarget),dispatchQueue.push({event:handleEventFunc,listeners:eventType}),handleEventFunc.data=fallbackData)),extractEvents$1(dispatchQueue,domEventName,targetInst,nativeEvent,nativeEventTarget)}processDispatchQueue(dispatchQueue,eventSystemFlags)})}__name(dispatchEventForPluginEventSystem,"dispatchEventForPluginEventSystem");function createDispatchListener(instance,listener,currentTarget){return{instance,listener,currentTarget}}__name(createDispatchListener,"createDispatchListener");function accumulateTwoPhaseListeners(targetFiber,reactName){for(var captureName=reactName+"Capture",listeners=[];targetFiber!==null;){var _instance2=targetFiber,stateNode=_instance2.stateNode;if(_instance2=_instance2.tag,_instance2!==5&&_instance2!==26&&_instance2!==27||stateNode===null||(_instance2=getListener(targetFiber,captureName),_instance2!=null&&listeners.unshift(createDispatchListener(targetFiber,_instance2,stateNode)),_instance2=getListener(targetFiber,reactName),_instance2!=null&&listeners.push(createDispatchListener(targetFiber,_instance2,stateNode))),targetFiber.tag===3)return listeners;targetFiber=targetFiber.return}return[]}__name(accumulateTwoPhaseListeners,"accumulateTwoPhaseListeners");function getParent(inst){if(inst===null)return null;do inst=inst.return;while(inst&&inst.tag!==5&&inst.tag!==27);return inst||null}__name(getParent,"getParent");function accumulateEnterLeaveListenersForEvent(dispatchQueue,event,target,common,inCapturePhase){for(var registrationName=event._reactName,listeners=[];target!==null&&target!==common;){var _instance3=target,alternate=_instance3.alternate,stateNode=_instance3.stateNode;if(_instance3=_instance3.tag,alternate!==null&&alternate===common)break;_instance3!==5&&_instance3!==26&&_instance3!==27||stateNode===null||(alternate=stateNode,inCapturePhase?(stateNode=getListener(target,registrationName),stateNode!=null&&listeners.unshift(createDispatchListener(target,stateNode,alternate))):inCapturePhase||(stateNode=getListener(target,registrationName),stateNode!=null&&listeners.push(createDispatchListener(target,stateNode,alternate)))),target=target.return}listeners.length!==0&&dispatchQueue.push({event,listeners})}__name(accumulateEnterLeaveListenersForEvent,"accumulateEnterLeaveListenersForEvent");var NORMALIZE_NEWLINES_REGEX=/\r\n?/g,NORMALIZE_NULL_AND_REPLACEMENT_REGEX=/\u0000|\uFFFD/g;function normalizeMarkupForTextOrAttribute(markup){return(typeof markup=="string"?markup:""+markup).replace(NORMALIZE_NEWLINES_REGEX,`
|
|
234
234
|
`).replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX,"")}__name(normalizeMarkupForTextOrAttribute,"normalizeMarkupForTextOrAttribute");function checkForUnmatchedText(serverText,clientText){return clientText=normalizeMarkupForTextOrAttribute(clientText),normalizeMarkupForTextOrAttribute(serverText)===clientText}__name(checkForUnmatchedText,"checkForUnmatchedText");function setProp(domElement,tag,key,value,props,prevValue){switch(key){case"children":typeof value=="string"?tag==="body"||tag==="textarea"&&value===""||setTextContent(domElement,value):(typeof value=="number"||typeof value=="bigint")&&tag!=="body"&&setTextContent(domElement,""+value);break;case"className":setValueForKnownAttribute(domElement,"class",value);break;case"tabIndex":setValueForKnownAttribute(domElement,"tabindex",value);break;case"dir":case"role":case"viewBox":case"width":case"height":setValueForKnownAttribute(domElement,key,value);break;case"style":setValueForStyles(domElement,value,prevValue);break;case"data":if(tag!=="object"){setValueForKnownAttribute(domElement,"data",value);break}case"src":case"href":if(value===""&&(tag!=="a"||key!=="href")){domElement.removeAttribute(key);break}if(value==null||typeof value=="function"||typeof value=="symbol"||typeof value=="boolean"){domElement.removeAttribute(key);break}value=sanitizeURL(""+value),domElement.setAttribute(key,value);break;case"action":case"formAction":if(typeof value=="function"){domElement.setAttribute(key,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof prevValue=="function"&&(key==="formAction"?(tag!=="input"&&setProp(domElement,tag,"name",props.name,props,null),setProp(domElement,tag,"formEncType",props.formEncType,props,null),setProp(domElement,tag,"formMethod",props.formMethod,props,null),setProp(domElement,tag,"formTarget",props.formTarget,props,null)):(setProp(domElement,tag,"encType",props.encType,props,null),setProp(domElement,tag,"method",props.method,props,null),setProp(domElement,tag,"target",props.target,props,null)));if(value==null||typeof value=="symbol"||typeof value=="boolean"){domElement.removeAttribute(key);break}value=sanitizeURL(""+value),domElement.setAttribute(key,value);break;case"onClick":value!=null&&(domElement.onclick=noop$12);break;case"onScroll":value!=null&&listenToNonDelegatedEvent("scroll",domElement);break;case"onScrollEnd":value!=null&&listenToNonDelegatedEvent("scrollend",domElement);break;case"dangerouslySetInnerHTML":if(value!=null){if(typeof value!="object"||!("__html"in value))throw Error(formatProdErrorMessage(61));if(key=value.__html,key!=null){if(props.children!=null)throw Error(formatProdErrorMessage(60));domElement.innerHTML=key}}break;case"multiple":domElement.multiple=value&&typeof value!="function"&&typeof value!="symbol";break;case"muted":domElement.muted=value&&typeof value!="function"&&typeof value!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(value==null||typeof value=="function"||typeof value=="boolean"||typeof value=="symbol"){domElement.removeAttribute("xlink:href");break}key=sanitizeURL(""+value),domElement.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",key);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":value!=null&&typeof value!="function"&&typeof value!="symbol"?domElement.setAttribute(key,""+value):domElement.removeAttribute(key);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":value&&typeof value!="function"&&typeof value!="symbol"?domElement.setAttribute(key,""):domElement.removeAttribute(key);break;case"capture":case"download":value===!0?domElement.setAttribute(key,""):value!==!1&&value!=null&&typeof value!="function"&&typeof value!="symbol"?domElement.setAttribute(key,value):domElement.removeAttribute(key);break;case"cols":case"rows":case"size":case"span":value!=null&&typeof value!="function"&&typeof value!="symbol"&&!isNaN(value)&&1<=value?domElement.setAttribute(key,value):domElement.removeAttribute(key);break;case"rowSpan":case"start":value==null||typeof value=="function"||typeof value=="symbol"||isNaN(value)?domElement.removeAttribute(key):domElement.setAttribute(key,value);break;case"popover":listenToNonDelegatedEvent("beforetoggle",domElement),listenToNonDelegatedEvent("toggle",domElement),setValueForAttribute(domElement,"popover",value);break;case"xlinkActuate":setValueForNamespacedAttribute(domElement,"http://www.w3.org/1999/xlink","xlink:actuate",value);break;case"xlinkArcrole":setValueForNamespacedAttribute(domElement,"http://www.w3.org/1999/xlink","xlink:arcrole",value);break;case"xlinkRole":setValueForNamespacedAttribute(domElement,"http://www.w3.org/1999/xlink","xlink:role",value);break;case"xlinkShow":setValueForNamespacedAttribute(domElement,"http://www.w3.org/1999/xlink","xlink:show",value);break;case"xlinkTitle":setValueForNamespacedAttribute(domElement,"http://www.w3.org/1999/xlink","xlink:title",value);break;case"xlinkType":setValueForNamespacedAttribute(domElement,"http://www.w3.org/1999/xlink","xlink:type",value);break;case"xmlBase":setValueForNamespacedAttribute(domElement,"http://www.w3.org/XML/1998/namespace","xml:base",value);break;case"xmlLang":setValueForNamespacedAttribute(domElement,"http://www.w3.org/XML/1998/namespace","xml:lang",value);break;case"xmlSpace":setValueForNamespacedAttribute(domElement,"http://www.w3.org/XML/1998/namespace","xml:space",value);break;case"is":setValueForAttribute(domElement,"is",value);break;case"innerText":case"textContent":break;default:(!(2<key.length)||key[0]!=="o"&&key[0]!=="O"||key[1]!=="n"&&key[1]!=="N")&&(key=aliases.get(key)||key,setValueForAttribute(domElement,key,value))}}__name(setProp,"setProp");function setPropOnCustomElement(domElement,tag,key,value,props,prevValue){switch(key){case"style":setValueForStyles(domElement,value,prevValue);break;case"dangerouslySetInnerHTML":if(value!=null){if(typeof value!="object"||!("__html"in value))throw Error(formatProdErrorMessage(61));if(key=value.__html,key!=null){if(props.children!=null)throw Error(formatProdErrorMessage(60));domElement.innerHTML=key}}break;case"children":typeof value=="string"?setTextContent(domElement,value):(typeof value=="number"||typeof value=="bigint")&&setTextContent(domElement,""+value);break;case"onScroll":value!=null&&listenToNonDelegatedEvent("scroll",domElement);break;case"onScrollEnd":value!=null&&listenToNonDelegatedEvent("scrollend",domElement);break;case"onClick":value!=null&&(domElement.onclick=noop$12);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!registrationNameDependencies.hasOwnProperty(key))a:{if(key[0]==="o"&&key[1]==="n"&&(props=key.endsWith("Capture"),tag=key.slice(2,props?key.length-7:void 0),prevValue=domElement[internalPropsKey]||null,prevValue=prevValue!=null?prevValue[key]:null,typeof prevValue=="function"&&domElement.removeEventListener(tag,prevValue,props),typeof value=="function")){typeof prevValue!="function"&&prevValue!==null&&(key in domElement?domElement[key]=null:domElement.hasAttribute(key)&&domElement.removeAttribute(key)),domElement.addEventListener(tag,value,props);break a}key in domElement?domElement[key]=value:value===!0?domElement.setAttribute(key,""):setValueForAttribute(domElement,key,value)}}}__name(setPropOnCustomElement,"setPropOnCustomElement");function setInitialProperties(domElement,tag,props){switch(tag){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":listenToNonDelegatedEvent("error",domElement),listenToNonDelegatedEvent("load",domElement);var hasSrc=!1,hasSrcSet=!1,propKey;for(propKey in props)if(props.hasOwnProperty(propKey)){var propValue=props[propKey];if(propValue!=null)switch(propKey){case"src":hasSrc=!0;break;case"srcSet":hasSrcSet=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(formatProdErrorMessage(137,tag));default:setProp(domElement,tag,propKey,propValue,props,null)}}hasSrcSet&&setProp(domElement,tag,"srcSet",props.srcSet,props,null),hasSrc&&setProp(domElement,tag,"src",props.src,props,null);return;case"input":listenToNonDelegatedEvent("invalid",domElement);var defaultValue=propKey=propValue=hasSrcSet=null,checked=null,defaultChecked=null;for(hasSrc in props)if(props.hasOwnProperty(hasSrc)){var propValue$184=props[hasSrc];if(propValue$184!=null)switch(hasSrc){case"name":hasSrcSet=propValue$184;break;case"type":propValue=propValue$184;break;case"checked":checked=propValue$184;break;case"defaultChecked":defaultChecked=propValue$184;break;case"value":propKey=propValue$184;break;case"defaultValue":defaultValue=propValue$184;break;case"children":case"dangerouslySetInnerHTML":if(propValue$184!=null)throw Error(formatProdErrorMessage(137,tag));break;default:setProp(domElement,tag,hasSrc,propValue$184,props,null)}}initInput(domElement,propKey,defaultValue,checked,defaultChecked,propValue,hasSrcSet,!1);return;case"select":listenToNonDelegatedEvent("invalid",domElement),hasSrc=propValue=propKey=null;for(hasSrcSet in props)if(props.hasOwnProperty(hasSrcSet)&&(defaultValue=props[hasSrcSet],defaultValue!=null))switch(hasSrcSet){case"value":propKey=defaultValue;break;case"defaultValue":propValue=defaultValue;break;case"multiple":hasSrc=defaultValue;default:setProp(domElement,tag,hasSrcSet,defaultValue,props,null)}tag=propKey,props=propValue,domElement.multiple=!!hasSrc,tag!=null?updateOptions(domElement,!!hasSrc,tag,!1):props!=null&&updateOptions(domElement,!!hasSrc,props,!0);return;case"textarea":listenToNonDelegatedEvent("invalid",domElement),propKey=hasSrcSet=hasSrc=null;for(propValue in props)if(props.hasOwnProperty(propValue)&&(defaultValue=props[propValue],defaultValue!=null))switch(propValue){case"value":hasSrc=defaultValue;break;case"defaultValue":hasSrcSet=defaultValue;break;case"children":propKey=defaultValue;break;case"dangerouslySetInnerHTML":if(defaultValue!=null)throw Error(formatProdErrorMessage(91));break;default:setProp(domElement,tag,propValue,defaultValue,props,null)}initTextarea(domElement,hasSrc,hasSrcSet,propKey);return;case"option":for(checked in props)props.hasOwnProperty(checked)&&(hasSrc=props[checked],hasSrc!=null)&&(checked==="selected"?domElement.selected=hasSrc&&typeof hasSrc!="function"&&typeof hasSrc!="symbol":setProp(domElement,tag,checked,hasSrc,props,null));return;case"dialog":listenToNonDelegatedEvent("beforetoggle",domElement),listenToNonDelegatedEvent("toggle",domElement),listenToNonDelegatedEvent("cancel",domElement),listenToNonDelegatedEvent("close",domElement);break;case"iframe":case"object":listenToNonDelegatedEvent("load",domElement);break;case"video":case"audio":for(hasSrc=0;hasSrc<mediaEventTypes.length;hasSrc++)listenToNonDelegatedEvent(mediaEventTypes[hasSrc],domElement);break;case"image":listenToNonDelegatedEvent("error",domElement),listenToNonDelegatedEvent("load",domElement);break;case"details":listenToNonDelegatedEvent("toggle",domElement);break;case"embed":case"source":case"link":listenToNonDelegatedEvent("error",domElement),listenToNonDelegatedEvent("load",domElement);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(defaultChecked in props)if(props.hasOwnProperty(defaultChecked)&&(hasSrc=props[defaultChecked],hasSrc!=null))switch(defaultChecked){case"children":case"dangerouslySetInnerHTML":throw Error(formatProdErrorMessage(137,tag));default:setProp(domElement,tag,defaultChecked,hasSrc,props,null)}return;default:if(isCustomElement(tag)){for(propValue$184 in props)props.hasOwnProperty(propValue$184)&&(hasSrc=props[propValue$184],hasSrc!==void 0&&setPropOnCustomElement(domElement,tag,propValue$184,hasSrc,props,void 0));return}}for(defaultValue in props)props.hasOwnProperty(defaultValue)&&(hasSrc=props[defaultValue],hasSrc!=null&&setProp(domElement,tag,defaultValue,hasSrc,props,null))}__name(setInitialProperties,"setInitialProperties");function updateProperties(domElement,tag,lastProps,nextProps){switch(tag){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var name2=null,type=null,value=null,defaultValue=null,lastDefaultValue=null,checked=null,defaultChecked=null;for(propKey in lastProps){var lastProp=lastProps[propKey];if(lastProps.hasOwnProperty(propKey)&&lastProp!=null)switch(propKey){case"checked":break;case"value":break;case"defaultValue":lastDefaultValue=lastProp;default:nextProps.hasOwnProperty(propKey)||setProp(domElement,tag,propKey,null,nextProps,lastProp)}}for(var propKey$201 in nextProps){var propKey=nextProps[propKey$201];if(lastProp=lastProps[propKey$201],nextProps.hasOwnProperty(propKey$201)&&(propKey!=null||lastProp!=null))switch(propKey$201){case"type":type=propKey;break;case"name":name2=propKey;break;case"checked":checked=propKey;break;case"defaultChecked":defaultChecked=propKey;break;case"value":value=propKey;break;case"defaultValue":defaultValue=propKey;break;case"children":case"dangerouslySetInnerHTML":if(propKey!=null)throw Error(formatProdErrorMessage(137,tag));break;default:propKey!==lastProp&&setProp(domElement,tag,propKey$201,propKey,nextProps,lastProp)}}updateInput(domElement,value,defaultValue,lastDefaultValue,checked,defaultChecked,type,name2);return;case"select":propKey=value=defaultValue=propKey$201=null;for(type in lastProps)if(lastDefaultValue=lastProps[type],lastProps.hasOwnProperty(type)&&lastDefaultValue!=null)switch(type){case"value":break;case"multiple":propKey=lastDefaultValue;default:nextProps.hasOwnProperty(type)||setProp(domElement,tag,type,null,nextProps,lastDefaultValue)}for(name2 in nextProps)if(type=nextProps[name2],lastDefaultValue=lastProps[name2],nextProps.hasOwnProperty(name2)&&(type!=null||lastDefaultValue!=null))switch(name2){case"value":propKey$201=type;break;case"defaultValue":defaultValue=type;break;case"multiple":value=type;default:type!==lastDefaultValue&&setProp(domElement,tag,name2,type,nextProps,lastDefaultValue)}tag=defaultValue,lastProps=value,nextProps=propKey,propKey$201!=null?updateOptions(domElement,!!lastProps,propKey$201,!1):!!nextProps!=!!lastProps&&(tag!=null?updateOptions(domElement,!!lastProps,tag,!0):updateOptions(domElement,!!lastProps,lastProps?[]:"",!1));return;case"textarea":propKey=propKey$201=null;for(defaultValue in lastProps)if(name2=lastProps[defaultValue],lastProps.hasOwnProperty(defaultValue)&&name2!=null&&!nextProps.hasOwnProperty(defaultValue))switch(defaultValue){case"value":break;case"children":break;default:setProp(domElement,tag,defaultValue,null,nextProps,name2)}for(value in nextProps)if(name2=nextProps[value],type=lastProps[value],nextProps.hasOwnProperty(value)&&(name2!=null||type!=null))switch(value){case"value":propKey$201=name2;break;case"defaultValue":propKey=name2;break;case"children":break;case"dangerouslySetInnerHTML":if(name2!=null)throw Error(formatProdErrorMessage(91));break;default:name2!==type&&setProp(domElement,tag,value,name2,nextProps,type)}updateTextarea(domElement,propKey$201,propKey);return;case"option":for(var propKey$217 in lastProps)propKey$201=lastProps[propKey$217],lastProps.hasOwnProperty(propKey$217)&&propKey$201!=null&&!nextProps.hasOwnProperty(propKey$217)&&(propKey$217==="selected"?domElement.selected=!1:setProp(domElement,tag,propKey$217,null,nextProps,propKey$201));for(lastDefaultValue in nextProps)propKey$201=nextProps[lastDefaultValue],propKey=lastProps[lastDefaultValue],nextProps.hasOwnProperty(lastDefaultValue)&&propKey$201!==propKey&&(propKey$201!=null||propKey!=null)&&(lastDefaultValue==="selected"?domElement.selected=propKey$201&&typeof propKey$201!="function"&&typeof propKey$201!="symbol":setProp(domElement,tag,lastDefaultValue,propKey$201,nextProps,propKey));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var propKey$222 in lastProps)propKey$201=lastProps[propKey$222],lastProps.hasOwnProperty(propKey$222)&&propKey$201!=null&&!nextProps.hasOwnProperty(propKey$222)&&setProp(domElement,tag,propKey$222,null,nextProps,propKey$201);for(checked in nextProps)if(propKey$201=nextProps[checked],propKey=lastProps[checked],nextProps.hasOwnProperty(checked)&&propKey$201!==propKey&&(propKey$201!=null||propKey!=null))switch(checked){case"children":case"dangerouslySetInnerHTML":if(propKey$201!=null)throw Error(formatProdErrorMessage(137,tag));break;default:setProp(domElement,tag,checked,propKey$201,nextProps,propKey)}return;default:if(isCustomElement(tag)){for(var propKey$227 in lastProps)propKey$201=lastProps[propKey$227],lastProps.hasOwnProperty(propKey$227)&&propKey$201!==void 0&&!nextProps.hasOwnProperty(propKey$227)&&setPropOnCustomElement(domElement,tag,propKey$227,void 0,nextProps,propKey$201);for(defaultChecked in nextProps)propKey$201=nextProps[defaultChecked],propKey=lastProps[defaultChecked],!nextProps.hasOwnProperty(defaultChecked)||propKey$201===propKey||propKey$201===void 0&&propKey===void 0||setPropOnCustomElement(domElement,tag,defaultChecked,propKey$201,nextProps,propKey);return}}for(var propKey$232 in lastProps)propKey$201=lastProps[propKey$232],lastProps.hasOwnProperty(propKey$232)&&propKey$201!=null&&!nextProps.hasOwnProperty(propKey$232)&&setProp(domElement,tag,propKey$232,null,nextProps,propKey$201);for(lastProp in nextProps)propKey$201=nextProps[lastProp],propKey=lastProps[lastProp],!nextProps.hasOwnProperty(lastProp)||propKey$201===propKey||propKey$201==null&&propKey==null||setProp(domElement,tag,lastProp,propKey$201,nextProps,propKey)}__name(updateProperties,"updateProperties");function isLikelyStaticResource(initiatorType){switch(initiatorType){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}__name(isLikelyStaticResource,"isLikelyStaticResource");function estimateBandwidth(){if(typeof performance.getEntriesByType=="function"){for(var count2=0,bits=0,resourceEntries=performance.getEntriesByType("resource"),i2=0;i2<resourceEntries.length;i2++){var entry=resourceEntries[i2],transferSize=entry.transferSize,initiatorType=entry.initiatorType,duration2=entry.duration;if(transferSize&&duration2&&isLikelyStaticResource(initiatorType)){for(initiatorType=0,duration2=entry.responseEnd,i2+=1;i2<resourceEntries.length;i2++){var overlapEntry=resourceEntries[i2],overlapStartTime=overlapEntry.startTime;if(overlapStartTime>duration2)break;var overlapTransferSize=overlapEntry.transferSize,overlapInitiatorType=overlapEntry.initiatorType;overlapTransferSize&&isLikelyStaticResource(overlapInitiatorType)&&(overlapEntry=overlapEntry.responseEnd,initiatorType+=overlapTransferSize*(overlapEntry<duration2?1:(duration2-overlapStartTime)/(overlapEntry-overlapStartTime)))}if(--i2,bits+=8*(transferSize+initiatorType)/(entry.duration/1e3),count2++,10<count2)break}}if(0<count2)return bits/count2/1e6}return navigator.connection&&(count2=navigator.connection.downlink,typeof count2=="number")?count2:5}__name(estimateBandwidth,"estimateBandwidth");var eventsEnabled=null,selectionInformation=null;function getOwnerDocumentFromRootContainer(rootContainerElement){return rootContainerElement.nodeType===9?rootContainerElement:rootContainerElement.ownerDocument}__name(getOwnerDocumentFromRootContainer,"getOwnerDocumentFromRootContainer");function getOwnHostContext(namespaceURI){switch(namespaceURI){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}__name(getOwnHostContext,"getOwnHostContext");function getChildHostContextProd(parentNamespace,type){if(parentNamespace===0)switch(type){case"svg":return 1;case"math":return 2;default:return 0}return parentNamespace===1&&type==="foreignObject"?0:parentNamespace}__name(getChildHostContextProd,"getChildHostContextProd");function shouldSetTextContent(type,props){return type==="textarea"||type==="noscript"||typeof props.children=="string"||typeof props.children=="number"||typeof props.children=="bigint"||typeof props.dangerouslySetInnerHTML=="object"&&props.dangerouslySetInnerHTML!==null&&props.dangerouslySetInnerHTML.__html!=null}__name(shouldSetTextContent,"shouldSetTextContent");var currentPopstateTransitionEvent=null;function shouldAttemptEagerTransition(){var event=window.event;return event&&event.type==="popstate"?event===currentPopstateTransitionEvent?!1:(currentPopstateTransitionEvent=event,!0):(currentPopstateTransitionEvent=null,!1)}__name(shouldAttemptEagerTransition,"shouldAttemptEagerTransition");var scheduleTimeout=typeof setTimeout=="function"?setTimeout:void 0,cancelTimeout=typeof clearTimeout=="function"?clearTimeout:void 0,localPromise=typeof Promise=="function"?Promise:void 0,scheduleMicrotask=typeof queueMicrotask=="function"?queueMicrotask:typeof localPromise<"u"?function(callback){return localPromise.resolve(null).then(callback).catch(handleErrorInNextTick)}:scheduleTimeout;function handleErrorInNextTick(error2){setTimeout(function(){throw error2})}__name(handleErrorInNextTick,"handleErrorInNextTick");function isSingletonScope(type){return type==="head"}__name(isSingletonScope,"isSingletonScope");function clearHydrationBoundary(parentInstance,hydrationInstance){var node2=hydrationInstance,depth=0;do{var nextNode=node2.nextSibling;if(parentInstance.removeChild(node2),nextNode&&nextNode.nodeType===8)if(node2=nextNode.data,node2==="/$"||node2==="/&"){if(depth===0){parentInstance.removeChild(nextNode),retryIfBlockedOn(hydrationInstance);return}depth--}else if(node2==="$"||node2==="$?"||node2==="$~"||node2==="$!"||node2==="&")depth++;else if(node2==="html")releaseSingletonInstance(parentInstance.ownerDocument.documentElement);else if(node2==="head"){node2=parentInstance.ownerDocument.head,releaseSingletonInstance(node2);for(var node$jscomp$0=node2.firstChild;node$jscomp$0;){var nextNode$jscomp$0=node$jscomp$0.nextSibling,nodeName=node$jscomp$0.nodeName;node$jscomp$0[internalHoistableMarker]||nodeName==="SCRIPT"||nodeName==="STYLE"||nodeName==="LINK"&&node$jscomp$0.rel.toLowerCase()==="stylesheet"||node2.removeChild(node$jscomp$0),node$jscomp$0=nextNode$jscomp$0}}else node2==="body"&&releaseSingletonInstance(parentInstance.ownerDocument.body);node2=nextNode}while(node2);retryIfBlockedOn(hydrationInstance)}__name(clearHydrationBoundary,"clearHydrationBoundary");function hideOrUnhideDehydratedBoundary(suspenseInstance,isHidden2){var node2=suspenseInstance;suspenseInstance=0;do{var nextNode=node2.nextSibling;if(node2.nodeType===1?isHidden2?(node2._stashedDisplay=node2.style.display,node2.style.display="none"):(node2.style.display=node2._stashedDisplay||"",node2.getAttribute("style")===""&&node2.removeAttribute("style")):node2.nodeType===3&&(isHidden2?(node2._stashedText=node2.nodeValue,node2.nodeValue=""):node2.nodeValue=node2._stashedText||""),nextNode&&nextNode.nodeType===8)if(node2=nextNode.data,node2==="/$"){if(suspenseInstance===0)break;suspenseInstance--}else node2!=="$"&&node2!=="$?"&&node2!=="$~"&&node2!=="$!"||suspenseInstance++;node2=nextNode}while(node2)}__name(hideOrUnhideDehydratedBoundary,"hideOrUnhideDehydratedBoundary");function clearContainerSparingly(container){var nextNode=container.firstChild;for(nextNode&&nextNode.nodeType===10&&(nextNode=nextNode.nextSibling);nextNode;){var node2=nextNode;switch(nextNode=nextNode.nextSibling,node2.nodeName){case"HTML":case"HEAD":case"BODY":clearContainerSparingly(node2),detachDeletedInstance(node2);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(node2.rel.toLowerCase()==="stylesheet")continue}container.removeChild(node2)}}__name(clearContainerSparingly,"clearContainerSparingly");function canHydrateInstance(instance,type,props,inRootOrSingleton){for(;instance.nodeType===1;){var anyProps=props;if(instance.nodeName.toLowerCase()!==type.toLowerCase()){if(!inRootOrSingleton&&(instance.nodeName!=="INPUT"||instance.type!=="hidden"))break}else if(inRootOrSingleton){if(!instance[internalHoistableMarker])switch(type){case"meta":if(!instance.hasAttribute("itemprop"))break;return instance;case"link":if(name2=instance.getAttribute("rel"),name2==="stylesheet"&&instance.hasAttribute("data-precedence"))break;if(name2!==anyProps.rel||instance.getAttribute("href")!==(anyProps.href==null||anyProps.href===""?null:anyProps.href)||instance.getAttribute("crossorigin")!==(anyProps.crossOrigin==null?null:anyProps.crossOrigin)||instance.getAttribute("title")!==(anyProps.title==null?null:anyProps.title))break;return instance;case"style":if(instance.hasAttribute("data-precedence"))break;return instance;case"script":if(name2=instance.getAttribute("src"),(name2!==(anyProps.src==null?null:anyProps.src)||instance.getAttribute("type")!==(anyProps.type==null?null:anyProps.type)||instance.getAttribute("crossorigin")!==(anyProps.crossOrigin==null?null:anyProps.crossOrigin))&&name2&&instance.hasAttribute("async")&&!instance.hasAttribute("itemprop"))break;return instance;default:return instance}}else if(type==="input"&&instance.type==="hidden"){var name2=anyProps.name==null?null:""+anyProps.name;if(anyProps.type==="hidden"&&instance.getAttribute("name")===name2)return instance}else return instance;if(instance=getNextHydratable(instance.nextSibling),instance===null)break}return null}__name(canHydrateInstance,"canHydrateInstance");function canHydrateTextInstance(instance,text2,inRootOrSingleton){if(text2==="")return null;for(;instance.nodeType!==3;)if((instance.nodeType!==1||instance.nodeName!=="INPUT"||instance.type!=="hidden")&&!inRootOrSingleton||(instance=getNextHydratable(instance.nextSibling),instance===null))return null;return instance}__name(canHydrateTextInstance,"canHydrateTextInstance");function canHydrateHydrationBoundary(instance,inRootOrSingleton){for(;instance.nodeType!==8;)if((instance.nodeType!==1||instance.nodeName!=="INPUT"||instance.type!=="hidden")&&!inRootOrSingleton||(instance=getNextHydratable(instance.nextSibling),instance===null))return null;return instance}__name(canHydrateHydrationBoundary,"canHydrateHydrationBoundary");function isSuspenseInstancePending(instance){return instance.data==="$?"||instance.data==="$~"}__name(isSuspenseInstancePending,"isSuspenseInstancePending");function isSuspenseInstanceFallback(instance){return instance.data==="$!"||instance.data==="$?"&&instance.ownerDocument.readyState!=="loading"}__name(isSuspenseInstanceFallback,"isSuspenseInstanceFallback");function registerSuspenseInstanceRetry(instance,callback){var ownerDocument=instance.ownerDocument;if(instance.data==="$~")instance._reactRetry=callback;else if(instance.data!=="$?"||ownerDocument.readyState!=="loading")callback();else{var listener=__name(function(){callback(),ownerDocument.removeEventListener("DOMContentLoaded",listener)},"listener");ownerDocument.addEventListener("DOMContentLoaded",listener),instance._reactRetry=listener}}__name(registerSuspenseInstanceRetry,"registerSuspenseInstanceRetry");function getNextHydratable(node2){for(;node2!=null;node2=node2.nextSibling){var nodeType=node2.nodeType;if(nodeType===1||nodeType===3)break;if(nodeType===8){if(nodeType=node2.data,nodeType==="$"||nodeType==="$!"||nodeType==="$?"||nodeType==="$~"||nodeType==="&"||nodeType==="F!"||nodeType==="F")break;if(nodeType==="/$"||nodeType==="/&")return null}}return node2}__name(getNextHydratable,"getNextHydratable");var previousHydratableOnEnteringScopedSingleton=null;function getNextHydratableInstanceAfterHydrationBoundary(hydrationInstance){hydrationInstance=hydrationInstance.nextSibling;for(var depth=0;hydrationInstance;){if(hydrationInstance.nodeType===8){var data=hydrationInstance.data;if(data==="/$"||data==="/&"){if(depth===0)return getNextHydratable(hydrationInstance.nextSibling);depth--}else data!=="$"&&data!=="$!"&&data!=="$?"&&data!=="$~"&&data!=="&"||depth++}hydrationInstance=hydrationInstance.nextSibling}return null}__name(getNextHydratableInstanceAfterHydrationBoundary,"getNextHydratableInstanceAfterHydrationBoundary");function getParentHydrationBoundary(targetInstance){targetInstance=targetInstance.previousSibling;for(var depth=0;targetInstance;){if(targetInstance.nodeType===8){var data=targetInstance.data;if(data==="$"||data==="$!"||data==="$?"||data==="$~"||data==="&"){if(depth===0)return targetInstance;depth--}else data!=="/$"&&data!=="/&"||depth++}targetInstance=targetInstance.previousSibling}return null}__name(getParentHydrationBoundary,"getParentHydrationBoundary");function resolveSingletonInstance(type,props,rootContainerInstance){switch(props=getOwnerDocumentFromRootContainer(rootContainerInstance),type){case"html":if(type=props.documentElement,!type)throw Error(formatProdErrorMessage(452));return type;case"head":if(type=props.head,!type)throw Error(formatProdErrorMessage(453));return type;case"body":if(type=props.body,!type)throw Error(formatProdErrorMessage(454));return type;default:throw Error(formatProdErrorMessage(451))}}__name(resolveSingletonInstance,"resolveSingletonInstance");function releaseSingletonInstance(instance){for(var attributes=instance.attributes;attributes.length;)instance.removeAttributeNode(attributes[0]);detachDeletedInstance(instance)}__name(releaseSingletonInstance,"releaseSingletonInstance");var preloadPropsMap=new Map,preconnectsSet=new Set;function getHoistableRoot(container){return typeof container.getRootNode=="function"?container.getRootNode():container.nodeType===9?container:container.ownerDocument}__name(getHoistableRoot,"getHoistableRoot");var previousDispatcher=ReactDOMSharedInternals.d;ReactDOMSharedInternals.d={f:flushSyncWork,r:requestFormReset,D:prefetchDNS,C:preconnect,L:preload2,m:preloadModule,X:preinitScript,S:preinitStyle,M:preinitModuleScript};function flushSyncWork(){var previousWasRendering=previousDispatcher.f(),wasRendering=flushSyncWork$1();return previousWasRendering||wasRendering}__name(flushSyncWork,"flushSyncWork");function requestFormReset(form){var formInst=getInstanceFromNode(form);formInst!==null&&formInst.tag===5&&formInst.type==="form"?requestFormReset$1(formInst):previousDispatcher.r(form)}__name(requestFormReset,"requestFormReset");var globalDocument=typeof document>"u"?null:document;function preconnectAs(rel,href,crossOrigin){var ownerDocument=globalDocument;if(ownerDocument&&typeof href=="string"&&href){var limitedEscapedHref=escapeSelectorAttributeValueInsideDoubleQuotes(href);limitedEscapedHref='link[rel="'+rel+'"][href="'+limitedEscapedHref+'"]',typeof crossOrigin=="string"&&(limitedEscapedHref+='[crossorigin="'+crossOrigin+'"]'),preconnectsSet.has(limitedEscapedHref)||(preconnectsSet.add(limitedEscapedHref),rel={rel,crossOrigin,href},ownerDocument.querySelector(limitedEscapedHref)===null&&(href=ownerDocument.createElement("link"),setInitialProperties(href,"link",rel),markNodeAsHoistable(href),ownerDocument.head.appendChild(href)))}}__name(preconnectAs,"preconnectAs");function prefetchDNS(href){previousDispatcher.D(href),preconnectAs("dns-prefetch",href,null)}__name(prefetchDNS,"prefetchDNS");function preconnect(href,crossOrigin){previousDispatcher.C(href,crossOrigin),preconnectAs("preconnect",href,crossOrigin)}__name(preconnect,"preconnect");function preload2(href,as,options2){previousDispatcher.L(href,as,options2);var ownerDocument=globalDocument;if(ownerDocument&&href&&as){var preloadSelector='link[rel="preload"][as="'+escapeSelectorAttributeValueInsideDoubleQuotes(as)+'"]';as==="image"&&options2&&options2.imageSrcSet?(preloadSelector+='[imagesrcset="'+escapeSelectorAttributeValueInsideDoubleQuotes(options2.imageSrcSet)+'"]',typeof options2.imageSizes=="string"&&(preloadSelector+='[imagesizes="'+escapeSelectorAttributeValueInsideDoubleQuotes(options2.imageSizes)+'"]')):preloadSelector+='[href="'+escapeSelectorAttributeValueInsideDoubleQuotes(href)+'"]';var key=preloadSelector;switch(as){case"style":key=getStyleKey(href);break;case"script":key=getScriptKey(href)}preloadPropsMap.has(key)||(href=assign({rel:"preload",href:as==="image"&&options2&&options2.imageSrcSet?void 0:href,as},options2),preloadPropsMap.set(key,href),ownerDocument.querySelector(preloadSelector)!==null||as==="style"&&ownerDocument.querySelector(getStylesheetSelectorFromKey(key))||as==="script"&&ownerDocument.querySelector(getScriptSelectorFromKey(key))||(as=ownerDocument.createElement("link"),setInitialProperties(as,"link",href),markNodeAsHoistable(as),ownerDocument.head.appendChild(as)))}}__name(preload2,"preload");function preloadModule(href,options2){previousDispatcher.m(href,options2);var ownerDocument=globalDocument;if(ownerDocument&&href){var as=options2&&typeof options2.as=="string"?options2.as:"script",preloadSelector='link[rel="modulepreload"][as="'+escapeSelectorAttributeValueInsideDoubleQuotes(as)+'"][href="'+escapeSelectorAttributeValueInsideDoubleQuotes(href)+'"]',key=preloadSelector;switch(as){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":key=getScriptKey(href)}if(!preloadPropsMap.has(key)&&(href=assign({rel:"modulepreload",href},options2),preloadPropsMap.set(key,href),ownerDocument.querySelector(preloadSelector)===null)){switch(as){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(ownerDocument.querySelector(getScriptSelectorFromKey(key)))return}as=ownerDocument.createElement("link"),setInitialProperties(as,"link",href),markNodeAsHoistable(as),ownerDocument.head.appendChild(as)}}}__name(preloadModule,"preloadModule");function preinitStyle(href,precedence,options2){previousDispatcher.S(href,precedence,options2);var ownerDocument=globalDocument;if(ownerDocument&&href){var styles=getResourcesFromRoot(ownerDocument).hoistableStyles,key=getStyleKey(href);precedence=precedence||"default";var resource=styles.get(key);if(!resource){var state2={loading:0,preload:null};if(resource=ownerDocument.querySelector(getStylesheetSelectorFromKey(key)))state2.loading=5;else{href=assign({rel:"stylesheet",href,"data-precedence":precedence},options2),(options2=preloadPropsMap.get(key))&&adoptPreloadPropsForStylesheet(href,options2);var link2=resource=ownerDocument.createElement("link");markNodeAsHoistable(link2),setInitialProperties(link2,"link",href),link2._p=new Promise(function(resolve,reject){link2.onload=resolve,link2.onerror=reject}),link2.addEventListener("load",function(){state2.loading|=1}),link2.addEventListener("error",function(){state2.loading|=2}),state2.loading|=4,insertStylesheet(resource,precedence,ownerDocument)}resource={type:"stylesheet",instance:resource,count:1,state:state2},styles.set(key,resource)}}}__name(preinitStyle,"preinitStyle");function preinitScript(src,options2){previousDispatcher.X(src,options2);var ownerDocument=globalDocument;if(ownerDocument&&src){var scripts=getResourcesFromRoot(ownerDocument).hoistableScripts,key=getScriptKey(src),resource=scripts.get(key);resource||(resource=ownerDocument.querySelector(getScriptSelectorFromKey(key)),resource||(src=assign({src,async:!0},options2),(options2=preloadPropsMap.get(key))&&adoptPreloadPropsForScript(src,options2),resource=ownerDocument.createElement("script"),markNodeAsHoistable(resource),setInitialProperties(resource,"link",src),ownerDocument.head.appendChild(resource)),resource={type:"script",instance:resource,count:1,state:null},scripts.set(key,resource))}}__name(preinitScript,"preinitScript");function preinitModuleScript(src,options2){previousDispatcher.M(src,options2);var ownerDocument=globalDocument;if(ownerDocument&&src){var scripts=getResourcesFromRoot(ownerDocument).hoistableScripts,key=getScriptKey(src),resource=scripts.get(key);resource||(resource=ownerDocument.querySelector(getScriptSelectorFromKey(key)),resource||(src=assign({src,async:!0,type:"module"},options2),(options2=preloadPropsMap.get(key))&&adoptPreloadPropsForScript(src,options2),resource=ownerDocument.createElement("script"),markNodeAsHoistable(resource),setInitialProperties(resource,"link",src),ownerDocument.head.appendChild(resource)),resource={type:"script",instance:resource,count:1,state:null},scripts.set(key,resource))}}__name(preinitModuleScript,"preinitModuleScript");function getResource(type,currentProps,pendingProps,currentResource){var JSCompiler_inline_result=(JSCompiler_inline_result=rootInstanceStackCursor.current)?getHoistableRoot(JSCompiler_inline_result):null;if(!JSCompiler_inline_result)throw Error(formatProdErrorMessage(446));switch(type){case"meta":case"title":return null;case"style":return typeof pendingProps.precedence=="string"&&typeof pendingProps.href=="string"?(currentProps=getStyleKey(pendingProps.href),pendingProps=getResourcesFromRoot(JSCompiler_inline_result).hoistableStyles,currentResource=pendingProps.get(currentProps),currentResource||(currentResource={type:"style",instance:null,count:0,state:null},pendingProps.set(currentProps,currentResource)),currentResource):{type:"void",instance:null,count:0,state:null};case"link":if(pendingProps.rel==="stylesheet"&&typeof pendingProps.href=="string"&&typeof pendingProps.precedence=="string"){type=getStyleKey(pendingProps.href);var styles$243=getResourcesFromRoot(JSCompiler_inline_result).hoistableStyles,resource$244=styles$243.get(type);if(resource$244||(JSCompiler_inline_result=JSCompiler_inline_result.ownerDocument||JSCompiler_inline_result,resource$244={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},styles$243.set(type,resource$244),(styles$243=JSCompiler_inline_result.querySelector(getStylesheetSelectorFromKey(type)))&&!styles$243._p&&(resource$244.instance=styles$243,resource$244.state.loading=5),preloadPropsMap.has(type)||(pendingProps={rel:"preload",as:"style",href:pendingProps.href,crossOrigin:pendingProps.crossOrigin,integrity:pendingProps.integrity,media:pendingProps.media,hrefLang:pendingProps.hrefLang,referrerPolicy:pendingProps.referrerPolicy},preloadPropsMap.set(type,pendingProps),styles$243||preloadStylesheet(JSCompiler_inline_result,type,pendingProps,resource$244.state))),currentProps&¤tResource===null)throw Error(formatProdErrorMessage(528,""));return resource$244}if(currentProps&¤tResource!==null)throw Error(formatProdErrorMessage(529,""));return null;case"script":return currentProps=pendingProps.async,pendingProps=pendingProps.src,typeof pendingProps=="string"&¤tProps&&typeof currentProps!="function"&&typeof currentProps!="symbol"?(currentProps=getScriptKey(pendingProps),pendingProps=getResourcesFromRoot(JSCompiler_inline_result).hoistableScripts,currentResource=pendingProps.get(currentProps),currentResource||(currentResource={type:"script",instance:null,count:0,state:null},pendingProps.set(currentProps,currentResource)),currentResource):{type:"void",instance:null,count:0,state:null};default:throw Error(formatProdErrorMessage(444,type))}}__name(getResource,"getResource");function getStyleKey(href){return'href="'+escapeSelectorAttributeValueInsideDoubleQuotes(href)+'"'}__name(getStyleKey,"getStyleKey");function getStylesheetSelectorFromKey(key){return'link[rel="stylesheet"]['+key+"]"}__name(getStylesheetSelectorFromKey,"getStylesheetSelectorFromKey");function stylesheetPropsFromRawProps(rawProps){return assign({},rawProps,{"data-precedence":rawProps.precedence,precedence:null})}__name(stylesheetPropsFromRawProps,"stylesheetPropsFromRawProps");function preloadStylesheet(ownerDocument,key,preloadProps,state2){ownerDocument.querySelector('link[rel="preload"][as="style"]['+key+"]")?state2.loading=1:(key=ownerDocument.createElement("link"),state2.preload=key,key.addEventListener("load",function(){return state2.loading|=1}),key.addEventListener("error",function(){return state2.loading|=2}),setInitialProperties(key,"link",preloadProps),markNodeAsHoistable(key),ownerDocument.head.appendChild(key))}__name(preloadStylesheet,"preloadStylesheet");function getScriptKey(src){return'[src="'+escapeSelectorAttributeValueInsideDoubleQuotes(src)+'"]'}__name(getScriptKey,"getScriptKey");function getScriptSelectorFromKey(key){return"script[async]"+key}__name(getScriptSelectorFromKey,"getScriptSelectorFromKey");function acquireResource(hoistableRoot,resource,props){if(resource.count++,resource.instance===null)switch(resource.type){case"style":var instance=hoistableRoot.querySelector('style[data-href~="'+escapeSelectorAttributeValueInsideDoubleQuotes(props.href)+'"]');if(instance)return resource.instance=instance,markNodeAsHoistable(instance),instance;var styleProps=assign({},props,{"data-href":props.href,"data-precedence":props.precedence,href:null,precedence:null});return instance=(hoistableRoot.ownerDocument||hoistableRoot).createElement("style"),markNodeAsHoistable(instance),setInitialProperties(instance,"style",styleProps),insertStylesheet(instance,props.precedence,hoistableRoot),resource.instance=instance;case"stylesheet":styleProps=getStyleKey(props.href);var instance$249=hoistableRoot.querySelector(getStylesheetSelectorFromKey(styleProps));if(instance$249)return resource.state.loading|=4,resource.instance=instance$249,markNodeAsHoistable(instance$249),instance$249;instance=stylesheetPropsFromRawProps(props),(styleProps=preloadPropsMap.get(styleProps))&&adoptPreloadPropsForStylesheet(instance,styleProps),instance$249=(hoistableRoot.ownerDocument||hoistableRoot).createElement("link"),markNodeAsHoistable(instance$249);var linkInstance=instance$249;return linkInstance._p=new Promise(function(resolve,reject){linkInstance.onload=resolve,linkInstance.onerror=reject}),setInitialProperties(instance$249,"link",instance),resource.state.loading|=4,insertStylesheet(instance$249,props.precedence,hoistableRoot),resource.instance=instance$249;case"script":return instance$249=getScriptKey(props.src),(styleProps=hoistableRoot.querySelector(getScriptSelectorFromKey(instance$249)))?(resource.instance=styleProps,markNodeAsHoistable(styleProps),styleProps):(instance=props,(styleProps=preloadPropsMap.get(instance$249))&&(instance=assign({},props),adoptPreloadPropsForScript(instance,styleProps)),hoistableRoot=hoistableRoot.ownerDocument||hoistableRoot,styleProps=hoistableRoot.createElement("script"),markNodeAsHoistable(styleProps),setInitialProperties(styleProps,"link",instance),hoistableRoot.head.appendChild(styleProps),resource.instance=styleProps);case"void":return null;default:throw Error(formatProdErrorMessage(443,resource.type))}else resource.type==="stylesheet"&&(resource.state.loading&4)===0&&(instance=resource.instance,resource.state.loading|=4,insertStylesheet(instance,props.precedence,hoistableRoot));return resource.instance}__name(acquireResource,"acquireResource");function insertStylesheet(instance,precedence,root3){for(var nodes=root3.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),last2=nodes.length?nodes[nodes.length-1]:null,prior=last2,i2=0;i2<nodes.length;i2++){var node2=nodes[i2];if(node2.dataset.precedence===precedence)prior=node2;else if(prior!==last2)break}prior?prior.parentNode.insertBefore(instance,prior.nextSibling):(precedence=root3.nodeType===9?root3.head:root3,precedence.insertBefore(instance,precedence.firstChild))}__name(insertStylesheet,"insertStylesheet");function adoptPreloadPropsForStylesheet(stylesheetProps,preloadProps){stylesheetProps.crossOrigin==null&&(stylesheetProps.crossOrigin=preloadProps.crossOrigin),stylesheetProps.referrerPolicy==null&&(stylesheetProps.referrerPolicy=preloadProps.referrerPolicy),stylesheetProps.title==null&&(stylesheetProps.title=preloadProps.title)}__name(adoptPreloadPropsForStylesheet,"adoptPreloadPropsForStylesheet");function adoptPreloadPropsForScript(scriptProps,preloadProps){scriptProps.crossOrigin==null&&(scriptProps.crossOrigin=preloadProps.crossOrigin),scriptProps.referrerPolicy==null&&(scriptProps.referrerPolicy=preloadProps.referrerPolicy),scriptProps.integrity==null&&(scriptProps.integrity=preloadProps.integrity)}__name(adoptPreloadPropsForScript,"adoptPreloadPropsForScript");var tagCaches=null;function getHydratableHoistableCache(type,keyAttribute,ownerDocument){if(tagCaches===null){var cache2=new Map,caches=tagCaches=new Map;caches.set(ownerDocument,cache2)}else caches=tagCaches,cache2=caches.get(ownerDocument),cache2||(cache2=new Map,caches.set(ownerDocument,cache2));if(cache2.has(type))return cache2;for(cache2.set(type,null),ownerDocument=ownerDocument.getElementsByTagName(type),caches=0;caches<ownerDocument.length;caches++){var node2=ownerDocument[caches];if(!(node2[internalHoistableMarker]||node2[internalInstanceKey]||type==="link"&&node2.getAttribute("rel")==="stylesheet")&&node2.namespaceURI!=="http://www.w3.org/2000/svg"){var nodeKey=node2.getAttribute(keyAttribute)||"";nodeKey=type+nodeKey;var existing=cache2.get(nodeKey);existing?existing.push(node2):cache2.set(nodeKey,[node2])}}return cache2}__name(getHydratableHoistableCache,"getHydratableHoistableCache");function mountHoistable(hoistableRoot,type,instance){hoistableRoot=hoistableRoot.ownerDocument||hoistableRoot,hoistableRoot.head.insertBefore(instance,type==="title"?hoistableRoot.querySelector("head > title"):null)}__name(mountHoistable,"mountHoistable");function isHostHoistableType(type,props,hostContext){if(hostContext===1||props.itemProp!=null)return!1;switch(type){case"meta":case"title":return!0;case"style":if(typeof props.precedence!="string"||typeof props.href!="string"||props.href==="")break;return!0;case"link":if(typeof props.rel!="string"||typeof props.href!="string"||props.href===""||props.onLoad||props.onError)break;return props.rel==="stylesheet"?(type=props.disabled,typeof props.precedence=="string"&&type==null):!0;case"script":if(props.async&&typeof props.async!="function"&&typeof props.async!="symbol"&&!props.onLoad&&!props.onError&&props.src&&typeof props.src=="string")return!0}return!1}__name(isHostHoistableType,"isHostHoistableType");function preloadResource(resource){return!(resource.type==="stylesheet"&&(resource.state.loading&3)===0)}__name(preloadResource,"preloadResource");function suspendResource(state2,hoistableRoot,resource,props){if(resource.type==="stylesheet"&&(typeof props.media!="string"||matchMedia(props.media).matches!==!1)&&(resource.state.loading&4)===0){if(resource.instance===null){var key=getStyleKey(props.href),instance=hoistableRoot.querySelector(getStylesheetSelectorFromKey(key));if(instance){hoistableRoot=instance._p,hoistableRoot!==null&&typeof hoistableRoot=="object"&&typeof hoistableRoot.then=="function"&&(state2.count++,state2=onUnsuspend.bind(state2),hoistableRoot.then(state2,state2)),resource.state.loading|=4,resource.instance=instance,markNodeAsHoistable(instance);return}instance=hoistableRoot.ownerDocument||hoistableRoot,props=stylesheetPropsFromRawProps(props),(key=preloadPropsMap.get(key))&&adoptPreloadPropsForStylesheet(props,key),instance=instance.createElement("link"),markNodeAsHoistable(instance);var linkInstance=instance;linkInstance._p=new Promise(function(resolve,reject){linkInstance.onload=resolve,linkInstance.onerror=reject}),setInitialProperties(instance,"link",props),resource.instance=instance}state2.stylesheets===null&&(state2.stylesheets=new Map),state2.stylesheets.set(resource,hoistableRoot),(hoistableRoot=resource.state.preload)&&(resource.state.loading&3)===0&&(state2.count++,resource=onUnsuspend.bind(state2),hoistableRoot.addEventListener("load",resource),hoistableRoot.addEventListener("error",resource))}}__name(suspendResource,"suspendResource");var estimatedBytesWithinLimit=0;function waitForCommitToBeReady(state2,timeoutOffset){return state2.stylesheets&&state2.count===0&&insertSuspendedStylesheets(state2,state2.stylesheets),0<state2.count||0<state2.imgCount?function(commit){var stylesheetTimer=setTimeout(function(){if(state2.stylesheets&&insertSuspendedStylesheets(state2,state2.stylesheets),state2.unsuspend){var unsuspend=state2.unsuspend;state2.unsuspend=null,unsuspend()}},6e4+timeoutOffset);0<state2.imgBytes&&estimatedBytesWithinLimit===0&&(estimatedBytesWithinLimit=62500*estimateBandwidth());var imgTimer=setTimeout(function(){if(state2.waitingForImages=!1,state2.count===0&&(state2.stylesheets&&insertSuspendedStylesheets(state2,state2.stylesheets),state2.unsuspend)){var unsuspend=state2.unsuspend;state2.unsuspend=null,unsuspend()}},(state2.imgBytes>estimatedBytesWithinLimit?50:800)+timeoutOffset);return state2.unsuspend=commit,function(){state2.unsuspend=null,clearTimeout(stylesheetTimer),clearTimeout(imgTimer)}}:null}__name(waitForCommitToBeReady,"waitForCommitToBeReady");function onUnsuspend(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)insertSuspendedStylesheets(this,this.stylesheets);else if(this.unsuspend){var unsuspend=this.unsuspend;this.unsuspend=null,unsuspend()}}}__name(onUnsuspend,"onUnsuspend");var precedencesByRoot=null;function insertSuspendedStylesheets(state2,resources){state2.stylesheets=null,state2.unsuspend!==null&&(state2.count++,precedencesByRoot=new Map,resources.forEach(insertStylesheetIntoRoot,state2),precedencesByRoot=null,onUnsuspend.call(state2))}__name(insertSuspendedStylesheets,"insertSuspendedStylesheets");function insertStylesheetIntoRoot(root3,resource){if(!(resource.state.loading&4)){var precedences=precedencesByRoot.get(root3);if(precedences)var last2=precedences.get(null);else{precedences=new Map,precedencesByRoot.set(root3,precedences);for(var nodes=root3.querySelectorAll("link[data-precedence],style[data-precedence]"),i2=0;i2<nodes.length;i2++){var node2=nodes[i2];(node2.nodeName==="LINK"||node2.getAttribute("media")!=="not all")&&(precedences.set(node2.dataset.precedence,node2),last2=node2)}last2&&precedences.set(null,last2)}nodes=resource.instance,node2=nodes.getAttribute("data-precedence"),i2=precedences.get(node2)||last2,i2===last2&&precedences.set(null,nodes),precedences.set(node2,nodes),this.count++,last2=onUnsuspend.bind(this),nodes.addEventListener("load",last2),nodes.addEventListener("error",last2),i2?i2.parentNode.insertBefore(nodes,i2.nextSibling):(root3=root3.nodeType===9?root3.head:root3,root3.insertBefore(nodes,root3.firstChild)),resource.state.loading|=4}}__name(insertStylesheetIntoRoot,"insertStylesheetIntoRoot");var HostTransitionContext={$$typeof:REACT_CONTEXT_TYPE,Provider:null,Consumer:null,_currentValue:sharedNotPendingObject,_currentValue2:sharedNotPendingObject,_threadCount:0};function FiberRootNode(containerInfo,tag,hydrate,identifierPrefix,onUncaughtError,onCaughtError,onRecoverableError,onDefaultTransitionIndicator,formState){this.tag=1,this.containerInfo=containerInfo,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=createLaneMap(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=createLaneMap(0),this.hiddenUpdates=createLaneMap(null),this.identifierPrefix=identifierPrefix,this.onUncaughtError=onUncaughtError,this.onCaughtError=onCaughtError,this.onRecoverableError=onRecoverableError,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=formState,this.incompleteTransitions=new Map}__name(FiberRootNode,"FiberRootNode");function createFiberRoot(containerInfo,tag,hydrate,initialChildren,hydrationCallbacks,isStrictMode,identifierPrefix,formState,onUncaughtError,onCaughtError,onRecoverableError,onDefaultTransitionIndicator){return containerInfo=new FiberRootNode(containerInfo,tag,hydrate,identifierPrefix,onUncaughtError,onCaughtError,onRecoverableError,onDefaultTransitionIndicator,formState),tag=1,isStrictMode===!0&&(tag|=24),isStrictMode=createFiberImplClass(3,null,null,tag),containerInfo.current=isStrictMode,isStrictMode.stateNode=containerInfo,tag=createCache(),tag.refCount++,containerInfo.pooledCache=tag,tag.refCount++,isStrictMode.memoizedState={element:initialChildren,isDehydrated:hydrate,cache:tag},initializeUpdateQueue(isStrictMode),containerInfo}__name(createFiberRoot,"createFiberRoot");function getContextForSubtree(parentComponent){return parentComponent?(parentComponent=emptyContextObject,parentComponent):emptyContextObject}__name(getContextForSubtree,"getContextForSubtree");function updateContainerImpl(rootFiber,lane,element2,container,parentComponent,callback){parentComponent=getContextForSubtree(parentComponent),container.context===null?container.context=parentComponent:container.pendingContext=parentComponent,container=createUpdate(lane),container.payload={element:element2},callback=callback===void 0?null:callback,callback!==null&&(container.callback=callback),element2=enqueueUpdate(rootFiber,container,lane),element2!==null&&(scheduleUpdateOnFiber(element2,rootFiber,lane),entangleTransitions(element2,rootFiber,lane))}__name(updateContainerImpl,"updateContainerImpl");function markRetryLaneImpl(fiber,retryLane){if(fiber=fiber.memoizedState,fiber!==null&&fiber.dehydrated!==null){var a2=fiber.retryLane;fiber.retryLane=a2!==0&&a2<retryLane?a2:retryLane}}__name(markRetryLaneImpl,"markRetryLaneImpl");function markRetryLaneIfNotHydrated(fiber,retryLane){markRetryLaneImpl(fiber,retryLane),(fiber=fiber.alternate)&&markRetryLaneImpl(fiber,retryLane)}__name(markRetryLaneIfNotHydrated,"markRetryLaneIfNotHydrated");function attemptContinuousHydration(fiber){if(fiber.tag===13||fiber.tag===31){var root3=enqueueConcurrentRenderForLane(fiber,67108864);root3!==null&&scheduleUpdateOnFiber(root3,fiber,67108864),markRetryLaneIfNotHydrated(fiber,67108864)}}__name(attemptContinuousHydration,"attemptContinuousHydration");function attemptHydrationAtCurrentPriority(fiber){if(fiber.tag===13||fiber.tag===31){var lane=requestUpdateLane();lane=getBumpedLaneForHydrationByLane(lane);var root3=enqueueConcurrentRenderForLane(fiber,lane);root3!==null&&scheduleUpdateOnFiber(root3,fiber,lane),markRetryLaneIfNotHydrated(fiber,lane)}}__name(attemptHydrationAtCurrentPriority,"attemptHydrationAtCurrentPriority");var _enabled=!0;function dispatchDiscreteEvent(domEventName,eventSystemFlags,container,nativeEvent){var prevTransition=ReactSharedInternals.T;ReactSharedInternals.T=null;var previousPriority=ReactDOMSharedInternals.p;try{ReactDOMSharedInternals.p=2,dispatchEvent(domEventName,eventSystemFlags,container,nativeEvent)}finally{ReactDOMSharedInternals.p=previousPriority,ReactSharedInternals.T=prevTransition}}__name(dispatchDiscreteEvent,"dispatchDiscreteEvent");function dispatchContinuousEvent(domEventName,eventSystemFlags,container,nativeEvent){var prevTransition=ReactSharedInternals.T;ReactSharedInternals.T=null;var previousPriority=ReactDOMSharedInternals.p;try{ReactDOMSharedInternals.p=8,dispatchEvent(domEventName,eventSystemFlags,container,nativeEvent)}finally{ReactDOMSharedInternals.p=previousPriority,ReactSharedInternals.T=prevTransition}}__name(dispatchContinuousEvent,"dispatchContinuousEvent");function dispatchEvent(domEventName,eventSystemFlags,targetContainer,nativeEvent){if(_enabled){var blockedOn=findInstanceBlockingEvent(nativeEvent);if(blockedOn===null)dispatchEventForPluginEventSystem(domEventName,eventSystemFlags,nativeEvent,return_targetInst,targetContainer),clearIfContinuousEvent(domEventName,nativeEvent);else if(queueIfContinuousEvent(blockedOn,domEventName,eventSystemFlags,targetContainer,nativeEvent))nativeEvent.stopPropagation();else if(clearIfContinuousEvent(domEventName,nativeEvent),eventSystemFlags&4&&-1<discreteReplayableEvents.indexOf(domEventName)){for(;blockedOn!==null;){var fiber=getInstanceFromNode(blockedOn);if(fiber!==null)switch(fiber.tag){case 3:if(fiber=fiber.stateNode,fiber.current.memoizedState.isDehydrated){var lanes=getHighestPriorityLanes(fiber.pendingLanes);if(lanes!==0){var root3=fiber;for(root3.pendingLanes|=2,root3.entangledLanes|=2;lanes;){var lane=1<<31-clz32(lanes);root3.entanglements[1]|=lane,lanes&=~lane}ensureRootIsScheduled(fiber),(executionContext&6)===0&&(workInProgressRootRenderTargetTime=now()+500,flushSyncWorkAcrossRoots_impl(0))}}break;case 31:case 13:root3=enqueueConcurrentRenderForLane(fiber,2),root3!==null&&scheduleUpdateOnFiber(root3,fiber,2),flushSyncWork$1(),markRetryLaneIfNotHydrated(fiber,2)}if(fiber=findInstanceBlockingEvent(nativeEvent),fiber===null&&dispatchEventForPluginEventSystem(domEventName,eventSystemFlags,nativeEvent,return_targetInst,targetContainer),fiber===blockedOn)break;blockedOn=fiber}blockedOn!==null&&nativeEvent.stopPropagation()}else dispatchEventForPluginEventSystem(domEventName,eventSystemFlags,nativeEvent,null,targetContainer)}}__name(dispatchEvent,"dispatchEvent");function findInstanceBlockingEvent(nativeEvent){return nativeEvent=getEventTarget2(nativeEvent),findInstanceBlockingTarget(nativeEvent)}__name(findInstanceBlockingEvent,"findInstanceBlockingEvent");var return_targetInst=null;function findInstanceBlockingTarget(targetNode){if(return_targetInst=null,targetNode=getClosestInstanceFromNode(targetNode),targetNode!==null){var nearestMounted=getNearestMountedFiber(targetNode);if(nearestMounted===null)targetNode=null;else{var tag=nearestMounted.tag;if(tag===13){if(targetNode=getSuspenseInstanceFromFiber(nearestMounted),targetNode!==null)return targetNode;targetNode=null}else if(tag===31){if(targetNode=getActivityInstanceFromFiber(nearestMounted),targetNode!==null)return targetNode;targetNode=null}else if(tag===3){if(nearestMounted.stateNode.current.memoizedState.isDehydrated)return nearestMounted.tag===3?nearestMounted.stateNode.containerInfo:null;targetNode=null}else nearestMounted!==targetNode&&(targetNode=null)}}return return_targetInst=targetNode,null}__name(findInstanceBlockingTarget,"findInstanceBlockingTarget");function getEventPriority(domEventName){switch(domEventName){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(getCurrentPriorityLevel()){case ImmediatePriority:return 2;case UserBlockingPriority:return 8;case NormalPriority$1:case LowPriority:return 32;case IdlePriority:return 268435456;default:return 32}default:return 32}}__name(getEventPriority,"getEventPriority");var hasScheduledReplayAttempt=!1,queuedFocus=null,queuedDrag=null,queuedMouse=null,queuedPointers=new Map,queuedPointerCaptures=new Map,queuedExplicitHydrationTargets=[],discreteReplayableEvents="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function clearIfContinuousEvent(domEventName,nativeEvent){switch(domEventName){case"focusin":case"focusout":queuedFocus=null;break;case"dragenter":case"dragleave":queuedDrag=null;break;case"mouseover":case"mouseout":queuedMouse=null;break;case"pointerover":case"pointerout":queuedPointers.delete(nativeEvent.pointerId);break;case"gotpointercapture":case"lostpointercapture":queuedPointerCaptures.delete(nativeEvent.pointerId)}}__name(clearIfContinuousEvent,"clearIfContinuousEvent");function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent,blockedOn,domEventName,eventSystemFlags,targetContainer,nativeEvent){return existingQueuedEvent===null||existingQueuedEvent.nativeEvent!==nativeEvent?(existingQueuedEvent={blockedOn,domEventName,eventSystemFlags,nativeEvent,targetContainers:[targetContainer]},blockedOn!==null&&(blockedOn=getInstanceFromNode(blockedOn),blockedOn!==null&&attemptContinuousHydration(blockedOn)),existingQueuedEvent):(existingQueuedEvent.eventSystemFlags|=eventSystemFlags,blockedOn=existingQueuedEvent.targetContainers,targetContainer!==null&&blockedOn.indexOf(targetContainer)===-1&&blockedOn.push(targetContainer),existingQueuedEvent)}__name(accumulateOrCreateContinuousQueuedReplayableEvent,"accumulateOrCreateContinuousQueuedReplayableEvent");function queueIfContinuousEvent(blockedOn,domEventName,eventSystemFlags,targetContainer,nativeEvent){switch(domEventName){case"focusin":return queuedFocus=accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus,blockedOn,domEventName,eventSystemFlags,targetContainer,nativeEvent),!0;case"dragenter":return queuedDrag=accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag,blockedOn,domEventName,eventSystemFlags,targetContainer,nativeEvent),!0;case"mouseover":return queuedMouse=accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse,blockedOn,domEventName,eventSystemFlags,targetContainer,nativeEvent),!0;case"pointerover":var pointerId=nativeEvent.pointerId;return queuedPointers.set(pointerId,accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId)||null,blockedOn,domEventName,eventSystemFlags,targetContainer,nativeEvent)),!0;case"gotpointercapture":return pointerId=nativeEvent.pointerId,queuedPointerCaptures.set(pointerId,accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(pointerId)||null,blockedOn,domEventName,eventSystemFlags,targetContainer,nativeEvent)),!0}return!1}__name(queueIfContinuousEvent,"queueIfContinuousEvent");function attemptExplicitHydrationTarget(queuedTarget){var targetInst=getClosestInstanceFromNode(queuedTarget.target);if(targetInst!==null){var nearestMounted=getNearestMountedFiber(targetInst);if(nearestMounted!==null){if(targetInst=nearestMounted.tag,targetInst===13){if(targetInst=getSuspenseInstanceFromFiber(nearestMounted),targetInst!==null){queuedTarget.blockedOn=targetInst,runWithPriority(queuedTarget.priority,function(){attemptHydrationAtCurrentPriority(nearestMounted)});return}}else if(targetInst===31){if(targetInst=getActivityInstanceFromFiber(nearestMounted),targetInst!==null){queuedTarget.blockedOn=targetInst,runWithPriority(queuedTarget.priority,function(){attemptHydrationAtCurrentPriority(nearestMounted)});return}}else if(targetInst===3&&nearestMounted.stateNode.current.memoizedState.isDehydrated){queuedTarget.blockedOn=nearestMounted.tag===3?nearestMounted.stateNode.containerInfo:null;return}}}queuedTarget.blockedOn=null}__name(attemptExplicitHydrationTarget,"attemptExplicitHydrationTarget");function attemptReplayContinuousQueuedEvent(queuedEvent){if(queuedEvent.blockedOn!==null)return!1;for(var targetContainers=queuedEvent.targetContainers;0<targetContainers.length;){var nextBlockedOn=findInstanceBlockingEvent(queuedEvent.nativeEvent);if(nextBlockedOn===null){nextBlockedOn=queuedEvent.nativeEvent;var nativeEventClone=new nextBlockedOn.constructor(nextBlockedOn.type,nextBlockedOn);currentReplayingEvent=nativeEventClone,nextBlockedOn.target.dispatchEvent(nativeEventClone),currentReplayingEvent=null}else return targetContainers=getInstanceFromNode(nextBlockedOn),targetContainers!==null&&attemptContinuousHydration(targetContainers),queuedEvent.blockedOn=nextBlockedOn,!1;targetContainers.shift()}return!0}__name(attemptReplayContinuousQueuedEvent,"attemptReplayContinuousQueuedEvent");function attemptReplayContinuousQueuedEventInMap(queuedEvent,key,map2){attemptReplayContinuousQueuedEvent(queuedEvent)&&map2.delete(key)}__name(attemptReplayContinuousQueuedEventInMap,"attemptReplayContinuousQueuedEventInMap");function replayUnblockedEvents(){hasScheduledReplayAttempt=!1,queuedFocus!==null&&attemptReplayContinuousQueuedEvent(queuedFocus)&&(queuedFocus=null),queuedDrag!==null&&attemptReplayContinuousQueuedEvent(queuedDrag)&&(queuedDrag=null),queuedMouse!==null&&attemptReplayContinuousQueuedEvent(queuedMouse)&&(queuedMouse=null),queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap),queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap)}__name(replayUnblockedEvents,"replayUnblockedEvents");function scheduleCallbackIfUnblocked(queuedEvent,unblocked){queuedEvent.blockedOn===unblocked&&(queuedEvent.blockedOn=null,hasScheduledReplayAttempt||(hasScheduledReplayAttempt=!0,Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority,replayUnblockedEvents)))}__name(scheduleCallbackIfUnblocked,"scheduleCallbackIfUnblocked");var lastScheduledReplayQueue=null;function scheduleReplayQueueIfNeeded(formReplayingQueue){lastScheduledReplayQueue!==formReplayingQueue&&(lastScheduledReplayQueue=formReplayingQueue,Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority,function(){lastScheduledReplayQueue===formReplayingQueue&&(lastScheduledReplayQueue=null);for(var i2=0;i2<formReplayingQueue.length;i2+=3){var form=formReplayingQueue[i2],submitterOrAction=formReplayingQueue[i2+1],formData=formReplayingQueue[i2+2];if(typeof submitterOrAction!="function"){if(findInstanceBlockingTarget(submitterOrAction||form)===null)continue;break}var formInst=getInstanceFromNode(form);formInst!==null&&(formReplayingQueue.splice(i2,3),i2-=3,startHostTransition(formInst,{pending:!0,data:formData,method:form.method,action:submitterOrAction},submitterOrAction,formData))}}))}__name(scheduleReplayQueueIfNeeded,"scheduleReplayQueueIfNeeded");function retryIfBlockedOn(unblocked){function unblock(queuedEvent){return scheduleCallbackIfUnblocked(queuedEvent,unblocked)}__name(unblock,"unblock"),queuedFocus!==null&&scheduleCallbackIfUnblocked(queuedFocus,unblocked),queuedDrag!==null&&scheduleCallbackIfUnblocked(queuedDrag,unblocked),queuedMouse!==null&&scheduleCallbackIfUnblocked(queuedMouse,unblocked),queuedPointers.forEach(unblock),queuedPointerCaptures.forEach(unblock);for(var i2=0;i2<queuedExplicitHydrationTargets.length;i2++){var queuedTarget=queuedExplicitHydrationTargets[i2];queuedTarget.blockedOn===unblocked&&(queuedTarget.blockedOn=null)}for(;0<queuedExplicitHydrationTargets.length&&(i2=queuedExplicitHydrationTargets[0],i2.blockedOn===null);)attemptExplicitHydrationTarget(i2),i2.blockedOn===null&&queuedExplicitHydrationTargets.shift();if(i2=(unblocked.ownerDocument||unblocked).$$reactFormReplay,i2!=null)for(queuedTarget=0;queuedTarget<i2.length;queuedTarget+=3){var form=i2[queuedTarget],submitterOrAction=i2[queuedTarget+1],formProps=form[internalPropsKey]||null;if(typeof submitterOrAction=="function")formProps||scheduleReplayQueueIfNeeded(i2);else if(formProps){var action=null;if(submitterOrAction&&submitterOrAction.hasAttribute("formAction")){if(form=submitterOrAction,formProps=submitterOrAction[internalPropsKey]||null)action=formProps.formAction;else if(findInstanceBlockingTarget(form)!==null)continue}else action=formProps.action;typeof action=="function"?i2[queuedTarget+1]=action:(i2.splice(queuedTarget,3),queuedTarget-=3),scheduleReplayQueueIfNeeded(i2)}}}__name(retryIfBlockedOn,"retryIfBlockedOn");function defaultOnDefaultTransitionIndicator(){function handleNavigate(event){event.canIntercept&&event.info==="react-transition"&&event.intercept({handler:__name(function(){return new Promise(function(resolve){return pendingResolve=resolve})},"handler"),focusReset:"manual",scroll:"manual"})}__name(handleNavigate,"handleNavigate");function handleNavigateComplete(){pendingResolve!==null&&(pendingResolve(),pendingResolve=null),isCancelled||setTimeout(startFakeNavigation,20)}__name(handleNavigateComplete,"handleNavigateComplete");function startFakeNavigation(){if(!isCancelled&&!navigation.transition){var currentEntry=navigation.currentEntry;currentEntry&¤tEntry.url!=null&&navigation.navigate(currentEntry.url,{state:currentEntry.getState(),info:"react-transition",history:"replace"})}}if(__name(startFakeNavigation,"startFakeNavigation"),typeof navigation=="object"){var isCancelled=!1,pendingResolve=null;return navigation.addEventListener("navigate",handleNavigate),navigation.addEventListener("navigatesuccess",handleNavigateComplete),navigation.addEventListener("navigateerror",handleNavigateComplete),setTimeout(startFakeNavigation,100),function(){isCancelled=!0,navigation.removeEventListener("navigate",handleNavigate),navigation.removeEventListener("navigatesuccess",handleNavigateComplete),navigation.removeEventListener("navigateerror",handleNavigateComplete),pendingResolve!==null&&(pendingResolve(),pendingResolve=null)}}}__name(defaultOnDefaultTransitionIndicator,"defaultOnDefaultTransitionIndicator");function ReactDOMRoot(internalRoot){this._internalRoot=internalRoot}__name(ReactDOMRoot,"ReactDOMRoot"),ReactDOMHydrationRoot.prototype.render=ReactDOMRoot.prototype.render=function(children){var root3=this._internalRoot;if(root3===null)throw Error(formatProdErrorMessage(409));var current=root3.current,lane=requestUpdateLane();updateContainerImpl(current,lane,children,root3,null,null)},ReactDOMHydrationRoot.prototype.unmount=ReactDOMRoot.prototype.unmount=function(){var root3=this._internalRoot;if(root3!==null){this._internalRoot=null;var container=root3.containerInfo;updateContainerImpl(root3.current,2,null,root3,null,null),flushSyncWork$1(),container[internalContainerInstanceKey]=null}};function ReactDOMHydrationRoot(internalRoot){this._internalRoot=internalRoot}__name(ReactDOMHydrationRoot,"ReactDOMHydrationRoot"),ReactDOMHydrationRoot.prototype.unstable_scheduleHydration=function(target){if(target){var updatePriority=resolveUpdatePriority();target={blockedOn:null,target,priority:updatePriority};for(var i2=0;i2<queuedExplicitHydrationTargets.length&&updatePriority!==0&&updatePriority<queuedExplicitHydrationTargets[i2].priority;i2++);queuedExplicitHydrationTargets.splice(i2,0,target),i2===0&&attemptExplicitHydrationTarget(target)}};var isomorphicReactPackageVersion$jscomp$inline_1840=React2.version;if(isomorphicReactPackageVersion$jscomp$inline_1840!=="19.2.4")throw Error(formatProdErrorMessage(527,isomorphicReactPackageVersion$jscomp$inline_1840,"19.2.4"));ReactDOMSharedInternals.findDOMNode=function(componentOrElement){var fiber=componentOrElement._reactInternals;if(fiber===void 0)throw typeof componentOrElement.render=="function"?Error(formatProdErrorMessage(188)):(componentOrElement=Object.keys(componentOrElement).join(","),Error(formatProdErrorMessage(268,componentOrElement)));return componentOrElement=findCurrentFiberUsingSlowPath(fiber),componentOrElement=componentOrElement!==null?findCurrentHostFiberImpl(componentOrElement):null,componentOrElement=componentOrElement===null?null:componentOrElement.stateNode,componentOrElement};var internals$jscomp$inline_2347={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:ReactSharedInternals,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hook$jscomp$inline_2348=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hook$jscomp$inline_2348.isDisabled&&hook$jscomp$inline_2348.supportsFiber)try{rendererID=hook$jscomp$inline_2348.inject(internals$jscomp$inline_2347),injectedHook=hook$jscomp$inline_2348}catch{}}return reactDomClient_production.createRoot=function(container,options2){if(!isValidContainer(container))throw Error(formatProdErrorMessage(299));var isStrictMode=!1,identifierPrefix="",onUncaughtError=defaultOnUncaughtError,onCaughtError=defaultOnCaughtError,onRecoverableError=defaultOnRecoverableError;return options2!=null&&(options2.unstable_strictMode===!0&&(isStrictMode=!0),options2.identifierPrefix!==void 0&&(identifierPrefix=options2.identifierPrefix),options2.onUncaughtError!==void 0&&(onUncaughtError=options2.onUncaughtError),options2.onCaughtError!==void 0&&(onCaughtError=options2.onCaughtError),options2.onRecoverableError!==void 0&&(onRecoverableError=options2.onRecoverableError)),options2=createFiberRoot(container,1,!1,null,null,isStrictMode,identifierPrefix,null,onUncaughtError,onCaughtError,onRecoverableError,defaultOnDefaultTransitionIndicator),container[internalContainerInstanceKey]=options2.current,listenToAllSupportedEvents(container),new ReactDOMRoot(options2)},reactDomClient_production.hydrateRoot=function(container,initialChildren,options2){if(!isValidContainer(container))throw Error(formatProdErrorMessage(299));var isStrictMode=!1,identifierPrefix="",onUncaughtError=defaultOnUncaughtError,onCaughtError=defaultOnCaughtError,onRecoverableError=defaultOnRecoverableError,formState=null;return options2!=null&&(options2.unstable_strictMode===!0&&(isStrictMode=!0),options2.identifierPrefix!==void 0&&(identifierPrefix=options2.identifierPrefix),options2.onUncaughtError!==void 0&&(onUncaughtError=options2.onUncaughtError),options2.onCaughtError!==void 0&&(onCaughtError=options2.onCaughtError),options2.onRecoverableError!==void 0&&(onRecoverableError=options2.onRecoverableError),options2.formState!==void 0&&(formState=options2.formState)),initialChildren=createFiberRoot(container,1,!0,initialChildren,options2??null,isStrictMode,identifierPrefix,formState,onUncaughtError,onCaughtError,onRecoverableError,defaultOnDefaultTransitionIndicator),initialChildren.context=getContextForSubtree(null),options2=initialChildren.current,isStrictMode=requestUpdateLane(),isStrictMode=getBumpedLaneForHydrationByLane(isStrictMode),identifierPrefix=createUpdate(isStrictMode),identifierPrefix.callback=null,enqueueUpdate(options2,identifierPrefix,isStrictMode),options2=isStrictMode,initialChildren.current.lanes=options2,markRootUpdated$1(initialChildren,options2),ensureRootIsScheduled(initialChildren),container[internalContainerInstanceKey]=initialChildren.current,listenToAllSupportedEvents(container),new ReactDOMHydrationRoot(initialChildren)},reactDomClient_production.version="19.2.4",reactDomClient_production}__name(requireReactDomClient_production,"requireReactDomClient_production");var hasRequiredClient;function requireClient(){if(hasRequiredClient)return client.exports;hasRequiredClient=1;function checkDCE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(err){console.error(err)}}return __name(checkDCE,"checkDCE"),checkDCE(),client.exports=requireReactDomClient_production(),client.exports}__name(requireClient,"requireClient");var clientExports=requireClient();clientExports.createRoot(document.getElementById("root"),{onUncaughtError:__name((error2,errorInfo)=>{addReactError(),console.error("Uncaught error:",error2,errorInfo)},"onUncaughtError"),onCaughtError:__name((error2,errorInfo)=>{addReactError(),console.error("Caught error:",error2,errorInfo)},"onCaughtError"),onRecoverableError:__name((error2,errorInfo)=>{addReactError(),console.warn("Recoverable error:",error2,errorInfo)},"onRecoverableError")}).render(jsxRuntimeExports.jsx(reactExports.StrictMode,{children:jsxRuntimeExports.jsx(App,{})}));export{useMutation as $,initViewportObservable as A,noop$2 as B,CENSORED_STRING_MARK as C,instrumentMethod as D,ExperimentalFeature as E,ActionType as F,instrumentSetter as G,requestIdleCallback as H,getMutationObserverConstructor as I,monitor as J,sendToExtension as K,addRecord as L,getSegmentsCount as M,NodePrivacyLevel as N,addSegment as O,PRIVACY_ATTR_VALUE_HIDDEN as P,addWroteData as Q,RumEventType as R,isPageExitReason as S,clearTimeout$1 as T,setTimeout$1 as U,ONE_SECOND as V,addTelemetryMetrics as W,getEventBridge as X,createHttpRequest as Y,canUseEventBridge as Z,addTelemetryDebug as _,shouldMaskAttribute as a,Loading as a$,apiClient as a0,object as a1,string$3 as a2,useRouter as a3,useNavigate as a4,useCloudAuth as a5,useForm as a6,a as a7,reactExports as a8,authStore as a9,clocksOrigin as aA,monitorError as aB,useInstanceClientIdParams as aC,useQueryClient as aD,ProgressBar as aE,getClusterInfo as aF,getInstanceClient as aG,getOperationsUrlForInstance as aH,getInstanceUserInfo as aI,restartInstance as aJ,sleep$1 as aK,pluralize as aL,excludeFalsy as aM,queryOptions as aN,getDefaultExportFromCjs as aO,commonjsGlobal as aP,requireReact as aQ,React as aR,__extends as aS,__assign$b as aT,q as aU,ye as aV,useParams as aW,useQuery as aX,getConfigurationQueryOptions as aY,getRegistrationInfoQueryOptions as aZ,useEntityRestURL as a_,OverallAppSignIn as aa,toast as ab,logoutOnSuccess as ac,jsxRuntimeExports as ad,Form as ae,FormField as af,FormItem as ag,FormLabel as ah,FormControl as ai,Input as aj,FormMessage as ak,Button as al,Save as am,jsonStringify as an,objectEntries as ao,buildTags as ap,currentDrift as aq,createValueHistory as ar,RumPerformanceEntryType as as,RumLongTaskEntryType as at,addDuration as au,SESSION_TIME_OUT_DELAY as av,mockable as aw,getGlobalObject as ax,display as ay,clocksNow as az,buildUrl as b,wasAReleasedBeforeB as b0,ErrorComponent as b1,Plus as b2,createLazyRoute as b3,translateSecondsToAgo as b4,humanFileSize as b5,cn$1 as b6,clsx as b7,withSelectorExports as b8,reactDomExports as b9,React$1 as ba,determineUnits as bb,scaleValueToUnits as bc,Label$2 as bd,Select as be,SelectTrigger as bf,SelectValue as bg,SelectContent as bh,SelectGroup as bi,SelectItem as bj,useSuspenseQuery as bk,TextLoadingSkeleton as bl,CENSORED_IMG_MARK as c,sanitizeIfLongDataUrl as d,getNodeSelfPrivacyLevel as e,PRIVACY_ATTR_NAME as f,getTextContent as g,hasChildNodes as h,isSafari as i,isNodeShadowRoot as j,forEachChildNodes as k,elapsed as l,getScrollY as m,getScrollX as n,isElementNode as o,getNodePrivacyLevel as p,getParentNode$1 as q,reducePrivacyLevel as r,shouldMaskNode as s,timeStampNow as t,isNodeShadowHost as u,isExperimentalFeatureEnabled as v,getViewportDimension as w,throttle as x,addEventListeners as y,addEventListener as z};
|
|
235
|
-
//# sourceMappingURL=index-
|
|
235
|
+
//# sourceMappingURL=index-BpmqvC1O.js.map
|