@feedmepos/mf-connect 0.1.0-beta.33 → 0.1.0-beta.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/{Analytic-COFvmYc_.js → Analytic-DYfm1eg5.js} +24 -23
  2. package/dist/{App-Di7kbEH7.js → App-DV85I2xq.js} +6 -6
  3. package/dist/{Broadcast-CAku3lNW.js → Broadcast-CNpwvxRx.js} +8 -8
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B1Ozu6-2.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Bv8Ki3vl.js} +7 -7
  5. package/dist/{Card-CcRmp6aK.js → Card-Bk4hfK9U.js} +15 -15
  6. package/dist/{Collections-BRLR37TF.js → Collections-CrND62Vz.js} +4 -4
  7. package/dist/{Credit-BEViCbtH.js → Credit-ICo98p8n.js} +8 -8
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DDSSHrcX.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-LFtf2JM3.js} +27 -26
  9. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CGBjH5AK.js → EffectSheet.vue_vue_type_style_index_0_lang-CdVIbAT3.js} +6 -6
  10. package/dist/{Experience-BL71InUh.js → Experience-BqMJUymq.js} +8 -8
  11. package/dist/{Game-vmhBTg3f.js → Game-DvjisU7I.js} +8 -8
  12. package/dist/{Index-DGkT3yms.js → Index-Vbv5hpsB.js} +9 -9
  13. package/dist/{Marketing-BCqFnOrR.js → Marketing-CU6GUm2L.js} +5 -5
  14. package/dist/{Member-C7uOPBUa.js → Member-Dcyb6og-.js} +4 -4
  15. package/dist/{MemberList-CaY2SRSx.js → MemberList-CBO6SVE-.js} +14 -14
  16. package/dist/{MemberTransactions-v2sui0Sy.js → MemberTransactions-BuPoUtjA.js} +1 -1
  17. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-za7Jz9uG.js → MessageInput.vue_vue_type_script_setup_true_lang-B_q37PEs.js} +2 -2
  18. package/dist/{Mission-DZG8d3vM.js → Mission-_Vi8gaKQ.js} +8 -8
  19. package/dist/{Overview-egVspSvq.js → Overview-8ZkvZh2U.js} +370 -346
  20. package/dist/{Point-DW_SHWMs.js → Point-BqmJ8ak3.js} +8 -8
  21. package/dist/{Promotion-C8tygVa7.js → Promotion-CDOtfUpE.js} +9 -9
  22. package/dist/{Record-D7XgEVn_.js → Record-NUadzYL2.js} +5 -5
  23. package/dist/Reward-CgRFzQHO.js +432 -0
  24. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Dyj14jcj.js → RewardGroup.vue_vue_type_script_setup_true_lang-Cg5cJLSS.js} +11 -11
  25. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Cmv-8YZd.js → RuleGroup.vue_vue_type_script_setup_true_lang-Bac_RiwJ.js} +13 -13
  26. package/dist/{Segment-DAYnubHq.js → Segment-bHLt_9xi.js} +13 -13
  27. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BviSuL4I.js → SelectItems.vue_vue_type_script_setup_true_lang-DWulr5sA.js} +2 -2
  28. package/dist/{Setting-Dd-PlldV.js → Setting-AQjJ0LBm.js} +8 -8
  29. package/dist/{Store-DmBeTkdi.js → Store-DzGhYzS9.js} +46 -46
  30. package/dist/{StoreRewards-VrmRII1r.js → StoreRewards-BN33UZrN.js} +12 -12
  31. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Bx1AwHhj.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CF7R6Mbf.js} +17 -17
  32. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DanZYVUH.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-C3wxmJBS.js} +1 -1
  33. package/dist/{Tier-h5t-OofQ.js → Tier-BaIm0-nO.js} +19 -19
  34. package/dist/{Title-BIGAZzv4.js → Title-CGU2TRSf.js} +19 -19
  35. package/dist/{Transaction-WfW0gCVl.js → Transaction-DA2CK2a4.js} +2 -2
  36. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-KB8LAOv_.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DSVVsk_u.js} +6 -6
  37. package/dist/{Voucher-CzA0AnCo.js → Voucher-Bzh_fJpa.js} +11 -11
  38. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BbYPy9pR.js → VoucherEditor.vue_vue_type_script_setup_true_lang-Bflyp1V0.js} +10 -10
  39. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BPHAIlP5.js → ZodTextField.vue_vue_type_script_setup_true_lang-Wh_Pc7qk.js} +1 -1
  40. package/dist/{app-BhP-DVoF.js → app-CBijF7l9.js} +1 -1
  41. package/dist/{app-C2GiWW62.js → app-Ceasya0M.js} +28 -28
  42. package/dist/app.js +1 -1
  43. package/dist/{business-BjQMXRkL.js → business-BJ-cyfj6.js} +1 -1
  44. package/dist/{campaign-tqh1zOQn.js → campaign-B5Cvxv_n.js} +2 -2
  45. package/dist/campaign.enum-CwvY4pwh.js +20 -0
  46. package/dist/campaign.fn-CWcwUEiZ.js +758 -0
  47. package/dist/{collectible.enum-904x3SQw.js → collectible.enum-COdcR96r.js} +1 -1
  48. package/dist/{collection.fn-B1wW3tQk.js → collection.fn-BTQbGCVW.js} +2 -2
  49. package/dist/dto-BnknKYcg.js +2018 -0
  50. package/dist/{effect-DlIXzIWd.js → effect-DqWwcDoL.js} +1 -1
  51. package/dist/{email-addresses-bquAp7UR.js → email-addresses-DPPlvfPT.js} +1 -1
  52. package/dist/{export-9ZU9HjO9.js → export-FXBFFRdK.js} +3 -3
  53. package/dist/{helper-D0S39he1.js → helper-C776lUH-.js} +1 -1
  54. package/dist/{index-DTsmbmOR.js → index-BG5txN30.js} +3 -3
  55. package/dist/{index-D4QKa9x3.js → index-BjAdYoh3.js} +7 -7
  56. package/dist/{index-BoJwjzpx.js → index-C1aWGTdZ.js} +1 -1
  57. package/dist/{index-kkystjJw.js → index-CRlD2sul.js} +3 -3
  58. package/dist/{index-Dszb1Xy-.js → index-CZaQ-veW.js} +1 -1
  59. package/dist/{index-DN5WVCu6.js → index-Cgaj4reE.js} +1 -1
  60. package/dist/{index-BwDwKkyV.js → index-CpD4ezv2.js} +1 -1
  61. package/dist/{index-DF3fzy-k.js → index-CxU9mwRl.js} +1 -1
  62. package/dist/{index-DNa1m2cM.js → index-D62SBn2q.js} +3 -3
  63. package/dist/{index-DnGzf-f8.js → index-DeMgVwv8.js} +2 -2
  64. package/dist/{index-B6SrZyMF.js → index-Dw1WniG7.js} +206 -222
  65. package/dist/{index-l_74COL_.js → index-I27oHD1a.js} +1 -1
  66. package/dist/{index.esm2017-CNuwLU2a.js → index.esm2017-Cf8UXsST.js} +1 -1
  67. package/dist/{loading-CiI8Y9Fj.js → loading-DCSdIZqP.js} +4 -4
  68. package/dist/{membership-CPNrhOk0.js → membership-KiKcnWxt.js} +4 -4
  69. package/dist/{money-DnAxVjb7.js → money-B_LMR19r.js} +1 -1
  70. package/dist/{number-B5VKL1Yu.js → number-Bk18T5Xb.js} +1 -1
  71. package/dist/{objectid-C-IOC4JL.js → objectid-CZ5qnZ1J.js} +5 -5
  72. package/dist/{reward-D4RyiYb6.js → reward-ozVC4wTW.js} +1 -1
  73. package/dist/{rule-DVMHVRWb.js → rule-CWT8hI3A.js} +3 -3
  74. package/dist/{rule-builder-CFUNraRE.js → rule-builder-DTEvWEjJ.js} +1 -1
  75. package/dist/{template-OBoSoTcO.js → template-9N1FRXDZ.js} +4 -4
  76. package/dist/{trigger-R6mF8LNa.js → trigger-C2-zYC46.js} +4 -4
  77. package/dist/{user-BGP1BTAw.js → user-DBxVxr4P.js} +1 -1
  78. package/dist/{vue-i18n-_ooGZZRG.js → vue-i18n-BK0qKZu-.js} +357 -357
  79. package/dist/{xlsx-ByJGlrKD.js → xlsx-CmKV4f40.js} +1 -1
  80. package/package.json +1 -1
  81. package/dist/Reward-DqP89Pqb.js +0 -413
  82. package/dist/dto-C9SOa-xs.js +0 -2770
