@nice2dev/licensing 1.2.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.cjs CHANGED
@@ -1,8 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
+ const uiCore = require("@nice2dev/ui-core");
4
5
  const React = require("react");
5
- const marks = require("./marks-CDyo3kiN.cjs");
6
+ const marks = require("./marks-BxZztzfi.cjs");
7
+ const TIER_NAMES = {
8
+ trial: "Trial",
9
+ personal: "Personal",
10
+ team: "Team",
11
+ enterprise: "Enterprise",
12
+ site: "Site License",
13
+ oem: "OEM"
14
+ };
15
+ const TIER_ORDER = ["trial", "personal", "team", "enterprise", "site", "oem"];
6
16
  const LicenseContext = /* @__PURE__ */ React.createContext(null);
7
17
  function LicenseProvider({
8
18
  serverUrl = "https://license.nice2dev.com/api/v1",
@@ -16,6 +26,7 @@ function LicenseProvider({
16
26
  children
17
27
  }) {
18
28
  var _a;
29
+ const { t } = uiCore.useNiceTranslation();
19
30
  const [state, setState] = React.useState({
20
31
  license: null,
21
32
  validation: null,
@@ -69,7 +80,7 @@ function LicenseProvider({
69
80
  }
70
81
  return result;
71
82
  } catch (error) {
72
- const errorMessage = error instanceof Error ? error.message : "Unknown error";
83
+ const errorMessage = error instanceof Error ? error.message : t("licensing.unknownError", "Unknown error");
73
84
  setState((s) => ({
74
85
  ...s,
75
86
  loading: false,
@@ -89,7 +100,7 @@ function LicenseProvider({
89
100
  };
90
101
  }
91
102
  },
92
- [validator, onLicenseChange]
103
+ [validator, onLicenseChange, t]
93
104
  );
94
105
  const activate = React.useCallback(
95
106
  async (key) => {
@@ -207,6 +218,7 @@ function FeatureGate({
207
218
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: fallback });
208
219
  }
209
220
  function LicenseStatus({ detailed = false, style, className }) {
221
+ const { t } = uiCore.useNiceTranslation();
210
222
  const { license, validation, loading, error } = useLicense();
211
223
  const baseStyle = {
212
224
  padding: "8px 12px",
@@ -223,7 +235,7 @@ function LicenseStatus({ detailed = false, style, className }) {
223
235
  {
224
236
  style: { ...baseStyle, backgroundColor: "#f0f0f0", color: "#666" },
225
237
  className,
226
- children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Checking license..." })
238
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: t("licensing.checkingLicense", "Checking license...") })
227
239
  }
228
240
  );
229
241
  }
@@ -235,7 +247,7 @@ function LicenseStatus({ detailed = false, style, className }) {
235
247
  className,
236
248
  children: [
237
249
  /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontWeight: 700 }, "aria-hidden": "true", children: "!" }),
238
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: error || "No license" })
250
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: error || t("licensing.noLicense", "No license") })
239
251
  ]
240
252
  }
241
253
  );
@@ -261,11 +273,11 @@ function LicenseStatus({ detailed = false, style, className }) {
261
273
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { ...baseStyle, backgroundColor: bgColor, color: textColor }, className, children: [
262
274
  /* @__PURE__ */ jsxRuntime.jsx(marks.CheckMark, {}),
263
275
  /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontWeight: 600 }, children: license.tier.charAt(0).toUpperCase() + license.tier.slice(1) }),
264
- (validation == null ? void 0 : validation.inGracePeriod) && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#dc2626", fontSize: "12px" }, children: "(Grace period)" }),
265
- detailed && (validation == null ? void 0 : validation.daysRemaining) !== void 0 && validation.daysRemaining > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontSize: "12px", opacity: 0.8 }, children: [
266
- validation.daysRemaining,
267
- " days remaining"
268
- ] }),
276
+ (validation == null ? void 0 : validation.inGracePeriod) && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#dc2626", fontSize: "12px" }, children: t("licensing.gracePeriod", "(Grace period)") }),
277
+ detailed && (validation == null ? void 0 : validation.daysRemaining) !== void 0 && validation.daysRemaining > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "12px", opacity: 0.8 }, children: t("licensing.daysRemaining", "{daysRemaining} days remaining").replace(
278
+ "{daysRemaining}",
279
+ String(validation.daysRemaining)
280
+ ) }),
269
281
  detailed && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "12px", opacity: 0.6 }, children: marks.maskLicenseKey(license.key) })
