mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
3 lines
41 KiB
JavaScript
3 lines
41 KiB
JavaScript
var app=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function s(t){t.forEach(e)}function r(t){return"function"==typeof t}function o(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function l(e,n,s){e.$$.on_destroy.push(function(e,...n){if(null==e)return t;const s=e.subscribe(...n);return s.unsubscribe?()=>s.unsubscribe():s}(n,s))}function a(t,e,n,s){if(t){const r=i(t,e,n,s);return t[0](r)}}function i(t,e,n,s){return t[1]&&s?function(t,e){for(const n in e)t[n]=e[n];return t}(n.ctx.slice(),t[1](s(e))):n.ctx}function c(t,e,n,s){if(t[2]&&s){const r=t[2](s(n));if(void 0===e.dirty)return r;if("object"==typeof r){const t=[],n=Math.max(e.dirty.length,r.length);for(let s=0;s<n;s+=1)t[s]=e.dirty[s]|r[s];return t}return e.dirty|r}return e.dirty}function u(t,e,n,s,r,o){if(r){const l=i(e,n,s,o);t.p(l,r)}}function d(t){if(t.ctx.length>32){const e=[],n=t.ctx.length/32;for(let t=0;t<n;t++)e[t]=-1;return e}return-1}function p(t,e){t.appendChild(e)}function f(t,e,n){t.insertBefore(e,n||null)}function g(t){t.parentNode.removeChild(t)}function m(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function h(t){return document.createElement(t)}function $(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function b(t){return document.createTextNode(t)}function w(){return b(" ")}function y(){return b("")}function v(t,e,n,s){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n,s)}function x(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function _(t){return""===t?null:+t}function k(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function S(t,e){t.value=null==e?"":e}function E(t,e){for(let n=0;n<t.options.length;n+=1){const s=t.options[n];if(s.__value===e)return void(s.selected=!0)}t.selectedIndex=-1}function N(t){const e=t.querySelector(":checked")||t.options[0];return e&&e.__value}let O;function P(t){O=t}function H(){if(!O)throw new Error("Function called outside component initialization");return O}function T(t){H().$$.on_mount.push(t)}function A(t){return H().$$.context.get(t)}const L=[],M=[],C=[],j=[],z=Promise.resolve();let I=!1;function J(){I||(I=!0,z.then(Y))}function R(){return J(),z}function q(t){C.push(t)}function W(t){j.push(t)}let F=!1;const B=new Set;function Y(){if(!F){F=!0;do{for(let t=0;t<L.length;t+=1){const e=L[t];P(e),D(e.$$)}for(P(null),L.length=0;M.length;)M.pop()();for(let t=0;t<C.length;t+=1){const e=C[t];B.has(e)||(B.add(e),e())}C.length=0}while(L.length);for(;j.length;)j.pop()();I=!1,F=!1,B.clear()}}function D(t){if(null!==t.fragment){t.update(),s(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(q)}}const K=new Set;let Z;function Q(){Z={r:0,c:[],p:Z}}function G(){Z.r||s(Z.c),Z=Z.p}function U(t,e){t&&t.i&&(K.delete(t),t.i(e))}function V(t,e,n,s){if(t&&t.o){if(K.has(t))return;K.add(t),Z.c.push((()=>{K.delete(t),s&&(n&&t.d(1),s())})),t.o(e)}}function X(t,e,n){const s=t.$$.props[e];void 0!==s&&(t.$$.bound[s]=n,n(t.$$.ctx[s]))}function tt(t){t&&t.c()}function et(t,n,o,l){const{fragment:a,on_mount:i,on_destroy:c,after_update:u}=t.$$;a&&a.m(n,o),l||q((()=>{const n=i.map(e).filter(r);c?c.push(...n):s(n),t.$$.on_mount=[]})),u.forEach(q)}function nt(t,e){const n=t.$$;null!==n.fragment&&(s(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function st(e,r,o,l,a,i,c,u=[-1]){const d=O;P(e);const p=e.$$={fragment:null,ctx:null,props:i,update:t,not_equal:a,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(r.context||(d?d.$$.context:[])),callbacks:n(),dirty:u,skip_bound:!1,root:r.target||d.$$.root};c&&c(p.root);let f=!1;if(p.ctx=o?o(e,r.props||{},((t,n,...s)=>{const r=s.length?s[0]:n;return p.ctx&&a(p.ctx[t],p.ctx[t]=r)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](r),f&&function(t,e){-1===t.$$.dirty[0]&&(L.push(t),J(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}(e,t)),n})):[],p.update(),f=!0,s(p.before_update),p.fragment=!!l&&l(p.ctx),r.target){if(r.hydrate){const t=function(t){return Array.from(t.childNodes)}(r.target);p.fragment&&p.fragment.l(t),t.forEach(g)}else p.fragment&&p.fragment.c();r.intro&&U(e.$$.fragment),et(e,r.target,r.anchor,r.customElement),Y()}P(d)}class rt{$destroy(){nt(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const ot=[];function lt(e,n=t){let s;const r=new Set;function l(t){if(o(e,t)&&(e=t,s)){const t=!ot.length;for(const t of r)t[1](),ot.push(t,e);if(t){for(let t=0;t<ot.length;t+=2)ot[t][0](ot[t+1]);ot.length=0}}}return{set:l,update:function(t){l(t(e))},subscribe:function(o,a=t){const i=[o,a];return r.add(i),1===r.size&&(s=n(l)||t),o(e),()=>{r.delete(i),0===r.size&&(s(),s=null)}}}}function at(t,e=!1){return(t=t.slice(t.startsWith("/#")?2:0,t.endsWith("/*")?-2:void 0)).startsWith("/")||(t="/"+t),"/"===t&&(t=""),e&&!t.endsWith("/")&&(t+="/"),t}function it(t,e,n){if(""===n)return t;if("/"===n[0])return n;let s=t=>t.split("/").filter((t=>""!==t)),r=s(t);return"/"+(e?s(e):[]).map(((t,e)=>r[e])).join("/")+"/"+n}function ct(t,e,n,s){let r=[e,"data-"+e].reduce(((e,s)=>{let r=t.getAttribute(s);return n&&t.removeAttribute(s),null===r?e:r}),!1);return!s&&""===r||(r||s||!1)}function ut(t){let e=t.split("&").map((t=>t.split("="))).reduce(((t,e)=>{let n=e[0];if(!n)return t;let s=!(e.length>1)||e[e.length-1];return"string"==typeof s&&s.includes(",")&&(s=s.split(",")),void 0===t[n]?t[n]=[s]:t[n].push(s),t}),{});return Object.entries(e).reduce(((t,e)=>(t[e[0]]=e[1].length>1?e[1]:e[1][0],t)),{})}var dt,pt,ft={HISTORY:1,HASH:2,MEMORY:3,OFF:4,run:function(t,e,n,s){return 1===t?e&&e():2===t?n&&n():s&&s()},getDeafault:function(){return window&&"srcdoc"!==window.location.pathname?1:3}},gt=function(){let t,e=ft.getDeafault(),n=n=>t&&t(mt(e));function s(t){t&&(e=t),window.onhashchange=window.onpopstate=pt=null,e!==ft.OFF&&ft.run(e,(t=>window.onpopstate=n),(t=>window.onhashchange=n))&&n()}return{mode:t=>s(t),get:t=>mt(e),go(t,s){(function(t,e,n){let s=t=>history[n?"replaceState":"pushState"]({},"",t);ft.run(t,(t=>s(e)),(t=>s(`#${e}`)),(t=>pt=e))})(e,t,s),n()},start(e){t=e,s()},stop(){t=null,s(ft.OFF)}}}();function mt(t){let e=dt,n=dt=ft.run(t,(t=>window.location.pathname+window.location.search),(t=>String(window.location.hash.slice(1)||"/")),(t=>pt||"/")),s=n.match(/^([^?#]+)(?:\?([^#]+))?(?:\#(.+))?$/);return{url:n,from:e,path:s[1]||"",query:ut(s[2]||""),hash:s[3]||""}}function ht(t){let e=A("tinro");e&&(e.exact||e.fallback)&&function(t){throw new Error("[Tinro] "+t)}(`${t.fallback?"<Route fallback>":`<Route path="${t.path}">`} can't be inside ${e.fallback?"<Route fallback>":`<Route path="${e.path||"/"}"> with exact path`}`);let n=t.fallback?"fallbacks":"childs",s=lt({}),r={router:{},exact:!1,pattern:null,meta:{},parent:e,fallback:t.fallback,redirect:!1,firstmatch:!1,breadcrumb:null,matched:!1,childs:new Set,activeChilds:new Set,fallbacks:new Set,update(t){r.exact=!t.path.endsWith("/*"),r.pattern=at(`${r.parent&&r.parent.pattern||""}${t.path}`),r.redirect=t.redirect,r.firstmatch=t.firstmatch,r.breadcrumb=t.breadcrumb,r.match()},register:()=>{if(r.parent)return r.parent[n].add(r),()=>{r.parent[n].delete(r),r.router.un&&r.router.un()}},show:()=>{t.onShow(),!r.fallback&&r.parent&&r.parent.activeChilds.add(r)},hide:()=>{t.onHide(),!r.fallback&&r.parent&&r.parent.activeChilds.delete(r)},match:async()=>{r.matched=!1;let{path:e,url:n,from:o,query:l}=r.router,a=function(t,e){t=at(t,!0),e=at(e,!0);let n=[],s={},r=!0,o=t.split("/").map((t=>t.startsWith(":")?(n.push(t.slice(1)),"([^\\/]+)"):t)).join("\\/"),l=e.match(new RegExp(`^${o}$`));return l||(r=!1,l=e.match(new RegExp(`^${o}`))),l?(n.forEach(((t,e)=>s[t]=l[e+1])),{exact:r,params:s,part:l[0].slice(0,-1)}):null}(r.pattern,e);if(!r.fallback&&a&&r.redirect&&(!r.exact||r.exact&&a.exact)){await R();let t=it(e,r.parent&&r.parent.pattern,r.redirect);return bt.goto(t,!0)}if(r.meta=a&&{from:o,url:n,query:l,match:a.part,pattern:r.pattern,breadcrumbs:r.parent&&r.parent.meta&&r.parent.meta.breadcrumbs.slice()||[],params:a.params,subscribe:s.subscribe},r.breadcrumb&&r.meta&&r.meta.breadcrumbs.push({name:r.breadcrumb,path:a.part}),s.set(r.meta),!a||r.fallback||!(!r.exact||r.exact&&a.exact)||r.parent&&r.parent.firstmatch&&r.parent.matched?r.hide():(t.onMeta(r.meta),r.parent&&(r.parent.matched=!0),r.show()),await R(),a&&!r.fallback&&(r.childs.size>0&&0==r.activeChilds.size||0==r.childs.size&&r.fallbacks.size>0)){let t=r;for(;0==t.fallbacks.size;)if(t=t.parent,!t)return;t&&t.fallbacks.forEach((t=>{if(t.redirect){let e=it("/",t.parent&&t.parent.pattern,t.redirect);bt.goto(e,!0)}else t.show()}))}}};return o="tinro",l=r,H().$$.context.set(o,l),T((()=>r.register())),r.router.un=bt.subscribe((t=>{r.router.path=t.path,r.router.url=t.url,r.router.query=t.query,r.router.from=t.from,null!==r.pattern&&r.match()})),r;var o,l}function $t(){return A("tinro").meta}var bt=function(){let{subscribe:t}=lt(gt.get(),(t=>{gt.start(t);let e=function(t){let e=e=>{let n=e.target.closest("a[href]"),s=n&&ct(n,"target",!1,"_self"),r=n&&ct(n,"tinro-ignore"),o=e.ctrlKey||e.metaKey||e.altKey||e.shiftKey;if("_self"==s&&!r&&!o&&n){let s=n.getAttribute("href").replace(/^\/#/,"");/^\/\/|^[a-zA-Z]+:/.test(s)||(e.preventDefault(),t(s.startsWith("/")?s:n.href.replace(window.location.origin,"")))}};return addEventListener("click",e),()=>removeEventListener("click",e)}(gt.go);return()=>{gt.stop(),e()}}));return{subscribe:t,goto:gt.go,params:wt,meta:$t,useHashNavigation:t=>gt.mode(t?ft.HASH:ft.HISTORY),mode:{hash:()=>gt.mode(ft.HASH),history:()=>gt.mode(ft.HISTORY),memory:()=>gt.mode(ft.MEMORY)}}}();function wt(){return A("tinro").meta.params}const yt=t=>({params:2&t,meta:4&t}),vt=t=>({params:t[1],meta:t[2]});function xt(t){let e;const n=t[9].default,s=a(n,t,t[8],vt);return{c(){s&&s.c()},m(t,n){s&&s.m(t,n),e=!0},p(t,r){s&&s.p&&(!e||262&r)&&u(s,n,t,t[8],e?c(n,t[8],r,yt):d(t[8]),vt)},i(t){e||(U(s,t),e=!0)},o(t){V(s,t),e=!1},d(t){s&&s.d(t)}}}function _t(t){let e,n,s=t[0]&&xt(t);return{c(){s&&s.c(),e=y()},m(t,r){s&&s.m(t,r),f(t,e,r),n=!0},p(t,[n]){t[0]?s?(s.p(t,n),1&n&&U(s,1)):(s=xt(t),s.c(),U(s,1),s.m(e.parentNode,e)):s&&(Q(),V(s,1,1,(()=>{s=null})),G())},i(t){n||(U(s),n=!0)},o(t){V(s),n=!1},d(t){s&&s.d(t),t&&g(e)}}}function kt(t,e,n){let{$$slots:s={},$$scope:r}=e,{path:o="/*"}=e,{fallback:l=!1}=e,{redirect:a=!1}=e,{firstmatch:i=!1}=e,{breadcrumb:c=null}=e,u=!1,d={},p={};const f=ht({fallback:l,onShow(){n(0,u=!0)},onHide(){n(0,u=!1)},onMeta(t){n(2,p=t),n(1,d=p.params)}});return t.$$set=t=>{"path"in t&&n(3,o=t.path),"fallback"in t&&n(4,l=t.fallback),"redirect"in t&&n(5,a=t.redirect),"firstmatch"in t&&n(6,i=t.firstmatch),"breadcrumb"in t&&n(7,c=t.breadcrumb),"$$scope"in t&&n(8,r=t.$$scope)},t.$$.update=()=>{232&t.$$.dirty&&f.update({path:o,redirect:a,firstmatch:i,breadcrumb:c})},[u,d,p,o,l,a,i,c,r,s]}class St extends rt{constructor(t){super(),st(this,t,kt,_t,o,{path:3,fallback:4,redirect:5,firstmatch:6,breadcrumb:7})}}function Et(t){let e,n,s,r,o;const l=t[2].default,i=a(l,t,t[1],null);return{c(){e=h("div"),n=h("h1"),s=b(t[0]),r=w(),i&&i.c(),x(n,"class","card-header"),x(e,"class","card")},m(t,l){f(t,e,l),p(e,n),p(n,s),p(e,r),i&&i.m(e,null),o=!0},p(t,[e]){(!o||1&e)&&k(s,t[0]),i&&i.p&&(!o||2&e)&&u(i,l,t,t[1],o?c(l,t[1],e,null):d(t[1]),null)},i(t){o||(U(i,t),o=!0)},o(t){V(i,t),o=!1},d(t){t&&g(e),i&&i.d(t)}}}function Nt(t,e,n){let{$$slots:s={},$$scope:r}=e,{title:o}=e;return t.$$set=t=>{"title"in t&&n(0,o=t.title),"$$scope"in t&&n(1,r=t.$$scope)},[o,r,s]}class Ot extends rt{constructor(t){super(),st(this,t,Nt,Et,o,{title:0})}}function Pt(t){let e,n,r,o;return{c(){e=h("input"),x(e,"class",n=1==t[0].send?"widget-input border-red-500":"widget-input focus:border-indigo-500"),x(e,"step","0.1"),x(e,"type","number")},m(n,s){f(n,e,s),S(e,t[0].status),r||(o=[v(e,"change",t[2]),v(e,"input",t[3])],r=!0)},p(t,s){1&s&&n!==(n=1==t[0].send?"widget-input border-red-500":"widget-input focus:border-indigo-500")&&x(e,"class",n),1&s&&_(e.value)!==t[0].status&&S(e,t[0].status)},d(t){t&&g(e),r=!1,s(o)}}}function Ht(t){let e,n,r,o;return{c(){e=h("input"),x(e,"class",n=1==t[0].send?"widget-input border-red-500":"widget-input focus:border-indigo-500"),x(e,"type","text")},m(n,s){f(n,e,s),S(e,t[0].status),r||(o=[v(e,"change",t[4]),v(e,"input",t[5])],r=!0)},p(t,s){1&s&&n!==(n=1==t[0].send?"widget-input border-red-500":"widget-input focus:border-indigo-500")&&x(e,"class",n),1&s&&e.value!==t[0].status&&S(e,t[0].status)},d(t){t&&g(e),r=!1,s(o)}}}function Tt(t){let e,n,r,o;return{c(){e=h("input"),x(e,"class",n=1==t[0].send?"widget-input border-red-500":"widget-input focus:border-indigo-500"),x(e,"type","date")},m(n,s){f(n,e,s),S(e,t[0].status),r||(o=[v(e,"change",t[6]),v(e,"input",t[7])],r=!0)},p(t,s){1&s&&n!==(n=1==t[0].send?"widget-input border-red-500":"widget-input focus:border-indigo-500")&&x(e,"class",n),1&s&&S(e,t[0].status)},d(t){t&&g(e),r=!1,s(o)}}}function At(t){let e,n,r,o;return{c(){e=h("input"),x(e,"class",n=1==t[0].send?"widget-input border-red-500":"widget-input focus:border-indigo-500"),x(e,"type","time")},m(n,s){f(n,e,s),S(e,t[0].status),r||(o=[v(e,"change",t[8]),v(e,"input",t[9])],r=!0)},p(t,s){1&s&&n!==(n=1==t[0].send?"widget-input border-red-500":"widget-input focus:border-indigo-500")&&x(e,"class",n),1&s&&S(e,t[0].status)},d(t){t&&g(e),r=!1,s(o)}}}function Lt(e){let n,s,r,o,l,a,i,c,u,d=(e[0].descr?e[0].descr:"")+"",m="number"==e[0].type&&Pt(e),$="text"==e[0].type&&Ht(e),y="date"==e[0].type&&Tt(e),v="time"==e[0].type&&At(e);return{c(){n=h("div"),s=h("div"),r=h("label"),o=b(d),l=w(),a=h("div"),m&&m.c(),i=w(),$&&$.c(),c=w(),y&&y.c(),u=w(),v&&v.c(),x(r,"class","widget-descr-style"),x(s,"class","widget-descr-width"),x(a,"class","widget-width"),x(n,"class","card-items-psn")},m(t,e){f(t,n,e),p(n,s),p(s,r),p(r,o),p(n,l),p(n,a),m&&m.m(a,null),p(a,i),$&&$.m(a,null),p(a,c),y&&y.m(a,null),p(a,u),v&&v.m(a,null)},p(t,[e]){1&e&&d!==(d=(t[0].descr?t[0].descr:"")+"")&&k(o,d),"number"==t[0].type?m?m.p(t,e):(m=Pt(t),m.c(),m.m(a,i)):m&&(m.d(1),m=null),"text"==t[0].type?$?$.p(t,e):($=Ht(t),$.c(),$.m(a,c)):$&&($.d(1),$=null),"date"==t[0].type?y?y.p(t,e):(y=Tt(t),y.c(),y.m(a,u)):y&&(y.d(1),y=null),"time"==t[0].type?v?v.p(t,e):(v=At(t),v.c(),v.m(a,null)):v&&(v.d(1),v=null)},i:t,o:t,d(t){t&&g(n),m&&m.d(),$&&$.d(),y&&y.d(),v&&v.d()}}}function Mt(t,e,n){let{widget:s}=e,{wsPushProp:r=((t,e,n)=>{})}=e;return t.$$set=t=>{"widget"in t&&n(0,s=t.widget),"wsPushProp"in t&&n(1,r=t.wsPushProp)},[s,r,()=>(n(0,s.send=!0,s),r(s.ws,s.topic,s.status)),function(){s.status=_(this.value),n(0,s)},()=>(n(0,s.send=!0,s),r(s.ws,s.topic,s.status)),function(){s.status=this.value,n(0,s)},()=>(n(0,s.send=!0,s),r(s.ws,s.topic,s.status)),function(){s.status=this.value,n(0,s)},()=>(n(0,s.send=!0,s),r(s.ws,s.topic,s.status)),function(){s.status=this.value,n(0,s)}]}class Ct extends rt{constructor(t){super(),st(this,t,Mt,Lt,o,{widget:0,wsPushProp:1})}}function jt(e){let n,r,o,l,a,i,c,u,d,m,$,y,_,E,N,O,P,H,T=(e[0].descr?e[0].descr:"")+"";return{c(){n=h("div"),r=h("div"),o=h("label"),l=b(T),a=w(),i=h("div"),c=h("label"),u=h("div"),d=h("input"),$=w(),y=h("div"),_=w(),E=h("div"),x(o,"class","widget-descr-style"),x(r,"class","widget-descr-width"),x(d,"id",m=e[0].topic),x(d,"type","checkbox"),x(d,"class","sr-only"),x(y,"class","block bg-gray-600 w-10 h-6 rounded-full"),x(E,"class",N="dot "+(1==e[0].send?"bg-red-400":"bg-white")+" absolute left-1 top-1 w-4 h-4 rounded-full transition"),x(u,"class","relative"),x(c,"for",O=e[0].topic),x(c,"class","items-center cursor-pointer"),x(i,"class","widget-width"),x(n,"class","card-items-psn")},m(t,s){f(t,n,s),p(n,r),p(r,o),p(o,l),p(n,a),p(n,i),p(i,c),p(c,u),p(u,d),S(d,e[0].status),p(u,$),p(u,y),p(u,_),p(u,E),P||(H=[v(d,"change",e[2]),v(d,"change",e[3])],P=!0)},p(t,[e]){1&e&&T!==(T=(t[0].descr?t[0].descr:"")+"")&&k(l,T),1&e&&m!==(m=t[0].topic)&&x(d,"id",m),1&e&&S(d,t[0].status),1&e&&N!==(N="dot "+(1==t[0].send?"bg-red-400":"bg-white")+" absolute left-1 top-1 w-4 h-4 rounded-full transition")&&x(E,"class",N),1&e&&O!==(O=t[0].topic)&&x(c,"for",O)},i:t,o:t,d(t){t&&g(n),P=!1,s(H)}}}function zt(t,e,n){let{widget:s}=e,{wsPushProp:r=((t,e,n)=>{})}=e;return t.$$set=t=>{"widget"in t&&n(0,s=t.widget),"wsPushProp"in t&&n(1,r=t.wsPushProp)},[s,r,()=>(n(0,s.send=!0,s),r(s.ws,s.topic,s.status)),function(){s.status=this.value,n(0,s)}]}class It extends rt{constructor(t){super(),st(this,t,zt,jt,o,{widget:0,wsPushProp:1})}}function Jt(e){let n,s,r,o,l,a,i,c,u,d,m,$,y=(e[0].descr?e[0].descr:"")+"",v=(e[0].status?e[0].status:"")+"",_=(e[0].after?e[0].after:"")+"";return{c(){n=h("div"),s=h("div"),r=h("label"),o=b(y),l=w(),a=h("div"),i=h("label"),c=b(v),u=w(),d=h("label"),m=b(" "),$=b(_),x(r,"class","widget-descr-style"),x(s,"class","widget-descr-width"),x(i,"class","widget-anydata-style"),x(d,"class","widget-anydata-style"),x(a,"class","widget-width"),x(n,"class","card-items-psn")},m(t,e){f(t,n,e),p(n,s),p(s,r),p(r,o),p(n,l),p(n,a),p(a,i),p(i,c),p(a,u),p(a,d),p(d,m),p(d,$)},p(t,[e]){1&e&&y!==(y=(t[0].descr?t[0].descr:"")+"")&&k(o,y),1&e&&v!==(v=(t[0].status?t[0].status:"")+"")&&k(c,v),1&e&&_!==(_=(t[0].after?t[0].after:"")+"")&&k($,_)},i:t,o:t,d(t){t&&g(n)}}}function Rt(t,e,n){let{widget:s}=e;return t.$$set=t=>{"widget"in t&&n(0,s=t.widget)},[s]}class qt extends rt{constructor(t){super(),st(this,t,Rt,Jt,o,{widget:0})}}function Wt(t,e,n){const s=t.slice();return s[54]=e[n],s}function Ft(t,e,n){const s=t.slice();return s[57]=e[n],s[59]=n,s}function Bt(t,e,n){const s=t.slice();return s[60]=e[n],s[61]=e,s[62]=n,s}function Yt(t,e,n){const s=t.slice();return s[54]=e[n],s}function Dt(t,e,n){const s=t.slice();return s[65]=e[n],s[59]=n,s}function Kt(t,e,n){const s=t.slice();return s[67]=e[n],s[68]=e,s[59]=n,s}function Zt(t,e,n){const s=t.slice();return s[54]=e[n],s}function Qt(t){let e,n,s,r,o=t[54].name+"";return{c(){e=h("option"),n=b(o),s=w(),e.__value=r=t[54],e.value=e.__value},m(t,r){f(t,e,r),p(e,n),p(e,s)},p(t,s){64&s[0]&&o!==(o=t[54].name+"")&&k(n,o),64&s[0]&&r!==(r=t[54])&&(e.__value=r,e.value=e.__value)},d(t){t&&g(e)}}}function Gt(t){let e,n,s,r,o="input"===t[67].widget&&Ut(t),l="toggle"===t[67].widget&&Vt(t),a="anydata"===t[67].widget&&Xt(t);return{c(){o&&o.c(),e=w(),l&&l.c(),n=w(),a&&a.c(),s=y()},m(t,i){o&&o.m(t,i),f(t,e,i),l&&l.m(t,i),f(t,n,i),a&&a.m(t,i),f(t,s,i),r=!0},p(t,r){"input"===t[67].widget?o?(o.p(t,r),2&r[0]&&U(o,1)):(o=Ut(t),o.c(),U(o,1),o.m(e.parentNode,e)):o&&(Q(),V(o,1,1,(()=>{o=null})),G()),"toggle"===t[67].widget?l?(l.p(t,r),2&r[0]&&U(l,1)):(l=Vt(t),l.c(),U(l,1),l.m(n.parentNode,n)):l&&(Q(),V(l,1,1,(()=>{l=null})),G()),"anydata"===t[67].widget?a?(a.p(t,r),2&r[0]&&U(a,1)):(a=Xt(t),a.c(),U(a,1),a.m(s.parentNode,s)):a&&(Q(),V(a,1,1,(()=>{a=null})),G())},i(t){r||(U(o),U(l),U(a),r=!0)},o(t){V(o),V(l),V(a),r=!1},d(t){o&&o.d(t),t&&g(e),l&&l.d(t),t&&g(n),a&&a.d(t),t&&g(s)}}}function Ut(t){let e,n,s;function r(e){t[18](e,t[67])}let o={widget:t[67],wsPushProp:t[17]};return void 0!==t[67].status&&(o.value=t[67].status),e=new Ct({props:o}),M.push((()=>X(e,"value",r))),{c(){tt(e.$$.fragment)},m(t,n){et(e,t,n),s=!0},p(s,r){t=s;const o={};2&r[0]&&(o.widget=t[67]),!n&&2&r[0]&&(n=!0,o.value=t[67].status,W((()=>n=!1))),e.$set(o)},i(t){s||(U(e.$$.fragment,t),s=!0)},o(t){V(e.$$.fragment,t),s=!1},d(t){nt(e,t)}}}function Vt(t){let e,n,s;function r(e){t[20](e,t[67])}let o={widget:t[67],wsPushProp:t[19]};return void 0!==t[67].status&&(o.value=t[67].status),e=new It({props:o}),M.push((()=>X(e,"value",r))),{c(){tt(e.$$.fragment)},m(t,n){et(e,t,n),s=!0},p(s,r){t=s;const o={};2&r[0]&&(o.widget=t[67]),!n&&2&r[0]&&(n=!0,o.value=t[67].status,W((()=>n=!1))),e.$set(o)},i(t){s||(U(e.$$.fragment,t),s=!0)},o(t){V(e.$$.fragment,t),s=!1},d(t){nt(e,t)}}}function Xt(t){let e,n,s;function r(e){t[21](e,t[67])}let o={widget:t[67]};return void 0!==t[67].status&&(o.value=t[67].status),e=new qt({props:o}),M.push((()=>X(e,"value",r))),{c(){tt(e.$$.fragment)},m(t,n){et(e,t,n),s=!0},p(s,r){t=s;const o={};2&r[0]&&(o.widget=t[67]),!n&&2&r[0]&&(n=!0,o.value=t[67].status,W((()=>n=!1))),e.$set(o)},i(t){s||(U(e.$$.fragment,t),s=!0)},o(t){V(e.$$.fragment,t),s=!1},d(t){nt(e,t)}}}function te(t){let e,n,s=t[67].page===t[65].page&&Gt(t);return{c(){s&&s.c(),e=y()},m(t,r){s&&s.m(t,r),f(t,e,r),n=!0},p(t,n){t[67].page===t[65].page?s?(s.p(t,n),6&n[0]&&U(s,1)):(s=Gt(t),s.c(),U(s,1),s.m(e.parentNode,e)):s&&(Q(),V(s,1,1,(()=>{s=null})),G())},i(t){n||(U(s),n=!0)},o(t){V(s),n=!1},d(t){s&&s.d(t),t&&g(e)}}}function ee(t){let e,n,s=t[1],r=[];for(let e=0;e<s.length;e+=1)r[e]=te(Kt(t,s,e));const o=t=>V(r[t],1,1,(()=>{r[t]=null}));return{c(){for(let t=0;t<r.length;t+=1)r[t].c();e=y()},m(t,s){for(let e=0;e<r.length;e+=1)r[e].m(t,s);f(t,e,s),n=!0},p(t,n){if(518&n[0]){let l;for(s=t[1],l=0;l<s.length;l+=1){const o=Kt(t,s,l);r[l]?(r[l].p(o,n),U(r[l],1)):(r[l]=te(o),r[l].c(),U(r[l],1),r[l].m(e.parentNode,e))}for(Q(),l=s.length;l<r.length;l+=1)o(l);G()}},i(t){if(!n){for(let t=0;t<s.length;t+=1)U(r[t]);n=!0}},o(t){r=r.filter(Boolean);for(let t=0;t<r.length;t+=1)V(r[t]);n=!1},d(t){m(r,t),t&&g(e)}}}function ne(t){let e,n;return e=new Ot({props:{title:t[65].page,$$slots:{default:[ee]},$$scope:{ctx:t}}}),{c(){tt(e.$$.fragment)},m(t,s){et(e,t,s),n=!0},p(t,n){const s={};4&n[0]&&(s.title=t[65].page),6&n[0]|512&n[2]&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){n||(U(e.$$.fragment,t),n=!0)},o(t){V(e.$$.fragment,t),n=!1},d(t){nt(e,t)}}}function se(t){let e,n,s,r;return{c(){e=h("textarea"),x(e,"rows","10"),x(e,"class","json-input w-full"),x(e,"id","text1"),e.value=n=t[13](JSON.stringify(t[1]))},m(n,o){f(n,e,o),s||(r=v(e,"input",t[10]),s=!0)},p(t,s){2&s[0]&&n!==(n=t[13](JSON.stringify(t[1])))&&(e.value=n)},d(t){t&&g(e),s=!1,r()}}}function re(t){let e,n,s,r,o=t[2],l=[];for(let e=0;e<o.length;e+=1)l[e]=ne(Dt(t,o,e));const a=t=>V(l[t],1,1,(()=>{l[t]=null}));return s=new Ot({props:{title:"Редактор JSON",$$slots:{default:[se]},$$scope:{ctx:t}}}),{c(){e=h("div");for(let t=0;t<l.length;t+=1)l[t].c();n=w(),tt(s.$$.fragment),x(e,"class","cards-grid")},m(t,o){f(t,e,o);for(let t=0;t<l.length;t+=1)l[t].m(e,null);p(e,n),et(s,e,null),r=!0},p(t,r){if(518&r[0]){let s;for(o=t[2],s=0;s<o.length;s+=1){const a=Dt(t,o,s);l[s]?(l[s].p(a,r),U(l[s],1)):(l[s]=ne(a),l[s].c(),U(l[s],1),l[s].m(e,n))}for(Q(),s=o.length;s<l.length;s+=1)a(s);G()}const i={};2&r[0]|512&r[2]&&(i.$$scope={dirty:r,ctx:t}),s.$set(i)},i(t){if(!r){for(let t=0;t<o.length;t+=1)U(l[t]);U(s.$$.fragment,t),r=!0}},o(t){l=l.filter(Boolean);for(let t=0;t<l.length;t+=1)V(l[t]);V(s.$$.fragment,t),r=!1},d(t){t&&g(e),m(l,t),nt(s)}}}function oe(t){let e,n,s,r,o=t[54].name+"";return{c(){e=h("option"),n=b(o),s=w(),e.__value=r=t[54],e.value=e.__value},m(t,r){f(t,e,r),p(e,n),p(e,s)},p(t,s){64&s[0]&&o!==(o=t[54].name+"")&&k(n,o),64&s[0]&&r!==(r=t[54])&&(e.__value=r,e.value=e.__value)},d(t){t&&g(e)}}}function le(t){let e,n,r,o,l,a,i,c,u,d,$,y,_,N,O,P,H,T,A,L,M,C,j,z,I,J=t[60].type+"";function R(){t[22].call(a,t[61],t[62])}function W(){t[23].call(u,t[61],t[62])}let F=t[6],B=[];for(let e=0;e<F.length;e+=1)B[e]=oe(Yt(t,F,e));function Y(){t[25].call(O,t[61],t[62])}function D(){t[26].call(T,t[61],t[62])}return{c(){e=h("tr"),n=h("td"),r=b(J),o=w(),l=h("td"),a=h("input"),i=w(),c=h("td"),u=h("input"),d=w(),$=h("td"),y=h("select");for(let t=0;t<B.length;t+=1)B[t].c();_=w(),N=h("td"),O=h("input"),P=w(),H=h("td"),T=h("input"),A=w(),L=h("td"),L.innerHTML='<button class="table-button bg-green-100 hover:bg-green-200"></button>',M=w(),C=h("td"),C.innerHTML='<button class="table-button bg-red-100 hover:bg-red-200"></button>',j=w(),x(n,"class","table-body-element"),x(a,"class","table-input"),x(a,"type","text"),x(l,"class","table-body-element"),x(u,"class","table-input"),x(u,"type","text"),x(c,"class","table-body-element"),x(y,"class","table-input"),void 0===t[5]&&q((()=>t[24].call(y))),x($,"class","table-body-element"),x(O,"class","table-input"),x(O,"type","text"),x(N,"class","table-body-element"),x(T,"class","table-input"),x(T,"type","text"),x(H,"class","table-body-element"),x(L,"class","table-body-element"),x(C,"class","table-body-element")},m(s,g){f(s,e,g),p(e,n),p(n,r),p(e,o),p(e,l),p(l,a),S(a,t[60].subtype),p(e,i),p(e,c),p(c,u),S(u,t[60].id),p(e,d),p(e,$),p($,y);for(let t=0;t<B.length;t+=1)B[t].m(y,null);E(y,t[5]),p(e,_),p(e,N),p(N,O),S(O,t[60].subtype),p(e,P),p(e,H),p(H,T),S(T,t[60].subtype),p(e,A),p(e,L),p(e,M),p(e,C),p(e,j),z||(I=[v(a,"input",R),v(u,"input",W),v(y,"change",t[24]),v(O,"input",Y),v(T,"input",D)],z=!0)},p(e,n){if(t=e,8&n[0]&&J!==(J=t[60].type+"")&&k(r,J),8&n[0]&&a.value!==t[60].subtype&&S(a,t[60].subtype),8&n[0]&&u.value!==t[60].id&&S(u,t[60].id),64&n[0]){let e;for(F=t[6],e=0;e<F.length;e+=1){const s=Yt(t,F,e);B[e]?B[e].p(s,n):(B[e]=oe(s),B[e].c(),B[e].m(y,null))}for(;e<B.length;e+=1)B[e].d(1);B.length=F.length}96&n[0]&&E(y,t[5]),8&n[0]&&O.value!==t[60].subtype&&S(O,t[60].subtype),8&n[0]&&T.value!==t[60].subtype&&S(T,t[60].subtype)},d(t){t&&g(e),m(B,t),z=!1,s(I)}}}function ae(t){let e,n,s,r,o,l,a,i,c=t[3],u=[];for(let e=0;e<c.length;e+=1)u[e]=le(Bt(t,c,e));return{c(){e=h("table"),n=h("thead"),n.innerHTML='<tr><th class="table-head-element">Тип</th> \n <th class="table-head-element">Подтип</th> \n <th class="table-head-element">Id</th> \n <th class="table-head-element">Виджет</th> \n <th class="table-head-element">Вкладка</th> \n <th class="table-head-element">Название</th> \n <th class="table-head-element w-12"></th> \n <th class="table-head-element w-12"></th></tr>',s=w(),r=h("tbody");for(let t=0;t<u.length;t+=1)u[t].c();o=w(),l=h("button"),l.textContent="Сохранить",x(n,"class","bg-gray-50"),x(r,"class","bg-white"),x(e,"class","table-fixed w-full"),x(l,"class","long-button")},m(c,d){f(c,e,d),p(e,n),p(e,s),p(e,r);for(let t=0;t<u.length;t+=1)u[t].m(r,null);f(c,o,d),f(c,l,d),a||(i=v(l,"click",t[27]),a=!0)},p(t,e){if(104&e[0]){let n;for(c=t[3],n=0;n<c.length;n+=1){const s=Bt(t,c,n);u[n]?u[n].p(s,e):(u[n]=le(s),u[n].c(),u[n].m(r,null))}for(;n<u.length;n+=1)u[n].d(1);u.length=c.length}},d(t){t&&g(e),m(u,t),t&&g(o),t&&g(l),a=!1,i()}}}function ie(t){let e,n,s;return n=new Ot({props:{title:"Конфигуратор",$$slots:{default:[ae]},$$scope:{ctx:t}}}),{c(){e=h("div"),tt(n.$$.fragment),x(e,"class","cards-grid-inline")},m(t,r){f(t,e,r),et(n,e,null),s=!0},p(t,e){const s={};104&e[0]|512&e[2]&&(s.$$scope={dirty:e,ctx:t}),n.$set(s)},i(t){s||(U(n.$$.fragment,t),s=!0)},o(t){V(n.$$.fragment,t),s=!1},d(t){t&&g(e),nt(n)}}}function ce(e){let n,s,r,o,l;return s=new Ot({props:{title:"Подключение к WiFi роутеру"}}),o=new Ot({props:{title:"Подключение к MQTT брокеру"}}),{c(){n=h("div"),tt(s.$$.fragment),r=w(),tt(o.$$.fragment),x(n,"class","cards-grid")},m(t,e){f(t,n,e),et(s,n,null),p(n,r),et(o,n,null),l=!0},p:t,i(t){l||(U(s.$$.fragment,t),U(o.$$.fragment,t),l=!0)},o(t){V(s.$$.fragment,t),V(o.$$.fragment,t),l=!1},d(t){t&&g(n),nt(s),nt(o)}}}function ue(t){let e,n,s,r=t[57].msg+"";return{c(){e=h("div"),n=b(r),x(e,"class",s=t[57].msg.toString().includes("[E]")?"text-red-500":"text-black")},m(t,s){f(t,e,s),p(e,n)},p(t,o){256&o[0]&&r!==(r=t[57].msg+"")&&k(n,r),256&o[0]&&s!==(s=t[57].msg.toString().includes("[E]")?"text-red-500":"text-black")&&x(e,"class",s)},d(t){t&&g(e)}}}function de(t){let e,n=t[8],s=[];for(let e=0;e<n.length;e+=1)s[e]=ue(Ft(t,n,e));return{c(){for(let t=0;t<s.length;t+=1)s[t].c();e=y()},m(t,n){for(let e=0;e<s.length;e+=1)s[e].m(t,n);f(t,e,n)},p(t,r){if(256&r[0]){let o;for(n=t[8],o=0;o<n.length;o+=1){const l=Ft(t,n,o);s[o]?s[o].p(l,r):(s[o]=ue(l),s[o].c(),s[o].m(e.parentNode,e))}for(;o<s.length;o+=1)s[o].d(1);s.length=n.length}},d(t){m(s,t),t&&g(e)}}}function pe(t){let e,n;return e=new Ot({props:{title:"Лог",$$slots:{default:[de]},$$scope:{ctx:t}}}),{c(){tt(e.$$.fragment)},m(t,s){et(e,t,s),n=!0},p(t,n){const s={};256&n[0]|512&n[2]&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){n||(U(e.$$.fragment,t),n=!0)},o(t){V(e.$$.fragment,t),n=!1},d(t){nt(e,t)}}}function fe(t){let e,n,s,r,o,l,a,i,c,u,d,m,$,y,v,_=t[54].name+"",S=t[54].ip+"",E=t[54].id+"",N=t[54].status?"online":"offline";return{c(){e=h("tr"),n=h("td"),s=b(_),r=w(),o=h("td"),l=h("a"),a=b(S),c=w(),u=h("td"),d=b(E),m=w(),$=h("td"),y=b(N),x(n,"class","table-body-element"),x(l,"href",i="http://"+t[54].ip),x(o,"class","table-body-element"),x(u,"class","table-body-element"),x($,"class",v="table-body-element "+(t[54].status?"bg-green-50":"bg-red-50"))},m(t,i){f(t,e,i),p(e,n),p(n,s),p(e,r),p(e,o),p(o,l),p(l,a),p(e,c),p(e,u),p(u,d),p(e,m),p(e,$),p($,y)},p(t,e){64&e[0]&&_!==(_=t[54].name+"")&&k(s,_),64&e[0]&&S!==(S=t[54].ip+"")&&k(a,S),64&e[0]&&i!==(i="http://"+t[54].ip)&&x(l,"href",i),64&e[0]&&E!==(E=t[54].id+"")&&k(d,E),64&e[0]&&N!==(N=t[54].status?"online":"offline")&&k(y,N),64&e[0]&&v!==(v="table-body-element "+(t[54].status?"bg-green-50":"bg-red-50"))&&x($,"class",v)},d(t){t&&g(e)}}}function ge(t){let e,n,r,o,l,a,i,c,u,d,m,$,b;return{c(){e=h("tr"),n=h("td"),r=h("input"),o=w(),l=h("td"),a=h("input"),i=w(),c=h("td"),u=h("input"),d=w(),m=h("td"),x(r,"class","table-input"),x(r,"type","text"),x(n,"class","table-body-element"),x(a,"class","table-input"),x(a,"type","text"),x(l,"class","table-body-element"),x(u,"class","table-input"),x(u,"type","text"),x(c,"class","table-body-element"),x(m,"class","table-body-element")},m(s,g){f(s,e,g),p(e,n),p(n,r),S(r,t[7].name),p(e,o),p(e,l),p(l,a),S(a,t[7].ip),p(e,i),p(e,c),p(c,u),S(u,t[7].id),p(e,d),p(e,m),$||(b=[v(r,"input",t[28]),v(a,"input",t[29]),v(u,"input",t[30])],$=!0)},p(t,e){128&e[0]&&r.value!==t[7].name&&S(r,t[7].name),128&e[0]&&a.value!==t[7].ip&&S(a,t[7].ip),128&e[0]&&u.value!==t[7].id&&S(u,t[7].id)},d(t){t&&g(e),$=!1,s(b)}}}function me(t){let e,n,s,r,o,l,a,i,c,u,d=t[0]?"Сохранить":"Добавить устройство",$=t[6],y=[];for(let e=0;e<$.length;e+=1)y[e]=fe(Wt(t,$,e));let _=t[0]&&ge(t);return{c(){e=h("table"),n=h("thead"),n.innerHTML='<tr><th class="table-head-element">Название устройства</th> \n <th class="table-head-element">IP адрес</th> \n <th class="table-head-element">Идентификатор</th> \n <th class="table-head-element">Состояние</th></tr>',s=w(),r=h("tbody");for(let t=0;t<y.length;t+=1)y[t].c();o=w(),_&&_.c(),l=w(),a=h("button"),i=b(d),x(n,"class","bg-gray-50"),x(r,"class","bg-white"),x(e,"class","table-fixed w-full"),x(a,"class","long-button")},m(d,g){f(d,e,g),p(e,n),p(e,s),p(e,r);for(let t=0;t<y.length;t+=1)y[t].m(r,null);p(r,o),_&&_.m(r,null),f(d,l,g),f(d,a,g),p(a,i),c||(u=v(a,"click",t[31]),c=!0)},p(t,e){if(64&e[0]){let n;for($=t[6],n=0;n<$.length;n+=1){const s=Wt(t,$,n);y[n]?y[n].p(s,e):(y[n]=fe(s),y[n].c(),y[n].m(r,o))}for(;n<y.length;n+=1)y[n].d(1);y.length=$.length}t[0]?_?_.p(t,e):(_=ge(t),_.c(),_.m(r,null)):_&&(_.d(1),_=null),1&e[0]&&d!==(d=t[0]?"Сохранить":"Добавить устройство")&&k(i,d)},d(t){t&&g(e),m(y,t),_&&_.d(),t&&g(l),t&&g(a),c=!1,u()}}}function he(t){let e,n;return e=new Ot({props:{title:"Список устройств",$$slots:{default:[me]},$$scope:{ctx:t}}}),{c(){tt(e.$$.fragment)},m(t,s){et(e,t,s),n=!0},p(t,n){const s={};193&n[0]|512&n[2]&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){n||(U(e.$$.fragment,t),n=!0)},o(t){V(e.$$.fragment,t),n=!1},d(t){nt(e,t)}}}function $e(e){let n,s;return n=new Ot({props:{title:"Список устройств"}}),{c(){tt(n.$$.fragment)},m(t,e){et(n,t,e),s=!0},p:t,i(t){s||(U(n.$$.fragment,t),s=!0)},o(t){V(n.$$.fragment,t),s=!1},d(t){nt(n,t)}}}function be(t){let e,n,r,o,l,a,i,c,u,d,b,y,_,k,S,N,O,P,H,T,A,L,M,C,j,z,I,J,R,W,F,B,Y,D,K,Z,Q,G,X,st,rt,ot,lt,at,it,ct,ut,dt,pt,ft,gt,mt,ht,$t,bt,wt,yt=t[6],vt=[];for(let e=0;e<yt.length;e+=1)vt[e]=Qt(Zt(t,yt,e));return rt=new St({props:{path:"/",$$slots:{default:[re]},$$scope:{ctx:t}}}),lt=new St({props:{path:"/config",$$slots:{default:[ie]},$$scope:{ctx:t}}}),it=new St({props:{path:"/connection",$$slots:{default:[ce]},$$scope:{ctx:t}}}),ut=new St({props:{path:"/utilities"}}),pt=new St({props:{path:"/log",$$slots:{default:[pe]},$$scope:{ctx:t}}}),gt=new St({props:{path:"/list",$$slots:{default:[he]},$$scope:{ctx:t}}}),ht=new St({props:{path:"/about",$$slots:{default:[$e]},$$scope:{ctx:t}}}),{c(){e=h("main"),n=h("div"),r=h("div"),o=h("div"),l=h("select");for(let t=0;t<vt.length;t+=1)vt[t].c();a=w(),i=h("div"),c=$("svg"),u=$("path"),d=$("path"),y=w(),_=h("input"),k=w(),S=h("label"),S.innerHTML="<span></span>",N=w(),O=h("ul"),P=h("li"),H=h("a"),H.textContent="Управление",T=w(),A=h("li"),L=h("a"),L.textContent="Конфигуратор",M=w(),C=h("li"),j=h("a"),j.textContent="Подключение",z=w(),I=h("li"),J=h("a"),J.textContent="Утилиты",R=w(),W=h("li"),F=h("a"),F.textContent="Лог",B=w(),Y=h("li"),D=h("a"),D.textContent="Устройства",K=w(),Z=h("li"),Q=h("a"),Q.textContent="О проекте",G=w(),X=h("ul"),st=h("div"),tt(rt.$$.fragment),ot=w(),tt(lt.$$.fragment),at=w(),tt(it.$$.fragment),ct=w(),tt(ut.$$.fragment),dt=w(),tt(pt.$$.fragment),ft=w(),tt(gt.$$.fragment),mt=w(),tt(ht.$$.fragment),void 0===t[5]&&q((()=>t[15].call(l))),x(o,"class","px-15 py-2"),x(u,"stroke","none"),x(u,"d","M0 0h24v24H0z"),x(d,"d","M7 18a4.6 4.4 0 0 1 0 -9h0a5 4.5 0 0 1 11 2h1a3.5 3.5 0 0 1 0 7h-12"),x(c,"class",b="h-8 w-8 "+(!0===t[4]?"text-green-500":"text-red-500")),x(c,"width","24"),x(c,"height","24"),x(c,"viewBox","0 0 24 24"),x(c,"stroke-width","2"),x(c,"stroke","currentColor"),x(c,"fill","none"),x(c,"stroke-linecap","round"),x(c,"stroke-linejoin","round"),x(i,"class","px-10 py-1"),x(r,"class","flex justify-end content-center"),x(n,"class","fixed m-0 h-10 w-full bg-gray-100 shadow-md"),x(_,"id","menu__toggle"),x(_,"type","checkbox"),x(S,"class","menu__btn"),x(S,"for","menu__toggle"),x(H,"class","menu__item"),x(H,"href","/"),x(L,"class","menu__item"),x(L,"href","/config"),x(j,"class","menu__item"),x(j,"href","/connection"),x(J,"class","menu__item"),x(J,"href","/utilities"),x(F,"class","menu__item"),x(F,"href","/log"),x(D,"class","menu__item"),x(D,"href","/list"),x(Q,"class","menu__item"),x(Q,"href","/about"),x(O,"class","menu__box"),x(st,"class","bg-cover bg-gray-50 pt-8 px-4"),x(X,"class","menu__main")},m(s,g){f(s,e,g),p(e,n),p(n,r),p(r,o),p(o,l);for(let t=0;t<vt.length;t+=1)vt[t].m(l,null);E(l,t[5]),p(r,a),p(r,i),p(i,c),p(c,u),p(c,d),p(e,y),p(e,_),p(e,k),p(e,S),p(e,N),p(e,O),p(O,P),p(P,H),p(O,T),p(O,A),p(A,L),p(O,M),p(O,C),p(C,j),p(O,z),p(O,I),p(I,J),p(O,R),p(O,W),p(W,F),p(O,B),p(O,Y),p(Y,D),p(O,K),p(O,Z),p(Z,Q),p(e,G),p(e,X),p(X,st),et(rt,st,null),p(st,ot),et(lt,st,null),p(st,at),et(it,st,null),p(st,ct),et(ut,st,null),p(st,dt),et(pt,st,null),p(st,ft),et(gt,st,null),p(st,mt),et(ht,st,null),$t=!0,bt||(wt=[v(l,"change",t[15]),v(l,"change",t[16])],bt=!0)},p(t,e){if(64&e[0]){let n;for(yt=t[6],n=0;n<yt.length;n+=1){const s=Zt(t,yt,n);vt[n]?vt[n].p(s,e):(vt[n]=Qt(s),vt[n].c(),vt[n].m(l,null))}for(;n<vt.length;n+=1)vt[n].d(1);vt.length=yt.length}96&e[0]&&E(l,t[5]),(!$t||16&e[0]&&b!==(b="h-8 w-8 "+(!0===t[4]?"text-green-500":"text-red-500")))&&x(c,"class",b);const n={};6&e[0]|512&e[2]&&(n.$$scope={dirty:e,ctx:t}),rt.$set(n);const s={};104&e[0]|512&e[2]&&(s.$$scope={dirty:e,ctx:t}),lt.$set(s);const r={};512&e[2]&&(r.$$scope={dirty:e,ctx:t}),it.$set(r);const o={};256&e[0]|512&e[2]&&(o.$$scope={dirty:e,ctx:t}),pt.$set(o);const a={};193&e[0]|512&e[2]&&(a.$$scope={dirty:e,ctx:t}),gt.$set(a);const i={};512&e[2]&&(i.$$scope={dirty:e,ctx:t}),ht.$set(i)},i(t){$t||(U(rt.$$.fragment,t),U(lt.$$.fragment,t),U(it.$$.fragment,t),U(ut.$$.fragment,t),U(pt.$$.fragment,t),U(gt.$$.fragment,t),U(ht.$$.fragment,t),$t=!0)},o(t){V(rt.$$.fragment,t),V(lt.$$.fragment,t),V(it.$$.fragment,t),V(ut.$$.fragment,t),V(pt.$$.fragment,t),V(gt.$$.fragment,t),V(ht.$$.fragment,t),$t=!1},d(t){t&&g(e),m(vt,t),nt(rt),nt(lt),nt(it),nt(ut),nt(pt),nt(gt),nt(ht),bt=!1,s(wt)}}}function we(t,e,n){let s;l(t,bt,(t=>n(38,s=t))),bt.mode.hash();let r=document.location.hostname,o=!1,a=[],i=[];a=[{widget:"input",type:"date",status:"2021-10-17",page:"Inputs",order:"4",descr:"Switch on boiler date",topic:"/prefix/00000-00004/date1",ws:0},{widget:"input",type:"time",status:"12:00",page:"Inputs",order:"1",descr:"Switch on boiler time",topic:"/prefix/00000-00001/time",ws:0},{widget:"input",type:"number",status:"30.5",after:"°С",page:"Inputs",order:"2",descr:"Boiler temperature",topic:"/prefix/00000-00002/temp",ws:0},{widget:"input",type:"text",status:"Hello",page:"Inputs",order:"3",descr:"Message to be send",topic:"/prefix/00000-00003/text",ws:0},{widget:"toggle",status:0,page:"Toggles",order:"3",descr:"Light in my room",topic:"/prefix/00000-00003/btn1",ws:0},{widget:"toggle",status:0,page:"Toggles",order:"3",descr:"Light in my room",topic:"/prefix/00000-00003/btn2",ws:0},{widget:"toggle",status:0,page:"Toggles",order:"3",descr:"Light in my room",topic:"/prefix/00000-00003/btn3",ws:0},{widget:"anydata",status:30.5,after:"°С",page:"Any data",order:"3",descr:"Temperature",topic:"/prefix/00000-00003/tmp10",ws:0},{widget:"anydata",status:1032,after:"mm",page:"Any data",order:"3",descr:"Pressure",topic:"/prefix/00000-00003/tmp10",ws:0},{widget:"anydata",status:50,after:"%",page:"Any data",order:"3",descr:"Level",topic:"/prefix/00000-00003/tmp10",ws:0},{widget:"anydata",status:"opened",page:"Any data",order:"3",descr:"Status",topic:"/prefix/00000-00003/tmp10",ws:0}];let c,u,d=[],p=[],f=[],g=!1,m={},h=[],$=!0,b={},w=[];function y(){let t=0;h.forEach((e=>{e.ws=t,e.status||(x(t),k(t)),t++})),n(6,h),n(4,g=m.status)}function v(t,e){h.forEach((n=>{n.ws===t&&(n.status=e,n.status?console.log("[i]",n.ip,"status online"):console.log("[i]",n.ip,"status offline"))})),n(6,h),n(4,g=m.status)}function x(t){let e=_(t);"error"===e?console.log("[e]","device list wrong"):(f[t]=new WebSocket("ws://"+e+":81"),console.log("[i]",e,"started connecting..."))}function _(t){let e="error";return h.forEach((n=>{t===n.ws&&(e=n.ip)})),e}function k(t){if(f[t]){let e=_(t);console.log("[i]",e,"web socket events added"),f[t].addEventListener("open",(function(n){console.log("[i]",e,"completed connecting"),v(t,!0),C()})),f[t].addEventListener("message",(function(t){let e=t.data.toString();e.includes("[log]")?(e=e.replace("[log]",""),H(e)):e.includes("/config.json")&&(e=e.replace("/config.json",""),p+=e,e.includes("]}")&&(p=p.replace("]}","]"),function(t){try{JSON.parse(t)}catch(t){return!1}return!0}(p)&&(n(3,d=JSON.parse(p)),p=[],n(3,d),console.log("[i]","parsed"))))})),f[t].addEventListener("close",(n=>{console.log("[e]",e,"connection closed"),v(t,!1)})),f[t].addEventListener("error",(function(n){console.log("[e]",e,"connection error"),v(t,!1)}))}else console.log("[e]","socket not exist")}function S(t,e,n){let s=e+" "+n;console.log("[i]","send to ws msg:",s),O(t,s)}function E(){setTimeout(E,6e4),console.log("[i]","----timer tick----"),$||h.forEach((t=>{!function(t){let e=!1;return h.forEach((n=>{t===n.ws&&(e=n.status)})),e}(t.ws)?(x(t.ws),k(t.ws)):O(t.ws,"tst")})),$=!1}function O(t,e){f[t]&&1===f[t].readyState?(f[t].send(e),console.log("[i]",_(t),"msg send success",e)):console.log("[e]",_(t),"msg not send",e)}function P(){n(2,i=[]);Array.from(new Set(Array.from(a,(({page:t})=>t)))).forEach((function(t,e,s){n(2,i=[...i,JSON.parse(JSON.stringify({page:t}))])})),i.sort((function(t,e){return t.page<e.page?-1:t.page>e.page?1:0}))}h=[{name:"Устройство 1",id:"987654321",ip:"192.168.88.233",status:!1},{name:"Устройство 2",id:"987654321",ip:"192.168.88.235",status:!1}],bt.subscribe((function(){M(),u=s.path.toString(),console.log("[i]","user on page:",u),C()}));const H=t=>{w.length>Number(10)&&n(8,w=w.slice(0));const e=(new Date).getTime();n(8,w=[...w,{time:e,msg:t}]),w.sort((function(t,e){return t.time>e.time?-1:t.time<e.time?1:0}))};function A(){n(4,g=m.status),c=m.ws,M(),C(),console.log("[i]","user selected device:",m.name),m.ip===r&&console.log("[i]","user selected original device",m.name)}function L(){o||(void 0!==b.name&&void 0!==b.ip&&void 0!==b.id?(n(7,b.status=!1,b),h.push(b),n(6,h),n(7,b={}),y(),console.log("[i]","selected device:",m)):console.log("[e]","wrong data"))}function M(){n(3,d=[]),p=[]}function C(){void 0!==c&&O(c,u)}function j(){O(c,"/changed"+JSON.stringify(d)),M(),C()}T((async()=>{console.log("[i]","mounted"),y(),E(),n(4,g=m.status),A(),P()}));return[o,a,i,d,g,m,h,b,w,S,function(){n(1,a=JSON.parse(document.getElementById("text1").value)),P()},A,L,t=>{try{t=JSON.stringify(JSON.parse(t),null,4)}catch(e){return t}return t=(t=t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")).replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,(function(t){return t}))},j,function(){m=N(this),n(5,m),n(6,h)},()=>A(),(t,e,n)=>S(t,e,n),function(e,s){t.$$.not_equal(s.status,e)&&(s.status=e,n(1,a))},(t,e,n)=>S(t,e,n),function(e,s){t.$$.not_equal(s.status,e)&&(s.status=e,n(1,a))},function(e,s){t.$$.not_equal(s.status,e)&&(s.status=e,n(1,a))},function(t,e){t[e].subtype=this.value,n(3,d)},function(t,e){t[e].id=this.value,n(3,d)},function(){m=N(this),n(5,m),n(6,h)},function(t,e){t[e].subtype=this.value,n(3,d)},function(t,e){t[e].subtype=this.value,n(3,d)},()=>j(),function(){b.name=this.value,n(7,b)},function(){b.ip=this.value,n(7,b)},function(){b.id=this.value,n(7,b)},()=>(n(0,o=!o),L())]}return new class extends rt{constructor(t){super(),st(this,t,we,be,o,{},null,[-1,-1,-1])}}({target:document.body,props:{name:"world"}})}();
|
||
//# sourceMappingURL=bundle.js.map
|