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AsB,yBAA0B,iBAAkB,UAAW,OAAQ,OAAQ,SAAU,MAAO,cAAe,SAAU,SAAU,kBAAmB,YAAa,UAAW,OAAQ,kBAAmB,GAAI,KAAM,mBAAoB,WAAY,QAAS,QAAS,QAAS,YAAa,WAAY,SAAU,cAAe,aAAc,aAAc,aAAc,SAAU,OAAQ,QAAS,QAAS,aAAc,UAAW,SAAU,aAAc,SAAU,SAAU,UAAW,OAAQ,eAAgB,UAAW,gBAAiB,UAAW,WAAY,aAAc,YAAa,aAAc,WAAY,WAAY,OAAQ,QAAS,UAAW,OAAQ,MAAO,UAAW,aAAc,WAAY,WAAY,aAAc,aAAc,WAAY,UAAW,UAAW,UAAW,UAAW,UAAW,WAAY,SAAU,SAAU,gBAAiB,SAAU,gBAAiB,kBAAmB,UAAW,WAAY,QAAS,eAAgB,QAAS,QAAS,gBAAiB,YAAa,kBAAmB,YAAa,gBAAiB,WAAY,UAAW,IAAK,GAAI,aAAc,SAAU,WAAY,YAAa,UAAW,QAAS,cAAe,YAAa,aAAc,aAAc,aAAc,YAAa,cAAe,aAAc,gBAAiB,IAAK,cAAe,qBAAsB,MAAO,MAAO,WAAY,SAAU,gBAAiB,mBAAoB,UAAW,aAAc,MAAO,QAAS,MAAO,QAAS,cAAe,UAAW,UAAW,OAAQ,KAAM,SAAU,SAAU,WAAY,WAAY,UAAW,aAAc,UAAW,GAAI,GAAI,UAAW,aAAc,MAAO","file":"/npm/shuutils@12.0.0/dist/shuutils.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.48.0.\n * Original file: /npm/shuutils@12.0.0/dist/shuutils.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/* unique-mark : 12.0.0 - 57735fc - 22/10/2026 22:33:58 */\n//#region src/lib/browser-console.ts\n/* v8 ignore start */\n/**\n* Log a message to the native console when it's needed to use the native (boring) console\n* @param messages the messages to log to the console\n*/\nfunction consoleLog(...messages) {\n\tconsole.log(...messages);\n}\n\n//#endregion\n//#region src/lib/browser-toast.ts\n/**\n* Hides the toast element by applying a transform and removing it after a delay.\n* @param element - The toast element to hide.\n* @param delay - The delay in milliseconds before removing the element.\n*/\nfunction toastHide(element, delay = 200) {\n\telement.style.opacity = \"0\";\n\telement.style.transform = \"translateX(300px)\";\n\t/* v8 ignore start */\n\tsetTimeout(() => {\n\t\telement.remove();\n\t}, delay);\n\t/* v8 ignore stop */\n}\n/**\n* Shows a toast element with a specified delay.\n* @param element - The toast element to be shown.\n* @param delay - The delay in milliseconds before showing the toast.\n*/\nfunction toastShow(element, delay = 100) {\n\tdocument.body.append(element);\n\t/* v8 ignore start */\n\tsetTimeout(() => {\n\t\telement.style.opacity = \"1\";\n\t\telement.style.transform = \"translateX(0)\";\n\t}, delay);\n\t/* v8 ignore stop */\n}\n/**\n* Returns the style for the toast notification based on the type.\n* @param type the type of the toast notification\n* @returns the style for the toast notification\n*/\nfunction toastStyle(type) {\n\tif (type === \"success\") return {\n\t\tbackgrounds: [\"MediumSeaGreen\", \"SeaGreen\"],\n\t\ticon: \"&check;\",\n\t\ticonStyle: \"line-height: 21px; text-indent: 1px;\"\n\t};\n\tif (type === \"error\") return {\n\t\tbackgrounds: [\"FireBrick\", \"Brown\"],\n\t\ticon: \"x\",\n\t\ticonStyle: \"line-height: 21.5px;\"\n\t};\n\treturn {\n\t\tbackgrounds: [\"DodgerBlue\", \"RoyalBlue\"],\n\t\ticon: \"i\",\n\t\ticonStyle: \"line-height: 21px;\"\n\t};\n}\n/**\n* Adds a toast notification to the document body.\n* @param type - The type of the toast notification.\n* @param message - The message to be displayed in the toast notification.\n* @param delay - The delay in milliseconds before the toast notification is removed.\n* @param padding - The padding in pixels for the toast notification.\n*/\nfunction toastAdd(type, message = \"\", delay = 0, padding = 14) {\n\tconst element = document.createElement(\"div\");\n\telement.setAttribute(\"class\", \"shu-toast\");\n\tconst last = document.querySelector(\".shu-toast:nth-last-child(1 of .shu-toast)\")?.getBoundingClientRect().top;\n\tconst bottom = last === void 0 ? 0 : globalThis.innerHeight - last;\n\tconst { backgrounds, icon, iconStyle } = toastStyle(type);\n\telement.style = `position: fixed; display: flex; align-items: center; gap: 9px; bottom: ${bottom + padding}px; right: ${padding}px; z-index: 99999; padding: 12px 20px 11px 14px; background: linear-gradient(45deg, ${backgrounds[0]}, 20%, ${backgrounds[1]}); color: white; border-radius: 5px; box-shadow: 0 3px 7px 0 rgba(0,0,0,.5); font-size: 18px; opacity: 0; transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out; transform: translateX(300px);`;\n\telement.innerHTML = `<span style=\"${iconStyle}border-radius: 50%; color: ${backgrounds[1]}; background-color: #ffffff90; width: 20px; height: 20px; text-align: center; font-weight: bolder; font-size: 12px;\">${icon}</span><span style=\"margin-top: -1px;\">${message}</span>`;\n\tconsole[type === \"error\" ? \"error\" : \"log\"](`toast ${type} : ${message}`);\n\ttoastShow(element);\n\tif (delay > 0) setTimeout(() => {\n\t\ttoastHide(element);\n\t}, delay);\n}\n/**\n* Displays an error toast message.\n* @param message - The error message to display.\n* @param delay - The delay in milliseconds before the toast disappears. Default is 4000ms.\n* @example utils.toastError('hello world')\n*/\nfunction toastError(message, delay = 4e3) {\n\ttoastAdd(\"error\", message, delay);\n}\n/**\n* Displays an info toast message.\n* @param message - The info message to display.\n* @param delay - The delay in milliseconds before the toast disappears. Default is 3000ms.\n* @example utils.toastInfo('hello world')\n*/\nfunction toastInfo(message, delay = 2e3) {\n\ttoastAdd(\"info\", message, delay);\n}\n/**\n* Displays a success toast message.\n* @param message - The success message to display.\n* @param delay - The delay in milliseconds before the toast disappears. Default is 2000ms.\n* @example utils.toastSuccess('hello world')\n*/\nfunction toastSuccess(message, delay = 2e3) {\n\ttoastAdd(\"success\", message, delay);\n}\n\n//#endregion\n//#region src/lib/colors.ts\n/**\n* Check if the browser is Firefox\n* @returns boolean if the browser is Firefox\n*/\nfunction isFirefox() {\n\t/* v8 ignore start */\n\tif (globalThis.navigator === void 0) return false;\n\treturn globalThis.navigator.userAgent.includes(\"Firefox\");\n\t/* v8 ignore stop */\n}\n/**\n* Wrap a string with a color code\n* @param from the color code to start the color\n* @param to the color code to end the color\n* @param string the string to wrap\n* @returns the string with the color code\n*/\nfunction addColorCode(from, to, string) {\n\t/* v8 ignore start */\n\treturn isFirefox() ? string : `\\u001B[${from}m${string}\\u001B[${to}m`;\n\t/* v8 ignore stop */\n}\n/**\n* Reset the string color to the default terminal color\n* @param string the string to reset\n* @returns the string with the reset color\n*/\nfunction reset(string) {\n\treturn addColorCode(0, 0, string);\n}\n/**\n* Render a bold string for the terminal\n* @param string the string to render\n* @returns the string with the bold decoration\n*/\nfunction bold(string) {\n\treturn addColorCode(1, 22, string);\n}\n/**\n* Render a dim string for the terminal\n* @param string the string to render\n* @returns the string with the dim decoration\n*/\nfunction dim(string) {\n\treturn addColorCode(2, 22, string);\n}\n/**\n* Render a italic string for the terminal\n* @param string the string to render\n* @returns the string with the italic decoration\n*/\nfunction italic(string) {\n\treturn addColorCode(3, 23, string);\n}\n/**\n* Render a underline string for the terminal\n* @param string the string to render\n* @returns the string with the underline decoration\n*/\nfunction underline(string) {\n\treturn addColorCode(4, 24, string);\n}\n/**\n* Render a overline string for the terminal\n* @param string the string to render\n* @returns the string with the overline decoration\n*/\nfunction overline(string) {\n\treturn addColorCode(53, 55, string);\n}\n/**\n* Render an inverse string for the terminal\n* @param string the string to render\n* @returns the string with the inverse decoration\n*/\nfunction inverse(string) {\n\treturn addColorCode(7, 27, string);\n}\n/**\n* Render a strike-through string for the terminal\n* @param string the string to render\n* @returns the string with the strike-through decoration\n*/\nfunction strikeThrough(string) {\n\treturn addColorCode(9, 29, string);\n}\n/**\n* Render a black string for the terminal\n* @param string the string to render\n* @returns the string with the black color\n*/\nfunction black(string) {\n\treturn addColorCode(30, 39, string);\n}\n/**\n* Render a red string for the terminal\n* @param string the string to render\n* @returns the string with the red color\n*/\nfunction red(string) {\n\treturn addColorCode(31, 39, string);\n}\n/**\n* Render a green string for the terminal\n* @param string the string to render\n* @returns the string with the green color\n*/\nfunction green(string) {\n\treturn addColorCode(32, 39, string);\n}\n/**\n* Render a yellow string for the terminal\n* @param string the string to render\n* @returns the string with the yellow color\n*/\nfunction yellow(string) {\n\treturn addColorCode(33, 39, string);\n}\n/**\n* Render a blue string for the terminal\n* @param string the string to render\n* @returns the string with the blue color\n*/\nfunction blue(string) {\n\treturn addColorCode(34, 39, string);\n}\n/**\n* Render a magenta string for the terminal\n* @param string the string to render\n* @returns the string with the magenta color\n*/\nfunction magenta(string) {\n\treturn addColorCode(35, 39, string);\n}\n/**\n* Render a cyan string for the terminal\n* @param string the string to render\n* @returns the string with the cyan color\n*/\nfunction cyan(string) {\n\treturn addColorCode(36, 39, string);\n}\n/**\n* Render a white string for the terminal\n* @param string the string to render\n* @returns the string with the white color\n*/\nfunction white(string) {\n\treturn addColorCode(37, 39, string);\n}\n/**\n* Render a gray string for the terminal\n* @param string the string to render\n* @returns the string with the gray color\n*/\nfunction gray(string) {\n\treturn addColorCode(90, 39, string);\n}\n/**\n* Render a string on a black background for the terminal\n* @param string the string to render\n* @returns the string with the black background\n*/\nfunction bgBlack(string) {\n\treturn addColorCode(40, 49, string);\n}\n/**\n* Render a string on a red background for the terminal\n* @param string the string to render\n* @returns the string with the red background\n*/\nfunction bgRed(string) {\n\treturn addColorCode(41, 49, string);\n}\n/**\n* Render a string on a green background for the terminal\n* @param string the string to render\n* @returns the string with the green background\n*/\nfunction bgGreen(string) {\n\treturn addColorCode(42, 49, string);\n}\n/**\n* Render a string on a yellow background for the terminal\n* @param string the string to render\n* @returns the string with the yellow background\n*/\nfunction bgYellow(string) {\n\treturn addColorCode(43, 49, string);\n}\n/**\n* Render a string on a blue background for the terminal\n* @param string the string to render\n* @returns the string with the blue background\n*/\nfunction bgBlue(string) {\n\treturn addColorCode(44, 49, string);\n}\n/**\n* Render a string on a magenta background for the terminal\n* @param string the string to render\n* @returns the string with the magenta background\n*/\nfunction bgMagenta(string) {\n\treturn addColorCode(45, 49, string);\n}\n/**\n* Render a string on a cyan background for the terminal\n* @param string the string to render\n* @returns the string with the cyan background\n*/\nfunction bgCyan(string) {\n\treturn addColorCode(46, 49, string);\n}\n/**\n* Render a string on a white background for the terminal\n* @param string the string to render\n* @returns the string with the white background\n*/\nfunction bgWhite(string) {\n\treturn addColorCode(47, 49, string);\n}\n/**\n* Render a string on a gray background for the terminal\n* @param string the string to render\n* @returns the string with the gray background\n*/\nfunction bgGray(string) {\n\treturn addColorCode(100, 49, string);\n}\n\n//#endregion\n//#region src/lib/constants.ts\nconst nbMsInSecond = 1e3;\nconst nbSecondsInMinute = 60;\nconst nbSecondsInHour = 3600;\nconst nbMsInMinute = 6e4;\nconst nbMinutesInHour = 60;\nconst nbMsInHour = 36e5;\nconst nbHoursInDay = 24;\nconst nbMsInDay = 864e5;\nconst nbDaysInWeek = 7;\nconst nbMsInWeek = 6048e5;\nconst nbDaysInMonth = 30;\nconst nbMsInMonth = 2592e6;\nconst nbDaysInYear = 365;\nconst nbMsInYear = 31536e6;\nconst nbAfter = 1;\nconst nbAscending = 1;\nconst nbBackward = -1;\nconst nbBefore = -1;\nconst nbDescending = -1;\nconst nbEven = 2;\nconst nbFirst = 0;\nconst nbForward = 1;\nconst nbLast = -1;\nconst nbNext = 1;\nconst nbNoIndex = -1;\nconst nbNone = 0;\nconst nbOdd = 1;\nconst nbPrevious = -1;\nconst nbSecond = 1;\nconst nbThird = 2;\nconst nbFourth = 3;\nconst nbFifth = 4;\nconst nbSixth = 5;\nconst nbSeventh = 6;\nconst nbEighth = 7;\nconst nbNinth = 8;\nconst nbTenth = 9;\nconst nbOneSixth = .16;\nconst nbOneQuarter = .25;\nconst nbOneThird = .33;\nconst nbOneHalf = .5;\nconst nbTwoThirds = .66;\nconst nbThreeQuarters = .75;\nconst nbFiveSixths = .83;\nconst nbShortHex = 4;\nconst nbLongHex = 7;\nconst nbRgbMin = 0;\nconst nbRgbMax = 255;\nconst nbSaturationMax = 100;\nconst nbLightnessMax = 100;\nconst nbHslMin = 0;\nconst nbHueStep = 60;\nconst nbHueMax = 360;\nconst nbSpacesIndent = 2;\nconst nbPercentMin = 0;\nconst nbPercentMax = 100;\nconst nbPixelXs = 320;\nconst nbPixelSm = 640;\nconst nbPixelMd = 768;\nconst nbPixelLg = 1024;\nconst nbPixelXl = 1280;\nconst nbPixel2Xl = 1536;\n\n//#endregion\n//#region src/lib/date-format.ts\nconst formatRegex = /y{4}|yy|M{4}|MM|dd|d|e{4}|e{3}|HH|mm|ss|\\s/gu;\nconst formatTokens = {\n\tMM: { month: \"2-digit\" },\n\tMMMM: { month: \"long\" },\n\td: { day: \"numeric\" },\n\tdd: { day: \"2-digit\" },\n\teee: { weekday: \"short\" },\n\teeee: { weekday: \"long\" },\n\tyy: { year: \"2-digit\" },\n\tyyyy: { year: \"numeric\" }\n};\nconst timeTokens = {\n\tHH: (date) => date.getHours(),\n\tmm: (date) => date.getMinutes(),\n\tss: (date) => date.getSeconds()\n};\n/**\n* Format a date to a specific format\n* @param date input date\n* @param format the format to use like : \"yyyy-MM-dd\" or \"dd/MM/yyyy HH:mm:ss\"\n* @param locale the locale to use, default is en-US\n* @returns a string like : \"2018-09-03\"\n*/\nfunction formatDate(date, format, locale = \"en-US\") {\n\treturn format.replaceAll(formatRegex, (match) => {\n\t\tconst dateOption = formatTokens[match];\n\t\tif (dateOption) return date.toLocaleDateString(locale, dateOption);\n\t\tconst timeGetter = timeTokens[match];\n\t\tif (timeGetter) return timeGetter(date).toString().padStart(match.length, \"0\");\n\t\treturn match;\n\t});\n}\n\n//#endregion\n//#region src/lib/date-readable-time.ts\n/**\n* Make a date readable for us, poor humans\n* @param input a date or a number of milliseconds\n* @param options the options\n* @param options.short true to return a short version like \"3d\" instead of \"3 days\"\n* @returns \"1 minute\", \"4 months\" or \"1min\", \"4mon\"\n* @example readableTime(3 * nbMsInDay) // \"3 days\"\n* @example readableTime(3 * nbMsInDay, { short: true }) // \"3d\"\n*/\nfunction readableTime(input, { short = false } = {}) {\n\t/* v8 ignore next */\n\tconst ms = typeof input === \"number\" ? input : Date.now() - input.getTime();\n\tconst format = (value, longUnit, shortUnit) => {\n\t\tconst floor = Math.floor(value);\n\t\tconst longPlural = ` ${longUnit + (floor > 1 ? \"s\" : \"\")}`;\n\t\treturn `${floor}${short ? shortUnit : longPlural}`;\n\t};\n\tif (ms < 1e3) return format(ms, \"millisecond\", \"ms\");\n\tif (ms < 6e4) return format(ms / nbMsInSecond, \"second\", \"s\");\n\tif (ms < 36e5) return format(ms / nbMsInMinute, \"minute\", \"min\");\n\tif (ms < 864e5) return format(ms / nbMsInHour, \"hour\", \"h\");\n\tif (ms < 2592e6) return format(ms / nbMsInDay, \"day\", \"d\");\n\tif (ms < 31536e6) return format(ms / nbMsInMonth, \"month\", \"mon\");\n\treturn format(ms / nbMsInYear, \"year\", \"y\");\n}\n\n//#endregion\n//#region src/lib/environment.ts\n/**\n* Check if the environment is a dev environment\n* @param isEnvDev env var\n* @returns true if the environment is a dev environment\n*/\nfunction isDevEnvironment(isEnvDev = import.meta.env?.DEV) {\n\treturn isEnvDev;\n}\n/**\n* check if app is deployed in dev namespace\n* @param isEnvDev env var\n* @param envSubDev env var for dev subdomain\n* @returns true if App is deployed in Dev namespace\n*/\nfunction isDeployedInDevNamespace(isEnvDev = import.meta.env?.DEV, envSubDev = import.meta.env?.VITE_DEV_SUBDOMAIN) {\n\tconst { host } = globalThis.window.location;\n\tconst [subdomain] = host.split(\".\");\n\treturn isDevEnvironment(isEnvDev) || subdomain === envSubDev;\n}\n/**\n* Check if the environment is a test environment\n* @param glob optional, the global object to check, default is globalThis\n* @returns true if the environment is a test environment\n*/\nfunction isTestEnvironment(glob = globalThis) {\n\tif ([\n\t\t\"jest\",\n\t\t\"mocha\",\n\t\t\"playwright\",\n\t\t\"__vitest_environment__\",\n\t\t\"__vitest_required__\",\n\t\t\"__vitest_browser_runner__\",\n\t\t\"__vitest_browser__\",\n\t\t\"__vitest_worker__\",\n\t\t\"__coverage__\",\n\t\t\"STORYBOOK_ENV\",\n\t\t\"__STORYBOOK_ADDONS_CHANNEL__\"\n\t].some((property) => property in glob)) return true;\n\treturn \"Bun\" in glob && glob?.Bun?.argv.join(\" \").includes(\".test.\");\n}\n/**\n* Check if the environment is a browser environment\n* @param userAgent optional, the user agent to check, default is navigator.userAgent\n* @returns true if the environment is a browser environment\n*/\nfunction isBrowserEnvironment(userAgent = globalThis.navigator?.userAgent) {\n\tif (!userAgent) return false;\n\tif (userAgent.includes(\"HappyDOM\")) return false;\n\tif (userAgent.includes(\"Headless\")) return false;\n\treturn typeof document !== \"undefined\" && globalThis.matchMedia !== void 0;\n}\n\n//#endregion\n//#region src/lib/flags.ts\n/**\n* Check if the given option is present in the command line arguments\n* @param name the name of the option to check\n* @param process the process object to check for the option, defaults to globalThis.process\n* @returns true if the option is present, false otherwise\n*/\nfunction hasOption(name, process = globalThis.process) {\n\tconst argv = process?.argv ?? [];\n\tconst env = process?.env?.[name] ?? \"\";\n\treturn argv.includes(`--${name}`) || env === \"true\";\n}\n/**\n* For debugging purposes, print out the verbose output\n* @returns true if the verbose option is present\n*/\nfunction isVerbose() {\n\treturn hasOption(\"v\") || hasOption(\"verbose\") || hasOption(\"VERBOSE\") || hasOption(\"debug\") || hasOption(\"DEBUG\");\n}\n\n//#endregion\n//#region src/lib/object-is-empty.ts\n/**\n* Check if an object is empty (has no own properties)\n* @param obj the object to check\n* @returns true if the object is empty\n*/\nfunction isObjectEmpty(obj) {\n\treturn Object.keys(obj).length === 0;\n}\n\n//#endregion\n//#region src/lib/result.ts\nvar Ok = class {\n\tvalue;\n\tok = true;\n\tconstructor(value) {\n\t\tthis.value = value;\n\t}\n};\nvar Err = class {\n\terror;\n\tok = false;\n\tconstructor(error) {\n\t\tthis.error = error;\n\t}\n};\nfunction ok(value) {\n\treturn new Ok(value);\n}\nfunction err(error) {\n\treturn new Err(error);\n}\nfunction trySafe(fnOrPromise) {\n\tif (fnOrPromise instanceof Promise) return fnOrPromise.then(ok).catch(err);\n\ttry {\n\t\treturn ok(fnOrPromise());\n\t} catch (error) {\n\t\treturn err(error);\n\t}\n}\nfunction unwrap(result) {\n\treturn result.ok ? {\n\t\terror: void 0,\n\t\tvalue: result.value\n\t} : {\n\t\terror: result.error,\n\t\tvalue: void 0\n\t};\n}\n/**\n* A `Result` collection of functions from Johann Schopplich to handle errors and successes.\n* @see https://github.com/johannschopplich/resultx\n* @see https://github.com/Shuunen/ts-result-comparison\n*/\nconst Result = {\n\t/**\n\t* Create a failing `Result` with an error message.\n\t* @example if (shitHappen) return Result.error('File not found')\n\t*/\n\terror: err,\n\t/**\n\t* Create a successful `Result` with a value.\n\t* @example return Result.ok(42)\n\t* @example return Result.ok({ a: 42 })\n\t*/\n\tok,\n\t/**\n\t* Wraps a function that might throw an error and returns a `Result` with the result of the function.\n\t* @example const result = trySafe(() => JSON.parse('{\"a\": 42}')) // { ok: true, value: { a: 42 } }\n\t* @example const result = trySafe(() => JSON.parse('{\"a\": 42')) // { ok: false, error: \"SyntaxError: Unexpected...\" }\n\t*/\n\ttrySafe,\n\t/**\n\t* Unwraps a Result, Ok, or Err value and returns the value or error in an object.\n\t* If the result is an Ok, the object contains the value and an undefined error.\n\t* If the result is an Err, the object contains an undefined value and the error.\n\t* @example\n\t* const result = Result.trySafe(() => JSON.parse('{\"a\": 42}')); // { ok: true, value: { a: 42 } }\n\t* const { value, error } = Result.unwrap(result); // value: { a: 42 } // error: undefined\n\t* @example\n\t* const result = Result.trySafe(() => JSON.parse('{\"a\": 42')); // { ok: false, error: \"SyntaxError...\" }\n\t* const { value, error } = Result.unwrap(result); // value: undefined // error: \"SyntaxError...\"\n\t*/\n\tunwrap\n};\n\n//#endregion\n//#region src/lib/object-is-record.ts\n/**\n* Check if a value is a plain object, i.e. created by the Object constructor or with a null prototype\n* @see https://github.com/toss/es-toolkit/blob/main/src/predicate/isPlainObject.ts\n* @param value the value to check\n* @returns true if the value is a plain object\n*/\nfunction isRecord(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst prototype = Object.getPrototypeOf(value);\n\tif (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) return false;\n\treturn !(Symbol.toStringTag in value) && !(Symbol.iterator in value);\n}\n\n//#endregion\n//#region src/lib/object-sort.ts\n/**\n* Returns a copy of the passed array, with all nested objects within it sorted deeply by their keys, without mangling any nested arrays.\n* @param subject the unsorted array\n* @param comparator an optional comparator for sorting keys of objects\n* @returns the new sorted array\n*/\nfunction arraySort(subject, comparator) {\n\tconst result = [];\n\tfor (const value of subject) {\n\t\tlet sortedValue = value;\n\t\tif (value !== null && value !== void 0) {\n\t\t\tif (Array.isArray(value)) sortedValue = arraySort(value, comparator);\n\t\t\telse if (typeof value === \"object\") sortedValue = objectSort(value, comparator);\n\t\t}\n\t\tresult.push(sortedValue);\n\t}\n\treturn result;\n}\n/**\n* Returns a copy of the passed object, with all nested objects within it sorted deeply by their keys, without mangling any nested arrays inside of it.\n* @param subject the unsorted object\n* @param comparator an optional comparator for sorting keys of objects\n* @returns the new sorted object\n*/\nfunction objectSort(subject, comparator) {\n\tconst result = {};\n\tconst sortedKeys = Object.keys(subject).toSorted(comparator);\n\tfor (const key of sortedKeys) {\n\t\tlet value = subject[key];\n\t\tif (value !== null && value !== void 0) {\n\t\t\tif (Array.isArray(value)) value = arraySort(value, comparator);\n\t\t\telse if (typeof value === \"object\") value = objectSort(value, comparator);\n\t\t}\n\t\tresult[key] = value;\n\t}\n\treturn result;\n}\n\n//#endregion\n//#region src/lib/object-serializer.ts\nconst markers = {\n\tdate: \"__date__\",\n\tfileName: \"__fileName__\",\n\tfileSize: \"__fileSize__\",\n\tfileType: \"__fileType__\",\n\tfunction: \"__function__\",\n\tregexFlags: \"__regexFlags__\",\n\tregexSource: \"__regexSource__\"\n};\n/**\n* Replacer function for JSON.stringify\n* @param this the context object\n* @param key the key of the object\n* @param value the value of the object\n* @returns the value of the object\n*/\nfunction replacer(key, value) {\n\tif (value === void 0) return value;\n\tif (value instanceof RegExp) return {\n\t\t[markers.regexFlags]: value.flags,\n\t\t[markers.regexSource]: value.source\n\t};\n\tif (typeof value === \"function\") return { [markers.function]: value.toString() };\n\tif (this[key] instanceof File) return {\n\t\t[markers.fileName]: this[key].name,\n\t\t[markers.fileSize]: this[key].size,\n\t\t[markers.fileType]: this[key].type\n\t};\n\tif (this[key] instanceof Date) return { [markers.date]: this[key].toISOString() };\n\treturn value;\n}\nconst createCircularReplacer = () => {\n\tconst seen = /* @__PURE__ */ new WeakSet();\n\t/**\n\t* Replacer function for JSON.stringify with circular reference handling\n\t* @param this the context object\n\t* @param key the key being stringified\n\t* @param value the value being stringified\n\t* @returns the value to serialize\n\t*/\n\tfunction circularReplacer(key, value) {\n\t\tif (typeof value === \"object\" && value !== null) {\n\t\t\tif (seen.has(value)) return \"__circular__\";\n\t\t\tseen.add(value);\n\t\t}\n\t\treturn replacer.call(this, key, value);\n\t}\n\treturn circularReplacer;\n};\n/**\n* Detect function for JSON.parse reviver\n* @param value an unknown value\n* @returns the type of this value like : \"empty\", \"date\"...\n*/\nfunction detect(value) {\n\tif (value === void 0 || value === null || typeof value !== \"object\") return \"not-object\";\n\tif (markers.regexFlags in value && markers.regexSource in value) return \"regex\";\n\tif (markers.function in value) return \"function\";\n\tif (markers.fileName in value && markers.fileSize in value && markers.fileType in value) return \"file\";\n\tif (markers.date in value) return \"date\";\n\treturn \"unknown\";\n}\nfunction isSerializedRegex(value) {\n\treturn isRecord(value) && typeof value[markers.regexSource] === \"string\" && typeof value[markers.regexFlags] === \"string\";\n}\nfunction isSerializedFunction(value) {\n\treturn isRecord(value) && typeof value[markers.function] === \"string\";\n}\nfunction isSerializedFile(value) {\n\treturn isRecord(value) && typeof value[markers.fileName] === \"string\" && typeof value[markers.fileSize] === \"number\" && typeof value[markers.fileType] === \"string\";\n}\nfunction isSerializedDate(value) {\n\treturn isRecord(value) && typeof value[markers.date] === \"string\";\n}\n/**\n* Revive a value parsed by JSON.parse\n* @param value the value of the object\n* @param functions true to revive serialized functions, which runs their source code\n* @returns the value of the object\n*/\nfunction revive(value, functions) {\n\tconst type = detect(value);\n\tif (type === \"regex\" && isSerializedRegex(value)) return new RegExp(value[markers.regexSource], value[markers.regexFlags]);\n\tif (functions && type === \"function\" && isSerializedFunction(value)) return new Function(`return ${value[markers.function]}`)();\n\tif (type === \"file\" && isSerializedFile(value)) return new File([], value[markers.fileName], { type: value[markers.fileType] });\n\tif (type === \"date\" && isSerializedDate(value)) return new Date(value[markers.date]);\n\treturn value;\n}\n/**\n* Serializes an object to a string, using JSON.stringify with enhanced support for functions & regex\n* @param object the object to serialize to a string\n* @param options the options\n* @param options.sortKeys if true, the order of keys will be sorted alpha before serialization\n* @param options.indent if true, the output string will be indented for better readability\n* @returns the serialized object as a string\n*/\nfunction objectSerialize(object, { indent = false, sortKeys = false } = {}) {\n\treturn JSON.stringify(sortKeys ? objectSort(object) : object, createCircularReplacer(), indent ? 2 : void 0);\n}\n/**\n* Deserializes a string to an object, using JSON.parse with enhanced support for functions & regex\n* @param string the string to deserialize to an object\n* @param options the options\n* @param options.functions if true, serialized functions are revived by running their source code, only use it on a trusted string, default false\n* @returns the deserialized object\n*/\nfunction objectDeserialize(string, { functions = false } = {}) {\n\treturn JSON.parse(string, (_key, value) => revive(value, functions));\n}\n\n//#endregion\n//#region src/lib/string-stringify.ts\n/**\n* Converts various data types to their string representation.\n* @param data the data to stringify\n* @param options the options\n* @param options.indent if true, the output object will be indented for better readability\n* @returns the string representation of the data\n*/\nfunction stringify(data, { indent = false } = {}) {\n\tif (data === void 0) return \"undefined\";\n\tif (data === null) return \"null\";\n\tif (typeof data === \"string\") return data;\n\tif (typeof data === \"object\") return objectSerialize(data, { indent });\n\treturn String(data);\n}\n\n//#endregion\n//#region src/lib/logger.ts\nconst logsStorageKey = \"logs\";\n/**\n* Clean stuff to log\n* @param stuff the things to log\n* @returns the cleaned log line\n* @example clean(['Hello', { name: \"world\" }, 42]) // \"Hello { \"name\": \"world\" } 42\"\n*/\nfunction clean$1(...stuff) {\n\tconst ansiEscapeRegex = new RegExp(`[${String.fromCodePoint(27)}${String.fromCodePoint(155)}][#();?[]*(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\d<=>A-ORZcf-nqry]`, \"gu\");\n\treturn stuff.map((thing) => stringify(thing)).join(\" \").replaceAll(ansiEscapeRegex, \"\").replaceAll(\"\\\"\", \"'\").trim();\n}\n/**\n* Logger class\n* @example const logger = new Logger()\n* @example const logger = new Logger({ isActive: false, minimumLevel: '3-info', willLogDate: false, willLogDelay: true, willLogTime: false, willOutputToConsole: true, storage: createInMemoryDriver() })\n*/\nvar Logger = class {\n\t#lastLogTimestamp = 0;\n\t#saveQueue = Promise.resolve();\n\t#pendingLines = [];\n\t#levels = [\n\t\t\"1-debug\",\n\t\t\"2-test\",\n\t\t\"3-info\",\n\t\t\"4-fix\",\n\t\t\"5-warn\",\n\t\t\"6-good\",\n\t\t\"7-error\"\n\t];\n\t#padding;\n\t#padStart = 7;\n\tclean = clean$1;\n\t#context = {};\n\toptions = {\n\t\tisActive: true,\n\t\t/* v8 ignore start */\n\t\tminimumLevel: isVerbose() ? \"1-debug\" : \"3-info\",\n\t\t/* v8 ignore stop */\n\t\twillLogDate: false,\n\t\twillLogDelay: true,\n\t\twillLogTime: false,\n\t\twillOutputToConsole: true\n\t};\n\t/**\n\t* Create a new Logger instance\n\t* @param options optional, LoggerOptions\n\t*/\n\tconstructor(options) {\n\t\tif (options) this.options = {\n\t\t\t...this.options,\n\t\t\t...options\n\t\t};\n\t\tthis.#padding = Math.max(...this.#levels.map((key) => key.length - 2));\n\t}\n\t/**\n\t* Calculate the delay since the last log\n\t* @returns the delay like \"+12ms\"\n\t*/\n\t#getDelay() {\n\t\tconst now = Date.now();\n\t\tif (this.#lastLogTimestamp === 0) {\n\t\t\tthis.#lastLogTimestamp = now;\n\t\t\treturn \"init\".padStart(this.#padStart);\n\t\t}\n\t\tconst delay = now - this.#lastLogTimestamp;\n\t\tthis.#lastLogTimestamp = now;\n\t\treturn `+${readableTime(delay, { short: true })}`.padStart(this.#padStart);\n\t}\n\t#saveLog(line) {\n\t\tthis.#pendingLines.push(line);\n\t\tif (this.#pendingLines.length > 1) return;\n\t\tthis.#saveQueue = this.#saveQueue.then(() => this.#savePendingLines());\n\t}\n\tasync #savePendingLines() {\n\t\tconst lines = this.#pendingLines;\n\t\tthis.#pendingLines = [];\n\t\tconst saveResult = await Result.trySafe(this.#doSaveLogs(lines));\n\t\tif (!saveResult.ok) this.#log([\"error\"], [\"Failed to save logs\", saveResult.error]);\n\t}\n\tasync #doSaveLogs(lines) {\n\t\tif (!this.options.storage) return;\n\t\tconst logs = await this.#readStoredLogs();\n\t\tif (logs === void 0) return;\n\t\tconst setResult = await Result.trySafe(this.options.storage.set(logsStorageKey, [...logs, ...lines].slice(-1e3)));\n\t\tif (!setResult.ok) this.#log([\"error\"], [\"Failed to set logs to storage\", setResult.error]);\n\t}\n\t/**\n\t* Read the stored logs\n\t* @returns the stored logs, or undefined when they could not be read or the storage key holds something else than logs\n\t*/\n\tasync #readStoredLogs() {\n\t\tif (!this.options.storage) return [];\n\t\tconst getResult = await Result.trySafe(this.options.storage.get(logsStorageKey));\n\t\tif (!getResult.ok) {\n\t\t\tthis.#log([\"error\"], [\"Failed to get logs from storage\", getResult.error]);\n\t\t\treturn;\n\t\t}\n\t\tconst stored = getResult.value;\n\t\tif (stored === void 0) return [];\n\t\tif (Array.isArray(stored) && stored.every((line) => typeof line === \"string\")) return stored;\n\t\tthis.#log([\"error\"], [`The \"${logsStorageKey}\" storage key holds something else than logs, they are not saved`]);\n\t}\n\t/**\n\t* Get the stored logs, only the last 1000 lines are kept\n\t* @returns the stored log lines\n\t*/\n\tasync getLogs() {\n\t\tawait this.#saveQueue;\n\t\treturn await this.#readStoredLogs() ?? [];\n\t}\n\tasync clearLogs() {\n\t\tif (!this.options.storage) return;\n\t\tawait this.#saveQueue;\n\t\tconst deleteResult = await Result.trySafe(this.options.storage.delete(logsStorageKey));\n\t\tif (!deleteResult.ok) this.#log([\"error\"], [\"Failed to clear logs from storage\", deleteResult.error]);\n\t}\n\t/**\n\t* Log a message\n\t* @param prefixes the prefixes to add before the message\n\t* @param stuff the things to log\n\t*/\n\t#log(prefixes, stuff) {\n\t\tif (this.options.willOutputToConsole) consoleLog(prefixes.join(\" \"), ...stuff);\n\t}\n\t/**\n\t* Log a message if log level allows it\n\t* @param prefix the prefix to add before the message\n\t* @param level the log level to check\n\t* @param stuff the things to log\n\t* @param color a function to colorize the prefix\n\t* @example logger.logIf('debug', '1-debug', ['Hello', 'world', 42])\n\t*/\n\t#logIf(prefix, level, stuff, color) {\n\t\tconst prefixes = [prefix.padStart(this.#padding)];\n\t\tif (this.options.willLogTime) prefixes.unshift(formatDate(/* @__PURE__ */ new Date(), \"HH:mm:ss\"));\n\t\tif (this.options.willLogDate) prefixes.unshift(formatDate(/* @__PURE__ */ new Date(), \"yyyy-MM-dd\"));\n\t\tif (this.options.willLogDelay) prefixes.unshift(this.#getDelay());\n\t\tconst context = isObjectEmpty(this.#context) ? \"\" : { context: this.#context };\n\t\tconst line = `${prefixes.join(\" \")} ${clean$1(...stuff, context)}`;\n\t\tthis.#saveLog(line);\n\t\tif (!this.#shouldLog(level)) return;\n\t\t/* v8 ignore next */\n\t\tprefixes[prefixes.length - 1] = color(prefixes.at(-1) ?? \"\");\n\t\tthis.#log(prefixes, stuff);\n\t}\n\t/**\n\t* Check if a log should be output\n\t* @param level the log level to check\n\t* @returns true if the log should be output\n\t*/\n\t#shouldLog(level) {\n\t\treturn this.options.isActive && this.#levels.indexOf(level) >= this.#levels.indexOf(this.options.minimumLevel);\n\t}\n\t/**\n\t* Log a debug message\n\t* @param stuff the things to log\n\t* @example logger.debug('Hello world')\n\t*/\n\tdebug(...stuff) {\n\t\tthis.#logIf(\"debug\", \"1-debug\", stuff, gray);\n\t}\n\t/**\n\t* Disable the logger output\n\t*/\n\tdisable() {\n\t\tthis.options.isActive = false;\n\t}\n\t/**\n\t* Enable the logger output\n\t*/\n\tenable() {\n\t\tthis.options.isActive = true;\n\t}\n\t/**\n\t* Log an error message\n\t* @param stuff the things to log (will be red, such original)\n\t* @example logger.error('Something went wrong')\n\t*/\n\terror(...stuff) {\n\t\tconst errors = stuff.map((thing) => thing instanceof Error ? thing.message : thing);\n\t\tthis.#logIf(\"error\", \"7-error\", errors, red);\n\t}\n\t/**\n\t* Log a fix message\n\t* @param stuff the things to log\n\t* @example logger.fix('This is a fix')\n\t*/\n\tfix(...stuff) {\n\t\tthis.#logIf(\"fix\", \"4-fix\", stuff, cyan);\n\t}\n\t/**\n\t* Log a good message\n\t* @param stuff the things to log (will be green, as expected)\n\t* @example logger.good('Everything went well')\n\t*/\n\tgood(...stuff) {\n\t\tthis.#logIf(\"good\", \"6-good\", stuff, green);\n\t}\n\t/**\n\t* Log an info message\n\t* @param stuff the things to log\n\t* @example logger.info('Hello ¯\\_(ツ)_/¯')\n\t*/\n\tinfo(...stuff) {\n\t\tthis.#logIf(\"info\", \"3-info\", stuff, blue);\n\t}\n\t/**\n\t* Log an error message and show a toast\n\t* @param stuff the things to log (will be red, such original)\n\t* @example logger.error('Something went wrong')\n\t*/\n\tshowError(...stuff) {\n\t\tthis.error(...stuff);\n\t\t/* v8 ignore start */\n\t\tif (isBrowserEnvironment()) toastError(clean$1(...stuff));\n\t\t/* v8 ignore stop */\n\t}\n\t/**\n\t* Log an info message and show a toast\n\t* @param stuff the things to log\n\t* @example logger.info('Hello ¯\\_(ツ)_/¯')\n\t*/\n\tshowInfo(...stuff) {\n\t\tthis.info(...stuff);\n\t\t/* v8 ignore start */\n\t\tif (isBrowserEnvironment()) toastInfo(clean$1(...stuff));\n\t\t/* v8 ignore stop */\n\t}\n\t/**\n\t* Log a success message and show a toast\n\t* @param stuff the things to log\n\t* @example logger.success('Everything went well')\n\t*/\n\tshowSuccess(...stuff) {\n\t\tthis.success(...stuff);\n\t\t/* v8 ignore start */\n\t\tif (isBrowserEnvironment()) toastSuccess(clean$1(...stuff));\n\t\t/* v8 ignore stop */\n\t}\n\t/**\n\t* Log a success message\n\t* @param stuff the things to log (will be green, as expected)\n\t* @example logger.success('Everything went well')\n\t* @alias good\n\t*/\n\tsuccess(...stuff) {\n\t\tthis.good(...stuff);\n\t}\n\t/**\n\t* Log a Result with appropriate levels\n\t* @param message the common message to log before the Result\n\t* @param result the Result to log\n\t* @param okLevel the log level to use if the Result is ok, default is 'info'\n\t* @param errorLevel the log level to use if the Result is error, default is 'error'\n\t* @example logger.result(\"update operation\", result)\n\t* @example logger.result(\"another operation\", result, 'success', 'warn')\n\t*/\n\tresult(message, result, okLevel = \"info\", errorLevel = \"error\") {\n\t\tif (result.ok) this[okLevel](message, \"result was ok and returned :\", result.value);\n\t\telse this[errorLevel](message, \"result was error and returned :\", result.error);\n\t}\n\t/**\n\t* Log a Result with appropriate levels and show a toast\n\t* @param message the common message to log before the Result\n\t* @param result the Result to log\n\t* @param okLevel the log level to use if the Result is ok, default is 'info'\n\t* @param errorLevel the log level to use if the Result is error, default is 'error'\n\t* @example logger.showResult(\"update operation\", result)\n\t* @example logger.showResult(\"another operation\", result, 'success', 'warn')\n\t*/\n\tshowResult(message, result, okLevel = \"info\", errorLevel = \"error\") {\n\t\tthis.result(message, result, okLevel, errorLevel);\n\t\t/* v8 ignore start */\n\t\tif (isBrowserEnvironment()) {\n\t\t\tconst isOk = result.ok;\n\t\t\tconst showMethod = {\n\t\t\t\terror: toastError,\n\t\t\t\tinfo: toastInfo,\n\t\t\t\tsuccess: toastSuccess,\n\t\t\t\twarn: toastInfo\n\t\t\t}[isOk ? okLevel : errorLevel];\n\t\t\tshowMethod(`${message}: ${clean$1(isOk ? result.value : result.error)}`);\n\t\t}\n\t\t/* v8 ignore stop */\n\t}\n\t/**\n\t* Log a truthy/falsy test assertion\n\t* @param thing the thing to test for truthiness\n\t* @param stuff the things to log\n\t* @example logger.test(1 === 1, '1 is equal to 1') // will log : ✔️ 1 is equal to 1\n\t*/\n\ttest(thing, ...stuff) {\n\t\tconst isTruthy = Boolean(thing);\n\t\tconst box = isTruthy ? bgGreen(\" ✓ \") : bgRed(\" ✗ \");\n\t\tconst prefix = \" \".repeat(this.#padding - 3);\n\t\tthis.#logIf(prefix + box, \"2-test\", stuff, isTruthy ? green : red);\n\t}\n\t/**\n\t* Log a warn message\n\t* @param stuff the things to log\n\t* @example logger.warn('Something went wrong')\n\t*/\n\twarn(...stuff) {\n\t\tthis.#logIf(\"warn\", \"5-warn\", stuff, yellow);\n\t}\n\t/**\n\t* Set the context for the logger that will be happened at the end of the log line\n\t* @param context the context to set\n\t* @example logger.setContext({ user: { id: 1, name: \"John Doe\" } })\n\t*/\n\tsetContext(context) {\n\t\tthis.#context = {\n\t\t\t...this.#context,\n\t\t\t...context\n\t\t};\n\t}\n\t/**\n\t* Clear the context of the logger\n\t* @example logger.clearContext()\n\t*/\n\tclearContext() {\n\t\tthis.#context = {};\n\t}\n};\n\n//#endregion\n//#region src/lib/analytics.ts\n/**\n* Generic analytics wrapper, can be used with any analytics third party library\n* @param options the options for the analytics\n* @param options.app the app name, like 'my-project', 'super-app', etc.\n* @param options.log if the analytics will log\n* @param options.onIdentify the callback to identify a user\n* @param options.onPage the callback to track a page\n* @param options.onTrack the callback to track an event\n* @param options.pile if the analytics will pile the events in memory\n* @returns the analytics object\n*/\nfunction createAnalytics({ app = \"app-default\", log = false, onIdentify, onPage, onTrack, pile: isPiling = false } = {}) {\n\tconst pile = [];\n\tconst logger = log ? new Logger() : void 0;\n\t/**\n\t* Add an item to the memory pile\n\t* @param item the item to add\n\t* @param data the data to add\n\t* @returns the result of the operation\n\t*/\n\tfunction addToPile(item, data) {\n\t\tlogger?.debug(`analytics : \"${item}\" added to pile`, data);\n\t\tpile.push(item);\n\t\tlogger?.debug(`analytics : pile for app \"${app}\"`, pile);\n\t\treturn Result.ok(`analytics : \"${item}\" added to pile`);\n\t}\n\t/**\n\t* Identify a user\n\t* @param userId - The user, like '123456', 'super-admin', etc.\n\t* @param additionalData - Additional data to identify the user\n\t* @returns a Result object\n\t*/\n\tfunction identify(userId, additionalData) {\n\t\tconst message = `analytics : identify user \"${userId}\" on app \"${app}\"`;\n\t\tonIdentify?.(userId, additionalData);\n\t\tlogger?.debug(message);\n\t\tif (isPiling) addToPile(`identify:${userId}`);\n\t\treturn Result.ok(message);\n\t}\n\t/**\n\t* Track a page view\n\t* @returns a Result object\n\t*/\n\tfunction page() {\n\t\tconst message = `analytics : track page for app \"${app}\"`;\n\t\tonPage?.();\n\t\tlogger?.debug(message);\n\t\tif (isPiling) addToPile(\"page\");\n\t\treturn Result.ok(message);\n\t}\n\t/**\n\t* Track an event\n\t* @param event The event name like 'click', 'download-invoice', etc.\n\t* @param additionalData Additional data to track the event\n\t* @returns a Result object\n\t*/\n\tfunction track(event, additionalData) {\n\t\tconst message = `analytics : track event \"${event}\" for app \"${app}\"`;\n\t\tonTrack?.(event, additionalData);\n\t\tlogger?.debug(message);\n\t\tif (isPiling) addToPile(`track:${event}`);\n\t\treturn Result.ok(message);\n\t}\n\treturn {\n\t\tidentify,\n\t\tpage,\n\t\tpile,\n\t\ttrack\n\t};\n}\n\n//#endregion\n//#region src/lib/array-align.ts\n/**\n* Aligns an array to a target length by filling or truncating as needed.\n* @param values - The array to align. If undefined, creates a new array.\n* @param targetLength - The desired length of the output array. If undefined, returns a single-element array with undefined.\n* @param fillValue - The value to fill the array with. If undefined, uses undefined.\n* @returns An array aligned to the target length\n* @example arrayAlign([1, 2], 4) // [1, 2, undefined, undefined]\n*/\nfunction arrayAlign(values, targetLength, fillValue) {\n\tif (values === void 0 && targetLength !== void 0) return Array.from({ length: targetLength }).fill(fillValue);\n\tif (values !== void 0 && targetLength !== void 0 && values.length !== targetLength) return Array.from({ length: targetLength }).map((_value, index) => values[index] ?? fillValue);\n\tif (values) return values;\n\treturn [fillValue];\n}\n\n//#endregion\n//#region src/lib/object-clone.ts\n/**\n* Clone a value with structuredClone, or keep it as is when it cannot be cloned\n* @param value the value to clone, like a date, a regex or a typed array\n* @returns the clone, or the value itself\n*/\nfunction cloneOrKeep(value) {\n\ttry {\n\t\treturn structuredClone(value);\n\t} catch {\n\t\treturn value;\n\t}\n}\n/**\n* Copy a map or a set, deep copying its keys and values\n* @param value the map or set to copy\n* @param seen the copies already made, to keep shared and circular references\n* @param copyItem the function to deep copy each key and value\n* @returns the copy\n*/\nfunction copyCollection(value, seen, copyItem) {\n\tif (value instanceof Map) {\n\t\tconst map = /* @__PURE__ */ new Map();\n\t\tseen.set(value, map);\n\t\tfor (const [key, item] of value) map.set(copyItem(key), copyItem(item));\n\t\treturn map;\n\t}\n\tconst set = /* @__PURE__ */ new Set();\n\tseen.set(value, set);\n\tfor (const item of value) set.add(copyItem(item));\n\treturn set;\n}\n/**\n* Deep copy a value that structuredClone refuses, like an object holding a function\n* @param value the value to copy\n* @param seen the copies already made, to keep shared and circular references\n* @returns the copy, where functions are the very same references\n*/\nfunction deepCopy(value, seen) {\n\tif (typeof value !== \"object\" || value === null) return value;\n\tif (seen.has(value)) return seen.get(value);\n\tif (value instanceof Map || value instanceof Set) return copyCollection(value, seen, (item) => deepCopy(item, seen));\n\tconst cloned = Array.isArray(value) || isRecord(value) ? value : cloneOrKeep(value);\n\tif (cloned !== value) {\n\t\tseen.set(value, cloned);\n\t\treturn cloned;\n\t}\n\tconst copy = Array.isArray(value) ? [] : Object.create(Object.getPrototypeOf(value));\n\tif (Array.isArray(copy) && Array.isArray(value)) copy.length = value.length;\n\tseen.set(value, copy);\n\tfor (const [key, item] of Object.entries(value)) Object.defineProperty(copy, key, {\n\t\tconfigurable: true,\n\t\tenumerable: true,\n\t\tvalue: deepCopy(item, seen),\n\t\twritable: true\n\t});\n\treturn copy;\n}\n/**\n* Return a deep copy of an object or array\n* @param object an object or array to clone\n* @returns the copy, when the object holds a function the copy holds the very same function and the rest is copied\n*/\nfunction clone(object) {\n\ttry {\n\t\treturn structuredClone(object);\n\t} catch {\n\t\treturn deepCopy(object, /* @__PURE__ */ new WeakMap());\n\t}\n}\n\n//#endregion\n//#region src/lib/array-insert-after.ts\n/**\n* Add a value to an array if it does not already exist\n* @param array the array to add the value to\n* @param item the value to add\n* @param value the value to add\n* @returns the array with the value added (if it did not already exist)\n*/\nfunction insertValueAfterItem(array, item, value) {\n\tconst index = array.indexOf(item);\n\tif (index === -1) return array;\n\tconst arrayCopy = clone(array);\n\tconst start = Math.min(index + 1, arrayCopy.length);\n\tarrayCopy.splice(start, 0, value);\n\treturn arrayCopy;\n}\n\n//#endregion\n//#region src/lib/array-pick-one.ts\n/**\n* Return an item from an array\n* @param items like : [\"great\", \"place\", \"pine\"]\n* @returns item like : \"pine\"\n*/\nfunction pickOne(items) {\n\tif (items.length === 0) throw new Error(\"Array is empty\");\n\treturn items[Math.floor(Math.random() * items.length)];\n}\n\n//#endregion\n//#region src/lib/array-remove-value.ts\n/**\n* Remove a value from an array\n* @param array the array to remove the value from\n* @param value the value to remove\n* @returns a copy of the array without the value\n*/\nfunction removeValueFromArray(array, value) {\n\tif (!array.includes(value)) return array;\n\tconst arrayCopy = clone(array);\n\tarrayCopy.splice(arrayCopy.indexOf(value), 1);\n\treturn arrayCopy;\n}\n\n//#endregion\n//#region src/lib/array-shuffle.ts\n/**\n* Randomize an array using the Fisher-Yates algorithm\n* @see https://dev.to/codebubb/how-to-shuffle-an-array-in-javascript-2ikj\n* @param input the array to shuffle\n* @returns a shuffled clone of the input array\n*/\nfunction shuffleArray(input) {\n\tconst array = clone(input);\n\tfor (let indexA = array.length - 1; indexA > 0; indexA += -1) {\n\t\tconst indexB = Math.floor(Math.random() * (indexA + 1));\n\t\tconst temporary = array[indexA];\n\t\tarray[indexA] = array[indexB];\n\t\tarray[indexB] = temporary;\n\t}\n\treturn array;\n}\n\n//#endregion\n//#region src/lib/array-unique.ts\n/**\n* Return an array with unique values\n* @param items the array to check/clean/reduce\n* @returns the array with unique values\n*/\nfunction arrayUnique(items) {\n\treturn Array.from(new Set(items));\n}\n\n//#endregion\n//#region src/lib/json.ts\nconst jsonStartRegex = /^(?:\\[\\s*)?\\{\\s*\"/u;\n/**\n* Check if the given string is a JSON object\n* @param jsonString The string to check\n* @returns The parsed object or false if parsing failed\n*/\nfunction isJson(jsonString) {\n\tif (!jsonStartRegex.test(jsonString)) return false;\n\ttry {\n\t\tJSON.parse(jsonString);\n\t} catch {\n\t\treturn false;\n\t}\n\treturn true;\n}\n/**\n* Parse a supposed JSON string into an object\n* @param json The JSON string to parse\n* @param options the options\n* @param options.functions if true, functions serialized by objectSerialize are revived by running their source code, only use it on a trusted string, default false\n* @returns a Result, ok with the parsed value, or an error message like \"Invalid JSON string: ...\"\n* @example const result = parseJson<{ age: number }>('{ \"age\": 32 }')\n* if (result.ok) console.log(result.value.age)\n*/\nfunction parseJson(json, { functions = false } = {}) {\n\ttry {\n\t\treturn Result.ok(objectDeserialize(json, { functions }));\n\t} catch (error) {\n\t\t/* v8 ignore next */\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\treturn Result.error(`Invalid JSON string: ${message}`);\n\t}\n}\n\n//#endregion\n//#region src/lib/storage.ts\n/**\n* Get a value from the storage media\n* @param key The key of the value to get\n* @param defaultValue The default value to return if the key is not found\n* @returns The value or defaultValue if not found\n*/\nfunction get(key, defaultValue) {\n\tconst path = storage.prefix + key;\n\tconst data = storage.media[path];\n\tif (data === void 0 || data === null || data === \"\") return defaultValue;\n\t/* v8 ignore next */\n\tif (typeof data !== \"string\") return data;\n\tconst result = parseJson(data);\n\tif (!result.ok) return data;\n\treturn result.value;\n}\n/**\n* Set a value in the storage\n* @param key The key of the value to set\n* @param data The value to set\n* @returns The given value\n*/\nfunction set(key, data) {\n\tconst path = storage.prefix + key;\n\tconst value = typeof data === \"string\" ? data : JSON.stringify(data);\n\tReflect.set(storage.media, path, value);\n\treturn data;\n}\n/**\n* Check if storage has a value\n* @param key The key of the value to check\n* @returns true if storage has a value for the given key\n*/\nfunction has(key) {\n\treturn get(key) !== void 0;\n}\n/**\n* Remove a value from the storage\n* @param key The key of the value to remove\n*/\nfunction clear(key) {\n\tconst path = storage.prefix + key;\n\tdelete storage.media[path];\n}\nconst storage = {\n\tclear,\n\tget,\n\thas,\n\t/* v8 ignore start */\n\tmedia: typeof localStorage === \"undefined\" ? {} : localStorage,\n\t/* v8 ignore stop */\n\tprefix: \"\",\n\tset\n};\n\n//#endregion\n//#region src/lib/async-storage.ts\nconst localStorageDriver = {\n\tdelete: (key) => Promise.resolve(localStorage.removeItem(key)),\n\tget: (key) => Promise.resolve(storage.get(key)),\n\tset: (key, value) => Promise.resolve(storage.set(key, value))\n};\n/**\n* Create an in-memory async storage driver, handy for tests and non-persistent usage\n* @returns an async storage driver backed by a plain object\n*/\nfunction createInMemoryDriver() {\n\tconst memory = {};\n\treturn {\n\t\tdelete: (key) => Promise.resolve(void delete memory[key]),\n\t\tget: (key) => Promise.resolve(memory[key]),\n\t\tset: (key, value) => Promise.resolve(memory[key] = value)\n\t};\n}\n/**\n* Create a namespaced async storage on top of the given driver\n* @param name the namespace prefixing every key\n* @param driver the underlying async storage driver\n* @returns an async storage scoped to the given namespace\n*/\nfunction createAsyncStorage(name, driver) {\n\treturn {\n\t\tdelete: (key) => driver.delete(`${name}_${key}`),\n\t\tget: (key) => driver.get(`${name}_${key}`),\n\t\tset: (key, value) => driver.set(`${name}_${key}`, value)\n\t};\n}\n\n//#endregion\n//#region src/lib/is-nil.ts\n/**\n* Check if a value is null or undefined\n* @see https://github.com/toss/es-toolkit/blob/main/src/predicate/isNil.ts\n* @param value the value to check\n* @returns true if the value is null or undefined\n*/\nfunction isNil(value) {\n\treturn value === null || value === void 0;\n}\n\n//#endregion\n//#region src/lib/string-remove-accents.ts\n/**\n* Remove accents from a string\n* @param string the string to remove accents from\n* @returns the string without accents\n* @example utils.removeAccents('éàù') // returns 'eau'\n*/\nfunction removeAccents(string) {\n\treturn string.normalize(\"NFD\").replaceAll(/[\\u0300-\\u036F]/gu, \"\");\n}\n\n//#endregion\n//#region src/lib/strings.ts\n/**\n* Clean a string from special characters\n* @param sentence like \"Hello, my name is John Doe !\"\n* @param options the options\n* @param options.lowercase lowercase the output, default true\n* @returns cleaned string like \"Hello my name is John Doe\"\n*/\nfunction sanitize(sentence, { lowercase = true } = {}) {\n\tconst text = removeAccents(sentence).trim().replaceAll(/<[^<>]*>/gu, \" \").replaceAll(/[/'’.-]/gu, \" \").replaceAll(/[^\\d\\sa-z]/giu, \"\").replaceAll(/\\s+/gu, \" \").trim();\n\treturn lowercase ? text.toLowerCase() : text;\n}\n/**\n* Slugify a string\n* @param string The input string, e.g. \"Slug % ME with // Love !\"\n* @returns The slugified string, e.g. \"slug-me-with-love\"\n*/\nfunction slugify(string) {\n\treturn sanitize(string).replaceAll(/\\W+/giu, \"-\").replace(/^-*/u, \"\").replace(/-$/u, \"\");\n}\n/**\n* Transform the first letter of a string into capital\n* @param string `\"hello John\"`\n* @param options the options\n* @param options.lowercaseRest lowercase the rest of the string\n* @returns `\"Hello John\"`\n*/\nfunction capitalize(string, { lowercaseRest = false } = {}) {\n\tif (!lowercaseRest) return string.charAt(0).toUpperCase() + string.slice(1);\n\treturn string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();\n}\n/**\n* Ellipsis after a specific amount of words\n* @param stringIn `\"Hello my dear friend\"`\n* @param maxWords 3 for example\n* @param addDots active by default, will add ellipsis dots at the end if input string is cut\n* @returns `\"Hello my dear...\"`\n*/\nfunction ellipsisWords(stringIn = \"\", maxWords = 5, addDots = true) {\n\tconst stringOut = stringIn.split(\" \").splice(0, maxWords).join(\" \");\n\tif (stringOut === stringIn) return stringIn;\n\treturn `${stringOut}${addDots ? \"...\" : \"\"}`;\n}\n/**\n* Ellipsis after a specific amount of characters\n* @param stringIn `\"Hello my dear friend\"`\n* @param maxLength 8 for example\n* @returns `\"Hello my...\"`\n*/\nfunction ellipsis(stringIn = \"\", maxLength = 50) {\n\tconst stringOut = stringIn.slice(0, maxLength);\n\tif (stringOut === stringIn) return stringIn;\n\treturn `${stringOut}...`;\n}\n/**\n* Create a CRC32 table\n* @param length the length of the table\n* @returns a table of 256 numbers\n*/\nfunction createCrc32Table(length = 256) {\n\tconst table = Array.from({ length });\n\tfor (let index = 0; index < length; index += 1) {\n\t\tlet code = index;\n\t\tfor (let indexB = 0; indexB < 8; indexB += 1) code = code & 1 ? 3988292384 ^ code >>> 1 : code >>> 1;\n\t\ttable[index] = code;\n\t}\n\treturn table;\n}\n/**\n* Generate a CRC32 checksum for a given string\n* https://dirask.com/posts/TypeScript-calculate-crc32-p2ZBKp\n* @param text the string to checksum\n* @returns the checksum like `3547`\n*/\nfunction crc32(text) {\n\tconst crcTable = createCrc32Table();\n\tlet crc = -1;\n\tfor (let index = 0; index < text.length; index += 1) {\n\t\tconst value = crcTable[((text.codePointAt(index) ?? 0) ^ crc) & 255];\n\t\t/* v8 ignore start */\n\t\tif (value !== void 0 && value !== 0)\n /* v8 ignore stop */\n\t\tcrc = value ^ crc >>> 8;\n\t}\n\treturn (-1 ^ crc) >>> 0;\n}\n/**\n* Generate a checksum for a given string\n* @param string `\"Hello my dear friend\"`\n* @returns the checksum like `3547`\n*/\nfunction stringSum(string) {\n\treturn crc32(string);\n}\n/**\n* Check if the value is a string\n* @param value the value to check\n* @returns true if the value is a string\n*/\nfunction isString(value) {\n\treturn typeof value === \"string\";\n}\n\n//#endregion\n//#region src/lib/browser-clipboard.ts\n/**\n* Copy data to the clipboard\n* @param stuff the data to copy\n* @param options the options\n* @param options.log if true, will console log the data before copying\n* @returns a Result object\n*/\nasync function copyToClipboard(stuff, { log = false } = {}) {\n\tlet text = \"\";\n\ttry {\n\t\ttext = typeof stuff === \"string\" ? stuff : JSON.stringify(stuff);\n\t} catch {\n\t\treturn Result.error(\"failed to stringify the data\");\n\t}\n\ttry {\n\t\tif (log) consoleLog(`copying to clipboard : ${ellipsis(text)}`);\n\t\tawait navigator.clipboard.writeText(text);\n\t\treturn Result.ok(`copied to clipboard : ${ellipsis(text)}`);\n\t} catch {\n\t\t/* v8 ignore start */\n\t\treturn Result.error(\"clipboard not available\");\n\t}\n}\n/**\n* Read the clipboard content\n* @param options the options\n* @param options.log if true, will console log the content of the clipboard\n* @param options.clipboard the clipboard to read from, default is navigator.clipboard\n* @returns the content of the clipboard\n*/\nasync function readClipboard({ clipboard = globalThis.navigator?.clipboard, log = false } = {}) {\n\tif (isNil(clipboard)) return Result.error(\"clipboard not available\");\n\tconst read = await Result.trySafe(Promise.resolve().then(() => clipboard.readText()));\n\tif (!read.ok) return Result.error(\"clipboard not available\");\n\tif (log) consoleLog(\"reading clipboard...\");\n\tif (log) consoleLog(`got this text from clipboard : ${ellipsis(read.value)}`);\n\treturn Result.ok(read.value);\n}\n\n//#endregion\n//#region src/lib/browser-download-file.ts\n/* v8 ignore start */\n/**\n* Download a file from a `Blob`, `File` or `MediaSource` instance.\n* @param file the file-like instance.\n* @param fileName optional custom file name for the download.\n*/\nfunction downloadFile(file, fileName) {\n\tconst url = URL.createObjectURL(file);\n\tconst link = document.createElement(\"a\");\n\tconst resolvedFileName = fileName ?? (file instanceof File ? file.name : \"download\");\n\tlink.href = url;\n\tlink.download = resolvedFileName;\n\tdocument.body.append(link);\n\tlink.click();\n\tlink.remove();\n\tURL.revokeObjectURL(url);\n}\n\n//#endregion\n//#region src/lib/invariant.ts\n/**\n* Assert that a condition is true, narrowing its type, and throw otherwise\n* @see https://github.com/toss/es-toolkit/blob/main/src/util/invariant.ts\n* @param condition the condition to assert\n* @param message the error message to throw when the condition is falsy\n* @throws {Error} when the condition is falsy\n*/\nfunction invariant(condition, message) {\n\tif (!condition) throw new Error(message);\n}\n\n//#endregion\n//#region src/lib/browser-file-to-base64.ts\n/**\n* Convert a `File` instance to base64.\n* @param file the file instance\n* @returns the base64 string\n*/\nfunction fileToBase64(file) {\n\treturn new Promise((resolve) => {\n\t\tconst reader = new FileReader();\n\t\treader.onload = () => {\n\t\t\tinvariant(reader.result !== null, \"reader.result is null\");\n\t\t\tinvariant(typeof reader.result === \"string\", \"reader.result must be a string\");\n\t\t\treturn resolve(Result.ok(reader.result));\n\t\t};\n\t\t/* v8 ignore start */\n\t\treader.onerror = () => resolve(Result.error(\"Conversion to base64 failed\"));\n\t\treader.readAsDataURL(file);\n\t});\n}\n\n//#endregion\n//#region src/lib/random.ts\n/**\n* Give a random word or sentence without signification\n* @returns string like `\"Bolowey Opnet\"`\n*/\nfunction randomString() {\n\tconst strings = \"Bar Alto,Sin Seguritat,Lorem Ipsum,Ciao,Sit dolor,Por erestet,Tchu la Comida,Amet Inn,Aqualeris baked,Bouquet,Zu Amarillo,Ploject,Ruhe animals,Mah Plizure,Baacon pasty,Vinci mador,Alan Awake,Malohe Sutur,A priore sur,Quel memento,Kalitat arae\".split(\",\");\n\treturn pickOne(strings);\n}\n/**\n* Give a random boolean\n* @returns boolean like `true`\n*/\nfunction randomBoolean() {\n\treturn Math.random() > .5;\n}\n/**\n* Give an email from first and last name\n* @param first the first name\n* @param last the last name\n* @param isShort if true, the first name will be shortened to the first letter\n* @returns email like `mickael.scott@gmail.com`\n*/\nfunction randomEmail(first, last, isShort = randomBoolean()) {\n\tconst provider = pickOne([\n\t\t\"gmail.com\",\n\t\t\"yahoo.de\",\n\t\t\"hotmail.fr\",\n\t\t\"outlook.com\",\n\t\t\"proton.com\"\n\t]);\n\treturn `${[isShort && first[0] ? first[0].toLocaleLowerCase() : first.toLocaleLowerCase(), last.toLocaleLowerCase()].filter(Boolean).join(\".\")}@${provider}`;\n}\n/**\n* Return a random number between min & max (0 & 100 if no args)\n* @param min (optional) the return number minimum included value\n* @param max (optional) the return number maximum included value\n* @returns number like : 12\n*/\nfunction randomNumber(min = 0, max = 100) {\n\treturn Math.floor(Math.random() * (max - min + 1) + min);\n}\n/**\n* Give a fake person with email, first name and last name\n* @returns object like `{ email: \"mickael.scott@gmail.com\", firstName: \"Michael\", lastName: \"Scott\" }`\n*/\nfunction randomPerson() {\n\tconst first = pickOne([\n\t\t\"Michael\",\n\t\t\"Dwight\",\n\t\t\"Jim\",\n\t\t\"Pam\",\n\t\t\"Ryan\",\n\t\t\"Andy\",\n\t\t\"Kevin\",\n\t\t\"Angela\",\n\t\t\"Oscar\",\n\t\t\"Toby\"\n\t]);\n\tconst last = pickOne([\n\t\t\"Scott\",\n\t\t\"Schrute\",\n\t\t\"Halpert\",\n\t\t\"Beesly\",\n\t\t\"Howard\",\n\t\t\"Bernard\",\n\t\t\"Malone\",\n\t\t\"Martin\",\n\t\t\"Martinez\",\n\t\t\"Flenderson\"\n\t]);\n\treturn {\n\t\tage: randomNumber(18, 65),\n\t\temail: randomEmail(first, last),\n\t\tfirstName: first,\n\t\tincome: randomNumber(1e3, 1e4),\n\t\tlastName: last\n\t};\n}\n\n//#endregion\n//#region src/lib/sleep.ts\n/**\n* Sleep let you \"pause\" or delay processes\n* @param ms the time to wait in milliseconds, default 1000ms / 1 sec\n* @returns promise that resolve in the provided time\n*/\nfunction sleep(ms = 1e3) {\n\treturn new Promise((resolve) => {\n\t\tsetTimeout(() => resolve(ms), ms);\n\t});\n}\n\n//#endregion\n//#region src/lib/browser-fill-like-human.ts\n/**\n* Fill an input like a human would do\n* @param input the HTMLInputElement to fill\n* @param value the value to fill\n* @returns nothing\n* @example await utils.fillLikeHuman(input, 'hello world')\n*/\nasync function fillLikeHuman(input, value) {\n\tinput.focus();\n\tfor (const char of value) {\n\t\tinput.value += char;\n\t\tawait sleep(randomNumber(40, 80));\n\t}\n\tinput.dispatchEvent(new Event(\"input\", { bubbles: true }));\n\tinput.dispatchEvent(new Event(\"change\", { bubbles: true }));\n\tinput.dispatchEvent(new Event(\"blur\", { bubbles: true }));\n\tinput.blur();\n}\n\n//#endregion\n//#region src/lib/browser-inject-styles.ts\n/**\n* Inject styles in the DOM\n* @param string the string to inject, can be a url or a css string\n* @example injectStyles('https://example.com/styles.css')\n* @example injectStyles('body { background-color: red; }')\n* @returns a Result object\n*/\nfunction injectStyles(string = \"\") {\n\tif (string.length === 0) return Result.error(\"injectStyles : cannot inject empty styles\");\n\tif (string.includes(\"://\") && !string.includes(\"\\n\") && string.includes(\".css\")) {\n\t\tdocument.querySelector(\"head\")?.insertAdjacentHTML(\"beforeend\", `<link rel=\"stylesheet\" href=\"${string}\" />`);\n\t\treturn Result.ok(`injectStyles : injected <link> with url \"${string}\"`);\n\t}\n\tdocument.body.insertAdjacentHTML(\"beforeend\", `<style>${string}</style>`);\n\treturn Result.ok(\"injectStyles : injected <style> with provided css\");\n}\n\n//#endregion\n//#region src/lib/browser-page-change.ts\n/**\n* Default callback for onPageChange\n* @param location the new location\n*/\nfunction onPageChangeDefaultCallback(location) {\n\tconsoleLog(`location changed : ${location} but onPageChange callback is empty`);\n}\n/**\n* Detect location.href changes\n* @param callback the callback to call when location.href changes\n* @param wait the time to wait between each check, default 1000ms\n* @param last used for recursion, do not use it\n*/\nasync function onPageChange(callback = onPageChangeDefaultCallback, wait = 1e3, last = \"\") {\n\tawait sleep(wait);\n\tconst current = document.location.href;\n\tif (current !== last) callback(current);\n\tonPageChange(callback, wait, current);\n}\n\n//#endregion\n//#region src/lib/browser-routing.ts\n/**\n* Remove extra slashes from URL\n* @param url - URL to clean\n* @returns Cleaned URL\n*/\nfunction removeExtraSlashes(url) {\n\treturn url.replaceAll(/\\/{2,}/gu, \"/\");\n}\n/**\n* Get the path from a URL\n* @param url - URL to get path from\n* @param addLang - Add language to path\n* @returns Path\n*/\nfunction getPath(url = \"\", addLang = \"\") {\n\t/* v8 ignore next */\n\tlet path = url === \"\" && isBrowserEnvironment() ? document.location.pathname : url;\n\tif (path === \"blank\") path = \"\";\n\tpath = removeExtraSlashes(path);\n\tpath = path.replace(/^\\/[a-z]{2}\\//u, \"/\");\n\tif (addLang !== \"\") path = `/${addLang}/${path}`;\n\treturn removeExtraSlashes(path);\n}\n/**\n* Get the page from a URL\n* @param url - URL to get page from\n* @returns Page\n*/\nfunction getPage(url = \"\") {\n\tconst path = getPath(url).slice(1);\n\tif (path === \"\") return \"index\";\n\t/* v8 ignore next */\n\treturn path.split(\".\")[0] ?? \"\";\n}\n\n//#endregion\n//#region src/lib/browser-scout.ts\nconst browsers = {\n\tEdge: /edge/iu,\n\tChrome: /chrome|chromium|crios/iu,\n\tFirefox: /firefox|fxios/iu,\n\t\"Internet Explorer\": /msie|trident/iu,\n\tSafari: /safari/iu,\n\t\"Unknown browser\": /./u\n};\nconst operatingSystems = {\n\tAndroid: /android/iu,\n\t\"Chrome OS\": /CrOS/iu,\n\tiOS: /iphone/iu,\n\tLinux: /linux/iu,\n\t\"Mac OS\": /MacIntel|Macintosh|MacPPC/iu,\n\tWindows: /Win32|Win64|Windows/iu,\n\t\"Unknown OS\": /./u\n};\nconst versions = {\n\tMSIE: /MSIE (?<version>[\\d.]+)/iu,\n\tEdge: /Edge\\/(?<version>[\\d.]+)/iu,\n\tChrome: /Chrome\\/(?<version>[\\d.]+)/iu,\n\tFirefox: /Firefox\\/(?<version>[\\d.]+)/iu,\n\tgeneric: /Version\\/(?<version>[\\d.]+)/iu,\n\trv: /rv:(?<version>[\\d.]+)/iu\n};\n/**\n* Get the user agent string\n* @returns the user agent string\n*/\nfunction getUserAgent() {\n\t/* v8 ignore next */\n\treturn isBrowserEnvironment() ? globalThis.navigator.userAgent : \"Unknown user agent\";\n}\n/**\n* Get the browser version from a user agent string\n* @param userAgent the user agent string to parse\n* @returns the browser version\n*/\nfunction getVersion(userAgent = getUserAgent()) {\n\tfor (const [browser, regex] of Object.entries(versions)) if (regex.test(userAgent))\n /* v8 ignore next */\n\treturn regex.exec(userAgent)?.groups?.version ?? `Unknown ${browser} version`;\n\treturn \"Unknown version\";\n}\n/**\n* Get the browser name from a user agent string\n* @param userAgent the user agent string to parse\n* @returns the browser name\n*/\nfunction getBrowser(userAgent = getUserAgent()) {\n\tfor (const [browser, regex] of Object.entries(browsers)) if (regex.test(userAgent)) return browser;\n\treturn \"Unknown browser\";\n}\n/**\n* Get the operating system name from a user agent string\n* @param userAgent the user agent string to parse\n* @returns the operating system name\n*/\nfunction getOperatingSystem(userAgent = getUserAgent()) {\n\tfor (const [os, regex] of Object.entries(operatingSystems)) if (regex.test(userAgent)) return os;\n\treturn \"Unknown OS\";\n}\n/**\n* Detect if the browser is running on mobile\n* @param userAgent the user agent like 'Mozilla/5.0...'\n* @returns true if the browser is running on mobile\n*/\nfunction isMobile(userAgent = getUserAgent()) {\n\tif (userAgent.includes(\"Mobile\")) return true;\n\tconst browser = getBrowser(userAgent);\n\treturn [\"Android\"].includes(browser);\n}\n/**\n* Return a report of the browser context\n* @param context the browser context like : browser: 'Chrome', version: '91.0.4472', ...\n* @returns a textual report like : - Browser: Chrome 91.0.4472 - Language: en-US...\n*/\nfunction browserReport(context) {\n\treturn `\n - Browser : ${context.browser} ${context.version}\n - Language : ${context.language}\n - OS : ${context.os}\n - Platform : ${context.platform}\n - Is mobile : ${String(context.isMobile)}\n - Screen : ${context.screenWidth}x${context.screenHeight}\n - Url : ${context.url}\n - User agent : ${context.userAgent}\n `;\n}\n/**\n* Detect the browser context\n* @returns the context like { browser: 'Chrome', version: '91.0.4472', ... }\n// oxlint-disable-next-line require-returns-description\n* @copyright inspired from Ben Brooks Scholz https://github.com/benbscholz/detect Copyright (C) 2011\n*/\nfunction browserContext() {\n\tconst isBrowser = isBrowserEnvironment();\n\tconst userAgent = getUserAgent();\n\tconst browser = getBrowser(userAgent);\n\t/* v8 ignore next */\n\treturn {\n\t\tbrowser,\n\t\tisInternetExplorer: browser === \"Internet Explorer\",\n\t\tisMobile: isMobile(userAgent),\n\t\tlanguage: isBrowser ? globalThis.navigator.language : \"Unknown language\",\n\t\tos: getOperatingSystem(userAgent),\n\t\tplatform: isBrowser ? globalThis.navigator.userAgentData?.platform ?? \"Unknown platform\" : \"Unknown platform\",\n\t\tscreenHeight: isBrowser ? globalThis.screen.height : 0,\n\t\tscreenWidth: isBrowser ? globalThis.screen.width : 0,\n\t\turl: isBrowser ? globalThis.location.href : \"Unknown url\",\n\t\tuserAgent,\n\t\tversion: getVersion(userAgent)\n\t};\n}\n\n//#endregion\n//#region src/lib/browser-scroll.ts\n/* v8 ignore start */\n/**\n* Smoothly scroll the page to the first element matching the given selector\n* @param querySelector the selector of the element to scroll to\n* @throws {Error} if no element matches the selector\n*/\nfunction scrollToElement(querySelector) {\n\tconst element = globalThis.document.querySelector(querySelector);\n\tinvariant(element, `Cannot find element for query ${querySelector}`);\n\telement.scrollIntoView({\n\t\tbehavior: \"smooth\",\n\t\tblock: \"center\"\n\t});\n}\n\n//#endregion\n//#region src/lib/color-converters.ts\n/**\n* Convert a hex color to rgb\n* @param hex the hex color like \"#0f0\" or \"#00ff00\"\n* @returns the rgb color\n*/\nfunction hexToRgb(hex) {\n\tif (hex.length === 4) return Result.ok({\n\t\tcolorBlue: Number(`0x${hex[3]}${hex[3]}`),\n\t\tcolorGreen: Number(`0x${hex[2]}${hex[2]}`),\n\t\tcolorRed: Number(`0x${hex[1]}${hex[1]}`)\n\t});\n\tif (hex.length === 7) return Result.ok({\n\t\tcolorBlue: Number(`0x${hex[5]}${hex[6]}`),\n\t\tcolorGreen: Number(`0x${hex[3]}${hex[4]}`),\n\t\tcolorRed: Number(`0x${hex[1]}${hex[2]}`)\n\t});\n\treturn Result.error(`Invalid HEX color provided : ${hex}, should have a length of ${4} or ${7} instead of : ${hex.length}`);\n}\n/**\n* Transform a HEX color to HSL\n* @param hex \"#000000\"\n* @returns hsl object\n*/\nfunction hexToHsl(hex) {\n\tconst result = hexToRgb(hex);\n\tif (!result.ok) return result;\n\tlet { colorBlue, colorGreen, colorRed } = result.value;\n\tcolorRed /= 255;\n\tcolorGreen /= 255;\n\tcolorBlue /= 255;\n\tconst min = Math.min(colorRed, colorGreen, colorBlue);\n\tconst max = Math.max(colorRed, colorGreen, colorBlue);\n\tconst delta = max - min;\n\tlet hue = 0;\n\tlet saturation = 0;\n\tlet lightness = 0;\n\tif (delta === 0) hue = 0;\n\telse if (max === colorRed) hue = (colorGreen - colorBlue) / delta % 6;\n\telse if (max === colorGreen) hue = (colorBlue - colorRed) / delta + 2;\n\telse hue = (colorRed - colorGreen) / delta + 4;\n\thue = Math.round(hue * 60);\n\tif (hue < 0) hue += 360;\n\tlightness = (max + min) / 2;\n\tsaturation = delta === 0 ? 0 : delta / (1 - Math.abs(2 * lightness - 1));\n\tsaturation = Math.round(saturation * 100);\n\tlightness = Math.round(lightness * 100);\n\treturn {\n\t\thue,\n\t\tlightness,\n\t\tsaturation\n\t};\n}\n\n//#endregion\n//#region src/lib/cookie.utils.ts\n/**\n* Get a cookie value by name, using the CookieStore API when available and falling back to document.cookie\n* @param name the name of the cookie to read\n* @returns the cookie value or undefined if not found\n*/\nasync function getCookieValueByName(name) {\n\tif (typeof globalThis !== \"undefined\" && \"cookieStore\" in globalThis) try {\n\t\tconst cookie = await globalThis.cookieStore.get(name);\n\t\tif (cookie) return cookie.value;\n\t} catch (error) {\n\t\tnew Logger().showError(error);\n\t}\n\tconst cookies = globalThis.document.cookie.split(\";\");\n\tfor (const cookie of cookies) {\n\t\tconst trimmedCookie = cookie.trim();\n\t\tconst separatorIndex = trimmedCookie.indexOf(\"=\");\n\t\t/* v8 ignore start */\n\t\tif (separatorIndex === -1) continue;\n\t\tconst key = trimmedCookie.slice(0, separatorIndex);\n\t\tconst value = trimmedCookie.slice(separatorIndex + 1);\n\t\tif (key === name) return decodeURIComponent(value);\n\t}\n}\n\n//#endregion\n//#region src/lib/date-iso.ts\n/**\n* Convert a date into iso string\n*\n* Example with timezone\n* in  : dateToIsoString(new Date())\n* out : \"2018-09-03T15:24:00.366Z\"\n*\n* Example without timezone\n* in  : dateToIsoString(new Date(), { removeTimezone: true })\n* out : \"2018-09-03T15:24:00.366\"\n* @param date input date\n* @param options the options\n* @param options.removeTimezone remove the last z ?\n* @returns string like : \"2018-09-03T15:24:00.366Z\"\n*/\nfunction dateToIsoString(date, { removeTimezone = false } = {}) {\n\tlet dateString = new Date(date.getTime() - date.getTimezoneOffset() * nbMsInMinute).toISOString();\n\tif (removeTimezone && dateString.toLowerCase().endsWith(\"z\")) dateString = dateString.slice(0, Math.max(0, dateString.length - 1));\n\treturn dateString;\n}\n/**\n* Format a date to ISO without time\n* @param date input date\n* @returns string like : \"2019-12-31\"\n*/\nfunction dateIso10(date = /* @__PURE__ */ new Date()) {\n\tconst [result] = date.toISOString().split(\"T\");\n\tinvariant(result, \"Failed to convert date to ISO string\");\n\treturn result;\n}\n/**\n* Strip the seconds, milliseconds and timezone from an ISO date string\n*\n* @param date  the ISO date string\n* @returns ex: `2025-06-26T12:34`\n*/\nfunction dateIsoStripSecondsZone(date) {\n\tconst dateObject = new Date(date);\n\tif (Number.isNaN(dateObject.getTime())) return \"\";\n\treturn new Date(date).toISOString().slice(0, 16);\n}\nconst emptyDateLabel = \"-\";\nconst invalidDateLabel = \"N/A\";\n/**\n* Parse a date as UTC, a date-only string is parsed at midnight UTC instead of local time\n* @param date the date to parse\n* @returns the parsed date\n*/\nfunction parseAsUTC(date) {\n\tif (date instanceof Date) return date;\n\tif (typeof date === \"string\") {\n\t\t/* v8 ignore end */\n\t\tconst dateWithZ = date.includes(\"Z\") || date.includes(\"+\") || (date.match(/-/g) || []).length > 2 ? date : `${date}Z`;\n\t\treturn new Date(dateWithZ);\n\t}\n\treturn new Date(date);\n}\n/**\n* Strip the seconds, milliseconds and timezone from an ISO date string\n* @param date  the ISO date as a string or a Date object\n* @param options - {\n*   withTime?: boolean; // Whether to include the time (hours:minutes) in the output. Defaults to `true`.\n*   acceptPartialDate?: boolean; // Whether to accept partial dates like \"2025\" or \"2025-12\". Defaults to `false`. If true and the date is partial, the output is handled by `partialDateDisplay`.\n* }\n* @returns A formatted date string (example: \"24/12/2025\" or \"24/12/2025 17:00\") in the current timezone, or a special invalidDateLabel constant if the input is invalid and partials are not accepted. If partials are accepted, returns a formatted partial date string.\n*/\nfunction dateIsoToReadableDatetime(date, options = {}) {\n\tconst withTime = options.withTime ?? true;\n\tconst acceptPartialDate = options.acceptPartialDate ?? false;\n\tif (!date) return emptyDateLabel;\n\tconst dateObject = parseAsUTC(date);\n\tconst padLength = 2;\n\tconst invalidDate = Number.isNaN(dateObject.getTime());\n\tif (invalidDate && !acceptPartialDate) return invalidDateLabel;\n\tif (invalidDate && acceptPartialDate) return partialDateDisplay(date);\n\tlet result = `${String(dateObject.getDate()).padStart(padLength, \"0\")}/${String(dateObject.getMonth() + 1).padStart(padLength, \"0\")}/${dateObject.getFullYear()}`;\n\tif (withTime) {\n\t\tconst hours = String(dateObject.getHours()).padStart(padLength, \"0\");\n\t\tconst minutes = String(dateObject.getMinutes()).padStart(padLength, \"0\");\n\t\tresult += ` ${hours}:${minutes}`;\n\t}\n\treturn result;\n}\nconst dateRegex = /^(?<year>\\d{4})-(?<month>\\d{2})-(?<day>\\d{2})$/u;\n/**\n* Converts a partial ISO date string to a human-readable format.\n*\n* Recognizes the following partial date formats:\n* - \"YYYY-00-00\": returns \"YYYY\"\n* - \"YYYY-MM-00\": returns \"MM/YYYY\"\n* For any other format (including full dates or invalid formats), returns \"N/A\".\n*\n* @param dateString - The ISO date string in the format \"YYYY-MM-DD\".\n* @returns A human-readable string for partial dates, or \"N/A\" if the format is not recognized.\n*/\nfunction partialDateDisplay(dateString) {\n\tconst parts = dateRegex.exec(dateString)?.groups;\n\tif (!parts) return invalidDateLabel;\n\tconst { year, month, day } = parts;\n\tif (year === \"0000\") return invalidDateLabel;\n\tif (month === \"00\" && year) return year;\n\tif (month !== \"00\" && day === \"00\") return `${month}/${year}`;\n\treturn invalidDateLabel;\n}\nconst millisecondsPattern = /\\.\\d{3}Z$/;\n/**\n* Builds an ISO 8601 string based on local date and time parts.\n* This function takes date and time strings in local time,\n* constructs a Date object, and returns the ISO string in UTC.\n* @param datePart - The local date string in \"YYYY-MM-DD\" format (e.g., \"2023-06-28\")\n* @param timePart - The local time string in \"HH:mm\" format (e.g., \"15:45\")\n* @returns The corresponding ISO string (e.g., \"2023-06-28T13:45:00Z\"), or an empty string if date or time is missing\n*/\nfunction buildIsoFromLocal(datePart, timePart) {\n\tif (!datePart || !timePart) return \"\";\n\tconst [yy, mm, dd] = datePart.split(\"-\").map(Number);\n\tconst [hh, min] = timePart.split(\":\").map(Number);\n\tif (yy === void 0 || mm === void 0 || dd === void 0 || hh === void 0 || min === void 0) return \"\";\n\tconst local = new Date(yy, mm - 1, dd, hh, min, 0, 0);\n\t/* v8 ignore start */\n\tif (Number.isNaN(local.getTime())) return \"\";\n\t/* v8 ignore stop */\n\treturn new Date(local.getTime() - local.getTimezoneOffset() * nbMsInMinute).toISOString().replace(millisecondsPattern, \"Z\");\n}\n/**\n* Check if the date is valid\n*\n* @param date  the date\n* @returns ex: `true`\n*/\nfunction isValidDate(date) {\n\tif (!date) return false;\n\treturn !Number.isNaN(date.getTime());\n}\n\n//#endregion\n//#region src/lib/date-relative.ts\nconst timeAgoTuples = [\n\t[\n\t\tnbMsInMinute,\n\t\tnbMsInSecond,\n\t\t\"second\"\n\t],\n\t[\n\t\tnbMsInHour,\n\t\tnbMsInMinute,\n\t\t\"minute\"\n\t],\n\t[\n\t\tnbMsInDay,\n\t\tnbMsInHour,\n\t\t\"hour\"\n\t],\n\t[\n\t\tnbMsInWeek,\n\t\tnbMsInDay,\n\t\t\"day\"\n\t],\n\t[\n\t\tnbMsInMonth,\n\t\tnbMsInWeek,\n\t\t\"week\"\n\t],\n\t[\n\t\tnbMsInYear,\n\t\tnbMsInMonth,\n\t\t\"month\"\n\t]\n];\n/**\n* Make a date readable for us, poor humans\n* Kudos to https://coolaj86.com/articles/time-ago-in-under-50-lines-of-javascript/\n* @param input a date or a number of milliseconds\n* @param language the language to use, default is \"en\"\n* @returns \"a minute ago\", \"4 days ago\"\n*/\nfunction readableTimeAgo(input, language = \"en\") {\n\tconst rtf = new Intl.RelativeTimeFormat(language, { numeric: \"auto\" });\n\tconst ms = typeof input === \"number\" ? input : Date.now() - input.getTime();\n\tfor (const [threshold, divisor, unit] of timeAgoTuples) if (ms < threshold) return rtf.format(-Math.floor(ms / divisor), unit);\n\treturn rtf.format(-Math.floor(ms / nbMsInYear), \"year\");\n}\n/**\n* Return a relative Date\n* @param nbDays the number of days to subtract from today\n* @returns a Date\n*/\nfunction daysAgo(nbDays = 0) {\n\tconst date = /* @__PURE__ */ new Date();\n\tdate.setDate(date.getDate() - nbDays);\n\treturn date;\n}\n/**\n* Return a relative Date in the future\n* @param nbDays the number of days to add to today\n* @returns a Date\n* @example daysFromNow(1) // tomorrow\n*/\nfunction daysFromNow(nbDays = 0) {\n\treturn daysAgo(-nbDays);\n}\n/**\n* Return a relative date formatted to ISO 10\n* @param nbDays the number of days to subtract from today\n* @returns a string like : \"2019-12-31\"\n*/\nfunction daysAgoIso10(nbDays = 0) {\n\treturn dateIso10(daysAgo(nbDays));\n}\n\n//#endregion\n//#region src/lib/debounce.ts\n/**\n* Debounce any function, the returned function resolves with the result of the last call\n* @param method the function to debounce\n* @param waitFor the time to wait before calling the function\n* @returns a promise with a resolve type of the original function's return type\n*/\nfunction debounce(method, waitFor) {\n\tlet timeout = void 0;\n\tlet pending = [];\n\treturn (...parameters) => {\n\t\tconst { promise, reject, resolve } = Promise.withResolvers();\n\t\tpending.push({\n\t\t\treject,\n\t\t\tresolve\n\t\t});\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(() => {\n\t\t\tconst callers = pending;\n\t\t\tpending = [];\n\t\t\ttry {\n\t\t\t\tconst result = method(...parameters);\n\t\t\t\tfor (const caller of callers) caller.resolve(result);\n\t\t\t} catch (error) {\n\t\t\t\tfor (const caller of callers) caller.reject(error);\n\t\t\t}\n\t\t}, waitFor);\n\t\treturn promise;\n\t};\n}\n\n//#endregion\n//#region src/lib/dom.ts\n/**\n* Generate a dom element\n* @param type the type of the element, like 'div' or 'span'\n* @param classes the custom classes to add to the element\n* @param content the content of the element, can be a string, another dom element or an array of dom elements\n* @returns the generated dom element\n*/\nfunction dom(type, classes = \"\", content = \"\") {\n\tconst element = document.createElement(type);\n\telement.className = classes;\n\tif (typeof content === \"string\") element.innerHTML = content;\n\telse if (content instanceof Node) element.append(content);\n\telse for (const node of content) element.append(node);\n\treturn element;\n}\n/**\n* Generate an image <img> element\n* @param classes the custom classes to add to the element\n* @param source the source of the image\n* @param alt the alt text of the image\n* @returns the generated image element\n*/\nfunction img(classes, source, alt) {\n\tconst element = dom(\"img\", classes);\n\telement.alt = alt;\n\telement.src = source;\n\treturn element;\n}\n/**\n* Generate an icon element with a <i> tag\n* @param classes the custom classes to add to the element\n* @returns the generated icon element\n*/\nfunction icon(classes = \"\") {\n\treturn dom(\"i\", `icon ${classes}`);\n}\n/**\n* Generate a link <a> element\n* @param classes the custom classes to add to the element\n* @param content the content of the element, can be a string, another dom element or an array of dom elements\n* @param href the href of the link\n* @param options the options\n* @param options.newTab true if the link should open in a new tab\n* @returns the generated link element\n*/\nfunction link(classes, content, href, { newTab = false } = {}) {\n\tconst element = dom(\"a\", classes, content);\n\telement.href = href;\n\tif (newTab) element.target = \"_blank\";\n\treturn element;\n}\n/**\n* Generate a paragraph <p> element\n* @param classes the custom classes to add to the element\n* @param content the content of the element, can be a string, another dom element or an array of dom elements\n* @returns the generated paragraph element\n*/\nfunction text(classes, content = \"\") {\n\treturn dom(\"p\", classes, content);\n}\n/**\n* Generate a <strong> element\n* @param classes the custom classes to add to the element\n* @param content the content of the element, can be a string, another dom element or an array of dom elements\n* @returns the generated strong element\n*/\nfunction strong(classes, content = \"\") {\n\treturn dom(\"strong\", classes, content);\n}\n/**\n* Generate an emphasis <em> element\n* @param classes the custom classes to add to the element\n* @param content the content of the element, can be a string, another dom element or an array of dom elements\n* @returns the generated emphasis element\n*/\nfunction em(classes, content = \"\") {\n\treturn dom(\"em\", classes, content);\n}\n/**\n* Generate a <small> element\n* @param classes the custom classes to add to the element\n* @param content the content of the element, can be a string, another dom element or an array of dom elements\n* @returns the generated small element\n*/\nfunction small(classes, content = \"\") {\n\treturn dom(\"small\", classes, content);\n}\n/**\n* Generate a <h1> heading element\n* @param classes the custom classes to add to the element\n* @param content the content of the element, can be a string, another dom element or an array of dom elements\n* @returns the generated heading element\n*/\nfunction h1(classes, content = \"\") {\n\treturn dom(\"h1\", classes, content);\n}\n/**\n* Generate a <h2> heading element\n* @param classes the custom classes to add to the element\n* @param content the content of the element, can be a string, another dom element or an array of dom elements\n* @returns the generated heading element\n*/\nfunction h2(classes, content = \"\") {\n\treturn dom(\"h2\", classes, content);\n}\n/**\n* Generate a <h3> heading element\n* @param classes the custom classes to add to the element\n* @param content the content of the element, can be a string, another dom element or an array of dom elements\n* @returns the generated heading element\n*/\nfunction h3(classes, content = \"\") {\n\treturn dom(\"h3\", classes, content);\n}\n/**\n* Generate a <ul> list element\n* @param classes the custom classes to add to the element\n* @param content the content of the element, can be a string, another dom element or an array of dom elements\n* @returns the generated list element\n*/\nfunction ul(classes, content = \"\") {\n\treturn dom(\"ul\", classes, content);\n}\n/**\n* Generate a <li> element\n* @param classes the custom classes to add to the element\n* @param content the content of the element, can be a string, another dom element or an array of dom elements\n* @returns the generated list element\n*/\nfunction li(classes, content = \"\") {\n\treturn dom(\"li\", classes, content);\n}\n/**\n* Generate a <div> element\n* @param classes the custom classes to add to the element\n* @param content the content of the element, can be a string, another dom element or an array of dom elements\n* @returns the generated div element\n*/\nfunction div(classes, content = \"\") {\n\treturn dom(\"div\", classes, content);\n}\n/**\n* Generate a link to a css/stylesheet file\n* @param href the href/src\n* @returns the link element, ex: &lt;link type=\"text/css\" href=\"../styles.css\" rel=\"stylesheet\" />\n*/\nfunction css(href) {\n\tconst element = dom(\"link\");\n\telement.href = href;\n\telement.rel = \"stylesheet\";\n\telement.type = \"text/css\";\n\treturn element;\n}\n/**\n* QuerySelector wrapper with a short-hand syntax\n* @param selector the css-like selector to find the element\n* @param context the dom context to search in\n* @returns the element or undefined if not found\n*/\nfunction findOne(selector, context = document) {\n\treturn context.querySelector(selector) ?? void 0;\n}\n/**\n* QuerySelectorAll with a short-hand syntax that return an Array instead of NodeList\n* @param selector the css-like selector to find the elements\n* @param context the context to search in, document by default\n* @returns array of found elements\n*/\nfunction findAll(selector, context = document) {\n\treturn Array.from(context.querySelectorAll(selector));\n}\n/**\n* Wait for an element to exist in the DOM, checking right away then again after each wait\n* @param selector the css-like selector to find the element, ex: '#super-id' or '.a-class'\n* @param options the options\n* @param options.wait time to wait in ms between two tries, default 500ms\n* @param options.maxTries the number of tries before giving up, default 5\n* @returns a Result with the element, or an error once every try failed\n* @example const result = await waitToDetect('input[name=\"email\"]', { maxTries: 10, wait: 200 })\n*/\nasync function waitToDetect(selector, { maxTries = 5, wait = 500 } = {}) {\n\tconst totalTries = Number.isNaN(maxTries) ? 1 : Math.max(1, Math.floor(maxTries));\n\tfor (let tries = 1; tries <= totalTries; tries += 1) {\n\t\tconst element = findOne(selector);\n\t\tif (element) return Result.ok(element);\n\t\tif (tries < totalTries) await sleep(wait);\n\t}\n\treturn Result.error(`stop searching after ${totalTries} tries to detect \"${selector}\"`);\n}\n/**\n* Set an element height to its content height, you should use it debounced like :\n* ```\n* const scrollToHeight = debounce((element: HTMLElement) => scrollToHeightSync(element), 100)\n* ```\n* @param element the element to set height to\n*/\nasync function scrollToHeightSync(element) {\n\tconst initial = element.style.height;\n\telement.style.height = \"inherit\";\n\tconst target = element.scrollHeight + 2;\n\telement.style.height = initial;\n\tawait sleep(7);\n\telement.style.height = `${target}px`;\n}\n/**\n* Generate a backdrop element\n* @param classes the classes to add to the backdrop\n* @returns the backdrop element\n*/\nfunction backdrop(classes) {\n\treturn div(`backdrop ${classes} fixed top-0 left-0 z-10 w-full h-full opacity-0 pointer-events-none`);\n}\n/**\n* Tw is a callee mock for tailwindcss, it will return the classes as a string\n* @param classes the classes to return\n* @returns the classes as a string\n*/\nfunction tw(classes) {\n\tif (typeof classes === \"string\") return classes;\n\treturn classes.join(\" \");\n}\n\n//#endregion\n//#region src/lib/events.ts\n/**\n* Emit an event on a media, window by default\n* @param name the name of the event\n* @param data the data to emit\n* @param media the media to emit the event from, like window or a dom element\n*/\nfunction emit(name, data, media = globalThis) {\n\t/* v8 ignore start */\n\tif (data === void 0) media.dispatchEvent(new CustomEvent(name));\n\telse media.dispatchEvent(new CustomEvent(name, { detail: data }));\n\t/* v8 ignore stop */\n}\n/**\n* Listen to an event on a media, window by default\n* @param name the name of the event to listen to\n* @param callback the callback to call when the event is emitted\n* @param media the media to listen to the event, like window or a dom element\n* @returns false if the event cannot be not listened to or a listener object if it can\n* @example on<{ id: number }>('user-selected', user => console.log(user.id))\n*/\nfunction on(name, callback, media = globalThis) {\n\t/**\n\t* The callback to call when the event is emitted\n\t* @param event the event\n\t* @returns the result of the callback\n\t*/\n\tfunction onCallback(event) {\n\t\treturn callback(event instanceof CustomEvent ? event.detail : event, event);\n\t}\n\tmedia.addEventListener(name, onCallback, { passive: true });\n\treturn {\n\t\tcallback: onCallback,\n\t\tmedia,\n\t\tname\n\t};\n}\n/**\n* Remove a listener from a media, window by default\n* @param listener the listener to remove\n* @param listener.media the media to remove the listener from, like window or a dom element\n* @param listener.name the name of the event to remove the listener from\n* @param listener.callback the callback to remove\n*/\nfunction off({ callback, media, name }) {\n\tmedia.removeEventListener(name, callback);\n}\n\n//#endregion\n//#region src/lib/fetch.ts\n/**\n* Fetches raw data from the specified URL using the provided request options.\n* Wraps the fetch in a Result type for safe error handling.\n*\n* @param url - The URL to fetch data from.\n* @param options - The request options to pass to the fetch API.\n* @returns A promise that resolves to a Result containing the raw data or an error if the fetch fails.\n*/\nasync function fetchRaw(url, options) {\n\tconst result = await Result.trySafe(fetch(url, options));\n\tif (!result.ok) return Result.error(String(result.error));\n\treturn result;\n}\n/**\n* Fetches JSON data from the specified URL using the provided request options.\n* Wraps the fetch and JSON parsing in a Result type for safe error handling.\n*\n* @param url - The URL to fetch data from.\n* @param options - The request options to pass to the fetch API.\n* @returns A promise that resolves to a Result containing the parsed JSON data or an error if the fetch or parsing fails.\n*/\nasync function fetchJson(url, options) {\n\tconst response = await fetchRaw(url, options);\n\tif (!response.ok) return Result.error(`fetch failed : ${response.error}`);\n\tconst result = await Result.trySafe(response.value.json());\n\tif (!result.ok) return Result.error(String(result.error));\n\treturn result;\n}\n\n//#endregion\n//#region src/lib/functions.ts\n/**\n* Determine whether the given object has a property\n* @param object the object to test\n* @param property the property to test\n* @returns true if the object has the property\n*/\nfunction hasOwn(object, property) {\n\treturn Object.hasOwn(object, property);\n}\n/**\n* A function that returns void, handy for initializing variables.\n*/\nfunction functionReturningVoid() {}\n/**\n* A function that returns `undefined`, handy for initializing variables.\n* @returns `undefined`\n*/\nfunction functionReturningUndefined() {}\n\n//#endregion\n//#region src/lib/memoize.ts\n/**\n* Creates a function that memoizes the result of `callback`\n* @copyright inspired from Angus Croll package `just-memoize` under MIT License Copyright (c) 2016-2023\n* @param callback the function to memoize\n* @returns a memoized function\n*/\nfunction memoize(callback) {\n\tif (typeof callback !== \"function\") throw new TypeError(\"memoize callback parameter should be a function\");\n\tconst cache = {};\n\t/**\n\t* The memoized function\n\t* @param parameters the arguments to pass to the callback\n\t* @returns the result of the callback\n\t*/\n\tfunction memoized(...parameters) {\n\t\tconst key = JSON.stringify(parameters);\n\t\tif (!(key in cache)) cache[key] = callback(...parameters);\n\t\treturn cache[key];\n\t}\n\tmemoized.cache = cache;\n\treturn memoized;\n}\n\n//#endregion\n//#region src/lib/number-round.ts\n/**\n* Round a number to a given number of decimals\n* @param number the number to round\n* @param nbDecimals the number of decimals to keep\n* @returns the rounded number\n* @example round(1.2345, 2) // returns 1.23\n*/\nfunction round(number, nbDecimals = 2) {\n\treturn Math.round(number * 10 ** nbDecimals) / 10 ** nbDecimals;\n}\n\n//#endregion\n//#region src/lib/number-ranged-score.ts\n/**\n* Get a ranged score\n* @param rules the rules to apply\n* @param rules.isHigherBetter if true, the higher the value, the higher the score\n* @param rules.scoreMax the maximum score\n* @param rules.scoreMin the minimum score\n* @param rules.valueMax the maximum value\n* @param rules.valueMin the minimum value\n* @param value the value to score\n* @returns the ranged score\n*/\nfunction rangedScore({ isHigherBetter, scoreMax, scoreMin, valueMax, valueMin }, value) {\n\tconst lineA = (scoreMin - scoreMax) / (valueMin - valueMax);\n\tconst lineB = scoreMax - valueMax * lineA;\n\tconst score = value * lineA + lineB;\n\tif (score < scoreMin) return isHigherBetter ? scoreMin : scoreMax;\n\tif (score > scoreMax) return isHigherBetter ? scoreMax : scoreMin;\n\tconst nbDecimals = scoreMax - scoreMin > 10 ? 0 : 2;\n\tconst finalScore = isHigherBetter ? score : scoreMax - score;\n\treturn round(finalScore, nbDecimals);\n}\n\n//#endregion\n//#region src/lib/object-cap-nesting.ts\n/**\n* Cap the nesting level of an object\n* @param object the object to cap\n* @param maxLevel like : `2`, the top level object is always kept, so values below 1 act like 1\n* @returns item like : `{ name : \"Pine\" }`\n*/\nfunction capNesting(object, maxLevel = 3) {\n\tconst one = 1;\n\tconst lastLevel = Math.max(maxLevel, one);\n\t/**\n\t* Helper function to cap the nesting level of an object.\n\t* @param currentObject - The current object to cap the nesting level.\n\t* @param currentLevel - The current nesting level.\n\t* @returns The capped object.\n\t*/\n\tfunction capHelper(currentObject, currentLevel) {\n\t\tif (currentLevel > lastLevel) return \"...\";\n\t\tif (typeof currentObject !== \"object\" || currentObject === null) return currentObject;\n\t\tif (Array.isArray(currentObject)) return currentObject.map((item) => capHelper(item, currentLevel + one));\n\t\tconst result = {};\n\t\tfor (const [key, value] of Object.entries(currentObject)) Object.defineProperty(result, key, {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: true,\n\t\t\tvalue: capHelper(value, currentLevel + one),\n\t\t\twritable: true\n\t\t});\n\t\treturn result;\n\t}\n\treturn capHelper(object, one);\n}\n\n//#endregion\n//#region src/lib/object-deep.ts\n/**\n* Get a nested value from an object\n* @see https://github.com/developit/dlv/blob/master/index.js\n* @see https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/dlv/index.d.ts\n* @param object the object to get the value from\n* @param path the path to the value\n* @param defaultValue the default value to return if the path does not exist\n* @returns the value at the specified path\n*/\nfunction getNested(object, path, defaultValue) {\n\tconst pathArray = typeof path === \"string\" ? path.split(\".\") : path;\n\tlet result = object;\n\tfor (const key of pathArray) result = result && typeof result === \"object\" ? result[key] : void 0;\n\treturn result === void 0 ? defaultValue : result;\n}\n/**\n* Set a nested value on an object, creating intermediate objects / arrays as needed\n* @see https://github.com/lukeed/dset/blob/master/src/index.js\n* @param object the object to mutate\n* @param path the path of the value to set\n* @param value the value to set\n*/\nfunction setNested(object, path, value) {\n\tconst pathArray = typeof path === \"string\" ? path.split(\".\") : path;\n\tlet current = object;\n\tfor (let index = 0; index < pathArray.length; index += 1) {\n\t\tconst key = String(pathArray[index]);\n\t\tif (key === \"__proto__\" || key === \"constructor\" || key === \"prototype\") return;\n\t\tif (index === pathArray.length - 1) {\n\t\t\tcurrent[key] = value;\n\t\t\treturn;\n\t\t}\n\t\tconst next = current[key];\n\t\tif (typeof next === \"object\" && next !== null) {\n\t\t\tcurrent = next;\n\t\t\tcontinue;\n\t\t}\n\t\tconst nextKey = String(pathArray[index + 1]);\n\t\tconst created = /^\\d+$/u.test(nextKey) ? [] : {};\n\t\tcurrent[key] = created;\n\t\tcurrent = created;\n\t}\n}\n\n//#endregion\n//#region src/lib/object-equal.ts\n/**\n* Check if two objects are deeply equal\n* @param objectA the base object to compare\n* @param objectB the object to compare with\n* @param options the options\n* @param options.sortKeys if true, the order of keys will be sorted alpha before comparison\n* @returns true if the two objects are deeply equal\n*/\nfunction objectEqual(objectA, objectB, { sortKeys = false } = {}) {\n\treturn objectSerialize(objectA, { sortKeys }) === objectSerialize(objectB, { sortKeys });\n}\n\n//#endregion\n//#region src/lib/object-flatten.ts\n/**\n* Convert a multi-level deep object into a single-level, flatten, object\n* @param object the object to flatten\n* @param path optional, add a root path to all keys\n* @param separator optional, the character to join keys\n* @returns object like `{ 'person.name': 'John Doe', 'person.age': 32 }`\n*/\nfunction flatten(object, path = \"\", separator = \".\") {\n\tconst result = {};\n\tfor (const key of Object.keys(object)) {\n\t\tconst value = object[key];\n\t\tconst updatedPath = Array.isArray(object) ? `${path}[${key}]` : [path, key].filter(Boolean).join(separator);\n\t\tif ([\n\t\t\ttypeof value === \"object\",\n\t\t\tvalue !== null,\n\t\t\t!(value instanceof Date),\n\t\t\t!(value instanceof File),\n\t\t\t!(value instanceof RegExp),\n\t\t\t!(Array.isArray(value) && value.length === 0)\n\t\t].every(Boolean)) Object.assign(result, flatten(value, updatedPath, separator));\n\t\telse result[updatedPath] = value;\n\t}\n\treturn result;\n}\n\n//#endregion\n//#region src/lib/object-safe-assign.ts\n/**\n* Like Object.assign but only non-null/undefined values can overwrite\n* @param target Destination object\n* @param sources Object(s) to sequentially merge\n* @returns The resulting object merged\n*/\nfunction safeAssign(target, ...sources) {\n\tif (sources.length === 0) return target;\n\tconst source = sources.shift();\n\tif (isRecord(target) && isRecord(source)) {\n\t\tfor (const key in source) if (isRecord(source[key])) {\n\t\t\tif (!target[key]) Object.assign(target, { [key]: {} });\n\t\t\tsafeAssign(target[key], source[key]);\n\t\t} else if (source[key] !== null && source[key] !== void 0) Object.assign(target, { [key]: source[key] });\n\t}\n\treturn safeAssign(target, ...sources);\n}\n\n//#endregion\n//#region src/lib/object-sort-by-property.ts\n/**\n* Sort an array of objects by a specific property of theses objects, example :\n* ```js\n* persons.sort(byProperty('name'))\n* ```\n* @param property the property to sort by\n* @param order the order to sort, default is ascending\n* @returns the sorted array\n*/\nfunction byProperty(property, order = \"\") {\n\tif (order === \"\") return () => 0;\n\tconst sortOrder = order === \"asc\" ? 1 : -1;\n\treturn (recordA, recordB) => {\n\t\tconst valueA = recordA[property];\n\t\tconst valueB = recordB[property];\n\t\tconst isValueAMissing = isNil(valueA);\n\t\tconst isValueBMissing = isNil(valueB);\n\t\tif (isValueAMissing && !isValueBMissing) return sortOrder;\n\t\tif (!isValueAMissing && isValueBMissing) return -sortOrder;\n\t\tif (valueA === valueB) return 0;\n\t\treturn (valueA < valueB ? -1 : 1) * sortOrder;\n\t};\n}\n\n//#endregion\n//#region src/lib/object-sum.ts\n/**\n* Generate a unique string checksum from an object\n* @param object the object to generate checksum from\n* @param options the options\n* @param options.sortKeys if true, the order of keys will be sorted alpha before checksum\n* @returns the checksum\n*/\nfunction objectSum(object, { sortKeys = false } = {}) {\n\treturn stringSum(objectSerialize(object, { sortKeys }));\n}\n\n//#endregion\n//#region src/lib/state.ts\n/**\n* Creates a state object that can be watched for changes, and optionally sync in a storage object\n* @param data The initial state object\n* @param stateStorage The storage object to sync with\n* @param onlyStoreKeys The keys to sync with the storage object, if empty all keys will be synced\n* @returns The state object and a watch function\n*/\nfunction createState(data, stateStorage, onlyStoreKeys = []) {\n\tconst store = (key) => stateStorage !== void 0 && (onlyStoreKeys.length === 0 || onlyStoreKeys.includes(key));\n\tconst listeners = {};\n\tconst state = new Proxy(data, {\n\t\tget(target, key) {\n\t\t\tconst localValue = Reflect.get(target, key);\n\t\t\tif (store(key)) return stateStorage?.get(key.toString(), localValue);\n\t\t\treturn localValue;\n\t\t},\n\t\tset(target, key, value) {\n\t\t\tReflect.set(target, key, value);\n\t\t\tif (store(key)) stateStorage?.set(key.toString(), value);\n\t\t\tconst callbacks = listeners[key] ?? [];\n\t\t\tfor (const callback of callbacks) callback(key.toString(), value);\n\t\t\treturn true;\n\t\t}\n\t});\n\tfunction watchState(key, callback) {\n\t\tconst all = Object.keys(state);\n\t\tconst keys = key === \"*\" ? all : Array.isArray(key) ? key : [key];\n\t\tfor (const stateKey of keys) {\n\t\t\tconst list = listeners[stateKey];\n\t\t\tif (list === void 0) listeners[stateKey] = [callback];\n\t\t\telse list.push(callback);\n\t\t}\n\t}\n\treturn {\n\t\tstate,\n\t\twatchState\n\t};\n}\n\n//#endregion\n//#region src/lib/string-regex.ts\nconst htmlTagRegex = /<[^>]+>/u;\nconst base64Regex = /^(?:data:)?[\\w/]+;base64,[\\w+/=]+$/u;\nconst base64TypeRegex = /[^:]\\w+\\/[\\w+.-]+(?=;|,)/u;\n/**\n* Check if the string contains HTML\n* @param string the string to check\n* @returns true if the string contains HTML\n*/\nfunction isHtml(string) {\n\treturn htmlTagRegex.test(string);\n}\n\n//#endregion\n//#region src/lib/string-base64.ts\n/**\n* Check if the string is a base64 string\n* @param string the string to check\n* @returns true if the string is a base64 string\n*/\nfunction isBase64(string) {\n\treturn base64Regex.test(string);\n}\n/**\n* Parse a base64 string\n* @param string the base64 string to parse\n* @returns the parsed string like `{ base64: 'iVBORw0KGgoYII=', size: 11, type: 'image/png' }`\n*/\nfunction parseBase64(string) {\n\tconst result = {\n\t\tbase64: \"\",\n\t\tsize: 0,\n\t\ttype: \"\"\n\t};\n\tif (!isBase64(string)) return result;\n\t/* v8 ignore start */\n\tconst type = base64TypeRegex.exec(string);\n\tif (type && typeof type[0] === \"string\") [result.type] = type;\n\tconst base64 = string.split(\"base64,\");\n\tif (base64.length > 1 && typeof base64[1] === \"string\") [, result.base64] = base64;\n\t/* v8 ignore stop */\n\tresult.size = Math.round(result.base64.length * 3 / 4);\n\treturn result;\n}\n\n//#endregion\n//#region src/lib/string-base64-to-file.ts\nconst mimeTypeRegex = /:(?<mimeType>[^;]+);/;\n/**\n* Convert a base64 string to a `File` instance.\n*\n* @param base64 the base64 string\n* @param filename the output filename with extension\n* @param checkExtension if false, does not check if the filename contains extension\n* @returns the base64 string\n*/\nfunction base64ToFile(base64, filename, checkExtension = true) {\n\tconst [dataUrlPrefix, base64String] = base64.split(\",\");\n\tif (dataUrlPrefix === void 0 || base64String === void 0) return Result.error(\"Invalid base64 string format.\");\n\t/* v8 ignore start */\n\tconst base64BinaryResult = Result.trySafe(() => atob(base64String));\n\tif (!base64BinaryResult.ok) return Result.error(\"Failed to decode base64 string.\");\n\t/* v8 ignore stop */\n\tconst uint8Arr = new Uint8Array(base64BinaryResult.value.length);\n\tfor (let index = 0; index < base64BinaryResult.value.length; index += 1) uint8Arr[index] = base64BinaryResult.value.codePointAt(index);\n\t/* v8 ignore start */\n\tconst mimeType = mimeTypeRegex.exec(dataUrlPrefix)?.groups?.mimeType;\n\tif (!mimeType) return Result.error(\"No mime type found.\");\n\tconst blob = new Blob([uint8Arr], { type: mimeType });\n\t/* v8 ignore stop */\n\tif (checkExtension && !/\\.\\w{2,5}$/.test(filename)) return Result.error(\"Missing extension in the filename.\");\n\tconst file = new File([blob], filename, { type: mimeType });\n\treturn Result.ok(file);\n}\n\n//#endregion\n//#region src/lib/string-case.ts\n/**\n* Convert kebab-case to PascalCase\n* @param kebab the kebab-case string like 'dropdown-menu'\n* @param joinChar the character to join the string parts\n* @returns The PascalCase string like 'DropdownMenu'\n*/\nfunction kebabToPascalCase(kebab, joinChar = \"\") {\n\treturn kebab.split(\"-\").map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(joinChar);\n}\n/**\n* Converts a camelCase string to kebab-case\n* @param camel the camelCase string to convert, like 'myVariableName'\n* @returns The kebab-case version of the input string, like 'my-variable-name'\n*/\nfunction camelToKebabCase(camel) {\n\treturn camel.replaceAll(/(?<lower>[a-z0-9])(?<upper>[A-Z])/g, \"$<lower>-$<upper>\").replaceAll(/(?<upper>[A-Z])(?<word>[A-Z][a-z])/g, \"$<upper>-$<word>\").replaceAll(/[\\s_]+/g, \"-\").toLowerCase();\n}\n\n//#endregion\n//#region src/lib/string-inject-mark.ts\nconst elementTagRegex = /^<[a-z.]+\\b/u;\nconst metaTagRegex = /^<meta\\b/u;\nconst closingTagRegex = /<\\/[a-z.]+>/uy;\nconst contentAfterRegex = /\\scontent=\"(?<value>[^\"]*)\"/du;\nconst contentBeforeRegex = /\\scontent=\"(?<value>[^\"]*)\" /du;\nconst childrenRegex = /,children:\"(?<value>[^\"]*)\"/du;\nconst jsxCall = \".jsx(\";\nconst wrappedJsxCall = \".jsx)(\";\nconst whitespaceRegex = /\\s/u;\n/**\n* Escape a placeholder so it is matched as is, not as a regex\n* @param placeholder the placeholder like \"app.mark\" or \"mark(1)\"\n* @returns the escaped placeholder, ready to be used in a regex\n*/\nfunction escapePlaceholder(placeholder) {\n\treturn placeholder.replaceAll(/[$()*+.?[\\\\\\]^{|}]/gu, String.raw`\\$&`);\n}\n/**\n* Find the start of the tag holding a position, skipping a \"<\" inside an earlier attribute value like title=\"1<2\"\n* @param content the string to look into\n* @param at the position inside the tag\n* @param tagRegex the regex the tag start must match, like /^<meta\\b/u\n* @returns the \"<\" position, or -1 when the position is not inside such a tag\n*/\nfunction tagStart(content, at, tagRegex) {\n\tfor (let open = content.lastIndexOf(\"<\", at); open !== -1; open = open === 0 ? -1 : content.lastIndexOf(\"<\", open - 1)) {\n\t\tconst head = content.slice(open, at);\n\t\tif (head.includes(\">\")) return -1;\n\t\tif (tagRegex.test(head)) return open;\n\t}\n\treturn -1;\n}\n/**\n* Find the \">\" closing a tag, skipping the ones inside a quoted attribute value like x-show=\"count > 0\"\n* @param content the string to look into\n* @param from a position inside the tag, outside any attribute value\n* @returns the \">\" position, or -1 when the tag is not closed\n*/\nfunction tagEnd(content, from) {\n\tlet quote = \"\";\n\tfor (let index = from; index < content.length; index += 1) {\n\t\tconst char = content.charAt(index);\n\t\tif (quote !== \"\") quote = char === quote ? \"\" : quote;\n\t\telse if (char === \"\\\"\" || char === \"'\") quote = char;\n\t\telse if (char === \">\") return index;\n\t}\n\treturn -1;\n}\n/**\n* List the tags holding an attribute, found with indexOf : a regex starting at every \"<\" backtracks quadratically on a big minified chunk\n* @param content the string to look into\n* @param attribute the attribute like 'id=\"app-mark\"'\n* @param tagRegex the regex the tag start must match, like /^<meta\\b/u\n* @yields {{ at: number, close: number, open: number }} the attribute position, and the tag \"<\" and \">\" positions\n*/\nfunction* tagsWith(content, attribute, tagRegex) {\n\tfor (let at = content.indexOf(attribute); at !== -1; at = content.indexOf(attribute, at + attribute.length)) {\n\t\tif (!whitespaceRegex.test(content.charAt(at - 1))) continue;\n\t\tconst open = tagStart(content, at, tagRegex);\n\t\tconst close = tagEnd(content, at + attribute.length);\n\t\tif (open !== -1 && close !== -1) yield {\n\t\t\tat,\n\t\t\tclose,\n\t\t\topen\n\t\t};\n\t}\n}\n/**\n* Replace the value captured by a regex with the d flag in a part of a string\n* @param content the whole string\n* @param offset where the part starts in the whole string\n* @param options the options\n* @param options.indices the indices of the part match, undefined when the part did not match\n* @param options.mark the mark to put in place of the value\n* @returns the string with the mark in place of the value, or undefined when the part did not match\n*/\nfunction replaceValue(content, offset, { indices, mark }) {\n\tconst value = indices?.groups?.value;\n\tif (value === void 0) return void 0;\n\treturn `${content.slice(0, offset + value[0])}${mark}${content.slice(offset + value[1])}`;\n}\n/**\n* Inject a mark as the text of the first element holding an attribute, like `<span id=\"placeholder\">...</span>`\n* @param content the string to inject the mark in\n* @param attribute the attribute like 'id=\"app-mark\"'\n* @param mark the mark to inject\n* @returns the string with the mark injected\n*/\nfunction injectInElement(content, attribute, mark) {\n\tfor (const { close } of tagsWith(content, attribute, elementTagRegex)) {\n\t\tconst textEnd = content.indexOf(\"<\", close);\n\t\tclosingTagRegex.lastIndex = textEnd;\n\t\tif (textEnd !== -1 && closingTagRegex.test(content)) return `${content.slice(0, close + 1)}${mark}${content.slice(textEnd)}`;\n\t}\n\treturn content;\n}\n/**\n* Inject a mark in the content attribute of the first meta holding an attribute, with the content attribute after or before it\n* @param content the string to inject the mark in\n* @param attribute the attribute like 'name=\"app-mark\"'\n* @param mark the mark to inject\n* @returns the string with the mark injected\n*/\nfunction injectInMeta(content, attribute, mark) {\n\tlet updated = content;\n\tfor (const { at, close } of tagsWith(updated, attribute, metaTagRegex)) {\n\t\tconst replaced = replaceValue(updated, at, {\n\t\t\tindices: contentAfterRegex.exec(updated.slice(at, close))?.indices,\n\t\t\tmark\n\t\t});\n\t\tif (replaced === void 0) continue;\n\t\tupdated = replaced;\n\t\tbreak;\n\t}\n\tfor (const { at, open } of tagsWith(updated, attribute, metaTagRegex)) {\n\t\tconst replaced = replaceValue(updated, open, {\n\t\t\tindices: contentBeforeRegex.exec(updated.slice(open, at))?.indices,\n\t\t\tmark\n\t\t});\n\t\tif (replaced !== void 0) return replaced;\n\t}\n\treturn updated;\n}\n/**\n* Inject a mark as the children of the first jsx call holding an attribute, like `r.jsx(\"span\",{id:\"placeholder\"})`\n* @param content the string to inject the mark in\n* @param attribute the attribute like 'id:\"app-mark\"'\n* @param mark the mark to inject\n* @returns the string with the mark injected, a children already injected by a previous run is replaced\n*/\nfunction injectInJsx(content, attribute, mark) {\n\tfor (let at = content.indexOf(attribute); at !== -1; at = content.indexOf(attribute, at + attribute.length)) {\n\t\tconst open = content.lastIndexOf(\"{\", at);\n\t\tconst close = content.indexOf(\"}\", at);\n\t\tconst wrappedCall = content.lastIndexOf(wrappedJsxCall, open);\n\t\tconst call = Math.max(content.lastIndexOf(jsxCall, open), wrappedCall);\n\t\tconst component = content.slice(call + (call === wrappedCall ? wrappedJsxCall : jsxCall).length, open - 1);\n\t\tif (!(open > 0 && close !== -1 && call > 0 && content[open - 1] === \",\" && component !== \"\" && !component.includes(\",\") && !content.slice(open, at).includes(\"}\")) || !/\\w/u.test(content.charAt(call - 1))) continue;\n\t\tconst props = content.slice(at, close);\n\t\tconst children = childrenRegex.exec(props);\n\t\tif (children && !/[{`]/u.test(props.slice(attribute.length, children.index))) return replaceValue(content, at, {\n\t\t\tindices: children.indices,\n\t\t\tmark\n\t\t}) ?? content;\n\t\tconst end = at + attribute.length;\n\t\treturn `${content.slice(0, end)},children:\"${mark}\"${content.slice(end)}`;\n\t}\n\treturn content;\n}\n/**\n* Inject a mark in a string at a specific placeholder locations like\n* `__placeholder__` or `<div id=\"placeholder\">...</div>` or `<meta name=\"placeholder\" content=\"...\" />`\n* @param content the string to inject the mark in\n* @param placeholder the placeholder to replace\n* @param mark the mark to inject\n* @returns the new string with the mark injected\n*/\nfunction injectMark(content, placeholder, mark) {\n\tif (!content.includes(placeholder)) return content;\n\treturn injectInJsx(injectInJsx(injectInMeta(injectInElement(content.replaceAll(`__${placeholder}__`, () => mark).replaceAll(new RegExp(`{{2} ?${escapePlaceholder(placeholder)} ?}{2}`, \"g\"), () => mark), `id=\"${placeholder}\"`, mark), `name=\"${placeholder}\"`, mark), `id:\"${placeholder}\"`, mark), `id:\\`${placeholder}\\``, mark);\n}\n/**\n* Count the placeholder-shaped usages in a string, the ones injectMark replaces and the near ones it does not, like a single quoted id\n* @param content the string to look into\n* @param placeholder the placeholder to count\n* @returns the number of placeholder-shaped usages, the bare placeholder word and a css selector like `[name=\"placeholder\"]` do not count\n* @example countPlaceholders('<span id=\"app-mark\"></span> __app-mark__', 'app-mark') // 2\n*/\nfunction countPlaceholders(content, placeholder) {\n\tif (!content.includes(placeholder)) return 0;\n\tconst name = escapePlaceholder(placeholder);\n\treturn content.match(new RegExp(`__${name}__|\\\\{{2} ?${name} ?\\\\}{2}|(?<=\\\\s)(?:id|name) ?= ?[\"'\\`]${name}[\"'\\`]|(?:id|name) ?: ?[\"'\\`]${name}[\"'\\`]`, \"gu\"))?.length ?? 0;\n}\n\n//#endregion\n//#region src/lib/string-template.ts\n/**\n* Fill mustaches in a given string\n* @param template The input string, like \"Hello {{ name }} !\".\n* @param data The input object, like { name: \"world\" }.\n* @returns The filled string, e.g. \"Hello world !\"\n*/\nfunction fillTemplate(template, data) {\n\tlet string = typeof template === \"object\" ? JSON.stringify(template, void 0, 2) : template;\n\tif (data === void 0) return string;\n\tif (string.length === 0) return string;\n\tconst flatData = flatten(data);\n\tfor (const [key, value] of Object.entries(flatData)) {\n\t\tconst regex = new RegExp(`(/?\\\\*?{{?\\\\s*${key}\\\\s*}?}\\\\*?/?)`, \"g\");\n\t\tstring = string.replaceAll(regex, String(value));\n\t}\n\treturn string;\n}\n\n//#endregion\n//#region src/lib/system.ts\n/**\n* Convert to Unix path\n* @param  filepath the file path to normalize\n* @returns  The Unix path\n*/\nfunction toUnixPath(filepath) {\n\treturn filepath.replaceAll(/\\\\+/giu, \"/\");\n}\n\n//#endregion\n//#region src/lib/testing-align-for-snap.ts\n/**\n* Clean dynamic data from a string\n* @param text the string to clean\n* @returns the cleaned string\n*/\nfunction clean(text) {\n\treturn text.replaceAll(/\\d{2}\\/\\d{2}\\/\\d{4} \\d{2}:\\d{2}:\\d{2}/gu, \"xx/xx/xxxx xx:xx:xx\").replaceAll(/\\d{1,2}\\/\\d{1,2}\\/\\d{4}, \\d{1,2}:\\d{2}:\\d{2} [ap]m/giu, \"xx/xx/xxxx xx:xx:xx\").replaceAll(/\\d{4}-\\d{2}-\\d{2}(?<separator>[T ])\\d{2}:\\d{2}:\\d{2}(?<milliseconds>\\.\\d{3}Z)?/gu, (_match, separator, milliseconds) => `xxxx-xx-xx${separator}xx:xx:xx${milliseconds === void 0 ? \"\" : \".xxxZ\"}`).replaceAll(/\\\\+(?<letter>[^\"])/gu, \"/$<letter>\");\n}\n/**\n* Align & clean dynamic data & operating system related stuff that can mess-up the snaps\n* @param content the string to clean\n* @returns the content aligned for snapshots\n* @example alignForSnap('Lu et approuvé le 16/05/2024 17:36:32') // => 'Lu et approuvé le xx/xx/xxxx xx:xx:xx'\n* @example alignForSnap({ value: '\\\\documents\\\\my-file.pdf' }) // => '{ \"value\": \"/documents/my-file.pdf\" }'\n*/\nfunction alignForSnap(content) {\n\tif (typeof content === \"string\") return clean(content);\n\tif (content === null || content === void 0) return String(content);\n\tif (typeof content === \"object\" && \"textContent\" in content) return clean(String(content.textContent));\n\tif (Array.isArray(content) || typeof NodeList !== \"undefined\" && content instanceof NodeList || typeof HTMLCollection !== \"undefined\" && content instanceof HTMLCollection) return Array.from(content).map((item) => alignForSnap(item)).join(\" | \");\n\treturn clean(JSON.stringify(content, void 0, 2));\n}\n\n//#endregion\n//#region src/lib/throttle.ts\n/**\n* Returns a throttled function that will be called at most once every `timeout` milliseconds.\n* @copyright inspired from https://www.matthewgerstman.com/tech/throttle-and-debounce\n* @param callback the function to throttle\n* @param timeout the time to wait before each function call\n* @returns a throttled function\n*/\nfunction throttle(callback, timeout) {\n\tlet isReady = true;\n\treturn (...arguments_) => {\n\t\tif (!isReady) return;\n\t\tisReady = false;\n\t\tcallback(...arguments_);\n\t\tsetTimeout(() => {\n\t\t\tisReady = true;\n\t\t}, timeout);\n\t};\n}\n\n//#endregion\n//#region src/lib/timestamps.ts\n/**\n* Give timestamp of a date or now in seconds\n* @param date input date\n* @returns number like : 1541258097\n*/\nfunction getTimestamp(date = /* @__PURE__ */ new Date()) {\n\treturn Math.round(date.getTime() / nbMsInSecond);\n}\n/**\n* Give timestamp of a date or now in milliseconds\n* @param date input date\n* @returns number like : 1541258116567\n*/\nfunction getTimestampMs(date = /* @__PURE__ */ new Date()) {\n\treturn date.getTime();\n}\n\n//#endregion\n//#region src/lib/translate.ts\nconst handledLangs = [\"en\", \"fr\"];\nconst defaultLang = \"en\";\nconst langRegex = /^\\/(?<lang>en|fr)\\//u;\n/**\n* Get the language from the path\n* @param path the path to get the language from, like \"/en/contact\"\n* @returns the language, like \"en\"\n*/\nfunction getLangFromPath(path) {\n\treturn (langRegex.exec(path)?.groups?.lang ?? defaultLang) === \"fr\" ? \"fr\" : defaultLang;\n}\n/**\n* Handle pluralization\n* @param translated the translated string, like \"1 item | {count} items\"\n* @param data the data to fill the template, like { count: 3 }\n* @returns the translated string, like \"3 items\"\n*/\nfunction handlePlural(translated, data) {\n\tif (!translated.includes(\"|\")) return fillTemplate(translated, data);\n\tconst rawCount = data?.count ?? 1;\n\tconst count = typeof rawCount === \"number\" ? rawCount : Number(rawCount);\n\tconst [partA = \"\", partB = \"\", partC = \"\"] = translated.split(\" | \");\n\tif (partC.length > 0 && count > 1) return fillTemplate(partC, data);\n\tif (partC.length > 0 && count === 1 || partB.length > 0 && count > 1) return fillTemplate(partB, data);\n\treturn fillTemplate(partA, data);\n}\n/**\n* Translate a message\n* @param lang the language to translate to, like \"en\" or \"fr\"\n* @param message the message to translate, like \"hello world\" or { en: \"hello {name}\", fr: \"bonjour {name}\" }\n* @param data the data to fill the template, like { name: \"world\" }\n* @returns the translated message, like \"hello world\" or \"bonjour world\"\n*/\nfunction translate(lang, message, data) {\n\tconst translated = typeof message === \"string\" ? message : message[lang];\n\tif (translated === void 0) return `missing translation for message \"${JSON.stringify(message)}\" and lang \"${lang}\"`;\n\treturn handlePlural(translated, data);\n}\n/**\n* Translate a path\n* @param path the path to translate, like \"/en/contact\"\n* @param targetLang the target language to translate to, like \"fr\"\n* @returns the translated path, like \"/fr/contact\"\n*/\nfunction localePath(path, targetLang = defaultLang) {\n\tif (!handledLangs.includes(targetLang)) return Result.error(`unsupported lang \"${targetLang}\", cannot translate path \"${path}\"`);\n\treturn Result.ok(getPath(path, targetLang === defaultLang ? \"\" : targetLang));\n}\n/**\n* Get a translator\n* @param lang the language to translate to, like \"en\" or \"fr\"\n* @returns the translator function\n* @example const $t = getTranslator('en')\n*/\nfunction getTranslator(lang) {\n\treturn (message, data) => translate(lang, message, data);\n}\n\n//#endregion\n//#region src/lib/url.ts\n/**\n* Encode a string to base64\n* @param str String to encode\n* @returns Base64 encoded string\n*/\nfunction toBase64(str) {\n\treturn globalThis.btoa(encodeURIComponent(str).replaceAll(/%(?<hex>[0-9A-F]{2})/g, (_value, hex) => String.fromCodePoint(Number.parseInt(hex, 16))));\n}\n/**\n* Convert a base64 character to percent-encoded string for URI decoding\n* @param char Single character from base64-decoded string\n* @returns Percent-encoded string\n*/\nfunction base64CharToPercentEncoded(char) {\n\treturn `%${(char.codePointAt(0) ?? 0).toString(16).padStart(2, \"0\")}`;\n}\n/**\n* Decode a base64 encoded string\n* @param b64 Base64 encoded string\n* @returns Decoded string\n*/\nfunction fromBase64(b64) {\n\tconst result = Result.trySafe(() => decodeURIComponent(Array.from(globalThis.atob(b64)).map((char) => base64CharToPercentEncoded(char)).join(\"\")));\n\treturn result.ok ? result.value : \"\";\n}\n/**\n* Encode data to be safely included in a URL for example as a query parameter or as storage\n* @param data Data to encode\n* @returns Encoded data\n*/\nfunction encodeForUrl(data) {\n\treturn encodeURIComponent(toBase64(JSON.stringify(data)));\n}\n/**\n* Decode data from a URL\n* @param str Encoded data found in a URL\n* @returns Decoded data or empty string if decoding or parsing failed\n*/\nfunction decodeFromUrl(str) {\n\tconst decoded = fromBase64(decodeURIComponent(str));\n\tconst result = parseJson(decoded);\n\treturn result.ok ? result.value : \"\";\n}\n\n//#endregion\nexport { Logger, Result, addColorCode, alignForSnap, arrayAlign, arraySort, arrayUnique, backdrop, base64CharToPercentEncoded, base64Regex, base64ToFile, base64TypeRegex, bgBlack, bgBlue, bgCyan, bgGray, bgGreen, bgMagenta, bgRed, bgWhite, bgYellow, black, blue, bold, browserContext, browserReport, buildIsoFromLocal, byProperty, camelToKebabCase, capNesting, capitalize, clone, consoleLog, copyToClipboard, countPlaceholders, crc32, createAnalytics, createAsyncStorage, createCrc32Table, createInMemoryDriver, createState, css, cyan, dateIso10, dateIsoStripSecondsZone, dateIsoToReadableDatetime, dateToIsoString, daysAgo, daysAgoIso10, daysFromNow, debounce, decodeFromUrl, dim, div, dom, downloadFile, ellipsis, ellipsisWords, em, emit, encodeForUrl, fetchJson, fetchRaw, fileToBase64, fillLikeHuman, fillTemplate, findAll, findOne, flatten, formatDate, fromBase64, functionReturningUndefined, functionReturningVoid, getBrowser, getCookieValueByName, getLangFromPath, getNested, getOperatingSystem, getPage, getPath, getTimestamp, getTimestampMs, getTranslator, getUserAgent, getVersion, gray, green, h1, h2, h3, handlePlural, hasOption, hasOwn, hexToHsl, hexToRgb, htmlTagRegex, icon, img, injectMark, injectStyles, insertValueAfterItem, invariant, inverse, isBase64, isBrowserEnvironment, isDeployedInDevNamespace, isDevEnvironment, isFirefox, isHtml, isJson, isMobile, isNil, isObjectEmpty, isRecord, isString, isTestEnvironment, isValidDate, isVerbose, italic, kebabToPascalCase, li, link, localStorageDriver, localePath, magenta, memoize, nbAfter, nbAscending, nbBackward, nbBefore, nbDaysInMonth, nbDaysInWeek, nbDaysInYear, nbDescending, nbEighth, nbEven, nbFifth, nbFirst, nbFiveSixths, nbForward, nbFourth, nbHoursInDay, nbHslMin, nbHueMax, nbHueStep, nbLast, nbLightnessMax, nbLongHex, nbMinutesInHour, nbMsInDay, nbMsInHour, nbMsInMinute, nbMsInMonth, nbMsInSecond, nbMsInWeek, nbMsInYear, nbNext, nbNinth, nbNoIndex, nbNone, nbOdd, nbOneHalf, nbOneQuarter, nbOneSixth, nbOneThird, nbPercentMax, nbPercentMin, nbPixel2Xl, nbPixelLg, nbPixelMd, nbPixelSm, nbPixelXl, nbPixelXs, nbPrevious, nbRgbMax, nbRgbMin, nbSaturationMax, nbSecond, nbSecondsInHour, nbSecondsInMinute, nbSeventh, nbShortHex, nbSixth, nbSpacesIndent, nbTenth, nbThird, nbThreeQuarters, nbTwoThirds, objectDeserialize, objectEqual, objectSerialize, objectSort, objectSum, off, on, onPageChange, overline, parseAsUTC, parseBase64, parseJson, pickOne, randomBoolean, randomEmail, randomNumber, randomPerson, randomString, rangedScore, readClipboard, readableTime, readableTimeAgo, red, removeAccents, removeValueFromArray, reset, round, safeAssign, sanitize, scrollToElement, scrollToHeightSync, setNested, shuffleArray, sleep, slugify, small, storage, strikeThrough, stringSum, stringify, strong, text, throttle, toBase64, toUnixPath, toastError, toastInfo, toastSuccess, translate, tw, ul, underline, waitToDetect, white, yellow };"]}