From 23ae779b48fa723d0516c4322289062e050a4309 Mon Sep 17 00:00:00 2001
From: Dmitry Borisenko <49808844+DmitryBorisenko33@users.noreply.github.com>
Date: Wed, 23 Feb 2022 01:39:05 +0100
Subject: [PATCH] =?UTF-8?q?=D1=81=D1=86=D0=B5=D0=BD=D0=B0=D1=80=D0=B8?=
=?UTF-8?q?=D0=B8=20=D0=B2=20=D0=B2=D0=B5=D0=B1=D0=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
data_svelte/build/bundle.js | 2 +-
data_svelte/settings.json | 4 ++--
src/EventsAndOrders.cpp | 14 +++++++-------
src/WsServer.cpp | 15 ++++++++++-----
4 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/data_svelte/build/bundle.js b/data_svelte/build/bundle.js
index 32108cf7..dca68c1e 100644
--- a/data_svelte/build/bundle.js
+++ b/data_svelte/build/bundle.js
@@ -1,2 +1,2 @@
-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 l(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function o(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 c(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 a(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;s32){const e=[],n=t.ctx.length/32;for(let t=0;tt.removeEventListener(e,n,s)}function y(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function k(t){return""===t?null:+t}function _(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function J(t,e){t.value=null==e?"":e}function j(t,e){for(let n=0;n{V.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,l,o){const{fragment:c,on_mount:i,on_destroy:a,after_update:u}=t.$$;c&&c.m(n,l),o||I((()=>{const n=i.map(e).filter(r);a?a.push(...n):s(n),t.$$.on_mount=[]})),u.forEach(I)}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,l,o,c,i,a,u=[-1]){const d=T;L(e);const f=e.$$={fragment:null,ctx:null,props:i,update:t,not_equal:c,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};a&&a(f.root);let p=!1;if(f.ctx=l?l(e,r.props||{},((t,n,...s)=>{const r=s.length?s[0]:n;return f.ctx&&c(f.ctx[t],f.ctx[t]=r)&&(!f.skip_bound&&f.bound[t]&&f.bound[t](r),p&&function(t,e){-1===t.$$.dirty[0]&&(O.push(t),D(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{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 lt=[];function ot(e,n=t){let s;const r=new Set;function o(t){if(l(e,t)&&(e=t,s)){const t=!lt.length;for(const t of r)t[1](),lt.push(t,e);if(t){for(let t=0;t{r.delete(i),0===r.size&&(s(),s=null)}}}}function ct(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 at(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,ft,pt={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=pt.getDeafault(),n=n=>t&&t(mt(e));function s(t){t&&(e=t),window.onhashchange=window.onpopstate=ft=null,e!==pt.OFF&&pt.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);pt.run(t,(t=>s(e)),(t=>s(`#${e}`)),(t=>ft=e))})(e,t,s),n()},start(e){t=e,s()},stop(){t=null,s(pt.OFF)}}}();function mt(t){let e=dt,n=dt=pt.run(t,(t=>window.location.pathname+window.location.search),(t=>String(window.location.hash.slice(1)||"/")),(t=>ft||"/")),s=n.match(/^([^?#]+)(?:\?([^#]+))?(?:\#(.+))?$/);return{url:n,from:e,path:s[1]||"",query:ut(s[2]||""),hash:s[3]||""}}function ht(t){let e=E("tinro");e&&(e.exact||e.fallback)&&function(t){throw new Error("[Tinro] "+t)}(`${t.fallback?"":``} can't be inside ${e.fallback?"":` with exact path`}`);let n=t.fallback?"fallbacks":"childs",s=ot({}),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=ct(`${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:l,query:o}=r.router,c=function(t,e){t=ct(t,!0),e=ct(e,!0);let n=[],s={},r=!0,l=t.split("/").map((t=>t.startsWith(":")?(n.push(t.slice(1)),"([^\\/]+)"):t)).join("\\/"),o=e.match(new RegExp(`^${l}$`));return o||(r=!1,o=e.match(new RegExp(`^${l}`))),o?(n.forEach(((t,e)=>s[t]=o[e+1])),{exact:r,params:s,part:o[0].slice(0,-1)}):null}(r.pattern,e);if(!r.fallback&&c&&r.redirect&&(!r.exact||r.exact&&c.exact)){await B();let t=it(e,r.parent&&r.parent.pattern,r.redirect);return xt.goto(t,!0)}if(r.meta=c&&{from:l,url:n,query:o,match:c.part,pattern:r.pattern,breadcrumbs:r.parent&&r.parent.meta&&r.parent.meta.breadcrumbs.slice()||[],params:c.params,subscribe:s.subscribe},r.breadcrumb&&r.meta&&r.meta.breadcrumbs.push({name:r.breadcrumb,path:c.part}),s.set(r.meta),!c||r.fallback||!(!r.exact||r.exact&&c.exact)||r.parent&&r.parent.firstmatch&&r.parent.matched?r.hide():(t.onMeta(r.meta),r.parent&&(r.parent.matched=!0),r.show()),await B(),c&&!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);xt.goto(e,!0)}else t.show()}))}}};return l="tinro",o=r,M().$$.context.set(l,o),q((()=>r.register())),r.router.un=xt.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 l,o}function $t(){return E("tinro").meta}var xt=function(){let{subscribe:t}=ot(gt.get(),(t=>{gt.start(t);let e=function(t){let e=e=>{let n=e.target.closest("a[href]"),s=n&&at(n,"target",!1,"_self"),r=n&&at(n,"tinro-ignore"),l=e.ctrlKey||e.metaKey||e.altKey||e.shiftKey;if("_self"==s&&!r&&!l&&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:bt,meta:$t,useHashNavigation:t=>gt.mode(t?pt.HASH:pt.HISTORY),mode:{hash:()=>gt.mode(pt.HASH),history:()=>gt.mode(pt.HISTORY),memory:()=>gt.mode(pt.MEMORY)}}}();function bt(){return E("tinro").meta.params}const wt=t=>({params:2&t,meta:4&t}),vt=t=>({params:t[1],meta:t[2]});function yt(t){let e;const n=t[9].default,s=c(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?a(n,t[8],r,wt):d(t[8]),vt)},i(t){e||(G(s,t),e=!0)},o(t){Z(s,t),e=!1},d(t){s&&s.d(t)}}}function kt(t){let e,n,s=t[0]&&yt(t);return{c(){s&&s.c(),e=w()},m(t,r){s&&s.m(t,r),p(t,e,r),n=!0},p(t,[n]){t[0]?s?(s.p(t,n),1&n&&G(s,1)):(s=yt(t),s.c(),G(s,1),s.m(e.parentNode,e)):s&&(K(),Z(s,1,1,(()=>{s=null})),Q())},i(t){n||(G(s),n=!0)},o(t){Z(s),n=!1},d(t){s&&s.d(t),t&&g(e)}}}function _t(t,e,n){let{$$slots:s={},$$scope:r}=e,{path:l="/*"}=e,{fallback:o=!1}=e,{redirect:c=!1}=e,{firstmatch:i=!1}=e,{breadcrumb:a=null}=e,u=!1,d={},f={};const p=ht({fallback:o,onShow(){n(0,u=!0)},onHide(){n(0,u=!1)},onMeta(t){n(2,f=t),n(1,d=f.params)}});return t.$$set=t=>{"path"in t&&n(3,l=t.path),"fallback"in t&&n(4,o=t.fallback),"redirect"in t&&n(5,c=t.redirect),"firstmatch"in t&&n(6,i=t.firstmatch),"breadcrumb"in t&&n(7,a=t.breadcrumb),"$$scope"in t&&n(8,r=t.$$scope)},t.$$.update=()=>{232&t.$$.dirty&&p.update({path:l,redirect:c,firstmatch:i,breadcrumb:a})},[u,d,f,l,o,c,i,a,r,s]}class Jt extends rt{constructor(t){super(),st(this,t,_t,kt,l,{path:3,fallback:4,redirect:5,firstmatch:6,breadcrumb:7})}}function jt(e){let n,s,l,o,c;return{c(){n=$("svg"),s=$("line"),l=$("line"),y(s,"x1","18"),y(s,"y1","6"),y(s,"x2","6"),y(s,"y2","18"),y(l,"x1","6"),y(l,"y1","6"),y(l,"x2","18"),y(l,"y2","18"),y(n,"class","h-6 w-6 text-red-400 cursor-pointer"),y(n,"viewBox","0 -2 24 24"),y(n,"fill","none"),y(n,"stroke","currentColor"),y(n,"stroke-width","2"),y(n,"stroke-linecap","round"),y(n,"stroke-linejoin","round")},m(t,i){p(t,n,i),f(n,s),f(n,l),o||(c=v(n,"click",(function(){r(e[0]())&&e[0]().apply(this,arguments)})),o=!0)},p(t,[n]){e=t},i:t,o:t,d(t){t&&g(n),o=!1,c()}}}function St(t,e,n){let{click:s=(()=>{})}=e;return t.$$set=t=>{"click"in t&&n(0,s=t.click)},[s]}class Tt extends rt{constructor(t){super(),st(this,t,St,jt,l,{click:0})}}function Lt(t){let e,n,s,r,l,o,c,i;return c=new Tt({props:{click:t[5]}}),{c(){e=h("div"),n=h("div"),s=h("h1"),r=x(t[0]),l=b(),o=h("div"),tt(c.$$.fragment),y(s,"class","alm-hdr"),y(n,"class","w-11/12"),y(o,"class","flex justify-end w-1/12"),y(e,"class","flex items-center")},m(t,a){p(t,e,a),f(e,n),f(n,s),f(s,r),f(e,l),f(e,o),et(c,o,null),i=!0},p(t,e){(!i||1&e)&&_(r,t[0]);const n={};4&e&&(n.click=t[5]),c.$set(n)},i(t){i||(G(c.$$.fragment,t),i=!0)},o(t){Z(c.$$.fragment,t),i=!1},d(t){t&&g(e),nt(c)}}}function Mt(e){let n,s;return{c(){n=h("h1"),s=x(e[0]),y(n,"class","alm-hdr")},m(t,e){p(t,n,e),f(n,s)},p(t,e){1&e&&_(s,t[0])},i:t,o:t,d(t){t&&g(n)}}}function qt(t){let e,n,s,r,l;const o=[Mt,Lt],i=[];function m(t,e){return t[0]&&!t[1]?0:t[0]&&t[1]?1:-1}~(n=m(t))&&(s=i[n]=o[n](t));const $=t[4].default,x=c($,t,t[3],null);return{c(){e=h("div"),s&&s.c(),r=b(),x&&x.c(),y(e,"class","alm")},m(t,s){p(t,e,s),~n&&i[n].m(e,null),f(e,r),x&&x.m(e,null),l=!0},p(t,[c]){let f=n;n=m(t),n===f?~n&&i[n].p(t,c):(s&&(K(),Z(i[f],1,1,(()=>{i[f]=null})),Q()),~n?(s=i[n],s?s.p(t,c):(s=i[n]=o[n](t),s.c()),G(s,1),s.m(e,r)):s=null),x&&x.p&&(!l||8&c)&&u(x,$,t,t[3],l?a($,t[3],c,null):d(t[3]),null)},i(t){l||(G(s),G(x,t),l=!0)},o(t){Z(s),Z(x,t),l=!1},d(t){t&&g(e),~n&&i[n].d(),x&&x.d(t)}}}function Et(t,e,n){let{$$slots:s={},$$scope:r}=e,{title:l=!1}=e,{cross:o=!1}=e,{close:c=(()=>{})}=e;return t.$$set=t=>{"title"in t&&n(0,l=t.title),"cross"in t&&n(1,o=t.cross),"close"in t&&n(2,c=t.close),"$$scope"in t&&n(3,r=t.$$scope)},[l,o,c,r,s,()=>c()]}class Ot extends rt{constructor(t){super(),st(this,t,Et,qt,l,{title:0,cross:1,close:2})}}function Ct(e){let n;return{c(){n=h("div"),n.innerHTML=' \n ',y(n,"class","z-50")},m(t,e){p(t,n,e)},p:t,i:t,o:t,d(t){t&&g(n)}}}class Nt extends rt{constructor(t){super(),st(this,t,null,Ct,l,{})}}function Ht(t){let e,n,s,r=t[0]&&Pt(t);const l=t[3].default,o=c(l,t,t[2],null);return{c(){e=h("div"),r&&r.c(),n=b(),o&&o.c(),y(e,"class","crd")},m(t,l){p(t,e,l),r&&r.m(e,null),f(e,n),o&&o.m(e,null),s=!0},p(t,c){t[0]?r?r.p(t,c):(r=Pt(t),r.c(),r.m(e,n)):r&&(r.d(1),r=null),o&&o.p&&(!s||4&c)&&u(o,l,t,t[2],s?a(l,t[2],c,null):d(t[2]),null)},i(t){s||(G(o,t),s=!0)},o(t){Z(o,t),s=!1},d(t){t&&g(e),r&&r.d(),o&&o.d(t)}}}function Pt(t){let e,n;return{c(){e=h("h1"),n=x(t[0]),y(e,"class","crd-hdr")},m(t,s){p(t,e,s),f(e,n)},p(t,e){1&e&&_(n,t[0])},d(t){t&&g(e)}}}function At(t){let e,n,s=t[1]&&Ht(t);return{c(){s&&s.c(),e=w()},m(t,r){s&&s.m(t,r),p(t,e,r),n=!0},p(t,[n]){t[1]?s?(s.p(t,n),2&n&&G(s,1)):(s=Ht(t),s.c(),G(s,1),s.m(e.parentNode,e)):s&&(K(),Z(s,1,1,(()=>{s=null})),Q())},i(t){n||(G(s),n=!0)},o(t){Z(s),n=!1},d(t){s&&s.d(t),t&&g(e)}}}function Dt(t,e,n){let{$$slots:s={},$$scope:r}=e,{title:l=!1}=e,{show:o=!0}=e;return t.$$set=t=>{"title"in t&&n(0,l=t.title),"show"in t&&n(1,o=t.show),"$$scope"in t&&n(2,r=t.$$scope)},[l,o,r,s]}class Bt extends rt{constructor(t){super(),st(this,t,Dt,At,l,{title:0,show:1})}}function It(t){let e,n,r,l;return{c(){e=h("input"),y(e,"class",n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500"),y(e,"step","0.1"),y(e,"type","number")},m(n,s){p(n,e,s),J(e,t[0].status),r||(l=[v(e,"change",t[3]),v(e,"input",t[4])],r=!0)},p(t,s){1&s&&n!==(n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500")&&y(e,"class",n),1&s&&k(e.value)!==t[0].status&&J(e,t[0].status)},d(t){t&&g(e),r=!1,s(l)}}}function zt(t){let e,n,r,l;return{c(){e=h("input"),y(e,"class",n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500"),y(e,"type","text")},m(n,s){p(n,e,s),J(e,t[0].status),r||(l=[v(e,"change",t[5]),v(e,"input",t[6])],r=!0)},p(t,s){1&s&&n!==(n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500")&&y(e,"class",n),1&s&&e.value!==t[0].status&&J(e,t[0].status)},d(t){t&&g(e),r=!1,s(l)}}}function Rt(t){let e,n,r,l;return{c(){e=h("input"),y(e,"class",n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500"),y(e,"type","date")},m(n,s){p(n,e,s),J(e,t[0].status),r||(l=[v(e,"change",t[7]),v(e,"input",t[8])],r=!0)},p(t,s){1&s&&n!==(n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500")&&y(e,"class",n),1&s&&J(e,t[0].status)},d(t){t&&g(e),r=!1,s(l)}}}function Ft(t){let e,n,r,l;return{c(){e=h("input"),y(e,"class",n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500"),y(e,"type","time")},m(n,s){p(n,e,s),J(e,t[0].status),r||(l=[v(e,"change",t[9]),v(e,"input",t[10])],r=!0)},p(t,s){1&s&&n!==(n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500")&&y(e,"class",n),1&s&&J(e,t[0].status)},d(t){t&&g(e),r=!1,s(l)}}}function Ut(e){let n,s,r,l,o,c,i,a,u,d=(e[0].descr?e[0].descr:"")+"",m="number"==e[0].type&&It(e),$="text"==e[0].type&&zt(e),w="date"==e[0].type&&Rt(e),v="time"==e[0].type&&Ft(e);return{c(){n=h("div"),s=h("div"),r=h("label"),l=x(d),o=b(),c=h("div"),m&&m.c(),i=b(),$&&$.c(),a=b(),w&&w.c(),u=b(),v&&v.c(),y(r,"class","wgt-dscr-stl"),y(s,"class","w-2/3"),y(c,"class","flex justify-end w-1/3"),y(n,"class","crd-itm-psn")},m(t,e){p(t,n,e),f(n,s),f(s,r),f(r,l),f(n,o),f(n,c),m&&m.m(c,null),f(c,i),$&&$.m(c,null),f(c,a),w&&w.m(c,null),f(c,u),v&&v.m(c,null)},p(t,[e]){1&e&&d!==(d=(t[0].descr?t[0].descr:"")+"")&&_(l,d),"number"==t[0].type?m?m.p(t,e):(m=It(t),m.c(),m.m(c,i)):m&&(m.d(1),m=null),"text"==t[0].type?$?$.p(t,e):($=zt(t),$.c(),$.m(c,a)):$&&($.d(1),$=null),"date"==t[0].type?w?w.p(t,e):(w=Rt(t),w.c(),w.m(c,u)):w&&(w.d(1),w=null),"time"==t[0].type?v?v.p(t,e):(v=Ft(t),v.c(),v.m(c,null)):v&&(v.d(1),v=null)},i:t,o:t,d(t){t&&g(n),m&&m.d(),$&&$.d(),w&&w.d(),v&&v.d()}}}function Wt(t,e,n){let{widget:s}=e,{wsPush:r=((t,e,n)=>{})}=e,{value:l}=e;l=l;return t.$$set=t=>{"widget"in t&&n(0,s=t.widget),"wsPush"in t&&n(1,r=t.wsPush),"value"in t&&n(2,l=t.value)},[s,r,l,()=>(n(0,s.send=!0,s),r(s.ws,s.topic,s.status)),function(){s.status=k(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 Vt extends rt{constructor(t){super(),st(this,t,Wt,Ut,l,{widget:0,wsPush:1,value:2})}}function Yt(e){let n,r,l,o,c,i,a,u,d,m,$,w,k,j,S,T,L,M,q=(e[0].descr?e[0].descr:"")+"";return{c(){n=h("div"),r=h("div"),l=h("label"),o=x(q),c=b(),i=h("div"),a=h("label"),u=h("div"),d=h("input"),$=b(),w=h("div"),k=b(),j=h("div"),y(l,"class","wgt-dscr-stl"),y(r,"class","w-2/3"),y(d,"id",m=e[0].topic),y(d,"type","checkbox"),y(d,"class","sr-only"),y(w,"class","block bg-gray-600 w-10 h-6 rounded-full"),y(j,"class",S="dot "+(1==e[0].send?"bg-red-400":"bg-white")+" absolute left-1 top-1 w-4 h-4 rounded-full transition"),y(u,"class","relative"),y(a,"for",T=e[0].topic),y(a,"class","items-center cursor-pointer"),y(i,"class","flex justify-end w-1/3"),y(n,"class","crd-itm-psn")},m(t,s){p(t,n,s),f(n,r),f(r,l),f(l,o),f(n,c),f(n,i),f(i,a),f(a,u),f(u,d),J(d,e[0].status),f(u,$),f(u,w),f(u,k),f(u,j),L||(M=[v(d,"change",e[3]),v(d,"change",e[4])],L=!0)},p(t,[e]){1&e&&q!==(q=(t[0].descr?t[0].descr:"")+"")&&_(o,q),1&e&&m!==(m=t[0].topic)&&y(d,"id",m),1&e&&J(d,t[0].status),1&e&&S!==(S="dot "+(1==t[0].send?"bg-red-400":"bg-white")+" absolute left-1 top-1 w-4 h-4 rounded-full transition")&&y(j,"class",S),1&e&&T!==(T=t[0].topic)&&y(a,"for",T)},i:t,o:t,d(t){t&&g(n),L=!1,s(M)}}}function Kt(t,e,n){let{widget:s}=e,{value:r}=e;r=r;let{wsPush:l=((t,e,n)=>{})}=e;return t.$$set=t=>{"widget"in t&&n(0,s=t.widget),"value"in t&&n(2,r=t.value),"wsPush"in t&&n(1,l=t.wsPush)},[s,l,r,()=>(n(0,s.send=!0,s),l(s.ws,s.topic,s.status)),function(){s.status=this.value,n(0,s)}]}class Qt extends rt{constructor(t){super(),st(this,t,Kt,Yt,l,{widget:0,value:2,wsPush:1})}}function Gt(e){let n,s,r,l,o,c,i,a,u,d,m,$,w=(e[0].descr?e[0].descr:"")+"",v=(e[0].status?e[0].status:"")+"",k=(e[0].after?e[0].after:"")+"";return{c(){n=h("div"),s=h("div"),r=h("label"),l=x(w),o=b(),c=h("div"),i=h("label"),a=x(v),u=b(),d=h("label"),m=x(" "),$=x(k),y(r,"class","wgt-dscr-stl"),y(s,"class","w-2/3"),y(i,"class","wgt-adt-stl"),y(d,"class","wgt-adt-stl"),y(c,"class","flex justify-end w-1/3"),y(n,"class","crd-itm-psn")},m(t,e){p(t,n,e),f(n,s),f(s,r),f(r,l),f(n,o),f(n,c),f(c,i),f(i,a),f(c,u),f(c,d),f(d,m),f(d,$)},p(t,[e]){1&e&&w!==(w=(t[0].descr?t[0].descr:"")+"")&&_(l,w),1&e&&v!==(v=(t[0].status?t[0].status:"")+"")&&_(a,v),1&e&&k!==(k=(t[0].after?t[0].after:"")+"")&&_($,k)},i:t,o:t,d(t){t&&g(n)}}}function Zt(t,e,n){let{widget:s}=e,{value:r}=e;return r=r,t.$$set=t=>{"widget"in t&&n(0,s=t.widget),"value"in t&&n(1,r=t.value)},[s,r]}class Xt extends rt{constructor(t){super(),st(this,t,Zt,Gt,l,{widget:0,value:1})}}function te(t,e,n){const s=t.slice();return s[9]=e[n],s[11]=n,s}function ee(t,e,n){const s=t.slice();return s[12]=e[n],s[13]=e,s[11]=n,s}function ne(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||(G(n.$$.fragment,t),s=!0)},o(t){Z(n.$$.fragment,t),s=!1},d(t){nt(n,t)}}}function se(t){let e,n,s,r=t[0]===[]&&re(),l=t[1],o=[];for(let e=0;eZ(o[t],1,1,(()=>{o[t]=null}));return{c(){e=h("div"),r&&r.c(),n=b();for(let t=0;t{r=null})),Q()),11&s){let n;for(l=t[1],n=0;n{l=null})),Q()),"toggle"===t[12].widget?o?(o.p(t,r),1&r&&G(o,1)):(o=ce(t),o.c(),G(o,1),o.m(n.parentNode,n)):o&&(K(),Z(o,1,1,(()=>{o=null})),Q()),"anydata"===t[12].widget?c?(c.p(t,r),1&r&&G(c,1)):(c=ie(t),c.c(),G(c,1),c.m(s.parentNode,s)):c&&(K(),Z(c,1,1,(()=>{c=null})),Q())},i(t){r||(G(l),G(o),G(c),r=!0)},o(t){Z(l),Z(o),Z(c),r=!1},d(t){l&&l.d(t),t&&g(e),o&&o.d(t),t&&g(n),c&&c.d(t),t&&g(s)}}}function oe(t){let e,n,s;function r(e){t[5](e,t[12])}let l={widget:t[12],wsPush:t[4]};return void 0!==t[12].status&&(l.value=t[12].status),e=new Vt({props:l}),C.push((()=>X(e,"value",r))),{c(){tt(e.$$.fragment)},m(t,n){et(e,t,n),s=!0},p(s,r){t=s;const l={};1&r&&(l.widget=t[12]),8&r&&(l.wsPush=t[4]),!n&&1&r&&(n=!0,l.value=t[12].status,z((()=>n=!1))),e.$set(l)},i(t){s||(G(e.$$.fragment,t),s=!0)},o(t){Z(e.$$.fragment,t),s=!1},d(t){nt(e,t)}}}function ce(t){let e,n,s;function r(e){t[7](e,t[12])}let l={widget:t[12],wsPush:t[6]};return void 0!==t[12].status&&(l.value=t[12].status),e=new Qt({props:l}),C.push((()=>X(e,"value",r))),{c(){tt(e.$$.fragment)},m(t,n){et(e,t,n),s=!0},p(s,r){t=s;const l={};1&r&&(l.widget=t[12]),8&r&&(l.wsPush=t[6]),!n&&1&r&&(n=!0,l.value=t[12].status,z((()=>n=!1))),e.$set(l)},i(t){s||(G(e.$$.fragment,t),s=!0)},o(t){Z(e.$$.fragment,t),s=!1},d(t){nt(e,t)}}}function ie(t){let e,n,s;function r(e){t[8](e,t[12])}let l={widget:t[12]};return void 0!==t[12].status&&(l.value=t[12].status),e=new Xt({props:l}),C.push((()=>X(e,"value",r))),{c(){tt(e.$$.fragment)},m(t,n){et(e,t,n),s=!0},p(s,r){t=s;const l={};1&r&&(l.widget=t[12]),!n&&1&r&&(n=!0,l.value=t[12].status,z((()=>n=!1))),e.$set(l)},i(t){s||(G(e.$$.fragment,t),s=!0)},o(t){Z(e.$$.fragment,t),s=!1},d(t){nt(e,t)}}}function ae(t){let e,n,s=t[12].page===t[9].page&&le(t);return{c(){s&&s.c(),e=w()},m(t,r){s&&s.m(t,r),p(t,e,r),n=!0},p(t,n){t[12].page===t[9].page?s?(s.p(t,n),3&n&&G(s,1)):(s=le(t),s.c(),G(s,1),s.m(e.parentNode,e)):s&&(K(),Z(s,1,1,(()=>{s=null})),Q())},i(t){n||(G(s),n=!0)},o(t){Z(s),n=!1},d(t){s&&s.d(t),t&&g(e)}}}function ue(t){let e,n,s=t[0],r=[];for(let e=0;eZ(r[t],1,1,(()=>{r[t]=null}));return{c(){for(let t=0;t{o[i]=null})),Q(),n=o[e],n?n.p(t,r):(n=o[e]=l[e](t),n.c()),G(n,1),n.m(s.parentNode,s))},i(t){r||(G(n),r=!0)},o(t){Z(n),r=!1},d(t){o[e].d(t),t&&g(s)}}}function pe(t,e,n){let{layoutJson:s}=e,{pages:r}=e,{show:l}=e,{wsPush:o=((t,e,n)=>{})}=e;return t.$$set=t=>{"layoutJson"in t&&n(0,s=t.layoutJson),"pages"in t&&n(1,r=t.pages),"show"in t&&n(2,l=t.show),"wsPush"in t&&n(3,o=t.wsPush)},[s,r,l,o,(t,e,n)=>o(t,e,n),function(e,r){t.$$.not_equal(r.status,e)&&(r.status=e,n(0,s))},(t,e,n)=>o(t,e,n),function(e,r){t.$$.not_equal(r.status,e)&&(r.status=e,n(0,s))},function(e,r){t.$$.not_equal(r.status,e)&&(r.status=e,n(0,s))}]}class ge extends rt{constructor(t){super(),st(this,t,pe,fe,l,{layoutJson:0,pages:1,show:2,wsPush:3})}}function me(e){let n,s,l,o,c,i,a;return{c(){n=$("svg"),s=$("path"),l=$("circle"),o=$("circle"),c=$("circle"),y(s,"stroke","none"),y(s,"d","M0 0h24v24H0z"),y(l,"cx","5"),y(l,"cy","12"),y(l,"r","1"),y(o,"cx","12"),y(o,"cy","12"),y(o,"r","1"),y(c,"cx","19"),y(c,"cy","12"),y(c,"r","1"),y(n,"class","h-6 w-6 text-green-400 cursor-pointer"),y(n,"width","24"),y(n,"height","24"),y(n,"viewBox","0 -2 24 24"),y(n,"stroke-width","2"),y(n,"stroke","currentColor"),y(n,"fill","none"),y(n,"stroke-linecap","round"),y(n,"stroke-linejoin","round")},m(t,u){p(t,n,u),f(n,s),f(n,l),f(n,o),f(n,c),i||(a=v(n,"click",(function(){r(e[0]())&&e[0]().apply(this,arguments)})),i=!0)},p(t,[n]){e=t},i:t,o:t,d(t){t&&g(n),i=!1,a()}}}function he(t,e,n){let{click:s=(()=>{})}=e;return t.$$set=t=>{"click"in t&&n(0,s=t.click)},[s]}class $e extends rt{constructor(t){super(),st(this,t,he,me,l,{click:0})}}function xe(t,e,n){const s=t.slice();return s[21]=e[n],s[22]=e,s[23]=n,s}function be(t,e,n){const s=t.slice();return s[24]=e[n][0],s[25]=e[n][1],s[26]=e,s[27]=n,s}function we(t,e,n){const s=t.slice();return s[28]=e[n],s}function ve(t,e,n){const s=t.slice();return s[31]=e[n],s}function ye(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||(G(n.$$.fragment,t),s=!0)},o(t){Z(n.$$.fragment,t),s=!1},d(t){nt(n,t)}}}function ke(t){let e,n,s;return n=new Bt({props:{$$slots:{default:[Ee]},$$scope:{ctx:t}}}),{c(){e=h("div"),tt(n.$$.fragment),y(e,"class","grd-1col1")},m(t,r){p(t,e,r),et(n,e,null),s=!0},p(t,e){const s={};247&e[0]|8&e[1]&&(s.$$scope={dirty:e,ctx:t}),n.$set(s)},i(t){s||(G(n.$$.fragment,t),s=!0)},o(t){Z(n.$$.fragment,t),s=!1},d(t){t&&g(e),nt(n)}}}function _e(t){let e,n;return{c(){e=h("optgroup"),y(e,"label",n=t[31].header)},m(t,n){p(t,e,n)},p(t,s){4&s[0]&&n!==(n=t[31].header)&&y(e,"label",n)},d(t){t&&g(e)}}}function Je(t){let e,n,s,r,l=t[31].name+"";return{c(){e=h("option"),n=x(l),s=b(),e.__value=r=t[31].num,e.value=e.__value},m(t,r){p(t,e,r),f(e,n),f(e,s)},p(t,s){4&s[0]&&l!==(l=t[31].name+"")&&_(n,l),4&s[0]&&r!==(r=t[31].num)&&(e.__value=r,e.value=e.__value)},d(t){t&&g(e)}}}function je(t){let e,n,s=t[31].header&&_e(t),r=!t[31].header&&Je(t);return{c(){s&&s.c(),e=w(),r&&r.c(),n=w()},m(t,l){s&&s.m(t,l),p(t,e,l),r&&r.m(t,l),p(t,n,l)},p(t,l){t[31].header?s?s.p(t,l):(s=_e(t),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),t[31].header?r&&(r.d(1),r=null):r?r.p(t,l):(r=Je(t),r.c(),r.m(n.parentNode,n))},d(t){s&&s.d(t),t&&g(e),r&&r.d(t),t&&g(n)}}}function Se(t){let e,n,s,r,l=t[28].label+"";return{c(){e=h("option"),n=x(l),s=b(),e.__value=r=t[28].name,e.value=e.__value},m(t,r){p(t,e,r),f(e,n),f(e,s)},p(t,s){2&s[0]&&l!==(l=t[28].label+"")&&_(n,l),2&s[0]&&r!==(r=t[28].name)&&(e.__value=r,e.value=e.__value)},d(t){t&&g(e)}}}function Te(t){let e,n=Object.entries(t[21]),s=[];for(let e=0;eZ(E[t],1,1,(()=>{E[t]=null}));return{c(){e=h("div"),n=h("select");for(let t=0;t| Тип | \n Id | \n Виджет | \n Вкладка | \n Название | \n | \n | ',u=b(),d=h("tbody");for(let t=0;tt[10].call(n))),o.__value="Выберите пресет",o.value=o.__value,y(l,"class","slct-lg"),y(e,"class","grd-2col2"),y(a,"class","bg-gray-100"),y(d,"class","bg-white"),y(i,"class","tbl"),y(w,"class","btn-lg"),y(_,"class","btn-lg"),y(x,"class","grd-2col1")},m(s,g){p(s,e,g),f(e,n);for(let t=0;t{o[i]=null})),Q(),n=o[e],n?n.p(t,r):(n=o[e]=l[e](t),n.c()),G(n,1),n.m(s.parentNode,s))},i(t){r||(G(n),r=!0)},o(t){Z(n),r=!1},d(t){o[e].d(t),t&&g(s)}}}function Ce(t,e,n){let{configJson:s}=e,{widgetsJson:r}=e,{itemsJson:l}=e,{show:o}=e,c=0,{saveConfig:i=(()=>{})}=e,{rebootEsp:a=(()=>{})}=e,u=!0;function d(){for(let t=0;t{"configJson"in t&&n(0,s=t.configJson),"widgetsJson"in t&&n(1,r=t.widgetsJson),"itemsJson"in t&&n(2,l=t.itemsJson),"show"in t&&n(3,o=t.show),"saveConfig"in t&&n(4,i=t.saveConfig),"rebootEsp"in t&&n(5,a=t.rebootEsp)},[s,r,l,o,i,a,c,u,d,f,function(){c=S(this),n(6,c),n(2,l)},()=>d(),function(t,e){t[e].id=this.value,n(0,s),n(1,r)},function(t,e){t[e].widget=S(this),n(0,s),n(1,r)},function(t,e){t[e].page=this.value,n(0,s),n(1,r)},function(t,e){t[e].descr=this.value,n(0,s),n(1,r)},()=>n(7,u=!u),t=>f(t),function(t,e,l){e[l][t]=this.value,n(0,s),n(1,r)},()=>i(),()=>a()]}class Ne extends rt{constructor(t){super(),st(this,t,Ce,Oe,l,{configJson:0,widgetsJson:1,itemsJson:2,show:3,saveConfig:4,rebootEsp:5},null,[-1,-1])}}function He(t,e,n){const s=t.slice();return s[23]=e[n][0],s[24]=e[n][1],s}function Pe(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||(G(n.$$.fragment,t),s=!0)},o(t){Z(n.$$.fragment,t),s=!1},d(t){nt(n,t)}}}function Ae(t){let e,n,s,r,l,o,c,i;return n=new Bt({props:{title:"Подключение к WiFi",$$slots:{default:[Ie]},$$scope:{ctx:t}}}),r=new Bt({props:{title:"Подключение к MQTT",$$slots:{default:[We]},$$scope:{ctx:t}}}),c=new Bt({props:{$$slots:{default:[Ve]},$$scope:{ctx:t}}}),{c(){e=h("div"),tt(n.$$.fragment),s=b(),tt(r.$$.fragment),l=b(),o=h("div"),tt(c.$$.fragment),y(e,"class","grd-2col1"),y(o,"class","grd-1col1")},m(t,a){p(t,e,a),et(n,e,null),f(e,s),et(r,e,null),p(t,l,a),p(t,o,a),et(c,o,null),i=!0},p(t,e){const s={};134217783&e&&(s.$$scope={dirty:e,ctx:t}),n.$set(s);const l={};134217795&e&&(l.$$scope={dirty:e,ctx:t}),r.$set(l);const o={};134217856&e&&(o.$$scope={dirty:e,ctx:t}),c.$set(o)},i(t){i||(G(n.$$.fragment,t),G(r.$$.fragment,t),G(c.$$.fragment,t),i=!0)},o(t){Z(n.$$.fragment,t),Z(r.$$.fragment,t),Z(c.$$.fragment,t),i=!1},d(t){t&&g(e),nt(n),nt(r),t&&g(l),t&&g(o),nt(c)}}}function De(t){let e,n,s,r,l=t[24]+"";return{c(){e=h("option"),n=x(l),s=b(),e.__value=r=t[24],e.value=e.__value},m(t,r){p(t,e,r),f(e,n),f(e,s)},p(t,s){4&s&&l!==(l=t[24]+"")&&_(n,l),4&s&&r!==(r=t[24])&&(e.__value=r,e.value=e.__value)},d(t){t&&g(e)}}}function Be(t){let e,n,s;return n=new Ot({props:{title:"Введен неправильный пароль"}}),{c(){e=h("div"),tt(n.$$.fragment),y(e,"class","grd-1col1")},m(t,r){p(t,e,r),et(n,e,null),s=!0},i(t){s||(G(n.$$.fragment,t),s=!0)},o(t){Z(n.$$.fragment,t),s=!1},d(t){t&&g(e),nt(n)}}}function Ie(t){let e,n,r,l,o,c,i,a,u,d,$,x,w,k,_,S,T,L,M,q,E,O,C,N,H,P,A,D,B,z,R,F,U,W,V,Y,X,tt,et,nt,st,rt=Object.entries(t[2]),lt=[];for(let e=0;eНазвание устройства
',r=b(),l=h("div"),o=h("input"),c=b(),i=h("div"),a=h("div"),a.innerHTML='Точка доступа
',u=b(),d=h("div"),$=h("input"),x=b(),w=h("div"),k=h("div"),k.innerHTML='Пароль точки доступа
',_=b(),S=h("div"),T=h("input"),L=b(),M=h("div"),q=h("div"),q.innerHTML='Название wifi сети
',E=b(),O=h("div"),C=h("select");for(let t=0;tПароль',A=b(),D=h("div"),B=h("input"),z=b(),R=h("div"),F=h("div"),F.innerHTML='Сервер обновления
',U=b(),W=h("div"),V=h("input"),Y=b(),ot&&ot.c(),X=b(),tt=h("button"),tt.textContent="Сохранить",y(n,"class","w-4/6"),y(o,"class","ipt-rnd text-left focus:border-indigo-500"),y(o,"type","text"),y(l,"class","flex justify-end w-3/6"),y(e,"class","crd-itm-psn"),y(a,"class","w-4/6"),y($,"class","ipt-rnd text-left focus:border-indigo-500"),y($,"type","text"),y(d,"class","flex justify-end w-3/6"),y(i,"class","crd-itm-psn"),y(k,"class","w-4/6"),y(T,"class","ipt-rnd text-left focus:border-indigo-500"),y(T,"type","text"),y(S,"class","flex justify-end w-3/6"),y(w,"class","crd-itm-psn"),y(q,"class","w-4/6"),y(C,"class","ipt-rnd text-left focus:border-indigo-500"),void 0===t[0].routerssid&&I((()=>t[11].call(C))),y(O,"class","flex justify-end w-3/6"),y(M,"class","crd-itm-psn"),y(P,"class","w-4/6"),y(B,"class","ipt-rnd text-left focus:border-indigo-500"),y(B,"type","text"),y(D,"class","flex justify-end w-3/6"),y(H,"class","crd-itm-psn"),y(F,"class","w-4/6"),y(V,"class","ipt-rnd text-left focus:border-indigo-500"),y(V,"type","text"),y(W,"class","flex justify-end w-3/6"),y(R,"class","crd-itm-psn"),y(tt,"class","btn-lg")},m(s,g){p(s,e,g),f(e,n),f(e,r),f(e,l),f(l,o),J(o,t[0].name),p(s,c,g),p(s,i,g),f(i,a),f(i,u),f(i,d),f(d,$),J($,t[0].apssid),p(s,x,g),p(s,w,g),f(w,k),f(w,_),f(w,S),f(S,T),J(T,t[0].appass),p(s,L,g),p(s,M,g),f(M,q),f(M,E),f(M,O),f(O,C);for(let t=0;t{ot=null})),Q())},i(t){et||(G(ot),et=!0)},o(t){Z(ot),et=!1},d(t){t&&g(e),t&&g(c),t&&g(i),t&&g(x),t&&g(w),t&&g(L),t&&g(M),m(lt,t),t&&g(N),t&&g(H),t&&g(z),t&&g(R),t&&g(Y),ot&&ot.d(t),t&&g(X),t&&g(tt),nt=!1,s(st)}}}function ze(t){let e;return{c(){e=h("p"),e.textContent="Ошибка",y(e,"class","text-red-500 font-bold h-8 bg-red-50 border-2 border-gray-200 rounded w-full text-center")},m(t,n){p(t,e,n)},d(t){t&&g(e)}}}function Re(t){let e;return{c(){e=h("p"),e.textContent="Ожидание",y(e,"class","text-blue-500 font-bold h-8 bg-blue-50 border-2 border-gray-200 rounded w-full text-center")},m(t,n){p(t,e,n)},d(t){t&&g(e)}}}function Fe(t){let e;return{c(){e=h("p"),e.textContent="Подключение",y(e,"class","text-yellow-500 font-bold h-8 bg-yellow-50 border-2 border-gray-200 rounded w-full text-center")},m(t,n){p(t,e,n)},d(t){t&&g(e)}}}function Ue(t){let e;return{c(){e=h("p"),e.textContent="Подключено",y(e,"class","text-green-500 font-bold h-8 bg-green-50 border-2 border-gray-200 rounded w-full text-center")},m(t,n){p(t,e,n)},d(t){t&&g(e)}}}function We(t){let e,n,r,l,o,c,i,a,u,d,m,$,x,w,k,_,j,S,T,L,M,q,E,O,C,N,H,P,A,D,B,I,z,R,F,U,W,V;function Y(t,e){return"e5"===t[1].mqtt?Ue:"e13"===t[1].mqtt?Fe:void 0===t[1].mqtt?Re:ze}let K=Y(t),Q=K(t);return{c(){e=h("div"),n=h("div"),n.innerHTML='Состояние подключения
',r=b(),l=h("div"),Q.c(),o=b(),c=h("div"),i=h("div"),i.innerHTML='Название сервера
',a=b(),u=h("div"),d=h("input"),m=b(),$=h("div"),x=h("div"),x.innerHTML='Порт
',w=b(),k=h("div"),_=h("input"),j=b(),S=h("div"),T=h("div"),T.innerHTML='Префикс
',L=b(),M=h("div"),q=h("input"),E=b(),O=h("div"),C=h("div"),C.innerHTML='Имя пользователя
',N=b(),H=h("div"),P=h("input"),A=b(),D=h("div"),B=h("div"),B.innerHTML='Пароль
',I=b(),z=h("div"),R=h("input"),F=b(),U=h("button"),U.textContent="Сохранить",y(n,"class","w-4/6"),y(l,"class","flex justify-center w-3/6 align-baseline text-sm sm:text-sm md:text-base lg:text-base xl:text-base 2xl:text-base break-words"),y(e,"class","crd-itm-psn"),y(i,"class","w-4/6"),y(d,"class","ipt-rnd text-left focus:border-indigo-500"),y(d,"type","text"),y(u,"class","flex justify-end w-3/6"),y(c,"class","crd-itm-psn"),y(x,"class","w-4/6"),y(_,"class","ipt-rnd text-left focus:border-indigo-500"),y(_,"type","text"),y(k,"class","flex justify-end w-3/6"),y($,"class","crd-itm-psn"),y(T,"class","w-4/6"),y(q,"class","ipt-rnd text-left focus:border-indigo-500"),y(q,"type","text"),y(M,"class","flex justify-end w-3/6"),y(S,"class","crd-itm-psn"),y(C,"class","w-4/6"),y(P,"class","ipt-rnd text-left focus:border-indigo-500"),y(P,"type","text"),y(H,"class","flex justify-end w-3/6"),y(O,"class","crd-itm-psn"),y(B,"class","w-4/6"),y(R,"class","ipt-rnd text-left focus:border-indigo-500"),y(R,"type","text"),y(z,"class","flex justify-end w-3/6"),y(D,"class","crd-itm-psn"),y(U,"class","btn-lg")},m(s,g){p(s,e,g),f(e,n),f(e,r),f(e,l),Q.m(l,null),p(s,o,g),p(s,c,g),f(c,i),f(c,a),f(c,u),f(u,d),J(d,t[0].mqttServer),p(s,m,g),p(s,$,g),f($,x),f($,w),f($,k),f(k,_),J(_,t[0].mqttPort),p(s,j,g),p(s,S,g),f(S,T),f(S,L),f(S,M),f(M,q),J(q,t[0].mqttPrefix),p(s,E,g),p(s,O,g),f(O,C),f(O,N),f(O,H),f(H,P),J(P,t[0].mqttUser),p(s,A,g),p(s,D,g),f(D,B),f(D,I),f(D,z),f(z,R),J(R,t[0].mqttPass),p(s,F,g),p(s,U,g),W||(V=[v(d,"input",t[16]),v(_,"input",t[17]),v(q,"input",t[18]),v(P,"input",t[19]),v(R,"input",t[20]),v(U,"click",t[21])],W=!0)},p(t,e){K!==(K=Y(t))&&(Q.d(1),Q=K(t),Q&&(Q.c(),Q.m(l,null))),5&e&&d.value!==t[0].mqttServer&&J(d,t[0].mqttServer),5&e&&_.value!==t[0].mqttPort&&J(_,t[0].mqttPort),5&e&&q.value!==t[0].mqttPrefix&&J(q,t[0].mqttPrefix),5&e&&P.value!==t[0].mqttUser&&J(P,t[0].mqttUser),5&e&&R.value!==t[0].mqttPass&&J(R,t[0].mqttPass)},d(t){t&&g(e),Q.d(),t&&g(o),t&&g(c),t&&g(m),t&&g($),t&&g(j),t&&g(S),t&&g(E),t&&g(O),t&&g(A),t&&g(D),t&&g(F),t&&g(U),W=!1,s(V)}}}function Ve(e){let n,s,r;return{c(){n=h("button"),n.textContent="Перезагрузить устройство",y(n,"class","btn-lg")},m(t,l){p(t,n,l),s||(r=v(n,"click",e[22]),s=!0)},p:t,d(t){t&&g(n),s=!1,r()}}}function Ye(t){let e,n,s,r;const l=[Ae,Pe],o=[];function c(t,e){return t[3]?0:1}return e=c(t),n=o[e]=l[e](t),{c(){n.c(),s=w()},m(t,n){o[e].m(t,n),p(t,s,n),r=!0},p(t,[r]){let i=e;e=c(t),e===i?o[e].p(t,r):(K(),Z(o[i],1,1,(()=>{o[i]=null})),Q(),n=o[e],n?n.p(t,r):(n=o[e]=l[e](t),n.c()),G(n,1),n.m(s.parentNode,s))},i(t){r||(G(n),r=!0)},o(t){Z(n),r=!1},d(t){o[e].d(t),t&&g(s)}}}function Ke(t,e,n){let{settingsJson:s}=e,{errorsJson:r}=e,{ssidJson:l}=e,{show:o}=e,{ssidClick:c=(()=>{})}=e,{saveSett:i=(()=>{})}=e,{saveMqtt:a=(()=>{})}=e,{rebootEsp:u=(()=>{})}=e;return t.$$set=t=>{"settingsJson"in t&&n(0,s=t.settingsJson),"errorsJson"in t&&n(1,r=t.errorsJson),"ssidJson"in t&&n(2,l=t.ssidJson),"show"in t&&n(3,o=t.show),"ssidClick"in t&&n(4,c=t.ssidClick),"saveSett"in t&&n(5,i=t.saveSett),"saveMqtt"in t&&n(6,a=t.saveMqtt),"rebootEsp"in t&&n(7,u=t.rebootEsp)},[s,r,l,o,c,i,a,u,function(){s.name=this.value,n(0,s),n(2,l)},function(){s.apssid=this.value,n(0,s),n(2,l)},function(){s.appass=this.value,n(0,s),n(2,l)},function(){s.routerssid=S(this),n(0,s),n(2,l)},()=>c(),function(){s.routerpass=this.value,n(0,s),n(2,l)},function(){s.serverip=this.value,n(0,s),n(2,l)},()=>i(),function(){s.mqttServer=this.value,n(0,s),n(2,l)},function(){s.mqttPort=this.value,n(0,s),n(2,l)},function(){s.mqttPrefix=this.value,n(0,s),n(2,l)},function(){s.mqttUser=this.value,n(0,s),n(2,l)},function(){s.mqttPass=this.value,n(0,s),n(2,l)},()=>a(),()=>u()]}class Qe extends rt{constructor(t){super(),st(this,t,Ke,Ye,l,{settingsJson:0,errorsJson:1,ssidJson:2,show:3,ssidClick:4,saveSett:5,saveMqtt:6,rebootEsp:7})}}function Ge(t,e,n){const s=t.slice();return s[13]=e[n],s[15]=n,s}function Ze(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||(G(n.$$.fragment,t),s=!0)},o(t){Z(n.$$.fragment,t),s=!1},d(t){nt(n,t)}}}function Xe(t){let e,n,s,r,l;return n=new Bt({props:{title:"Список устройств",$$slots:{default:[nn]},$$scope:{ctx:t}}}),r=new Ot({props:{$$slots:{default:[sn]},$$scope:{ctx:t}}}),{c(){e=h("div"),tt(n.$$.fragment),s=b(),tt(r.$$.fragment),y(e,"class","grd-1col1")},m(t,o){p(t,e,o),et(n,e,null),f(e,s),et(r,e,null),l=!0},p(t,e){const s={};65591&e&&(s.$$scope={dirty:e,ctx:t}),n.$set(s);const l={};65536&e&&(l.$$scope={dirty:e,ctx:t}),r.$set(l)},i(t){l||(G(n.$$.fragment,t),G(r.$$.fragment,t),l=!0)},o(t){Z(n.$$.fragment,t),Z(r.$$.fragment,t),l=!1},d(t){t&&g(e),nt(n),nt(r)}}}function tn(t){let e,n,s,r,l,o,c,i,a,u,d,m,$,w,v,k,J,j,S,T=t[13].name+"",L=t[13].ip+"",M=t[13].id+"",q=t[13].status?"online":"offline";return j=new Tt({props:{click:function(){return t[7](t[15])}}}),{c(){e=h("tr"),n=h("td"),s=x(T),r=b(),l=h("td"),o=h("a"),c=x(L),a=b(),u=h("td"),d=x(M),m=b(),$=h("td"),w=x(q),k=b(),J=h("td"),tt(j.$$.fragment),y(n,"class","tbl-bdy-lg ipt-lg w-full"),y(o,"href",i="http://"+t[13].ip),y(l,"class","tbl-bdy-lg ipt-lg w-full"),y(u,"class","tbl-bdy-lg ipt-lg w-full"),y($,"class",v="tbl-bdy-lg ipt-lg w-full "+(t[13].status?"bg-green-50":"bg-red-50")),y(J,"class","tbl-bdy-lg"),y(e,"class","txt-sz txt-pad")},m(t,i){p(t,e,i),f(e,n),f(n,s),f(e,r),f(e,l),f(l,o),f(o,c),f(e,a),f(e,u),f(u,d),f(e,m),f(e,$),f($,w),f(e,k),f(e,J),et(j,J,null),S=!0},p(e,n){t=e,(!S||1&n)&&T!==(T=t[13].name+"")&&_(s,T),(!S||1&n)&&L!==(L=t[13].ip+"")&&_(c,L),(!S||1&n&&i!==(i="http://"+t[13].ip))&&y(o,"href",i),(!S||1&n)&&M!==(M=t[13].id+"")&&_(d,M),(!S||1&n)&&q!==(q=t[13].status?"online":"offline")&&_(w,q),(!S||1&n&&v!==(v="tbl-bdy-lg ipt-lg w-full "+(t[13].status?"bg-green-50":"bg-red-50")))&&y($,"class",v)},i(t){S||(G(j.$$.fragment,t),S=!0)},o(t){Z(j.$$.fragment,t),S=!1},d(t){t&&g(e),nt(j)}}}function en(t){let e,n,r,l,o,c,i,a,u,d,m,$,x;return{c(){e=h("tr"),n=h("td"),r=h("input"),l=b(),o=h("td"),c=h("input"),i=b(),a=h("td"),u=h("input"),d=b(),m=h("td"),y(r,"class","ipt-lg w-full"),y(r,"type","text"),y(n,"class","tbl-bdy-lg"),y(c,"class","ipt-lg w-full"),y(c,"type","text"),y(o,"class","tbl-bdy-lg"),y(u,"class","ipt-lg w-full"),y(u,"type","text"),y(a,"class","tbl-bdy-lg"),y(m,"class","tbl-bdy-lg"),y(e,"class","txt-sz txt-pad")},m(s,g){p(s,e,g),f(e,n),f(n,r),J(r,t[2].name),f(e,l),f(e,o),f(o,c),J(c,t[2].ip),f(e,i),f(e,a),f(a,u),J(u,t[2].id),f(e,d),f(e,m),$||(x=[v(r,"input",t[8]),v(c,"input",t[9]),v(u,"input",t[10])],$=!0)},p(t,e){4&e&&r.value!==t[2].name&&J(r,t[2].name),4&e&&c.value!==t[2].ip&&J(c,t[2].ip),4&e&&u.value!==t[2].id&&J(u,t[2].id)},d(t){t&&g(e),$=!1,s(x)}}}function nn(t){let e,n,r,l,o,c,i,a,u,d,$,w,k,J,j=t[1]?"Сохранить":"Добавить устройство",S=t[0],T=[];for(let e=0;eZ(T[t],1,1,(()=>{T[t]=null}));let M=t[1]&&en(t);return{c(){e=h("table"),n=h("thead"),n.innerHTML='| Название устройства | \n IP адрес | \n Идентификатор | \n Состояние | \n |
',r=b(),l=h("tbody");for(let t=0;t{o[i]=null})),Q(),n=o[e],n?n.p(t,r):(n=o[e]=l[e](t),n.c()),G(n,1),n.m(s.parentNode,s))},i(t){r||(G(n),r=!0)},o(t){Z(n),r=!1},d(t){o[e].d(t),t&&g(s)}}}function ln(t,e,n){let{show:s}=e,{deviceList:r}=e,{showInput:l}=e,{newDevice:o={}}=e,{addDevInList:c=(()=>{})}=e,{sendToAllDevices:i=(t=>{})}=e;function a(t){for(let e=0;e{"show"in t&&n(3,s=t.show),"deviceList"in t&&n(0,r=t.deviceList),"showInput"in t&&n(1,l=t.showInput),"newDevice"in t&&n(2,o=t.newDevice),"addDevInList"in t&&n(4,c=t.addDevInList),"sendToAllDevices"in t&&n(5,i=t.sendToAllDevices)},[r,l,o,s,c,i,a,t=>a(t),function(){o.name=this.value,n(2,o)},function(){o.ip=this.value,n(2,o)},function(){o.id=this.value,n(2,o)},()=>(n(1,l=!l),c()),t=>i("/reboot|")]}class on extends rt{constructor(t){super(),st(this,t,ln,rn,l,{show:3,deviceList:0,showInput:1,newDevice:2,addDevInList:4,sendToAllDevices:5})}}function cn(t,e,n){const s=t.slice();return s[18]=e[n][0],s[19]=e[n][1],s[21]=n,s}function an(t,e,n){const s=t.slice();return s[22]=e[n],s[21]=n,s}function un(t,e,n){const s=t.slice();return s[18]=e[n][0],s[19]=e[n][1],s}function dn(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||(G(n.$$.fragment,t),s=!0)},o(t){Z(n.$$.fragment,t),s=!1},d(t){nt(n,t)}}}function fn(t){let e,n,s,r,l,o,c,i,a,u;return n=new Bt({props:{title:"Системная информация",$$slots:{default:[vn]},$$scope:{ctx:t}}}),r=new Bt({props:{title:"Системные настройки",$$slots:{default:[yn]},$$scope:{ctx:t}}}),o=new Bt({props:{title:"Лог",$$slots:{default:[_n]},$$scope:{ctx:t}}}),a=new Bt({props:{title:"Системные ошибки",$$slots:{default:[Ln]},$$scope:{ctx:t}}}),{c(){e=h("div"),tt(n.$$.fragment),s=b(),tt(r.$$.fragment),l=b(),tt(o.$$.fragment),c=b(),i=h("div"),tt(a.$$.fragment),y(e,"class","grd-3col1"),y(i,"class","grd-1col1")},m(t,d){p(t,e,d),et(n,e,null),f(e,s),et(r,e,null),f(e,l),et(o,e,null),p(t,c,d),p(t,i,d),et(a,i,null),u=!0},p(t,e){const s={};67108949&e&&(s.$$scope={dirty:e,ctx:t}),n.$set(s);const l={};67109002&e&&(l.$$scope={dirty:e,ctx:t}),r.$set(l);const c={};67108896&e&&(c.$$scope={dirty:e,ctx:t}),o.$set(c);const i={};67109380&e&&(i.$$scope={dirty:e,ctx:t}),a.$set(i)},i(t){u||(G(n.$$.fragment,t),G(r.$$.fragment,t),G(o.$$.fragment,t),G(a.$$.fragment,t),u=!0)},o(t){Z(n.$$.fragment,t),Z(r.$$.fragment,t),Z(o.$$.fragment,t),Z(a.$$.fragment,t),u=!1},d(t){t&&g(e),nt(n),nt(r),nt(o),t&&g(c),t&&g(i),nt(a)}}}function pn(t){let e,n,s,r,l=t[19]+"";return{c(){e=h("option"),n=x(l),s=b(),e.__value=r=t[19],e.value=e.__value},m(t,r){p(t,e,r),f(e,n),f(e,s)},p(t,s){16&s&&l!==(l=t[19]+"")&&_(n,l),16&s&&r!==(r=t[19])&&(e.__value=r,e.value=e.__value)},d(t){t&&g(e)}}}function gn(t){let e;return{c(){e=h("p"),e.textContent="не подключено",y(e,"class","text-red-500 font-bold text-sm text-center truncate")},m(t,n){p(t,e,n)},d(t){t&&g(e)}}}function mn(t){let e;return{c(){e=h("p"),e.textContent="нет сигнала",y(e,"class","text-red-500 font-bold text-sm text-center truncate")},m(t,n){p(t,e,n)},d(t){t&&g(e)}}}function hn(t){let e;return{c(){e=h("p"),e.textContent="очень низкий",y(e,"class","text-red-500 font-bold text-sm text-center truncate")},m(t,n){p(t,e,n)},d(t){t&&g(e)}}}function $n(t){let e;return{c(){e=h("p"),e.textContent="низкий",y(e,"class","text-yellow-500 font-bold text-sm text-center truncate")},m(t,n){p(t,e,n)},d(t){t&&g(e)}}}function xn(t){let e;return{c(){e=h("p"),e.textContent="хороший",y(e,"class","text-yellow-500 font-bold text-sm text-center truncate")},m(t,n){p(t,e,n)},d(t){t&&g(e)}}}function bn(t){let e;return{c(){e=h("p"),e.textContent="очень хороший",y(e,"class","text-green-500 font-bold text-sm text-center truncate")},m(t,n){p(t,e,n)},d(t){t&&g(e)}}}function wn(t){let e;return{c(){e=h("p"),e.textContent="отличный",y(e,"class","text-green-500 font-bold text-sm text-center truncate")},m(t,n){p(t,e,n)},d(t){t&&g(e)}}}function vn(t){let e,n,r,l,o,c,i,a,u,d,$,w,k,J,S,T,L,M,q,E,O,C,N,H,P,A,D,B,z,R,F,U,W,V,Y,K,Q,G,Z,X,tt,et,nt,st,rt,lt,ot,ct,it,at,ut,dt,ft,pt,gt,mt,ht,$t,xt,bt,wt,vt,yt,kt,_t,Jt,jt,St,Tt,Lt,Mt,qt,Et,Ot,Ct,Nt,Ht,Pt=t[2].bn+"",At=t[2].bver+"",Dt=t[2].upt+"",Bt=t[2].uptm+"",It=t[2].uptw+"",zt=t[2].heap+"",Rt=t[2].fl+"",Ft=t[2].rst+"",Ut=Object.entries(t[4]),Wt=[];for(let e=0;eНазвание прошивки',r=b(),l=h("div"),o=h("p"),c=x(Pt),i=b(),a=h("div"),u=h("div"),u.innerHTML='Доступные версии
',d=b(),$=h("div"),w=h("select");for(let t=0;tВерсия прошивки',T=b(),L=h("div"),M=h("p"),q=x(At),E=b(),O=h("div"),C=h("div"),C.innerHTML='Uptime устройства
',N=b(),H=h("div"),P=h("p"),A=x(Dt),D=b(),B=h("div"),z=h("div"),z.innerHTML='Uptime сессии mqtt
',R=b(),F=h("div"),U=h("p"),W=x(Bt),V=b(),Y=h("div"),K=h("div"),K.innerHTML='Uptime сессии wifi
',Q=b(),G=h("div"),Z=h("p"),X=x(It),tt=b(),et=h("div"),nt=h("div"),nt.innerHTML='Качество WiFi сигнала
',st=b(),rt=h("div"),Vt&&Vt.c(),lt=b(),Yt&&Yt.c(),ot=b(),Kt&&Kt.c(),ct=b(),Qt&&Qt.c(),it=b(),Gt&&Gt.c(),at=b(),Zt&&Zt.c(),ut=b(),Xt&&Xt.c(),dt=b(),ft=h("div"),pt=h("div"),pt.innerHTML='Остаток RAM
',gt=b(),mt=h("div"),ht=h("p"),$t=x(zt),xt=b(),bt=h("div"),wt=h("div"),wt.innerHTML='Кол-во записей на flash
',vt=b(),yt=h("div"),kt=h("p"),_t=x(Rt),Jt=b(),jt=h("div"),St=h("div"),St.innerHTML='Причина перезагрузки
',Tt=b(),Lt=h("div"),Mt=h("p"),qt=x(Ft),Ot=b(),Ct=h("button"),Ct.textContent="Обновить прошивку",y(n,"class","w-2/3"),y(o,"class","text-gray-500 font-bold text-sm text-center truncate"),y(l,"class","flex justify-center w-1/3"),y(e,"class","flex mb-2 h-6 items-center"),y(u,"class","w-2/3"),y(w,"class","border border-indigo-500 border-4 text-center"),void 0===t[0]&&I((()=>t[11].call(w))),y($,"class","flex justify-center w-1/3"),y(a,"class","flex mb-2 h-6 items-center"),y(S,"class","w-2/3"),y(M,"class","text-gray-500 font-bold text-sm text-center truncate"),y(L,"class","flex justify-center w-1/3"),y(J,"class","flex mb-2 h-6 items-center"),y(C,"class","w-2/3"),y(P,"class","text-gray-500 font-bold text-sm text-center truncate"),y(H,"class","flex justify-center w-1/3"),y(O,"class","flex mb-2 h-6 items-center"),y(z,"class","w-2/3"),y(U,"class","text-gray-500 font-bold text-sm text-center truncate"),y(F,"class","flex justify-center w-1/3"),y(B,"class","flex mb-2 h-6 items-center"),y(K,"class","w-2/3"),y(Z,"class","text-gray-500 font-bold text-sm text-center truncate"),y(G,"class","flex justify-center w-1/3"),y(Y,"class","flex mb-2 h-6 items-center"),y(nt,"class","w-2/3"),y(rt,"class","flex justify-center w-1/3 text-xs sm:text-sm md:text-base lg:text-base xl:text-base 2xl:text-base break-words"),y(et,"class","flex mb-2 h-6 items-center"),y(pt,"class","w-2/3"),y(ht,"class","text-green-500 font-bold text-center truncate"),y(mt,"class","flex justify-center w-1/3 text-sm text-center"),y(ft,"class","flex mb-2 h-6 items-center"),y(wt,"class","w-2/3"),y(kt,"class","text-green-500 font-bold text-center truncate"),y(yt,"class","flex justify-center w-1/3 text-sm"),y(bt,"class","flex mb-2 h-6 items-center"),y(St,"class","w-2/3"),y(Mt,"class",Et=(t[2].rst.includes("Watchdog")||t[2].rst.includes("Exception")?"text-red-500":"text-green-500")+" font-bold text-center truncate"),y(Lt,"class","flex justify-center w-1/3 text-sm"),y(jt,"class","flex mb-2 h-6 items-center"),y(Ct,"class","btn-lg")},m(s,g){p(s,e,g),f(e,n),f(e,r),f(e,l),f(l,o),f(o,c),p(s,i,g),p(s,a,g),f(a,u),f(a,d),f(a,$),f($,w);for(let t=0;tВключить лог',r=b(),l=h("div"),o=h("input"),c=b(),i=h("button"),i.textContent="Перезагрузить устройство",y(n,"class","w-5/6"),y(o,"type","checkbox"),y(o,"class","form-checkbox h-4 w-4 text-gray-600"),y(l,"class","flex justify-center w-1/6"),y(e,"class","flex mb-2 h-6 items-center"),y(i,"class","btn-lg")},m(s,d){p(s,e,d),f(e,n),f(e,r),f(e,l),f(l,o),o.checked=t[1].log,p(s,c,d),p(s,i,d),a||(u=[v(o,"change",t[13]),v(o,"change",t[14]),v(i,"click",t[15])],a=!0)},p(t,e){2&e&&(o.checked=t[1].log)},d(t){t&&g(e),t&&g(c),t&&g(i),a=!1,s(u)}}}function kn(t){let e,n,s,r=t[22].msg+"";return{c(){e=h("div"),n=x(r),y(e,"class",s=t[22].msg.toString().includes("[E]")?"text-xs text-red-500":"text-xs text-black")},m(t,s){p(t,e,s),f(e,n)},p(t,l){32&l&&r!==(r=t[22].msg+"")&&_(n,r),32&l&&s!==(s=t[22].msg.toString().includes("[E]")?"text-xs text-red-500":"text-xs text-black")&&y(e,"class",s)},d(t){t&&g(e)}}}function _n(t){let e,n=t[5],s=[];for(let e=0;e{s=null})),Q())},i(t){n||(G(s),n=!0)},o(t){Z(s),n=!1},d(t){s&&s.d(t),t&&g(e)}}}function Ln(t){let e,n,s=Object.entries(t[2]),r=[];for(let e=0;eZ(r[t],1,1,(()=>{r[t]=null}));return{c(){for(let t=0;t{o[i]=null})),Q(),n=o[e],n?n.p(t,r):(n=o[e]=l[e](t),n.c()),G(n,1),n.m(s.parentNode,s))},i(t){r||(G(n),r=!0)},o(t){Z(n),r=!1},d(t){o[e].d(t),t&&g(s)}}}function qn(t,e,n){let{errorsJson:s}=e,{rebootEsp:r=(()=>{})}=e,{versionsList:l}=e,{choosingVersion:o}=e,{coreMessages:c}=e,{settingsJson:i}=e,{startUpdate:a=(()=>{})}=e,{saveSett:u=(()=>{})}=e,{show:d}=e,{cancelAlarm:f=(t=>{})}=e;return t.$$set=t=>{"errorsJson"in t&&n(2,s=t.errorsJson),"rebootEsp"in t&&n(3,r=t.rebootEsp),"versionsList"in t&&n(4,l=t.versionsList),"choosingVersion"in t&&n(0,o=t.choosingVersion),"coreMessages"in t&&n(5,c=t.coreMessages),"settingsJson"in t&&n(1,i=t.settingsJson),"startUpdate"in t&&n(6,a=t.startUpdate),"saveSett"in t&&n(7,u=t.saveSett),"show"in t&&n(8,d=t.show),"cancelAlarm"in t&&n(9,f=t.cancelAlarm)},[o,i,s,r,l,c,a,u,d,f,{mqtt:{e1:{descr:"Ошибка mqtt",color:"text-red-500",txt:"Нет ответа от сервера",cancel:!1},e2:{descr:"Ошибка mqtt",color:"text-red-500",txt:"Соединение было разорвано",cancel:!1},e3:{descr:"Ошибка mqtt",color:"text-red-500",txt:"Ошибка соединения. Обычно возникает когда неверно указано название сервера MQTT",cancel:!1},e4:{descr:"Ошибка mqtt",color:"text-red-500",txt:"Клиент был отключен",cancel:!1},e6:{descr:"Ошибка mqtt",color:"text-red-500",txt:"Ошибка версии",cancel:!1},e7:{descr:"Ошибка mqtt",color:"text-red-500",txt:"Отклонен идентификатор",cancel:!1},e8:{descr:"Ошибка mqtt",color:"text-red-500",txt:"Не могу установить соединение",cancel:!1},e9:{descr:"Ошибка mqtt",color:"text-red-500",txt:"Неправильное имя пользователя/пароль"},e10:{descr:"Ошибка mqtt",color:"text-red-500",txt:"Не авторизован для подключения",cancel:!1},e11:{descr:"Ошибка mqtt",color:"text-red-500",txt:"Название сервера пустое",cancel:!1},e12:{descr:"Ошибка mqtt",color:"text-red-500",txt:"Имя пользователя или пароль пустые",cancel:!1},e13:{descr:"Mqtt",color:"text-red-500",txt:"Подключение в процессе",cancel:!1}},wse1:{1:{descr:"Ошибка веб сокетов",color:"text-red-500",txt:"Слишком много клиентов было открыто. Допускается не более четырех.",cancel:!0}},jse1:{1:{descr:"Ошибка json",color:"text-red-500",txt:"Недостаточный размер буфера библиотеки Arduino Json. Устройство может вести себя непредсказуемо. Обратитесь к разработчику.",cancel:!0}},jse2:{1:{descr:"Ошибка json",color:"text-red-500",txt:"Ошибка записи/чтения json.",cancel:!0,num:!0}},jse3:{1:{descr:"Ошибка json",color:"text-red-500",txt:"Ошибка чтения json файла с виджетами",cancel:!0}}},function(){o=S(this),n(0,o),n(4,l)},()=>a(),function(){i.log=this.checked,n(1,i)},()=>u(),()=>r(),t=>f(t)]}class En extends rt{constructor(t){super(),st(this,t,qn,Mn,l,{errorsJson:2,rebootEsp:3,versionsList:4,choosingVersion:0,coreMessages:5,settingsJson:1,startUpdate:6,saveSett:7,show:8,cancelAlarm:9})}}function On(e){let n,s,r,l;return{c(){n=$("svg"),s=$("path"),y(s,"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"),y(n,"class",r="h-8 w-8 "+e[0]),y(n,"width","8"),y(n,"height","8"),y(n,"viewBox",l=e[1]+" "+e[2]+" 24 24"),y(n,"stroke-width","2"),y(n,"stroke","currentColor"),y(n,"fill","none"),y(n,"stroke-linecap","round"),y(n,"stroke-linejoin","round")},m(t,e){p(t,n,e),f(n,s)},p(t,[e]){1&e&&r!==(r="h-8 w-8 "+t[0])&&y(n,"class",r),6&e&&l!==(l=t[1]+" "+t[2]+" 24 24")&&y(n,"viewBox",l)},i:t,o:t,d(t){t&&g(n)}}}function Cn(t,e,n){let{color:s}=e,{x:r=0}=e,{y:l=0}=e;return t.$$set=t=>{"color"in t&&n(0,s=t.color),"x"in t&&n(1,r=t.x),"y"in t&&n(2,l=t.y)},[s,r,l]}class Nn extends rt{constructor(t){super(),st(this,t,Cn,On,l,{color:0,x:1,y:2})}}function Hn(t,e,n){const s=t.slice();return s[115]=e[n],s}function Pn(t){let e,n;return e=new Nt({}),{c(){tt(e.$$.fragment)},m(t,s){et(e,t,s),n=!0},i(t){n||(G(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){nt(e,t)}}}function An(t){let e,n,s,r,l=t[115].name+"";return{c(){e=h("option"),n=x(l),s=b(),e.__value=r=t[115].ws,e.value=e.__value},m(t,r){p(t,e,r),f(e,n),f(e,s)},p(t,s){131072&s[0]&&l!==(l=t[115].name+"")&&_(n,l),131072&s[0]&&r!==(r=t[115].ws)&&(e.__value=r,e.value=e.__value)},d(t){t&&g(e)}}}function Dn(t){let e,n,s,r,l,o,c,i,a,u;return e=new Jt({props:{path:"/",$$slots:{default:[In]},$$scope:{ctx:t}}}),s=new Jt({props:{path:"/config",$$slots:{default:[zn]},$$scope:{ctx:t}}}),l=new Jt({props:{path:"/connection",$$slots:{default:[Rn]},$$scope:{ctx:t}}}),c=new Jt({props:{path:"/list",$$slots:{default:[Fn]},$$scope:{ctx:t}}}),a=new Jt({props:{path:"/system",$$slots:{default:[Un]},$$scope:{ctx:t}}}),{c(){tt(e.$$.fragment),n=b(),tt(s.$$.fragment),r=b(),tt(l.$$.fragment),o=b(),tt(c.$$.fragment),i=b(),tt(a.$$.fragment)},m(t,d){et(e,t,d),p(t,n,d),et(s,t,d),p(t,r,d),et(l,t,d),p(t,o,d),et(c,t,d),p(t,i,d),et(a,t,d),u=!0},p(t,n){const r={};8204&n[0]|33554432&n[3]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r);const o={};7184&n[0]|33554432&n[3]&&(o.$$scope={dirty:n,ctx:t}),s.$set(o);const i={};114720&n[0]|33554432&n[3]&&(i.$$scope={dirty:n,ctx:t}),l.$set(i);const u={};1179712&n[0]|33554432&n[3]&&(u.$$scope={dirty:n,ctx:t}),c.$set(u);const d={};2147200&n[0]|33554432&n[3]&&(d.$$scope={dirty:n,ctx:t}),a.$set(d)},i(t){u||(G(e.$$.fragment,t),G(s.$$.fragment,t),G(l.$$.fragment,t),G(c.$$.fragment,t),G(a.$$.fragment,t),u=!0)},o(t){Z(e.$$.fragment,t),Z(s.$$.fragment,t),Z(l.$$.fragment,t),Z(c.$$.fragment,t),Z(a.$$.fragment,t),u=!1},d(t){nt(e,t),t&&g(n),nt(s,t),t&&g(r),nt(l,t),t&&g(o),nt(c,t),t&&g(i),nt(a,t)}}}function Bn(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||(G(n.$$.fragment,t),s=!0)},o(t){Z(n.$$.fragment,t),s=!1},d(t){nt(n,t)}}}function In(t){let e,n;return e=new ge({props:{show:t[3],layoutJson:t[13],pages:t[2],wsPush:t[39]}}),{c(){tt(e.$$.fragment)},m(t,s){et(e,t,s),n=!0},p(t,n){const s={};8&n[0]&&(s.show=t[3]),8192&n[0]&&(s.layoutJson=t[13]),4&n[0]&&(s.pages=t[2]),e.$set(s)},i(t){n||(G(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){nt(e,t)}}}function zn(t){let e,n;return e=new Ne({props:{show:t[4],configJson:t[10],widgetsJson:t[11],itemsJson:t[12],saveConfig:t[40],rebootEsp:t[41]}}),{c(){tt(e.$$.fragment)},m(t,s){et(e,t,s),n=!0},p(t,n){const s={};16&n[0]&&(s.show=t[4]),1024&n[0]&&(s.configJson=t[10]),2048&n[0]&&(s.widgetsJson=t[11]),4096&n[0]&&(s.itemsJson=t[12]),e.$set(s)},i(t){n||(G(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){nt(e,t)}}}function Rn(t){let e,n;return e=new Qe({props:{show:t[5],rebootEsp:t[42],ssidClick:t[43],saveSett:t[44],saveMqtt:t[45],settingsJson:t[14],errorsJson:t[15],ssidJson:t[16]}}),{c(){tt(e.$$.fragment)},m(t,s){et(e,t,s),n=!0},p(t,n){const s={};32&n[0]&&(s.show=t[5]),16384&n[0]&&(s.settingsJson=t[14]),32768&n[0]&&(s.errorsJson=t[15]),65536&n[0]&&(s.ssidJson=t[16]),e.$set(s)},i(t){n||(G(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){nt(e,t)}}}function Fn(t){let e,n;return e=new on({props:{show:t[6],deviceList:t[17],showInput:Vn,addDevInList:t[46],newDevice:t[20],sendToAllDevices:t[47]}}),{c(){tt(e.$$.fragment)},m(t,s){et(e,t,s),n=!0},p(t,n){const s={};64&n[0]&&(s.show=t[6]),131072&n[0]&&(s.deviceList=t[17]),1048576&n[0]&&(s.newDevice=t[20]),e.$set(s)},i(t){n||(G(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){nt(e,t)}}}function Un(t){let e,n,s;function r(e){t[52](e)}let l={show:t[7],errorsJson:t[15],settingsJson:t[14],saveSett:t[48],rebootEsp:t[49],cancelAlarm:t[50],versionsList:t[8],startUpdate:t[51],coreMessages:t[21]};return void 0!==t[9]&&(l.choosingVersion=t[9]),e=new En({props:l}),C.push((()=>X(e,"choosingVersion",r))),{c(){tt(e.$$.fragment)},m(t,n){et(e,t,n),s=!0},p(t,s){const r={};128&s[0]&&(r.show=t[7]),32768&s[0]&&(r.errorsJson=t[15]),16384&s[0]&&(r.settingsJson=t[14]),256&s[0]&&(r.versionsList=t[8]),2097152&s[0]&&(r.coreMessages=t[21]),!n&&512&s[0]&&(n=!0,r.choosingVersion=t[9],z((()=>n=!1))),e.$set(r)},i(t){s||(G(e.$$.fragment,t),s=!0)},o(t){Z(e.$$.fragment,t),s=!1},d(t){nt(e,t)}}}function Wn(t){let e,n,r,l,o,c,i,a,u,d,$,x,w,k,_,J,S,T,L,M,q,E,O,C,N,H,P,A,D,B,z,R,F,U,W,V,Y,X,st,rt,lt,ot,ct=t[22]&&Pn(),it=t[17],at=[];for(let e=0;e",_=b(),J=h("ul"),S=h("li"),T=h("a"),T.textContent="Управление",L=b(),M=h("li"),q=h("a"),q.textContent="Конфигуратор",E=b(),O=h("li"),C=h("a"),C.textContent="Подключение",N=b(),H=h("li"),P=h("a"),P.textContent="Устройства",A=b(),D=h("li"),B=h("a"),B.textContent="Системные",z=b(),R=h("main"),F=h("ul"),U=h("div"),V.c(),X=b(),st=h("footer"),st.innerHTML='Developed by Dmitry Borisenko
',y(c,"class","border border-indigo-500 border-4"),void 0===t[19]&&I((()=>t[35].call(c))),y(o,"class","px-15 py-1"),y(a,"class","pl-4 pr-4 py-1"),y(l,"class","flex content-center items-center justify-end"),y(r,"class","h-10 w-full bg-gray-100 overflow-auto shadow-md"),y(x,"id","menu__toggle"),y(x,"type","checkbox"),y(k,"class","menu__btn"),y(k,"for","menu__toggle"),y(T,"class","menu__item"),y(T,"href","/"),y(q,"class","menu__item"),y(q,"href","/config"),y(C,"class","menu__item"),y(C,"href","/connection"),y(P,"class","menu__item"),y(P,"href","/list"),y(B,"class","menu__item"),y(B,"href","/system"),y(J,"class","menu__box"),y($,"class","flex"),y(U,"class","bg-cover pt-0 px-4"),y(F,"class","menu__main"),y(R,"class",Y="flex-1 overflow-y-auto p-0 "+(!0!==t[0]||t[1]?"ml-0":"ml-36")),y(st,"class","h-4 bg-gray-100 border-gray-200 shadow-lg"),y(e,"class","flex flex-col h-screen bg-gray-50")},m(s,g){p(s,e,g),ct&&ct.m(e,null),f(e,n),f(e,r),f(r,l),f(l,o),f(o,c);for(let t=0;t{ct=null})),Q()),131072&s[0]){let e;for(it=t[17],e=0;e{dt[l]=null})),Q(),V=dt[W],V?V.p(t,s):(V=dt[W]=ut[W](t),V.c()),G(V,1),V.m(U,null)),(!rt||3&s[0]&&Y!==(Y="flex-1 overflow-y-auto p-0 "+(!0!==t[0]||t[1]?"ml-0":"ml-36")))&&y(R,"class",Y)},i(t){rt||(G(ct),G(u.$$.fragment,t),G(V),rt=!0)},o(t){Z(ct),Z(u.$$.fragment,t),Z(V),rt=!1},d(t){t&&g(e),ct&&ct.d(),m(at,t),nt(u),dt[W].d(),lt=!1,s(ot)}}}let Vn=!1;function Yn(t,e,n){let s;o(t,xt,(t=>n(79,s=t))),xt.mode.hash();let r,l=!1,c=!1,i=document.location.hostname,a=!0,u=[],d=!1,f=!1,p=!1,g=!1,m=!1,h={},$=[],x=!1,b=!1,w=[],v=!1,y=!1,k=[],_=!1,J=!1,j=[],T=!1,L=!1,M={},E=!1,O={},C=!1,N={},H=!1,P={},A=!1,D=[],B=!1,I=[];I=[{name:"--",id:"--",ip:i,ws:0,status:!1}];let z,R=[],F=!1,U=0,W=!0,V={},Y=[];var K=function(){this.parts=[]};let Q;K.prototype.append=function(t){this.parts.push(t),this.blob=void 0},K.prototype.getBlob=function(){return this.blob||(this.blob=new Blob(this.parts,{type:"binary"})),this.blob},K.prototype.clear=function(){this.parts=[]};var G=new K,Z=new K,X=new K,tt=new K;function et(){void 0!==U&&mt(U,Q)}function nt(){kt(U);let t=0;I.forEach((e=>{e.ws=t,e.status||(rt(t),ot(t)),t++})),n(17,I)}function st(t,e){I.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(17,I),kt(U),n(18,F=z.status)}function rt(t){let e=lt(t);"error"===e?console.log("[e]","device list wrong"):(R[t]=new WebSocket("ws://"+e+":81"),R.binaryType="blob",console.log("[i]",e,t,"started connecting..."))}function lt(t){let e="error";return I.forEach((n=>{t===n.ws&&(e=n.ip)})),e}function ot(t){if(R[t]){let e=lt(t);console.log("[i]",e,t,"web socket events added"),R[t].addEventListener("open",(function(n){console.log("[i]",e,t,"completed connecting"),st(t,!0),a&&mt(0,"/list|"),t===U&&et()})),R[t].addEventListener("message",(function(e){if("string"==typeof e.data){let c=e.data;if(t===U){if(c.includes("devicelist")&&Jt(c)&&(D=JSON.parse(c),D=D,B=!0,console.log("✔","incDeviceList json parced"),ct(),a?(n(17,I=D),n(17,I[0].status=!0,I)):n(17,(r=I,l=D,o=new Set(r.map((t=>t.ip))),I=[...r,...l.filter((t=>!o.has(t.ip)))])),a=!1,I.sort((function(t,e){return t.namee.name?1:0})),n(17,I),vt(),nt()),c.includes("status")&&Jt(c)){!function(t){for(let e=0;e{let e=t.result;Jt(e)&&(n(10,$=JSON.parse(e)),n(10,$),b=!0,console.log("✔","configJson parced"),ct())}}if("/st/widgets.json"===c&&(v=!0),"/end/widgets.json"===c){v=!1;s=Z.getBlob();let t=new FileReader;t.readAsText(s),t.onload=()=>{let e=t.result;Jt(e)&&(n(11,w=JSON.parse(e)),n(11,w),y=!0,console.log("✔","widgetsJson parced"),ct())}}if("/st/items.json"===c&&(_=!0),"/end/items.json"===c){_=!1;s=X.getBlob();let t=new FileReader;t.readAsText(s),t.onload=()=>{let e=t.result;Jt(e)&&(n(12,k=JSON.parse(e)),n(12,k),J=!0,console.log("✔","itemsJson parced"),ct())}}if("/st/layout.json"===c&&(T=!0),"/end/layout.json"===c){T=!1;s=tt.getBlob();let e=new FileReader;e.readAsText(s),e.onload=()=>{let s=e.result;Jt(s)&&(n(13,j=JSON.parse(s)),n(13,j),bt(),L=!0,console.log("✔","layoutJson parced",t),ct())}}}}var r,l,o;e.data instanceof Blob&&t===U&&(x&&G.append(e.data),v&&Z.append(e.data),_&&X.append(e.data),T&&tt.append(e.data))})),R[t].addEventListener("close",(n=>{console.log("[e]",e,"connection closed"),st(t,!1)})),R[t].addEventListener("error",(function(n){console.log("[e]",e,"connection error"),st(t,!1)}))}else console.log("[e]","socket not exist")}function ct(t){"/|"===Q&&L&&A&&(ft(),console.log("✔✔","dashboard data parced"),function(t){for(const[e,s]of Object.entries(t))for(let t=0;t5?(!function(t,e,n,s,r){for(let l=0;l5?mt(U,"/sgnittes|"+JSON.stringify(M)):window.alert("Ошибка"),dt(),mt(U,"/mqtt|")}function dt(){n(10,$=[]),G.clear(),n(11,w=[]),Z.clear(),n(12,k=[]),X.clear(),n(13,j=[]),tt.clear(),n(14,M={}),n(15,O={}),n(21,Y=[]),n(3,d=!1),n(4,f=!1),n(5,p=!1),n(6,g=!1),n(7,m=!1),ft(),console.log("[i]","all app data cleared")}function ft(){b=!1,y=!1,J=!1,L=!1,E=!1,C=!1,H=!1,A=!1,B=!1}function pt(t,e,n){let s=e+" "+n;console.log("[i]","send to ws msg:",s),mt(t,s)}function gt(){setTimeout(gt,2e4),console.log("[i]","----timer tick----"),W||I.forEach((t=>{!function(t){let e=!1;return I.forEach((n=>{t===n.ws&&(e=n.status)})),e}(t.ws)?(rt(t.ws),ot(t.ws)):mt(t.ws,"/tst|")})),W=!1}function mt(t,e){R[t]&&1===R[t].readyState?(R[t].send(e),console.log("[i]",lt(t),t,"msg send success",e)):console.log("[e]",lt(t),t,"msg not send",e)}function ht(t){I.forEach((e=>{e.status&&mt(e.ws,t)}))}function $t(){n(2,u=[]);Array.from(new Set(Array.from(j,(({page:t})=>t)))).forEach((function(t,e,s){n(2,u=[...u,JSON.parse(JSON.stringify({page:t}))])})),u.sort((function(t,e){return t.pagee.page?1:0}))}function bt(){$t(),n(13,j)}xt.subscribe((function(){dt(),Q=s.path.toString(),Q+="|",console.log("[i]","user on page:",Q),et()}));const wt=t=>{Y.length>=100&&Y.shift(),n(21,Y=[...Y,{msg:t}]),Y.sort((function(t,e){return t.time>e.time?-1:t.time{console.log("[i]","mounted"),vt(),a=!0,nt(),gt(),$t()}));return[l,c,u,d,f,p,g,m,h,r,$,w,k,j,M,O,N,I,F,U,V,Y,Tt,it,at,ut,pt,ht,yt,_t,jt,St,Mt,Et,Ot,function(){U=S(this),n(19,U),n(17,I)},()=>yt(),function(){l=this.checked,n(0,l)},()=>jt(),(t,e,n)=>pt(t,e,n),()=>it(),()=>Mt(),()=>Mt(),()=>St(),()=>at(),()=>ut(),()=>_t(),t=>ht(t),()=>at(),()=>Mt(),t=>Et(t),()=>Ot(),function(t){r=t,n(9,r)}]}return new class extends rt{constructor(t){super(),st(this,t,Yn,Wn,l,{},null,[-1,-1,-1,-1])}}({target:document.body,props:{name:"world"}})}();
+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 l(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function o(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 c(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 a(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;s32){const e=[],n=t.ctx.length/32;for(let t=0;tt.removeEventListener(e,n,s)}function y(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function k(t){return""===t?null:+t}function _(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function J(t,e){t.value=null==e?"":e}function j(t,e){for(let n=0;n{V.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,l,o){const{fragment:c,on_mount:i,on_destroy:a,after_update:u}=t.$$;c&&c.m(n,l),o||I((()=>{const n=i.map(e).filter(r);a?a.push(...n):s(n),t.$$.on_mount=[]})),u.forEach(I)}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,l,o,c,i,a,u=[-1]){const d=S;L(e);const f=e.$$={fragment:null,ctx:null,props:i,update:t,not_equal:c,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};a&&a(f.root);let p=!1;if(f.ctx=l?l(e,r.props||{},((t,n,...s)=>{const r=s.length?s[0]:n;return f.ctx&&c(f.ctx[t],f.ctx[t]=r)&&(!f.skip_bound&&f.bound[t]&&f.bound[t](r),p&&function(t,e){-1===t.$$.dirty[0]&&(O.push(t),D(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{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 lt=[];function ot(e,n=t){let s;const r=new Set;function o(t){if(l(e,t)&&(e=t,s)){const t=!lt.length;for(const t of r)t[1](),lt.push(t,e);if(t){for(let t=0;t{r.delete(i),0===r.size&&(s(),s=null)}}}}function ct(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 at(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,ft,pt={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=pt.getDeafault(),n=n=>t&&t(mt(e));function s(t){t&&(e=t),window.onhashchange=window.onpopstate=ft=null,e!==pt.OFF&&pt.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);pt.run(t,(t=>s(e)),(t=>s(`#${e}`)),(t=>ft=e))})(e,t,s),n()},start(e){t=e,s()},stop(){t=null,s(pt.OFF)}}}();function mt(t){let e=dt,n=dt=pt.run(t,(t=>window.location.pathname+window.location.search),(t=>String(window.location.hash.slice(1)||"/")),(t=>ft||"/")),s=n.match(/^([^?#]+)(?:\?([^#]+))?(?:\#(.+))?$/);return{url:n,from:e,path:s[1]||"",query:ut(s[2]||""),hash:s[3]||""}}function ht(t){let e=E("tinro");e&&(e.exact||e.fallback)&&function(t){throw new Error("[Tinro] "+t)}(`${t.fallback?"":``} can't be inside ${e.fallback?"":` with exact path`}`);let n=t.fallback?"fallbacks":"childs",s=ot({}),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=ct(`${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:l,query:o}=r.router,c=function(t,e){t=ct(t,!0),e=ct(e,!0);let n=[],s={},r=!0,l=t.split("/").map((t=>t.startsWith(":")?(n.push(t.slice(1)),"([^\\/]+)"):t)).join("\\/"),o=e.match(new RegExp(`^${l}$`));return o||(r=!1,o=e.match(new RegExp(`^${l}`))),o?(n.forEach(((t,e)=>s[t]=o[e+1])),{exact:r,params:s,part:o[0].slice(0,-1)}):null}(r.pattern,e);if(!r.fallback&&c&&r.redirect&&(!r.exact||r.exact&&c.exact)){await B();let t=it(e,r.parent&&r.parent.pattern,r.redirect);return xt.goto(t,!0)}if(r.meta=c&&{from:l,url:n,query:o,match:c.part,pattern:r.pattern,breadcrumbs:r.parent&&r.parent.meta&&r.parent.meta.breadcrumbs.slice()||[],params:c.params,subscribe:s.subscribe},r.breadcrumb&&r.meta&&r.meta.breadcrumbs.push({name:r.breadcrumb,path:c.part}),s.set(r.meta),!c||r.fallback||!(!r.exact||r.exact&&c.exact)||r.parent&&r.parent.firstmatch&&r.parent.matched?r.hide():(t.onMeta(r.meta),r.parent&&(r.parent.matched=!0),r.show()),await B(),c&&!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);xt.goto(e,!0)}else t.show()}))}}};return l="tinro",o=r,M().$$.context.set(l,o),q((()=>r.register())),r.router.un=xt.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 l,o}function $t(){return E("tinro").meta}var xt=function(){let{subscribe:t}=ot(gt.get(),(t=>{gt.start(t);let e=function(t){let e=e=>{let n=e.target.closest("a[href]"),s=n&&at(n,"target",!1,"_self"),r=n&&at(n,"tinro-ignore"),l=e.ctrlKey||e.metaKey||e.altKey||e.shiftKey;if("_self"==s&&!r&&!l&&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:bt,meta:$t,useHashNavigation:t=>gt.mode(t?pt.HASH:pt.HISTORY),mode:{hash:()=>gt.mode(pt.HASH),history:()=>gt.mode(pt.HISTORY),memory:()=>gt.mode(pt.MEMORY)}}}();function bt(){return E("tinro").meta.params}const wt=t=>({params:2&t,meta:4&t}),vt=t=>({params:t[1],meta:t[2]});function yt(t){let e;const n=t[9].default,s=c(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?a(n,t[8],r,wt):d(t[8]),vt)},i(t){e||(G(s,t),e=!0)},o(t){Z(s,t),e=!1},d(t){s&&s.d(t)}}}function kt(t){let e,n,s=t[0]&&yt(t);return{c(){s&&s.c(),e=w()},m(t,r){s&&s.m(t,r),p(t,e,r),n=!0},p(t,[n]){t[0]?s?(s.p(t,n),1&n&&G(s,1)):(s=yt(t),s.c(),G(s,1),s.m(e.parentNode,e)):s&&(K(),Z(s,1,1,(()=>{s=null})),Q())},i(t){n||(G(s),n=!0)},o(t){Z(s),n=!1},d(t){s&&s.d(t),t&&g(e)}}}function _t(t,e,n){let{$$slots:s={},$$scope:r}=e,{path:l="/*"}=e,{fallback:o=!1}=e,{redirect:c=!1}=e,{firstmatch:i=!1}=e,{breadcrumb:a=null}=e,u=!1,d={},f={};const p=ht({fallback:o,onShow(){n(0,u=!0)},onHide(){n(0,u=!1)},onMeta(t){n(2,f=t),n(1,d=f.params)}});return t.$$set=t=>{"path"in t&&n(3,l=t.path),"fallback"in t&&n(4,o=t.fallback),"redirect"in t&&n(5,c=t.redirect),"firstmatch"in t&&n(6,i=t.firstmatch),"breadcrumb"in t&&n(7,a=t.breadcrumb),"$$scope"in t&&n(8,r=t.$$scope)},t.$$.update=()=>{232&t.$$.dirty&&p.update({path:l,redirect:c,firstmatch:i,breadcrumb:a})},[u,d,f,l,o,c,i,a,r,s]}class Jt extends rt{constructor(t){super(),st(this,t,_t,kt,l,{path:3,fallback:4,redirect:5,firstmatch:6,breadcrumb:7})}}function jt(e){let n,s,l,o,c;return{c(){n=$("svg"),s=$("line"),l=$("line"),y(s,"x1","18"),y(s,"y1","6"),y(s,"x2","6"),y(s,"y2","18"),y(l,"x1","6"),y(l,"y1","6"),y(l,"x2","18"),y(l,"y2","18"),y(n,"class","h-6 w-6 text-red-400 cursor-pointer"),y(n,"viewBox","0 -2 24 24"),y(n,"fill","none"),y(n,"stroke","currentColor"),y(n,"stroke-width","2"),y(n,"stroke-linecap","round"),y(n,"stroke-linejoin","round")},m(t,i){p(t,n,i),f(n,s),f(n,l),o||(c=v(n,"click",(function(){r(e[0]())&&e[0]().apply(this,arguments)})),o=!0)},p(t,[n]){e=t},i:t,o:t,d(t){t&&g(n),o=!1,c()}}}function Tt(t,e,n){let{click:s=(()=>{})}=e;return t.$$set=t=>{"click"in t&&n(0,s=t.click)},[s]}class St extends rt{constructor(t){super(),st(this,t,Tt,jt,l,{click:0})}}function Lt(t){let e,n,s,r,l,o,c,i;return c=new St({props:{click:t[5]}}),{c(){e=h("div"),n=h("div"),s=h("h1"),r=x(t[0]),l=b(),o=h("div"),tt(c.$$.fragment),y(s,"class","alm-hdr"),y(n,"class","w-11/12"),y(o,"class","flex justify-end w-1/12"),y(e,"class","flex items-center")},m(t,a){p(t,e,a),f(e,n),f(n,s),f(s,r),f(e,l),f(e,o),et(c,o,null),i=!0},p(t,e){(!i||1&e)&&_(r,t[0]);const n={};4&e&&(n.click=t[5]),c.$set(n)},i(t){i||(G(c.$$.fragment,t),i=!0)},o(t){Z(c.$$.fragment,t),i=!1},d(t){t&&g(e),nt(c)}}}function Mt(e){let n,s;return{c(){n=h("h1"),s=x(e[0]),y(n,"class","alm-hdr")},m(t,e){p(t,n,e),f(n,s)},p(t,e){1&e&&_(s,t[0])},i:t,o:t,d(t){t&&g(n)}}}function qt(t){let e,n,s,r,l;const o=[Mt,Lt],i=[];function m(t,e){return t[0]&&!t[1]?0:t[0]&&t[1]?1:-1}~(n=m(t))&&(s=i[n]=o[n](t));const $=t[4].default,x=c($,t,t[3],null);return{c(){e=h("div"),s&&s.c(),r=b(),x&&x.c(),y(e,"class","alm")},m(t,s){p(t,e,s),~n&&i[n].m(e,null),f(e,r),x&&x.m(e,null),l=!0},p(t,[c]){let f=n;n=m(t),n===f?~n&&i[n].p(t,c):(s&&(K(),Z(i[f],1,1,(()=>{i[f]=null})),Q()),~n?(s=i[n],s?s.p(t,c):(s=i[n]=o[n](t),s.c()),G(s,1),s.m(e,r)):s=null),x&&x.p&&(!l||8&c)&&u(x,$,t,t[3],l?a($,t[3],c,null):d(t[3]),null)},i(t){l||(G(s),G(x,t),l=!0)},o(t){Z(s),Z(x,t),l=!1},d(t){t&&g(e),~n&&i[n].d(),x&&x.d(t)}}}function Et(t,e,n){let{$$slots:s={},$$scope:r}=e,{title:l=!1}=e,{cross:o=!1}=e,{close:c=(()=>{})}=e;return t.$$set=t=>{"title"in t&&n(0,l=t.title),"cross"in t&&n(1,o=t.cross),"close"in t&&n(2,c=t.close),"$$scope"in t&&n(3,r=t.$$scope)},[l,o,c,r,s,()=>c()]}class Ot extends rt{constructor(t){super(),st(this,t,Et,qt,l,{title:0,cross:1,close:2})}}function Ct(e){let n;return{c(){n=h("div"),n.innerHTML=' \n ',y(n,"class","z-50")},m(t,e){p(t,n,e)},p:t,i:t,o:t,d(t){t&&g(n)}}}class Nt extends rt{constructor(t){super(),st(this,t,null,Ct,l,{})}}function Ht(t){let e,n,s,r=t[0]&&Pt(t);const l=t[3].default,o=c(l,t,t[2],null);return{c(){e=h("div"),r&&r.c(),n=b(),o&&o.c(),y(e,"class","crd")},m(t,l){p(t,e,l),r&&r.m(e,null),f(e,n),o&&o.m(e,null),s=!0},p(t,c){t[0]?r?r.p(t,c):(r=Pt(t),r.c(),r.m(e,n)):r&&(r.d(1),r=null),o&&o.p&&(!s||4&c)&&u(o,l,t,t[2],s?a(l,t[2],c,null):d(t[2]),null)},i(t){s||(G(o,t),s=!0)},o(t){Z(o,t),s=!1},d(t){t&&g(e),r&&r.d(),o&&o.d(t)}}}function Pt(t){let e,n;return{c(){e=h("h1"),n=x(t[0]),y(e,"class","crd-hdr")},m(t,s){p(t,e,s),f(e,n)},p(t,e){1&e&&_(n,t[0])},d(t){t&&g(e)}}}function At(t){let e,n,s=t[1]&&Ht(t);return{c(){s&&s.c(),e=w()},m(t,r){s&&s.m(t,r),p(t,e,r),n=!0},p(t,[n]){t[1]?s?(s.p(t,n),2&n&&G(s,1)):(s=Ht(t),s.c(),G(s,1),s.m(e.parentNode,e)):s&&(K(),Z(s,1,1,(()=>{s=null})),Q())},i(t){n||(G(s),n=!0)},o(t){Z(s),n=!1},d(t){s&&s.d(t),t&&g(e)}}}function Dt(t,e,n){let{$$slots:s={},$$scope:r}=e,{title:l=!1}=e,{show:o=!0}=e;return t.$$set=t=>{"title"in t&&n(0,l=t.title),"show"in t&&n(1,o=t.show),"$$scope"in t&&n(2,r=t.$$scope)},[l,o,r,s]}class Bt extends rt{constructor(t){super(),st(this,t,Dt,At,l,{title:0,show:1})}}function It(t){let e,n,r,l;return{c(){e=h("input"),y(e,"class",n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500"),y(e,"step","0.1"),y(e,"type","number")},m(n,s){p(n,e,s),J(e,t[0].status),r||(l=[v(e,"change",t[3]),v(e,"input",t[4])],r=!0)},p(t,s){1&s&&n!==(n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500")&&y(e,"class",n),1&s&&k(e.value)!==t[0].status&&J(e,t[0].status)},d(t){t&&g(e),r=!1,s(l)}}}function zt(t){let e,n,r,l;return{c(){e=h("input"),y(e,"class",n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500"),y(e,"type","text")},m(n,s){p(n,e,s),J(e,t[0].status),r||(l=[v(e,"change",t[5]),v(e,"input",t[6])],r=!0)},p(t,s){1&s&&n!==(n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500")&&y(e,"class",n),1&s&&e.value!==t[0].status&&J(e,t[0].status)},d(t){t&&g(e),r=!1,s(l)}}}function Rt(t){let e,n,r,l;return{c(){e=h("input"),y(e,"class",n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500"),y(e,"type","date")},m(n,s){p(n,e,s),J(e,t[0].status),r||(l=[v(e,"change",t[7]),v(e,"input",t[8])],r=!0)},p(t,s){1&s&&n!==(n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500")&&y(e,"class",n),1&s&&J(e,t[0].status)},d(t){t&&g(e),r=!1,s(l)}}}function Ft(t){let e,n,r,l;return{c(){e=h("input"),y(e,"class",n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500"),y(e,"type","time")},m(n,s){p(n,e,s),J(e,t[0].status),r||(l=[v(e,"change",t[9]),v(e,"input",t[10])],r=!0)},p(t,s){1&s&&n!==(n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500")&&y(e,"class",n),1&s&&J(e,t[0].status)},d(t){t&&g(e),r=!1,s(l)}}}function Ut(e){let n,s,r,l,o,c,i,a,u,d=(e[0].descr?e[0].descr:"")+"",m="number"==e[0].type&&It(e),$="text"==e[0].type&&zt(e),w="date"==e[0].type&&Rt(e),v="time"==e[0].type&&Ft(e);return{c(){n=h("div"),s=h("div"),r=h("label"),l=x(d),o=b(),c=h("div"),m&&m.c(),i=b(),$&&$.c(),a=b(),w&&w.c(),u=b(),v&&v.c(),y(r,"class","wgt-dscr-stl"),y(s,"class","w-2/3"),y(c,"class","flex justify-end w-1/3"),y(n,"class","crd-itm-psn")},m(t,e){p(t,n,e),f(n,s),f(s,r),f(r,l),f(n,o),f(n,c),m&&m.m(c,null),f(c,i),$&&$.m(c,null),f(c,a),w&&w.m(c,null),f(c,u),v&&v.m(c,null)},p(t,[e]){1&e&&d!==(d=(t[0].descr?t[0].descr:"")+"")&&_(l,d),"number"==t[0].type?m?m.p(t,e):(m=It(t),m.c(),m.m(c,i)):m&&(m.d(1),m=null),"text"==t[0].type?$?$.p(t,e):($=zt(t),$.c(),$.m(c,a)):$&&($.d(1),$=null),"date"==t[0].type?w?w.p(t,e):(w=Rt(t),w.c(),w.m(c,u)):w&&(w.d(1),w=null),"time"==t[0].type?v?v.p(t,e):(v=Ft(t),v.c(),v.m(c,null)):v&&(v.d(1),v=null)},i:t,o:t,d(t){t&&g(n),m&&m.d(),$&&$.d(),w&&w.d(),v&&v.d()}}}function Wt(t,e,n){let{widget:s}=e,{wsPush:r=((t,e,n)=>{})}=e,{value:l}=e;l=l;return t.$$set=t=>{"widget"in t&&n(0,s=t.widget),"wsPush"in t&&n(1,r=t.wsPush),"value"in t&&n(2,l=t.value)},[s,r,l,()=>(n(0,s.send=!0,s),r(s.ws,s.topic,s.status)),function(){s.status=k(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 Vt extends rt{constructor(t){super(),st(this,t,Wt,Ut,l,{widget:0,wsPush:1,value:2})}}function Yt(e){let n,r,l,o,c,i,a,u,d,m,$,w,k,j,T,S,L,M,q=(e[0].descr?e[0].descr:"")+"";return{c(){n=h("div"),r=h("div"),l=h("label"),o=x(q),c=b(),i=h("div"),a=h("label"),u=h("div"),d=h("input"),$=b(),w=h("div"),k=b(),j=h("div"),y(l,"class","wgt-dscr-stl"),y(r,"class","w-2/3"),y(d,"id",m=e[0].topic),y(d,"type","checkbox"),y(d,"class","sr-only"),y(w,"class","block bg-gray-600 w-10 h-6 rounded-full"),y(j,"class",T="dot "+(1==e[0].send?"bg-red-400":"bg-white")+" absolute left-1 top-1 w-4 h-4 rounded-full transition"),y(u,"class","relative"),y(a,"for",S=e[0].topic),y(a,"class","items-center cursor-pointer"),y(i,"class","flex justify-end w-1/3"),y(n,"class","crd-itm-psn")},m(t,s){p(t,n,s),f(n,r),f(r,l),f(l,o),f(n,c),f(n,i),f(i,a),f(a,u),f(u,d),J(d,e[0].status),f(u,$),f(u,w),f(u,k),f(u,j),L||(M=[v(d,"change",e[3]),v(d,"change",e[4])],L=!0)},p(t,[e]){1&e&&q!==(q=(t[0].descr?t[0].descr:"")+"")&&_(o,q),1&e&&m!==(m=t[0].topic)&&y(d,"id",m),1&e&&J(d,t[0].status),1&e&&T!==(T="dot "+(1==t[0].send?"bg-red-400":"bg-white")+" absolute left-1 top-1 w-4 h-4 rounded-full transition")&&y(j,"class",T),1&e&&S!==(S=t[0].topic)&&y(a,"for",S)},i:t,o:t,d(t){t&&g(n),L=!1,s(M)}}}function Kt(t,e,n){let{widget:s}=e,{value:r}=e;r=r;let{wsPush:l=((t,e,n)=>{})}=e;return t.$$set=t=>{"widget"in t&&n(0,s=t.widget),"value"in t&&n(2,r=t.value),"wsPush"in t&&n(1,l=t.wsPush)},[s,l,r,()=>(n(0,s.send=!0,s),l(s.ws,s.topic,s.status)),function(){s.status=this.value,n(0,s)}]}class Qt extends rt{constructor(t){super(),st(this,t,Kt,Yt,l,{widget:0,value:2,wsPush:1})}}function Gt(e){let n,s,r,l,o,c,i,a,u,d,m,$,w=(e[0].descr?e[0].descr:"")+"",v=(e[0].status?e[0].status:"")+"",k=(e[0].after?e[0].after:"")+"";return{c(){n=h("div"),s=h("div"),r=h("label"),l=x(w),o=b(),c=h("div"),i=h("label"),a=x(v),u=b(),d=h("label"),m=x(" "),$=x(k),y(r,"class","wgt-dscr-stl"),y(s,"class","w-2/3"),y(i,"class","wgt-adt-stl"),y(d,"class","wgt-adt-stl"),y(c,"class","flex justify-end w-1/3"),y(n,"class","crd-itm-psn")},m(t,e){p(t,n,e),f(n,s),f(s,r),f(r,l),f(n,o),f(n,c),f(c,i),f(i,a),f(c,u),f(c,d),f(d,m),f(d,$)},p(t,[e]){1&e&&w!==(w=(t[0].descr?t[0].descr:"")+"")&&_(l,w),1&e&&v!==(v=(t[0].status?t[0].status:"")+"")&&_(a,v),1&e&&k!==(k=(t[0].after?t[0].after:"")+"")&&_($,k)},i:t,o:t,d(t){t&&g(n)}}}function Zt(t,e,n){let{widget:s}=e,{value:r}=e;return r=r,t.$$set=t=>{"widget"in t&&n(0,s=t.widget),"value"in t&&n(1,r=t.value)},[s,r]}class Xt extends rt{constructor(t){super(),st(this,t,Zt,Gt,l,{widget:0,value:1})}}function te(t,e,n){const s=t.slice();return s[9]=e[n],s[11]=n,s}function ee(t,e,n){const s=t.slice();return s[12]=e[n],s[13]=e,s[11]=n,s}function ne(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||(G(n.$$.fragment,t),s=!0)},o(t){Z(n.$$.fragment,t),s=!1},d(t){nt(n,t)}}}function se(t){let e,n,s,r=t[0]===[]&&re(),l=t[1],o=[];for(let e=0;eZ(o[t],1,1,(()=>{o[t]=null}));return{c(){e=h("div"),r&&r.c(),n=b();for(let t=0;t{r=null})),Q()),11&s){let n;for(l=t[1],n=0;n{l=null})),Q()),"toggle"===t[12].widget?o?(o.p(t,r),1&r&&G(o,1)):(o=ce(t),o.c(),G(o,1),o.m(n.parentNode,n)):o&&(K(),Z(o,1,1,(()=>{o=null})),Q()),"anydata"===t[12].widget?c?(c.p(t,r),1&r&&G(c,1)):(c=ie(t),c.c(),G(c,1),c.m(s.parentNode,s)):c&&(K(),Z(c,1,1,(()=>{c=null})),Q())},i(t){r||(G(l),G(o),G(c),r=!0)},o(t){Z(l),Z(o),Z(c),r=!1},d(t){l&&l.d(t),t&&g(e),o&&o.d(t),t&&g(n),c&&c.d(t),t&&g(s)}}}function oe(t){let e,n,s;function r(e){t[5](e,t[12])}let l={widget:t[12],wsPush:t[4]};return void 0!==t[12].status&&(l.value=t[12].status),e=new Vt({props:l}),C.push((()=>X(e,"value",r))),{c(){tt(e.$$.fragment)},m(t,n){et(e,t,n),s=!0},p(s,r){t=s;const l={};1&r&&(l.widget=t[12]),8&r&&(l.wsPush=t[4]),!n&&1&r&&(n=!0,l.value=t[12].status,z((()=>n=!1))),e.$set(l)},i(t){s||(G(e.$$.fragment,t),s=!0)},o(t){Z(e.$$.fragment,t),s=!1},d(t){nt(e,t)}}}function ce(t){let e,n,s;function r(e){t[7](e,t[12])}let l={widget:t[12],wsPush:t[6]};return void 0!==t[12].status&&(l.value=t[12].status),e=new Qt({props:l}),C.push((()=>X(e,"value",r))),{c(){tt(e.$$.fragment)},m(t,n){et(e,t,n),s=!0},p(s,r){t=s;const l={};1&r&&(l.widget=t[12]),8&r&&(l.wsPush=t[6]),!n&&1&r&&(n=!0,l.value=t[12].status,z((()=>n=!1))),e.$set(l)},i(t){s||(G(e.$$.fragment,t),s=!0)},o(t){Z(e.$$.fragment,t),s=!1},d(t){nt(e,t)}}}function ie(t){let e,n,s;function r(e){t[8](e,t[12])}let l={widget:t[12]};return void 0!==t[12].status&&(l.value=t[12].status),e=new Xt({props:l}),C.push((()=>X(e,"value",r))),{c(){tt(e.$$.fragment)},m(t,n){et(e,t,n),s=!0},p(s,r){t=s;const l={};1&r&&(l.widget=t[12]),!n&&1&r&&(n=!0,l.value=t[12].status,z((()=>n=!1))),e.$set(l)},i(t){s||(G(e.$$.fragment,t),s=!0)},o(t){Z(e.$$.fragment,t),s=!1},d(t){nt(e,t)}}}function ae(t){let e,n,s=t[12].page===t[9].page&&le(t);return{c(){s&&s.c(),e=w()},m(t,r){s&&s.m(t,r),p(t,e,r),n=!0},p(t,n){t[12].page===t[9].page?s?(s.p(t,n),3&n&&G(s,1)):(s=le(t),s.c(),G(s,1),s.m(e.parentNode,e)):s&&(K(),Z(s,1,1,(()=>{s=null})),Q())},i(t){n||(G(s),n=!0)},o(t){Z(s),n=!1},d(t){s&&s.d(t),t&&g(e)}}}function ue(t){let e,n,s=t[0],r=[];for(let e=0;eZ(r[t],1,1,(()=>{r[t]=null}));return{c(){for(let t=0;t{o[i]=null})),Q(),n=o[e],n?n.p(t,r):(n=o[e]=l[e](t),n.c()),G(n,1),n.m(s.parentNode,s))},i(t){r||(G(n),r=!0)},o(t){Z(n),r=!1},d(t){o[e].d(t),t&&g(s)}}}function pe(t,e,n){let{layoutJson:s}=e,{pages:r}=e,{show:l}=e,{wsPush:o=((t,e,n)=>{})}=e;return t.$$set=t=>{"layoutJson"in t&&n(0,s=t.layoutJson),"pages"in t&&n(1,r=t.pages),"show"in t&&n(2,l=t.show),"wsPush"in t&&n(3,o=t.wsPush)},[s,r,l,o,(t,e,n)=>o(t,e,n),function(e,r){t.$$.not_equal(r.status,e)&&(r.status=e,n(0,s))},(t,e,n)=>o(t,e,n),function(e,r){t.$$.not_equal(r.status,e)&&(r.status=e,n(0,s))},function(e,r){t.$$.not_equal(r.status,e)&&(r.status=e,n(0,s))}]}class ge extends rt{constructor(t){super(),st(this,t,pe,fe,l,{layoutJson:0,pages:1,show:2,wsPush:3})}}function me(e){let n,s,l,o,c,i,a;return{c(){n=$("svg"),s=$("path"),l=$("circle"),o=$("circle"),c=$("circle"),y(s,"stroke","none"),y(s,"d","M0 0h24v24H0z"),y(l,"cx","5"),y(l,"cy","12"),y(l,"r","1"),y(o,"cx","12"),y(o,"cy","12"),y(o,"r","1"),y(c,"cx","19"),y(c,"cy","12"),y(c,"r","1"),y(n,"class","h-6 w-6 text-green-400 cursor-pointer"),y(n,"width","24"),y(n,"height","24"),y(n,"viewBox","0 -2 24 24"),y(n,"stroke-width","2"),y(n,"stroke","currentColor"),y(n,"fill","none"),y(n,"stroke-linecap","round"),y(n,"stroke-linejoin","round")},m(t,u){p(t,n,u),f(n,s),f(n,l),f(n,o),f(n,c),i||(a=v(n,"click",(function(){r(e[0]())&&e[0]().apply(this,arguments)})),i=!0)},p(t,[n]){e=t},i:t,o:t,d(t){t&&g(n),i=!1,a()}}}function he(t,e,n){let{click:s=(()=>{})}=e;return t.$$set=t=>{"click"in t&&n(0,s=t.click)},[s]}class $e extends rt{constructor(t){super(),st(this,t,he,me,l,{click:0})}}function xe(t,e,n){const s=t.slice();return s[23]=e[n],s[24]=e,s[25]=n,s}function be(t,e,n){const s=t.slice();return s[26]=e[n][0],s[27]=e[n][1],s[28]=e,s[29]=n,s}function we(t,e,n){const s=t.slice();return s[30]=e[n],s}function ve(t,e,n){const s=t.slice();return s[33]=e[n],s}function ye(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||(G(n.$$.fragment,t),s=!0)},o(t){Z(n.$$.fragment,t),s=!1},d(t){nt(n,t)}}}function ke(t){let e,n,s,r,l,o;return n=new Bt({props:{title:"Конфигуратор",$$slots:{default:[Ee]},$$scope:{ctx:t}}}),l=new Bt({props:{title:"Сценарии",$$slots:{default:[Oe]},$$scope:{ctx:t}}}),{c(){e=h("div"),tt(n.$$.fragment),s=b(),r=h("div"),tt(l.$$.fragment),y(e,"class","grd-1col1"),y(r,"class","grd-1col1")},m(t,c){p(t,e,c),et(n,e,null),p(t,s,c),p(t,r,c),et(l,r,null),o=!0},p(t,e){const s={};397&e[0]|32&e[1]&&(s.$$scope={dirty:e,ctx:t}),n.$set(s);const r={};98&e[0]|32&e[1]&&(r.$$scope={dirty:e,ctx:t}),l.$set(r)},i(t){o||(G(n.$$.fragment,t),G(l.$$.fragment,t),o=!0)},o(t){Z(n.$$.fragment,t),Z(l.$$.fragment,t),o=!1},d(t){t&&g(e),nt(n),t&&g(s),t&&g(r),nt(l)}}}function _e(t){let e,n;return{c(){e=h("optgroup"),y(e,"label",n=t[33].header)},m(t,n){p(t,e,n)},p(t,s){8&s[0]&&n!==(n=t[33].header)&&y(e,"label",n)},d(t){t&&g(e)}}}function Je(t){let e,n,s,r,l=t[33].name+"";return{c(){e=h("option"),n=x(l),s=b(),e.__value=r=t[33].num,e.value=e.__value},m(t,r){p(t,e,r),f(e,n),f(e,s)},p(t,s){8&s[0]&&l!==(l=t[33].name+"")&&_(n,l),8&s[0]&&r!==(r=t[33].num)&&(e.__value=r,e.value=e.__value)},d(t){t&&g(e)}}}function je(t){let e,n,s=t[33].header&&_e(t),r=!t[33].header&&Je(t);return{c(){s&&s.c(),e=w(),r&&r.c(),n=w()},m(t,l){s&&s.m(t,l),p(t,e,l),r&&r.m(t,l),p(t,n,l)},p(t,l){t[33].header?s?s.p(t,l):(s=_e(t),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),t[33].header?r&&(r.d(1),r=null):r?r.p(t,l):(r=Je(t),r.c(),r.m(n.parentNode,n))},d(t){s&&s.d(t),t&&g(e),r&&r.d(t),t&&g(n)}}}function Te(t){let e,n,s,r,l=t[30].label+"";return{c(){e=h("option"),n=x(l),s=b(),e.__value=r=t[30].name,e.value=e.__value},m(t,r){p(t,e,r),f(e,n),f(e,s)},p(t,s){4&s[0]&&l!==(l=t[30].label+"")&&_(n,l),4&s[0]&&r!==(r=t[30].name)&&(e.__value=r,e.value=e.__value)},d(t){t&&g(e)}}}function Se(t){let e,n=Object.entries(t[23]),s=[];for(let e=0;eZ(T[t],1,1,(()=>{T[t]=null}));return{c(){e=h("div"),n=h("select");for(let t=0;t<_.length;t+=1)_[t].c();r=b(),l=h("select"),o=h("option"),o.textContent="Выберите пресет",c=b(),i=h("table"),a=h("thead"),a.innerHTML='| Тип | \n Id | \n Виджет | \n Вкладка | \n Название | \n | \n |
',u=b(),d=h("tbody");for(let t=0;tt[11].call(n))),o.__value="Выберите пресет",o.value=o.__value,y(l,"class","slct-lg"),y(e,"class","grd-2col2"),y(a,"class","bg-gray-100"),y(d,"class","bg-white"),y(i,"class","tbl")},m(s,g){p(s,e,g),f(e,n);for(let t=0;t<_.length;t+=1)_[t].m(n,null);j(n,t[7]),f(e,r),f(e,l),f(l,o),p(s,c,g),p(s,i,g),f(i,a),f(i,u),f(i,d);for(let t=0;t{o[i]=null})),Q(),n=o[e],n?n.p(t,r):(n=o[e]=l[e](t),n.c()),G(n,1),n.m(s.parentNode,s))},i(t){r||(G(n),r=!0)},o(t){Z(n),r=!1},d(t){o[e].d(t),t&&g(s)}}}function Ne(t,e,n){let{configJson:s}=e,{widgetsJson:r}=e,{itemsJson:l}=e,{show:o}=e,{scenarioTxt:c}=e,i=0,{saveConfig:a=(()=>{})}=e,{rebootEsp:u=(()=>{})}=e,d=!0;function f(){for(let t=0;t{"configJson"in t&&n(0,s=t.configJson),"widgetsJson"in t&&n(2,r=t.widgetsJson),"itemsJson"in t&&n(3,l=t.itemsJson),"show"in t&&n(4,o=t.show),"scenarioTxt"in t&&n(1,c=t.scenarioTxt),"saveConfig"in t&&n(5,a=t.saveConfig),"rebootEsp"in t&&n(6,u=t.rebootEsp)},[s,c,r,l,o,a,u,i,d,f,p,function(){i=T(this),n(7,i),n(3,l)},()=>f(),function(t,e){t[e].id=this.value,n(0,s),n(2,r)},function(t,e){t[e].widget=T(this),n(0,s),n(2,r)},function(t,e){t[e].page=this.value,n(0,s),n(2,r)},function(t,e){t[e].descr=this.value,n(0,s),n(2,r)},()=>n(8,d=!d),t=>p(t),function(t,e,l){e[l][t]=this.value,n(0,s),n(2,r)},function(){c=this.value,n(1,c)},()=>a(),()=>u()]}class He extends rt{constructor(t){super(),st(this,t,Ne,Ce,l,{configJson:0,widgetsJson:2,itemsJson:3,show:4,scenarioTxt:1,saveConfig:5,rebootEsp:6},null,[-1,-1])}}function Pe(t,e,n){const s=t.slice();return s[23]=e[n][0],s[24]=e[n][1],s}function Ae(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||(G(n.$$.fragment,t),s=!0)},o(t){Z(n.$$.fragment,t),s=!1},d(t){nt(n,t)}}}function De(t){let e,n,s,r,l,o,c,i;return n=new Bt({props:{title:"Подключение к WiFi",$$slots:{default:[ze]},$$scope:{ctx:t}}}),r=new Bt({props:{title:"Подключение к MQTT",$$slots:{default:[Ve]},$$scope:{ctx:t}}}),c=new Bt({props:{$$slots:{default:[Ye]},$$scope:{ctx:t}}}),{c(){e=h("div"),tt(n.$$.fragment),s=b(),tt(r.$$.fragment),l=b(),o=h("div"),tt(c.$$.fragment),y(e,"class","grd-2col1"),y(o,"class","grd-1col1")},m(t,a){p(t,e,a),et(n,e,null),f(e,s),et(r,e,null),p(t,l,a),p(t,o,a),et(c,o,null),i=!0},p(t,e){const s={};134217783&e&&(s.$$scope={dirty:e,ctx:t}),n.$set(s);const l={};134217795&e&&(l.$$scope={dirty:e,ctx:t}),r.$set(l);const o={};134217856&e&&(o.$$scope={dirty:e,ctx:t}),c.$set(o)},i(t){i||(G(n.$$.fragment,t),G(r.$$.fragment,t),G(c.$$.fragment,t),i=!0)},o(t){Z(n.$$.fragment,t),Z(r.$$.fragment,t),Z(c.$$.fragment,t),i=!1},d(t){t&&g(e),nt(n),nt(r),t&&g(l),t&&g(o),nt(c)}}}function Be(t){let e,n,s,r,l=t[24]+"";return{c(){e=h("option"),n=x(l),s=b(),e.__value=r=t[24],e.value=e.__value},m(t,r){p(t,e,r),f(e,n),f(e,s)},p(t,s){4&s&&l!==(l=t[24]+"")&&_(n,l),4&s&&r!==(r=t[24])&&(e.__value=r,e.value=e.__value)},d(t){t&&g(e)}}}function Ie(t){let e,n,s;return n=new Ot({props:{title:"Введен неправильный пароль"}}),{c(){e=h("div"),tt(n.$$.fragment),y(e,"class","grd-1col1")},m(t,r){p(t,e,r),et(n,e,null),s=!0},i(t){s||(G(n.$$.fragment,t),s=!0)},o(t){Z(n.$$.fragment,t),s=!1},d(t){t&&g(e),nt(n)}}}function ze(t){let e,n,r,l,o,c,i,a,u,d,$,x,w,k,_,T,S,L,M,q,E,O,C,N,H,P,A,D,B,z,R,F,U,W,V,Y,X,tt,et,nt,st,rt=Object.entries(t[2]),lt=[];for(let e=0;eНазвание устройства',r=b(),l=h("div"),o=h("input"),c=b(),i=h("div"),a=h("div"),a.innerHTML='Точка доступа
',u=b(),d=h("div"),$=h("input"),x=b(),w=h("div"),k=h("div"),k.innerHTML='Пароль точки доступа
',_=b(),T=h("div"),S=h("input"),L=b(),M=h("div"),q=h("div"),q.innerHTML='Название wifi сети
',E=b(),O=h("div"),C=h("select");for(let t=0;tПароль',A=b(),D=h("div"),B=h("input"),z=b(),R=h("div"),F=h("div"),F.innerHTML='Сервер обновления
',U=b(),W=h("div"),V=h("input"),Y=b(),ot&&ot.c(),X=b(),tt=h("button"),tt.textContent="Сохранить",y(n,"class","w-4/6"),y(o,"class","ipt-rnd text-left focus:border-indigo-500"),y(o,"type","text"),y(l,"class","flex justify-end w-3/6"),y(e,"class","crd-itm-psn"),y(a,"class","w-4/6"),y($,"class","ipt-rnd text-left focus:border-indigo-500"),y($,"type","text"),y(d,"class","flex justify-end w-3/6"),y(i,"class","crd-itm-psn"),y(k,"class","w-4/6"),y(S,"class","ipt-rnd text-left focus:border-indigo-500"),y(S,"type","text"),y(T,"class","flex justify-end w-3/6"),y(w,"class","crd-itm-psn"),y(q,"class","w-4/6"),y(C,"class","ipt-rnd text-left focus:border-indigo-500"),void 0===t[0].routerssid&&I((()=>t[11].call(C))),y(O,"class","flex justify-end w-3/6"),y(M,"class","crd-itm-psn"),y(P,"class","w-4/6"),y(B,"class","ipt-rnd text-left focus:border-indigo-500"),y(B,"type","text"),y(D,"class","flex justify-end w-3/6"),y(H,"class","crd-itm-psn"),y(F,"class","w-4/6"),y(V,"class","ipt-rnd text-left focus:border-indigo-500"),y(V,"type","text"),y(W,"class","flex justify-end w-3/6"),y(R,"class","crd-itm-psn"),y(tt,"class","btn-lg")},m(s,g){p(s,e,g),f(e,n),f(e,r),f(e,l),f(l,o),J(o,t[0].name),p(s,c,g),p(s,i,g),f(i,a),f(i,u),f(i,d),f(d,$),J($,t[0].apssid),p(s,x,g),p(s,w,g),f(w,k),f(w,_),f(w,T),f(T,S),J(S,t[0].appass),p(s,L,g),p(s,M,g),f(M,q),f(M,E),f(M,O),f(O,C);for(let t=0;t{ot=null})),Q())},i(t){et||(G(ot),et=!0)},o(t){Z(ot),et=!1},d(t){t&&g(e),t&&g(c),t&&g(i),t&&g(x),t&&g(w),t&&g(L),t&&g(M),m(lt,t),t&&g(N),t&&g(H),t&&g(z),t&&g(R),t&&g(Y),ot&&ot.d(t),t&&g(X),t&&g(tt),nt=!1,s(st)}}}function Re(t){let e;return{c(){e=h("p"),e.textContent="Ошибка",y(e,"class","text-red-500 font-bold h-8 bg-red-50 border-2 border-gray-200 rounded w-full text-center")},m(t,n){p(t,e,n)},d(t){t&&g(e)}}}function Fe(t){let e;return{c(){e=h("p"),e.textContent="Ожидание",y(e,"class","text-blue-500 font-bold h-8 bg-blue-50 border-2 border-gray-200 rounded w-full text-center")},m(t,n){p(t,e,n)},d(t){t&&g(e)}}}function Ue(t){let e;return{c(){e=h("p"),e.textContent="Подключение",y(e,"class","text-yellow-500 font-bold h-8 bg-yellow-50 border-2 border-gray-200 rounded w-full text-center")},m(t,n){p(t,e,n)},d(t){t&&g(e)}}}function We(t){let e;return{c(){e=h("p"),e.textContent="Подключено",y(e,"class","text-green-500 font-bold h-8 bg-green-50 border-2 border-gray-200 rounded w-full text-center")},m(t,n){p(t,e,n)},d(t){t&&g(e)}}}function Ve(t){let e,n,r,l,o,c,i,a,u,d,m,$,x,w,k,_,j,T,S,L,M,q,E,O,C,N,H,P,A,D,B,I,z,R,F,U,W,V;function Y(t,e){return"e5"===t[1].mqtt?We:"e13"===t[1].mqtt?Ue:void 0===t[1].mqtt?Fe:Re}let K=Y(t),Q=K(t);return{c(){e=h("div"),n=h("div"),n.innerHTML='Состояние подключения
',r=b(),l=h("div"),Q.c(),o=b(),c=h("div"),i=h("div"),i.innerHTML='Название сервера
',a=b(),u=h("div"),d=h("input"),m=b(),$=h("div"),x=h("div"),x.innerHTML='Порт
',w=b(),k=h("div"),_=h("input"),j=b(),T=h("div"),S=h("div"),S.innerHTML='Префикс
',L=b(),M=h("div"),q=h("input"),E=b(),O=h("div"),C=h("div"),C.innerHTML='Имя пользователя
',N=b(),H=h("div"),P=h("input"),A=b(),D=h("div"),B=h("div"),B.innerHTML='Пароль
',I=b(),z=h("div"),R=h("input"),F=b(),U=h("button"),U.textContent="Сохранить",y(n,"class","w-4/6"),y(l,"class","flex justify-center w-3/6 align-baseline text-sm sm:text-sm md:text-base lg:text-base xl:text-base 2xl:text-base break-words"),y(e,"class","crd-itm-psn"),y(i,"class","w-4/6"),y(d,"class","ipt-rnd text-left focus:border-indigo-500"),y(d,"type","text"),y(u,"class","flex justify-end w-3/6"),y(c,"class","crd-itm-psn"),y(x,"class","w-4/6"),y(_,"class","ipt-rnd text-left focus:border-indigo-500"),y(_,"type","text"),y(k,"class","flex justify-end w-3/6"),y($,"class","crd-itm-psn"),y(S,"class","w-4/6"),y(q,"class","ipt-rnd text-left focus:border-indigo-500"),y(q,"type","text"),y(M,"class","flex justify-end w-3/6"),y(T,"class","crd-itm-psn"),y(C,"class","w-4/6"),y(P,"class","ipt-rnd text-left focus:border-indigo-500"),y(P,"type","text"),y(H,"class","flex justify-end w-3/6"),y(O,"class","crd-itm-psn"),y(B,"class","w-4/6"),y(R,"class","ipt-rnd text-left focus:border-indigo-500"),y(R,"type","text"),y(z,"class","flex justify-end w-3/6"),y(D,"class","crd-itm-psn"),y(U,"class","btn-lg")},m(s,g){p(s,e,g),f(e,n),f(e,r),f(e,l),Q.m(l,null),p(s,o,g),p(s,c,g),f(c,i),f(c,a),f(c,u),f(u,d),J(d,t[0].mqttServer),p(s,m,g),p(s,$,g),f($,x),f($,w),f($,k),f(k,_),J(_,t[0].mqttPort),p(s,j,g),p(s,T,g),f(T,S),f(T,L),f(T,M),f(M,q),J(q,t[0].mqttPrefix),p(s,E,g),p(s,O,g),f(O,C),f(O,N),f(O,H),f(H,P),J(P,t[0].mqttUser),p(s,A,g),p(s,D,g),f(D,B),f(D,I),f(D,z),f(z,R),J(R,t[0].mqttPass),p(s,F,g),p(s,U,g),W||(V=[v(d,"input",t[16]),v(_,"input",t[17]),v(q,"input",t[18]),v(P,"input",t[19]),v(R,"input",t[20]),v(U,"click",t[21])],W=!0)},p(t,e){K!==(K=Y(t))&&(Q.d(1),Q=K(t),Q&&(Q.c(),Q.m(l,null))),5&e&&d.value!==t[0].mqttServer&&J(d,t[0].mqttServer),5&e&&_.value!==t[0].mqttPort&&J(_,t[0].mqttPort),5&e&&q.value!==t[0].mqttPrefix&&J(q,t[0].mqttPrefix),5&e&&P.value!==t[0].mqttUser&&J(P,t[0].mqttUser),5&e&&R.value!==t[0].mqttPass&&J(R,t[0].mqttPass)},d(t){t&&g(e),Q.d(),t&&g(o),t&&g(c),t&&g(m),t&&g($),t&&g(j),t&&g(T),t&&g(E),t&&g(O),t&&g(A),t&&g(D),t&&g(F),t&&g(U),W=!1,s(V)}}}function Ye(e){let n,s,r;return{c(){n=h("button"),n.textContent="Перезагрузить устройство",y(n,"class","btn-lg")},m(t,l){p(t,n,l),s||(r=v(n,"click",e[22]),s=!0)},p:t,d(t){t&&g(n),s=!1,r()}}}function Ke(t){let e,n,s,r;const l=[De,Ae],o=[];function c(t,e){return t[3]?0:1}return e=c(t),n=o[e]=l[e](t),{c(){n.c(),s=w()},m(t,n){o[e].m(t,n),p(t,s,n),r=!0},p(t,[r]){let i=e;e=c(t),e===i?o[e].p(t,r):(K(),Z(o[i],1,1,(()=>{o[i]=null})),Q(),n=o[e],n?n.p(t,r):(n=o[e]=l[e](t),n.c()),G(n,1),n.m(s.parentNode,s))},i(t){r||(G(n),r=!0)},o(t){Z(n),r=!1},d(t){o[e].d(t),t&&g(s)}}}function Qe(t,e,n){let{settingsJson:s}=e,{errorsJson:r}=e,{ssidJson:l}=e,{show:o}=e,{ssidClick:c=(()=>{})}=e,{saveSett:i=(()=>{})}=e,{saveMqtt:a=(()=>{})}=e,{rebootEsp:u=(()=>{})}=e;return t.$$set=t=>{"settingsJson"in t&&n(0,s=t.settingsJson),"errorsJson"in t&&n(1,r=t.errorsJson),"ssidJson"in t&&n(2,l=t.ssidJson),"show"in t&&n(3,o=t.show),"ssidClick"in t&&n(4,c=t.ssidClick),"saveSett"in t&&n(5,i=t.saveSett),"saveMqtt"in t&&n(6,a=t.saveMqtt),"rebootEsp"in t&&n(7,u=t.rebootEsp)},[s,r,l,o,c,i,a,u,function(){s.name=this.value,n(0,s),n(2,l)},function(){s.apssid=this.value,n(0,s),n(2,l)},function(){s.appass=this.value,n(0,s),n(2,l)},function(){s.routerssid=T(this),n(0,s),n(2,l)},()=>c(),function(){s.routerpass=this.value,n(0,s),n(2,l)},function(){s.serverip=this.value,n(0,s),n(2,l)},()=>i(),function(){s.mqttServer=this.value,n(0,s),n(2,l)},function(){s.mqttPort=this.value,n(0,s),n(2,l)},function(){s.mqttPrefix=this.value,n(0,s),n(2,l)},function(){s.mqttUser=this.value,n(0,s),n(2,l)},function(){s.mqttPass=this.value,n(0,s),n(2,l)},()=>a(),()=>u()]}class Ge extends rt{constructor(t){super(),st(this,t,Qe,Ke,l,{settingsJson:0,errorsJson:1,ssidJson:2,show:3,ssidClick:4,saveSett:5,saveMqtt:6,rebootEsp:7})}}function Ze(t,e,n){const s=t.slice();return s[13]=e[n],s[15]=n,s}function Xe(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||(G(n.$$.fragment,t),s=!0)},o(t){Z(n.$$.fragment,t),s=!1},d(t){nt(n,t)}}}function tn(t){let e,n,s,r,l;return n=new Bt({props:{title:"Список устройств",$$slots:{default:[sn]},$$scope:{ctx:t}}}),r=new Ot({props:{$$slots:{default:[rn]},$$scope:{ctx:t}}}),{c(){e=h("div"),tt(n.$$.fragment),s=b(),tt(r.$$.fragment),y(e,"class","grd-1col1")},m(t,o){p(t,e,o),et(n,e,null),f(e,s),et(r,e,null),l=!0},p(t,e){const s={};65591&e&&(s.$$scope={dirty:e,ctx:t}),n.$set(s);const l={};65536&e&&(l.$$scope={dirty:e,ctx:t}),r.$set(l)},i(t){l||(G(n.$$.fragment,t),G(r.$$.fragment,t),l=!0)},o(t){Z(n.$$.fragment,t),Z(r.$$.fragment,t),l=!1},d(t){t&&g(e),nt(n),nt(r)}}}function en(t){let e,n,s,r,l,o,c,i,a,u,d,m,$,w,v,k,J,j,T,S=t[13].name+"",L=t[13].ip+"",M=t[13].id+"",q=t[13].status?"online":"offline";return j=new St({props:{click:function(){return t[7](t[15])}}}),{c(){e=h("tr"),n=h("td"),s=x(S),r=b(),l=h("td"),o=h("a"),c=x(L),a=b(),u=h("td"),d=x(M),m=b(),$=h("td"),w=x(q),k=b(),J=h("td"),tt(j.$$.fragment),y(n,"class","tbl-bdy-lg ipt-lg w-full"),y(o,"href",i="http://"+t[13].ip),y(l,"class","tbl-bdy-lg ipt-lg w-full"),y(u,"class","tbl-bdy-lg ipt-lg w-full"),y($,"class",v="tbl-bdy-lg ipt-lg w-full "+(t[13].status?"bg-green-50":"bg-red-50")),y(J,"class","tbl-bdy-lg"),y(e,"class","txt-sz txt-pad")},m(t,i){p(t,e,i),f(e,n),f(n,s),f(e,r),f(e,l),f(l,o),f(o,c),f(e,a),f(e,u),f(u,d),f(e,m),f(e,$),f($,w),f(e,k),f(e,J),et(j,J,null),T=!0},p(e,n){t=e,(!T||1&n)&&S!==(S=t[13].name+"")&&_(s,S),(!T||1&n)&&L!==(L=t[13].ip+"")&&_(c,L),(!T||1&n&&i!==(i="http://"+t[13].ip))&&y(o,"href",i),(!T||1&n)&&M!==(M=t[13].id+"")&&_(d,M),(!T||1&n)&&q!==(q=t[13].status?"online":"offline")&&_(w,q),(!T||1&n&&v!==(v="tbl-bdy-lg ipt-lg w-full "+(t[13].status?"bg-green-50":"bg-red-50")))&&y($,"class",v)},i(t){T||(G(j.$$.fragment,t),T=!0)},o(t){Z(j.$$.fragment,t),T=!1},d(t){t&&g(e),nt(j)}}}function nn(t){let e,n,r,l,o,c,i,a,u,d,m,$,x;return{c(){e=h("tr"),n=h("td"),r=h("input"),l=b(),o=h("td"),c=h("input"),i=b(),a=h("td"),u=h("input"),d=b(),m=h("td"),y(r,"class","ipt-lg w-full"),y(r,"type","text"),y(n,"class","tbl-bdy-lg"),y(c,"class","ipt-lg w-full"),y(c,"type","text"),y(o,"class","tbl-bdy-lg"),y(u,"class","ipt-lg w-full"),y(u,"type","text"),y(a,"class","tbl-bdy-lg"),y(m,"class","tbl-bdy-lg"),y(e,"class","txt-sz txt-pad")},m(s,g){p(s,e,g),f(e,n),f(n,r),J(r,t[2].name),f(e,l),f(e,o),f(o,c),J(c,t[2].ip),f(e,i),f(e,a),f(a,u),J(u,t[2].id),f(e,d),f(e,m),$||(x=[v(r,"input",t[8]),v(c,"input",t[9]),v(u,"input",t[10])],$=!0)},p(t,e){4&e&&r.value!==t[2].name&&J(r,t[2].name),4&e&&c.value!==t[2].ip&&J(c,t[2].ip),4&e&&u.value!==t[2].id&&J(u,t[2].id)},d(t){t&&g(e),$=!1,s(x)}}}function sn(t){let e,n,r,l,o,c,i,a,u,d,$,w,k,J,j=t[1]?"Сохранить":"Добавить устройство",T=t[0],S=[];for(let e=0;eZ(S[t],1,1,(()=>{S[t]=null}));let M=t[1]&&nn(t);return{c(){e=h("table"),n=h("thead"),n.innerHTML='| Название устройства | \n IP адрес | \n Идентификатор | \n Состояние | \n |
',r=b(),l=h("tbody");for(let t=0;t{o[i]=null})),Q(),n=o[e],n?n.p(t,r):(n=o[e]=l[e](t),n.c()),G(n,1),n.m(s.parentNode,s))},i(t){r||(G(n),r=!0)},o(t){Z(n),r=!1},d(t){o[e].d(t),t&&g(s)}}}function on(t,e,n){let{show:s}=e,{deviceList:r}=e,{showInput:l}=e,{newDevice:o={}}=e,{addDevInList:c=(()=>{})}=e,{sendToAllDevices:i=(t=>{})}=e;function a(t){for(let e=0;e{"show"in t&&n(3,s=t.show),"deviceList"in t&&n(0,r=t.deviceList),"showInput"in t&&n(1,l=t.showInput),"newDevice"in t&&n(2,o=t.newDevice),"addDevInList"in t&&n(4,c=t.addDevInList),"sendToAllDevices"in t&&n(5,i=t.sendToAllDevices)},[r,l,o,s,c,i,a,t=>a(t),function(){o.name=this.value,n(2,o)},function(){o.ip=this.value,n(2,o)},function(){o.id=this.value,n(2,o)},()=>(n(1,l=!l),c()),t=>i("/reboot|")]}class cn extends rt{constructor(t){super(),st(this,t,on,ln,l,{show:3,deviceList:0,showInput:1,newDevice:2,addDevInList:4,sendToAllDevices:5})}}function an(t,e,n){const s=t.slice();return s[18]=e[n][0],s[19]=e[n][1],s[21]=n,s}function un(t,e,n){const s=t.slice();return s[22]=e[n],s[21]=n,s}function dn(t,e,n){const s=t.slice();return s[18]=e[n][0],s[19]=e[n][1],s}function fn(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||(G(n.$$.fragment,t),s=!0)},o(t){Z(n.$$.fragment,t),s=!1},d(t){nt(n,t)}}}function pn(t){let e,n,s,r,l,o,c,i,a,u;return n=new Bt({props:{title:"Системная информация",$$slots:{default:[yn]},$$scope:{ctx:t}}}),r=new Bt({props:{title:"Системные настройки",$$slots:{default:[kn]},$$scope:{ctx:t}}}),o=new Bt({props:{title:"Лог",$$slots:{default:[Jn]},$$scope:{ctx:t}}}),a=new Bt({props:{title:"Системные ошибки",$$slots:{default:[Mn]},$$scope:{ctx:t}}}),{c(){e=h("div"),tt(n.$$.fragment),s=b(),tt(r.$$.fragment),l=b(),tt(o.$$.fragment),c=b(),i=h("div"),tt(a.$$.fragment),y(e,"class","grd-3col1"),y(i,"class","grd-1col1")},m(t,d){p(t,e,d),et(n,e,null),f(e,s),et(r,e,null),f(e,l),et(o,e,null),p(t,c,d),p(t,i,d),et(a,i,null),u=!0},p(t,e){const s={};67108949&e&&(s.$$scope={dirty:e,ctx:t}),n.$set(s);const l={};67109002&e&&(l.$$scope={dirty:e,ctx:t}),r.$set(l);const c={};67108896&e&&(c.$$scope={dirty:e,ctx:t}),o.$set(c);const i={};67109380&e&&(i.$$scope={dirty:e,ctx:t}),a.$set(i)},i(t){u||(G(n.$$.fragment,t),G(r.$$.fragment,t),G(o.$$.fragment,t),G(a.$$.fragment,t),u=!0)},o(t){Z(n.$$.fragment,t),Z(r.$$.fragment,t),Z(o.$$.fragment,t),Z(a.$$.fragment,t),u=!1},d(t){t&&g(e),nt(n),nt(r),nt(o),t&&g(c),t&&g(i),nt(a)}}}function gn(t){let e,n,s,r,l=t[19]+"";return{c(){e=h("option"),n=x(l),s=b(),e.__value=r=t[19],e.value=e.__value},m(t,r){p(t,e,r),f(e,n),f(e,s)},p(t,s){16&s&&l!==(l=t[19]+"")&&_(n,l),16&s&&r!==(r=t[19])&&(e.__value=r,e.value=e.__value)},d(t){t&&g(e)}}}function mn(t){let e;return{c(){e=h("p"),e.textContent="не подключено",y(e,"class","text-red-500 font-bold text-sm text-center truncate")},m(t,n){p(t,e,n)},d(t){t&&g(e)}}}function hn(t){let e;return{c(){e=h("p"),e.textContent="нет сигнала",y(e,"class","text-red-500 font-bold text-sm text-center truncate")},m(t,n){p(t,e,n)},d(t){t&&g(e)}}}function $n(t){let e;return{c(){e=h("p"),e.textContent="очень низкий",y(e,"class","text-red-500 font-bold text-sm text-center truncate")},m(t,n){p(t,e,n)},d(t){t&&g(e)}}}function xn(t){let e;return{c(){e=h("p"),e.textContent="низкий",y(e,"class","text-yellow-500 font-bold text-sm text-center truncate")},m(t,n){p(t,e,n)},d(t){t&&g(e)}}}function bn(t){let e;return{c(){e=h("p"),e.textContent="хороший",y(e,"class","text-yellow-500 font-bold text-sm text-center truncate")},m(t,n){p(t,e,n)},d(t){t&&g(e)}}}function wn(t){let e;return{c(){e=h("p"),e.textContent="очень хороший",y(e,"class","text-green-500 font-bold text-sm text-center truncate")},m(t,n){p(t,e,n)},d(t){t&&g(e)}}}function vn(t){let e;return{c(){e=h("p"),e.textContent="отличный",y(e,"class","text-green-500 font-bold text-sm text-center truncate")},m(t,n){p(t,e,n)},d(t){t&&g(e)}}}function yn(t){let e,n,r,l,o,c,i,a,u,d,$,w,k,J,T,S,L,M,q,E,O,C,N,H,P,A,D,B,z,R,F,U,W,V,Y,K,Q,G,Z,X,tt,et,nt,st,rt,lt,ot,ct,it,at,ut,dt,ft,pt,gt,mt,ht,$t,xt,bt,wt,vt,yt,kt,_t,Jt,jt,Tt,St,Lt,Mt,qt,Et,Ot,Ct,Nt,Ht,Pt=t[2].bn+"",At=t[2].bver+"",Dt=t[2].upt+"",Bt=t[2].uptm+"",It=t[2].uptw+"",zt=t[2].heap+"",Rt=t[2].fl+"",Ft=t[2].rst+"",Ut=Object.entries(t[4]),Wt=[];for(let e=0;eНазвание прошивки',r=b(),l=h("div"),o=h("p"),c=x(Pt),i=b(),a=h("div"),u=h("div"),u.innerHTML='Доступные версии
',d=b(),$=h("div"),w=h("select");for(let t=0;tВерсия прошивки',S=b(),L=h("div"),M=h("p"),q=x(At),E=b(),O=h("div"),C=h("div"),C.innerHTML='Uptime устройства
',N=b(),H=h("div"),P=h("p"),A=x(Dt),D=b(),B=h("div"),z=h("div"),z.innerHTML='Uptime сессии mqtt
',R=b(),F=h("div"),U=h("p"),W=x(Bt),V=b(),Y=h("div"),K=h("div"),K.innerHTML='Uptime сессии wifi
',Q=b(),G=h("div"),Z=h("p"),X=x(It),tt=b(),et=h("div"),nt=h("div"),nt.innerHTML='Качество WiFi сигнала
',st=b(),rt=h("div"),Vt&&Vt.c(),lt=b(),Yt&&Yt.c(),ot=b(),Kt&&Kt.c(),ct=b(),Qt&&Qt.c(),it=b(),Gt&&Gt.c(),at=b(),Zt&&Zt.c(),ut=b(),Xt&&Xt.c(),dt=b(),ft=h("div"),pt=h("div"),pt.innerHTML='Остаток RAM
',gt=b(),mt=h("div"),ht=h("p"),$t=x(zt),xt=b(),bt=h("div"),wt=h("div"),wt.innerHTML='Кол-во записей на flash
',vt=b(),yt=h("div"),kt=h("p"),_t=x(Rt),Jt=b(),jt=h("div"),Tt=h("div"),Tt.innerHTML='Причина перезагрузки
',St=b(),Lt=h("div"),Mt=h("p"),qt=x(Ft),Ot=b(),Ct=h("button"),Ct.textContent="Обновить прошивку",y(n,"class","w-2/3"),y(o,"class","text-gray-500 font-bold text-sm text-center truncate"),y(l,"class","flex justify-center w-1/3"),y(e,"class","flex mb-2 h-6 items-center"),y(u,"class","w-2/3"),y(w,"class","border border-indigo-500 border-4 text-center"),void 0===t[0]&&I((()=>t[11].call(w))),y($,"class","flex justify-center w-1/3"),y(a,"class","flex mb-2 h-6 items-center"),y(T,"class","w-2/3"),y(M,"class","text-gray-500 font-bold text-sm text-center truncate"),y(L,"class","flex justify-center w-1/3"),y(J,"class","flex mb-2 h-6 items-center"),y(C,"class","w-2/3"),y(P,"class","text-gray-500 font-bold text-sm text-center truncate"),y(H,"class","flex justify-center w-1/3"),y(O,"class","flex mb-2 h-6 items-center"),y(z,"class","w-2/3"),y(U,"class","text-gray-500 font-bold text-sm text-center truncate"),y(F,"class","flex justify-center w-1/3"),y(B,"class","flex mb-2 h-6 items-center"),y(K,"class","w-2/3"),y(Z,"class","text-gray-500 font-bold text-sm text-center truncate"),y(G,"class","flex justify-center w-1/3"),y(Y,"class","flex mb-2 h-6 items-center"),y(nt,"class","w-2/3"),y(rt,"class","flex justify-center w-1/3 text-xs sm:text-sm md:text-base lg:text-base xl:text-base 2xl:text-base break-words"),y(et,"class","flex mb-2 h-6 items-center"),y(pt,"class","w-2/3"),y(ht,"class","text-green-500 font-bold text-center truncate"),y(mt,"class","flex justify-center w-1/3 text-sm text-center"),y(ft,"class","flex mb-2 h-6 items-center"),y(wt,"class","w-2/3"),y(kt,"class","text-green-500 font-bold text-center truncate"),y(yt,"class","flex justify-center w-1/3 text-sm"),y(bt,"class","flex mb-2 h-6 items-center"),y(Tt,"class","w-2/3"),y(Mt,"class",Et=(t[2].rst.toString().includes("Watchdog")||t[2].rst.toString().includes("Exception")?"text-red-500":"text-green-500")+" font-bold text-center truncate"),y(Lt,"class","flex justify-center w-1/3 text-sm"),y(jt,"class","flex mb-2 h-6 items-center"),y(Ct,"class","btn-lg")},m(s,g){p(s,e,g),f(e,n),f(e,r),f(e,l),f(l,o),f(o,c),p(s,i,g),p(s,a,g),f(a,u),f(a,d),f(a,$),f($,w);for(let t=0;tВключить лог',r=b(),l=h("div"),o=h("input"),c=b(),i=h("button"),i.textContent="Перезагрузить устройство",y(n,"class","w-5/6"),y(o,"type","checkbox"),y(o,"class","form-checkbox h-4 w-4 text-gray-600"),y(l,"class","flex justify-center w-1/6"),y(e,"class","flex mb-2 h-6 items-center"),y(i,"class","btn-lg")},m(s,d){p(s,e,d),f(e,n),f(e,r),f(e,l),f(l,o),o.checked=t[1].log,p(s,c,d),p(s,i,d),a||(u=[v(o,"change",t[13]),v(o,"change",t[14]),v(i,"click",t[15])],a=!0)},p(t,e){2&e&&(o.checked=t[1].log)},d(t){t&&g(e),t&&g(c),t&&g(i),a=!1,s(u)}}}function _n(t){let e,n,s,r=t[22].msg+"";return{c(){e=h("div"),n=x(r),y(e,"class",s=t[22].msg.toString().includes("[E]")?"text-xs text-red-500":"text-xs text-black")},m(t,s){p(t,e,s),f(e,n)},p(t,l){32&l&&r!==(r=t[22].msg+"")&&_(n,r),32&l&&s!==(s=t[22].msg.toString().includes("[E]")?"text-xs text-red-500":"text-xs text-black")&&y(e,"class",s)},d(t){t&&g(e)}}}function Jn(t){let e,n=t[5],s=[];for(let e=0;e{s=null})),Q())},i(t){n||(G(s),n=!0)},o(t){Z(s),n=!1},d(t){s&&s.d(t),t&&g(e)}}}function Mn(t){let e,n,s=Object.entries(t[2]),r=[];for(let e=0;eZ(r[t],1,1,(()=>{r[t]=null}));return{c(){for(let t=0;t{o[i]=null})),Q(),n=o[e],n?n.p(t,r):(n=o[e]=l[e](t),n.c()),G(n,1),n.m(s.parentNode,s))},i(t){r||(G(n),r=!0)},o(t){Z(n),r=!1},d(t){o[e].d(t),t&&g(s)}}}function En(t,e,n){let{errorsJson:s}=e,{rebootEsp:r=(()=>{})}=e,{versionsList:l}=e,{choosingVersion:o}=e,{coreMessages:c}=e,{settingsJson:i}=e,{startUpdate:a=(()=>{})}=e,{saveSett:u=(()=>{})}=e,{show:d}=e,{cancelAlarm:f=(t=>{})}=e;return t.$$set=t=>{"errorsJson"in t&&n(2,s=t.errorsJson),"rebootEsp"in t&&n(3,r=t.rebootEsp),"versionsList"in t&&n(4,l=t.versionsList),"choosingVersion"in t&&n(0,o=t.choosingVersion),"coreMessages"in t&&n(5,c=t.coreMessages),"settingsJson"in t&&n(1,i=t.settingsJson),"startUpdate"in t&&n(6,a=t.startUpdate),"saveSett"in t&&n(7,u=t.saveSett),"show"in t&&n(8,d=t.show),"cancelAlarm"in t&&n(9,f=t.cancelAlarm)},[o,i,s,r,l,c,a,u,d,f,{mqtt:{e1:{descr:"Ошибка mqtt",color:"text-red-500",txt:"Нет ответа от сервера",cancel:!1},e2:{descr:"Ошибка mqtt",color:"text-red-500",txt:"Соединение было разорвано",cancel:!1},e3:{descr:"Ошибка mqtt",color:"text-red-500",txt:"Ошибка соединения. Обычно возникает когда неверно указано название сервера MQTT",cancel:!1},e4:{descr:"Ошибка mqtt",color:"text-red-500",txt:"Клиент был отключен",cancel:!1},e6:{descr:"Ошибка mqtt",color:"text-red-500",txt:"Ошибка версии",cancel:!1},e7:{descr:"Ошибка mqtt",color:"text-red-500",txt:"Отклонен идентификатор",cancel:!1},e8:{descr:"Ошибка mqtt",color:"text-red-500",txt:"Не могу установить соединение",cancel:!1},e9:{descr:"Ошибка mqtt",color:"text-red-500",txt:"Неправильное имя пользователя/пароль"},e10:{descr:"Ошибка mqtt",color:"text-red-500",txt:"Не авторизован для подключения",cancel:!1},e11:{descr:"Ошибка mqtt",color:"text-red-500",txt:"Название сервера пустое",cancel:!1},e12:{descr:"Ошибка mqtt",color:"text-red-500",txt:"Имя пользователя или пароль пустые",cancel:!1},e13:{descr:"Mqtt",color:"text-red-500",txt:"Подключение в процессе",cancel:!1}},wse1:{1:{descr:"Ошибка веб сокетов",color:"text-red-500",txt:"Слишком много клиентов было открыто. Допускается не более четырех.",cancel:!0}},jse1:{1:{descr:"Ошибка json",color:"text-red-500",txt:"Недостаточный размер буфера библиотеки Arduino Json. Устройство может вести себя непредсказуемо. Обратитесь к разработчику.",cancel:!0}},jse2:{1:{descr:"Ошибка json",color:"text-red-500",txt:"Ошибка записи/чтения json.",cancel:!0,num:!0}},jse3:{1:{descr:"Ошибка json",color:"text-red-500",txt:"Ошибка чтения json файла с виджетами",cancel:!0}}},function(){o=T(this),n(0,o),n(4,l)},()=>a(),function(){i.log=this.checked,n(1,i)},()=>u(),()=>r(),t=>f(t)]}class On extends rt{constructor(t){super(),st(this,t,En,qn,l,{errorsJson:2,rebootEsp:3,versionsList:4,choosingVersion:0,coreMessages:5,settingsJson:1,startUpdate:6,saveSett:7,show:8,cancelAlarm:9})}}function Cn(e){let n,s,r,l;return{c(){n=$("svg"),s=$("path"),y(s,"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"),y(n,"class",r="h-8 w-8 "+e[0]),y(n,"width","8"),y(n,"height","8"),y(n,"viewBox",l=e[1]+" "+e[2]+" 24 24"),y(n,"stroke-width","2"),y(n,"stroke","currentColor"),y(n,"fill","none"),y(n,"stroke-linecap","round"),y(n,"stroke-linejoin","round")},m(t,e){p(t,n,e),f(n,s)},p(t,[e]){1&e&&r!==(r="h-8 w-8 "+t[0])&&y(n,"class",r),6&e&&l!==(l=t[1]+" "+t[2]+" 24 24")&&y(n,"viewBox",l)},i:t,o:t,d(t){t&&g(n)}}}function Nn(t,e,n){let{color:s}=e,{x:r=0}=e,{y:l=0}=e;return t.$$set=t=>{"color"in t&&n(0,s=t.color),"x"in t&&n(1,r=t.x),"y"in t&&n(2,l=t.y)},[s,r,l]}class Hn extends rt{constructor(t){super(),st(this,t,Nn,Cn,l,{color:0,x:1,y:2})}}function Pn(t,e,n){const s=t.slice();return s[120]=e[n],s}function An(t){let e,n;return e=new Nt({}),{c(){tt(e.$$.fragment)},m(t,s){et(e,t,s),n=!0},i(t){n||(G(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){nt(e,t)}}}function Dn(t){let e,n,s,r,l=t[120].name+"";return{c(){e=h("option"),n=x(l),s=b(),e.__value=r=t[120].ws,e.value=e.__value},m(t,r){p(t,e,r),f(e,n),f(e,s)},p(t,s){262144&s[0]&&l!==(l=t[120].name+"")&&_(n,l),262144&s[0]&&r!==(r=t[120].ws)&&(e.__value=r,e.value=e.__value)},d(t){t&&g(e)}}}function Bn(t){let e,n,s,r,l,o,c,i,a,u;return e=new Jt({props:{path:"/",$$slots:{default:[zn]},$$scope:{ctx:t}}}),s=new Jt({props:{path:"/config",$$slots:{default:[Rn]},$$scope:{ctx:t}}}),l=new Jt({props:{path:"/connection",$$slots:{default:[Fn]},$$scope:{ctx:t}}}),c=new Jt({props:{path:"/list",$$slots:{default:[Un]},$$scope:{ctx:t}}}),a=new Jt({props:{path:"/system",$$slots:{default:[Wn]},$$scope:{ctx:t}}}),{c(){tt(e.$$.fragment),n=b(),tt(s.$$.fragment),r=b(),tt(l.$$.fragment),o=b(),tt(c.$$.fragment),i=b(),tt(a.$$.fragment)},m(t,d){et(e,t,d),p(t,n,d),et(s,t,d),p(t,r,d),et(l,t,d),p(t,o,d),et(c,t,d),p(t,i,d),et(a,t,d),u=!0},p(t,n){const r={};8204&n[0]|1073741824&n[3]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r);const o={};138256&n[0]|1073741824&n[3]&&(o.$$scope={dirty:n,ctx:t}),s.$set(o);const i={};114720&n[0]|1073741824&n[3]&&(i.$$scope={dirty:n,ctx:t}),l.$set(i);const u={};2359360&n[0]|1073741824&n[3]&&(u.$$scope={dirty:n,ctx:t}),c.$set(u);const d={};4244352&n[0]|1073741824&n[3]&&(d.$$scope={dirty:n,ctx:t}),a.$set(d)},i(t){u||(G(e.$$.fragment,t),G(s.$$.fragment,t),G(l.$$.fragment,t),G(c.$$.fragment,t),G(a.$$.fragment,t),u=!0)},o(t){Z(e.$$.fragment,t),Z(s.$$.fragment,t),Z(l.$$.fragment,t),Z(c.$$.fragment,t),Z(a.$$.fragment,t),u=!1},d(t){nt(e,t),t&&g(n),nt(s,t),t&&g(r),nt(l,t),t&&g(o),nt(c,t),t&&g(i),nt(a,t)}}}function In(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||(G(n.$$.fragment,t),s=!0)},o(t){Z(n.$$.fragment,t),s=!1},d(t){nt(n,t)}}}function zn(t){let e,n;return e=new ge({props:{show:t[3],layoutJson:t[13],pages:t[2],wsPush:t[40]}}),{c(){tt(e.$$.fragment)},m(t,s){et(e,t,s),n=!0},p(t,n){const s={};8&n[0]&&(s.show=t[3]),8192&n[0]&&(s.layoutJson=t[13]),4&n[0]&&(s.pages=t[2]),e.$set(s)},i(t){n||(G(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){nt(e,t)}}}function Rn(t){let e,n,s;function r(e){t[43](e)}let l={show:t[4],configJson:t[10],widgetsJson:t[11],itemsJson:t[12],saveConfig:t[41],rebootEsp:t[42]};return void 0!==t[17]&&(l.scenarioTxt=t[17]),e=new He({props:l}),C.push((()=>X(e,"scenarioTxt",r))),{c(){tt(e.$$.fragment)},m(t,n){et(e,t,n),s=!0},p(t,s){const r={};16&s[0]&&(r.show=t[4]),1024&s[0]&&(r.configJson=t[10]),2048&s[0]&&(r.widgetsJson=t[11]),4096&s[0]&&(r.itemsJson=t[12]),!n&&131072&s[0]&&(n=!0,r.scenarioTxt=t[17],z((()=>n=!1))),e.$set(r)},i(t){s||(G(e.$$.fragment,t),s=!0)},o(t){Z(e.$$.fragment,t),s=!1},d(t){nt(e,t)}}}function Fn(t){let e,n;return e=new Ge({props:{show:t[5],rebootEsp:t[44],ssidClick:t[45],saveSett:t[46],saveMqtt:t[47],settingsJson:t[14],errorsJson:t[15],ssidJson:t[16]}}),{c(){tt(e.$$.fragment)},m(t,s){et(e,t,s),n=!0},p(t,n){const s={};32&n[0]&&(s.show=t[5]),16384&n[0]&&(s.settingsJson=t[14]),32768&n[0]&&(s.errorsJson=t[15]),65536&n[0]&&(s.ssidJson=t[16]),e.$set(s)},i(t){n||(G(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){nt(e,t)}}}function Un(t){let e,n;return e=new cn({props:{show:t[6],deviceList:t[18],showInput:Yn,addDevInList:t[48],newDevice:t[21],sendToAllDevices:t[49]}}),{c(){tt(e.$$.fragment)},m(t,s){et(e,t,s),n=!0},p(t,n){const s={};64&n[0]&&(s.show=t[6]),262144&n[0]&&(s.deviceList=t[18]),2097152&n[0]&&(s.newDevice=t[21]),e.$set(s)},i(t){n||(G(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){nt(e,t)}}}function Wn(t){let e,n,s;function r(e){t[54](e)}let l={show:t[7],errorsJson:t[15],settingsJson:t[14],saveSett:t[50],rebootEsp:t[51],cancelAlarm:t[52],versionsList:t[8],startUpdate:t[53],coreMessages:t[22]};return void 0!==t[9]&&(l.choosingVersion=t[9]),e=new On({props:l}),C.push((()=>X(e,"choosingVersion",r))),{c(){tt(e.$$.fragment)},m(t,n){et(e,t,n),s=!0},p(t,s){const r={};128&s[0]&&(r.show=t[7]),32768&s[0]&&(r.errorsJson=t[15]),16384&s[0]&&(r.settingsJson=t[14]),256&s[0]&&(r.versionsList=t[8]),4194304&s[0]&&(r.coreMessages=t[22]),!n&&512&s[0]&&(n=!0,r.choosingVersion=t[9],z((()=>n=!1))),e.$set(r)},i(t){s||(G(e.$$.fragment,t),s=!0)},o(t){Z(e.$$.fragment,t),s=!1},d(t){nt(e,t)}}}function Vn(t){let e,n,r,l,o,c,i,a,u,d,$,x,w,k,_,J,T,S,L,M,q,E,O,C,N,H,P,A,D,B,z,R,F,U,W,V,Y,X,st,rt,lt,ot,ct=t[23]&&An(),it=t[18],at=[];for(let e=0;e",_=b(),J=h("ul"),T=h("li"),S=h("a"),S.textContent="Управление",L=b(),M=h("li"),q=h("a"),q.textContent="Конфигуратор",E=b(),O=h("li"),C=h("a"),C.textContent="Подключение",N=b(),H=h("li"),P=h("a"),P.textContent="Устройства",A=b(),D=h("li"),B=h("a"),B.textContent="Системные",z=b(),R=h("main"),F=h("ul"),U=h("div"),V.c(),X=b(),st=h("footer"),st.innerHTML='Developed by Dmitry Borisenko
',y(c,"class","border border-indigo-500 border-4"),void 0===t[20]&&I((()=>t[36].call(c))),y(o,"class","px-15 py-1"),y(a,"class","pl-4 pr-4 py-1"),y(l,"class","flex content-center items-center justify-end"),y(r,"class","h-10 w-full bg-gray-100 overflow-auto shadow-md"),y(x,"id","menu__toggle"),y(x,"type","checkbox"),y(k,"class","menu__btn"),y(k,"for","menu__toggle"),y(S,"class","menu__item"),y(S,"href","/"),y(q,"class","menu__item"),y(q,"href","/config"),y(C,"class","menu__item"),y(C,"href","/connection"),y(P,"class","menu__item"),y(P,"href","/list"),y(B,"class","menu__item"),y(B,"href","/system"),y(J,"class","menu__box"),y($,"class","flex"),y(U,"class","bg-cover pt-0 px-4"),y(F,"class","menu__main"),y(R,"class",Y="flex-1 overflow-y-auto p-0 "+(!0!==t[0]||t[1]?"ml-0":"ml-36")),y(st,"class","h-4 bg-gray-100 border-gray-200 shadow-lg"),y(e,"class","flex flex-col h-screen bg-gray-50")},m(s,g){p(s,e,g),ct&&ct.m(e,null),f(e,n),f(e,r),f(r,l),f(l,o),f(o,c);for(let t=0;t{ct=null})),Q()),262144&s[0]){let e;for(it=t[18],e=0;e{dt[l]=null})),Q(),V=dt[W],V?V.p(t,s):(V=dt[W]=ut[W](t),V.c()),G(V,1),V.m(U,null)),(!rt||3&s[0]&&Y!==(Y="flex-1 overflow-y-auto p-0 "+(!0!==t[0]||t[1]?"ml-0":"ml-36")))&&y(R,"class",Y)},i(t){rt||(G(ct),G(u.$$.fragment,t),G(V),rt=!0)},o(t){Z(ct),Z(u.$$.fragment,t),Z(V),rt=!1},d(t){t&&g(e),ct&&ct.d(),m(at,t),nt(u),dt[W].d(),lt=!1,s(ot)}}}let Yn=!1;function Kn(t,e,n){let s;o(t,xt,(t=>n(83,s=t))),xt.mode.hash();let r,l=!1,c=!1,i=document.location.hostname,a=!0,u=[],d=!1,f=!1,p=!1,g=!1,m=!1,h={},$=[],x=!1,b=!1,w=[],v=!1,y=!1,k=[],_=!1,J=!1,j=[],S=!1,L=!1,M={},E=!1,O={},C=!1,N={},H=!1,P={},A=!1,D=[],B=!1,I="",z=!1,R=!1,F=[];F=[{name:"--",id:"--",ip:i,ws:0,status:!1}];let U,W=[],V=!1,Y=0,K=!0,Q={},G=[];var Z=function(){this.parts=[]};let X;Z.prototype.append=function(t){this.parts.push(t),this.blob=void 0},Z.prototype.getBlob=function(){return this.blob||(this.blob=new Blob(this.parts,{type:"binary"})),this.blob},Z.prototype.clear=function(){this.parts=[]};var tt=new Z,et=new Z,nt=new Z,st=new Z,rt=(st=new Z,new Z);function lt(){void 0!==Y&&wt(Y,X)}function ot(){Tt(Y);let t=0;F.forEach((e=>{e.ws=t,e.status||(it(t),ut(t)),t++})),n(18,F)}function ct(t,e){F.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(18,F),Tt(Y),n(19,V=U.status)}function it(t){let e=at(t);"error"===e?console.log("[e]","device list wrong"):(W[t]=new WebSocket("ws://"+e+":81"),W.binaryType="blob",console.log("[i]",e,t,"started connecting..."))}function at(t){let e="error";return F.forEach((n=>{t===n.ws&&(e=n.ip)})),e}function ut(t){if(W[t]){let e=at(t);console.log("[i]",e,t,"web socket events added"),W[t].addEventListener("open",(function(n){console.log("[i]",e,t,"completed connecting"),ct(t,!0),a&&wt(0,"/list|"),t===Y&<()})),W[t].addEventListener("message",(function(e){if("string"==typeof e.data){let c=e.data;if(t===Y){if(c.includes("devicelist")&&Lt(c)&&(D=JSON.parse(c),D=D,B=!0,console.log("✔","incDeviceList json parced"),dt(),a?(n(18,F=D),n(18,F[0].status=!0,F)):n(18,(r=F,l=D,o=new Set(r.map((t=>t.ip))),F=[...r,...l.filter((t=>!o.has(t.ip)))])),a=!1,n(18,F),Jt(),ot()),c.includes("status")&&Lt(c)){!function(t){for(let e=0;e{let e=t.result;n(17,I=e),n(17,I),R=!0,console.log("✔","scenarioTxt parced"),dt()}}if("/st/config.json"===c&&(x=!0),"/end/config.json"===c){x=!1;s=tt.getBlob();let t=new FileReader;t.readAsText(s),t.onload=()=>{let e=t.result;Lt(e)&&(n(10,$=JSON.parse(e)),n(10,$),b=!0,console.log("✔","configJson parced"),dt())}}if("/st/widgets.json"===c&&(v=!0),"/end/widgets.json"===c){v=!1;s=et.getBlob();let t=new FileReader;t.readAsText(s),t.onload=()=>{let e=t.result;Lt(e)&&(n(11,w=JSON.parse(e)),n(11,w),y=!0,console.log("✔","widgetsJson parced"),dt())}}if("/st/items.json"===c&&(_=!0),"/end/items.json"===c){_=!1;s=nt.getBlob();let t=new FileReader;t.readAsText(s),t.onload=()=>{let e=t.result;Lt(e)&&(n(12,k=JSON.parse(e)),n(12,k),J=!0,console.log("✔","itemsJson parced"),dt())}}if("/st/layout.json"===c&&(S=!0),"/end/layout.json"===c){S=!1;s=st.getBlob();let e=new FileReader;e.readAsText(s),e.onload=()=>{let s=e.result;Lt(s)&&(n(13,j=JSON.parse(s)),n(13,j),kt(),L=!0,console.log("✔","layoutJson parced",t),dt())}}}}var r,l,o;e.data instanceof Blob&&t===Y&&(x&&tt.append(e.data),v&&et.append(e.data),_&&nt.append(e.data),S&&st.append(e.data),z&&rt.append(e.data))})),W[t].addEventListener("close",(n=>{console.log("[e]",e,"connection closed"),ct(t,!1)})),W[t].addEventListener("error",(function(n){console.log("[e]",e,"connection error"),ct(t,!1)}))}else console.log("[e]","socket not exist")}function dt(t){"/|"===X&&L&&A&&(ht(),console.log("✔✔","dashboard data parced"),function(t){for(const[e,s]of Object.entries(t))for(let t=0;t5?(!function(t,e,n,s,r){for(let l=0;l5?wt(Y,"/sgnittes|"+JSON.stringify(M)):window.alert("Ошибка"),mt(),wt(Y,"/mqtt|")}function mt(){n(10,$=[]),tt.clear(),n(11,w=[]),et.clear(),n(12,k=[]),nt.clear(),n(13,j=[]),st.clear(),n(14,M={}),n(15,O={}),n(22,G=[]),n(17,I=""),rt.clear(),n(3,d=!1),n(4,f=!1),n(5,p=!1),n(6,g=!1),n(7,m=!1),ht(),console.log("[i]","all app data cleared")}function ht(){b=!1,y=!1,J=!1,L=!1,E=!1,C=!1,H=!1,A=!1,B=!1,R=!1}function $t(t,e,n){let s=e+" "+n;console.log("[i]","send to ws msg:",s),wt(t,s)}function bt(){setTimeout(bt,2e4),console.log("[i]","----timer tick----"),K||F.forEach((t=>{!function(t){let e=!1;return F.forEach((n=>{t===n.ws&&(e=n.status)})),e}(t.ws)?(it(t.ws),ut(t.ws)):wt(t.ws,"/tst|")})),K=!1}function wt(t,e){W[t]&&1===W[t].readyState?(W[t].send(e),console.log("[i]",at(t),t,"msg send success",e)):console.log("[e]",at(t),t,"msg not send",e)}function vt(t){F.forEach((e=>{e.status&&wt(e.ws,t)}))}function yt(){n(2,u=[]);Array.from(new Set(Array.from(j,(({page:t})=>t)))).forEach((function(t,e,s){n(2,u=[...u,JSON.parse(JSON.stringify({page:t}))])})),u.sort((function(t,e){return t.pagee.page?1:0}))}function kt(){yt(),n(13,j)}xt.subscribe((function(){mt(),X=s.path.toString(),X+="|",console.log("[i]","user on page:",X),lt()}));const _t=t=>{G.length>=100&&G.shift(),n(22,G=[...G,{msg:t}]),G.sort((function(t,e){return t.time>e.time?-1:t.time{console.log("[i]","mounted"),Jt(),a=!0,ot(),bt(),yt()}));return[l,c,u,d,f,p,g,m,h,r,$,w,k,j,M,O,N,I,F,V,Y,Q,G,Et,ft,pt,gt,$t,vt,jt,St,Mt,qt,Ct,Ht,Pt,function(){Y=T(this),n(20,Y),n(18,F)},()=>jt(),function(){l=this.checked,n(0,l)},()=>Mt(),(t,e,n)=>$t(t,e,n),()=>ft(),()=>Ct(),function(t){I=t,n(17,I)},()=>Ct(),()=>qt(),()=>pt(),()=>gt(),()=>St(),t=>vt(t),()=>pt(),()=>Ct(),t=>Ht(t),()=>Pt(),function(t){r=t,n(9,r)}]}return new class extends rt{constructor(t){super(),st(this,t,Kn,Vn,l,{},null,[-1,-1,-1,-1])}}({target:document.body,props:{name:"world"}})}();
//# sourceMappingURL=bundle.js.map
diff --git a/data_svelte/settings.json b/data_svelte/settings.json
index 0c3350bb..3811dd35 100644
--- a/data_svelte/settings.json
+++ b/data_svelte/settings.json
@@ -3,8 +3,8 @@
"name": "IoTmanagerVer4",
"apssid": "IoTmanager",
"appass": "",
- "routerssid": "WLAN1-Y1GYEF",
- "routerpass": "2egY69YTA8DDR7En",
+ "routerssid": "rise",
+ "routerpass": "hostel3333",
"timezone": 1,
"ntp": "pool.ntp.org",
"weblogin": "admin",
diff --git a/src/EventsAndOrders.cpp b/src/EventsAndOrders.cpp
index 4a38122d..5fc634a1 100644
--- a/src/EventsAndOrders.cpp
+++ b/src/EventsAndOrders.cpp
@@ -3,15 +3,13 @@
extern IoTScenario iotScen; // объект управления сценарием
-// orderBuf - буфер прямых команд, которые нужно выпонить сразу, нажали на кнопку в приложении, сработало условие сценария
+// orderBuf - буфер прямых команд, которые нужно выпонить сразу, нажали на кнопку в приложении
//необходимо тут же изменить параметр, записать новое значение
// eventBuf - буфер событий, в нем как на конвеере едут события, и каждое событие проверяется через все условия сценариев
//его главное отличие от orderBuf в том что события в нем не для выполнения, а для проверки в условиях сценариев
//события в нем лишь вызывают другие команды, помещенные в блоке сценария, если условие совпало.
-
-
//эта функция будет вызываться:
// 1.на приеме сообщений в mqtt (см mqttCallback строку 142 в mqttClient.cpp)
// 2.на приеме сообщений в ws
@@ -26,14 +24,16 @@ void handleOrder() {
if (orderBuf.length()) {
String order = selectToMarker(orderBuf, ",");
Serial.println("order: " + order);
-
+
//здесь нужно перебрать все методы execute всех векторов и выполнить те id которых совпали с id события
IoTItem* item = findIoTItem(selectToMarker(order, " "));
if (item) {
String valStr = selectToMarkerLast(order, " ");
IoTValue value;
- if (value.isDecimal = isDigitStr(valStr)) value.valD = valStr.toFloat();
- else value.valS = valStr;
+ if (value.isDecimal = isDigitStr(valStr))
+ value.valD = valStr.toFloat();
+ else
+ value.valS = valStr;
item->setValue(value);
}
@@ -53,7 +53,7 @@ void handleEvent() {
if (eventBuf.length()) {
String event = selectToMarker(eventBuf, ",");
Serial.println("event: " + event);
-
+
//здесь нужно пропускать данное событие через условия сценариев
//и если оно есть в условии сценария и совподает
//то нужно поместить все команды этого блока сценария в generateOrder(order1, order2, ....)
diff --git a/src/WsServer.cpp b/src/WsServer.cpp
index 822a9dba..daea63d8 100644
--- a/src/WsServer.cpp
+++ b/src/WsServer.cpp
@@ -56,24 +56,29 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload, size_t length)
jsonMergeObjects(json, paramsFlashJson);
standWebSocket.sendTXT(num, json);
}
- //**сохранение**//
- if (headerStr == "/tuoyal|") {
- writeFileUint8tByFrames("layout.json", payload, length, headerLenth, 256);
- }
// page configutation================================================================
//**отправка**//
if (headerStr == "/config|") {
sendFileToWs("/items.json", num, 1024);
sendFileToWs("/widgets.json", num, 1024);
sendFileToWs("/config.json", num, 1024);
+ sendFileToWs("/scenario.txt", num, 1024);
standWebSocket.sendTXT(num, settingsFlashJson);
}
//**сохранение**//
if (headerStr == "/gifnoc|") {
writeFileUint8tByFrames("config.json", payload, length, headerLenth, 256);
- clearConfigure();
+ //clearConfigure();
configure("/config.json");
}
+ //**сохранение**//
+ if (headerStr == "/tuoyal|") {
+ writeFileUint8tByFrames("layout.json", payload, length, headerLenth, 256);
+ }
+ //**сохранение**//
+ if (headerStr == "/oiranecs|") {
+ writeFileUint8tByFrames("scenario.txt", payload, length, headerLenth, 256);
+ }
// page connection===================================================================
//**отправка**//
if (headerStr == "/connection|") {