momentic 1.0.87 → 1.0.88
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/bin/cli.js
CHANGED
|
@@ -2985,7 +2985,7 @@ ${i.stack}`),a.status(500).send("Internal Server Error")}),n){let i=ES.static(n)
|
|
|
2985
2985
|
|
|
2986
2986
|
Using Command Prompt on Windows:
|
|
2987
2987
|
for /f "tokens=5" %a in ('netstat -ano ^| findstr :58888') do taskkill /PID %a /F
|
|
2988
|
-
`)}import SL from"events";import Rb from"fs";import bL from"open";import il from"path";import{fileURLToPath as wL}from"url";import RP from"diff-lines";import{gt as IP}from"semver";import{execSync as dP}from"child_process";import{platform as pP}from"os";function Jd(){return IS()?(b.info("Setting device pixel ratio to 2 automatically since a Mac OS Retina screen was detected."),b.info("If you are using a low pixel-density monitor, you should manually set --pixel-ratio to 1 to avoid incorrect viewport calculations."),b.info("Confirm your device's pixel-ratio at https://www.mydevice.io."),2):(b.info("Setting device pixel ratio to 1."),b.info("If you are using Momentic on a high-pixel density (HiDPI) monitor, relaunch with the --pixel-ratio option to avoid incorrect viewport calculations"),b.info("Confirm your device's pixel-ratio at https://www.mydevice.io."),1)}function IS(){return pP()==="darwin"&&dP("system_profiler SPDisplaysDataType").toString().includes("Retina")}function Xd(n){IS()&&n===1&&(b.warn("If you are using Momentic on a Retina screen, relaunch with the --pixel-ratio option to avoid incorrect viewport calculations."),b.warn("Confirm your device's pixel-ratio at https://www.mydevice.io."))}import uP from"@actions/exec";import mP from"@actions/io";import hP from"quote";import fP from"string-argv";async function PS(n,e=!0){let t=fP(n),r=await mP.which(t[0],!0),o=t.slice(1),i=uP.exec(hP(r),o,{delay:100});if(e)return i}import{existsSync as gP,statSync as yP}from"fs";var Ha=!!process.env.CI||!process.stdout.isTTY||!!process.env.TF_BUILD;function Vi(n){try{return gP(n)&&yP(n).isDirectory()}catch(e){return b.error({err:e},`Error reading path ${n} during directory existence check`),!1}}import SP from"csv-parser";import{createReadStream as bP}from"fs";function Zd(n){return new Promise((e,t)=>{let r=[];bP(n).pipe(SP()).on("data",o=>r.push(o)).on("end",()=>e(r)).on("error",o=>t(o))})}import Wa from"semver";import{z as Ga}from"zod";var ko="1.0.87",wP="https://registry.npmjs.org/momentic",vP=Ga.object({versions:Ga.record(Ga.string(),Ga.unknown()).optional()});async function LS(n){if(!ko){n.warn("Unable to check CLI version because CLI_VERSION is not set");return}let e;for(let r=0;r<2;r++)try{let o=await U(fetch(wP),{milliseconds:2e3});if(!o.ok)throw new Error(`Got error status code ${o.statusText}`);let i=await o.json();e=vP.parse(i).versions;break}catch(o){n.warn({err:o},"Failed to fetch npm registry data")}if(!e){n.warn("Failed to fetch npm registry data. Skipping version check.");return}let t;for(let r of Object.keys(e))Wa.valid(r)&&(!t||Wa.gt(r,t))&&Wa.gt(r,ko)&&Wa.lt(r,"2.0.0")&&!r.includes("alpha")&&(t=r);t&&(b.warn(`Update available: v${ko} -> v${t}`),b.warn("This version may be missing critical fixes, features, and security updates."),b.warn(`Run "npx momentic@${t} -V" to update`))}import{existsSync as TP,mkdirSync as EP,statSync as CP}from"fs";import{dirname as AP}from"path";import kS from"readline/promises";import{hostname as xP}from"os";var j=Fa({app:"cli",clientToken:"pub7eb923f18fb3f1d42ac5eba8c5ea13a5",hostname:xP(),disableConsoleLogs:!0}).child({version:"1.0.87"});var Qd=!1,_S=(()=>{try{return CP("/.dockerenv"),!0}catch{return!1}})();async function rt(n,e){if(Ha||Qd||_S)return!0;j.flush(),await new Promise(s=>setTimeout(s,500));let t=kS.createInterface({input:process.stdin,output:process.stdout}),r=n.split("."),o;if(r.length===1)o=n;else{let s=`${r.slice(0,r.length-1).join(".").trim()}.`;e?b.warn(s):b.log(s),o=r[r.length-1].trim()}let i=await t.question(`${o} ('y' for yes / n for no / 'A' to accept all) `);return t.close(),i==="A"?(Qd=!0,setTimeout(()=>{Qd=!1},3e3),!0):i.toLowerCase()==="y"}async function ep(n){let e=AP(n);return Vi(e)?TP(n)?rt(`File '${OS(n)}' already exists. Overwrite existing content?`,!0):!0:await rt(`Directory '${OS(e)}' doesn't exist. Create it now?`,!0)?(EP(e,{recursive:!0}),!0):!1}function OS(n){return n.replace(/(\s+)/g,"\\$1")}async function NS(n,e){if(Ha||_S)return e;let t=kS.createInterface({input:process.stdin,output:process.stdout}),r=await t.question(`${n} `);return t.close(),r.trim()||e}async function MS({test:n,fragment:e,entities:t,client:r,logger:o,yes:i}){IP(e.schemaVersion,ut)&&(b.error(`This version of the CLI does not support the schema version of the fragment (${e.schemaVersion}). Please update to the latest version of the CLI and retry this command.`),process.exit(1)),eh(e.steps).forEach(f=>{t.modules[f]||(b.error(`The test patch contains a module with id ${f} that could not be found in the current project. This suggests that either this test patch or your local file system may be out of date.`),process.exit(1))}),e.createdAt.getTime()<Date.now()-7*24*60*60*1e3&&!i&&!await rt("The test patch you are applying is more than 7 days old. Are you sure you want to continue?",!0)&&process.exit(1);let a=n.lastModified.getTime();e.createdAt.getTime()+60*60*1e3<a&&!i&&!await rt("The test patch you are applying was created before the test was last updated. Are you sure you want to continue?",!0)&&process.exit(1);let l=ud(n.fullFilePath,o,t),c=l.steps;if(!Array.isArray(c))throw new Error(`Test ${n.fullFilePath} is missing steps array`);let d,p;if(e.schemaVersion!==ut){let{steps:f,newVersion:g}=await gi({metadata:{id:e.id,schemaVersion:e.schemaVersion},steps:e.steps,logger:b});d=g,p=Re.array().parse(f)}else p=Re.array().parse(e.steps);let{stepsToSave:u,moduleUpdates:m}=await It({stepLists:{steps:p}});u.beforeSteps=l.beforeSteps??void 0,u.afterSteps=l.afterSteps??void 0;let h=RP(JSON.stringify(c,void 0,2),JSON.stringify(u,void 0,2),{n_surrounding:5});b.dimmed("=".repeat(30)),b.dimmed(h),b.dimmed("=".repeat(30)),b.dimmed(""),d&&b.warn(`If this patch is applied, your test will also be automatically upgraded to the latest schema version (${d}). Schema upgrades have no impact on functionality, although you may notice minor differences in the test YAML.`),!i&&!await rt("Do you want to apply this patch?")&&(b.dimmed("Cancelled."),process.exit(1)),Ci(n.relativePath,u,d??e.schemaVersion,t.project),b.success("Patch applied successfully."),await r.patchTestFragment(e.id,{applied:!0,appliedAt:new Date})}import{cloneDeep as PP}from"lodash-es";async function Va({client:n,skipPrompts:e,project:t}){let r=await n.getAllEnvironments(),o=PP(t.config);o.environments||(o.environments=[]);for(let i of r){let s=o.environments?.find(a=>a.name===i.name);if(s)!e&&!await rt(`Environment ${i.name} already exists in the project configuration file. Would you like to overwrite its variables?`)&&process.exit(1),s.baseUrl=i.variables[ve],delete i.variables[ve],s.envVariables=i.variables;else{let a=i.variables[ve];delete i.variables[ve],o.environments.push({name:i.name,baseUrl:a,envVariables:i.variables})}}Ao(o,t.configFilePath),b.success(`Pulled ${r.length} environments successfully! Please make sure to commit any changes to your project configuration file.`)}import{createHash as DS}from"crypto";import FS from"fs";async function zS({testsToFetch:n,client:e,all:t,yes:r}){let{tests:o,modules:i}=await e.getTestYAMLExport({paths:n,all:t}),s=0;for(let[l,c]of Object.entries(o)){let d=US(l,xe.TEST);!r&&!await ep(d)||(s+=1,FS.writeFileSync(d,c,"utf-8"),j.info({checksum:DS("md5").update(c).digest("hex")},`Wrote '${d}'`))}let a=0;for(let[l,c]of Object.entries(i)){let d=US(l,xe.MODULE);!r&&!await ep(d)||(a+=1,FS.writeFileSync(d,c,"utf-8"),j.info({checksum:DS("md5").update(c).digest("hex")},`Wrote '${d}'`))}s===0?b.success("Pulled 0 tests."):b.success(`Pulled ${s} test${s>1?"s":""}${a?` and ${a} module${a>1?"s":""}`:""}!`)}function US(n,e){switch(e){case xe.TEST:return`${Pe(n)}.${En.TEST}`;case xe.MODULE:return`${Pe(n)}.${En.MODULE}`;default:throw new Error(`Unknown entity type ${e}`)}}async function BS(n){let{project:e,client:t,skipPrompts:r}=n;b.info("Welcome to the Momentic Cloud importer wizard! \u{1F636}\u200D\u{1F32B}\uFE0F"),b.info("Importing environments from Momentic Cloud."),b.info(`This command will overwrite all local environment configuration in ${e.configFilePath} with environments from Momentic Cloud.`),await rt("Are you sure you want to proceed?",!0)||(b.info("Aborting..."),process.exit(1)),await Va({client:t,project:e,skipPrompts:r}),b.success(`Successfully imported environments from Momentic Cloud. We recommend pulling secrets out of ${e.configFilePath} into .env files or dynamically set environment variables for security.`),b.info("Importing tests and modules from Momentic Cloud."),await zS({testsToFetch:[],client:t,all:!0,yes:r}),b.success("Successfully imported tests and modules from Momentic Cloud. You can move them to the desired location in your project. We recommend committing these files to version control so you can share them with team members and run Momentic tests in CI.")}import kt from"fs";import Pr from"path";import LP from"yaml";function jS(){Vi("momentic")||(b.error(`The migration command should be ran from the v0 root Momentic directory, which should contain a folder called 'momentic'. No folder named 'momentic' was found in the current working directory (${process.cwd()}).`),process.exit(1));let n={name:"default",include:Hi,environments:[]};b.info("Migrating environments");let e=$S(["momentic/environments"],OP);for(let r of e){let o=LP.parse(kt.readFileSync(r,"utf-8"));try{let i=hs.parse(o),s=i.variables[ve]??"";delete i.variables[ve],n.environments?.push({name:i.name,baseUrl:s,envVariables:i.variables})}catch(i){b.error(`${r} failed to parse as a valid environment file.`),b.error(i),process.exit(1)}}b.info("Migrating tests");let t=pd("./momentic",b);for(let r of t){let o=Pr.join(...r.fullPathSegments),i=Pr.join(Pr.dirname(o),`${r.fileName.slice(0,-5)}.test.yaml`);b.info(`Moving test ${o} to ${i}`),kt.renameSync(o,i)}if(Vi("momentic/modules")){b.info("Migrating modules");for(let r of kt.readdirSync("./momentic/modules")){if(!r.endsWith(".yaml"))continue;let o=Pr.resolve(Pr.join("./momentic/modules",r));if(!kt.readFileSync(o,"utf-8").includes("schemaVersion")){b.warn(`Skipping file ${o} since it does not have valid Momentic module contents`);continue}let s=`${o.slice(0,-5)}.module.yaml`;b.info(`Moving module ${o} to ${s}`),kt.renameSync(o,s)}}return b.info("Writing new project configuration file"),Ao(n,"momentic.config.yaml"),kt.rmSync("./momentic/environments",{recursive:!0,force:!0}),kt.rmSync("./momentic/fixtures",{recursive:!0,force:!0}),b.success("Migration succeeded!"),b.info("Going forward:"),b.info(` - You can store test and module files anywhere under the project root (${process.cwd()})`),b.info(" - Environment details and other common options are tracked in the root momentic.config.yaml file"),n}function $S(n,e,t=new Set){for(let r of n){let o=Pr.resolve(r),i=!1;try{i=kt.existsSync(o)&&kt.statSync(o).isDirectory()}catch(s){b.error({err:s},`Error reading path ${o} during collect paths`)}if(o&&i){let s=kt.readdirSync(o).map(a=>Pr.join(o,a));$S(s,e,t);continue}if(o.endsWith(".yaml")){try{if(!kt.existsSync(o)||!kt.statSync(o).isFile()){b.warn(`File not found or unreadable: ${o}`);continue}}catch(s){b.error({err:s},`Error reading file ${o} during collect paths`);continue}if(!e(o))continue;t.add(o)}}return t}function OP(n){return n.endsWith(".yaml")?kt.readFileSync(n,"utf8").includes("momentic/environment")?!0:(b.warn(`Skipping YAML that is not a Momentic environment: ${n}`),!1):!1}import{Argument as qa,Option as Me}from"@commander-js/extra-typings";import{validateHeaderValue as kP}from"http";import{cpus as HS}from"os";import{parse as soe}from"yaml";import{z as $}from"zod";var Ka=58888,tp=30*60*1e3,Yn=new Me("--api-key <key>","API key for authentication. If not supplied, attempts to read the MOMENTIC_API_KEY env var."),Lr=new Me("--server <server>","Momentic server to use. Leave unchanged unless using Momentic on-premise."),Jn=new Me("-y, --yes","Skip all confirmation prompts."),np=new Me("-w, --wait","Wait for tests to finish running before exiting. Only applicable when running tests remotely").implies({remote:!0}),rp=new Me("--wait-timeout <waitTimeout>",`The maximum number of seconds to wait for tests to complete. Only applicable when the --wait option is specified. Defaults to ${tp/1e3} seconds.`),Ya=new Me("--custom-headers <customHeaders...>","Specify custom headers in the form HEADER=VALUE to be sent with each request during the test. Multiple entries can be provided."),op=new Me("--no-report","Skip reporting test results to Momentic Cloud when running with the --local flag.").implies({local:!0}),GS=new Me("--reporter <reporter>","Output report files in a standardized format to a local directory. See the --reporter-dir flag for information on the output directory.").choices(Object.values(As)),VS=new Me("--reporter-dir <reporterDir>","Output directory to store report files. Relative paths are resolved relative to the project root, which is defined by the detected momentic.config.yaml. Defaults to 'reports' if unset."),qS=new Me("--include <includePatterns...>","Only include tests that match the provided regex patterns. Multiple patterns can be provided. The patterns will be matched against the test file paths and the pattern only needs to match a part of the path for the test to be included."),KS=new Me("--exclude <excludePatterns...>","The inverted version of --include: a test that matches any of the provided exclusion patterns will be excluded from running."),ip=new Me("--pixel-ratio <pixelRatio>","Device pixel ratio of your screen or monitor. Mac OS Retina displays and machines marketed as 'HiDPI' should set this to 2. Visit https://www.mydevice.io/ to find your device's pixel ratio."),YS=new Me("--port <port>",`Port to run the app on. Defaults to ${Ka}.`),sp=new Me("--input-csv <inputCsv>","Path to a CSV file on disk where each row represents a set of inputs that will be made available to all tests that are ran. The first line of the CSV must be the input names."),Ja=new Me("--env <env>","Name of the environment to use when running tests."),Xa=new Me("--url-override <urlOverride>","Fully qualified url (e.g. https://www.google.com) to start all tests from. Overrides any default starting url set from the test or environment."),JS=new Me("--shard-index <shardIndex>","The index of the shard to run tests for. Defaults to 1.").default(1).argParser(n=>parseInt(n,10)),Or=new Me("-c, --config <configPath>","Absolute or relative path to a Momentic configuration file (*.momentic.config.yaml)"),ap=new Me("-f, --filter <filter>","Run tests within the project that has a name equal to the filter provided. This option cannot be used together with file path or directory arguments, but substring matches are allowed."),XS=new Me("--shard-count <shardCount>","The number of shards that tests are being run on. Defaults to 1.").default(1).argParser(n=>parseInt(n,10)),ZS=new qa("<tests...>",`One or more test paths to queue on Momentic Cloud.
|
|
2988
|
+
`)}import SL from"events";import Rb from"fs";import bL from"open";import il from"path";import{fileURLToPath as wL}from"url";import RP from"diff-lines";import{gt as IP}from"semver";import{execSync as dP}from"child_process";import{platform as pP}from"os";function Jd(){return IS()?(b.info("Setting device pixel ratio to 2 automatically since a Mac OS Retina screen was detected."),b.info("If you are using a low pixel-density monitor, you should manually set --pixel-ratio to 1 to avoid incorrect viewport calculations."),b.info("Confirm your device's pixel-ratio at https://www.mydevice.io."),2):(b.info("Setting device pixel ratio to 1."),b.info("If you are using Momentic on a high-pixel density (HiDPI) monitor, relaunch with the --pixel-ratio option to avoid incorrect viewport calculations"),b.info("Confirm your device's pixel-ratio at https://www.mydevice.io."),1)}function IS(){return pP()==="darwin"&&dP("system_profiler SPDisplaysDataType").toString().includes("Retina")}function Xd(n){IS()&&n===1&&(b.warn("If you are using Momentic on a Retina screen, relaunch with the --pixel-ratio option to avoid incorrect viewport calculations."),b.warn("Confirm your device's pixel-ratio at https://www.mydevice.io."))}import uP from"@actions/exec";import mP from"@actions/io";import hP from"quote";import fP from"string-argv";async function PS(n,e=!0){let t=fP(n),r=await mP.which(t[0],!0),o=t.slice(1),i=uP.exec(hP(r),o,{delay:100});if(e)return i}import{existsSync as gP,statSync as yP}from"fs";var Ha=!!process.env.CI||!process.stdout.isTTY||!!process.env.TF_BUILD;function Vi(n){try{return gP(n)&&yP(n).isDirectory()}catch(e){return b.error({err:e},`Error reading path ${n} during directory existence check`),!1}}import SP from"csv-parser";import{createReadStream as bP}from"fs";function Zd(n){return new Promise((e,t)=>{let r=[];bP(n).pipe(SP()).on("data",o=>r.push(o)).on("end",()=>e(r)).on("error",o=>t(o))})}import Wa from"semver";import{z as Ga}from"zod";var ko="1.0.88",wP="https://registry.npmjs.org/momentic",vP=Ga.object({versions:Ga.record(Ga.string(),Ga.unknown()).optional()});async function LS(n){if(!ko){n.warn("Unable to check CLI version because CLI_VERSION is not set");return}let e;for(let r=0;r<2;r++)try{let o=await U(fetch(wP),{milliseconds:2e3});if(!o.ok)throw new Error(`Got error status code ${o.statusText}`);let i=await o.json();e=vP.parse(i).versions;break}catch(o){n.warn({err:o},"Failed to fetch npm registry data")}if(!e){n.warn("Failed to fetch npm registry data. Skipping version check.");return}let t;for(let r of Object.keys(e))Wa.valid(r)&&(!t||Wa.gt(r,t))&&Wa.gt(r,ko)&&Wa.lt(r,"2.0.0")&&!r.includes("alpha")&&(t=r);t&&(b.warn(`Update available: v${ko} -> v${t}`),b.warn("This version may be missing critical fixes, features, and security updates."),b.warn(`Run "npx momentic@${t} -V" to update`))}import{existsSync as TP,mkdirSync as EP,statSync as CP}from"fs";import{dirname as AP}from"path";import kS from"readline/promises";import{hostname as xP}from"os";var j=Fa({app:"cli",clientToken:"pub7eb923f18fb3f1d42ac5eba8c5ea13a5",hostname:xP(),disableConsoleLogs:!0}).child({version:"1.0.88"});var Qd=!1,_S=(()=>{try{return CP("/.dockerenv"),!0}catch{return!1}})();async function rt(n,e){if(Ha||Qd||_S)return!0;j.flush(),await new Promise(s=>setTimeout(s,500));let t=kS.createInterface({input:process.stdin,output:process.stdout}),r=n.split("."),o;if(r.length===1)o=n;else{let s=`${r.slice(0,r.length-1).join(".").trim()}.`;e?b.warn(s):b.log(s),o=r[r.length-1].trim()}let i=await t.question(`${o} ('y' for yes / n for no / 'A' to accept all) `);return t.close(),i==="A"?(Qd=!0,setTimeout(()=>{Qd=!1},3e3),!0):i.toLowerCase()==="y"}async function ep(n){let e=AP(n);return Vi(e)?TP(n)?rt(`File '${OS(n)}' already exists. Overwrite existing content?`,!0):!0:await rt(`Directory '${OS(e)}' doesn't exist. Create it now?`,!0)?(EP(e,{recursive:!0}),!0):!1}function OS(n){return n.replace(/(\s+)/g,"\\$1")}async function NS(n,e){if(Ha||_S)return e;let t=kS.createInterface({input:process.stdin,output:process.stdout}),r=await t.question(`${n} `);return t.close(),r.trim()||e}async function MS({test:n,fragment:e,entities:t,client:r,logger:o,yes:i}){IP(e.schemaVersion,ut)&&(b.error(`This version of the CLI does not support the schema version of the fragment (${e.schemaVersion}). Please update to the latest version of the CLI and retry this command.`),process.exit(1)),eh(e.steps).forEach(f=>{t.modules[f]||(b.error(`The test patch contains a module with id ${f} that could not be found in the current project. This suggests that either this test patch or your local file system may be out of date.`),process.exit(1))}),e.createdAt.getTime()<Date.now()-7*24*60*60*1e3&&!i&&!await rt("The test patch you are applying is more than 7 days old. Are you sure you want to continue?",!0)&&process.exit(1);let a=n.lastModified.getTime();e.createdAt.getTime()+60*60*1e3<a&&!i&&!await rt("The test patch you are applying was created before the test was last updated. Are you sure you want to continue?",!0)&&process.exit(1);let l=ud(n.fullFilePath,o,t),c=l.steps;if(!Array.isArray(c))throw new Error(`Test ${n.fullFilePath} is missing steps array`);let d,p;if(e.schemaVersion!==ut){let{steps:f,newVersion:g}=await gi({metadata:{id:e.id,schemaVersion:e.schemaVersion},steps:e.steps,logger:b});d=g,p=Re.array().parse(f)}else p=Re.array().parse(e.steps);let{stepsToSave:u,moduleUpdates:m}=await It({stepLists:{steps:p}});u.beforeSteps=l.beforeSteps??void 0,u.afterSteps=l.afterSteps??void 0;let h=RP(JSON.stringify(c,void 0,2),JSON.stringify(u,void 0,2),{n_surrounding:5});b.dimmed("=".repeat(30)),b.dimmed(h),b.dimmed("=".repeat(30)),b.dimmed(""),d&&b.warn(`If this patch is applied, your test will also be automatically upgraded to the latest schema version (${d}). Schema upgrades have no impact on functionality, although you may notice minor differences in the test YAML.`),!i&&!await rt("Do you want to apply this patch?")&&(b.dimmed("Cancelled."),process.exit(1)),Ci(n.relativePath,u,d??e.schemaVersion,t.project),b.success("Patch applied successfully."),await r.patchTestFragment(e.id,{applied:!0,appliedAt:new Date})}import{cloneDeep as PP}from"lodash-es";async function Va({client:n,skipPrompts:e,project:t}){let r=await n.getAllEnvironments(),o=PP(t.config);o.environments||(o.environments=[]);for(let i of r){let s=o.environments?.find(a=>a.name===i.name);if(s)!e&&!await rt(`Environment ${i.name} already exists in the project configuration file. Would you like to overwrite its variables?`)&&process.exit(1),s.baseUrl=i.variables[ve],delete i.variables[ve],s.envVariables=i.variables;else{let a=i.variables[ve];delete i.variables[ve],o.environments.push({name:i.name,baseUrl:a,envVariables:i.variables})}}Ao(o,t.configFilePath),b.success(`Pulled ${r.length} environments successfully! Please make sure to commit any changes to your project configuration file.`)}import{createHash as DS}from"crypto";import FS from"fs";async function zS({testsToFetch:n,client:e,all:t,yes:r}){let{tests:o,modules:i}=await e.getTestYAMLExport({paths:n,all:t}),s=0;for(let[l,c]of Object.entries(o)){let d=US(l,xe.TEST);!r&&!await ep(d)||(s+=1,FS.writeFileSync(d,c,"utf-8"),j.info({checksum:DS("md5").update(c).digest("hex")},`Wrote '${d}'`))}let a=0;for(let[l,c]of Object.entries(i)){let d=US(l,xe.MODULE);!r&&!await ep(d)||(a+=1,FS.writeFileSync(d,c,"utf-8"),j.info({checksum:DS("md5").update(c).digest("hex")},`Wrote '${d}'`))}s===0?b.success("Pulled 0 tests."):b.success(`Pulled ${s} test${s>1?"s":""}${a?` and ${a} module${a>1?"s":""}`:""}!`)}function US(n,e){switch(e){case xe.TEST:return`${Pe(n)}.${En.TEST}`;case xe.MODULE:return`${Pe(n)}.${En.MODULE}`;default:throw new Error(`Unknown entity type ${e}`)}}async function BS(n){let{project:e,client:t,skipPrompts:r}=n;b.info("Welcome to the Momentic Cloud importer wizard! \u{1F636}\u200D\u{1F32B}\uFE0F"),b.info("Importing environments from Momentic Cloud."),b.info(`This command will overwrite all local environment configuration in ${e.configFilePath} with environments from Momentic Cloud.`),await rt("Are you sure you want to proceed?",!0)||(b.info("Aborting..."),process.exit(1)),await Va({client:t,project:e,skipPrompts:r}),b.success(`Successfully imported environments from Momentic Cloud. We recommend pulling secrets out of ${e.configFilePath} into .env files or dynamically set environment variables for security.`),b.info("Importing tests and modules from Momentic Cloud."),await zS({testsToFetch:[],client:t,all:!0,yes:r}),b.success("Successfully imported tests and modules from Momentic Cloud. You can move them to the desired location in your project. We recommend committing these files to version control so you can share them with team members and run Momentic tests in CI.")}import kt from"fs";import Pr from"path";import LP from"yaml";function jS(){Vi("momentic")||(b.error(`The migration command should be ran from the v0 root Momentic directory, which should contain a folder called 'momentic'. No folder named 'momentic' was found in the current working directory (${process.cwd()}).`),process.exit(1));let n={name:"default",include:Hi,environments:[]};b.info("Migrating environments");let e=$S(["momentic/environments"],OP);for(let r of e){let o=LP.parse(kt.readFileSync(r,"utf-8"));try{let i=hs.parse(o),s=i.variables[ve]??"";delete i.variables[ve],n.environments?.push({name:i.name,baseUrl:s,envVariables:i.variables})}catch(i){b.error(`${r} failed to parse as a valid environment file.`),b.error(i),process.exit(1)}}b.info("Migrating tests");let t=pd("./momentic",b);for(let r of t){let o=Pr.join(...r.fullPathSegments),i=Pr.join(Pr.dirname(o),`${r.fileName.slice(0,-5)}.test.yaml`);b.info(`Moving test ${o} to ${i}`),kt.renameSync(o,i)}if(Vi("momentic/modules")){b.info("Migrating modules");for(let r of kt.readdirSync("./momentic/modules")){if(!r.endsWith(".yaml"))continue;let o=Pr.resolve(Pr.join("./momentic/modules",r));if(!kt.readFileSync(o,"utf-8").includes("schemaVersion")){b.warn(`Skipping file ${o} since it does not have valid Momentic module contents`);continue}let s=`${o.slice(0,-5)}.module.yaml`;b.info(`Moving module ${o} to ${s}`),kt.renameSync(o,s)}}return b.info("Writing new project configuration file"),Ao(n,"momentic.config.yaml"),kt.rmSync("./momentic/environments",{recursive:!0,force:!0}),kt.rmSync("./momentic/fixtures",{recursive:!0,force:!0}),b.success("Migration succeeded!"),b.info("Going forward:"),b.info(` - You can store test and module files anywhere under the project root (${process.cwd()})`),b.info(" - Environment details and other common options are tracked in the root momentic.config.yaml file"),n}function $S(n,e,t=new Set){for(let r of n){let o=Pr.resolve(r),i=!1;try{i=kt.existsSync(o)&&kt.statSync(o).isDirectory()}catch(s){b.error({err:s},`Error reading path ${o} during collect paths`)}if(o&&i){let s=kt.readdirSync(o).map(a=>Pr.join(o,a));$S(s,e,t);continue}if(o.endsWith(".yaml")){try{if(!kt.existsSync(o)||!kt.statSync(o).isFile()){b.warn(`File not found or unreadable: ${o}`);continue}}catch(s){b.error({err:s},`Error reading file ${o} during collect paths`);continue}if(!e(o))continue;t.add(o)}}return t}function OP(n){return n.endsWith(".yaml")?kt.readFileSync(n,"utf8").includes("momentic/environment")?!0:(b.warn(`Skipping YAML that is not a Momentic environment: ${n}`),!1):!1}import{Argument as qa,Option as Me}from"@commander-js/extra-typings";import{validateHeaderValue as kP}from"http";import{cpus as HS}from"os";import{parse as soe}from"yaml";import{z as $}from"zod";var Ka=58888,tp=30*60*1e3,Yn=new Me("--api-key <key>","API key for authentication. If not supplied, attempts to read the MOMENTIC_API_KEY env var."),Lr=new Me("--server <server>","Momentic server to use. Leave unchanged unless using Momentic on-premise."),Jn=new Me("-y, --yes","Skip all confirmation prompts."),np=new Me("-w, --wait","Wait for tests to finish running before exiting. Only applicable when running tests remotely").implies({remote:!0}),rp=new Me("--wait-timeout <waitTimeout>",`The maximum number of seconds to wait for tests to complete. Only applicable when the --wait option is specified. Defaults to ${tp/1e3} seconds.`),Ya=new Me("--custom-headers <customHeaders...>","Specify custom headers in the form HEADER=VALUE to be sent with each request during the test. Multiple entries can be provided."),op=new Me("--no-report","Skip reporting test results to Momentic Cloud when running with the --local flag.").implies({local:!0}),GS=new Me("--reporter <reporter>","Output report files in a standardized format to a local directory. See the --reporter-dir flag for information on the output directory.").choices(Object.values(As)),VS=new Me("--reporter-dir <reporterDir>","Output directory to store report files. Relative paths are resolved relative to the project root, which is defined by the detected momentic.config.yaml. Defaults to 'reports' if unset."),qS=new Me("--include <includePatterns...>","Only include tests that match the provided regex patterns. Multiple patterns can be provided. The patterns will be matched against the test file paths and the pattern only needs to match a part of the path for the test to be included."),KS=new Me("--exclude <excludePatterns...>","The inverted version of --include: a test that matches any of the provided exclusion patterns will be excluded from running."),ip=new Me("--pixel-ratio <pixelRatio>","Device pixel ratio of your screen or monitor. Mac OS Retina displays and machines marketed as 'HiDPI' should set this to 2. Visit https://www.mydevice.io/ to find your device's pixel ratio."),YS=new Me("--port <port>",`Port to run the app on. Defaults to ${Ka}.`),sp=new Me("--input-csv <inputCsv>","Path to a CSV file on disk where each row represents a set of inputs that will be made available to all tests that are ran. The first line of the CSV must be the input names."),Ja=new Me("--env <env>","Name of the environment to use when running tests."),Xa=new Me("--url-override <urlOverride>","Fully qualified url (e.g. https://www.google.com) to start all tests from. Overrides any default starting url set from the test or environment."),JS=new Me("--shard-index <shardIndex>","The index of the shard to run tests for. Defaults to 1.").default(1).argParser(n=>parseInt(n,10)),Or=new Me("-c, --config <configPath>","Absolute or relative path to a Momentic configuration file (*.momentic.config.yaml)"),ap=new Me("-f, --filter <filter>","Run tests within the project that has a name equal to the filter provided. This option cannot be used together with file path or directory arguments, but substring matches are allowed."),XS=new Me("--shard-count <shardCount>","The number of shards that tests are being run on. Defaults to 1.").default(1).argParser(n=>parseInt(n,10)),ZS=new qa("<tests...>",`One or more test paths to queue on Momentic Cloud.
|
|
2989
2989
|
|
|
2990
2990
|
A test path is a lowercased version of your test name where spaces are replaced with dashes: 'npx momentic@latest pull hello-world'.`),QS=new qa("<tests...>","One or more test file path or folders that exist on the local machine: 'npx momentic@latest run hello-world.test.yaml'.").argOptional(),eb=new qa("<suites...>",`One or more suite paths that exist on Momentic Cloud.
|
|
2991
2991
|
|
|
@@ -3000,6 +3000,6 @@ ${n.map(p=>` - ${p}`).join(`
|
|
|
3000
3000
|
${n.map(p=>` - ${p}`).join(`
|
|
3001
3001
|
`)}`),Object.values(e.tests).forEach(p=>{n.some(u=>p.relativePath.includes(u))&&a.add(p.fullFilePath)}))}else{!r&&!await rt("No test paths or substrings were provided. Do you want to run all tests?")&&(b.error("Cancelled by user."),process.exit(1));let c=Object.values(e.tests);b.info(`Reading all ${c.length} tests in the project from local disk.`),c.forEach(d=>{a.add(d.fullFilePath)})}for(let c of a){let d=hp.relative(t.rootDir,c);o&&!o.some(p=>new RegExp(p).test(d))&&a.delete(c),i&&i.some(p=>new RegExp(p).test(d))&&a.delete(c)}let l=Array.from(a).map(async c=>{try{let d=await ya(c,j,e);if(iL.gt(d.schemaVersion,ut)&&b.warn(`Test ${c} has schema version ${d.schemaVersion}, which is greater than what is currently supported by this SDK. Please update your momentic package version to avoid unexpected behavior.`),d.disabled)return null;if(s&&s.length>0){let p=d.labels||[];if(!s.some(m=>p.includes(m)))return null}return{...d,fullFilePath:c,relativeFilePath:hp.relative(t.rootDir,c)}}catch(d){b.error(`Failed to read and resolve test at '${c}': ${d}`),process.exit(1)}});return Promise.all(l).then(rL)}import{randomUUID as cL}from"crypto";import{cloneDeep as Tb}from"lodash-es";async function Sb({orgId:n,codeEvalTools:e,logger:t,outputDefinitions:r,testContext:o}){let i={};for(let s of r){let{name:a,value:l}=s;i[a]=await Pt({orgId:n,s:l,localTools:e,logger:t,context:o})}return i}async function bb({baseUrl:n,envName:e,devicePixelRatio:t,apiClient:r,test:o,storageClient:i,codeEvalTools:s,generator:a,orgId:l,variables:c,logger:d,customHeaders:p,testInputs:u,analytics:m,localBrowserConfig:h,visualDiffScreenshotStorage:f}){let g=await oa({advanced:{...h,...o.advanced},customHeaders:p,envVariables:c,envName:e,baseUrl:n,logger:d,localTools:s,orgId:l}),y=await so.init(l),v={baseUrl:r.baseUrl,apiKey:r.apiKey,logger:j};g.browserType==="Google Chrome"&&await kr(["chrome"]);let S;try{S=await en.init({baseUrl:n,logger:d,userBrowserSettings:g,storage:i,featureFlagStore:y,enricher:new Sr(v),timeout:g.pageLoadTimeoutMs,contextArgs:{viewport:o.advanced.viewport??Yt,deviceScaleFactor:t}})}catch(C){let P=C.message;if(P.includes("Executable doesn't exist")||P.includes("install your dependencies"))b.error("The headless browser used by Momentic is not installed correctly. Re-installing the necessary dependencies before starting the test. If this issue persists, pleases contact Momentic Support."),await kr(lp,!0),S=await en.init({baseUrl:n,logger:d,userBrowserSettings:g,storage:i,featureFlagStore:y,enricher:new Sr(v),timeout:g.pageLoadTimeoutMs,contextArgs:{viewport:o.advanced.viewport??Yt,deviceScaleFactor:t}});else throw C}let E=new mo({browser:S,generator:a,logger:d,orgId:l,scratchPadId:void 0,storage:i,flagStore:y,localCodeEvalTools:s,visualDiffScreenshotStorage:f,analytics:m}),T=new vt({baseUrl:n,currentUrl:E.browser.url(),variablesFromEnvironment:c,envName:e});return o.parameters&&await Promise.all(o.parameters.map(async C=>{let{name:P,defaultValue:k,required:N}=C,J=u?.[P];N&&J===void 0&&(b.error(`Required parameter '${P}' is required by test '${o.name}' but not provided`),process.exit(1));let V=await Pt({orgId:l,s:J??k,localTools:s,logger:d,context:vt.dummyContext(T.getEnvName())});T.setMomenticSystemVariable(P,V)})),{controller:E,context:T,flagStore:y}}import{randomUUID as sL}from"crypto";import{diff as aL}from"deep-object-diff";import{cloneDeep as vb}from"lodash-es";import{debounce as lL}from"ts-debounce";async function wb({testId:n,apiClient:e,testAdvancedSettings:t,aiSettingsFromEnv:r,logger:o,noReport:i}){if(i)return o.debug("The CLI is not running in a CI environment or --no-report was explicitly passed"),!1;if(t.failureRecovery===!1||t.failureRecovery===void 0&&!r?.failureRecovery)return!1;let s;try{s=await e.getPastTestResults(n,{afterTime:Date.now()-7*24*60*60*1e3})}catch(l){return o.error({err:l},"Test is not eligible for recovery since we failed to fetch the recent test results"),!1}return s.some(l=>l.status==="PASSED")?!0:(o.debug({recentRuns:s},"Test is not eligible for recovery because there are only failures in the past 7 days"),!1)}async function xb({attemptInputs:n,attemptFixtures:e,attemptMetadata:t}){let{attemptNumber:r,orgId:o,runId:i,runAttemptId:s}=t,{controller:a,context:l,flagStore:c,analytics:d,codeEvalTools:p,storageClient:u,debugDataClient:m,logger:h,apiClient:f,billingReporter:g}=e,{test:y,orgSettings:v,noReport:S}=n;h.info(`Running test '${y.name}' locally${S?"":` and reporting results to https://app.momentic.ai/runs/${i}`}`);let E=vb({steps:y.steps,beforeSteps:y.beforeSteps,afterSteps:y.afterSteps}),T=async O=>{if(!(S||!i))try{if(O.results){let I=vb(O.results);Hs(I,h),O.results=I}await f.updateRun(i,{...O,updatedAt:new Date})}catch(I){h.warn({err:I},"Failed to update run data. You may see stale data on the Momentic Cloud Server.")}},C=lL(async O=>{S||await T(O)},1e4,{maxWait:3e4}),P=async O=>{try{await C(O)}catch{}},k={controller:a,storage:u,debugDataStorage:m,billingReporter:g,analytics:d,context:l,logger:h,codeEvalTools:p},N={orgId:o,runId:i||sL(),runAttemptId:s,testMetadata:y,steps:y.steps,beforeSteps:y.beforeSteps,afterSteps:y.afterSteps},J={collectDebugData:!0,reinitializeBrowser:!0,disableHealing:!await wb({noReport:S,currentAttempt:r,testId:y.id,flagStore:c,apiClient:f,testAdvancedSettings:y.advanced,aiSettingsFromEnv:v.ai,logger:h})},V={step:{},test:{onTestComplete:async()=>{await a.browser.cleanup()},onSaveScreenshot:async O=>{if(S)return"";let{key:I}=await f.uploadScreenshot({screenshot:O.toString("base64")});return I},onUpdateRun:O=>{P(O)},onSaveFinalRunResults:async O=>{C.cancel(),await T(O)},onProposedTestSteps:async O=>f.uploadProposedSteps(O,h),onTestSuccess:async O=>{let I=aL(E,O);if(Object.keys(I).length!==0){h.debug({changes:I},"Updating steps post-run success in worker");try{let{cachesToSave:te}=await It({stepLists:O,cacheCreationParams:{testId:y.id,orgId:o}});await f.updateStepCaches({testId:y.id,entries:te})}catch(te){h.error({err:te},"Failed to save step caches after successful execution. This is not critical, but can impact future performance.")}}}}};return await g.reportBillableEvent(h,"test-run",{eventId:i,testId:y.id,testName:y.name}),await ra({fixtures:k,inputs:N,options:J,callbacks:V})}async function Eb(n){let e=new Date,{testDefinition:t}=n;try{return await dL(n)}catch(r){let o="Fatal error running test";return b.error(`${o}: ${r.message}`),j.error({err:r},o),{parameters:n,failureReason:"UnknownError",failureDetails:{errorMessage:r.message,errorStack:r.stack},status:"FAILED",attempts:0,test:t,filePath:t.relativeFilePath,startedAt:e,finishedAt:new Date,outputs:{}}}}async function dL(n){let{testDefinition:e,project:t,apiClient:r,orgId:o,noReport:i,urlOverride:s,runGroupId:a,runSigIntHandlers:l}=n,c=new Zr(r,o),d=new Dn({httpClient:new Et({baseUrl:r.baseUrl,apiKey:r.apiKey})}),p=e.steps,u=Tb(e.steps);try{await c.resolveStepCacheEntries({organizationId:o,testId:e.id,steps:u,schemaVersion:e.schemaVersion,logger:j})}catch(v){throw j.error({err:v},"Failed to resolve step cache entries"),new Error(`Failed to resolve step cache entries. Please ensure you are running using a supported version of Momentic. If you believe this is an error, please contact Momentic Support with the following error: ${v}`)}let m=n.envName??uL(e),h,f={};if(m){try{h=Ai(m,t,j)}catch(v){let S=`Failed to resolve environment ${m} for test ${e.name}: ${v}`;throw new Error(S)}f=h.variables}let g=e.baseUrl;if(s)g=s;else if(!g){let v=f[ve];typeof v=="string"&&(g=v)}if(!g){let v=`Cannot run test with no base URL and no ${ve} variable defined in its environment`;throw new Error(v)}let y;if(!i)try{y=(await r.createRun({stepsSnapshot:p,runGroupId:a,testId:e.id,testName:e.name,trigger:"CLI",resolvedBaseUrl:g,environmentName:m,schemaVersion:e.schemaVersion})).id}catch(v){throw j.error({err:v,testId:e.id},"Error creating run on Momentic Cloud"),new Error(`Error creating run on Momentic Cloud. Please ensure Momentic is accessible from your environment.
|
|
3002
3002
|
If you believe this is an error, please contact Momentic Support with the following error message: ${v}`)}try{return l?.push(async()=>{!y||i||await r.updateRun(y,{status:"CANCELLED",updatedAt:new Date})}),pL({...n,variables:f,envName:m,runId:y,stepsWithCaches:u,resolvedEnv:h,baseUrl:g,storageClient:c,codeEvalTools:d})}finally{l?.pop()}}async function pL(n){let{testDefinition:e,stepsWithCaches:t,project:r,regenerateGoldenFiles:o,apiClient:i,generator:s,baseUrl:a,storageClient:l,codeEvalTools:c,runId:d,orgId:p,envName:u,urlOverride:m,customHeaders:h,testInputs:f,variables:g,analytics:y,resolvedEnv:v,noReport:S,retriesOverride:E,billingReporter:T,devicePixelRatio:C,logUpdate:P}=n,k=new Date,N=new Io(r,o),J={ai:r.config.ai},V=new Jr(i,p),de={envName:u,urlOverride:m,customHeaders:h,testInputs:f};d&&(g[uf]=d);let O=j.child({testId:e.id,runId:d,orgId:p}),I=y.child({test_id:e.id,test_name:e.name,label_names:e.labels,run_id:d});I.track({type:"execution:test_start"});let te=async Ae=>{if(!(S||!d))try{await i.updateRun(d,Ae)}catch(Q){O.warn({err:Q},`Failed to update run status for test ${d}. You may see stale data on the Momentic Cloud Server.`)}},L,fe=Math.abs(E??r.config.retries??e.retries??0),se=[];O.info("Starting test run using CLI");for(let Ae=0;Ae<=fe;Ae++){let Q=cL(),we={...e,steps:Tb(t)};if(!S&&d)try{Q=(await i.createRunAttempt(d)).id}catch(De){throw O.error({err:De,testId:we.id,runId:d},"Error creating run attempt on Momentic Cloud"),new Error("Error creating run attempt on Momentic Cloud. Please ensure Momentic is accessible from your environment or pass the --no-report flag.")}Ae!==0&&P("RETRY",`attempt ${Ae+1}/${fe+1}`);let pt=async De=>{if(!(S||!d))try{await i.updateRunAttempt(d,Q,De)}catch(F){O.warn({err:F},`Failed to update run attempt for attempt ${Q}. You may see stale data on the Momentic Cloud Server.`)}};try{await te({status:"RUNNING",attempts:Ae+1});let{controller:De,context:F,flagStore:sn}=await bb({baseUrl:a,envName:u,apiClient:i,devicePixelRatio:C,logger:O,storageClient:l,codeEvalTools:c,test:we,generator:s,orgId:p,variables:g,customHeaders:h,testInputs:f,localBrowserConfig:v?.browser??r.config.browser,visualDiffScreenshotStorage:N,analytics:I});L=await xb({attemptMetadata:{attemptNumber:Ae+1,orgId:p,runId:d,runAttemptId:Q},attemptFixtures:{logger:O,storageClient:l,billingReporter:T,analytics:I,debugDataClient:V,codeEvalTools:c,flagStore:sn,apiClient:i,context:F,controller:De},attemptInputs:{test:we,orgSettings:J,noReport:S}}),await pt({status:L.status,finishedAt:new Date,results:L.results,beforeResults:L.beforeResults,afterResults:L.afterResults}),se.unshift(L.status);let ue=await Sb({orgId:p,codeEvalTools:c,logger:O,outputDefinitions:e.outputs??[],testContext:F}),Be=new Date,Rt=Ru(se),Je=Be.getTime()-k.getTime(),an=Ae+1;if(L.status!=="FAILED")return L.status==="PASSED"&&I.track({type:"execution:test_success",attempt_count:an,duration_ms:Je,is_flake:Rt}),await te({status:L.status,finishedAt:Be,flake:Rt}),{...L,parameters:de,runId:d,test:we,filePath:we.relativeFilePath,startedAt:k,finishedAt:Be,attempts:an,baseUrl:a,outputs:ue};let _r=L.failedStepResult,Kt=_r?.message||"Unknown failure",Do=_r?.failureReason??om(Kt)??"UnknownError",Zn=O.child({errResult:_r,failureReason:Do,errorMessage:Kt,numAttempts:fe+1,name:we.name});if(Ae<fe){Zn.warn(`Retrying failed execution attempt for run ${d}: ${Kt}`);continue}Zn.error(`Test failed after all exhausting attempts: ${Kt}`);let Fo={errorMessage:Kt};return await te({status:"FAILED",finishedAt:Be,failureDetails:Fo,failureReason:Do}),I.track({type:"execution:test_fail",attempt_count:Ae+1,duration_ms:Be.getTime()-k.getTime(),fail_reason:Fo.errorMessage}),{...L,parameters:de,runId:d,failureDetails:Fo,failureReason:Do,test:we,filePath:we.relativeFilePath,startedAt:k,finishedAt:new Date,attempts:Ae+1,baseUrl:a,outputs:ue}}catch(De){let F=`Encountered fatal platform error while running test '${we.name}': ${De}`,sn=new Date,ue=Ae+1;O.error({err:De},F),b.error(F);let Be={errorMessage:De.message,errStack:De.stack},Rt={status:"FAILED",failureDetails:Be,failureReason:"InternalPlatformError",finishedAt:sn};return await Promise.all([pt(Rt),te(Rt)]),I.track({type:"execution:test_fail",attempt_count:ue,duration_ms:sn.getTime()-k.getTime(),fail_reason:Be.errorMessage}),{...Rt,parameters:de,runId:d,test:we,filePath:we.relativeFilePath,startedAt:k,finishedAt:new Date,attempts:ue,baseUrl:a,outputs:{}}}}throw new Error("This code should not be reachable")}function uL(n){for(let e of n.envs??[])if(e.default)return e.name}async function Cb(n){let{tests:e,yes:t,start:r,waitOn:o,client:i,billingReporter:s,analytics:a,project:l,report:c,retriesOverride:d,urlOverride:p,envName:u,orgId:m,devicePixelRatio:h,customHeaders:f,testInputMatrix:g,reporter:y,include:v,exclude:S,labels:E,reporterDir:T="reports",waitOnTimeout:C=60,parallel:P=l.config.parallel??1,shardIndex:k=1,shardCount:N=1,regenerateGoldenFiles:J}=n;r&&(j.info({orgId:m},`Executing start command: ${r}`),await PS(r,!1)),o&&(j.info({orgId:m},`Waiting for url: ${o} with timeout: ${C} seconds.`),await hL({resources:[o],interval:2500,timeout:C*1e3,headers:{Accept:"*/*"},followRedirect:!0,verbose:!1,log:!0,strictSSL:!1}));let V=new eo({baseUrl:i.baseUrl,apiKey:i.apiKey,logger:j}),de=nt(l,b),O=await yb({tests:e,momenticFiles:de,yes:t,project:l,include:v,exclude:S,labels:E}),I=[];O.forEach((ue,Be)=>{g?g.forEach((Rt,Je)=>{I.push({testIndex:Be,inputs:Rt,inputIndex:Je})}):I.push({testIndex:Be,inputs:void 0,inputIndex:void 0})}),N&&N>1&&(I=fL(I,k,N));let te=`Running ${I.length} tests with ${P} workers`;j.info({allTestsToRunWithInputs:I,shardCount:N,shardIndex:k,orgId:m},te),b.dimmed(te),I.forEach(ue=>{b.dimmed(` - ${[O[ue.testIndex].relativeFilePath]}${typeof ue.inputIndex=="number"?` with input set ${ue.inputIndex}`:""}`)}),b.log("");let L=[],fe=Date.now(),se=new Set,Ae=()=>{let ue=i.getAppUrl(),Be=_o({results:L,startTime:fe,onFailed:Je=>{nl(Je,Je.filePath)},getDisplayLine:Je=>{let an=` - ${Je.filePath}${Je.proposedTest?" [AUTO-HEALED] ":""}`;return c&&Je.runId&&(an+=` (${ue}/runs/${Je.runId})`),an},entity:"test"}),Rt=L.filter(Je=>!!Je.proposedTest);return Rt.length>0&&b.warn(`${Rt.length} tests passed with auto-healing. Please use the run links printed above to review proposed changes and apply them locally.`),Be},Q=await gb(b),we=a.child({commit_sha:Q?.gitCommitSha,commit_sha_short:Q?.gitCommitShaShort,branch_name:Q?.gitBranchName,origin_url:Q?.gitOriginUrl,commit_timestamp:Q?.gitCommitTimestamp,github_repository:Q?.githubRepository,gitlab_project_path:Q?.gitlabProjectPath,pipeline_id:Q?.pipelineId}),pt;c&&(pt=(await i.createRunGroup({...Q,trigger:Ut.CLI,startedAt:new Date,status:"RUNNING"})).id);let De=[],F=async()=>{b.warn("SIGINT received. Stopping tests and printing latest results..."),c&&pt&&await i.updateRunGroup(pt,{status:"CANCELLED",finishedAt:new Date}),Ae(),await Promise.allSettled(De.map(ue=>ue())),process.exit(1)};process.on("SIGINT",F);let sn={};for(let ue=0;ue<I.length;ue++){let Be=Object.values(sn);Be.length===P&&await Promise.race(Be.map(an=>an.promise));let Rt=I[ue],Je=`test-${ue}`;sn[Je]={done:!1,promise:(async({testIndex:an,inputs:_r})=>{let Kt=O[an];se.add({testIndex:an,inputs:_r});let Do=Kt.relativeFilePath.includes("..")?Kt.fullFilePath:Kt.relativeFilePath,Zn=(ot,Uo)=>{let Nr=(sl,gp)=>{let Pb=Math.floor((gp-sl.length)/2);return sl.padStart(Pb+sl.length).padEnd(gp)};ot=ot.toUpperCase();let wn=ot;ot.includes("FAIL")?wn=Mo.bgRed.white(Nr("FAIL",8)):ot.includes("PASS")?wn=Mo.bgGreen.white(Nr("PASS",8)):ot.includes("START")?wn=Mo.bgBlue.white(Nr("START",8)):ot.includes("CANCEL")?wn=Mo.bgYellow.white(Nr("CANCEL",8)):ot.includes("RETRY")?wn=Mo.bgYellow.white(Nr("RETRY",8)):ot.includes("RUN")||ot.includes("PROG")?wn=Mo.bgMagenta.white(Nr("RUNNING",8)):j.warn(`Unknown status tried to be logged in run test locally: ${ot}`),mL||(wn=`[${wn}]`),b.log(`${wn} ${Do} ${Uo?`${Uo} `:""}(${se.size}/${I.length})`)};Zn("START");let Fo=setInterval(()=>Zn("RUN"),5*60*1e3);try{let ot=await Eb({testDefinition:Kt,project:l,testInputs:_r,orgId:m,devicePixelRatio:h,apiClient:i,billingReporter:s,analytics:we,generator:V,retriesOverride:d,urlOverride:p,envName:u,noReport:!c,customHeaders:f,regenerateGoldenFiles:J,logUpdate:Zn,runGroupId:pt,runSigIntHandlers:c?De:void 0});Zn(ot.status),L.push(ot)}catch(ot){let Uo=`Encountered unexpected fatal error when running test '${Kt.name}': ${ot.message}`;b.error(Uo),j.error(Uo)}finally{clearInterval(Fo),sn[Je].done=!0,delete sn[Je]}})(Rt)}}if(await Promise.allSettled(Object.values(sn).map(ue=>ue.promise)),c&&pt){let ue="PASSED";L.some(Be=>Be.status==="FAILED")&&(ue="FAILED"),await i.updateRunGroup(pt,{status:ue,finishedAt:new Date})}return process.off("SIGINT",F),y&&await fb(y,{suiteName:`on-demand-suite-${fe}`,startedAt:new Date(fe),finishedAt:new Date,runs:L},T??"reports"),Ae()}function fL(n,e,t){if(t>n.length&&(b.warn(`Shard count ${t} is greater than the number of tests ${n.length}! Some workers won't have any tests to run.`),t=Math.max(t,n.length),e>t))return[];let r=Math.floor((e-1)*(n.length/t)),o=Math.floor(e*(n.length/t));return n.sort().filter((s,a)=>a>=r&&a<o)}var Ab=new Oo({platform:"cli"},{flushAt:1,flushInterval:0});ll||j.warn("Sentry is not enabled in this environment due to unsupported node version");var vL=process.argv.some(n=>n.includes("--log-level"))&&process.argv.some(n=>n.includes("debug")),fp=n=>{vL&&b.dimmed(n)},At=new gL;At.name("momentic").description("CLI").version(ko||"unknown");At.command("install-browsers").option("-f, --force","Force reinstallation even if the browser executables already exist on disk.").argument("[browsers...]","Browsers to install",["chromium"]).action(async(n,e)=>{await kr(ob(n),e.force)});At.addOption(new qt("--log-level <level>").choices(["debug","info","warn","error"]).default("info")).on("option:log-level",n=>{n==="debug"&&b.info("Enabling debug logging"),b.setMinLevel(n.toLowerCase())});At.addOption(new qt("--verbose","enable verbose logging")).on("option:verbose",()=>{j.enableConsoleLogs(),b.setMinLevel(0)});At.command("check-config").addOption(Or).action(async n=>{bn({configFilePath:n.config})});var xL=At.command("checks").alias("check").description("Perform various project checks");xL.command("duplicate-names").description("Checks if tests or modules with duplicate names or ids exist").addOption(Or).action(async n=>{let e=bn({configFilePath:n.config}),t=nt(e,b),r=Object.values(t.tests),o=await fa(t,j),i={},s={},a={},l={},c=new Set,d=new Set,p=new Set,u=new Set;for(let h of r)i[h.id]?a[h.id]?a[h.id].push(h.fullFilePath):a[h.id]=[i[h.id],h.fullFilePath]:i[h.id]=h.fullFilePath,s[h.name]?l[h.name]?l[h.name].push(h.fullFilePath):l[h.name]=[s[h.name],h.fullFilePath]:s[h.name]=h.fullFilePath;for(let h of o)u.has(h.moduleId)&&c.add(h.moduleId),p.has(h.name)&&d.add(h.name),u.add(h.moduleId),p.add(h.name);if(Object.entries(a).length>0||Object.entries(l).length>0||c.size>0||d.size>0){for(let[h,f]of Object.entries(a))for(let g of f)b.error(`Test ID ${h} is duplicated in ${g}`);for(let[h,f]of Object.entries(l))for(let g of f)b.error(`Test Name ${h} is duplicated in ${g}`);for(let h of c)b.error(`Module id ${h} is duplicated in your project`);for(let h of d)b.error(`Module name ${h} is duplicated in your project`);process.exit(1)}b.success("No duplicates detected. All test and module names and ids are unique."),process.exit(0)});var TL=At.command("migrate").description("Migrate and upgrade tooling");TL.command("v0-v1").addOption(Jn).addOption(Yn).action(async n=>{let e=await Xn(n);if(!e.yes&&!await rt("This command will migrate and then delete your previous Momentic files. All members of your team should transition to the V1 CLI at the same time. Please backup your local directory for safety before proceeding. Continue?",!0)&&process.exit(1),!jS().environments?.length&&await rt("In the V1 CLI, all environment configuration should be committed to a central `momentic.config.yaml` file, which you should commit to your source control repository. Sensitive data can be managed through `.env` files or by injecting the secret into the environment and then referencing them in `envVariables` with ${VAR} syntax. Would you like to pull the latest environments from Momentic Cloud into your `momentic.config.yaml` file?",!0)){let{apiKey:r,server:o}=e,i=bn({}),s=new lt({baseUrl:o,apiKey:r,logger:j});await Va({client:s,project:i,skipPrompts:e.yes}),b.success("Successfully imported environments from Momentic Cloud.")}});At.command("import-from-cloud").addOption(Yn).addOption(Lr).addOption(Or).addOption(Jn).action(async n=>{let e=await Xn(n),{apiKey:t,server:r,config:o,yes:i}=e,s=bn({configFilePath:o}),a=new lt({baseUrl:r,apiKey:t,logger:j});await BS({client:a,project:s,skipPrompts:i}),process.exit(0)});At.command("init").description("Initialize an empty Momentic project in the current working directory").addOption(new qt("--name <name>","Name of the project")).action(async n=>{b.info(`Welcome to the Momentic project setup wizard! \u{1F680}
|
|
3003
|
-
`),b.info("This wizard will help you bootstrap a new Momentic project. If you need to import existing assets from Momentic Cloud, you can call the 'import-from-cloud' command after initialization."),Rb.existsSync(Co)&&(b.error("A momentic.config.yaml file already exists in this directory. Please rename or remove it to initialize a new project."),process.exit(1));let t={name:n.name??await NS("Choose an identifier for your project, such as a service, product, or team name (default: 'app'):","app"),include:Hi};Ao(t,Co),b.success(`Initialized Momentic project file at ${il.resolve(Co)}`)});At.command("app").addOption(Yn).addOption(Lr).addOption(Jn).addOption(ip).addOption(YS).addOption(Or).action(async n=>{let e=await Xn(n),{apiKey:t,port:r=Ka,yes:o,server:i,pixelRatio:s}=e,a=new lt({baseUrl:i,apiKey:t,logger:j});await cp({client:a,skipPrompts:o,installBrowsers:!0});let l=wL(import.meta.url),c=il.dirname(l),d=il.resolve(c,"..","static"),p=il.resolve(c,"..","assets"),u=s??Jd();Xd(u),zo(),await AS({momenticServerUrl:i,apiKey:t,serverPort:r,appPort:r,staticDir:d,assetsDir:p,devicePixelRatio:u,version:"1.0.
|
|
3003
|
+
`),b.info("This wizard will help you bootstrap a new Momentic project. If you need to import existing assets from Momentic Cloud, you can call the 'import-from-cloud' command after initialization."),Rb.existsSync(Co)&&(b.error("A momentic.config.yaml file already exists in this directory. Please rename or remove it to initialize a new project."),process.exit(1));let t={name:n.name??await NS("Choose an identifier for your project, such as a service, product, or team name (default: 'app'):","app"),include:Hi};Ao(t,Co),b.success(`Initialized Momentic project file at ${il.resolve(Co)}`)});At.command("app").addOption(Yn).addOption(Lr).addOption(Jn).addOption(ip).addOption(YS).addOption(Or).action(async n=>{let e=await Xn(n),{apiKey:t,port:r=Ka,yes:o,server:i,pixelRatio:s}=e,a=new lt({baseUrl:i,apiKey:t,logger:j});await cp({client:a,skipPrompts:o,installBrowsers:!0});let l=wL(import.meta.url),c=il.dirname(l),d=il.resolve(c,"..","static"),p=il.resolve(c,"..","assets"),u=s??Jd();Xd(u),zo(),await AS({momenticServerUrl:i,apiKey:t,serverPort:r,appPort:r,staticDir:d,assetsDir:p,devicePixelRatio:u,version:"1.0.88"});let m=`http://localhost:${r}`;await bL(m)});var Ib=At.command("queue").description("Queue tests or suites to run on Momentic Cloud");Ib.command("suites").description("Run one or more suites on Momentic Cloud").addOption(Yn).addOption(Lr).addOption(np).addOption(rp).addOption(Jn).addArgument(eb).addOption(Xa).addOption(Ja).addOption(Ya).action(async(n,e)=>{let{apiKey:t,server:r,wait:o,waitTimeout:i,env:s,urlOverride:a,customHeaders:l}=await Xn(e),c=new lt({baseUrl:r,apiKey:t,logger:j});(!n||!Array.isArray(n)||!n.length)&&(b.error("Must pass at least one suite to run."),process.exit(1));let{orgId:d}=await c.getAuthInfo();await lb({client:c,orgId:d,wait:o,suitePaths:n,waitTimeout:i,env:s,urlOverride:a,customHeaders:Za(l)})});Ib.command("tests").description("Run one or more tests on Momentic Cloud").addOption(Yn).addOption(Lr).addOption(Jn).addOption(Ya).addOption(sp).addOption(Xa).addOption(Ja).addOption(np).addOption(rp).addArgument(ZS).action(async(n,e)=>{let t=await Xn(e),{all:r,apiKey:o,customHeaders:i,env:s,server:a,inputCsv:l,urlOverride:c,wait:d,waitTimeout:p,yes:u}=t,m=Za(i);for(let y of n)(y.endsWith(".yaml")||Rb.existsSync(y))&&b.warn("Are you trying to run a test on your local machine? If so, please use the 'run' command instead of the 'queue' command");let h=new lt({baseUrl:a,apiKey:o,logger:j}),{orgId:f}=await h.getAuthInfo(),g;l&&(g=await Zd(l)),await cb({client:h,orgId:f,tests:n,all:r,customHeaders:m,env:s,urlOverride:c,wait:d,waitTimeout:p,testInputMatrix:g,yes:u}),process.exit(0)});var EL=At.command("run").alias("test").description("Run tests on the local machine");EL.addOption(Yn).addOption(Lr).addOption(Or).addOption(ap).addOption(Jn).addOption(Ya).addOption(sp).addOption(Ja).addOption(Xa).addOption(op).addOption(ip).addOption(new qt("--start <start>","Arbitrary setup command that will run before Momentic steps begin.")).addOption(new qt("--wait-on <waitOn>","URL to wait to become accessible before Momentic tests begin.")).addOption(new qt("--wait-on-timeout <waitOnTimeout>","Max time in seconds to wait for the --wait-on URL to become accessible.")).addOption(new qt("--retries <retries>","Number of retries to attempt when running tests locally. Defaults to each test's own retry configuration.")).addOption(new qt("-p, --parallel <parallel>","When running with the --local flag, the number of tests to run in parallel. Defaults to 1.")).addOption(new qt("--labels <labels...>","Only run tests with the specified label(s).")).addOption(new qt("--update-golden-files","Update locally stored golden files for steps that this is enabled for.")).addOption(op).addOption(GS).addOption(VS).addOption(JS).addOption(XS).addOption(qS).addOption(KS).addArgument(QS).action(async(n,e)=>{b.debug("Run tests invoked");let t=await Xn(e);b.debug(t,"Parsed CLI options");let r=Za(t.customHeaders),o=bn({configFilePath:t.config,nameFilter:t.filter});b.debug({projectName:o.config.name},"Identified project config");let i=new lt({baseUrl:t.server,apiKey:t.apiKey,logger:j}),s=new Bs(i),a;t.inputCsv&&(a=await Zd(t.inputCsv)),b.debug("Checking API key and dependencies");let{orgId:l,userId:c}=await cp({client:i,skipPrompts:t.yes,installBrowsers:!0});b.debug("API key check and browser installation complete");let d=t.pixelRatio??Jd();Xd(d);let p=Ab.child({org_id:l,user_id:c,cli_version:ko,trigger:"CLI"});t.report||(p=new $a);try{(await Cb({...t,retriesOverride:t.retries,devicePixelRatio:d,tests:n,project:o,client:i,billingReporter:s,analytics:p,customHeaders:r,envName:t.env,orgId:l,testInputMatrix:a,regenerateGoldenFiles:t.updateGoldenFiles})).failed>0?process.exit(1):process.exit(0)}catch(u){b.error("Failed to run tests locally. Please check the error message below or run with the --verbose flag."),b.error(u),process.exit(1)}});var CL=At.command("apply").description("Apply an operation to local resources");CL.command("patch").addOption(Yn).addOption(Lr).addOption(Or).addOption(ap).addOption(Jn).addOption(new qt("--from <from>","Name or ID of the patch to apply").makeOptionMandatory()).addOption(new qt("--to <to>","Name or ID of the test to apply the patch to").makeOptionMandatory()).action(async n=>{let e=await Xn(n),{apiKey:t,server:r,config:o,yes:i}=e,s=bn({configFilePath:o}),a=new lt({baseUrl:r,apiKey:t,logger:j}),l=nt(s,b),c=l.tests[n.to]??Object.values(l.tests).find(p=>Pe(p.name)===n.to.trim());c||(b.error(`No test matching '${n.to}' could be found in the current project.`),process.exit(1));let d=await a.fetchTestFragment(n.from);await MS({client:a,test:c,fragment:d,yes:i,entities:l,logger:j}),process.exit(0)});async function AL(){fp("Main program started"),await LS(j),fp("CLI version check complete");try{await At.parseAsync(process.argv),zo()}catch(n){let e={};try{e.playwrightVersion=yL("npx playwright --version").toString()}catch(t){j.error({err:t},"Error fetching debug information")}j.error({err:n,debugInfo:e},"Uncaught error in CLI"),j.flush(),al(n,e),b.error(n),zo(),process.exit(1)}}SL.setMaxListeners(50);process.on("warning",n=>{j.warn({err:n},`Node warning received on CLI: ${n.message}`)});fp("CLI parsing setup complete");AL();
|
|
3004
3004
|
//# sourceMappingURL=cli.js.map
|
|
3005
3005
|
//# debugId=21e59e86-f837-5b15-851d-f3319cc9f773
|
package/package.json
CHANGED
|
@@ -694,7 +694,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
694
694
|
*/var $Me=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],JD=$Me.join(","),PMe=typeof Element>"u",Y0=PMe?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,eL=!PMe&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},tL=function e(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),a=i===""||i==="true",o=a||n&&t&&e(t.parentNode);return o},C2t=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},kMe=function(t,n,r){if(tL(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(JD));return n&&Y0.call(t,JD)&&i.unshift(t),i=i.filter(r),i},RMe=function e(t,n,r){for(var i=[],a=Array.from(t);a.length;){var o=a.shift();if(!tL(o,!1))if(o.tagName==="SLOT"){var s=o.assignedElements(),l=s.length?s:o.children,c=e(l,!0,r);r.flatten?i.push.apply(i,c):i.push({scopeParent:o,candidates:c})}else{var u=Y0.call(o,JD);u&&r.filter(o)&&(n||!t.includes(o))&&i.push(o);var f=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),d=!tL(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(f&&d){var h=e(f===!0?o.children:f.children,!0,r);r.flatten?i.push.apply(i,h):i.push({scopeParent:o,candidates:h})}else a.unshift.apply(a,o.children)}}return i},IMe=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Bm=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||C2t(t))&&!IMe(t)?0:t.tabIndex},A2t=function(t,n){var r=Bm(t);return r<0&&n&&!IMe(t)?0:r},$2t=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},NMe=function(t){return t.tagName==="INPUT"},P2t=function(t){return NMe(t)&&t.type==="hidden"},k2t=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},R2t=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},I2t=function(t){if(!t.name)return!0;var n=t.form||eL(t),r=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var a=R2t(i,t.form);return!a||a===t},N2t=function(t){return NMe(t)&&t.type==="radio"},M2t=function(t){return N2t(t)&&!I2t(t)},D2t=function(t){var n,r=t&&eL(t),i=(n=r)===null||n===void 0?void 0:n.host,a=!1;if(r&&r!==t){var o,s,l;for(a=!!((o=i)!==null&&o!==void 0&&(s=o.ownerDocument)!==null&&s!==void 0&&s.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!a&&i;){var c,u,f;r=eL(i),i=(c=r)===null||c===void 0?void 0:c.host,a=!!((u=i)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(i))}}return a},jue=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},L2t=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var a=Y0.call(t,"details>summary:first-of-type"),o=a?t.parentElement:t;if(Y0.call(o,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof i=="function"){for(var s=t;t;){var l=t.parentElement,c=eL(t);if(l&&!l.shadowRoot&&i(l)===!0)return jue(t);t.assignedSlot?t=t.assignedSlot:!l&&c!==t.ownerDocument?t=c.host:t=l}t=s}if(D2t(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return jue(t);return!1},j2t=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return Y0.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},nL=function(t,n){return!(n.disabled||tL(n)||P2t(n)||L2t(n,t)||k2t(n)||j2t(n))},Cz=function(t,n){return!(M2t(n)||Bm(n)<0||!nL(t,n))},F2t=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},B2t=function e(t){var n=[],r=[];return t.forEach(function(i,a){var o=!!i.scopeParent,s=o?i.scopeParent:i,l=A2t(s,o),c=o?e(i.candidates):s;l===0?o?n.push.apply(n,c):n.push(s):r.push({documentOrder:a,tabIndex:l,item:i,isScope:o,content:c})}),r.sort($2t).reduce(function(i,a){return a.isScope?i.push.apply(i,a.content):i.push(a.content),i},[]).concat(n)},MMe=function(t,n){n=n||{};var r;return n.getShadowRoot?r=RMe([t],n.includeContainer,{filter:Cz.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:F2t}):r=kMe(t,n.includeContainer,Cz.bind(null,n)),B2t(r)},DMe=function(t,n){n=n||{};var r;return n.getShadowRoot?r=RMe([t],n.includeContainer,{filter:nL.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=kMe(t,n.includeContainer,nL.bind(null,n)),r},ay=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Y0.call(t,JD)===!1?!1:Cz(n,t)},U2t=$Me.concat("iframe").join(","),N2=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Y0.call(t,U2t)===!1?!1:nL(n,t)};const V2t=Object.freeze(Object.defineProperty({__proto__:null,focusable:DMe,getTabIndex:Bm,isFocusable:N2,isTabbable:ay,tabbable:MMe},Symbol.toStringTag,{value:"Module"}));/*!
|
|
695
695
|
* focus-trap 7.5.4
|
|
696
696
|
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
697
|
-
*/function Fue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bue(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fue(Object(n),!0).forEach(function(r){Q2t(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fue(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Q2t(e,t,n){return t=W2t(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z2t(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function W2t(e){var t=z2t(e,"string");return typeof t=="symbol"?t:String(t)}var Uue={activateTrap:function(t,n){if(t.length>0){var r=t[t.length-1];r!==n&&r.pause()}var i=t.indexOf(n);i===-1||t.splice(i,1),t.push(n)},deactivateTrap:function(t,n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),t.length>0&&t[t.length-1].unpause()}},H2t=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},q2t=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},cC=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},G2t=function(t){return cC(t)&&!t.shiftKey},Z2t=function(t){return cC(t)&&t.shiftKey},Vue=function(t){return setTimeout(t,0)},Que=function(t,n){var r=-1;return t.every(function(i,a){return n(i)?(r=a,!1):!0}),r},wE=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return typeof t=="function"?t.apply(void 0,r):t},II=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},Y2t=[],X2t=function(t,n){var r=(n==null?void 0:n.document)||document,i=(n==null?void 0:n.trapStack)||Y2t,a=Bue({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:G2t,isKeyBackward:Z2t},n),o={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},s,l=function(E,A,$){return E&&E[A]!==void 0?E[A]:a[$||A]},c=function(E,A){var $=typeof(A==null?void 0:A.composedPath)=="function"?A.composedPath():void 0;return o.containerGroups.findIndex(function(I){var D=I.container,V=I.tabbableNodes;return D.contains(E)||($==null?void 0:$.includes(D))||V.find(function(N){return N===E})})},u=function(E){var A=a[E];if(typeof A=="function"){for(var $=arguments.length,I=new Array($>1?$-1:0),D=1;D<$;D++)I[D-1]=arguments[D];A=A.apply(void 0,I)}if(A===!0&&(A=void 0),!A){if(A===void 0||A===!1)return A;throw new Error("`".concat(E,"` was specified but was not a node, or did not return a node"))}var V=A;if(typeof A=="string"&&(V=r.querySelector(A),!V))throw new Error("`".concat(E,"` as selector refers to no known node"));return V},f=function(){var E=u("initialFocus");if(E===!1)return!1;if(E===void 0||!N2(E,a.tabbableOptions))if(c(r.activeElement)>=0)E=r.activeElement;else{var A=o.tabbableGroups[0],$=A&&A.firstTabbableNode;E=$||u("fallbackFocus")}if(!E)throw new Error("Your focus-trap needs to have at least one focusable element");return E},d=function(){if(o.containerGroups=o.containers.map(function(E){var A=MMe(E,a.tabbableOptions),$=DMe(E,a.tabbableOptions),I=A.length>0?A[0]:void 0,D=A.length>0?A[A.length-1]:void 0,V=$.find(function(z){return ay(z)}),N=$.slice().reverse().find(function(z){return ay(z)}),F=!!A.find(function(z){return Bm(z)>0});return{container:E,tabbableNodes:A,focusableNodes:$,posTabIndexesFound:F,firstTabbableNode:I,lastTabbableNode:D,firstDomTabbableNode:V,lastDomTabbableNode:N,nextTabbableNode:function(H){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,U=A.indexOf(H);return U<0?L?$.slice($.indexOf(H)+1).find(function(Q){return ay(Q)}):$.slice(0,$.indexOf(H)).reverse().find(function(Q){return ay(Q)}):A[U+(L?1:-1)]}}}),o.tabbableGroups=o.containerGroups.filter(function(E){return E.tabbableNodes.length>0}),o.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(o.containerGroups.find(function(E){return E.posTabIndexesFound})&&o.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function C(E){var A=E.activeElement;if(A)return A.shadowRoot&&A.shadowRoot.activeElement!==null?C(A.shadowRoot):A},p=function C(E){if(E!==!1&&E!==h(document)){if(!E||!E.focus){C(f());return}E.focus({preventScroll:!!a.preventScroll}),o.mostRecentlyFocusedNode=E,H2t(E)&&E.select()}},m=function(E){var A=u("setReturnFocus",E);return A||(A===!1?!1:E)},g=function(E){var A=E.target,$=E.event,I=E.isBackward,D=I===void 0?!1:I;A=A||II($),d();var V=null;if(o.tabbableGroups.length>0){var N=c(A,$),F=N>=0?o.containerGroups[N]:void 0;if(N<0)D?V=o.tabbableGroups[o.tabbableGroups.length-1].lastTabbableNode:V=o.tabbableGroups[0].firstTabbableNode;else if(D){var z=Que(o.tabbableGroups,function(B){var Y=B.firstTabbableNode;return A===Y});if(z<0&&(F.container===A||N2(A,a.tabbableOptions)&&!ay(A,a.tabbableOptions)&&!F.nextTabbableNode(A,!1))&&(z=N),z>=0){var H=z===0?o.tabbableGroups.length-1:z-1,L=o.tabbableGroups[H];V=Bm(A)>=0?L.lastTabbableNode:L.lastDomTabbableNode}else cC($)||(V=F.nextTabbableNode(A,!1))}else{var U=Que(o.tabbableGroups,function(B){var Y=B.lastTabbableNode;return A===Y});if(U<0&&(F.container===A||N2(A,a.tabbableOptions)&&!ay(A,a.tabbableOptions)&&!F.nextTabbableNode(A))&&(U=N),U>=0){var Q=U===o.tabbableGroups.length-1?0:U+1,W=o.tabbableGroups[Q];V=Bm(A)>=0?W.firstTabbableNode:W.firstDomTabbableNode}else cC($)||(V=F.nextTabbableNode(A))}}else V=u("fallbackFocus");return V},v=function(E){var A=II(E);if(!(c(A,E)>=0)){if(wE(a.clickOutsideDeactivates,E)){s.deactivate({returnFocus:a.returnFocusOnDeactivate});return}wE(a.allowOutsideClick,E)||E.preventDefault()}},b=function(E){var A=II(E),$=c(A,E)>=0;if($||A instanceof Document)$&&(o.mostRecentlyFocusedNode=A);else{E.stopImmediatePropagation();var I,D=!0;if(o.mostRecentlyFocusedNode)if(Bm(o.mostRecentlyFocusedNode)>0){var V=c(o.mostRecentlyFocusedNode),N=o.containerGroups[V].tabbableNodes;if(N.length>0){var F=N.findIndex(function(z){return z===o.mostRecentlyFocusedNode});F>=0&&(a.isKeyForward(o.recentNavEvent)?F+1<N.length&&(I=N[F+1],D=!1):F-1>=0&&(I=N[F-1],D=!1))}}else o.containerGroups.some(function(z){return z.tabbableNodes.some(function(H){return Bm(H)>0})})||(D=!1);else D=!1;D&&(I=g({target:o.mostRecentlyFocusedNode,isBackward:a.isKeyBackward(o.recentNavEvent)})),p(I||o.mostRecentlyFocusedNode||f())}o.recentNavEvent=void 0},O=function(E){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;o.recentNavEvent=E;var $=g({event:E,isBackward:A});$&&(cC(E)&&E.preventDefault(),p($))},x=function(E){if(q2t(E)&&wE(a.escapeDeactivates,E)!==!1){E.preventDefault(),s.deactivate();return}(a.isKeyForward(E)||a.isKeyBackward(E))&&O(E,a.isKeyBackward(E))},w=function(E){var A=II(E);c(A,E)>=0||wE(a.clickOutsideDeactivates,E)||wE(a.allowOutsideClick,E)||(E.preventDefault(),E.stopImmediatePropagation())},S=function(){if(o.active)return Uue.activateTrap(i,s),o.delayInitialFocusTimer=a.delayInitialFocus?Vue(function(){p(f())}):p(f()),r.addEventListener("focusin",b,!0),r.addEventListener("mousedown",v,{capture:!0,passive:!1}),r.addEventListener("touchstart",v,{capture:!0,passive:!1}),r.addEventListener("click",w,{capture:!0,passive:!1}),r.addEventListener("keydown",x,{capture:!0,passive:!1}),s},T=function(){if(o.active)return r.removeEventListener("focusin",b,!0),r.removeEventListener("mousedown",v,!0),r.removeEventListener("touchstart",v,!0),r.removeEventListener("click",w,!0),r.removeEventListener("keydown",x,!0),s},k=function(E){var A=E.some(function($){var I=Array.from($.removedNodes);return I.some(function(D){return D===o.mostRecentlyFocusedNode})});A&&p(f())},M=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(k):void 0,R=function(){M&&(M.disconnect(),o.active&&!o.paused&&o.containers.map(function(E){M.observe(E,{subtree:!0,childList:!0})}))};return s={get active(){return o.active},get paused(){return o.paused},activate:function(E){if(o.active)return this;var A=l(E,"onActivate"),$=l(E,"onPostActivate"),I=l(E,"checkCanFocusTrap");I||d(),o.active=!0,o.paused=!1,o.nodeFocusedBeforeActivation=r.activeElement,A==null||A();var D=function(){I&&d(),S(),R(),$==null||$()};return I?(I(o.containers.concat()).then(D,D),this):(D(),this)},deactivate:function(E){if(!o.active)return this;var A=Bue({onDeactivate:a.onDeactivate,onPostDeactivate:a.onPostDeactivate,checkCanReturnFocus:a.checkCanReturnFocus},E);clearTimeout(o.delayInitialFocusTimer),o.delayInitialFocusTimer=void 0,T(),o.active=!1,o.paused=!1,R(),Uue.deactivateTrap(i,s);var $=l(A,"onDeactivate"),I=l(A,"onPostDeactivate"),D=l(A,"checkCanReturnFocus"),V=l(A,"returnFocus","returnFocusOnDeactivate");$==null||$();var N=function(){Vue(function(){V&&p(m(o.nodeFocusedBeforeActivation)),I==null||I()})};return V&&D?(D(m(o.nodeFocusedBeforeActivation)).then(N,N),this):(N(),this)},pause:function(E){if(o.paused||!o.active)return this;var A=l(E,"onPause"),$=l(E,"onPostPause");return o.paused=!0,A==null||A(),T(),R(),$==null||$(),this},unpause:function(E){if(!o.paused||!o.active)return this;var A=l(E,"onUnpause"),$=l(E,"onPostUnpause");return o.paused=!1,A==null||A(),d(),S(),R(),$==null||$(),this},updateContainerElements:function(E){var A=[].concat(E).filter(Boolean);return o.containers=A.map(function($){return typeof $=="string"?r.querySelector($):$}),o.active&&d(),R(),this}},s.updateContainerElements(t),s};const K2t=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:X2t},Symbol.toStringTag,{value:"Module"})),J2t=Rc(K2t),eMt=Rc(V2t);function hS(e){"@babel/helpers - typeof";return hS=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hS(e)}function tMt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zue(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,LMe(r.key),r)}}function nMt(e,t,n){return t&&zue(e.prototype,t),n&&zue(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function rMt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Az(e,t)}function Az(e,t){return Az=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Az(e,t)}function iMt(e){var t=oMt();return function(){var r=rL(e),i;if(t){var a=rL(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return aMt(this,i)}}function aMt(e,t){if(t&&(hS(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oT(e)}function oT(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oMt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function rL(e){return rL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},rL(e)}function sMt(e,t,n){return t=LMe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LMe(e){var t=lMt(e,"string");return hS(t)==="symbol"?t:String(t)}function lMt(e,t){if(hS(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(hS(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var NI=_,Jt=w3,cMt=J2t,uMt=cMt.createFocusTrap,fMt=eMt,dMt=fMt.isFocusable,HJ=function(e){rMt(n,e);var t=iMt(n);function n(r){var i;tMt(this,n),i=t.call(this,r),sMt(oT(i),"getNodeForOption",function(s){var l,c=(l=this.internalOptions[s])!==null&&l!==void 0?l:this.originalOptions[s];if(typeof c=="function"){for(var u=arguments.length,f=new Array(u>1?u-1:0),d=1;d<u;d++)f[d-1]=arguments[d];c=c.apply(void 0,f)}if(c===!0&&(c=void 0),!c){if(c===void 0||c===!1)return c;throw new Error("`".concat(s,"` was specified but was not a node, or did not return a node"))}var h=c;if(typeof c=="string"){var p;if(h=(p=this.getDocument())===null||p===void 0?void 0:p.querySelector(c),!h)throw new Error("`".concat(s,"` as selector refers to no known node"))}return h}),i.handleDeactivate=i.handleDeactivate.bind(oT(i)),i.handlePostDeactivate=i.handlePostDeactivate.bind(oT(i)),i.handleClickOutsideDeactivates=i.handleClickOutsideDeactivates.bind(oT(i)),i.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:i.handleDeactivate,onPostDeactivate:i.handlePostDeactivate,clickOutsideDeactivates:i.handleClickOutsideDeactivates},i.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var a=r.focusTrapOptions;for(var o in a)if(Object.prototype.hasOwnProperty.call(a,o)){if(o==="returnFocusOnDeactivate"||o==="onDeactivate"||o==="onPostDeactivate"||o==="checkCanReturnFocus"||o==="clickOutsideDeactivates"){i.originalOptions[o]=a[o];continue}i.internalOptions[o]=a[o]}return i.outsideClick=null,i.focusTrapElements=r.containerElements||[],i.updatePreviousElement(),i}return nMt(n,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document<"u"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var i=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return i||(i===!1?!1:this.previouslyFocusedElement)}},{key:"updatePreviousElement",value:function(){var i=this.getDocument();i&&(this.previouslyFocusedElement=i.activeElement)}},{key:"deactivateTrap",value:function(){!this.focusTrap||!this.focusTrap.active||this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(i){var a=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,i):this.originalOptions.clickOutsideDeactivates;return a&&(this.outsideClick={target:i.target,allowDeactivation:a}),a}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var i=this,a=function(){var s=i.getReturnFocusNode(),l=!!(i.originalOptions.returnFocusOnDeactivate&&s!==null&&s!==void 0&&s.focus&&(!i.outsideClick||i.outsideClick.allowDeactivation&&!dMt(i.outsideClick.target,i.internalOptions.tabbableOptions))),c=i.internalOptions.preventScroll,u=c===void 0?!1:c;l&&s.focus({preventScroll:u}),i.originalOptions.onPostDeactivate&&i.originalOptions.onPostDeactivate.call(null),i.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(a,a):a()}},{key:"setupFocusTrap",value:function(){if(this.focusTrap)this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause());else{var i=this.focusTrapElements.some(Boolean);i&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(i){if(this.focusTrap){i.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var a=!i.active&&this.props.active,o=i.active&&!this.props.active,s=!i.paused&&this.props.paused,l=i.paused&&!this.props.paused;if(a&&(this.updatePreviousElement(),this.focusTrap.activate()),o){this.deactivateTrap();return}s&&this.focusTrap.pause(),l&&this.focusTrap.unpause()}else i.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var i=this,a=this.props.children?NI.Children.only(this.props.children):void 0;if(a){if(a.type&&a.type===NI.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");var o=function(c){var u=i.props.containerElements;a&&(typeof a.ref=="function"?a.ref(c):a.ref&&(a.ref.current=c)),i.focusTrapElements=u||[c]},s=NI.cloneElement(a,{ref:o});return s}return null}}]),n}(NI.Component),SE=typeof Element>"u"?Function:Element;HJ.propTypes={active:Jt.bool,paused:Jt.bool,focusTrapOptions:Jt.shape({document:Jt.object,onActivate:Jt.func,onPostActivate:Jt.func,checkCanFocusTrap:Jt.func,onPause:Jt.func,onPostPause:Jt.func,onUnpause:Jt.func,onPostUnpause:Jt.func,onDeactivate:Jt.func,onPostDeactivate:Jt.func,checkCanReturnFocus:Jt.func,initialFocus:Jt.oneOfType([Jt.instanceOf(SE),Jt.string,Jt.bool,Jt.func]),fallbackFocus:Jt.oneOfType([Jt.instanceOf(SE),Jt.string,Jt.func]),escapeDeactivates:Jt.oneOfType([Jt.bool,Jt.func]),clickOutsideDeactivates:Jt.oneOfType([Jt.bool,Jt.func]),returnFocusOnDeactivate:Jt.bool,setReturnFocus:Jt.oneOfType([Jt.instanceOf(SE),Jt.string,Jt.bool,Jt.func]),allowOutsideClick:Jt.oneOfType([Jt.bool,Jt.func]),preventScroll:Jt.bool,tabbableOptions:Jt.shape({displayCheck:Jt.oneOf(["full","legacy-full","non-zero-area","none"]),getShadowRoot:Jt.oneOfType([Jt.bool,Jt.func])}),trapStack:Jt.array,isKeyForward:Jt.func,isKeyBackward:Jt.func}),containerElements:Jt.arrayOf(Jt.instanceOf(SE)),children:Jt.oneOfType([Jt.element,Jt.instanceOf(SE)])};HJ.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:uMt};var hMt=HJ;const pMt=Nn(hMt);function xg(e){const t=_.useRef(e);return _.useLayoutEffect(()=>{t.current=e}),_.useCallback(function(...r){var i;return(i=t.current)==null?void 0:i.call(t,...r)},[])}const mMt=e=>{const t=_.useRef(null),[n,r]=_.useState(!1),i=xg(()=>{r(!1)}),a=l=>{const c=t.current;if(!c)return;const{offsetHeight:u,offsetWidth:f,offsetTop:d,offsetLeft:h}=c,p=l.clientX-h,m=l.clientY-d,g=p/f,v=m/u;return{x:p,y:m,pctX:g,pctY:v}},o=xg(l=>{var c;n&&((c=e.onKeyDown)==null||c.call(e,l.key))}),s=xg(l=>{var p;if(!n)return;l.preventDefault();const c=t.current;if(!c)return;const{offsetHeight:u,offsetWidth:f}=c,{deltaX:d,deltaY:h}=l;(p=e.onWheel)==null||p.call(e,{deltaX:d,deltaY:h,pctDeltaX:d/f,pctDeltaY:h/u})});return _.useEffect(()=>(window.addEventListener("keydown",o),()=>{window.removeEventListener("keydown",o)}),[o]),_.useEffect(()=>{if(!t.current)return;const l=t.current;return l.addEventListener("wheel",s,{passive:!1}),()=>{l.removeEventListener("wheel",s)}},[s]),y.jsx(pMt,{active:n,focusTrapOptions:{escapeDeactivates:!0,clickOutsideDeactivates:!0,onDeactivate:i},children:y.jsxs("div",{ref:t,className:"group relative",onClick:l=>{var u;const c=a(l);c&&(r(!0),(u=e.onClick)==null||u.call(e,c))},onMouseMove:l=>{var u;const c=a(l);c&&(r(!0),(u=e.onMouseMove)==null||u.call(e,c))},children:[y.jsx("input",{className:"absolute h-0 w-0"}),e.children]})})};var jMe={exports:{}},FMe={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},BMe={exports:{}},gMt=function(t){return!t||typeof t=="string"?!1:t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&t.constructor.name!=="String")},vMt=gMt,yMt=Array.prototype.concat,bMt=Array.prototype.slice,Wue=BMe.exports=function(t){for(var n=[],r=0,i=t.length;r<i;r++){var a=t[r];vMt(a)?n=yMt.call(n,bMt.call(a)):n.push(a)}return n};Wue.wrap=function(e){return function(){return e(Wue(arguments))}};var OMt=BMe.exports,uC=FMe,Ik=OMt,UMe=Object.hasOwnProperty,VMe=Object.create(null);for(var FB in uC)UMe.call(uC,FB)&&(VMe[uC[FB]]=FB);var dc=jMe.exports={to:{},get:{}};dc.get=function(e){var t=e.substring(0,3).toLowerCase(),n,r;switch(t){case"hsl":n=dc.get.hsl(e),r="hsl";break;case"hwb":n=dc.get.hwb(e),r="hwb";break;default:n=dc.get.rgb(e),r="rgb";break}return n?{model:r,value:n}:null};dc.get.rgb=function(e){if(!e)return null;var t=/^#([a-f0-9]{3,4})$/i,n=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,r=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,a=/^(\w+)$/,o=[0,0,0,1],s,l,c;if(s=e.match(n)){for(c=s[2],s=s[1],l=0;l<3;l++){var u=l*2;o[l]=parseInt(s.slice(u,u+2),16)}c&&(o[3]=parseInt(c,16)/255)}else if(s=e.match(t)){for(s=s[1],c=s[3],l=0;l<3;l++)o[l]=parseInt(s[l]+s[l],16);c&&(o[3]=parseInt(c+c,16)/255)}else if(s=e.match(r)){for(l=0;l<3;l++)o[l]=parseInt(s[l+1],0);s[4]&&(s[5]?o[3]=parseFloat(s[4])*.01:o[3]=parseFloat(s[4]))}else if(s=e.match(i)){for(l=0;l<3;l++)o[l]=Math.round(parseFloat(s[l+1])*2.55);s[4]&&(s[5]?o[3]=parseFloat(s[4])*.01:o[3]=parseFloat(s[4]))}else return(s=e.match(a))?s[1]==="transparent"?[0,0,0,0]:UMe.call(uC,s[1])?(o=uC[s[1]],o[3]=1,o):null:null;for(l=0;l<3;l++)o[l]=wg(o[l],0,255);return o[3]=wg(o[3],0,1),o};dc.get.hsl=function(e){if(!e)return null;var t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var r=parseFloat(n[4]),i=(parseFloat(n[1])%360+360)%360,a=wg(parseFloat(n[2]),0,100),o=wg(parseFloat(n[3]),0,100),s=wg(isNaN(r)?1:r,0,1);return[i,a,o,s]}return null};dc.get.hwb=function(e){if(!e)return null;var t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var r=parseFloat(n[4]),i=(parseFloat(n[1])%360+360)%360,a=wg(parseFloat(n[2]),0,100),o=wg(parseFloat(n[3]),0,100),s=wg(isNaN(r)?1:r,0,1);return[i,a,o,s]}return null};dc.to.hex=function(){var e=Ik(arguments);return"#"+MI(e[0])+MI(e[1])+MI(e[2])+(e[3]<1?MI(Math.round(e[3]*255)):"")};dc.to.rgb=function(){var e=Ik(arguments);return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};dc.to.rgb.percent=function(){var e=Ik(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+n+"%, "+r+"%)":"rgba("+t+"%, "+n+"%, "+r+"%, "+e[3]+")"};dc.to.hsl=function(){var e=Ik(arguments);return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};dc.to.hwb=function(){var e=Ik(arguments),t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};dc.to.keyword=function(e){return VMe[e.slice(0,3)]};function wg(e,t,n){return Math.min(Math.max(t,e),n)}function MI(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}var xMt=jMe.exports;const zA=FMe,QMe={};for(const e of Object.keys(zA))QMe[zA[e]]=e;const Ut={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var zMe=Ut;for(const e of Object.keys(Ut)){if(!("channels"in Ut[e]))throw new Error("missing channels property: "+e);if(!("labels"in Ut[e]))throw new Error("missing channel labels property: "+e);if(Ut[e].labels.length!==Ut[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=Ut[e];delete Ut[e].channels,delete Ut[e].labels,Object.defineProperty(Ut[e],"channels",{value:t}),Object.defineProperty(Ut[e],"labels",{value:n})}Ut.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i;let s,l;a===i?s=0:t===a?s=(n-r)/o:n===a?s=2+(r-t)/o:r===a&&(s=4+(t-n)/o),s=Math.min(s*60,360),s<0&&(s+=360);const c=(i+a)/2;return a===i?l=0:c<=.5?l=o/(a+i):l=o/(2-a-i),[s,l*100,c*100]};Ut.rgb.hsv=function(e){let t,n,r,i,a;const o=e[0]/255,s=e[1]/255,l=e[2]/255,c=Math.max(o,s,l),u=c-Math.min(o,s,l),f=function(d){return(c-d)/6/u+1/2};return u===0?(i=0,a=0):(a=u/c,t=f(o),n=f(s),r=f(l),o===c?i=r-n:s===c?i=1/3+t-r:l===c&&(i=2/3+n-t),i<0?i+=1:i>1&&(i-=1)),[i*360,a*100,c*100]};Ut.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const i=Ut.rgb.hsl(e)[0],a=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,a*100,r*100]};Ut.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r),a=(1-t-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,s=(1-r-i)/(1-i)||0;return[a*100,o*100,s*100,i*100]};function wMt(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}Ut.rgb.keyword=function(e){const t=QMe[e];if(t)return t;let n=1/0,r;for(const i of Object.keys(zA)){const a=zA[i],o=wMt(e,a);o<n&&(n=o,r=i)}return r};Ut.keyword.rgb=function(e){return zA[e]};Ut.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;const i=t*.4124+n*.3576+r*.1805,a=t*.2126+n*.7152+r*.0722,o=t*.0193+n*.1192+r*.9505;return[i*100,a*100,o*100]};Ut.rgb.lab=function(e){const t=Ut.rgb.xyz(e);let n=t[0],r=t[1],i=t[2];n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;const a=116*r-16,o=500*(n-r),s=200*(r-i);return[a,o,s]};Ut.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let i,a,o;if(n===0)return o=r*255,[o,o,o];r<.5?i=r*(1+n):i=r+n-r*n;const s=2*r-i,l=[0,0,0];for(let c=0;c<3;c++)a=t+1/3*-(c-1),a<0&&a++,a>1&&a--,6*a<1?o=s+(i-s)*6*a:2*a<1?o=i:3*a<2?o=s+(i-s)*(2/3-a)*6:o=s,l[c]=o*255;return l};Ut.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,i=n;const a=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=a<=1?a:2-a;const o=(r+n)/2,s=r===0?2*i/(a+i):2*n/(r+n);return[t,s*100,o*100]};Ut.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const i=Math.floor(t)%6,a=t-Math.floor(t),o=255*r*(1-n),s=255*r*(1-n*a),l=255*r*(1-n*(1-a));switch(r*=255,i){case 0:return[r,l,o];case 1:return[s,r,o];case 2:return[o,r,l];case 3:return[o,s,r];case 4:return[l,o,r];case 5:return[r,o,s]}};Ut.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01);let a,o;o=(2-n)*r;const s=(2-n)*i;return a=n*i,a/=s<=1?s:2-s,a=a||0,o/=2,[t,a*100,o*100]};Ut.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const i=n+r;let a;i>1&&(n/=i,r/=i);const o=Math.floor(6*t),s=1-r;a=6*t-o,o&1&&(a=1-a);const l=n+a*(s-n);let c,u,f;switch(o){default:case 6:case 0:c=s,u=l,f=n;break;case 1:c=l,u=s,f=n;break;case 2:c=n,u=s,f=l;break;case 3:c=n,u=l,f=s;break;case 4:c=l,u=n,f=s;break;case 5:c=s,u=n,f=l;break}return[c*255,u*255,f*255]};Ut.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100,a=1-Math.min(1,t*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),s=1-Math.min(1,r*(1-i)+i);return[a*255,o*255,s*255]};Ut.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let i,a,o;return i=t*3.2406+n*-1.5372+r*-.4986,a=t*-.9689+n*1.8758+r*.0415,o=t*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]};Ut.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;const i=116*n-16,a=500*(t-n),o=200*(n-r);return[i,a,o]};Ut.lab.xyz=function(e){const t=e[0],n=e[1],r=e[2];let i,a,o;a=(t+16)/116,i=n/500+a,o=a-r/200;const s=a**3,l=i**3,c=o**3;return a=s>.008856?s:(a-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]};Ut.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let i;i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360);const o=Math.sqrt(n*n+r*r);return[t,o,i]};Ut.lch.lab=function(e){const t=e[0],n=e[1],i=e[2]/360*2*Math.PI,a=n*Math.cos(i),o=n*Math.sin(i);return[t,a,o]};Ut.rgb.ansi16=function(e,t=null){const[n,r,i]=e;let a=t===null?Ut.rgb.hsv(e)[2]:t;if(a=Math.round(a/50),a===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return a===2&&(o+=60),o};Ut.hsv.ansi16=function(e){return Ut.rgb.ansi16(Ut.hsv.rgb(e),e[2])};Ut.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};Ut.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=(~~(e>50)+1)*.5,r=(t&1)*n*255,i=(t>>1&1)*n*255,a=(t>>2&1)*n*255;return[r,i,a]};Ut.ansi256.rgb=function(e){if(e>=232){const a=(e-232)*10+8;return[a,a,a]}e-=16;let t;const n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,i=t%6/5*255;return[n,r,i]};Ut.rgb.hex=function(e){const n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};Ut.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split("").map(s=>s+s).join(""));const r=parseInt(n,16),i=r>>16&255,a=r>>8&255,o=r&255;return[i,a,o]};Ut.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),o=i-a;let s,l;return o<1?s=a/(1-o):s=0,o<=0?l=0:i===t?l=(n-r)/o%6:i===n?l=2+(r-t)/o:l=4+(t-n)/o,l/=6,l%=1,[l*360,o*100,s*100]};Ut.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],r*100,i*100]};Ut.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]};Ut.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];const i=[0,0,0],a=t%1*6,o=a%1,s=1-o;let l=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return l=(1-n)*r,[(n*i[0]+l)*255,(n*i[1]+l)*255,(n*i[2]+l)*255]};Ut.hcg.hsv=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);let i=0;return r>0&&(i=t/r),[e[0],i*100,r*100]};Ut.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let i=0;return r>0&&r<.5?i=t/(2*r):r>=.5&&r<1&&(i=t/(2*(1-r))),[e[0],i*100,r*100]};Ut.hcg.hwb=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};Ut.hwb.hcg=function(e){const t=e[1]/100,r=1-e[2]/100,i=r-t;let a=0;return i<1&&(a=(r-i)/(1-i)),[e[0],i*100,a*100]};Ut.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};Ut.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};Ut.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};Ut.gray.hsl=function(e){return[0,0,e[0]]};Ut.gray.hsv=Ut.gray.hsl;Ut.gray.hwb=function(e){return[0,100,e[0]]};Ut.gray.cmyk=function(e){return[0,0,0,e[0]]};Ut.gray.lab=function(e){return[e[0],0,0]};Ut.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r};Ut.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const iL=zMe;function SMt(){const e={},t=Object.keys(iL);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function _Mt(e){const t=SMt(),n=[e];for(t[e].distance=0;n.length;){const r=n.pop(),i=Object.keys(iL[r]);for(let a=i.length,o=0;o<a;o++){const s=i[o],l=t[s];l.distance===-1&&(l.distance=t[r].distance+1,l.parent=r,n.unshift(s))}}return t}function EMt(e,t){return function(n){return t(e(n))}}function TMt(e,t){const n=[t[e].parent,e];let r=iL[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)n.unshift(t[i].parent),r=EMt(iL[t[i].parent][i],r),i=t[i].parent;return r.conversion=n,r}var CMt=function(e){const t=_Mt(e),n={},r=Object.keys(t);for(let i=r.length,a=0;a<i;a++){const o=r[a];t[o].parent!==null&&(n[o]=TMt(o,t))}return n};const $z=zMe,AMt=CMt,YO={},$Mt=Object.keys($z);function PMt(e){const t=function(...n){const r=n[0];return r==null?r:(r.length>1&&(n=r),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function kMt(e){const t=function(...n){const r=n[0];if(r==null)return r;r.length>1&&(n=r);const i=e(n);if(typeof i=="object")for(let a=i.length,o=0;o<a;o++)i[o]=Math.round(i[o]);return i};return"conversion"in e&&(t.conversion=e.conversion),t}$Mt.forEach(e=>{YO[e]={},Object.defineProperty(YO[e],"channels",{value:$z[e].channels}),Object.defineProperty(YO[e],"labels",{value:$z[e].labels});const t=AMt(e);Object.keys(t).forEach(r=>{const i=t[r];YO[e][r]=kMt(i),YO[e][r].raw=PMt(i)})});var RMt=YO;const XO=xMt,ac=RMt,WMe=["keyword","gray","hex"],Pz={};for(const e of Object.keys(ac))Pz[[...ac[e].labels].sort().join("")]=e;const aL={};function co(e,t){if(!(this instanceof co))return new co(e,t);if(t&&t in WMe&&(t=null),t&&!(t in ac))throw new Error("Unknown model: "+t);let n,r;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof co)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e=="string"){const i=XO.get(e);if(i===null)throw new Error("Unable to parse color from string: "+e);this.model=i.model,r=ac[this.model].channels,this.color=i.value.slice(0,r),this.valpha=typeof i.value[r]=="number"?i.value[r]:1}else if(e.length>0){this.model=t||"rgb",r=ac[this.model].channels;const i=Array.prototype.slice.call(e,0,r);this.color=kz(i,r),this.valpha=typeof e[r]=="number"?e[r]:1}else if(typeof e=="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;const i=Object.keys(e);"alpha"in e&&(i.splice(i.indexOf("alpha"),1),this.valpha=typeof e.alpha=="number"?e.alpha:0);const a=i.sort().join("");if(!(a in Pz))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=Pz[a];const{labels:o}=ac[this.model],s=[];for(n=0;n<o.length;n++)s.push(e[o[n]]);this.color=kz(s)}if(aL[this.model])for(r=ac[this.model].channels,n=0;n<r;n++){const i=aL[this.model][n];i&&(this.color[n]=i(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}co.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in XO.to?this:this.rgb();t=t.round(typeof e=="number"?e:1);const n=t.valpha===1?t.color:[...t.color,this.valpha];return XO.to[t.model](n)},percentString(e){const t=this.rgb().round(typeof e=="number"?e:1),n=t.valpha===1?t.color:[...t.color,this.valpha];return XO.to.rgb.percent(n)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){const e={},{channels:t}=ac[this.model],{labels:n}=ac[this.model];for(let r=0;r<t;r++)e[n[r]]=this.color[r];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray(){const e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject(){const e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new co([...this.color.map(NMt(e)),this.valpha],this.model)},alpha(e){return e!==void 0?new co([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:sa("rgb",0,La(255)),green:sa("rgb",1,La(255)),blue:sa("rgb",2,La(255)),hue:sa(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:sa("hsl",1,La(100)),lightness:sa("hsl",2,La(100)),saturationv:sa("hsv",1,La(100)),value:sa("hsv",2,La(100)),chroma:sa("hcg",1,La(100)),gray:sa("hcg",2,La(100)),white:sa("hwb",1,La(100)),wblack:sa("hwb",2,La(100)),cyan:sa("cmyk",0,La(100)),magenta:sa("cmyk",1,La(100)),yellow:sa("cmyk",2,La(100)),black:sa("cmyk",3,La(100)),x:sa("xyz",0,La(95.047)),y:sa("xyz",1,La(100)),z:sa("xyz",2,La(108.833)),l:sa("lab",0,La(100)),a:sa("lab",1),b:sa("lab",2),keyword(e){return e!==void 0?new co(e):ac[this.model].keyword(this.color)},hex(e){return e!==void 0?new co(e):XO.to.hex(this.rgb().round().color)},hexa(e){if(e!==void 0)return new co(e);const t=this.rgb().round().color;let n=Math.round(this.valpha*255).toString(16).toUpperCase();return n.length===1&&(n="0"+n),XO.to.hex(t)+n},rgbNumber(){const e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){const e=this.rgb().color,t=[];for(const[n,r]of e.entries()){const i=r/255;t[n]=i<=.04045?i/12.92:((i+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=e[0]*.3+e[1]*.59+e[2]*.11;return co.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const n=e.rgb(),r=this.rgb(),i=t===void 0?.5:t,a=2*i-1,o=n.alpha()-r.alpha(),s=((a*o===-1?a:(a+o)/(1+a*o))+1)/2,l=1-s;return co.rgb(s*n.red()+l*r.red(),s*n.green()+l*r.green(),s*n.blue()+l*r.blue(),n.alpha()*i+r.alpha()*(1-i))}};for(const e of Object.keys(ac)){if(WMe.includes(e))continue;const{channels:t}=ac[e];co.prototype[e]=function(...n){return this.model===e?new co(this):n.length>0?new co(n,e):new co([...MMt(ac[this.model][e].raw(this.color)),this.valpha],e)},co[e]=function(...n){let r=n[0];return typeof r=="number"&&(r=kz(n,t)),new co(r,e)}}function IMt(e,t){return Number(e.toFixed(t))}function NMt(e){return function(t){return IMt(t,e)}}function sa(e,t,n){e=Array.isArray(e)?e:[e];for(const r of e)(aL[r]||(aL[r]=[]))[t]=n;return e=e[0],function(r){let i;return r!==void 0?(n&&(r=n(r)),i=this[e](),i.color[t]=r,i):(i=this[e]().color[t],n&&(i=n(i)),i)}}function La(e){return function(t){return Math.max(0,Math.min(e,t))}}function MMt(e){return Array.isArray(e)?e:[e]}function kz(e,t){for(let n=0;n<t;n++)typeof e[n]!="number"&&(e[n]=0);return e}var DMt=co;const Hue=Nn(DMt);function LMt(e){const t=e[0],n=e[1],r=e[2];let i,a,o;return i=t*1+n*0+r*1.13983,a=t*1+n*-.39465+r*-.5806,o=t*1+n*2.02311+r*0,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]}function jMt(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=t*.299+n*.587+r*.114,a=t*-.14713+n*-.28886+r*.436,o=t*.615+n*-.51499+r*-.10001;return[i,a,o]}const FMt={scheme:"threezerotwofour",author:"jan t. sott (http://github.com/idleberg)",base00:"#090300",base01:"#3a3432",base02:"#4a4543",base03:"#5c5855",base04:"#807d7c",base05:"#a5a2a2",base06:"#d6d5d4",base07:"#f7f7f7",base08:"#db2d20",base09:"#e8bbd0",base0A:"#fded02",base0B:"#01a252",base0C:"#b5e4f4",base0D:"#01a0e4",base0E:"#a16a94",base0F:"#cdab53"},BMt={scheme:"apathy",author:"jannik siebert (https://github.com/janniks)",base00:"#031A16",base01:"#0B342D",base02:"#184E45",base03:"#2B685E",base04:"#5F9C92",base05:"#81B5AC",base06:"#A7CEC8",base07:"#D2E7E4",base08:"#3E9688",base09:"#3E7996",base0A:"#3E4C96",base0B:"#883E96",base0C:"#963E4C",base0D:"#96883E",base0E:"#4C963E",base0F:"#3E965B"},UMt={scheme:"ashes",author:"jannik siebert (https://github.com/janniks)",base00:"#1C2023",base01:"#393F45",base02:"#565E65",base03:"#747C84",base04:"#ADB3BA",base05:"#C7CCD1",base06:"#DFE2E5",base07:"#F3F4F5",base08:"#C7AE95",base09:"#C7C795",base0A:"#AEC795",base0B:"#95C7AE",base0C:"#95AEC7",base0D:"#AE95C7",base0E:"#C795AE",base0F:"#C79595"},VMt={scheme:"atelier dune",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune)",base00:"#20201d",base01:"#292824",base02:"#6e6b5e",base03:"#7d7a68",base04:"#999580",base05:"#a6a28c",base06:"#e8e4cf",base07:"#fefbec",base08:"#d73737",base09:"#b65611",base0A:"#cfb017",base0B:"#60ac39",base0C:"#1fad83",base0D:"#6684e1",base0E:"#b854d4",base0F:"#d43552"},QMt={scheme:"atelier forest",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/forest)",base00:"#1b1918",base01:"#2c2421",base02:"#68615e",base03:"#766e6b",base04:"#9c9491",base05:"#a8a19f",base06:"#e6e2e0",base07:"#f1efee",base08:"#f22c40",base09:"#df5320",base0A:"#d5911a",base0B:"#5ab738",base0C:"#00ad9c",base0D:"#407ee7",base0E:"#6666ea",base0F:"#c33ff3"},zMt={scheme:"atelier heath",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/heath)",base00:"#1b181b",base01:"#292329",base02:"#695d69",base03:"#776977",base04:"#9e8f9e",base05:"#ab9bab",base06:"#d8cad8",base07:"#f7f3f7",base08:"#ca402b",base09:"#a65926",base0A:"#bb8a35",base0B:"#379a37",base0C:"#159393",base0D:"#516aec",base0E:"#7b59c0",base0F:"#cc33cc"},WMt={scheme:"atelier lakeside",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/lakeside/)",base00:"#161b1d",base01:"#1f292e",base02:"#516d7b",base03:"#5a7b8c",base04:"#7195a8",base05:"#7ea2b4",base06:"#c1e4f6",base07:"#ebf8ff",base08:"#d22d72",base09:"#935c25",base0A:"#8a8a0f",base0B:"#568c3b",base0C:"#2d8f6f",base0D:"#257fad",base0E:"#5d5db1",base0F:"#b72dd2"},HMt={scheme:"atelier seaside",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/seaside/)",base00:"#131513",base01:"#242924",base02:"#5e6e5e",base03:"#687d68",base04:"#809980",base05:"#8ca68c",base06:"#cfe8cf",base07:"#f0fff0",base08:"#e6193c",base09:"#87711d",base0A:"#c3c322",base0B:"#29a329",base0C:"#1999b3",base0D:"#3d62f5",base0E:"#ad2bee",base0F:"#e619c3"},qMt={scheme:"bespin",author:"jan t. sott",base00:"#28211c",base01:"#36312e",base02:"#5e5d5c",base03:"#666666",base04:"#797977",base05:"#8a8986",base06:"#9d9b97",base07:"#baae9e",base08:"#cf6a4c",base09:"#cf7d34",base0A:"#f9ee98",base0B:"#54be0d",base0C:"#afc4db",base0D:"#5ea6ea",base0E:"#9b859d",base0F:"#937121"},GMt={scheme:"brewer",author:"timothée poisot (http://github.com/tpoisot)",base00:"#0c0d0e",base01:"#2e2f30",base02:"#515253",base03:"#737475",base04:"#959697",base05:"#b7b8b9",base06:"#dadbdc",base07:"#fcfdfe",base08:"#e31a1c",base09:"#e6550d",base0A:"#dca060",base0B:"#31a354",base0C:"#80b1d3",base0D:"#3182bd",base0E:"#756bb1",base0F:"#b15928"},ZMt={scheme:"bright",author:"chris kempson (http://chriskempson.com)",base00:"#000000",base01:"#303030",base02:"#505050",base03:"#b0b0b0",base04:"#d0d0d0",base05:"#e0e0e0",base06:"#f5f5f5",base07:"#ffffff",base08:"#fb0120",base09:"#fc6d24",base0A:"#fda331",base0B:"#a1c659",base0C:"#76c7b7",base0D:"#6fb3d2",base0E:"#d381c3",base0F:"#be643c"},YMt={scheme:"chalk",author:"chris kempson (http://chriskempson.com)",base00:"#151515",base01:"#202020",base02:"#303030",base03:"#505050",base04:"#b0b0b0",base05:"#d0d0d0",base06:"#e0e0e0",base07:"#f5f5f5",base08:"#fb9fb1",base09:"#eda987",base0A:"#ddb26f",base0B:"#acc267",base0C:"#12cfc0",base0D:"#6fc2ef",base0E:"#e1a3ee",base0F:"#deaf8f"},XMt={scheme:"codeschool",author:"brettof86",base00:"#232c31",base01:"#1c3657",base02:"#2a343a",base03:"#3f4944",base04:"#84898c",base05:"#9ea7a6",base06:"#a7cfa3",base07:"#b5d8f6",base08:"#2a5491",base09:"#43820d",base0A:"#a03b1e",base0B:"#237986",base0C:"#b02f30",base0D:"#484d79",base0E:"#c59820",base0F:"#c98344"},KMt={scheme:"colors",author:"mrmrs (http://clrs.cc)",base00:"#111111",base01:"#333333",base02:"#555555",base03:"#777777",base04:"#999999",base05:"#bbbbbb",base06:"#dddddd",base07:"#ffffff",base08:"#ff4136",base09:"#ff851b",base0A:"#ffdc00",base0B:"#2ecc40",base0C:"#7fdbff",base0D:"#0074d9",base0E:"#b10dc9",base0F:"#85144b"},JMt={scheme:"default",author:"chris kempson (http://chriskempson.com)",base00:"#181818",base01:"#282828",base02:"#383838",base03:"#585858",base04:"#b8b8b8",base05:"#d8d8d8",base06:"#e8e8e8",base07:"#f8f8f8",base08:"#ab4642",base09:"#dc9656",base0A:"#f7ca88",base0B:"#a1b56c",base0C:"#86c1b9",base0D:"#7cafc2",base0E:"#ba8baf",base0F:"#a16946"},eDt={scheme:"eighties",author:"chris kempson (http://chriskempson.com)",base00:"#2d2d2d",base01:"#393939",base02:"#515151",base03:"#747369",base04:"#a09f93",base05:"#d3d0c8",base06:"#e8e6df",base07:"#f2f0ec",base08:"#f2777a",base09:"#f99157",base0A:"#ffcc66",base0B:"#99cc99",base0C:"#66cccc",base0D:"#6699cc",base0E:"#cc99cc",base0F:"#d27b53"},tDt={scheme:"embers",author:"jannik siebert (https://github.com/janniks)",base00:"#16130F",base01:"#2C2620",base02:"#433B32",base03:"#5A5047",base04:"#8A8075",base05:"#A39A90",base06:"#BEB6AE",base07:"#DBD6D1",base08:"#826D57",base09:"#828257",base0A:"#6D8257",base0B:"#57826D",base0C:"#576D82",base0D:"#6D5782",base0E:"#82576D",base0F:"#825757"},nDt={scheme:"flat",author:"chris kempson (http://chriskempson.com)",base00:"#2C3E50",base01:"#34495E",base02:"#7F8C8D",base03:"#95A5A6",base04:"#BDC3C7",base05:"#e0e0e0",base06:"#f5f5f5",base07:"#ECF0F1",base08:"#E74C3C",base09:"#E67E22",base0A:"#F1C40F",base0B:"#2ECC71",base0C:"#1ABC9C",base0D:"#3498DB",base0E:"#9B59B6",base0F:"#be643c"},rDt={scheme:"google",author:"seth wright (http://sethawright.com)",base00:"#1d1f21",base01:"#282a2e",base02:"#373b41",base03:"#969896",base04:"#b4b7b4",base05:"#c5c8c6",base06:"#e0e0e0",base07:"#ffffff",base08:"#CC342B",base09:"#F96A38",base0A:"#FBA922",base0B:"#198844",base0C:"#3971ED",base0D:"#3971ED",base0E:"#A36AC7",base0F:"#3971ED"},iDt={scheme:"grayscale",author:"alexandre gavioli (https://github.com/alexx2/)",base00:"#101010",base01:"#252525",base02:"#464646",base03:"#525252",base04:"#ababab",base05:"#b9b9b9",base06:"#e3e3e3",base07:"#f7f7f7",base08:"#7c7c7c",base09:"#999999",base0A:"#a0a0a0",base0B:"#8e8e8e",base0C:"#868686",base0D:"#686868",base0E:"#747474",base0F:"#5e5e5e"},aDt={scheme:"green screen",author:"chris kempson (http://chriskempson.com)",base00:"#001100",base01:"#003300",base02:"#005500",base03:"#007700",base04:"#009900",base05:"#00bb00",base06:"#00dd00",base07:"#00ff00",base08:"#007700",base09:"#009900",base0A:"#007700",base0B:"#00bb00",base0C:"#005500",base0D:"#009900",base0E:"#00bb00",base0F:"#005500"},oDt={scheme:"harmonic16",author:"jannik siebert (https://github.com/janniks)",base00:"#0b1c2c",base01:"#223b54",base02:"#405c79",base03:"#627e99",base04:"#aabcce",base05:"#cbd6e2",base06:"#e5ebf1",base07:"#f7f9fb",base08:"#bf8b56",base09:"#bfbf56",base0A:"#8bbf56",base0B:"#56bf8b",base0C:"#568bbf",base0D:"#8b56bf",base0E:"#bf568b",base0F:"#bf5656"},sDt={scheme:"hopscotch",author:"jan t. sott",base00:"#322931",base01:"#433b42",base02:"#5c545b",base03:"#797379",base04:"#989498",base05:"#b9b5b8",base06:"#d5d3d5",base07:"#ffffff",base08:"#dd464c",base09:"#fd8b19",base0A:"#fdcc59",base0B:"#8fc13e",base0C:"#149b93",base0D:"#1290bf",base0E:"#c85e7c",base0F:"#b33508"},lDt={scheme:"isotope",author:"jan t. sott",base00:"#000000",base01:"#404040",base02:"#606060",base03:"#808080",base04:"#c0c0c0",base05:"#d0d0d0",base06:"#e0e0e0",base07:"#ffffff",base08:"#ff0000",base09:"#ff9900",base0A:"#ff0099",base0B:"#33ff00",base0C:"#00ffff",base0D:"#0066ff",base0E:"#cc00ff",base0F:"#3300ff"},cDt={scheme:"marrakesh",author:"alexandre gavioli (http://github.com/alexx2/)",base00:"#201602",base01:"#302e00",base02:"#5f5b17",base03:"#6c6823",base04:"#86813b",base05:"#948e48",base06:"#ccc37a",base07:"#faf0a5",base08:"#c35359",base09:"#b36144",base0A:"#a88339",base0B:"#18974e",base0C:"#75a738",base0D:"#477ca1",base0E:"#8868b3",base0F:"#b3588e"},uDt={scheme:"mocha",author:"chris kempson (http://chriskempson.com)",base00:"#3B3228",base01:"#534636",base02:"#645240",base03:"#7e705a",base04:"#b8afad",base05:"#d0c8c6",base06:"#e9e1dd",base07:"#f5eeeb",base08:"#cb6077",base09:"#d28b71",base0A:"#f4bc87",base0B:"#beb55b",base0C:"#7bbda4",base0D:"#8ab3b5",base0E:"#a89bb9",base0F:"#bb9584"},fDt={scheme:"monokai",author:"wimer hazenberg (http://www.monokai.nl)",base00:"#272822",base01:"#383830",base02:"#49483e",base03:"#75715e",base04:"#a59f85",base05:"#f8f8f2",base06:"#f5f4f1",base07:"#f9f8f5",base08:"#f92672",base09:"#fd971f",base0A:"#f4bf75",base0B:"#a6e22e",base0C:"#a1efe4",base0D:"#66d9ef",base0E:"#ae81ff",base0F:"#cc6633"},dDt={scheme:"nicinabox",author:"nicinabox (http://github.com/nicinabox)",base00:"#2A2F3A",base01:"#3C444F",base02:"#4F5A65",base03:"#BEBEBE",base04:"#b0b0b0",base05:"#d0d0d0",base06:"#FFFFFF",base07:"#f5f5f5",base08:"#fb9fb1",base09:"#FC6D24",base0A:"#ddb26f",base0B:"#A1C659",base0C:"#12cfc0",base0D:"#6FB3D2",base0E:"#D381C3",base0F:"#deaf8f"},hDt={scheme:"ocean",author:"chris kempson (http://chriskempson.com)",base00:"#2b303b",base01:"#343d46",base02:"#4f5b66",base03:"#65737e",base04:"#a7adba",base05:"#c0c5ce",base06:"#dfe1e8",base07:"#eff1f5",base08:"#bf616a",base09:"#d08770",base0A:"#ebcb8b",base0B:"#a3be8c",base0C:"#96b5b4",base0D:"#8fa1b3",base0E:"#b48ead",base0F:"#ab7967"},pDt={scheme:"paraiso",author:"jan t. sott",base00:"#2f1e2e",base01:"#41323f",base02:"#4f424c",base03:"#776e71",base04:"#8d8687",base05:"#a39e9b",base06:"#b9b6b0",base07:"#e7e9db",base08:"#ef6155",base09:"#f99b15",base0A:"#fec418",base0B:"#48b685",base0C:"#5bc4bf",base0D:"#06b6ef",base0E:"#815ba4",base0F:"#e96ba8"},mDt={scheme:"pop",author:"chris kempson (http://chriskempson.com)",base00:"#000000",base01:"#202020",base02:"#303030",base03:"#505050",base04:"#b0b0b0",base05:"#d0d0d0",base06:"#e0e0e0",base07:"#ffffff",base08:"#eb008a",base09:"#f29333",base0A:"#f8ca12",base0B:"#37b349",base0C:"#00aabb",base0D:"#0e5a94",base0E:"#b31e8d",base0F:"#7a2d00"},gDt={scheme:"railscasts",author:"ryan bates (http://railscasts.com)",base00:"#2b2b2b",base01:"#272935",base02:"#3a4055",base03:"#5a647e",base04:"#d4cfc9",base05:"#e6e1dc",base06:"#f4f1ed",base07:"#f9f7f3",base08:"#da4939",base09:"#cc7833",base0A:"#ffc66d",base0B:"#a5c261",base0C:"#519f50",base0D:"#6d9cbe",base0E:"#b6b3eb",base0F:"#bc9458"},vDt={scheme:"shapeshifter",author:"tyler benziger (http://tybenz.com)",base00:"#000000",base01:"#040404",base02:"#102015",base03:"#343434",base04:"#555555",base05:"#ababab",base06:"#e0e0e0",base07:"#f9f9f9",base08:"#e92f2f",base09:"#e09448",base0A:"#dddd13",base0B:"#0ed839",base0C:"#23edda",base0D:"#3b48e3",base0E:"#f996e2",base0F:"#69542d"},yDt={scheme:"solarized",author:"ethan schoonover (http://ethanschoonover.com/solarized)",base00:"#002b36",base01:"#073642",base02:"#586e75",base03:"#657b83",base04:"#839496",base05:"#93a1a1",base06:"#eee8d5",base07:"#fdf6e3",base08:"#dc322f",base09:"#cb4b16",base0A:"#b58900",base0B:"#859900",base0C:"#2aa198",base0D:"#268bd2",base0E:"#6c71c4",base0F:"#d33682"},bDt={scheme:"summerfruit",author:"christopher corley (http://cscorley.github.io/)",base00:"#151515",base01:"#202020",base02:"#303030",base03:"#505050",base04:"#B0B0B0",base05:"#D0D0D0",base06:"#E0E0E0",base07:"#FFFFFF",base08:"#FF0086",base09:"#FD8900",base0A:"#ABA800",base0B:"#00C918",base0C:"#1faaaa",base0D:"#3777E6",base0E:"#AD00A1",base0F:"#cc6633"},ODt={scheme:"tomorrow",author:"chris kempson (http://chriskempson.com)",base00:"#1d1f21",base01:"#282a2e",base02:"#373b41",base03:"#969896",base04:"#b4b7b4",base05:"#c5c8c6",base06:"#e0e0e0",base07:"#ffffff",base08:"#cc6666",base09:"#de935f",base0A:"#f0c674",base0B:"#b5bd68",base0C:"#8abeb7",base0D:"#81a2be",base0E:"#b294bb",base0F:"#a3685a"},xDt={scheme:"london tube",author:"jan t. sott",base00:"#231f20",base01:"#1c3f95",base02:"#5a5758",base03:"#737171",base04:"#959ca1",base05:"#d9d8d8",base06:"#e7e7e8",base07:"#ffffff",base08:"#ee2e24",base09:"#f386a1",base0A:"#ffd204",base0B:"#00853e",base0C:"#85cebc",base0D:"#009ddc",base0E:"#98005d",base0F:"#b06110"},wDt={scheme:"twilight",author:"david hart (http://hart-dev.com)",base00:"#1e1e1e",base01:"#323537",base02:"#464b50",base03:"#5f5a60",base04:"#838184",base05:"#a7a7a7",base06:"#c3c3c3",base07:"#ffffff",base08:"#cf6a4c",base09:"#cda869",base0A:"#f9ee98",base0B:"#8f9d6a",base0C:"#afc4db",base0D:"#7587a6",base0E:"#9b859d",base0F:"#9b703f"},HMe={threezerotwofour:FMt,apathy:BMt,ashes:UMt,atelierDune:VMt,atelierForest:QMt,atelierHeath:zMt,atelierLakeside:WMt,atelierSeaside:HMt,bespin:qMt,brewer:GMt,bright:ZMt,chalk:YMt,codeschool:XMt,colors:KMt,default:JMt,eighties:eDt,embers:tDt,flat:nDt,google:rDt,grayscale:iDt,greenscreen:aDt,harmonic:oDt,hopscotch:sDt,isotope:lDt,marrakesh:cDt,mocha:uDt,monokai:fDt,nicinabox:dDt,ocean:hDt,paraiso:pDt,pop:mDt,railscasts:gDt,shapeshifter:vDt,solarized:yDt,summerfruit:bDt,tomorrow:ODt,tube:xDt,twilight:wDt},qMe=HMe.default,que=Object.keys(qMe),SDt=e=>e<.25?1:e<.5?.9-e:1.1-e,_Dt=e=>{const t=Hue(e),[n,r,i]=jMt(t.array()),a=[SDt(n),r,i],o=LMt(a);return Hue.rgb(o).hex()},$O=e=>t=>({className:[t.className,e.className].filter(Boolean).join(" "),style:{...t.style||{},...e.style||{}}}),EDt=(e,t)=>{if(e===void 0)return t;if(t===void 0)return e;const n=typeof e,r=typeof t;switch(n){case"string":switch(r){case"string":return[t,e].filter(Boolean).join(" ");case"object":return $O({className:e,style:t});case"function":return(i,...a)=>$O({className:e})(t(i,...a))}break;case"object":switch(r){case"string":return $O({className:t,style:e});case"object":return{...t,...e};case"function":return(i,...a)=>$O({style:e})(t(i,...a))}break;case"function":switch(r){case"string":return(i,...a)=>e($O(i)({className:t}),...a);case"object":return(i,...a)=>e($O(i)({style:t}),...a);case"function":return(i,...a)=>e(t(i,...a),...a)}}},TDt=(e,t)=>{const n=Object.keys(t);for(const r in e)n.indexOf(r)===-1&&n.push(r);return n.reduce((r,i)=>(r[i]=EDt(e[i],t[i]),r),{})},CDt=(e,t,...n)=>{if(t===null)return e;Array.isArray(t)||(t=[t]);const i=t.map(a=>e[a]).filter(Boolean).reduce((a,o)=>(typeof o=="string"?a.className=[a.className,o].filter(Boolean).join(" "):typeof o=="object"?a.style={...a.style,...o}:typeof o=="function"&&(a={...a,...o(a,...n)}),a),{className:"",style:{}});return i.className||delete i.className,Object.keys(i.style).length===0&&delete i.style,i},Rz=e=>Object.keys(e).reduce((t,n)=>(t[n]=/^base/.test(n)?_Dt(e[n]):n==="scheme"?e[n]+":inverted":e[n],t),{}),ADt=$D((e,t={},n={},...r)=>{const{defaultBase16:i=qMe,base16Themes:a=null}=t,o=$Dt(n,a);o&&(n={...o,...n});const s=que.reduce((f,d)=>(f[d]=n[d]||i[d],f),{}),l=Object.keys(n).reduce((f,d)=>(que.indexOf(d)===-1&&(f[d]=n[d]),f),{}),c=e(s),u=TDt(l,c);return $D(CDt,2)(u,...r)},3),GMe=e=>!!e.extend,$Dt=(e,t)=>{if(e&&GMe(e)&&e.extend&&(e=e.extend),typeof e=="string"){const[n,r]=e.split(":");t?e=t[n]:e=HMe[n],r==="inverted"&&(e=Rz(e))}return e&&Object.prototype.hasOwnProperty.call(e,"base00")?e:void 0},PDt=e=>typeof e=="string"?`${e}:inverted`:e&&GMe(e)&&e.extend?typeof e.extend=="string"?{...e,extend:`${e.extend}:inverted`}:{...e,extend:Rz(e.extend)}:e&&Rz(e);function kDt(e){const t=Object.prototype.toString.call(e).slice(8,-1);return t==="Object"&&typeof e[Symbol.iterator]=="function"?"Iterable":t==="Custom"&&e.constructor!==Object&&e instanceof Object?"Object":t}function ZMe({styling:e,arrowStyle:t="single",expanded:n,nodeType:r,onClick:i}){return j.createElement("div",{...e("arrowContainer",t),onClick:i},j.createElement("div",{...e(["arrow","arrowSign"],r,n,t)},"▶",t==="double"&&j.createElement("div",{...e(["arrowSign","arrowSignInner"])},"▶")))}function RDt(e,t){return e==="Object"?Object.keys(t).length:e==="Array"?t.length:1/0}function IDt(e){return typeof e.set=="function"}function NDt(e,t,n,r=0,i=1/0){let a;if(e==="Object"){let o=Object.getOwnPropertyNames(t);n&&o.sort(n===!0?void 0:n),o=o.slice(r,i+1),a={entries:o.map(s=>({key:s,value:t[s]}))}}else if(e==="Array")a={entries:t.slice(r,i+1).map((o,s)=>({key:s+r,value:o}))};else{let o=0;const s=[];let l=!0;const c=IDt(t);for(const u of t){if(o>i){l=!1;break}r<=o&&(c&&Array.isArray(u)?typeof u[0]=="string"||typeof u[0]=="number"?s.push({key:u[0],value:u[1]}):s.push({key:`[entry ${o}]`,value:{"[key]":u[0],"[value]":u[1]}}):s.push({key:o,value:u})),o++}a={hasMore:!l,entries:s}}return a}function BB(e,t,n){const r=[];for(;t-e>n*n;)n=n*n;for(let i=e;i<=t;i+=n)r.push({from:i,to:Math.min(t,i+n-1)});return r}function MDt(e,t,n,r,i=0,a=1/0){const o=NDt.bind(null,e,t,n);if(!r)return o().entries;const s=a<1/0,l=Math.min(a-i,RDt(e,t));if(e!=="Iterable"){if(l<=r||r<7)return o(i,a).entries}else if(l<=r&&!s)return o(i,a).entries;let c;if(e==="Iterable"){const{hasMore:u,entries:f}=o(i,i+r-1);c=u?[...f,...BB(i+r,i+2*r-1,r)]:f}else c=s?BB(i,a,r):[...o(0,r-5).entries,...BB(r-4,l-5,r),...o(l-4,l-1).entries];return c}function DDt(e){const{styling:t,from:n,to:r,renderChildNodes:i,nodeType:a}=e,[o,s]=_.useState(!1),l=_.useCallback(()=>{s(!o)},[o]);return o?j.createElement("div",{...t("itemRange",o)},i(e,n,r)):j.createElement("div",{...t("itemRange",o),onClick:l},j.createElement(ZMe,{nodeType:a,styling:t,expanded:!1,onClick:l,arrowStyle:"double"}),`${n} ... ${r}`)}function LDt(e){return e.to!==void 0}function YMe(e,t,n){const{nodeType:r,data:i,collectionLimit:a,circularCache:o,keyPath:s,postprocessValue:l,sortObjectKeys:c}=e,u=[];return MDt(r,i,c,a,t,n).forEach(f=>{if(LDt(f))u.push(j.createElement(DDt,{...e,key:`ItemRange--${f.from}-${f.to}`,from:f.from,to:f.to,renderChildNodes:YMe}));else{const{key:d,value:h}=f,p=o.indexOf(h)!==-1;u.push(j.createElement(XMe,{...e,postprocessValue:l,collectionLimit:a,key:`Node--${d}`,keyPath:[d,...s],value:l(h),circularCache:[...o,h],isCircular:p,hideRoot:!1}))}}),u}function qJ(e){const{circularCache:t=[],collectionLimit:n,createItemString:r,data:i,expandable:a,getItemString:o,hideRoot:s,isCircular:l,keyPath:c,labelRenderer:u,level:f=0,nodeType:d,nodeTypeIndicator:h,shouldExpandNodeInitially:p,styling:m}=e,[g,v]=_.useState(l?!1:p(c,i,f)),b=_.useCallback(()=>{a&&v(!g)},[a,g]),O=g||s&&f===0?YMe({...e,circularCache:t,level:f+1}):null,x=j.createElement("span",{...m("nestedNodeItemType",g)},h),w=o(d,i,x,r(i,n),c),S=[c,d,g,a];return s?j.createElement("li",{...m("rootNode",...S)},j.createElement("ul",{...m("rootNodeChildren",...S)},O)):j.createElement("li",{...m("nestedNode",...S)},a&&j.createElement(ZMe,{styling:m,nodeType:d,expanded:g,onClick:b}),j.createElement("label",{...m(["label","nestedNodeLabel"],...S),onClick:b},u(...S)),j.createElement("span",{...m("nestedNodeItemString",...S),onClick:b},w),j.createElement("ul",{...m("nestedNodeChildren",...S)},O))}function jDt(e){const t=Object.getOwnPropertyNames(e).length;return`${t} ${t!==1?"keys":"key"}`}function FDt({data:e,...t}){return j.createElement(qJ,{...t,data:e,nodeType:"Object",nodeTypeIndicator:t.nodeType==="Error"?"Error()":"{}",createItemString:jDt,expandable:Object.getOwnPropertyNames(e).length>0})}function BDt(e){return`${e.length} ${e.length!==1?"items":"item"}`}function UDt({data:e,...t}){return j.createElement(qJ,{...t,data:e,nodeType:"Array",nodeTypeIndicator:"[]",createItemString:BDt,expandable:e.length>0})}function VDt(e,t){let n=0,r=!1;if(Number.isSafeInteger(e.size))n=e.size;else for(const i of e){if(t&&n+1>t){r=!0;break}n+=1}return`${r?">":""}${n} ${n!==1?"entries":"entry"}`}function QDt(e){return j.createElement(qJ,{...e,nodeType:"Iterable",nodeTypeIndicator:"()",createItemString:VDt,expandable:!0})}function wh({nodeType:e,styling:t,labelRenderer:n,keyPath:r,valueRenderer:i,value:a,valueGetter:o=s=>s}){return j.createElement("li",{...t("value",e,r)},j.createElement("label",{...t(["label","valueLabel"],e,r)},n(r,e,!1,!1)),j.createElement("span",{...t("valueText",e,r)},i(o(a),a,...r)))}function XMe({getItemString:e,keyPath:t,labelRenderer:n,styling:r,value:i,valueRenderer:a,isCustomNode:o,...s}){const l=o(i)?"Custom":kDt(i),c={getItemString:e,key:t[0],keyPath:t,labelRenderer:n,nodeType:l,styling:r,value:i,valueRenderer:a},u={...s,...c,data:i,isCustomNode:o};switch(l){case"Object":case"Error":case"WeakMap":case"WeakSet":return j.createElement(FDt,{...u});case"Array":return j.createElement(UDt,{...u});case"Iterable":case"Map":case"Set":return j.createElement(QDt,{...u});case"String":return j.createElement(wh,{...c,valueGetter:f=>`"${f}"`});case"Number":return j.createElement(wh,{...c});case"Boolean":return j.createElement(wh,{...c,valueGetter:f=>f?"true":"false"});case"Date":return j.createElement(wh,{...c,valueGetter:f=>f.toISOString()});case"Null":return j.createElement(wh,{...c,valueGetter:()=>"null"});case"Undefined":return j.createElement(wh,{...c,valueGetter:()=>"undefined"});case"Function":case"Symbol":return j.createElement(wh,{...c,valueGetter:f=>f.toString()});case"Custom":return j.createElement(wh,{...c});default:return j.createElement(wh,{...c,valueGetter:()=>`<${l}>`})}}const zDt={scheme:"solarized",author:"ethan schoonover (http://ethanschoonover.com/solarized)",base00:"#002b36",base01:"#073642",base02:"#586e75",base03:"#657b83",base04:"#839496",base05:"#93a1a1",base06:"#eee8d5",base07:"#fdf6e3",base08:"#dc322f",base09:"#cb4b16",base0A:"#b58900",base0B:"#859900",base0C:"#2aa198",base0D:"#268bd2",base0E:"#6c71c4",base0F:"#d33682"},WDt=e=>({BACKGROUND_COLOR:e.base00,TEXT_COLOR:e.base07,STRING_COLOR:e.base0B,DATE_COLOR:e.base0B,NUMBER_COLOR:e.base09,BOOLEAN_COLOR:e.base09,NULL_COLOR:e.base08,UNDEFINED_COLOR:e.base08,FUNCTION_COLOR:e.base08,SYMBOL_COLOR:e.base08,LABEL_COLOR:e.base0D,ARROW_COLOR:e.base0D,ITEM_STRING_COLOR:e.base0B,ITEM_STRING_EXPANDED_COLOR:e.base03}),HDt=e=>({String:e.STRING_COLOR,Date:e.DATE_COLOR,Number:e.NUMBER_COLOR,Boolean:e.BOOLEAN_COLOR,Null:e.NULL_COLOR,Undefined:e.UNDEFINED_COLOR,Function:e.FUNCTION_COLOR,Symbol:e.SYMBOL_COLOR}),qDt=e=>{const t=WDt(e);return{tree:{border:0,padding:0,marginTop:"0.5em",marginBottom:"0.5em",marginLeft:"0.125em",marginRight:0,listStyle:"none",MozUserSelect:"none",WebkitUserSelect:"none",backgroundColor:t.BACKGROUND_COLOR},value:({style:n},r,i)=>({style:{...n,paddingTop:"0.25em",paddingRight:0,marginLeft:"0.875em",WebkitUserSelect:"text",MozUserSelect:"text",wordWrap:"break-word",paddingLeft:i.length>1?"2.125em":"1.25em",textIndent:"-0.5em",wordBreak:"break-all"}}),label:{display:"inline-block",color:t.LABEL_COLOR},valueLabel:{margin:"0 0.5em 0 0"},valueText:({style:n},r)=>({style:{...n,color:HDt(t)[r]}}),itemRange:(n,r)=>({style:{paddingTop:r?0:"0.25em",cursor:"pointer",color:t.LABEL_COLOR}}),arrow:({style:n},r,i)=>({style:{...n,marginLeft:0,transition:"150ms",WebkitTransition:"150ms",MozTransition:"150ms",WebkitTransform:i?"rotateZ(90deg)":"rotateZ(0deg)",MozTransform:i?"rotateZ(90deg)":"rotateZ(0deg)",transform:i?"rotateZ(90deg)":"rotateZ(0deg)",transformOrigin:"45% 50%",WebkitTransformOrigin:"45% 50%",MozTransformOrigin:"45% 50%",position:"relative",lineHeight:"1.1em",fontSize:"0.75em"}}),arrowContainer:({style:n},r)=>({style:{...n,display:"inline-block",paddingRight:"0.5em",paddingLeft:r==="double"?"1em":0,cursor:"pointer"}}),arrowSign:{color:t.ARROW_COLOR},arrowSignInner:{position:"absolute",top:0,left:"-0.4em"},nestedNode:({style:n},r,i,a,o)=>({style:{...n,position:"relative",paddingTop:"0.25em",marginLeft:r.length>1?"0.875em":0,paddingLeft:o?0:"1.125em"}}),rootNode:{padding:0,margin:0},nestedNodeLabel:({style:n},r,i,a,o)=>({style:{...n,margin:0,padding:0,WebkitUserSelect:o?"inherit":"text",MozUserSelect:o?"inherit":"text",cursor:o?"pointer":"default"}}),nestedNodeItemString:({style:n},r,i,a)=>({style:{...n,paddingLeft:"0.5em",cursor:"default",color:a?t.ITEM_STRING_EXPANDED_COLOR:t.ITEM_STRING_COLOR}}),nestedNodeItemType:{marginLeft:"0.3em",marginRight:"0.3em"},nestedNodeChildren:({style:n},r,i)=>({style:{...n,padding:0,margin:0,listStyle:"none",display:i?"block":"none"}}),rootNodeChildren:{padding:0,margin:0,listStyle:"none"}}},GDt=ADt(qDt,{defaultBase16:zDt}),ZDt=GDt,Gue=e=>e,YDt=(e,t,n)=>n===0,XDt=(e,t,n,r)=>j.createElement("span",null,n," ",r),KDt=([e])=>j.createElement("span",null,e,":"),JDt=()=>!1;function eLt({data:e,theme:t,invertTheme:n,keyPath:r=["root"],labelRenderer:i=KDt,valueRenderer:a=Gue,shouldExpandNodeInitially:o=YDt,hideRoot:s=!1,getItemString:l=XDt,postprocessValue:c=Gue,isCustomNode:u=JDt,collectionLimit:f=50,sortObjectKeys:d=!1}){const h=_.useMemo(()=>ZDt(n?PDt(t):t),[t,n]);return j.createElement("ul",{...h("tree")},j.createElement(XMe,{keyPath:s?[]:r,value:c(e),isCustomNode:u,styling:h,labelRenderer:i,valueRenderer:a,shouldExpandNodeInitially:o,hideRoot:s,getItemString:l,postprocessValue:c,collectionLimit:f,sortObjectKeys:d}))}const tLt={scheme:"Github",author:"Defman21",base00:"#ffffff",base01:"#f5f5f5",base02:"#c8c8fa",base03:"#969896",base04:"#e8e8e8",base05:"#333333",base06:"#ffffff",base07:"#ffffff",base08:"#ed6a43",base09:"#0086b3",base0A:"#795da3",base0B:"#183691",base0C:"#183691",base0D:"#795da3",base0E:"#a71d5d",base0F:"#333333"},KMe=({data:e})=>{const{resolvedTheme:t}=AMe();return y.jsx(eLt,{data:e,theme:tLt,invertTheme:t==="dark",hideRoot:!0,shouldExpandNodeInitially:()=>!0})};function Np(e){return Array.isArray?Array.isArray(e):tDe(e)==="[object Array]"}const nLt=1/0;function rLt(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-nLt?"-0":t}function iLt(e){return e==null?"":rLt(e)}function jd(e){return typeof e=="string"}function JMe(e){return typeof e=="number"}function aLt(e){return e===!0||e===!1||oLt(e)&&tDe(e)=="[object Boolean]"}function eDe(e){return typeof e=="object"}function oLt(e){return eDe(e)&&e!==null}function ic(e){return e!=null}function UB(e){return!e.trim().length}function tDe(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const sLt="Incorrect 'index' type",lLt=e=>`Invalid value for key ${e}`,cLt=e=>`Pattern length exceeds max of ${e}.`,uLt=e=>`Missing ${e} property in key`,fLt=e=>`Property 'weight' in key '${e}' must be a positive integer`,Zue=Object.prototype.hasOwnProperty;class dLt{constructor(t){this._keys=[],this._keyMap={};let n=0;t.forEach(r=>{let i=nDe(r);this._keys.push(i),this._keyMap[i.id]=i,n+=i.weight}),this._keys.forEach(r=>{r.weight/=n})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function nDe(e){let t=null,n=null,r=null,i=1,a=null;if(jd(e)||Np(e))r=e,t=Yue(e),n=Iz(e);else{if(!Zue.call(e,"name"))throw new Error(uLt("name"));const o=e.name;if(r=o,Zue.call(e,"weight")&&(i=e.weight,i<=0))throw new Error(fLt(o));t=Yue(o),n=Iz(o),a=e.getFn}return{path:t,id:n,weight:i,src:r,getFn:a}}function Yue(e){return Np(e)?e:e.split(".")}function Iz(e){return Np(e)?e.join("."):e}function hLt(e,t){let n=[],r=!1;const i=(a,o,s)=>{if(ic(a))if(!o[s])n.push(a);else{let l=o[s];const c=a[l];if(!ic(c))return;if(s===o.length-1&&(jd(c)||JMe(c)||aLt(c)))n.push(iLt(c));else if(Np(c)){r=!0;for(let u=0,f=c.length;u<f;u+=1)i(c[u],o,s+1)}else o.length&&i(c,o,s+1)}};return i(e,jd(t)?t.split("."):t,0),r?n:n[0]}const pLt={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},mLt={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},gLt={location:0,threshold:.6,distance:100},vLt={useExtendedSearch:!1,getFn:hLt,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var pn={...mLt,...pLt,...gLt,...vLt};const yLt=/[^ ]+/g;function bLt(e=1,t=3){const n=new Map,r=Math.pow(10,t);return{get(i){const a=i.match(yLt).length;if(n.has(a))return n.get(a);const o=1/Math.pow(a,.5*e),s=parseFloat(Math.round(o*r)/r);return n.set(a,s),s},clear(){n.clear()}}}class GJ{constructor({getFn:t=pn.getFn,fieldNormWeight:n=pn.fieldNormWeight}={}){this.norm=bLt(n,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((n,r)=>{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,jd(this.docs[0])?this.docs.forEach((t,n)=>{this._addString(t,n)}):this.docs.forEach((t,n)=>{this._addObject(t,n)}),this.norm.clear())}add(t){const n=this.size();jd(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let n=t,r=this.size();n<r;n+=1)this.records[n].i-=1}getValueForItemAtKeyId(t,n){return t[this._keysMap[n]]}size(){return this.records.length}_addString(t,n){if(!ic(t)||UB(t))return;let r={v:t,i:n,n:this.norm.get(t)};this.records.push(r)}_addObject(t,n){let r={i:n,$:{}};this.keys.forEach((i,a)=>{let o=i.getFn?i.getFn(t):this.getFn(t,i.path);if(ic(o)){if(Np(o)){let s=[];const l=[{nestedArrIndex:-1,value:o}];for(;l.length;){const{nestedArrIndex:c,value:u}=l.pop();if(ic(u))if(jd(u)&&!UB(u)){let f={v:u,i:c,n:this.norm.get(u)};s.push(f)}else Np(u)&&u.forEach((f,d)=>{l.push({nestedArrIndex:d,value:f})})}r.$[a]=s}else if(jd(o)&&!UB(o)){let s={v:o,n:this.norm.get(o)};r.$[a]=s}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function rDe(e,t,{getFn:n=pn.getFn,fieldNormWeight:r=pn.fieldNormWeight}={}){const i=new GJ({getFn:n,fieldNormWeight:r});return i.setKeys(e.map(nDe)),i.setSources(t),i.create(),i}function OLt(e,{getFn:t=pn.getFn,fieldNormWeight:n=pn.fieldNormWeight}={}){const{keys:r,records:i}=e,a=new GJ({getFn:t,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(i),a}function DI(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:i=pn.distance,ignoreLocation:a=pn.ignoreLocation}={}){const o=t/e.length;if(a)return o;const s=Math.abs(r-n);return i?o+s/i:s?1:o}function xLt(e=[],t=pn.minMatchCharLength){let n=[],r=-1,i=-1,a=0;for(let o=e.length;a<o;a+=1){let s=e[a];s&&r===-1?r=a:!s&&r!==-1&&(i=a-1,i-r+1>=t&&n.push([r,i]),r=-1)}return e[a-1]&&a-r>=t&&n.push([r,a-1]),n}const by=32;function wLt(e,t,n,{location:r=pn.location,distance:i=pn.distance,threshold:a=pn.threshold,findAllMatches:o=pn.findAllMatches,minMatchCharLength:s=pn.minMatchCharLength,includeMatches:l=pn.includeMatches,ignoreLocation:c=pn.ignoreLocation}={}){if(t.length>by)throw new Error(cLt(by));const u=t.length,f=e.length,d=Math.max(0,Math.min(r,f));let h=a,p=d;const m=s>1||l,g=m?Array(f):[];let v;for(;(v=e.indexOf(t,p))>-1;){let T=DI(t,{currentLocation:v,expectedLocation:d,distance:i,ignoreLocation:c});if(h=Math.min(T,h),p=v+u,m){let k=0;for(;k<u;)g[v+k]=1,k+=1}}p=-1;let b=[],O=1,x=u+f;const w=1<<u-1;for(let T=0;T<u;T+=1){let k=0,M=x;for(;k<M;)DI(t,{errors:T,currentLocation:d+M,expectedLocation:d,distance:i,ignoreLocation:c})<=h?k=M:x=M,M=Math.floor((x-k)/2+k);x=M;let R=Math.max(1,d-M+1),C=o?f:Math.min(d+M,f)+u,E=Array(C+2);E[C+1]=(1<<T)-1;for(let $=C;$>=R;$-=1){let I=$-1,D=n[e.charAt(I)];if(m&&(g[I]=+!!D),E[$]=(E[$+1]<<1|1)&D,T&&(E[$]|=(b[$+1]|b[$])<<1|1|b[$+1]),E[$]&w&&(O=DI(t,{errors:T,currentLocation:I,expectedLocation:d,distance:i,ignoreLocation:c}),O<=h)){if(h=O,p=I,p<=d)break;R=Math.max(1,2*d-p)}}if(DI(t,{errors:T+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:c})>h)break;b=E}const S={isMatch:p>=0,score:Math.max(.001,O)};if(m){const T=xLt(g,s);T.length?l&&(S.indices=T):S.isMatch=!1}return S}function SLt(e){let t={};for(let n=0,r=e.length;n<r;n+=1){const i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}const oL=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):e=>e;class iDe{constructor(t,{location:n=pn.location,threshold:r=pn.threshold,distance:i=pn.distance,includeMatches:a=pn.includeMatches,findAllMatches:o=pn.findAllMatches,minMatchCharLength:s=pn.minMatchCharLength,isCaseSensitive:l=pn.isCaseSensitive,ignoreDiacritics:c=pn.ignoreDiacritics,ignoreLocation:u=pn.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:i,includeMatches:a,findAllMatches:o,minMatchCharLength:s,isCaseSensitive:l,ignoreDiacritics:c,ignoreLocation:u},t=l?t:t.toLowerCase(),t=c?oL(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const f=(h,p)=>{this.chunks.push({pattern:h,alphabet:SLt(h),startIndex:p})},d=this.pattern.length;if(d>by){let h=0;const p=d%by,m=d-p;for(;h<m;)f(this.pattern.substr(h,by),h),h+=by;if(p){const g=d-by;f(this.pattern.substr(g),g)}}else f(this.pattern,0)}searchIn(t){const{isCaseSensitive:n,ignoreDiacritics:r,includeMatches:i}=this.options;if(t=n?t:t.toLowerCase(),t=r?oL(t):t,this.pattern===t){let m={isMatch:!0,score:0};return i&&(m.indices=[[0,t.length-1]]),m}const{location:a,distance:o,threshold:s,findAllMatches:l,minMatchCharLength:c,ignoreLocation:u}=this.options;let f=[],d=0,h=!1;this.chunks.forEach(({pattern:m,alphabet:g,startIndex:v})=>{const{isMatch:b,score:O,indices:x}=wLt(t,m,g,{location:a+v,distance:o,threshold:s,findAllMatches:l,minMatchCharLength:c,includeMatches:i,ignoreLocation:u});b&&(h=!0),d+=O,b&&x&&(f=[...f,...x])});let p={isMatch:h,score:h?d/this.chunks.length:1};return h&&i&&(p.indices=f),p}}class _v{constructor(t){this.pattern=t}static isMultiMatch(t){return Xue(t,this.multiRegex)}static isSingleMatch(t){return Xue(t,this.singleRegex)}search(){}}function Xue(e,t){const n=e.match(t);return n?n[1]:null}class _Lt extends _v{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const n=t===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class ELt extends _v{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const r=t.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class TLt extends _v{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const n=t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class CLt extends _v{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const n=!t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class ALt extends _v{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const n=t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class $Lt extends _v{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const n=!t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class aDe extends _v{constructor(t,{location:n=pn.location,threshold:r=pn.threshold,distance:i=pn.distance,includeMatches:a=pn.includeMatches,findAllMatches:o=pn.findAllMatches,minMatchCharLength:s=pn.minMatchCharLength,isCaseSensitive:l=pn.isCaseSensitive,ignoreDiacritics:c=pn.ignoreDiacritics,ignoreLocation:u=pn.ignoreLocation}={}){super(t),this._bitapSearch=new iDe(t,{location:n,threshold:r,distance:i,includeMatches:a,findAllMatches:o,minMatchCharLength:s,isCaseSensitive:l,ignoreDiacritics:c,ignoreLocation:u})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class oDe extends _v{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let n=0,r;const i=[],a=this.pattern.length;for(;(r=t.indexOf(this.pattern,n))>-1;)n=r+a,i.push([r,n-1]);const o=!!i.length;return{isMatch:o,score:o?0:1,indices:i}}}const Nz=[_Lt,oDe,TLt,CLt,$Lt,ALt,ELt,aDe],Kue=Nz.length,PLt=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,kLt="|";function RLt(e,t={}){return e.split(kLt).map(n=>{let r=n.trim().split(PLt).filter(a=>a&&!!a.trim()),i=[];for(let a=0,o=r.length;a<o;a+=1){const s=r[a];let l=!1,c=-1;for(;!l&&++c<Kue;){const u=Nz[c];let f=u.isMultiMatch(s);f&&(i.push(new u(f,t)),l=!0)}if(!l)for(c=-1;++c<Kue;){const u=Nz[c];let f=u.isSingleMatch(s);if(f){i.push(new u(f,t));break}}}return i})}const ILt=new Set([aDe.type,oDe.type]);class NLt{constructor(t,{isCaseSensitive:n=pn.isCaseSensitive,ignoreDiacritics:r=pn.ignoreDiacritics,includeMatches:i=pn.includeMatches,minMatchCharLength:a=pn.minMatchCharLength,ignoreLocation:o=pn.ignoreLocation,findAllMatches:s=pn.findAllMatches,location:l=pn.location,threshold:c=pn.threshold,distance:u=pn.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:r,includeMatches:i,minMatchCharLength:a,findAllMatches:s,ignoreLocation:o,location:l,threshold:c,distance:u},t=n?t:t.toLowerCase(),t=r?oL(t):t,this.pattern=t,this.query=RLt(this.pattern,this.options)}static condition(t,n){return n.useExtendedSearch}searchIn(t){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:i,ignoreDiacritics:a}=this.options;t=i?t:t.toLowerCase(),t=a?oL(t):t;let o=0,s=[],l=0;for(let c=0,u=n.length;c<u;c+=1){const f=n[c];s.length=0,o=0;for(let d=0,h=f.length;d<h;d+=1){const p=f[d],{isMatch:m,indices:g,score:v}=p.search(t);if(m){if(o+=1,l+=v,r){const b=p.constructor.type;ILt.has(b)?s=[...s,...g]:s.push(g)}}else{l=0,o=0,s.length=0;break}}if(o){let d={isMatch:!0,score:l/o};return r&&(d.indices=s),d}}return{isMatch:!1,score:1}}}const Mz=[];function MLt(...e){Mz.push(...e)}function Dz(e,t){for(let n=0,r=Mz.length;n<r;n+=1){let i=Mz[n];if(i.condition(e,t))return new i(e,t)}return new iDe(e,t)}const sL={AND:"$and",OR:"$or"},Lz={PATH:"$path",PATTERN:"$val"},jz=e=>!!(e[sL.AND]||e[sL.OR]),DLt=e=>!!e[Lz.PATH],LLt=e=>!Np(e)&&eDe(e)&&!jz(e),Jue=e=>({[sL.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function sDe(e,t,{auto:n=!0}={}){const r=i=>{let a=Object.keys(i);const o=DLt(i);if(!o&&a.length>1&&!jz(i))return r(Jue(i));if(LLt(i)){const l=o?i[Lz.PATH]:a[0],c=o?i[Lz.PATTERN]:i[l];if(!jd(c))throw new Error(lLt(l));const u={keyId:Iz(l),pattern:c};return n&&(u.searcher=Dz(c,t)),u}let s={children:[],operator:a[0]};return a.forEach(l=>{const c=i[l];Np(c)&&c.forEach(u=>{s.children.push(r(u))})}),s};return jz(e)||(e=Jue(e)),r(e)}function jLt(e,{ignoreFieldNorm:t=pn.ignoreFieldNorm}){e.forEach(n=>{let r=1;n.matches.forEach(({key:i,norm:a,score:o})=>{const s=i?i.weight:null;r*=Math.pow(o===0&&s?Number.EPSILON:o,(s||1)*(t?1:a))}),n.score=r})}function FLt(e,t){const n=e.matches;t.matches=[],ic(n)&&n.forEach(r=>{if(!ic(r.indices)||!r.indices.length)return;const{indices:i,value:a}=r;let o={indices:i,value:a};r.key&&(o.key=r.key.src),r.idx>-1&&(o.refIndex=r.idx),t.matches.push(o)})}function BLt(e,t){t.score=e.score}function ULt(e,t,{includeMatches:n=pn.includeMatches,includeScore:r=pn.includeScore}={}){const i=[];return n&&i.push(FLt),r&&i.push(BLt),e.map(a=>{const{idx:o}=a,s={item:t[o],refIndex:o};return i.length&&i.forEach(l=>{l(a,s)}),s})}class n_{constructor(t,n={},r){this.options={...pn,...n},this.options.useExtendedSearch,this._keyStore=new dLt(this.options.keys),this.setCollection(t,r)}setCollection(t,n){if(this._docs=t,n&&!(n instanceof GJ))throw new Error(sLt);this._myIndex=n||rDe(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){ic(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const n=[];for(let r=0,i=this._docs.length;r<i;r+=1){const a=this._docs[r];t(a,r)&&(this.removeAt(r),r-=1,i-=1,n.push(a))}return n}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:n=-1}={}){const{includeMatches:r,includeScore:i,shouldSort:a,sortFn:o,ignoreFieldNorm:s}=this.options;let l=jd(t)?jd(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return jLt(l,{ignoreFieldNorm:s}),a&&l.sort(o),JMe(n)&&n>-1&&(l=l.slice(0,n)),ULt(l,this._docs,{includeMatches:r,includeScore:i})}_searchStringList(t){const n=Dz(t,this.options),{records:r}=this._myIndex,i=[];return r.forEach(({v:a,i:o,n:s})=>{if(!ic(a))return;const{isMatch:l,score:c,indices:u}=n.searchIn(a);l&&i.push({item:a,idx:o,matches:[{score:c,value:a,norm:s,indices:u}]})}),i}_searchLogical(t){const n=sDe(t,this.options),r=(s,l,c)=>{if(!s.children){const{keyId:f,searcher:d}=s,h=this._findMatches({key:this._keyStore.get(f),value:this._myIndex.getValueForItemAtKeyId(l,f),searcher:d});return h&&h.length?[{idx:c,item:l,matches:h}]:[]}const u=[];for(let f=0,d=s.children.length;f<d;f+=1){const h=s.children[f],p=r(h,l,c);if(p.length)u.push(...p);else if(s.operator===sL.AND)return[]}return u},i=this._myIndex.records,a={},o=[];return i.forEach(({$:s,i:l})=>{if(ic(s)){let c=r(n,s,l);c.length&&(a[l]||(a[l]={idx:l,item:s,matches:[]},o.push(a[l])),c.forEach(({matches:u})=>{a[l].matches.push(...u)}))}}),o}_searchObjectList(t){const n=Dz(t,this.options),{keys:r,records:i}=this._myIndex,a=[];return i.forEach(({$:o,i:s})=>{if(!ic(o))return;let l=[];r.forEach((c,u)=>{l.push(...this._findMatches({key:c,value:o[u],searcher:n}))}),l.length&&a.push({idx:s,item:o,matches:l})}),a}_findMatches({key:t,value:n,searcher:r}){if(!ic(n))return[];let i=[];if(Np(n))n.forEach(({v:a,i:o,n:s})=>{if(!ic(a))return;const{isMatch:l,score:c,indices:u}=r.searchIn(a);l&&i.push({score:c,key:t,value:a,idx:o,norm:s,indices:u})});else{const{v:a,n:o}=n,{isMatch:s,score:l,indices:c}=r.searchIn(a);s&&i.push({score:l,key:t,value:a,norm:o,indices:c})}return i}}n_.version="7.1.0";n_.createIndex=rDe;n_.parseIndex=OLt;n_.config=pn;n_.parseQuery=sDe;MLt(NLt);const lDe=({aiSuggestibleCommandsOnly:e,onSelect:t,open:n,onOpenChange:r,modules:i,moduleFolders:a,hideModules:o,children:s})=>{const[l,c]=_.useState(""),u=VLt({aiSuggestibleCommandsOnly:e}),f=_.useMemo(()=>u.map(O=>({type:"STEP",name:OK[O],description:fbt[O],onSelect:()=>{if(ubt(O)){t==null||t({type:Ee.PRESET_ACTION,command:O});return}t==null||t({type:O})}})),[t,u]),d=_.useMemo(()=>i.map(O=>{const x=a.find(w=>w.moduleIds.includes(O.moduleId));return{type:"MODULE",name:ek(O.name),relativePath:x==null?void 0:x.id,description:O.description||void 0,onSelect:()=>{t==null||t({...O,type:"RESOLVED_MODULE"})}}}),[a,i,t]),h=_.useMemo(()=>new n_([...d,...f],{keys:[{name:"name",weight:.8},{name:"relativePath",weight:.3},{name:"description",weight:.2}],threshold:.3,includeScore:!0,findAllMatches:!0,ignoreLocation:!0,useExtendedSearch:!0}),[d,f]),p=_.useMemo(()=>{const O=l.trim().replace(/-/g," ");if(!O)return[...f,...d];const x=O.toLowerCase().split(/\s+/);return h.search({$and:x.map(S=>({$or:[{name:S},{description:S},{relativePath:S}]}))}).map(S=>{const T=S.item,k=x.filter(M=>{var R;return(R=T.relativePath)==null?void 0:R.includes(M)}).length;return{...T,score:S.score??1,pathMatchBoost:k*.1}}).sort((S,T)=>S.score-S.pathMatchBoost-(T.score-T.pathMatchBoost))},[h,d,l,f]),m=_.useMemo(()=>p.filter(O=>O.type==="STEP"),[p]),g=_.useMemo(()=>p.filter(O=>O.type==="MODULE"),[p]);_.useEffect(()=>{n||c("")},[n]);const v=_.useRef(null),b=_.useRef(null);return y.jsxs(FAt,{open:n,onOpenChange:r,trigger:s,commandProps:{shouldFilter:!1},children:[y.jsx(Z1,{placeholder:"Search steps and modules...",value:l,onValueChange:O=>{c(O),v.current&&window.clearTimeout(v.current),v.current=window.setTimeout(()=>{const x=b.current;x==null||x.scrollTo({top:0})},0)}}),y.jsxs(Y1,{ref:b,children:[p.length?null:y.jsx(X1,{children:"No results found."}),g.length&&!o?y.jsx(z0,{heading:"Modules",children:g.map(O=>y.jsx(ah,{onSelect:O.onSelect,children:y.jsxs("div",{children:[y.jsx("div",{className:"font-medium",children:O.name}),y.jsx("div",{className:"text-muted-foreground",children:O.description}),y.jsx("div",{className:"text-muted-foreground italic",children:O.relativePath})]})},O.name))}):null,m.length&&!o?y.jsx(z0,{heading:"Steps",children:m.map(O=>y.jsx(ah,{onSelect:O.onSelect,children:y.jsxs("div",{children:[y.jsx("div",{className:"font-medium",children:O.name}),y.jsx("div",{className:"text-muted-foreground",children:O.description})]})},O.name))}):null]})]})},VLt=e=>{const{ai:t}=okt();return _.useMemo(()=>{const n=QLt.filter(r=>!zLt.has(r));return t!=null&&t.aiAction&&n.push(Ee.AI_ACTION_DYNAMIC),n.filter(r=>r===q.SUCCESS?e.aiSuggestibleCommandsOnly:e.aiSuggestibleCommandsOnly?FX.options.some(i=>i.shape.type.value===r):!0)},[t==null?void 0:t.aiAction,e.aiSuggestibleCommandsOnly])},QLt=[...Object.values(q)];Ee.AI_ACTION+"",Ee.AI_ACTION_DYNAMIC+"",q.AI_ASSERTION+"",q.AI_WAIT+"",q.AI_EXTRACT+"",q.SUCCESS+"",q.AUTH_LOAD+"",q.AUTH_SAVE+"",q.CAPTCHA+"",q.VISUAL_DIFF+"",q.JAVASCRIPT+"",q.ELEMENT_CHECK+"",q.PAGE_CHECK+"",q.CLICK+"",q.DRAG+"",q.FILE_UPLOAD+"",q.SELECT_OPTION+"",q.REQUEST+"",q.GRAPHQL_REQUEST+"",q.TYPE+"",q.PRESS+"",q.NAVIGATE+"",q.DIALOG+"",q.SCROLL_UP+"",q.SCROLL_DOWN+"",q.SCROLL_LEFT+"",q.SCROLL_RIGHT+"",q.GO_BACK+"",q.GO_FORWARD+"",q.WAIT+"",q.WAIT_FOR_URL+"",q.REFRESH+"",q.TAB+"",q.NEW_TAB+"",q.COOKIE+"",q.LOCAL_STORAGE+"",q.HOVER+"",q.FOCUS+"",q.BLUR+"",q.MOUSE_DRAG+"",q.COPY+"",q.PASTE+"";const zLt=new Set([Ee.AI_ACTION,q.CAPTCHA]),WLt=e=>{switch(e.type){case Ee.AI_ACTION:return{type:e.type};case Ee.AI_ACTION_DYNAMIC:return{type:e.type};case Ee.PRESET_ACTION:return{type:e.type,command:e.command.type};case"RESOLVED_MODULE":return e;case Ee.CONDITIONAL:case Ee.SECTION:case Ee.IFRAME:throw new Error("not implemented");default:return(n=>{throw"If Typescript complains about the line below, you missed a case or break in the switch above"})()}},HLt=e=>{switch(e.type){case Ee.AI_ACTION:return Ee.AI_ACTION;case Ee.AI_ACTION_DYNAMIC:return Ee.AI_ACTION_DYNAMIC;case Ee.PRESET_ACTION:return e.command;case"RESOLVED_MODULE":return"RESOLVED_MODULE";default:return(n=>{throw"If Typescript complains about the line below, you missed a case or break in the switch above"})()}},qLt=e=>{const[t,n]=_.useState(!1),r=HLt(e.value);return y.jsx(lDe,{open:t,onOpenChange:n,hideModules:e.hideModules,aiSuggestibleCommandsOnly:e.aiSuggestibleCommandsOnly,modules:e.modules,moduleFolders:e.moduleFolders,onSelect:i=>{var a;(a=e.onChange)==null||a.call(e,i),n(!1)},children:y.jsxs(xn,{variant:"outline",role:"combobox",disabled:e.disabled,className:Ne({"pointer-events-none":e.readOnly}),children:[OK[r],y.jsx(nX,{className:"h-4 w-4 shrink-0 opacity-50"})]})})},M2=e=>{const[t,n]=_.useState(!1);return y.jsx(lDe,{open:t,onOpenChange:n,hideModules:e.hideModules,aiSuggestibleCommandsOnly:e.aiSuggestibleCommandsOnly,modules:e.modules,moduleFolders:e.moduleFolders,onSelect:r=>{var i;(i=e.onAdd)==null||i.call(e,r),n(!1)},children:e.children??y.jsxs(xn,{variant:"outline",disabled:e.disabled,children:[y.jsx(BP,{className:"h-4 w-4"})," Add new step"]})})},VB=e=>e instanceof Date,GLt=e=>Object.keys(e).length===0,Fz=e=>e!=null&&typeof e=="object",efe=(e,...t)=>Object.prototype.hasOwnProperty.call(e,...t),QB=e=>Fz(e)&&GLt(e),ZLt=()=>Object.create(null),fC=(e,t)=>{if(e===t)return{};if(!Fz(e)||!Fz(t))return t;const n=Object.keys(e).reduce((r,i)=>(efe(t,i)||(r[i]=void 0),r),ZLt());return VB(e)||VB(t)?e.valueOf()==t.valueOf()?{}:t:Object.keys(t).reduce((r,i)=>{if(!efe(e,i))return r[i]=t[i],r;const a=fC(e[i],t[i]);return QB(a)&&!VB(a)&&(QB(e[i])||!QB(t[i]))||(r[i]=a),r},n)};var cDe=Symbol.for("immer-nothing"),tfe=Symbol.for("immer-draftable"),Ac=Symbol.for("immer-state");function pf(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var pS=Object.getPrototypeOf;function mS(e){return!!e&&!!e[Ac]}function X0(e){var t;return e?uDe(e)||Array.isArray(e)||!!e[tfe]||!!((t=e.constructor)!=null&&t[tfe])||B3(e)||U3(e):!1}var YLt=Object.prototype.constructor.toString();function uDe(e){if(!e||typeof e!="object")return!1;const t=pS(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===YLt}function lL(e,t){F3(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function F3(e){const t=e[Ac];return t?t.type_:Array.isArray(e)?1:B3(e)?2:U3(e)?3:0}function Bz(e,t){return F3(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function fDe(e,t,n){const r=F3(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function XLt(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function B3(e){return e instanceof Map}function U3(e){return e instanceof Set}function oy(e){return e.copy_||e.base_}function Uz(e,t){if(B3(e))return new Map(e);if(U3(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=uDe(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Ac];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],s=r[o];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(r[o]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[o]})}return Object.create(pS(e),r)}else{const r=pS(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function WA(e,t=!1){return V3(e)||mS(e)||!X0(e)||(F3(e)>1&&(e.set=e.add=e.clear=e.delete=KLt),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>WA(r,!0))),e}function KLt(){pf(2)}function V3(e){return Object.isFrozen(e)}var JLt={};function K0(e){const t=JLt[e];return t||pf(0,e),t}var HA;function dDe(){return HA}function ejt(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function nfe(e,t){t&&(K0("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Vz(e){Qz(e),e.drafts_.forEach(tjt),e.drafts_=null}function Qz(e){e===HA&&(HA=e.parent_)}function rfe(e){return HA=ejt(HA,e)}function tjt(e){const t=e[Ac];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ife(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Ac].modified_&&(Vz(t),pf(4)),X0(e)&&(e=cL(t,e),t.parent_||uL(t,e)),t.patches_&&K0("Patches").generateReplacementPatches_(n[Ac].base_,e,t.patches_,t.inversePatches_)):e=cL(t,n,[]),Vz(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==cDe?e:void 0}function cL(e,t,n){if(V3(t))return t;const r=t[Ac];if(!r)return lL(t,(i,a)=>afe(e,r,t,i,a,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return uL(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let a=i,o=!1;r.type_===3&&(a=new Set(i),i.clear(),o=!0),lL(a,(s,l)=>afe(e,r,i,s,l,n,o)),uL(e,i,!1),n&&e.patches_&&K0("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function afe(e,t,n,r,i,a,o){if(mS(i)){const s=a&&t&&t.type_!==3&&!Bz(t.assigned_,r)?a.concat(r):void 0,l=cL(e,i,s);if(fDe(n,r,l),mS(l))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(X0(i)&&!V3(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;cL(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&uL(e,i)}}function uL(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&WA(t,n)}function njt(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:dDe(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=ZJ;n&&(i=[r],a=qA);const{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,s}var ZJ={get(e,t){if(t===Ac)return e;const n=oy(e);if(!Bz(n,t))return rjt(e,n,t);const r=n[t];return e.finalized_||!X0(r)?r:r===zB(e.base_,t)?(WB(e),e.copy_[t]=Wz(r,e)):r},has(e,t){return t in oy(e)},ownKeys(e){return Reflect.ownKeys(oy(e))},set(e,t,n){const r=hDe(oy(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=zB(oy(e),t),a=i==null?void 0:i[Ac];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(XLt(n,i)&&(n!==void 0||Bz(e.base_,t)))return!0;WB(e),zz(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return zB(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,WB(e),zz(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=oy(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){pf(11)},getPrototypeOf(e){return pS(e.base_)},setPrototypeOf(){pf(12)}},qA={};lL(ZJ,(e,t)=>{qA[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});qA.deleteProperty=function(e,t){return qA.set.call(this,e,t,void 0)};qA.set=function(e,t,n){return ZJ.set.call(this,e[0],t,n,e[0])};function zB(e,t){const n=e[Ac];return(n?oy(n):e)[t]}function rjt(e,t,n){var i;const r=hDe(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function hDe(e,t){if(!(t in e))return;let n=pS(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=pS(n)}}function zz(e){e.modified_||(e.modified_=!0,e.parent_&&zz(e.parent_))}function WB(e){e.copy_||(e.copy_=Uz(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var ijt=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const a=n;n=t;const o=this;return function(l=a,...c){return o.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&pf(6),r!==void 0&&typeof r!="function"&&pf(7);let i;if(X0(t)){const a=rfe(this),o=Wz(t,void 0);let s=!0;try{i=n(o),s=!1}finally{s?Vz(a):Qz(a)}return nfe(a,r),ife(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===cDe&&(i=void 0),this.autoFreeze_&&WA(i,!0),r){const a=[],o=[];K0("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else pf(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(o,...s)=>this.produceWithPatches(o,l=>t(l,...s));let r,i;return[this.produce(t,n,(o,s)=>{r=o,i=s}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){X0(e)||pf(8),mS(e)&&(e=ajt(e));const t=rfe(this),n=Wz(e,void 0);return n[Ac].isManual_=!0,Qz(t),n}finishDraft(e,t){const n=e&&e[Ac];(!n||!n.isManual_)&&pf(9);const{scope_:r}=n;return nfe(r,t),ife(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=K0("Patches").applyPatches_;return mS(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Wz(e,t){const n=B3(e)?K0("MapSet").proxyMap_(e,t):U3(e)?K0("MapSet").proxySet_(e,t):njt(e,t);return(t?t.scope_:dDe()).drafts_.push(n),n}function ajt(e){return mS(e)||pf(10,e),pDe(e)}function pDe(e){if(!X0(e)||V3(e))return e;const t=e[Ac];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Uz(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Uz(e,!0);return lL(n,(r,i)=>{fDe(n,r,pDe(i))}),t&&(t.finalized_=!1),n}var $c=new ijt,mDe=$c.produce;$c.produceWithPatches.bind($c);$c.setAutoFreeze.bind($c);$c.setUseStrictShallowCopy.bind($c);$c.applyPatches.bind($c);$c.createDraft.bind($c);$c.finishDraft.bind($c);const oh=Object.create(null);oh.open="0";oh.close="1";oh.ping="2";oh.pong="3";oh.message="4";oh.upgrade="5";oh.noop="6";const D2=Object.create(null);Object.keys(oh).forEach(e=>{D2[oh[e]]=e});const Hz={type:"error",data:"parser error"},gDe=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",vDe=typeof ArrayBuffer=="function",yDe=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,YJ=({type:e,data:t},n,r)=>gDe&&t instanceof Blob?n?r(t):ofe(t,r):vDe&&(t instanceof ArrayBuffer||yDe(t))?n?r(t):ofe(new Blob([t]),r):r(oh[e]+(t||"")),ofe=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function sfe(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let HB;function ojt(e,t){if(gDe&&e.data instanceof Blob)return e.data.arrayBuffer().then(sfe).then(t);if(vDe&&(e.data instanceof ArrayBuffer||yDe(e.data)))return t(sfe(e.data));YJ(e,!1,n=>{HB||(HB=new TextEncoder),t(HB.encode(n))})}const lfe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",sT=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<lfe.length;e++)sT[lfe.charCodeAt(e)]=e;const sjt=e=>{let t=e.length*.75,n=e.length,r,i=0,a,o,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),u=new Uint8Array(c);for(r=0;r<n;r+=4)a=sT[e.charCodeAt(r)],o=sT[e.charCodeAt(r+1)],s=sT[e.charCodeAt(r+2)],l=sT[e.charCodeAt(r+3)],u[i++]=a<<2|o>>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|l&63;return c},ljt=typeof ArrayBuffer=="function",XJ=(e,t)=>{if(typeof e!="string")return{type:"message",data:bDe(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:cjt(e.substring(1),t)}:D2[n]?e.length>1?{type:D2[n],data:e.substring(1)}:{type:D2[n]}:Hz},cjt=(e,t)=>{if(ljt){const n=sjt(e);return bDe(n,t)}else return{base64:!0,data:e}},bDe=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},ODe="",ujt=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((a,o)=>{YJ(a,!1,s=>{r[o]=s,++i===n&&t(r.join(ODe))})})},fjt=(e,t)=>{const n=e.split(ODe),r=[];for(let i=0;i<n.length;i++){const a=XJ(n[i],t);if(r.push(a),a.type==="error")break}return r};function djt(){return new TransformStream({transform(e,t){ojt(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const a=new DataView(i.buffer);a.setUint8(0,126),a.setUint16(1,r)}else{i=new Uint8Array(9);const a=new DataView(i.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let qB;function LI(e){return e.reduce((t,n)=>t+n.length,0)}function jI(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function hjt(e,t){qB||(qB=new TextDecoder);const n=[];let r=0,i=-1,a=!1;return new TransformStream({transform(o,s){for(n.push(o);;){if(r===0){if(LI(n)<1)break;const l=jI(n,1);a=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(LI(n)<2)break;const l=jI(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(LI(n)<8)break;const l=jI(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),u=c.getUint32(0);if(u>Math.pow(2,21)-1){s.enqueue(Hz);break}i=u*Math.pow(2,32)+c.getUint32(4),r=3}else{if(LI(n)<i)break;const l=jI(n,i);s.enqueue(XJ(a?l:qB.decode(l),t)),r=0}if(i===0||i>e){s.enqueue(Hz);break}}}})}const xDe=4;function Ra(e){if(e)return pjt(e)}function pjt(e){for(var t in Ra.prototype)e[t]=Ra.prototype[t];return e}Ra.prototype.on=Ra.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Ra.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Ra.prototype.off=Ra.prototype.removeListener=Ra.prototype.removeAllListeners=Ra.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Ra.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};Ra.prototype.emitReserved=Ra.prototype.emit;Ra.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Ra.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Q3=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),ru=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),mjt="arraybuffer";function wDe(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const gjt=ru.setTimeout,vjt=ru.clearTimeout;function z3(e,t){t.useNativeTimers?(e.setTimeoutFn=gjt.bind(ru),e.clearTimeoutFn=vjt.bind(ru)):(e.setTimeoutFn=ru.setTimeout.bind(ru),e.clearTimeoutFn=ru.clearTimeout.bind(ru))}const yjt=1.33;function bjt(e){return typeof e=="string"?Ojt(e):Math.ceil((e.byteLength||e.size)*yjt)}function Ojt(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function SDe(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function xjt(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function wjt(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let a=n[r].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class Sjt extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class KJ extends Ra{constructor(t){super(),this.writable=!1,z3(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Sjt(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=XJ(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=xjt(t);return n.length?"?"+n:""}}class _jt extends KJ{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};fjt(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,ujt(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=SDe()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let _De=!1;try{_De=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Ejt=_De;function Tjt(){}class Cjt extends _jt{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,a)=>{this.onError("xhr post error",i,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}let iw=class L2 extends Ra{constructor(t,n,r){super(),this.createRequest=t,z3(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=wDe(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=L2.requestsCount++,L2.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Tjt,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete L2.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};iw.requestsCount=0;iw.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",cfe);else if(typeof addEventListener=="function"){const e="onpagehide"in ru?"pagehide":"unload";addEventListener(e,cfe,!1)}}function cfe(){for(let e in iw.requests)iw.requests.hasOwnProperty(e)&&iw.requests[e].abort()}const Ajt=function(){const e=EDe({xdomain:!1});return e&&e.responseType!==null}();class $jt extends Cjt{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Ajt&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new iw(EDe,this.uri(),t)}}function EDe(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Ejt))return new XMLHttpRequest}catch{}if(!t)try{return new ru[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const TDe=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Pjt extends KJ{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=TDe?{}:wDe(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;YJ(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch{}i&&Q3(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=SDe()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const GB=ru.WebSocket||ru.MozWebSocket;class kjt extends Pjt{createSocket(t,n,r){return TDe?new GB(t,n,r):n?new GB(t,n):new GB(t)}doWrite(t,n){this.ws.send(n)}}class Rjt extends KJ{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=hjt(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=djt();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const a=()=>{r.read().then(({done:s,value:l})=>{s||(this.onPacket(l),a())}).catch(s=>{})};a();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&Q3(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Ijt={websocket:kjt,webtransport:Rjt,polling:$jt},Njt=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Mjt=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function qz(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=Njt.exec(e||""),a={},o=14;for(;o--;)a[Mjt[o]]=i[o]||"";return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=Djt(a,a.path),a.queryKey=Ljt(a,a.query),a}function Djt(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Ljt(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,a){i&&(n[i]=a)}),n}const Gz=typeof addEventListener=="function"&&typeof removeEventListener=="function",j2=[];Gz&&addEventListener("offline",()=>{j2.forEach(e=>e())},!1);class Sg extends Ra{constructor(t,n){if(super(),this.binaryType=mjt,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=qz(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=qz(n.host).host);z3(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=wjt(this.opts.query)),Gz&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},j2.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=xDe,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Sg.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Sg.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=bjt(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Q3(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:t,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Sg.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Gz&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=j2.indexOf(this._offlineEventListener);r!==-1&&j2.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Sg.protocol=xDe;class jjt extends Sg{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Sg.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Sg.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const d=new Error("probe error");d.transport=n.name,this.emitReserved("upgradeError",d)}}))};function a(){r||(r=!0,u(),n.close(),n=null)}const o=f=>{const d=new Error("probe error: "+f);d.transport=n.name,a(),this.emitReserved("upgradeError",d)};function s(){o("transport closed")}function l(){o("socket closed")}function c(f){n&&f.name!==n.name&&a()}const u=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",s),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",o),n.once("close",s),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let Fjt=class extends jjt{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>Ijt[i]).filter(i=>!!i)),super(t,r)}};function Bjt(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=qz(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const a=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+t,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}const Ujt=typeof ArrayBuffer=="function",Vjt=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,CDe=Object.prototype.toString,Qjt=typeof Blob=="function"||typeof Blob<"u"&&CDe.call(Blob)==="[object BlobConstructor]",zjt=typeof File=="function"||typeof File<"u"&&CDe.call(File)==="[object FileConstructor]";function JJ(e){return Ujt&&(e instanceof ArrayBuffer||Vjt(e))||Qjt&&e instanceof Blob||zjt&&e instanceof File}function F2(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(F2(e[n]))return!0;return!1}if(JJ(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return F2(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&F2(e[n]))return!0;return!1}function Wjt(e){const t=[],n=e.data,r=e;return r.data=Zz(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Zz(e,t){if(!e)return e;if(JJ(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Zz(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Zz(e[r],t));return n}return e}function Hjt(e,t){return e.data=Yz(e.data,t),delete e.attachments,e}function Yz(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Yz(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Yz(e[n],t));return e}const qjt=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Gjt=5;var rr;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(rr||(rr={}));class Zjt{constructor(t){this.replacer=t}encode(t){return(t.type===rr.EVENT||t.type===rr.ACK)&&F2(t)?this.encodeAsBinary({type:t.type===rr.EVENT?rr.BINARY_EVENT:rr.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===rr.BINARY_EVENT||t.type===rr.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=Wjt(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function ufe(e){return Object.prototype.toString.call(e)==="[object Object]"}class eee extends Ra{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===rr.BINARY_EVENT;r||n.type===rr.BINARY_ACK?(n.type=r?rr.EVENT:rr.ACK,this.reconstructor=new Yjt(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(JJ(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(rr[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===rr.BINARY_EVENT||r.type===rr.BINARY_ACK){const a=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(a,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(t.charAt(n+1)==="/"){const a=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(a,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const a=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(a,n+1))}if(t.charAt(++n)){const a=this.tryParse(t.substr(n));if(eee.isPayloadValid(r.type,a))r.data=a;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case rr.CONNECT:return ufe(n);case rr.DISCONNECT:return n===void 0;case rr.CONNECT_ERROR:return typeof n=="string"||ufe(n);case rr.EVENT:case rr.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&qjt.indexOf(n[0])===-1);case rr.ACK:case rr.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Yjt{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=Hjt(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Xjt=Object.freeze(Object.defineProperty({__proto__:null,Decoder:eee,Encoder:Zjt,get PacketType(){return rr},protocol:Gjt},Symbol.toStringTag,{value:"Module"}));function af(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Kjt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class ADe extends Ra{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[af(t,"open",this.onopen.bind(this)),af(t,"packet",this.onpacket.bind(this)),af(t,"error",this.onerror.bind(this)),af(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,a;if(Kjt.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:rr.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,f=n.pop();this._registerAckCallback(u,f),o.id=u}const s=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!s||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===t&&this.sendBuffer.splice(s,1);n.call(this,new Error("operation has timed out"))},i),o=(...s)=>{this.io.clearTimeoutFn(a),n.apply(this,s)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,i)=>{const a=(o,s)=>o?i(o):r(s);a.withError=!0,n.push(a),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...a)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:rr.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case rr.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case rr.EVENT:case rr.BINARY_EVENT:this.onevent(t);break;case rr.ACK:case rr.BINARY_ACK:this.onack(t);break;case rr.DISCONNECT:this.ondisconnect();break;case rr.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:rr.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:rr.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function r_(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}r_.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};r_.prototype.reset=function(){this.attempts=0};r_.prototype.setMin=function(e){this.ms=e};r_.prototype.setMax=function(e){this.max=e};r_.prototype.setJitter=function(e){this.jitter=e};class Xz extends Ra{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,z3(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new r_({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||Xjt;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Fjt(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=af(n,"open",function(){r.onopen(),t&&t()}),a=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),t?t(s):this.maybeReconnectOnOpen()},o=af(n,"error",a);if(this._timeout!==!1){const s=this._timeout,l=this.setTimeoutFn(()=>{i(),a(new Error("timeout")),n.close()},s);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(af(t,"ping",this.onping.bind(this)),af(t,"data",this.ondata.bind(this)),af(t,"error",this.onerror.bind(this)),af(t,"close",this.onclose.bind(this)),af(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Q3(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new ADe(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const _E={};function B2(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Bjt(e,t.path||"/socket.io"),r=n.source,i=n.id,a=n.path,o=_E[i]&&a in _E[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return s?l=new Xz(r,t):(_E[i]||(_E[i]=new Xz(r,t)),l=_E[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(B2,{Manager:Xz,Socket:ADe,io:B2,connect:B2});function aw(e,t,n=!1){return e.length<t?e:e.slice(0,t-3)+(n?"...TRUNCATED...":"[...]")}const gS={[Oo.EQUALS]:"equals",[Oo.CONTAINS]:"contains",[Oo.STARTS_WITH]:"starts with"},vS={[Oo.EQUALS]:"does not equal",[Oo.CONTAINS]:"does not contain",[Oo.STARTS_WITH]:"does not start with"},$De={[ms.EXISTS]:"exists",[ms.VISIBLE]:"is visible",[ms.ENABLED]:"is enabled",[ms.EDITABLE]:"is editable"},PDe={[ms.EXISTS]:"does not exists",[ms.VISIBLE]:"is not visible",[ms.ENABLED]:"is disabled",[ms.EDITABLE]:"is not editable"};function Jjt(e){switch(e.type){case ha.ELEMENT_CONTENT:return`${e.negated?vS[e.operation]:gS[e.operation]} '${e.value}'`;case ha.ELEMENT_ATTRIBUTE:{const n=e.negated?vS[e.operation]:gS[e.operation];return`attribute '${e.attr}' ${n} '${e.value}'`}case ha.ELEMENT_EXISTENCE:return e.negated?PDe[e.condition]:$De[e.condition];default:return(n=>{throw"If Typescript complains about the line below, you missed a case or break in the switch above"})()}}const e5t={[R0.CONTENT]:"The page"};function t5t(e){switch(e.type){case"VALUE":return`the option with value ${e.value}`;case"LABEL":return`the option with label ${e.label}`;case"INDEX":return`the option at index ${e.index}`;default:return(n=>{throw"If Typescript complains about the line below, you missed a case or break in the switch above"})()}}function n5t(e){switch(e.type){case"SUBSTRING":return`match substring '${e.url}'`;case"REGEX":return`match regex '${e.regex}'`;case"GLOB":return`match glob '${e.glob}'`;default:return(n=>{throw"If Typescript complains about the line below, you missed a case or break in the switch above"})()}}function r5t(e){switch(e.type){case R0.CONTENT:return`${e.negated?vS[Oo.CONTAINS]:gS[Oo.CONTAINS]} '${e.value}'`;default:return(n=>{throw"If Typescript complains about the line below, you missed a case or break in the switch above"})(e.type)}}function i5t(e){const t=[];for(const n of e){n.sort((o,s)=>o.timestamp-s.timestamp);const r=[];let i,a=1;for(const o of n)i&&i.text===o.text&&i.type===o.type&&JSON.stringify(i.args??null)===JSON.stringify(o.args??null)?a++:(i&&(a>1?i.args&&i.args.length?i.args.push(`(repeated ${a} times)`):i.text+=` (repeated ${a} times)`:r.push(i)),i=o,a=1);i&&r.push(i),t.push(r)}return t}var a5t={exports:{}};/*!
|
|
697
|
+
*/function Fue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bue(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fue(Object(n),!0).forEach(function(r){Q2t(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fue(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Q2t(e,t,n){return t=W2t(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z2t(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function W2t(e){var t=z2t(e,"string");return typeof t=="symbol"?t:String(t)}var Uue={activateTrap:function(t,n){if(t.length>0){var r=t[t.length-1];r!==n&&r.pause()}var i=t.indexOf(n);i===-1||t.splice(i,1),t.push(n)},deactivateTrap:function(t,n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),t.length>0&&t[t.length-1].unpause()}},H2t=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},q2t=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},cC=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},G2t=function(t){return cC(t)&&!t.shiftKey},Z2t=function(t){return cC(t)&&t.shiftKey},Vue=function(t){return setTimeout(t,0)},Que=function(t,n){var r=-1;return t.every(function(i,a){return n(i)?(r=a,!1):!0}),r},wE=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return typeof t=="function"?t.apply(void 0,r):t},II=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},Y2t=[],X2t=function(t,n){var r=(n==null?void 0:n.document)||document,i=(n==null?void 0:n.trapStack)||Y2t,a=Bue({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:G2t,isKeyBackward:Z2t},n),o={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},s,l=function(E,A,$){return E&&E[A]!==void 0?E[A]:a[$||A]},c=function(E,A){var $=typeof(A==null?void 0:A.composedPath)=="function"?A.composedPath():void 0;return o.containerGroups.findIndex(function(I){var D=I.container,V=I.tabbableNodes;return D.contains(E)||($==null?void 0:$.includes(D))||V.find(function(N){return N===E})})},u=function(E){var A=a[E];if(typeof A=="function"){for(var $=arguments.length,I=new Array($>1?$-1:0),D=1;D<$;D++)I[D-1]=arguments[D];A=A.apply(void 0,I)}if(A===!0&&(A=void 0),!A){if(A===void 0||A===!1)return A;throw new Error("`".concat(E,"` was specified but was not a node, or did not return a node"))}var V=A;if(typeof A=="string"&&(V=r.querySelector(A),!V))throw new Error("`".concat(E,"` as selector refers to no known node"));return V},f=function(){var E=u("initialFocus");if(E===!1)return!1;if(E===void 0||!N2(E,a.tabbableOptions))if(c(r.activeElement)>=0)E=r.activeElement;else{var A=o.tabbableGroups[0],$=A&&A.firstTabbableNode;E=$||u("fallbackFocus")}if(!E)throw new Error("Your focus-trap needs to have at least one focusable element");return E},d=function(){if(o.containerGroups=o.containers.map(function(E){var A=MMe(E,a.tabbableOptions),$=DMe(E,a.tabbableOptions),I=A.length>0?A[0]:void 0,D=A.length>0?A[A.length-1]:void 0,V=$.find(function(z){return ay(z)}),N=$.slice().reverse().find(function(z){return ay(z)}),F=!!A.find(function(z){return Bm(z)>0});return{container:E,tabbableNodes:A,focusableNodes:$,posTabIndexesFound:F,firstTabbableNode:I,lastTabbableNode:D,firstDomTabbableNode:V,lastDomTabbableNode:N,nextTabbableNode:function(H){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,U=A.indexOf(H);return U<0?L?$.slice($.indexOf(H)+1).find(function(Q){return ay(Q)}):$.slice(0,$.indexOf(H)).reverse().find(function(Q){return ay(Q)}):A[U+(L?1:-1)]}}}),o.tabbableGroups=o.containerGroups.filter(function(E){return E.tabbableNodes.length>0}),o.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(o.containerGroups.find(function(E){return E.posTabIndexesFound})&&o.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function C(E){var A=E.activeElement;if(A)return A.shadowRoot&&A.shadowRoot.activeElement!==null?C(A.shadowRoot):A},p=function C(E){if(E!==!1&&E!==h(document)){if(!E||!E.focus){C(f());return}E.focus({preventScroll:!!a.preventScroll}),o.mostRecentlyFocusedNode=E,H2t(E)&&E.select()}},m=function(E){var A=u("setReturnFocus",E);return A||(A===!1?!1:E)},g=function(E){var A=E.target,$=E.event,I=E.isBackward,D=I===void 0?!1:I;A=A||II($),d();var V=null;if(o.tabbableGroups.length>0){var N=c(A,$),F=N>=0?o.containerGroups[N]:void 0;if(N<0)D?V=o.tabbableGroups[o.tabbableGroups.length-1].lastTabbableNode:V=o.tabbableGroups[0].firstTabbableNode;else if(D){var z=Que(o.tabbableGroups,function(B){var Y=B.firstTabbableNode;return A===Y});if(z<0&&(F.container===A||N2(A,a.tabbableOptions)&&!ay(A,a.tabbableOptions)&&!F.nextTabbableNode(A,!1))&&(z=N),z>=0){var H=z===0?o.tabbableGroups.length-1:z-1,L=o.tabbableGroups[H];V=Bm(A)>=0?L.lastTabbableNode:L.lastDomTabbableNode}else cC($)||(V=F.nextTabbableNode(A,!1))}else{var U=Que(o.tabbableGroups,function(B){var Y=B.lastTabbableNode;return A===Y});if(U<0&&(F.container===A||N2(A,a.tabbableOptions)&&!ay(A,a.tabbableOptions)&&!F.nextTabbableNode(A))&&(U=N),U>=0){var Q=U===o.tabbableGroups.length-1?0:U+1,W=o.tabbableGroups[Q];V=Bm(A)>=0?W.firstTabbableNode:W.firstDomTabbableNode}else cC($)||(V=F.nextTabbableNode(A))}}else V=u("fallbackFocus");return V},v=function(E){var A=II(E);if(!(c(A,E)>=0)){if(wE(a.clickOutsideDeactivates,E)){s.deactivate({returnFocus:a.returnFocusOnDeactivate});return}wE(a.allowOutsideClick,E)||E.preventDefault()}},b=function(E){var A=II(E),$=c(A,E)>=0;if($||A instanceof Document)$&&(o.mostRecentlyFocusedNode=A);else{E.stopImmediatePropagation();var I,D=!0;if(o.mostRecentlyFocusedNode)if(Bm(o.mostRecentlyFocusedNode)>0){var V=c(o.mostRecentlyFocusedNode),N=o.containerGroups[V].tabbableNodes;if(N.length>0){var F=N.findIndex(function(z){return z===o.mostRecentlyFocusedNode});F>=0&&(a.isKeyForward(o.recentNavEvent)?F+1<N.length&&(I=N[F+1],D=!1):F-1>=0&&(I=N[F-1],D=!1))}}else o.containerGroups.some(function(z){return z.tabbableNodes.some(function(H){return Bm(H)>0})})||(D=!1);else D=!1;D&&(I=g({target:o.mostRecentlyFocusedNode,isBackward:a.isKeyBackward(o.recentNavEvent)})),p(I||o.mostRecentlyFocusedNode||f())}o.recentNavEvent=void 0},O=function(E){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;o.recentNavEvent=E;var $=g({event:E,isBackward:A});$&&(cC(E)&&E.preventDefault(),p($))},x=function(E){if(q2t(E)&&wE(a.escapeDeactivates,E)!==!1){E.preventDefault(),s.deactivate();return}(a.isKeyForward(E)||a.isKeyBackward(E))&&O(E,a.isKeyBackward(E))},w=function(E){var A=II(E);c(A,E)>=0||wE(a.clickOutsideDeactivates,E)||wE(a.allowOutsideClick,E)||(E.preventDefault(),E.stopImmediatePropagation())},S=function(){if(o.active)return Uue.activateTrap(i,s),o.delayInitialFocusTimer=a.delayInitialFocus?Vue(function(){p(f())}):p(f()),r.addEventListener("focusin",b,!0),r.addEventListener("mousedown",v,{capture:!0,passive:!1}),r.addEventListener("touchstart",v,{capture:!0,passive:!1}),r.addEventListener("click",w,{capture:!0,passive:!1}),r.addEventListener("keydown",x,{capture:!0,passive:!1}),s},T=function(){if(o.active)return r.removeEventListener("focusin",b,!0),r.removeEventListener("mousedown",v,!0),r.removeEventListener("touchstart",v,!0),r.removeEventListener("click",w,!0),r.removeEventListener("keydown",x,!0),s},k=function(E){var A=E.some(function($){var I=Array.from($.removedNodes);return I.some(function(D){return D===o.mostRecentlyFocusedNode})});A&&p(f())},M=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(k):void 0,R=function(){M&&(M.disconnect(),o.active&&!o.paused&&o.containers.map(function(E){M.observe(E,{subtree:!0,childList:!0})}))};return s={get active(){return o.active},get paused(){return o.paused},activate:function(E){if(o.active)return this;var A=l(E,"onActivate"),$=l(E,"onPostActivate"),I=l(E,"checkCanFocusTrap");I||d(),o.active=!0,o.paused=!1,o.nodeFocusedBeforeActivation=r.activeElement,A==null||A();var D=function(){I&&d(),S(),R(),$==null||$()};return I?(I(o.containers.concat()).then(D,D),this):(D(),this)},deactivate:function(E){if(!o.active)return this;var A=Bue({onDeactivate:a.onDeactivate,onPostDeactivate:a.onPostDeactivate,checkCanReturnFocus:a.checkCanReturnFocus},E);clearTimeout(o.delayInitialFocusTimer),o.delayInitialFocusTimer=void 0,T(),o.active=!1,o.paused=!1,R(),Uue.deactivateTrap(i,s);var $=l(A,"onDeactivate"),I=l(A,"onPostDeactivate"),D=l(A,"checkCanReturnFocus"),V=l(A,"returnFocus","returnFocusOnDeactivate");$==null||$();var N=function(){Vue(function(){V&&p(m(o.nodeFocusedBeforeActivation)),I==null||I()})};return V&&D?(D(m(o.nodeFocusedBeforeActivation)).then(N,N),this):(N(),this)},pause:function(E){if(o.paused||!o.active)return this;var A=l(E,"onPause"),$=l(E,"onPostPause");return o.paused=!0,A==null||A(),T(),R(),$==null||$(),this},unpause:function(E){if(!o.paused||!o.active)return this;var A=l(E,"onUnpause"),$=l(E,"onPostUnpause");return o.paused=!1,A==null||A(),d(),S(),R(),$==null||$(),this},updateContainerElements:function(E){var A=[].concat(E).filter(Boolean);return o.containers=A.map(function($){return typeof $=="string"?r.querySelector($):$}),o.active&&d(),R(),this}},s.updateContainerElements(t),s};const K2t=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:X2t},Symbol.toStringTag,{value:"Module"})),J2t=Rc(K2t),eMt=Rc(V2t);function hS(e){"@babel/helpers - typeof";return hS=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hS(e)}function tMt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zue(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,LMe(r.key),r)}}function nMt(e,t,n){return t&&zue(e.prototype,t),n&&zue(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function rMt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Az(e,t)}function Az(e,t){return Az=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Az(e,t)}function iMt(e){var t=oMt();return function(){var r=rL(e),i;if(t){var a=rL(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return aMt(this,i)}}function aMt(e,t){if(t&&(hS(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oT(e)}function oT(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oMt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function rL(e){return rL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},rL(e)}function sMt(e,t,n){return t=LMe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LMe(e){var t=lMt(e,"string");return hS(t)==="symbol"?t:String(t)}function lMt(e,t){if(hS(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(hS(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var NI=_,Jt=w3,cMt=J2t,uMt=cMt.createFocusTrap,fMt=eMt,dMt=fMt.isFocusable,HJ=function(e){rMt(n,e);var t=iMt(n);function n(r){var i;tMt(this,n),i=t.call(this,r),sMt(oT(i),"getNodeForOption",function(s){var l,c=(l=this.internalOptions[s])!==null&&l!==void 0?l:this.originalOptions[s];if(typeof c=="function"){for(var u=arguments.length,f=new Array(u>1?u-1:0),d=1;d<u;d++)f[d-1]=arguments[d];c=c.apply(void 0,f)}if(c===!0&&(c=void 0),!c){if(c===void 0||c===!1)return c;throw new Error("`".concat(s,"` was specified but was not a node, or did not return a node"))}var h=c;if(typeof c=="string"){var p;if(h=(p=this.getDocument())===null||p===void 0?void 0:p.querySelector(c),!h)throw new Error("`".concat(s,"` as selector refers to no known node"))}return h}),i.handleDeactivate=i.handleDeactivate.bind(oT(i)),i.handlePostDeactivate=i.handlePostDeactivate.bind(oT(i)),i.handleClickOutsideDeactivates=i.handleClickOutsideDeactivates.bind(oT(i)),i.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:i.handleDeactivate,onPostDeactivate:i.handlePostDeactivate,clickOutsideDeactivates:i.handleClickOutsideDeactivates},i.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var a=r.focusTrapOptions;for(var o in a)if(Object.prototype.hasOwnProperty.call(a,o)){if(o==="returnFocusOnDeactivate"||o==="onDeactivate"||o==="onPostDeactivate"||o==="checkCanReturnFocus"||o==="clickOutsideDeactivates"){i.originalOptions[o]=a[o];continue}i.internalOptions[o]=a[o]}return i.outsideClick=null,i.focusTrapElements=r.containerElements||[],i.updatePreviousElement(),i}return nMt(n,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document<"u"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var i=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return i||(i===!1?!1:this.previouslyFocusedElement)}},{key:"updatePreviousElement",value:function(){var i=this.getDocument();i&&(this.previouslyFocusedElement=i.activeElement)}},{key:"deactivateTrap",value:function(){!this.focusTrap||!this.focusTrap.active||this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(i){var a=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,i):this.originalOptions.clickOutsideDeactivates;return a&&(this.outsideClick={target:i.target,allowDeactivation:a}),a}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var i=this,a=function(){var s=i.getReturnFocusNode(),l=!!(i.originalOptions.returnFocusOnDeactivate&&s!==null&&s!==void 0&&s.focus&&(!i.outsideClick||i.outsideClick.allowDeactivation&&!dMt(i.outsideClick.target,i.internalOptions.tabbableOptions))),c=i.internalOptions.preventScroll,u=c===void 0?!1:c;l&&s.focus({preventScroll:u}),i.originalOptions.onPostDeactivate&&i.originalOptions.onPostDeactivate.call(null),i.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(a,a):a()}},{key:"setupFocusTrap",value:function(){if(this.focusTrap)this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause());else{var i=this.focusTrapElements.some(Boolean);i&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(i){if(this.focusTrap){i.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var a=!i.active&&this.props.active,o=i.active&&!this.props.active,s=!i.paused&&this.props.paused,l=i.paused&&!this.props.paused;if(a&&(this.updatePreviousElement(),this.focusTrap.activate()),o){this.deactivateTrap();return}s&&this.focusTrap.pause(),l&&this.focusTrap.unpause()}else i.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var i=this,a=this.props.children?NI.Children.only(this.props.children):void 0;if(a){if(a.type&&a.type===NI.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");var o=function(c){var u=i.props.containerElements;a&&(typeof a.ref=="function"?a.ref(c):a.ref&&(a.ref.current=c)),i.focusTrapElements=u||[c]},s=NI.cloneElement(a,{ref:o});return s}return null}}]),n}(NI.Component),SE=typeof Element>"u"?Function:Element;HJ.propTypes={active:Jt.bool,paused:Jt.bool,focusTrapOptions:Jt.shape({document:Jt.object,onActivate:Jt.func,onPostActivate:Jt.func,checkCanFocusTrap:Jt.func,onPause:Jt.func,onPostPause:Jt.func,onUnpause:Jt.func,onPostUnpause:Jt.func,onDeactivate:Jt.func,onPostDeactivate:Jt.func,checkCanReturnFocus:Jt.func,initialFocus:Jt.oneOfType([Jt.instanceOf(SE),Jt.string,Jt.bool,Jt.func]),fallbackFocus:Jt.oneOfType([Jt.instanceOf(SE),Jt.string,Jt.func]),escapeDeactivates:Jt.oneOfType([Jt.bool,Jt.func]),clickOutsideDeactivates:Jt.oneOfType([Jt.bool,Jt.func]),returnFocusOnDeactivate:Jt.bool,setReturnFocus:Jt.oneOfType([Jt.instanceOf(SE),Jt.string,Jt.bool,Jt.func]),allowOutsideClick:Jt.oneOfType([Jt.bool,Jt.func]),preventScroll:Jt.bool,tabbableOptions:Jt.shape({displayCheck:Jt.oneOf(["full","legacy-full","non-zero-area","none"]),getShadowRoot:Jt.oneOfType([Jt.bool,Jt.func])}),trapStack:Jt.array,isKeyForward:Jt.func,isKeyBackward:Jt.func}),containerElements:Jt.arrayOf(Jt.instanceOf(SE)),children:Jt.oneOfType([Jt.element,Jt.instanceOf(SE)])};HJ.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:uMt};var hMt=HJ;const pMt=Nn(hMt);function xg(e){const t=_.useRef(e);return _.useLayoutEffect(()=>{t.current=e}),_.useCallback(function(...r){var i;return(i=t.current)==null?void 0:i.call(t,...r)},[])}const mMt=e=>{const t=_.useRef(null),[n,r]=_.useState(!1),i=xg(()=>{r(!1)}),a=l=>{const c=t.current;if(!c)return;const{offsetHeight:u,offsetWidth:f,offsetTop:d,offsetLeft:h}=c,p=l.clientX-h,m=l.clientY-d,g=p/f,v=m/u;return{x:p,y:m,pctX:g,pctY:v}},o=xg(l=>{var c;n&&((c=e.onKeyDown)==null||c.call(e,l.key))}),s=xg(l=>{var p;if(!n)return;l.preventDefault();const c=t.current;if(!c)return;const{offsetHeight:u,offsetWidth:f}=c,{deltaX:d,deltaY:h}=l;(p=e.onWheel)==null||p.call(e,{deltaX:d,deltaY:h,pctDeltaX:d/f,pctDeltaY:h/u})});return _.useEffect(()=>(window.addEventListener("keydown",o),()=>{window.removeEventListener("keydown",o)}),[o]),_.useEffect(()=>{if(!t.current)return;const l=t.current;return l.addEventListener("wheel",s,{passive:!1}),()=>{l.removeEventListener("wheel",s)}},[s]),y.jsx(pMt,{active:n,focusTrapOptions:{escapeDeactivates:!0,clickOutsideDeactivates:!0,onDeactivate:i},children:y.jsxs("div",{ref:t,className:"group relative",onClick:l=>{var u;const c=a(l);c&&(r(!0),(u=e.onClick)==null||u.call(e,c))},onMouseMove:l=>{var u;const c=a(l);c&&(r(!0),(u=e.onMouseMove)==null||u.call(e,c))},children:[y.jsx("input",{className:"absolute h-0 w-0"}),e.children]})})};var jMe={exports:{}},FMe={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},BMe={exports:{}},gMt=function(t){return!t||typeof t=="string"?!1:t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&t.constructor.name!=="String")},vMt=gMt,yMt=Array.prototype.concat,bMt=Array.prototype.slice,Wue=BMe.exports=function(t){for(var n=[],r=0,i=t.length;r<i;r++){var a=t[r];vMt(a)?n=yMt.call(n,bMt.call(a)):n.push(a)}return n};Wue.wrap=function(e){return function(){return e(Wue(arguments))}};var OMt=BMe.exports,uC=FMe,Ik=OMt,UMe=Object.hasOwnProperty,VMe=Object.create(null);for(var FB in uC)UMe.call(uC,FB)&&(VMe[uC[FB]]=FB);var dc=jMe.exports={to:{},get:{}};dc.get=function(e){var t=e.substring(0,3).toLowerCase(),n,r;switch(t){case"hsl":n=dc.get.hsl(e),r="hsl";break;case"hwb":n=dc.get.hwb(e),r="hwb";break;default:n=dc.get.rgb(e),r="rgb";break}return n?{model:r,value:n}:null};dc.get.rgb=function(e){if(!e)return null;var t=/^#([a-f0-9]{3,4})$/i,n=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,r=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,a=/^(\w+)$/,o=[0,0,0,1],s,l,c;if(s=e.match(n)){for(c=s[2],s=s[1],l=0;l<3;l++){var u=l*2;o[l]=parseInt(s.slice(u,u+2),16)}c&&(o[3]=parseInt(c,16)/255)}else if(s=e.match(t)){for(s=s[1],c=s[3],l=0;l<3;l++)o[l]=parseInt(s[l]+s[l],16);c&&(o[3]=parseInt(c+c,16)/255)}else if(s=e.match(r)){for(l=0;l<3;l++)o[l]=parseInt(s[l+1],0);s[4]&&(s[5]?o[3]=parseFloat(s[4])*.01:o[3]=parseFloat(s[4]))}else if(s=e.match(i)){for(l=0;l<3;l++)o[l]=Math.round(parseFloat(s[l+1])*2.55);s[4]&&(s[5]?o[3]=parseFloat(s[4])*.01:o[3]=parseFloat(s[4]))}else return(s=e.match(a))?s[1]==="transparent"?[0,0,0,0]:UMe.call(uC,s[1])?(o=uC[s[1]],o[3]=1,o):null:null;for(l=0;l<3;l++)o[l]=wg(o[l],0,255);return o[3]=wg(o[3],0,1),o};dc.get.hsl=function(e){if(!e)return null;var t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var r=parseFloat(n[4]),i=(parseFloat(n[1])%360+360)%360,a=wg(parseFloat(n[2]),0,100),o=wg(parseFloat(n[3]),0,100),s=wg(isNaN(r)?1:r,0,1);return[i,a,o,s]}return null};dc.get.hwb=function(e){if(!e)return null;var t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var r=parseFloat(n[4]),i=(parseFloat(n[1])%360+360)%360,a=wg(parseFloat(n[2]),0,100),o=wg(parseFloat(n[3]),0,100),s=wg(isNaN(r)?1:r,0,1);return[i,a,o,s]}return null};dc.to.hex=function(){var e=Ik(arguments);return"#"+MI(e[0])+MI(e[1])+MI(e[2])+(e[3]<1?MI(Math.round(e[3]*255)):"")};dc.to.rgb=function(){var e=Ik(arguments);return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};dc.to.rgb.percent=function(){var e=Ik(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+n+"%, "+r+"%)":"rgba("+t+"%, "+n+"%, "+r+"%, "+e[3]+")"};dc.to.hsl=function(){var e=Ik(arguments);return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};dc.to.hwb=function(){var e=Ik(arguments),t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};dc.to.keyword=function(e){return VMe[e.slice(0,3)]};function wg(e,t,n){return Math.min(Math.max(t,e),n)}function MI(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}var xMt=jMe.exports;const zA=FMe,QMe={};for(const e of Object.keys(zA))QMe[zA[e]]=e;const Ut={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var zMe=Ut;for(const e of Object.keys(Ut)){if(!("channels"in Ut[e]))throw new Error("missing channels property: "+e);if(!("labels"in Ut[e]))throw new Error("missing channel labels property: "+e);if(Ut[e].labels.length!==Ut[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=Ut[e];delete Ut[e].channels,delete Ut[e].labels,Object.defineProperty(Ut[e],"channels",{value:t}),Object.defineProperty(Ut[e],"labels",{value:n})}Ut.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i;let s,l;a===i?s=0:t===a?s=(n-r)/o:n===a?s=2+(r-t)/o:r===a&&(s=4+(t-n)/o),s=Math.min(s*60,360),s<0&&(s+=360);const c=(i+a)/2;return a===i?l=0:c<=.5?l=o/(a+i):l=o/(2-a-i),[s,l*100,c*100]};Ut.rgb.hsv=function(e){let t,n,r,i,a;const o=e[0]/255,s=e[1]/255,l=e[2]/255,c=Math.max(o,s,l),u=c-Math.min(o,s,l),f=function(d){return(c-d)/6/u+1/2};return u===0?(i=0,a=0):(a=u/c,t=f(o),n=f(s),r=f(l),o===c?i=r-n:s===c?i=1/3+t-r:l===c&&(i=2/3+n-t),i<0?i+=1:i>1&&(i-=1)),[i*360,a*100,c*100]};Ut.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const i=Ut.rgb.hsl(e)[0],a=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,a*100,r*100]};Ut.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r),a=(1-t-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,s=(1-r-i)/(1-i)||0;return[a*100,o*100,s*100,i*100]};function wMt(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}Ut.rgb.keyword=function(e){const t=QMe[e];if(t)return t;let n=1/0,r;for(const i of Object.keys(zA)){const a=zA[i],o=wMt(e,a);o<n&&(n=o,r=i)}return r};Ut.keyword.rgb=function(e){return zA[e]};Ut.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;const i=t*.4124+n*.3576+r*.1805,a=t*.2126+n*.7152+r*.0722,o=t*.0193+n*.1192+r*.9505;return[i*100,a*100,o*100]};Ut.rgb.lab=function(e){const t=Ut.rgb.xyz(e);let n=t[0],r=t[1],i=t[2];n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;const a=116*r-16,o=500*(n-r),s=200*(r-i);return[a,o,s]};Ut.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let i,a,o;if(n===0)return o=r*255,[o,o,o];r<.5?i=r*(1+n):i=r+n-r*n;const s=2*r-i,l=[0,0,0];for(let c=0;c<3;c++)a=t+1/3*-(c-1),a<0&&a++,a>1&&a--,6*a<1?o=s+(i-s)*6*a:2*a<1?o=i:3*a<2?o=s+(i-s)*(2/3-a)*6:o=s,l[c]=o*255;return l};Ut.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,i=n;const a=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=a<=1?a:2-a;const o=(r+n)/2,s=r===0?2*i/(a+i):2*n/(r+n);return[t,s*100,o*100]};Ut.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const i=Math.floor(t)%6,a=t-Math.floor(t),o=255*r*(1-n),s=255*r*(1-n*a),l=255*r*(1-n*(1-a));switch(r*=255,i){case 0:return[r,l,o];case 1:return[s,r,o];case 2:return[o,r,l];case 3:return[o,s,r];case 4:return[l,o,r];case 5:return[r,o,s]}};Ut.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01);let a,o;o=(2-n)*r;const s=(2-n)*i;return a=n*i,a/=s<=1?s:2-s,a=a||0,o/=2,[t,a*100,o*100]};Ut.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const i=n+r;let a;i>1&&(n/=i,r/=i);const o=Math.floor(6*t),s=1-r;a=6*t-o,o&1&&(a=1-a);const l=n+a*(s-n);let c,u,f;switch(o){default:case 6:case 0:c=s,u=l,f=n;break;case 1:c=l,u=s,f=n;break;case 2:c=n,u=s,f=l;break;case 3:c=n,u=l,f=s;break;case 4:c=l,u=n,f=s;break;case 5:c=s,u=n,f=l;break}return[c*255,u*255,f*255]};Ut.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100,a=1-Math.min(1,t*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),s=1-Math.min(1,r*(1-i)+i);return[a*255,o*255,s*255]};Ut.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let i,a,o;return i=t*3.2406+n*-1.5372+r*-.4986,a=t*-.9689+n*1.8758+r*.0415,o=t*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]};Ut.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;const i=116*n-16,a=500*(t-n),o=200*(n-r);return[i,a,o]};Ut.lab.xyz=function(e){const t=e[0],n=e[1],r=e[2];let i,a,o;a=(t+16)/116,i=n/500+a,o=a-r/200;const s=a**3,l=i**3,c=o**3;return a=s>.008856?s:(a-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]};Ut.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let i;i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360);const o=Math.sqrt(n*n+r*r);return[t,o,i]};Ut.lch.lab=function(e){const t=e[0],n=e[1],i=e[2]/360*2*Math.PI,a=n*Math.cos(i),o=n*Math.sin(i);return[t,a,o]};Ut.rgb.ansi16=function(e,t=null){const[n,r,i]=e;let a=t===null?Ut.rgb.hsv(e)[2]:t;if(a=Math.round(a/50),a===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return a===2&&(o+=60),o};Ut.hsv.ansi16=function(e){return Ut.rgb.ansi16(Ut.hsv.rgb(e),e[2])};Ut.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};Ut.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=(~~(e>50)+1)*.5,r=(t&1)*n*255,i=(t>>1&1)*n*255,a=(t>>2&1)*n*255;return[r,i,a]};Ut.ansi256.rgb=function(e){if(e>=232){const a=(e-232)*10+8;return[a,a,a]}e-=16;let t;const n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,i=t%6/5*255;return[n,r,i]};Ut.rgb.hex=function(e){const n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};Ut.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split("").map(s=>s+s).join(""));const r=parseInt(n,16),i=r>>16&255,a=r>>8&255,o=r&255;return[i,a,o]};Ut.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),o=i-a;let s,l;return o<1?s=a/(1-o):s=0,o<=0?l=0:i===t?l=(n-r)/o%6:i===n?l=2+(r-t)/o:l=4+(t-n)/o,l/=6,l%=1,[l*360,o*100,s*100]};Ut.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],r*100,i*100]};Ut.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]};Ut.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];const i=[0,0,0],a=t%1*6,o=a%1,s=1-o;let l=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return l=(1-n)*r,[(n*i[0]+l)*255,(n*i[1]+l)*255,(n*i[2]+l)*255]};Ut.hcg.hsv=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);let i=0;return r>0&&(i=t/r),[e[0],i*100,r*100]};Ut.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let i=0;return r>0&&r<.5?i=t/(2*r):r>=.5&&r<1&&(i=t/(2*(1-r))),[e[0],i*100,r*100]};Ut.hcg.hwb=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};Ut.hwb.hcg=function(e){const t=e[1]/100,r=1-e[2]/100,i=r-t;let a=0;return i<1&&(a=(r-i)/(1-i)),[e[0],i*100,a*100]};Ut.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};Ut.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};Ut.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};Ut.gray.hsl=function(e){return[0,0,e[0]]};Ut.gray.hsv=Ut.gray.hsl;Ut.gray.hwb=function(e){return[0,100,e[0]]};Ut.gray.cmyk=function(e){return[0,0,0,e[0]]};Ut.gray.lab=function(e){return[e[0],0,0]};Ut.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r};Ut.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const iL=zMe;function SMt(){const e={},t=Object.keys(iL);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function _Mt(e){const t=SMt(),n=[e];for(t[e].distance=0;n.length;){const r=n.pop(),i=Object.keys(iL[r]);for(let a=i.length,o=0;o<a;o++){const s=i[o],l=t[s];l.distance===-1&&(l.distance=t[r].distance+1,l.parent=r,n.unshift(s))}}return t}function EMt(e,t){return function(n){return t(e(n))}}function TMt(e,t){const n=[t[e].parent,e];let r=iL[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)n.unshift(t[i].parent),r=EMt(iL[t[i].parent][i],r),i=t[i].parent;return r.conversion=n,r}var CMt=function(e){const t=_Mt(e),n={},r=Object.keys(t);for(let i=r.length,a=0;a<i;a++){const o=r[a];t[o].parent!==null&&(n[o]=TMt(o,t))}return n};const $z=zMe,AMt=CMt,YO={},$Mt=Object.keys($z);function PMt(e){const t=function(...n){const r=n[0];return r==null?r:(r.length>1&&(n=r),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function kMt(e){const t=function(...n){const r=n[0];if(r==null)return r;r.length>1&&(n=r);const i=e(n);if(typeof i=="object")for(let a=i.length,o=0;o<a;o++)i[o]=Math.round(i[o]);return i};return"conversion"in e&&(t.conversion=e.conversion),t}$Mt.forEach(e=>{YO[e]={},Object.defineProperty(YO[e],"channels",{value:$z[e].channels}),Object.defineProperty(YO[e],"labels",{value:$z[e].labels});const t=AMt(e);Object.keys(t).forEach(r=>{const i=t[r];YO[e][r]=kMt(i),YO[e][r].raw=PMt(i)})});var RMt=YO;const XO=xMt,ac=RMt,WMe=["keyword","gray","hex"],Pz={};for(const e of Object.keys(ac))Pz[[...ac[e].labels].sort().join("")]=e;const aL={};function co(e,t){if(!(this instanceof co))return new co(e,t);if(t&&t in WMe&&(t=null),t&&!(t in ac))throw new Error("Unknown model: "+t);let n,r;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof co)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e=="string"){const i=XO.get(e);if(i===null)throw new Error("Unable to parse color from string: "+e);this.model=i.model,r=ac[this.model].channels,this.color=i.value.slice(0,r),this.valpha=typeof i.value[r]=="number"?i.value[r]:1}else if(e.length>0){this.model=t||"rgb",r=ac[this.model].channels;const i=Array.prototype.slice.call(e,0,r);this.color=kz(i,r),this.valpha=typeof e[r]=="number"?e[r]:1}else if(typeof e=="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;const i=Object.keys(e);"alpha"in e&&(i.splice(i.indexOf("alpha"),1),this.valpha=typeof e.alpha=="number"?e.alpha:0);const a=i.sort().join("");if(!(a in Pz))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=Pz[a];const{labels:o}=ac[this.model],s=[];for(n=0;n<o.length;n++)s.push(e[o[n]]);this.color=kz(s)}if(aL[this.model])for(r=ac[this.model].channels,n=0;n<r;n++){const i=aL[this.model][n];i&&(this.color[n]=i(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}co.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in XO.to?this:this.rgb();t=t.round(typeof e=="number"?e:1);const n=t.valpha===1?t.color:[...t.color,this.valpha];return XO.to[t.model](n)},percentString(e){const t=this.rgb().round(typeof e=="number"?e:1),n=t.valpha===1?t.color:[...t.color,this.valpha];return XO.to.rgb.percent(n)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){const e={},{channels:t}=ac[this.model],{labels:n}=ac[this.model];for(let r=0;r<t;r++)e[n[r]]=this.color[r];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray(){const e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject(){const e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new co([...this.color.map(NMt(e)),this.valpha],this.model)},alpha(e){return e!==void 0?new co([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:sa("rgb",0,La(255)),green:sa("rgb",1,La(255)),blue:sa("rgb",2,La(255)),hue:sa(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:sa("hsl",1,La(100)),lightness:sa("hsl",2,La(100)),saturationv:sa("hsv",1,La(100)),value:sa("hsv",2,La(100)),chroma:sa("hcg",1,La(100)),gray:sa("hcg",2,La(100)),white:sa("hwb",1,La(100)),wblack:sa("hwb",2,La(100)),cyan:sa("cmyk",0,La(100)),magenta:sa("cmyk",1,La(100)),yellow:sa("cmyk",2,La(100)),black:sa("cmyk",3,La(100)),x:sa("xyz",0,La(95.047)),y:sa("xyz",1,La(100)),z:sa("xyz",2,La(108.833)),l:sa("lab",0,La(100)),a:sa("lab",1),b:sa("lab",2),keyword(e){return e!==void 0?new co(e):ac[this.model].keyword(this.color)},hex(e){return e!==void 0?new co(e):XO.to.hex(this.rgb().round().color)},hexa(e){if(e!==void 0)return new co(e);const t=this.rgb().round().color;let n=Math.round(this.valpha*255).toString(16).toUpperCase();return n.length===1&&(n="0"+n),XO.to.hex(t)+n},rgbNumber(){const e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){const e=this.rgb().color,t=[];for(const[n,r]of e.entries()){const i=r/255;t[n]=i<=.04045?i/12.92:((i+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=e[0]*.3+e[1]*.59+e[2]*.11;return co.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const n=e.rgb(),r=this.rgb(),i=t===void 0?.5:t,a=2*i-1,o=n.alpha()-r.alpha(),s=((a*o===-1?a:(a+o)/(1+a*o))+1)/2,l=1-s;return co.rgb(s*n.red()+l*r.red(),s*n.green()+l*r.green(),s*n.blue()+l*r.blue(),n.alpha()*i+r.alpha()*(1-i))}};for(const e of Object.keys(ac)){if(WMe.includes(e))continue;const{channels:t}=ac[e];co.prototype[e]=function(...n){return this.model===e?new co(this):n.length>0?new co(n,e):new co([...MMt(ac[this.model][e].raw(this.color)),this.valpha],e)},co[e]=function(...n){let r=n[0];return typeof r=="number"&&(r=kz(n,t)),new co(r,e)}}function IMt(e,t){return Number(e.toFixed(t))}function NMt(e){return function(t){return IMt(t,e)}}function sa(e,t,n){e=Array.isArray(e)?e:[e];for(const r of e)(aL[r]||(aL[r]=[]))[t]=n;return e=e[0],function(r){let i;return r!==void 0?(n&&(r=n(r)),i=this[e](),i.color[t]=r,i):(i=this[e]().color[t],n&&(i=n(i)),i)}}function La(e){return function(t){return Math.max(0,Math.min(e,t))}}function MMt(e){return Array.isArray(e)?e:[e]}function kz(e,t){for(let n=0;n<t;n++)typeof e[n]!="number"&&(e[n]=0);return e}var DMt=co;const Hue=Nn(DMt);function LMt(e){const t=e[0],n=e[1],r=e[2];let i,a,o;return i=t*1+n*0+r*1.13983,a=t*1+n*-.39465+r*-.5806,o=t*1+n*2.02311+r*0,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]}function jMt(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=t*.299+n*.587+r*.114,a=t*-.14713+n*-.28886+r*.436,o=t*.615+n*-.51499+r*-.10001;return[i,a,o]}const FMt={scheme:"threezerotwofour",author:"jan t. sott (http://github.com/idleberg)",base00:"#090300",base01:"#3a3432",base02:"#4a4543",base03:"#5c5855",base04:"#807d7c",base05:"#a5a2a2",base06:"#d6d5d4",base07:"#f7f7f7",base08:"#db2d20",base09:"#e8bbd0",base0A:"#fded02",base0B:"#01a252",base0C:"#b5e4f4",base0D:"#01a0e4",base0E:"#a16a94",base0F:"#cdab53"},BMt={scheme:"apathy",author:"jannik siebert (https://github.com/janniks)",base00:"#031A16",base01:"#0B342D",base02:"#184E45",base03:"#2B685E",base04:"#5F9C92",base05:"#81B5AC",base06:"#A7CEC8",base07:"#D2E7E4",base08:"#3E9688",base09:"#3E7996",base0A:"#3E4C96",base0B:"#883E96",base0C:"#963E4C",base0D:"#96883E",base0E:"#4C963E",base0F:"#3E965B"},UMt={scheme:"ashes",author:"jannik siebert (https://github.com/janniks)",base00:"#1C2023",base01:"#393F45",base02:"#565E65",base03:"#747C84",base04:"#ADB3BA",base05:"#C7CCD1",base06:"#DFE2E5",base07:"#F3F4F5",base08:"#C7AE95",base09:"#C7C795",base0A:"#AEC795",base0B:"#95C7AE",base0C:"#95AEC7",base0D:"#AE95C7",base0E:"#C795AE",base0F:"#C79595"},VMt={scheme:"atelier dune",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune)",base00:"#20201d",base01:"#292824",base02:"#6e6b5e",base03:"#7d7a68",base04:"#999580",base05:"#a6a28c",base06:"#e8e4cf",base07:"#fefbec",base08:"#d73737",base09:"#b65611",base0A:"#cfb017",base0B:"#60ac39",base0C:"#1fad83",base0D:"#6684e1",base0E:"#b854d4",base0F:"#d43552"},QMt={scheme:"atelier forest",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/forest)",base00:"#1b1918",base01:"#2c2421",base02:"#68615e",base03:"#766e6b",base04:"#9c9491",base05:"#a8a19f",base06:"#e6e2e0",base07:"#f1efee",base08:"#f22c40",base09:"#df5320",base0A:"#d5911a",base0B:"#5ab738",base0C:"#00ad9c",base0D:"#407ee7",base0E:"#6666ea",base0F:"#c33ff3"},zMt={scheme:"atelier heath",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/heath)",base00:"#1b181b",base01:"#292329",base02:"#695d69",base03:"#776977",base04:"#9e8f9e",base05:"#ab9bab",base06:"#d8cad8",base07:"#f7f3f7",base08:"#ca402b",base09:"#a65926",base0A:"#bb8a35",base0B:"#379a37",base0C:"#159393",base0D:"#516aec",base0E:"#7b59c0",base0F:"#cc33cc"},WMt={scheme:"atelier lakeside",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/lakeside/)",base00:"#161b1d",base01:"#1f292e",base02:"#516d7b",base03:"#5a7b8c",base04:"#7195a8",base05:"#7ea2b4",base06:"#c1e4f6",base07:"#ebf8ff",base08:"#d22d72",base09:"#935c25",base0A:"#8a8a0f",base0B:"#568c3b",base0C:"#2d8f6f",base0D:"#257fad",base0E:"#5d5db1",base0F:"#b72dd2"},HMt={scheme:"atelier seaside",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/seaside/)",base00:"#131513",base01:"#242924",base02:"#5e6e5e",base03:"#687d68",base04:"#809980",base05:"#8ca68c",base06:"#cfe8cf",base07:"#f0fff0",base08:"#e6193c",base09:"#87711d",base0A:"#c3c322",base0B:"#29a329",base0C:"#1999b3",base0D:"#3d62f5",base0E:"#ad2bee",base0F:"#e619c3"},qMt={scheme:"bespin",author:"jan t. sott",base00:"#28211c",base01:"#36312e",base02:"#5e5d5c",base03:"#666666",base04:"#797977",base05:"#8a8986",base06:"#9d9b97",base07:"#baae9e",base08:"#cf6a4c",base09:"#cf7d34",base0A:"#f9ee98",base0B:"#54be0d",base0C:"#afc4db",base0D:"#5ea6ea",base0E:"#9b859d",base0F:"#937121"},GMt={scheme:"brewer",author:"timothée poisot (http://github.com/tpoisot)",base00:"#0c0d0e",base01:"#2e2f30",base02:"#515253",base03:"#737475",base04:"#959697",base05:"#b7b8b9",base06:"#dadbdc",base07:"#fcfdfe",base08:"#e31a1c",base09:"#e6550d",base0A:"#dca060",base0B:"#31a354",base0C:"#80b1d3",base0D:"#3182bd",base0E:"#756bb1",base0F:"#b15928"},ZMt={scheme:"bright",author:"chris kempson (http://chriskempson.com)",base00:"#000000",base01:"#303030",base02:"#505050",base03:"#b0b0b0",base04:"#d0d0d0",base05:"#e0e0e0",base06:"#f5f5f5",base07:"#ffffff",base08:"#fb0120",base09:"#fc6d24",base0A:"#fda331",base0B:"#a1c659",base0C:"#76c7b7",base0D:"#6fb3d2",base0E:"#d381c3",base0F:"#be643c"},YMt={scheme:"chalk",author:"chris kempson (http://chriskempson.com)",base00:"#151515",base01:"#202020",base02:"#303030",base03:"#505050",base04:"#b0b0b0",base05:"#d0d0d0",base06:"#e0e0e0",base07:"#f5f5f5",base08:"#fb9fb1",base09:"#eda987",base0A:"#ddb26f",base0B:"#acc267",base0C:"#12cfc0",base0D:"#6fc2ef",base0E:"#e1a3ee",base0F:"#deaf8f"},XMt={scheme:"codeschool",author:"brettof86",base00:"#232c31",base01:"#1c3657",base02:"#2a343a",base03:"#3f4944",base04:"#84898c",base05:"#9ea7a6",base06:"#a7cfa3",base07:"#b5d8f6",base08:"#2a5491",base09:"#43820d",base0A:"#a03b1e",base0B:"#237986",base0C:"#b02f30",base0D:"#484d79",base0E:"#c59820",base0F:"#c98344"},KMt={scheme:"colors",author:"mrmrs (http://clrs.cc)",base00:"#111111",base01:"#333333",base02:"#555555",base03:"#777777",base04:"#999999",base05:"#bbbbbb",base06:"#dddddd",base07:"#ffffff",base08:"#ff4136",base09:"#ff851b",base0A:"#ffdc00",base0B:"#2ecc40",base0C:"#7fdbff",base0D:"#0074d9",base0E:"#b10dc9",base0F:"#85144b"},JMt={scheme:"default",author:"chris kempson (http://chriskempson.com)",base00:"#181818",base01:"#282828",base02:"#383838",base03:"#585858",base04:"#b8b8b8",base05:"#d8d8d8",base06:"#e8e8e8",base07:"#f8f8f8",base08:"#ab4642",base09:"#dc9656",base0A:"#f7ca88",base0B:"#a1b56c",base0C:"#86c1b9",base0D:"#7cafc2",base0E:"#ba8baf",base0F:"#a16946"},eDt={scheme:"eighties",author:"chris kempson (http://chriskempson.com)",base00:"#2d2d2d",base01:"#393939",base02:"#515151",base03:"#747369",base04:"#a09f93",base05:"#d3d0c8",base06:"#e8e6df",base07:"#f2f0ec",base08:"#f2777a",base09:"#f99157",base0A:"#ffcc66",base0B:"#99cc99",base0C:"#66cccc",base0D:"#6699cc",base0E:"#cc99cc",base0F:"#d27b53"},tDt={scheme:"embers",author:"jannik siebert (https://github.com/janniks)",base00:"#16130F",base01:"#2C2620",base02:"#433B32",base03:"#5A5047",base04:"#8A8075",base05:"#A39A90",base06:"#BEB6AE",base07:"#DBD6D1",base08:"#826D57",base09:"#828257",base0A:"#6D8257",base0B:"#57826D",base0C:"#576D82",base0D:"#6D5782",base0E:"#82576D",base0F:"#825757"},nDt={scheme:"flat",author:"chris kempson (http://chriskempson.com)",base00:"#2C3E50",base01:"#34495E",base02:"#7F8C8D",base03:"#95A5A6",base04:"#BDC3C7",base05:"#e0e0e0",base06:"#f5f5f5",base07:"#ECF0F1",base08:"#E74C3C",base09:"#E67E22",base0A:"#F1C40F",base0B:"#2ECC71",base0C:"#1ABC9C",base0D:"#3498DB",base0E:"#9B59B6",base0F:"#be643c"},rDt={scheme:"google",author:"seth wright (http://sethawright.com)",base00:"#1d1f21",base01:"#282a2e",base02:"#373b41",base03:"#969896",base04:"#b4b7b4",base05:"#c5c8c6",base06:"#e0e0e0",base07:"#ffffff",base08:"#CC342B",base09:"#F96A38",base0A:"#FBA922",base0B:"#198844",base0C:"#3971ED",base0D:"#3971ED",base0E:"#A36AC7",base0F:"#3971ED"},iDt={scheme:"grayscale",author:"alexandre gavioli (https://github.com/alexx2/)",base00:"#101010",base01:"#252525",base02:"#464646",base03:"#525252",base04:"#ababab",base05:"#b9b9b9",base06:"#e3e3e3",base07:"#f7f7f7",base08:"#7c7c7c",base09:"#999999",base0A:"#a0a0a0",base0B:"#8e8e8e",base0C:"#868686",base0D:"#686868",base0E:"#747474",base0F:"#5e5e5e"},aDt={scheme:"green screen",author:"chris kempson (http://chriskempson.com)",base00:"#001100",base01:"#003300",base02:"#005500",base03:"#007700",base04:"#009900",base05:"#00bb00",base06:"#00dd00",base07:"#00ff00",base08:"#007700",base09:"#009900",base0A:"#007700",base0B:"#00bb00",base0C:"#005500",base0D:"#009900",base0E:"#00bb00",base0F:"#005500"},oDt={scheme:"harmonic16",author:"jannik siebert (https://github.com/janniks)",base00:"#0b1c2c",base01:"#223b54",base02:"#405c79",base03:"#627e99",base04:"#aabcce",base05:"#cbd6e2",base06:"#e5ebf1",base07:"#f7f9fb",base08:"#bf8b56",base09:"#bfbf56",base0A:"#8bbf56",base0B:"#56bf8b",base0C:"#568bbf",base0D:"#8b56bf",base0E:"#bf568b",base0F:"#bf5656"},sDt={scheme:"hopscotch",author:"jan t. sott",base00:"#322931",base01:"#433b42",base02:"#5c545b",base03:"#797379",base04:"#989498",base05:"#b9b5b8",base06:"#d5d3d5",base07:"#ffffff",base08:"#dd464c",base09:"#fd8b19",base0A:"#fdcc59",base0B:"#8fc13e",base0C:"#149b93",base0D:"#1290bf",base0E:"#c85e7c",base0F:"#b33508"},lDt={scheme:"isotope",author:"jan t. sott",base00:"#000000",base01:"#404040",base02:"#606060",base03:"#808080",base04:"#c0c0c0",base05:"#d0d0d0",base06:"#e0e0e0",base07:"#ffffff",base08:"#ff0000",base09:"#ff9900",base0A:"#ff0099",base0B:"#33ff00",base0C:"#00ffff",base0D:"#0066ff",base0E:"#cc00ff",base0F:"#3300ff"},cDt={scheme:"marrakesh",author:"alexandre gavioli (http://github.com/alexx2/)",base00:"#201602",base01:"#302e00",base02:"#5f5b17",base03:"#6c6823",base04:"#86813b",base05:"#948e48",base06:"#ccc37a",base07:"#faf0a5",base08:"#c35359",base09:"#b36144",base0A:"#a88339",base0B:"#18974e",base0C:"#75a738",base0D:"#477ca1",base0E:"#8868b3",base0F:"#b3588e"},uDt={scheme:"mocha",author:"chris kempson (http://chriskempson.com)",base00:"#3B3228",base01:"#534636",base02:"#645240",base03:"#7e705a",base04:"#b8afad",base05:"#d0c8c6",base06:"#e9e1dd",base07:"#f5eeeb",base08:"#cb6077",base09:"#d28b71",base0A:"#f4bc87",base0B:"#beb55b",base0C:"#7bbda4",base0D:"#8ab3b5",base0E:"#a89bb9",base0F:"#bb9584"},fDt={scheme:"monokai",author:"wimer hazenberg (http://www.monokai.nl)",base00:"#272822",base01:"#383830",base02:"#49483e",base03:"#75715e",base04:"#a59f85",base05:"#f8f8f2",base06:"#f5f4f1",base07:"#f9f8f5",base08:"#f92672",base09:"#fd971f",base0A:"#f4bf75",base0B:"#a6e22e",base0C:"#a1efe4",base0D:"#66d9ef",base0E:"#ae81ff",base0F:"#cc6633"},dDt={scheme:"nicinabox",author:"nicinabox (http://github.com/nicinabox)",base00:"#2A2F3A",base01:"#3C444F",base02:"#4F5A65",base03:"#BEBEBE",base04:"#b0b0b0",base05:"#d0d0d0",base06:"#FFFFFF",base07:"#f5f5f5",base08:"#fb9fb1",base09:"#FC6D24",base0A:"#ddb26f",base0B:"#A1C659",base0C:"#12cfc0",base0D:"#6FB3D2",base0E:"#D381C3",base0F:"#deaf8f"},hDt={scheme:"ocean",author:"chris kempson (http://chriskempson.com)",base00:"#2b303b",base01:"#343d46",base02:"#4f5b66",base03:"#65737e",base04:"#a7adba",base05:"#c0c5ce",base06:"#dfe1e8",base07:"#eff1f5",base08:"#bf616a",base09:"#d08770",base0A:"#ebcb8b",base0B:"#a3be8c",base0C:"#96b5b4",base0D:"#8fa1b3",base0E:"#b48ead",base0F:"#ab7967"},pDt={scheme:"paraiso",author:"jan t. sott",base00:"#2f1e2e",base01:"#41323f",base02:"#4f424c",base03:"#776e71",base04:"#8d8687",base05:"#a39e9b",base06:"#b9b6b0",base07:"#e7e9db",base08:"#ef6155",base09:"#f99b15",base0A:"#fec418",base0B:"#48b685",base0C:"#5bc4bf",base0D:"#06b6ef",base0E:"#815ba4",base0F:"#e96ba8"},mDt={scheme:"pop",author:"chris kempson (http://chriskempson.com)",base00:"#000000",base01:"#202020",base02:"#303030",base03:"#505050",base04:"#b0b0b0",base05:"#d0d0d0",base06:"#e0e0e0",base07:"#ffffff",base08:"#eb008a",base09:"#f29333",base0A:"#f8ca12",base0B:"#37b349",base0C:"#00aabb",base0D:"#0e5a94",base0E:"#b31e8d",base0F:"#7a2d00"},gDt={scheme:"railscasts",author:"ryan bates (http://railscasts.com)",base00:"#2b2b2b",base01:"#272935",base02:"#3a4055",base03:"#5a647e",base04:"#d4cfc9",base05:"#e6e1dc",base06:"#f4f1ed",base07:"#f9f7f3",base08:"#da4939",base09:"#cc7833",base0A:"#ffc66d",base0B:"#a5c261",base0C:"#519f50",base0D:"#6d9cbe",base0E:"#b6b3eb",base0F:"#bc9458"},vDt={scheme:"shapeshifter",author:"tyler benziger (http://tybenz.com)",base00:"#000000",base01:"#040404",base02:"#102015",base03:"#343434",base04:"#555555",base05:"#ababab",base06:"#e0e0e0",base07:"#f9f9f9",base08:"#e92f2f",base09:"#e09448",base0A:"#dddd13",base0B:"#0ed839",base0C:"#23edda",base0D:"#3b48e3",base0E:"#f996e2",base0F:"#69542d"},yDt={scheme:"solarized",author:"ethan schoonover (http://ethanschoonover.com/solarized)",base00:"#002b36",base01:"#073642",base02:"#586e75",base03:"#657b83",base04:"#839496",base05:"#93a1a1",base06:"#eee8d5",base07:"#fdf6e3",base08:"#dc322f",base09:"#cb4b16",base0A:"#b58900",base0B:"#859900",base0C:"#2aa198",base0D:"#268bd2",base0E:"#6c71c4",base0F:"#d33682"},bDt={scheme:"summerfruit",author:"christopher corley (http://cscorley.github.io/)",base00:"#151515",base01:"#202020",base02:"#303030",base03:"#505050",base04:"#B0B0B0",base05:"#D0D0D0",base06:"#E0E0E0",base07:"#FFFFFF",base08:"#FF0086",base09:"#FD8900",base0A:"#ABA800",base0B:"#00C918",base0C:"#1faaaa",base0D:"#3777E6",base0E:"#AD00A1",base0F:"#cc6633"},ODt={scheme:"tomorrow",author:"chris kempson (http://chriskempson.com)",base00:"#1d1f21",base01:"#282a2e",base02:"#373b41",base03:"#969896",base04:"#b4b7b4",base05:"#c5c8c6",base06:"#e0e0e0",base07:"#ffffff",base08:"#cc6666",base09:"#de935f",base0A:"#f0c674",base0B:"#b5bd68",base0C:"#8abeb7",base0D:"#81a2be",base0E:"#b294bb",base0F:"#a3685a"},xDt={scheme:"london tube",author:"jan t. sott",base00:"#231f20",base01:"#1c3f95",base02:"#5a5758",base03:"#737171",base04:"#959ca1",base05:"#d9d8d8",base06:"#e7e7e8",base07:"#ffffff",base08:"#ee2e24",base09:"#f386a1",base0A:"#ffd204",base0B:"#00853e",base0C:"#85cebc",base0D:"#009ddc",base0E:"#98005d",base0F:"#b06110"},wDt={scheme:"twilight",author:"david hart (http://hart-dev.com)",base00:"#1e1e1e",base01:"#323537",base02:"#464b50",base03:"#5f5a60",base04:"#838184",base05:"#a7a7a7",base06:"#c3c3c3",base07:"#ffffff",base08:"#cf6a4c",base09:"#cda869",base0A:"#f9ee98",base0B:"#8f9d6a",base0C:"#afc4db",base0D:"#7587a6",base0E:"#9b859d",base0F:"#9b703f"},HMe={threezerotwofour:FMt,apathy:BMt,ashes:UMt,atelierDune:VMt,atelierForest:QMt,atelierHeath:zMt,atelierLakeside:WMt,atelierSeaside:HMt,bespin:qMt,brewer:GMt,bright:ZMt,chalk:YMt,codeschool:XMt,colors:KMt,default:JMt,eighties:eDt,embers:tDt,flat:nDt,google:rDt,grayscale:iDt,greenscreen:aDt,harmonic:oDt,hopscotch:sDt,isotope:lDt,marrakesh:cDt,mocha:uDt,monokai:fDt,nicinabox:dDt,ocean:hDt,paraiso:pDt,pop:mDt,railscasts:gDt,shapeshifter:vDt,solarized:yDt,summerfruit:bDt,tomorrow:ODt,tube:xDt,twilight:wDt},qMe=HMe.default,que=Object.keys(qMe),SDt=e=>e<.25?1:e<.5?.9-e:1.1-e,_Dt=e=>{const t=Hue(e),[n,r,i]=jMt(t.array()),a=[SDt(n),r,i],o=LMt(a);return Hue.rgb(o).hex()},$O=e=>t=>({className:[t.className,e.className].filter(Boolean).join(" "),style:{...t.style||{},...e.style||{}}}),EDt=(e,t)=>{if(e===void 0)return t;if(t===void 0)return e;const n=typeof e,r=typeof t;switch(n){case"string":switch(r){case"string":return[t,e].filter(Boolean).join(" ");case"object":return $O({className:e,style:t});case"function":return(i,...a)=>$O({className:e})(t(i,...a))}break;case"object":switch(r){case"string":return $O({className:t,style:e});case"object":return{...t,...e};case"function":return(i,...a)=>$O({style:e})(t(i,...a))}break;case"function":switch(r){case"string":return(i,...a)=>e($O(i)({className:t}),...a);case"object":return(i,...a)=>e($O(i)({style:t}),...a);case"function":return(i,...a)=>e(t(i,...a),...a)}}},TDt=(e,t)=>{const n=Object.keys(t);for(const r in e)n.indexOf(r)===-1&&n.push(r);return n.reduce((r,i)=>(r[i]=EDt(e[i],t[i]),r),{})},CDt=(e,t,...n)=>{if(t===null)return e;Array.isArray(t)||(t=[t]);const i=t.map(a=>e[a]).filter(Boolean).reduce((a,o)=>(typeof o=="string"?a.className=[a.className,o].filter(Boolean).join(" "):typeof o=="object"?a.style={...a.style,...o}:typeof o=="function"&&(a={...a,...o(a,...n)}),a),{className:"",style:{}});return i.className||delete i.className,Object.keys(i.style).length===0&&delete i.style,i},Rz=e=>Object.keys(e).reduce((t,n)=>(t[n]=/^base/.test(n)?_Dt(e[n]):n==="scheme"?e[n]+":inverted":e[n],t),{}),ADt=$D((e,t={},n={},...r)=>{const{defaultBase16:i=qMe,base16Themes:a=null}=t,o=$Dt(n,a);o&&(n={...o,...n});const s=que.reduce((f,d)=>(f[d]=n[d]||i[d],f),{}),l=Object.keys(n).reduce((f,d)=>(que.indexOf(d)===-1&&(f[d]=n[d]),f),{}),c=e(s),u=TDt(l,c);return $D(CDt,2)(u,...r)},3),GMe=e=>!!e.extend,$Dt=(e,t)=>{if(e&&GMe(e)&&e.extend&&(e=e.extend),typeof e=="string"){const[n,r]=e.split(":");t?e=t[n]:e=HMe[n],r==="inverted"&&(e=Rz(e))}return e&&Object.prototype.hasOwnProperty.call(e,"base00")?e:void 0},PDt=e=>typeof e=="string"?`${e}:inverted`:e&&GMe(e)&&e.extend?typeof e.extend=="string"?{...e,extend:`${e.extend}:inverted`}:{...e,extend:Rz(e.extend)}:e&&Rz(e);function kDt(e){const t=Object.prototype.toString.call(e).slice(8,-1);return t==="Object"&&typeof e[Symbol.iterator]=="function"?"Iterable":t==="Custom"&&e.constructor!==Object&&e instanceof Object?"Object":t}function ZMe({styling:e,arrowStyle:t="single",expanded:n,nodeType:r,onClick:i}){return j.createElement("div",{...e("arrowContainer",t),onClick:i},j.createElement("div",{...e(["arrow","arrowSign"],r,n,t)},"▶",t==="double"&&j.createElement("div",{...e(["arrowSign","arrowSignInner"])},"▶")))}function RDt(e,t){return e==="Object"?Object.keys(t).length:e==="Array"?t.length:1/0}function IDt(e){return typeof e.set=="function"}function NDt(e,t,n,r=0,i=1/0){let a;if(e==="Object"){let o=Object.getOwnPropertyNames(t);n&&o.sort(n===!0?void 0:n),o=o.slice(r,i+1),a={entries:o.map(s=>({key:s,value:t[s]}))}}else if(e==="Array")a={entries:t.slice(r,i+1).map((o,s)=>({key:s+r,value:o}))};else{let o=0;const s=[];let l=!0;const c=IDt(t);for(const u of t){if(o>i){l=!1;break}r<=o&&(c&&Array.isArray(u)?typeof u[0]=="string"||typeof u[0]=="number"?s.push({key:u[0],value:u[1]}):s.push({key:`[entry ${o}]`,value:{"[key]":u[0],"[value]":u[1]}}):s.push({key:o,value:u})),o++}a={hasMore:!l,entries:s}}return a}function BB(e,t,n){const r=[];for(;t-e>n*n;)n=n*n;for(let i=e;i<=t;i+=n)r.push({from:i,to:Math.min(t,i+n-1)});return r}function MDt(e,t,n,r,i=0,a=1/0){const o=NDt.bind(null,e,t,n);if(!r)return o().entries;const s=a<1/0,l=Math.min(a-i,RDt(e,t));if(e!=="Iterable"){if(l<=r||r<7)return o(i,a).entries}else if(l<=r&&!s)return o(i,a).entries;let c;if(e==="Iterable"){const{hasMore:u,entries:f}=o(i,i+r-1);c=u?[...f,...BB(i+r,i+2*r-1,r)]:f}else c=s?BB(i,a,r):[...o(0,r-5).entries,...BB(r-4,l-5,r),...o(l-4,l-1).entries];return c}function DDt(e){const{styling:t,from:n,to:r,renderChildNodes:i,nodeType:a}=e,[o,s]=_.useState(!1),l=_.useCallback(()=>{s(!o)},[o]);return o?j.createElement("div",{...t("itemRange",o)},i(e,n,r)):j.createElement("div",{...t("itemRange",o),onClick:l},j.createElement(ZMe,{nodeType:a,styling:t,expanded:!1,onClick:l,arrowStyle:"double"}),`${n} ... ${r}`)}function LDt(e){return e.to!==void 0}function YMe(e,t,n){const{nodeType:r,data:i,collectionLimit:a,circularCache:o,keyPath:s,postprocessValue:l,sortObjectKeys:c}=e,u=[];return MDt(r,i,c,a,t,n).forEach(f=>{if(LDt(f))u.push(j.createElement(DDt,{...e,key:`ItemRange--${f.from}-${f.to}`,from:f.from,to:f.to,renderChildNodes:YMe}));else{const{key:d,value:h}=f,p=o.indexOf(h)!==-1;u.push(j.createElement(XMe,{...e,postprocessValue:l,collectionLimit:a,key:`Node--${d}`,keyPath:[d,...s],value:l(h),circularCache:[...o,h],isCircular:p,hideRoot:!1}))}}),u}function qJ(e){const{circularCache:t=[],collectionLimit:n,createItemString:r,data:i,expandable:a,getItemString:o,hideRoot:s,isCircular:l,keyPath:c,labelRenderer:u,level:f=0,nodeType:d,nodeTypeIndicator:h,shouldExpandNodeInitially:p,styling:m}=e,[g,v]=_.useState(l?!1:p(c,i,f)),b=_.useCallback(()=>{a&&v(!g)},[a,g]),O=g||s&&f===0?YMe({...e,circularCache:t,level:f+1}):null,x=j.createElement("span",{...m("nestedNodeItemType",g)},h),w=o(d,i,x,r(i,n),c),S=[c,d,g,a];return s?j.createElement("li",{...m("rootNode",...S)},j.createElement("ul",{...m("rootNodeChildren",...S)},O)):j.createElement("li",{...m("nestedNode",...S)},a&&j.createElement(ZMe,{styling:m,nodeType:d,expanded:g,onClick:b}),j.createElement("label",{...m(["label","nestedNodeLabel"],...S),onClick:b},u(...S)),j.createElement("span",{...m("nestedNodeItemString",...S),onClick:b},w),j.createElement("ul",{...m("nestedNodeChildren",...S)},O))}function jDt(e){const t=Object.getOwnPropertyNames(e).length;return`${t} ${t!==1?"keys":"key"}`}function FDt({data:e,...t}){return j.createElement(qJ,{...t,data:e,nodeType:"Object",nodeTypeIndicator:t.nodeType==="Error"?"Error()":"{}",createItemString:jDt,expandable:Object.getOwnPropertyNames(e).length>0})}function BDt(e){return`${e.length} ${e.length!==1?"items":"item"}`}function UDt({data:e,...t}){return j.createElement(qJ,{...t,data:e,nodeType:"Array",nodeTypeIndicator:"[]",createItemString:BDt,expandable:e.length>0})}function VDt(e,t){let n=0,r=!1;if(Number.isSafeInteger(e.size))n=e.size;else for(const i of e){if(t&&n+1>t){r=!0;break}n+=1}return`${r?">":""}${n} ${n!==1?"entries":"entry"}`}function QDt(e){return j.createElement(qJ,{...e,nodeType:"Iterable",nodeTypeIndicator:"()",createItemString:VDt,expandable:!0})}function wh({nodeType:e,styling:t,labelRenderer:n,keyPath:r,valueRenderer:i,value:a,valueGetter:o=s=>s}){return j.createElement("li",{...t("value",e,r)},j.createElement("label",{...t(["label","valueLabel"],e,r)},n(r,e,!1,!1)),j.createElement("span",{...t("valueText",e,r)},i(o(a),a,...r)))}function XMe({getItemString:e,keyPath:t,labelRenderer:n,styling:r,value:i,valueRenderer:a,isCustomNode:o,...s}){const l=o(i)?"Custom":kDt(i),c={getItemString:e,key:t[0],keyPath:t,labelRenderer:n,nodeType:l,styling:r,value:i,valueRenderer:a},u={...s,...c,data:i,isCustomNode:o};switch(l){case"Object":case"Error":case"WeakMap":case"WeakSet":return j.createElement(FDt,{...u});case"Array":return j.createElement(UDt,{...u});case"Iterable":case"Map":case"Set":return j.createElement(QDt,{...u});case"String":return j.createElement(wh,{...c,valueGetter:f=>`"${f}"`});case"Number":return j.createElement(wh,{...c});case"Boolean":return j.createElement(wh,{...c,valueGetter:f=>f?"true":"false"});case"Date":return j.createElement(wh,{...c,valueGetter:f=>f.toISOString()});case"Null":return j.createElement(wh,{...c,valueGetter:()=>"null"});case"Undefined":return j.createElement(wh,{...c,valueGetter:()=>"undefined"});case"Function":case"Symbol":return j.createElement(wh,{...c,valueGetter:f=>f.toString()});case"Custom":return j.createElement(wh,{...c});default:return j.createElement(wh,{...c,valueGetter:()=>`<${l}>`})}}const zDt={scheme:"solarized",author:"ethan schoonover (http://ethanschoonover.com/solarized)",base00:"#002b36",base01:"#073642",base02:"#586e75",base03:"#657b83",base04:"#839496",base05:"#93a1a1",base06:"#eee8d5",base07:"#fdf6e3",base08:"#dc322f",base09:"#cb4b16",base0A:"#b58900",base0B:"#859900",base0C:"#2aa198",base0D:"#268bd2",base0E:"#6c71c4",base0F:"#d33682"},WDt=e=>({BACKGROUND_COLOR:e.base00,TEXT_COLOR:e.base07,STRING_COLOR:e.base0B,DATE_COLOR:e.base0B,NUMBER_COLOR:e.base09,BOOLEAN_COLOR:e.base09,NULL_COLOR:e.base08,UNDEFINED_COLOR:e.base08,FUNCTION_COLOR:e.base08,SYMBOL_COLOR:e.base08,LABEL_COLOR:e.base0D,ARROW_COLOR:e.base0D,ITEM_STRING_COLOR:e.base0B,ITEM_STRING_EXPANDED_COLOR:e.base03}),HDt=e=>({String:e.STRING_COLOR,Date:e.DATE_COLOR,Number:e.NUMBER_COLOR,Boolean:e.BOOLEAN_COLOR,Null:e.NULL_COLOR,Undefined:e.UNDEFINED_COLOR,Function:e.FUNCTION_COLOR,Symbol:e.SYMBOL_COLOR}),qDt=e=>{const t=WDt(e);return{tree:{border:0,padding:0,marginTop:"0.5em",marginBottom:"0.5em",marginLeft:"0.125em",marginRight:0,listStyle:"none",MozUserSelect:"none",WebkitUserSelect:"none",backgroundColor:t.BACKGROUND_COLOR},value:({style:n},r,i)=>({style:{...n,paddingTop:"0.25em",paddingRight:0,marginLeft:"0.875em",WebkitUserSelect:"text",MozUserSelect:"text",wordWrap:"break-word",paddingLeft:i.length>1?"2.125em":"1.25em",textIndent:"-0.5em",wordBreak:"break-all"}}),label:{display:"inline-block",color:t.LABEL_COLOR},valueLabel:{margin:"0 0.5em 0 0"},valueText:({style:n},r)=>({style:{...n,color:HDt(t)[r]}}),itemRange:(n,r)=>({style:{paddingTop:r?0:"0.25em",cursor:"pointer",color:t.LABEL_COLOR}}),arrow:({style:n},r,i)=>({style:{...n,marginLeft:0,transition:"150ms",WebkitTransition:"150ms",MozTransition:"150ms",WebkitTransform:i?"rotateZ(90deg)":"rotateZ(0deg)",MozTransform:i?"rotateZ(90deg)":"rotateZ(0deg)",transform:i?"rotateZ(90deg)":"rotateZ(0deg)",transformOrigin:"45% 50%",WebkitTransformOrigin:"45% 50%",MozTransformOrigin:"45% 50%",position:"relative",lineHeight:"1.1em",fontSize:"0.75em"}}),arrowContainer:({style:n},r)=>({style:{...n,display:"inline-block",paddingRight:"0.5em",paddingLeft:r==="double"?"1em":0,cursor:"pointer"}}),arrowSign:{color:t.ARROW_COLOR},arrowSignInner:{position:"absolute",top:0,left:"-0.4em"},nestedNode:({style:n},r,i,a,o)=>({style:{...n,position:"relative",paddingTop:"0.25em",marginLeft:r.length>1?"0.875em":0,paddingLeft:o?0:"1.125em"}}),rootNode:{padding:0,margin:0},nestedNodeLabel:({style:n},r,i,a,o)=>({style:{...n,margin:0,padding:0,WebkitUserSelect:o?"inherit":"text",MozUserSelect:o?"inherit":"text",cursor:o?"pointer":"default"}}),nestedNodeItemString:({style:n},r,i,a)=>({style:{...n,paddingLeft:"0.5em",cursor:"default",color:a?t.ITEM_STRING_EXPANDED_COLOR:t.ITEM_STRING_COLOR}}),nestedNodeItemType:{marginLeft:"0.3em",marginRight:"0.3em"},nestedNodeChildren:({style:n},r,i)=>({style:{...n,padding:0,margin:0,listStyle:"none",display:i?"block":"none"}}),rootNodeChildren:{padding:0,margin:0,listStyle:"none"}}},GDt=ADt(qDt,{defaultBase16:zDt}),ZDt=GDt,Gue=e=>e,YDt=(e,t,n)=>n===0,XDt=(e,t,n,r)=>j.createElement("span",null,n," ",r),KDt=([e])=>j.createElement("span",null,e,":"),JDt=()=>!1;function eLt({data:e,theme:t,invertTheme:n,keyPath:r=["root"],labelRenderer:i=KDt,valueRenderer:a=Gue,shouldExpandNodeInitially:o=YDt,hideRoot:s=!1,getItemString:l=XDt,postprocessValue:c=Gue,isCustomNode:u=JDt,collectionLimit:f=50,sortObjectKeys:d=!1}){const h=_.useMemo(()=>ZDt(n?PDt(t):t),[t,n]);return j.createElement("ul",{...h("tree")},j.createElement(XMe,{keyPath:s?[]:r,value:c(e),isCustomNode:u,styling:h,labelRenderer:i,valueRenderer:a,shouldExpandNodeInitially:o,hideRoot:s,getItemString:l,postprocessValue:c,collectionLimit:f,sortObjectKeys:d}))}const tLt={scheme:"Github",author:"Defman21",base00:"#ffffff",base01:"#f5f5f5",base02:"#c8c8fa",base03:"#969896",base04:"#e8e8e8",base05:"#333333",base06:"#ffffff",base07:"#ffffff",base08:"#ed6a43",base09:"#0086b3",base0A:"#795da3",base0B:"#183691",base0C:"#183691",base0D:"#795da3",base0E:"#a71d5d",base0F:"#333333"},KMe=({data:e})=>{const{resolvedTheme:t}=AMe();return y.jsx(eLt,{data:e,theme:tLt,invertTheme:t==="dark",hideRoot:!0,shouldExpandNodeInitially:()=>!0})};function Np(e){return Array.isArray?Array.isArray(e):tDe(e)==="[object Array]"}const nLt=1/0;function rLt(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-nLt?"-0":t}function iLt(e){return e==null?"":rLt(e)}function jd(e){return typeof e=="string"}function JMe(e){return typeof e=="number"}function aLt(e){return e===!0||e===!1||oLt(e)&&tDe(e)=="[object Boolean]"}function eDe(e){return typeof e=="object"}function oLt(e){return eDe(e)&&e!==null}function ic(e){return e!=null}function UB(e){return!e.trim().length}function tDe(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const sLt="Incorrect 'index' type",lLt=e=>`Invalid value for key ${e}`,cLt=e=>`Pattern length exceeds max of ${e}.`,uLt=e=>`Missing ${e} property in key`,fLt=e=>`Property 'weight' in key '${e}' must be a positive integer`,Zue=Object.prototype.hasOwnProperty;class dLt{constructor(t){this._keys=[],this._keyMap={};let n=0;t.forEach(r=>{let i=nDe(r);this._keys.push(i),this._keyMap[i.id]=i,n+=i.weight}),this._keys.forEach(r=>{r.weight/=n})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function nDe(e){let t=null,n=null,r=null,i=1,a=null;if(jd(e)||Np(e))r=e,t=Yue(e),n=Iz(e);else{if(!Zue.call(e,"name"))throw new Error(uLt("name"));const o=e.name;if(r=o,Zue.call(e,"weight")&&(i=e.weight,i<=0))throw new Error(fLt(o));t=Yue(o),n=Iz(o),a=e.getFn}return{path:t,id:n,weight:i,src:r,getFn:a}}function Yue(e){return Np(e)?e:e.split(".")}function Iz(e){return Np(e)?e.join("."):e}function hLt(e,t){let n=[],r=!1;const i=(a,o,s)=>{if(ic(a))if(!o[s])n.push(a);else{let l=o[s];const c=a[l];if(!ic(c))return;if(s===o.length-1&&(jd(c)||JMe(c)||aLt(c)))n.push(iLt(c));else if(Np(c)){r=!0;for(let u=0,f=c.length;u<f;u+=1)i(c[u],o,s+1)}else o.length&&i(c,o,s+1)}};return i(e,jd(t)?t.split("."):t,0),r?n:n[0]}const pLt={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},mLt={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},gLt={location:0,threshold:.6,distance:100},vLt={useExtendedSearch:!1,getFn:hLt,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var pn={...mLt,...pLt,...gLt,...vLt};const yLt=/[^ ]+/g;function bLt(e=1,t=3){const n=new Map,r=Math.pow(10,t);return{get(i){const a=i.match(yLt).length;if(n.has(a))return n.get(a);const o=1/Math.pow(a,.5*e),s=parseFloat(Math.round(o*r)/r);return n.set(a,s),s},clear(){n.clear()}}}class GJ{constructor({getFn:t=pn.getFn,fieldNormWeight:n=pn.fieldNormWeight}={}){this.norm=bLt(n,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((n,r)=>{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,jd(this.docs[0])?this.docs.forEach((t,n)=>{this._addString(t,n)}):this.docs.forEach((t,n)=>{this._addObject(t,n)}),this.norm.clear())}add(t){const n=this.size();jd(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let n=t,r=this.size();n<r;n+=1)this.records[n].i-=1}getValueForItemAtKeyId(t,n){return t[this._keysMap[n]]}size(){return this.records.length}_addString(t,n){if(!ic(t)||UB(t))return;let r={v:t,i:n,n:this.norm.get(t)};this.records.push(r)}_addObject(t,n){let r={i:n,$:{}};this.keys.forEach((i,a)=>{let o=i.getFn?i.getFn(t):this.getFn(t,i.path);if(ic(o)){if(Np(o)){let s=[];const l=[{nestedArrIndex:-1,value:o}];for(;l.length;){const{nestedArrIndex:c,value:u}=l.pop();if(ic(u))if(jd(u)&&!UB(u)){let f={v:u,i:c,n:this.norm.get(u)};s.push(f)}else Np(u)&&u.forEach((f,d)=>{l.push({nestedArrIndex:d,value:f})})}r.$[a]=s}else if(jd(o)&&!UB(o)){let s={v:o,n:this.norm.get(o)};r.$[a]=s}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function rDe(e,t,{getFn:n=pn.getFn,fieldNormWeight:r=pn.fieldNormWeight}={}){const i=new GJ({getFn:n,fieldNormWeight:r});return i.setKeys(e.map(nDe)),i.setSources(t),i.create(),i}function OLt(e,{getFn:t=pn.getFn,fieldNormWeight:n=pn.fieldNormWeight}={}){const{keys:r,records:i}=e,a=new GJ({getFn:t,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(i),a}function DI(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:i=pn.distance,ignoreLocation:a=pn.ignoreLocation}={}){const o=t/e.length;if(a)return o;const s=Math.abs(r-n);return i?o+s/i:s?1:o}function xLt(e=[],t=pn.minMatchCharLength){let n=[],r=-1,i=-1,a=0;for(let o=e.length;a<o;a+=1){let s=e[a];s&&r===-1?r=a:!s&&r!==-1&&(i=a-1,i-r+1>=t&&n.push([r,i]),r=-1)}return e[a-1]&&a-r>=t&&n.push([r,a-1]),n}const by=32;function wLt(e,t,n,{location:r=pn.location,distance:i=pn.distance,threshold:a=pn.threshold,findAllMatches:o=pn.findAllMatches,minMatchCharLength:s=pn.minMatchCharLength,includeMatches:l=pn.includeMatches,ignoreLocation:c=pn.ignoreLocation}={}){if(t.length>by)throw new Error(cLt(by));const u=t.length,f=e.length,d=Math.max(0,Math.min(r,f));let h=a,p=d;const m=s>1||l,g=m?Array(f):[];let v;for(;(v=e.indexOf(t,p))>-1;){let T=DI(t,{currentLocation:v,expectedLocation:d,distance:i,ignoreLocation:c});if(h=Math.min(T,h),p=v+u,m){let k=0;for(;k<u;)g[v+k]=1,k+=1}}p=-1;let b=[],O=1,x=u+f;const w=1<<u-1;for(let T=0;T<u;T+=1){let k=0,M=x;for(;k<M;)DI(t,{errors:T,currentLocation:d+M,expectedLocation:d,distance:i,ignoreLocation:c})<=h?k=M:x=M,M=Math.floor((x-k)/2+k);x=M;let R=Math.max(1,d-M+1),C=o?f:Math.min(d+M,f)+u,E=Array(C+2);E[C+1]=(1<<T)-1;for(let $=C;$>=R;$-=1){let I=$-1,D=n[e.charAt(I)];if(m&&(g[I]=+!!D),E[$]=(E[$+1]<<1|1)&D,T&&(E[$]|=(b[$+1]|b[$])<<1|1|b[$+1]),E[$]&w&&(O=DI(t,{errors:T,currentLocation:I,expectedLocation:d,distance:i,ignoreLocation:c}),O<=h)){if(h=O,p=I,p<=d)break;R=Math.max(1,2*d-p)}}if(DI(t,{errors:T+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:c})>h)break;b=E}const S={isMatch:p>=0,score:Math.max(.001,O)};if(m){const T=xLt(g,s);T.length?l&&(S.indices=T):S.isMatch=!1}return S}function SLt(e){let t={};for(let n=0,r=e.length;n<r;n+=1){const i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}const oL=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):e=>e;class iDe{constructor(t,{location:n=pn.location,threshold:r=pn.threshold,distance:i=pn.distance,includeMatches:a=pn.includeMatches,findAllMatches:o=pn.findAllMatches,minMatchCharLength:s=pn.minMatchCharLength,isCaseSensitive:l=pn.isCaseSensitive,ignoreDiacritics:c=pn.ignoreDiacritics,ignoreLocation:u=pn.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:i,includeMatches:a,findAllMatches:o,minMatchCharLength:s,isCaseSensitive:l,ignoreDiacritics:c,ignoreLocation:u},t=l?t:t.toLowerCase(),t=c?oL(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const f=(h,p)=>{this.chunks.push({pattern:h,alphabet:SLt(h),startIndex:p})},d=this.pattern.length;if(d>by){let h=0;const p=d%by,m=d-p;for(;h<m;)f(this.pattern.substr(h,by),h),h+=by;if(p){const g=d-by;f(this.pattern.substr(g),g)}}else f(this.pattern,0)}searchIn(t){const{isCaseSensitive:n,ignoreDiacritics:r,includeMatches:i}=this.options;if(t=n?t:t.toLowerCase(),t=r?oL(t):t,this.pattern===t){let m={isMatch:!0,score:0};return i&&(m.indices=[[0,t.length-1]]),m}const{location:a,distance:o,threshold:s,findAllMatches:l,minMatchCharLength:c,ignoreLocation:u}=this.options;let f=[],d=0,h=!1;this.chunks.forEach(({pattern:m,alphabet:g,startIndex:v})=>{const{isMatch:b,score:O,indices:x}=wLt(t,m,g,{location:a+v,distance:o,threshold:s,findAllMatches:l,minMatchCharLength:c,includeMatches:i,ignoreLocation:u});b&&(h=!0),d+=O,b&&x&&(f=[...f,...x])});let p={isMatch:h,score:h?d/this.chunks.length:1};return h&&i&&(p.indices=f),p}}class _v{constructor(t){this.pattern=t}static isMultiMatch(t){return Xue(t,this.multiRegex)}static isSingleMatch(t){return Xue(t,this.singleRegex)}search(){}}function Xue(e,t){const n=e.match(t);return n?n[1]:null}class _Lt extends _v{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const n=t===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class ELt extends _v{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const r=t.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class TLt extends _v{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const n=t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class CLt extends _v{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const n=!t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class ALt extends _v{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const n=t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class $Lt extends _v{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const n=!t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class aDe extends _v{constructor(t,{location:n=pn.location,threshold:r=pn.threshold,distance:i=pn.distance,includeMatches:a=pn.includeMatches,findAllMatches:o=pn.findAllMatches,minMatchCharLength:s=pn.minMatchCharLength,isCaseSensitive:l=pn.isCaseSensitive,ignoreDiacritics:c=pn.ignoreDiacritics,ignoreLocation:u=pn.ignoreLocation}={}){super(t),this._bitapSearch=new iDe(t,{location:n,threshold:r,distance:i,includeMatches:a,findAllMatches:o,minMatchCharLength:s,isCaseSensitive:l,ignoreDiacritics:c,ignoreLocation:u})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class oDe extends _v{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let n=0,r;const i=[],a=this.pattern.length;for(;(r=t.indexOf(this.pattern,n))>-1;)n=r+a,i.push([r,n-1]);const o=!!i.length;return{isMatch:o,score:o?0:1,indices:i}}}const Nz=[_Lt,oDe,TLt,CLt,$Lt,ALt,ELt,aDe],Kue=Nz.length,PLt=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,kLt="|";function RLt(e,t={}){return e.split(kLt).map(n=>{let r=n.trim().split(PLt).filter(a=>a&&!!a.trim()),i=[];for(let a=0,o=r.length;a<o;a+=1){const s=r[a];let l=!1,c=-1;for(;!l&&++c<Kue;){const u=Nz[c];let f=u.isMultiMatch(s);f&&(i.push(new u(f,t)),l=!0)}if(!l)for(c=-1;++c<Kue;){const u=Nz[c];let f=u.isSingleMatch(s);if(f){i.push(new u(f,t));break}}}return i})}const ILt=new Set([aDe.type,oDe.type]);class NLt{constructor(t,{isCaseSensitive:n=pn.isCaseSensitive,ignoreDiacritics:r=pn.ignoreDiacritics,includeMatches:i=pn.includeMatches,minMatchCharLength:a=pn.minMatchCharLength,ignoreLocation:o=pn.ignoreLocation,findAllMatches:s=pn.findAllMatches,location:l=pn.location,threshold:c=pn.threshold,distance:u=pn.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:r,includeMatches:i,minMatchCharLength:a,findAllMatches:s,ignoreLocation:o,location:l,threshold:c,distance:u},t=n?t:t.toLowerCase(),t=r?oL(t):t,this.pattern=t,this.query=RLt(this.pattern,this.options)}static condition(t,n){return n.useExtendedSearch}searchIn(t){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:i,ignoreDiacritics:a}=this.options;t=i?t:t.toLowerCase(),t=a?oL(t):t;let o=0,s=[],l=0;for(let c=0,u=n.length;c<u;c+=1){const f=n[c];s.length=0,o=0;for(let d=0,h=f.length;d<h;d+=1){const p=f[d],{isMatch:m,indices:g,score:v}=p.search(t);if(m){if(o+=1,l+=v,r){const b=p.constructor.type;ILt.has(b)?s=[...s,...g]:s.push(g)}}else{l=0,o=0,s.length=0;break}}if(o){let d={isMatch:!0,score:l/o};return r&&(d.indices=s),d}}return{isMatch:!1,score:1}}}const Mz=[];function MLt(...e){Mz.push(...e)}function Dz(e,t){for(let n=0,r=Mz.length;n<r;n+=1){let i=Mz[n];if(i.condition(e,t))return new i(e,t)}return new iDe(e,t)}const sL={AND:"$and",OR:"$or"},Lz={PATH:"$path",PATTERN:"$val"},jz=e=>!!(e[sL.AND]||e[sL.OR]),DLt=e=>!!e[Lz.PATH],LLt=e=>!Np(e)&&eDe(e)&&!jz(e),Jue=e=>({[sL.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function sDe(e,t,{auto:n=!0}={}){const r=i=>{let a=Object.keys(i);const o=DLt(i);if(!o&&a.length>1&&!jz(i))return r(Jue(i));if(LLt(i)){const l=o?i[Lz.PATH]:a[0],c=o?i[Lz.PATTERN]:i[l];if(!jd(c))throw new Error(lLt(l));const u={keyId:Iz(l),pattern:c};return n&&(u.searcher=Dz(c,t)),u}let s={children:[],operator:a[0]};return a.forEach(l=>{const c=i[l];Np(c)&&c.forEach(u=>{s.children.push(r(u))})}),s};return jz(e)||(e=Jue(e)),r(e)}function jLt(e,{ignoreFieldNorm:t=pn.ignoreFieldNorm}){e.forEach(n=>{let r=1;n.matches.forEach(({key:i,norm:a,score:o})=>{const s=i?i.weight:null;r*=Math.pow(o===0&&s?Number.EPSILON:o,(s||1)*(t?1:a))}),n.score=r})}function FLt(e,t){const n=e.matches;t.matches=[],ic(n)&&n.forEach(r=>{if(!ic(r.indices)||!r.indices.length)return;const{indices:i,value:a}=r;let o={indices:i,value:a};r.key&&(o.key=r.key.src),r.idx>-1&&(o.refIndex=r.idx),t.matches.push(o)})}function BLt(e,t){t.score=e.score}function ULt(e,t,{includeMatches:n=pn.includeMatches,includeScore:r=pn.includeScore}={}){const i=[];return n&&i.push(FLt),r&&i.push(BLt),e.map(a=>{const{idx:o}=a,s={item:t[o],refIndex:o};return i.length&&i.forEach(l=>{l(a,s)}),s})}class n_{constructor(t,n={},r){this.options={...pn,...n},this.options.useExtendedSearch,this._keyStore=new dLt(this.options.keys),this.setCollection(t,r)}setCollection(t,n){if(this._docs=t,n&&!(n instanceof GJ))throw new Error(sLt);this._myIndex=n||rDe(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){ic(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const n=[];for(let r=0,i=this._docs.length;r<i;r+=1){const a=this._docs[r];t(a,r)&&(this.removeAt(r),r-=1,i-=1,n.push(a))}return n}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:n=-1}={}){const{includeMatches:r,includeScore:i,shouldSort:a,sortFn:o,ignoreFieldNorm:s}=this.options;let l=jd(t)?jd(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return jLt(l,{ignoreFieldNorm:s}),a&&l.sort(o),JMe(n)&&n>-1&&(l=l.slice(0,n)),ULt(l,this._docs,{includeMatches:r,includeScore:i})}_searchStringList(t){const n=Dz(t,this.options),{records:r}=this._myIndex,i=[];return r.forEach(({v:a,i:o,n:s})=>{if(!ic(a))return;const{isMatch:l,score:c,indices:u}=n.searchIn(a);l&&i.push({item:a,idx:o,matches:[{score:c,value:a,norm:s,indices:u}]})}),i}_searchLogical(t){const n=sDe(t,this.options),r=(s,l,c)=>{if(!s.children){const{keyId:f,searcher:d}=s,h=this._findMatches({key:this._keyStore.get(f),value:this._myIndex.getValueForItemAtKeyId(l,f),searcher:d});return h&&h.length?[{idx:c,item:l,matches:h}]:[]}const u=[];for(let f=0,d=s.children.length;f<d;f+=1){const h=s.children[f],p=r(h,l,c);if(p.length)u.push(...p);else if(s.operator===sL.AND)return[]}return u},i=this._myIndex.records,a={},o=[];return i.forEach(({$:s,i:l})=>{if(ic(s)){let c=r(n,s,l);c.length&&(a[l]||(a[l]={idx:l,item:s,matches:[]},o.push(a[l])),c.forEach(({matches:u})=>{a[l].matches.push(...u)}))}}),o}_searchObjectList(t){const n=Dz(t,this.options),{keys:r,records:i}=this._myIndex,a=[];return i.forEach(({$:o,i:s})=>{if(!ic(o))return;let l=[];r.forEach((c,u)=>{l.push(...this._findMatches({key:c,value:o[u],searcher:n}))}),l.length&&a.push({idx:s,item:o,matches:l})}),a}_findMatches({key:t,value:n,searcher:r}){if(!ic(n))return[];let i=[];if(Np(n))n.forEach(({v:a,i:o,n:s})=>{if(!ic(a))return;const{isMatch:l,score:c,indices:u}=r.searchIn(a);l&&i.push({score:c,key:t,value:a,idx:o,norm:s,indices:u})});else{const{v:a,n:o}=n,{isMatch:s,score:l,indices:c}=r.searchIn(a);s&&i.push({score:l,key:t,value:a,norm:o,indices:c})}return i}}n_.version="7.1.0";n_.createIndex=rDe;n_.parseIndex=OLt;n_.config=pn;n_.parseQuery=sDe;MLt(NLt);const lDe=({aiSuggestibleCommandsOnly:e,onSelect:t,open:n,onOpenChange:r,modules:i,moduleFolders:a,hideModules:o,children:s})=>{const[l,c]=_.useState(""),u=VLt({aiSuggestibleCommandsOnly:e}),f=_.useMemo(()=>u.map(O=>({type:"STEP",name:OK[O],description:fbt[O],onSelect:()=>{if(ubt(O)){t==null||t({type:Ee.PRESET_ACTION,command:O});return}t==null||t({type:O})}})),[t,u]),d=_.useMemo(()=>i.map(O=>{const x=a.find(w=>w.moduleIds.includes(O.moduleId));return{type:"MODULE",name:ek(O.name),relativePath:x==null?void 0:x.id,description:O.description||void 0,onSelect:()=>{t==null||t({...O,type:"RESOLVED_MODULE"})}}}),[a,i,t]),h=_.useMemo(()=>new n_([...d,...f],{keys:[{name:"name",weight:.8},{name:"relativePath",weight:.3},{name:"description",weight:.2}],threshold:.3,includeScore:!0,findAllMatches:!0,ignoreLocation:!0,useExtendedSearch:!0}),[d,f]),p=_.useMemo(()=>{const O=l.trim().replace(/-/g," ");if(!O)return[...f,...d];const x=O.toLowerCase().split(/\s+/);return h.search({$and:x.map(S=>({$or:[{name:S},{description:S},{relativePath:S}]}))}).map(S=>{const T=S.item,k=x.filter(M=>{var R;return(R=T.relativePath)==null?void 0:R.includes(M)}).length;return{...T,score:S.score??1,pathMatchBoost:k*.1}}).sort((S,T)=>S.score-S.pathMatchBoost-(T.score-T.pathMatchBoost))},[h,d,l,f]),m=_.useMemo(()=>p.filter(O=>O.type==="STEP"),[p]),g=_.useMemo(()=>p.filter(O=>O.type==="MODULE"),[p]);_.useEffect(()=>{n||c("")},[n]);const v=_.useRef(null),b=_.useRef(null);return y.jsxs(FAt,{open:n,onOpenChange:r,trigger:s,commandProps:{shouldFilter:!1},children:[y.jsx(Z1,{placeholder:"Search steps and modules...",value:l,onValueChange:O=>{c(O),v.current&&window.clearTimeout(v.current),v.current=window.setTimeout(()=>{const x=b.current;x==null||x.scrollTo({top:0})},0)}}),y.jsxs(Y1,{ref:b,children:[p.length?null:y.jsx(X1,{children:"No results found."}),g.length&&!o?y.jsx(z0,{heading:"Modules",children:g.map(O=>y.jsx(ah,{onSelect:O.onSelect,children:y.jsxs("div",{children:[y.jsx("div",{className:"font-medium",children:O.name}),y.jsx("div",{className:"text-muted-foreground",children:O.description}),y.jsx("div",{className:"text-muted-foreground italic",children:O.relativePath})]})},O.name))}):null,m.length?y.jsx(z0,{heading:"Steps",children:m.map(O=>y.jsx(ah,{onSelect:O.onSelect,children:y.jsxs("div",{children:[y.jsx("div",{className:"font-medium",children:O.name}),y.jsx("div",{className:"text-muted-foreground",children:O.description})]})},O.name))}):null]})]})},VLt=e=>{const{ai:t}=okt();return _.useMemo(()=>{const n=QLt.filter(r=>!zLt.has(r));return t!=null&&t.aiAction&&n.push(Ee.AI_ACTION_DYNAMIC),n.filter(r=>r===q.SUCCESS?e.aiSuggestibleCommandsOnly:e.aiSuggestibleCommandsOnly?FX.options.some(i=>i.shape.type.value===r):!0)},[t==null?void 0:t.aiAction,e.aiSuggestibleCommandsOnly])},QLt=[...Object.values(q)];Ee.AI_ACTION+"",Ee.AI_ACTION_DYNAMIC+"",q.AI_ASSERTION+"",q.AI_WAIT+"",q.AI_EXTRACT+"",q.SUCCESS+"",q.AUTH_LOAD+"",q.AUTH_SAVE+"",q.CAPTCHA+"",q.VISUAL_DIFF+"",q.JAVASCRIPT+"",q.ELEMENT_CHECK+"",q.PAGE_CHECK+"",q.CLICK+"",q.DRAG+"",q.FILE_UPLOAD+"",q.SELECT_OPTION+"",q.REQUEST+"",q.GRAPHQL_REQUEST+"",q.TYPE+"",q.PRESS+"",q.NAVIGATE+"",q.DIALOG+"",q.SCROLL_UP+"",q.SCROLL_DOWN+"",q.SCROLL_LEFT+"",q.SCROLL_RIGHT+"",q.GO_BACK+"",q.GO_FORWARD+"",q.WAIT+"",q.WAIT_FOR_URL+"",q.REFRESH+"",q.TAB+"",q.NEW_TAB+"",q.COOKIE+"",q.LOCAL_STORAGE+"",q.HOVER+"",q.FOCUS+"",q.BLUR+"",q.MOUSE_DRAG+"",q.COPY+"",q.PASTE+"";const zLt=new Set([Ee.AI_ACTION,q.CAPTCHA]),WLt=e=>{switch(e.type){case Ee.AI_ACTION:return{type:e.type};case Ee.AI_ACTION_DYNAMIC:return{type:e.type};case Ee.PRESET_ACTION:return{type:e.type,command:e.command.type};case"RESOLVED_MODULE":return e;case Ee.CONDITIONAL:case Ee.SECTION:case Ee.IFRAME:throw new Error("not implemented");default:return(n=>{throw"If Typescript complains about the line below, you missed a case or break in the switch above"})()}},HLt=e=>{switch(e.type){case Ee.AI_ACTION:return Ee.AI_ACTION;case Ee.AI_ACTION_DYNAMIC:return Ee.AI_ACTION_DYNAMIC;case Ee.PRESET_ACTION:return e.command;case"RESOLVED_MODULE":return"RESOLVED_MODULE";default:return(n=>{throw"If Typescript complains about the line below, you missed a case or break in the switch above"})()}},qLt=e=>{const[t,n]=_.useState(!1),r=HLt(e.value);return y.jsx(lDe,{open:t,onOpenChange:n,hideModules:e.hideModules,aiSuggestibleCommandsOnly:e.aiSuggestibleCommandsOnly,modules:e.modules,moduleFolders:e.moduleFolders,onSelect:i=>{var a;(a=e.onChange)==null||a.call(e,i),n(!1)},children:y.jsxs(xn,{variant:"outline",role:"combobox",disabled:e.disabled,className:Ne({"pointer-events-none":e.readOnly}),children:[OK[r],y.jsx(nX,{className:"h-4 w-4 shrink-0 opacity-50"})]})})},M2=e=>{const[t,n]=_.useState(!1);return y.jsx(lDe,{open:t,onOpenChange:n,hideModules:e.hideModules,aiSuggestibleCommandsOnly:e.aiSuggestibleCommandsOnly,modules:e.modules,moduleFolders:e.moduleFolders,onSelect:r=>{var i;(i=e.onAdd)==null||i.call(e,r),n(!1)},children:e.children??y.jsxs(xn,{variant:"outline",disabled:e.disabled,children:[y.jsx(BP,{className:"h-4 w-4"})," Add new step"]})})},VB=e=>e instanceof Date,GLt=e=>Object.keys(e).length===0,Fz=e=>e!=null&&typeof e=="object",efe=(e,...t)=>Object.prototype.hasOwnProperty.call(e,...t),QB=e=>Fz(e)&&GLt(e),ZLt=()=>Object.create(null),fC=(e,t)=>{if(e===t)return{};if(!Fz(e)||!Fz(t))return t;const n=Object.keys(e).reduce((r,i)=>(efe(t,i)||(r[i]=void 0),r),ZLt());return VB(e)||VB(t)?e.valueOf()==t.valueOf()?{}:t:Object.keys(t).reduce((r,i)=>{if(!efe(e,i))return r[i]=t[i],r;const a=fC(e[i],t[i]);return QB(a)&&!VB(a)&&(QB(e[i])||!QB(t[i]))||(r[i]=a),r},n)};var cDe=Symbol.for("immer-nothing"),tfe=Symbol.for("immer-draftable"),Ac=Symbol.for("immer-state");function pf(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var pS=Object.getPrototypeOf;function mS(e){return!!e&&!!e[Ac]}function X0(e){var t;return e?uDe(e)||Array.isArray(e)||!!e[tfe]||!!((t=e.constructor)!=null&&t[tfe])||B3(e)||U3(e):!1}var YLt=Object.prototype.constructor.toString();function uDe(e){if(!e||typeof e!="object")return!1;const t=pS(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===YLt}function lL(e,t){F3(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function F3(e){const t=e[Ac];return t?t.type_:Array.isArray(e)?1:B3(e)?2:U3(e)?3:0}function Bz(e,t){return F3(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function fDe(e,t,n){const r=F3(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function XLt(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function B3(e){return e instanceof Map}function U3(e){return e instanceof Set}function oy(e){return e.copy_||e.base_}function Uz(e,t){if(B3(e))return new Map(e);if(U3(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=uDe(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Ac];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],s=r[o];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(r[o]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[o]})}return Object.create(pS(e),r)}else{const r=pS(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function WA(e,t=!1){return V3(e)||mS(e)||!X0(e)||(F3(e)>1&&(e.set=e.add=e.clear=e.delete=KLt),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>WA(r,!0))),e}function KLt(){pf(2)}function V3(e){return Object.isFrozen(e)}var JLt={};function K0(e){const t=JLt[e];return t||pf(0,e),t}var HA;function dDe(){return HA}function ejt(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function nfe(e,t){t&&(K0("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Vz(e){Qz(e),e.drafts_.forEach(tjt),e.drafts_=null}function Qz(e){e===HA&&(HA=e.parent_)}function rfe(e){return HA=ejt(HA,e)}function tjt(e){const t=e[Ac];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ife(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Ac].modified_&&(Vz(t),pf(4)),X0(e)&&(e=cL(t,e),t.parent_||uL(t,e)),t.patches_&&K0("Patches").generateReplacementPatches_(n[Ac].base_,e,t.patches_,t.inversePatches_)):e=cL(t,n,[]),Vz(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==cDe?e:void 0}function cL(e,t,n){if(V3(t))return t;const r=t[Ac];if(!r)return lL(t,(i,a)=>afe(e,r,t,i,a,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return uL(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let a=i,o=!1;r.type_===3&&(a=new Set(i),i.clear(),o=!0),lL(a,(s,l)=>afe(e,r,i,s,l,n,o)),uL(e,i,!1),n&&e.patches_&&K0("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function afe(e,t,n,r,i,a,o){if(mS(i)){const s=a&&t&&t.type_!==3&&!Bz(t.assigned_,r)?a.concat(r):void 0,l=cL(e,i,s);if(fDe(n,r,l),mS(l))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(X0(i)&&!V3(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;cL(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&uL(e,i)}}function uL(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&WA(t,n)}function njt(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:dDe(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=ZJ;n&&(i=[r],a=qA);const{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,s}var ZJ={get(e,t){if(t===Ac)return e;const n=oy(e);if(!Bz(n,t))return rjt(e,n,t);const r=n[t];return e.finalized_||!X0(r)?r:r===zB(e.base_,t)?(WB(e),e.copy_[t]=Wz(r,e)):r},has(e,t){return t in oy(e)},ownKeys(e){return Reflect.ownKeys(oy(e))},set(e,t,n){const r=hDe(oy(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=zB(oy(e),t),a=i==null?void 0:i[Ac];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(XLt(n,i)&&(n!==void 0||Bz(e.base_,t)))return!0;WB(e),zz(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return zB(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,WB(e),zz(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=oy(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){pf(11)},getPrototypeOf(e){return pS(e.base_)},setPrototypeOf(){pf(12)}},qA={};lL(ZJ,(e,t)=>{qA[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});qA.deleteProperty=function(e,t){return qA.set.call(this,e,t,void 0)};qA.set=function(e,t,n){return ZJ.set.call(this,e[0],t,n,e[0])};function zB(e,t){const n=e[Ac];return(n?oy(n):e)[t]}function rjt(e,t,n){var i;const r=hDe(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function hDe(e,t){if(!(t in e))return;let n=pS(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=pS(n)}}function zz(e){e.modified_||(e.modified_=!0,e.parent_&&zz(e.parent_))}function WB(e){e.copy_||(e.copy_=Uz(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var ijt=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const a=n;n=t;const o=this;return function(l=a,...c){return o.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&pf(6),r!==void 0&&typeof r!="function"&&pf(7);let i;if(X0(t)){const a=rfe(this),o=Wz(t,void 0);let s=!0;try{i=n(o),s=!1}finally{s?Vz(a):Qz(a)}return nfe(a,r),ife(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===cDe&&(i=void 0),this.autoFreeze_&&WA(i,!0),r){const a=[],o=[];K0("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else pf(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(o,...s)=>this.produceWithPatches(o,l=>t(l,...s));let r,i;return[this.produce(t,n,(o,s)=>{r=o,i=s}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){X0(e)||pf(8),mS(e)&&(e=ajt(e));const t=rfe(this),n=Wz(e,void 0);return n[Ac].isManual_=!0,Qz(t),n}finishDraft(e,t){const n=e&&e[Ac];(!n||!n.isManual_)&&pf(9);const{scope_:r}=n;return nfe(r,t),ife(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=K0("Patches").applyPatches_;return mS(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Wz(e,t){const n=B3(e)?K0("MapSet").proxyMap_(e,t):U3(e)?K0("MapSet").proxySet_(e,t):njt(e,t);return(t?t.scope_:dDe()).drafts_.push(n),n}function ajt(e){return mS(e)||pf(10,e),pDe(e)}function pDe(e){if(!X0(e)||V3(e))return e;const t=e[Ac];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Uz(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Uz(e,!0);return lL(n,(r,i)=>{fDe(n,r,pDe(i))}),t&&(t.finalized_=!1),n}var $c=new ijt,mDe=$c.produce;$c.produceWithPatches.bind($c);$c.setAutoFreeze.bind($c);$c.setUseStrictShallowCopy.bind($c);$c.applyPatches.bind($c);$c.createDraft.bind($c);$c.finishDraft.bind($c);const oh=Object.create(null);oh.open="0";oh.close="1";oh.ping="2";oh.pong="3";oh.message="4";oh.upgrade="5";oh.noop="6";const D2=Object.create(null);Object.keys(oh).forEach(e=>{D2[oh[e]]=e});const Hz={type:"error",data:"parser error"},gDe=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",vDe=typeof ArrayBuffer=="function",yDe=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,YJ=({type:e,data:t},n,r)=>gDe&&t instanceof Blob?n?r(t):ofe(t,r):vDe&&(t instanceof ArrayBuffer||yDe(t))?n?r(t):ofe(new Blob([t]),r):r(oh[e]+(t||"")),ofe=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function sfe(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let HB;function ojt(e,t){if(gDe&&e.data instanceof Blob)return e.data.arrayBuffer().then(sfe).then(t);if(vDe&&(e.data instanceof ArrayBuffer||yDe(e.data)))return t(sfe(e.data));YJ(e,!1,n=>{HB||(HB=new TextEncoder),t(HB.encode(n))})}const lfe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",sT=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<lfe.length;e++)sT[lfe.charCodeAt(e)]=e;const sjt=e=>{let t=e.length*.75,n=e.length,r,i=0,a,o,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),u=new Uint8Array(c);for(r=0;r<n;r+=4)a=sT[e.charCodeAt(r)],o=sT[e.charCodeAt(r+1)],s=sT[e.charCodeAt(r+2)],l=sT[e.charCodeAt(r+3)],u[i++]=a<<2|o>>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|l&63;return c},ljt=typeof ArrayBuffer=="function",XJ=(e,t)=>{if(typeof e!="string")return{type:"message",data:bDe(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:cjt(e.substring(1),t)}:D2[n]?e.length>1?{type:D2[n],data:e.substring(1)}:{type:D2[n]}:Hz},cjt=(e,t)=>{if(ljt){const n=sjt(e);return bDe(n,t)}else return{base64:!0,data:e}},bDe=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},ODe="",ujt=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((a,o)=>{YJ(a,!1,s=>{r[o]=s,++i===n&&t(r.join(ODe))})})},fjt=(e,t)=>{const n=e.split(ODe),r=[];for(let i=0;i<n.length;i++){const a=XJ(n[i],t);if(r.push(a),a.type==="error")break}return r};function djt(){return new TransformStream({transform(e,t){ojt(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const a=new DataView(i.buffer);a.setUint8(0,126),a.setUint16(1,r)}else{i=new Uint8Array(9);const a=new DataView(i.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let qB;function LI(e){return e.reduce((t,n)=>t+n.length,0)}function jI(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function hjt(e,t){qB||(qB=new TextDecoder);const n=[];let r=0,i=-1,a=!1;return new TransformStream({transform(o,s){for(n.push(o);;){if(r===0){if(LI(n)<1)break;const l=jI(n,1);a=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(LI(n)<2)break;const l=jI(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(LI(n)<8)break;const l=jI(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),u=c.getUint32(0);if(u>Math.pow(2,21)-1){s.enqueue(Hz);break}i=u*Math.pow(2,32)+c.getUint32(4),r=3}else{if(LI(n)<i)break;const l=jI(n,i);s.enqueue(XJ(a?l:qB.decode(l),t)),r=0}if(i===0||i>e){s.enqueue(Hz);break}}}})}const xDe=4;function Ra(e){if(e)return pjt(e)}function pjt(e){for(var t in Ra.prototype)e[t]=Ra.prototype[t];return e}Ra.prototype.on=Ra.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Ra.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Ra.prototype.off=Ra.prototype.removeListener=Ra.prototype.removeAllListeners=Ra.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Ra.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};Ra.prototype.emitReserved=Ra.prototype.emit;Ra.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Ra.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Q3=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),ru=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),mjt="arraybuffer";function wDe(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const gjt=ru.setTimeout,vjt=ru.clearTimeout;function z3(e,t){t.useNativeTimers?(e.setTimeoutFn=gjt.bind(ru),e.clearTimeoutFn=vjt.bind(ru)):(e.setTimeoutFn=ru.setTimeout.bind(ru),e.clearTimeoutFn=ru.clearTimeout.bind(ru))}const yjt=1.33;function bjt(e){return typeof e=="string"?Ojt(e):Math.ceil((e.byteLength||e.size)*yjt)}function Ojt(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function SDe(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function xjt(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function wjt(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let a=n[r].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class Sjt extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class KJ extends Ra{constructor(t){super(),this.writable=!1,z3(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Sjt(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=XJ(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=xjt(t);return n.length?"?"+n:""}}class _jt extends KJ{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};fjt(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,ujt(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=SDe()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let _De=!1;try{_De=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Ejt=_De;function Tjt(){}class Cjt extends _jt{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,a)=>{this.onError("xhr post error",i,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}let iw=class L2 extends Ra{constructor(t,n,r){super(),this.createRequest=t,z3(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=wDe(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=L2.requestsCount++,L2.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Tjt,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete L2.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};iw.requestsCount=0;iw.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",cfe);else if(typeof addEventListener=="function"){const e="onpagehide"in ru?"pagehide":"unload";addEventListener(e,cfe,!1)}}function cfe(){for(let e in iw.requests)iw.requests.hasOwnProperty(e)&&iw.requests[e].abort()}const Ajt=function(){const e=EDe({xdomain:!1});return e&&e.responseType!==null}();class $jt extends Cjt{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Ajt&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new iw(EDe,this.uri(),t)}}function EDe(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Ejt))return new XMLHttpRequest}catch{}if(!t)try{return new ru[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const TDe=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Pjt extends KJ{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=TDe?{}:wDe(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;YJ(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch{}i&&Q3(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=SDe()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const GB=ru.WebSocket||ru.MozWebSocket;class kjt extends Pjt{createSocket(t,n,r){return TDe?new GB(t,n,r):n?new GB(t,n):new GB(t)}doWrite(t,n){this.ws.send(n)}}class Rjt extends KJ{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=hjt(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=djt();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const a=()=>{r.read().then(({done:s,value:l})=>{s||(this.onPacket(l),a())}).catch(s=>{})};a();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&Q3(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Ijt={websocket:kjt,webtransport:Rjt,polling:$jt},Njt=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Mjt=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function qz(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=Njt.exec(e||""),a={},o=14;for(;o--;)a[Mjt[o]]=i[o]||"";return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=Djt(a,a.path),a.queryKey=Ljt(a,a.query),a}function Djt(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Ljt(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,a){i&&(n[i]=a)}),n}const Gz=typeof addEventListener=="function"&&typeof removeEventListener=="function",j2=[];Gz&&addEventListener("offline",()=>{j2.forEach(e=>e())},!1);class Sg extends Ra{constructor(t,n){if(super(),this.binaryType=mjt,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=qz(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=qz(n.host).host);z3(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=wjt(this.opts.query)),Gz&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},j2.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=xDe,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Sg.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Sg.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=bjt(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Q3(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:t,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Sg.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Gz&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=j2.indexOf(this._offlineEventListener);r!==-1&&j2.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Sg.protocol=xDe;class jjt extends Sg{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Sg.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Sg.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const d=new Error("probe error");d.transport=n.name,this.emitReserved("upgradeError",d)}}))};function a(){r||(r=!0,u(),n.close(),n=null)}const o=f=>{const d=new Error("probe error: "+f);d.transport=n.name,a(),this.emitReserved("upgradeError",d)};function s(){o("transport closed")}function l(){o("socket closed")}function c(f){n&&f.name!==n.name&&a()}const u=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",s),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",o),n.once("close",s),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let Fjt=class extends jjt{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>Ijt[i]).filter(i=>!!i)),super(t,r)}};function Bjt(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=qz(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const a=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+t,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}const Ujt=typeof ArrayBuffer=="function",Vjt=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,CDe=Object.prototype.toString,Qjt=typeof Blob=="function"||typeof Blob<"u"&&CDe.call(Blob)==="[object BlobConstructor]",zjt=typeof File=="function"||typeof File<"u"&&CDe.call(File)==="[object FileConstructor]";function JJ(e){return Ujt&&(e instanceof ArrayBuffer||Vjt(e))||Qjt&&e instanceof Blob||zjt&&e instanceof File}function F2(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(F2(e[n]))return!0;return!1}if(JJ(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return F2(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&F2(e[n]))return!0;return!1}function Wjt(e){const t=[],n=e.data,r=e;return r.data=Zz(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Zz(e,t){if(!e)return e;if(JJ(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Zz(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Zz(e[r],t));return n}return e}function Hjt(e,t){return e.data=Yz(e.data,t),delete e.attachments,e}function Yz(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Yz(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Yz(e[n],t));return e}const qjt=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Gjt=5;var rr;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(rr||(rr={}));class Zjt{constructor(t){this.replacer=t}encode(t){return(t.type===rr.EVENT||t.type===rr.ACK)&&F2(t)?this.encodeAsBinary({type:t.type===rr.EVENT?rr.BINARY_EVENT:rr.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===rr.BINARY_EVENT||t.type===rr.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=Wjt(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function ufe(e){return Object.prototype.toString.call(e)==="[object Object]"}class eee extends Ra{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===rr.BINARY_EVENT;r||n.type===rr.BINARY_ACK?(n.type=r?rr.EVENT:rr.ACK,this.reconstructor=new Yjt(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(JJ(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(rr[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===rr.BINARY_EVENT||r.type===rr.BINARY_ACK){const a=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(a,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(t.charAt(n+1)==="/"){const a=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(a,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const a=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(a,n+1))}if(t.charAt(++n)){const a=this.tryParse(t.substr(n));if(eee.isPayloadValid(r.type,a))r.data=a;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case rr.CONNECT:return ufe(n);case rr.DISCONNECT:return n===void 0;case rr.CONNECT_ERROR:return typeof n=="string"||ufe(n);case rr.EVENT:case rr.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&qjt.indexOf(n[0])===-1);case rr.ACK:case rr.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Yjt{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=Hjt(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Xjt=Object.freeze(Object.defineProperty({__proto__:null,Decoder:eee,Encoder:Zjt,get PacketType(){return rr},protocol:Gjt},Symbol.toStringTag,{value:"Module"}));function af(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Kjt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class ADe extends Ra{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[af(t,"open",this.onopen.bind(this)),af(t,"packet",this.onpacket.bind(this)),af(t,"error",this.onerror.bind(this)),af(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,a;if(Kjt.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:rr.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,f=n.pop();this._registerAckCallback(u,f),o.id=u}const s=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!s||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===t&&this.sendBuffer.splice(s,1);n.call(this,new Error("operation has timed out"))},i),o=(...s)=>{this.io.clearTimeoutFn(a),n.apply(this,s)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,i)=>{const a=(o,s)=>o?i(o):r(s);a.withError=!0,n.push(a),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...a)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:rr.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case rr.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case rr.EVENT:case rr.BINARY_EVENT:this.onevent(t);break;case rr.ACK:case rr.BINARY_ACK:this.onack(t);break;case rr.DISCONNECT:this.ondisconnect();break;case rr.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:rr.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:rr.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function r_(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}r_.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};r_.prototype.reset=function(){this.attempts=0};r_.prototype.setMin=function(e){this.ms=e};r_.prototype.setMax=function(e){this.max=e};r_.prototype.setJitter=function(e){this.jitter=e};class Xz extends Ra{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,z3(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new r_({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||Xjt;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Fjt(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=af(n,"open",function(){r.onopen(),t&&t()}),a=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),t?t(s):this.maybeReconnectOnOpen()},o=af(n,"error",a);if(this._timeout!==!1){const s=this._timeout,l=this.setTimeoutFn(()=>{i(),a(new Error("timeout")),n.close()},s);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(af(t,"ping",this.onping.bind(this)),af(t,"data",this.ondata.bind(this)),af(t,"error",this.onerror.bind(this)),af(t,"close",this.onclose.bind(this)),af(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Q3(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new ADe(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const _E={};function B2(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Bjt(e,t.path||"/socket.io"),r=n.source,i=n.id,a=n.path,o=_E[i]&&a in _E[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return s?l=new Xz(r,t):(_E[i]||(_E[i]=new Xz(r,t)),l=_E[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(B2,{Manager:Xz,Socket:ADe,io:B2,connect:B2});function aw(e,t,n=!1){return e.length<t?e:e.slice(0,t-3)+(n?"...TRUNCATED...":"[...]")}const gS={[Oo.EQUALS]:"equals",[Oo.CONTAINS]:"contains",[Oo.STARTS_WITH]:"starts with"},vS={[Oo.EQUALS]:"does not equal",[Oo.CONTAINS]:"does not contain",[Oo.STARTS_WITH]:"does not start with"},$De={[ms.EXISTS]:"exists",[ms.VISIBLE]:"is visible",[ms.ENABLED]:"is enabled",[ms.EDITABLE]:"is editable"},PDe={[ms.EXISTS]:"does not exists",[ms.VISIBLE]:"is not visible",[ms.ENABLED]:"is disabled",[ms.EDITABLE]:"is not editable"};function Jjt(e){switch(e.type){case ha.ELEMENT_CONTENT:return`${e.negated?vS[e.operation]:gS[e.operation]} '${e.value}'`;case ha.ELEMENT_ATTRIBUTE:{const n=e.negated?vS[e.operation]:gS[e.operation];return`attribute '${e.attr}' ${n} '${e.value}'`}case ha.ELEMENT_EXISTENCE:return e.negated?PDe[e.condition]:$De[e.condition];default:return(n=>{throw"If Typescript complains about the line below, you missed a case or break in the switch above"})()}}const e5t={[R0.CONTENT]:"The page"};function t5t(e){switch(e.type){case"VALUE":return`the option with value ${e.value}`;case"LABEL":return`the option with label ${e.label}`;case"INDEX":return`the option at index ${e.index}`;default:return(n=>{throw"If Typescript complains about the line below, you missed a case or break in the switch above"})()}}function n5t(e){switch(e.type){case"SUBSTRING":return`match substring '${e.url}'`;case"REGEX":return`match regex '${e.regex}'`;case"GLOB":return`match glob '${e.glob}'`;default:return(n=>{throw"If Typescript complains about the line below, you missed a case or break in the switch above"})()}}function r5t(e){switch(e.type){case R0.CONTENT:return`${e.negated?vS[Oo.CONTAINS]:gS[Oo.CONTAINS]} '${e.value}'`;default:return(n=>{throw"If Typescript complains about the line below, you missed a case or break in the switch above"})(e.type)}}function i5t(e){const t=[];for(const n of e){n.sort((o,s)=>o.timestamp-s.timestamp);const r=[];let i,a=1;for(const o of n)i&&i.text===o.text&&i.type===o.type&&JSON.stringify(i.args??null)===JSON.stringify(o.args??null)?a++:(i&&(a>1?i.args&&i.args.length?i.args.push(`(repeated ${a} times)`):i.text+=` (repeated ${a} times)`:r.push(i)),i=o,a=1);i&&r.push(i),t.push(r)}return t}var a5t={exports:{}};/*!
|
|
698
698
|
|
|
699
699
|
diff v3.5.0
|
|
700
700
|
|
package/static/index.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
|
|
8
8
|
<title>Momentic app</title>
|
|
9
|
-
<script type="module" crossorigin src="/assets/index
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-XgrU2dH0.js"></script>
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/assets/index-LhcAPoUK.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|