osmanli-veri-dagitim 2.1.9-dev → 2.1.11-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1695,7 +1695,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vuex
1695
1695
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1696
1696
 
1697
1697
  "use strict";
1698
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.esm.js\");\n/* harmony import */ var _PackageSettingType_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PackageSettingType.vue */ \"./src/components/customer/PackageSettingType.vue\");\n/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components */ \"./src/components/index.js\");\n/* harmony import */ var _mixins___WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/ */ \"./src/mixins/index.js\");\n/* harmony import */ var _base_InfoArea_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/InfoArea.vue */ \"./src/components/base/InfoArea.vue\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../constants */ \"./src/constants/index.js\");\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"PackageSettigns\",\n mixins: [_mixins___WEBPACK_IMPORTED_MODULE_3__[\"default\"]],\n components: {\n BaseButton: _components__WEBPACK_IMPORTED_MODULE_2__[\"BaseButton\"],\n BaseIcon: _components__WEBPACK_IMPORTED_MODULE_2__[\"BaseIcon\"],\n PopupRight: _components__WEBPACK_IMPORTED_MODULE_2__[\"PopupRight\"],\n PackageSettingType: _PackageSettingType_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n AccordionResearch: _components__WEBPACK_IMPORTED_MODULE_2__[\"AccordionResearch\"],\n AccordionForeign: _components__WEBPACK_IMPORTED_MODULE_2__[\"AccordionForeign\"],\n AccordionAlgoServer: _components__WEBPACK_IMPORTED_MODULE_2__[\"AccordionAlgoServer\"],\n InfoArea: _base_InfoArea_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n },\n props: {\n dataItem: Object,\n marketInfo: Array,\n isPopupVisible: Boolean\n },\n\n data() {\n return {\n isResponsive: false,\n fund: 0,\n commission: 0,\n topPrice: 0,\n bottomFund: 0,\n bottomCommission: 0,\n totalPrice: 0,\n startDateSelection: this.dataItem.dateSelection,\n selectData: [],\n research: [],\n foreign: [],\n algoServer: [],\n isButtonClicked: false,\n warningMessage: false,\n infoText: \"BES ve yatırım fonu büyüklüğü ve/veya komisyon şartı sağlandığı taktirde; o ay toplamda belirtilen ekran ücreti sizden alınmayacaktır.\",\n startDate: [{\n label: \"Seçiniz\",\n code: -1\n }, {\n label: \"Hemen\",\n code: 0\n }, {\n label: \"Ay Başında\",\n code: 1\n }],\n cusId: null\n };\n },\n\n created() {\n this.handleWidth();\n window.addEventListener(\"resize\", this.handleWidth());\n },\n\n mounted() {\n this.setSelectedForeign([]);\n this.setSelectedAlgoServer([]);\n this.setSelectedResearch([]);\n this.cusId = this.$route.params.customerId !== undefined ? this.$route.params.customerId : null;\n\n if (this.$route.name === \"Checkout\") {\n this.cusId = this.$route.query.c !== undefined ? this.$route.query.c : this.$route.params.customerId;\n this.startDateSelection = this.dataItem.dateSelection;\n }\n\n this.sumFundCommission();\n this.getForeign([this.dataItem.application.applicationId, this.dataItem.platform.platformId, this.cusId]).then(res => {\n let details = {};\n details = res.data;\n\n if (this.getDraftPackageDetails.foreignIndice) {\n this.getDraftPackageDetails.foreignIndice.forEach((element, index) => {\n if (element.foreignIndiceFeature.id == details[index].id) {\n details[index].dateSelection = Number(element.dateSelection.key);\n }\n });\n }\n\n this.foreign.push({\n id: 2,\n active: false,\n title: \"Yabancı Endeksler\",\n details\n });\n });\n this.getResearch([this.dataItem.application.applicationId, this.cusId]).then(res => {\n let details = {};\n details = res.data;\n\n if (this.getDraftPackageDetails.research) {\n this.getDraftPackageDetails.research.forEach((element, index) => {\n if (element.researchFeature.id == details[index].id) {\n details[index].dateSelection = Number(element.dateSelection.key);\n }\n });\n }\n\n this.research = [{\n id: 1,\n active: false,\n title: \"Araştırma ve Diğer Uygulamalar\",\n details\n }];\n });\n this.getAlgoServer([this.dataItem.application.applicationId, this.cusId]).then(res => {\n let details = {};\n details = res.data;\n\n if (this.getDraftPackageDetails.algorithm) {\n this.getDraftPackageDetails.algorithm.forEach((element, index) => {\n if (element.algorithmFeature.id == details[index].id) {\n details[index].dateSelection = Number(element.dateSelection.key);\n }\n });\n }\n\n this.algoServer.push({\n id: 3,\n active: false,\n title: \"Algoritmalar\",\n details\n });\n });\n },\n\n computed: { ...Object(vuex__WEBPACK_IMPORTED_MODULE_0__[\"mapGetters\"])([\"getSelectedAlgoServerInfo\", \"customer\", \"getResearchInfo\", \"getSelectedForeignInfo\", \"getForeignInfo\", \"getAlgoServerInfo\", \"getSelectedResearchInfo\", \"getPackageInfo\", \"getDraftPackageDetails\"]),\n\n currencySymbol() {\n return _constants__WEBPACK_IMPORTED_MODULE_5__[\"CurrencySymbol\"];\n },\n\n researchTotal() {\n return this.getSelectedResearchInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n }, 0);\n },\n\n foraignDollarTotal() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n if (item.priceInfo === \"$\") {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n } else {\n return 0 + totald;\n }\n }, 0);\n },\n\n getStartDateSelection() {\n return this.dataItem.dateSelection;\n },\n\n foraignEuroTotal() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n if (item.priceInfo === \"€\") {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n } else {\n return 0 + totald;\n }\n }, 0);\n },\n\n algoServerTotal() {\n return this.getSelectedAlgoServerInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n }, 0);\n },\n\n researchFund() {\n return this.getSelectedResearchInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.fundAmount) || 0) + totald;\n }, 0);\n },\n\n foreignFund() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.fundAmount) || 0) + totald;\n }, 0);\n },\n\n algoServerFund() {\n return this.getSelectedAlgoServerInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.fundAmount) || 0) + totald;\n }, 0);\n },\n\n researchCommission() {\n return this.getSelectedResearchInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.commissionAmount) || 0) + totald;\n }, 0);\n },\n\n foreignCommission() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.commissionAmount) || 0) + totald;\n }, 0);\n },\n\n foraignTurkishLiraTotal() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n if (item.priceInfo === \"₺\") {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n } else {\n return 0 + totald;\n }\n }, 0);\n },\n\n algoServerCommission() {\n return this.getSelectedAlgoServerInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.commissionAmount) || 0) + totald;\n }, 0);\n },\n\n totalPriceDollar() {\n var _this$dataItem, _this$dataItem$price, _this$dataItem$price$;\n\n return (_this$dataItem = this.dataItem) === null || _this$dataItem === void 0 ? void 0 : (_this$dataItem$price = _this$dataItem.price) === null || _this$dataItem$price === void 0 ? void 0 : (_this$dataItem$price$ = _this$dataItem$price.prices) === null || _this$dataItem$price$ === void 0 ? void 0 : _this$dataItem$price$.filter(e => e.info === this.currencySymbol.dolar)[0];\n },\n\n totalPriceEuro() {\n var _this$dataItem2, _this$dataItem2$price, _this$dataItem2$price2;\n\n return (_this$dataItem2 = this.dataItem) === null || _this$dataItem2 === void 0 ? void 0 : (_this$dataItem2$price = _this$dataItem2.price) === null || _this$dataItem2$price === void 0 ? void 0 : (_this$dataItem2$price2 = _this$dataItem2$price.prices) === null || _this$dataItem2$price2 === void 0 ? void 0 : _this$dataItem2$price2.filter(e => e.info === this.currencySymbol.euro)[0];\n },\n\n totalPriceTl() {\n var _this$dataItem3, _this$dataItem3$price, _this$dataItem3$price2;\n\n return (_this$dataItem3 = this.dataItem) === null || _this$dataItem3 === void 0 ? void 0 : (_this$dataItem3$price = _this$dataItem3.price) === null || _this$dataItem3$price === void 0 ? void 0 : (_this$dataItem3$price2 = _this$dataItem3$price.prices) === null || _this$dataItem3$price2 === void 0 ? void 0 : _this$dataItem3$price2.filter(e => e.info === this.currencySymbol.tl)[0].totalPrice;\n },\n\n totalPriceCalc() {\n var _this$totalPriceDolla, _this$totalPriceEuro;\n\n let totalDollar = `${this.totalPriceDollar ? ` + ${this.formatPriceDollar((_this$totalPriceDolla = this.totalPriceDollar) === null || _this$totalPriceDolla === void 0 ? void 0 : _this$totalPriceDolla.totalPrice)} Dolar` : \"\"}`;\n let totalEuro = `${this.totalPriceEuro ? ` + ${this.formatPriceEuro((_this$totalPriceEuro = this.totalPriceEuro) === null || _this$totalPriceEuro === void 0 ? void 0 : _this$totalPriceEuro.totalPrice)} Euro` : \"\"}`;\n return this.formatPrice(this.totalPriceTl) + this.currencySymbol.tl + totalDollar + totalEuro;\n }\n\n },\n methods: { ...Object(vuex__WEBPACK_IMPORTED_MODULE_0__[\"mapActions\"])([\"getForeign\", \"getAllPackages\", \"getDraftPackageDetail\", \"getResearch\", \"updatePackage\", \"getAlgoServer\", \"createPackage\"]),\n ...Object(vuex__WEBPACK_IMPORTED_MODULE_0__[\"mapMutations\"])([\"setSelectedForeign\", \"setSelectedAlgoServer\", \"setSelectedResearch\"]),\n\n checkSpesificWarning(param) {\n this.warningMessage = param;\n },\n\n setDefaultValues() {\n this.bottomCommission = 0;\n this.totalPrice = 0;\n this.bottomFund = 0;\n this.selectData = [];\n this.startDateSelection = this.startDate[0].code;\n this.setSelectedForeign([]);\n this.setSelectedAlgoServer([]);\n this.setSelectedResearch([]);\n this.$emit(\"close\");\n },\n\n handleWidth() {\n let w = window.innerWidth;\n this.isResponsive = w <= 640;\n },\n\n sumFundCommission() {\n this.fund = this.dataItem.price.totalFundAmount;\n this.commission = this.dataItem.price.totalCommissionAmount;\n this.topPrice = this.totalPriceCalc;\n this.totalPrice = this.topPrice;\n },\n\n changeSelected(data) {\n this.selectData = data;\n },\n\n async submitShow() {\n this.isButtonClicked = true;\n const packageData = this.buildPackageData();\n const getEveryDateSelection = packageData.filter(o => o.dateSelection == -1);\n const getResearchDateSelection = this.getSelectedResearchInfo.filter(o => o.dateSelection == -1);\n const getForeignDateSelection = this.getSelectedForeignInfo.filter(o => o.dateSelection == -1);\n const getSelectedAlgoSvInfo = this.getSelectedAlgoServerInfo.filter(o => o.dateSelection == -1);\n\n if (getEveryDateSelection.length > 0 || getResearchDateSelection.length > 0 || getForeignDateSelection.length > 0 || getSelectedAlgoSvInfo.length > 0) {\n this.$toast.error(\"Başlangıç zamanı seçiniz.\");\n this.isButtonClicked = false;\n return;\n }\n\n const researchData = this.buildResearchData();\n const foreignData = this.buildForeignData();\n const algoServerData = this.buildAlgoServerData();\n const args = this.buildArgsObject(packageData, researchData, foreignData, algoServerData);\n const actionName = this.getActionName();\n const sendAction = await this[actionName](args);\n\n if (sendAction.error) {\n this.handleError(sendAction);\n } else {\n this.handleSuccess(sendAction, actionName);\n this.args = {};\n }\n },\n\n buildPackageData() {\n return this.selectData.map(item => {\n var _this$dataItem4, _this$dataItem4$appli, _this$dataItem5, _this$dataItem5$platf, _item$marketFeature, _item$perspectiveFeat, _item$vendorFeature, _item$vendorFeature2, _item$vendorFeature3;\n\n return {\n applicationId: (_this$dataItem4 = this.dataItem) === null || _this$dataItem4 === void 0 ? void 0 : (_this$dataItem4$appli = _this$dataItem4.application) === null || _this$dataItem4$appli === void 0 ? void 0 : _this$dataItem4$appli.id,\n platformId: ((_this$dataItem5 = this.dataItem) === null || _this$dataItem5 === void 0 ? void 0 : (_this$dataItem5$platf = _this$dataItem5.platform) === null || _this$dataItem5$platf === void 0 ? void 0 : _this$dataItem5$platf.id) || null,\n marketId: (item === null || item === void 0 ? void 0 : (_item$marketFeature = item.marketFeature) === null || _item$marketFeature === void 0 ? void 0 : _item$marketFeature.id) || null,\n perspectiveId: (item === null || item === void 0 ? void 0 : (_item$perspectiveFeat = item.perspectiveFeature) === null || _item$perspectiveFeat === void 0 ? void 0 : _item$perspectiveFeat.id) || null,\n vendorId: (item === null || item === void 0 ? void 0 : (_item$vendorFeature = item.vendorFeature) === null || _item$vendorFeature === void 0 ? void 0 : _item$vendorFeature.id) === undefined || (item === null || item === void 0 ? void 0 : (_item$vendorFeature2 = item.vendorFeature) === null || _item$vendorFeature2 === void 0 ? void 0 : _item$vendorFeature2.id) === null ? null : item === null || item === void 0 ? void 0 : (_item$vendorFeature3 = item.vendorFeature) === null || _item$vendorFeature3 === void 0 ? void 0 : _item$vendorFeature3.id,\n dateSelection: item.dateSelection\n };\n });\n },\n\n buildResearchData() {\n return this.getSelectedResearchInfo.map(item => ({\n applicationId: this.dataItem.application.id || null,\n researchId: item.id || null,\n dateSelection: item.dateSelection\n }));\n },\n\n buildForeignData() {\n return this.getSelectedForeignInfo.map(item => ({\n applicationId: this.dataItem.application.id,\n foreignIndiceId: item.id || null,\n dateSelection: item.dateSelection\n }));\n },\n\n buildAlgoServerData() {\n return this.getSelectedAlgoServerInfo.map(item => ({\n applicationId: this.dataItem.application.id,\n algorithmAndServerId: item.id || null,\n dateSelection: item.dateSelection\n }));\n },\n\n buildArgsObject(packageData, researchData, foreignData, algoServerData) {\n var _this$dataItem6, _this$dataItem6$appli, _this$dataItem7, _this$dataItem7$platf, _this$dataItem8, _this$dataItem9, _this$dataItem9$platf;\n\n return {\n customerId: this.customer.id,\n purchaseId: this.dataItem.id,\n purchaseNumber: this.dataItem.purchaseNo.toString(),\n applicationId: ((_this$dataItem6 = this.dataItem) === null || _this$dataItem6 === void 0 ? void 0 : (_this$dataItem6$appli = _this$dataItem6.application) === null || _this$dataItem6$appli === void 0 ? void 0 : _this$dataItem6$appli.applicationId) || null,\n platformId: ((_this$dataItem7 = this.dataItem) === null || _this$dataItem7 === void 0 ? void 0 : (_this$dataItem7$platf = _this$dataItem7.platform) === null || _this$dataItem7$platf === void 0 ? void 0 : _this$dataItem7$platf.platformId) || null,\n applicationFeatureId: ((_this$dataItem8 = this.dataItem) === null || _this$dataItem8 === void 0 ? void 0 : _this$dataItem8.application.id) || null,\n platformFeatureId: (_this$dataItem9 = this.dataItem) === null || _this$dataItem9 === void 0 ? void 0 : (_this$dataItem9$platf = _this$dataItem9.platform) === null || _this$dataItem9$platf === void 0 ? void 0 : _this$dataItem9$platf.id,\n features: packageData,\n research: researchData,\n foreignIndice: foreignData,\n algorithmAndServer: algoServerData,\n cusId: this.cusId\n };\n },\n\n getActionName() {\n return this.dataItem.packageStatus.id === 2 ? \"updatePackage\" : \"createPackage\";\n },\n\n handleError(res) {\n if (res.result !== undefined && res.result !== null) {\n this.$toast.error(res.result.data[0].errors[0]);\n } else {\n this.$toast.error(res.message);\n }\n\n this.isButtonClicked = false;\n },\n\n handleSuccess(res, actionName) {\n if (actionName === \"updatePackage\") {\n this.handleUpdatePackageSuccess(res);\n } else {\n this.handleCreatePackageSuccess(res);\n }\n },\n\n async handleUpdatePackageSuccess() {\n const response = await this.getDraftPackageDetail([this.dataItem.id, this.cusId]);\n setTimeout(() => {\n const path = `/checkout/${this.$route.params.customerNumber}/${response.data.id}`;\n console.log(this.$route.name);\n console.log(this.$route.path);\n\n if (path !== this.$route.path || this.$route.name != \"Checkout\" || this.$route.name == \"OvdHome\") {\n this.$router.push({\n name: \"Checkout\",\n params: {\n packageNumber: response.data.id,\n customerNumber: this.$route.params.customerNumber\n },\n query: {\n c: this.$route.query.c\n }\n });\n } else {\n this.$router.go(this.$router.currentRoute);\n }\n }, 300);\n },\n\n handleCreatePackageSuccess(res) {\n if (this.$route.name === \"Checkout\") {\n this.$router.push({\n name: \"Checkout\",\n params: {\n packageNumber: res.purchaseId,\n customerNumber: this.$route.params.customerNumber\n },\n query: {\n c: this.$route.query.c\n }\n });\n } else {\n this.$emit(\"close\");\n this.getAllPackages(this.cusId);\n }\n\n this.setSelectedResearch([]);\n this.setSelectedForeign([]);\n this.setSelectedAlgoServer([]);\n },\n\n calculatePrice(items) {\n var _this$dataItem$applic, _this$dataItem$applic2;\n\n this.bottomFund = items.reduce((totald, item) => {\n var _item$marketFeature2, _item$perspectiveFeat2, _item$vendorFeature4;\n\n return ((item === null || item === void 0 ? void 0 : (_item$marketFeature2 = item.marketFeature) === null || _item$marketFeature2 === void 0 ? void 0 : _item$marketFeature2.fundAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$perspectiveFeat2 = item.perspectiveFeature) === null || _item$perspectiveFeat2 === void 0 ? void 0 : _item$perspectiveFeat2.fundAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$vendorFeature4 = item.vendorFeature) === null || _item$vendorFeature4 === void 0 ? void 0 : _item$vendorFeature4.fundAmount) || 0) + totald;\n }, (_this$dataItem$applic = this.dataItem.application) === null || _this$dataItem$applic === void 0 ? void 0 : _this$dataItem$applic.fundAmount);\n this.bottomCommission = items.reduce((totald, item) => {\n var _item$marketFeature3, _item$perspectiveFeat3, _item$vendorFeature5;\n\n return ((item === null || item === void 0 ? void 0 : (_item$marketFeature3 = item.marketFeature) === null || _item$marketFeature3 === void 0 ? void 0 : _item$marketFeature3.commissionAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$perspectiveFeat3 = item.perspectiveFeature) === null || _item$perspectiveFeat3 === void 0 ? void 0 : _item$perspectiveFeat3.commissionAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$vendorFeature5 = item.vendorFeature) === null || _item$vendorFeature5 === void 0 ? void 0 : _item$vendorFeature5.commissionAmount) || 0) + totald;\n }, (_this$dataItem$applic2 = this.dataItem.application) === null || _this$dataItem$applic2 === void 0 ? void 0 : _this$dataItem$applic2.commissionAmount);\n const total = items.reduce((totald, item) => {\n var _item$perspectiveFeat4, _item$vendorFeature6;\n\n return (\n /* (item?.marketFeature?.price || 0) +\n (item?.platformFeature?.price || 0)*/\n +((item === null || item === void 0 ? void 0 : (_item$perspectiveFeat4 = item.perspectiveFeature) === null || _item$perspectiveFeat4 === void 0 ? void 0 : _item$perspectiveFeat4.price) || 0) + ((item === null || item === void 0 ? void 0 : (_item$vendorFeature6 = item.vendorFeature) === null || _item$vendorFeature6 === void 0 ? void 0 : _item$vendorFeature6.price) || 0) + totald\n );\n }, 0);\n this.totalPrice = total + this.dataItem.application.price;\n },\n\n calculateTotalPrice() {\n return this.dataItem.price + this.totalPrice + this.researchTotal() + this.foraignTurkishLiraTotal() + this.algoServerTotal();\n }\n\n },\n watch: {\n selectData: {\n handler(newVal) {\n this.calculatePrice(newVal);\n },\n\n deep: true,\n immediate: true\n }\n }\n});\n\n//# sourceURL=webpack://OsmanliPackage/./src/components/customer/PackageSettigns.vue?./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options");
1698
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.esm.js\");\n/* harmony import */ var _PackageSettingType_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PackageSettingType.vue */ \"./src/components/customer/PackageSettingType.vue\");\n/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components */ \"./src/components/index.js\");\n/* harmony import */ var _mixins___WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/ */ \"./src/mixins/index.js\");\n/* harmony import */ var _base_InfoArea_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/InfoArea.vue */ \"./src/components/base/InfoArea.vue\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../constants */ \"./src/constants/index.js\");\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"PackageSettigns\",\n mixins: [_mixins___WEBPACK_IMPORTED_MODULE_3__[\"default\"]],\n components: {\n BaseButton: _components__WEBPACK_IMPORTED_MODULE_2__[\"BaseButton\"],\n BaseIcon: _components__WEBPACK_IMPORTED_MODULE_2__[\"BaseIcon\"],\n PopupRight: _components__WEBPACK_IMPORTED_MODULE_2__[\"PopupRight\"],\n PackageSettingType: _PackageSettingType_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n AccordionResearch: _components__WEBPACK_IMPORTED_MODULE_2__[\"AccordionResearch\"],\n AccordionForeign: _components__WEBPACK_IMPORTED_MODULE_2__[\"AccordionForeign\"],\n AccordionAlgoServer: _components__WEBPACK_IMPORTED_MODULE_2__[\"AccordionAlgoServer\"],\n InfoArea: _base_InfoArea_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n },\n props: {\n dataItem: Object,\n marketInfo: Array,\n isPopupVisible: Boolean\n },\n\n data() {\n return {\n isResponsive: false,\n fund: 0,\n commission: 0,\n topPrice: 0,\n bottomFund: 0,\n bottomCommission: 0,\n totalPrice: 0,\n startDateSelection: this.dataItem.dateSelection,\n selectData: [],\n research: [],\n foreign: [],\n algoServer: [],\n isButtonClicked: false,\n warningMessage: false,\n infoText: \"BES ve yatırım fonu büyüklüğü ve/veya komisyon şartı sağlandığı taktirde; o ay toplamda belirtilen ekran ücreti sizden alınmayacaktır.\",\n startDate: [{\n label: \"Seçiniz\",\n code: -1\n }, {\n label: \"Hemen\",\n code: 0\n }, {\n label: \"Ay Başında\",\n code: 1\n }],\n cusId: null\n };\n },\n\n created() {\n this.handleWidth();\n window.addEventListener(\"resize\", this.handleWidth());\n },\n\n mounted() {\n this.setSelectedForeign([]);\n this.setSelectedAlgoServer([]);\n this.setSelectedResearch([]);\n this.cusId = this.$route.params.customerId !== undefined ? this.$route.params.customerId : null;\n\n if (this.$route.name === \"Checkout\") {\n this.cusId = this.$route.query.c !== undefined ? this.$route.query.c : this.$route.params.customerId;\n this.startDateSelection = this.dataItem.dateSelection;\n }\n\n this.sumFundCommission();\n this.getForeign([this.dataItem.application.applicationId, this.dataItem.platform.platformId, this.cusId]).then(res => {\n let details = {};\n details = res.data;\n\n if (this.getDraftPackageDetails.foreignIndice) {\n this.getDraftPackageDetails.foreignIndice.forEach((element, index) => {\n if (element.foreignIndiceFeature.id == details[index].id) {\n details[index].dateSelection = Number(element.dateSelection.key);\n }\n });\n }\n\n this.foreign.push({\n id: 2,\n active: false,\n title: \"Yabancı Endeksler\",\n details\n });\n });\n this.getResearch([this.dataItem.application.applicationId, this.cusId]).then(res => {\n let details = {};\n details = res.data;\n\n if (this.getDraftPackageDetails.research) {\n this.getDraftPackageDetails.research.forEach((element, index) => {\n if (element.researchFeature.id == details[index].id) {\n details[index].dateSelection = Number(element.dateSelection.key);\n }\n });\n }\n\n this.research = [{\n id: 1,\n active: false,\n title: \"Araştırma ve Diğer Uygulamalar\",\n details\n }];\n });\n this.getAlgoServer([this.dataItem.application.applicationId, this.cusId]).then(res => {\n let details = {};\n details = res.data;\n\n if (this.getDraftPackageDetails.algorithm) {\n this.getDraftPackageDetails.algorithm.forEach((element, index) => {\n if (element.algorithmFeature.id == details[index].id) {\n details[index].dateSelection = Number(element.dateSelection.key);\n }\n });\n }\n\n this.algoServer.push({\n id: 3,\n active: false,\n title: \"Algoritmalar\",\n details\n });\n });\n },\n\n computed: { ...Object(vuex__WEBPACK_IMPORTED_MODULE_0__[\"mapGetters\"])([\"getSelectedAlgoServerInfo\", \"customer\", \"getResearchInfo\", \"getSelectedForeignInfo\", \"getForeignInfo\", \"getAlgoServerInfo\", \"getSelectedResearchInfo\", \"getPackageInfo\", \"getDraftPackageDetails\"]),\n\n currencySymbol() {\n return _constants__WEBPACK_IMPORTED_MODULE_5__[\"CurrencySymbol\"];\n },\n\n researchTotal() {\n return this.getSelectedResearchInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n }, 0);\n },\n\n foraignDollarTotal() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n if (item.priceInfo === \"$\") {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n } else {\n return 0 + totald;\n }\n }, 0);\n },\n\n getStartDateSelection() {\n return this.dataItem.dateSelection;\n },\n\n foraignEuroTotal() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n if (item.priceInfo === \"€\") {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n } else {\n return 0 + totald;\n }\n }, 0);\n },\n\n algoServerTotal() {\n return this.getSelectedAlgoServerInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n }, 0);\n },\n\n researchFund() {\n return this.getSelectedResearchInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.fundAmount) || 0) + totald;\n }, 0);\n },\n\n foreignFund() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.fundAmount) || 0) + totald;\n }, 0);\n },\n\n algoServerFund() {\n return this.getSelectedAlgoServerInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.fundAmount) || 0) + totald;\n }, 0);\n },\n\n researchCommission() {\n return this.getSelectedResearchInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.commissionAmount) || 0) + totald;\n }, 0);\n },\n\n foreignCommission() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.commissionAmount) || 0) + totald;\n }, 0);\n },\n\n foraignTurkishLiraTotal() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n if (item.priceInfo === \"₺\") {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n } else {\n return 0 + totald;\n }\n }, 0);\n },\n\n algoServerCommission() {\n return this.getSelectedAlgoServerInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.commissionAmount) || 0) + totald;\n }, 0);\n },\n\n totalPriceDollar() {\n var _this$dataItem, _this$dataItem$price, _this$dataItem$price$;\n\n return (_this$dataItem = this.dataItem) === null || _this$dataItem === void 0 ? void 0 : (_this$dataItem$price = _this$dataItem.price) === null || _this$dataItem$price === void 0 ? void 0 : (_this$dataItem$price$ = _this$dataItem$price.prices) === null || _this$dataItem$price$ === void 0 ? void 0 : _this$dataItem$price$.filter(e => e.info === this.currencySymbol.dolar)[0];\n },\n\n totalPriceEuro() {\n var _this$dataItem2, _this$dataItem2$price, _this$dataItem2$price2;\n\n return (_this$dataItem2 = this.dataItem) === null || _this$dataItem2 === void 0 ? void 0 : (_this$dataItem2$price = _this$dataItem2.price) === null || _this$dataItem2$price === void 0 ? void 0 : (_this$dataItem2$price2 = _this$dataItem2$price.prices) === null || _this$dataItem2$price2 === void 0 ? void 0 : _this$dataItem2$price2.filter(e => e.info === this.currencySymbol.euro)[0];\n },\n\n totalPriceTl() {\n var _this$dataItem3, _this$dataItem3$price, _this$dataItem3$price2;\n\n return (_this$dataItem3 = this.dataItem) === null || _this$dataItem3 === void 0 ? void 0 : (_this$dataItem3$price = _this$dataItem3.price) === null || _this$dataItem3$price === void 0 ? void 0 : (_this$dataItem3$price2 = _this$dataItem3$price.prices) === null || _this$dataItem3$price2 === void 0 ? void 0 : _this$dataItem3$price2.filter(e => e.info === this.currencySymbol.tl)[0].totalPrice;\n },\n\n totalPriceCalc() {\n var _this$totalPriceDolla, _this$totalPriceEuro;\n\n let totalDollar = `${this.totalPriceDollar ? ` + ${this.formatPriceDollar((_this$totalPriceDolla = this.totalPriceDollar) === null || _this$totalPriceDolla === void 0 ? void 0 : _this$totalPriceDolla.totalPrice)} Dolar` : \"\"}`;\n let totalEuro = `${this.totalPriceEuro ? ` + ${this.formatPriceEuro((_this$totalPriceEuro = this.totalPriceEuro) === null || _this$totalPriceEuro === void 0 ? void 0 : _this$totalPriceEuro.totalPrice)} Euro` : \"\"}`;\n return this.formatPrice(this.totalPriceTl) + this.currencySymbol.tl + totalDollar + totalEuro;\n }\n\n },\n methods: { ...Object(vuex__WEBPACK_IMPORTED_MODULE_0__[\"mapActions\"])([\"getForeign\", \"getAllPackages\", \"getDraftPackageDetail\", \"getResearch\", \"updatePackage\", \"getAlgoServer\", \"createPackage\"]),\n ...Object(vuex__WEBPACK_IMPORTED_MODULE_0__[\"mapMutations\"])([\"setSelectedForeign\", \"setSelectedAlgoServer\", \"setSelectedResearch\"]),\n\n checkSpesificWarning(param) {\n this.warningMessage = param;\n },\n\n setDefaultValues() {\n this.bottomCommission = 0;\n this.totalPrice = 0;\n this.bottomFund = 0;\n this.selectData = [];\n this.startDateSelection = this.startDate[0].code;\n this.setSelectedForeign([]);\n this.setSelectedAlgoServer([]);\n this.setSelectedResearch([]);\n this.$emit(\"close\");\n },\n\n handleWidth() {\n let w = window.innerWidth;\n this.isResponsive = w <= 640;\n },\n\n sumFundCommission() {\n this.fund = this.dataItem.price.totalFundAmount;\n this.commission = this.dataItem.price.totalCommissionAmount;\n this.topPrice = this.totalPriceCalc;\n this.totalPrice = this.topPrice;\n },\n\n changeSelected(data) {\n this.selectData = data;\n },\n\n async submitShow() {\n this.isButtonClicked = true;\n const packageData = this.buildPackageData();\n const getEveryDateSelection = packageData.filter(o => o.dateSelection == -1);\n const getResearchDateSelection = this.getSelectedResearchInfo.filter(o => o.dateSelection == -1);\n const getForeignDateSelection = this.getSelectedForeignInfo.filter(o => o.dateSelection == -1);\n const getSelectedAlgoSvInfo = this.getSelectedAlgoServerInfo.filter(o => o.dateSelection == -1);\n\n if (getEveryDateSelection.length > 0 || getResearchDateSelection.length > 0 || getForeignDateSelection.length > 0 || getSelectedAlgoSvInfo.length > 0) {\n this.$toast.error(\"Başlangıç zamanı seçiniz.\");\n this.isButtonClicked = false;\n return;\n }\n\n const researchData = this.buildResearchData();\n const foreignData = this.buildForeignData();\n const algoServerData = this.buildAlgoServerData();\n const args = this.buildArgsObject(packageData, researchData, foreignData, algoServerData);\n const actionName = this.getActionName();\n const sendAction = await this[actionName](args);\n\n if (sendAction.error) {\n this.handleError(sendAction);\n } else {\n this.handleSuccess(sendAction, actionName);\n this.args = {};\n }\n },\n\n buildPackageData() {\n return this.selectData.map(item => {\n var _this$dataItem4, _this$dataItem4$appli, _this$dataItem5, _this$dataItem5$platf, _item$marketFeature, _item$perspectiveFeat, _item$vendorFeature, _item$vendorFeature2, _item$vendorFeature3;\n\n return {\n applicationId: (_this$dataItem4 = this.dataItem) === null || _this$dataItem4 === void 0 ? void 0 : (_this$dataItem4$appli = _this$dataItem4.application) === null || _this$dataItem4$appli === void 0 ? void 0 : _this$dataItem4$appli.id,\n platformId: ((_this$dataItem5 = this.dataItem) === null || _this$dataItem5 === void 0 ? void 0 : (_this$dataItem5$platf = _this$dataItem5.platform) === null || _this$dataItem5$platf === void 0 ? void 0 : _this$dataItem5$platf.id) || null,\n marketId: (item === null || item === void 0 ? void 0 : (_item$marketFeature = item.marketFeature) === null || _item$marketFeature === void 0 ? void 0 : _item$marketFeature.id) || null,\n perspectiveId: (item === null || item === void 0 ? void 0 : (_item$perspectiveFeat = item.perspectiveFeature) === null || _item$perspectiveFeat === void 0 ? void 0 : _item$perspectiveFeat.id) || null,\n vendorId: (item === null || item === void 0 ? void 0 : (_item$vendorFeature = item.vendorFeature) === null || _item$vendorFeature === void 0 ? void 0 : _item$vendorFeature.id) === undefined || (item === null || item === void 0 ? void 0 : (_item$vendorFeature2 = item.vendorFeature) === null || _item$vendorFeature2 === void 0 ? void 0 : _item$vendorFeature2.id) === null ? null : item === null || item === void 0 ? void 0 : (_item$vendorFeature3 = item.vendorFeature) === null || _item$vendorFeature3 === void 0 ? void 0 : _item$vendorFeature3.id,\n dateSelection: item.dateSelection\n };\n });\n },\n\n buildResearchData() {\n return this.getSelectedResearchInfo.map(item => ({\n applicationId: this.dataItem.application.id || null,\n researchId: item.id || null,\n dateSelection: item.dateSelection\n }));\n },\n\n buildForeignData() {\n return this.getSelectedForeignInfo.map(item => ({\n applicationId: this.dataItem.application.id,\n foreignIndiceId: item.id || null,\n dateSelection: item.dateSelection\n }));\n },\n\n buildAlgoServerData() {\n return this.getSelectedAlgoServerInfo.map(item => ({\n applicationId: this.dataItem.application.id,\n algorithmAndServerId: item.id || null,\n dateSelection: item.dateSelection\n }));\n },\n\n buildArgsObject(packageData, researchData, foreignData, algoServerData) {\n var _this$dataItem6, _this$dataItem6$appli, _this$dataItem7, _this$dataItem7$platf, _this$dataItem8, _this$dataItem9, _this$dataItem9$platf;\n\n return {\n customerId: this.customer.id,\n purchaseId: this.dataItem.id,\n purchaseNumber: this.dataItem.purchaseNo.toString(),\n applicationId: ((_this$dataItem6 = this.dataItem) === null || _this$dataItem6 === void 0 ? void 0 : (_this$dataItem6$appli = _this$dataItem6.application) === null || _this$dataItem6$appli === void 0 ? void 0 : _this$dataItem6$appli.applicationId) || null,\n platformId: ((_this$dataItem7 = this.dataItem) === null || _this$dataItem7 === void 0 ? void 0 : (_this$dataItem7$platf = _this$dataItem7.platform) === null || _this$dataItem7$platf === void 0 ? void 0 : _this$dataItem7$platf.platformId) || null,\n applicationFeatureId: ((_this$dataItem8 = this.dataItem) === null || _this$dataItem8 === void 0 ? void 0 : _this$dataItem8.application.id) || null,\n platformFeatureId: (_this$dataItem9 = this.dataItem) === null || _this$dataItem9 === void 0 ? void 0 : (_this$dataItem9$platf = _this$dataItem9.platform) === null || _this$dataItem9$platf === void 0 ? void 0 : _this$dataItem9$platf.id,\n features: packageData,\n research: researchData,\n foreignIndice: foreignData,\n algorithmAndServer: algoServerData,\n cusId: this.cusId\n };\n },\n\n getActionName() {\n return this.dataItem.packageStatus.id === 2 ? \"updatePackage\" : \"createPackage\";\n },\n\n handleError(res) {\n if (res.result !== undefined && res.result !== null) {\n this.$toast.error(res.result.data[0].errors[0]);\n } else {\n this.$toast.error(res.message);\n }\n\n this.isButtonClicked = false;\n },\n\n handleSuccess(res, actionName) {\n if (actionName === \"updatePackage\") {\n this.handleUpdatePackageSuccess(res);\n } else {\n this.handleCreatePackageSuccess(res);\n }\n },\n\n async handleUpdatePackageSuccess() {\n const response = await this.getDraftPackageDetail([this.dataItem.id, this.cusId]);\n setTimeout(() => {\n console.log(this.$route.name);\n console.log(this.$route.path);\n this.$router.push({\n name: \"Checkout\",\n params: {\n packageNumber: response.data.id,\n customerNumber: this.$route.params.customerNumber\n },\n query: {\n c: this.$route.query.c || this.cusId,\n timeStamp: new Date()\n }\n });\n }, 300);\n },\n\n handleCreatePackageSuccess(res) {\n if (this.$route.name === \"Checkout\") {\n this.$router.push({\n name: \"Checkout\",\n params: {\n packageNumber: res.purchaseId,\n customerNumber: this.$route.params.customerNumber\n },\n query: {\n c: this.$route.query.c\n }\n });\n } else {\n this.$emit(\"close\");\n this.getAllPackages(this.cusId);\n }\n\n this.setSelectedResearch([]);\n this.setSelectedForeign([]);\n this.setSelectedAlgoServer([]);\n },\n\n calculatePrice(items) {\n var _this$dataItem$applic, _this$dataItem$applic2;\n\n this.bottomFund = items.reduce((totald, item) => {\n var _item$marketFeature2, _item$perspectiveFeat2, _item$vendorFeature4;\n\n return ((item === null || item === void 0 ? void 0 : (_item$marketFeature2 = item.marketFeature) === null || _item$marketFeature2 === void 0 ? void 0 : _item$marketFeature2.fundAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$perspectiveFeat2 = item.perspectiveFeature) === null || _item$perspectiveFeat2 === void 0 ? void 0 : _item$perspectiveFeat2.fundAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$vendorFeature4 = item.vendorFeature) === null || _item$vendorFeature4 === void 0 ? void 0 : _item$vendorFeature4.fundAmount) || 0) + totald;\n }, (_this$dataItem$applic = this.dataItem.application) === null || _this$dataItem$applic === void 0 ? void 0 : _this$dataItem$applic.fundAmount);\n this.bottomCommission = items.reduce((totald, item) => {\n var _item$marketFeature3, _item$perspectiveFeat3, _item$vendorFeature5;\n\n return ((item === null || item === void 0 ? void 0 : (_item$marketFeature3 = item.marketFeature) === null || _item$marketFeature3 === void 0 ? void 0 : _item$marketFeature3.commissionAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$perspectiveFeat3 = item.perspectiveFeature) === null || _item$perspectiveFeat3 === void 0 ? void 0 : _item$perspectiveFeat3.commissionAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$vendorFeature5 = item.vendorFeature) === null || _item$vendorFeature5 === void 0 ? void 0 : _item$vendorFeature5.commissionAmount) || 0) + totald;\n }, (_this$dataItem$applic2 = this.dataItem.application) === null || _this$dataItem$applic2 === void 0 ? void 0 : _this$dataItem$applic2.commissionAmount);\n const total = items.reduce((totald, item) => {\n var _item$perspectiveFeat4, _item$vendorFeature6;\n\n return (\n /* (item?.marketFeature?.price || 0) +\n (item?.platformFeature?.price || 0)*/\n +((item === null || item === void 0 ? void 0 : (_item$perspectiveFeat4 = item.perspectiveFeature) === null || _item$perspectiveFeat4 === void 0 ? void 0 : _item$perspectiveFeat4.price) || 0) + ((item === null || item === void 0 ? void 0 : (_item$vendorFeature6 = item.vendorFeature) === null || _item$vendorFeature6 === void 0 ? void 0 : _item$vendorFeature6.price) || 0) + totald\n );\n }, 0);\n this.totalPrice = total + this.dataItem.application.price;\n },\n\n calculateTotalPrice() {\n return this.dataItem.price + this.totalPrice + this.researchTotal() + this.foraignTurkishLiraTotal() + this.algoServerTotal();\n }\n\n },\n watch: {\n selectData: {\n handler(newVal) {\n this.calculatePrice(newVal);\n },\n\n deep: true,\n immediate: true\n }\n }\n});\n\n//# sourceURL=webpack://OsmanliPackage/./src/components/customer/PackageSettigns.vue?./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options");
1699
1699
 
