{"version":3,"file":"docs\\js\\total-look.js","sources":["../../src/app/total-look/emitter/emitter.js","../../src/app/total-look/component/component.js","../../src/app/total-look/drag/drag.listener.js","../../src/app/total-look/total-look/total-look-card.component.js","../../src/app/total-look/total-look/total-look-pin.component.js","../../src/app/total-look/total-look/total-look.component.js","../../src/app/total-look/main.js"],"sourcesContent":["export default class Emitter {\r\n\r\n\tconstructor(options = {}) {\r\n\t\tObject.assign(this, options);\r\n\t\tthis.events = {};\r\n\t}\r\n\r\n\ton(type, callback) {\r\n\t\tconst event = (this.events[type] = this.events[type] || []);\r\n\t\tevent.push(callback);\r\n\t\treturn () => {\r\n\t\t\tthis.events[type] = event.filter(x => x !== callback);\r\n\t\t};\r\n\t}\r\n\r\n\toff(type, callback) {\r\n\t\tconst event = this.events[type];\r\n\t\tif (event) {\r\n\t\t\tthis.events[type] = event.filter(x => x !== callback);\r\n\t\t}\r\n\t}\r\n\r\n\temit(type, data) {\r\n\t\tconst event = this.events[type];\r\n\t\tif (event) {\r\n\t\t\tevent.forEach(callback => {\r\n\t\t\t\t// callback.call(this, data);\r\n\t\t\t\tcallback(data);\r\n\t\t\t});\r\n\t\t}\r\n\t\tconst broadcast = this.events.broadcast;\r\n\t\tif (broadcast) {\r\n\t\t\tbroadcast.forEach(callback => {\r\n\t\t\t\tcallback(type, data);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n}\r\n","import Emitter from \"../emitter/emitter\";\r\n\r\nexport default class Component extends Emitter {\r\n\r\n\tgetNode() {\r\n\t\tif (typeof this.render === 'function') {\r\n\t\t\tconst template = this.render();\r\n\t\t\tif (!template) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tconst div = document.createElement(\"div\");\r\n\t\t\tdiv.innerHTML = template;\r\n\t\t\tconst node = div.firstElementChild;\r\n\t\t\treturn node;\r\n\t\t}\r\n\t}\r\n\r\n\tsetNode(node) {\r\n\t\tconst template = this.getNode();\r\n\t\tif (template) {\r\n\t\t\tnode.parentNode.replaceChild(template, node);\r\n\t\t\tnode = template;\r\n\t\t}\r\n\t\tthis.node = node;\r\n\t\tif (typeof this.onInit === 'function') {\r\n\t\t\tthis.onInit(this.node);\r\n\t\t}\r\n\t\treturn this;\r\n\t}\r\n\r\n\tsetParentNode(node) {\r\n\t\tconst template = this.getNode();\r\n\t\tif (template) {\r\n\t\t\tnode.appendChild(template);\r\n\t\t}\r\n\t\tthis.node = template;\r\n\t\tif (typeof this.onInit === 'function') {\r\n\t\t\tthis.onInit(this.node);\r\n\t\t}\r\n\t\treturn this;\r\n\t}\r\n\r\n\tdestroy() {\r\n\t\tif (typeof this.onDestroy === 'function') {\r\n\t\t\tthis.onDestroy(this.node);\r\n\t\t}\r\n\t}\r\n\r\n\t/*\r\n\trender() {\r\n\t\treturn `