@@ -1,2770 +0,0 @@
1
- import { h as te } from "./moment-BWErdI6_.js";
2
- import { h as B, i as Wt, a as J, j as Yt } from "./index-B6SrZyMF.js";
3
- import { e as ve } from "./effect-DlIXzIWd.js";
4
- import { components as je } from "@feedmepos/ui-library";
5
- import { i as Be, R as Ve } from "./rule-builder-CFUNraRE.js";
6
- import { c as Jt } from "./rule-DVMHVRWb.js";
7
- import { u as qt } from "./business-BjQMXRkL.js";
8
- import { s as Zt } from "./index-Dbd4WA4r.js";
9
- import { c as tt, F as V, z as P } from "./loading-CiI8Y9Fj.js";
10
- import { e as Qt, Z as D, a as st, i as Ft, z as es } from "./app-C2GiWW62.js";
11
- import { createFeedMeI18n as ts, detectLocale as Ke } from "@feedmepos/mf-common";
12
- import { h as ce } from "vue";
13
- import { F as xe } from "./index-DnGzf-f8.js";
14
- var Me = { exports: {} };
15
- const ss = "2.0.0", jt = 256, rs = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
16
- 9007199254740991, ns = 16, is = jt - 6, as = [
17
- "major",
18
- "premajor",
19
- "minor",
20
- "preminor",
21
- "patch",
22
- "prepatch",
23
- "prerelease"
24
- ];
25
- var $e = {
26
- MAX_LENGTH: jt,
27
- MAX_SAFE_COMPONENT_LENGTH: ns,
28
- MAX_SAFE_BUILD_LENGTH: is,
29
- MAX_SAFE_INTEGER: rs,
30
- RELEASE_TYPES: as,
31
- SEMVER_SPEC_VERSION: ss,
32
- FLAG_INCLUDE_PRERELEASE: 1,
33
- FLAG_LOOSE: 2
34
- }, fe = { env: { GITHUB_STATE: "/home/runner/work/_temp/_runner_file_commands/save_state_6da6c803-a51f-40dc-a0f4-a0dcc00ecf91", npm_package_dependencies_zod: "3.22.4", npm_package_devDependencies__types_node: "^18.19.41", STATS_TRP: "true", DEPLOYMENT_BASEPATH: "/opt/runner", DOTNET_NOLOGO: "1", npm_package_dependencies__feedmepos_remy_vue_client: "0.2.0-beta.14", npm_package_dependencies_pinia: "^2.1.7", npm_package_dependencies_vite_plugin_vue_devtools: "^7.6.4", USER: "runner", npm_config_user_agent: "pnpm/9.15.9 npm/? node/v20.19.0 linux x64", CI: "true", npm_package_dependencies_vue: "^3.4.33", RUNNER_ENVIRONMENT: "github-hosted", GITHUB_ENV: "/home/runner/work/_temp/_runner_file_commands/set_env_6da6c803-a51f-40dc-a0f4-a0dcc00ecf91", PIPX_HOME: "/opt/pipx", npm_package_devDependencies_vite: "^5.3.4", npm_node_execpath: "/opt/hostedtoolcache/node/20.19.0/x64/bin/node", JAVA_HOME_8_X64: "/usr/lib/jvm/temurin-8-jdk-amd64", SHLVL: "1", npm_package_files_0: "dist", HOME: "/home/runner", RUNNER_TEMP: "/home/runner/work/_temp", GITHUB_EVENT_PATH: "/home/runner/work/_temp/_github_workflow/event.json", npm_package_scripts_build_mf_dev: "vite build --mode fmmf", npm_package_dependencies__types_qrcode: "^1.5.5", JAVA_HOME_11_X64: "/usr/lib/jvm/temurin-11-jdk-amd64", PIPX_BIN_DIR: "/opt/pipx_bin", GITHUB_REPOSITORY_OWNER: "feedmepos", npm_package_scripts_build_mf_prod: "vite build --mode fmmf:prod", npm_package_dependencies_change_case: "^5.4.4", NODE_OPTIONS: "--max-old-space-size=8096", GRADLE_HOME: "/usr/share/gradle-8.13", ANDROID_NDK_LATEST_HOME: "/usr/local/lib/android/sdk/ndk/28.1.13356709", JAVA_HOME_21_X64: "/usr/lib/jvm/temurin-21-jdk-amd64", STATS_RDCL: "true", GITHUB_RETENTION_DAYS: "90", npm_package_dependencies__feedmepos_mf_common: "1.12.5", npm_package_dependencies_fabric: "^5.5.1", npm_package_dependencies_zod_i18n_map: "2.27.0", GITHUB_REPOSITORY_OWNER_ID: "54831515", POWERSHELL_DISTRIBUTION_CHANNEL: "GitHub-Actions-ubuntu24", AZURE_EXTENSION_DIR: "/opt/az/azcliextensions", GITHUB_HEAD_REF: "", SYSTEMD_EXEC_PID: "720", npm_package_dependencies__feedmepos_ui_library: "1.5.5", npm_package_dependencies_dayjs: "^1.11.12", npm_package_dependencies_dotenv: "^16.4.5", npm_package_dependencies_moment: "^2.30.1", GITHUB_GRAPHQL_URL: "https://api.github.com/graphql", npm_package_scripts_build_only_dev: "pnpm build:mf:dev", npm_package_dependencies_i18next: "24.2.1", npm_package_devDependencies_tailwindcss: "^3.4.6", npm_package_devDependencies_typescript: "^5.5.3", NVM_DIR: "/home/runner/.nvm", npm_package_scripts_build_dev: "cross-env NODE_OPTIONS=--max-old-space-size=4096 vite build --mode development", npm_package_scripts_build_only_prod: "pnpm build:mf:prod", npm_package_dependencies_xlsx: "^0.18.5", npm_package_devDependencies_vue_tsc: "^2.0.26", DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1", GOROOT_1_21_X64: "/opt/hostedtoolcache/go/1.21.13/x64", JAVA_HOME_17_X64: "/usr/lib/jvm/temurin-17-jdk-amd64", ImageVersion: "20250420.1.0", npm_package_scripts_dev: "vite", npm_package_scripts_build_prod: "cross-env NODE_OPTIONS=--max-old-space-size=4096 vite build --mode production", npm_package_dependencies_unplugin_auto_import: "^0.17.8", RUNNER_OS: "Linux", GITHUB_API_URL: "https://api.github.com", GOROOT_1_22_X64: "/opt/hostedtoolcache/go/1.22.12/x64", STORE_PATH: "/home/runner/setup-pnpm/node_modules/.bin/store/v3", SWIFT_PATH: "/usr/share/swift/usr/bin", npm_package_type: "module", RUNNER_USER: "runner", STATS_V3PS: "true", CHROMEWEBDRIVER: "/usr/local/share/chromedriver-linux64", GOROOT_1_23_X64: "/opt/hostedtoolcache/go/1.23.8/x64", JOURNAL_STREAM: "9:6279", GITHUB_WORKFLOW: "Publish mf-connect - dev", _: "/home/runner/setup-pnpm/node_modules/.bin/pnpm", npm_package_module: "./dist/app.js", npm_package_devDependencies_autoprefixer: "^10.4.19", MEMORY_PRESSURE_WATCH: "/sys/fs/cgroup/system.slice/runner-provisioner.service/memory.pressure", npm_package_devDependencies__types_uuid: "^9.0.8", npm_package_devDependencies_unlayer_types: "^1.157.0", npm_config_registry: "https://registry.npmjs.org/", ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE: "/opt/actionarchivecache", STATS_D: "false", GITHUB_RUN_ID: "14703739292", STATS_VMFE: "true", npm_package_dependencies_bson_objectid: "^2.0.4", npm_package_devDependencies__types_lodash: "^4.17.7", GITHUB_REF_TYPE: "branch", BOOTSTRAP_HASKELL_NONINTERACTIVE: "1", GITHUB_WORKFLOW_SHA: "a4a4fb6b86e2c83f2e84f679435a080f2aedfd42", GITHUB_BASE_REF: "", ImageOS: "ubuntu24", npm_package_exports___import: "./dist/app.js", npm_package_devDependencies__vitejs_plugin_vue: "^5.0.5", GITHUB_WORKFLOW_REF: "feedmepos/marketing-services/.github/workflows/[DEV] publish-mf-connect.yml@refs/heads/dev", PERFLOG_LOCATION_SETTING: "RUNNER_PERFLOG", GITHUB_ACTION_REPOSITORY: "", npm_package_dependencies_axios: "^1.7.2", npm_config_node_gyp: "/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.15.9/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js", PATH: "/home/runner/work/marketing-services/marketing-services/packages/connect/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.15.9/node_modules/pnpm/dist/node-gyp-bin:/home/runner/work/marketing-services/marketing-services/packages/connect/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.15.9/node_modules/pnpm/dist/node-gyp-bin:/home/runner/setup-pnpm/node_modules/.bin:/opt/hostedtoolcache/node/20.19.0/x64/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin", ANT_HOME: "/usr/share/ant", DOTNET_MULTILEVEL_LOOKUP: "0", RUNNER_TRACKING_ID: "github_5e8e7e75-0570-490e-b528-d073f2f5a4d4", INVOCATION_ID: "c49e14ed69524bf1aeb2d1b63440e3e4", RUNNER_TOOL_CACHE: "/opt/hostedtoolcache", NODE: "/opt/hostedtoolcache/node/20.19.0/x64/bin/node", npm_package_name: "@feedmepos/mf-connect", npm_package_scripts_deploy_dev: "pnpm run build-only:dev && pnpm publish --no-git-checks .", npm_package_dependencies_cross_env: "^7.0.3", GITHUB_ACTION: "__run_5", GITHUB_RUN_NUMBER: "95", GITHUB_TRIGGERING_ACTOR: "qaijunse", RUNNER_ARCH: "X64", XDG_RUNTIME_DIR: "/run/user/1001", AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache", npm_package_scripts_deploy_prod: "pnpm run build-only:prod && pnpm publish --no-git-checks .", npm_config_frozen_lockfile: "", LANG: "C.UTF-8", VCPKG_INSTALLATION_ROOT: "/usr/local/share/vcpkg", npm_package_dependencies__feedmepos_mf_core_ui: "1.0.18", CONDA: "/usr/share/miniconda", RUNNER_NAME: "GitHub Actions 444", XDG_CONFIG_HOME: "/home/runner/.config", STATS_VMD: "true", GITHUB_REF_NAME: "dev", GITHUB_REPOSITORY: "feedmepos/marketing-services", STATS_D_D: "false", npm_package_scripts_build_dts: "vue-tsc --declaration --noEmit false --emitDeclarationOnly -p tsconfig.json --outDir ./dist && mv ./dist/src/* dist", npm_package_scripts_build_types: "vue-tsc --declaration --emitDeclarationOnly -p tsconfig.json --outDir dist --composite false", npm_package_dependencies__feedmepos_core: "^2.14.9", npm_lifecycle_script: "vite build --mode fmmf", STATS_UE: "true", ANDROID_NDK_ROOT: "/usr/local/lib/android/sdk/ndk/27.2.12479018", GITHUB_ACTION_REF: "", DEBIAN_FRONTEND: "noninteractive", npm_package_dependencies_rrule: "^2.8.1", npm_package_dependencies_vue3_lottie: "^3.3.0", GITHUB_REPOSITORY_ID: "615151795", GITHUB_ACTIONS: "true", STATS_PIP: "false", NODE_PATH: "/home/runner/work/marketing-services/marketing-services/packages/connect/node_modules/.pnpm/vite@5.3.4_@types+node@18.19.41/node_modules/vite/bin/node_modules:/home/runner/work/marketing-services/marketing-services/packages/connect/node_modules/.pnpm/vite@5.3.4_@types+node@18.19.41/node_modules/vite/node_modules:/home/runner/work/marketing-services/marketing-services/packages/connect/node_modules/.pnpm/vite@5.3.4_@types+node@18.19.41/node_modules:/home/runner/work/marketing-services/marketing-services/packages/connect/node_modules/.pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.15.9/node_modules/pnpm/bin/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.15.9/node_modules/pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.15.9/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.15.9/node_modules/pnpm/bin/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.15.9/node_modules/pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.15.9/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/node_modules", npm_package_version: "0.1.0-beta.33", npm_lifecycle_event: "build:mf:dev", GITHUB_REF_PROTECTED: "false", npm_package_scripts_build: "vue-tsc && vite build", npm_package_dependencies_uuid: "^10.0.0", npm_package_dependencies_vue_i18n: "10.0.5", GITHUB_WORKSPACE: "/home/runner/work/marketing-services/marketing-services", ACCEPT_EULA: "Y", GITHUB_JOB: "deploy", RUNNER_PERFLOG: "/home/runner/perflog", npm_package_dependencies_lodash: "^4.17.21", GITHUB_SHA: "a4a4fb6b86e2c83f2e84f679435a080f2aedfd42", GITHUB_RUN_ATTEMPT: "1", STATS_D_TC: "true", npm_package_exports___style: "./dist/style.css", npm_package_dependencies_vue_router: "^4.4.0", GITHUB_REF: "refs/heads/dev", GITHUB_ACTOR: "qaijunse", ANDROID_SDK_ROOT: "/usr/local/lib/android/sdk", npm_package_license: "UNLICENSED", npm_package_dependencies_email_addresses: "^5.0.0", npm_package_dependencies_firebase: "^10.12.4", npm_package_dependencies_qrcode: "^1.5.3", GITHUB_PATH: "/home/runner/work/_temp/_runner_file_commands/add_path_6da6c803-a51f-40dc-a0f4-a0dcc00ecf91", JAVA_HOME: "/usr/lib/jvm/temurin-17-jdk-amd64", PWD: "/home/runner/work/marketing-services/marketing-services/packages/connect", GITHUB_ACTOR_ID: "39590157", RUNNER_WORKSPACE: "/home/runner/work/marketing-services", npm_execpath: "/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.15.9/node_modules/pnpm/bin/pnpm.cjs", HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS: "3650", STATS_TIS: "mining", GITHUB_EVENT_NAME: "workflow_dispatch", HOMEBREW_NO_AUTO_UPDATE: "1", ANDROID_HOME: "/usr/local/lib/android/sdk", GITHUB_SERVER_URL: "https://github.com", GECKOWEBDRIVER: "/usr/local/share/gecko_driver", GHCUP_INSTALL_BASE_PREFIX: "/usr/local", GITHUB_OUTPUT: "/home/runner/work/_temp/_runner_file_commands/set_output_6da6c803-a51f-40dc-a0f4-a0dcc00ecf91", npm_package_exports___types: "./dist/packages/connect/src/app.d.ts", EDGEWEBDRIVER: "/usr/local/share/edge_driver", STATS_EXT: "true", PNPM_SCRIPT_SRC_DIR: "/home/runner/work/marketing-services/marketing-services/packages/connect", npm_package_devDependencies_postcss: "^8.4.39", npm_command: "run-script", ANDROID_NDK: "/usr/local/lib/android/sdk/ndk/27.2.12479018", SGX_AESM_ADDR: "1", CHROME_BIN: "/usr/bin/google-chrome", npm_package_scripts_preview: "vite preview", SELENIUM_JAR_PATH: "/usr/share/java/selenium-server.jar", MEMORY_PRESSURE_WRITE: "c29tZSAyMDAwMDAgMjAwMDAwMAA=", PNPM_HOME: "/home/runner/setup-pnpm/node_modules/.bin", STATS_EXTP: "https://provjobdprod.z13.web.core.windows.net/settings/provjobdsettings-latest/provjobd.data", npm_package_pnpm_overrides__feedmepos_mf_common: "1.15.0-beta.6", npm_package_dependencies__feedmepos_menu: "1.0.34", ANDROID_NDK_HOME: "/usr/local/lib/android/sdk/ndk/27.2.12479018", GITHUB_STEP_SUMMARY: "/home/runner/work/_temp/_runner_file_commands/step_summary_6da6c803-a51f-40dc-a0f4-a0dcc00ecf91", INIT_CWD: "/home/runner/work/marketing-services/marketing-services/packages/connect", NODE_ENV: "production", FEEDME_NAMESPACE: "dev", FIREBASE_API_KEY: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", FIREBASE_AUTH_DOMAIN: "feedme-dev-4c3ef.firebaseapp.com", FIREBASE_DATABASE_URL: "https://feedme-dev-4c3ef.firebaseio.com", FIREBASE_PROJECT_ID: "feedme-dev-4c3ef", FIREBASE_STORAGE_BUCKET: "feedme-dev-4c3ef.appspot.com", FIREBASE_MESSAGING_SENDER_ID: "458797803788", FIREBASE_APP_ID: "1:458797803788:web:37f2af2926a84288f0c129", FIREBASE_MEASUREMENT_ID: "G-J2QG09D2Q7", ASSET_STORAGE_BUCKET: "feedme-dev-4c3ef.appspot.com", AUTH_URL: "https://portal-v2-dev.feedmeapi.com/", SLACK_WEBHOOK_URL: "https://hooks.slack.com/services/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", MEMBER_APP_URL: "member.feedmedev.cc", CRM_APP_URL: "crm.feedmedev.cc", MARKETING_V1_PORTAL: "https://marketing-v1.feedmedev.cc", CLIENT_ID: "1a362d621873497b277ea55258cc82594ba148d235257f7bd44ea2acc132d8a4", PAYMENT_PORTAL_URL: "https://portal.feedmedev.cc/payment/payout-account" } };
35
- const os = typeof fe == "object" && fe.env && fe.env.NODE_DEBUG && /\bsemver\b/i.test(fe.env.NODE_DEBUG) ? (...r) => console.error("SEMVER", ...r) : () => {
36
- };
37
- var ye = os;
38
- (function(r, e) {
39
- const {
40
- MAX_SAFE_COMPONENT_LENGTH: t,
41
- MAX_SAFE_BUILD_LENGTH: s,
42
- MAX_LENGTH: n
43
- } = $e, i = ye;
44
- e = r.exports = {};
45
- const a = e.re = [], c = e.safeRe = [], o = e.src = [], l = e.t = {};
46
- let u = 0;
47
- const p = "[a-zA-Z0-9-]", d = [
48
- ["\\s", 1],
49
- ["\\d", n],
50
- [p, s]
51
- ], h = (O) => {
52
- for (const [$, A] of d)
53
- O = O.split(`${$}*`).join(`${$}{0,${A}}`).split(`${$}+`).join(`${$}{1,${A}}`);
54
- return O;
55
- }, f = (O, $, A) => {
56
- const U = h($), T = u++;
57
- i(O, T, $), l[O] = T, o[T] = $, a[T] = new RegExp($, A ? "g" : void 0), c[T] = new RegExp(U, A ? "g" : void 0);
58
- };
59
- f("NUMERICIDENTIFIER", "0|[1-9]\\d*"), f("NUMERICIDENTIFIERLOOSE", "\\d+"), f("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${p}*`), f("MAINVERSION", `(${o[l.NUMERICIDENTIFIER]})\\.(${o[l.NUMERICIDENTIFIER]})\\.(${o[l.NUMERICIDENTIFIER]})`), f("MAINVERSIONLOOSE", `(${o[l.NUMERICIDENTIFIERLOOSE]})\\.(${o[l.NUMERICIDENTIFIERLOOSE]})\\.(${o[l.NUMERICIDENTIFIERLOOSE]})`), f("PRERELEASEIDENTIFIER", `(?:${o[l.NUMERICIDENTIFIER]}|${o[l.NONNUMERICIDENTIFIER]})`), f("PRERELEASEIDENTIFIERLOOSE", `(?:${o[l.NUMERICIDENTIFIERLOOSE]}|${o[l.NONNUMERICIDENTIFIER]})`), f("PRERELEASE", `(?:-(${o[l.PRERELEASEIDENTIFIER]}(?:\\.${o[l.PRERELEASEIDENTIFIER]})*))`), f("PRERELEASELOOSE", `(?:-?(${o[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${o[l.PRERELEASEIDENTIFIERLOOSE]})*))`), f("BUILDIDENTIFIER", `${p}+`), f("BUILD", `(?:\\+(${o[l.BUILDIDENTIFIER]}(?:\\.${o[l.BUILDIDENTIFIER]})*))`), f("FULLPLAIN", `v?${o[l.MAINVERSION]}${o[l.PRERELEASE]}?${o[l.BUILD]}?`), f("FULL", `^${o[l.FULLPLAIN]}$`), f("LOOSEPLAIN", `[v=\\s]*${o[l.MAINVERSIONLOOSE]}${o[l.PRERELEASELOOSE]}?${o[l.BUILD]}?`), f("LOOSE", `^${o[l.LOOSEPLAIN]}$`), f("GTLT", "((?:<|>)?=?)"), f("XRANGEIDENTIFIERLOOSE", `${o[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), f("XRANGEIDENTIFIER", `${o[l.NUMERICIDENTIFIER]}|x|X|\\*`), f("XRANGEPLAIN", `[v=\\s]*(${o[l.XRANGEIDENTIFIER]})(?:\\.(${o[l.XRANGEIDENTIFIER]})(?:\\.(${o[l.XRANGEIDENTIFIER]})(?:${o[l.PRERELEASE]})?${o[l.BUILD]}?)?)?`), f("XRANGEPLAINLOOSE", `[v=\\s]*(${o[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[l.XRANGEIDENTIFIERLOOSE]})(?:${o[l.PRERELEASELOOSE]})?${o[l.BUILD]}?)?)?`), f("XRANGE", `^${o[l.GTLT]}\\s*${o[l.XRANGEPLAIN]}$`), f("XRANGELOOSE", `^${o[l.GTLT]}\\s*${o[l.XRANGEPLAINLOOSE]}$`), f("COERCEPLAIN", `(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`), f("COERCE", `${o[l.COERCEPLAIN]}(?:$|[^\\d])`), f("COERCEFULL", o[l.COERCEPLAIN] + `(?:${o[l.PRERELEASE]})?(?:${o[l.BUILD]})?(?:$|[^\\d])`), f("COERCERTL", o[l.COERCE], !0), f("COERCERTLFULL", o[l.COERCEFULL], !0), f("LONETILDE", "(?:~>?)"), f("TILDETRIM", `(\\s*)${o[l.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", f("TILDE", `^${o[l.LONETILDE]}${o[l.XRANGEPLAIN]}$`), f("TILDELOOSE", `^${o[l.LONETILDE]}${o[l.XRANGEPLAINLOOSE]}$`), f("LONECARET", "(?:\\^)"), f("CARETTRIM", `(\\s*)${o[l.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", f("CARET", `^${o[l.LONECARET]}${o[l.XRANGEPLAIN]}$`), f("CARETLOOSE", `^${o[l.LONECARET]}${o[l.XRANGEPLAINLOOSE]}$`), f("COMPARATORLOOSE", `^${o[l.GTLT]}\\s*(${o[l.LOOSEPLAIN]})$|^$`), f("COMPARATOR", `^${o[l.GTLT]}\\s*(${o[l.FULLPLAIN]})$|^$`), f("COMPARATORTRIM", `(\\s*)${o[l.GTLT]}\\s*(${o[l.LOOSEPLAIN]}|${o[l.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", f("HYPHENRANGE", `^\\s*(${o[l.XRANGEPLAIN]})\\s+-\\s+(${o[l.XRANGEPLAIN]})\\s*$`), f("HYPHENRANGELOOSE", `^\\s*(${o[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${o[l.XRANGEPLAINLOOSE]})\\s*$`), f("STAR", "(<|>)?=?\\s*\\*"), f("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), f("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
60
- })(Me, Me.exports);
61
- var de = Me.exports;
62
- const ls = Object.freeze({ loose: !0 }), cs = Object.freeze({}), us = (r) => r ? typeof r != "object" ? ls : r : cs;
63
- var Xe = us;
64
- const rt = /^[0-9]+$/, Vt = (r, e) => {
65
- const t = rt.test(r), s = rt.test(e);
66
- return t && s && (r = +r, e = +e), r === e ? 0 : t && !s ? -1 : s && !t ? 1 : r < e ? -1 : 1;
67
- }, ps = (r, e) => Vt(e, r);
68
- var Mt = {
69
- compareIdentifiers: Vt,
70
- rcompareIdentifiers: ps
71
- };
72
- const he = ye, { MAX_LENGTH: nt, MAX_SAFE_INTEGER: me } = $e, { safeRe: it, t: at } = de, ds = Xe, { compareIdentifiers: se } = Mt;
73
- let fs = class X {
74
- constructor(e, t) {
75
- if (t = ds(t), e instanceof X) {
76
- if (e.loose === !!t.loose && e.includePrerelease === !!t.includePrerelease)
77
- return e;
78
- e = e.version;
79
- } else if (typeof e != "string")
80
- throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);
81
- if (e.length > nt)
82
- throw new TypeError(
83
- `version is longer than ${nt} characters`
84
- );
85
- he("SemVer", e, t), this.options = t, this.loose = !!t.loose, this.includePrerelease = !!t.includePrerelease;
86
- const s = e.trim().match(t.loose ? it[at.LOOSE] : it[at.FULL]);
87
- if (!s)
88
- throw new TypeError(`Invalid Version: ${e}`);
89
- if (this.raw = e, this.major = +s[1], this.minor = +s[2], this.patch = +s[3], this.major > me || this.major < 0)
90
- throw new TypeError("Invalid major version");
91
- if (this.minor > me || this.minor < 0)
92
- throw new TypeError("Invalid minor version");
93
- if (this.patch > me || this.patch < 0)
94
- throw new TypeError("Invalid patch version");
95
- s[4] ? this.prerelease = s[4].split(".").map((n) => {
96
- if (/^[0-9]+$/.test(n)) {
97
- const i = +n;
98
- if (i >= 0 && i < me)
99
- return i;
100
- }
101
- return n;
102
- }) : this.prerelease = [], this.build = s[5] ? s[5].split(".") : [], this.format();
103
- }
104
- format() {
105
- return this.version = `${this.major}.${this.minor}.${this.patch}`, this.prerelease.length && (this.version += `-${this.prerelease.join(".")}`), this.version;
106
- }
107
- toString() {
108
- return this.version;
109
- }
110
- compare(e) {
111
- if (he("SemVer.compare", this.version, this.options, e), !(e instanceof X)) {
112
- if (typeof e == "string" && e === this.version)
113
- return 0;
114
- e = new X(e, this.options);
115
- }
116
- return e.version === this.version ? 0 : this.compareMain(e) || this.comparePre(e);
117
- }
118
- compareMain(e) {
119
- return e instanceof X || (e = new X(e, this.options)), se(this.major, e.major) || se(this.minor, e.minor) || se(this.patch, e.patch);
120
- }
121
- comparePre(e) {
122
- if (e instanceof X || (e = new X(e, this.options)), this.prerelease.length && !e.prerelease.length)
123
- return -1;
124
- if (!this.prerelease.length && e.prerelease.length)
125
- return 1;
126
- if (!this.prerelease.length && !e.prerelease.length)
127
- return 0;
128
- let t = 0;
129
- do {
130
- const s = this.prerelease[t], n = e.prerelease[t];
131
- if (he("prerelease compare", t, s, n), s === void 0 && n === void 0)
132
- return 0;
133
- if (n === void 0)
134
- return 1;
135
- if (s === void 0)
136
- return -1;
137
- if (s === n)
138
- continue;
139
- return se(s, n);
140
- } while (++t);
141
- }
142
- compareBuild(e) {
143
- e instanceof X || (e = new X(e, this.options));
144
- let t = 0;
145
- do {
146
- const s = this.build[t], n = e.build[t];
147
- if (he("build compare", t, s, n), s === void 0 && n === void 0)
148
- return 0;
149
- if (n === void 0)
150
- return 1;
151
- if (s === void 0)
152
- return -1;
153
- if (s === n)
154
- continue;
155
- return se(s, n);
156
- } while (++t);
157
- }
158
- // preminor will bump the version up to the next minor release, and immediately
159
- // down to pre-release. premajor and prepatch work the same way.
160
- inc(e, t, s) {
161
- switch (e) {
162
- case "premajor":
163
- this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", t, s);
164
- break;
165
- case "preminor":
166
- this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", t, s);
167
- break;
168
- case "prepatch":
169
- this.prerelease.length = 0, this.inc("patch", t, s), this.inc("pre", t, s);
170
- break;
171
- case "prerelease":
172
- this.prerelease.length === 0 && this.inc("patch", t, s), this.inc("pre", t, s);
173
- break;
174
- case "major":
175
- (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) && this.major++, this.minor = 0, this.patch = 0, this.prerelease = [];
176
- break;
177
- case "minor":
178
- (this.patch !== 0 || this.prerelease.length === 0) && this.minor++, this.patch = 0, this.prerelease = [];
179
- break;
180
- case "patch":
181
- this.prerelease.length === 0 && this.patch++, this.prerelease = [];
182
- break;
183
- case "pre": {
184
- const n = Number(s) ? 1 : 0;
185
- if (!t && s === !1)
186
- throw new Error("invalid increment argument: identifier is empty");
187
- if (this.prerelease.length === 0)
188
- this.prerelease = [n];
189
- else {
190
- let i = this.prerelease.length;
191
- for (; --i >= 0; )
192
- typeof this.prerelease[i] == "number" && (this.prerelease[i]++, i = -2);
193
- if (i === -1) {
194
- if (t === this.prerelease.join(".") && s === !1)
195
- throw new Error("invalid increment argument: identifier already exists");
196
- this.prerelease.push(n);
197
- }
198
- }
199
- if (t) {
200
- let i = [t, n];
201
- s === !1 && (i = [t]), se(this.prerelease[0], t) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = i) : this.prerelease = i;
202
- }
203
- break;
204
- }
205
- default:
206
- throw new Error(`invalid increment argument: ${e}`);
207
- }
208
- return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
209
- }
210
- };
211
- var F = fs;
212
- const ot = F, hs = (r, e, t = !1) => {
213
- if (r instanceof ot)
214
- return r;
215
- try {
216
- return new ot(r, e);
217
- } catch (s) {
218
- if (!t)
219
- return null;
220
- throw s;
221
- }
222
- };
223
- var ie = hs;
224
- const ms = ie, gs = (r, e) => {
225
- const t = ms(r, e);
226
- return t ? t.version : null;
227
- };
228
- var _s = gs;
229
- const Es = ie, vs = (r, e) => {
230
- const t = Es(r.trim().replace(/^[=v]+/, ""), e);
231
- return t ? t.version : null;
232
- };
233
- var Rs = vs;
234
- const lt = F, Os = (r, e, t, s, n) => {
235
- typeof t == "string" && (n = s, s = t, t = void 0);
236
- try {
237
- return new lt(
238
- r instanceof lt ? r.version : r,
239
- t
240
- ).inc(e, s, n).version;
241
- } catch {
242
- return null;
243
- }
244
- };
245
- var Ss = Os;
246
- const ct = ie, Is = (r, e) => {
247
- const t = ct(r, null, !0), s = ct(e, null, !0), n = t.compare(s);
248
- if (n === 0)
249
- return null;
250
- const i = n > 0, a = i ? t : s, c = i ? s : t, o = !!a.prerelease.length;
251
- if (!!c.prerelease.length && !o)
252
- return !c.patch && !c.minor ? "major" : a.patch ? "patch" : a.minor ? "minor" : "major";
253
- const u = o ? "pre" : "";
254
- return t.major !== s.major ? u + "major" : t.minor !== s.minor ? u + "minor" : t.patch !== s.patch ? u + "patch" : "prerelease";
255
- };
256
- var $s = Is;
257
- const ys = F, Ns = (r, e) => new ys(r, e).major;
258
- var Ts = Ns;
259
- const Ls = F, bs = (r, e) => new Ls(r, e).minor;
260
- var As = bs;
261
- const xs = F, Cs = (r, e) => new xs(r, e).patch;
262
- var Ps = Cs;
263
- const ws = ie, ks = (r, e) => {
264
- const t = ws(r, e);
265
- return t && t.prerelease.length ? t.prerelease : null;
266
- };
267
- var Ds = ks;
268
- const ut = F, Us = (r, e, t) => new ut(r, t).compare(new ut(e, t));
269
- var G = Us;
270
- const Fs = G, js = (r, e, t) => Fs(e, r, t);
271
- var Vs = js;
272
- const Ms = G, Gs = (r, e) => Ms(r, e, !0);
273
- var Hs = Gs;
274
- const pt = F, Bs = (r, e, t) => {
275
- const s = new pt(r, t), n = new pt(e, t);
276
- return s.compare(n) || s.compareBuild(n);
277
- };
278
- var ze = Bs;
279
- const Ks = ze, Xs = (r, e) => r.sort((t, s) => Ks(t, s, e));
280
- var zs = Xs;
281
- const Ws = ze, Ys = (r, e) => r.sort((t, s) => Ws(s, t, e));
282
- var Js = Ys;
283
- const qs = G, Zs = (r, e, t) => qs(r, e, t) > 0;
284
- var Ne = Zs;
285
- const Qs = G, er = (r, e, t) => Qs(r, e, t) < 0;
286
- var We = er;
287
- const tr = G, sr = (r, e, t) => tr(r, e, t) === 0;
288
- var Gt = sr;
289
- const rr = G, nr = (r, e, t) => rr(r, e, t) !== 0;
290
- var Ht = nr;
291
- const ir = G, ar = (r, e, t) => ir(r, e, t) >= 0;
292
- var Ye = ar;
293
- const or = G, lr = (r, e, t) => or(r, e, t) <= 0;
294
- var Je = lr;
295
- const cr = Gt, ur = Ht, pr = Ne, dr = Ye, fr = We, hr = Je, mr = (r, e, t, s) => {
296
- switch (e) {
297
- case "===":
298
- return typeof r == "object" && (r = r.version), typeof t == "object" && (t = t.version), r === t;
299
- case "!==":
300
- return typeof r == "object" && (r = r.version), typeof t == "object" && (t = t.version), r !== t;
301
- case "":
302
- case "=":
303
- case "==":
304
- return cr(r, t, s);
305
- case "!=":
306
- return ur(r, t, s);
307
- case ">":
308
- return pr(r, t, s);
309
- case ">=":
310
- return dr(r, t, s);
311
- case "<":
312
- return fr(r, t, s);
313
- case "<=":
314
- return hr(r, t, s);
315
- default:
316
- throw new TypeError(`Invalid operator: ${e}`);
317
- }
318
- };
319
- var Bt = mr;
320
- const gr = F, _r = ie, { safeRe: ge, t: _e } = de, Er = (r, e) => {
321
- if (r instanceof gr)
322
- return r;
323
- if (typeof r == "number" && (r = String(r)), typeof r != "string")
324
- return null;
325
- e = e || {};
326
- let t = null;
327
- if (!e.rtl)
328
- t = r.match(e.includePrerelease ? ge[_e.COERCEFULL] : ge[_e.COERCE]);
329
- else {
330
- const o = e.includePrerelease ? ge[_e.COERCERTLFULL] : ge[_e.COERCERTL];
331
- let l;
332
- for (; (l = o.exec(r)) && (!t || t.index + t[0].length !== r.length); )
333
- (!t || l.index + l[0].length !== t.index + t[0].length) && (t = l), o.lastIndex = l.index + l[1].length + l[2].length;
334
- o.lastIndex = -1;
335
- }
336
- if (t === null)
337
- return null;
338
- const s = t[2], n = t[3] || "0", i = t[4] || "0", a = e.includePrerelease && t[5] ? `-${t[5]}` : "", c = e.includePrerelease && t[6] ? `+${t[6]}` : "";
339
- return _r(`${s}.${n}.${i}${a}${c}`, e);
340
- };
341
- var vr = Er;
342
- class Rr {
343
- constructor() {
344
- this.max = 1e3, this.map = /* @__PURE__ */ new Map();
345
- }
346
- get(e) {
347
- const t = this.map.get(e);
348
- if (t !== void 0)
349
- return this.map.delete(e), this.map.set(e, t), t;
350
- }
351
- delete(e) {
352
- return this.map.delete(e);
353
- }
354
- set(e, t) {
355
- if (!this.delete(e) && t !== void 0) {
356
- if (this.map.size >= this.max) {
357
- const n = this.map.keys().next().value;
358
- this.delete(n);
359
- }
360
- this.map.set(e, t);
361
- }
362
- return this;
363
- }
364
- }
365
- var Or = Rr, Ce, dt;
366
- function H() {
367
- if (dt) return Ce;
368
- dt = 1;
369
- const r = /\s+/g;
370
- class e {
371
- constructor(m, R) {
372
- if (R = n(R), m instanceof e)
373
- return m.loose === !!R.loose && m.includePrerelease === !!R.includePrerelease ? m : new e(m.raw, R);
374
- if (m instanceof i)
375
- return this.raw = m.value, this.set = [[m]], this.formatted = void 0, this;
376
- if (this.options = R, this.loose = !!R.loose, this.includePrerelease = !!R.includePrerelease, this.raw = m.trim().replace(r, " "), this.set = this.raw.split("||").map((v) => this.parseRange(v.trim())).filter((v) => v.length), !this.set.length)
377
- throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
378
- if (this.set.length > 1) {
379
- const v = this.set[0];
380
- if (this.set = this.set.filter((_) => !O(_[0])), this.set.length === 0)
381
- this.set = [v];
382
- else if (this.set.length > 1) {
383
- for (const _ of this.set)
384
- if (_.length === 1 && $(_[0])) {
385
- this.set = [_];
386
- break;
387
- }
388
- }
389
- }
390
- this.formatted = void 0;
391
- }
392
- get range() {
393
- if (this.formatted === void 0) {
394
- this.formatted = "";
395
- for (let m = 0; m < this.set.length; m++) {
396
- m > 0 && (this.formatted += "||");
397
- const R = this.set[m];
398
- for (let v = 0; v < R.length; v++)
399
- v > 0 && (this.formatted += " "), this.formatted += R[v].toString().trim();
400
- }
401
- }
402
- return this.formatted;
403
- }
404
- format() {
405
- return this.range;
406
- }
407
- toString() {
408
- return this.range;
409
- }
410
- parseRange(m) {
411
- const v = ((this.options.includePrerelease && h) | (this.options.loose && f)) + ":" + m, _ = s.get(v);
412
- if (_)
413
- return _;
414
- const E = this.options.loose, S = E ? o[l.HYPHENRANGELOOSE] : o[l.HYPHENRANGE];
415
- m = m.replace(S, et(this.options.includePrerelease)), a("hyphen replace", m), m = m.replace(o[l.COMPARATORTRIM], u), a("comparator trim", m), m = m.replace(o[l.TILDETRIM], p), a("tilde trim", m), m = m.replace(o[l.CARETTRIM], d), a("caret trim", m);
416
- let N = m.split(" ").map((C) => U(C, this.options)).join(" ").split(/\s+/).map((C) => Q(C, this.options));
417
- E && (N = N.filter((C) => (a("loose invalid filter", C, this.options), !!C.match(o[l.COMPARATORLOOSE])))), a("range list", N);
418
- const y = /* @__PURE__ */ new Map(), b = N.map((C) => new i(C, this.options));
419
- for (const C of b) {
420
- if (O(C))
421
- return [C];
422
- y.set(C.value, C);
423
- }
424
- y.size > 1 && y.has("") && y.delete("");
425
- const j = [...y.values()];
426
- return s.set(v, j), j;
427
- }
428
- intersects(m, R) {
429
- if (!(m instanceof e))
430
- throw new TypeError("a Range is required");
431
- return this.set.some((v) => A(v, R) && m.set.some((_) => A(_, R) && v.every((E) => _.every((S) => E.intersects(S, R)))));
432
- }
433
- // if ANY of the sets match ALL of its comparators, then pass
434
- test(m) {
435
- if (!m)
436
- return !1;
437
- if (typeof m == "string")
438
- try {
439
- m = new c(m, this.options);
440
- } catch {
441
- return !1;
442
- }
443
- for (let R = 0; R < this.set.length; R++)
444
- if (Ae(this.set[R], m, this.options))
445
- return !0;
446
- return !1;
447
- }
448
- }
449
- Ce = e;
450
- const t = Or, s = new t(), n = Xe, i = Te(), a = ye, c = F, {
451
- safeRe: o,
452
- t: l,
453
- comparatorTrimReplace: u,
454
- tildeTrimReplace: p,
455
- caretTrimReplace: d
456
- } = de, { FLAG_INCLUDE_PRERELEASE: h, FLAG_LOOSE: f } = $e, O = (g) => g.value === "<0.0.0-0", $ = (g) => g.value === "", A = (g, m) => {
457
- let R = !0;
458
- const v = g.slice();
459
- let _ = v.pop();
460
- for (; R && v.length; )
461
- R = v.every((E) => _.intersects(E, m)), _ = v.pop();
462
- return R;
463
- }, U = (g, m) => (a("comp", g, m), g = M(g, m), a("caret", g), g = L(g, m), a("tildes", g), g = W(g, m), a("xrange", g), g = Y(g, m), a("stars", g), g), T = (g) => !g || g.toLowerCase() === "x" || g === "*", L = (g, m) => g.trim().split(/\s+/).map((R) => k(R, m)).join(" "), k = (g, m) => {
464
- const R = m.loose ? o[l.TILDELOOSE] : o[l.TILDE];
465
- return g.replace(R, (v, _, E, S, N) => {
466
- a("tilde", g, v, _, E, S, N);
467
- let y;
468
- return T(_) ? y = "" : T(E) ? y = `>=${_}.0.0 <${+_ + 1}.0.0-0` : T(S) ? y = `>=${_}.${E}.0 <${_}.${+E + 1}.0-0` : N ? (a("replaceTilde pr", N), y = `>=${_}.${E}.${S}-${N} <${_}.${+E + 1}.0-0`) : y = `>=${_}.${E}.${S} <${_}.${+E + 1}.0-0`, a("tilde return", y), y;
469
- });
470
- }, M = (g, m) => g.trim().split(/\s+/).map((R) => x(R, m)).join(" "), x = (g, m) => {
471
- a("caret", g, m);
472
- const R = m.loose ? o[l.CARETLOOSE] : o[l.CARET], v = m.includePrerelease ? "-0" : "";
473
- return g.replace(R, (_, E, S, N, y) => {
474
- a("caret", g, _, E, S, N, y);
475
- let b;
476
- return T(E) ? b = "" : T(S) ? b = `>=${E}.0.0${v} <${+E + 1}.0.0-0` : T(N) ? E === "0" ? b = `>=${E}.${S}.0${v} <${E}.${+S + 1}.0-0` : b = `>=${E}.${S}.0${v} <${+E + 1}.0.0-0` : y ? (a("replaceCaret pr", y), E === "0" ? S === "0" ? b = `>=${E}.${S}.${N}-${y} <${E}.${S}.${+N + 1}-0` : b = `>=${E}.${S}.${N}-${y} <${E}.${+S + 1}.0-0` : b = `>=${E}.${S}.${N}-${y} <${+E + 1}.0.0-0`) : (a("no pr"), E === "0" ? S === "0" ? b = `>=${E}.${S}.${N}${v} <${E}.${S}.${+N + 1}-0` : b = `>=${E}.${S}.${N}${v} <${E}.${+S + 1}.0-0` : b = `>=${E}.${S}.${N} <${+E + 1}.0.0-0`), a("caret return", b), b;
477
- });
478
- }, W = (g, m) => (a("replaceXRanges", g, m), g.split(/\s+/).map((R) => Z(R, m)).join(" ")), Z = (g, m) => {
479
- g = g.trim();
480
- const R = m.loose ? o[l.XRANGELOOSE] : o[l.XRANGE];
481
- return g.replace(R, (v, _, E, S, N, y) => {
482
- a("xRange", g, v, _, E, S, N, y);
483
- const b = T(E), j = b || T(S), C = j || T(N), ae = C;
484
- return _ === "=" && ae && (_ = ""), y = m.includePrerelease ? "-0" : "", b ? _ === ">" || _ === "<" ? v = "<0.0.0-0" : v = "*" : _ && ae ? (j && (S = 0), N = 0, _ === ">" ? (_ = ">=", j ? (E = +E + 1, S = 0, N = 0) : (S = +S + 1, N = 0)) : _ === "<=" && (_ = "<", j ? E = +E + 1 : S = +S + 1), _ === "<" && (y = "-0"), v = `${_ + E}.${S}.${N}${y}`) : j ? v = `>=${E}.0.0${y} <${+E + 1}.0.0-0` : C && (v = `>=${E}.${S}.0${y} <${E}.${+S + 1}.0-0`), a("xRange return", v), v;
485
- });
486
- }, Y = (g, m) => (a("replaceStars", g, m), g.trim().replace(o[l.STAR], "")), Q = (g, m) => (a("replaceGTE0", g, m), g.trim().replace(o[m.includePrerelease ? l.GTE0PRE : l.GTE0], "")), et = (g) => (m, R, v, _, E, S, N, y, b, j, C, ae) => (T(v) ? R = "" : T(_) ? R = `>=${v}.0.0${g ? "-0" : ""}` : T(E) ? R = `>=${v}.${_}.0${g ? "-0" : ""}` : S ? R = `>=${R}` : R = `>=${R}${g ? "-0" : ""}`, T(b) ? y = "" : T(j) ? y = `<${+b + 1}.0.0-0` : T(C) ? y = `<${b}.${+j + 1}.0-0` : ae ? y = `<=${b}.${j}.${C}-${ae}` : g ? y = `<${b}.${j}.${+C + 1}-0` : y = `<=${y}`, `${R} ${y}`.trim()), Ae = (g, m, R) => {
487
- for (let v = 0; v < g.length; v++)
488
- if (!g[v].test(m))
489
- return !1;
490
- if (m.prerelease.length && !R.includePrerelease) {
491
- for (let v = 0; v < g.length; v++)
492
- if (a(g[v].semver), g[v].semver !== i.ANY && g[v].semver.prerelease.length > 0) {
493
- const _ = g[v].semver;
494
- if (_.major === m.major && _.minor === m.minor && _.patch === m.patch)
495
- return !0;
496
- }
497
- return !1;
498
- }
499
- return !0;
500
- };
501
- return Ce;
502
- }
503
- var Pe, ft;
504
- function Te() {
505
- if (ft) return Pe;
506
- ft = 1;
507
- const r = Symbol("SemVer ANY");
508
- class e {
509
- static get ANY() {
510
- return r;
511
- }
512
- constructor(u, p) {
513
- if (p = t(p), u instanceof e) {
514
- if (u.loose === !!p.loose)
515
- return u;
516
- u = u.value;
517
- }
518
- u = u.trim().split(/\s+/).join(" "), a("comparator", u, p), this.options = p, this.loose = !!p.loose, this.parse(u), this.semver === r ? this.value = "" : this.value = this.operator + this.semver.version, a("comp", this);
519
- }
520
- parse(u) {
521
- const p = this.options.loose ? s[n.COMPARATORLOOSE] : s[n.COMPARATOR], d = u.match(p);
522
- if (!d)
523
- throw new TypeError(`Invalid comparator: ${u}`);
524
- this.operator = d[1] !== void 0 ? d[1] : "", this.operator === "=" && (this.operator = ""), d[2] ? this.semver = new c(d[2], this.options.loose) : this.semver = r;
525
- }
526
- toString() {
527
- return this.value;
528
- }
529
- test(u) {
530
- if (a("Comparator.test", u, this.options.loose), this.semver === r || u === r)
531
- return !0;
532
- if (typeof u == "string")
533
- try {
534
- u = new c(u, this.options);
535
- } catch {
536
- return !1;
537
- }
538
- return i(u, this.operator, this.semver, this.options);
539
- }
540
- intersects(u, p) {
541
- if (!(u instanceof e))
542
- throw new TypeError("a Comparator is required");
543
- return this.operator === "" ? this.value === "" ? !0 : new o(u.value, p).test(this.value) : u.operator === "" ? u.value === "" ? !0 : new o(this.value, p).test(u.semver) : (p = t(p), p.includePrerelease && (this.value === "<0.0.0-0" || u.value === "<0.0.0-0") || !p.includePrerelease && (this.value.startsWith("<0.0.0") || u.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && u.operator.startsWith(">") || this.operator.startsWith("<") && u.operator.startsWith("<") || this.semver.version === u.semver.version && this.operator.includes("=") && u.operator.includes("=") || i(this.semver, "<", u.semver, p) && this.operator.startsWith(">") && u.operator.startsWith("<") || i(this.semver, ">", u.semver, p) && this.operator.startsWith("<") && u.operator.startsWith(">")));
544
- }
545
- }
546
- Pe = e;
547
- const t = Xe, { safeRe: s, t: n } = de, i = Bt, a = ye, c = F, o = H();
548
- return Pe;
549
- }
550
- const Sr = H(), Ir = (r, e, t) => {
551
- try {
552
- e = new Sr(e, t);
553
- } catch {
554
- return !1;
555
- }
556
- return e.test(r);
557
- };
558
- var Le = Ir;
559
- const $r = H(), yr = (r, e) => new $r(r, e).set.map((t) => t.map((s) => s.value).join(" ").trim().split(" "));
560
- var Nr = yr;
561
- const Tr = F, Lr = H(), br = (r, e, t) => {
562
- let s = null, n = null, i = null;
563
- try {
564
- i = new Lr(e, t);
565
- } catch {
566
- return null;
567
- }
568
- return r.forEach((a) => {
569
- i.test(a) && (!s || n.compare(a) === -1) && (s = a, n = new Tr(s, t));
570
- }), s;
571
- };
572
- var Ar = br;
573
- const xr = F, Cr = H(), Pr = (r, e, t) => {
574
- let s = null, n = null, i = null;
575
- try {
576
- i = new Cr(e, t);
577
- } catch {
578
- return null;
579
- }
580
- return r.forEach((a) => {
581
- i.test(a) && (!s || n.compare(a) === 1) && (s = a, n = new xr(s, t));
582
- }), s;
583
- };
584
- var wr = Pr;
585
- const we = F, kr = H(), ht = Ne, Dr = (r, e) => {
586
- r = new kr(r, e);
587
- let t = new we("0.0.0");
588
- if (r.test(t) || (t = new we("0.0.0-0"), r.test(t)))
589
- return t;
590
- t = null;
591
- for (let s = 0; s < r.set.length; ++s) {
592
- const n = r.set[s];
593
- let i = null;
594
- n.forEach((a) => {
595
- const c = new we(a.semver.version);
596
- switch (a.operator) {
597
- case ">":
598
- c.prerelease.length === 0 ? c.patch++ : c.prerelease.push(0), c.raw = c.format();
599
- case "":
600
- case ">=":
601
- (!i || ht(c, i)) && (i = c);
602
- break;
603
- case "<":
604
- case "<=":
605
- break;
606
- default:
607
- throw new Error(`Unexpected operation: ${a.operator}`);
608
- }
609
- }), i && (!t || ht(t, i)) && (t = i);
610
- }
611
- return t && r.test(t) ? t : null;
612
- };
613
- var Ur = Dr;
614
- const Fr = H(), jr = (r, e) => {
615
- try {
616
- return new Fr(r, e).range || "*";
617
- } catch {
618
- return null;
619
- }
620
- };
621
- var Vr = jr;
622
- const Mr = F, Kt = Te(), { ANY: Gr } = Kt, Hr = H(), Br = Le, mt = Ne, gt = We, Kr = Je, Xr = Ye, zr = (r, e, t, s) => {
623
- r = new Mr(r, s), e = new Hr(e, s);
624
- let n, i, a, c, o;
625
- switch (t) {
626
- case ">":
627
- n = mt, i = Kr, a = gt, c = ">", o = ">=";
628
- break;
629
- case "<":
630
- n = gt, i = Xr, a = mt, c = "<", o = "<=";
631
- break;
632
- default:
633
- throw new TypeError('Must provide a hilo val of "<" or ">"');
634
- }
635
- if (Br(r, e, s))
636
- return !1;
637
- for (let l = 0; l < e.set.length; ++l) {
638
- const u = e.set[l];
639
- let p = null, d = null;
640
- if (u.forEach((h) => {
641
- h.semver === Gr && (h = new Kt(">=0.0.0")), p = p || h, d = d || h, n(h.semver, p.semver, s) ? p = h : a(h.semver, d.semver, s) && (d = h);
642
- }), p.operator === c || p.operator === o || (!d.operator || d.operator === c) && i(r, d.semver))
643
- return !1;
644
- if (d.operator === o && a(r, d.semver))
645
- return !1;
646
- }
647
- return !0;
648
- };
649
- var qe = zr;
650
- const Wr = qe, Yr = (r, e, t) => Wr(r, e, ">", t);
651
- var Jr = Yr;
652
- const qr = qe, Zr = (r, e, t) => qr(r, e, "<", t);
653
- var Qr = Zr;
654
- const _t = H(), en = (r, e, t) => (r = new _t(r, t), e = new _t(e, t), r.intersects(e, t));
655
- var tn = en;
656
- const sn = Le, rn = G;
657
- var nn = (r, e, t) => {
658
- const s = [];
659
- let n = null, i = null;
660
- const a = r.sort((u, p) => rn(u, p, t));
661
- for (const u of a)
662
- sn(u, e, t) ? (i = u, n || (n = u)) : (i && s.push([n, i]), i = null, n = null);
663
- n && s.push([n, null]);
664
- const c = [];
665
- for (const [u, p] of s)
666
- u === p ? c.push(u) : !p && u === a[0] ? c.push("*") : p ? u === a[0] ? c.push(`<=${p}`) : c.push(`${u} - ${p}`) : c.push(`>=${u}`);
667
- const o = c.join(" || "), l = typeof e.raw == "string" ? e.raw : String(e);
668
- return o.length < l.length ? o : e;
669
- };
670
- const Et = H(), Ze = Te(), { ANY: ke } = Ze, oe = Le, Qe = G, an = (r, e, t = {}) => {
671
- if (r === e)
672
- return !0;
673
- r = new Et(r, t), e = new Et(e, t);
674
- let s = !1;
675
- e: for (const n of r.set) {
676
- for (const i of e.set) {
677
- const a = ln(n, i, t);
678
- if (s = s || a !== null, a)
679
- continue e;
680
- }
681
- if (s)
682
- return !1;
683
- }
684
- return !0;
685
- }, on = [new Ze(">=0.0.0-0")], vt = [new Ze(">=0.0.0")], ln = (r, e, t) => {
686
- if (r === e)
687
- return !0;
688
- if (r.length === 1 && r[0].semver === ke) {
689
- if (e.length === 1 && e[0].semver === ke)
690
- return !0;
691
- t.includePrerelease ? r = on : r = vt;
692
- }
693
- if (e.length === 1 && e[0].semver === ke) {
694
- if (t.includePrerelease)
695
- return !0;
696
- e = vt;
697
- }
698
- const s = /* @__PURE__ */ new Set();
699
- let n, i;
700
- for (const h of r)
701
- h.operator === ">" || h.operator === ">=" ? n = Rt(n, h, t) : h.operator === "<" || h.operator === "<=" ? i = Ot(i, h, t) : s.add(h.semver);
702
- if (s.size > 1)
703
- return null;
704
- let a;
705
- if (n && i) {
706
- if (a = Qe(n.semver, i.semver, t), a > 0)
707
- return null;
708
- if (a === 0 && (n.operator !== ">=" || i.operator !== "<="))
709
- return null;
710
- }
711
- for (const h of s) {
712
- if (n && !oe(h, String(n), t) || i && !oe(h, String(i), t))
713
- return null;
714
- for (const f of e)
715
- if (!oe(h, String(f), t))
716
- return !1;
717
- return !0;
718
- }
719
- let c, o, l, u, p = i && !t.includePrerelease && i.semver.prerelease.length ? i.semver : !1, d = n && !t.includePrerelease && n.semver.prerelease.length ? n.semver : !1;
720
- p && p.prerelease.length === 1 && i.operator === "<" && p.prerelease[0] === 0 && (p = !1);
721
- for (const h of e) {
722
- if (u = u || h.operator === ">" || h.operator === ">=", l = l || h.operator === "<" || h.operator === "<=", n) {
723
- if (d && h.semver.prerelease && h.semver.prerelease.length && h.semver.major === d.major && h.semver.minor === d.minor && h.semver.patch === d.patch && (d = !1), h.operator === ">" || h.operator === ">=") {
724
- if (c = Rt(n, h, t), c === h && c !== n)
725
- return !1;
726
- } else if (n.operator === ">=" && !oe(n.semver, String(h), t))
727
- return !1;
728
- }
729
- if (i) {
730
- if (p && h.semver.prerelease && h.semver.prerelease.length && h.semver.major === p.major && h.semver.minor === p.minor && h.semver.patch === p.patch && (p = !1), h.operator === "<" || h.operator === "<=") {
731
- if (o = Ot(i, h, t), o === h && o !== i)
732
- return !1;
733
- } else if (i.operator === "<=" && !oe(i.semver, String(h), t))
734
- return !1;
735
- }
736
- if (!h.operator && (i || n) && a !== 0)
737
- return !1;
738
- }
739
- return !(n && l && !i && a !== 0 || i && u && !n && a !== 0 || d || p);
740
- }, Rt = (r, e, t) => {
741
- if (!r)
742
- return e;
743
- const s = Qe(r.semver, e.semver, t);
744
- return s > 0 ? r : s < 0 || e.operator === ">" && r.operator === ">=" ? e : r;
745
- }, Ot = (r, e, t) => {
746
- if (!r)
747
- return e;
748
- const s = Qe(r.semver, e.semver, t);
749
- return s < 0 ? r : s > 0 || e.operator === "<" && r.operator === "<=" ? e : r;
750
- };
751
- var cn = an;
752
- const De = de, St = $e, un = F, It = Mt, pn = ie, dn = _s, fn = Rs, hn = Ss, mn = $s, gn = Ts, _n = As, En = Ps, vn = Ds, Rn = G, On = Vs, Sn = Hs, In = ze, $n = zs, yn = Js, Nn = Ne, Tn = We, Ln = Gt, bn = Ht, An = Ye, xn = Je, Cn = Bt, Pn = vr, wn = Te(), kn = H(), Dn = Le, Un = Nr, Fn = Ar, jn = wr, Vn = Ur, Mn = Vr, Gn = qe, Hn = Jr, Bn = Qr, Kn = tn, Xn = nn, zn = cn;
753
- De.re, De.src, De.t, St.SEMVER_SPEC_VERSION, St.RELEASE_TYPES, It.compareIdentifiers, It.rcompareIdentifiers;
754
- function Wn(r) {
755
- switch (r) {
756
- case "COIN":
757
- return "Point";
758
- case "POINT":
759
- return "Experience";
760
- default:
761
- return Zt(r);
762
- }
763
- }
764
- const ee = {
765
- formattedType: Wn
766
- }, I = (r) => typeof r == "string", le = () => {
767
- let r, e;
768
- const t = new Promise((s, n) => {
769
- r = s, e = n;
770
- });
771
- return t.resolve = r, t.reject = e, t;
772
- }, $t = (r) => r == null ? "" : "" + r, Yn = (r, e, t) => {
773
- r.forEach((s) => {
774
- e[s] && (t[s] = e[s]);
775
- });
776
- }, Jn = /###/g, yt = (r) => r && r.indexOf("###") > -1 ? r.replace(Jn, ".") : r, Nt = (r) => !r || I(r), ue = (r, e, t) => {
777
- const s = I(e) ? e.split(".") : e;
778
- let n = 0;
779
- for (; n < s.length - 1; ) {
780
- if (Nt(r)) return {};
781
- const i = yt(s[n]);
782
- !r[i] && t && (r[i] = new t()), Object.prototype.hasOwnProperty.call(r, i) ? r = r[i] : r = {}, ++n;
783
- }
784
- return Nt(r) ? {} : {
785
- obj: r,
786
- k: yt(s[n])
787
- };
788
- }, Tt = (r, e, t) => {
789
- const {
790
- obj: s,
791
- k: n
792
- } = ue(r, e, Object);
793
- if (s !== void 0 || e.length === 1) {
794
- s[n] = t;
795
- return;
796
- }
797
- let i = e[e.length - 1], a = e.slice(0, e.length - 1), c = ue(r, a, Object);
798
- for (; c.obj === void 0 && a.length; )
799
- i = `${a[a.length - 1]}.${i}`, a = a.slice(0, a.length - 1), c = ue(r, a, Object), c != null && c.obj && typeof c.obj[`${c.k}.${i}`] < "u" && (c.obj = void 0);
800
- c.obj[`${c.k}.${i}`] = t;
801
- }, qn = (r, e, t, s) => {
802
- const {
803
- obj: n,
804
- k: i
805
- } = ue(r, e, Object);
806
- n[i] = n[i] || [], n[i].push(t);
807
- }, Re = (r, e) => {
808
- const {
809
- obj: t,
810
- k: s
811
- } = ue(r, e);
812
- if (t && Object.prototype.hasOwnProperty.call(t, s))
813
- return t[s];
814
- }, Zn = (r, e, t) => {
815
- const s = Re(r, t);
816
- return s !== void 0 ? s : Re(e, t);
817
- }, Xt = (r, e, t) => {
818
- for (const s in e)
819
- s !== "__proto__" && s !== "constructor" && (s in r ? I(r[s]) || r[s] instanceof String || I(e[s]) || e[s] instanceof String ? t && (r[s] = e[s]) : Xt(r[s], e[s], t) : r[s] = e[s]);
820
- return r;
821
- }, re = (r) => r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
822
- var Qn = {
823
- "&": "&amp;",
824
- "<": "&lt;",
825
- ">": "&gt;",
826
- '"': "&quot;",
827
- "'": "&#39;",
828
- "/": "&#x2F;"
829
- };
830
- const ei = (r) => I(r) ? r.replace(/[&<>"'\/]/g, (e) => Qn[e]) : r;
831
- class ti {
832
- constructor(e) {
833
- this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
834
- }
835
- getRegExp(e) {
836
- const t = this.regExpMap.get(e);
837
- if (t !== void 0)
838
- return t;
839
- const s = new RegExp(e);
840
- return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, s), this.regExpQueue.push(e), s;
841
- }
842
- }
843
- const si = [" ", ",", "?", "!", ";"], ri = new ti(20), ni = (r, e, t) => {
844
- e = e || "", t = t || "";
845
- const s = si.filter((a) => e.indexOf(a) < 0 && t.indexOf(a) < 0);
846
- if (s.length === 0) return !0;
847
- const n = ri.getRegExp(`(${s.map((a) => a === "?" ? "\\?" : a).join("|")})`);
848
- let i = !n.test(r);
849
- if (!i) {
850
- const a = r.indexOf(t);
851
- a > 0 && !n.test(r.substring(0, a)) && (i = !0);
852
- }
853
- return i;
854
- }, Ge = function(r, e) {
855
- let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
856
- if (!r) return;
857
- if (r[e])
858
- return Object.prototype.hasOwnProperty.call(r, e) ? r[e] : void 0;
859
- const s = e.split(t);
860
- let n = r;
861
- for (let i = 0; i < s.length; ) {
862
- if (!n || typeof n != "object")
863
- return;
864
- let a, c = "";
865
- for (let o = i; o < s.length; ++o)
866
- if (o !== i && (c += t), c += s[o], a = n[c], a !== void 0) {
867
- if (["string", "number", "boolean"].indexOf(typeof a) > -1 && o < s.length - 1)
868
- continue;
869
- i += o - i + 1;
870
- break;
871
- }
872
- n = a;
873
- }
874
- return n;
875
- }, Oe = (r) => r == null ? void 0 : r.replace("_", "-"), ii = {
876
- type: "logger",
877
- log(r) {
878
- this.output("log", r);
879
- },
880
- warn(r) {
881
- this.output("warn", r);
882
- },
883
- error(r) {
884
- this.output("error", r);
885
- },
886
- output(r, e) {
887
- var t, s;
888
- (s = (t = console == null ? void 0 : console[r]) == null ? void 0 : t.apply) == null || s.call(t, console, e);
889
- }
890
- };
891
- class Se {
892
- constructor(e) {
893
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
894
- this.init(e, t);
895
- }
896
- init(e) {
897
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
898
- this.prefix = t.prefix || "i18next:", this.logger = e || ii, this.options = t, this.debug = t.debug;
899
- }
900
- log() {
901
- for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)
902
- t[s] = arguments[s];
903
- return this.forward(t, "log", "", !0);
904
- }
905
- warn() {
906
- for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)
907
- t[s] = arguments[s];
908
- return this.forward(t, "warn", "", !0);
909
- }
910
- error() {
911
- for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)
912
- t[s] = arguments[s];
913
- return this.forward(t, "error", "");
914
- }
915
- deprecate() {
916
- for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)
917
- t[s] = arguments[s];
918
- return this.forward(t, "warn", "WARNING DEPRECATED: ", !0);
919
- }
920
- forward(e, t, s, n) {
921
- return n && !this.debug ? null : (I(e[0]) && (e[0] = `${s}${this.prefix} ${e[0]}`), this.logger[t](e));
922
- }
923
- create(e) {
924
- return new Se(this.logger, {
925
- prefix: `${this.prefix}:${e}:`,
926
- ...this.options
927
- });
928
- }
929
- clone(e) {
930
- return e = e || this.options, e.prefix = e.prefix || this.prefix, new Se(this.logger, e);
931
- }
932
- }
933
- var z = new Se();
934
- class be {
935
- constructor() {
936
- this.observers = {};
937
- }
938
- on(e, t) {
939
- return e.split(" ").forEach((s) => {
940
- this.observers[s] || (this.observers[s] = /* @__PURE__ */ new Map());
941
- const n = this.observers[s].get(t) || 0;
942
- this.observers[s].set(t, n + 1);
943
- }), this;
944
- }
945
- off(e, t) {
946
- if (this.observers[e]) {
947
- if (!t) {
948
- delete this.observers[e];
949
- return;
950
- }
951
- this.observers[e].delete(t);
952
- }
953
- }
954
- emit(e) {
955
- for (var t = arguments.length, s = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
956
- s[n - 1] = arguments[n];
957
- this.observers[e] && Array.from(this.observers[e].entries()).forEach((a) => {
958
- let [c, o] = a;
959
- for (let l = 0; l < o; l++)
960
- c(...s);
961
- }), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach((a) => {
962
- let [c, o] = a;
963
- for (let l = 0; l < o; l++)
964
- c.apply(c, [e, ...s]);
965
- });
966
- }
967
- }
968
- class Lt extends be {
969
- constructor(e) {
970
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
971
- ns: ["translation"],
972
- defaultNS: "translation"
973
- };
974
- super(), this.data = e || {}, this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
975
- }
976
- addNamespaces(e) {
977
- this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
978
- }
979
- removeNamespaces(e) {
980
- const t = this.options.ns.indexOf(e);
981
- t > -1 && this.options.ns.splice(t, 1);
982
- }
983
- getResource(e, t, s) {
984
- var l, u;
985
- let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
986
- const i = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator, a = n.ignoreJSONStructure !== void 0 ? n.ignoreJSONStructure : this.options.ignoreJSONStructure;
987
- let c;
988
- e.indexOf(".") > -1 ? c = e.split(".") : (c = [e, t], s && (Array.isArray(s) ? c.push(...s) : I(s) && i ? c.push(...s.split(i)) : c.push(s)));
989
- const o = Re(this.data, c);
990
- return !o && !t && !s && e.indexOf(".") > -1 && (e = c[0], t = c[1], s = c.slice(2).join(".")), o || !a || !I(s) ? o : Ge((u = (l = this.data) == null ? void 0 : l[e]) == null ? void 0 : u[t], s, i);
991
- }
992
- addResource(e, t, s, n) {
993
- let i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
994
- silent: !1
995
- };
996
- const a = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator;
997
- let c = [e, t];
998
- s && (c = c.concat(a ? s.split(a) : s)), e.indexOf(".") > -1 && (c = e.split("."), n = t, t = c[1]), this.addNamespaces(t), Tt(this.data, c, n), i.silent || this.emit("added", e, t, s, n);
999
- }
1000
- addResources(e, t, s) {
1001
- let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
1002
- silent: !1
1003
- };
1004
- for (const i in s)
1005
- (I(s[i]) || Array.isArray(s[i])) && this.addResource(e, t, i, s[i], {
1006
- silent: !0
1007
- });
1008
- n.silent || this.emit("added", e, t, s);
1009
- }
1010
- addResourceBundle(e, t, s, n, i) {
1011
- let a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {
1012
- silent: !1,
1013
- skipCopy: !1
1014
- }, c = [e, t];
1015
- e.indexOf(".") > -1 && (c = e.split("."), n = s, s = t, t = c[1]), this.addNamespaces(t);
1016
- let o = Re(this.data, c) || {};
1017
- a.skipCopy || (s = JSON.parse(JSON.stringify(s))), n ? Xt(o, s, i) : o = {
1018
- ...o,
1019
- ...s
1020
- }, Tt(this.data, c, o), a.silent || this.emit("added", e, t, s);
1021
- }
1022
- removeResourceBundle(e, t) {
1023
- this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
1024
- }
1025
- hasResourceBundle(e, t) {
1026
- return this.getResource(e, t) !== void 0;
1027
- }
1028
- getResourceBundle(e, t) {
1029
- return t || (t = this.options.defaultNS), this.getResource(e, t);
1030
- }
1031
- getDataByLanguage(e) {
1032
- return this.data[e];
1033
- }
1034
- hasLanguageSomeTranslations(e) {
1035
- const t = this.getDataByLanguage(e);
1036
- return !!(t && Object.keys(t) || []).find((n) => t[n] && Object.keys(t[n]).length > 0);
1037
- }
1038
- toJSON() {
1039
- return this.data;
1040
- }
1041
- }
1042
- var zt = {
1043
- processors: {},
1044
- addPostProcessor(r) {
1045
- this.processors[r.name] = r;
1046
- },
1047
- handle(r, e, t, s, n) {
1048
- return r.forEach((i) => {
1049
- var a;
1050
- e = ((a = this.processors[i]) == null ? void 0 : a.process(e, t, s, n)) ?? e;
1051
- }), e;
1052
- }
1053
- };
1054
- const bt = {};
1055
- class Ie extends be {
1056
- constructor(e) {
1057
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1058
- super(), Yn(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = z.create("translator");
1059
- }
1060
- changeLanguage(e) {
1061
- e && (this.language = e);
1062
- }
1063
- exists(e) {
1064
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
1065
- interpolation: {}
1066
- };
1067
- if (e == null)
1068
- return !1;
1069
- const s = this.resolve(e, t);
1070
- return (s == null ? void 0 : s.res) !== void 0;
1071
- }
1072
- extractFromKey(e, t) {
1073
- let s = t.nsSeparator !== void 0 ? t.nsSeparator : this.options.nsSeparator;
1074
- s === void 0 && (s = ":");
1075
- const n = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
1076
- let i = t.ns || this.options.defaultNS || [];
1077
- const a = s && e.indexOf(s) > -1, c = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !ni(e, s, n);
1078
- if (a && !c) {
1079
- const o = e.match(this.interpolator.nestingRegexp);
1080
- if (o && o.length > 0)
1081
- return {
1082
- key: e,
1083
- namespaces: I(i) ? [i] : i
1084
- };
1085
- const l = e.split(s);
1086
- (s !== n || s === n && this.options.ns.indexOf(l[0]) > -1) && (i = l.shift()), e = l.join(n);
1087
- }
1088
- return {
1089
- key: e,
1090
- namespaces: I(i) ? [i] : i
1091
- };
1092
- }
1093
- translate(e, t, s) {
1094
- if (typeof t != "object" && this.options.overloadTranslationOptionHandler && (t = this.options.overloadTranslationOptionHandler(arguments)), typeof t == "object" && (t = {
1095
- ...t
1096
- }), t || (t = {}), e == null) return "";
1097
- Array.isArray(e) || (e = [String(e)]);
1098
- const n = t.returnDetails !== void 0 ? t.returnDetails : this.options.returnDetails, i = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator, {
1099
- key: a,
1100
- namespaces: c
1101
- } = this.extractFromKey(e[e.length - 1], t), o = c[c.length - 1], l = t.lng || this.language, u = t.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
1102
- if ((l == null ? void 0 : l.toLowerCase()) === "cimode") {
1103
- if (u) {
1104
- const L = t.nsSeparator || this.options.nsSeparator;
1105
- return n ? {
1106
- res: `${o}${L}${a}`,
1107
- usedKey: a,
1108
- exactUsedKey: a,
1109
- usedLng: l,
1110
- usedNS: o,
1111
- usedParams: this.getUsedParamsDetails(t)
1112
- } : `${o}${L}${a}`;
1113
- }
1114
- return n ? {
1115
- res: a,
1116
- usedKey: a,
1117
- exactUsedKey: a,
1118
- usedLng: l,
1119
- usedNS: o,
1120
- usedParams: this.getUsedParamsDetails(t)
1121
- } : a;
1122
- }
1123
- const p = this.resolve(e, t);
1124
- let d = p == null ? void 0 : p.res;
1125
- const h = (p == null ? void 0 : p.usedKey) || a, f = (p == null ? void 0 : p.exactUsedKey) || a, O = Object.prototype.toString.apply(d), $ = ["[object Number]", "[object Function]", "[object RegExp]"], A = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, U = !this.i18nFormat || this.i18nFormat.handleAsObject, T = !I(d) && typeof d != "boolean" && typeof d != "number";
1126
- if (U && d && T && $.indexOf(O) < 0 && !(I(A) && Array.isArray(d))) {
1127
- if (!t.returnObjects && !this.options.returnObjects) {
1128
- this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
1129
- const L = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(h, d, {
1130
- ...t,
1131
- ns: c
1132
- }) : `key '${a} (${this.language})' returned an object instead of string.`;
1133
- return n ? (p.res = L, p.usedParams = this.getUsedParamsDetails(t), p) : L;
1134
- }
1135
- if (i) {
1136
- const L = Array.isArray(d), k = L ? [] : {}, M = L ? f : h;
1137
- for (const x in d)
1138
- if (Object.prototype.hasOwnProperty.call(d, x)) {
1139
- const W = `${M}${i}${x}`;
1140
- k[x] = this.translate(W, {
1141
- ...t,
1142
- joinArrays: !1,
1143
- ns: c
1144
- }), k[x] === W && (k[x] = d[x]);
1145
- }
1146
- d = k;
1147
- }
1148
- } else if (U && I(A) && Array.isArray(d))
1149
- d = d.join(A), d && (d = this.extendTranslation(d, e, t, s));
1150
- else {
1151
- let L = !1, k = !1;
1152
- const M = t.count !== void 0 && !I(t.count), x = Ie.hasDefaultValue(t), W = M ? this.pluralResolver.getSuffix(l, t.count, t) : "", Z = t.ordinal && M ? this.pluralResolver.getSuffix(l, t.count, {
1153
- ordinal: !1
1154
- }) : "", Y = M && !t.ordinal && t.count === 0, Q = Y && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${W}`] || t[`defaultValue${Z}`] || t.defaultValue;
1155
- !this.isValidLookup(d) && x && (L = !0, d = Q), this.isValidLookup(d) || (k = !0, d = a);
1156
- const Ae = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && k ? void 0 : d, g = x && Q !== d && this.options.updateMissing;
1157
- if (k || L || g) {
1158
- if (this.logger.log(g ? "updateKey" : "missingKey", l, o, a, g ? Q : d), i) {
1159
- const _ = this.resolve(a, {
1160
- ...t,
1161
- keySeparator: !1
1162
- });
1163
- _ && _.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
1164
- }
1165
- let m = [];
1166
- const R = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t.lng || this.language);
1167
- if (this.options.saveMissingTo === "fallback" && R && R[0])
1168
- for (let _ = 0; _ < R.length; _++)
1169
- m.push(R[_]);
1170
- else this.options.saveMissingTo === "all" ? m = this.languageUtils.toResolveHierarchy(t.lng || this.language) : m.push(t.lng || this.language);
1171
- const v = (_, E, S) => {
1172
- var y;
1173
- const N = x && S !== d ? S : Ae;
1174
- this.options.missingKeyHandler ? this.options.missingKeyHandler(_, o, E, N, g, t) : (y = this.backendConnector) != null && y.saveMissing && this.backendConnector.saveMissing(_, o, E, N, g, t), this.emit("missingKey", _, o, E, d);
1175
- };
1176
- this.options.saveMissing && (this.options.saveMissingPlurals && M ? m.forEach((_) => {
1177
- const E = this.pluralResolver.getSuffixes(_, t);
1178
- Y && t[`defaultValue${this.options.pluralSeparator}zero`] && E.indexOf(`${this.options.pluralSeparator}zero`) < 0 && E.push(`${this.options.pluralSeparator}zero`), E.forEach((S) => {
1179
- v([_], a + S, t[`defaultValue${S}`] || Q);
1180
- });
1181
- }) : v(m, a, Q));
1182
- }
1183
- d = this.extendTranslation(d, e, t, p, s), k && d === a && this.options.appendNamespaceToMissingKey && (d = `${o}:${a}`), (k || L) && this.options.parseMissingKeyHandler && (d = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${o}:${a}` : a, L ? d : void 0));
1184
- }
1185
- return n ? (p.res = d, p.usedParams = this.getUsedParamsDetails(t), p) : d;
1186
- }
1187
- extendTranslation(e, t, s, n, i) {
1188
- var l, u;
1189
- var a = this;
1190
- if ((l = this.i18nFormat) != null && l.parse)
1191
- e = this.i18nFormat.parse(e, {
1192
- ...this.options.interpolation.defaultVariables,
1193
- ...s
1194
- }, s.lng || this.language || n.usedLng, n.usedNS, n.usedKey, {
1195
- resolved: n
1196
- });
1197
- else if (!s.skipInterpolation) {
1198
- s.interpolation && this.interpolator.init({
1199
- ...s,
1200
- interpolation: {
1201
- ...this.options.interpolation,
1202
- ...s.interpolation
1203
- }
1204
- });
1205
- const p = I(e) && (((u = s == null ? void 0 : s.interpolation) == null ? void 0 : u.skipOnVariables) !== void 0 ? s.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
1206
- let d;
1207
- if (p) {
1208
- const f = e.match(this.interpolator.nestingRegexp);
1209
- d = f && f.length;
1210
- }
1211
- let h = s.replace && !I(s.replace) ? s.replace : s;
1212
- if (this.options.interpolation.defaultVariables && (h = {
1213
- ...this.options.interpolation.defaultVariables,
1214
- ...h
1215
- }), e = this.interpolator.interpolate(e, h, s.lng || this.language || n.usedLng, s), p) {
1216
- const f = e.match(this.interpolator.nestingRegexp), O = f && f.length;
1217
- d < O && (s.nest = !1);
1218
- }
1219
- !s.lng && n && n.res && (s.lng = this.language || n.usedLng), s.nest !== !1 && (e = this.interpolator.nest(e, function() {
1220
- for (var f = arguments.length, O = new Array(f), $ = 0; $ < f; $++)
1221
- O[$] = arguments[$];
1222
- return (i == null ? void 0 : i[0]) === O[0] && !s.context ? (a.logger.warn(`It seems you are nesting recursively key: ${O[0]} in key: ${t[0]}`), null) : a.translate(...O, t);
1223
- }, s)), s.interpolation && this.interpolator.reset();
1224
- }
1225
- const c = s.postProcess || this.options.postProcess, o = I(c) ? [c] : c;
1226
- return e != null && (o != null && o.length) && s.applyPostProcessor !== !1 && (e = zt.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
1227
- i18nResolved: {
1228
- ...n,
1229
- usedParams: this.getUsedParamsDetails(s)
1230
- },
1231
- ...s
1232
- } : s, this)), e;
1233
- }
1234
- resolve(e) {
1235
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s, n, i, a, c;
1236
- return I(e) && (e = [e]), e.forEach((o) => {
1237
- if (this.isValidLookup(s)) return;
1238
- const l = this.extractFromKey(o, t), u = l.key;
1239
- n = u;
1240
- let p = l.namespaces;
1241
- this.options.fallbackNS && (p = p.concat(this.options.fallbackNS));
1242
- const d = t.count !== void 0 && !I(t.count), h = d && !t.ordinal && t.count === 0, f = t.context !== void 0 && (I(t.context) || typeof t.context == "number") && t.context !== "", O = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
1243
- p.forEach(($) => {
1244
- var A, U;
1245
- this.isValidLookup(s) || (c = $, !bt[`${O[0]}-${$}`] && ((A = this.utils) != null && A.hasLoadedNamespace) && !((U = this.utils) != null && U.hasLoadedNamespace(c)) && (bt[`${O[0]}-${$}`] = !0, this.logger.warn(`key "${n}" for languages "${O.join(", ")}" won't get resolved as namespace "${c}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), O.forEach((T) => {
1246
- var M;
1247
- if (this.isValidLookup(s)) return;
1248
- a = T;
1249
- const L = [u];
1250
- if ((M = this.i18nFormat) != null && M.addLookupKeys)
1251
- this.i18nFormat.addLookupKeys(L, u, T, $, t);
1252
- else {
1253
- let x;
1254
- d && (x = this.pluralResolver.getSuffix(T, t.count, t));
1255
- const W = `${this.options.pluralSeparator}zero`, Z = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
1256
- if (d && (L.push(u + x), t.ordinal && x.indexOf(Z) === 0 && L.push(u + x.replace(Z, this.options.pluralSeparator)), h && L.push(u + W)), f) {
1257
- const Y = `${u}${this.options.contextSeparator}${t.context}`;
1258
- L.push(Y), d && (L.push(Y + x), t.ordinal && x.indexOf(Z) === 0 && L.push(Y + x.replace(Z, this.options.pluralSeparator)), h && L.push(Y + W));
1259
- }
1260
- }
1261
- let k;
1262
- for (; k = L.pop(); )
1263
- this.isValidLookup(s) || (i = k, s = this.getResource(T, $, k, t));
1264
- }));
1265
- });
1266
- }), {
1267
- res: s,
1268
- usedKey: n,
1269
- exactUsedKey: i,
1270
- usedLng: a,
1271
- usedNS: c
1272
- };
1273
- }
1274
- isValidLookup(e) {
1275
- return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
1276
- }
1277
- getResource(e, t, s) {
1278
- var i;
1279
- let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
1280
- return (i = this.i18nFormat) != null && i.getResource ? this.i18nFormat.getResource(e, t, s, n) : this.resourceStore.getResource(e, t, s, n);
1281
- }
1282
- getUsedParamsDetails() {
1283
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1284
- const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], s = e.replace && !I(e.replace);
1285
- let n = s ? e.replace : e;
1286
- if (s && typeof e.count < "u" && (n.count = e.count), this.options.interpolation.defaultVariables && (n = {
1287
- ...this.options.interpolation.defaultVariables,
1288
- ...n
1289
- }), !s) {
1290
- n = {
1291
- ...n
1292
- };
1293
- for (const i of t)
1294
- delete n[i];
1295
- }
1296
- return n;
1297
- }
1298
- static hasDefaultValue(e) {
1299
- const t = "defaultValue";
1300
- for (const s in e)
1301
- if (Object.prototype.hasOwnProperty.call(e, s) && t === s.substring(0, t.length) && e[s] !== void 0)
1302
- return !0;
1303
- return !1;
1304
- }
1305
- }
1306
- class At {
1307
- constructor(e) {
1308
- this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = z.create("languageUtils");
1309
- }
1310
- getScriptPartFromCode(e) {
1311
- if (e = Oe(e), !e || e.indexOf("-") < 0) return null;
1312
- const t = e.split("-");
1313
- return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
1314
- }
1315
- getLanguagePartFromCode(e) {
1316
- if (e = Oe(e), !e || e.indexOf("-") < 0) return e;
1317
- const t = e.split("-");
1318
- return this.formatLanguageCode(t[0]);
1319
- }
1320
- formatLanguageCode(e) {
1321
- if (I(e) && e.indexOf("-") > -1) {
1322
- let t;
1323
- try {
1324
- t = Intl.getCanonicalLocales(e)[0];
1325
- } catch {
1326
- }
1327
- return t && this.options.lowerCaseLng && (t = t.toLowerCase()), t || (this.options.lowerCaseLng ? e.toLowerCase() : e);
1328
- }
1329
- return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
1330
- }
1331
- isSupportedCode(e) {
1332
- return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1;
1333
- }
1334
- getBestMatchFromCodes(e) {
1335
- if (!e) return null;
1336
- let t;
1337
- return e.forEach((s) => {
1338
- if (t) return;
1339
- const n = this.formatLanguageCode(s);
1340
- (!this.options.supportedLngs || this.isSupportedCode(n)) && (t = n);
1341
- }), !t && this.options.supportedLngs && e.forEach((s) => {
1342
- if (t) return;
1343
- const n = this.getLanguagePartFromCode(s);
1344
- if (this.isSupportedCode(n)) return t = n;
1345
- t = this.options.supportedLngs.find((i) => {
1346
- if (i === n) return i;
1347
- if (!(i.indexOf("-") < 0 && n.indexOf("-") < 0) && (i.indexOf("-") > 0 && n.indexOf("-") < 0 && i.substring(0, i.indexOf("-")) === n || i.indexOf(n) === 0 && n.length > 1))
1348
- return i;
1349
- });
1350
- }), t || (t = this.getFallbackCodes(this.options.fallbackLng)[0]), t;
1351
- }
1352
- getFallbackCodes(e, t) {
1353
- if (!e) return [];
1354
- if (typeof e == "function" && (e = e(t)), I(e) && (e = [e]), Array.isArray(e)) return e;
1355
- if (!t) return e.default || [];
1356
- let s = e[t];
1357
- return s || (s = e[this.getScriptPartFromCode(t)]), s || (s = e[this.formatLanguageCode(t)]), s || (s = e[this.getLanguagePartFromCode(t)]), s || (s = e.default), s || [];
1358
- }
1359
- toResolveHierarchy(e, t) {
1360
- const s = this.getFallbackCodes(t || this.options.fallbackLng || [], e), n = [], i = (a) => {
1361
- a && (this.isSupportedCode(a) ? n.push(a) : this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`));
1362
- };
1363
- return I(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && i(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && i(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && i(this.getLanguagePartFromCode(e))) : I(e) && i(this.formatLanguageCode(e)), s.forEach((a) => {
1364
- n.indexOf(a) < 0 && i(this.formatLanguageCode(a));
1365
- }), n;
1366
- }
1367
- }
1368
- const xt = {
1369
- zero: 0,
1370
- one: 1,
1371
- two: 2,
1372
- few: 3,
1373
- many: 4,
1374
- other: 5
1375
- }, Ct = {
1376
- select: (r) => r === 1 ? "one" : "other",
1377
- resolvedOptions: () => ({
1378
- pluralCategories: ["one", "other"]
1379
- })
1380
- };
1381
- class ai {
1382
- constructor(e) {
1383
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1384
- this.languageUtils = e, this.options = t, this.logger = z.create("pluralResolver"), this.pluralRulesCache = {};
1385
- }
1386
- addRule(e, t) {
1387
- this.rules[e] = t;
1388
- }
1389
- clearCache() {
1390
- this.pluralRulesCache = {};
1391
- }
1392
- getRule(e) {
1393
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1394
- const s = Oe(e === "dev" ? "en" : e), n = t.ordinal ? "ordinal" : "cardinal", i = JSON.stringify({
1395
- cleanedCode: s,
1396
- type: n
1397
- });
1398
- if (i in this.pluralRulesCache)
1399
- return this.pluralRulesCache[i];
1400
- let a;
1401
- try {
1402
- a = new Intl.PluralRules(s, {
1403
- type: n
1404
- });
1405
- } catch {
1406
- if (!Intl)
1407
- return this.logger.error("No Intl support, please use an Intl polyfill!"), Ct;
1408
- if (!e.match(/-|_/)) return Ct;
1409
- const o = this.languageUtils.getLanguagePartFromCode(e);
1410
- a = this.getRule(o, t);
1411
- }
1412
- return this.pluralRulesCache[i] = a, a;
1413
- }
1414
- needsPlural(e) {
1415
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = this.getRule(e, t);
1416
- return s || (s = this.getRule("dev", t)), (s == null ? void 0 : s.resolvedOptions().pluralCategories.length) > 1;
1417
- }
1418
- getPluralFormsOfKey(e, t) {
1419
- let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1420
- return this.getSuffixes(e, s).map((n) => `${t}${n}`);
1421
- }
1422
- getSuffixes(e) {
1423
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = this.getRule(e, t);
1424
- return s || (s = this.getRule("dev", t)), s ? s.resolvedOptions().pluralCategories.sort((n, i) => xt[n] - xt[i]).map((n) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${n}`) : [];
1425
- }
1426
- getSuffix(e, t) {
1427
- let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1428
- const n = this.getRule(e, s);
1429
- return n ? `${this.options.prepend}${s.ordinal ? `ordinal${this.options.prepend}` : ""}${n.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, s));
1430
- }
1431
- }
1432
- const Pt = function(r, e, t) {
1433
- let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, i = Zn(r, e, t);
1434
- return !i && n && I(t) && (i = Ge(r, t, s), i === void 0 && (i = Ge(e, t, s))), i;
1435
- }, Ue = (r) => r.replace(/\$/g, "$$$$");
1436
- class oi {
1437
- constructor() {
1438
- var t;
1439
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1440
- this.logger = z.create("interpolator"), this.options = e, this.format = ((t = e == null ? void 0 : e.interpolation) == null ? void 0 : t.format) || ((s) => s), this.init(e);
1441
- }
1442
- init() {
1443
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1444
- e.interpolation || (e.interpolation = {
1445
- escapeValue: !0
1446
- });
1447
- const {
1448
- escape: t,
1449
- escapeValue: s,
1450
- useRawValueToEscape: n,
1451
- prefix: i,
1452
- prefixEscaped: a,
1453
- suffix: c,
1454
- suffixEscaped: o,
1455
- formatSeparator: l,
1456
- unescapeSuffix: u,
1457
- unescapePrefix: p,
1458
- nestingPrefix: d,
1459
- nestingPrefixEscaped: h,
1460
- nestingSuffix: f,
1461
- nestingSuffixEscaped: O,
1462
- nestingOptionsSeparator: $,
1463
- maxReplaces: A,
1464
- alwaysFormat: U
1465
- } = e.interpolation;
1466
- this.escape = t !== void 0 ? t : ei, this.escapeValue = s !== void 0 ? s : !0, this.useRawValueToEscape = n !== void 0 ? n : !1, this.prefix = i ? re(i) : a || "{{", this.suffix = c ? re(c) : o || "}}", this.formatSeparator = l || ",", this.unescapePrefix = u ? "" : p || "-", this.unescapeSuffix = this.unescapePrefix ? "" : u || "", this.nestingPrefix = d ? re(d) : h || re("$t("), this.nestingSuffix = f ? re(f) : O || re(")"), this.nestingOptionsSeparator = $ || ",", this.maxReplaces = A || 1e3, this.alwaysFormat = U !== void 0 ? U : !1, this.resetRegExp();
1467
- }
1468
- reset() {
1469
- this.options && this.init(this.options);
1470
- }
1471
- resetRegExp() {
1472
- const e = (t, s) => (t == null ? void 0 : t.source) === s ? (t.lastIndex = 0, t) : new RegExp(s, "g");
1473
- this.regexp = e(this.regexp, `${this.prefix}(.+?)${this.suffix}`), this.regexpUnescape = e(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`), this.nestingRegexp = e(this.nestingRegexp, `${this.nestingPrefix}(.+?)${this.nestingSuffix}`);
1474
- }
1475
- interpolate(e, t, s, n) {
1476
- var h;
1477
- let i, a, c;
1478
- const o = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, l = (f) => {
1479
- if (f.indexOf(this.formatSeparator) < 0) {
1480
- const U = Pt(t, o, f, this.options.keySeparator, this.options.ignoreJSONStructure);
1481
- return this.alwaysFormat ? this.format(U, void 0, s, {
1482
- ...n,
1483
- ...t,
1484
- interpolationkey: f
1485
- }) : U;
1486
- }
1487
- const O = f.split(this.formatSeparator), $ = O.shift().trim(), A = O.join(this.formatSeparator).trim();
1488
- return this.format(Pt(t, o, $, this.options.keySeparator, this.options.ignoreJSONStructure), A, s, {
1489
- ...n,
1490
- ...t,
1491
- interpolationkey: $
1492
- });
1493
- };
1494
- this.resetRegExp();
1495
- const u = (n == null ? void 0 : n.missingInterpolationHandler) || this.options.missingInterpolationHandler, p = ((h = n == null ? void 0 : n.interpolation) == null ? void 0 : h.skipOnVariables) !== void 0 ? n.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
1496
- return [{
1497
- regex: this.regexpUnescape,
1498
- safeValue: (f) => Ue(f)
1499
- }, {
1500
- regex: this.regexp,
1501
- safeValue: (f) => this.escapeValue ? Ue(this.escape(f)) : Ue(f)
1502
- }].forEach((f) => {
1503
- for (c = 0; i = f.regex.exec(e); ) {
1504
- const O = i[1].trim();
1505
- if (a = l(O), a === void 0)
1506
- if (typeof u == "function") {
1507
- const A = u(e, i, n);
1508
- a = I(A) ? A : "";
1509
- } else if (n && Object.prototype.hasOwnProperty.call(n, O))
1510
- a = "";
1511
- else if (p) {
1512
- a = i[0];
1513
- continue;
1514
- } else
1515
- this.logger.warn(`missed to pass in variable ${O} for interpolating ${e}`), a = "";
1516
- else !I(a) && !this.useRawValueToEscape && (a = $t(a));
1517
- const $ = f.safeValue(a);
1518
- if (e = e.replace(i[0], $), p ? (f.regex.lastIndex += a.length, f.regex.lastIndex -= i[0].length) : f.regex.lastIndex = 0, c++, c >= this.maxReplaces)
1519
- break;
1520
- }
1521
- }), e;
1522
- }
1523
- nest(e, t) {
1524
- let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n, i, a;
1525
- const c = (o, l) => {
1526
- const u = this.nestingOptionsSeparator;
1527
- if (o.indexOf(u) < 0) return o;
1528
- const p = o.split(new RegExp(`${u}[ ]*{`));
1529
- let d = `{${p[1]}`;
1530
- o = p[0], d = this.interpolate(d, a);
1531
- const h = d.match(/'/g), f = d.match(/"/g);
1532
- (((h == null ? void 0 : h.length) ?? 0) % 2 === 0 && !f || f.length % 2 !== 0) && (d = d.replace(/'/g, '"'));
1533
- try {
1534
- a = JSON.parse(d), l && (a = {
1535
- ...l,
1536
- ...a
1537
- });
1538
- } catch (O) {
1539
- return this.logger.warn(`failed parsing options string in nesting for key ${o}`, O), `${o}${u}${d}`;
1540
- }
1541
- return a.defaultValue && a.defaultValue.indexOf(this.prefix) > -1 && delete a.defaultValue, o;
1542
- };
1543
- for (; n = this.nestingRegexp.exec(e); ) {
1544
- let o = [];
1545
- a = {
1546
- ...s
1547
- }, a = a.replace && !I(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
1548
- let l = !1;
1549
- if (n[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(n[1])) {
1550
- const u = n[1].split(this.formatSeparator).map((p) => p.trim());
1551
- n[1] = u.shift(), o = u, l = !0;
1552
- }
1553
- if (i = t(c.call(this, n[1].trim(), a), a), i && n[0] === e && !I(i)) return i;
1554
- I(i) || (i = $t(i)), i || (this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`), i = ""), l && (i = o.reduce((u, p) => this.format(u, p, s.lng, {
1555
- ...s,
1556
- interpolationkey: n[1].trim()
1557
- }), i.trim())), e = e.replace(n[0], i), this.regexp.lastIndex = 0;
1558
- }
1559
- return e;
1560
- }
1561
- }
1562
- const li = (r) => {
1563
- let e = r.toLowerCase().trim();
1564
- const t = {};
1565
- if (r.indexOf("(") > -1) {
1566
- const s = r.split("(");
1567
- e = s[0].toLowerCase().trim();
1568
- const n = s[1].substring(0, s[1].length - 1);
1569
- e === "currency" && n.indexOf(":") < 0 ? t.currency || (t.currency = n.trim()) : e === "relativetime" && n.indexOf(":") < 0 ? t.range || (t.range = n.trim()) : n.split(";").forEach((a) => {
1570
- if (a) {
1571
- const [c, ...o] = a.split(":"), l = o.join(":").trim().replace(/^'+|'+$/g, ""), u = c.trim();
1572
- t[u] || (t[u] = l), l === "false" && (t[u] = !1), l === "true" && (t[u] = !0), isNaN(l) || (t[u] = parseInt(l, 10));
1573
- }
1574
- });
1575
- }
1576
- return {
1577
- formatName: e,
1578
- formatOptions: t
1579
- };
1580
- }, ne = (r) => {
1581
- const e = {};
1582
- return (t, s, n) => {
1583
- let i = n;
1584
- n && n.interpolationkey && n.formatParams && n.formatParams[n.interpolationkey] && n[n.interpolationkey] && (i = {
1585
- ...i,
1586
- [n.interpolationkey]: void 0
1587
- });
1588
- const a = s + JSON.stringify(i);
1589
- let c = e[a];
1590
- return c || (c = r(Oe(s), n), e[a] = c), c(t);
1591
- };
1592
- };
1593
- class ci {
1594
- constructor() {
1595
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1596
- this.logger = z.create("formatter"), this.options = e, this.formats = {
1597
- number: ne((t, s) => {
1598
- const n = new Intl.NumberFormat(t, {
1599
- ...s
1600
- });
1601
- return (i) => n.format(i);
1602
- }),
1603
- currency: ne((t, s) => {
1604
- const n = new Intl.NumberFormat(t, {
1605
- ...s,
1606
- style: "currency"
1607
- });
1608
- return (i) => n.format(i);
1609
- }),
1610
- datetime: ne((t, s) => {
1611
- const n = new Intl.DateTimeFormat(t, {
1612
- ...s
1613
- });
1614
- return (i) => n.format(i);
1615
- }),
1616
- relativetime: ne((t, s) => {
1617
- const n = new Intl.RelativeTimeFormat(t, {
1618
- ...s
1619
- });
1620
- return (i) => n.format(i, s.range || "day");
1621
- }),
1622
- list: ne((t, s) => {
1623
- const n = new Intl.ListFormat(t, {
1624
- ...s
1625
- });
1626
- return (i) => n.format(i);
1627
- })
1628
- }, this.init(e);
1629
- }
1630
- init(e) {
1631
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
1632
- interpolation: {}
1633
- };
1634
- this.formatSeparator = t.interpolation.formatSeparator || ",";
1635
- }
1636
- add(e, t) {
1637
- this.formats[e.toLowerCase().trim()] = t;
1638
- }
1639
- addCached(e, t) {
1640
- this.formats[e.toLowerCase().trim()] = ne(t);
1641
- }
1642
- format(e, t, s) {
1643
- let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
1644
- const i = t.split(this.formatSeparator);
1645
- if (i.length > 1 && i[0].indexOf("(") > 1 && i[0].indexOf(")") < 0 && i.find((c) => c.indexOf(")") > -1)) {
1646
- const c = i.findIndex((o) => o.indexOf(")") > -1);
1647
- i[0] = [i[0], ...i.splice(1, c)].join(this.formatSeparator);
1648
- }
1649
- return i.reduce((c, o) => {
1650
- var p;
1651
- const {
1652
- formatName: l,
1653
- formatOptions: u
1654
- } = li(o);
1655
- if (this.formats[l]) {
1656
- let d = c;
1657
- try {
1658
- const h = ((p = n == null ? void 0 : n.formatParams) == null ? void 0 : p[n.interpolationkey]) || {}, f = h.locale || h.lng || n.locale || n.lng || s;
1659
- d = this.formats[l](c, f, {
1660
- ...u,
1661
- ...n,
1662
- ...h
1663
- });
1664
- } catch (h) {
1665
- this.logger.warn(h);
1666
- }
1667
- return d;
1668
- } else
1669
- this.logger.warn(`there was no format function for ${l}`);
1670
- return c;
1671
- }, e);
1672
- }
1673
- }
1674
- const ui = (r, e) => {
1675
- r.pending[e] !== void 0 && (delete r.pending[e], r.pendingCount--);
1676
- };
1677
- class pi extends be {
1678
- constructor(e, t, s) {
1679
- var i, a;
1680
- let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
1681
- super(), this.backend = e, this.store = t, this.services = s, this.languageUtils = s.languageUtils, this.options = n, this.logger = z.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = n.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = n.maxRetries >= 0 ? n.maxRetries : 5, this.retryTimeout = n.retryTimeout >= 1 ? n.retryTimeout : 350, this.state = {}, this.queue = [], (a = (i = this.backend) == null ? void 0 : i.init) == null || a.call(i, s, n.backend, n);
1682
- }
1683
- queueLoad(e, t, s, n) {
1684
- const i = {}, a = {}, c = {}, o = {};
1685
- return e.forEach((l) => {
1686
- let u = !0;
1687
- t.forEach((p) => {
1688
- const d = `${l}|${p}`;
1689
- !s.reload && this.store.hasResourceBundle(l, p) ? this.state[d] = 2 : this.state[d] < 0 || (this.state[d] === 1 ? a[d] === void 0 && (a[d] = !0) : (this.state[d] = 1, u = !1, a[d] === void 0 && (a[d] = !0), i[d] === void 0 && (i[d] = !0), o[p] === void 0 && (o[p] = !0)));
1690
- }), u || (c[l] = !0);
1691
- }), (Object.keys(i).length || Object.keys(a).length) && this.queue.push({
1692
- pending: a,
1693
- pendingCount: Object.keys(a).length,
1694
- loaded: {},
1695
- errors: [],
1696
- callback: n
1697
- }), {
1698
- toLoad: Object.keys(i),
1699
- pending: Object.keys(a),
1700
- toLoadLanguages: Object.keys(c),
1701
- toLoadNamespaces: Object.keys(o)
1702
- };
1703
- }
1704
- loaded(e, t, s) {
1705
- const n = e.split("|"), i = n[0], a = n[1];
1706
- t && this.emit("failedLoading", i, a, t), !t && s && this.store.addResourceBundle(i, a, s, void 0, void 0, {
1707
- skipCopy: !0
1708
- }), this.state[e] = t ? -1 : 2, t && s && (this.state[e] = 0);
1709
- const c = {};
1710
- this.queue.forEach((o) => {
1711
- qn(o.loaded, [i], a), ui(o, e), t && o.errors.push(t), o.pendingCount === 0 && !o.done && (Object.keys(o.loaded).forEach((l) => {
1712
- c[l] || (c[l] = {});
1713
- const u = o.loaded[l];
1714
- u.length && u.forEach((p) => {
1715
- c[l][p] === void 0 && (c[l][p] = !0);
1716
- });
1717
- }), o.done = !0, o.errors.length ? o.callback(o.errors) : o.callback());
1718
- }), this.emit("loaded", c), this.queue = this.queue.filter((o) => !o.done);
1719
- }
1720
- read(e, t, s) {
1721
- let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout, a = arguments.length > 5 ? arguments[5] : void 0;
1722
- if (!e.length) return a(null, {});
1723
- if (this.readingCalls >= this.maxParallelReads) {
1724
- this.waitingReads.push({
1725
- lng: e,
1726
- ns: t,
1727
- fcName: s,
1728
- tried: n,
1729
- wait: i,
1730
- callback: a
1731
- });
1732
- return;
1733
- }
1734
- this.readingCalls++;
1735
- const c = (l, u) => {
1736
- if (this.readingCalls--, this.waitingReads.length > 0) {
1737
- const p = this.waitingReads.shift();
1738
- this.read(p.lng, p.ns, p.fcName, p.tried, p.wait, p.callback);
1739
- }
1740
- if (l && u && n < this.maxRetries) {
1741
- setTimeout(() => {
1742
- this.read.call(this, e, t, s, n + 1, i * 2, a);
1743
- }, i);
1744
- return;
1745
- }
1746
- a(l, u);
1747
- }, o = this.backend[s].bind(this.backend);
1748
- if (o.length === 2) {
1749
- try {
1750
- const l = o(e, t);
1751
- l && typeof l.then == "function" ? l.then((u) => c(null, u)).catch(c) : c(null, l);
1752
- } catch (l) {
1753
- c(l);
1754
- }
1755
- return;
1756
- }
1757
- return o(e, t, c);
1758
- }
1759
- prepareLoading(e, t) {
1760
- let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n = arguments.length > 3 ? arguments[3] : void 0;
1761
- if (!this.backend)
1762
- return this.logger.warn("No backend was added via i18next.use. Will not load resources."), n && n();
1763
- I(e) && (e = this.languageUtils.toResolveHierarchy(e)), I(t) && (t = [t]);
1764
- const i = this.queueLoad(e, t, s, n);
1765
- if (!i.toLoad.length)
1766
- return i.pending.length || n(), null;
1767
- i.toLoad.forEach((a) => {
1768
- this.loadOne(a);
1769
- });
1770
- }
1771
- load(e, t, s) {
1772
- this.prepareLoading(e, t, {}, s);
1773
- }
1774
- reload(e, t, s) {
1775
- this.prepareLoading(e, t, {
1776
- reload: !0
1777
- }, s);
1778
- }
1779
- loadOne(e) {
1780
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
1781
- const s = e.split("|"), n = s[0], i = s[1];
1782
- this.read(n, i, "read", void 0, void 0, (a, c) => {
1783
- a && this.logger.warn(`${t}loading namespace ${i} for language ${n} failed`, a), !a && c && this.logger.log(`${t}loaded namespace ${i} for language ${n}`, c), this.loaded(e, a, c);
1784
- });
1785
- }
1786
- saveMissing(e, t, s, n, i) {
1787
- var o, l, u, p, d;
1788
- let a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {}, c = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : () => {
1789
- };
1790
- if ((l = (o = this.services) == null ? void 0 : o.utils) != null && l.hasLoadedNamespace && !((p = (u = this.services) == null ? void 0 : u.utils) != null && p.hasLoadedNamespace(t))) {
1791
- this.logger.warn(`did not save key "${s}" as the namespace "${t}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
1792
- return;
1793
- }
1794
- if (!(s == null || s === "")) {
1795
- if ((d = this.backend) != null && d.create) {
1796
- const h = {
1797
- ...a,
1798
- isUpdate: i
1799
- }, f = this.backend.create.bind(this.backend);
1800
- if (f.length < 6)
1801
- try {
1802
- let O;
1803
- f.length === 5 ? O = f(e, t, s, n, h) : O = f(e, t, s, n), O && typeof O.then == "function" ? O.then(($) => c(null, $)).catch(c) : c(null, O);
1804
- } catch (O) {
1805
- c(O);
1806
- }
1807
- else
1808
- f(e, t, s, n, c, h);
1809
- }
1810
- !e || !e[0] || this.store.addResource(e[0], t, s, n);
1811
- }
1812
- }
1813
- }
1814
- const wt = () => ({
1815
- debug: !1,
1816
- initAsync: !0,
1817
- ns: ["translation"],
1818
- defaultNS: ["translation"],
1819
- fallbackLng: ["dev"],
1820
- fallbackNS: !1,
1821
- supportedLngs: !1,
1822
- nonExplicitSupportedLngs: !1,
1823
- load: "all",
1824
- preload: !1,
1825
- simplifyPluralSuffix: !0,
1826
- keySeparator: ".",
1827
- nsSeparator: ":",
1828
- pluralSeparator: "_",
1829
- contextSeparator: "_",
1830
- partialBundledLanguages: !1,
1831
- saveMissing: !1,
1832
- updateMissing: !1,
1833
- saveMissingTo: "fallback",
1834
- saveMissingPlurals: !0,
1835
- missingKeyHandler: !1,
1836
- missingInterpolationHandler: !1,
1837
- postProcess: !1,
1838
- postProcessPassResolved: !1,
1839
- returnNull: !1,
1840
- returnEmptyString: !0,
1841
- returnObjects: !1,
1842
- joinArrays: !1,
1843
- returnedObjectHandler: !1,
1844
- parseMissingKeyHandler: !1,
1845
- appendNamespaceToMissingKey: !1,
1846
- appendNamespaceToCIMode: !1,
1847
- overloadTranslationOptionHandler: (r) => {
1848
- let e = {};
1849
- if (typeof r[1] == "object" && (e = r[1]), I(r[1]) && (e.defaultValue = r[1]), I(r[2]) && (e.tDescription = r[2]), typeof r[2] == "object" || typeof r[3] == "object") {
1850
- const t = r[3] || r[2];
1851
- Object.keys(t).forEach((s) => {
1852
- e[s] = t[s];
1853
- });
1854
- }
1855
- return e;
1856
- },
1857
- interpolation: {
1858
- escapeValue: !0,
1859
- format: (r) => r,
1860
- prefix: "{{",
1861
- suffix: "}}",
1862
- formatSeparator: ",",
1863
- unescapePrefix: "-",
1864
- nestingPrefix: "$t(",
1865
- nestingSuffix: ")",
1866
- nestingOptionsSeparator: ",",
1867
- maxReplaces: 1e3,
1868
- skipOnVariables: !0
1869
- }
1870
- }), kt = (r) => {
1871
- var e, t;
1872
- return I(r.ns) && (r.ns = [r.ns]), I(r.fallbackLng) && (r.fallbackLng = [r.fallbackLng]), I(r.fallbackNS) && (r.fallbackNS = [r.fallbackNS]), ((t = (e = r.supportedLngs) == null ? void 0 : e.indexOf) == null ? void 0 : t.call(e, "cimode")) < 0 && (r.supportedLngs = r.supportedLngs.concat(["cimode"])), typeof r.initImmediate == "boolean" && (r.initAsync = r.initImmediate), r;
1873
- }, Ee = () => {
1874
- }, di = (r) => {
1875
- Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach((t) => {
1876
- typeof r[t] == "function" && (r[t] = r[t].bind(r));
1877
- });
1878
- };
1879
- class pe extends be {
1880
- constructor() {
1881
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
1882
- if (super(), this.options = kt(e), this.services = {}, this.logger = z, this.modules = {
1883
- external: []
1884
- }, di(this), t && !this.isInitialized && !e.isClone) {
1885
- if (!this.options.initAsync)
1886
- return this.init(e, t), this;
1887
- setTimeout(() => {
1888
- this.init(e, t);
1889
- }, 0);
1890
- }
1891
- }
1892
- init() {
1893
- var e = this;
1894
- let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, s = arguments.length > 1 ? arguments[1] : void 0;
1895
- this.isInitializing = !0, typeof t == "function" && (s = t, t = {}), t.defaultNS == null && t.ns && (I(t.ns) ? t.defaultNS = t.ns : t.ns.indexOf("translation") < 0 && (t.defaultNS = t.ns[0]));
1896
- const n = wt();
1897
- this.options = {
1898
- ...n,
1899
- ...this.options,
1900
- ...kt(t)
1901
- }, this.options.interpolation = {
1902
- ...n.interpolation,
1903
- ...this.options.interpolation
1904
- }, t.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = t.keySeparator), t.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = t.nsSeparator);
1905
- const i = (u) => u ? typeof u == "function" ? new u() : u : null;
1906
- if (!this.options.isClone) {
1907
- this.modules.logger ? z.init(i(this.modules.logger), this.options) : z.init(null, this.options);
1908
- let u;
1909
- this.modules.formatter ? u = this.modules.formatter : u = ci;
1910
- const p = new At(this.options);
1911
- this.store = new Lt(this.options.resources, this.options);
1912
- const d = this.services;
1913
- d.logger = z, d.resourceStore = this.store, d.languageUtils = p, d.pluralResolver = new ai(p, {
1914
- prepend: this.options.pluralSeparator,
1915
- simplifyPluralSuffix: this.options.simplifyPluralSuffix
1916
- }), u && (!this.options.interpolation.format || this.options.interpolation.format === n.interpolation.format) && (d.formatter = i(u), d.formatter.init(d, this.options), this.options.interpolation.format = d.formatter.format.bind(d.formatter)), d.interpolator = new oi(this.options), d.utils = {
1917
- hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
1918
- }, d.backendConnector = new pi(i(this.modules.backend), d.resourceStore, d, this.options), d.backendConnector.on("*", function(h) {
1919
- for (var f = arguments.length, O = new Array(f > 1 ? f - 1 : 0), $ = 1; $ < f; $++)
1920
- O[$ - 1] = arguments[$];
1921
- e.emit(h, ...O);
1922
- }), this.modules.languageDetector && (d.languageDetector = i(this.modules.languageDetector), d.languageDetector.init && d.languageDetector.init(d, this.options.detection, this.options)), this.modules.i18nFormat && (d.i18nFormat = i(this.modules.i18nFormat), d.i18nFormat.init && d.i18nFormat.init(this)), this.translator = new Ie(this.services, this.options), this.translator.on("*", function(h) {
1923
- for (var f = arguments.length, O = new Array(f > 1 ? f - 1 : 0), $ = 1; $ < f; $++)
1924
- O[$ - 1] = arguments[$];
1925
- e.emit(h, ...O);
1926
- }), this.modules.external.forEach((h) => {
1927
- h.init && h.init(this);
1928
- });
1929
- }
1930
- if (this.format = this.options.interpolation.format, s || (s = Ee), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1931
- const u = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1932
- u.length > 0 && u[0] !== "dev" && (this.options.lng = u[0]);
1933
- }
1934
- !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach((u) => {
1935
- this[u] = function() {
1936
- return e.store[u](...arguments);
1937
- };
1938
- }), ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((u) => {
1939
- this[u] = function() {
1940
- return e.store[u](...arguments), e;
1941
- };
1942
- });
1943
- const o = le(), l = () => {
1944
- const u = (p, d) => {
1945
- this.isInitializing = !1, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), o.resolve(d), s(p, d);
1946
- };
1947
- if (this.languages && !this.isInitialized) return u(null, this.t.bind(this));
1948
- this.changeLanguage(this.options.lng, u);
1949
- };
1950
- return this.options.resources || !this.options.initAsync ? l() : setTimeout(l, 0), o;
1951
- }
1952
- loadResources(e) {
1953
- var i, a;
1954
- let s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Ee;
1955
- const n = I(e) ? e : this.language;
1956
- if (typeof e == "function" && (s = e), !this.options.resources || this.options.partialBundledLanguages) {
1957
- if ((n == null ? void 0 : n.toLowerCase()) === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return s();
1958
- const c = [], o = (l) => {
1959
- if (!l || l === "cimode") return;
1960
- this.services.languageUtils.toResolveHierarchy(l).forEach((p) => {
1961
- p !== "cimode" && c.indexOf(p) < 0 && c.push(p);
1962
- });
1963
- };
1964
- n ? o(n) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((u) => o(u)), (a = (i = this.options.preload) == null ? void 0 : i.forEach) == null || a.call(i, (l) => o(l)), this.services.backendConnector.load(c, this.options.ns, (l) => {
1965
- !l && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), s(l);
1966
- });
1967
- } else
1968
- s(null);
1969
- }
1970
- reloadResources(e, t, s) {
1971
- const n = le();
1972
- return typeof e == "function" && (s = e, e = void 0), typeof t == "function" && (s = t, t = void 0), e || (e = this.languages), t || (t = this.options.ns), s || (s = Ee), this.services.backendConnector.reload(e, t, (i) => {
1973
- n.resolve(), s(i);
1974
- }), n;
1975
- }
1976
- use(e) {
1977
- if (!e) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
1978
- if (!e.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
1979
- return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && zt.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
1980
- }
1981
- setResolvedLanguage(e) {
1982
- if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1))
1983
- for (let t = 0; t < this.languages.length; t++) {
1984
- const s = this.languages[t];
1985
- if (!(["cimode", "dev"].indexOf(s) > -1) && this.store.hasLanguageSomeTranslations(s)) {
1986
- this.resolvedLanguage = s;
1987
- break;
1988
- }
1989
- }
1990
- }
1991
- changeLanguage(e, t) {
1992
- var s = this;
1993
- this.isLanguageChangingTo = e;
1994
- const n = le();
1995
- this.emit("languageChanging", e);
1996
- const i = (o) => {
1997
- this.language = o, this.languages = this.services.languageUtils.toResolveHierarchy(o), this.resolvedLanguage = void 0, this.setResolvedLanguage(o);
1998
- }, a = (o, l) => {
1999
- l ? (i(l), this.translator.changeLanguage(l), this.isLanguageChangingTo = void 0, this.emit("languageChanged", l), this.logger.log("languageChanged", l)) : this.isLanguageChangingTo = void 0, n.resolve(function() {
2000
- return s.t(...arguments);
2001
- }), t && t(o, function() {
2002
- return s.t(...arguments);
2003
- });
2004
- }, c = (o) => {
2005
- var u, p;
2006
- !e && !o && this.services.languageDetector && (o = []);
2007
- const l = I(o) ? o : this.services.languageUtils.getBestMatchFromCodes(o);
2008
- l && (this.language || i(l), this.translator.language || this.translator.changeLanguage(l), (p = (u = this.services.languageDetector) == null ? void 0 : u.cacheUserLanguage) == null || p.call(u, l)), this.loadResources(l, (d) => {
2009
- a(d, l);
2010
- });
2011
- };
2012
- return !e && this.services.languageDetector && !this.services.languageDetector.async ? c(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(c) : this.services.languageDetector.detect(c) : c(e), n;
2013
- }
2014
- getFixedT(e, t, s) {
2015
- var n = this;
2016
- const i = function(a, c) {
2017
- let o;
2018
- if (typeof c != "object") {
2019
- for (var l = arguments.length, u = new Array(l > 2 ? l - 2 : 0), p = 2; p < l; p++)
2020
- u[p - 2] = arguments[p];
2021
- o = n.options.overloadTranslationOptionHandler([a, c].concat(u));
2022
- } else
2023
- o = {
2024
- ...c
2025
- };
2026
- o.lng = o.lng || i.lng, o.lngs = o.lngs || i.lngs, o.ns = o.ns || i.ns, o.keyPrefix !== "" && (o.keyPrefix = o.keyPrefix || s || i.keyPrefix);
2027
- const d = n.options.keySeparator || ".";
2028
- let h;
2029
- return o.keyPrefix && Array.isArray(a) ? h = a.map((f) => `${o.keyPrefix}${d}${f}`) : h = o.keyPrefix ? `${o.keyPrefix}${d}${a}` : a, n.t(h, o);
2030
- };
2031
- return I(e) ? i.lng = e : i.lngs = e, i.ns = t, i.keyPrefix = s, i;
2032
- }
2033
- t() {
2034
- var n;
2035
- for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)
2036
- t[s] = arguments[s];
2037
- return (n = this.translator) == null ? void 0 : n.translate(...t);
2038
- }
2039
- exists() {
2040
- var n;
2041
- for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)
2042
- t[s] = arguments[s];
2043
- return (n = this.translator) == null ? void 0 : n.exists(...t);
2044
- }
2045
- setDefaultNamespace(e) {
2046
- this.options.defaultNS = e;
2047
- }
2048
- hasLoadedNamespace(e) {
2049
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2050
- if (!this.isInitialized)
2051
- return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
2052
- if (!this.languages || !this.languages.length)
2053
- return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
2054
- const s = t.lng || this.resolvedLanguage || this.languages[0], n = this.options ? this.options.fallbackLng : !1, i = this.languages[this.languages.length - 1];
2055
- if (s.toLowerCase() === "cimode") return !0;
2056
- const a = (c, o) => {
2057
- const l = this.services.backendConnector.state[`${c}|${o}`];
2058
- return l === -1 || l === 0 || l === 2;
2059
- };
2060
- if (t.precheck) {
2061
- const c = t.precheck(this, a);
2062
- if (c !== void 0) return c;
2063
- }
2064
- return !!(this.hasResourceBundle(s, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(s, e) && (!n || a(i, e)));
2065
- }
2066
- loadNamespaces(e, t) {
2067
- const s = le();
2068
- return this.options.ns ? (I(e) && (e = [e]), e.forEach((n) => {
2069
- this.options.ns.indexOf(n) < 0 && this.options.ns.push(n);
2070
- }), this.loadResources((n) => {
2071
- s.resolve(), t && t(n);
2072
- }), s) : (t && t(), Promise.resolve());
2073
- }
2074
- loadLanguages(e, t) {
2075
- const s = le();
2076
- I(e) && (e = [e]);
2077
- const n = this.options.preload || [], i = e.filter((a) => n.indexOf(a) < 0 && this.services.languageUtils.isSupportedCode(a));
2078
- return i.length ? (this.options.preload = n.concat(i), this.loadResources((a) => {
2079
- s.resolve(), t && t(a);
2080
- }), s) : (t && t(), Promise.resolve());
2081
- }
2082
- dir(e) {
2083
- var n, i;
2084
- if (e || (e = this.resolvedLanguage || (((n = this.languages) == null ? void 0 : n.length) > 0 ? this.languages[0] : this.language)), !e) return "rtl";
2085
- const t = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], s = ((i = this.services) == null ? void 0 : i.languageUtils) || new At(wt());
2086
- return t.indexOf(s.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
2087
- }
2088
- static createInstance() {
2089
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
2090
- return new pe(e, t);
2091
- }
2092
- cloneInstance() {
2093
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Ee;
2094
- const s = e.forkResourceStore;
2095
- s && delete e.forkResourceStore;
2096
- const n = {
2097
- ...this.options,
2098
- ...e,
2099
- isClone: !0
2100
- }, i = new pe(n);
2101
- if ((e.debug !== void 0 || e.prefix !== void 0) && (i.logger = i.logger.clone(e)), ["store", "services", "language"].forEach((c) => {
2102
- i[c] = this[c];
2103
- }), i.services = {
2104
- ...this.services
2105
- }, i.services.utils = {
2106
- hasLoadedNamespace: i.hasLoadedNamespace.bind(i)
2107
- }, s) {
2108
- const c = Object.keys(this.store.data).reduce((o, l) => (o[l] = {
2109
- ...this.store.data[l]
2110
- }, Object.keys(o[l]).reduce((u, p) => (u[p] = {
2111
- ...o[l][p]
2112
- }, u), {})), {});
2113
- i.store = new Lt(c, n), i.services.resourceStore = i.store;
2114
- }
2115
- return i.translator = new Ie(i.services, n), i.translator.on("*", function(c) {
2116
- for (var o = arguments.length, l = new Array(o > 1 ? o - 1 : 0), u = 1; u < o; u++)
2117
- l[u - 1] = arguments[u];
2118
- i.emit(c, ...l);
2119
- }), i.init(n, t), i.translator.options = n, i.translator.backendConnector.services.utils = {
2120
- hasLoadedNamespace: i.hasLoadedNamespace.bind(i)
2121
- }, i;
2122
- }
2123
- toJSON() {
2124
- return {
2125
- options: this.options,
2126
- store: this.store,
2127
- language: this.language,
2128
- languages: this.languages,
2129
- resolvedLanguage: this.resolvedLanguage
2130
- };
2131
- }
2132
- }
2133
- const w = pe.createInstance();
2134
- w.createInstance = pe.createInstance;
2135
- w.createInstance;
2136
- w.dir;
2137
- w.init;
2138
- w.loadResources;
2139
- w.reloadResources;
2140
- w.use;
2141
- w.changeLanguage;
2142
- w.getFixedT;
2143
- w.t;
2144
- w.exists;
2145
- w.setDefaultNamespace;
2146
- w.hasLoadedNamespace;
2147
- w.loadNamespaces;
2148
- w.loadLanguages;
2149
- var fi = (r, e) => typeof e == "bigint" ? e.toString() : e;
2150
- function Fe(r, e = " | ") {
2151
- return r.map((t) => typeof t == "string" ? `'${t}'` : t).join(e);
2152
- }
2153
- var Dt = (r) => {
2154
- if (typeof r != "object" || r === null)
2155
- return !1;
2156
- for (const e in r)
2157
- if (!Object.prototype.hasOwnProperty.call(r, e))
2158
- return !1;
2159
- return !0;
2160
- }, hi = (r, e) => {
2161
- if (typeof r == "string")
2162
- return { key: r, values: {} };
2163
- if (Dt(r)) {
2164
- const t = "key" in r && typeof r.key == "string" ? r.key : e, s = "values" in r && Dt(r.values) ? r.values : {};
2165
- return { key: t, values: s };
2166
- }
2167
- return { key: e, values: {} };
2168
- }, Ut = "zod", mi = (r) => (e, t) => {
2169
- var o;
2170
- const { t: s, ns: n, handlePath: i } = {
2171
- t: w.t,
2172
- ns: Ut,
2173
- ...r,
2174
- handlePath: (r == null ? void 0 : r.handlePath) !== !1 ? {
2175
- context: "with_path",
2176
- ns: (r == null ? void 0 : r.ns) ?? Ut,
2177
- keyPrefix: void 0,
2178
- ...r == null ? void 0 : r.handlePath
2179
- } : null
2180
- };
2181
- let a;
2182
- a = Qt(e, t).message;
2183
- const c = e.path.length > 0 && i ? {
2184
- context: i.context,
2185
- path: s(
2186
- [i.keyPrefix, e.path.join(".")].filter(Boolean).join("."),
2187
- {
2188
- ns: i.ns,
2189
- defaultValue: e.path.join(".")
2190
- }
2191
- )
2192
- } : {};
2193
- switch (e.code) {
2194
- case D.invalid_type:
2195
- e.received === st.undefined ? a = s("errors.invalid_type_received_undefined", {
2196
- ns: n,
2197
- defaultValue: a,
2198
- ...c
2199
- }) : e.received === st.null ? a = s("errors.invalid_type_received_null", {
2200
- ns: n,
2201
- defaultValue: a,
2202
- ...c
2203
- }) : a = s("errors.invalid_type", {
2204
- expected: s(`types.${e.expected}`, {
2205
- defaultValue: e.expected,
2206
- ns: n
2207
- }),
2208
- received: s(`types.${e.received}`, {
2209
- defaultValue: e.received,
2210
- ns: n
2211
- }),
2212
- ns: n,
2213
- defaultValue: a,
2214
- ...c
2215
- });
2216
- break;
2217
- case D.invalid_literal:
2218
- a = s("errors.invalid_literal", {
2219
- expected: JSON.stringify(e.expected, fi),
2220
- ns: n,
2221
- defaultValue: a,
2222
- ...c
2223
- });
2224
- break;
2225
- case D.unrecognized_keys:
2226
- a = s("errors.unrecognized_keys", {
2227
- keys: Fe(e.keys, ", "),
2228
- count: e.keys.length,
2229
- ns: n,
2230
- defaultValue: a,
2231
- ...c
2232
- });
2233
- break;
2234
- case D.invalid_union:
2235
- a = s("errors.invalid_union", {
2236
- ns: n,
2237
- defaultValue: a,
2238
- ...c
2239
- });
2240
- break;
2241
- case D.invalid_union_discriminator:
2242
- a = s("errors.invalid_union_discriminator", {
2243
- options: Fe(e.options),
2244
- ns: n,
2245
- defaultValue: a,
2246
- ...c
2247
- });
2248
- break;
2249
- case D.invalid_enum_value:
2250
- a = s("errors.invalid_enum_value", {
2251
- options: Fe(e.options),
2252
- received: e.received,
2253
- ns: n,
2254
- defaultValue: a,
2255
- ...c
2256
- });
2257
- break;
2258
- case D.invalid_arguments:
2259
- a = s("errors.invalid_arguments", {
2260
- ns: n,
2261
- defaultValue: a,
2262
- ...c
2263
- });
2264
- break;
2265
- case D.invalid_return_type:
2266
- a = s("errors.invalid_return_type", {
2267
- ns: n,
2268
- defaultValue: a,
2269
- ...c
2270
- });
2271
- break;
2272
- case D.invalid_date:
2273
- a = s("errors.invalid_date", {
2274
- ns: n,
2275
- defaultValue: a,
2276
- ...c
2277
- });
2278
- break;
2279
- case D.invalid_string:
2280
- typeof e.validation == "object" ? "startsWith" in e.validation ? a = s("errors.invalid_string.startsWith", {
2281
- startsWith: e.validation.startsWith,
2282
- ns: n,
2283
- defaultValue: a,
2284
- ...c
2285
- }) : "endsWith" in e.validation && (a = s("errors.invalid_string.endsWith", {
2286
- endsWith: e.validation.endsWith,
2287
- ns: n,
2288
- defaultValue: a,
2289
- ...c
2290
- })) : a = s(`errors.invalid_string.${e.validation}`, {
2291
- validation: s(`validations.${e.validation}`, {
2292
- defaultValue: e.validation,
2293
- ns: n
2294
- }),
2295
- ns: n,
2296
- defaultValue: a,
2297
- ...c
2298
- });
2299
- break;
2300
- case D.too_small:
2301
- const l = e.type === "date" ? new Date(e.minimum) : e.minimum;
2302
- a = s(
2303
- `errors.too_small.${e.type}.${e.exact ? "exact" : e.inclusive ? "inclusive" : "not_inclusive"}`,
2304
- {
2305
- minimum: l,
2306
- count: typeof l == "number" ? l : void 0,
2307
- ns: n,
2308
- defaultValue: a,
2309
- ...c
2310
- }
2311
- );
2312
- break;
2313
- case D.too_big:
2314
- const u = e.type === "date" ? new Date(e.maximum) : e.maximum;
2315
- a = s(
2316
- `errors.too_big.${e.type}.${e.exact ? "exact" : e.inclusive ? "inclusive" : "not_inclusive"}`,
2317
- {
2318
- maximum: u,
2319
- count: typeof u == "number" ? u : void 0,
2320
- ns: n,
2321
- defaultValue: a,
2322
- ...c
2323
- }
2324
- );
2325
- break;
2326
- case D.custom:
2327
- const { key: p, values: d } = hi(
2328
- (o = e.params) == null ? void 0 : o.i18n,
2329
- "errors.custom"
2330
- );
2331
- a = s(p, {
2332
- ...d,
2333
- ns: n,
2334
- defaultValue: a,
2335
- ...c
2336
- });
2337
- break;
2338
- case D.invalid_intersection_types:
2339
- a = s("errors.invalid_intersection_types", {
2340
- ns: n,
2341
- defaultValue: a,
2342
- ...c
2343
- });
2344
- break;
2345
- case D.not_multiple_of:
2346
- a = s("errors.not_multiple_of", {
2347
- multipleOf: e.multipleOf,
2348
- ns: n,
2349
- defaultValue: a,
2350
- ...c
2351
- });
2352
- break;
2353
- case D.not_finite:
2354
- a = s("errors.not_finite", {
2355
- ns: n,
2356
- defaultValue: a,
2357
- ...c
2358
- });
2359
- break;
2360
- }
2361
- return { message: a };
2362
- };
2363
- const gi = ts({
2364
- locale: Ke(),
2365
- messages: Ft
2366
- });
2367
- console.log(Ke());
2368
- w.init({
2369
- lng: Ke(),
2370
- resources: Ft
2371
- });
2372
- es.setErrorMap(mi({ ns: ["connectZod", "connectZodCustom"] }));
2373
- const He = gi;
2374
- function K(r) {
2375
- return ce(
2376
- "div",
2377
- {
2378
- class: `${r.chipClass} gap-4 h-[22px] inline-flex items-center justify-center min-w-min px-8 rounded-md`
2379
- },
2380
- [
2381
- ce(je.FmIcon, { size: "sm", name: r.icon, outline: !0 }),
2382
- ce("span", { class: "fm-typo-en-body-md-600" }, r.name)
2383
- ]
2384
- );
2385
- }
2386
- const xi = {
2387
- [B.enum.CREDIT]: {
2388
- chipClass: "!text-fm-color-secondary-plum !bg-[#f2ebfe]",
2389
- icon: "local_activity",
2390
- name: "Credit",
2391
- chip() {
2392
- return K(this);
2393
- }
2394
- },
2395
- [B.enum.PROMOTION]: {
2396
- chipClass: "!text-fm-color-secondary-citrus !bg-fm-color-system-warning-100",
2397
- icon: "loyalty",
2398
- name: "Promotion",
2399
- chip() {
2400
- return K(this);
2401
- }
2402
- },
2403
- [B.enum.VOUCHER]: {
2404
- chipClass: "!text-fm-color-secondary-halite !bg-[#fff0f6]",
2405
- icon: "sell",
2406
- name: He.global.t("connect.campaign.voucher.title"),
2407
- chip() {
2408
- return K(this);
2409
- }
2410
- },
2411
- [B.enum.POINT]: {
2412
- chipClass: "!text-fm-color-secondary-cocoa !bg-[#fff9e6]",
2413
- icon: "award_star",
2414
- name: "Experience",
2415
- chip() {
2416
- return K(this);
2417
- }
2418
- },
2419
- [B.enum.BROADCAST]: {
2420
- chipClass: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
2421
- icon: "campaign",
2422
- name: "Broadcast",
2423
- chip() {
2424
- return K(this);
2425
- }
2426
- },
2427
- [B.enum.GAME]: {
2428
- chipClass: "!text-fm-color-secondary-mint !bg-fm-color-system-success-100",
2429
- icon: "database",
2430
- name: "Token",
2431
- chip() {
2432
- return K(this);
2433
- }
2434
- },
2435
- [B.enum.REWARD_POOL]: {
2436
- chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
2437
- icon: "editor_choice",
2438
- name: "Reward Pool",
2439
- chip() {
2440
- return K(this);
2441
- }
2442
- },
2443
- [B.enum.COIN]: {
2444
- chipClass: "!text-fm-color-system-success-400 !bg-fm-color-system-success-100",
2445
- icon: "monetization_on",
2446
- name: "Point",
2447
- chip() {
2448
- return K(this);
2449
- }
2450
- },
2451
- [B.enum.MEMBERSHIP]: {
2452
- chipClass: "",
2453
- icon: "",
2454
- name: "Membership",
2455
- chip() {
2456
- return K(this);
2457
- }
2458
- },
2459
- // TODO: confirm color
2460
- [B.enum.MISSION]: {
2461
- chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
2462
- icon: "editor_choice",
2463
- name: "Mission",
2464
- chip() {
2465
- return K(this);
2466
- }
2467
- }
2468
- };
2469
- function Ci(r) {
2470
- const e = _i(r), t = {
2471
- active: "text-fm-color-typo-success bg-fm-color-system-success-100",
2472
- upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
2473
- expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
2474
- };
2475
- return r.type == "VOUCHER" ? ce(je.FmChip, {
2476
- class: t[e],
2477
- label: tt.title(He.global.t(`connect.campaign.common.status.${e}`)),
2478
- compact: !0
2479
- }) : ce(je.FmChip, {
2480
- class: t[e],
2481
- label: tt.title(He.global.t(`connect.campaign.common.status.${e}`)),
2482
- compact: !0
2483
- });
2484
- }
2485
- function Pi(r) {
2486
- const { campaign: e } = r;
2487
- function t(s) {
2488
- if (!s || !s.start && !s.end)
2489
- return "connect.campaign.common.always";
2490
- const n = s.start ? te(s.start).format("DD MMM YYYY") : "From campaign creation", i = s.end ? te(s.end).format("DD MMM YYYY") : "Never ends";
2491
- return `${n} - ${i}`;
2492
- }
2493
- return {
2494
- "connect.campaign.common.campaign_name": e.name,
2495
- "connect.campaign.common.campaign_period": t(e.timeframeOptions),
2496
- get "connect.campaign.common.next_schedule_at"() {
2497
- if (e.event.type != "SCHEDULE" || !e.event.rule || !Be(e.event.rule))
2498
- return;
2499
- const s = Jt(
2500
- e.event.rule.rules.g_schedule
2501
- );
2502
- return s ? te(s).format("ddd, DD MMM YYYY, hh:mmA") : void 0;
2503
- },
2504
- get "connect.campaign.common.discount_type"() {
2505
- if (e.type == "PROMOTION") return ve(e.effect);
2506
- if ("configs" in r && r.configs.type == "VOUCHER")
2507
- return ve(r.configs.extras.effect);
2508
- },
2509
- get "connect.campaign.common.available_at"() {
2510
- return e.targetLocation ? e.targetLocation.length > 0 ? e.targetLocation.map(
2511
- (s) => qt().locationItems.find((n) => n.value == s).label
2512
- ).join(",") : "connect.campaign.common.no_location" : "connect.campaign.common.all_locations";
2513
- }
2514
- };
2515
- }
2516
- function _i(r) {
2517
- return r.timeframeOptions && r.timeframeOptions.type == "timeframe" ? te().isBetween(
2518
- r.timeframeOptions.start ?? te().subtract(1, "d"),
2519
- r.timeframeOptions.end ?? te().add(1, "d")
2520
- ) ? "active" : te().isAfter(r.timeframeOptions.end) ? "expired" : "upcoming" : "active";
2521
- }
2522
- function wi(r) {
2523
- var e, t;
2524
- switch (r.event.type) {
2525
- case "BILL_COMPLETED":
2526
- const s = `Spend to get ${ee.formattedType(r.type)}`;
2527
- switch (r.type) {
2528
- case "POINT":
2529
- case "CREDIT":
2530
- case "COIN":
2531
- return r.earningOption.type == "FIXED" ? `Spend to get ${r.earningOption.amount} ${ee.formattedType(r.type)}` : `Every ${r.earningOption.every} amount spent get ${r.earningOption.amount} ${ee.formattedType(r.type)}`;
2532
- case "VOUCHER":
2533
- const n = (t = (e = r == null ? void 0 : r.pf_collectible) == null ? void 0 : e.extras) == null ? void 0 : t.effect;
2534
- return n ? `${s} - ${ve(n)}` : s;
2535
- default:
2536
- return s;
2537
- }
2538
- case "FEEDBACK":
2539
- return `Give feedback to receive ${ee.formattedType(r.type)}`;
2540
- case "SCHEDULE":
2541
- return `Receive ${ee.formattedType(r.type)} on scheduled time`;
2542
- case "SIMPLE_CLAIM":
2543
- return "Simple claim voucher";
2544
- case "TIER_UPGRADED":
2545
- return `Receive ${ee.formattedType(r.type)} when member tier upgraded`;
2546
- case "MEMBERSHIP_JOINED":
2547
- return `Receive ${ee.formattedType(r.type)} when member joined`;
2548
- case "MAKING_ORDER":
2549
- return r.type !== "PROMOTION" ? void 0 : ve(r.effect);
2550
- default:
2551
- throw new Error(
2552
- `Not implemented ${JSON.stringify({ cause: r.event.type })}`
2553
- );
2554
- }
2555
- }
2556
- function ki(r, e) {
2557
- var n, i;
2558
- if (!r) return;
2559
- const t = r.campaign;
2560
- if (!t) return;
2561
- const s = t.event.rule;
2562
- if (!s || !Be(s)) {
2563
- e.addIssue({
2564
- code: "custom",
2565
- path: ["campaign", "event", "rule"],
2566
- params: {
2567
- i18n: { key: "zodCustom.campaign.rule_required", values: { type: t.event.type } }
2568
- }
2569
- });
2570
- return;
2571
- }
2572
- switch (t.type) {
2573
- case "MISSION": {
2574
- t.earningOption.amount > t.mission.end && e.addIssue({
2575
- code: "custom",
2576
- path: ["campaign", "earningOption"],
2577
- params: {
2578
- i18n: { key: "zodCustom.campaign.earning_amount_exceed", values: { max: t.mission.end } }
2579
- }
2580
- });
2581
- break;
2582
- }
2583
- case "CREDIT": {
2584
- const a = (n = t.config) == null ? void 0 : n.validityOption;
2585
- (!a || ["validForDay", "validBefore"].every((o) => a[o] == null)) && e.addIssue({
2586
- code: "custom",
2587
- path: ["campaign", "config", "validityOption"],
2588
- params: {
2589
- i18n: { key: "zodCustom.campaign.credit_validity_required" }
2590
- }
2591
- });
2592
- }
2593
- }
2594
- switch (t.event.type) {
2595
- case "BILL_COMPLETED":
2596
- t.type === "MISSION" && t.rewards.length && (t.rewards.forEach((a, c) => {
2597
- (a.threshold < 0 || a.threshold > t.mission.end) && e.addIssue({
2598
- code: "custom",
2599
- path: ["campaign", "rewards", c, "threshold"],
2600
- params: {
2601
- i18n: { key: "zodCustom.campaign.reward_threshold_range" }
2602
- }
2603
- });
2604
- }), (i = t.config) != null && i.validityOption.followFirstReceive || e.addIssue({
2605
- code: "custom",
2606
- path: ["campaign", "config", "validityOption"],
2607
- params: {
2608
- i18n: { key: "zodCustom.campaign.mission_first_receive" }
2609
- }
2610
- }));
2611
- break;
2612
- case "SCHEDULE": {
2613
- if (!s.rules.g_schedule) {
2614
- e.addIssue({
2615
- code: "custom",
2616
- path: ["campaign", "event", "rule"],
2617
- params: {
2618
- i18n: { key: "zodCustom.campaign.schedule_period_required" }
2619
- },
2620
- fatal: !0
2621
- });
2622
- return;
2623
- }
2624
- const a = Ve.getRules(
2625
- s.rules.g_schedule
2626
- ), c = [
2627
- {
2628
- property: "trigger.date",
2629
- operator: ["_isOnDate", "_rrule"]
2630
- },
2631
- {
2632
- property: "trigger.time",
2633
- operator: ["_isOnTime"]
2634
- }
2635
- ];
2636
- c.length == a.length && c.every((l) => a.some((u) => {
2637
- const p = Ve.simplify(u);
2638
- return p.property === l.property && l.operator.includes(p.operator);
2639
- })) || e.addIssue({
2640
- code: "custom",
2641
- path: ["campaign", "event", "rule"],
2642
- params: {
2643
- i18n: { key: "zodCustom.campaign.active_period_invalid" }
2644
- }
2645
- });
2646
- break;
2647
- }
2648
- default: {
2649
- "earningOption" in t && t.earningOption.type != "FIXED" && e.addIssue({
2650
- code: "custom",
2651
- path: ["campaign", "earningOption"],
2652
- params: {
2653
- i18n: { key: "zodCustom.campaign.fixed_earning_required" }
2654
- }
2655
- });
2656
- break;
2657
- }
2658
- }
2659
- }
2660
- function Di(r) {
2661
- var t;
2662
- if (r.campaign.type === "VOUCHER" && "configs" in r) {
2663
- const s = r.configs;
2664
- s.extras.targetLocation = r.campaign.targetLocation;
2665
- const n = Math.max(
2666
- r.campaign.earningOption.amount,
2667
- s.options.maxUse ?? 1
2668
- );
2669
- r.campaign.earningOption.amount = n, s.options.maxUse = n, r.campaign.earningOption = {
2670
- type: "FIXED",
2671
- amount: 1
2672
- };
2673
- }
2674
- if (r.campaign.type == "MISSION" && "configs" in r) {
2675
- const s = r.configs;
2676
- s.options.validityOption = (t = r.campaign.config) == null ? void 0 : t.validityOption;
2677
- }
2678
- const e = r.campaign.event;
2679
- return e.type != "BILL_COMPLETED" && e.rule && Be(e.rule) && (e.rule = Ve.removeEntry(e.rule, "g_bill"), r.campaign.event = e), r;
2680
- }
2681
- function q(r) {
2682
- const e = Yt.optionsMap.get(r).extend({
2683
- _id: V.optional(),
2684
- collectible: P.string().nullish()
2685
- });
2686
- switch (r) {
2687
- case "VOUCHER":
2688
- return P.object({
2689
- campaign: e,
2690
- templateId: V,
2691
- configs: xe,
2692
- updateCollections: P.boolean().optional(),
2693
- code: P.string().optional()
2694
- });
2695
- case "PROMOTION":
2696
- return P.object({
2697
- campaign: e,
2698
- templateId: V
2699
- });
2700
- case "POINT":
2701
- return P.object({
2702
- campaign: e,
2703
- templateId: V
2704
- });
2705
- case "CREDIT":
2706
- return P.object({
2707
- campaign: e,
2708
- templateId: V
2709
- });
2710
- case "BROADCAST":
2711
- return P.object({
2712
- campaign: e,
2713
- templateId: V
2714
- });
2715
- case "COIN":
2716
- return P.object({
2717
- campaign: e,
2718
- templateId: V
2719
- });
2720
- case "REWARD_POOL":
2721
- return P.object({
2722
- campaign: e,
2723
- templateId: V,
2724
- updateCollections: P.boolean().optional()
2725
- });
2726
- case "GAME":
2727
- return P.object({
2728
- campaign: e,
2729
- configs: xe,
2730
- templateId: V,
2731
- updateCollections: P.boolean().optional()
2732
- });
2733
- case "MISSION":
2734
- return P.object({
2735
- campaign: e,
2736
- configs: xe,
2737
- templateId: V,
2738
- updateCollections: P.boolean().optional()
2739
- });
2740
- default:
2741
- throw new Error("Not implemented");
2742
- }
2743
- }
2744
- const Ui = Wt.extend({
2745
- _id: V.optional(),
2746
- name: P.string().min(1).max(300),
2747
- business: V.optional(),
2748
- campaigns: P.array(V).optional()
2749
- }), Fi = {
2750
- [J.enum.VOUCHER]: q("VOUCHER"),
2751
- [J.enum.PROMOTION]: q("PROMOTION"),
2752
- [J.enum.POINT]: q("POINT"),
2753
- [J.enum.CREDIT]: q("CREDIT"),
2754
- [J.enum.BROADCAST]: q("BROADCAST"),
2755
- [J.enum.COIN]: q("COIN"),
2756
- [J.enum.REWARD_POOL]: q("REWARD_POOL"),
2757
- [J.enum.GAME]: q("GAME"),
2758
- [J.enum.MISSION]: q("MISSION")
2759
- };
2760
- export {
2761
- ee as C,
2762
- Ui as F,
2763
- wi as a,
2764
- xi as b,
2765
- Pi as c,
2766
- ki as d,
2767
- Fi as e,
2768
- Di as f,
2769
- Ci as g
2770
- };