1700
1700
  /***/ }),
1701
1701
 
@@ -1704,7 +1704,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vuex
1704
1704
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1705
1705
 
1706
1706
  "use strict";
1707
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.esm.js\");\n/* harmony import */ var _PackageSettingType_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PackageSettingType.vue */ \"./src/components/customer/PackageSettingType.vue\");\n/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components */ \"./src/components/index.js\");\n/* harmony import */ var _mixins___WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/ */ \"./src/mixins/index.js\");\n/* harmony import */ var _base_InfoArea_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/InfoArea.vue */ \"./src/components/base/InfoArea.vue\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../constants */ \"./src/constants/index.js\");\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"PackageSettigns\",\n mixins: [_mixins___WEBPACK_IMPORTED_MODULE_3__[\"default\"]],\n components: {\n BaseButton: _components__WEBPACK_IMPORTED_MODULE_2__[\"BaseButton\"],\n BaseIcon: _components__WEBPACK_IMPORTED_MODULE_2__[\"BaseIcon\"],\n PopupRight: _components__WEBPACK_IMPORTED_MODULE_2__[\"PopupRight\"],\n PackageSettingType: _PackageSettingType_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n AccordionResearch: _components__WEBPACK_IMPORTED_MODULE_2__[\"AccordionResearch\"],\n AccordionForeign: _components__WEBPACK_IMPORTED_MODULE_2__[\"AccordionForeign\"],\n AccordionAlgoServer: _components__WEBPACK_IMPORTED_MODULE_2__[\"AccordionAlgoServer\"],\n InfoArea: _base_InfoArea_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n },\n props: {\n dataItem: Object,\n marketInfo: Array,\n isPopupVisible: Boolean\n },\n\n data() {\n return {\n isResponsive: false,\n fund: 0,\n commission: 0,\n topPrice: 0,\n bottomFund: 0,\n bottomCommission: 0,\n totalPrice: 0,\n startDateSelection: this.dataItem.dateSelection,\n selectData: [],\n research: [],\n foreign: [],\n algoServer: [],\n isButtonClicked: false,\n warningMessage: false,\n infoText: \"BES ve yatırım fonu büyüklüğü ve/veya komisyon şartı sağlandığı taktirde; o ay toplamda belirtilen ekran ücreti sizden alınmayacaktır.\",\n startDate: [{\n label: \"Seçiniz\",\n code: -1\n }, {\n label: \"Hemen\",\n code: 0\n }, {\n label: \"Ay Başında\",\n code: 1\n }],\n cusId: null\n };\n },\n\n created() {\n this.handleWidth();\n window.addEventListener(\"resize\", this.handleWidth());\n },\n\n mounted() {\n this.setSelectedForeign([]);\n this.setSelectedAlgoServer([]);\n this.setSelectedResearch([]);\n this.cusId = this.$route.params.customerId !== undefined ? this.$route.params.customerId : null;\n\n if (this.$route.name === \"Checkout\") {\n this.cusId = this.$route.query.c !== undefined ? this.$route.query.c : this.$route.params.customerId;\n this.startDateSelection = this.dataItem.dateSelection;\n }\n\n this.sumFundCommission();\n this.getForeign([this.dataItem.application.applicationId, this.dataItem.platform.platformId, this.cusId]).then(res => {\n let details = {};\n details = res.data;\n\n if (this.getDraftPackageDetails.foreignIndice) {\n this.getDraftPackageDetails.foreignIndice.forEach((element, index) => {\n if (element.foreignIndiceFeature.id == details[index].id) {\n details[index].dateSelection = Number(element.dateSelection.key);\n }\n });\n }\n\n this.foreign.push({\n id: 2,\n active: false,\n title: \"Yabancı Endeksler\",\n details\n });\n });\n this.getResearch([this.dataItem.application.applicationId, this.cusId]).then(res => {\n let details = {};\n details = res.data;\n\n if (this.getDraftPackageDetails.research) {\n this.getDraftPackageDetails.research.forEach((element, index) => {\n if (element.researchFeature.id == details[index].id) {\n details[index].dateSelection = Number(element.dateSelection.key);\n }\n });\n }\n\n this.research = [{\n id: 1,\n active: false,\n title: \"Araştırma ve Diğer Uygulamalar\",\n details\n }];\n });\n this.getAlgoServer([this.dataItem.application.applicationId, this.cusId]).then(res => {\n let details = {};\n details = res.data;\n\n if (this.getDraftPackageDetails.algorithm) {\n this.getDraftPackageDetails.algorithm.forEach((element, index) => {\n if (element.algorithmFeature.id == details[index].id) {\n details[index].dateSelection = Number(element.dateSelection.key);\n }\n });\n }\n\n this.algoServer.push({\n id: 3,\n active: false,\n title: \"Algoritmalar\",\n details\n });\n });\n },\n\n computed: { ...Object(vuex__WEBPACK_IMPORTED_MODULE_0__[\"mapGetters\"])([\"getSelectedAlgoServerInfo\", \"customer\", \"getResearchInfo\", \"getSelectedForeignInfo\", \"getForeignInfo\", \"getAlgoServerInfo\", \"getSelectedResearchInfo\", \"getPackageInfo\", \"getDraftPackageDetails\"]),\n\n currencySymbol() {\n return _constants__WEBPACK_IMPORTED_MODULE_5__[\"CurrencySymbol\"];\n },\n\n researchTotal() {\n return this.getSelectedResearchInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n }, 0);\n },\n\n foraignDollarTotal() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n if (item.priceInfo === \"$\") {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n } else {\n return 0 + totald;\n }\n }, 0);\n },\n\n getStartDateSelection() {\n return this.dataItem.dateSelection;\n },\n\n foraignEuroTotal() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n if (item.priceInfo === \"€\") {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n } else {\n return 0 + totald;\n }\n }, 0);\n },\n\n algoServerTotal() {\n return this.getSelectedAlgoServerInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n }, 0);\n },\n\n researchFund() {\n return this.getSelectedResearchInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.fundAmount) || 0) + totald;\n }, 0);\n },\n\n foreignFund() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.fundAmount) || 0) + totald;\n }, 0);\n },\n\n algoServerFund() {\n return this.getSelectedAlgoServerInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.fundAmount) || 0) + totald;\n }, 0);\n },\n\n researchCommission() {\n return this.getSelectedResearchInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.commissionAmount) || 0) + totald;\n }, 0);\n },\n\n foreignCommission() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.commissionAmount) || 0) + totald;\n }, 0);\n },\n\n foraignTurkishLiraTotal() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n if (item.priceInfo === \"₺\") {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n } else {\n return 0 + totald;\n }\n }, 0);\n },\n\n algoServerCommission() {\n return this.getSelectedAlgoServerInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.commissionAmount) || 0) + totald;\n }, 0);\n },\n\n totalPriceDollar() {\n var _this$dataItem, _this$dataItem$price, _this$dataItem$price$;\n\n return (_this$dataItem = this.dataItem) === null || _this$dataItem === void 0 ? void 0 : (_this$dataItem$price = _this$dataItem.price) === null || _this$dataItem$price === void 0 ? void 0 : (_this$dataItem$price$ = _this$dataItem$price.prices) === null || _this$dataItem$price$ === void 0 ? void 0 : _this$dataItem$price$.filter(e => e.info === this.currencySymbol.dolar)[0];\n },\n\n totalPriceEuro() {\n var _this$dataItem2, _this$dataItem2$price, _this$dataItem2$price2;\n\n return (_this$dataItem2 = this.dataItem) === null || _this$dataItem2 === void 0 ? void 0 : (_this$dataItem2$price = _this$dataItem2.price) === null || _this$dataItem2$price === void 0 ? void 0 : (_this$dataItem2$price2 = _this$dataItem2$price.prices) === null || _this$dataItem2$price2 === void 0 ? void 0 : _this$dataItem2$price2.filter(e => e.info === this.currencySymbol.euro)[0];\n },\n\n totalPriceTl() {\n var _this$dataItem3, _this$dataItem3$price, _this$dataItem3$price2;\n\n return (_this$dataItem3 = this.dataItem) === null || _this$dataItem3 === void 0 ? void 0 : (_this$dataItem3$price = _this$dataItem3.price) === null || _this$dataItem3$price === void 0 ? void 0 : (_this$dataItem3$price2 = _this$dataItem3$price.prices) === null || _this$dataItem3$price2 === void 0 ? void 0 : _this$dataItem3$price2.filter(e => e.info === this.currencySymbol.tl)[0].totalPrice;\n },\n\n totalPriceCalc() {\n var _this$totalPriceDolla, _this$totalPriceEuro;\n\n let totalDollar = `${this.totalPriceDollar ? ` + ${this.formatPriceDollar((_this$totalPriceDolla = this.totalPriceDollar) === null || _this$totalPriceDolla === void 0 ? void 0 : _this$totalPriceDolla.totalPrice)} Dolar` : \"\"}`;\n let totalEuro = `${this.totalPriceEuro ? ` + ${this.formatPriceEuro((_this$totalPriceEuro = this.totalPriceEuro) === null || _this$totalPriceEuro === void 0 ? void 0 : _this$totalPriceEuro.totalPrice)} Euro` : \"\"}`;\n return this.formatPrice(this.totalPriceTl) + this.currencySymbol.tl + totalDollar + totalEuro;\n }\n\n },\n methods: { ...Object(vuex__WEBPACK_IMPORTED_MODULE_0__[\"mapActions\"])([\"getForeign\", \"getAllPackages\", \"getDraftPackageDetail\", \"getResearch\", \"updatePackage\", \"getAlgoServer\", \"createPackage\"]),\n ...Object(vuex__WEBPACK_IMPORTED_MODULE_0__[\"mapMutations\"])([\"setSelectedForeign\", \"setSelectedAlgoServer\", \"setSelectedResearch\"]),\n\n checkSpesificWarning(param) {\n this.warningMessage = param;\n },\n\n setDefaultValues() {\n this.bottomCommission = 0;\n this.totalPrice = 0;\n this.bottomFund = 0;\n this.selectData = [];\n this.startDateSelection = this.startDate[0].code;\n this.setSelectedForeign([]);\n this.setSelectedAlgoServer([]);\n this.setSelectedResearch([]);\n this.$emit(\"close\");\n },\n\n handleWidth() {\n let w = window.innerWidth;\n this.isResponsive = w <= 640;\n },\n\n sumFundCommission() {\n this.fund = this.dataItem.price.totalFundAmount;\n this.commission = this.dataItem.price.totalCommissionAmount;\n this.topPrice = this.totalPriceCalc;\n this.totalPrice = this.topPrice;\n },\n\n changeSelected(data) {\n this.selectData = data;\n },\n\n async submitShow() {\n this.isButtonClicked = true;\n const packageData = this.buildPackageData();\n const getEveryDateSelection = packageData.filter(o => o.dateSelection == -1);\n const getResearchDateSelection = this.getSelectedResearchInfo.filter(o => o.dateSelection == -1);\n const getForeignDateSelection = this.getSelectedForeignInfo.filter(o => o.dateSelection == -1);\n const getSelectedAlgoSvInfo = this.getSelectedAlgoServerInfo.filter(o => o.dateSelection == -1);\n\n if (getEveryDateSelection.length > 0 || getResearchDateSelection.length > 0 || getForeignDateSelection.length > 0 || getSelectedAlgoSvInfo.length > 0) {\n this.$toast.error(\"Başlangıç zamanı seçiniz.\");\n this.isButtonClicked = false;\n return;\n }\n\n const researchData = this.buildResearchData();\n const foreignData = this.buildForeignData();\n const algoServerData = this.buildAlgoServerData();\n const args = this.buildArgsObject(packageData, researchData, foreignData, algoServerData);\n const actionName = this.getActionName();\n const sendAction = await this[actionName](args);\n\n if (sendAction.error) {\n this.handleError(sendAction);\n } else {\n this.handleSuccess(sendAction, actionName);\n this.args = {};\n }\n },\n\n buildPackageData() {\n return this.selectData.map(item => {\n var _this$dataItem4, _this$dataItem4$appli, _this$dataItem5, _this$dataItem5$platf, _item$marketFeature, _item$perspectiveFeat, _item$vendorFeature, _item$vendorFeature2, _item$vendorFeature3;\n\n return {\n applicationId: (_this$dataItem4 = this.dataItem) === null || _this$dataItem4 === void 0 ? void 0 : (_this$dataItem4$appli = _this$dataItem4.application) === null || _this$dataItem4$appli === void 0 ? void 0 : _this$dataItem4$appli.id,\n platformId: ((_this$dataItem5 = this.dataItem) === null || _this$dataItem5 === void 0 ? void 0 : (_this$dataItem5$platf = _this$dataItem5.platform) === null || _this$dataItem5$platf === void 0 ? void 0 : _this$dataItem5$platf.id) || null,\n marketId: (item === null || item === void 0 ? void 0 : (_item$marketFeature = item.marketFeature) === null || _item$marketFeature === void 0 ? void 0 : _item$marketFeature.id) || null,\n perspectiveId: (item === null || item === void 0 ? void 0 : (_item$perspectiveFeat = item.perspectiveFeature) === null || _item$perspectiveFeat === void 0 ? void 0 : _item$perspectiveFeat.id) || null,\n vendorId: (item === null || item === void 0 ? void 0 : (_item$vendorFeature = item.vendorFeature) === null || _item$vendorFeature === void 0 ? void 0 : _item$vendorFeature.id) === undefined || (item === null || item === void 0 ? void 0 : (_item$vendorFeature2 = item.vendorFeature) === null || _item$vendorFeature2 === void 0 ? void 0 : _item$vendorFeature2.id) === null ? null : item === null || item === void 0 ? void 0 : (_item$vendorFeature3 = item.vendorFeature) === null || _item$vendorFeature3 === void 0 ? void 0 : _item$vendorFeature3.id,\n dateSelection: item.dateSelection\n };\n });\n },\n\n buildResearchData() {\n return this.getSelectedResearchInfo.map(item => ({\n applicationId: this.dataItem.application.id || null,\n researchId: item.id || null,\n dateSelection: item.dateSelection\n }));\n },\n\n buildForeignData() {\n return this.getSelectedForeignInfo.map(item => ({\n applicationId: this.dataItem.application.id,\n foreignIndiceId: item.id || null,\n dateSelection: item.dateSelection\n }));\n },\n\n buildAlgoServerData() {\n return this.getSelectedAlgoServerInfo.map(item => ({\n applicationId: this.dataItem.application.id,\n algorithmAndServerId: item.id || null,\n dateSelection: item.dateSelection\n }));\n },\n\n buildArgsObject(packageData, researchData, foreignData, algoServerData) {\n var _this$dataItem6, _this$dataItem6$appli, _this$dataItem7, _this$dataItem7$platf, _this$dataItem8, _this$dataItem9, _this$dataItem9$platf;\n\n return {\n customerId: this.customer.id,\n purchaseId: this.dataItem.id,\n purchaseNumber: this.dataItem.purchaseNo.toString(),\n applicationId: ((_this$dataItem6 = this.dataItem) === null || _this$dataItem6 === void 0 ? void 0 : (_this$dataItem6$appli = _this$dataItem6.application) === null || _this$dataItem6$appli === void 0 ? void 0 : _this$dataItem6$appli.applicationId) || null,\n platformId: ((_this$dataItem7 = this.dataItem) === null || _this$dataItem7 === void 0 ? void 0 : (_this$dataItem7$platf = _this$dataItem7.platform) === null || _this$dataItem7$platf === void 0 ? void 0 : _this$dataItem7$platf.platformId) || null,\n applicationFeatureId: ((_this$dataItem8 = this.dataItem) === null || _this$dataItem8 === void 0 ? void 0 : _this$dataItem8.application.id) || null,\n platformFeatureId: (_this$dataItem9 = this.dataItem) === null || _this$dataItem9 === void 0 ? void 0 : (_this$dataItem9$platf = _this$dataItem9.platform) === null || _this$dataItem9$platf === void 0 ? void 0 : _this$dataItem9$platf.id,\n features: packageData,\n research: researchData,\n foreignIndice: foreignData,\n algorithmAndServer: algoServerData,\n cusId: this.cusId\n };\n },\n\n getActionName() {\n return this.dataItem.packageStatus.id === 2 ? \"updatePackage\" : \"createPackage\";\n },\n\n handleError(res) {\n if (res.result !== undefined && res.result !== null) {\n this.$toast.error(res.result.data[0].errors[0]);\n } else {\n this.$toast.error(res.message);\n }\n\n this.isButtonClicked = false;\n },\n\n handleSuccess(res, actionName) {\n if (actionName === \"updatePackage\") {\n this.handleUpdatePackageSuccess(res);\n } else {\n this.handleCreatePackageSuccess(res);\n }\n },\n\n async handleUpdatePackageSuccess() {\n const response = await this.getDraftPackageDetail([this.dataItem.id, this.cusId]);\n setTimeout(() => {\n const path = `/checkout/${this.$route.params.customerNumber}/${response.data.id}`;\n console.log(this.$route.name);\n console.log(this.$route.path);\n\n if (path !== this.$route.path || this.$route.name != \"Checkout\" || this.$route.name == \"OvdHome\") {\n this.$router.push({\n name: \"Checkout\",\n params: {\n packageNumber: response.data.id,\n customerNumber: this.$route.params.customerNumber\n },\n query: {\n c: this.$route.query.c\n }\n });\n } else {\n this.$router.go(this.$router.currentRoute);\n }\n }, 300);\n },\n\n handleCreatePackageSuccess(res) {\n if (this.$route.name === \"Checkout\") {\n this.$router.push({\n name: \"Checkout\",\n params: {\n packageNumber: res.purchaseId,\n customerNumber: this.$route.params.customerNumber\n },\n query: {\n c: this.$route.query.c\n }\n });\n } else {\n this.$emit(\"close\");\n this.getAllPackages(this.cusId);\n }\n\n this.setSelectedResearch([]);\n this.setSelectedForeign([]);\n this.setSelectedAlgoServer([]);\n },\n\n calculatePrice(items) {\n var _this$dataItem$applic, _this$dataItem$applic2;\n\n this.bottomFund = items.reduce((totald, item) => {\n var _item$marketFeature2, _item$perspectiveFeat2, _item$vendorFeature4;\n\n return ((item === null || item === void 0 ? void 0 : (_item$marketFeature2 = item.marketFeature) === null || _item$marketFeature2 === void 0 ? void 0 : _item$marketFeature2.fundAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$perspectiveFeat2 = item.perspectiveFeature) === null || _item$perspectiveFeat2 === void 0 ? void 0 : _item$perspectiveFeat2.fundAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$vendorFeature4 = item.vendorFeature) === null || _item$vendorFeature4 === void 0 ? void 0 : _item$vendorFeature4.fundAmount) || 0) + totald;\n }, (_this$dataItem$applic = this.dataItem.application) === null || _this$dataItem$applic === void 0 ? void 0 : _this$dataItem$applic.fundAmount);\n this.bottomCommission = items.reduce((totald, item) => {\n var _item$marketFeature3, _item$perspectiveFeat3, _item$vendorFeature5;\n\n return ((item === null || item === void 0 ? void 0 : (_item$marketFeature3 = item.marketFeature) === null || _item$marketFeature3 === void 0 ? void 0 : _item$marketFeature3.commissionAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$perspectiveFeat3 = item.perspectiveFeature) === null || _item$perspectiveFeat3 === void 0 ? void 0 : _item$perspectiveFeat3.commissionAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$vendorFeature5 = item.vendorFeature) === null || _item$vendorFeature5 === void 0 ? void 0 : _item$vendorFeature5.commissionAmount) || 0) + totald;\n }, (_this$dataItem$applic2 = this.dataItem.application) === null || _this$dataItem$applic2 === void 0 ? void 0 : _this$dataItem$applic2.commissionAmount);\n const total = items.reduce((totald, item) => {\n var _item$perspectiveFeat4, _item$vendorFeature6;\n\n return (\n /* (item?.marketFeature?.price || 0) +\n (item?.platformFeature?.price || 0)*/\n +((item === null || item === void 0 ? void 0 : (_item$perspectiveFeat4 = item.perspectiveFeature) === null || _item$perspectiveFeat4 === void 0 ? void 0 : _item$perspectiveFeat4.price) || 0) + ((item === null || item === void 0 ? void 0 : (_item$vendorFeature6 = item.vendorFeature) === null || _item$vendorFeature6 === void 0 ? void 0 : _item$vendorFeature6.price) || 0) + totald\n );\n }, 0);\n this.totalPrice = total + this.dataItem.application.price;\n },\n\n calculateTotalPrice() {\n return this.dataItem.price + this.totalPrice + this.researchTotal() + this.foraignTurkishLiraTotal() + this.algoServerTotal();\n }\n\n },\n watch: {\n selectData: {\n handler(newVal) {\n this.calculatePrice(newVal);\n },\n\n deep: true,\n immediate: true\n }\n }\n});\n\n//# sourceURL=webpack://OsmanliPackage/./src/components/customer/PackageSettigns.vue?./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options");
1707
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.esm.js\");\n/* harmony import */ var _PackageSettingType_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PackageSettingType.vue */ \"./src/components/customer/PackageSettingType.vue\");\n/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components */ \"./src/components/index.js\");\n/* harmony import */ var _mixins___WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/ */ \"./src/mixins/index.js\");\n/* harmony import */ var _base_InfoArea_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/InfoArea.vue */ \"./src/components/base/InfoArea.vue\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../constants */ \"./src/constants/index.js\");\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"PackageSettigns\",\n mixins: [_mixins___WEBPACK_IMPORTED_MODULE_3__[\"default\"]],\n components: {\n BaseButton: _components__WEBPACK_IMPORTED_MODULE_2__[\"BaseButton\"],\n BaseIcon: _components__WEBPACK_IMPORTED_MODULE_2__[\"BaseIcon\"],\n PopupRight: _components__WEBPACK_IMPORTED_MODULE_2__[\"PopupRight\"],\n PackageSettingType: _PackageSettingType_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n AccordionResearch: _components__WEBPACK_IMPORTED_MODULE_2__[\"AccordionResearch\"],\n AccordionForeign: _components__WEBPACK_IMPORTED_MODULE_2__[\"AccordionForeign\"],\n AccordionAlgoServer: _components__WEBPACK_IMPORTED_MODULE_2__[\"AccordionAlgoServer\"],\n InfoArea: _base_InfoArea_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n },\n props: {\n dataItem: Object,\n marketInfo: Array,\n isPopupVisible: Boolean\n },\n\n data() {\n return {\n isResponsive: false,\n fund: 0,\n commission: 0,\n topPrice: 0,\n bottomFund: 0,\n bottomCommission: 0,\n totalPrice: 0,\n startDateSelection: this.dataItem.dateSelection,\n selectData: [],\n research: [],\n foreign: [],\n algoServer: [],\n isButtonClicked: false,\n warningMessage: false,\n infoText: \"BES ve yatırım fonu büyüklüğü ve/veya komisyon şartı sağlandığı taktirde; o ay toplamda belirtilen ekran ücreti sizden alınmayacaktır.\",\n startDate: [{\n label: \"Seçiniz\",\n code: -1\n }, {\n label: \"Hemen\",\n code: 0\n }, {\n label: \"Ay Başında\",\n code: 1\n }],\n cusId: null\n };\n },\n\n created() {\n this.handleWidth();\n window.addEventListener(\"resize\", this.handleWidth());\n },\n\n mounted() {\n this.setSelectedForeign([]);\n this.setSelectedAlgoServer([]);\n this.setSelectedResearch([]);\n this.cusId = this.$route.params.customerId !== undefined ? this.$route.params.customerId : null;\n\n if (this.$route.name === \"Checkout\") {\n this.cusId = this.$route.query.c !== undefined ? this.$route.query.c : this.$route.params.customerId;\n this.startDateSelection = this.dataItem.dateSelection;\n }\n\n this.sumFundCommission();\n this.getForeign([this.dataItem.application.applicationId, this.dataItem.platform.platformId, this.cusId]).then(res => {\n let details = {};\n details = res.data;\n\n if (this.getDraftPackageDetails.foreignIndice) {\n this.getDraftPackageDetails.foreignIndice.forEach((element, index) => {\n if (element.foreignIndiceFeature.id == details[index].id) {\n details[index].dateSelection = Number(element.dateSelection.key);\n }\n });\n }\n\n this.foreign.push({\n id: 2,\n active: false,\n title: \"Yabancı Endeksler\",\n details\n });\n });\n this.getResearch([this.dataItem.application.applicationId, this.cusId]).then(res => {\n let details = {};\n details = res.data;\n\n if (this.getDraftPackageDetails.research) {\n this.getDraftPackageDetails.research.forEach((element, index) => {\n if (element.researchFeature.id == details[index].id) {\n details[index].dateSelection = Number(element.dateSelection.key);\n }\n });\n }\n\n this.research = [{\n id: 1,\n active: false,\n title: \"Araştırma ve Diğer Uygulamalar\",\n details\n }];\n });\n this.getAlgoServer([this.dataItem.application.applicationId, this.cusId]).then(res => {\n let details = {};\n details = res.data;\n\n if (this.getDraftPackageDetails.algorithm) {\n this.getDraftPackageDetails.algorithm.forEach((element, index) => {\n if (element.algorithmFeature.id == details[index].id) {\n details[index].dateSelection = Number(element.dateSelection.key);\n }\n });\n }\n\n this.algoServer.push({\n id: 3,\n active: false,\n title: \"Algoritmalar\",\n details\n });\n });\n },\n\n computed: { ...Object(vuex__WEBPACK_IMPORTED_MODULE_0__[\"mapGetters\"])([\"getSelectedAlgoServerInfo\", \"customer\", \"getResearchInfo\", \"getSelectedForeignInfo\", \"getForeignInfo\", \"getAlgoServerInfo\", \"getSelectedResearchInfo\", \"getPackageInfo\", \"getDraftPackageDetails\"]),\n\n currencySymbol() {\n return _constants__WEBPACK_IMPORTED_MODULE_5__[\"CurrencySymbol\"];\n },\n\n researchTotal() {\n return this.getSelectedResearchInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n }, 0);\n },\n\n foraignDollarTotal() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n if (item.priceInfo === \"$\") {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n } else {\n return 0 + totald;\n }\n }, 0);\n },\n\n getStartDateSelection() {\n return this.dataItem.dateSelection;\n },\n\n foraignEuroTotal() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n if (item.priceInfo === \"€\") {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n } else {\n return 0 + totald;\n }\n }, 0);\n },\n\n algoServerTotal() {\n return this.getSelectedAlgoServerInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n }, 0);\n },\n\n researchFund() {\n return this.getSelectedResearchInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.fundAmount) || 0) + totald;\n }, 0);\n },\n\n foreignFund() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.fundAmount) || 0) + totald;\n }, 0);\n },\n\n algoServerFund() {\n return this.getSelectedAlgoServerInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.fundAmount) || 0) + totald;\n }, 0);\n },\n\n researchCommission() {\n return this.getSelectedResearchInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.commissionAmount) || 0) + totald;\n }, 0);\n },\n\n foreignCommission() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.commissionAmount) || 0) + totald;\n }, 0);\n },\n\n foraignTurkishLiraTotal() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n if (item.priceInfo === \"₺\") {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n } else {\n return 0 + totald;\n }\n }, 0);\n },\n\n algoServerCommission() {\n return this.getSelectedAlgoServerInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.commissionAmount) || 0) + totald;\n }, 0);\n },\n\n totalPriceDollar() {\n var _this$dataItem, _this$dataItem$price, _this$dataItem$price$;\n\n return (_this$dataItem = this.dataItem) === null || _this$dataItem === void 0 ? void 0 : (_this$dataItem$price = _this$dataItem.price) === null || _this$dataItem$price === void 0 ? void 0 : (_this$dataItem$price$ = _this$dataItem$price.prices) === null || _this$dataItem$price$ === void 0 ? void 0 : _this$dataItem$price$.filter(e => e.info === this.currencySymbol.dolar)[0];\n },\n\n totalPriceEuro() {\n var _this$dataItem2, _this$dataItem2$price, _this$dataItem2$price2;\n\n return (_this$dataItem2 = this.dataItem) === null || _this$dataItem2 === void 0 ? void 0 : (_this$dataItem2$price = _this$dataItem2.price) === null || _this$dataItem2$price === void 0 ? void 0 : (_this$dataItem2$price2 = _this$dataItem2$price.prices) === null || _this$dataItem2$price2 === void 0 ? void 0 : _this$dataItem2$price2.filter(e => e.info === this.currencySymbol.euro)[0];\n },\n\n totalPriceTl() {\n var _this$dataItem3, _this$dataItem3$price, _this$dataItem3$price2;\n\n return (_this$dataItem3 = this.dataItem) === null || _this$dataItem3 === void 0 ? void 0 : (_this$dataItem3$price = _this$dataItem3.price) === null || _this$dataItem3$price === void 0 ? void 0 : (_this$dataItem3$price2 = _this$dataItem3$price.prices) === null || _this$dataItem3$price2 === void 0 ? void 0 : _this$dataItem3$price2.filter(e => e.info === this.currencySymbol.tl)[0].totalPrice;\n },\n\n totalPriceCalc() {\n var _this$totalPriceDolla, _this$totalPriceEuro;\n\n let totalDollar = `${this.totalPriceDollar ? ` + ${this.formatPriceDollar((_this$totalPriceDolla = this.totalPriceDollar) === null || _this$totalPriceDolla === void 0 ? void 0 : _this$totalPriceDolla.totalPrice)} Dolar` : \"\"}`;\n let totalEuro = `${this.totalPriceEuro ? ` + ${this.formatPriceEuro((_this$totalPriceEuro = this.totalPriceEuro) === null || _this$totalPriceEuro === void 0 ? void 0 : _this$totalPriceEuro.totalPrice)} Euro` : \"\"}`;\n return this.formatPrice(this.totalPriceTl) + this.currencySymbol.tl + totalDollar + totalEuro;\n }\n\n },\n methods: { ...Object(vuex__WEBPACK_IMPORTED_MODULE_0__[\"mapActions\"])([\"getForeign\", \"getAllPackages\", \"getDraftPackageDetail\", \"getResearch\", \"updatePackage\", \"getAlgoServer\", \"createPackage\"]),\n ...Object(vuex__WEBPACK_IMPORTED_MODULE_0__[\"mapMutations\"])([\"setSelectedForeign\", \"setSelectedAlgoServer\", \"setSelectedResearch\"]),\n\n checkSpesificWarning(param) {\n this.warningMessage = param;\n },\n\n setDefaultValues() {\n this.bottomCommission = 0;\n this.totalPrice = 0;\n this.bottomFund = 0;\n this.selectData = [];\n this.startDateSelection = this.startDate[0].code;\n this.setSelectedForeign([]);\n this.setSelectedAlgoServer([]);\n this.setSelectedResearch([]);\n this.$emit(\"close\");\n },\n\n handleWidth() {\n let w = window.innerWidth;\n this.isResponsive = w <= 640;\n },\n\n sumFundCommission() {\n this.fund = this.dataItem.price.totalFundAmount;\n this.commission = this.dataItem.price.totalCommissionAmount;\n this.topPrice = this.totalPriceCalc;\n this.totalPrice = this.topPrice;\n },\n\n changeSelected(data) {\n this.selectData = data;\n },\n\n async submitShow() {\n this.isButtonClicked = true;\n const packageData = this.buildPackageData();\n const getEveryDateSelection = packageData.filter(o => o.dateSelection == -1);\n const getResearchDateSelection = this.getSelectedResearchInfo.filter(o => o.dateSelection == -1);\n const getForeignDateSelection = this.getSelectedForeignInfo.filter(o => o.dateSelection == -1);\n const getSelectedAlgoSvInfo = this.getSelectedAlgoServerInfo.filter(o => o.dateSelection == -1);\n\n if (getEveryDateSelection.length > 0 || getResearchDateSelection.length > 0 || getForeignDateSelection.length > 0 || getSelectedAlgoSvInfo.length > 0) {\n this.$toast.error(\"Başlangıç zamanı seçiniz.\");\n this.isButtonClicked = false;\n return;\n }\n\n const researchData = this.buildResearchData();\n const foreignData = this.buildForeignData();\n const algoServerData = this.buildAlgoServerData();\n const args = this.buildArgsObject(packageData, researchData, foreignData, algoServerData);\n const actionName = this.getActionName();\n const sendAction = await this[actionName](args);\n\n if (sendAction.error) {\n this.handleError(sendAction);\n } else {\n this.handleSuccess(sendAction, actionName);\n this.args = {};\n }\n },\n\n buildPackageData() {\n return this.selectData.map(item => {\n var _this$dataItem4, _this$dataItem4$appli, _this$dataItem5, _this$dataItem5$platf, _item$marketFeature, _item$perspectiveFeat, _item$vendorFeature, _item$vendorFeature2, _item$vendorFeature3;\n\n return {\n applicationId: (_this$dataItem4 = this.dataItem) === null || _this$dataItem4 === void 0 ? void 0 : (_this$dataItem4$appli = _this$dataItem4.application) === null || _this$dataItem4$appli === void 0 ? void 0 : _this$dataItem4$appli.id,\n platformId: ((_this$dataItem5 = this.dataItem) === null || _this$dataItem5 === void 0 ? void 0 : (_this$dataItem5$platf = _this$dataItem5.platform) === null || _this$dataItem5$platf === void 0 ? void 0 : _this$dataItem5$platf.id) || null,\n marketId: (item === null || item === void 0 ? void 0 : (_item$marketFeature = item.marketFeature) === null || _item$marketFeature === void 0 ? void 0 : _item$marketFeature.id) || null,\n perspectiveId: (item === null || item === void 0 ? void 0 : (_item$perspectiveFeat = item.perspectiveFeature) === null || _item$perspectiveFeat === void 0 ? void 0 : _item$perspectiveFeat.id) || null,\n vendorId: (item === null || item === void 0 ? void 0 : (_item$vendorFeature = item.vendorFeature) === null || _item$vendorFeature === void 0 ? void 0 : _item$vendorFeature.id) === undefined || (item === null || item === void 0 ? void 0 : (_item$vendorFeature2 = item.vendorFeature) === null || _item$vendorFeature2 === void 0 ? void 0 : _item$vendorFeature2.id) === null ? null : item === null || item === void 0 ? void 0 : (_item$vendorFeature3 = item.vendorFeature) === null || _item$vendorFeature3 === void 0 ? void 0 : _item$vendorFeature3.id,\n dateSelection: item.dateSelection\n };\n });\n },\n\n buildResearchData() {\n return this.getSelectedResearchInfo.map(item => ({\n applicationId: this.dataItem.application.id || null,\n researchId: item.id || null,\n dateSelection: item.dateSelection\n }));\n },\n\n buildForeignData() {\n return this.getSelectedForeignInfo.map(item => ({\n applicationId: this.dataItem.application.id,\n foreignIndiceId: item.id || null,\n dateSelection: item.dateSelection\n }));\n },\n\n buildAlgoServerData() {\n return this.getSelectedAlgoServerInfo.map(item => ({\n applicationId: this.dataItem.application.id,\n algorithmAndServerId: item.id || null,\n dateSelection: item.dateSelection\n }));\n },\n\n buildArgsObject(packageData, researchData, foreignData, algoServerData) {\n var _this$dataItem6, _this$dataItem6$appli, _this$dataItem7, _this$dataItem7$platf, _this$dataItem8, _this$dataItem9, _this$dataItem9$platf;\n\n return {\n customerId: this.customer.id,\n purchaseId: this.dataItem.id,\n purchaseNumber: this.dataItem.purchaseNo.toString(),\n applicationId: ((_this$dataItem6 = this.dataItem) === null || _this$dataItem6 === void 0 ? void 0 : (_this$dataItem6$appli = _this$dataItem6.application) === null || _this$dataItem6$appli === void 0 ? void 0 : _this$dataItem6$appli.applicationId) || null,\n platformId: ((_this$dataItem7 = this.dataItem) === null || _this$dataItem7 === void 0 ? void 0 : (_this$dataItem7$platf = _this$dataItem7.platform) === null || _this$dataItem7$platf === void 0 ? void 0 : _this$dataItem7$platf.platformId) || null,\n applicationFeatureId: ((_this$dataItem8 = this.dataItem) === null || _this$dataItem8 === void 0 ? void 0 : _this$dataItem8.application.id) || null,\n platformFeatureId: (_this$dataItem9 = this.dataItem) === null || _this$dataItem9 === void 0 ? void 0 : (_this$dataItem9$platf = _this$dataItem9.platform) === null || _this$dataItem9$platf === void 0 ? void 0 : _this$dataItem9$platf.id,\n features: packageData,\n research: researchData,\n foreignIndice: foreignData,\n algorithmAndServer: algoServerData,\n cusId: this.cusId\n };\n },\n\n getActionName() {\n return this.dataItem.packageStatus.id === 2 ? \"updatePackage\" : \"createPackage\";\n },\n\n handleError(res) {\n if (res.result !== undefined && res.result !== null) {\n this.$toast.error(res.result.data[0].errors[0]);\n } else {\n this.$toast.error(res.message);\n }\n\n this.isButtonClicked = false;\n },\n\n handleSuccess(res, actionName) {\n if (actionName === \"updatePackage\") {\n this.handleUpdatePackageSuccess(res);\n } else {\n this.handleCreatePackageSuccess(res);\n }\n },\n\n async handleUpdatePackageSuccess() {\n const response = await this.getDraftPackageDetail([this.dataItem.id, this.cusId]);\n setTimeout(() => {\n console.log(this.$route.name);\n console.log(this.$route.path);\n this.$router.push({\n name: \"Checkout\",\n params: {\n packageNumber: response.data.id,\n customerNumber: this.$route.params.customerNumber\n },\n query: {\n c: this.$route.query.c || this.cusId,\n timeStamp: new Date()\n }\n });\n }, 300);\n },\n\n handleCreatePackageSuccess(res) {\n if (this.$route.name === \"Checkout\") {\n this.$router.push({\n name: \"Checkout\",\n params: {\n packageNumber: res.purchaseId,\n customerNumber: this.$route.params.customerNumber\n },\n query: {\n c: this.$route.query.c\n }\n });\n } else {\n this.$emit(\"close\");\n this.getAllPackages(this.cusId);\n }\n\n this.setSelectedResearch([]);\n this.setSelectedForeign([]);\n this.setSelectedAlgoServer([]);\n },\n\n calculatePrice(items) {\n var _this$dataItem$applic, _this$dataItem$applic2;\n\n this.bottomFund = items.reduce((totald, item) => {\n var _item$marketFeature2, _item$perspectiveFeat2, _item$vendorFeature4;\n\n return ((item === null || item === void 0 ? void 0 : (_item$marketFeature2 = item.marketFeature) === null || _item$marketFeature2 === void 0 ? void 0 : _item$marketFeature2.fundAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$perspectiveFeat2 = item.perspectiveFeature) === null || _item$perspectiveFeat2 === void 0 ? void 0 : _item$perspectiveFeat2.fundAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$vendorFeature4 = item.vendorFeature) === null || _item$vendorFeature4 === void 0 ? void 0 : _item$vendorFeature4.fundAmount) || 0) + totald;\n }, (_this$dataItem$applic = this.dataItem.application) === null || _this$dataItem$applic === void 0 ? void 0 : _this$dataItem$applic.fundAmount);\n this.bottomCommission = items.reduce((totald, item) => {\n var _item$marketFeature3, _item$perspectiveFeat3, _item$vendorFeature5;\n\n return ((item === null || item === void 0 ? void 0 : (_item$marketFeature3 = item.marketFeature) === null || _item$marketFeature3 === void 0 ? void 0 : _item$marketFeature3.commissionAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$perspectiveFeat3 = item.perspectiveFeature) === null || _item$perspectiveFeat3 === void 0 ? void 0 : _item$perspectiveFeat3.commissionAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$vendorFeature5 = item.vendorFeature) === null || _item$vendorFeature5 === void 0 ? void 0 : _item$vendorFeature5.commissionAmount) || 0) + totald;\n }, (_this$dataItem$applic2 = this.dataItem.application) === null || _this$dataItem$applic2 === void 0 ? void 0 : _this$dataItem$applic2.commissionAmount);\n const total = items.reduce((totald, item) => {\n var _item$perspectiveFeat4, _item$vendorFeature6;\n\n return (\n /* (item?.marketFeature?.price || 0) +\n (item?.platformFeature?.price || 0)*/\n +((item === null || item === void 0 ? void 0 : (_item$perspectiveFeat4 = item.perspectiveFeature) === null || _item$perspectiveFeat4 === void 0 ? void 0 : _item$perspectiveFeat4.price) || 0) + ((item === null || item === void 0 ? void 0 : (_item$vendorFeature6 = item.vendorFeature) === null || _item$vendorFeature6 === void 0 ? void 0 : _item$vendorFeature6.price) || 0) + totald\n );\n }, 0);\n this.totalPrice = total + this.dataItem.application.price;\n },\n\n calculateTotalPrice() {\n return this.dataItem.price + this.totalPrice + this.researchTotal() + this.foraignTurkishLiraTotal() + this.algoServerTotal();\n }\n\n },\n watch: {\n selectData: {\n handler(newVal) {\n this.calculatePrice(newVal);\n },\n\n deep: true,\n immediate: true\n }\n }\n});\n\n//# sourceURL=webpack://OsmanliPackage/./src/components/customer/PackageSettigns.vue?./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options");
1708
1708
 
