@nice2dev/ui-iot 1.2.2 → 1.3.1
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 +1 -1
- package/dist/index.mjs +479 -393
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("react"),B=(a,n)=>n,q=h.createContext(B),W=h.createContext("en");function M(){const a=h.useContext(q),n=h.useContext(W);return{t:a,lang:n}}const G={"chevron-down":"M6 9l6 6 6-6","chevron-up":"M18 15l-6-6-6 6","chevron-left":"M15 18l-6-6 6-6","chevron-right":"M9 6l6 6-6 6","arrow-left":"M19 12H5m0 0l7 7m-7-7l7-7","arrow-right":"M5 12h14m0 0l-7-7m7 7l-7 7","arrow-up":"M12 19V5m0 0l-7 7m7-7l7 7","arrow-down":"M12 5v14m0 0l7-7m-7 7l-7-7",close:"M18 6L6 18M6 6l12 12",plus:"M12 5v14m-7-7h14",minus:"M5 12h14",check:"M5 13l4 4L19 7",edit:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7M18.5 2.5a2.121 2.121 0 113 3L12 15l-4 1 1-4 9.5-9.5z",trash:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",copy:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z",download:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4",upload:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12",refresh:"M4 4v5h5M20 20v-5h-5M20.49 9A9 9 0 005.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 013.51 15",search:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",filter:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z","sort-asc":"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12","sort-desc":"M3 4h13M3 8h9m-9 4h9m5-4v12m0 0l-4-4m4 4l4-4",sort:"M6 10l6-6 6 6M6 14l6 6 6-6",menu:"M4 6h16M4 12h16M4 18h16","more-vertical":"M12 5v.01M12 12v.01M12 19v.01","more-horizontal":"M5 12h.01M12 12h.01M19 12h.01",settings:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z",eye:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z M15 12a3 3 0 11-6 0 3 3 0 016 0z","eye-off":"M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24 M1 1l22 22",lock:"M19 11H5a2 2 0 00-2 2v7a2 2 0 002 2h14a2 2 0 002-2v-7a2 2 0 00-2-2zm-3-4a4 4 0 10-8 0v4h8V7z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",warning:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",error:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",success:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",help:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",calendar:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",clock:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",file:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z",folder:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",image:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",link:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1",mail:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",phone:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",smartphone:"M7 2h10a2 2 0 012 2v16a2 2 0 01-2 2H7a2 2 0 01-2-2V4a2 2 0 012-2z M11 18h2",user:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z",users:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z",home:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6",star:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z",heart:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z",bell:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",grip:"M4 6h2m4 0h2m4 0h2M4 12h2m4 0h2m4 0h2M4 18h2m4 0h2m4 0h2",hash:"M4 9h16M4 15h16M10 3L8 21M16 3l-2 18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",circle:"M12 21a9 9 0 100-18 9 9 0 000 18z",box:"M21 8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16V8z M3.27 6.96L12 12.01l8.73-5.05 M12 22.08V12",tabs:"M3 9h18v10H3z M7 9V5h6v4",columns:"M4 4h7v16H4z M13 4h7v16h-7z",grid:"M3 3h7v7H3z M14 3h7v7h-7z M14 14h7v7h-7z M3 14h7v7H3z",table:"M3 5h18v14H3z M3 10h18M3 15h18M9 5v14M15 5v14",heading:"M6 4v16M18 4v16M6 12h12",type:"M4 7V4h16v3M9 20h6M12 4v16","align-left":"M3 6h18M3 12h12M3 18h15",input:"M4 9h16a1 1 0 011 1v4a1 1 0 01-1 1H4a1 1 0 01-1-1v-4a1 1 0 011-1z M7 12h5",button:"M5 9h14a2 2 0 012 2v2a2 2 0 01-2 2H5a2 2 0 01-2-2v-2a2 2 0 012-2z",select:"M4 6h16a1 1 0 011 1v10a1 1 0 01-1 1H4a1 1 0 01-1-1V7a1 1 0 011-1z M15 11l-3 3-3-3","check-square":"M9 11l3 3L22 4 M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11",video:"M23 7l-7 5 7 5V7z M16 5H3a2 2 0 00-2 2v10a2 2 0 002 2h13a2 2 0 002-2V7a2 2 0 00-2-2z",card:"M3 5h18a1 1 0 011 1v12a1 1 0 01-1 1H3a1 1 0 01-1-1V6a1 1 0 011-1z M3 10h18","bar-chart":"M6 20v-6M12 20V4M18 20v-10","line-chart":"M3 3v18h18 M7 15l4-4 3 3 5-6","area-chart":"M3 3v18h18 M7 17v-3l4-4 3 3 5-6v10z","pie-chart":"M21.21 15.89A10 10 0 118 2.83 M22 12A10 10 0 0012 2v10z","donut-chart":"M12 3a9 9 0 100 18 9 9 0 000-18z M12 8a4 4 0 100 8 4 4 0 000-8z","scatter-chart":"M3 3v18h18 M8 16h.01 M11 11h.01 M15 14h.01 M18 8h.01","bars-vertical":"M6 5v14M12 5v14M18 5v14",globe:"M12 3a9 9 0 100 18 9 9 0 000-18z M3 12h18 M12 3a14 14 0 010 18 M12 3a14 14 0 000 18",monitor:"M3 4h18a1 1 0 011 1v11a1 1 0 01-1 1H3a1 1 0 01-1-1V5a1 1 0 011-1z M8 21h8 M12 17v4",camera:"M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h3l2-3h6l2 3h3a2 2 0 012 2z M12 17a4 4 0 100-8 4 4 0 000 8z",plug:"M9 2v5 M15 2v5 M7 7h10v3a5 5 0 01-10 0V7z M12 15v7",save:"M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z M17 21v-8H7v8 M7 3v5h8",tag:"M20.59 13.41l-7.17 7.17a2 2 0 01-2.83 0L2 12V2h10l8.59 8.59a2 2 0 010 2.82z M7 7h.01",palette:"M12 2a10 10 0 000 20 2 2 0 002-2c0-.5-.2-1-.5-1.3a2 2 0 01-.5-1.2 2 2 0 012-2H17a5 5 0 005-5c0-5-4.5-9-10-9z M6.5 11.5h.01 M9.5 7.5h.01 M14.5 7.5h.01",book:"M4 19.5A2.5 2.5 0 016.5 17H20 M6.5 2H20v20H6.5A2.5 2.5 0 014 19.5v-15A2.5 2.5 0 016.5 2z",cloud:"M18 10h-1.26A8 8 0 109 20h9a5 5 0 000-10z",target:"M12 3a9 9 0 100 18 9 9 0 000-18z M12 7a5 5 0 100 10 5 5 0 000-10z M12 11a1 1 0 100 2 1 1 0 000-2z",message:"M21 11.5a8.5 8.5 0 01-8.5 8.5 8.4 8.4 0 01-3.8-.9L3 21l1.9-5.7a8.4 8.4 0 01-.9-3.8A8.5 8.5 0 0112.5 3 8.5 8.5 0 0121 11.5z",flask:"M9 2h6 M10 2v6.5L4.5 19a1 1 0 00.9 1.5h13.2a1 1 0 00.9-1.5L14 8.5V2 M7 15h10",rocket:"M12 15l-3-3a22 22 0 012-3.95A12.88 12.88 0 0122 2c0 2.72-.78 7.5-6 11a22 22 0 01-3.95 2z M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0 M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5 M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 00-2.91-.09z",music:"M9 18V5l12-2v13 M9 18a3 3 0 11-6 0 3 3 0 016 0z M21 16a3 3 0 11-6 0 3 3 0 016 0z",wifi:"M5 12.55a11 11 0 0114 0 M8.5 16.11a6 6 0 017 0 M12 20h.01 M2 8.82a15 15 0 0120 0",database:"M12 8c4.97 0 9-1.34 9-3s-4.03-3-9-3-9 1.34-9 3 4.03 3 9 3z M21 5v6c0 1.66-4.03 3-9 3s-9-1.34-9-3V5 M21 11v6c0 1.66-4.03 3-9 3s-9-1.34-9-3v-6",slash:"M12 3a9 9 0 100 18 9 9 0 000-18z M5.6 5.6l12.8 12.8",puzzle:"M19.4 13.6a1.6 1.6 0 10.2-3.2H19V7a2 2 0 00-2-2h-3.4v-.4a1.6 1.6 0 10-3.2 0V5H7a2 2 0 00-2 2v3.4h.4a1.6 1.6 0 100 3.2H5V17a2 2 0 002 2h3.4v.4a1.6 1.6 0 103.2 0V19H17a2 2 0 002-2v-3.4z",dollar:"M12 1v22 M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6",printer:"M6 9V2h12v7 M6 18H4a2 2 0 01-2-2v-5a2 2 0 012-2h16a2 2 0 012 2v5a2 2 0 01-2 2h-2 M6 14h12v8H6z",scale:"M12 3v18 M5 21h14 M5 7l7-2 7 2 M2 13a3 3 0 006 0L5 7zm14 0a3 3 0 006 0L19 7z",accessibility:"M12 3a9 9 0 100 18 9 9 0 000-18z M12 9a1.5 1.5 0 100-3 1.5 1.5 0 000 3z M7.5 10.5l4.5 1 4.5-1 M12 11.5v3.5l-2 3.5 M12 15l2 3.5",window:"M3 4h18a1 1 0 011 1v14a1 1 0 01-1 1H3a1 1 0 01-1-1V5a1 1 0 011-1z M2 9h20 M6 6.5h.01 M9 6.5h.01","map-pin":"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z M12 13a3 3 0 100-6 3 3 0 000 6z",cursor:"M5 3l14 7-6 2-2 6-6-15z",shuffle:"M16 3h5v5 M4 20L21 3 M21 16v5h-5 M15 15l6 6 M4 4l5 5",lightbulb:"M9 18h6 M10 22h4 M12 2a7 7 0 00-4 12.7c.6.5 1 1.3 1 2.1V18h6v-1.2c0-.8.4-1.6 1-2.1A7 7 0 0012 2z",server:"M3 4h18a1 1 0 011 1v4a1 1 0 01-1 1H3a1 1 0 01-1-1V5a1 1 0 011-1z M3 14h18a1 1 0 011 1v4a1 1 0 01-1 1H3a1 1 0 01-1-1v-4a1 1 0 011-1z M7 7h.01 M7 17h.01",terminal:"M4 17l6-6-6-6 M12 19h8","git-branch":"M6 3v12 M18 9a3 3 0 100-6 3 3 0 000 6z M6 21a3 3 0 100-6 3 3 0 000 6z M18 9a9 9 0 01-9 9",send:"M22 2L11 13 M22 2l-7 20-4-9-9-4 20-7z",play:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z M21 12a9 9 0 11-18 0 9 9 0 0118 0z",pause:"M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z",stop:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z M9 10a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z",mic:"M12 1a3 3 0 00-3 3v8a3 3 0 006 0V4a3 3 0 00-3-3zM19 10v2a7 7 0 01-14 0v-2M12 19v4M8 23h8",volume:"M11 5L6 9H2v6h4l5 4V5z M15.54 8.46a5 5 0 010 7.07 M19.07 4.93a10 10 0 010 14.14","volume-off":"M11 5L6 9H2v6h4l5 4V5z M23 9l-6 6 M17 9l6 6","skip-back":"M19 20L9 12l10-8v16z M5 19V5",expand:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4",collapse:"M9 9V5m0 4H5m4 0L4 4m11 5h4m-4 0V5m0 4l5-5M9 15v4m0-4H5m4 0l-5 5m15-5h-4m4 0v4m0-4l-5 5","external-link":"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",briefcase:"M20 7H4a2 2 0 00-2 2v9a2 2 0 002 2h16a2 2 0 002-2V9a2 2 0 00-2-2zM16 7V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v2M2 12h20",building:"M4 22V4a2 2 0 012-2h12a2 2 0 012 2v18M4 22h16M9 22v-4h6v4M9 6h.01M15 6h.01M9 10h.01M15 10h.01M9 14h.01M15 14h.01",medal:"M15.477 12.89L17 22l-5-3-5 3 1.523-9.11M12 15a6 6 0 100-12 6 6 0 000 12z",clipboard:"M9 2h6a1 1 0 011 1v1a1 1 0 01-1 1H9a1 1 0 01-1-1V3a1 1 0 011-1zM16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2","skip-forward":"M5 4l10 8-10 8V4zM19 5v14","at-sign":"M12 16a4 4 0 100-8 4 4 0 000 8zM16 12v1.5a2.5 2.5 0 005 0V12a9 9 0 10-3.5 7.14",gift:"M20 12v10H4V12M2 7h20v5H2zM12 22V7M12 7H7.5a2.5 2.5 0 010-5C11 2 12 7 12 7zM12 7h4.5a2.5 2.5 0 000-5C13 2 12 7 12 7z",archive:"M21 8v13H3V8M1 3h22v5H1zM10 12h4",reply:"M9 17l-5-5 5-5M4 12h11a4 4 0 014 4v2",forward:"M15 17l5-5-5-5M20 12H9a4 4 0 00-4 4v2",paperclip:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48",zap:"M13 2L3 14h9l-1 8 10-12h-9l1-8z",square:"M4 4h16v16H4z",triangle:"M12 4L3 20h18z",hexagon:"M7.5 3h9l4.5 9-4.5 9h-9L3 12z",diamond:"M12 2l10 10-10 10L2 12z",line:"M5 19L19 5",pen:"M12 19l7-7 3 3-7 7-3-3z M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z M11 11a2 2 0 100-4 2 2 0 000 4z",brush:"M9.06 11.9l8.07-8.06a2.85 2.85 0 114.03 4.03l-8.06 8.08 M7.07 14.94c-1.66 0-3 1.35-3 3.02 0 1.33-2.5 1.52-2 2.02 1.08 1.1 2.49 2.02 4 2.02 2.2 0 4-1.8 4-4.04a3.01 3.01 0 00-3-3.02z",droplet:"M12 2.69l5.66 5.66a8 8 0 11-11.31 0z",bucket:"M5 8h14l-1.5 11a2 2 0 01-2 1.8H8.5a2 2 0 01-2-1.8L5 8z M5 8l2-4h10l2 4",scissors:"M6 9a3 3 0 100-6 3 3 0 000 6z M6 21a3 3 0 100-6 3 3 0 000 6z M20 4L8.12 15.88 M14.47 14.48L20 20 M8.12 8.12L12 12",layers:"M12 2l9 5-9 5-9-5 9-5z M3 12l9 5 9-5 M3 17l9 5 9-5",crop:"M6 2v14a2 2 0 002 2h14 M2 6h14a2 2 0 012 2v14",eyedropper:"M2 22l1-1h3l9-9 M3 21v-3l9-9 M15 6l3.5-3.5a2.12 2.12 0 013 3L18 9l-3-3z",ruler:"M21.3 8.7l-6-6a1 1 0 00-1.4 0L2.7 13.9a1 1 0 000 1.4l6 6a1 1 0 001.4 0L21.3 10.1a1 1 0 000-1.4z M7.5 10.5l2 2 M11 7l2 2 M14.5 3.5l2 2",wand:"M15 4V2 M15 16v-2 M8 9h2 M20 9h2 M3 21l9-9 M12.2 6.2L11 5 M17.8 6.2L19 5 M17.8 11.8L19 13",move:"M5 9l-3 3 3 3 M9 5l3-3 3 3 M15 19l-3 3-3-3 M19 9l3 3-3 3 M2 12h20 M12 2v20",gamepad:"M6 12h4 M8 10v4 M15 13h.01 M18 11h.01 M2 12a4 4 0 014-4h12a4 4 0 014 4l-1.5 6a2 2 0 01-2 1.5H5.5a2 2 0 01-2-1.5L2 12z",eraser:"M7 21l-4.3-4.3a1 1 0 010-1.4l9.6-9.6a2 2 0 012.8 0l4.6 4.6a2 2 0 010 2.8L13 21H7z M22 21H7 M5 12l5 5",thermometer:"M14 14.76V3.5a2.5 2.5 0 00-5 0v11.26a4.5 4.5 0 105 0z",door:"M18 20V5a1 1 0 00-1-1H7a1 1 0 00-1 1v15 M3 20h18 M13 11.5h.01",stairs:"M3 20h3v-3h3v-3h3v-3h3v-3h3",elevator:"M5 3h14a1 1 0 011 1v16a1 1 0 01-1 1H5a1 1 0 01-1-1V4a1 1 0 011-1z M9.5 9L12 6.5 14.5 9 M9.5 15l2.5 2.5 2.5-2.5",bed:"M2 4v16 M2 8h18a2 2 0 012 2v10 M22 17H2 M6 8v4 M2 12h4",sofa:"M3 9V7a2 2 0 012-2h14a2 2 0 012 2v2 M21 9a2 2 0 00-2 2v3H5v-3a2 2 0 00-2-2 2 2 0 00-2 2v4a1 1 0 001 1h18a1 1 0 001-1v-4a2 2 0 00-2-2 M5 18v2 M19 18v2",chair:"M6 11V5a2 2 0 012-2h8a2 2 0 012 2v6 M5 11h14 M6 11l-1 8h14l-1-8 M6 19v2 M18 19v2",utensils:"M3 2v7a2 2 0 002 2 2 2 0 002-2V2 M5 2v20 M21 2v9c0 1-1 1.8-2 1.8h-1V20 M18 2v9",mountain:"M8 3l4 8 5-5 5 15H2L8 3z",tree:"M12 2L7 11h10L12 2z M9 11l3 5 3-5 M12 16v6",sun:"M12 17a5 5 0 100-10 5 5 0 000 10z M12 1v2 M12 21v2 M4.22 4.22l1.42 1.42 M18.36 18.36l1.42 1.42 M1 12h2 M21 12h2 M4.22 19.78l1.42-1.42 M18.36 5.64l1.42-1.42",moon:"M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z","list-ordered":"M10 6h11M10 12h11M10 18h11M4 6h1v4M4 10h2M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",unlink:"M18.84 12.25l1.72-1.71a5 5 0 0 0-7.07-7.07L11 5.78M3 3l18 18M9 15l3-3M14 11l3 3M14 21l-1.72-1.72a5 5 0 0 1-7.07-7.07L7 10.49",code:"M16 18l6-6-6-6M8 6l-6 6 6 6",quote:"M3 21c3-3 3-9 0-12M21 21c-3-3-3-9 0-12M9 7h6v6H9zM15 7h6v6h-6z",indent:"M3 8l4 4-4 4M7 6h14M7 12h14M3 18h18",outdent:"M7 8l-4 4 4 4M21 6H3M21 12H7M21 18H3","align-center":"M3 6h18M6 12h12M3 18h18","align-right":"M3 6h18M9 12h12M3 18h18","align-justify":"M3 6h18M3 12h18M3 18h18","align-top":"M4 4h16M9 8v12M15 8v7","align-middle":"M4 12h16M9 5v14M15 8v8","align-bottom":"M4 20h16M9 4v12M15 9v7","distribute-h":"M4 4v16M20 4v16M10 7h4v10h-4z","distribute-v":"M4 4h16M4 20h16M7 10h10v4H7z",parallelogram:"M7 5h14l-4 14H3z",barcode:"M4 5v14M6.5 5v14M10 5v14M13 5v14M15.5 5v14M19 5v14M20.5 5v14","qr-code":"M4 4h6v6H4z M14 4h6v6h-6z M4 14h6v6H4z M14 14h2v2h-2z M18 14h2v2h-2z M14 18h2v2h-2z M18 18h2v2h-2z",smile:"M12 22a10 10 0 1 1 0-20 10 10 0 0 1 0 20zM8 14s1.5 2 4 2 4-2 4-2M9 9h.01M15 9h.01",undo:"M9 14L4 9l5-5M4 9h10.5a5.5 5.5 0 010 11H11",redo:"M15 14l5-5-5-5M20 9H9.5a5.5 5.5 0 000 11H13",unlock:"M19 11H5a2 2 0 00-2 2v7a2 2 0 002 2h14a2 2 0 002-2v-7a2 2 0 00-2-2z M7 11V7a5 5 0 019.9-1",keyboard:"M4 6h16a2 2 0 012 2v8a2 2 0 01-2 2H4a2 2 0 01-2-2V8a2 2 0 012-2z M6 10h.01 M10 10h.01 M14 10h.01 M18 10h.01 M8 14h8","page-break":"M6 3v5h12V3 M6 21v-5h12v5 M2 12h3 M8 12h3 M13 12h3 M19 12h3",shield:"M12 2l8 3v6c0 5-3.4 9.4-8 11-4.6-1.6-8-6-8-11V5z",repeat:"M17 2l4 4-4 4 M3 11V9a4 4 0 014-4h14 M7 22l-4-4 4-4 M21 13v2a4 4 0 01-4 4H3",pin:"M12 17v5 M5 17h14l-1.5-3V8a2 2 0 00-2-2h-7a2 2 0 00-2 2v6z","mic-off":"M1 1l22 22 M9 9v3a3 3 0 005.12 2.12 M15 9.34V4a3 3 0 00-5.94-.6 M17 16.95A7 7 0 015 12v-2 M19 10v2a7 7 0 01-.11 1.23 M12 19v4 M8 23h8","log-out":"M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4 M16 17l5-5-5-5 M21 12H9","chevrons-left":"M11 17l-5-5 5-5 M18 17l-5-5 5-5","chevrons-right":"M13 17l5-5-5-5 M6 17l5-5-5-5","zoom-in":"M11 4a7 7 0 100 14 7 7 0 000-14z M21 21l-4.35-4.35 M11 8v6 M8 11h6","zoom-out":"M11 4a7 7 0 100 14 7 7 0 000-14z M21 21l-4.35-4.35 M8 11h6",navigation:"M12 2l7 19-7-4-7 4z","refresh-ccw":"M1 4v6h6 M23 20v-6h-6 M20.49 9A9 9 0 005.64 5.64L1 10 M3.51 15a9 9 0 0014.85 3.36L23 14",minimize:"M4 14h6v6 M20 10h-6V4 M14 10l7-7 M3 21l7-7",point:"M12 8a4 4 0 1 0 0 8a4 4 0 1 0 0-8z M12 12h.01",segment:"M6.5 17.5L17.5 6.5 M3 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0 M17 5a2 2 0 1 0 4 0a2 2 0 1 0-4 0",perpendicular:"M3 20h18 M12 20V4 M12 15h5v5",parallel:"M4 16L14 6 M10 20L20 10",midpoint:"M3 12h6 M15 12h6 M3 9v6 M21 9v6 M12 9a3 3 0 1 0 0 6a3 3 0 1 0 0-6z","angle-bisector":"M4 20h17 M4 20L16 5 M4 20l14.4-6.9 M10 20a6 6 0 0 0-2.25-4.68",group:"M3 7V3h4 M17 3h4v4 M21 17v4h-4 M7 21H3v-4 M7 7h5v5H7z M12 12h5v5h-5z",ungroup:"M3 3h8v8H3z M13 13h8v8h-8z"},Q={xs:12,sm:16,md:20,lg:24,xl:32},K=h.createContext({});function Y({path:a,size:n,className:i,style:s,color:l,title:r,onClick:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:l||"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:`nice-icon ${i||""}`,style:s,role:r?"img":"presentation","aria-label":r,"aria-hidden":!r,onClick:t,children:[r&&e.jsx("title",{children:r}),e.jsx("path",{d:a})]})}const p=({name:a,size:n="md",className:i,style:s,color:l,title:r,onClick:t})=>{const{resolver:o}=h.useContext(K),d=typeof n=="number"?n:Q[n];if(o){const v=o(a,d);if(v)return e.jsx("span",{className:`nice-icon-wrap ${i||""}`,style:s,onClick:t,children:v})}const m=G[a];return m?e.jsx(Y,{path:m,size:d,className:i,style:s,color:l,title:r,onClick:t}):null};process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;function J(){const a=globalThis.crypto;if(typeof(a==null?void 0:a.randomUUID)=="function")return a.randomUUID();const n=new Uint8Array(16);if(typeof(a==null?void 0:a.getRandomValues)=="function")a.getRandomValues(n);else for(let s=0;s<n.length;s++)n[s]=Math.floor(Math.random()*256);n[6]=n[6]&15|64,n[8]=n[8]&63|128;const i=Array.from(n,s=>s.toString(16).padStart(2,"0")).join("");return`${i.slice(0,8)}-${i.slice(8,12)}-${i.slice(12,16)}-${i.slice(16,20)}-${i.slice(20)}`}process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;const P={display:"inline-block",width:10,height:10,borderRadius:"50%",background:"currentColor"},S=[{type:"device-list",label:"Device List",icon:"list"},{type:"device-status",label:"Device Status",icon:"success"},{type:"telemetry-chart",label:"Telemetry Chart",icon:"bar-chart"},{type:"gauge",label:"Gauge",icon:"clock"},{type:"map",label:"Device Map",icon:"map-pin"},{type:"alarms",label:"Alarms",icon:"bell"},{type:"control-panel",label:"Control Panel",icon:"settings"},{type:"topology",label:"Network Topology",icon:"link"},{type:"kpi",label:"KPI Card",icon:"target"},{type:"camera-feed",label:"Camera Feed",icon:"video"}];function X({devices:a=[],widgets:n=[],alarms:i=[],onDeviceSelect:s,onWidgetChange:l,onCommand:r,onAlarmAcknowledge:t,fetchTelemetry:o,className:d=""}){const{t:m}=M(),[v,w]=h.useState(n),[j,f]=h.useState(null),[g,y]=h.useState("dashboard"),[x,C]=h.useState(!1),[_,T]=h.useState(""),u=h.useCallback(c=>{w(b=>{const N=c(b);return l==null||l(N),N})},[l]),z=h.useCallback(c=>{var N;const b={id:J(),type:c,title:((N=S.find(H=>H.type===c))==null?void 0:N.label)||c,position:{x:0,y:Z(v),width:4,height:3},config:{}};u(H=>[...H,b])},[v,u]),V=h.useCallback(c=>{f(c),s==null||s(c)},[s]),k=h.useCallback(c=>{t==null||t(c)},[t]),F=a.filter(c=>!_||c.name.toLowerCase().includes(_.toLowerCase())||c.type.toLowerCase().includes(_.toLowerCase())),D=i.filter(c=>!c.cleared),A=D.filter(c=>c.severity==="critical"||c.severity==="high");return e.jsxs("div",{className:`nice-iot-dashboard ${d}`,children:[e.jsxs("header",{className:"nice-iot-dashboard__header",children:[e.jsx("h1",{children:m("ioTDashboard.iotDashboard","IoT Dashboard")}),e.jsxs("div",{className:"nice-iot-dashboard__stats",children:[e.jsxs("span",{className:"nice-iot-dashboard__stat",children:[e.jsx("span",{className:"nice-iot-dashboard__stat-icon",children:e.jsx(p,{name:"wifi",size:14})}),m("ioTDashboard.devices","{devices} Devices").replace("{devices}",String(a.length))]}),e.jsxs("span",{className:"nice-iot-dashboard__stat nice-iot-dashboard__stat--online",children:[e.jsx("span",{className:"nice-iot-dashboard__stat-icon",style:P}),m("ioTDashboard.online","{online} Online").replace("{online}",String(a.filter(c=>c.status==="online").length))]}),e.jsxs("span",{className:"nice-iot-dashboard__stat nice-iot-dashboard__stat--offline",children:[e.jsx("span",{className:"nice-iot-dashboard__stat-icon",style:P}),m("ioTDashboard.offline","{offline} Offline").replace("{offline}",String(a.filter(c=>c.status==="offline").length))]}),A.length>0&&e.jsxs("span",{className:"nice-iot-dashboard__stat nice-iot-dashboard__stat--alarms",children:[e.jsx("span",{className:"nice-iot-dashboard__stat-icon",children:e.jsx(p,{name:"bell",size:14})}),m("ioTDashboard.alarms","{criticalAlarms} Alarms").replace("{criticalAlarms}",String(A.length))]})]}),e.jsxs("nav",{className:"nice-iot-dashboard__nav",children:[e.jsx("button",{className:`nice-iot-dashboard__nav-button ${g==="dashboard"?"nice-iot-dashboard__nav-button--active":""}`,onClick:()=>y("dashboard"),children:m("ioTDashboard.dashboard","Dashboard")}),e.jsx("button",{className:`nice-iot-dashboard__nav-button ${g==="devices"?"nice-iot-dashboard__nav-button--active":""}`,onClick:()=>y("devices"),children:m("ioTDashboard.devices2","Devices")}),e.jsxs("button",{className:`nice-iot-dashboard__nav-button ${g==="alarms"?"nice-iot-dashboard__nav-button--active":""}`,onClick:()=>y("alarms"),children:[m("ioTDashboard.alarms2","Alarms")," ",D.length>0&&`(${D.length})`]})]}),e.jsx("div",{className:"nice-iot-dashboard__actions",children:g==="dashboard"&&e.jsxs("button",{onClick:()=>C(!x),children:[e.jsx(p,{name:x?"check":"edit",size:14})," ",x?m("ioTDashboard.done","Done"):m("ioTDashboard.edit","Edit")]})})]}),g==="dashboard"&&e.jsxs("div",{className:"nice-iot-dashboard__main",children:[x&&e.jsxs("aside",{className:"nice-iot-dashboard__palette",children:[e.jsx("h4",{children:m("ioTDashboard.addWidget","Add Widget")}),S.map(c=>e.jsxs("button",{className:"nice-iot-dashboard__palette-item",onClick:()=>z(c.type),children:[e.jsx(p,{name:c.icon,size:16}),e.jsx("span",{children:c.label})]},c.type))]}),e.jsxs("div",{className:"nice-iot-dashboard__grid",children:[v.map(c=>e.jsx(ee,{widget:c,devices:a,alarms:i,isEditing:x,onCommand:r,onDelete:()=>u(b=>b.filter(N=>N.id!==c.id))},c.id)),v.length===0&&e.jsx("div",{className:"nice-iot-dashboard__empty",children:x?m("ioTDashboard.addWidgetsFromThePalette","Add widgets from the palette"):m("ioTDashboard.noWidgetsConfiguredClickEdit","No widgets configured. Click Edit to add widgets.")})]})]}),g==="devices"&&e.jsxs("div",{className:"nice-iot-dashboard__devices",children:[e.jsx("div",{className:"nice-iot-dashboard__devices-toolbar",children:e.jsx("input",{type:"search",placeholder:m("ioTDashboard.searchDevices","Search devices..."),value:_,onChange:c=>T(c.target.value)})}),e.jsx("div",{className:"nice-iot-dashboard__device-grid",children:F.map(c=>e.jsx(se,{device:c,isSelected:(j==null?void 0:j.id)===c.id,onSelect:()=>V(c)},c.id))}),j&&e.jsx(ie,{device:j,onCommand:r,onClose:()=>f(null)})]}),g==="alarms"&&e.jsx("div",{className:"nice-iot-dashboard__alarms",children:e.jsxs("table",{className:"nice-iot-dashboard__alarm-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:m("ioTDashboard.severity","Severity")}),e.jsx("th",{children:m("ioTDashboard.device","Device")}),e.jsx("th",{children:m("ioTDashboard.message","Message")}),e.jsx("th",{children:m("ioTDashboard.time","Time")}),e.jsx("th",{children:m("ioTDashboard.status","Status")}),e.jsx("th",{children:m("ioTDashboard.actions","Actions")})]})}),e.jsx("tbody",{children:D.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"nice-iot-dashboard__no-alarms",children:m("ioTDashboard.noActiveAlarms","No active alarms")})}):D.map(c=>{const b=a.find(N=>N.id===c.deviceId);return e.jsxs("tr",{className:`nice-iot-dashboard__alarm-row nice-iot-dashboard__alarm-row--${c.severity}`,children:[e.jsx("td",{children:e.jsx("span",{className:`nice-iot-dashboard__severity nice-iot-dashboard__severity--${c.severity}`,children:c.severity})}),e.jsx("td",{children:(b==null?void 0:b.name)||c.deviceId}),e.jsx("td",{children:c.message}),e.jsx("td",{children:c.timestamp.toLocaleString()}),e.jsx("td",{children:c.acknowledged?m("ioTDashboard.acknowledged","Acknowledged"):m("ioTDashboard.active","Active")}),e.jsx("td",{children:!c.acknowledged&&e.jsx("button",{onClick:()=>k(c.id),children:m("ioTDashboard.acknowledge","Acknowledge")})})]},c.id)})})]})})]})}function Z(a){return a.length===0?0:Math.max(...a.map(n=>n.position.y+n.position.height))}function L(a){switch(a){case"online":return"var(--nice-success, #28a745)";case"offline":return"var(--nice-text-secondary, #6c757d)";case"warning":return"var(--nice-warning, #ffc107)";case"error":return"var(--nice-danger, #dc3545)";case"maintenance":return"var(--nice-info, #17a2b8)";default:return"var(--nice-text-secondary, #6c757d)"}}function ee({widget:a,devices:n,alarms:i,isEditing:s,onCommand:l,onDelete:r}){const{t}=M(),o=S.find(d=>d.type===a.type);return e.jsxs("div",{className:`nice-iot-dashboard__widget nice-iot-dashboard__widget--${a.type}`,style:{gridColumn:`span ${a.position.width}`,gridRow:`span ${a.position.height}`},children:[e.jsxs("div",{className:"nice-iot-dashboard__widget-header",children:[e.jsx("span",{className:"nice-iot-dashboard__widget-icon",children:e.jsx(p,{name:(o==null?void 0:o.icon)??"box",size:14})}),e.jsx("span",{className:"nice-iot-dashboard__widget-title",children:a.title}),s&&e.jsx("button",{"aria-label":t("ioTDashboard.close","Close"),className:"nice-iot-dashboard__widget-delete",onClick:r,children:e.jsx(p,{name:"close",size:14})})]}),e.jsx("div",{className:"nice-iot-dashboard__widget-content",children:e.jsx(ae,{widget:a,devices:n,alarms:i,onCommand:l})})]})}function ae({widget:a,devices:n,alarms:i,onCommand:s}){const{t:l}=M();switch(a.type){case"device-list":return e.jsx("div",{className:"nice-iot-dashboard__device-list",children:n.slice(0,10).map(r=>e.jsxs("div",{className:"nice-iot-dashboard__device-list-item",children:[e.jsx("span",{className:"nice-iot-dashboard__device-status",style:{background:L(r.status)}}),e.jsx("span",{children:r.name}),e.jsx("span",{className:"nice-iot-dashboard__device-type",children:r.type})]},r.id))});case"device-status":return e.jsx("div",{className:"nice-iot-dashboard__status-grid",children:["online","offline","warning","error"].map(r=>{const t=n.filter(o=>o.status===r).length;return e.jsxs("div",{className:"nice-iot-dashboard__status-card",children:[e.jsx("span",{className:"nice-iot-dashboard__status-indicator",style:{background:L(r)}}),e.jsx("span",{className:"nice-iot-dashboard__status-count",children:t}),e.jsx("span",{className:"nice-iot-dashboard__status-label",children:r})]},r)})});case"telemetry-chart":return e.jsxs("div",{className:"nice-iot-dashboard__chart-placeholder",children:[e.jsx(p,{name:"bar-chart",size:32}),e.jsx("span",{children:l("ioTDashboard.telemetryChart","Telemetry Chart")}),e.jsx("small",{children:l("ioTDashboard.configureDeviceAndCapability","Configure device and capability")})]});case"gauge":return e.jsx("div",{className:"nice-iot-dashboard__gauge",children:e.jsxs("svg",{viewBox:"0 0 100 60",children:[e.jsx("path",{d:"M 10 55 A 40 40 0 0 1 90 55",fill:"none",stroke:"var(--nice-border, #e0e0e0)",strokeWidth:"8"}),e.jsx("path",{d:"M 10 55 A 40 40 0 0 1 90 55",fill:"none",stroke:"var(--nice-primary, #0066cc)",strokeWidth:"8",strokeDasharray:"63 126"}),e.jsx("text",{x:"50",y:"50",textAnchor:"middle",fontSize:"14",fontWeight:"bold",children:"50%"})]})});case"map":return e.jsxs("div",{className:"nice-iot-dashboard__map-placeholder",children:[e.jsx(p,{name:"map-pin",size:32}),e.jsx("span",{children:l("ioTDashboard.deviceMap","Device Map")}),e.jsx("small",{children:l("ioTDashboard.devicesWithLocation","{devices} devices with location").replace("{devices}",String(n.filter(r=>r.location).length))})]});case"alarms":{const r=i.filter(t=>!t.cleared).slice(0,5);return e.jsx("div",{className:"nice-iot-dashboard__alarm-list",children:r.length===0?e.jsx("div",{className:"nice-iot-dashboard__alarm-empty",children:l("ioTDashboard.noActiveAlarms","No active alarms")}):r.map(t=>e.jsxs("div",{className:`nice-iot-dashboard__alarm-item nice-iot-dashboard__alarm-item--${t.severity}`,children:[e.jsx("span",{className:"nice-iot-dashboard__alarm-severity",children:t.severity}),e.jsx("span",{className:"nice-iot-dashboard__alarm-message",children:t.message})]},t.id))})}case"control-panel":return e.jsxs("div",{className:"nice-iot-dashboard__control-placeholder",children:[e.jsx(p,{name:"settings",size:32}),e.jsx("span",{children:l("ioTDashboard.controlPanel","Control Panel")}),e.jsx("small",{children:l("ioTDashboard.configureDeviceControls","Configure device controls")})]});case"kpi":return e.jsxs("div",{className:"nice-iot-dashboard__kpi",children:[e.jsx("div",{className:"nice-iot-dashboard__kpi-value",children:n.length}),e.jsx("div",{className:"nice-iot-dashboard__kpi-label",children:l("ioTDashboard.totalDevices","Total Devices")})]});default:return e.jsx("div",{className:"nice-iot-dashboard__widget-placeholder",children:a.type})}}function se({device:a,isSelected:n,onSelect:i}){const{t:s}=M();return e.jsxs("div",{className:`nice-iot-dashboard__device-card ${n?"nice-iot-dashboard__device-card--selected":""}`,onClick:i,children:[e.jsxs("div",{className:"nice-iot-dashboard__device-card-header",children:[e.jsx("span",{className:"nice-iot-dashboard__device-status",style:{background:L(a.status)}}),e.jsx("span",{className:"nice-iot-dashboard__device-name",children:a.name})]}),e.jsxs("div",{className:"nice-iot-dashboard__device-card-body",children:[e.jsxs("div",{className:"nice-iot-dashboard__device-info",children:[e.jsx("span",{children:s("ioTDashboard.type","Type: {type}").replace("{type}",String(a.type))}),e.jsx("span",{children:s("ioTDashboard.protocol","Protocol: {protocol}").replace("{protocol}",String(a.protocol))})]}),a.lastSeen&&e.jsx("div",{className:"nice-iot-dashboard__device-lastseen",children:s("ioTDashboard.lastSeen","Last seen: {lastSeen}").replace("{lastSeen}",String(a.lastSeen.toLocaleString()))}),e.jsxs("div",{className:"nice-iot-dashboard__device-capabilities",children:[a.capabilities.slice(0,3).map(l=>e.jsx("span",{className:"nice-iot-dashboard__capability-badge",children:l.name},l.id)),a.capabilities.length>3&&e.jsxs("span",{className:"nice-iot-dashboard__capability-more",children:["+",a.capabilities.length-3]})]})]})]})}function ie({device:a,onCommand:n,onClose:i}){const{t:s}=M();return e.jsxs("aside",{className:"nice-iot-dashboard__device-detail",children:[e.jsxs("div",{className:"nice-iot-dashboard__device-detail-header",children:[e.jsx("h3",{children:a.name}),e.jsx("button",{"aria-label":s("ioTDashboard.close","Close"),onClick:i,children:e.jsx(p,{name:"close",size:14})})]}),e.jsxs("div",{className:"nice-iot-dashboard__device-detail-content",children:[e.jsxs("section",{children:[e.jsx("h4",{children:s("ioTDashboard.status","Status")}),e.jsxs("div",{className:"nice-iot-dashboard__detail-row",children:[e.jsx("span",{children:s("ioTDashboard.status2","Status:")}),e.jsx("span",{className:"nice-iot-dashboard__status-badge",style:{background:L(a.status)},children:a.status})]}),a.lastSeen&&e.jsxs("div",{className:"nice-iot-dashboard__detail-row",children:[e.jsx("span",{children:s("ioTDashboard.lastSeen2","Last Seen:")}),e.jsx("span",{children:a.lastSeen.toLocaleString()})]})]}),e.jsxs("section",{children:[e.jsx("h4",{children:s("ioTDashboard.connection","Connection")}),e.jsxs("div",{className:"nice-iot-dashboard__detail-row",children:[e.jsx("span",{children:s("ioTDashboard.protocol2","Protocol:")}),e.jsx("span",{children:a.protocol})]}),a.connectionInfo.host&&e.jsxs("div",{className:"nice-iot-dashboard__detail-row",children:[e.jsx("span",{children:s("ioTDashboard.host","Host:")}),e.jsxs("span",{children:[a.connectionInfo.host,":",a.connectionInfo.port]})]})]}),a.metadata&&e.jsxs("section",{children:[e.jsx("h4",{children:s("ioTDashboard.metadata","Metadata")}),a.metadata.manufacturer&&e.jsxs("div",{className:"nice-iot-dashboard__detail-row",children:[e.jsx("span",{children:s("ioTDashboard.manufacturer","Manufacturer:")}),e.jsx("span",{children:a.metadata.manufacturer})]}),a.metadata.model&&e.jsxs("div",{className:"nice-iot-dashboard__detail-row",children:[e.jsx("span",{children:s("ioTDashboard.model","Model:")}),e.jsx("span",{children:a.metadata.model})]})]}),e.jsxs("section",{children:[e.jsx("h4",{children:s("ioTDashboard.capabilities","Capabilities")}),e.jsx("div",{className:"nice-iot-dashboard__capabilities-list",children:a.capabilities.map(l=>e.jsxs("div",{className:"nice-iot-dashboard__capability-item",children:[e.jsx("span",{className:"nice-iot-dashboard__capability-name",children:l.name}),e.jsx("span",{className:"nice-iot-dashboard__capability-type",children:l.type}),l.writable&&n&&e.jsx("button",{className:"nice-iot-dashboard__capability-control",onClick:()=>n(a.id,l.id,!0),children:s("ioTDashboard.control","Control")})]},l.id))})]})]})]})}const ne=[{name:"MQTT Broker",image:"eclipse-mosquitto:latest"},{name:"Node-RED",image:"nodered/node-red:latest"},{name:"InfluxDB",image:"influxdb:latest"},{name:"Grafana",image:"grafana/grafana:latest"},{name:"Telegraf",image:"telegraf:latest"},{name:"Protocol Adapter",image:"nice2dev/protocol-adapter:latest"}];function re({nodes:a=[],modules:n=[],onNodeSelect:i,onModuleDeploy:s,onModuleAction:l,onNodeSync:r,className:t=""}){const{t:o}=M(),[d,m]=h.useState(null),[v,w]=h.useState("nodes"),[j,f]=h.useState(!1),[g,y]=h.useState({name:"",image:"",status:"pending"}),x=h.useCallback(u=>{m(u),i==null||i(u)},[i]),C=h.useCallback(async()=>{!d||!g.name||!g.image||(await(s==null?void 0:s(d.id,g)),f(!1),y({name:"",image:"",status:"pending"}))},[d,g,s]),_=h.useCallback(async(u,z)=>{d&&await(l==null?void 0:l(d.id,u,z))},[d,l]),T=h.useCallback(async()=>{d&&await(r==null?void 0:r(d.id))},[d,r]);return e.jsxs("div",{className:`nice-edge-manager ${t}`,children:[e.jsxs("header",{className:"nice-edge-manager__header",children:[e.jsx("h1",{children:o("edgeManager.edgeManager","Edge Manager")}),e.jsxs("nav",{className:"nice-edge-manager__nav",children:[e.jsx("button",{className:`nice-edge-manager__nav-button ${v==="nodes"?"nice-edge-manager__nav-button--active":""}`,onClick:()=>w("nodes"),children:o("edgeManager.nodes","Nodes ({nodes})").replace("{nodes}",String(a.length))}),e.jsx("button",{className:`nice-edge-manager__nav-button ${v==="modules"?"nice-edge-manager__nav-button--active":""}`,onClick:()=>w("modules"),children:o("edgeManager.modules","Modules")})]})]}),e.jsxs("div",{className:"nice-edge-manager__main",children:[v==="nodes"&&e.jsx("div",{className:"nice-edge-manager__nodes",children:e.jsxs("div",{className:"nice-edge-manager__node-grid",children:[a.map(u=>e.jsx(le,{node:u,isSelected:(d==null?void 0:d.id)===u.id,onSelect:()=>x(u)},u.id)),a.length===0&&e.jsx("div",{className:"nice-edge-manager__empty",children:o("edgeManager.noEdgeNodesConfigured","No edge nodes configured")})]})}),v==="modules"&&d&&e.jsxs("div",{className:"nice-edge-manager__modules",children:[e.jsxs("div",{className:"nice-edge-manager__modules-header",children:[e.jsx("h3",{children:o("edgeManager.modulesOn","Modules on {name}").replace("{name}",String(d.name))}),e.jsx("button",{className:"nice-edge-manager__deploy-btn",onClick:()=>f(!0),children:o("edgeManager.deployModule2","+ Deploy Module")})]}),e.jsxs("div",{className:"nice-edge-manager__module-grid",children:[d.deployedModules.map(u=>e.jsx(oe,{module:u,onAction:z=>_(u.id,z)},u.id)),d.deployedModules.length===0&&e.jsx("div",{className:"nice-edge-manager__empty",children:o("edgeManager.noModulesDeployedOnThis","No modules deployed on this node")})]})]}),v==="modules"&&!d&&e.jsx("div",{className:"nice-edge-manager__no-selection",children:o("edgeManager.selectANodeFromThe","Select a node from the Nodes tab to manage modules")}),d&&e.jsx(ce,{node:d,onSync:T,onClose:()=>m(null)})]}),j&&e.jsx(de,{config:g,templates:ne,onChange:y,onDeploy:C,onClose:()=>f(!1)})]})}function R(a){switch(a){case"running":return"var(--nice-success, #28a745)";case"stopped":return"var(--nice-text-secondary, #6c757d)";case"updating":return"var(--nice-warning, #ffc107)";case"error":return"var(--nice-danger, #dc3545)";case"unreachable":return"var(--nice-text-secondary, #868e96)";default:return"var(--nice-text-secondary, #6c757d)"}}function E(a){return a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(1)} KB`:a<1024*1024*1024?`${(a/1024/1024).toFixed(1)} MB`:`${(a/1024/1024/1024).toFixed(2)} GB`}function te(a){const n=Math.floor(a/86400),i=Math.floor(a%86400/3600),s=Math.floor(a%3600/60);return n>0?`${n}d ${i}h`:i>0?`${i}h ${s}m`:`${s}m`}function le({node:a,isSelected:n,onSelect:i}){const{t:s}=M();return e.jsxs("div",{className:`nice-edge-manager__node-card ${n?"nice-edge-manager__node-card--selected":""}`,onClick:i,children:[e.jsxs("div",{className:"nice-edge-manager__node-header",children:[e.jsx("span",{className:"nice-edge-manager__node-status",style:{background:R(a.status)}}),e.jsx("span",{className:"nice-edge-manager__node-name",children:a.name}),e.jsx("span",{className:"nice-edge-manager__node-type",children:a.type})]}),e.jsxs("div",{className:"nice-edge-manager__node-body",children:[e.jsxs("div",{className:"nice-edge-manager__node-info",children:[e.jsxs("span",{children:[e.jsx(p,{name:"server",size:12})," ",a.hardware.cpu]}),e.jsxs("span",{children:[e.jsx(p,{name:"database",size:12})," ",(a.hardware.memoryMB/1024).toFixed(1)," GB"]})]}),e.jsx("div",{className:"nice-edge-manager__node-metrics",children:a.metrics&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"nice-edge-manager__metric",children:[e.jsx("span",{className:"nice-edge-manager__metric-label",children:"CPU"}),e.jsx("div",{className:"nice-edge-manager__metric-bar",children:e.jsx("div",{className:"nice-edge-manager__metric-fill",style:{width:`${a.metrics.cpuUsage}%`}})}),e.jsxs("span",{className:"nice-edge-manager__metric-value",children:[a.metrics.cpuUsage.toFixed(0),"%"]})]}),e.jsxs("div",{className:"nice-edge-manager__metric",children:[e.jsx("span",{className:"nice-edge-manager__metric-label",children:s("edgeManager.mem","MEM")}),e.jsx("div",{className:"nice-edge-manager__metric-bar",children:e.jsx("div",{className:"nice-edge-manager__metric-fill",style:{width:`${a.metrics.memoryUsage}%`}})}),e.jsxs("span",{className:"nice-edge-manager__metric-value",children:[a.metrics.memoryUsage.toFixed(0),"%"]})]})]})}),e.jsx("div",{className:"nice-edge-manager__node-modules",children:s("edgeManager.modulesDeployed","{deployedModules} modules deployed").replace("{deployedModules}",String(a.deployedModules.length))})]})]})}function oe({module:a,onAction:n}){const{t:i}=M(),s={running:"var(--nice-success, #28a745)",stopped:"var(--nice-text-secondary, #6c757d)",error:"var(--nice-danger, #dc3545)",pending:"var(--nice-warning, #ffc107)"};return e.jsxs("div",{className:"nice-edge-manager__module-card",children:[e.jsxs("div",{className:"nice-edge-manager__module-header",children:[e.jsx("span",{className:"nice-edge-manager__module-status",style:{background:s[a.status]||"var(--nice-bg-tertiary, #6c757d)"}}),e.jsx("span",{className:"nice-edge-manager__module-name",children:a.name}),e.jsxs("span",{className:"nice-edge-manager__module-version",children:["v",a.version]})]}),e.jsxs("div",{className:"nice-edge-manager__module-body",children:[e.jsx("div",{className:"nice-edge-manager__module-image",children:a.image}),a.resources&&e.jsxs("div",{className:"nice-edge-manager__module-resources",children:[a.resources.cpuLimit&&e.jsx("span",{children:i("edgeManager.cpu","CPU: {cpuLimit}").replace("{cpuLimit}",String(a.resources.cpuLimit))}),a.resources.memoryLimitMB&&e.jsx("span",{children:i("edgeManager.ramMb","RAM: {memoryLimitMB} MB").replace("{memoryLimitMB}",String(a.resources.memoryLimitMB))})]}),a.ports&&a.ports.length>0&&e.jsx("div",{className:"nice-edge-manager__module-ports",children:i("edgeManager.ports","Ports: {ports}").replace("{ports}",String(a.ports.map(l=>`${l.host}:${l.container}`).join(", ")))})]}),e.jsxs("div",{className:"nice-edge-manager__module-actions",children:[a.status==="running"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>n("stop"),children:i("edgeManager.stop","Stop")}),e.jsx("button",{onClick:()=>n("restart"),children:i("edgeManager.restart","Restart")})]}),a.status==="stopped"&&e.jsx("button",{onClick:()=>n("start"),children:i("edgeManager.start","Start")}),e.jsx("button",{className:"nice-edge-manager__module-remove",onClick:()=>n("remove"),children:i("edgeManager.remove","Remove")})]})]})}function ce({node:a,onSync:n,onClose:i}){const{t:s}=M();return e.jsxs("aside",{className:"nice-edge-manager__detail",children:[e.jsxs("div",{className:"nice-edge-manager__detail-header",children:[e.jsx("h3",{children:a.name}),e.jsxs("div",{className:"nice-edge-manager__detail-actions",children:[e.jsxs("button",{onClick:n,children:[e.jsx(p,{name:"refresh",size:14})," ",s("edgeManager.sync","Sync")]}),e.jsx("button",{onClick:i,"aria-label":s("edgeManager.close","Close"),children:e.jsx(p,{name:"close",size:14})})]})]}),e.jsxs("div",{className:"nice-edge-manager__detail-content",children:[e.jsxs("section",{children:[e.jsx("h4",{children:s("edgeManager.status","Status")}),e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.status2","Status:")}),e.jsx("span",{className:"nice-edge-manager__status-badge",style:{background:R(a.status)},children:a.status})]}),a.metrics&&e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.uptime","Uptime:")}),e.jsx("span",{children:te(a.metrics.uptime)})]})]}),e.jsxs("section",{children:[e.jsx("h4",{children:s("edgeManager.hardware","Hardware")}),e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.cpu2","CPU:")}),e.jsx("span",{children:s("edgeManager.cores","{cpu} ({cores} cores)").replace("{cpu}",String(a.hardware.cpu)).replace("{cores}",String(a.hardware.cores))})]}),e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.memory2","Memory:")}),e.jsxs("span",{children:[(a.hardware.memoryMB/1024).toFixed(1)," GB"]})]}),e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.storage","Storage:")}),e.jsxs("span",{children:[(a.hardware.storageMB/1024).toFixed(1)," GB"]})]}),e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.architecture","Architecture:")}),e.jsx("span",{children:a.hardware.architecture})]})]}),e.jsxs("section",{children:[e.jsx("h4",{children:s("edgeManager.software","Software")}),e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.os","OS:")}),e.jsxs("span",{children:[a.software.os," ",a.software.osVersion]})]}),e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.runtime","Runtime:")}),e.jsxs("span",{children:[a.software.runtime," ",a.software.runtimeVersion]})]}),e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.agent","Agent:")}),e.jsxs("span",{children:[a.software.agent," v",a.software.agentVersion]})]})]}),e.jsxs("section",{children:[e.jsx("h4",{children:s("edgeManager.connectivity","Connectivity")}),e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.cloud","Cloud:")}),e.jsxs("span",{children:[e.jsx(p,{name:a.connectivity.cloudConnected?"check":"close",size:12})," ",a.connectivity.cloudConnected?s("edgeManager.connected","Connected"):s("edgeManager.disconnected","Disconnected")]})]}),e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.network","Network:")}),e.jsx("span",{children:a.connectivity.localNetwork})]}),a.connectivity.publicIP&&e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.publicIp","Public IP:")}),e.jsx("span",{children:a.connectivity.publicIP})]}),a.connectivity.lastSync&&e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.lastSync","Last Sync:")}),e.jsx("span",{children:a.connectivity.lastSync.toLocaleString()})]})]}),a.metrics&&e.jsxs("section",{children:[e.jsx("h4",{children:s("edgeManager.resourceUsage","Resource Usage")}),e.jsxs("div",{className:"nice-edge-manager__resource-chart",children:[e.jsxs("div",{className:"nice-edge-manager__resource-item",children:[e.jsx("span",{children:"CPU"}),e.jsx("div",{className:"nice-edge-manager__resource-bar",children:e.jsx("div",{className:"nice-edge-manager__resource-fill",style:{width:`${a.metrics.cpuUsage}%`}})}),e.jsxs("span",{children:[a.metrics.cpuUsage.toFixed(1),"%"]})]}),e.jsxs("div",{className:"nice-edge-manager__resource-item",children:[e.jsx("span",{children:s("edgeManager.memory","Memory")}),e.jsx("div",{className:"nice-edge-manager__resource-bar",children:e.jsx("div",{className:"nice-edge-manager__resource-fill",style:{width:`${a.metrics.memoryUsage}%`}})}),e.jsxs("span",{children:[a.metrics.memoryUsage.toFixed(1),"%"]})]}),e.jsxs("div",{className:"nice-edge-manager__resource-item",children:[e.jsx("span",{children:s("edgeManager.disk","Disk")}),e.jsx("div",{className:"nice-edge-manager__resource-bar",children:e.jsx("div",{className:"nice-edge-manager__resource-fill",style:{width:`${a.metrics.diskUsage}%`}})}),e.jsxs("span",{children:[a.metrics.diskUsage.toFixed(1),"%"]})]})]}),e.jsxs("div",{className:"nice-edge-manager__network-stats",children:[e.jsxs("span",{children:[e.jsx(p,{name:"arrow-down",size:12})," ",E(a.metrics.networkIn)]}),e.jsxs("span",{children:[e.jsx(p,{name:"arrow-up",size:12})," ",E(a.metrics.networkOut)]})]})]})]})]})}function de({config:a,templates:n,onChange:i,onDeploy:s,onClose:l}){const{t:r}=M();return e.jsx("div",{className:"nice-edge-manager__dialog-overlay",children:e.jsxs("div",{className:"nice-edge-manager__dialog",children:[e.jsxs("div",{className:"nice-edge-manager__dialog-header",children:[e.jsx("h3",{children:r("edgeManager.deployModule","Deploy Module")}),e.jsx("button",{onClick:l,"aria-label":r("edgeManager.close","Close"),children:e.jsx(p,{name:"close",size:14})})]}),e.jsxs("div",{className:"nice-edge-manager__dialog-content",children:[e.jsxs("div",{className:"nice-edge-manager__field",children:[e.jsx("label",{children:r("edgeManager.templateOptional","Template (optional)")}),e.jsxs("select",{value:"",onChange:t=>{const o=n.find(d=>d.image===t.target.value);o&&i({...a,name:o.name,image:o.image})},children:[e.jsx("option",{value:"",children:r("edgeManager.selectATemplate","Select a template...")}),n.map(t=>e.jsx("option",{value:t.image,children:t.name},t.image))]})]}),e.jsxs("div",{className:"nice-edge-manager__field",children:[e.jsx("label",{children:r("edgeManager.moduleName","Module Name")}),e.jsx("input",{type:"text",value:a.name||"",onChange:t=>i({...a,name:t.target.value}),placeholder:r("edgeManager.eGMyModule","e.g., my-module")})]}),e.jsxs("div",{className:"nice-edge-manager__field",children:[e.jsx("label",{children:r("edgeManager.containerImage","Container Image")}),e.jsx("input",{type:"text",value:a.image||"",onChange:t=>i({...a,image:t.target.value}),placeholder:r("edgeManager.eGNginxLatest","e.g., nginx:latest")})]}),e.jsxs("div",{className:"nice-edge-manager__field",children:[e.jsx("label",{children:r("edgeManager.version","Version")}),e.jsx("input",{type:"text",value:a.version||"1.0.0",onChange:t=>i({...a,version:t.target.value})})]})]}),e.jsxs("div",{className:"nice-edge-manager__dialog-footer",children:[e.jsx("button",{onClick:l,children:r("edgeManager.cancel","Cancel")}),e.jsx("button",{className:"nice-edge-manager__deploy-confirm",onClick:s,children:r("edgeManager.deploy","Deploy")})]})]})})}const I={broker:"localhost",port:1883,clientId:`nice2dev-${Date.now()}`,useTLS:!1,keepAlive:60,cleanSession:!0,topics:[]},U={host:"localhost",port:5683,useDTLS:!1,resources:[]},$={type:"tcp",host:"localhost",port:502,slaveId:1,timeout:1e3,registers:[]},O={endpointUrl:"opc.tcp://localhost:4840",securityMode:"None",authentication:"anonymous",applicationName:"Nice2Dev IoT Client",nodes:[]};function he({protocol:a="mqtt",config:n,onSave:i,onTest:s,className:l=""}){const{t:r}=M(),[t,o]=h.useState(a),[d,m]=h.useState((n==null?void 0:n.type)==="mqtt"?{...I,...n.config}:I),[v,w]=h.useState((n==null?void 0:n.type)==="coap"?{...U,...n.config}:U),[j,f]=h.useState((n==null?void 0:n.type)==="modbus"?{...$,...n.config}:$),[g,y]=h.useState((n==null?void 0:n.type)==="opcua"?{...O,...n.config}:O),[x,C]=h.useState(null),[_,T]=h.useState(!1),u=h.useCallback(()=>{switch(t){case"mqtt":return d;case"coap":return v;case"modbus-tcp":case"modbus-rtu":return j;case"opcua":return g;default:return d}},[t,d,v,j,g]),z=h.useCallback(()=>{i==null||i(u())},[u,i]),V=h.useCallback(async()=>{if(s){T(!0),C(null);try{const k=await s(u());C(k)}catch(k){C({success:!1,message:String(k)})}finally{T(!1)}}},[u,s]);return e.jsxs("div",{className:`nice-protocol-config ${l}`,children:[e.jsxs("header",{className:"nice-protocol-config__header",children:[e.jsx("h2",{children:r("protocolConfig.title","Protocol Configuration")}),e.jsxs("div",{className:"nice-protocol-config__protocol-selector",children:[e.jsx("label",{children:r("protocolConfig.protocol","Protocol:")}),e.jsxs("select",{value:t,onChange:k=>o(k.target.value),children:[e.jsx("option",{value:"mqtt",children:r("protocolConfig.mqtt","MQTT")}),e.jsx("option",{value:"coap",children:r("protocolConfig.coap","CoAP")}),e.jsx("option",{value:"modbus-tcp",children:r("protocolConfig.modbusTcp","Modbus TCP")}),e.jsx("option",{value:"modbus-rtu",children:r("protocolConfig.modbusRtu","Modbus RTU")}),e.jsx("option",{value:"opcua",children:r("protocolConfig.opcUa","OPC-UA")})]})]})]}),e.jsxs("div",{className:"nice-protocol-config__content",children:[t==="mqtt"&&e.jsx(me,{config:d,onChange:m}),t==="coap"&&e.jsx(pe,{config:v,onChange:w}),(t==="modbus-tcp"||t==="modbus-rtu")&&e.jsx(ue,{config:j,type:t==="modbus-rtu"?"rtu":"tcp",onChange:f}),t==="opcua"&&e.jsx(ve,{config:g,onChange:y})]}),x&&e.jsxs("div",{className:`nice-protocol-config__test-result nice-protocol-config__test-result--${x.success?"success":"error"}`,children:[e.jsx(p,{name:x.success?"check":"close",size:14})," ",x.message]}),e.jsxs("footer",{className:"nice-protocol-config__footer",children:[e.jsx("button",{className:"nice-protocol-config__test-btn",onClick:V,disabled:_||!s,children:_?r("protocolConfig.testing","Testing..."):e.jsxs(e.Fragment,{children:[e.jsx(p,{name:"plug",size:14})," ",r("protocolConfig.testConnection","Test Connection")]})}),e.jsxs("button",{className:"nice-protocol-config__save-btn",onClick:z,children:[e.jsx(p,{name:"save",size:14})," ",r("save","Save")]})]})]})}function me({config:a,onChange:n}){const{t:i}=M();return e.jsxs("div",{className:"nice-protocol-config__section",children:[e.jsx("h3",{children:i("protocolConfig.mqttConfiguration","MQTT Configuration")}),e.jsxs("div",{className:"nice-protocol-config__grid",children:[e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:i("protocolConfig.broker","Broker")}),e.jsx("input",{type:"text",value:a.broker,onChange:s=>n({...a,broker:s.target.value}),placeholder:"localhost"})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:i("protocolConfig.port","Port")}),e.jsx("input",{type:"number",value:a.port,onChange:s=>n({...a,port:parseInt(s.target.value,10)||1883})})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:i("protocolConfig.clientId","Client ID")}),e.jsx("input",{type:"text",value:a.clientId,onChange:s=>n({...a,clientId:s.target.value})})]}),e.jsx("div",{className:"nice-protocol-config__field",children:e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:a.useTLS,onChange:s=>n({...a,useTLS:s.target.checked})}),i("protocolConfig.useTls","Use TLS")]})}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:i("protocolConfig.username","Username")}),e.jsx("input",{type:"text",value:a.username||"",onChange:s=>n({...a,username:s.target.value})})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:i("protocolConfig.password","Password")}),e.jsx("input",{type:"password",value:a.password||"",onChange:s=>n({...a,password:s.target.value})})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:i("protocolConfig.keepAlive","Keep Alive (seconds)")}),e.jsx("input",{type:"number",value:a.keepAlive,onChange:s=>n({...a,keepAlive:parseInt(s.target.value,10)||60})})]}),e.jsx("div",{className:"nice-protocol-config__field",children:e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:a.cleanSession,onChange:s=>n({...a,cleanSession:s.target.checked})}),i("protocolConfig.cleanSession","Clean Session")]})})]}),e.jsx("h4",{children:i("protocolConfig.topics","Topics")}),e.jsxs("div",{className:"nice-protocol-config__topics",children:[a.topics.map((s,l)=>e.jsxs("div",{className:"nice-protocol-config__topic-row",children:[e.jsx("input",{type:"text",value:s.pattern,onChange:r=>{const t=[...a.topics];t[l]={...t[l],pattern:r.target.value},n({...a,topics:t})},placeholder:i("protocolConfig.topicPatternPlaceholder","e.g., sensors/+/data")}),e.jsxs("select",{value:s.qos,onChange:r=>{const t=[...a.topics];t[l]={...t[l],qos:parseInt(r.target.value,10)},n({...a,topics:t})},children:[e.jsx("option",{value:0,children:i("protocolConfig.qos0","QoS 0")}),e.jsx("option",{value:1,children:i("protocolConfig.qos1","QoS 1")}),e.jsx("option",{value:2,children:i("protocolConfig.qos2","QoS 2")})]}),e.jsxs("select",{value:s.direction,onChange:r=>{const t=[...a.topics];t[l]={...t[l],direction:r.target.value},n({...a,topics:t})},children:[e.jsx("option",{value:"subscribe",children:i("protocolConfig.subscribe","Subscribe")}),e.jsx("option",{value:"publish",children:i("protocolConfig.publish","Publish")}),e.jsx("option",{value:"both",children:i("protocolConfig.both","Both")})]}),e.jsx("button",{"aria-label":i("protocolConfig.close","Close"),onClick:()=>{const r=a.topics.filter((t,o)=>o!==l);n({...a,topics:r})},children:e.jsx(p,{name:"close",size:14})})]},l)),e.jsxs("button",{onClick:()=>{n({...a,topics:[...a.topics,{pattern:"",qos:0,direction:"subscribe",payloadFormat:"json"}]})},children:[e.jsx(p,{name:"plus",size:14})," ",i("protocolConfig.addTopic","Add Topic")]})]})]})}function pe({config:a,onChange:n}){const{t:i}=M();return e.jsxs("div",{className:"nice-protocol-config__section",children:[e.jsx("h3",{children:i("protocolConfig.coapConfiguration","CoAP Configuration")}),e.jsxs("div",{className:"nice-protocol-config__grid",children:[e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:i("protocolConfig.host","Host")}),e.jsx("input",{type:"text",value:a.host,onChange:s=>n({...a,host:s.target.value})})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:i("protocolConfig.port","Port")}),e.jsx("input",{type:"number",value:a.port,onChange:s=>n({...a,port:parseInt(s.target.value,10)||5683})})]}),e.jsx("div",{className:"nice-protocol-config__field",children:e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:a.useDTLS,onChange:s=>n({...a,useDTLS:s.target.checked})}),i("protocolConfig.useDtls","Use DTLS")]})}),e.jsx("div",{className:"nice-protocol-config__field",children:e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:a.observe||!1,onChange:s=>n({...a,observe:s.target.checked})}),i("protocolConfig.enableObserve","Enable Observe")]})})]}),e.jsx("h4",{children:i("protocolConfig.resources","Resources")}),e.jsxs("div",{className:"nice-protocol-config__resources",children:[a.resources.map((s,l)=>e.jsxs("div",{className:"nice-protocol-config__resource-row",children:[e.jsx("input",{type:"text",value:s.path,onChange:r=>{const t=[...a.resources];t[l]={...t[l],path:r.target.value},n({...a,resources:t})},placeholder:"/sensors/temperature"}),e.jsx("button",{"aria-label":i("protocolConfig.close","Close"),onClick:()=>{const r=a.resources.filter((t,o)=>o!==l);n({...a,resources:r})},children:e.jsx(p,{name:"close",size:14})})]},l)),e.jsxs("button",{onClick:()=>{n({...a,resources:[...a.resources,{path:"",methods:["GET"],mediaType:"application/json",observable:!1}]})},children:[e.jsx(p,{name:"plus",size:14})," ",i("protocolConfig.addResource","Add Resource")]})]})]})}function ue({config:a,type:n,onChange:i}){const{t:s}=M();return e.jsxs("div",{className:"nice-protocol-config__section",children:[e.jsx("h3",{children:s("protocolConfig.modbusConfiguration","Modbus {type} Configuration").replace("{type}",String(n.toUpperCase()))}),e.jsxs("div",{className:"nice-protocol-config__grid",children:[n==="tcp"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:s("protocolConfig.host","Host")}),e.jsx("input",{type:"text",value:a.host||"",onChange:l=>i({...a,host:l.target.value})})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:s("protocolConfig.port","Port")}),e.jsx("input",{type:"number",value:a.port||502,onChange:l=>i({...a,port:parseInt(l.target.value,10)||502})})]})]}),n==="rtu"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:s("protocolConfig.serialPort","Serial Port")}),e.jsx("input",{type:"text",value:a.serialPort||"",onChange:l=>i({...a,serialPort:l.target.value}),placeholder:s("protocolConfig.serialPortPlaceholder","COM1 or /dev/ttyUSB0")})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:s("protocolConfig.baudRate","Baud Rate")}),e.jsxs("select",{value:a.baudRate||9600,onChange:l=>i({...a,baudRate:parseInt(l.target.value,10)}),children:[e.jsx("option",{value:9600,children:"9600"}),e.jsx("option",{value:19200,children:"19200"}),e.jsx("option",{value:38400,children:"38400"}),e.jsx("option",{value:57600,children:"57600"}),e.jsx("option",{value:115200,children:"115200"})]})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:s("protocolConfig.parity","Parity")}),e.jsxs("select",{value:a.parity||"none",onChange:l=>i({...a,parity:l.target.value}),children:[e.jsx("option",{value:"none",children:s("protocolConfig.none","None")}),e.jsx("option",{value:"even",children:s("protocolConfig.even","Even")}),e.jsx("option",{value:"odd",children:s("protocolConfig.odd","Odd")})]})]})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:s("protocolConfig.slaveId","Slave ID")}),e.jsx("input",{type:"number",value:a.slaveId,onChange:l=>i({...a,slaveId:parseInt(l.target.value,10)||1}),min:1,max:247})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:s("protocolConfig.timeoutMs","Timeout (ms)")}),e.jsx("input",{type:"number",value:a.timeout,onChange:l=>i({...a,timeout:parseInt(l.target.value,10)||1e3})})]})]}),e.jsx("h4",{children:s("protocolConfig.registers","Registers")}),e.jsxs("table",{className:"nice-protocol-config__registers-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:s("protocolConfig.name","Name")}),e.jsx("th",{children:s("protocolConfig.address","Address")}),e.jsx("th",{children:s("protocolConfig.type","Type")}),e.jsx("th",{children:s("protocolConfig.dataType","Data Type")}),e.jsx("th",{children:s("protocolConfig.readWrite","R/W")}),e.jsx("th",{})]})}),e.jsx("tbody",{children:a.registers.map((l,r)=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("input",{type:"text",value:l.name,onChange:t=>{const o=[...a.registers];o[r]={...o[r],name:t.target.value},i({...a,registers:o})}})}),e.jsx("td",{children:e.jsx("input",{type:"number",value:l.address,onChange:t=>{const o=[...a.registers];o[r]={...o[r],address:parseInt(t.target.value,10)||0},i({...a,registers:o})}})}),e.jsx("td",{children:e.jsxs("select",{value:l.type,onChange:t=>{const o=[...a.registers];o[r]={...o[r],type:t.target.value},i({...a,registers:o})},children:[e.jsx("option",{value:"coil",children:s("protocolConfig.coil","Coil")}),e.jsx("option",{value:"discrete",children:s("protocolConfig.discrete","Discrete")}),e.jsx("option",{value:"holding",children:s("protocolConfig.holding","Holding")}),e.jsx("option",{value:"input",children:s("protocolConfig.input","Input")})]})}),e.jsx("td",{children:e.jsxs("select",{value:l.dataType,onChange:t=>{const o=[...a.registers];o[r]={...o[r],dataType:t.target.value},i({...a,registers:o})},children:[e.jsx("option",{value:"bool",children:s("protocolConfig.bool","Bool")}),e.jsx("option",{value:"int16",children:s("protocolConfig.int16","Int16")}),e.jsx("option",{value:"uint16",children:s("protocolConfig.uint16","UInt16")}),e.jsx("option",{value:"int32",children:s("protocolConfig.int32","Int32")}),e.jsx("option",{value:"uint32",children:s("protocolConfig.uint32","UInt32")}),e.jsx("option",{value:"float32",children:s("protocolConfig.float32","Float32")})]})}),e.jsxs("td",{children:[e.jsx("input",{type:"checkbox",checked:l.readable,onChange:t=>{const o=[...a.registers];o[r]={...o[r],readable:t.target.checked},i({...a,registers:o})},title:s("protocolConfig.readable","Readable")}),e.jsx("input",{type:"checkbox",checked:l.writable,onChange:t=>{const o=[...a.registers];o[r]={...o[r],writable:t.target.checked},i({...a,registers:o})},title:s("protocolConfig.writable","Writable")})]}),e.jsx("td",{children:e.jsx("button",{"aria-label":s("protocolConfig.close","Close"),onClick:()=>{const t=a.registers.filter((o,d)=>d!==r);i({...a,registers:t})},children:e.jsx(p,{name:"close",size:14})})})]},r))})]}),e.jsxs("button",{onClick:()=>{i({...a,registers:[...a.registers,{name:"",address:0,type:"holding",dataType:"uint16",readable:!0,writable:!1}]})},children:[e.jsx(p,{name:"plus",size:14})," ",s("protocolConfig.addRegister","Add Register")]})]})}function ve({config:a,onChange:n}){const{t:i}=M();return e.jsxs("div",{className:"nice-protocol-config__section",children:[e.jsx("h3",{children:i("protocolConfig.opcUaConfiguration","OPC-UA Configuration")}),e.jsxs("div",{className:"nice-protocol-config__grid",children:[e.jsxs("div",{className:"nice-protocol-config__field nice-protocol-config__field--full",children:[e.jsx("label",{children:i("protocolConfig.endpointUrl","Endpoint URL")}),e.jsx("input",{type:"text",value:a.endpointUrl,onChange:s=>n({...a,endpointUrl:s.target.value}),placeholder:i("protocolConfig.endpointUrlPlaceholder","opc.tcp://localhost:4840")})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:i("protocolConfig.securityMode","Security Mode")}),e.jsxs("select",{value:a.securityMode,onChange:s=>n({...a,securityMode:s.target.value}),children:[e.jsx("option",{value:"None",children:i("protocolConfig.securityNone","None")}),e.jsx("option",{value:"Sign",children:i("protocolConfig.sign","Sign")}),e.jsx("option",{value:"SignAndEncrypt",children:i("protocolConfig.signAndEncrypt","Sign and Encrypt")})]})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:i("protocolConfig.authentication","Authentication")}),e.jsxs("select",{value:a.authentication,onChange:s=>n({...a,authentication:s.target.value}),children:[e.jsx("option",{value:"anonymous",children:i("protocolConfig.anonymous","Anonymous")}),e.jsx("option",{value:"username",children:i("protocolConfig.usernamePassword","Username/Password")}),e.jsx("option",{value:"certificate",children:i("protocolConfig.certificate","Certificate")})]})]}),a.authentication==="username"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:i("protocolConfig.username","Username")}),e.jsx("input",{type:"text",value:a.username||"",onChange:s=>n({...a,username:s.target.value})})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:i("protocolConfig.password","Password")}),e.jsx("input",{type:"password",value:a.password||"",onChange:s=>n({...a,password:s.target.value})})]})]}),e.jsxs("div",{className:"nice-protocol-config__field nice-protocol-config__field--full",children:[e.jsx("label",{children:i("protocolConfig.applicationName","Application Name")}),e.jsx("input",{type:"text",value:a.applicationName,onChange:s=>n({...a,applicationName:s.target.value})})]})]}),e.jsx("h4",{children:i("protocolConfig.nodes","Nodes")}),e.jsxs("div",{className:"nice-protocol-config__nodes",children:[a.nodes.map((s,l)=>e.jsxs("div",{className:"nice-protocol-config__node-row",children:[e.jsx("input",{type:"text",value:s.nodeId,onChange:r=>{const t=[...a.nodes];t[l]={...t[l],nodeId:r.target.value},n({...a,nodes:t})},placeholder:i("protocolConfig.nodeIdPlaceholder","ns=2;s=Temperature")}),e.jsx("input",{type:"text",value:s.displayName,onChange:r=>{const t=[...a.nodes];t[l]={...t[l],displayName:r.target.value},n({...a,nodes:t})},placeholder:i("protocolConfig.displayNamePlaceholder","Display Name")}),e.jsx("button",{"aria-label":i("protocolConfig.close","Close"),onClick:()=>{const r=a.nodes.filter((t,o)=>o!==l);n({...a,nodes:r})},children:e.jsx(p,{name:"close",size:14})})]},l)),e.jsxs("button",{onClick:()=>{n({...a,nodes:[...a.nodes,{nodeId:"",displayName:"",dataType:"Double",read:!0}]})},children:[e.jsx(p,{name:"plus",size:14})," ",i("protocolConfig.addNode","Add Node")]})]})]})}exports.NiceEdgeManager=re;exports.NiceIoTDashboard=X;exports.NiceProtocolConfig=he;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("react"),q=(a,i)=>i,K=h.createContext(q),W=h.createContext("en");function g(){const a=h.useContext(K),i=h.useContext(W);return{t:a,lang:i}}function V(a){if(a.defaultPrevented||a.repeat||a.target!==a.currentTarget||a.key!=="Enter"&&a.key!==" "&&a.key!=="Spacebar")return;const i=a.currentTarget;if(!i||typeof i.dispatchEvent!="function")return;a.preventDefault();const t=i.ownerDocument.defaultView;i.dispatchEvent(new((t==null?void 0:t.MouseEvent)??MouseEvent)("click",{bubbles:!0,cancelable:!0,composed:!0,ctrlKey:!!a.ctrlKey,shiftKey:!!a.shiftKey,altKey:!!a.altKey,metaKey:!!a.metaKey}))}const G={"chevron-down":"M6 9l6 6 6-6","chevron-up":"M18 15l-6-6-6 6","chevron-left":"M15 18l-6-6 6-6","chevron-right":"M9 6l6 6-6 6","arrow-left":"M19 12H5m0 0l7 7m-7-7l7-7","arrow-right":"M5 12h14m0 0l-7-7m7 7l-7 7","arrow-up":"M12 19V5m0 0l-7 7m7-7l7 7","arrow-down":"M12 5v14m0 0l7-7m-7 7l-7-7",close:"M18 6L6 18M6 6l12 12",plus:"M12 5v14m-7-7h14",minus:"M5 12h14",check:"M5 13l4 4L19 7",edit:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7M18.5 2.5a2.121 2.121 0 113 3L12 15l-4 1 1-4 9.5-9.5z",trash:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",copy:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z",download:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4",upload:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12",refresh:"M4 4v5h5M20 20v-5h-5M20.49 9A9 9 0 005.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 013.51 15",search:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",filter:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z","sort-asc":"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12","sort-desc":"M3 4h13M3 8h9m-9 4h9m5-4v12m0 0l-4-4m4 4l4-4",sort:"M6 10l6-6 6 6M6 14l6 6 6-6",menu:"M4 6h16M4 12h16M4 18h16","more-vertical":"M12 5v.01M12 12v.01M12 19v.01","more-horizontal":"M5 12h.01M12 12h.01M19 12h.01",settings:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z",eye:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z M15 12a3 3 0 11-6 0 3 3 0 016 0z","eye-off":"M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24 M1 1l22 22",lock:"M19 11H5a2 2 0 00-2 2v7a2 2 0 002 2h14a2 2 0 002-2v-7a2 2 0 00-2-2zm-3-4a4 4 0 10-8 0v4h8V7z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",warning:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",error:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",success:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",help:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",calendar:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",clock:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",file:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z",folder:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",image:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",link:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1",mail:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",phone:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",smartphone:"M7 2h10a2 2 0 012 2v16a2 2 0 01-2 2H7a2 2 0 01-2-2V4a2 2 0 012-2z M11 18h2",user:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z",users:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z",home:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6",star:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z",heart:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z",bell:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",grip:"M4 6h2m4 0h2m4 0h2M4 12h2m4 0h2m4 0h2M4 18h2m4 0h2m4 0h2",hash:"M4 9h16M4 15h16M10 3L8 21M16 3l-2 18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",circle:"M12 21a9 9 0 100-18 9 9 0 000 18z",box:"M21 8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16V8z M3.27 6.96L12 12.01l8.73-5.05 M12 22.08V12",tabs:"M3 9h18v10H3z M7 9V5h6v4",columns:"M4 4h7v16H4z M13 4h7v16h-7z",grid:"M3 3h7v7H3z M14 3h7v7h-7z M14 14h7v7h-7z M3 14h7v7H3z",table:"M3 5h18v14H3z M3 10h18M3 15h18M9 5v14M15 5v14",heading:"M6 4v16M18 4v16M6 12h12",type:"M4 7V4h16v3M9 20h6M12 4v16","align-left":"M3 6h18M3 12h12M3 18h15",input:"M4 9h16a1 1 0 011 1v4a1 1 0 01-1 1H4a1 1 0 01-1-1v-4a1 1 0 011-1z M7 12h5",button:"M5 9h14a2 2 0 012 2v2a2 2 0 01-2 2H5a2 2 0 01-2-2v-2a2 2 0 012-2z",select:"M4 6h16a1 1 0 011 1v10a1 1 0 01-1 1H4a1 1 0 01-1-1V7a1 1 0 011-1z M15 11l-3 3-3-3","check-square":"M9 11l3 3L22 4 M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11",video:"M23 7l-7 5 7 5V7z M16 5H3a2 2 0 00-2 2v10a2 2 0 002 2h13a2 2 0 002-2V7a2 2 0 00-2-2z",card:"M3 5h18a1 1 0 011 1v12a1 1 0 01-1 1H3a1 1 0 01-1-1V6a1 1 0 011-1z M3 10h18","bar-chart":"M6 20v-6M12 20V4M18 20v-10","line-chart":"M3 3v18h18 M7 15l4-4 3 3 5-6","area-chart":"M3 3v18h18 M7 17v-3l4-4 3 3 5-6v10z","pie-chart":"M21.21 15.89A10 10 0 118 2.83 M22 12A10 10 0 0012 2v10z","donut-chart":"M12 3a9 9 0 100 18 9 9 0 000-18z M12 8a4 4 0 100 8 4 4 0 000-8z","scatter-chart":"M3 3v18h18 M8 16h.01 M11 11h.01 M15 14h.01 M18 8h.01","bars-vertical":"M6 5v14M12 5v14M18 5v14",globe:"M12 3a9 9 0 100 18 9 9 0 000-18z M3 12h18 M12 3a14 14 0 010 18 M12 3a14 14 0 000 18",monitor:"M3 4h18a1 1 0 011 1v11a1 1 0 01-1 1H3a1 1 0 01-1-1V5a1 1 0 011-1z M8 21h8 M12 17v4",camera:"M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h3l2-3h6l2 3h3a2 2 0 012 2z M12 17a4 4 0 100-8 4 4 0 000 8z",plug:"M9 2v5 M15 2v5 M7 7h10v3a5 5 0 01-10 0V7z M12 15v7",save:"M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z M17 21v-8H7v8 M7 3v5h8",tag:"M20.59 13.41l-7.17 7.17a2 2 0 01-2.83 0L2 12V2h10l8.59 8.59a2 2 0 010 2.82z M7 7h.01",palette:"M12 2a10 10 0 000 20 2 2 0 002-2c0-.5-.2-1-.5-1.3a2 2 0 01-.5-1.2 2 2 0 012-2H17a5 5 0 005-5c0-5-4.5-9-10-9z M6.5 11.5h.01 M9.5 7.5h.01 M14.5 7.5h.01",book:"M4 19.5A2.5 2.5 0 016.5 17H20 M6.5 2H20v20H6.5A2.5 2.5 0 014 19.5v-15A2.5 2.5 0 016.5 2z",cloud:"M18 10h-1.26A8 8 0 109 20h9a5 5 0 000-10z",target:"M12 3a9 9 0 100 18 9 9 0 000-18z M12 7a5 5 0 100 10 5 5 0 000-10z M12 11a1 1 0 100 2 1 1 0 000-2z",message:"M21 11.5a8.5 8.5 0 01-8.5 8.5 8.4 8.4 0 01-3.8-.9L3 21l1.9-5.7a8.4 8.4 0 01-.9-3.8A8.5 8.5 0 0112.5 3 8.5 8.5 0 0121 11.5z",flask:"M9 2h6 M10 2v6.5L4.5 19a1 1 0 00.9 1.5h13.2a1 1 0 00.9-1.5L14 8.5V2 M7 15h10",rocket:"M12 15l-3-3a22 22 0 012-3.95A12.88 12.88 0 0122 2c0 2.72-.78 7.5-6 11a22 22 0 01-3.95 2z M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0 M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5 M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 00-2.91-.09z",music:"M9 18V5l12-2v13 M9 18a3 3 0 11-6 0 3 3 0 016 0z M21 16a3 3 0 11-6 0 3 3 0 016 0z",wifi:"M5 12.55a11 11 0 0114 0 M8.5 16.11a6 6 0 017 0 M12 20h.01 M2 8.82a15 15 0 0120 0",database:"M12 8c4.97 0 9-1.34 9-3s-4.03-3-9-3-9 1.34-9 3 4.03 3 9 3z M21 5v6c0 1.66-4.03 3-9 3s-9-1.34-9-3V5 M21 11v6c0 1.66-4.03 3-9 3s-9-1.34-9-3v-6",slash:"M12 3a9 9 0 100 18 9 9 0 000-18z M5.6 5.6l12.8 12.8",puzzle:"M19.4 13.6a1.6 1.6 0 10.2-3.2H19V7a2 2 0 00-2-2h-3.4v-.4a1.6 1.6 0 10-3.2 0V5H7a2 2 0 00-2 2v3.4h.4a1.6 1.6 0 100 3.2H5V17a2 2 0 002 2h3.4v.4a1.6 1.6 0 103.2 0V19H17a2 2 0 002-2v-3.4z",dollar:"M12 1v22 M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6",printer:"M6 9V2h12v7 M6 18H4a2 2 0 01-2-2v-5a2 2 0 012-2h16a2 2 0 012 2v5a2 2 0 01-2 2h-2 M6 14h12v8H6z",scale:"M12 3v18 M5 21h14 M5 7l7-2 7 2 M2 13a3 3 0 006 0L5 7zm14 0a3 3 0 006 0L19 7z",accessibility:"M12 3a9 9 0 100 18 9 9 0 000-18z M12 9a1.5 1.5 0 100-3 1.5 1.5 0 000 3z M7.5 10.5l4.5 1 4.5-1 M12 11.5v3.5l-2 3.5 M12 15l2 3.5",window:"M3 4h18a1 1 0 011 1v14a1 1 0 01-1 1H3a1 1 0 01-1-1V5a1 1 0 011-1z M2 9h20 M6 6.5h.01 M9 6.5h.01","map-pin":"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z M12 13a3 3 0 100-6 3 3 0 000 6z",cursor:"M5 3l14 7-6 2-2 6-6-15z",shuffle:"M16 3h5v5 M4 20L21 3 M21 16v5h-5 M15 15l6 6 M4 4l5 5",lightbulb:"M9 18h6 M10 22h4 M12 2a7 7 0 00-4 12.7c.6.5 1 1.3 1 2.1V18h6v-1.2c0-.8.4-1.6 1-2.1A7 7 0 0012 2z",server:"M3 4h18a1 1 0 011 1v4a1 1 0 01-1 1H3a1 1 0 01-1-1V5a1 1 0 011-1z M3 14h18a1 1 0 011 1v4a1 1 0 01-1 1H3a1 1 0 01-1-1v-4a1 1 0 011-1z M7 7h.01 M7 17h.01",terminal:"M4 17l6-6-6-6 M12 19h8","git-branch":"M6 3v12 M18 9a3 3 0 100-6 3 3 0 000 6z M6 21a3 3 0 100-6 3 3 0 000 6z M18 9a9 9 0 01-9 9",send:"M22 2L11 13 M22 2l-7 20-4-9-9-4 20-7z",play:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z M21 12a9 9 0 11-18 0 9 9 0 0118 0z",pause:"M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z",stop:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z M9 10a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z",mic:"M12 1a3 3 0 00-3 3v8a3 3 0 006 0V4a3 3 0 00-3-3zM19 10v2a7 7 0 01-14 0v-2M12 19v4M8 23h8",volume:"M11 5L6 9H2v6h4l5 4V5z M15.54 8.46a5 5 0 010 7.07 M19.07 4.93a10 10 0 010 14.14","volume-off":"M11 5L6 9H2v6h4l5 4V5z M23 9l-6 6 M17 9l6 6","skip-back":"M19 20L9 12l10-8v16z M5 19V5",expand:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4",collapse:"M9 9V5m0 4H5m4 0L4 4m11 5h4m-4 0V5m0 4l5-5M9 15v4m0-4H5m4 0l-5 5m15-5h-4m4 0v4m0-4l-5 5","external-link":"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",briefcase:"M20 7H4a2 2 0 00-2 2v9a2 2 0 002 2h16a2 2 0 002-2V9a2 2 0 00-2-2zM16 7V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v2M2 12h20",building:"M4 22V4a2 2 0 012-2h12a2 2 0 012 2v18M4 22h16M9 22v-4h6v4M9 6h.01M15 6h.01M9 10h.01M15 10h.01M9 14h.01M15 14h.01",medal:"M15.477 12.89L17 22l-5-3-5 3 1.523-9.11M12 15a6 6 0 100-12 6 6 0 000 12z",clipboard:"M9 2h6a1 1 0 011 1v1a1 1 0 01-1 1H9a1 1 0 01-1-1V3a1 1 0 011-1zM16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2","skip-forward":"M5 4l10 8-10 8V4zM19 5v14","at-sign":"M12 16a4 4 0 100-8 4 4 0 000 8zM16 12v1.5a2.5 2.5 0 005 0V12a9 9 0 10-3.5 7.14",gift:"M20 12v10H4V12M2 7h20v5H2zM12 22V7M12 7H7.5a2.5 2.5 0 010-5C11 2 12 7 12 7zM12 7h4.5a2.5 2.5 0 000-5C13 2 12 7 12 7z",archive:"M21 8v13H3V8M1 3h22v5H1zM10 12h4",reply:"M9 17l-5-5 5-5M4 12h11a4 4 0 014 4v2",forward:"M15 17l5-5-5-5M20 12H9a4 4 0 00-4 4v2",paperclip:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48",zap:"M13 2L3 14h9l-1 8 10-12h-9l1-8z",square:"M4 4h16v16H4z",triangle:"M12 4L3 20h18z",hexagon:"M7.5 3h9l4.5 9-4.5 9h-9L3 12z",diamond:"M12 2l10 10-10 10L2 12z",line:"M5 19L19 5",pen:"M12 19l7-7 3 3-7 7-3-3z M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z M11 11a2 2 0 100-4 2 2 0 000 4z",brush:"M9.06 11.9l8.07-8.06a2.85 2.85 0 114.03 4.03l-8.06 8.08 M7.07 14.94c-1.66 0-3 1.35-3 3.02 0 1.33-2.5 1.52-2 2.02 1.08 1.1 2.49 2.02 4 2.02 2.2 0 4-1.8 4-4.04a3.01 3.01 0 00-3-3.02z",droplet:"M12 2.69l5.66 5.66a8 8 0 11-11.31 0z",bucket:"M5 8h14l-1.5 11a2 2 0 01-2 1.8H8.5a2 2 0 01-2-1.8L5 8z M5 8l2-4h10l2 4",scissors:"M6 9a3 3 0 100-6 3 3 0 000 6z M6 21a3 3 0 100-6 3 3 0 000 6z M20 4L8.12 15.88 M14.47 14.48L20 20 M8.12 8.12L12 12",layers:"M12 2l9 5-9 5-9-5 9-5z M3 12l9 5 9-5 M3 17l9 5 9-5",crop:"M6 2v14a2 2 0 002 2h14 M2 6h14a2 2 0 012 2v14",eyedropper:"M2 22l1-1h3l9-9 M3 21v-3l9-9 M15 6l3.5-3.5a2.12 2.12 0 013 3L18 9l-3-3z",ruler:"M21.3 8.7l-6-6a1 1 0 00-1.4 0L2.7 13.9a1 1 0 000 1.4l6 6a1 1 0 001.4 0L21.3 10.1a1 1 0 000-1.4z M7.5 10.5l2 2 M11 7l2 2 M14.5 3.5l2 2",wand:"M15 4V2 M15 16v-2 M8 9h2 M20 9h2 M3 21l9-9 M12.2 6.2L11 5 M17.8 6.2L19 5 M17.8 11.8L19 13",move:"M5 9l-3 3 3 3 M9 5l3-3 3 3 M15 19l-3 3-3-3 M19 9l3 3-3 3 M2 12h20 M12 2v20",gamepad:"M6 12h4 M8 10v4 M15 13h.01 M18 11h.01 M2 12a4 4 0 014-4h12a4 4 0 014 4l-1.5 6a2 2 0 01-2 1.5H5.5a2 2 0 01-2-1.5L2 12z",eraser:"M7 21l-4.3-4.3a1 1 0 010-1.4l9.6-9.6a2 2 0 012.8 0l4.6 4.6a2 2 0 010 2.8L13 21H7z M22 21H7 M5 12l5 5",thermometer:"M14 14.76V3.5a2.5 2.5 0 00-5 0v11.26a4.5 4.5 0 105 0z",door:"M18 20V5a1 1 0 00-1-1H7a1 1 0 00-1 1v15 M3 20h18 M13 11.5h.01",stairs:"M3 20h3v-3h3v-3h3v-3h3v-3h3",elevator:"M5 3h14a1 1 0 011 1v16a1 1 0 01-1 1H5a1 1 0 01-1-1V4a1 1 0 011-1z M9.5 9L12 6.5 14.5 9 M9.5 15l2.5 2.5 2.5-2.5",bed:"M2 4v16 M2 8h18a2 2 0 012 2v10 M22 17H2 M6 8v4 M2 12h4",sofa:"M3 9V7a2 2 0 012-2h14a2 2 0 012 2v2 M21 9a2 2 0 00-2 2v3H5v-3a2 2 0 00-2-2 2 2 0 00-2 2v4a1 1 0 001 1h18a1 1 0 001-1v-4a2 2 0 00-2-2 M5 18v2 M19 18v2",chair:"M6 11V5a2 2 0 012-2h8a2 2 0 012 2v6 M5 11h14 M6 11l-1 8h14l-1-8 M6 19v2 M18 19v2",utensils:"M3 2v7a2 2 0 002 2 2 2 0 002-2V2 M5 2v20 M21 2v9c0 1-1 1.8-2 1.8h-1V20 M18 2v9",mountain:"M8 3l4 8 5-5 5 15H2L8 3z",tree:"M12 2L7 11h10L12 2z M9 11l3 5 3-5 M12 16v6",sun:"M12 17a5 5 0 100-10 5 5 0 000 10z M12 1v2 M12 21v2 M4.22 4.22l1.42 1.42 M18.36 18.36l1.42 1.42 M1 12h2 M21 12h2 M4.22 19.78l1.42-1.42 M18.36 5.64l1.42-1.42",moon:"M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z","list-ordered":"M10 6h11M10 12h11M10 18h11M4 6h1v4M4 10h2M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",unlink:"M18.84 12.25l1.72-1.71a5 5 0 0 0-7.07-7.07L11 5.78M3 3l18 18M9 15l3-3M14 11l3 3M14 21l-1.72-1.72a5 5 0 0 1-7.07-7.07L7 10.49",code:"M16 18l6-6-6-6M8 6l-6 6 6 6",quote:"M3 21c3-3 3-9 0-12M21 21c-3-3-3-9 0-12M9 7h6v6H9zM15 7h6v6h-6z",indent:"M3 8l4 4-4 4M7 6h14M7 12h14M3 18h18",outdent:"M7 8l-4 4 4 4M21 6H3M21 12H7M21 18H3","align-center":"M3 6h18M6 12h12M3 18h18","align-right":"M3 6h18M9 12h12M3 18h18","align-justify":"M3 6h18M3 12h18M3 18h18","align-top":"M4 4h16M9 8v12M15 8v7","align-middle":"M4 12h16M9 5v14M15 8v8","align-bottom":"M4 20h16M9 4v12M15 9v7","distribute-h":"M4 4v16M20 4v16M10 7h4v10h-4z","distribute-v":"M4 4h16M4 20h16M7 10h10v4H7z",parallelogram:"M7 5h14l-4 14H3z",barcode:"M4 5v14M6.5 5v14M10 5v14M13 5v14M15.5 5v14M19 5v14M20.5 5v14","qr-code":"M4 4h6v6H4z M14 4h6v6h-6z M4 14h6v6H4z M14 14h2v2h-2z M18 14h2v2h-2z M14 18h2v2h-2z M18 18h2v2h-2z",smile:"M12 22a10 10 0 1 1 0-20 10 10 0 0 1 0 20zM8 14s1.5 2 4 2 4-2 4-2M9 9h.01M15 9h.01",undo:"M9 14L4 9l5-5M4 9h10.5a5.5 5.5 0 010 11H11",redo:"M15 14l5-5-5-5M20 9H9.5a5.5 5.5 0 000 11H13",unlock:"M19 11H5a2 2 0 00-2 2v7a2 2 0 002 2h14a2 2 0 002-2v-7a2 2 0 00-2-2z M7 11V7a5 5 0 019.9-1",keyboard:"M4 6h16a2 2 0 012 2v8a2 2 0 01-2 2H4a2 2 0 01-2-2V8a2 2 0 012-2z M6 10h.01 M10 10h.01 M14 10h.01 M18 10h.01 M8 14h8","page-break":"M6 3v5h12V3 M6 21v-5h12v5 M2 12h3 M8 12h3 M13 12h3 M19 12h3",shield:"M12 2l8 3v6c0 5-3.4 9.4-8 11-4.6-1.6-8-6-8-11V5z",repeat:"M17 2l4 4-4 4 M3 11V9a4 4 0 014-4h14 M7 22l-4-4 4-4 M21 13v2a4 4 0 01-4 4H3",pin:"M12 17v5 M5 17h14l-1.5-3V8a2 2 0 00-2-2h-7a2 2 0 00-2 2v6z","mic-off":"M1 1l22 22 M9 9v3a3 3 0 005.12 2.12 M15 9.34V4a3 3 0 00-5.94-.6 M17 16.95A7 7 0 015 12v-2 M19 10v2a7 7 0 01-.11 1.23 M12 19v4 M8 23h8","log-out":"M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4 M16 17l5-5-5-5 M21 12H9","chevrons-left":"M11 17l-5-5 5-5 M18 17l-5-5 5-5","chevrons-right":"M13 17l5-5-5-5 M6 17l5-5-5-5","zoom-in":"M11 4a7 7 0 100 14 7 7 0 000-14z M21 21l-4.35-4.35 M11 8v6 M8 11h6","zoom-out":"M11 4a7 7 0 100 14 7 7 0 000-14z M21 21l-4.35-4.35 M8 11h6",navigation:"M12 2l7 19-7-4-7 4z","refresh-ccw":"M1 4v6h6 M23 20v-6h-6 M20.49 9A9 9 0 005.64 5.64L1 10 M3.51 15a9 9 0 0014.85 3.36L23 14",minimize:"M4 14h6v6 M20 10h-6V4 M14 10l7-7 M3 21l7-7",point:"M12 8a4 4 0 1 0 0 8a4 4 0 1 0 0-8z M12 12h.01",segment:"M6.5 17.5L17.5 6.5 M3 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0 M17 5a2 2 0 1 0 4 0a2 2 0 1 0-4 0",perpendicular:"M3 20h18 M12 20V4 M12 15h5v5",parallel:"M4 16L14 6 M10 20L20 10",midpoint:"M3 12h6 M15 12h6 M3 9v6 M21 9v6 M12 9a3 3 0 1 0 0 6a3 3 0 1 0 0-6z","angle-bisector":"M4 20h17 M4 20L16 5 M4 20l14.4-6.9 M10 20a6 6 0 0 0-2.25-4.68",group:"M3 7V3h4 M17 3h4v4 M21 17v4h-4 M7 21H3v-4 M7 7h5v5H7z M12 12h5v5h-5z",ungroup:"M3 3h8v8H3z M13 13h8v8h-8z","pad-xbox-a":"M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M9.25 16l2.75-8 2.75 8 M10.2 13.25h3.6","pad-xbox-b":"M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M9.75 8v8 M9.75 8h2.5a2 2 0 0 1 0 4h-2.5 M9.75 12h3a2 2 0 0 1 0 4h-3","pad-xbox-x":"M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M9.5 8l5 8 M14.5 8l-5 8","pad-xbox-y":"M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M9.5 8l2.5 4 2.5-4 M12 12v4","pad-nintendo-a":"M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M9.25 16l2.75-8 2.75 8 M10.2 13.25h3.6","pad-nintendo-b":"M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M9.75 8v8 M9.75 8h2.5a2 2 0 0 1 0 4h-2.5 M9.75 12h3a2 2 0 0 1 0 4h-3","pad-nintendo-x":"M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M9.5 8l5 8 M14.5 8l-5 8","pad-nintendo-y":"M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M9.5 8l2.5 4 2.5-4 M12 12v4","pad-playstation-cross":"M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M9 9l6 6 M15 9l-6 6","pad-playstation-circle":"M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M12 8.25a3.75 3.75 0 1 0 0 7.5a3.75 3.75 0 1 0 0 -7.5z","pad-playstation-square":"M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M8.5 8.5h7v7h-7z","pad-playstation-triangle":"M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M12 8l4.5 7.5h-9z","pad-generic-north":"M12 3a3 3 0 1 0 0 6a3 3 0 1 0 0 -6z M12 6h.01 M18 10.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z M6 10.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z M12 16.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z","pad-generic-east":"M12 4.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z M18 9a3 3 0 1 0 0 6a3 3 0 1 0 0 -6z M18 12h.01 M6 10.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z M12 16.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z","pad-generic-west":"M12 4.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z M18 10.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z M6 9a3 3 0 1 0 0 6a3 3 0 1 0 0 -6z M6 12h.01 M12 16.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z","pad-generic-south":"M12 4.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z M18 10.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z M6 10.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z M12 15a3 3 0 1 0 0 6a3 3 0 1 0 0 -6z M12 18h.01","pad-lb":"M6 9h12a3 3 0 0 1 0 6H6a3 3 0 0 1 0-6z M7.5 12h.01","pad-rb":"M6 9h12a3 3 0 0 1 0 6H6a3 3 0 0 1 0-6z M16.5 12h.01","pad-lt":"M9 3h6a3 3 0 0 1 3 3v7a6 6 0 0 1-12 0V6a3 3 0 0 1 3-3z M9.5 7h.01","pad-rt":"M9 3h6a3 3 0 0 1 3 3v7a6 6 0 0 1-12 0V6a3 3 0 0 1 3-3z M14.5 7h.01","pad-start":"M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M8.5 8.75h7 M8.5 12h7 M8.5 15.25h7","pad-select":"M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M7.75 7.75h5.5v5.5h-5.5z M10.75 16.25h5.5v-5.5","pad-home":"M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M7.95 12L12 8.6l4.05 3.4v4H7.95z","pad-dpad":"M9 3h6v6h6v6h-6v6H9v-6H3V9h6z","pad-dpad-up":"M9 3h6v6h6v6h-6v6H9v-6H3V9h6z M12 5.6l1.15 1.5h-2.3z","pad-dpad-down":"M9 3h6v6h6v6h-6v6H9v-6H3V9h6z M12 18.4l1.15-1.5h-2.3z","pad-dpad-left":"M9 3h6v6h6v6h-6v6H9v-6H3V9h6z M5.6 12l1.5-1.15v2.3z","pad-dpad-right":"M9 3h6v6h6v6h-6v6H9v-6H3V9h6z M18.4 12l-1.5-1.15v2.3z","pad-stick-left":"M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M12 7.5a4.5 4.5 0 1 0 0 9a4.5 4.5 0 1 0 0 -9z M4.5 12h1","pad-stick-right":"M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M12 7.5a4.5 4.5 0 1 0 0 9a4.5 4.5 0 1 0 0 -9z M18.5 12h1","pad-stick-left-press":"M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M12 7.5a4.5 4.5 0 1 0 0 9a4.5 4.5 0 1 0 0 -9z M12 12h.01 M4.5 12h1","pad-stick-right-press":"M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M12 7.5a4.5 4.5 0 1 0 0 9a4.5 4.5 0 1 0 0 -9z M12 12h.01 M18.5 12h1","remote-ok":"M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M12 8.5a3.5 3.5 0 1 0 0 7a3.5 3.5 0 1 0 0 -7z","remote-back":"M9 14l-4-4 4-4 M5 10h9a5 5 0 0 1 0 10h-2","remote-menu":"M4 6h16v12H4z M8 10h8 M8 14h8","key-command":"M9 9V6.5A2.5 2.5 0 1 0 6.5 9H9z M9 9h6 M9 9v6 M15 9V6.5A2.5 2.5 0 1 1 17.5 9H15z M15 9v6 M15 15H9 M15 15v2.5a2.5 2.5 0 1 0 2.5-2.5H15z M9 15H6.5A2.5 2.5 0 1 0 9 17.5V15z","key-option":"M4 6h5l6 12h5 M14 6h6","key-shift":"M12 4l-8 8h4v8h8v-8h4z","key-control":"M7 14l5-5 5 5","key-enter":"M20 5v7a3 3 0 0 1-3 3H5 M9 11l-4 4 4 4","key-tab":"M4 12h14 M14 8l4 4-4 4 M20 6v12","key-backspace":"M21 5H9l-6 7 6 7h12a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1z M17 9l-6 6 M11 9l6 6","key-space":"M4 10v4h16v-4","key-caps":"M12 4l-7 7h4v5h6v-5h4z M8 20h8"},Q={xs:12,sm:16,md:20,lg:24,xl:32},Y=h.createContext({});function J({path:a,size:i,className:t,style:s,color:l,title:r,onClick:n}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:l||"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:`nice-icon ${t||""}`,style:s,role:n?"button":r?"img":"presentation",tabIndex:n?0:void 0,onKeyDown:n?V:void 0,"aria-label":r,"aria-hidden":n?void 0:!r,onClick:n,children:[r&&e.jsx("title",{children:r}),e.jsx("path",{d:a})]})}const m=({name:a,size:i="md",className:t,style:s,color:l,title:r,onClick:n})=>{const{resolver:o}=h.useContext(Y),d=typeof i=="number"?i:Q[i];if(o){const v=o(a,d);if(v)return e.jsx("span",{role:n?"button":void 0,tabIndex:n?0:void 0,onKeyDown:n?V:void 0,className:`nice-icon-wrap ${t||""}`,style:s,onClick:n,children:v})}const p=G[a];return p?e.jsx(J,{path:p,size:d,className:t,style:s,color:l,title:r,onClick:n}):null};process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;function Z(){const a=globalThis.crypto;if(typeof(a==null?void 0:a.randomUUID)=="function")return a.randomUUID();const i=new Uint8Array(16);if(typeof(a==null?void 0:a.getRandomValues)=="function")a.getRandomValues(i);else for(let s=0;s<i.length;s++)i[s]=Math.floor(Math.random()*256);i[6]=i[6]&15|64,i[8]=i[8]&63|128;const t=Array.from(i,s=>s.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;const P={display:"inline-block",width:10,height:10,borderRadius:"50%",background:"currentColor"},A=[{type:"device-list",label:"Device List",icon:"list"},{type:"device-status",label:"Device Status",icon:"success"},{type:"telemetry-chart",label:"Telemetry Chart",icon:"bar-chart"},{type:"gauge",label:"Gauge",icon:"clock"},{type:"map",label:"Device Map",icon:"map-pin"},{type:"alarms",label:"Alarms",icon:"bell"},{type:"control-panel",label:"Control Panel",icon:"settings"},{type:"topology",label:"Network Topology",icon:"link"},{type:"kpi",label:"KPI Card",icon:"target"},{type:"camera-feed",label:"Camera Feed",icon:"video"}];function X({devices:a=[],widgets:i=[],alarms:t=[],onDeviceSelect:s,onWidgetChange:l,onCommand:r,onAlarmAcknowledge:n,fetchTelemetry:o,className:d=""}){const{t:p}=g(),[v,w]=h.useState(i),[j,N]=h.useState(null),[u,y]=h.useState("dashboard"),[x,z]=h.useState(!1),[_,D]=h.useState(""),M=h.useCallback(c=>{w(b=>{const f=c(b);return l==null||l(f),f})},[l]),C=h.useCallback(c=>{var f;const b={id:Z(),type:c,title:((f=A.find(S=>S.type===c))==null?void 0:f.label)||c,position:{x:0,y:ee(v),width:4,height:3},config:{}};M(S=>[...S,b])},[v,M]),L=h.useCallback(c=>{N(c),s==null||s(c)},[s]),k=h.useCallback(c=>{n==null||n(c)},[n]),B=a.filter(c=>!_||c.name.toLowerCase().includes(_.toLowerCase())||c.type.toLowerCase().includes(_.toLowerCase())),T=t.filter(c=>!c.cleared),E=T.filter(c=>c.severity==="critical"||c.severity==="high");return e.jsxs("div",{className:`nice-iot-dashboard ${d}`,children:[e.jsxs("header",{className:"nice-iot-dashboard__header",children:[e.jsx("h1",{children:p("ioTDashboard.iotDashboard","IoT Dashboard")}),e.jsxs("div",{className:"nice-iot-dashboard__stats",children:[e.jsxs("span",{className:"nice-iot-dashboard__stat",children:[e.jsx("span",{className:"nice-iot-dashboard__stat-icon",children:e.jsx(m,{name:"wifi",size:14})}),p("ioTDashboard.devices","{devices} Devices").replace("{devices}",String(a.length))]}),e.jsxs("span",{className:"nice-iot-dashboard__stat nice-iot-dashboard__stat--online",children:[e.jsx("span",{className:"nice-iot-dashboard__stat-icon",style:P}),p("ioTDashboard.online","{online} Online").replace("{online}",String(a.filter(c=>c.status==="online").length))]}),e.jsxs("span",{className:"nice-iot-dashboard__stat nice-iot-dashboard__stat--offline",children:[e.jsx("span",{className:"nice-iot-dashboard__stat-icon",style:P}),p("ioTDashboard.offline","{offline} Offline").replace("{offline}",String(a.filter(c=>c.status==="offline").length))]}),E.length>0&&e.jsxs("span",{className:"nice-iot-dashboard__stat nice-iot-dashboard__stat--alarms",children:[e.jsx("span",{className:"nice-iot-dashboard__stat-icon",children:e.jsx(m,{name:"bell",size:14})}),p("ioTDashboard.alarms","{criticalAlarms} Alarms").replace("{criticalAlarms}",String(E.length))]})]}),e.jsxs("nav",{className:"nice-iot-dashboard__nav",children:[e.jsx("button",{className:`nice-iot-dashboard__nav-button ${u==="dashboard"?"nice-iot-dashboard__nav-button--active":""}`,onClick:()=>y("dashboard"),children:p("ioTDashboard.dashboard","Dashboard")}),e.jsx("button",{className:`nice-iot-dashboard__nav-button ${u==="devices"?"nice-iot-dashboard__nav-button--active":""}`,onClick:()=>y("devices"),children:p("ioTDashboard.devices2","Devices")}),e.jsxs("button",{className:`nice-iot-dashboard__nav-button ${u==="alarms"?"nice-iot-dashboard__nav-button--active":""}`,onClick:()=>y("alarms"),children:[p("ioTDashboard.alarms2","Alarms")," ",T.length>0&&`(${T.length})`]})]}),e.jsx("div",{className:"nice-iot-dashboard__actions",children:u==="dashboard"&&e.jsxs("button",{onClick:()=>z(!x),children:[e.jsx(m,{name:x?"check":"edit",size:14})," ",x?p("ioTDashboard.done","Done"):p("ioTDashboard.edit","Edit")]})})]}),u==="dashboard"&&e.jsxs("div",{className:"nice-iot-dashboard__main",children:[x&&e.jsxs("aside",{className:"nice-iot-dashboard__palette",children:[e.jsx("h4",{children:p("ioTDashboard.addWidget","Add Widget")}),A.map(c=>e.jsxs("button",{className:"nice-iot-dashboard__palette-item",onClick:()=>C(c.type),children:[e.jsx(m,{name:c.icon,size:16}),e.jsx("span",{children:c.label})]},c.type))]}),e.jsxs("div",{className:"nice-iot-dashboard__grid",children:[v.map(c=>e.jsx(ae,{widget:c,devices:a,alarms:t,isEditing:x,onCommand:r,onDelete:()=>M(b=>b.filter(f=>f.id!==c.id))},c.id)),v.length===0&&e.jsx("div",{className:"nice-iot-dashboard__empty",children:x?p("ioTDashboard.addWidgetsFromThePalette","Add widgets from the palette"):p("ioTDashboard.noWidgetsConfiguredClickEdit","No widgets configured. Click Edit to add widgets.")})]})]}),u==="devices"&&e.jsxs("div",{className:"nice-iot-dashboard__devices",children:[e.jsx("div",{className:"nice-iot-dashboard__devices-toolbar",children:e.jsx("input",{type:"search",placeholder:p("ioTDashboard.searchDevices","Search devices..."),value:_,onChange:c=>D(c.target.value)})}),e.jsx("div",{className:"nice-iot-dashboard__device-grid",children:B.map(c=>e.jsx(te,{device:c,isSelected:(j==null?void 0:j.id)===c.id,onSelect:()=>L(c)},c.id))}),j&&e.jsx(ie,{device:j,onCommand:r,onClose:()=>N(null)})]}),u==="alarms"&&e.jsx("div",{className:"nice-iot-dashboard__alarms",children:e.jsxs("table",{className:"nice-iot-dashboard__alarm-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:p("ioTDashboard.severity","Severity")}),e.jsx("th",{children:p("ioTDashboard.device","Device")}),e.jsx("th",{children:p("ioTDashboard.message","Message")}),e.jsx("th",{children:p("ioTDashboard.time","Time")}),e.jsx("th",{children:p("ioTDashboard.status","Status")}),e.jsx("th",{children:p("ioTDashboard.actions","Actions")})]})}),e.jsx("tbody",{children:T.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"nice-iot-dashboard__no-alarms",children:p("ioTDashboard.noActiveAlarms","No active alarms")})}):T.map(c=>{const b=a.find(f=>f.id===c.deviceId);return e.jsxs("tr",{className:`nice-iot-dashboard__alarm-row nice-iot-dashboard__alarm-row--${c.severity}`,children:[e.jsx("td",{children:e.jsx("span",{className:`nice-iot-dashboard__severity nice-iot-dashboard__severity--${c.severity}`,children:c.severity})}),e.jsx("td",{children:(b==null?void 0:b.name)||c.deviceId}),e.jsx("td",{children:c.message}),e.jsx("td",{children:c.timestamp.toLocaleString()}),e.jsx("td",{children:c.acknowledged?p("ioTDashboard.acknowledged","Acknowledged"):p("ioTDashboard.active","Active")}),e.jsx("td",{children:!c.acknowledged&&e.jsx("button",{onClick:()=>k(c.id),children:p("ioTDashboard.acknowledge","Acknowledge")})})]},c.id)})})]})})]})}function ee(a){return a.length===0?0:Math.max(...a.map(i=>i.position.y+i.position.height))}function H(a){switch(a){case"online":return"var(--nice-success, #28a745)";case"offline":return"var(--nice-text-secondary, #6c757d)";case"warning":return"var(--nice-warning, #ffc107)";case"error":return"var(--nice-danger, #dc3545)";case"maintenance":return"var(--nice-info, #17a2b8)";default:return"var(--nice-text-secondary, #6c757d)"}}function ae({widget:a,devices:i,alarms:t,isEditing:s,onCommand:l,onDelete:r}){const{t:n}=g(),o=A.find(d=>d.type===a.type);return e.jsxs("div",{className:`nice-iot-dashboard__widget nice-iot-dashboard__widget--${a.type}`,style:{gridColumn:`span ${a.position.width}`,gridRow:`span ${a.position.height}`},children:[e.jsxs("div",{className:"nice-iot-dashboard__widget-header",children:[e.jsx("span",{className:"nice-iot-dashboard__widget-icon",children:e.jsx(m,{name:(o==null?void 0:o.icon)??"box",size:14})}),e.jsx("span",{className:"nice-iot-dashboard__widget-title",children:a.title}),s&&e.jsx("button",{"aria-label":n("ioTDashboard.close","Close"),className:"nice-iot-dashboard__widget-delete",onClick:r,children:e.jsx(m,{name:"close",size:14})})]}),e.jsx("div",{className:"nice-iot-dashboard__widget-content",children:e.jsx(se,{widget:a,devices:i,alarms:t,onCommand:l})})]})}function se({widget:a,devices:i,alarms:t,onCommand:s}){const{t:l}=g();switch(a.type){case"device-list":return e.jsx("div",{className:"nice-iot-dashboard__device-list",children:i.slice(0,10).map(r=>e.jsxs("div",{className:"nice-iot-dashboard__device-list-item",children:[e.jsx("span",{className:"nice-iot-dashboard__device-status",style:{background:H(r.status)}}),e.jsx("span",{children:r.name}),e.jsx("span",{className:"nice-iot-dashboard__device-type",children:r.type})]},r.id))});case"device-status":return e.jsx("div",{className:"nice-iot-dashboard__status-grid",children:["online","offline","warning","error"].map(r=>{const n=i.filter(o=>o.status===r).length;return e.jsxs("div",{className:"nice-iot-dashboard__status-card",children:[e.jsx("span",{className:"nice-iot-dashboard__status-indicator",style:{background:H(r)}}),e.jsx("span",{className:"nice-iot-dashboard__status-count",children:n}),e.jsx("span",{className:"nice-iot-dashboard__status-label",children:r})]},r)})});case"telemetry-chart":return e.jsxs("div",{className:"nice-iot-dashboard__chart-placeholder",children:[e.jsx(m,{name:"bar-chart",size:32}),e.jsx("span",{children:l("ioTDashboard.telemetryChart","Telemetry Chart")}),e.jsx("small",{children:l("ioTDashboard.configureDeviceAndCapability","Configure device and capability")})]});case"gauge":return e.jsx("div",{className:"nice-iot-dashboard__gauge",children:e.jsxs("svg",{viewBox:"0 0 100 60",children:[e.jsx("path",{d:"M 10 55 A 40 40 0 0 1 90 55",fill:"none",stroke:"var(--nice-border, #e0e0e0)",strokeWidth:"8"}),e.jsx("path",{d:"M 10 55 A 40 40 0 0 1 90 55",fill:"none",stroke:"var(--nice-primary, #0066cc)",strokeWidth:"8",strokeDasharray:"63 126"}),e.jsx("text",{x:"50",y:"50",textAnchor:"middle",fontSize:"14",fontWeight:"bold",children:"50%"})]})});case"map":return e.jsxs("div",{className:"nice-iot-dashboard__map-placeholder",children:[e.jsx(m,{name:"map-pin",size:32}),e.jsx("span",{children:l("ioTDashboard.deviceMap","Device Map")}),e.jsx("small",{children:l("ioTDashboard.devicesWithLocation","{devices} devices with location").replace("{devices}",String(i.filter(r=>r.location).length))})]});case"alarms":{const r=t.filter(n=>!n.cleared).slice(0,5);return e.jsx("div",{className:"nice-iot-dashboard__alarm-list",children:r.length===0?e.jsx("div",{className:"nice-iot-dashboard__alarm-empty",children:l("ioTDashboard.noActiveAlarms","No active alarms")}):r.map(n=>e.jsxs("div",{className:`nice-iot-dashboard__alarm-item nice-iot-dashboard__alarm-item--${n.severity}`,children:[e.jsx("span",{className:"nice-iot-dashboard__alarm-severity",children:n.severity}),e.jsx("span",{className:"nice-iot-dashboard__alarm-message",children:n.message})]},n.id))})}case"control-panel":return e.jsxs("div",{className:"nice-iot-dashboard__control-placeholder",children:[e.jsx(m,{name:"settings",size:32}),e.jsx("span",{children:l("ioTDashboard.controlPanel","Control Panel")}),e.jsx("small",{children:l("ioTDashboard.configureDeviceControls","Configure device controls")})]});case"kpi":return e.jsxs("div",{className:"nice-iot-dashboard__kpi",children:[e.jsx("div",{className:"nice-iot-dashboard__kpi-value",children:i.length}),e.jsx("div",{className:"nice-iot-dashboard__kpi-label",children:l("ioTDashboard.totalDevices","Total Devices")})]});default:return e.jsx("div",{className:"nice-iot-dashboard__widget-placeholder",children:a.type})}}function te({device:a,isSelected:i,onSelect:t}){const{t:s}=g();return e.jsxs("div",{role:"button",tabIndex:0,onKeyDown:V,className:`nice-iot-dashboard__device-card ${i?"nice-iot-dashboard__device-card--selected":""}`,onClick:t,children:[e.jsxs("div",{className:"nice-iot-dashboard__device-card-header",children:[e.jsx("span",{className:"nice-iot-dashboard__device-status",style:{background:H(a.status)}}),e.jsx("span",{className:"nice-iot-dashboard__device-name",children:a.name})]}),e.jsxs("div",{className:"nice-iot-dashboard__device-card-body",children:[e.jsxs("div",{className:"nice-iot-dashboard__device-info",children:[e.jsx("span",{children:s("ioTDashboard.type","Type: {type}").replace("{type}",String(a.type))}),e.jsx("span",{children:s("ioTDashboard.protocol","Protocol: {protocol}").replace("{protocol}",String(a.protocol))})]}),a.lastSeen&&e.jsx("div",{className:"nice-iot-dashboard__device-lastseen",children:s("ioTDashboard.lastSeen","Last seen: {lastSeen}").replace("{lastSeen}",String(a.lastSeen.toLocaleString()))}),e.jsxs("div",{className:"nice-iot-dashboard__device-capabilities",children:[a.capabilities.slice(0,3).map(l=>e.jsx("span",{className:"nice-iot-dashboard__capability-badge",children:l.name},l.id)),a.capabilities.length>3&&e.jsxs("span",{className:"nice-iot-dashboard__capability-more",children:["+",a.capabilities.length-3]})]})]})]})}function ie({device:a,onCommand:i,onClose:t}){const{t:s}=g();return e.jsxs("aside",{className:"nice-iot-dashboard__device-detail",children:[e.jsxs("div",{className:"nice-iot-dashboard__device-detail-header",children:[e.jsx("h3",{children:a.name}),e.jsx("button",{"aria-label":s("ioTDashboard.close","Close"),onClick:t,children:e.jsx(m,{name:"close",size:14})})]}),e.jsxs("div",{className:"nice-iot-dashboard__device-detail-content",children:[e.jsxs("section",{children:[e.jsx("h4",{children:s("ioTDashboard.status","Status")}),e.jsxs("div",{className:"nice-iot-dashboard__detail-row",children:[e.jsx("span",{children:s("ioTDashboard.status2","Status:")}),e.jsx("span",{className:"nice-iot-dashboard__status-badge",style:{background:H(a.status)},children:a.status})]}),a.lastSeen&&e.jsxs("div",{className:"nice-iot-dashboard__detail-row",children:[e.jsx("span",{children:s("ioTDashboard.lastSeen2","Last Seen:")}),e.jsx("span",{children:a.lastSeen.toLocaleString()})]})]}),e.jsxs("section",{children:[e.jsx("h4",{children:s("ioTDashboard.connection","Connection")}),e.jsxs("div",{className:"nice-iot-dashboard__detail-row",children:[e.jsx("span",{children:s("ioTDashboard.protocol2","Protocol:")}),e.jsx("span",{children:a.protocol})]}),a.connectionInfo.host&&e.jsxs("div",{className:"nice-iot-dashboard__detail-row",children:[e.jsx("span",{children:s("ioTDashboard.host","Host:")}),e.jsxs("span",{children:[a.connectionInfo.host,":",a.connectionInfo.port]})]})]}),a.metadata&&e.jsxs("section",{children:[e.jsx("h4",{children:s("ioTDashboard.metadata","Metadata")}),a.metadata.manufacturer&&e.jsxs("div",{className:"nice-iot-dashboard__detail-row",children:[e.jsx("span",{children:s("ioTDashboard.manufacturer","Manufacturer:")}),e.jsx("span",{children:a.metadata.manufacturer})]}),a.metadata.model&&e.jsxs("div",{className:"nice-iot-dashboard__detail-row",children:[e.jsx("span",{children:s("ioTDashboard.model","Model:")}),e.jsx("span",{children:a.metadata.model})]})]}),e.jsxs("section",{children:[e.jsx("h4",{children:s("ioTDashboard.capabilities","Capabilities")}),e.jsx("div",{className:"nice-iot-dashboard__capabilities-list",children:a.capabilities.map(l=>e.jsxs("div",{className:"nice-iot-dashboard__capability-item",children:[e.jsx("span",{className:"nice-iot-dashboard__capability-name",children:l.name}),e.jsx("span",{className:"nice-iot-dashboard__capability-type",children:l.type}),l.writable&&i&&e.jsx("button",{className:"nice-iot-dashboard__capability-control",onClick:()=>i(a.id,l.id,!0),children:s("ioTDashboard.control","Control")})]},l.id))})]})]})]})}const ne=[{name:"MQTT Broker",image:"eclipse-mosquitto:latest"},{name:"Node-RED",image:"nodered/node-red:latest"},{name:"InfluxDB",image:"influxdb:latest"},{name:"Grafana",image:"grafana/grafana:latest"},{name:"Telegraf",image:"telegraf:latest"},{name:"Protocol Adapter",image:"nice2dev/protocol-adapter:latest"}];function re({nodes:a=[],modules:i=[],onNodeSelect:t,onModuleDeploy:s,onModuleAction:l,onNodeSync:r,className:n=""}){const{t:o}=g(),[d,p]=h.useState(null),[v,w]=h.useState("nodes"),[j,N]=h.useState(!1),[u,y]=h.useState({name:"",image:"",status:"pending"}),x=h.useCallback(M=>{p(M),t==null||t(M)},[t]),z=h.useCallback(async()=>{!d||!u.name||!u.image||(await(s==null?void 0:s(d.id,u)),N(!1),y({name:"",image:"",status:"pending"}))},[d,u,s]),_=h.useCallback(async(M,C)=>{d&&await(l==null?void 0:l(d.id,M,C))},[d,l]),D=h.useCallback(async()=>{d&&await(r==null?void 0:r(d.id))},[d,r]);return e.jsxs("div",{className:`nice-edge-manager ${n}`,children:[e.jsxs("header",{className:"nice-edge-manager__header",children:[e.jsx("h1",{children:o("edgeManager.edgeManager","Edge Manager")}),e.jsxs("nav",{className:"nice-edge-manager__nav",children:[e.jsx("button",{className:`nice-edge-manager__nav-button ${v==="nodes"?"nice-edge-manager__nav-button--active":""}`,onClick:()=>w("nodes"),children:o("edgeManager.nodes","Nodes ({nodes})").replace("{nodes}",String(a.length))}),e.jsx("button",{className:`nice-edge-manager__nav-button ${v==="modules"?"nice-edge-manager__nav-button--active":""}`,onClick:()=>w("modules"),children:o("edgeManager.modules","Modules")})]})]}),e.jsxs("div",{className:"nice-edge-manager__main",children:[v==="nodes"&&e.jsx("div",{className:"nice-edge-manager__nodes",children:e.jsxs("div",{className:"nice-edge-manager__node-grid",children:[a.map(M=>e.jsx(oe,{node:M,isSelected:(d==null?void 0:d.id)===M.id,onSelect:()=>x(M)},M.id)),a.length===0&&e.jsx("div",{className:"nice-edge-manager__empty",children:o("edgeManager.noEdgeNodesConfigured","No edge nodes configured")})]})}),v==="modules"&&d&&e.jsxs("div",{className:"nice-edge-manager__modules",children:[e.jsxs("div",{className:"nice-edge-manager__modules-header",children:[e.jsx("h3",{children:o("edgeManager.modulesOn","Modules on {name}").replace("{name}",String(d.name))}),e.jsx("button",{className:"nice-edge-manager__deploy-btn",onClick:()=>N(!0),children:o("edgeManager.deployModule2","+ Deploy Module")})]}),e.jsxs("div",{className:"nice-edge-manager__module-grid",children:[d.deployedModules.map(M=>e.jsx(ce,{module:M,onAction:C=>_(M.id,C)},M.id)),d.deployedModules.length===0&&e.jsx("div",{className:"nice-edge-manager__empty",children:o("edgeManager.noModulesDeployedOnThis","No modules deployed on this node")})]})]}),v==="modules"&&!d&&e.jsx("div",{className:"nice-edge-manager__no-selection",children:o("edgeManager.selectANodeFromThe","Select a node from the Nodes tab to manage modules")}),d&&e.jsx(de,{node:d,onSync:D,onClose:()=>p(null)})]}),j&&e.jsx(he,{config:u,templates:ne,onChange:y,onDeploy:z,onClose:()=>N(!1)})]})}function F(a){switch(a){case"running":return"var(--nice-success, #28a745)";case"stopped":return"var(--nice-text-secondary, #6c757d)";case"updating":return"var(--nice-warning, #ffc107)";case"error":return"var(--nice-danger, #dc3545)";case"unreachable":return"var(--nice-text-secondary, #868e96)";default:return"var(--nice-text-secondary, #6c757d)"}}function I(a){return a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(1)} KB`:a<1024*1024*1024?`${(a/1024/1024).toFixed(1)} MB`:`${(a/1024/1024/1024).toFixed(2)} GB`}function le(a){const i=Math.floor(a/86400),t=Math.floor(a%86400/3600),s=Math.floor(a%3600/60);return i>0?`${i}d ${t}h`:t>0?`${t}h ${s}m`:`${s}m`}function oe({node:a,isSelected:i,onSelect:t}){const{t:s}=g();return e.jsxs("div",{role:"button",tabIndex:0,onKeyDown:V,className:`nice-edge-manager__node-card ${i?"nice-edge-manager__node-card--selected":""}`,onClick:t,children:[e.jsxs("div",{className:"nice-edge-manager__node-header",children:[e.jsx("span",{className:"nice-edge-manager__node-status",style:{background:F(a.status)}}),e.jsx("span",{className:"nice-edge-manager__node-name",children:a.name}),e.jsx("span",{className:"nice-edge-manager__node-type",children:a.type})]}),e.jsxs("div",{className:"nice-edge-manager__node-body",children:[e.jsxs("div",{className:"nice-edge-manager__node-info",children:[e.jsxs("span",{children:[e.jsx(m,{name:"server",size:12})," ",a.hardware.cpu]}),e.jsxs("span",{children:[e.jsx(m,{name:"database",size:12})," ",(a.hardware.memoryMB/1024).toFixed(1)," GB"]})]}),e.jsx("div",{className:"nice-edge-manager__node-metrics",children:a.metrics&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"nice-edge-manager__metric",children:[e.jsx("span",{className:"nice-edge-manager__metric-label",children:"CPU"}),e.jsx("div",{className:"nice-edge-manager__metric-bar",children:e.jsx("div",{className:"nice-edge-manager__metric-fill",style:{width:`${a.metrics.cpuUsage}%`}})}),e.jsxs("span",{className:"nice-edge-manager__metric-value",children:[a.metrics.cpuUsage.toFixed(0),"%"]})]}),e.jsxs("div",{className:"nice-edge-manager__metric",children:[e.jsx("span",{className:"nice-edge-manager__metric-label",children:s("edgeManager.mem","MEM")}),e.jsx("div",{className:"nice-edge-manager__metric-bar",children:e.jsx("div",{className:"nice-edge-manager__metric-fill",style:{width:`${a.metrics.memoryUsage}%`}})}),e.jsxs("span",{className:"nice-edge-manager__metric-value",children:[a.metrics.memoryUsage.toFixed(0),"%"]})]})]})}),e.jsx("div",{className:"nice-edge-manager__node-modules",children:s("edgeManager.modulesDeployed","{deployedModules} modules deployed").replace("{deployedModules}",String(a.deployedModules.length))})]})]})}function ce({module:a,onAction:i}){const{t}=g(),s={running:"var(--nice-success, #28a745)",stopped:"var(--nice-text-secondary, #6c757d)",error:"var(--nice-danger, #dc3545)",pending:"var(--nice-warning, #ffc107)"};return e.jsxs("div",{className:"nice-edge-manager__module-card",children:[e.jsxs("div",{className:"nice-edge-manager__module-header",children:[e.jsx("span",{className:"nice-edge-manager__module-status",style:{background:s[a.status]||"var(--nice-bg-tertiary, #6c757d)"}}),e.jsx("span",{className:"nice-edge-manager__module-name",children:a.name}),e.jsxs("span",{className:"nice-edge-manager__module-version",children:["v",a.version]})]}),e.jsxs("div",{className:"nice-edge-manager__module-body",children:[e.jsx("div",{className:"nice-edge-manager__module-image",children:a.image}),a.resources&&e.jsxs("div",{className:"nice-edge-manager__module-resources",children:[a.resources.cpuLimit&&e.jsx("span",{children:t("edgeManager.cpu","CPU: {cpuLimit}").replace("{cpuLimit}",String(a.resources.cpuLimit))}),a.resources.memoryLimitMB&&e.jsx("span",{children:t("edgeManager.ramMb","RAM: {memoryLimitMB} MB").replace("{memoryLimitMB}",String(a.resources.memoryLimitMB))})]}),a.ports&&a.ports.length>0&&e.jsx("div",{className:"nice-edge-manager__module-ports",children:t("edgeManager.ports","Ports: {ports}").replace("{ports}",String(a.ports.map(l=>`${l.host}:${l.container}`).join(", ")))})]}),e.jsxs("div",{className:"nice-edge-manager__module-actions",children:[a.status==="running"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>i("stop"),children:t("edgeManager.stop","Stop")}),e.jsx("button",{onClick:()=>i("restart"),children:t("edgeManager.restart","Restart")})]}),a.status==="stopped"&&e.jsx("button",{onClick:()=>i("start"),children:t("edgeManager.start","Start")}),e.jsx("button",{className:"nice-edge-manager__module-remove",onClick:()=>i("remove"),children:t("edgeManager.remove","Remove")})]})]})}function de({node:a,onSync:i,onClose:t}){const{t:s}=g();return e.jsxs("aside",{className:"nice-edge-manager__detail",children:[e.jsxs("div",{className:"nice-edge-manager__detail-header",children:[e.jsx("h3",{children:a.name}),e.jsxs("div",{className:"nice-edge-manager__detail-actions",children:[e.jsxs("button",{onClick:i,children:[e.jsx(m,{name:"refresh",size:14})," ",s("edgeManager.sync","Sync")]}),e.jsx("button",{onClick:t,"aria-label":s("edgeManager.close","Close"),children:e.jsx(m,{name:"close",size:14})})]})]}),e.jsxs("div",{className:"nice-edge-manager__detail-content",children:[e.jsxs("section",{children:[e.jsx("h4",{children:s("edgeManager.status","Status")}),e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.status2","Status:")}),e.jsx("span",{className:"nice-edge-manager__status-badge",style:{background:F(a.status)},children:a.status})]}),a.metrics&&e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.uptime","Uptime:")}),e.jsx("span",{children:le(a.metrics.uptime)})]})]}),e.jsxs("section",{children:[e.jsx("h4",{children:s("edgeManager.hardware","Hardware")}),e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.cpu2","CPU:")}),e.jsx("span",{children:s("edgeManager.cores","{cpu} ({cores} cores)").replace("{cpu}",String(a.hardware.cpu)).replace("{cores}",String(a.hardware.cores))})]}),e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.memory2","Memory:")}),e.jsxs("span",{children:[(a.hardware.memoryMB/1024).toFixed(1)," GB"]})]}),e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.storage","Storage:")}),e.jsxs("span",{children:[(a.hardware.storageMB/1024).toFixed(1)," GB"]})]}),e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.architecture","Architecture:")}),e.jsx("span",{children:a.hardware.architecture})]})]}),e.jsxs("section",{children:[e.jsx("h4",{children:s("edgeManager.software","Software")}),e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.os","OS:")}),e.jsxs("span",{children:[a.software.os," ",a.software.osVersion]})]}),e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.runtime","Runtime:")}),e.jsxs("span",{children:[a.software.runtime," ",a.software.runtimeVersion]})]}),e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.agent","Agent:")}),e.jsxs("span",{children:[a.software.agent," v",a.software.agentVersion]})]})]}),e.jsxs("section",{children:[e.jsx("h4",{children:s("edgeManager.connectivity","Connectivity")}),e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.cloud","Cloud:")}),e.jsxs("span",{children:[e.jsx(m,{name:a.connectivity.cloudConnected?"check":"close",size:12})," ",a.connectivity.cloudConnected?s("edgeManager.connected","Connected"):s("edgeManager.disconnected","Disconnected")]})]}),e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.network","Network:")}),e.jsx("span",{children:a.connectivity.localNetwork})]}),a.connectivity.publicIP&&e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.publicIp","Public IP:")}),e.jsx("span",{children:a.connectivity.publicIP})]}),a.connectivity.lastSync&&e.jsxs("div",{className:"nice-edge-manager__detail-row",children:[e.jsx("span",{children:s("edgeManager.lastSync","Last Sync:")}),e.jsx("span",{children:a.connectivity.lastSync.toLocaleString()})]})]}),a.metrics&&e.jsxs("section",{children:[e.jsx("h4",{children:s("edgeManager.resourceUsage","Resource Usage")}),e.jsxs("div",{className:"nice-edge-manager__resource-chart",children:[e.jsxs("div",{className:"nice-edge-manager__resource-item",children:[e.jsx("span",{children:"CPU"}),e.jsx("div",{className:"nice-edge-manager__resource-bar",children:e.jsx("div",{className:"nice-edge-manager__resource-fill",style:{width:`${a.metrics.cpuUsage}%`}})}),e.jsxs("span",{children:[a.metrics.cpuUsage.toFixed(1),"%"]})]}),e.jsxs("div",{className:"nice-edge-manager__resource-item",children:[e.jsx("span",{children:s("edgeManager.memory","Memory")}),e.jsx("div",{className:"nice-edge-manager__resource-bar",children:e.jsx("div",{className:"nice-edge-manager__resource-fill",style:{width:`${a.metrics.memoryUsage}%`}})}),e.jsxs("span",{children:[a.metrics.memoryUsage.toFixed(1),"%"]})]}),e.jsxs("div",{className:"nice-edge-manager__resource-item",children:[e.jsx("span",{children:s("edgeManager.disk","Disk")}),e.jsx("div",{className:"nice-edge-manager__resource-bar",children:e.jsx("div",{className:"nice-edge-manager__resource-fill",style:{width:`${a.metrics.diskUsage}%`}})}),e.jsxs("span",{children:[a.metrics.diskUsage.toFixed(1),"%"]})]})]}),e.jsxs("div",{className:"nice-edge-manager__network-stats",children:[e.jsxs("span",{children:[e.jsx(m,{name:"arrow-down",size:12})," ",I(a.metrics.networkIn)]}),e.jsxs("span",{children:[e.jsx(m,{name:"arrow-up",size:12})," ",I(a.metrics.networkOut)]})]})]})]})]})}function he({config:a,templates:i,onChange:t,onDeploy:s,onClose:l}){const{t:r}=g();return e.jsx("div",{className:"nice-edge-manager__dialog-overlay",children:e.jsxs("div",{className:"nice-edge-manager__dialog",children:[e.jsxs("div",{className:"nice-edge-manager__dialog-header",children:[e.jsx("h3",{children:r("edgeManager.deployModule","Deploy Module")}),e.jsx("button",{onClick:l,"aria-label":r("edgeManager.close","Close"),children:e.jsx(m,{name:"close",size:14})})]}),e.jsxs("div",{className:"nice-edge-manager__dialog-content",children:[e.jsxs("div",{className:"nice-edge-manager__field",children:[e.jsx("label",{children:r("edgeManager.templateOptional","Template (optional)")}),e.jsxs("select",{value:"",onChange:n=>{const o=i.find(d=>d.image===n.target.value);o&&t({...a,name:o.name,image:o.image})},children:[e.jsx("option",{value:"",children:r("edgeManager.selectATemplate","Select a template...")}),i.map(n=>e.jsx("option",{value:n.image,children:n.name},n.image))]})]}),e.jsxs("div",{className:"nice-edge-manager__field",children:[e.jsx("label",{children:r("edgeManager.moduleName","Module Name")}),e.jsx("input",{type:"text",value:a.name||"",onChange:n=>t({...a,name:n.target.value}),placeholder:r("edgeManager.eGMyModule","e.g., my-module")})]}),e.jsxs("div",{className:"nice-edge-manager__field",children:[e.jsx("label",{children:r("edgeManager.containerImage","Container Image")}),e.jsx("input",{type:"text",value:a.image||"",onChange:n=>t({...a,image:n.target.value}),placeholder:r("edgeManager.eGNginxLatest","e.g., nginx:latest")})]}),e.jsxs("div",{className:"nice-edge-manager__field",children:[e.jsx("label",{children:r("edgeManager.version","Version")}),e.jsx("input",{type:"text",value:a.version||"1.0.0",onChange:n=>t({...a,version:n.target.value})})]})]}),e.jsxs("div",{className:"nice-edge-manager__dialog-footer",children:[e.jsx("button",{onClick:l,children:r("edgeManager.cancel","Cancel")}),e.jsx("button",{className:"nice-edge-manager__deploy-confirm",onClick:s,children:r("edgeManager.deploy","Deploy")})]})]})})}const U={broker:"localhost",port:1883,clientId:`nice2dev-${Date.now()}`,useTLS:!1,keepAlive:60,cleanSession:!0,topics:[]},$={host:"localhost",port:5683,useDTLS:!1,resources:[]},O={type:"tcp",host:"localhost",port:502,slaveId:1,timeout:1e3,registers:[]},R={endpointUrl:"opc.tcp://localhost:4840",securityMode:"None",authentication:"anonymous",applicationName:"Nice2Dev IoT Client",nodes:[]};function pe({protocol:a="mqtt",config:i,onSave:t,onTest:s,className:l=""}){const{t:r}=g(),[n,o]=h.useState(a),[d,p]=h.useState((i==null?void 0:i.type)==="mqtt"?{...U,...i.config}:U),[v,w]=h.useState((i==null?void 0:i.type)==="coap"?{...$,...i.config}:$),[j,N]=h.useState((i==null?void 0:i.type)==="modbus"?{...O,...i.config}:O),[u,y]=h.useState((i==null?void 0:i.type)==="opcua"?{...R,...i.config}:R),[x,z]=h.useState(null),[_,D]=h.useState(!1),M=h.useCallback(()=>{switch(n){case"mqtt":return d;case"coap":return v;case"modbus-tcp":case"modbus-rtu":return j;case"opcua":return u;default:return d}},[n,d,v,j,u]),C=h.useCallback(()=>{t==null||t(M())},[M,t]),L=h.useCallback(async()=>{if(s){D(!0),z(null);try{const k=await s(M());z(k)}catch(k){z({success:!1,message:String(k)})}finally{D(!1)}}},[M,s]);return e.jsxs("div",{className:`nice-protocol-config ${l}`,children:[e.jsxs("header",{className:"nice-protocol-config__header",children:[e.jsx("h2",{children:r("protocolConfig.title","Protocol Configuration")}),e.jsxs("div",{className:"nice-protocol-config__protocol-selector",children:[e.jsx("label",{children:r("protocolConfig.protocol","Protocol:")}),e.jsxs("select",{value:n,onChange:k=>o(k.target.value),children:[e.jsx("option",{value:"mqtt",children:r("protocolConfig.mqtt","MQTT")}),e.jsx("option",{value:"coap",children:r("protocolConfig.coap","CoAP")}),e.jsx("option",{value:"modbus-tcp",children:r("protocolConfig.modbusTcp","Modbus TCP")}),e.jsx("option",{value:"modbus-rtu",children:r("protocolConfig.modbusRtu","Modbus RTU")}),e.jsx("option",{value:"opcua",children:r("protocolConfig.opcUa","OPC-UA")})]})]})]}),e.jsxs("div",{className:"nice-protocol-config__content",children:[n==="mqtt"&&e.jsx(me,{config:d,onChange:p}),n==="coap"&&e.jsx(Me,{config:v,onChange:w}),(n==="modbus-tcp"||n==="modbus-rtu")&&e.jsx(ve,{config:j,type:n==="modbus-rtu"?"rtu":"tcp",onChange:N}),n==="opcua"&&e.jsx(ue,{config:u,onChange:y})]}),x&&e.jsxs("div",{className:`nice-protocol-config__test-result nice-protocol-config__test-result--${x.success?"success":"error"}`,children:[e.jsx(m,{name:x.success?"check":"close",size:14})," ",x.message]}),e.jsxs("footer",{className:"nice-protocol-config__footer",children:[e.jsx("button",{className:"nice-protocol-config__test-btn",onClick:L,disabled:_||!s,children:_?r("protocolConfig.testing","Testing..."):e.jsxs(e.Fragment,{children:[e.jsx(m,{name:"plug",size:14})," ",r("protocolConfig.testConnection","Test Connection")]})}),e.jsxs("button",{className:"nice-protocol-config__save-btn",onClick:C,children:[e.jsx(m,{name:"save",size:14})," ",r("save","Save")]})]})]})}function me({config:a,onChange:i}){const{t}=g();return e.jsxs("div",{className:"nice-protocol-config__section",children:[e.jsx("h3",{children:t("protocolConfig.mqttConfiguration","MQTT Configuration")}),e.jsxs("div",{className:"nice-protocol-config__grid",children:[e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:t("protocolConfig.broker","Broker")}),e.jsx("input",{type:"text",value:a.broker,onChange:s=>i({...a,broker:s.target.value}),placeholder:"localhost"})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:t("protocolConfig.port","Port")}),e.jsx("input",{type:"number",value:a.port,onChange:s=>i({...a,port:parseInt(s.target.value,10)||1883})})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:t("protocolConfig.clientId","Client ID")}),e.jsx("input",{type:"text",value:a.clientId,onChange:s=>i({...a,clientId:s.target.value})})]}),e.jsx("div",{className:"nice-protocol-config__field",children:e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:a.useTLS,onChange:s=>i({...a,useTLS:s.target.checked})}),t("protocolConfig.useTls","Use TLS")]})}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:t("protocolConfig.username","Username")}),e.jsx("input",{type:"text",value:a.username||"",onChange:s=>i({...a,username:s.target.value})})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:t("protocolConfig.password","Password")}),e.jsx("input",{type:"password",value:a.password||"",onChange:s=>i({...a,password:s.target.value})})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:t("protocolConfig.keepAlive","Keep Alive (seconds)")}),e.jsx("input",{type:"number",value:a.keepAlive,onChange:s=>i({...a,keepAlive:parseInt(s.target.value,10)||60})})]}),e.jsx("div",{className:"nice-protocol-config__field",children:e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:a.cleanSession,onChange:s=>i({...a,cleanSession:s.target.checked})}),t("protocolConfig.cleanSession","Clean Session")]})})]}),e.jsx("h4",{children:t("protocolConfig.topics","Topics")}),e.jsxs("div",{className:"nice-protocol-config__topics",children:[a.topics.map((s,l)=>e.jsxs("div",{className:"nice-protocol-config__topic-row",children:[e.jsx("input",{type:"text",value:s.pattern,onChange:r=>{const n=[...a.topics];n[l]={...n[l],pattern:r.target.value},i({...a,topics:n})},placeholder:t("protocolConfig.topicPatternPlaceholder","e.g., sensors/+/data")}),e.jsxs("select",{value:s.qos,onChange:r=>{const n=[...a.topics];n[l]={...n[l],qos:parseInt(r.target.value,10)},i({...a,topics:n})},children:[e.jsx("option",{value:0,children:t("protocolConfig.qos0","QoS 0")}),e.jsx("option",{value:1,children:t("protocolConfig.qos1","QoS 1")}),e.jsx("option",{value:2,children:t("protocolConfig.qos2","QoS 2")})]}),e.jsxs("select",{value:s.direction,onChange:r=>{const n=[...a.topics];n[l]={...n[l],direction:r.target.value},i({...a,topics:n})},children:[e.jsx("option",{value:"subscribe",children:t("protocolConfig.subscribe","Subscribe")}),e.jsx("option",{value:"publish",children:t("protocolConfig.publish","Publish")}),e.jsx("option",{value:"both",children:t("protocolConfig.both","Both")})]}),e.jsx("button",{"aria-label":t("protocolConfig.close","Close"),onClick:()=>{const r=a.topics.filter((n,o)=>o!==l);i({...a,topics:r})},children:e.jsx(m,{name:"close",size:14})})]},l)),e.jsxs("button",{onClick:()=>{i({...a,topics:[...a.topics,{pattern:"",qos:0,direction:"subscribe",payloadFormat:"json"}]})},children:[e.jsx(m,{name:"plus",size:14})," ",t("protocolConfig.addTopic","Add Topic")]})]})]})}function Me({config:a,onChange:i}){const{t}=g();return e.jsxs("div",{className:"nice-protocol-config__section",children:[e.jsx("h3",{children:t("protocolConfig.coapConfiguration","CoAP Configuration")}),e.jsxs("div",{className:"nice-protocol-config__grid",children:[e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:t("protocolConfig.host","Host")}),e.jsx("input",{type:"text",value:a.host,onChange:s=>i({...a,host:s.target.value})})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:t("protocolConfig.port","Port")}),e.jsx("input",{type:"number",value:a.port,onChange:s=>i({...a,port:parseInt(s.target.value,10)||5683})})]}),e.jsx("div",{className:"nice-protocol-config__field",children:e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:a.useDTLS,onChange:s=>i({...a,useDTLS:s.target.checked})}),t("protocolConfig.useDtls","Use DTLS")]})}),e.jsx("div",{className:"nice-protocol-config__field",children:e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:a.observe||!1,onChange:s=>i({...a,observe:s.target.checked})}),t("protocolConfig.enableObserve","Enable Observe")]})})]}),e.jsx("h4",{children:t("protocolConfig.resources","Resources")}),e.jsxs("div",{className:"nice-protocol-config__resources",children:[a.resources.map((s,l)=>e.jsxs("div",{className:"nice-protocol-config__resource-row",children:[e.jsx("input",{type:"text",value:s.path,onChange:r=>{const n=[...a.resources];n[l]={...n[l],path:r.target.value},i({...a,resources:n})},placeholder:"/sensors/temperature"}),e.jsx("button",{"aria-label":t("protocolConfig.close","Close"),onClick:()=>{const r=a.resources.filter((n,o)=>o!==l);i({...a,resources:r})},children:e.jsx(m,{name:"close",size:14})})]},l)),e.jsxs("button",{onClick:()=>{i({...a,resources:[...a.resources,{path:"",methods:["GET"],mediaType:"application/json",observable:!1}]})},children:[e.jsx(m,{name:"plus",size:14})," ",t("protocolConfig.addResource","Add Resource")]})]})]})}function ve({config:a,type:i,onChange:t}){const{t:s}=g();return e.jsxs("div",{className:"nice-protocol-config__section",children:[e.jsx("h3",{children:s("protocolConfig.modbusConfiguration","Modbus {type} Configuration").replace("{type}",String(i.toUpperCase()))}),e.jsxs("div",{className:"nice-protocol-config__grid",children:[i==="tcp"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:s("protocolConfig.host","Host")}),e.jsx("input",{type:"text",value:a.host||"",onChange:l=>t({...a,host:l.target.value})})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:s("protocolConfig.port","Port")}),e.jsx("input",{type:"number",value:a.port||502,onChange:l=>t({...a,port:parseInt(l.target.value,10)||502})})]})]}),i==="rtu"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:s("protocolConfig.serialPort","Serial Port")}),e.jsx("input",{type:"text",value:a.serialPort||"",onChange:l=>t({...a,serialPort:l.target.value}),placeholder:s("protocolConfig.serialPortPlaceholder","COM1 or /dev/ttyUSB0")})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:s("protocolConfig.baudRate","Baud Rate")}),e.jsxs("select",{value:a.baudRate||9600,onChange:l=>t({...a,baudRate:parseInt(l.target.value,10)}),children:[e.jsx("option",{value:9600,children:"9600"}),e.jsx("option",{value:19200,children:"19200"}),e.jsx("option",{value:38400,children:"38400"}),e.jsx("option",{value:57600,children:"57600"}),e.jsx("option",{value:115200,children:"115200"})]})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:s("protocolConfig.parity","Parity")}),e.jsxs("select",{value:a.parity||"none",onChange:l=>t({...a,parity:l.target.value}),children:[e.jsx("option",{value:"none",children:s("protocolConfig.none","None")}),e.jsx("option",{value:"even",children:s("protocolConfig.even","Even")}),e.jsx("option",{value:"odd",children:s("protocolConfig.odd","Odd")})]})]})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:s("protocolConfig.slaveId","Slave ID")}),e.jsx("input",{type:"number",value:a.slaveId,onChange:l=>t({...a,slaveId:parseInt(l.target.value,10)||1}),min:1,max:247})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:s("protocolConfig.timeoutMs","Timeout (ms)")}),e.jsx("input",{type:"number",value:a.timeout,onChange:l=>t({...a,timeout:parseInt(l.target.value,10)||1e3})})]})]}),e.jsx("h4",{children:s("protocolConfig.registers","Registers")}),e.jsxs("table",{className:"nice-protocol-config__registers-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:s("protocolConfig.name","Name")}),e.jsx("th",{children:s("protocolConfig.address","Address")}),e.jsx("th",{children:s("protocolConfig.type","Type")}),e.jsx("th",{children:s("protocolConfig.dataType","Data Type")}),e.jsx("th",{children:s("protocolConfig.readWrite","R/W")}),e.jsx("th",{})]})}),e.jsx("tbody",{children:a.registers.map((l,r)=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("input",{type:"text",value:l.name,onChange:n=>{const o=[...a.registers];o[r]={...o[r],name:n.target.value},t({...a,registers:o})}})}),e.jsx("td",{children:e.jsx("input",{type:"number",value:l.address,onChange:n=>{const o=[...a.registers];o[r]={...o[r],address:parseInt(n.target.value,10)||0},t({...a,registers:o})}})}),e.jsx("td",{children:e.jsxs("select",{value:l.type,onChange:n=>{const o=[...a.registers];o[r]={...o[r],type:n.target.value},t({...a,registers:o})},children:[e.jsx("option",{value:"coil",children:s("protocolConfig.coil","Coil")}),e.jsx("option",{value:"discrete",children:s("protocolConfig.discrete","Discrete")}),e.jsx("option",{value:"holding",children:s("protocolConfig.holding","Holding")}),e.jsx("option",{value:"input",children:s("protocolConfig.input","Input")})]})}),e.jsx("td",{children:e.jsxs("select",{value:l.dataType,onChange:n=>{const o=[...a.registers];o[r]={...o[r],dataType:n.target.value},t({...a,registers:o})},children:[e.jsx("option",{value:"bool",children:s("protocolConfig.bool","Bool")}),e.jsx("option",{value:"int16",children:s("protocolConfig.int16","Int16")}),e.jsx("option",{value:"uint16",children:s("protocolConfig.uint16","UInt16")}),e.jsx("option",{value:"int32",children:s("protocolConfig.int32","Int32")}),e.jsx("option",{value:"uint32",children:s("protocolConfig.uint32","UInt32")}),e.jsx("option",{value:"float32",children:s("protocolConfig.float32","Float32")})]})}),e.jsxs("td",{children:[e.jsx("input",{type:"checkbox",checked:l.readable,onChange:n=>{const o=[...a.registers];o[r]={...o[r],readable:n.target.checked},t({...a,registers:o})},title:s("protocolConfig.readable","Readable")}),e.jsx("input",{type:"checkbox",checked:l.writable,onChange:n=>{const o=[...a.registers];o[r]={...o[r],writable:n.target.checked},t({...a,registers:o})},title:s("protocolConfig.writable","Writable")})]}),e.jsx("td",{children:e.jsx("button",{"aria-label":s("protocolConfig.close","Close"),onClick:()=>{const n=a.registers.filter((o,d)=>d!==r);t({...a,registers:n})},children:e.jsx(m,{name:"close",size:14})})})]},r))})]}),e.jsxs("button",{onClick:()=>{t({...a,registers:[...a.registers,{name:"",address:0,type:"holding",dataType:"uint16",readable:!0,writable:!1}]})},children:[e.jsx(m,{name:"plus",size:14})," ",s("protocolConfig.addRegister","Add Register")]})]})}function ue({config:a,onChange:i}){const{t}=g();return e.jsxs("div",{className:"nice-protocol-config__section",children:[e.jsx("h3",{children:t("protocolConfig.opcUaConfiguration","OPC-UA Configuration")}),e.jsxs("div",{className:"nice-protocol-config__grid",children:[e.jsxs("div",{className:"nice-protocol-config__field nice-protocol-config__field--full",children:[e.jsx("label",{children:t("protocolConfig.endpointUrl","Endpoint URL")}),e.jsx("input",{type:"text",value:a.endpointUrl,onChange:s=>i({...a,endpointUrl:s.target.value}),placeholder:t("protocolConfig.endpointUrlPlaceholder","opc.tcp://localhost:4840")})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:t("protocolConfig.securityMode","Security Mode")}),e.jsxs("select",{value:a.securityMode,onChange:s=>i({...a,securityMode:s.target.value}),children:[e.jsx("option",{value:"None",children:t("protocolConfig.securityNone","None")}),e.jsx("option",{value:"Sign",children:t("protocolConfig.sign","Sign")}),e.jsx("option",{value:"SignAndEncrypt",children:t("protocolConfig.signAndEncrypt","Sign and Encrypt")})]})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:t("protocolConfig.authentication","Authentication")}),e.jsxs("select",{value:a.authentication,onChange:s=>i({...a,authentication:s.target.value}),children:[e.jsx("option",{value:"anonymous",children:t("protocolConfig.anonymous","Anonymous")}),e.jsx("option",{value:"username",children:t("protocolConfig.usernamePassword","Username/Password")}),e.jsx("option",{value:"certificate",children:t("protocolConfig.certificate","Certificate")})]})]}),a.authentication==="username"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:t("protocolConfig.username","Username")}),e.jsx("input",{type:"text",value:a.username||"",onChange:s=>i({...a,username:s.target.value})})]}),e.jsxs("div",{className:"nice-protocol-config__field",children:[e.jsx("label",{children:t("protocolConfig.password","Password")}),e.jsx("input",{type:"password",value:a.password||"",onChange:s=>i({...a,password:s.target.value})})]})]}),e.jsxs("div",{className:"nice-protocol-config__field nice-protocol-config__field--full",children:[e.jsx("label",{children:t("protocolConfig.applicationName","Application Name")}),e.jsx("input",{type:"text",value:a.applicationName,onChange:s=>i({...a,applicationName:s.target.value})})]})]}),e.jsx("h4",{children:t("protocolConfig.nodes","Nodes")}),e.jsxs("div",{className:"nice-protocol-config__nodes",children:[a.nodes.map((s,l)=>e.jsxs("div",{className:"nice-protocol-config__node-row",children:[e.jsx("input",{type:"text",value:s.nodeId,onChange:r=>{const n=[...a.nodes];n[l]={...n[l],nodeId:r.target.value},i({...a,nodes:n})},placeholder:t("protocolConfig.nodeIdPlaceholder","ns=2;s=Temperature")}),e.jsx("input",{type:"text",value:s.displayName,onChange:r=>{const n=[...a.nodes];n[l]={...n[l],displayName:r.target.value},i({...a,nodes:n})},placeholder:t("protocolConfig.displayNamePlaceholder","Display Name")}),e.jsx("button",{"aria-label":t("protocolConfig.close","Close"),onClick:()=>{const r=a.nodes.filter((n,o)=>o!==l);i({...a,nodes:r})},children:e.jsx(m,{name:"close",size:14})})]},l)),e.jsxs("button",{onClick:()=>{i({...a,nodes:[...a.nodes,{nodeId:"",displayName:"",dataType:"Double",read:!0}]})},children:[e.jsx(m,{name:"plus",size:14})," ",t("protocolConfig.addNode","Add Node")]})]})]})}exports.NiceEdgeManager=re;exports.NiceIoTDashboard=X;exports.NiceProtocolConfig=pe;
|