270
282
  ] });
271
283
  }
@@ -275,6 +287,7 @@ function LicenseActivator({
275
287
  style,
276
288
  className
277
289
  }) {
290
+ const { t } = uiCore.useNiceTranslation();
278
291
  const { activate, loading } = useLicense();
279
292
  const [key, setKey] = React.useState("");
280
293
  const [localError, setLocalError] = React.useState(null);
@@ -292,7 +305,7 @@ function LicenseActivator({
292
305
  setKey("");
293
306
  onActivated == null ? void 0 : onActivated(result.license);
294
307
  } else {
295
- setLocalError(result.errorMessage || "Activation failed");
308
+ setLocalError(result.errorMessage || t("licensing.activationFailed", "Activation failed"));
296
309
  onError == null ? void 0 : onError(result.errorMessage || "Activation failed");
297
310
  }
298
311
  } finally {
@@ -329,7 +342,7 @@ function LicenseActivator({
329
342
  cursor: isActivating || loading ? "not-allowed" : "pointer"
330
343
  };
331
344
  return /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handleSubmit, style: containerStyle, className, children: [
332
- /* @__PURE__ */ jsxRuntime.jsx("label", { style: { fontWeight: 500, color: "#374151" }, children: "Enter License Key" }),
345
+ /* @__PURE__ */ jsxRuntime.jsx("label", { style: { fontWeight: 500, color: "#374151" }, children: t("licensing.enterLicenseKey", "Enter License Key") }),
333
346
  /* @__PURE__ */ jsxRuntime.jsx(
334
347
  "input",
335
348
  {
@@ -342,7 +355,7 @@ function LicenseActivator({
342
355
  }
343
356
  ),
344
357
  localError && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { color: "#dc2626", fontSize: "13px" }, children: localError }),
345
- /* @__PURE__ */ jsxRuntime.jsx("button", { type: "submit", style: buttonStyle, disabled: isActivating || loading || !key.trim(), children: isActivating ? "Activating..." : "Activate License" })
358
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "submit", style: buttonStyle, disabled: isActivating || loading || !key.trim(), children: isActivating ? t("licensing.activating", "Activating...") : t("licensing.activateLicense", "Activate License") })
346
359
  ] });
347
360
  }
348
361
  function UpgradePrompt({
@@ -352,6 +365,7 @@ function UpgradePrompt({
352
365
  style,
353
366
  compact = false
354
367
  }) {
368
+ const { t } = uiCore.useNiceTranslation();
355
369
  const { license } = useLicense();
356
370
  const missingFeatures = marks.getMissingFeatures(license, targetTier);
357
371
  const handleUpgrade = () => {
@@ -385,19 +399,18 @@ function UpgradePrompt({
385
399
  marginTop: "12px"
386
400
  };
387
401
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: containerStyle, children: [
388
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: titleStyle, children: [
389
- "Upgrade to ",
390
- targetTier.charAt(0).toUpperCase() + targetTier.slice(1)
391
- ] }),
402
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: titleStyle, children: t("licensing.upgradeTo", "Upgrade to {targetTier}").replace(
403
+ "{targetTier}",
404
+ t(`licensing.tier.${targetTier}`, TIER_NAMES[targetTier] ?? targetTier)
405
+ ) }),
392
406
  !compact && missingFeatures.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("ul", { style: { margin: "8px 0", paddingLeft: "20px", color: "#374151", fontSize: "14px" }, children: [
393
- missingFeatures.slice(0, 3).map((f) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: f.name }, f.id)),
394
- missingFeatures.length > 3 && /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
395
- "+",
396
- missingFeatures.length - 3,
397
- " more features"
398
- ] })
407
+ missingFeatures.slice(0, 3).map((f) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: marks.isBuiltInEntry(f) ? t(`licensing.feature.${f.id}`, f.name) : f.name }, f.id)),
408
+ missingFeatures.length > 3 && /* @__PURE__ */ jsxRuntime.jsx("li", { children: t("licensing.moreFeatures", "+{missingFeatures} more features").replace(
409
+ "{missingFeatures}",
410
+ String(missingFeatures.length - 3)
411
+ ) })
399
412
  ] }),
