{"version":3,"sources":["webpack:///./src/components/projects/detail/viewer/DataAsset.vue?62aa","webpack:///src/components/projects/detail/viewer/DataAsset.vue","webpack:///./src/components/projects/detail/viewer/DataAsset.vue?b838","webpack:///./src/components/projects/detail/viewer/DataAsset.vue","webpack:///./src/components/projects/detail/viewer/DataAsset.vue?8f52","webpack:///./src/network/file-downloader.js"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","directives","name","rawName","modifiers","attrs","asset_name","_v","_s","truncatedName","downloading","on","downloadAsset","staticRenderFns","props","assetObj","required","data","computed","methods","component","downloadFile","url","filename","config","responseType","instance","axios","create","get","response","href","URL","createObjectURL","link","document","createElement","download","body","appendChild","click","removeChild","revokeObjectURL","console","log","getSimulationSettingsPDF","simulationId","projectApiService","file","Blob","type","fileURL","setAttribute"],"mappings":"6IAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,2FAA2F,CAACF,EAAG,QAAQ,CAACG,WAAW,CAAC,CAACC,KAAK,YAAYC,QAAQ,oBAAoBC,UAAU,CAAC,OAAQ,KAAQJ,YAAY,gCAAgCK,MAAM,CAAC,MAAQV,KAAKW,aAAa,CAACZ,EAAIa,GAAGb,EAAIc,GAAGb,KAAKc,kBAAkBX,EAAG,WAAW,CAACE,YAAY,mCAAmCK,MAAM,CAAC,MAAQ,GAAG,QAAU,QAAQ,SAAWX,EAAIgB,aAAaC,GAAG,CAAC,MAAQjB,EAAIkB,gBAAgB,CAAElB,EAAe,YAAEI,EAAG,YAAY,CAACO,MAAM,CAAC,MAAQ,MAAMP,EAAG,kBAAkB,CAACO,MAAM,CAAC,MAAQ,WAAW,IAAI,IAC5qBQ,EAAkB,G,8CCYtB,GACEX,KAAM,YACNY,MAAO,CACLC,SAAU,CACRC,UAAU,IAIdC,KARF,WASI,MAAO,CACLP,aAAa,IAGjBQ,SAAU,CACRZ,WADJ,WACA,MACM,OAAN,wDAEIG,cAJJ,WAIA,QACM,OAAN,kEACe,GAAf,iDAEA,yDAIEU,QAAS,CACP,cADJ,WACA,+JACA,iBADA,SAEA,+DAFA,OAGA,iBAHA,gDCvCma,I,wBCQ/ZC,EAAY,eACd,EACA3B,EACAoB,GACA,EACA,KACA,WACA,MAIa,aAAAO,E,sECnBf,yBAA8hB,EAAG,G,uICGlhB,QACPC,aADO,SACMC,EAAKC,GAAU,2KAG1BC,EAAS,CACXC,aAAc,QAGVC,EAAWC,IAAMC,OAAOJ,GAPA,SASTE,EAASG,IAAIP,EAAKE,GATT,OAS1BM,EAT0B,OAYxBC,EAAOC,IAAIC,gBAAgBH,EAASb,MAGpCiB,EAAOC,SAASC,cAAc,KACpCF,EAAKH,KAAOA,EACZG,EAAKG,SAAWd,EAEhBY,SAASG,KAAKC,YAAYL,GAC1BA,EAAKM,QAGLL,SAASG,KAAKG,YAAYP,GAC1BF,IAAIU,gBAAgBX,GAxBU,qDA0B9BY,QAAQC,IAAR,MA1B8B,6DA+B5BC,yBAhCO,SAgCkBC,GAAc,yKAEpBC,OAAkBF,yBAAyBC,GAFvB,OAErChB,EAFqC,OAIrCkB,EAAO,IAAIC,KAAK,CAACnB,GAAW,CAAEoB,KAAM,oBAGpCC,EAAUnB,IAAIC,gBAAgBe,GAC9Bd,EAAOC,SAASC,cAAc,KACpCF,EAAKH,KAAOoB,EACZjB,EAAKkB,aAAa,WAAY,kBAC9BjB,SAASG,KAAKC,YAAYL,GAE1BA,EAAKM,QACLL,SAASG,KAAKG,YAAYP,GAdiB","file":"js/projects-detail-viewer-DataAsset-vue.053dee70.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"d-flex flex-row justify-content-between downloadable-asset-container align-items-center\"},[_c('label',{directives:[{name:\"b-tooltip\",rawName:\"v-b-tooltip.hover\",modifiers:{\"hover\":true}}],staticClass:\"downloadable-asset-label mb-0\",attrs:{\"title\":this.asset_name}},[_vm._v(_vm._s(this.truncatedName))]),_c('b-button',{staticClass:\"py-0 px-1 rounded-circle bg-gray\",attrs:{\"small\":\"\",\"variant\":\"light\",\"disabled\":_vm.downloading},on:{\"click\":_vm.downloadAsset}},[(_vm.downloading)?_c('b-spinner',{attrs:{\"small\":\"\"}}):_c('b-icon-download',{attrs:{\"scale\":\"0.75\"}})],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DataAsset.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DataAsset.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./DataAsset.vue?vue&type=template&id=35f2ac82&scoped=true&\"\nimport script from \"./DataAsset.vue?vue&type=script&lang=js&\"\nexport * from \"./DataAsset.vue?vue&type=script&lang=js&\"\nimport style0 from \"./DataAsset.vue?vue&type=style&index=0&id=35f2ac82&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"35f2ac82\",\n null\n \n)\n\nexport default component.exports","import mod from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--7-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--7-oneOf-1-1!../../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--7-oneOf-1-2!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DataAsset.vue?vue&type=style&index=0&id=35f2ac82&scoped=true&lang=css&\"; export default mod; export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--7-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--7-oneOf-1-1!../../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--7-oneOf-1-2!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DataAsset.vue?vue&type=style&index=0&id=35f2ac82&scoped=true&lang=css&\"","import axios from 'axios';\nimport projectApiService from '@/network/project';\n\nexport default {\n async downloadFile(url, filename) {\n\n try {\n let config = {\n responseType: 'blob',\n };\n\n const instance = axios.create(config);\n\n var response = await instance.get(url, config);\n \n // create file link in browser's memory\n const href = URL.createObjectURL(response.data);\n\n // create \"a\" HTML element with href to file & click\n const link = document.createElement('a');\n link.href = href;\n link.download = filename;\n\n document.body.appendChild(link);\n link.click();\n\n // clean up \"a\" element & remove ObjectURL\n document.body.removeChild(link);\n URL.revokeObjectURL(href);\n } catch (ex) {\n console.log(ex);\n }\n \n \n },\n async getSimulationSettingsPDF(simulationId) {\n\n const response = await projectApiService.getSimulationSettingsPDF(simulationId);\n // Create a Blob from the PDF Stream\n const file = new Blob([response], { type: 'application/pdf' });\n\n // Create a link to download the file\n const fileURL = URL.createObjectURL(file);\n const link = document.createElement('a');\n link.href = fileURL;\n link.setAttribute('download', 'downloaded.pdf'); // or any other filename\n document.body.appendChild(link);\n \n link.click();\n document.body.removeChild(link); // Clean up\n\n },\n\n};"],"sourceRoot":""}