@frangoteam/fuxa
Version:
Web-based Process Visualization (SCADA/HMI/Dashboard) software
1 lines • 7.51 MB
JavaScript
(self.webpackChunkFUXA=self.webpackChunkFUXA||[]).push([[792],{8326:(Ai,Nt,ce)=>{"use strict";ce.d(Nt,{G:()=>k});var te=ce(5312),V=ce(4438);let k=(()=>{class e{static url=null;static getURL(){if(!this.url)if(te.c.apiEndpoint)this.url=te.c.apiEndpoint;else{location;let p=location.origin.split("/")[2];const m=location.origin.split(":")[0],v=p.split(":")[0];v.length>1&&te.c.apiPort&&(p=v+":"+te.c.apiPort),this.url=m+"://"+p}return this.url}static getRemoteURL(y){return location.origin.split(":")[0]+"://"+y+":"+te.c.apiPort+"/api"}static resolveUrl=y=>{if(!y)return"";try{return new URL(y,window.location.origin).toString()}catch{return y.startsWith("/")?y:"/"+y}};static \u0275fac=function(p){return new(p||e)};static \u0275prov=V.jDH({token:e,factory:e.\u0275fac})}return e})()},3728:(Ai,Nt,ce)=>{"use strict";ce.d(Nt,{Aq:()=>V,yN:()=>k});var te=ce(4438);class V{static _seed=Date.now();static minDate=new Date(1970,0,1);static maxDate=new Date(2100,11,31);static defaultColor=["#FFFFFF","#000000","#EEECE1","#1F497D","#4F81BD","#C0504D","#9BBB59","#8064A2","#4BACC6","#F79646","#C00000","#FF0000","#FFC000","#FFD04A","#FFFF00","#92D050","#0AC97D","#00B050","#00B0F0","#4484EF","#3358C0","#002060","#7030A0","#D8D8D8","#BFBFBF","#A5A5A5","#7F7F7F","#595959","#3F3F3F","#262626"];static lineColor=["#4484ef","#ef0909","#00b050","#ffd04a","#7030a0","#a5a5a5","#c0504d","#000000"];static svgTagToType=["rect","line","path","circle","ellipse","text"];static walkTree(y,p){if(y&&1==y.nodeType){p(y);for(var m=y.childNodes.length;m--;)this.walkTree(y.childNodes.item(m),p)}}static searchTreeStartWith(y,p){if(y.id.startsWith(p))return y;if(null!=y.children){var m,v=null;for(m=0;null==v&&m<y.children.length;m++)v=V.searchTreeStartWith(y.children[m],p);return v}return null}static childrenStartWith(y,p){let m=[];for(let v=0;v<y.children?.length;v++)y.children[v].id.startsWith(p)&&m.push(y.children[v]);return m}static searchTreeTagName(y,p){if(y.tagName===p)return y;if(null!=y.children){var m,v=null;for(m=0;null==v&&m<y.children.length;m++)v=V.searchTreeTagName(y.children[m],p);return v}return null}static findElementByIdRecursive(y,p){if(!y)return null;if(y.id===p)return y;for(let m=0;m<y.children.length;m++){const B=this.findElementByIdRecursive(y.children[m],p);if(B)return B}return null}static searchValuesByAttribute(y,p){const m=[];return function v(B){if(Array.isArray(B))for(const C of B)v(C);else if("object"==typeof B&&null!==B){B.hasOwnProperty(p)&&m.push(B[p]);for(const C in B)v(B[C])}}(y),m}static changeAttributeValue(y,p,m,v){!function B(C){if(Array.isArray(C))for(const x of C)B(x);else if("object"==typeof C&&null!==C){C.hasOwnProperty(p)&&C[p]===m&&(C[p]=v);for(const x in C)B(C[x])}}(y)}static replaceStringInObject(y,p,m){let v=JSON.stringify(y);const B=new RegExp(p,"g");return v=v.replace(B,m),JSON.parse(v)}static getInTreeIdAndType(y){let p=y.getAttribute("type");!p&&V.svgTagToType.includes(y.tagName.toLowerCase())&&(p="svg-ext-shapes-"+y.tagName.toLowerCase());let m=y.getAttribute("id"),v=[];m&&p&&(v=[{id:m,type:p}]);for(var B=0;B<y.children.length;B++){const C=V.getInTreeIdAndType(y.children[B]);v=[...v,...C]}return v}static cleanObject(y){const p={};for(const m in y)null!=y[m]&&(p[m]=y[m]);return p}static isNullOrUndefined(y){return null==y}static enumKeys(y){return Object.keys(y)}static enumValues(y){return Object.keys(y).map(m=>Object(y)[m])}static getGUID(y=""){var m,v,p="";for(m=0;m<16;m++)v=16*Math.random()|0,8==m&&(p+="-"),p+=(12==m?4:16==m?3&v|8:v).toString(16);return y+p}static getShortGUID(y="",p="-"){var v,B,m="";for(v=0;v<12;v++)B=16*Math.random()|0,8==v&&(m+=p),m+=(4==v?4:6==v?3&B|8:B).toString(12);return y+m}static getNextName(y,p){let m=1,v=y+m;for(;p.indexOf(v)>=0;)m++,v=y+m;return v}static isObject(y){return"object"==typeof y&&null!==y}static getType(y){return typeof y}static getTextHeight(y){var m=document.createElement("canvas").getContext("2d");return m.font=y,m.measureText("M").width}static getDomTextHeight(y,p){let m=document.createElement("span");document.body.appendChild(m),m.style.font=p,m.style.fontSize=y+"px",m.style.height="auto",m.style.width="auto",m.style.position="absolute",m.style.whiteSpace="no-wrap",m.innerHTML="M";let v=Math.ceil(m.clientHeight);return document.body.removeChild(m),v}static getEnumKey(y,p){return Object.keys(y).find(m=>y[m]===p)}static isJson(y){try{let p=JSON.parse(y);if(p&&Object.keys(p).length)return!0}catch{}return!1}static isNumeric(y){return!isNaN(parseFloat(y))&&isFinite(y)}static toFiniteNumber(y){if("number"==typeof y)return Number.isFinite(y)?y:null;if("string"!=typeof y)return null;const p=y.trim();if(""===p)return null;const m=Number(p);return Number.isFinite(m)?m:null}static Boolify(y){return-1===[!0,!1,"true","false",1,0].indexOf(y)?null:1==y||"true"==y||1==y}static toNumber(y){const p=V.Boolify(y);return V.isNullOrUndefined(p)?y:Number(p)}static toFloatOrNumber(y){let p=parseFloat(y);return p=V.isNullOrUndefined(p)?Number(y):parseFloat(p.toFixed(5)),p}static formatValue(y,p){try{if(V.isNumeric(y))return numeral(y).format(p)}catch(m){console.error(m)}return y}static arrayToObject=(y,p)=>{y.reduce((m,v)=>(m[v[p]]=v,m),{})};static rand(y,p){return y=y||0,p=p||0,this._seed=(9301*this._seed+49297)%233280,Math.round(y+this._seed/233280*(p-y))}static randNumbers(y,p,m){let v=[];for(let B=0;B<y;++B)v.push(this.rand(p,m));return v}static formatDate(y,p,m){var v=["\0","January","February","March","April","May","June","July","August","September","October","November","December"],B=["\x01","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],C=["\x02","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],x=["\x03","Sun","Mon","Tue","Wed","Thu","Fri","Sat"];let D=(W,K)=>{var le=W+"";for(K=K||2;le.length<K;)le="0"+le;return le};var E=m?y.getUTCFullYear():y.getFullYear();p=(p=(p=p.replace(/(^|[^\\])yyyy+/g,"$1"+E)).replace(/(^|[^\\])yy/g,"$1"+E.toString().substr(2,2))).replace(/(^|[^\\])y/g,"$1"+E);var I=(m?y.getUTCMonth():y.getMonth())+1;p=(p=(p=(p=p.replace(/(^|[^\\])MMMM+/g,"$1"+v[0])).replace(/(^|[^\\])MMM/g,"$1"+B[0])).replace(/(^|[^\\])MM/g,"$1"+D(I))).replace(/(^|[^\\])M/g,"$1"+I);var S=m?y.getUTCDate():y.getDate();p=(p=(p=(p=p.replace(/(^|[^\\])dddd+/g,"$1"+C[0])).replace(/(^|[^\\])ddd/g,"$1"+x[0])).replace(/(^|[^\\])dd/g,"$1"+D(S))).replace(/(^|[^\\])d/g,"$1"+S);var F=m?y.getUTCHours():y.getHours(),u=F>12?F-12:0==F?12:F;p=(p=(p=(p=p.replace(/(^|[^\\])HH+/g,"$1"+D(F))).replace(/(^|[^\\])H/g,"$1"+F)).replace(/(^|[^\\])hh+/g,"$1"+D(u))).replace(/(^|[^\\])h/g,"$1"+u);var P=m?y.getUTCMinutes():y.getMinutes();p=(p=p.replace(/(^|[^\\])mm+/g,"$1"+D(P))).replace(/(^|[^\\])m/g,"$1"+P);var U=m?y.getUTCSeconds():y.getSeconds();p=(p=p.replace(/(^|[^\\])ss+/g,"$1"+D(U))).replace(/(^|[^\\])s/g,"$1"+U);var J=m?y.getUTCMilliseconds():y.getMilliseconds();p=p.replace(/(^|[^\\])fff+/g,"$1"+D(J,3)),J=Math.round(J/10),p=p.replace(/(^|[^\\])ff/g,"$1"+D(J)),J=Math.round(J/10);var q=F<12?"AM":"PM";p=(p=(p=p.replace(/(^|[^\\])f/g,"$1"+J)).replace(/(^|[^\\])TT+/g,"$1"+q)).replace(/(^|[^\\])T/g,"$1"+q.charAt(0));var X=q.toLowerCase();p=(p=p.replace(/(^|[^\\])tt+/g,"$1"+X)).replace(/(^|[^\\])t/g,"$1"+X.charAt(0));var z=-y.getTimezoneOffset(),H=m||!z?"Z":z>0?"+":"-";if(!m){var O=(z=Math.abs(z))%60;H+=D(Math.floor(z/60))+":"+D(O)}p=p.replace(/(^|[^\\])K/g,"$1"+H);var R=(m?y.getUTCDay():y.getDay())+1;return(p=(p=(p=(p=p.replace(new RegExp(C[0],"g"),C[R])).replace(new RegExp(x[0],"g"),x[R])).replace(new RegExp(v[0],"g"),v[I])).replace(new RegExp(B[0],"g"),B[I])).replace(/\\(.)/g,"$1")}static findBitPosition(y){let p=[];for(let m=0;m<32;m++)y&1<<m&&p.push(m);return p}static assign=(y,...p)=>(p.forEach(m=>Object.keys(m).forEach(v=>{y[v]=m[v]})),y);static clone=y=>JSON.parse(JSON.stringify(y));static convertArrayToObject=(y,p)=>y.reduce((m,v)=>({...m,[v]:p}),{});static resizeView=y=>{document.querySelectorAll(y).forEach(p=>{let m=p.parentNode;p.style.transform="scale("+Math.min(m.offsetWidth/p.offsetWidth,m.offsetHeight/p.offsetHeight)+")",p.style.transformOrigin="top left"})};static resizeViewExt=(y,p,m)=>{const v=document.getElementById(p);if(!v)return void console.error(`resizeViewExt -> Parent element with ID '${p}' not found.`);const B=v.getBoundingClientRect(),C=m??"none";v.querySelectorAll(y).forEach(x=>{const D=B?.width/x.offsetWidth,E=B?.height/x.offsetHeight;"contain"===C?x.style.transform="scale("+Math.min(D,E)+")":"stretch"===C?x.style.transform="scale("+D+", "+E+")":"none"===C&&(x.style.transform="scale(1)"),x.style.transformOrigin="top left"})};static resizeViewRev=(y,p,m)=>{function v(x,D,E){const I=D?.width/x.clientWidth,S=D?.height/x.clientHeight;"contain"===E?(x.style.transform="scale("+Math.min(I,S)+")",x.parentElement.style.margin="unset"):"stretch"===E?(x.style.transform="scale("+I+", "+S+")",x.parentElement.style.margin="unset"):"none"===E&&(x.style.transform="scale(1)"),x.style.top="unset",x.style.left="unset",x.style.transformOrigin="top left"}const B="string"==typeof p?document.getElementById(p):p;if(!B)return void console.error(`resizeViewExt -> Parent element with ID '${p}' not found.`);const C=B.getBoundingClientRect();"string"==typeof y?B.querySelectorAll(y).forEach(x=>{v(x,C,m??"none")}):y&&v(y,C,m??"none")};static mergeDeep(...y){const p={};return y.forEach(m=>{m&&Object.keys(m).forEach(v=>{m[v]&&"object"==typeof m[v]&&!Array.isArray(m[v])?p[v]=V.mergeDeep(p[v],m[v]):Array.isArray(m[v])?(Array.isArray(p[v])||(p[v]=[]),p[v]=p[v].concat(m[v])):p[v]=m[v]})}),p}static mergeArray(y,p){const m=new Map;if(y)for(const v of y)if(v)for(const B of v){const C=B[p];C?m.set(C,{...m.get(C),...B}):console.warn(`L'oggetto ${JSON.stringify(B)} non ha la chiave ${p}`)}return Array.from(m.values())}static mergeUniqueBy(y,p,m){if(!(y&&0!==y.length||p&&0!==p.length))return null;const v=y?[...y]:[],B=new Set(v.map(x=>x[m]));let C=!1;return p&&p.forEach(x=>{B.has(x[m])||(v.push(x),B.add(x[m]),C=!0)}),C?v:y??null}static copyToClipboard(y){const p=document.createElement("textarea");p.value=y,p.style.position="fixed",p.style.opacity="0",document.body.appendChild(p),p.select(),document.execCommand("copy"),document.body.removeChild(p)}static millisecondsToTime(y){const p=Math.floor(y/36e5);y%=36e5;const m=Math.floor(y/6e4);return y%=6e4,{hours:p,minutes:m,seconds:Math.floor(y/1e3),milliseconds:y%=1e3}}static timeToString(y,p){function m(B,C){return B.toString().padStart(C,"0")}let v=`${m(y.hours,2)}:${m(y.minutes,2)}`;return p&&(v+=`:${m(y.seconds,2)}`,p>=1e3&&(v+=`.${m(y.milliseconds,3)}`)),v}static millisecondsToTimeString(y,p){return V.timeToString(V.millisecondsToTime(y),p)}static millisecondsToDateString(y,p){const m=new Date(y),v=m.getFullYear(),B=(m.getMonth()+1).toString().padStart(2,"0"),C=m.getDate().toString().padStart(2,"0"),x=m.getHours().toString().padStart(2,"0"),D=m.getMinutes().toString().padStart(2,"0"),E=m.getSeconds().toString().padStart(2,"0"),I=m.getMilliseconds().toString().padStart(3,"0");let S=`${v}-${B}-${C}`;return p>0&&(S+=`T${x}:${D}`,p>1&&(S+=`:${E}`,p>100&&(S+=`.${I}`))),S}static getTimeDifferenceInSeconds(y){const m=Date.now()-y;return Math.floor(m/1e3)}static isValidUrl(y){try{return new URL(y),!0}catch{return!!(y.startsWith("/")||!y.includes("://")&&y.length>0)}}static \u0275fac=function(p){return new(p||V)};static \u0275prov=te.jDH({token:V,factory:V.\u0275fac})}let k=(()=>{class A{transform(p){let m=[];for(var v=Object.keys(p),B=Object.values(p),C=0;C<v.length;C++)m.push({key:v[C],value:B[C]});return m}static \u0275fac=function(m){return new(m||A)};static \u0275pipe=te.EJ8({name:"enumToArray",type:A,pure:!0})}return A})()},6334:(Ai,Nt,ce)=>{"use strict";ce.d(Nt,{K:()=>te});class te{scriptSystemFunctions=[]}},7546:(Ai,Nt,ce)=>{"use strict";ce.d(Nt,{$U:()=>F,$d:()=>W,C_:()=>O,FW:()=>u,JS:()=>D,PK:()=>x,Pl:()=>z,Rs:()=>le,Vl:()=>X,Vz:()=>q,Wb:()=>I,Yp:()=>V,_z:()=>U,bI:()=>E,bq:()=>C,e4:()=>k,eq:()=>Be,f0:()=>Z,hD:()=>y,i5:()=>P,jN:()=>R,kA:()=>J,lE:()=>K,lc:()=>H,n7:()=>B,oO:()=>we,pF:()=>e,q9:()=>ge,qp:()=>S,tk:()=>p,v_:()=>m,vw:()=>A});var te=ce(3728);const V={id:"0",name:"FUXA"},k={id:"@",name:"Placeholder",tags:[{id:"@",name:"@",device:"@"}]};let e=(()=>class Ae{id;name;enabled;property;type;polling;tags;constructor(ae){this.id=ae}static descriptor={id:"Device id, GUID",name:"Device name",enabled:"Enabled",type:"Device Type: FuxaServer | SiemensS7 | OPCUA | BACnet | ModbusRTU | ModbusTCP | WebAPI | MQTTclient | internal | EthernetIP | ADSclient | Gpio | WebCam | MELSEC | REDIS",polling:"Polling interval in millisec., check changed value after ask value, by OPCUA there is a monitor",property:"Connection property depending of type",tags:"Tags list of Tag"};static isWebApiProperty(ae){return ae.type===C.WebAPI&&ae.property.getTags}})(),A=(()=>class Ae{id;name;label;value;type;memaddress;address;divisor;access;options;format;daq;init;scale;scaleReadFunction;scaleReadParams;scaleWriteFunction;scaleWriteParams;sysType;description;unsPath;deadband;direction;edge;constructor(ae){this.id=ae,this.daq=new y(!1,!1,60,!1)}static descriptor={id:"Tag id, GUID",name:"Tag name, is like the id",label:"Tag label, used by BACnet and WebAPI",type:"Tag type, Bool, Byte, etc. depending of device type",memaddress:"Address of Tag, combine with address by Modbus, some property for WebAPI",address:"Tag address, for OPCUA like the id",divisor:"Value divisor, used by Modbus",options:"Options is a string JSON object, used for WebAPI and MQTT, pubs: items to publish | subs: items to subscribe",init:"Init value",daq:{enabled:"Daq enabled storage",interval:"min storage interval (without change value)"},format:"Number of digits to appear after the decimal point",direction:"A string specifying whether the GPIO should be configured as an input or output. The valid values are: 'in', 'out', 'high', and 'low'. If 'out' is specified the GPIO will be configured as an output and the value of the GPIO will be set to 0. 'high' and 'low' are variants of 'out' that configure the GPIO as an output with an initial level of 1 or 0 respectively.",edge:"An optional string specifying the interrupt generating edge or edges for an input GPIO. The valid values are: 'none', 'rising', 'falling' or 'both'. The default value is 'none' indicating that the GPIO will not generate interrupts. Whether or not interrupts are supported by an input GPIO is GPIO specific. If interrupts are not supported by a GPIO the edge argument should not be specified. The edge argument is ignored for output GPIOs."}})();class y{enabled;interval;changed;restored=!1;constructor(Me,ae,_e,ve){this.enabled=Me,this.changed=ae,this.interval=_e,this.restored=ve}}var p=function(Ae){return Ae.absolute="absolute",Ae}(p||{});let m=(()=>class Ae{address;port;slot;rack;slaveid;baudrate;databits;stopbits;parity;options;method;format;connectionOption;delay=10;socketReuse;forceFC16;ascii;octalIO;static descriptor={address:"Device address (IP)"}})();class B{mode;username;password;clientId;grant_type;certificateFileName;privateKeyFileName;caCertificateFileName}var C=function(Ae){return Ae.FuxaServer="FuxaServer",Ae.SiemensS7="SiemensS7",Ae.OPCUA="OPCUA",Ae.BACnet="BACnet",Ae.ModbusRTU="ModbusRTU",Ae.ModbusTCP="ModbusTCP",Ae.WebAPI="WebAPI",Ae.MQTTclient="MQTTclient",Ae.internal="internal",Ae.EthernetIP="EthernetIP",Ae.ODBC="ODBC",Ae.ADSclient="ADSclient",Ae.GPIO="GPIO",Ae.WebCam="WebCam",Ae.MELSEC="MELSEC",Ae.REDIS="REDIS",Ae}(C||{}),x=function(Ae){return Ae.Bool="Bool",Ae.Byte="Byte",Ae.Int="Int",Ae.Word="Word",Ae.DInt="DInt",Ae.DWord="DWord",Ae.Real="Real",Ae}(x||{}),D=function(Ae){return Ae.Bool="Bool",Ae.Int16="Int16",Ae.UInt16="UInt16",Ae.Int32="Int32",Ae.UInt32="UInt32",Ae.Float32="Float32",Ae.Float64="Float64",Ae.Int64="Int64",Ae.Int16LE="Int16LE",Ae.UInt16LE="UInt16LE",Ae.Int32LE="Int32LE",Ae.UInt32LE="UInt32LE",Ae.Float32LE="Float32LE",Ae.Float64LE="Float64LE",Ae.Float64MLE="Float64MLE",Ae.Int64LE="Int64LE",Ae.Float32MLE="Float32MLE",Ae.Int32MLE="Int32MLE",Ae.UInt32MLE="UInt32MLE",Ae}(D||{}),E=function(Ae){return Ae.Boolean="Boolean",Ae.SByte="SByte",Ae.Byte="Byte",Ae.Int16="Int16",Ae.UInt16="UInt16",Ae.Int32="Int32",Ae.UInt32="UInt32",Ae.Int64="Int64",Ae.UInt64="UInt64",Ae.Float="Float",Ae.Double="Double",Ae.String="String",Ae.DateTime="DateTime",Ae.Guid="Guid",Ae.ByteString="ByteString",Ae}(E||{}),I=function(Ae){return Ae.Number="number",Ae.Boolean="boolean",Ae.String="string",Ae}(I||{}),S=function(Ae){return Ae.BOOL="BOOL",Ae.BYTE="BYTE",Ae.WORD="WORD",Ae.INT="INT",Ae.UINT="UINT",Ae.DINT="DINT",Ae.UDINT="UDINT",Ae.REAL="REAL",Ae.STRING="STRING",Ae}(S||{}),F=function(Ae){return Ae.simple="simple",Ae.hash="hash",Ae}(F||{}),u=function(Ae){return Ae.number="number",Ae.boolean="boolean",Ae.string="string",Ae}(u||{});class P{redisTimeoutMs=3e3;maxKeysPerPoll=500;readFields={value:"",quality:"",timestamp:""};customCommand={read:{name:"",batchPerKey:!0,args:["{{key}}","{{fields...}}"]},write:{name:"",args:[]}}}var U=function(Ae){return Ae.SerialPort="SerialPort",Ae.RTUBufferedPort="RTUBufferedPort",Ae.AsciiPort="AsciiPort",Ae.TcpPort="TcpPort",Ae.UdpPort="UdpPort",Ae.TcpRTUBufferedPort="TcpRTUBufferedPort",Ae.TelnetPort="TelnetPort",Ae}(U||{}),J=function(Ae){return Ae.Reuse="Reuse",Ae.ReuseSerial="ReuseSerial",Ae}(J||{}),q=function(Ae){return Ae.in="in",Ae.out="out",Ae.high=" - high",Ae.low=" - low",Ae}(q||{}),X=function(Ae){return Ae.none="none",Ae.rising="rising",Ae.falling="falling",Ae.both="both",Ae}(X||{}),z=function(Ae){return Ae[Ae.INVALID=0]="INVALID",Ae.NONE="1",Ae.SIGN="2",Ae.SIGNANDENCRYPT="3",Ae}(z||{}),H=function(Ae){return Ae.None="None",Ae.Basic128="Basic128",Ae.Basic128Rsa15="Basic128Rsa15",Ae.Basic192="Basic192",Ae.Basic192Rsa15="Basic192Rsa15",Ae.Basic256="Basic256",Ae.Basic256Rsa15="Basic256Rsa15",Ae.Basic256Sha256="Basic256Sha256",Ae.Aes256_Sha256_RsaPss="Aes256_Sha256_RsaPss",Ae.Aes128_Sha256_RsaOaep="Aes128_Sha256_RsaOaep",Ae}(H||{}),Z=function(Ae){return Ae.ANALOG_INPUT="Analog Input",Ae.ANALOG_OUTPUT="Analog Output",Ae.ANALOG_VALUE="Analog Value",Ae.BINARY_INPUT="Binary Input",Ae.BINARY_OUTPUT="Binary Output",Ae.BINARY_VALUE="Binary Value",Ae.CALENDAR="",Ae.COMMAND="",Ae.DEVICE="",Ae}(Z||{});const O="d_",R="t_";let W=(()=>{class Ae{static getDeviceTagText(ae,_e){for(let ve=0;ve<ae.length;ve++)if(ae[ve].tags[_e])return`${ae[ve].name} - ${ae[ve].tags[_e].name}`;return""}static getDeviceFromTagId(ae,_e){for(let ve=0;ve<ae.length;ve++)if(ae[ve].tags[_e])return ae[ve];return null}static getTagFromTagId(ae,_e){for(let ve=0;ve<ae.length;ve++)if(ae[ve].tags[_e])return ae[ve].tags[_e];return null}static getTagFromTagAddress(ae,_e){return Object.values(ae.tags).find(ve=>ve.address===_e)}static columnDelimiter=",";static lineDelimiter="\n";static lineComment="#";static lineDevice="D@";static lineTag="T@";static lineSectionHeader="@";static columnMaske="~";static unmaskCsvValue(ae){return ae.replace(new RegExp(Ae.columnMaske,"g"),Ae.columnDelimiter)}static formatCsvValue(ae){if(null==ae)return"";let _e="";if("function"==typeof ae)return _e=ae.name||"",_e.replace(new RegExp(Ae.columnDelimiter,"g"),Ae.columnMaske);if("object"==typeof ae)try{_e=JSON.stringify(ae)}catch{_e=ae.toString()}else _e=ae.toString();return _e.replace(new RegExp(Ae.columnDelimiter,"g"),Ae.columnMaske)}static isBooleanKey(ae){return"enabled"===ae||ae.endsWith(".enabled")||ae.endsWith(".changed")||ae.endsWith(".restored")||ae.endsWith(".forceFC16")||ae.endsWith(".ascii")||ae.endsWith(".octalIO")}static isNumberKey(ae){return"polling"===ae||"divisor"===ae||"format"===ae||"sysType"===ae||ae.endsWith(".interval")||ae.endsWith(".delay")}static parseCsvValueForKey(ae,_e){const ve=Ae.unmaskCsvValue(_e);if(""===ve)return"";const Le=ve.trim();if((Le.startsWith("{")||Le.startsWith("["))&&te.Aq.isJson(Le))try{return JSON.parse(Le)}catch{}if(Ae.isBooleanKey(ae))return te.Aq.Boolify(ve);if(Ae.isNumberKey(ae)){const ye=parseFloat(ve);return Number.isNaN(ye)?ve:ye}return ve}static getScriptNameByIdMap(ae){const _e={};return ae&&ae.forEach(ve=>{ve?.id&&ve?.name&&(_e[ve.id]=ve.name)}),_e}static getScriptIdByNameMap(ae){const _e={};return ae&&ae.forEach(ve=>{ve?.id&&ve?.name&&(_e[ve.name]=ve.id)}),_e}static resolveScriptName(ae,_e){return ae&&_e?_e[ae]??ae:ae}static resolveScriptId(ae,_e){return ae&&_e?_e[ae]??ae:ae}static setNestedValue(ae,_e,ve){if(!_e.includes("."))return void(ae[_e]=ve);const Le=_e.split(".");let ye=ae;for(let de=0;de<Le.length-1;de++)ye[Le[de]]||(ye[Le[de]]={}),ye=ye[Le[de]];ye[Le[Le.length-1]]=ve}static collectDeviceKeys(ae){const _e=Object.keys(e.descriptor).filter(de=>"tags"!==de&&"property"!==de),ve=new Set,Le=Object.keys(m.descriptor),ye=new Set;return ae.forEach(de=>{de&&(Object.keys(de).forEach(ke=>{"tags"===ke||"property"===ke||_e.includes(ke)||ve.add(ke)}),de.property&&Object.keys(de.property).forEach(ke=>{Le.includes(ke)||ye.add(ke)}))}),{deviceKeys:[..._e,...Array.from(ve).sort()],propertyKeys:[...Le,...Array.from(ye).sort()]}}static collectTagKeys(ae){const _e=Object.keys(A.descriptor).filter(ye=>"daq"!==ye&&"options"!==ye),ve=new Set,Le=new Set;return ae.forEach(ye=>{ye?.tags&&Object.values(ye.tags).forEach(ke=>{ke&&(Object.keys(ke).forEach(je=>{"daq"===je||"options"===je||"value"===je||"timestamp"===je||_e.includes(je)||ve.add(je)}),ke.daq&&Object.keys(ke.daq).forEach(je=>{"enabled"===je||"interval"===je||Le.add(je)}))})}),{tagKeys:[..._e,...Array.from(ve).sort()],daqKeys:["enabled","interval",...Array.from(Le).sort()]}}static parseHeaderKeys(ae){return ae.split(Ae.columnDelimiter).slice(1).filter(ve=>""!==ve)}static mapLineToData(ae,_e){const Le=ae.split(Ae.columnDelimiter).slice(1),ye={};return _e.forEach((de,ke)=>{ke<Le.length&&(ye[de]=Ae.parseCsvValueForKey(de,Le[ke]))}),ye}static devicesToCsv(ae,_e){let ve="";const Le=Ae.getScriptNameByIdMap(_e);let ye=`!! CSV separator property convertion to "~"${Ae.lineDelimiter}`,de=`${Ae.lineSectionHeader}header${Ae.columnDelimiter}`,ke="";const je=Ae.collectDeviceKeys(ae),_t=je.deviceKeys,Rt=je.propertyKeys;_t.forEach(Dt=>{ye+=`${Ae.lineComment}${Dt}${Ae.columnDelimiter}: ${e.descriptor[Dt]||"dynamic device field"}${Ae.lineDelimiter}`,de+=`${Dt}${Ae.columnDelimiter}`}),Rt.forEach(Dt=>{ye+=`${Ae.lineComment}property.${Dt}${Ae.columnDelimiter}: ${m.descriptor[Dt]||"dynamic property field"}${Ae.lineDelimiter}`,de+=`property.${Dt}${Ae.columnDelimiter}`});for(let Dt=0;Dt<ae.length;Dt++)ke+=Ae.device2Line(ae[Dt],_t,Rt),ke+=`${Ae.lineDelimiter}`;ve+=`${ye}${Ae.lineDelimiter}`,ve+=`${de}${Ae.lineDelimiter}${ke}`,ve+=`${Ae.lineDelimiter}`;let ui="",He="",Ee="";const We=Ae.collectTagKeys(ae),Ke=We.tagKeys,Bt=We.daqKeys;ui+=`${Ae.lineComment}deviceId${Ae.columnDelimiter}:Reference to device${Ae.lineDelimiter}`,He+=`${Ae.lineSectionHeader}header${Ae.columnDelimiter}deviceId${Ae.columnDelimiter}`,Ke.forEach(Dt=>{ui+=`${Ae.lineComment}${Dt}${Ae.columnDelimiter}: ${A.descriptor[Dt]||"dynamic tag field"}${Ae.lineDelimiter}`,He+=`${Dt}${Ae.columnDelimiter}`}),ui+=`${Ae.lineComment}options${Ae.columnDelimiter}: ${A.descriptor.options}${Ae.lineDelimiter}`,He+=`options${Ae.columnDelimiter}`,Bt.forEach(Dt=>{ui+=`${Ae.lineComment}daq.${Dt}${Ae.columnDelimiter}: ${A.descriptor?.daq?.[Dt]||"dynamic daq field"}${Ae.lineDelimiter}`,He+=`daq.${Dt}${Ae.columnDelimiter}`});for(let Dt=0;Dt<ae.length;Dt++){if(ae[Dt].tags){const $e=Object.values(ae[Dt].tags);for(let vt=0;vt<$e.length;vt++)Ee+=Ae.tag2Line($e[vt],ae[Dt].id,Ke,Bt,Le),Ee+=`${Ae.lineDelimiter}`}Ee+=`${Ae.lineDelimiter}`}return ve+=`${ui}${Ae.lineDelimiter}`,ve+=`${He}${Ae.lineDelimiter}${Ee}`,ve+=`${Ae.lineDelimiter}`,ve}static csvToDevices(ae,_e){try{const ve=Object.keys(e.descriptor).length+Object.keys(m.descriptor).length,Le=Object.keys(A.descriptor).length+4;let ye={},de=null,ke=null;const je=Ae.getScriptIdByNameMap(_e);return ae.split(Ae.lineDelimiter).forEach(Rt=>{if(Rt&&!Rt.startsWith(Ae.lineComment)){if(Rt.startsWith(Ae.lineSectionHeader)){const ui=Ae.parseHeaderKeys(Rt);return void("deviceId"===ui[0]?ke=ui:de=ui)}if(Rt.startsWith(Ae.lineDevice)){let ui=de?Ae.line2DeviceDynamic(Rt,de):Ae.line2Device(Rt,ve);ye[ui.id]=ui}else if(Rt.startsWith(Ae.lineTag)){let ui=ke?Ae.line2TagDynamic(Rt,ke,je):Ae.line2Tag(Rt,Le);if(!ye[ui.deviceId])throw new Error(`Device don't exist: ${Rt}`);if(ye[ui.deviceId].tags[ui.tag.id])throw new Error(`Tag already exist: ${Rt}`);ye[ui.deviceId].tags[ui.tag.id]=ui.tag}}}),Object.values(ye)}catch(ve){console.error(ve)}return null}static device2Line(ae,_e,ve){let Le=`${Ae.lineDevice}${Ae.columnDelimiter}`;return _e.forEach(ye=>{let de=Ae.formatCsvValue(ae[ye]);Le+=`${de}${Ae.columnDelimiter}`}),ve.forEach(ye=>{const de=ae.property?Ae.formatCsvValue(ae.property[ye]):"";Le+=`${de}${Ae.columnDelimiter}`}),Le}static line2Device(ae,_e){const ve=ae.split(Ae.columnDelimiter);if(ve.length<_e-1)throw new Error(`Format Error ${ve.length}/${_e} ${ae}`);let Le=new e(ve[1]);return Le.name=ve[2].replace(new RegExp(Ae.columnMaske,"g"),Ae.columnDelimiter),Le.enabled="true"===ve[3].toLowerCase(),Le.type=ve[4],Le.polling=parseInt(ve[5])||1e3,Le.property={address:ve[6],port:ve[7],slot:ve[8],rack:ve[9],slaveid:ve[10],baudrate:ve[11],databits:ve[12],stopbits:ve[13],parity:ve[14],options:ve[15],method:ve[16],format:ve[17]},Le.tags={},Le}static line2DeviceDynamic(ae,_e){const ve=Ae.mapLineToData(ae,_e),Le=ve.id;if(!Le)throw new Error(`Device id missing: ${ae}`);let ye=new e(Le),de=!1;return Object.keys(ve).forEach(ke=>{if("id"!==ke){if(ke.startsWith("property.")){ye.property||(ye.property={}),de=!0;const je=ke.substring(9);return void Ae.setNestedValue(ye.property,je,ve[ke])}if("enabled"===ke)return void(ye.enabled=!!te.Aq.Boolify(ve[ke]));if("polling"===ke){const je=parseInt(ve[ke],10);return void(ye.polling=Number.isNaN(je)?1e3:je)}if("type"===ke)return void(ye.type=ve[ke]);ye[ke]=ve[ke]}}),!de&&!ye.property&&(ye.property={}),(null==ye.polling||!ye.polling)&&(ye.polling=1e3),ye.tags={},ye}static tag2Line(ae,_e,ve,Le,ye){let de=`${Ae.lineTag}${Ae.columnDelimiter}${_e}${Ae.columnDelimiter}`;ve.forEach(je=>{let _t=ae[je];("scaleReadFunction"===je||"scaleWriteFunction"===je)&&(_t=Ae.resolveScriptName(_t,ye));let Rt=Ae.formatCsvValue(_t);de+=`${Rt}${Ae.columnDelimiter}`});let ke=Ae.formatCsvValue(ae.options);return de+=`${ke}${Ae.columnDelimiter}`,Le.forEach(je=>{de+=`${Ae.formatCsvValue(ae.daq?ae.daq[je]:"")}${Ae.columnDelimiter}`}),de}static line2Tag(ae,_e){const ve=ae.split(Ae.columnDelimiter);if(ve.length<_e-1)throw new Error(`Format Error: ${ve.length}/${_e} ${ae}`);const Le=ve[1];let ye=new A(ve[2]);return ye.name=ve[3].replace(new RegExp(Ae.columnMaske,"g"),Ae.columnDelimiter),ye.label=ve[4].replace(new RegExp(Ae.columnMaske,"g"),Ae.columnDelimiter),ye.type=ve[5],ye.memaddress=ve[6].replace(new RegExp(Ae.columnMaske,"g"),Ae.columnDelimiter),ye.address=ve[7].replace(new RegExp(Ae.columnMaske,"g"),Ae.columnDelimiter),ye.divisor=parseInt(ve[8])||1,ye.init=ve[9],ye.format=ve[10]?parseInt(ve[10]):null,ye.options=ve[11].replace(new RegExp(Ae.columnMaske,"g"),Ae.columnDelimiter),ye.options&&te.Aq.isJson(ye.options)&&(ye.options=JSON.parse(ye.options)),ye.daq={enabled:!!te.Aq.Boolify(ve[12]),changed:!0,interval:parseInt(ve[13])||60},{tag:ye,deviceId:Le}}static line2TagDynamic(ae,_e,ve){const Le=Ae.mapLineToData(ae,_e),ye=Le.deviceId,de=Le.id;if(!ye||!de)throw new Error(`Tag missing deviceId or id: ${ae}`);let ke=new A(de);return ke.daq=ke.daq||new y(!1,!1,60,!1),Object.keys(Le).forEach(je=>{if("deviceId"!==je&&"id"!==je){if("divisor"===je){const _t=parseInt(Le[je],10);return void(ke.divisor=Number.isNaN(_t)?1:_t)}if("format"===je){const _t=parseInt(Le[je],10);return void(ke.format=Number.isNaN(_t)?null:_t)}if("sysType"===je){const _t=parseInt(Le[je],10);return void(ke.sysType=Number.isNaN(_t)?Le[je]:_t)}if("options"===je)return void(ke.options=Le[je]);if(je.startsWith("daq.")){const _t=je.substring(4);if(ke.daq||(ke.daq={}),"interval"===_t){const Rt=parseInt(Le[je],10);ke.daq.interval=Number.isNaN(Rt)?60:Rt}else ke.daq[_t]="enabled"===_t||"changed"===_t||"restored"===_t?!!te.Aq.Boolify(Le[je]):Le[je];return}if("scaleReadFunction"===je||"scaleWriteFunction"===je)return void(ke[je]=Ae.resolveScriptId(Le[je],ve));ke[je]=Le[je]}}),ke.daq&&void 0===ke.daq.changed&&(ke.daq.changed=!0),{tag:ke,deviceId:ye}}static placeholderToTag(ae,_e){const ve=Ae.getPlaceholderContent(ae);return ve.firstContent?_e?.find(Le=>Le.name===ve.firstContent):null}static getPlaceholderContent(ae){const _e=ae.indexOf("@");if(-1===_e)return{firstContent:null,secondContent:null};const ve=ae.indexOf("@",_e+1);return-1===ve?{firstContent:ae.substring(_e+1).trim(),secondContent:null}:{firstContent:ae.substring(_e+1,ve).trim(),secondContent:ae.substring(ve+1).trim()}}}return Ae})();var K=function(Ae){return Ae.tags="tags",Ae.devices="devices",Ae.list="devices-list",Ae.map="devices-map",Ae}(K||{}),le=function(Ae){return Ae.ok="device.connect-ok",Ae.error="device.connect-error",Ae.failed="device.connect-failed",Ae.off="device.connect-off",Ae.busy="device.connect-busy",Ae}(le||{}),ge=function(Ae){return Ae.number="number",Ae.boolean="boolean",Ae.string="string",Ae}(ge||{}),Be=function(Ae){return Ae.undefined="device.tag-scale-mode-undefined",Ae.linear="device.tag-scale-mode-linear",Ae.convertDateTime="device.tag-convert-datetime",Ae.convertTickTime="device.tag-convert-ticktime",Ae.expression="device.tag-scale-mode-expression",Ae}(Be||{}),we=function(Ae){return Ae[Ae.deviceConnectionStatus=1]="deviceConnectionStatus",Ae}(we||{})},3276:(Ai,Nt,ce)=>{"use strict";ce.d(Nt,{AY:()=>we,Ar:()=>Ee,EV:()=>de,Eh:()=>Le,FV:()=>Mt,FY:()=>z,Fo:()=>E,GF:()=>F,G_:()=>I,Hj:()=>He,J:()=>hi,Jf:()=>_t,Jh:()=>Ve,Ny:()=>vt,OX:()=>B,QQ:()=>y,Q_:()=>si,Qk:()=>ae,Qo:()=>C,Qs:()=>Z,Ss:()=>e,TH:()=>U,Uy:()=>ve,V0:()=>m,Ve:()=>ui,Vq:()=>D,Xp:()=>ge,Y6:()=>Gt,Z4:()=>ye,Z_:()=>x,_O:()=>Be,a2:()=>We,bv:()=>k,c$:()=>Ae,cH:()=>O,cq:()=>Xe,dE:()=>P,e6:()=>Me,f5:()=>J,iz:()=>K,k:()=>v,k4:()=>u,lG:()=>ke,lp:()=>je,mt:()=>It,nA:()=>Rt,nW:()=>gt,oI:()=>p,pT:()=>Se,qR:()=>X,qi:()=>A,rT:()=>Ke,u6:()=>H,uR:()=>S,vo:()=>W,yO:()=>le,yy:()=>_e,zQ:()=>Ie});var te=ce(3378),V=ce(7546);class k{layout=new y;views=[]}class e{id="";name="";profile=new F;items={};variables={};svgcontent="";type;property;constructor(wi,zi,Oi){this.id=wi,this.name=Oi,this.type=zi}}var A=function(Ut){return Ut.svg="svg",Ut.cards="cards",Ut.maps="maps",Ut}(A||{});class y{autoresize=!1;start="";navigation=new p;header=new x;showdev=!0;zoom;inputdialog="false";hidenavigation=!1;theme="";loginonstart=!1;loginoverlaycolor=m.none;show_connection_error=!0;customStyles=""}class p{mode;type;bkcolor="#F4F5F7";fgcolor="#1D1D1D";items;logo=!1;constructor(){this.mode=Object.keys(v).find(wi=>v[wi]===v.over),this.type=Object.keys(B).find(wi=>B[wi]===B.block)}}var m=function(Ut){return Ut.none="none",Ut.black="black",Ut.white="white",Ut}(m||{}),v=function(Ut){return Ut.void="item.navsmode-none",Ut.push="item.navsmode-push",Ut.over="item.navsmode-over",Ut.fix="item.navsmode-fix",Ut}(v||{}),B=function(Ut){return Ut.icon="item.navtype-icons",Ut.text="item.navtype-text",Ut.block="item.navtype-icons-text-block",Ut.inline="item.navtype-icons-text-inline",Ut}(B||{});class C{id;text;link;view;icon;image;permission;permissionRoles;children}class x{title;alarms;infos;bkcolor="#ffffff";fgcolor="#000000";fontFamily;fontSize=13;items;itemsAnchor="left";loginInfo;dateTimeDisplay;language}var D=function(Ut){return Ut.hide="item.notifymode-hide",Ut.fix="item.notifymode-fix",Ut.float="item.notifymode-float",Ut}(D||{}),E=function(Ut){return Ut.disabled="item.zoommode-disabled",Ut.enabled="item.zoommode-enabled",Ut.autoresize="item.zoommode-autoresize",Ut}(E||{}),I=function(Ut){return Ut.false="item.inputmode-disabled",Ut.true="item.inputmode-enabled",Ut.keyboard="item.inputmode-keyboard",Ut.keyboardFullScreen="item.inputmode-keyboard-full-screen",Ut}(I||{}),S=function(Ut){return Ut.true="item.headerbarmode-hide",Ut.false="item.headerbarmode-show",Ut}(S||{});class F{width=1024;height=768;bkcolor="#ffffffff";margin=10;align=u.topCenter;gridType=te.jJ.Fixed;viewRenderDelay=0}var u=function(Ut){return Ut.topCenter="topCenter",Ut.middleCenter="middleCenter",Ut}(u||{});class P{id;type;name="";property=null;label="";hide=!1;lock=!1;constructor(wi,zi){this.id=wi,this.type=zi}}class U{events=[];startLocation;startZoom}class J{variableId;variableValue;bitmask;permission;permissionRoles;ranges;events=[];actions=[];options;readonly;text}var X=function(Ut){return Ut.number="number",Ut.text="text",Ut.date="date",Ut.time="time",Ut.datetime="datetime",Ut.textarea="textarea",Ut.password="password",Ut}(X||{}),z=function(Ut){return Ut.normal="normal",Ut.seconds="seconds",Ut.milliseconds="milliseconds",Ut}(z||{}),H=function(Ut){return Ut.milliseconds="milliseconds",Ut.string="string",Ut}(H||{}),Z=function(Ut){return Ut.update="update",Ut.enter="enter",Ut}(Z||{});class O{type;action;actparam;actoptions={}}var W=function(Ut){return Ut.hide="shapes.action-hide",Ut.show="shapes.action-show",Ut.blink="shapes.action-blink",Ut.color="shapes.action-color",Ut.stop="shapes.action-stop",Ut.clockwise="shapes.action-clockwise",Ut.anticlockwise="shapes.action-anticlockwise",Ut.downup="shapes.action-downup",Ut.rotate="shapes.action-rotate",Ut.move="shapes.action-move",Ut.monitor="shapes.action-monitor",Ut.refreshImage="shapes.action-refreshImage",Ut.start="shapes.action-start",Ut.pause="shapes.action-pause",Ut.reset="shapes.action-reset",Ut}(W||{});class K{variableId;bitmask;range;type;options={}}class le{strokeA=null;strokeB=null;fillA=null;fillB=null;interval=1e3}class ge{minAngle=0;maxAngle=90;delay=0}class Ie{toX=0;toY=0;duration=100}class Be{fill;stroke}class we{variablesValue={};onlyChange=!1;takeValue=!1;actionRef}class Ae{type;timer=null;animr=null;spool;constructor(wi){this.type=wi}}var Me=function(Ut){return Ut.click="shapes.event-click",Ut.dblclick="shapes.event-dblclick",Ut.mousedown="shapes.event-mousedown",Ut.mouseup="shapes.event-mouseup",Ut.mouseover="shapes.event-mouseover",Ut.mouseout="shapes.event-mouseout",Ut.enter="shapes.event-enter",Ut.select="shapes.event-select",Ut.onLoad="shapes.event-onLoad",Ut}(Me||{}),ae=function(Ut){return Ut.onpage="shapes.event-onpage",Ut.onwindow="shapes.event-onwindow",Ut.onOpenTab="shapes.event-onopentab",Ut.ondialog="shapes.event-ondialog",Ut.oniframe="shapes.event-oniframe",Ut.oncard="shapes.event-oncard",Ut.onSetValue="shapes.event-onsetvalue",Ut.onToggleValue="shapes.event-ontogglevalue",Ut.onSetInput="shapes.event-onsetinput",Ut.onclose="shapes.event-onclose",Ut.onRunScript="shapes.event-onrunscript",Ut.onViewToPanel="shapes.event-onViewToPanel",Ut.onMonitor="shapes.event-onmonitor",Ut}(ae||{}),_e=function(Ut){return Ut.onopen="shapes.event-onopen",Ut.onclose="shapes.event-onclose",Ut}(_e||{}),ve=function(Ut){return Ut.onRunScript="shapes.event-onrunscript",Ut}(ve||{}),Le=function(Ut){return Ut.window="window",Ut.mouse="mouse",Ut}(Le||{}),ye=function(Ut){return Ut.set="shapes.event-setvalue-set",Ut.add="shapes.event-setvalue-add",Ut.remove="shapes.event-setvalue-remove",Ut}(ye||{});class de{min;max;text;textId;color;type;style;stroke}var ke=function(Ut){return Ut.none="none",Ut.contain="contain",Ut.stretch="stretch",Ut}(ke||{}),je=function(Ut){return Ut.data="data",Ut.history="history",Ut.alarms="alarms",Ut.alarmsHistory="alarmsHistory",Ut.reports="reports",Ut}(je||{}),_t=function(Ut){return Ut.label="label",Ut.variable="variable",Ut.timestamp="timestamp",Ut.device="device",Ut}(_t||{});class Rt{id;label;variableId;valueFormat;timeInterval;bitmask;type;constructor(wi,zi,Oi){this.id=wi,this.type=zi||_t.label,this.label=Oi}}class ui extends Rt{align=Ee.left;width=100;exname;constructor(wi,zi,Oi){super(wi,zi,Oi)}}class He{cells;constructor(wi){this.cells=wi}}var Ee=function(Ut){return Ut.left="left",Ut.center="center",Ut.right="right",Ut}(Ee||{}),We=function(Ut){return Ut.last1h="table.rangetype-last1h",Ut.last1d="table.rangetype-last1d",Ut.last3d="table.rangetype-last3d",Ut}(We||{});class Ke{id;name;source;value;error;timestamp;device;quality;constructor(wi,zi,Oi){this.id=wi,this.name=zi,this.device=Oi,Oi?.type===V.bq.internal&&(this.value="0")}}class vt{type="";id;ele=null}class Ve{id="";dom;value=null;dbg="";type;ga;variableId}class Mt{gid;from;to;event;sids;chunked}class It{page;tag}var Xe=function(Ut){return Ut.YYYY_MM_DD="1998/03/25",Ut.MM_DD_YYYY="03/25/1998",Ut.DD_MM_YYYY="25/03/1998",Ut.MM_DD_YY="03/25/98",Ut.DD_MM_YY="25/03/98",Ut}(Xe||{}),Se=function(Ut){return Ut.hh_mm_ss="16:58:10",Ut.hh_mm_ss_AA="04:58:10 PM",Ut}(Se||{}),gt=function(Ut){return Ut.view="view",Ut.alarms="alarms",Ut.iframe="iframe",Ut.table="table",Ut}(gt||{}),hi=function(Ut){return Ut.address="[link]",Ut.alarms="[alarms]",Ut}(hi||{});const Gt="rodevice";class si extends J{constructor(){super(),this.options={address:""}}}},1394:(Ai,Nt,ce)=>{"use strict";ce.d(Nt,{AT:()=>te,yq:()=>e});class te{default;options=[]}const e="@"},3367:(Ai,Nt,ce)=>{"use strict";ce.d(Nt,{cu:()=>p,wE:()=>y});var te=ce(7546),V=ce(3276),k=ce(1394),e=ce(3728),A=ce(6334);class y{version="1.01";name;server=new te.pF(e.Aq.getGUID(te.C_));hmi=new V.bv;devices={};charts=[];graphs=[];alarms=[];notifications=[];scripts=[];reports=[];texts=[];languages=new k.AT;plugin=[];mapsLocations=[];clientAccess=new A.K}var p=function(v){return v.SetDevice="set-device",v.DelDevice="del-device",v.SetView="set-view",v.DelView="del-view",v.HmiLayout="layout",v.Charts="charts",v.Graphs="graphs",v.Languages="languages",v.ClientAccess="client-access",v.SetText="set-text",v.DelText="del-text",v.SetAlarm="set-alarm",v.DelAlarm="del-alarm",v.SetNotification="set-notification",v.DelNotification="del-notification",v.SetScript="set-script",v.DelScript="del-script",v.SetReport="set-report",v.DelReport="del-report",v.SetMapsLocation="set-maps-location",v.DelMapsLocation="del-maps-location",v}(p||{})},3955:(Ai,Nt,ce)=>{"use strict";ce.d(Nt,{Bf:()=>A,FB:()=>k,H8:()=>e,Jg:()=>x,N0:()=>v,YA:()=>V,bR:()=>C,bj:()=>B,eF:()=>te,ju:()=>p,od:()=>y});class te{id;name;code;sync=!1;parameters=[];scheduling;permission;permissionRoles;mode=C.SERVER;constructor(E){this.id=E}}class V extends te{test=!0;outputId;constructor(E,I){super(E),this.name=I}}class k{name;type;value;constructor(E,I){this.name=E,this.type=I}}var e=function(D){return D.tagid="tagid",D.value="value",D.chart="chart",D}(e||{});const A="s_",y="params";var p=function(D){return D.interval="interval",D.start="start",D.scheduling="scheduling",D}(p||{});class v{functions=[];constructor(E){this.functions=this.allFunctions.filter(I=>!I.mode||!E||I.mode===E)}allFunctions=[{name:"$setTag",mode:null,text:"script.sys-fnc-settag-text",tooltip:"script.sys-fnc-settag-tooltip",params:[!0,!1]},{name:"$getTag",mode:null,text:"script.sys-fnc-gettag-text",tooltip:"script.sys-fnc-gettag-tooltip",params:[!0]},{name:"$getTagId",mode:null,text:"script.sys-fnc-getTagId-text",tooltip:"script.sys-fnc-getTagId-tooltip",params:[!1],paramsText:"script.sys-fnc-getTagId-params"},{name:"$getTagDaqSettings",mode:null,text:"script.sys-fnc-getTagDaqSettings-text",tooltip:"script.sys-fnc-getTagDaqSettings-tooltip",params:[!0],paramsText:"script.sys-fnc-getTagDaqSettings-params"},{name:"$setTagDaqSettings",mode:null,text:"script.sys-fnc-setTagDaqSettings-text",tooltip:"script.sys-fnc-setTagDaqSettings-tooltip",params:[!0,!1],paramsText:"script.sys-fnc-setTagDaqSettings-params"},{name:"$setView",mode:null,text:"script.sys-fnc-setview-text",tooltip:"script.sys-fnc-setview-tooltip",params:[!1],paramsText:"script.sys-fnc-setview-params"},{name:"$openCard",mode:null,text:"script.sys-fnc-opencard-text",tooltip:"script.sys-fnc-opencard-tooltip",params:[!1],paramsText:"script.sys-fnc-opencard-params"},{name:"$enableDevice",mode:null,text:"script.sys-fnc-enableDevice-text",tooltip:"script.sys-fnc-enableDevice-tooltip",params:[!1,!1],paramsText:"script.sys-fnc-enableDevice-params"},{name:"$getDeviceProperty",mode:null,text:"script.sys-fnc-getDeviceProperty-text",tooltip:"script.sys-fnc-getDeviceProperty-tooltip",params:[!1],paramsText:"script.sys-fnc-getDeviceProperty-params"},{name:"$setDeviceProperty",mode:null,text:"script.sys-fnc-setDeviceProperty-text",tooltip:"script.sys-fnc-setDeviceProperty-tooltip",params:[!1,!1],paramsText:"script.sys-fnc-setDeviceProperty-params"},{name:"$getDevice",mode:C.SERVER,text:"script.sys-fnc-getDevice-text",tooltip:"script.sys-fnc-getDevice-tooltip",params:[!1,!1],paramsText:"script.sys-fnc-getDevice-params"},{name:"$setAdapterToDevice",mode:C.CLIENT,text:"script.sys-fnc-setAdapterToDevice-text",tooltip:"script.sys-fnc-setAdapterToDevice-tooltip",params:[!1,!1],paramsText:"script.sys-fnc-setAdapterToDevice-params"},{name:"$resolveAdapterTagId",mode:C.CLIENT,text:"script.sys-fnc-resolveAdapterTagId-text",tooltip:"script.sys-fnc-resolveAdapterTagId-tooltip",params:[!0],paramsText:"script.sys-fnc-resolveAdapterTagId-params"},{name:"$invokeObject",mode:C.CLIENT,text:"script.sys-fnc-invokeObject-text",tooltip:"script.sys-fnc-invokeObject-tooltip",params:[!1,!1,!1],paramsText:"script.sys-fnc-invokeObject-params"},{name:"$getObject",mode:C.CLIENT,text:"script.sys-fnc-getObject-text",tooltip:"script.sys-fnc-getObject-tooltip",params:[!1],paramsText:"script.sys-fnc-getObject-params"},{name:"$runServerScript",mode:C.CLIENT,text:"script.sys-fnc-runServerScript-text",tooltip:"script.sys-fnc-runServerScript-tooltip",params:[!1,!1],paramsText:"script.sys-fnc-runServerScript-params"},{name:"$getHistoricalTags",mode:null,text:"script.sys-fnc-getHistoricalTag-text",tooltip:"script.sys-fnc-getHistoricalTag-tooltip",params:["array",!1,!1],paramsText:"script.sys-fnc-getHistoricalTag-params",paramFilter:x.history},{name:"$sendMessage",mode:null,text:"script.sys-fnc-sendMessage-text",tooltip:"script.sys-fnc-sendMessage-tooltip",params:[!1,!1,!1],paramsText:"script.sys-fnc-sendMessage-params"},{name:"$getAlarms",mode:null,text:"script.sys-fnc-getAlarms-text",tooltip:"script.sys-fnc-getAlarms-tooltip",params:[],paramsText:"script.sys-fnc-getAlarms-params"},{name:"$getAlarmsHistory",mode:null,text:"script.sys-fnc-getAlarmsHistory-text",tooltip:"script.sys-fnc-getAlarmsHistory-tooltip",params:[!1,!1],paramsText:"script.sys-fnc-getAlarmsHistory-params"},{name:"$ackAlarm",mode:null,text:"script.sys-fnc-ackAlarms-text",tooltip:"script.sys-fnc-ackAlarms-tooltip",params:[!1,!1],paramsText:"script.sys-fnc-ackAlarms-params"}]}class B{functions=[];constructor(E){this.functions=this.allFunctions.filter(I=>!I.mode||!E||I.mode===E)}allFunctions=[{name:"chart-data",mode:null,text:"script.template-chart-data-text",tooltip:"script.template-chart-data-tooltip",code:"// Add script parameter 'paramLines' as Chart lines (array)\nif (paramLines && Array.isArray(paramLines)) {\n const count = 10;\n paramLines.forEach(line => {\n var y = [];\n var x = [];\n for (var i = 0; i < count; i++) {\n const randomNumber = Math.floor(Math.random() * 21);\n y.push(randomNumber);\n x.push(i);\n }\n line['y'] = y;\n line['x'] = x;\n });\n return paramLines;\n} else {\n return 'Missing chart lines';\n}"},{name:"chart-data-touch",mode:null,text:"script.template-chart-data-touch-text",tooltip:"script.template-chart-data-touch-tooltip",code:"// Add script parameters 'paramLines' as Chart lines (array), 'xVal' as X axis touch point, 'yVal' as Y axis touch point\nif (paramLines && Array.isArray(paramLines)) {\n const count = 10;\n paramLines.forEach(line => {\n var y = [];\n var x = [];\n for (var i = 0; i < count; i++) {\n const randomNumber = Math.floor(Math.random() * 21);\n y.push(randomNumber);\n x.push(i);\n }\n \tif (typeof xVal === 'number' && typeof yVal === 'number') {\n \t\tx.push(Math.round(xVal));\n \t\ty.push(Math.round(yVal));\n \t}\n line['y'] = y;\n line['x'] = x;\n });\n return paramLines;\n} else {\n return 'Missing chart lines';\n}"},{name:"invoke-chart-update-options",mode:C.CLIENT,text:"script.template-invoke-chart-update-options-text",tooltip:"script.template-invoke-chart-update-options-tooltip",code:"let opt = $invokeObject('chart_1', 'getOptions');\nif (opt) {\n opt.scaleY1min = 100;\n opt.scaleY1max = 200;\n}\n$invokeObject('chart_1', 'updateOptions', opt);"},{name:"getHistoricalTags",mode:null,text:"script.template-getHistoricalTagsoptions-text",tooltip:"script.template-getHistoricalTagsoptions-tooltip",code:"const to = Date.now();\nvar from = Date.now() - (1000 * 3600); // 1 hour\nvar data = await $getHistoricalTags(['t_a95d5816-9f1e4a67' /* opcua - Byte */], from, to);\nconsole.log(JSON.stringify(data));"}]}var C=function(D){return D.CLIENT="CLIENT",D.SERVER="SERVER",D}(C||{}),x=function(D){return D.history="history",D}(x||{})},8329:(Ai,Nt,ce)=>{"use strict";ce.d(Nt,{$9:()=>te,CT:()=>k,Cr:()=>e,Kb:()=>p,LE:()=>A,SC:()=>v,bO:()=>B,sd:()=>V,sr:()=>y});class te{language="en";uiPort=1881;secureEnabled=!1;secretCode="";tokenExpiresIn="1h";enableRefreshCookieAuth=!1;refreshTokenExpiresIn;secureOnlyEditor=!1;broadcastAll=!1;smtp=new V;daqstore=new k;alarms=new e;logs=new A;logFull=!1;userRole=!1;nodeRedEnabled=!0;nodeRedAuthMode="secure";swaggerEnabled=!1}class V{host="";port=587;mailsender="";username="";password="";constructor(D=null){D&&(this.host=D.host,this.port=D.port,this.mailsender=D.mailsender,this.username=D.username,this.password=D.password)}}class k{type=p.SQlite;varsion;url;host="127.0.0.1";tableName="meters";configurationString="http::addr=localhost:9000;";organization;credentials;bucket;database;retention=v.year1;constructor(D=null){D&&(this.type=D.type,this.url=D.url,this.host=D.host,this.tableName=D.tableName||"meters",this.configurationString=D.configurationString,this.organization=D.organization,this.credentials=D.credentials,this.bucket=D.bucket,this.database=D.database,this.retention=D.retention||v.year1)}isEquals(D){return!(this.type!==D.type||this.bucket!==D.bucket||this.url!==D.url||this.host!==D.host||this.tableName!==D.tableName||this.configurationString!==D.configurationString||this.organization!==D.organization||this.database!==D.database||!this.credentials||!y.isEquals(this.credentials,D.credentials)||this.retention!==D.retention)}}class e{retention=B.year1}class A{retention=v.none}class y{token;username;password;static isEquals(D,E){return D.token===E.token&&D.username===E.username&&D.password===E.password}}var p=function(x){return x.SQlite="SQlite",x.influxDB="influxDB",x.influxDB18="influxDB 1.8",x.TDengine="TDengine",x.questDB="questDB",x}(p||{}),v=function(x){return x.none="none",x.day1="day1",x.days2="days2",x.days3="days3",x.days7="days7",x.days14="days14",x.days30="days30",x.days90="days90",x.year1="year1",x.year3="year3",x.year5="year5",x}(v||{}),B=function(x){return x.none="none",x.days7="days7",x.days30="days30",x.days90="days90",x.year1="year1",x.year3="year3",x.year5="year5",x}(B||{})},8411:(Ai,Nt,ce)=>{"use strict";ce.d(Nt,{KJ:()=>te,Xh:()=>V,yD:()=>k});class te{username;fullname;password;groups;info}class V{id;name;index;description}let k=(()=>class e{static ADMINMASK=[-1,255];static EXTENSION=8;static Groups=[{id:1,label:"Viewer"},{id:2,label:"Operator"},{id:4,label:"Engineer"},{id:8,label:"Supervisor"},{id:16,label:"Manager"},{id:32,label:"F"},{id:64,label:"G"},{id:128,label:"Administrator"}];static GroupsToValue(y,p){let m=0;if(y)for(let B=0;B<y.length;B++)m+=y[B].id;return m<<(p?this.EXTENSION:0)}static ValueToGroups(y,p){let m=[],v=p?this.EXTENSION:0;for(let B=0;B<this.Groups.length;B++)y>>v&this.Groups[B].id&&m.push(this.Groups[B]);return m}static GroupToLabel(y){let p=[];for(let m=0;m<this.Groups.length;m++)y&this.Groups[m].id&&p.push(this.Groups[m].label);return p.join(", ")}})()},4910:(Ai,Nt,ce)=>{"use strict";ce.d(Nt,{d:()=>e});var te=ce(4438),V=ce(5312),k=ce(5174);let e=(()=>{class A{settingsService;onShowModeChanged=new te.bkB;onShowLoading=new te.bkB;static APP_DEMO="demo";static APP_CLIENT="client";showMode;constructor(p){this.settingsService=p}setShowMode(p){return"editor"===p&&this.settingsService.isEditModeLocked()?(this.settingsService.notifyEditorLocked(),this.showMode):(this.showMode=p,this.onShowModeChanged.emit(this.showMode),this.showMode)}lockEditMode(){this.settingsService.lockEditMode()}unlockEditMode(){this.settingsService.unlockEditMode()}showLoading(p){this.onShowLoading.emit(p)}nodeRedEnabled(){return this.settingsService.getSettings()?.nodeRedEnabled}get isDemoApp(){return V.c.type===A.APP_DEMO}get isClientApp(){return V.c.type===A.APP_CLIENT}static \u0275fac=function(m){return new(m||A)(te.KVO(k.h))};static \u0275prov=te.jDH({token:A,factory:A.\u0275fac})}return A})()},4205:(Ai,Nt,ce)=>{"use strict";ce.d(Nt,{u:()=>B});var te=ce(1626),V=ce(4412),k=ce(1985),e=ce(8411),A=ce(5312),y=ce(8326),p=ce(5174),m=ce(3728),v=ce(4438);let B=(()=>{class x{http;settings;currentUser;endPointConfig=y.G.getURL();currentUser$=new V.t(null);useRefreshCookieAuth=!1;constructor(E,I){this.http=E,this.settings=I,this.useRefreshCookieAuth=!!this.settings.getSettings()?.enableRefreshCookieAuth;let S=JSON.parse(sessionStorage.getItem("currentUser"));S&&(this.currentUser=S,!this.useRefreshCookieAuth&&this.isTokenExpired(this.currentUser?.token)&&(this.isGuestUser(this.currentUser)?(this.currentUser.token=null,this.saveUserToken(this.currentUser)):(this.currentUser=null,sessionStorage.removeItem("currentUser")))),this.currentUser$.next(this.currentUser),this.useRefreshCookieAuth&&this.refreshAccessToken(),this.settings.settings$.subscribe(F=>{const u=!!F?.enableRefreshCookieAuth,P=this.useRefreshCookieAuth;this.useRefreshCookieAuth=u,u&&!P&&(this.currentUser&&(this.currentUser.token=null,this.saveUserToken(this.currentUser),this.currentUser$.next(this.currentUser)),this.refreshAccessToken())})}signIn(E,I){return new k.c(S=>{if(A.c.serverEnabled)return new te.Lr({"Content-Type":"application/json"}),this.http.post(this.endPointConfig+"/api/signin",{username:E,password:I}).subscribe(u=>{u&&(this.currentUser=u.data,this.currentUser.inf