400
- /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: handleUpgrade, style: buttonStyle, children: "Upgrade Now" })
413
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: handleUpgrade, style: buttonStyle, children: t("licensing.upgradeNow", "Upgrade Now") })
401
414
  ] });
402
415
  }
403
416
  function LicenseComparison({
@@ -406,18 +419,21 @@ function LicenseComparison({
406
419
  onSelect,
407
420
  showPrices = true
408
421
  }) {
422
+ const { t } = uiCore.useNiceTranslation();
409
423
  const { license } = useLicense();
410
424
  const tier = currentTier || (license == null ? void 0 : license.tier);
411
425
  const plans = customPlans || marks.getAllPlans().filter((p) => p.priceMonthly > 0 || p.id === "trial");
412
426
  const formatPrice = (cents) => {
413
427
  if (cents === 0) {
414
- return "Free";
428
+ return t("licensing.free", "Free");
415
429
  }
416
430
  return `$${(cents / 100).toFixed(0)}`;
417
431
  };
418
432
  return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", gap: "16px", flexWrap: "wrap", justifyContent: "center" }, children: plans.map((plan) => {
419
433
  const isCurrent = plan.id === tier;
420
434
  const isRecommended = plan.recommended;
435
+ const builtIn = marks.isBuiltInEntry(plan);
436
+ const planText = (field, text) => builtIn ? t(`licensing.plan.${plan.id}.${field}`, text) : text;
421
437
  return /* @__PURE__ */ jsxRuntime.jsxs(
422
438
  "div",
423
439
  {
@@ -446,19 +462,19 @@ function LicenseComparison({
446
462
  fontSize: "12px",
447
463
  fontWeight: 600
448
464
  },
449
- children: "Recommended"
465
+ children: t("licensing.recommended", "Recommended")
450
466
  }
451
467
  ),
452
- /* @__PURE__ */ jsxRuntime.jsx("h3", { style: { margin: "0 0 4px", fontSize: "20px", color: "#111" }, children: plan.name }),
453
- /* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: "0 0 16px", fontSize: "14px", color: "#6b7280" }, children: plan.description }),
468
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { style: { margin: "0 0 4px", fontSize: "20px", color: "#111" }, children: planText("name", plan.name) }),
469
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: "0 0 16px", fontSize: "14px", color: "#6b7280" }, children: planText("description", plan.description) }),
454
470
  showPrices && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: "16px" }, children: [
455
471
  /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "32px", fontWeight: 700, color: "#111" }, children: formatPrice(plan.priceMonthly) }),
456
- plan.priceMonthly > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "14px", color: "#6b7280" }, children: "/month" })
472
+ plan.priceMonthly > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "14px", color: "#6b7280" }, children: t("licensing.perMonth", "/month") })
457
473
  ] }),
458
474
  /* @__PURE__ */ jsxRuntime.jsx("ul", { style: { listStyle: "none", padding: 0, margin: "0 0 16px" }, children: plan.highlights.map((h, i) => /* @__PURE__ */ jsxRuntime.jsxs("li", { style: { padding: "6px 0", fontSize: "14px", color: "#374151" }, children: [
459
475
  /* @__PURE__ */ jsxRuntime.jsx(marks.CheckMark, {}),
460
476
  " ",
461
- h
477
+ planText(`highlight${i}`, h)
462
478
  ] }, i)) }),
463
479
  /* @__PURE__ */ jsxRuntime.jsx(
464
480
  "button",
@@ -476,7 +492,7 @@ function LicenseComparison({
476
492
  borderRadius: "6px",
477
493
  cursor: isCurrent ? "default" : "pointer"
478
494
  },
479
- children: isCurrent ? "Current Plan" : "Select"
495
+ children: isCurrent ? t("licensing.currentPlan", "Current Plan") : t("licensing.select", "Select")
480
496
  }
481
497
  )
482
498
  ]
@@ -526,6 +542,7 @@ function LicensePortal({
526
542
  style,
527
543
  className
528
544
  }) {
545
+ const { t } = uiCore.useNiceTranslation();
529
546
  const {
530
547
  license,
531
548
  validation: _validation,
@@ -550,11 +567,11 @@ function LicensePortal({
550
567
  onDeactivate == null ? void 0 : onDeactivate();
551
568
  };
552
569
  const tabLabels = {
553
- overview: "Overview",
554
- activation: "Activation",
555
- seats: "Seats",
556
- features: "Features",
557
- plans: "Plans"
570
+ overview: t("licensing.overview", "Overview"),
571
+ activation: t("licensing.activation", "Activation"),
572
+ seats: t("licensing.seats", "Seats"),
573
+ features: t("licensing.features", "Features"),
574
+ plans: t("licensing.plans", "Plans")
558
575
  };
559
576
  const containerStyle = {
560
577
  border: "1px solid #e5e7eb",
@@ -582,21 +599,21 @@ function LicensePortal({
582
599
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: containerStyle, className, children: [
583
600
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: tabBarStyle, children: tabs.map((tab) => /* @__PURE__ */ jsxRuntime.jsx("button", { style: getTabStyle(tab), onClick: () => setActiveTab(tab), children: tabLabels[tab] }, tab)) }),
584
601
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: panelStyle, children: [
585
- loading && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { color: "#6b7280" }, children: "Loading license information..." }),
602
+ loading && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { color: "#6b7280" }, children: t("licensing.loadingLicenseInformation", "Loading license information...") }),
586
603
  !loading && activeTab === "overview" && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: [
587
604
  /* @__PURE__ */ jsxRuntime.jsx(LicenseStatus, { detailed: true }),
588
605
  license && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
589
606
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: "12px" }, children: [
590
607
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
591
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "12px", color: "#6b7280" }, children: "Licensee" }),
608
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "12px", color: "#6b7280" }, children: t("licensing.licensee", "Licensee") }),
592
609
  /* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: "2px 0 0", fontWeight: 500 }, children: license.licensee })
593
610
  ] }),
594
611
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
595
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "12px", color: "#6b7280" }, children: "Email" }),
612
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "12px", color: "#6b7280" }, children: t("licensing.email", "Email") }),
596
613
  /* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: "2px 0 0", fontWeight: 500 }, children: license.email })
597
614
  ] }),
598
615
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
599
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "12px", color: "#6b7280" }, children: "Seats" }),
616
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "12px", color: "#6b7280" }, children: t("licensing.seats", "Seats") }),
600
617
  /* @__PURE__ */ jsxRuntime.jsxs("p", { style: { margin: "2px 0 0", fontWeight: 500 }, children: [
601
618
  license.activeSeats,
602
619
  " / ",
@@ -604,8 +621,8 @@ function LicensePortal({
604
621
  ] })
605
622
  ] }),
