(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["hub"],{"17b5":function(e,n,t){"use strict";t.r(n);var o=t("7a23"),c={class:"lb-hub"},u=Object(o["createElementVNode"])("h1",null,"Browse the hub",-1),i={class:"lb-presets-container"},r=["onClick"];function l(e,n,t,l,s,a){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",c,[u,Object(o["createElementVNode"])("div",i,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.hubPresets,(function(n,t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:t},[Object(o["createElementVNode"])("button",{onClick:function(n){return e.usePreset(t)}},Object(o["toDisplayString"])(n.id),9,r)])})),128))])])}t("d3b7"),t("d81d"),t("99af");var s=t("f3ea"),a=t("8f70"),b=t("3ea3"),d=null,f=function e(n){if(null===d){var t=a["a"].getHubWsUrl(s["b"]);console.log("Connecting to ".concat(t)),d=new WebSocket(t),d.onopen=function(){console.info("Connected to ".concat(t)),n()},d.onmessage=function(e){console.log("onmessage",e.data)},d.onclose=function(){console.log("Reconnecting..."),e(n)},d.onerror=function(){d.close()}}},g=function(e){console.log("sendHub",e),d&&d.send(e)},j=Object(o["defineComponent"])({name:"HubView",setup:function(){var e=Object(o["ref"])(),n=function(){fetch("".concat(a["a"].getHubUrl(s["b"]),"/presets")).then((function(e){return e.json()})).then((function(n){e.value=n.map((function(e){return{_id:e._id,id:e.id}}))}))},t=function(n){fetch("".concat(a["a"].getHubUrl(s["b"]),"/preset/").concat(e.value[n]._id)).then((function(e){return console.log(e),e.json()})).then((function(e){delete e._id;var n=e;Object(b["g"])("VUI_POST_SEQUENCE",n)}))},c=function(e){e&&Object(b["g"])("VUI_USE_SEQUENCE",{id:e})},u=function(){g("Coucou de la HubView")};return n(),f(u),{hubPresets:e,state:s["b"],usePreset:t,useSequence:c,vuiCommand:b["g"],window:window}}});t("635d");j.render=l;n["default"]=j},"635d":function(e,n,t){"use strict";t("bb84")},bb84:function(e,n,t){}}]);
//# sourceMappingURL=hub.js.map