1709
1709
  /***/ }),
1710
1710
 
@@ -1704,7 +1704,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vuex
1704
1704
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1705
1705
 
1706
1706
  "use strict";
1707
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.esm.js\");\n/* harmony import */ var _PackageSettingType_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PackageSettingType.vue */ \"./src/components/customer/PackageSettingType.vue\");\n/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components */ \"./src/components/index.js\");\n/* harmony import */ var _mixins___WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/ */ \"./src/mixins/index.js\");\n/* harmony import */ var _base_InfoArea_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/InfoArea.vue */ \"./src/components/base/InfoArea.vue\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../constants */ \"./src/constants/index.js\");\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"PackageSettigns\",\n mixins: [_mixins___WEBPACK_IMPORTED_MODULE_3__[\"default\"]],\n components: {\n BaseButton: _components__WEBPACK_IMPORTED_MODULE_2__[\"BaseButton\"],\n BaseIcon: _components__WEBPACK_IMPORTED_MODULE_2__[\"BaseIcon\"],\n PopupRight: _components__WEBPACK_IMPORTED_MODULE_2__[\"PopupRight\"],\n PackageSettingType: _PackageSettingType_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n AccordionResearch: _components__WEBPACK_IMPORTED_MODULE_2__[\"AccordionResearch\"],\n AccordionForeign: _components__WEBPACK_IMPORTED_MODULE_2__[\"AccordionForeign\"],\n AccordionAlgoServer: _components__WEBPACK_IMPORTED_MODULE_2__[\"AccordionAlgoServer\"],\n InfoArea: _base_InfoArea_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n },\n props: {\n dataItem: Object,\n marketInfo: Array,\n isPopupVisible: Boolean\n },\n\n data() {\n return {\n isResponsive: false,\n fund: 0,\n commission: 0,\n topPrice: 0,\n bottomFund: 0,\n bottomCommission: 0,\n totalPrice: 0,\n startDateSelection: this.dataItem.dateSelection,\n selectData: [],\n research: [],\n foreign: [],\n algoServer: [],\n isButtonClicked: false,\n warningMessage: false,\n infoText: \"BES ve yatırım fonu büyüklüğü ve/veya komisyon şartı sağlandığı taktirde; o ay toplamda belirtilen ekran ücreti sizden alınmayacaktır.\",\n startDate: [{\n label: \"Seçiniz\",\n code: -1\n }, {\n label: \"Hemen\",\n code: 0\n }, {\n label: \"Ay Başında\",\n code: 1\n }],\n cusId: null\n };\n },\n\n created() {\n this.handleWidth();\n window.addEventListener(\"resize\", this.handleWidth());\n },\n\n mounted() {\n this.setSelectedForeign([]);\n this.setSelectedAlgoServer([]);\n this.setSelectedResearch([]);\n this.cusId = this.$route.params.customerId !== undefined ? this.$route.params.customerId : null;\n\n if (this.$route.name === \"Checkout\") {\n this.cusId = this.$route.query.c !== undefined ? this.$route.query.c : this.$route.params.customerId;\n this.startDateSelection = this.dataItem.dateSelection;\n }\n\n this.sumFundCommission();\n this.getForeign([this.dataItem.application.applicationId, this.dataItem.platform.platformId, this.cusId]).then(res => {\n let details = {};\n details = res.data;\n\n if (this.getDraftPackageDetails.foreignIndice) {\n this.getDraftPackageDetails.foreignIndice.forEach((element, index) => {\n if (element.foreignIndiceFeature.id == details[index].id) {\n details[index].dateSelection = Number(element.dateSelection.key);\n }\n });\n }\n\n this.foreign.push({\n id: 2,\n active: false,\n title: \"Yabancı Endeksler\",\n details\n });\n });\n this.getResearch([this.dataItem.application.applicationId, this.cusId]).then(res => {\n let details = {};\n details = res.data;\n\n if (this.getDraftPackageDetails.research) {\n this.getDraftPackageDetails.research.forEach((element, index) => {\n if (element.researchFeature.id == details[index].id) {\n details[index].dateSelection = Number(element.dateSelection.key);\n }\n });\n }\n\n this.research = [{\n id: 1,\n active: false,\n title: \"Araştırma ve Diğer Uygulamalar\",\n details\n }];\n });\n this.getAlgoServer([this.dataItem.application.applicationId, this.cusId]).then(res => {\n let details = {};\n details = res.data;\n\n if (this.getDraftPackageDetails.algorithm) {\n this.getDraftPackageDetails.algorithm.forEach((element, index) => {\n if (element.algorithmFeature.id == details[index].id) {\n details[index].dateSelection = Number(element.dateSelection.key);\n }\n });\n }\n\n this.algoServer.push({\n id: 3,\n active: false,\n title: \"Algoritmalar\",\n details\n });\n });\n },\n\n computed: { ...Object(vuex__WEBPACK_IMPORTED_MODULE_0__[\"mapGetters\"])([\"getSelectedAlgoServerInfo\", \"customer\", \"getResearchInfo\", \"getSelectedForeignInfo\", \"getForeignInfo\", \"getAlgoServerInfo\", \"getSelectedResearchInfo\", \"getPackageInfo\", \"getDraftPackageDetails\"]),\n\n currencySymbol() {\n return _constants__WEBPACK_IMPORTED_MODULE_5__[\"CurrencySymbol\"];\n },\n\n researchTotal() {\n return this.getSelectedResearchInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n }, 0);\n },\n\n foraignDollarTotal() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n if (item.priceInfo === \"$\") {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n } else {\n return 0 + totald;\n }\n }, 0);\n },\n\n getStartDateSelection() {\n return this.dataItem.dateSelection;\n },\n\n foraignEuroTotal() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n if (item.priceInfo === \"€\") {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n } else {\n return 0 + totald;\n }\n }, 0);\n },\n\n algoServerTotal() {\n return this.getSelectedAlgoServerInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n }, 0);\n },\n\n researchFund() {\n return this.getSelectedResearchInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.fundAmount) || 0) + totald;\n }, 0);\n },\n\n foreignFund() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.fundAmount) || 0) + totald;\n }, 0);\n },\n\n algoServerFund() {\n return this.getSelectedAlgoServerInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.fundAmount) || 0) + totald;\n }, 0);\n },\n\n researchCommission() {\n return this.getSelectedResearchInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.commissionAmount) || 0) + totald;\n }, 0);\n },\n\n foreignCommission() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.commissionAmount) || 0) + totald;\n }, 0);\n },\n\n foraignTurkishLiraTotal() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n if (item.priceInfo === \"₺\") {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n } else {\n return 0 + totald;\n }\n }, 0);\n },\n\n algoServerCommission() {\n return this.getSelectedAlgoServerInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.commissionAmount) || 0) + totald;\n }, 0);\n },\n\n totalPriceDollar() {\n var _this$dataItem, _this$dataItem$price, _this$dataItem$price$;\n\n return (_this$dataItem = this.dataItem) === null || _this$dataItem === void 0 ? void 0 : (_this$dataItem$price = _this$dataItem.price) === null || _this$dataItem$price === void 0 ? void 0 : (_this$dataItem$price$ = _this$dataItem$price.prices) === null || _this$dataItem$price$ === void 0 ? void 0 : _this$dataItem$price$.filter(e => e.info === this.currencySymbol.dolar)[0];\n },\n\n totalPriceEuro() {\n var _this$dataItem2, _this$dataItem2$price, _this$dataItem2$price2;\n\n return (_this$dataItem2 = this.dataItem) === null || _this$dataItem2 === void 0 ? void 0 : (_this$dataItem2$price = _this$dataItem2.price) === null || _this$dataItem2$price === void 0 ? void 0 : (_this$dataItem2$price2 = _this$dataItem2$price.prices) === null || _this$dataItem2$price2 === void 0 ? void 0 : _this$dataItem2$price2.filter(e => e.info === this.currencySymbol.euro)[0];\n },\n\n totalPriceTl() {\n var _this$dataItem3, _this$dataItem3$price, _this$dataItem3$price2;\n\n return (_this$dataItem3 = this.dataItem) === null || _this$dataItem3 === void 0 ? void 0 : (_this$dataItem3$price = _this$dataItem3.price) === null || _this$dataItem3$price === void 0 ? void 0 : (_this$dataItem3$price2 = _this$dataItem3$price.prices) === null || _this$dataItem3$price2 === void 0 ? void 0 : _this$dataItem3$price2.filter(e => e.info === this.currencySymbol.tl)[0].totalPrice;\n },\n\n totalPriceCalc() {\n var _this$totalPriceDolla, _this$totalPriceEuro;\n\n let totalDollar = `${this.totalPriceDollar ? ` + ${this.formatPriceDollar((_this$totalPriceDolla = this.totalPriceDollar) === null || _this$totalPriceDolla === void 0 ? void 0 : _this$totalPriceDolla.totalPrice)} Dolar` : \"\"}`;\n let totalEuro = `${this.totalPriceEuro ? ` + ${this.formatPriceEuro((_this$totalPriceEuro = this.totalPriceEuro) === null || _this$totalPriceEuro === void 0 ? void 0 : _this$totalPriceEuro.totalPrice)} Euro` : \"\"}`;\n return this.formatPrice(this.totalPriceTl) + this.currencySymbol.tl + totalDollar + totalEuro;\n }\n\n },\n methods: { ...Object(vuex__WEBPACK_IMPORTED_MODULE_0__[\"mapActions\"])([\"getForeign\", \"getAllPackages\", \"getDraftPackageDetail\", \"getResearch\", \"updatePackage\", \"getAlgoServer\", \"createPackage\"]),\n ...Object(vuex__WEBPACK_IMPORTED_MODULE_0__[\"mapMutations\"])([\"setSelectedForeign\", \"setSelectedAlgoServer\", \"setSelectedResearch\"]),\n\n checkSpesificWarning(param) {\n this.warningMessage = param;\n },\n\n setDefaultValues() {\n this.bottomCommission = 0;\n this.totalPrice = 0;\n this.bottomFund = 0;\n this.selectData = [];\n this.startDateSelection = this.startDate[0].code;\n this.setSelectedForeign([]);\n this.setSelectedAlgoServer([]);\n this.setSelectedResearch([]);\n this.$emit(\"close\");\n },\n\n handleWidth() {\n let w = window.innerWidth;\n this.isResponsive = w <= 640;\n },\n\n sumFundCommission() {\n this.fund = this.dataItem.price.totalFundAmount;\n this.commission = this.dataItem.price.totalCommissionAmount;\n this.topPrice = this.totalPriceCalc;\n this.totalPrice = this.topPrice;\n },\n\n changeSelected(data) {\n this.selectData = data;\n },\n\n async submitShow() {\n this.isButtonClicked = true;\n const packageData = this.buildPackageData();\n const getEveryDateSelection = packageData.filter(o => o.dateSelection == -1);\n const getResearchDateSelection = this.getSelectedResearchInfo.filter(o => o.dateSelection == -1);\n const getForeignDateSelection = this.getSelectedForeignInfo.filter(o => o.dateSelection == -1);\n const getSelectedAlgoSvInfo = this.getSelectedAlgoServerInfo.filter(o => o.dateSelection == -1);\n\n if (getEveryDateSelection.length > 0 || getResearchDateSelection.length > 0 || getForeignDateSelection.length > 0 || getSelectedAlgoSvInfo.length > 0) {\n this.$toast.error(\"Başlangıç zamanı seçiniz.\");\n this.isButtonClicked = false;\n return;\n }\n\n const researchData = this.buildResearchData();\n const foreignData = this.buildForeignData();\n const algoServerData = this.buildAlgoServerData();\n const args = this.buildArgsObject(packageData, researchData, foreignData, algoServerData);\n const actionName = this.getActionName();\n const sendAction = await this[actionName](args);\n\n if (sendAction.error) {\n this.handleError(sendAction);\n } else {\n this.handleSuccess(sendAction, actionName);\n this.args = {};\n }\n },\n\n buildPackageData() {\n return this.selectData.map(item => {\n var _this$dataItem4, _this$dataItem4$appli, _this$dataItem5, _this$dataItem5$platf, _item$marketFeature, _item$perspectiveFeat, _item$vendorFeature, _item$vendorFeature2, _item$vendorFeature3;\n\n return {\n applicationId: (_this$dataItem4 = this.dataItem) === null || _this$dataItem4 === void 0 ? void 0 : (_this$dataItem4$appli = _this$dataItem4.application) === null || _this$dataItem4$appli === void 0 ? void 0 : _this$dataItem4$appli.id,\n platformId: ((_this$dataItem5 = this.dataItem) === null || _this$dataItem5 === void 0 ? void 0 : (_this$dataItem5$platf = _this$dataItem5.platform) === null || _this$dataItem5$platf === void 0 ? void 0 : _this$dataItem5$platf.id) || null,\n marketId: (item === null || item === void 0 ? void 0 : (_item$marketFeature = item.marketFeature) === null || _item$marketFeature === void 0 ? void 0 : _item$marketFeature.id) || null,\n perspectiveId: (item === null || item === void 0 ? void 0 : (_item$perspectiveFeat = item.perspectiveFeature) === null || _item$perspectiveFeat === void 0 ? void 0 : _item$perspectiveFeat.id) || null,\n vendorId: (item === null || item === void 0 ? void 0 : (_item$vendorFeature = item.vendorFeature) === null || _item$vendorFeature === void 0 ? void 0 : _item$vendorFeature.id) === undefined || (item === null || item === void 0 ? void 0 : (_item$vendorFeature2 = item.vendorFeature) === null || _item$vendorFeature2 === void 0 ? void 0 : _item$vendorFeature2.id) === null ? null : item === null || item === void 0 ? void 0 : (_item$vendorFeature3 = item.vendorFeature) === null || _item$vendorFeature3 === void 0 ? void 0 : _item$vendorFeature3.id,\n dateSelection: item.dateSelection\n };\n });\n },\n\n buildResearchData() {\n return this.getSelectedResearchInfo.map(item => ({\n applicationId: this.dataItem.application.id || null,\n researchId: item.id || null,\n dateSelection: item.dateSelection\n }));\n },\n\n buildForeignData() {\n return this.getSelectedForeignInfo.map(item => ({\n applicationId: this.dataItem.application.id,\n foreignIndiceId: item.id || null,\n dateSelection: item.dateSelection\n }));\n },\n\n buildAlgoServerData() {\n return this.getSelectedAlgoServerInfo.map(item => ({\n applicationId: this.dataItem.application.id,\n algorithmAndServerId: item.id || null,\n dateSelection: item.dateSelection\n }));\n },\n\n buildArgsObject(packageData, researchData, foreignData, algoServerData) {\n var _this$dataItem6, _this$dataItem6$appli, _this$dataItem7, _this$dataItem7$platf, _this$dataItem8, _this$dataItem9, _this$dataItem9$platf;\n\n return {\n customerId: this.customer.id,\n purchaseId: this.dataItem.id,\n purchaseNumber: this.dataItem.purchaseNo.toString(),\n applicationId: ((_this$dataItem6 = this.dataItem) === null || _this$dataItem6 === void 0 ? void 0 : (_this$dataItem6$appli = _this$dataItem6.application) === null || _this$dataItem6$appli === void 0 ? void 0 : _this$dataItem6$appli.applicationId) || null,\n platformId: ((_this$dataItem7 = this.dataItem) === null || _this$dataItem7 === void 0 ? void 0 : (_this$dataItem7$platf = _this$dataItem7.platform) === null || _this$dataItem7$platf === void 0 ? void 0 : _this$dataItem7$platf.platformId) || null,\n applicationFeatureId: ((_this$dataItem8 = this.dataItem) === null || _this$dataItem8 === void 0 ? void 0 : _this$dataItem8.application.id) || null,\n platformFeatureId: (_this$dataItem9 = this.dataItem) === null || _this$dataItem9 === void 0 ? void 0 : (_this$dataItem9$platf = _this$dataItem9.platform) === null || _this$dataItem9$platf === void 0 ? void 0 : _this$dataItem9$platf.id,\n features: packageData,\n research: researchData,\n foreignIndice: foreignData,\n algorithmAndServer: algoServerData,\n cusId: this.cusId\n };\n },\n\n getActionName() {\n return this.dataItem.packageStatus.id === 2 ? \"updatePackage\" : \"createPackage\";\n },\n\n handleError(res) {\n if (res.result !== undefined && res.result !== null) {\n this.$toast.error(res.result.data[0].errors[0]);\n } else {\n this.$toast.error(res.message);\n }\n\n this.isButtonClicked = false;\n },\n\n handleSuccess(res, actionName) {\n if (actionName === \"updatePackage\") {\n this.handleUpdatePackageSuccess(res);\n } else {\n this.handleCreatePackageSuccess(res);\n }\n },\n\n async handleUpdatePackageSuccess() {\n const response = await this.getDraftPackageDetail([this.dataItem.id, this.cusId]);\n setTimeout(() => {\n const path = `/checkout/${this.$route.params.customerNumber}/${response.data.id}`;\n console.log(this.$route.name);\n console.log(this.$route.path);\n\n if (path !== this.$route.path || this.$route.name != \"Checkout\" || this.$route.name == \"OvdHome\") {\n this.$router.push({\n name: \"Checkout\",\n params: {\n packageNumber: response.data.id,\n customerNumber: this.$route.params.customerNumber\n },\n query: {\n c: this.$route.query.c\n }\n });\n } else {\n this.$router.go(this.$router.currentRoute);\n }\n }, 300);\n },\n\n handleCreatePackageSuccess(res) {\n if (this.$route.name === \"Checkout\") {\n this.$router.push({\n name: \"Checkout\",\n params: {\n packageNumber: res.purchaseId,\n customerNumber: this.$route.params.customerNumber\n },\n query: {\n c: this.$route.query.c\n }\n });\n } else {\n this.$emit(\"close\");\n this.getAllPackages(this.cusId);\n }\n\n this.setSelectedResearch([]);\n this.setSelectedForeign([]);\n this.setSelectedAlgoServer([]);\n },\n\n calculatePrice(items) {\n var _this$dataItem$applic, _this$dataItem$applic2;\n\n this.bottomFund = items.reduce((totald, item) => {\n var _item$marketFeature2, _item$perspectiveFeat2, _item$vendorFeature4;\n\n return ((item === null || item === void 0 ? void 0 : (_item$marketFeature2 = item.marketFeature) === null || _item$marketFeature2 === void 0 ? void 0 : _item$marketFeature2.fundAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$perspectiveFeat2 = item.perspectiveFeature) === null || _item$perspectiveFeat2 === void 0 ? void 0 : _item$perspectiveFeat2.fundAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$vendorFeature4 = item.vendorFeature) === null || _item$vendorFeature4 === void 0 ? void 0 : _item$vendorFeature4.fundAmount) || 0) + totald;\n }, (_this$dataItem$applic = this.dataItem.application) === null || _this$dataItem$applic === void 0 ? void 0 : _this$dataItem$applic.fundAmount);\n this.bottomCommission = items.reduce((totald, item) => {\n var _item$marketFeature3, _item$perspectiveFeat3, _item$vendorFeature5;\n\n return ((item === null || item === void 0 ? void 0 : (_item$marketFeature3 = item.marketFeature) === null || _item$marketFeature3 === void 0 ? void 0 : _item$marketFeature3.commissionAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$perspectiveFeat3 = item.perspectiveFeature) === null || _item$perspectiveFeat3 === void 0 ? void 0 : _item$perspectiveFeat3.commissionAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$vendorFeature5 = item.vendorFeature) === null || _item$vendorFeature5 === void 0 ? void 0 : _item$vendorFeature5.commissionAmount) || 0) + totald;\n }, (_this$dataItem$applic2 = this.dataItem.application) === null || _this$dataItem$applic2 === void 0 ? void 0 : _this$dataItem$applic2.commissionAmount);\n const total = items.reduce((totald, item) => {\n var _item$perspectiveFeat4, _item$vendorFeature6;\n\n return (\n /* (item?.marketFeature?.price || 0) +\n (item?.platformFeature?.price || 0)*/\n +((item === null || item === void 0 ? void 0 : (_item$perspectiveFeat4 = item.perspectiveFeature) === null || _item$perspectiveFeat4 === void 0 ? void 0 : _item$perspectiveFeat4.price) || 0) + ((item === null || item === void 0 ? void 0 : (_item$vendorFeature6 = item.vendorFeature) === null || _item$vendorFeature6 === void 0 ? void 0 : _item$vendorFeature6.price) || 0) + totald\n );\n }, 0);\n this.totalPrice = total + this.dataItem.application.price;\n },\n\n calculateTotalPrice() {\n return this.dataItem.price + this.totalPrice + this.researchTotal() + this.foraignTurkishLiraTotal() + this.algoServerTotal();\n }\n\n },\n watch: {\n selectData: {\n handler(newVal) {\n this.calculatePrice(newVal);\n },\n\n deep: true,\n immediate: true\n }\n }\n});\n\n//# sourceURL=webpack://OsmanliPackage/./src/components/customer/PackageSettigns.vue?./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options");
1707
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.esm.js\");\n/* harmony import */ var _PackageSettingType_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PackageSettingType.vue */ \"./src/components/customer/PackageSettingType.vue\");\n/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components */ \"./src/components/index.js\");\n/* harmony import */ var _mixins___WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/ */ \"./src/mixins/index.js\");\n/* harmony import */ var _base_InfoArea_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/InfoArea.vue */ \"./src/components/base/InfoArea.vue\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../constants */ \"./src/constants/index.js\");\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"PackageSettigns\",\n mixins: [_mixins___WEBPACK_IMPORTED_MODULE_3__[\"default\"]],\n components: {\n BaseButton: _components__WEBPACK_IMPORTED_MODULE_2__[\"BaseButton\"],\n BaseIcon: _components__WEBPACK_IMPORTED_MODULE_2__[\"BaseIcon\"],\n PopupRight: _components__WEBPACK_IMPORTED_MODULE_2__[\"PopupRight\"],\n PackageSettingType: _PackageSettingType_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n AccordionResearch: _components__WEBPACK_IMPORTED_MODULE_2__[\"AccordionResearch\"],\n AccordionForeign: _components__WEBPACK_IMPORTED_MODULE_2__[\"AccordionForeign\"],\n AccordionAlgoServer: _components__WEBPACK_IMPORTED_MODULE_2__[\"AccordionAlgoServer\"],\n InfoArea: _base_InfoArea_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n },\n props: {\n dataItem: Object,\n marketInfo: Array,\n isPopupVisible: Boolean\n },\n\n data() {\n return {\n isResponsive: false,\n fund: 0,\n commission: 0,\n topPrice: 0,\n bottomFund: 0,\n bottomCommission: 0,\n totalPrice: 0,\n startDateSelection: this.dataItem.dateSelection,\n selectData: [],\n research: [],\n foreign: [],\n algoServer: [],\n isButtonClicked: false,\n warningMessage: false,\n infoText: \"BES ve yatırım fonu büyüklüğü ve/veya komisyon şartı sağlandığı taktirde; o ay toplamda belirtilen ekran ücreti sizden alınmayacaktır.\",\n startDate: [{\n label: \"Seçiniz\",\n code: -1\n }, {\n label: \"Hemen\",\n code: 0\n }, {\n label: \"Ay Başında\",\n code: 1\n }],\n cusId: null\n };\n },\n\n created() {\n this.handleWidth();\n window.addEventListener(\"resize\", this.handleWidth());\n },\n\n mounted() {\n this.setSelectedForeign([]);\n this.setSelectedAlgoServer([]);\n this.setSelectedResearch([]);\n this.cusId = this.$route.params.customerId !== undefined ? this.$route.params.customerId : null;\n\n if (this.$route.name === \"Checkout\") {\n this.cusId = this.$route.query.c !== undefined ? this.$route.query.c : this.$route.params.customerId;\n this.startDateSelection = this.dataItem.dateSelection;\n }\n\n this.sumFundCommission();\n this.getForeign([this.dataItem.application.applicationId, this.dataItem.platform.platformId, this.cusId]).then(res => {\n let details = {};\n details = res.data;\n\n if (this.getDraftPackageDetails.foreignIndice) {\n this.getDraftPackageDetails.foreignIndice.forEach((element, index) => {\n if (element.foreignIndiceFeature.id == details[index].id) {\n details[index].dateSelection = Number(element.dateSelection.key);\n }\n });\n }\n\n this.foreign.push({\n id: 2,\n active: false,\n title: \"Yabancı Endeksler\",\n details\n });\n });\n this.getResearch([this.dataItem.application.applicationId, this.cusId]).then(res => {\n let details = {};\n details = res.data;\n\n if (this.getDraftPackageDetails.research) {\n this.getDraftPackageDetails.research.forEach((element, index) => {\n if (element.researchFeature.id == details[index].id) {\n details[index].dateSelection = Number(element.dateSelection.key);\n }\n });\n }\n\n this.research = [{\n id: 1,\n active: false,\n title: \"Araştırma ve Diğer Uygulamalar\",\n details\n }];\n });\n this.getAlgoServer([this.dataItem.application.applicationId, this.cusId]).then(res => {\n let details = {};\n details = res.data;\n\n if (this.getDraftPackageDetails.algorithm) {\n this.getDraftPackageDetails.algorithm.forEach((element, index) => {\n if (element.algorithmFeature.id == details[index].id) {\n details[index].dateSelection = Number(element.dateSelection.key);\n }\n });\n }\n\n this.algoServer.push({\n id: 3,\n active: false,\n title: \"Algoritmalar\",\n details\n });\n });\n },\n\n computed: { ...Object(vuex__WEBPACK_IMPORTED_MODULE_0__[\"mapGetters\"])([\"getSelectedAlgoServerInfo\", \"customer\", \"getResearchInfo\", \"getSelectedForeignInfo\", \"getForeignInfo\", \"getAlgoServerInfo\", \"getSelectedResearchInfo\", \"getPackageInfo\", \"getDraftPackageDetails\"]),\n\n currencySymbol() {\n return _constants__WEBPACK_IMPORTED_MODULE_5__[\"CurrencySymbol\"];\n },\n\n researchTotal() {\n return this.getSelectedResearchInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n }, 0);\n },\n\n foraignDollarTotal() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n if (item.priceInfo === \"$\") {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n } else {\n return 0 + totald;\n }\n }, 0);\n },\n\n getStartDateSelection() {\n return this.dataItem.dateSelection;\n },\n\n foraignEuroTotal() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n if (item.priceInfo === \"€\") {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n } else {\n return 0 + totald;\n }\n }, 0);\n },\n\n algoServerTotal() {\n return this.getSelectedAlgoServerInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n }, 0);\n },\n\n researchFund() {\n return this.getSelectedResearchInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.fundAmount) || 0) + totald;\n }, 0);\n },\n\n foreignFund() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.fundAmount) || 0) + totald;\n }, 0);\n },\n\n algoServerFund() {\n return this.getSelectedAlgoServerInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.fundAmount) || 0) + totald;\n }, 0);\n },\n\n researchCommission() {\n return this.getSelectedResearchInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.commissionAmount) || 0) + totald;\n }, 0);\n },\n\n foreignCommission() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.commissionAmount) || 0) + totald;\n }, 0);\n },\n\n foraignTurkishLiraTotal() {\n return this.getSelectedForeignInfo.reduce((totald, item) => {\n if (item.priceInfo === \"₺\") {\n return ((item === null || item === void 0 ? void 0 : item.price) || 0) + totald;\n } else {\n return 0 + totald;\n }\n }, 0);\n },\n\n algoServerCommission() {\n return this.getSelectedAlgoServerInfo.reduce((totald, item) => {\n return ((item === null || item === void 0 ? void 0 : item.commissionAmount) || 0) + totald;\n }, 0);\n },\n\n totalPriceDollar() {\n var _this$dataItem, _this$dataItem$price, _this$dataItem$price$;\n\n return (_this$dataItem = this.dataItem) === null || _this$dataItem === void 0 ? void 0 : (_this$dataItem$price = _this$dataItem.price) === null || _this$dataItem$price === void 0 ? void 0 : (_this$dataItem$price$ = _this$dataItem$price.prices) === null || _this$dataItem$price$ === void 0 ? void 0 : _this$dataItem$price$.filter(e => e.info === this.currencySymbol.dolar)[0];\n },\n\n totalPriceEuro() {\n var _this$dataItem2, _this$dataItem2$price, _this$dataItem2$price2;\n\n return (_this$dataItem2 = this.dataItem) === null || _this$dataItem2 === void 0 ? void 0 : (_this$dataItem2$price = _this$dataItem2.price) === null || _this$dataItem2$price === void 0 ? void 0 : (_this$dataItem2$price2 = _this$dataItem2$price.prices) === null || _this$dataItem2$price2 === void 0 ? void 0 : _this$dataItem2$price2.filter(e => e.info === this.currencySymbol.euro)[0];\n },\n\n totalPriceTl() {\n var _this$dataItem3, _this$dataItem3$price, _this$dataItem3$price2;\n\n return (_this$dataItem3 = this.dataItem) === null || _this$dataItem3 === void 0 ? void 0 : (_this$dataItem3$price = _this$dataItem3.price) === null || _this$dataItem3$price === void 0 ? void 0 : (_this$dataItem3$price2 = _this$dataItem3$price.prices) === null || _this$dataItem3$price2 === void 0 ? void 0 : _this$dataItem3$price2.filter(e => e.info === this.currencySymbol.tl)[0].totalPrice;\n },\n\n totalPriceCalc() {\n var _this$totalPriceDolla, _this$totalPriceEuro;\n\n let totalDollar = `${this.totalPriceDollar ? ` + ${this.formatPriceDollar((_this$totalPriceDolla = this.totalPriceDollar) === null || _this$totalPriceDolla === void 0 ? void 0 : _this$totalPriceDolla.totalPrice)} Dolar` : \"\"}`;\n let totalEuro = `${this.totalPriceEuro ? ` + ${this.formatPriceEuro((_this$totalPriceEuro = this.totalPriceEuro) === null || _this$totalPriceEuro === void 0 ? void 0 : _this$totalPriceEuro.totalPrice)} Euro` : \"\"}`;\n return this.formatPrice(this.totalPriceTl) + this.currencySymbol.tl + totalDollar + totalEuro;\n }\n\n },\n methods: { ...Object(vuex__WEBPACK_IMPORTED_MODULE_0__[\"mapActions\"])([\"getForeign\", \"getAllPackages\", \"getDraftPackageDetail\", \"getResearch\", \"updatePackage\", \"getAlgoServer\", \"createPackage\"]),\n ...Object(vuex__WEBPACK_IMPORTED_MODULE_0__[\"mapMutations\"])([\"setSelectedForeign\", \"setSelectedAlgoServer\", \"setSelectedResearch\"]),\n\n checkSpesificWarning(param) {\n this.warningMessage = param;\n },\n\n setDefaultValues() {\n this.bottomCommission = 0;\n this.totalPrice = 0;\n this.bottomFund = 0;\n this.selectData = [];\n this.startDateSelection = this.startDate[0].code;\n this.setSelectedForeign([]);\n this.setSelectedAlgoServer([]);\n this.setSelectedResearch([]);\n this.$emit(\"close\");\n },\n\n handleWidth() {\n let w = window.innerWidth;\n this.isResponsive = w <= 640;\n },\n\n sumFundCommission() {\n this.fund = this.dataItem.price.totalFundAmount;\n this.commission = this.dataItem.price.totalCommissionAmount;\n this.topPrice = this.totalPriceCalc;\n this.totalPrice = this.topPrice;\n },\n\n changeSelected(data) {\n this.selectData = data;\n },\n\n async submitShow() {\n this.isButtonClicked = true;\n const packageData = this.buildPackageData();\n const getEveryDateSelection = packageData.filter(o => o.dateSelection == -1);\n const getResearchDateSelection = this.getSelectedResearchInfo.filter(o => o.dateSelection == -1);\n const getForeignDateSelection = this.getSelectedForeignInfo.filter(o => o.dateSelection == -1);\n const getSelectedAlgoSvInfo = this.getSelectedAlgoServerInfo.filter(o => o.dateSelection == -1);\n\n if (getEveryDateSelection.length > 0 || getResearchDateSelection.length > 0 || getForeignDateSelection.length > 0 || getSelectedAlgoSvInfo.length > 0) {\n this.$toast.error(\"Başlangıç zamanı seçiniz.\");\n this.isButtonClicked = false;\n return;\n }\n\n const researchData = this.buildResearchData();\n const foreignData = this.buildForeignData();\n const algoServerData = this.buildAlgoServerData();\n const args = this.buildArgsObject(packageData, researchData, foreignData, algoServerData);\n const actionName = this.getActionName();\n const sendAction = await this[actionName](args);\n\n if (sendAction.error) {\n this.handleError(sendAction);\n } else {\n this.handleSuccess(sendAction, actionName);\n this.args = {};\n }\n },\n\n buildPackageData() {\n return this.selectData.map(item => {\n var _this$dataItem4, _this$dataItem4$appli, _this$dataItem5, _this$dataItem5$platf, _item$marketFeature, _item$perspectiveFeat, _item$vendorFeature, _item$vendorFeature2, _item$vendorFeature3;\n\n return {\n applicationId: (_this$dataItem4 = this.dataItem) === null || _this$dataItem4 === void 0 ? void 0 : (_this$dataItem4$appli = _this$dataItem4.application) === null || _this$dataItem4$appli === void 0 ? void 0 : _this$dataItem4$appli.id,\n platformId: ((_this$dataItem5 = this.dataItem) === null || _this$dataItem5 === void 0 ? void 0 : (_this$dataItem5$platf = _this$dataItem5.platform) === null || _this$dataItem5$platf === void 0 ? void 0 : _this$dataItem5$platf.id) || null,\n marketId: (item === null || item === void 0 ? void 0 : (_item$marketFeature = item.marketFeature) === null || _item$marketFeature === void 0 ? void 0 : _item$marketFeature.id) || null,\n perspectiveId: (item === null || item === void 0 ? void 0 : (_item$perspectiveFeat = item.perspectiveFeature) === null || _item$perspectiveFeat === void 0 ? void 0 : _item$perspectiveFeat.id) || null,\n vendorId: (item === null || item === void 0 ? void 0 : (_item$vendorFeature = item.vendorFeature) === null || _item$vendorFeature === void 0 ? void 0 : _item$vendorFeature.id) === undefined || (item === null || item === void 0 ? void 0 : (_item$vendorFeature2 = item.vendorFeature) === null || _item$vendorFeature2 === void 0 ? void 0 : _item$vendorFeature2.id) === null ? null : item === null || item === void 0 ? void 0 : (_item$vendorFeature3 = item.vendorFeature) === null || _item$vendorFeature3 === void 0 ? void 0 : _item$vendorFeature3.id,\n dateSelection: item.dateSelection\n };\n });\n },\n\n buildResearchData() {\n return this.getSelectedResearchInfo.map(item => ({\n applicationId: this.dataItem.application.id || null,\n researchId: item.id || null,\n dateSelection: item.dateSelection\n }));\n },\n\n buildForeignData() {\n return this.getSelectedForeignInfo.map(item => ({\n applicationId: this.dataItem.application.id,\n foreignIndiceId: item.id || null,\n dateSelection: item.dateSelection\n }));\n },\n\n buildAlgoServerData() {\n return this.getSelectedAlgoServerInfo.map(item => ({\n applicationId: this.dataItem.application.id,\n algorithmAndServerId: item.id || null,\n dateSelection: item.dateSelection\n }));\n },\n\n buildArgsObject(packageData, researchData, foreignData, algoServerData) {\n var _this$dataItem6, _this$dataItem6$appli, _this$dataItem7, _this$dataItem7$platf, _this$dataItem8, _this$dataItem9, _this$dataItem9$platf;\n\n return {\n customerId: this.customer.id,\n purchaseId: this.dataItem.id,\n purchaseNumber: this.dataItem.purchaseNo.toString(),\n applicationId: ((_this$dataItem6 = this.dataItem) === null || _this$dataItem6 === void 0 ? void 0 : (_this$dataItem6$appli = _this$dataItem6.application) === null || _this$dataItem6$appli === void 0 ? void 0 : _this$dataItem6$appli.applicationId) || null,\n platformId: ((_this$dataItem7 = this.dataItem) === null || _this$dataItem7 === void 0 ? void 0 : (_this$dataItem7$platf = _this$dataItem7.platform) === null || _this$dataItem7$platf === void 0 ? void 0 : _this$dataItem7$platf.platformId) || null,\n applicationFeatureId: ((_this$dataItem8 = this.dataItem) === null || _this$dataItem8 === void 0 ? void 0 : _this$dataItem8.application.id) || null,\n platformFeatureId: (_this$dataItem9 = this.dataItem) === null || _this$dataItem9 === void 0 ? void 0 : (_this$dataItem9$platf = _this$dataItem9.platform) === null || _this$dataItem9$platf === void 0 ? void 0 : _this$dataItem9$platf.id,\n features: packageData,\n research: researchData,\n foreignIndice: foreignData,\n algorithmAndServer: algoServerData,\n cusId: this.cusId\n };\n },\n\n getActionName() {\n return this.dataItem.packageStatus.id === 2 ? \"updatePackage\" : \"createPackage\";\n },\n\n handleError(res) {\n if (res.result !== undefined && res.result !== null) {\n this.$toast.error(res.result.data[0].errors[0]);\n } else {\n this.$toast.error(res.message);\n }\n\n this.isButtonClicked = false;\n },\n\n handleSuccess(res, actionName) {\n if (actionName === \"updatePackage\") {\n this.handleUpdatePackageSuccess(res);\n } else {\n this.handleCreatePackageSuccess(res);\n }\n },\n\n async handleUpdatePackageSuccess() {\n const response = await this.getDraftPackageDetail([this.dataItem.id, this.cusId]);\n setTimeout(() => {\n console.log(this.$route.name);\n console.log(this.$route.path);\n this.$router.push({\n name: \"Checkout\",\n params: {\n packageNumber: response.data.id,\n customerNumber: this.$route.params.customerNumber\n },\n query: {\n c: this.$route.query.c || this.cusId,\n timeStamp: new Date()\n }\n });\n }, 300);\n },\n\n handleCreatePackageSuccess(res) {\n if (this.$route.name === \"Checkout\") {\n this.$router.push({\n name: \"Checkout\",\n params: {\n packageNumber: res.purchaseId,\n customerNumber: this.$route.params.customerNumber\n },\n query: {\n c: this.$route.query.c\n }\n });\n } else {\n this.$emit(\"close\");\n this.getAllPackages(this.cusId);\n }\n\n this.setSelectedResearch([]);\n this.setSelectedForeign([]);\n this.setSelectedAlgoServer([]);\n },\n\n calculatePrice(items) {\n var _this$dataItem$applic, _this$dataItem$applic2;\n\n this.bottomFund = items.reduce((totald, item) => {\n var _item$marketFeature2, _item$perspectiveFeat2, _item$vendorFeature4;\n\n return ((item === null || item === void 0 ? void 0 : (_item$marketFeature2 = item.marketFeature) === null || _item$marketFeature2 === void 0 ? void 0 : _item$marketFeature2.fundAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$perspectiveFeat2 = item.perspectiveFeature) === null || _item$perspectiveFeat2 === void 0 ? void 0 : _item$perspectiveFeat2.fundAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$vendorFeature4 = item.vendorFeature) === null || _item$vendorFeature4 === void 0 ? void 0 : _item$vendorFeature4.fundAmount) || 0) + totald;\n }, (_this$dataItem$applic = this.dataItem.application) === null || _this$dataItem$applic === void 0 ? void 0 : _this$dataItem$applic.fundAmount);\n this.bottomCommission = items.reduce((totald, item) => {\n var _item$marketFeature3, _item$perspectiveFeat3, _item$vendorFeature5;\n\n return ((item === null || item === void 0 ? void 0 : (_item$marketFeature3 = item.marketFeature) === null || _item$marketFeature3 === void 0 ? void 0 : _item$marketFeature3.commissionAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$perspectiveFeat3 = item.perspectiveFeature) === null || _item$perspectiveFeat3 === void 0 ? void 0 : _item$perspectiveFeat3.commissionAmount) || 0) + ((item === null || item === void 0 ? void 0 : (_item$vendorFeature5 = item.vendorFeature) === null || _item$vendorFeature5 === void 0 ? void 0 : _item$vendorFeature5.commissionAmount) || 0) + totald;\n }, (_this$dataItem$applic2 = this.dataItem.application) === null || _this$dataItem$applic2 === void 0 ? void 0 : _this$dataItem$applic2.commissionAmount);\n const total = items.reduce((totald, item) => {\n var _item$perspectiveFeat4, _item$vendorFeature6;\n\n return (\n /* (item?.marketFeature?.price || 0) +\n (item?.platformFeature?.price || 0)*/\n +((item === null || item === void 0 ? void 0 : (_item$perspectiveFeat4 = item.perspectiveFeature) === null || _item$perspectiveFeat4 === void 0 ? void 0 : _item$perspectiveFeat4.price) || 0) + ((item === null || item === void 0 ? void 0 : (_item$vendorFeature6 = item.vendorFeature) === null || _item$vendorFeature6 === void 0 ? void 0 : _item$vendorFeature6.price) || 0) + totald\n );\n }, 0);\n this.totalPrice = total + this.dataItem.application.price;\n },\n\n calculateTotalPrice() {\n return this.dataItem.price + this.totalPrice + this.researchTotal() + this.foraignTurkishLiraTotal() + this.algoServerTotal();\n }\n\n },\n watch: {\n selectData: {\n handler(newVal) {\n this.calculatePrice(newVal);\n },\n\n deep: true,\n immediate: true\n }\n }\n});\n\n//# sourceURL=webpack://OsmanliPackage/./src/components/customer/PackageSettigns.vue?./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options");
1708
1708
 
1709
1709
  /***/ }),
1710
1710
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "osmanli-veri-dagitim",
3
- "version": "2.1.09-dev",
3
+ "version": "2.1.11-dev",
4
4
  "main": "./dist/OsmanliPackage.umd.min.js?version=2.0.90",
5
5
  "files": [
6
6
  "dist"