606
623
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
607
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "12px", color: "#6b7280" }, children: "Expires" }),
608
- /* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: "2px 0 0", fontWeight: 500 }, children: license.expiresAt ? new Date(license.expiresAt).toLocaleDateString() : "Perpetual" })
624
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "12px", color: "#6b7280" }, children: t("licensing.expires", "Expires") }),
625
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: "2px 0 0", fontWeight: 500 }, children: license.expiresAt ? new Date(license.expiresAt).toLocaleDateString() : t("licensing.perpetual", "Perpetual") })
609
626
  ] })
610
627
  ] }),
611
628
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: "8px" }, children: [
@@ -622,7 +639,7 @@ function LicensePortal({
622
639
  backgroundColor: "#fff",
623
640
  cursor: refreshing ? "not-allowed" : "pointer"
624
641
  },
625
- children: refreshing ? "Refreshing..." : "Refresh"
642
+ children: refreshing ? t("licensing.refreshing", "Refreshing...") : t("licensing.refresh", "Refresh")
626
643
  }
627
644
  ),
628
645
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -638,26 +655,33 @@ function LicensePortal({
638
655
  backgroundColor: "#fff",
639
656
  cursor: "pointer"
640
657
  },
641
- children: "Deactivate"
658
+ children: t("licensing.deactivate", "Deactivate")
642
659
  }
643
660
  )
644
661
  ] })
645
662
  ] }),
646
- !license && !error && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { color: "#6b7280" }, children: "No active license. Go to the Activation tab to enter your license key." }),
663
+ !license && !error && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { color: "#6b7280" }, children: t(
664
+ "licensing.noActiveLicenseGoTo",
665
+ "No active license. Go to the Activation tab to enter your license key."
666
+ ) }),
647
667
  error && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { color: "#dc2626" }, children: error })
648
668
  ] }),
649
669
  !loading && activeTab === "activation" && /* @__PURE__ */ jsxRuntime.jsx(LicenseActivator, { onActivated: () => setActiveTab("overview") }),
