platypush/platypush/backend/http/webapp/dist/static/js/chunk-9ab30700.2d0a4b4e.js.map

1 line
29 KiB
Plaintext

{"version":3,"sources":["webpack:///./node_modules/core-js/modules/es.string.trim.js","webpack:///./src/components/widgets/Component/Index.vue","webpack:///./src/components/widgets/Component/components/Slider.vue?762a","webpack:///./src/components/widgets/Component/Index.vue?a557","webpack:///./src/components/widgets/Component/components/mixins.js","webpack:///./src/components/widgets/Component/components/Run.vue","webpack:///./src/components/widgets/Component/components/Run.vue?a6ed","webpack:///./src/components/widgets/Component/components/Switch.vue","webpack:///./src/components/widgets/Component/components/Switch.vue?07ce","webpack:///./src/components/widgets/Component/components/Slider.vue","webpack:///./src/components/widgets/Component/components/Slider.vue?02c1","webpack:///./src/components/widgets/Component/index.js","webpack:///./node_modules/core-js/internals/string-trim-forced.js","webpack:///./src/components/widgets/Component/Index.vue?f85a","webpack:///./src/components/widgets/Component/components/Run.vue?fb03","webpack:///./src/components/widgets/Component/components/Switch.vue?217b"],"names":["$","$trim","trim","forcedStringTrimMethod","target","proto","forced","this","bus","name","components","Loading","mixins","props","content","type","String","data","loading","unwatch","methods","_parseActions","element","actionsTags","children","filter","node","tagName","toLowerCase","length","actionTags","map","actionTag","action","attributes","value","args","reduce","obj","arg","undefined","JSON","parse","innerText","e","_parseVars","varsTags","vars","varTag","_parseHandlers","handlers","parseHndlScript","hndlText","app","eval","parseEventHndl","event","hndlTags","mounted","refresh","handler","interval","events","hndlTag","beforeActionsTags","beforeActions","afterActionsTags","afterActions","_parseProps","attr","propagateEvent","emit","_addEventHandler","subscribe","_removeEventHandler","$refs","container","innerHTML","Object","entries","forEach","component","$options","getElementsByTagName","actions","_vars","render","mount","parentNode","removeChild","unmounted","class","ref","__scopeId","Utils","Array","default","_interval","refreshInterval","run","input","request_","key","m","match","request","processEvent","hndl","$root","on","self","wrapper","setInterval","clearInterval","hasIcon","iconUrl","src","alt","iconClass","style","iconStyle","iconColor","computed","ToggleSwitch","range","parseFloat","min","max","SliderElement","Slider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iB,SAASiB,aAPH,kCAQP,EAAKjB,SAASiB,aAAa,GARpB,oEAanBlD,KA5Ca,WA6CX,MAAO,CACLkB,WAAOK,K,UC5Db,EAAO8C,OAAS,EAChB,EAAOO,UAAY,kBAEJ,QCJA,QACXuC,MACAC,SACAJ,W,qBCPJ,IAAIK,EAAQ,EAAQ,QAChBC,EAAc,EAAQ,QAEtBC,EAAM,MAIVC,EAAOC,QAAU,SAAUC,GACzB,OAAOL,GAAM,WACX,QAASC,EAAYI,MAAkBH,EAAIG,MAAkBH,GAAOD,EAAYI,GAAalI,OAASkI,O,kCCT1G,W,kCCAA,W,kCCAA","file":"static/js/chunk-9ab30700.2d0a4b4e.js","sourcesContent":["'use strict';\nvar $ = require('../internals/export');\nvar $trim = require('../internals/string-trim').trim;\nvar forcedStringTrimMethod = require('../internals/string-trim-forced');\n\n// `String.prototype.trim` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.trim\n$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {\n trim: function trim() {\n return $trim(this);\n }\n});\n","<template>\n <div class=\"component-widget\">\n <Loading v-if=\"loading\" />\n <div class=\"container\" ref=\"container\" />\n </div>\n</template>\n\n<script>\nimport Utils from \"@/Utils\";\nimport Loading from \"@/components/Loading\";\nimport components from './index'\nimport { createApp, h } from \"vue\";\nimport mitt from 'mitt';\n\nconst bus = mitt();\n\nexport default {\n name: \"Elements\",\n components: {Loading},\n mixins: [Utils],\n props: {\n content: {\n type: String,\n },\n },\n\n data() {\n return {\n loading: false,\n unwatch: null,\n }\n },\n\n methods: {\n _parseActions(element) {\n const actionsTags = [...element.children].filter((node) => node.tagName?.toLowerCase() === 'actions')\n const children = actionsTags?.length ? actionsTags[0].children : element.children\n const actionTags = [...children].filter((node) => node.tagName?.toLowerCase() === 'action')\n\n if (!actionTags?.length)\n return\n\n return [...actionTags]\n .map((actionTag) => {\n return {\n action: actionTag.attributes.name.value,\n args: [...actionTag.children].reduce((obj, arg) => {\n let value = undefined\n try {\n value = JSON.parse(arg.innerText)\n } catch (e) {\n if (arg.innerText?.length)\n value = arg.innerText\n }\n\n obj[arg.tagName.toLowerCase()] = value\n return obj\n }, {}),\n }\n })\n },\n\n _parseVars(element) {\n const varsTags = [...element.children].filter((node) => node.tagName?.toLowerCase() === 'vars')\n if (!varsTags?.length)\n return\n\n return [...varsTags[0].children].reduce((vars, varTag) => {\n let value = undefined\n try {\n value = JSON.parse(varTag.innerText)\n } catch (e) {\n if (varTag.innerText?.length)\n value = varTag.innerText\n }\n vars[varTag.tagName.toLowerCase()] = value\n return vars\n }, {})\n },\n\n _parseHandlers(element) {\n const handlers = {}\n const parseHndlScript = (hndlText) => {\n return (app) => {\n return eval(`// noinspection JSUnusedLocalSymbols\n (async function (self) {\n ${hndlText}\n })`)(app)\n }\n }\n\n const parseEventHndl = (hndlText) => {\n return (app) => {\n return (event) => {\n return eval(`// noinspection JSUnusedLocalSymbols\n (async function (self, event) {\n ${hndlText}\n })`)(app, event)\n }\n }\n }\n\n const hndlTags = [...element.children].filter((node) => node.tagName?.toLowerCase() === 'handlers')\n if (hndlTags?.length) {\n const mounted = [...hndlTags[0].children].filter((node) => node.tagName?.toLowerCase() === 'mounted')\n if (mounted?.length)\n handlers.mounted = parseHndlScript(mounted[0].innerText)\n\n const refresh = [...hndlTags[0].children].filter((node) => node.tagName?.toLowerCase() === 'refresh')\n if (refresh?.length) {\n handlers.refresh = {\n handler: parseHndlScript(refresh[0].innerText),\n interval: refresh[0].attributes.interval?.value || 10,\n }\n }\n\n const events = [...hndlTags[0].children].filter((node) => node.tagName?.toLowerCase() === 'event')\n if (events?.length)\n handlers.events = events.reduce((events, hndlTag) => {\n events[hndlTag.attributes.type.value] = parseEventHndl(hndlTag.innerText)\n return events\n }, {})\n }\n\n const actionsTags = [...element.children].filter((node) => node.tagName?.toLowerCase() === 'actions')\n if (actionsTags?.length) {\n const beforeActionsTags = [...actionsTags[0].children].filter((node) => node.tagName?.toLowerCase() === 'before')\n if (beforeActionsTags?.length)\n handlers.beforeActions = parseHndlScript(beforeActionsTags[0].innerText)\n\n const afterActionsTags = [...actionsTags[0].children].filter((node) => node.tagName?.toLowerCase() === 'after')\n if (afterActionsTags?.length)\n handlers.afterActions = parseHndlScript(afterActionsTags[0].innerText)\n }\n\n return handlers\n },\n\n _parseProps(element) {\n return [...element.attributes].reduce((obj, attr) => {\n obj[attr.name] = attr.value\n return obj\n }, {})\n },\n\n propagateEvent(event) {\n bus.emit('event', event)\n },\n\n _addEventHandler() {\n this.unwatch = this.subscribe((event) => {\n bus.emit('event', event)\n })\n },\n\n _removeEventHandler() {\n if (this.unwatch) {\n this.unwatch()\n this.unwatch = null\n }\n },\n },\n\n mounted() {\n this.loading = true\n this._addEventHandler()\n\n try {\n this.$refs.container.innerHTML = this.content\n\n Object.entries(components).forEach(([name, component]) => {\n this.$options.components[name] = component;\n [...this.$refs.container.getElementsByTagName(name)].forEach((element) => {\n const props = this._parseProps(element)\n props.actions = this._parseActions(element)\n props.handlers = this._parseHandlers(element)\n props._vars = this._parseVars(element)\n\n createApp({\n render() { return h(component, props) },\n data() {\n return { bus: bus }\n },\n }).mount(element)\n })\n })\n\n for (const tagName of ['handlers', 'actions', 'vars'])\n this.$refs.container.getElementsByTagName(tagName).forEach((hndlTag) => {\n hndlTag.parentNode.removeChild(hndlTag)\n })\n } finally {\n this.loading = false\n }\n },\n\n unmounted() {\n this._removeEventHandler()\n },\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.component-widget {\n margin: -.75em 0 0 -.75em !important;\n padding: 0;\n width: calc(100% + 1.5em);\n height: calc(100% + 1.5em);\n}\n</style>\n","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./Slider.vue?vue&type=style&index=0&id=e7f08b3a&lang=scss&scoped=true\"","import { render } from \"./Index.vue?vue&type=template&id=505e25e7&scoped=true\"\nimport script from \"./Index.vue?vue&type=script&lang=js\"\nexport * from \"./Index.vue?vue&type=script&lang=js\"\n\nimport \"./Index.vue?vue&type=style&index=0&id=505e25e7&lang=scss&scoped=true\"\nscript.render = render\nscript.__scopeId = \"data-v-505e25e7\"\n\nexport default script","import Utils from \"@/Utils\";\n\nexport default {\n mixins: [Utils],\n props: {\n // Actions to run upon interaction with the widget. Format:\n //\n // [\n // {\n // \"action\": \"light.hue.toggle\",\n // \"args\": {\n // \"lights\": [\"Bulb 1\", \"Bulb 2\"]\n // }\n // },\n // {\n // \"action\": \"music.mpd.pause\"\n // }\n // ]\n actions: {\n type: Array,\n default: () => { return [] },\n },\n\n // Map of variables used by this component, in the form\n // of variable_name -> variable_value.\n _vars: {\n type: Object,\n default: () => { return {} },\n },\n\n // Map of handlers, in the form of event_type -> functions.\n // Supported event handler types:\n //\n // - mounted: Function to execute when the component is mounted.\n // - beforeActions: Function to execute before the component action is run.\n // - afterActions: Function to execute after the component action is run.\n // - refresh: Function to be called at startup (if mounted is also specified\n // then refresh will be called after mounted when the component is\n // first mounted) and at regular intervals defined on the\n // interval property (default: 10 seconds).\n // - events: This is a mapping of functions that react to Platypush\n // platform events published on the websocket (e.g. lights or\n // switches toggles, media events etc.). The form is\n // platypush_event_type -> function.\n handlers: {\n type: Object,\n default: () => { return {} },\n },\n\n // Event bus\n bus: {\n type: Object,\n },\n },\n\n data() {\n return {\n vars: {...(this._vars || {})},\n _interval: undefined,\n refresh: null,\n refreshInterval: null,\n value: null,\n }\n },\n\n methods: {\n async run() {\n if (this.handlers.input)\n return this.handlers.input(this)(this.value)\n\n if (this.handlers.beforeActions)\n await this.handlers.beforeActions(this)\n for (const action of this.actions)\n await this.request_(action)\n if (this.handlers.afterActions) {\n await this.handlers.afterActions(this)\n }\n },\n\n async request_(action) {\n const args = Object.entries(action.args).reduce((args, [key, value]) => {\n if (value.trim) {\n value = value.trim()\n const m = value.match(/^{{\\s*(.*)\\s*}}/)\n if (m) {\n value = eval(`// noinspection JSUnusedLocalSymbols\n (function (self) {\n return ${m[1]}\n })`)(this)\n }\n }\n\n args[key] = value\n return args\n }, {})\n\n await this.request(action.action, args)\n },\n\n async processEvent(event) {\n const hndl = (this.handlers.events || {})[event.type]\n if (hndl)\n await hndl(this)(event)\n },\n },\n\n async mounted() {\n this.$root.bus.on('event', this.processEvent)\n\n if (this.handlers.mounted)\n await this.handlers.mounted(this)\n\n if (this.handlers.refresh) {\n this.refreshInterval = (this.handlers.refresh?.interval || 0) * 1000\n this.refresh = () => {\n this.handlers.refresh.handler(this)\n }\n\n await this.refresh()\n if (this.refreshInterval) {\n const self = this\n const wrapper = () => { return self.refresh() }\n this._interval = setInterval(wrapper, this.refreshInterval)\n }\n }\n },\n\n unmounted() {\n if (this._interval)\n clearInterval(this._interval)\n }\n}\n","<template>\n <div class=\"run component-row\" @click=\"run\">\n <div :class=\"{'col-10': hasIcon, 'col-12': !hasIcon}\" v-text=\"name\" />\n <div class=\"col-2 icon-container\" v-if=\"hasIcon\">\n <img class=\"icon\" :src=\"iconUrl\" :alt=\"name\" v-if=\"iconUrl?.length\">\n <i class=\"icon\" :class=\"iconClass\" :style=\"iconStyle\" v-else />\n </div>\n </div>\n</template>\n\n<script>\nimport mixins from './mixins';\n\n/**\n * This component is used to run one or more actions.\n */\nexport default {\n name: \"Run\",\n mixins: [mixins],\n props: {\n /**\n * Component name\n */\n name: {\n type: String,\n default: '[Unnamed action]',\n },\n\n /**\n * Action (FontAwesome) icon class (default: `fa fa-play`)\n */\n iconClass: {\n type: String,\n },\n\n /**\n * Action icon URL (default: `fa fa-play`)\n */\n iconUrl: {\n type: String,\n },\n\n /**\n * Action icon color override, for FontAwesome icons\n */\n iconColor: {\n type: String,\n },\n },\n\n computed: {\n iconStyle() {\n if (!this.iconClass?.length && this.iconColor?.length)\n return\n\n return {'color': this.iconColor}\n },\n\n hasIcon() {\n return this.iconUrl?.length || this.iconClass?.length\n },\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import \"mixins\";\n\n.run {\n .icon-container {\n position: relative;\n\n .icon {\n position: absolute;\n right: 0;\n }\n }\n}\n</style>\n","import { render } from \"./Run.vue?vue&type=template&id=2e89c938&scoped=true\"\nimport script from \"./Run.vue?vue&type=script&lang=js\"\nexport * from \"./Run.vue?vue&type=script&lang=js\"\n\nimport \"./Run.vue?vue&type=style&index=0&id=2e89c938&lang=scss&scoped=true\"\nscript.render = render\nscript.__scopeId = \"data-v-2e89c938\"\n\nexport default script","<template>\n <div class=\"switch component-row\" @click=\"run\">\n <div class=\"col-10\" v-text=\"name\" />\n <div class=\"col-2 toggle-container\">\n <div class=\"toggle\">\n <ToggleSwitch :value=\"value\" @input.stop=\"run\" />\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport mixins from './mixins';\nimport ToggleSwitch from \"@/components/elements/ToggleSwitch\";\n\n/**\n * This component can be used to trigger toggle actions on\n * entities with a binary (ON/OFF) state.\n */\nexport default {\n name: \"Switch\",\n components: {ToggleSwitch},\n mixins: [mixins],\n props: {\n /**\n * Display name for this switch.\n */\n name: {\n type: String,\n default: '[Unnamed switch]',\n },\n },\n\n data() {\n return {\n value: undefined,\n }\n },\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import \"mixins\";\n\n.switch {\n .toggle-container {\n position: relative;\n\n .toggle {\n position: absolute;\n right: 0;\n }\n }\n}\n</style>\n","import { render } from \"./Switch.vue?vue&type=template&id=5cc65deb&scoped=true\"\nimport script from \"./Switch.vue?vue&type=script&lang=js\"\nexport * from \"./Switch.vue?vue&type=script&lang=js\"\n\nimport \"./Switch.vue?vue&type=style&index=0&id=5cc65deb&lang=scss&scoped=true\"\nscript.render = render\nscript.__scopeId = \"data-v-5cc65deb\"\n\nexport default script","<template>\n <div class=\"slider-root component-row\">\n <div class=\"col-7\" v-text=\"name\" />\n <div class=\"col-5 slider-container\">\n <div class=\"slider\">\n <SliderElement :value=\"value\" :range=\"[parseFloat(min), parseFloat(max)]\" @mouseup=\"run\" />\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport mixins from './mixins';\nimport SliderElement from \"@/components/elements/Slider\";\n\n/**\n * This component can be used to run action on the basis of a\n * numeric value included in a specified interval (i.e. a slider).\n */\nexport default {\n name: \"Slider\",\n components: {SliderElement},\n mixins: [mixins],\n props: {\n /**\n * Display name for this slider.\n */\n name: {\n type: String,\n default: '[Unnamed slider]',\n },\n\n /**\n * Minimum value for the slider (default: 0).\n */\n min: {\n type: [String, Number],\n default: 0,\n },\n\n /**\n * Maximum value for the slider.\n */\n max: {\n type: [String, Number],\n required: true,\n },\n },\n\n methods: {\n async run(event) {\n this.value = parseFloat(event.target.value)\n\n if (this.handlers.beforeActions)\n await this.handlers.beforeActions(this)\n for (const action of this.actions)\n await this.request_(action)\n if (this.handlers.afterActions) {\n await this.handlers.afterActions(this)\n }\n },\n },\n\n data() {\n return {\n value: undefined,\n }\n },\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import \"mixins\";\n\n.slider-root {\n .slider-container {\n position: relative;\n\n .slider {\n position: absolute;\n right: 0;\n }\n }\n}\n</style>\n","import { render } from \"./Slider.vue?vue&type=template&id=e7f08b3a&scoped=true\"\nimport script from \"./Slider.vue?vue&type=script&lang=js\"\nexport * from \"./Slider.vue?vue&type=script&lang=js\"\n\nimport \"./Slider.vue?vue&type=style&index=0&id=e7f08b3a&lang=scss&scoped=true\"\nscript.render = render\nscript.__scopeId = \"data-v-e7f08b3a\"\n\nexport default script","import Run from './components/Run'\nimport Switch from './components/Switch'\nimport Slider from './components/Slider'\n\nexport default {\n Run,\n Switch,\n Slider,\n}\n","var fails = require('../internals/fails');\nvar whitespaces = require('../internals/whitespaces');\n\nvar non = '\\u200B\\u0085\\u180E';\n\n// check that a method works with the correct list\n// of whitespaces and has a correct name\nmodule.exports = function (METHOD_NAME) {\n return fails(function () {\n return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;\n });\n};\n","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./Index.vue?vue&type=style&index=0&id=505e25e7&lang=scss&scoped=true\"","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./Run.vue?vue&type=style&index=0&id=2e89c938&lang=scss&scoped=true\"","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./Switch.vue?vue&type=style&index=0&id=5cc65deb&lang=scss&scoped=true\""],"sourceRoot":""}