{"version":3,"sources":["webpack:///./src/views/reports/ReportParameters.vue?02bf","webpack:///./src/mixins/reportDownloadMixin.js","webpack:///./src/views/reports/ReportParameters.vue?39ba","webpack:///src/views/reports/ReportParameters.vue","webpack:///./src/views/reports/ReportParameters.vue?a7f1","webpack:///./src/views/reports/ReportParameters.vue","webpack:///./src/views/reports/ReportParameters.vue?f744","webpack:///./node_modules/core-js/modules/es7.string.pad-start.js"],"names":["reportDownloadMixin","methods","downloadReport","reportUrl","filename","filetype","payload","this","setLoadingStatus","reportdata","report_path","request_method","JSON","stringify","store","dispatch","then","response","headers","blob","Blob","data","type","link","document","createElement","href","URL","createObjectURL","download","includes","click","revokeObjectURL","console","error","downloadCampReport","siteCoreKey","orgKey","startDate","endDate","overviewSitecorekey","axios","get","API_CONFIG","getReportCampOverview","responseType","getReportCampDetail","status","Error","url","endDateObj","date","Date","getFullYear","getMonth","formattedEndDate","year","month","String","padStart","day","getDate","body","appendChild","removeChild","render","_vm","_h","$createElement","_c","_self","staticClass","_v","_s","translations","tcTitle","title","attrs","components","on","$event","page_load","translatedName","reportLabelDescription","reportMessage","params","model","value","callback","$$v","values","expression","preventDefault","handleDownload","tcDownloadReport","handleCancelClick","tcCancel","staticRenderFns","name","mixins","reportName","reportParamParentKey","fileType","userMemberType","campEventPlannerKey","campSelector","CampSelect","addPresenter","$router","push","computed","reportDownloadUrl","route","sitecoreKey","paramsSitecoreName","component","$export","$pad","userAgent","WEBKIT_BUG","test","P","F","maxLength","arguments","length","undefined"],"mappings":"kHAAA,W,2KCKaA,EAAsB,CACjCC,QAAS,CACDC,eADC,oEACcC,EAAWC,EAAUC,GADnC,4GAC6CC,EAD7C,+BACuD,KACxDC,KAAKC,kBACPD,KAAKC,kBAAiB,GAHnB,SAMCC,EAAa,CACfC,YAAaP,EACbQ,eAAkBL,EAAU,OAAS,MACrCA,QAAWA,EAAUM,KAAKC,UAAUP,GAAW,MAT9C,SAWGQ,OAAMC,SAAS,yBAA0BN,GAAYO,MAAK,S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DA8FA,oBA9FA,yBAgGA,0BAhGA,qIAmGI,kBAnGJ,uJAoGA,oBApGA,wGAuGI,eAvGJ,oKAwGA,iEACA,6DACA,mBAEA,qGA5GA,gCA6GA,gDA7GA,+CA+GA,0EA/GA,yGAkHI,iBAlHJ,oKAmHA,6DACA,GACA,2BACA,oCAEA,8CAEA,4EAGA,2CA7HA,0GAkIE,QAtJF,mPAuJEC,SAAU,EAAZ,KACA,gBACI,cAAJ,gCACI,eAAJ,iCACI,UAAJ,iBACI,uBAAJ,8BACI,iBAAJ,6BACI,mBAAJ,+BACI,YAAJ,4BACI,kBAAJ,8BACI,eAAJ,iCACI,iBAAJ,uCACI,gBAAJ,kCACI,kBAAJ,oCACI,WAAJ,6BACI,SAAJ,gBACI,YAAJ,mBACI,OAAJ,cACI,UAAJ,oBAlBA,IAoBIC,kBApBJ,WAqBA,8CAAM,IACN,wCACM,OAAOC,GAET5B,cAzBJ,WA0BM,MAA2B,6BAApB7E,KAAK6F,WAClB,oGACA,IAEIjB,uBA9BJ,WA+BM,MAA2B,0BAApB5E,KAAK6F,WAClB,kGACA,IAEIa,YAnCJ,WAoCM,OAAO1G,KAAK2G,uBC9NuV,I,kCCSrWC,EAAY,eACd,EACAlD,EACAgC,GACA,EACA,KACA,WACA,MAIa,aAAAkB,E,2CCpBf,W,gFCEA,IAAIC,EAAU,EAAQ,QAClBC,EAAO,EAAQ,QACfC,EAAY,EAAQ,QAGpBC,EAAa,mDAAmDC,KAAKF,GAEzEF,EAAQA,EAAQK,EAAIL,EAAQM,EAAIH,EAAY,SAAU,CACpD5D,SAAU,SAAkBgE,GAC1B,OAAON,EAAK9G,KAAMoH,EAAWC,UAAUC,OAAS,EAAID,UAAU,QAAKE,GAAW","file":"js/chunk-169d6808.915de184.js","sourcesContent":["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!./ReportParameters.vue?vue&type=style&index=0&id=cb0e6b18&prod&scoped=true&lang=css&\"","import store from '../store'\nimport { API_CONFIG } from '@/config/api.config.js'\nimport axios from 'axios'\n\n/* eslint-disable */\nexport const reportDownloadMixin = {\n methods: {\n async downloadReport(reportUrl, filename, filetype, payload = null) {\n if (this.setLoadingStatus) {\n this.setLoadingStatus(true)\n }\n try {\n let reportdata = {\n report_path: reportUrl,\n request_method: !!payload ? 'POST' : 'GET',\n payload: !!payload ? JSON.stringify(payload) : null\n }\n await store.dispatch('report/getReportStream', reportdata).then((response) => {\n if (response.headers['content-type'] && response.headers['content-length'] != '0') {\n const blob = new Blob([response.data], { type: response.headers['content-type'] })\n const link = document.createElement('a')\n link.href = URL.createObjectURL(blob)\n link.download = filename + (['csv', 'excel'].includes(filetype) ? '.xlsx' : '.pdf')\n link.click()\n URL.revokeObjectURL(link.href)\n }\n })\n } catch (e) {\n console.error(e)\n } finally {\n if (this.setLoadingStatus) {\n this.setLoadingStatus(false)\n }\n }\n },\n\n // Code for reports for Camp reports\nasync downloadCampReport(siteCoreKey, orgKey, startDate, endDate) {\n try {\n let response;\n const overviewSitecorekey = 'tcCampCalendarOverviewReport'\n\n if (siteCoreKey === overviewSitecorekey) {\n response = await axios.get(API_CONFIG.getReportCampOverview(startDate, orgKey), {\n responseType: 'blob', // Specify the response type as 'blob'\n });\n } else {\n response = await axios.get(API_CONFIG.getReportCampDetail(startDate, endDate, orgKey), {\n responseType: 'blob', // Specify the response type as 'blob'\n });\n }\n\n if (response.status !== 200) {\n throw new Error(`HTTP error! status: ${response.status}`);\n }\n\n // Create a download link\n const blob = response.data;\n const link = document.createElement('a');\n const url = URL.createObjectURL(blob);\n link.href = url;\n\n if (siteCoreKey === overviewSitecorekey) {\n const endDateObj = (date = new Date(startDate)) =>\n new Date(date.getFullYear(), date.getMonth() + 12 + 1, 0);\n\n const formattedEndDate = (date) => {\n const endDate = endDateObj(date);\n const year = endDate.getFullYear();\n const month = String(endDate.getMonth() + 1).padStart(2, '0'); \n const day = String(endDate.getDate()).padStart(2, '0');\n return `${year}-${month}-${day}`;\n };\n\n endDate = formattedEndDate(new Date(startDate));\n\n // Set the download link filename with correct date format\n link.download = `Calendar_Overview_Report_${startDate}_${endDate}.xlsx`;\n } else {\n link.download = `Calendar_Detailed_Report_${startDate}_${endDate}.xlsx`;\n }\n\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n URL.revokeObjectURL(url);\n } catch (error) {\n console.error('Error downloading the report:', error);\n }\n}},\n}\n\nexport default reportDownloadMixin\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"report-parameters container template-1\"},[_c('header',{staticClass:\"page-header container mx-lg\"},[_c('h1',[_vm._v(_vm._s(_vm.translations.tcTitle ? _vm.translations.tcTitle : _vm.title))])]),_c('div',{staticClass:\"pb20\"},[_c('camp-selector',{attrs:{\"displayOnly\":true,\"i18n\":_vm.translations.components},on:{\"camp_changed\":function($event){return _vm.page_load()}}})],1),_c('section',{staticClass:\"container bg-block\"},[_c('h3',[_vm._v(_vm._s(_vm.translatedName))]),_c('b',[_vm._v(_vm._s(_vm.reportLabelDescription))]),_c('div',[_vm._v(_vm._s(_vm.reportMessage))]),_c('FormulateForm',{attrs:{\"schema\":_vm.params},model:{value:(_vm.values),callback:function ($$v) {_vm.values=$$v},expression:\"values\"}}),_c('div',{staticClass:\"report-download-btn\"},[_c('b-button',{staticClass:\"flex-0 mr-0 mr-sm-3 mb-3 w-100-sd mb-sm-0\",attrs:{\"download\":\"\",\"variant\":\"secondary\"},on:{\"click\":function($event){$event.preventDefault();return _vm.handleDownload($event)}}},[_vm._v(\" \"+_vm._s(_vm.translations.tcDownloadReport)+\" \")]),_c('b-button',{staticClass:\"flex-0 w-100-sd mb-sm-0\",attrs:{\"variant\":\"tertiary\"},on:{\"click\":_vm.handleCancelClick}},[_vm._v(\" \"+_vm._s(_vm.translations.tcCancel)+\" \")])],1)],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\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/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!./ReportParameters.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/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!./ReportParameters.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./ReportParameters.vue?vue&type=template&id=cb0e6b18&scoped=true&\"\nimport script from \"./ReportParameters.vue?vue&type=script&lang=js&\"\nexport * from \"./ReportParameters.vue?vue&type=script&lang=js&\"\nimport style0 from \"./ReportParameters.vue?vue&type=style&index=0&id=cb0e6b18&prod&scoped=true&lang=css&\"\nimport style1 from \"./ReportParameters.vue?vue&type=style&index=1&id=cb0e6b18&prod&lang=scss&\"\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 \"cb0e6b18\",\n null\n \n)\n\nexport default component.exports","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReportParameters.vue?vue&type=style&index=1&id=cb0e6b18&prod&lang=scss&\"","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export');\nvar $pad = require('./_string-pad');\nvar userAgent = require('./_user-agent');\n\n// https://github.com/zloirock/core-js/issues/280\nvar WEBKIT_BUG = /Version\\/10\\.\\d+(\\.\\d+)?( Mobile\\/\\w+)? Safari\\//.test(userAgent);\n\n$export($export.P + $export.F * WEBKIT_BUG, 'String', {\n padStart: function padStart(maxLength /* , fillString = ' ' */) {\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);\n }\n});\n"],"sourceRoot":""}