650
670
  !loading && activeTab === "seats" && /* @__PURE__ */ jsxRuntime.jsx("div", { children: license ? /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: [
651
671
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: "14px", color: "#374151" }, children: [
652
672
  /* @__PURE__ */ jsxRuntime.jsx("strong", { children: license.activeSeats }),
653
- " of",
673
+ " ",
674
+ t("licensing.of", "of"),
654
675
  " ",
655
676
  /* @__PURE__ */ jsxRuntime.jsx("strong", { children: license.maxSeats ?? "∞" }),
656
- " seats in use",
677
+ " ",
678
+ t("licensing.seatsInUse", "seats in use"),
657
679
  license.floatingSeats != null && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
658
- " (",
659
- license.floatingSeats,
660
- " floating)"
680
+ " ",
681
+ t("licensing.floating", "({floatingSeats} floating)").replace(
682
+ "{floatingSeats}",
683
+ String(license.floatingSeats)
684
+ )
661
685
  ] })
662
686
  ] }),
663
687
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -683,13 +707,11 @@ function LicensePortal({
683
707
  )
684
708
  }
685
709
  ),
686
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: "12px", color: "#9ca3af" }, children: [
687
- "Machines bound: ",
688
- license.boundMachines.length,
689
- " / ",
690
- license.maxMachines
691
- ] })
692
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("p", { style: { color: "#6b7280" }, children: "Activate a license to view seat information." }) }),
710
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: "12px", color: "#9ca3af" }, children: t("licensing.machinesBound", "Machines bound: {boundMachines} / {maxMachines}").replace("{boundMachines}", String(license.boundMachines.length)).replace("{maxMachines}", String(license.maxMachines)) })
711
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("p", { style: { color: "#6b7280" }, children: t(
712
+ "licensing.activateALicenseToView",
713
+ "Activate a license to view seat information."
714
+ ) }) }),
693
715
  !loading && activeTab === "features" && /* @__PURE__ */ jsxRuntime.jsx("div", { children: license ? /* @__PURE__ */ jsxRuntime.jsxs(
694
716
  "ul",
695
717
  {
@@ -720,10 +742,13 @@ function LicensePortal({
720
742
  },
721
743
  f
722
744
  )),
723
- license.features.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("li", { style: { color: "#6b7280", fontSize: "14px" }, children: "No explicit features — tier-based access applies." })
745
+ license.features.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("li", { style: { color: "#6b7280", fontSize: "14px" }, children: t(
746
+ "licensing.noExplicitFeaturesTierBased",
747
+ "No explicit features — tier-based access applies."
748
+ ) })
724
749
  ]
725
750
  }
726
- ) : /* @__PURE__ */ jsxRuntime.jsx("p", { style: { color: "#6b7280" }, children: "Activate a license to view features." }) }),
751
+ ) : /* @__PURE__ */ jsxRuntime.jsx("p", { style: { color: "#6b7280" }, children: t("licensing.activateALicenseToView2", "Activate a license to view features.") }) }),
727
752
  !loading && activeTab === "plans" && /* @__PURE__ */ jsxRuntime.jsx(
728
753
  LicenseComparison,
729
754
  {
@@ -745,6 +770,7 @@ function NiceLicenseManager({
745
770
  style,
746
771
  className
747
772
  }) {
773
+ const { t } = uiCore.useNiceTranslation();
748
774
  const [search, setSearch] = React.useState("");
749
775
  const [expandedKey, setExpandedKey] = React.useState(null);
750
776
  const handleSearch = (value) => {
@@ -780,7 +806,7 @@ function NiceLicenseManager({
780
806
  backgroundColor: "#f9fafb"
781
807
  },
782
808
  children: [
783
- /* @__PURE__ */ jsxRuntime.jsx("h3", { style: { margin: 0, fontSize: "16px", color: "#111" }, children: "License Manager" }),
809
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { style: { margin: 0, fontSize: "16px", color: "#111" }, children: t("licensing.licenseManager", "License Manager") }),
784
810
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: "8px" }, children: [
785
811
  /* @__PURE__ */ jsxRuntime.jsx(
786
812
  "input",
@@ -788,7 +814,7 @@ function NiceLicenseManager({
788
814
  type: "text",
789
815
  value: search,
790
816
  onChange: (e) => handleSearch(e.target.value),
791
- placeholder: "Search licenses...",
817
+ placeholder: t("licensing.searchLicenses", "Search licenses..."),
792
818
  style: {
793
819
  padding: "6px 12px",
794
820
  fontSize: "13px",
@@ -813,7 +839,7 @@ function NiceLicenseManager({
813
839
  borderRadius: "6px",
814
840
  cursor: "pointer"
815
841
  },
816
- children: "+ Generate"
842
+ children: t("licensing.generate", "+ Generate")
817
843
  }
818
844
  )
819
845
  ] })
@@ -821,7 +847,7 @@ function NiceLicenseManager({
821
847
  }
822
848
  ),
823
849
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { maxHeight: "500px", overflow: "auto" }, children: [
824
- filtered.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { padding: "20px", textAlign: "center", color: "#6b7280" }, children: search ? "No licenses match your search." : "No licenses found." }),
850
+ filtered.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { padding: "20px", textAlign: "center", color: "#6b7280" }, children: search ? t("licensing.noLicensesMatchYourSearch", "No licenses match your search.") : t("licensing.noLicensesFound", "No licenses found.") }),
825
851
  filtered.map((lic) => {
826
852
  const isExpanded = expandedKey === lic.key;
827
853
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -834,6 +860,10 @@ function NiceLicenseManager({
834
860
  /* @__PURE__ */ jsxRuntime.jsxs(
835
861
  "div",
836
862
  {
863
+ role: "button",
864
+ tabIndex: 0,
865
+ "aria-expanded": isExpanded,
866
+ onKeyDown: uiCore.clickOnActivationKey,
837
867
  style: {
838
868
  display: "grid",
839
869
  gridTemplateColumns: "1fr 140px 100px 80px 60px",
@@ -889,15 +919,15 @@ function NiceLicenseManager({
889
919
  },
890
920
  children: [
891
921
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
892
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "11px", color: "#9ca3af" }, children: "Issued" }),
922
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "11px", color: "#9ca3af" }, children: t("licensing.issued", "Issued") }),
893
923
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: "13px" }, children: new Date(lic.issuedAt).toLocaleDateString() })
894
924
  ] }),
