{"version":3,"sources":["webpack:///../WCC.UI/App/components/attachments/generic/generic.html?8309","webpack:///../WCC.UI/App/components/attachments/generic/generic.ts","webpack:///../WCC.UI/App/webpack/runtime/htmlExposer.js","webpack:///../WCC.UI/App/components/attachments/generic/generic.html"],"names":["content","expose","__esModule","default","components","preload","WCCGenericAttachmentVM","constructor","attachment","info","this","templateNodes","ko","pureComputed","getTemplateNodes","nodes","WCCUpload","getNodes","WCCImage","WCCVideo","WCCAudio","WCCFile","WCCYoutubeVideo","WCCVimeoVideo","selector","defaultNodes","result","$","filter","contents","toArray","length","_","isString","__decorate","injectable","__param","inject","wccModules","componentConfig","componentInfo","system","SystemHelpers","html","getTemplatesAndResources","forEach","node","document","head","appendChild","module","exports"],"mappings":"+IAAA,UAAO,CACC,+GACA,wDAIC,KAJ4C,EAAF,SAAYA,EAASC,GAG5D,OADAA,EADAD,EAAUA,EAAQE,WAAaF,EAAQG,QAAUH,GAE1CA,GACV,4B,qiCCOTI,EAAWC,QAAQ,aAAc,YAAa,YAAa,WAAY,oBAAqB,kBAAmB,aAG/G,IAAqBC,EAArB,MAGIC,YAC+CC,EACTC,GADS,KAAAD,aAG3CE,KAAKC,cAAgBC,EAAGC,aAAa,IAAMH,KAAKI,iBAAiBN,EAAYC,EAAKE,gBAG9EG,iBAAiBN,EAA2BO,GAChD,OAAIP,aAAsBQ,IACfN,KAAKO,SAASF,EAAO,aAAc,oDACrCP,aAAsBU,UACpBR,KAAKO,SAASF,EAAO,YAAa,iDACpCP,aAAsBW,IACpBT,KAAKO,SAASF,EAAO,YAAa,iDACpCP,aAAsBY,IACpBV,KAAKO,SAASF,EAAO,YAAa,iDACpCP,aAAsBa,IACpBX,KAAKO,SAASF,EAAO,WAAY,+CACnCP,aAAsBc,IACpBZ,KAAKO,SAASF,EAAO,cAAe,+CACtCP,aAAsBe,IACpBb,KAAKO,SAASF,EAAO,YAAa,6CAElC,GAGPE,SAASF,EAAoBS,EAAkBC,GACnD,IAAIC,EAASC,EAAEZ,GAAOa,OAAOJ,GAAUK,WAAWC,UAElD,OAAqB,GAAjBJ,EAAOK,OACAC,EAAEC,SAASR,GAAgBE,EAAEF,GAAcK,UAAYL,EAE3DC,IAnCMpB,EAAsB4B,EAAA,CAD1CC,cAKQC,EAAA,EAAAC,YAAOC,IAAWC,kBAClBH,EAAA,EAAAC,YAAOC,IAAWE,iBALNlC,gB,iTChBrB,WAOC,KAPD,aACI,MAAMmC,EAAS,EAAQ,mCAAkBC,cAEzC,OAAO,SAAUC,GACbF,EAAOG,yBAAyBD,GAC3BE,SAAQ,SAAUC,GAAQC,SAASC,KAAKC,YAAYH,QAEhE,+B,0HCJDI,EAAOC,QAFI","file":"341.f3d2fb86d8606990c5d4.js","sourcesContent":["define([\n \"!!../../../../node_modules/html-loader/dist/cjs.js??ref--26-1!./generic.html\", \n \"!../../../webpack/runtime/htmlExposer.js\"], function (content, expose) {\n content = content.__esModule ? content.default : content;\n expose(content);\n return content;\n });","import { wccModules } from 'enums/wccModules';\r\nimport { inject, injectable } from 'inversify';\r\nimport { Subscribable } from 'knockout';\r\nimport WCCAttachment from 'models/attachments/attachment';\r\nimport WCCAudio from 'models/attachments/audio';\r\nimport WCCFile from 'models/attachments/file';\r\nimport WCCImage from 'models/attachments/image';\r\nimport WCCVideo from 'models/attachments/video';\r\nimport WCCVimeoVideo from 'models/attachments/vimeo';\r\nimport WCCYoutubeVideo from 'models/attachments/youtube';\r\nimport WCCUpload from 'models/upload';\r\nimport './generic.html';\r\n\ncomponents.preload('wcc-upload', 'wcc-image', 'wcc-video', 'wcc-file', 'wcc-youtube-video', 'wcc-vimeo-video', 'wcc-audio');\n\n@injectable()\nexport default class WCCGenericAttachmentVM {\n templateNodes: Subscribable>\n\n constructor(\n @inject(wccModules.componentConfig) public attachment: WCCAttachment,\n @inject(wccModules.componentInfo) info: ko.components.ComponentInfo\n ) {\n this.templateNodes = ko.pureComputed(() => this.getTemplateNodes(attachment, info.templateNodes));\n }\n\n private getTemplateNodes(attachment: WCCAttachment, nodes: Array) {\n if (attachment instanceof WCCUpload)\r\n return this.getNodes(nodes, 'upload-tpl', '');\r\n else if (attachment instanceof WCCImage)\r\n return this.getNodes(nodes, 'image-tpl', '');\r\n else if (attachment instanceof WCCVideo)\r\n return this.getNodes(nodes, 'video-tpl', '');\r\n else if (attachment instanceof WCCAudio)\r\n return this.getNodes(nodes, 'audio-tpl', '');\r\n else if (attachment instanceof WCCFile)\r\n return this.getNodes(nodes, 'file-tpl', '');\r\n else if (attachment instanceof WCCYoutubeVideo)\r\n return this.getNodes(nodes, 'youtube-tpl', '');\r\n else if (attachment instanceof WCCVimeoVideo)\r\n return this.getNodes(nodes, 'vimeo-tpl', '');\r\n else\r\n return [];\r\n }\n\n private getNodes(nodes: Array, selector: string, defaultNodes: Array | string): Array {\n let result = $(nodes).filter(selector).contents().toArray() as Array;\r\n\r\n if (result.length == 0)\r\n return _.isString(defaultNodes) ? $(defaultNodes).toArray() : defaultNodes;\r\n\r\n return result;\r\n }\n}","define(function () {\r\n const system = require('helpers/system').SystemHelpers;\r\n\r\n return function (html) {\r\n system.getTemplatesAndResources(html)\r\n .forEach(function (node) { document.head.appendChild(node) });\r\n }\r\n});","// Module\nvar code = \"\";\n// Exports\nmodule.exports = code;"],"sourceRoot":""}