myio-js-library 0.1.520 → 0.1.522

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/index.cjs CHANGED
@@ -569,6 +569,8 @@ __export(index_exports, {
569
569
  ANNOTATION_TYPE_LABELS: () => ANNOTATION_TYPE_LABELS,
570
570
  ANNOTATION_TYPE_LABELS_EN: () => ANNOTATION_TYPE_LABELS_EN,
571
571
  ANNOTATION_VIRTUAL_THRESHOLD: () => VIRTUAL_SCROLL_THRESHOLD,
572
+ ASSET_CODE_RE: () => ASSET_CODE_RE,
573
+ ASSET_TYPE_CONFIG: () => ASSET_TYPE_CONFIG,
572
574
  ActionButtonController: () => ActionButtonController,
573
575
  ActionButtonView: () => ActionButtonView,
574
576
  AlarmService: () => AlarmService,
@@ -585,6 +587,8 @@ __export(index_exports, {
585
587
  CONSUMPTION_CHART_COLORS: () => DEFAULT_COLORS,
586
588
  CONSUMPTION_CHART_DEFAULTS: () => DEFAULT_CONFIG,
587
589
  CONSUMPTION_THEME_COLORS: () => THEME_COLORS,
590
+ CUSTOMER_CODE_RE: () => CUSTOMER_CODE_RE,
591
+ CUSTOMER_NAME_STOPWORDS: () => CUSTOMER_NAME_STOPWORDS,
588
592
  CardGridPanel: () => CardGridPanel,
589
593
  CardGridTabsBuilder: () => CardGridTabsBuilder,
590
594
  ColumnSummaryTooltip: () => ColumnSummaryTooltip,
@@ -609,6 +613,7 @@ __export(index_exports, {
609
613
  DEFAULT_DEVICE_IMAGE: () => DEFAULT_DEVICE_IMAGE,
610
614
  DEFAULT_DEVICE_OPERATIONAL_CARD_FILTER_STATE: () => DEFAULT_DEVICE_OPERATIONAL_CARD_FILTER_STATE,
611
615
  DEFAULT_DEVICE_TYPE_PREFIX: () => DEFAULT_DEVICE_TYPE_PREFIX,
616
+ DEFAULT_DEVICE_TYPE_TOKEN: () => DEFAULT_DEVICE_TYPE_TOKEN,
612
617
  DEFAULT_ENERGY_GROUP_COLORS: () => DEFAULT_ENERGY_GROUP_COLORS,
613
618
  DEFAULT_EQUIPMENT_FILTER_STATE: () => DEFAULT_EQUIPMENT_FILTER_STATE,
614
619
  DEFAULT_EQUIPMENT_STATS: () => DEFAULT_EQUIPMENT_STATS,
@@ -649,6 +654,7 @@ __export(index_exports, {
649
654
  DEVICE_OPERATIONAL_CARD_GRID_STYLES: () => DEVICE_OPERATIONAL_CARD_GRID_STYLES,
650
655
  DEVICE_OPERATIONAL_CARD_STYLES: () => DEVICE_OPERATIONAL_CARD_STYLES,
651
656
  DEVICE_TYPES: () => DEVICE_TYPES2,
657
+ DEVICE_TYPE_CODE_TOKEN: () => DEVICE_TYPE_CODE_TOKEN,
652
658
  DEVICE_TYPE_CONFIG: () => DEVICE_TYPE_CONFIG,
653
659
  DEVICE_TYPE_DOMAIN: () => DEVICE_TYPE_DOMAIN,
654
660
  DEVICE_TYPE_PREFIX_MAP: () => DEVICE_TYPE_PREFIX_MAP,
@@ -812,13 +818,17 @@ __export(index_exports, {
812
818
  WATER_UNITS: () => WATER_UNITS,
813
819
  WELCOME_DEFAULT_PALETTE: () => DEFAULT_PALETTE,
814
820
  WaterSummaryTooltip: () => WaterSummaryTooltip,
821
+ addAlarmBadge: () => addAlarmBadge,
815
822
  addDetectionContext: () => addDetectionContext,
816
823
  addFreshdeskTicketNote: () => addTicketNote,
817
824
  addNamespace: () => addNamespace,
825
+ addTicketBadge: () => addTicketBadge,
818
826
  aggregateByDay: () => aggregateByDay,
819
827
  appendFreshdeskTicketToTB: () => appendFreshdeskTicketToTB,
828
+ applyCustomerCodeToAssetName: () => applyCustomerCodeToAssetName,
820
829
  applyDeviceGridFilters: () => applyFilters,
821
830
  archiveAlarmAnnotation: () => archiveAlarmAnnotation,
831
+ assetLocalToken: () => assetLocalToken,
822
832
  assignShoppingColors: () => assignShoppingColors,
823
833
  averageByDay: () => averageByDay,
824
834
  buildAmbienteGroupData: () => buildAmbienteGroupData,
@@ -850,7 +860,9 @@ __export(index_exports, {
850
860
  calculateShoppingDeviceCounts: () => calculateShoppingDeviceCounts,
851
861
  calculateShoppingDeviceStats: () => calculateShoppingDeviceStats,
852
862
  calculateStats: () => calculateStats,
863
+ canEditAlarmRules: () => canEditAlarmRules,
853
864
  canModifyAnnotation: () => canModifyAnnotation,
865
+ checkCustomerCodeAvailable: () => checkCustomerCodeAvailable,
854
866
  clampTemperature: () => clampTemperature,
855
867
  classify: () => classify,
856
868
  classifyEquipment: () => classifyEquipment,
@@ -932,12 +944,14 @@ __export(index_exports, {
932
944
  detectContext: () => detectContext,
933
945
  detectDeviceType: () => detectDeviceType,
934
946
  detectDomainAndContext: () => detectDomainAndContext,
947
+ detectHoldingUserAdmin: () => detectHoldingUserAdmin,
935
948
  detectSuperAdminHolding: () => detectSuperAdminHolding,
936
949
  detectSuperAdminMyio: () => detectSuperAdminMyio,
937
950
  determineInterval: () => determineInterval,
938
951
  deviceIconLabels: () => deviceIconLabels,
939
952
  deviceIcons: () => deviceIcons,
940
953
  deviceStatusIcons: () => deviceStatusIcons,
954
+ deviceTypeToken: () => deviceTypeToken,
941
955
  doSchedulesOverlap: () => doSchedulesOverlap,
942
956
  downloadAnnotationsTextFile: () => downloadTextFile,
943
957
  escapeAnnotationHtml: () => escapeHtml8,
@@ -987,6 +1001,9 @@ __export(index_exports, {
987
1001
  formatWaterByGroup: () => formatWaterByGroup,
988
1002
  formatWaterVolumeM3: () => formatWaterVolumeM3,
989
1003
  formatarDuracao: () => formatarDuracao,
1004
+ generateAssetCode: () => generateAssetCode,
1005
+ generateCustomerCode: () => generateCustomerCode,
1006
+ generateDeviceCode: () => generateDeviceCode,
990
1007
  generateExportFilename: () => generateFilename,
991
1008
  generateFilterModalStyles: () => generateFilterModalStyles,
992
1009
  generateMercosulPlate: () => generateMercosulPlate,
@@ -999,6 +1016,7 @@ __export(index_exports, {
999
1016
  getAlarmSeverityConfig: () => getSeverityConfig,
1000
1017
  getAlarmStateConfig: () => getStateConfig,
1001
1018
  getAnnotationPermissions: () => getAnnotationPermissions,
1019
+ getAssetTypeConfig: () => getAssetTypeConfig,
1002
1020
  getAuthCacheStats: () => getAuthCacheStats,
1003
1021
  getAvailabilityColorFromThresholds: () => getAvailabilityColorFromThresholds,
1004
1022
  getAvailableContexts: () => getAvailableContexts,
@@ -1082,7 +1100,9 @@ __export(index_exports, {
1082
1100
  interpolateTemperature: () => interpolateTemperature,
1083
1101
  isAlarmActive: () => isAlarmActive,
1084
1102
  isAnnotationOverdue: () => isOverdue,
1103
+ isAssetCode: () => isAssetCode,
1085
1104
  isConnectionStale: () => isConnectionStale,
1105
+ isCustomerCode: () => isCustomerCode,
1086
1106
  isDeviceIconType: () => isDeviceIconType,
1087
1107
  isDeviceOffline: () => isDeviceOffline,
1088
1108
  isEndAfterStart: () => isEndAfterStart,
@@ -1146,9 +1166,12 @@ __export(index_exports, {
1146
1166
  parseInputDateToDate: () => parseInputDateToDate,
1147
1167
  parseLogAnnotations: () => parseLogAnnotations,
1148
1168
  periodKey: () => periodKey,
1169
+ pickUniqueCustomerCode: () => pickUniqueCustomerCode,
1149
1170
  readFreshdeskTicketsFromTB: () => readFreshdeskTicketsFromTB,
1150
1171
  recalculateDeviceStatus: () => recalculateDeviceStatus,
1151
1172
  recomputeDeviceGridPercentages: () => recomputePercentages,
1173
+ refreshAlarmBadges: () => refreshAlarmBadges,
1174
+ refreshTicketBadges: () => refreshTicketBadges,
1152
1175
  removeAlarmsNotificationsPanelStyles: () => removeAlarmsNotificationsPanelStyles,
1153
1176
  removeBASDashboardStyles: () => removeBASDashboardStyles,
1154
1177
  removeDeviceOperationalCardGridStyles: () => removeDeviceOperationalCardGridStyles,
@@ -1190,6 +1213,7 @@ __export(index_exports, {
1190
1213
  schedShowNotificationModal: () => showNotificationModal,
1191
1214
  shouldFlashIcon: () => shouldFlashIcon,
1192
1215
  shouldVirtualizeAnnotationList: () => shouldVirtualize,
1216
+ slugifyCustomerName: () => slugifyCustomerName,
1193
1217
  sortAnnotationGroups: () => sortGroups,
1194
1218
  sortDeviceGridDevices: () => sortDevices,
1195
1219
  strings: () => strings_exports,
@@ -1216,7 +1240,7 @@ module.exports = __toCommonJS(index_exports);
1216
1240
  // package.json
1217
1241
  var package_default = {
1218
1242
  name: "myio-js-library",
1219
- version: "0.1.520",
1243
+ version: "0.1.522",
1220
1244
  description: "A clean, standalone JS SDK for MYIO projects",
1221
1245
  license: "MIT",
1222
1246
  repository: "github:gh-myio/myio-js-library",
@@ -2511,7 +2535,10 @@ var DeviceIconType = {
2511
2535
  HIDROMETRO_AREA_COMUM: "HIDROMETRO_AREA_COMUM",
2512
2536
  HIDROMETRO_SHOPPING: "HIDROMETRO_SHOPPING",
2513
2537
  CAIXA_DAGUA: "CAIXA_DAGUA",
2514
- TERMOSTATO: "TERMOSTATO"
2538
+ TERMOSTATO: "TERMOSTATO",
2539
+ COMPRESSOR: "COMPRESSOR",
2540
+ VENTILADOR: "VENTILADOR",
2541
+ SOLENOIDE: "SOLENOIDE"
2515
2542
  };
2516
2543
  var deviceIcons = {
2517
2544
  ESCADA_ROLANTE: "https://dashboard.myio-bas.com/api/images/public/EJ997iB2HD1AYYUHwIloyQOOszeqb2jp",
@@ -2531,7 +2558,12 @@ var deviceIcons = {
2531
2558
  HIDROMETRO_AREA_COMUM: "https://dashboard.myio-bas.com/api/images/public/IbEhjsvixAxwKg1ntGGZc5xZwwvGKv2t",
2532
2559
  HIDROMETRO_SHOPPING: "https://dashboard.myio-bas.com/api/images/public/OIMmvN4ZTKYDvrpPGYY5agqMRoSaWNTI",
2533
2560
  CAIXA_DAGUA: "https://dashboard.myio-bas.com/api/images/public/3t6WVhMQJFsrKA8bSZmrngDsNPkZV7fq",
2534
- TERMOSTATO: "https://dashboard.myio-bas.com/api/images/public/rtCcq6kZZVCD7wgJywxEurRZwR8LA7Q7"
2561
+ TERMOSTATO: "https://dashboard.myio-bas.com/api/images/public/rtCcq6kZZVCD7wgJywxEurRZwR8LA7Q7",
2562
+ // COMPRESSOR shares FANCOIL art; VENTILADOR shares MOTOR/BOMBA art (single static icons, no on/off variation).
2563
+ COMPRESSOR: "https://dashboard.myio-bas.com/api/images/public/4BWMuVIFHnsfqatiV86DmTrOB7IF0X8Y",
2564
+ VENTILADOR: "https://dashboard.myio-bas.com/api/images/public/Rge8Q3t0CP5PW8XyTn9bBK9aVP6uzSTT",
2565
+ // SOLENOIDE: single representative (on); dynamic on/off/offline lives in solenoid-control SOLENOID_IMAGES.
2566
+ SOLENOIDE: "https://dashboard.myio-bas.com/api/images/public/Tnq47Vd1TxhhqhYoHvzS73WVh1X84fPa"
2535
2567
  };
2536
2568
  var deviceIconLabels = {
2537
2569
  ESCADA_ROLANTE: "Escada Rolante",
@@ -2551,7 +2583,10 @@ var deviceIconLabels = {
2551
2583
  HIDROMETRO_AREA_COMUM: "Hidr\xF4metro \xC1rea Comum",
2552
2584
  HIDROMETRO_SHOPPING: "Hidr\xF4metro Shopping",
2553
2585
  CAIXA_DAGUA: "Caixa d'\xC1gua",
2554
- TERMOSTATO: "Termostato"
2586
+ TERMOSTATO: "Termostato",
2587
+ COMPRESSOR: "Compressor",
2588
+ VENTILADOR: "Ventilador",
2589
+ SOLENOIDE: "Solenoide"
2555
2590
  };
2556
2591
  var DEFAULT_DEVICE_ICON = "https://dashboard.myio-bas.com/api/images/public/f9Ce4meybsdaAhAkUlAfy5ei3I4kcN4k";
2557
2592
  function getDeviceIcon(deviceType) {
@@ -2645,6 +2680,122 @@ var DEVICE_TYPE_PREFIX_MAP = {
2645
2680
  function getDeviceTypePrefix(deviceType) {
2646
2681
  return DEVICE_TYPE_PREFIX_MAP[deviceType || ""] || DEFAULT_DEVICE_TYPE_PREFIX;
2647
2682
  }
2683
+ var DEFAULT_DEVICE_TYPE_TOKEN = "DEV";
2684
+ var DEVICE_TYPE_CODE_TOKEN = {
2685
+ "3F_MEDIDOR": "3F"
2686
+ };
2687
+ function deviceTypeToken(deviceType) {
2688
+ const raw = String(deviceType || "").trim().toUpperCase();
2689
+ if (!raw) return DEFAULT_DEVICE_TYPE_TOKEN;
2690
+ if (DEVICE_TYPE_CODE_TOKEN[raw]) return DEVICE_TYPE_CODE_TOKEN[raw];
2691
+ const sanitized = raw.replace(/[^A-Z0-9]+/g, "-").replace(/^-+|-+$/g, "");
2692
+ return sanitized || DEFAULT_DEVICE_TYPE_TOKEN;
2693
+ }
2694
+ function generateDeviceCode(deviceType) {
2695
+ return `D-${deviceTypeToken(deviceType)}-${generateMercosulPlate()}-${generateMercosulPlate()}`;
2696
+ }
2697
+
2698
+ // src/utils/customer.ts
2699
+ function generateCustomerCode() {
2700
+ return `C-${generateMercosulPlate()}-${generateMercosulPlate()}`;
2701
+ }
2702
+ var CUSTOMER_CODE_RE = /^C-[ABCDEFGHJKLMNPQRSTUVWXYZ]{3}[2-9][ABCDEFGHJKLMNPQRSTUVWXYZ][2-9]{2}-[ABCDEFGHJKLMNPQRSTUVWXYZ]{3}[2-9][ABCDEFGHJKLMNPQRSTUVWXYZ][2-9]{2}$/;
2703
+ function isCustomerCode(code) {
2704
+ return typeof code === "string" && CUSTOMER_CODE_RE.test(code);
2705
+ }
2706
+ var CUSTOMER_NAME_STOPWORDS = /* @__PURE__ */ new Set([
2707
+ "de",
2708
+ "da",
2709
+ "do",
2710
+ "dos",
2711
+ "das",
2712
+ "e",
2713
+ "a",
2714
+ "o",
2715
+ "em",
2716
+ "the",
2717
+ "of",
2718
+ "and",
2719
+ "in"
2720
+ ]);
2721
+ function slugifyCustomerName(name, stopwords = CUSTOMER_NAME_STOPWORDS) {
2722
+ return (name || "").normalize("NFD").replace(/[̀-ͯ]/g, "").toUpperCase().split(/\s+/).filter((w) => w.length > 0 && !stopwords.has(w.toLowerCase())).map((w) => w.replace(/[^A-Z0-9]/g, "").slice(0, 5)).filter(Boolean).join("-");
2723
+ }
2724
+ function extractItems(json) {
2725
+ const j = json;
2726
+ if (!j || typeof j !== "object") return [];
2727
+ const candidates = [
2728
+ j.items,
2729
+ j.data?.items,
2730
+ j.data
2731
+ ];
2732
+ for (const c of candidates) {
2733
+ if (Array.isArray(c)) return c;
2734
+ }
2735
+ return [];
2736
+ }
2737
+ async function checkCustomerCodeAvailable(code, cfg) {
2738
+ const doFetch = cfg.fetch || fetch;
2739
+ const base = cfg.baseUrl.replace(/\/+$/, "");
2740
+ const url = `${base}/customers?search=${encodeURIComponent(code)}`;
2741
+ const headers = { Accept: "application/json" };
2742
+ if (cfg.token) headers.Authorization = `Bearer ${cfg.token}`;
2743
+ const res = await doFetch(url, { headers, signal: cfg.signal });
2744
+ if (!res.ok) {
2745
+ throw new Error(`checkCustomerCodeAvailable: HTTP ${res.status}`);
2746
+ }
2747
+ const json = await res.json();
2748
+ const items = extractItems(json);
2749
+ return !items.some((it) => String(it.code) === code);
2750
+ }
2751
+ async function pickUniqueCustomerCode(cfg) {
2752
+ const maxAttempts = cfg.maxAttempts ?? 256;
2753
+ for (let i = 0; i < maxAttempts; i++) {
2754
+ const code = generateCustomerCode();
2755
+ if (await checkCustomerCodeAvailable(code, cfg)) return code;
2756
+ }
2757
+ throw new Error(
2758
+ `pickUniqueCustomerCode: no available code after ${maxAttempts} attempts`
2759
+ );
2760
+ }
2761
+
2762
+ // src/utils/asset.ts
2763
+ function generateAssetCode() {
2764
+ return `A-${generateMercosulPlate()}-${generateMercosulPlate()}`;
2765
+ }
2766
+ var ASSET_CODE_RE = /^A-[ABCDEFGHJKLMNPQRSTUVWXYZ]{3}[2-9][ABCDEFGHJKLMNPQRSTUVWXYZ][2-9]{2}-[ABCDEFGHJKLMNPQRSTUVWXYZ]{3}[2-9][ABCDEFGHJKLMNPQRSTUVWXYZ][2-9]{2}$/;
2767
+ function isAssetCode(code) {
2768
+ return typeof code === "string" && ASSET_CODE_RE.test(code);
2769
+ }
2770
+ var ASSET_TYPE_CONFIG = {
2771
+ LOCATION: { icon: "MapPin", color: "#3b82f6" },
2772
+ BUILDING: { icon: "Building2", color: "#8b5cf6" },
2773
+ FLOOR: { icon: "Layers", color: "#f59e0b" },
2774
+ ROOM: { icon: "DoorOpen", color: "#10b981" },
2775
+ EQUIPMENT: { icon: "Settings2", color: "#ef4444" },
2776
+ OTHER: { icon: "Box", color: "#6b7280" }
2777
+ };
2778
+ function getAssetTypeConfig(type) {
2779
+ const key = String(type || "").toUpperCase();
2780
+ return ASSET_TYPE_CONFIG[key] ?? ASSET_TYPE_CONFIG.OTHER;
2781
+ }
2782
+ function applyCustomerCodeToAssetName(assetName, customerCode) {
2783
+ const name = (assetName || "").trim();
2784
+ const code = (customerCode || "").trim();
2785
+ if (!code) return name;
2786
+ if (name === code || name.startsWith(`${code} `)) return name;
2787
+ return name ? `${code} ${name}` : code;
2788
+ }
2789
+ function assetLocalToken(assetName) {
2790
+ const name = (assetName || "").trim();
2791
+ const spaceIdx = name.indexOf(" ");
2792
+ if (spaceIdx === -1) return name;
2793
+ const head = name.slice(0, spaceIdx);
2794
+ if (CUSTOMER_CODE_RE.test(head)) {
2795
+ return name.slice(spaceIdx + 1).trim();
2796
+ }
2797
+ return name;
2798
+ }
2648
2799
 
2649
2800
  // src/utils/deviceItem.js
2650
2801
  var DomainType = {
@@ -4495,6 +4646,46 @@ async function detectSuperAdminHolding(customerId, jwtToken, tbBaseUrl) {
4495
4646
  return false;
4496
4647
  }
4497
4648
  }
4649
+ async function detectHoldingUserAdmin(jwtToken, tbBaseUrl) {
4650
+ const jwt = jwtToken || localStorage.getItem("jwt_token");
4651
+ if (!jwt) return false;
4652
+ const base = tbBaseUrl || "";
4653
+ const headers = {
4654
+ "Content-Type": "application/json",
4655
+ "X-Authorization": `Bearer ${jwt}`
4656
+ };
4657
+ try {
4658
+ const userResp = await fetch(`${base}/api/auth/user`, { method: "GET", headers, credentials: "include" });
4659
+ if (!userResp.ok) return false;
4660
+ const user = await userResp.json();
4661
+ const userId = user.id?.id || user.id;
4662
+ if (!userId) return false;
4663
+ const attrResp = await fetch(
4664
+ `${base}/api/plugins/telemetry/USER/${userId}/values/attributes/SERVER_SCOPE`,
4665
+ { method: "GET", headers, credentials: "include" }
4666
+ );
4667
+ if (!attrResp.ok) return false;
4668
+ const attrs = await attrResp.json();
4669
+ const truthy = (key) => {
4670
+ const a = Array.isArray(attrs) ? attrs.find((x) => x.key === key) : null;
4671
+ return a?.value === true || a?.value === "true";
4672
+ };
4673
+ const result = truthy("isHolding") && truthy("isUserAdmin");
4674
+ console.log(`[SuperAdminUtils] detectHoldingUserAdmin: userId=${userId} -> ${result}`);
4675
+ return result;
4676
+ } catch (error) {
4677
+ console.error("[SuperAdminUtils] detectHoldingUserAdmin error:", error);
4678
+ return false;
4679
+ }
4680
+ }
4681
+ async function canEditAlarmRules(jwtToken, tbBaseUrl) {
4682
+ try {
4683
+ if (await detectSuperAdminMyio(jwtToken, tbBaseUrl)) return true;
4684
+ return await detectHoldingUserAdmin(jwtToken, tbBaseUrl);
4685
+ } catch {
4686
+ return false;
4687
+ }
4688
+ }
4498
4689
  async function getAnnotationPermissions(customerId, jwtToken, tbBaseUrl) {
4499
4690
  const [currentUser, isSuperAdminMyio, isSuperAdminHolding] = await Promise.all([
4500
4691
  fetchCurrentUserInfo(jwtToken, tbBaseUrl),
@@ -21071,6 +21262,7 @@ var CardGridPanel = class {
21071
21262
  showTempRangeTooltip,
21072
21263
  enableActionSelector,
21073
21264
  actionSelectorOnCardClick,
21265
+ onCardRendered,
21074
21266
  enableSelection,
21075
21267
  enableDragDrop,
21076
21268
  handleSelect
@@ -21142,6 +21334,13 @@ var CardGridPanel = class {
21142
21334
  }
21143
21335
  wrapper.appendChild(cardResult[0]);
21144
21336
  grid.appendChild(wrapper);
21337
+ if (onCardRendered) {
21338
+ try {
21339
+ onCardRendered(item, cardResult[0]);
21340
+ } catch (err) {
21341
+ console.warn("[CardGridPanel] onCardRendered callback failed:", err);
21342
+ }
21343
+ }
21145
21344
  }
21146
21345
  });
21147
21346
  }
@@ -52834,7 +53033,7 @@ function formatAlarmRelativeTime(isoString) {
52834
53033
  // src/components/AlarmsNotificationsPanel/AlarmAnnotations.ts
52835
53034
  var _store = /* @__PURE__ */ new Map();
52836
53035
  async function _persistToDevice(tbConfig, alarmId) {
52837
- const { deviceId, tbBaseUrl, jwtToken, alarmType, alarmTitle } = tbConfig;
53036
+ const { deviceId, tbBaseUrl, jwtToken, alarmType, alarmTitle: alarmTitle2 } = tbConfig;
52838
53037
  const base = tbBaseUrl.replace(/\/$/, "");
52839
53038
  const authHdr = { "X-Authorization": `Bearer ${jwtToken}` };
52840
53039
  let existing = {};
@@ -52856,7 +53055,7 @@ async function _persistToDevice(tbConfig, alarmId) {
52856
53055
  const alarmGroups = existing.alarmGroups ?? {};
52857
53056
  alarmGroups[alarmType] = {
52858
53057
  alarmType,
52859
- alarmTitle,
53058
+ alarmTitle: alarmTitle2,
52860
53059
  lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
52861
53060
  annotations
52862
53061
  };
@@ -91040,6 +91239,178 @@ ${errors.slice(0, 5).join("\n")}` + (errors.length > 5 ? `
91040
91239
  renderModal4(container, state6, modalId, t);
91041
91240
  }
91042
91241
 
91242
+ // src/components/card-badges/index.ts
91243
+ var ALARM_STYLES_ID = "myio-alarm-badge-styles";
91244
+ var TICKET_STYLES_ID = "myio-ticket-badge-styles";
91245
+ function injectAlarmBadgeStyles() {
91246
+ if (document.getElementById(ALARM_STYLES_ID)) return;
91247
+ const s = document.createElement("style");
91248
+ s.id = ALARM_STYLES_ID;
91249
+ s.textContent = `
91250
+ .myio-alarm-badge {
91251
+ position: absolute;
91252
+ top: 6px;
91253
+ left: 6px;
91254
+ background: #dc2626;
91255
+ color: #fff;
91256
+ border-radius: 10px;
91257
+ padding: 2px 5px;
91258
+ font-size: 10px;
91259
+ font-weight: 700;
91260
+ display: flex;
91261
+ align-items: center;
91262
+ gap: 2px;
91263
+ z-index: 10;
91264
+ pointer-events: none;
91265
+ line-height: 1.3;
91266
+ }
91267
+ `;
91268
+ document.head.appendChild(s);
91269
+ }
91270
+ function injectTicketBadgeStyles() {
91271
+ if (document.getElementById(TICKET_STYLES_ID)) return;
91272
+ const s = document.createElement("style");
91273
+ s.id = TICKET_STYLES_ID;
91274
+ s.textContent = `
91275
+ /* Mini clone of .tbx-btn-ticket-notif */
91276
+ .myio-ticket-badge {
91277
+ position: absolute;
91278
+ bottom: 6px;
91279
+ left: 6px;
91280
+ width: 24px;
91281
+ height: 24px;
91282
+ background: rgba(8, 145, 178, 0.12);
91283
+ color: #0891b2;
91284
+ border: 1px solid rgba(8, 145, 178, 0.25);
91285
+ border-radius: 6px;
91286
+ display: flex;
91287
+ align-items: center;
91288
+ justify-content: center;
91289
+ z-index: 10;
91290
+ cursor: pointer;
91291
+ transition: background 0.15s, border-color 0.15s;
91292
+ }
91293
+ .myio-ticket-badge:hover {
91294
+ background: rgba(8, 145, 178, 0.22);
91295
+ border-color: rgba(8, 145, 178, 0.45);
91296
+ }
91297
+ /* Count pill \u2014 clone of .tbx-ticket-badge */
91298
+ .myio-ticket-badge-count {
91299
+ position: absolute;
91300
+ top: -5px;
91301
+ right: -5px;
91302
+ min-width: 14px;
91303
+ height: 14px;
91304
+ padding: 0 3px;
91305
+ border-radius: 7px;
91306
+ background: #0891b2;
91307
+ color: #fff;
91308
+ font-size: 9px;
91309
+ font-weight: 700;
91310
+ line-height: 14px;
91311
+ text-align: center;
91312
+ pointer-events: none;
91313
+ box-shadow: 0 1px 3px rgba(0,0,0,0.3);
91314
+ }
91315
+ `;
91316
+ document.head.appendChild(s);
91317
+ }
91318
+ function defaultAlarmCount(gcdrDeviceId) {
91319
+ const aso = window.AlarmServiceOrchestrator;
91320
+ return aso?.getAlarmCountForDevice?.(gcdrDeviceId) ?? 0;
91321
+ }
91322
+ function alarmTitle(count) {
91323
+ return `${count} alarme${count !== 1 ? "s" : ""} ativo${count !== 1 ? "s" : ""}`;
91324
+ }
91325
+ function ticketTitle(count) {
91326
+ return count > 0 ? `${count} chamado${count !== 1 ? "s" : ""} aberto${count !== 1 ? "s" : ""}` : "Chamados";
91327
+ }
91328
+ function addAlarmBadge(cardElement, gcdrDeviceId, opts) {
91329
+ if (!cardElement || !gcdrDeviceId) return;
91330
+ if (cardElement.querySelector(`[data-alarm-device-id="${gcdrDeviceId}"]`)) return;
91331
+ const count = (opts?.getCount ?? defaultAlarmCount)(gcdrDeviceId);
91332
+ injectAlarmBadgeStyles();
91333
+ if (cardElement.style) cardElement.style.position = "relative";
91334
+ const badge = document.createElement("div");
91335
+ badge.className = "myio-alarm-badge";
91336
+ badge.setAttribute("data-alarm-device-id", gcdrDeviceId);
91337
+ badge.style.display = count > 0 ? "" : "none";
91338
+ badge.title = alarmTitle(count);
91339
+ badge.innerHTML = `<svg viewBox="0 0 24 24" width="10" height="10" fill="currentColor" aria-hidden="true"><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6-6V11c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></svg><span>${count > 99 ? "99+" : count}</span>`;
91340
+ cardElement.appendChild(badge);
91341
+ }
91342
+ function refreshAlarmBadges(opts) {
91343
+ const getCount = opts?.getCount ?? defaultAlarmCount;
91344
+ document.querySelectorAll(".myio-alarm-badge[data-alarm-device-id]").forEach((badge) => {
91345
+ const gcdrDeviceId = badge.getAttribute("data-alarm-device-id");
91346
+ if (!gcdrDeviceId) return;
91347
+ const count = getCount(gcdrDeviceId);
91348
+ const span = badge.querySelector("span");
91349
+ if (count > 0) {
91350
+ badge.style.display = "";
91351
+ badge.title = alarmTitle(count);
91352
+ if (span) span.textContent = count > 99 ? "99+" : String(count);
91353
+ } else {
91354
+ badge.style.display = "none";
91355
+ }
91356
+ });
91357
+ }
91358
+ function addTicketBadge(cardElement, identifier, ticketsItemsRaw, opts) {
91359
+ if (!cardElement || !identifier) return;
91360
+ if (cardElement.querySelector(`[data-ticket-identifier="${identifier}"]`)) return;
91361
+ const tso = window.TicketServiceOrchestrator;
91362
+ let count = tso?.getTicketCountForDevice?.(identifier) ?? 0;
91363
+ if (count === 0 && ticketsItemsRaw) {
91364
+ try {
91365
+ const parsed = typeof ticketsItemsRaw === "string" ? JSON.parse(ticketsItemsRaw) : ticketsItemsRaw;
91366
+ const summaries = Array.isArray(parsed) ? parsed : parsed?.items ?? [];
91367
+ count = summaries.filter(
91368
+ (t) => [2, 3, 6].includes(t?.status)
91369
+ ).length;
91370
+ } catch {
91371
+ }
91372
+ }
91373
+ injectTicketBadgeStyles();
91374
+ if (cardElement.style) cardElement.style.position = "relative";
91375
+ const gateOpen = opts?.gateOpen ?? window.MyIOUtils?.ticketsEnabled === true;
91376
+ const badge = document.createElement("div");
91377
+ badge.className = "myio-ticket-badge";
91378
+ badge.setAttribute("data-ticket-identifier", identifier);
91379
+ badge.style.display = count > 0 && gateOpen ? "" : "none";
91380
+ badge.title = ticketTitle(count);
91381
+ badge.innerHTML = '<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 18v-6a9 9 0 0 1 18 0v6"/><path d="M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3z"/><path d="M3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z"/></svg>' + (count > 0 ? `<span class="myio-ticket-badge-count">${count > 99 ? "99+" : count}</span>` : "");
91382
+ cardElement.appendChild(badge);
91383
+ }
91384
+ function refreshTicketBadges(opts) {
91385
+ const tso = window.TicketServiceOrchestrator;
91386
+ if (!tso?.getTicketCountForDevice) return;
91387
+ const gateOpen = opts?.gateOpen ?? window.MyIOUtils?.ticketsEnabled === true;
91388
+ if (!gateOpen) {
91389
+ document.querySelectorAll(".myio-ticket-badge").forEach((el2) => {
91390
+ el2.style.display = "none";
91391
+ });
91392
+ return;
91393
+ }
91394
+ document.querySelectorAll(".myio-ticket-badge[data-ticket-identifier]").forEach((badge) => {
91395
+ const identifier = badge.getAttribute("data-ticket-identifier");
91396
+ if (!identifier) return;
91397
+ const count = tso.getTicketCountForDevice(identifier);
91398
+ if (count > 0) {
91399
+ badge.style.display = "";
91400
+ badge.title = ticketTitle(count);
91401
+ let pill = badge.querySelector(".myio-ticket-badge-count");
91402
+ if (!pill) {
91403
+ pill = document.createElement("span");
91404
+ pill.className = "myio-ticket-badge-count";
91405
+ badge.appendChild(pill);
91406
+ }
91407
+ pill.textContent = count > 99 ? "99+" : String(count);
91408
+ } else {
91409
+ badge.style.display = "none";
91410
+ }
91411
+ });
91412
+ }
91413
+
91043
91414
  // src/components/premium-modals/dialog/styles.ts
91044
91415
  var FONT_LINK_ID = "myio-dialog-font-nunito";
91045
91416
  var STYLE_ID3 = "myio-dialog-styles";
@@ -131397,6 +131768,7 @@ function injectOnOffDeviceModalStyles() {
131397
131768
  display: flex;
131398
131769
  flex-direction: row;
131399
131770
  width: 100%;
131771
+ max-width: 100%;
131400
131772
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
131401
131773
  box-sizing: border-box;
131402
131774
  overflow: hidden;
@@ -131492,6 +131864,7 @@ function injectOnOffDeviceModalStyles() {
131492
131864
  padding: 12px 8px;
131493
131865
  overflow: hidden;
131494
131866
  box-sizing: border-box;
131867
+ min-width: 0;
131495
131868
  }
131496
131869
 
131497
131870
  /* View container for chart/schedule toggle */
@@ -131866,10 +132239,12 @@ function injectOnOffDeviceModalStyles() {
131866
132239
  }
131867
132240
 
131868
132241
  .${ON_OFF_MODAL_CSS_PREFIX}__schedule-title {
131869
- font-size: 15px;
131870
- font-weight: 600;
132242
+ font-size: 15px !important;
132243
+ font-weight: 600 !important;
131871
132244
  color: var(--onoff-text-color, #1f2937);
131872
- margin: 0;
132245
+ margin: 0 !important;
132246
+ padding: 0 !important;
132247
+ line-height: 1.3 !important;
131873
132248
  }
131874
132249
 
131875
132250
  .${ON_OFF_MODAL_CSS_PREFIX}__schedule-content {
@@ -132092,54 +132467,187 @@ function injectOnOffDeviceModalStyles() {
132092
132467
  color: var(--onoff-text-color, #f3f4f6);
132093
132468
  }
132094
132469
 
132095
- /* ===== Responsive ===== */
132470
+ /* ===== Responsive: tablet / mobile \u2264768px ===== */
132096
132471
  @media (max-width: 768px) {
132472
+ /* Ocultar solenoide e toolbar no modo agendamento */
132473
+ .${ON_OFF_MODAL_CSS_PREFIX}[data-view="schedule"] .${ON_OFF_MODAL_CSS_PREFIX}__control-container {
132474
+ display: none;
132475
+ }
132476
+
132477
+ .${ON_OFF_MODAL_CSS_PREFIX}[data-view="schedule"] .${ON_OFF_MODAL_CSS_PREFIX}__toolbar {
132478
+ display: none;
132479
+ }
132480
+
132481
+ /* Root: layout em coluna, sem overflow */
132097
132482
  .${ON_OFF_MODAL_CSS_PREFIX} {
132098
132483
  flex-direction: column;
132484
+ max-width: 100%;
132485
+ overflow: hidden;
132486
+ box-sizing: border-box;
132099
132487
  }
132100
132488
 
132489
+ /* Left panel: row horizontal compacto */
132101
132490
  .${ON_OFF_MODAL_CSS_PREFIX}__left-panel {
132102
132491
  width: 100%;
132103
132492
  max-width: none;
132493
+ min-width: 0;
132104
132494
  flex-direction: row;
132495
+ align-items: center;
132105
132496
  border-right: none;
132106
132497
  border-bottom: 1px solid var(--onoff-border-color, #e5e7eb);
132107
- padding: 12px;
132498
+ padding: 10px 12px;
132499
+ gap: 10px;
132500
+ box-sizing: border-box;
132501
+ overflow: hidden;
132108
132502
  }
132109
132503
 
132110
- .${ON_OFF_MODAL_CSS_PREFIX}__control-container,
132111
- .${ON_OFF_MODAL_CSS_PREFIX}__schedule-btn-container {
132504
+ /* Control container: expande, sem overflow */
132505
+ .${ON_OFF_MODAL_CSS_PREFIX}__control-container {
132112
132506
  flex: 1;
132507
+ min-width: 0;
132508
+ overflow: hidden;
132509
+ }
132510
+
132511
+ /* Bottom-buttons: separador vertical (border-left), coluna compacta */
132512
+ .${ON_OFF_MODAL_CSS_PREFIX}__bottom-buttons {
132513
+ flex-direction: column;
132514
+ align-items: center;
132515
+ border-top: none;
132516
+ border-left: 1px solid var(--onoff-border-color, #e5e7eb);
132517
+ padding-top: 0;
132518
+ padding-left: 10px;
132519
+ margin-top: 0;
132520
+ gap: 6px;
132521
+ flex-shrink: 0;
132522
+ }
132523
+
132524
+ .${ON_OFF_MODAL_CSS_PREFIX}__schedule-btn-container {
132525
+ flex: 0 0 auto;
132113
132526
  }
132114
132527
 
132115
132528
  .${ON_OFF_MODAL_CSS_PREFIX}__schedule-btn {
132116
- padding: 12px 16px;
132529
+ padding: 8px 10px;
132530
+ gap: 4px;
132531
+ max-width: none;
132117
132532
  }
132118
132533
 
132119
132534
  .${ON_OFF_MODAL_CSS_PREFIX}__schedule-btn-icon {
132120
- font-size: 24px;
132535
+ font-size: 20px;
132536
+ }
132537
+
132538
+ .${ON_OFF_MODAL_CSS_PREFIX}__schedule-btn-label {
132539
+ font-size: 11px;
132121
132540
  }
132122
132541
 
132542
+ .${ON_OFF_MODAL_CSS_PREFIX}__refresh-btn {
132543
+ padding: 5px 8px;
132544
+ font-size: 11px;
132545
+ margin-top: 0;
132546
+ }
132547
+
132548
+ /* Right panel: full width, sem overflow */
132549
+ .${ON_OFF_MODAL_CSS_PREFIX}__right-panel {
132550
+ padding: 8px 6px;
132551
+ overflow: hidden;
132552
+ max-width: 100%;
132553
+ min-width: 0;
132554
+ box-sizing: border-box;
132555
+ }
132556
+
132557
+ /* Toolbar: wrap, overflow hidden */
132123
132558
  .${ON_OFF_MODAL_CSS_PREFIX}__toolbar {
132124
132559
  flex-wrap: wrap;
132560
+ gap: 4px;
132561
+ padding: 6px 8px;
132562
+ overflow: hidden;
132563
+ box-sizing: border-box;
132564
+ }
132565
+
132566
+ .${ON_OFF_MODAL_CSS_PREFIX}__toolbar-label {
132567
+ font-size: 11px;
132568
+ letter-spacing: 0;
132569
+ flex-shrink: 0;
132125
132570
  }
132126
132571
 
132572
+ /* min-width:0 \xE9 CR\xCDTICO para flex n\xE3o estourar */
132127
132573
  .${ON_OFF_MODAL_CSS_PREFIX}__date-input-wrapper {
132574
+ flex: 1;
132575
+ min-width: 0;
132128
132576
  max-width: none;
132577
+ overflow: hidden;
132129
132578
  }
132130
132579
 
132131
- .${ON_OFF_MODAL_CSS_PREFIX}__refresh-btn {
132132
- padding: 5px 10px;
132580
+ .${ON_OFF_MODAL_CSS_PREFIX}__date-input {
132581
+ overflow: hidden;
132582
+ text-overflow: ellipsis;
132583
+ white-space: nowrap;
132584
+ font-size: 12px;
132585
+ }
132586
+
132587
+ /* Export buttons: compactos mas vis\xEDveis */
132588
+ .${ON_OFF_MODAL_CSS_PREFIX}__export-buttons {
132589
+ flex-shrink: 0;
132590
+ display: flex !important;
132591
+ gap: 4px !important;
132592
+ margin-left: 0 !important;
132593
+ }
132594
+
132595
+ .${ON_OFF_MODAL_CSS_PREFIX}__export-btn {
132596
+ padding: 4px 8px;
132133
132597
  font-size: 11px;
132598
+ gap: 3px;
132599
+ white-space: nowrap;
132600
+ flex-shrink: 0;
132134
132601
  }
132135
132602
  }
132136
132603
 
132137
- .myio-onoff-modal__schedule-view {
132138
- max-height: 704px;
132604
+ /* ===== Responsive: mobile pequeno \u2264480px ===== */
132605
+ @media (max-width: 480px) {
132606
+ /* PER\xCDODO label ocupa linha pr\xF3pria */
132607
+ .${ON_OFF_MODAL_CSS_PREFIX}__toolbar-label {
132608
+ width: 100%;
132609
+ font-size: 10px;
132610
+ margin-bottom: 0;
132611
+ }
132612
+
132613
+ .${ON_OFF_MODAL_CSS_PREFIX}__date-input {
132614
+ font-size: 11px;
132615
+ padding: 5px 8px 5px 26px;
132616
+ }
132617
+
132618
+ /* Export: sem \xEDcone SVG, s\xF3 texto */
132619
+ .${ON_OFF_MODAL_CSS_PREFIX}__export-btn svg {
132620
+ display: none;
132621
+ }
132622
+
132623
+ .${ON_OFF_MODAL_CSS_PREFIX}__export-btn {
132624
+ padding: 4px 10px;
132625
+ min-width: 36px;
132626
+ }
132627
+
132628
+ /* Schedule view: remove alturas fixas */
132629
+ .${ON_OFF_MODAL_CSS_PREFIX}__schedule-view {
132630
+ min-height: 0 !important;
132631
+ max-height: none !important;
132632
+ }
132633
+
132634
+ /* Schedule header e t\xEDtulo compactos */
132635
+ .${ON_OFF_MODAL_CSS_PREFIX}__schedule-header {
132636
+ padding: 6px 10px;
132637
+ margin-bottom: 6px;
132638
+ }
132639
+
132640
+ .${ON_OFF_MODAL_CSS_PREFIX}__schedule-title {
132641
+ font-size: 13px !important;
132642
+ }
132139
132643
  }
132140
132644
 
132141
- .myio-onoff-modal__schedule-view {
132142
- min-height: 435px;
132645
+ /* Schedule view heights \u2014 apenas desktop (\u2265769px) */
132646
+ @media (min-width: 769px) {
132647
+ .${ON_OFF_MODAL_CSS_PREFIX}__schedule-view {
132648
+ max-height: 704px;
132649
+ min-height: 435px;
132650
+ }
132143
132651
  }
132144
132652
  `;
132145
132653
  document.head.appendChild(style);
@@ -133459,6 +133967,7 @@ var OnOffDeviceModalView = class {
133459
133967
  injectOnOffDeviceModalStyles();
133460
133968
  this.root = document.createElement("div");
133461
133969
  this.root.className = this.getRootClassName();
133970
+ this.root.dataset.view = this.state.currentView;
133462
133971
  this.render();
133463
133972
  this.container.appendChild(this.root);
133464
133973
  if (this.jwtToken) {
@@ -134173,6 +134682,7 @@ var OnOffDeviceModalView = class {
134173
134682
  toggleView() {
134174
134683
  const newView = this.state.currentView === "chart" ? "schedule" : "chart";
134175
134684
  this.state.currentView = newView;
134685
+ this.root.dataset.view = newView;
134176
134686
  if (newView === "schedule") {
134177
134687
  if (this.chartView) {
134178
134688
  this.chartView.classList.add(`${ON_OFF_MODAL_CSS_PREFIX}__view-container--hidden`);
@@ -134495,6 +135005,29 @@ var OnOffDeviceModalController = class {
134495
135005
  background: #1f2937;
134496
135006
  color: #f3f4f6;
134497
135007
  }
135008
+
135009
+ /* ===== Mobile: remove min-height fixo e ajusta dimens\xF5es ===== */
135010
+ @media (max-width: 768px) {
135011
+ .${ON_OFF_MODAL_CSS_PREFIX}-content {
135012
+ min-height: auto !important;
135013
+ max-height: 92vh !important;
135014
+ width: 98% !important;
135015
+ border-radius: 8px !important;
135016
+ }
135017
+ }
135018
+
135019
+ @media (max-width: 480px) {
135020
+ .${ON_OFF_MODAL_CSS_PREFIX}-overlay {
135021
+ align-items: flex-end !important;
135022
+ padding: 0 !important;
135023
+ }
135024
+ .${ON_OFF_MODAL_CSS_PREFIX}-content {
135025
+ width: 100% !important;
135026
+ max-height: 96dvh !important;
135027
+ border-radius: 12px 12px 0 0 !important;
135028
+ margin: 0 !important;
135029
+ }
135030
+ }
134498
135031
  `;
134499
135032
  document.head.appendChild(style);
134500
135033
  }
@@ -139716,6 +140249,9 @@ var STYLES3 = `
139716
140249
  margin-top: 8px; padding: 10px 12px;
139717
140250
  background: #f4fbf9; border: 1px solid #c3e6e2; border-radius: 8px;
139718
140251
  display: flex; flex-direction: column; gap: 10px;
140252
+ /* O form \xE9 injetado dentro de .abm-rule-detail (flex-wrap row); sem isto
140253
+ ele s\xF3 ocupava a largura do conte\xFAdo. For\xE7a ocupar a linha inteira. */
140254
+ flex: 1 1 100%; width: 100%; box-sizing: border-box;
139719
140255
  }
139720
140256
  #${MODAL_ID3} .abm-ef-row {
139721
140257
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
@@ -146094,6 +146630,8 @@ var version = package_default.version || "0.0.0";
146094
146630
  ANNOTATION_TYPE_LABELS,
146095
146631
  ANNOTATION_TYPE_LABELS_EN,
146096
146632
  ANNOTATION_VIRTUAL_THRESHOLD,
146633
+ ASSET_CODE_RE,
146634
+ ASSET_TYPE_CONFIG,
146097
146635
  ActionButtonController,
146098
146636
  ActionButtonView,
146099
146637
  AlarmService,
@@ -146110,6 +146648,8 @@ var version = package_default.version || "0.0.0";
146110
146648
  CONSUMPTION_CHART_COLORS,
146111
146649
  CONSUMPTION_CHART_DEFAULTS,
146112
146650
  CONSUMPTION_THEME_COLORS,
146651
+ CUSTOMER_CODE_RE,
146652
+ CUSTOMER_NAME_STOPWORDS,
146113
146653
  CardGridPanel,
146114
146654
  CardGridTabsBuilder,
146115
146655
  ColumnSummaryTooltip,
@@ -146134,6 +146674,7 @@ var version = package_default.version || "0.0.0";
146134
146674
  DEFAULT_DEVICE_IMAGE,
146135
146675
  DEFAULT_DEVICE_OPERATIONAL_CARD_FILTER_STATE,
146136
146676
  DEFAULT_DEVICE_TYPE_PREFIX,
146677
+ DEFAULT_DEVICE_TYPE_TOKEN,
146137
146678
  DEFAULT_ENERGY_GROUP_COLORS,
146138
146679
  DEFAULT_EQUIPMENT_FILTER_STATE,
146139
146680
  DEFAULT_EQUIPMENT_STATS,
@@ -146174,6 +146715,7 @@ var version = package_default.version || "0.0.0";
146174
146715
  DEVICE_OPERATIONAL_CARD_GRID_STYLES,
146175
146716
  DEVICE_OPERATIONAL_CARD_STYLES,
146176
146717
  DEVICE_TYPES,
146718
+ DEVICE_TYPE_CODE_TOKEN,
146177
146719
  DEVICE_TYPE_CONFIG,
146178
146720
  DEVICE_TYPE_DOMAIN,
146179
146721
  DEVICE_TYPE_PREFIX_MAP,
@@ -146337,13 +146879,17 @@ var version = package_default.version || "0.0.0";
146337
146879
  WATER_UNITS,
146338
146880
  WELCOME_DEFAULT_PALETTE,
146339
146881
  WaterSummaryTooltip,
146882
+ addAlarmBadge,
146340
146883
  addDetectionContext,
146341
146884
  addFreshdeskTicketNote,
146342
146885
  addNamespace,
146886
+ addTicketBadge,
146343
146887
  aggregateByDay,
146344
146888
  appendFreshdeskTicketToTB,
146889
+ applyCustomerCodeToAssetName,
146345
146890
  applyDeviceGridFilters,
146346
146891
  archiveAlarmAnnotation,
146892
+ assetLocalToken,
146347
146893
  assignShoppingColors,
146348
146894
  averageByDay,
146349
146895
  buildAmbienteGroupData,
@@ -146375,7 +146921,9 @@ var version = package_default.version || "0.0.0";
146375
146921
  calculateShoppingDeviceCounts,
146376
146922
  calculateShoppingDeviceStats,
146377
146923
  calculateStats,
146924
+ canEditAlarmRules,
146378
146925
  canModifyAnnotation,
146926
+ checkCustomerCodeAvailable,
146379
146927
  clampTemperature,
146380
146928
  classify,
146381
146929
  classifyEquipment,
@@ -146457,12 +147005,14 @@ var version = package_default.version || "0.0.0";
146457
147005
  detectContext,
146458
147006
  detectDeviceType,
146459
147007
  detectDomainAndContext,
147008
+ detectHoldingUserAdmin,
146460
147009
  detectSuperAdminHolding,
146461
147010
  detectSuperAdminMyio,
146462
147011
  determineInterval,
146463
147012
  deviceIconLabels,
146464
147013
  deviceIcons,
146465
147014
  deviceStatusIcons,
147015
+ deviceTypeToken,
146466
147016
  doSchedulesOverlap,
146467
147017
  downloadAnnotationsTextFile,
146468
147018
  escapeAnnotationHtml,
@@ -146512,6 +147062,9 @@ var version = package_default.version || "0.0.0";
146512
147062
  formatWaterByGroup,
146513
147063
  formatWaterVolumeM3,
146514
147064
  formatarDuracao,
147065
+ generateAssetCode,
147066
+ generateCustomerCode,
147067
+ generateDeviceCode,
146515
147068
  generateExportFilename,
146516
147069
  generateFilterModalStyles,
146517
147070
  generateMercosulPlate,
@@ -146524,6 +147077,7 @@ var version = package_default.version || "0.0.0";
146524
147077
  getAlarmSeverityConfig,
146525
147078
  getAlarmStateConfig,
146526
147079
  getAnnotationPermissions,
147080
+ getAssetTypeConfig,
146527
147081
  getAuthCacheStats,
146528
147082
  getAvailabilityColorFromThresholds,
146529
147083
  getAvailableContexts,
@@ -146607,7 +147161,9 @@ var version = package_default.version || "0.0.0";
146607
147161
  interpolateTemperature,
146608
147162
  isAlarmActive,
146609
147163
  isAnnotationOverdue,
147164
+ isAssetCode,
146610
147165
  isConnectionStale,
147166
+ isCustomerCode,
146611
147167
  isDeviceIconType,
146612
147168
  isDeviceOffline,
146613
147169
  isEndAfterStart,
@@ -146671,9 +147227,12 @@ var version = package_default.version || "0.0.0";
146671
147227
  parseInputDateToDate,
146672
147228
  parseLogAnnotations,
146673
147229
  periodKey,
147230
+ pickUniqueCustomerCode,
146674
147231
  readFreshdeskTicketsFromTB,
146675
147232
  recalculateDeviceStatus,
146676
147233
  recomputeDeviceGridPercentages,
147234
+ refreshAlarmBadges,
147235
+ refreshTicketBadges,
146677
147236
  removeAlarmsNotificationsPanelStyles,
146678
147237
  removeBASDashboardStyles,
146679
147238
  removeDeviceOperationalCardGridStyles,
@@ -146715,6 +147274,7 @@ var version = package_default.version || "0.0.0";
146715
147274
  schedShowNotificationModal,
146716
147275
  shouldFlashIcon,
146717
147276
  shouldVirtualizeAnnotationList,
147277
+ slugifyCustomerName,
146718
147278
  sortAnnotationGroups,
146719
147279
  sortDeviceGridDevices,
146720
147280
  strings,