895
925
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
896
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "11px", color: "#9ca3af" }, children: "Expires" }),
897
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: "13px" }, children: lic.expiresAt ? new Date(lic.expiresAt).toLocaleDateString() : "Perpetual" })
926
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "11px", color: "#9ca3af" }, children: t("licensing.expires", "Expires") }),
927
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: "13px" }, children: lic.expiresAt ? new Date(lic.expiresAt).toLocaleDateString() : t("licensing.perpetual", "Perpetual") })
898
928
  ] }),
899
929
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
900
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "11px", color: "#9ca3af" }, children: "Seats" }),
930
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "11px", color: "#9ca3af" }, children: t("licensing.seats", "Seats") }),
901
931
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: "13px" }, children: [
902
932
  lic.activeSeats,
903
933
  " / ",
@@ -905,11 +935,11 @@ function NiceLicenseManager({
905
935
  ] })
906
936
  ] }),
907
937
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
908
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "11px", color: "#9ca3af" }, children: "Features" }),
909
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: "13px" }, children: [
910
- lic.features.length,
911
- " enabled"
912
- ] })
938
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "11px", color: "#9ca3af" }, children: t("licensing.features", "Features") }),
939
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: "13px" }, children: t("licensing.enabled", "{features} enabled").replace(
940
+ "{features}",
941
+ String(lic.features.length)
942
+ ) })
913
943
  ] })
914
944
  ]
915
945
  }
@@ -930,7 +960,7 @@ function NiceLicenseManager({
930
960
  backgroundColor: "#fff",
931
961
  cursor: "pointer"
932
962
  },
933
- children: "Extend 1 Year"
963
+ children: t("licensing.extend1Year", "Extend 1 Year")
934
964
  }
935
965
  ),
936
966
  onAddSeats && lic.status !== "revoked" && /* @__PURE__ */ jsxRuntime.jsx(
@@ -948,10 +978,10 @@ function NiceLicenseManager({
948
978
  backgroundColor: "#fff",
949
979
  cursor: "pointer"
950
980
  },
951
- children: "+5 Seats"
981
+ children: t("licensing.n5Seats", "+5 Seats")
952
982
  }
953
983
  ),
954
- onChangeTier && lic.status !== "revoked" && /* @__PURE__ */ jsxRuntime.jsxs(
984
+ onChangeTier && lic.status !== "revoked" && /* @__PURE__ */ jsxRuntime.jsx(
955
985
  "select",
956
986
  {
957
987
  onClick: (e) => e.stopPropagation(),
@@ -964,14 +994,7 @@ function NiceLicenseManager({
964
994
  borderRadius: "4px",
965
995
  cursor: "pointer"
966
996
  },
967
- children: [
968
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "trial", children: "Trial" }),
969
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "personal", children: "Personal" }),
970
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "team", children: "Team" }),
971
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "enterprise", children: "Enterprise" }),
972
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "site", children: "Site" }),
973
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "oem", children: "OEM" })
974
- ]
997
+ children: TIER_ORDER.map((tier) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: tier, children: t(`licensing.tier.${tier}`, TIER_NAMES[tier]) }, tier))
975
998
  }
976
999
  ),
977
1000
  onRevoke && lic.status !== "revoked" && /* @__PURE__ */ jsxRuntime.jsx(
@@ -990,7 +1013,7 @@ function NiceLicenseManager({
990
1013
  backgroundColor: "#fff",
991
1014
  cursor: "pointer"
992
1015
  },
993
- children: "Revoke"
1016
+ children: t("licensing.revoke", "Revoke")
994
1017
  }
995
1018
  )
996
1019
  ] })
@@ -1012,13 +1035,13 @@ function NiceLicenseManager({
1012
1035
  color: "#6b7280"
1013
1036
  },
1014
1037
  children: [
1015
- filtered.length,
1016
- " license",
1017
- filtered.length !== 1 ? "s" : "",
1018
- search && ` matching "${search}"`,
1038
+ (filtered.length === 1 ? t("licensing.licenseCountOne", "{count} license") : t("licensing.licenseCountMany", "{count} licenses")).replace("{count}", String(filtered.length)),
1039
+ search && t("licensing.matching", ' matching "{search}"').replace("{search}", String(search)),
1019
1040
  " · ",
1020
- licenses.filter((l) => l.status === "valid").length,
1021
- " active"
1041
+ t("licensing.activeCount", "{count} active").replace(
1042
+ "{count}",
1043
+ String(licenses.filter((l) => l.status === "valid").length)
1044
+ )
1022
1045
  ]
1023
1046
  }
1024
1047
  )