{"version":3,"sources":["webpack:///resources/js/src/app/components/item/VariationSelect.vue","webpack:///./node_modules/core-js/internals/object-to-array.js","webpack:///./node_modules/core-js/modules/es.object.entries.js","webpack:///./node_modules/core-js/modules/es.object.values.js","webpack:///./resources/js/src/app/components/item/VariationSelect.vue?ea6c","webpack:///./resources/js/src/app/components/item/VariationSelect.vue","webpack:///./resources/js/src/app/components/item/VariationSelect.vue?7032","webpack:///./resources/js/src/app/components/item/VariationSelect.vue?65d9"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+FA;AACA;;AAEA;;AAEA;AAEA,0BAFA;AAIA;AACA,kBACA;AACA,mBADA;AAEA;AAFA;AAFA,GAJA;AAYA;AACA;AACA;AADA;AADA,GAZA;AAkBA,MAlBA,kBAmBA;AACA;AACA,iCADA;AAEA;AAFA;AAIA,GAxBA;AA0BA,SA1BA,qBA2BA;AACA;AACA;AACA,GA9BA;AAgCA,YACA;AACA,oBADA,8BACA;AACA;AACA,KAHA;AAKA,0BALA,oCAKA;AACA;AACA,KAPA;;AASA;AACA;AACA;AACA,kBAZA,4BAaA;AACA;AAAA;AAAA;AACA,KAfA;AAiBA,yBAjBA,mCAkBA;AACA;AACA,KApBA;;AAsBA;AACA;AACA;AACA;AACA,oBA1BA,8BA2BA;AACA;;AAEA,2CACA;AACA;AACA;;AAEA;AACA,KApCA;;AAsCA;AACA;AACA;AACA;AACA,iBA1CA,2BA2CA;AACA;AACA;AACA;;AAHA,iDAKA,UALA;AAAA;;AAAA;AAKA,4DACA;AAAA,cADA,SACA;AACA;AACA;AARA;AAAA;AAAA;AAAA;AAAA;;AAUA;AACA,KAtDA;AAwDA,8BA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AAClC;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACTD;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,qBAAqB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,qDAAqD;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,gDAAgD,YAAY,YAAY,EAAE;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA,2BAA2B,SAAS,oCAAoC,EAAE;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA,gDAAgD,sBAAsB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA,gDAAgD,sBAAsB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA,kDAAkD,sBAAsB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,2BAA2B,yCAAyC;AACpE,6BAA6B,4BAA4B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AC5bA;AAAA;AAAA;AAAA;AAA8F;AAC3B;AACL;;;AAG9D;AACsG;AACtG,gBAAgB,2GAAU;AAC1B,EAAE,qFAAM;AACR,EAAE,0FAAM;AACR,EAAE,mGAAe;AACjB;AACA;AACA;AACA;;AAEA;;AAEA;AACA,IAAI,KAAU,EAAE,YAiBf;AACD;AACe,gF;;;;;;;;;;;;ACtCf;AAAA;AAAA,wCAAuM,CAAgB,mPAAG,EAAC,C;;;;;;;;;;;;ACA3N;AAAA;AAAA;AAAA;AAAA;AAAA","file":"chunks/ceres-13.js","sourcesContent":["<template>\n    <div class=\"row\">\n        <template v-if=\"attributes.length || (possibleUnitCombinationIds.length > 1 && isContentVisible)\">\n            <div class=\"col-12 variation-select\" v-for=\"(attribute, index) in attributes\" :key=\"index\">\n                <!-- dropdown -->\n                <div class=\"input-unit\" ref=\"attributesContaner\" v-if=\"attribute.type === 'dropdown'\">\n                    <select :id=\"'custom-select_' + attribute.name\" class=\"custom-select\" @change=\"selectAttribute(attribute.attributeId, $event.target.value)\" data-testing=\"variation-select-dropdown\">\n                        <option :value=\"-1\" v-if=\"addPleaseSelectOption || !hasSelection\">{{ $translate(\"Ceres::Template.singleItemPleaseSelect\") }}</option>\n                        <option\n                                :value=\"null\" v-if=\"hasEmptyOption || selectedAttributes[attribute.attributeId] === null\"\n                                :selected=\"selectedAttributes[attribute.attributeId] === null\">{{ $translate(\"Ceres::Template.singleItemNoSelection\") }}</option>\n                        <option\n                                v-for=\"value in attribute.values\"\n                                :value=\"value.attributeValueId\"\n                                :selected=\"value.attributeValueId === selectedAttributes[attribute.attributeId]\"\n                                :key=\"value.attributeValueId\">\n                            <template v-if=\"isAttributeSelectionValid(attribute.attributeId, value.attributeValueId, true)\">\n                                {{ value.name }}\n                            </template>\n                            <template v-else-if=\"isAttributeSelectionValid(attribute.attributeId, value.attributeValueId, false)\">\n                                {{ $translate(\"Ceres::Template.singleItemNotSalableAttribute\", { \"name\": value.name }) }}\n                            </template>\n                            <template v-else>\n                                {{ $translate(\"Ceres::Template.singleItemInvalidAttribute\", { \"name\": value.name }) }}\n                            </template>\n                        </option>\n                    </select>\n                    <label :for=\"'custom-select_' + attribute.name\" v-tooltip=\"isTextCut(attribute.name)\" data-toggle=\"tooltip\" data-placement=\"top\" :title=\"attribute.name\" data-testing=\"variation-select-dropdown-label\">{{ attribute.name }}</label>\n                </div>\n                <!-- /dropdown -->\n\n                <!-- box and image -->\n                <div v-else-if=\"attribute.type === 'box' || attribute.type === 'image'\">\n                    <span class=\"text-muted\" data-testing=\"attribute-name\">{{ attribute.name }}:</span> <b data-testing=\"attribute-value\">{{ getSelectedAttributeValueName(attribute) }}</b>\n                    <div class=\"v-s-boxes py-3\" :class=\"{ 'images': attribute.type === 'image' }\">\n                        <div class=\"v-s-box bg-white empty-option\"\n                             data-testing=\"variation-select-box\"\n                             v-if=\"addPleaseSelectOption\"\n                             @click=\"selectAttribute(attribute.attributeId, -1)\"\n                             :class=\"{ 'active': selectedAttributes[attribute.attributeId] === -1, 'invalid': !isAttributeSelectionValid(attribute.attributeId, -1) }\">\n                            <span class=\"mx-3\">{{ $translate(\"Ceres::Template.singleItemPleaseSelect\") }}</span>\n                        </div>\n                        <div class=\"v-s-box bg-white empty-option\"\n                             data-testing=\"variation-select-box\"\n                             v-if=\"hasEmptyOption\"\n                             @click=\"selectAttribute(attribute.attributeId, null)\"\n                             :class=\"{ 'active': selectedAttributes[attribute.attributeId] === null, 'invalid': !isAttributeSelectionValid(attribute.attributeId, null, true) }\">\n                            <span class=\"mx-3\">{{ $translate(\"Ceres::Template.singleItemNoSelection\") }}</span>\n                        </div>\n\n                        <div class=\"v-s-box bg-white\"\n                             data-testing=\"variation-select-box\"\n                             v-for=\"value in attribute.values\"\n                             @click=\"selectAttribute(attribute.attributeId, value.attributeValueId)\"\n                             :class=\"{ 'active': value.attributeValueId === selectedAttributes[attribute.attributeId], 'invalid': !isAttributeSelectionValid(attribute.attributeId, value.attributeValueId, true) }\"\n                             v-tooltip=\"true\" data-html=\"true\" data-toggle=\"tooltip\" data-placement=\"top\" :data-original-title=\"getTooltip(attribute, value)\"\n                             :key=\"value.attributeValueId\">\n                            <span class=\"mx-3\" v-if=\"attribute.type === 'box'\">{{ value.name }}</span>\n                            <img class=\"p-1\" v-else :src=\"value.imageUrl\" :alt=\"value.name\">\n                        </div>\n                    </div>\n                </div>\n                <!-- /box and image -->\n            </div>\n\n            <!-- units -->\n            <div class=\"col-12 variation-select\" v-if=\"possibleUnitCombinationIds.length > 1 && isContentVisible\">\n                <div class=\"input-unit\">\n                    <select id=\"unit-combination-ids-select\" class=\"custom-select\" @change=\"selectUnit($event.target.value)\" data-testing=\"variation-select-unit\">\n                        <option\n                                v-for=\"unitCombinationId in possibleUnitCombinationIds\"\n                                :value=\"unitCombinationId\"\n                                :selected=\"parseInt(unitCombinationId) === selectedUnit\"\n                                :key=\"unitCombinationId\">\n                            <template v-if=\"isUnitSelectionValid(unitCombinationId)\">\n                                {{ possibleUnits[unitCombinationId] }}\n                            </template>\n                            <template v-else>\n                                {{ $translate(\"Ceres::Template.singleItemInvalidAttribute\", { \"name\": possibleUnits[unitCombinationId] }) }}\n                            </template>\n                        </option>\n                    </select>\n                    <label for=\"unit-combination-ids-select\" data-testing=\"variation-select-unit-label\">{{ $translate(\"Ceres::Template.singleItemContent\") }}</label>\n                </div>\n            </div>\n            <!-- /units -->\n        </template>\n\n        <template v-else>\n            <slot></slot>\n        </template>\n    </div>\n</template>\n\n<script>\nimport { textWidth } from \"../../helper/dom\";\nimport { isDefined, isNull, isNullOrUndefined } from \"../../helper/utils\";\n\nconst NotificationService = require(\"../../services/NotificationService\");\n\nexport default {\n\n    name: \"variation-select\",\n\n    props: {\n        forceContent:\n        {\n            type: Boolean,\n            default: false\n        }\n    },\n\n    inject: {\n        itemId: {\n            default: null\n        }\n    },\n\n    data()\n    {\n        return {\n            filteredVariationsCache: {},\n            lastContentCount: 0\n        };\n    },\n\n    mounted()\n    {\n        // initially check for valid selection and disable add to basket button\n        this.$store.commit(`${this.itemId}/variationSelect/setIsVariationSelected`, !!this.currentSelection);\n    },\n\n    computed:\n    {\n        currentVariation() {\n            return this.$store.getters[`${this.itemId}/currentItemVariation`];\n        },\n\n        currentVariationSelect() {\n            return this.$store.state.items[this.itemId] && this.$store.state.items[this.itemId].variationSelect;\n        },\n\n        /**\n         * returns true if any variation has no attributes\n         */\n        hasEmptyOption()\n        {\n            return this.variations.some(variation => !variation.attributes.length);\n        },\n\n        addPleaseSelectOption()\n        {\n            return App.config.item.showPleaseSelect;\n        },\n\n        /**\n         * returns the variation, based on the selected attributes / unit\n         * returns false if there are none or multiple results\n         */\n        currentSelection()\n        {\n            const filteredVariations = this.filterVariations(null, null, true);\n\n            if (filteredVariations.length === 1)\n            {\n                return filteredVariations[0];\n            }\n\n            return false;\n        },\n\n        /**\n         * returns all units, selectable by current selection\n         * prop 'forceContent' with value true will return all units, without filtering\n         */\n        possibleUnits()\n        {\n            // use an object, to make the entries unique\n            const possibleUnits = {};\n            const variations = this.forceContent ? this.variations : this.filterVariations(null, null, null, true);\n\n            for (const variation of variations)\n            {\n                possibleUnits[variation.unitCombinationId] = variation.unitName;\n            }\n\n            return possibleUnits;\n        },\n\n        possibleUnitCombinationIds()\n        {\n            return this.transformPossibleUnits(this.possibleUnits).map(value => value[0]);\n        },\n\n        isContentVisible()\n        {\n            return !this.forceContent && !!this.currentSelection || this.forceContent;\n        },\n\n        hasSelection()\n        {\n            return !isNullOrUndefined(this.selectedAttributes) && !Object.values(this.selectedAttributes).some((value) => value < 0);\n        },\n\n        attributes() {\n            return this.currentVariationSelect && this.currentVariationSelect.attributes;\n        },\n\n        selectedAttributes() {\n            return this.currentVariationSelect && this.currentVariationSelect.selectedAttributes;\n        },\n\n        selectedUnit() {\n            return this.currentVariationSelect && this.currentVariationSelect.selectedUnit;\n        },\n\n        variations() {\n            return this.currentVariationSelect && this.currentVariationSelect.variations;\n        }\n    },\n\n    methods:\n    {\n        /**\n         * select an attribute and check, if the selection is valid; if not, unsetInvalidSelection will be executed\n         * @param {number} attributeId\n         * @param {[number, string, null]} attributeValueId\n         */\n        selectAttribute(attributeId, attributeValueId)\n        {\n            attributeValueId = parseInt(attributeValueId) || null;\n\n            if (this.selectedAttributes[attributeId] !== attributeValueId)\n            {\n                this.$store.commit(`${this.itemId}/variationSelect/selectItemAttribute`, { attributeId, attributeValueId });\n                this.onSelectionChange(attributeId, attributeValueId, null);\n            }\n        },\n\n        /**\n         * select a unit and check, if the selection is valid; if not, unsetInvalidSelection will be executed\n         * @param {[number, string]} unitId\n         */\n        selectUnit(unitId)\n        {\n            unitId = parseInt(unitId);\n            this.$store.commit(`${this.itemId}/variationSelect/selectItemUnit`, unitId);\n            this.onSelectionChange(null, null, unitId);\n        },\n\n        onSelectionChange(attributeId, attributeValueId, unitId)\n        {\n            if (this.currentSelection)\n            {\n                this.setVariation(this.currentSelection.variationId);\n            }\n            else if (!this.hasSelection)\n            {\n                // user switched back to \"please select\"\n                this.setVariation(0);\n            }\n            else\n            {\n                this.unsetInvalidSelection(attributeId, attributeValueId, unitId);\n            }\n\n            this.lastContentCount = this.possibleUnitCombinationIds.length;\n        },\n\n        /**\n         * changes the selected attributes / unit, to ensure a valid seelction\n         * @param {[number, null]} attributeId\n         * @param {[number, null]} attributeValueId\n         * @param {[number, null]} unitId\n         */\n        unsetInvalidSelection(attributeId, attributeValueId, unitId)\n        {\n            const qualifiedVariations = this.getQualifiedVariations(attributeId, attributeValueId, unitId);\n            const closestVariations = this.getClosestVariations(qualifiedVariations);\n\n            // if the salable 'closestVariations' is undefined, take the not-salable one\n            const closestVariation = closestVariations[0] || closestVariations[1];\n\n            if (!closestVariation)\n            {\n                return;\n            }\n\n            const invalidSelection = this.getInvalidSelectionByVariation(closestVariation);\n\n            this.correctSelection(invalidSelection);\n        },\n\n        getTooltip(attribute, attributeValue)\n        {\n            if(!this.isAttributeSelectionValid(attribute.attributeId, attributeValue.attributeValueId, true))\n            {\n                return this.getInvalidOptionTooltip(attribute.attributeId, attributeValue.attributeValueId);\n            }\n            else if(attribute.type === \"image\")\n            {\n                return this.$translate(\"Ceres::Template.singleItemAttributeTooltip\", {\n                    attribute: attribute.name,\n                    value: attributeValue.name\n                });\n            }\n\n            return \"\";\n        },\n\n        /**\n         * returns a string for box tooltips, for not available options\n         * @param {number} attributeId\n         * @param {number} attributeValueId\n         */\n        getInvalidOptionTooltip(attributeId, attributeValueId)\n        {\n            const qualifiedVariations = this.getQualifiedVariations(attributeId, attributeValueId);\n            const closestVariations   = this.getClosestVariations(qualifiedVariations);\n\n            if (!closestVariations || closestVariations.length <= 0)\n            {\n                return \"\";\n            }\n\n            const invalidSelections = [\n                !!closestVariations[0] ? this.getInvalidSelectionByVariation(closestVariations[0]) : null,\n                !!closestVariations[1] ? this.getInvalidSelectionByVariation(closestVariations[1]) : null\n            ];\n\n            if (!!invalidSelections[0]\n                && !!invalidSelections[1]\n                && invalidSelections[0].attributesToReset.length > invalidSelections[1].attributesToReset.length)\n            {\n                // there is a non-salable variation with less changes\n                return this.$translate(\"Ceres::Template.singleItemNotSalable\");\n            }\n\n            const invalidSelection = invalidSelections[0] || invalidSelections[1];\n            const names = [];\n\n            for (const attribute of invalidSelection.attributesToReset)\n            {\n                if (attribute.attributeId !== attributeId)\n                {\n                    names.push(\"<b>\" + attribute.name +\"</b>\");\n                }\n            }\n            if (invalidSelection.newUnit)\n            {\n                names.push(\n                    \"<b>\" + this.$translate(\"Ceres::Template.singleItemContent\") + \"</b>\"\n                );\n            }\n\n            if (!names.length)\n            {\n                return null;\n            }\n\n            return this.$translate(\"Ceres::Template.singleItemNotAvailableInSelection\", { name: names.join(\", \") });\n        },\n\n        /**\n         * returns a list of variations, filtered by attribute or unit\n         * @param {[number, null]} attributeId\n         * @param {[number, null]} attributeValueId\n         * @param {[number, null]} unitId\n         */\n        getQualifiedVariations(attributeId, attributeValueId, unitId)\n        {\n            if (isDefined(attributeValueId))\n            {\n                return this.variations.filter(variation =>\n                {\n                    return isDefined(variation.attributes.find(attribute =>\n                        attribute.attributeId === attributeId && attribute.attributeValueId === attributeValueId));\n                });\n            }\n            else if (isDefined(unitId))\n            {\n                return this.variations.filter(variation => variation.unitCombinationId === unitId);\n            }\n\n            return this.variations.filter(variation => !variation.attributes.length);\n        },\n\n        /**\n         * return a salable and a non-salable variation with the minimum number of changes on attributes compared to the current selection.\n         * @param {array} qualifiedVariations\n         */\n        getClosestVariations(qualifiedVariations)\n        {\n            let closestSalableVariation, numberOfSalableChanges;\n            let closestNonSalableVariation, numberOfNonSalableChanges;\n\n            for (const variation of qualifiedVariations)\n            {\n                let changes = 0;\n\n                if (variation.unitCombinationId !== this.selectedUnit && !isNull(this.selectedUnit))\n                {\n                    // when the unit dropdown isn't visible, it should have a lower weight for reset investigations\n                    const unitWeight = this.possibleUnitCombinationIds.length > 1 && this.isContentVisible ? 0.9 : 0.1;\n\n                    changes += unitWeight;\n                }\n\n                for (const attribute of variation.attributes)\n                {\n                    if (this.selectedAttributes[attribute.attributeId] !== attribute.attributeValueId)\n                    {\n                        changes++;\n                    }\n                }\n\n                if(variation.isSalable && (!numberOfSalableChanges || changes < numberOfSalableChanges))\n                {\n                    closestSalableVariation = variation;\n                    numberOfSalableChanges = changes;\n                }\n                else if (!variation.isSalable && (!numberOfNonSalableChanges || changes < numberOfNonSalableChanges))\n                {\n                    closestNonSalableVariation = variation;\n                    numberOfNonSalableChanges = changes;\n                }\n            }\n\n            return [closestSalableVariation, closestNonSalableVariation];\n        },\n\n        /**\n         * returns object with array 'attributesToReset' and newUnit. The attributesToReset contains all attributes, which are not matching with the given variation\n         * @param {object} variation\n         */\n        getInvalidSelectionByVariation(variation)\n        {\n            const attributesToReset = [];\n            let newUnit = null;\n\n            for (let selectedAttributeId in this.selectedAttributes)\n            {\n                selectedAttributeId = parseInt(selectedAttributeId);\n                const variationAttribute = variation.attributes.find(attribute => attribute.attributeId === selectedAttributeId);\n\n                if (!isNull(this.selectedAttributes[selectedAttributeId]))\n                {\n                    if (variationAttribute && variationAttribute.attributeValueId !== this.selectedAttributes[selectedAttributeId] || !variationAttribute)\n                    {\n                        const attributeToReset = this.attributes.find(attr => attr.attributeId === selectedAttributeId);\n\n                        attributesToReset.push(attributeToReset);\n                    }\n                }\n            }\n\n            if (variation.unitCombinationId !== this.selectedUnit)\n            {\n                newUnit = variation.unitCombinationId;\n            }\n\n            return { attributesToReset, newUnit };\n        },\n\n        /**\n         * resets all invalid attributes and change the unit, if required. Prints a message to the user if so.\n         * @param {object} invalidSelection\n         */\n        correctSelection(invalidSelection)\n        {\n            const messages   = [];\n            const attributes = JSON.parse(JSON.stringify(this.selectedAttributes));\n\n            for (const attributeToReset of invalidSelection.attributesToReset)\n            {\n                messages.push(\n                    this.$translate(\"Ceres::Template.singleItemNotAvailable\", { name: attributeToReset.name })\n                );\n\n                attributes[attributeToReset.attributeId] = (!this.hasEmptyOption && App.config.item.showPleaseSelect) ? -1 : null;\n            }\n\n            if (invalidSelection.newUnit)\n            {\n                if (this.lastContentCount > 1 && this.possibleUnitCombinationIds.length > 1 && !isNull(this.selectedUnit))\n                {\n                    messages.push(\n                        this.$translate(\"Ceres::Template.singleItemNotAvailable\", { name:\n                                this.$translate(\"Ceres::Template.singleItemContent\")\n                        })\n                    );\n                }\n\n                this.$store.commit(`${this.itemId}/variationSelect/selectItemUnit`, invalidSelection.newUnit);\n            }\n\n            this.$store.commit(`${this.itemId}/variationSelect/setItemSelectedAttributes`, attributes);\n\n            this.setVariation(this.currentSelection ? this.currentSelection.variationId : 0);\n\n            NotificationService.warn(\n                messages.join(\"<br>\")\n            ).closeAfter(5000);\n        },\n\n        /**\n         * returns matching variations with current selection\n         * attributes and unitId could be filled, to check a specific selection\n         * @param {object} attributes\n         * @param {number} unitId\n         * @param {boolean} strict\n         */\n        filterVariations(attributes, unitId, strict, ignoreUnit)\n        {\n            attributes = attributes || this.selectedAttributes;\n            unitId = unitId || this.selectedUnit;\n            strict = !!strict;\n            ignoreUnit = !!ignoreUnit;\n\n            const key = JSON.stringify(attributes) + \"_\" + unitId + \"_\" + strict + \"_\" + ignoreUnit;\n\n            if (isDefined(this.filteredVariationsCache[key]))\n            {\n                return this.filteredVariationsCache[key];\n            }\n\n            const uniqueValues = [...new Set(Object.values(attributes))];\n            const isEmptyOptionSelected = uniqueValues.length === 1 && isNull(uniqueValues[0]);\n            const filteredVariations = this.variations.filter(variation =>\n            {\n                // the selected unit is not matching\n                if (!ignoreUnit && variation.unitCombinationId !== unitId)\n                {\n                    return false;\n                }\n\n                // the variation has no attributes (only checked, if any attribute has a selected value); or the variation has attributes and empty option is selected\n                // requires more than 0 attributes\n                if (((!isEmptyOptionSelected && !variation.attributes.length) || (isEmptyOptionSelected && variation.attributes.length))\n                    && this.attributes.length > 0)\n                {\n                    return false;\n                }\n\n                for (const attributeId in attributes)\n                {\n                    const variationAttribute = variation.attributes.find(variationAttribute =>\n                        variationAttribute.attributeId === parseInt(attributeId));\n\n                    // an attribute is not matching with selection\n                    if (variationAttribute &&\n                        variationAttribute.attributeValueId !== attributes[attributeId] &&\n                        (strict || !strict && !isNull(attributes[attributeId]) && attributes[attributeId] !== -1))\n                    {\n                        return false;\n                    }\n                }\n\n                return true;\n            });\n\n            this.filteredVariationsCache[key] = filteredVariations;\n\n            return filteredVariations;\n        },\n\n        /**\n         * returns true, if the selection with a new attribute value would be valid\n         * @param {number} attributeId\n         * @param {[number, string, null]} attributeValueId\n         * @param {boolean} filterSalableVariations\n         */\n        isAttributeSelectionValid(attributeId, attributeValueId, filterSalableVariations)\n        {\n            attributeValueId = parseInt(attributeValueId) || null;\n            if (this.selectedAttributes[attributeId] === attributeValueId)\n            {\n                return true;\n            }\n\n            const selectedAttributes = JSON.parse(JSON.stringify(this.selectedAttributes));\n\n            selectedAttributes[attributeId] = parseInt(attributeValueId) || null;\n\n            const ignoreUnit = !(Object.keys(this.possibleUnits).length > 1 && this.isContentVisible);\n            let variations = this.filterVariations(selectedAttributes, null, null, ignoreUnit);\n\n            if (filterSalableVariations)\n            {\n                variations = variations.filter(variation => variation.isSalable)\n            }\n\n            return variations.length > 0;\n        },\n\n        /**\n         * returns true, if the selection with a new unitId would be valid\n         * @param {[number, string]} unitId\n         */\n        isUnitSelectionValid(unitId)\n        {\n            unitId = parseInt(unitId);\n            if (this.selectedUnit === unitId)\n            {\n                return true;\n            }\n\n            return this\n                .filterVariations(null, unitId)\n                .filter(variation => variation.isSalable)\n                .length > 0\n        },\n\n        /**\n         * dispatch vuex action 'loadVariation' to archive a variation\n         * dispatches a custom event named 'onVariationChanged'\n         * @param {[string, number, null]} variationId\n         */\n        setVariation(variationId)\n        {\n            if (!isDefined(variationId) && this.currentSelection)\n            {\n                variationId = this.currentSelection.variationId;\n            }\n\n            if (isDefined(variationId))\n            {\n                this.$store.dispatch(`${this.itemId}/loadVariation`, variationId).then(variation =>\n                {\n                    document.dispatchEvent(new CustomEvent(\"onVariationChanged\",\n                        {\n                            detail:\n                                {\n                                    attributes: variation.attributes,\n                                    documents: variation.documents,\n                                    itemId: this.itemId\n                                }\n                        }));\n                });\n            }\n        },\n\n        isTextCut(content)\n        {\n            if (this.$refs.attributesContaner)\n            {\n                return textWidth(content, \"Custom-Font, Helvetica, Arial, sans-serif\") > this.$refs.attributesContaner[0].clientWidth;\n            }\n\n            return false;\n        },\n\n        getSelectedAttributeValueName(attribute)\n        {\n            const selectedAttributeValueId =  this.selectedAttributes[attribute.attributeId];\n            const selectedAttributeValue = attribute.values.find(attrValue => attrValue.attributeValueId === selectedAttributeValueId);\n\n            if (selectedAttributeValue)\n            {\n                return selectedAttributeValue.name;\n            }\n            else if (App.config.item.showPleaseSelect && selectedAttributeValueId === -1)\n            {\n                return this.$translate(\"Ceres::Template.singleItemPleaseSelect\");\n            }\n            return this.$translate(\"Ceres::Template.singleItemNoSelection\");\n        },\n\n        transformPossibleUnits(possibleUnits)\n        {\n            return Object.entries(possibleUnits).sort((unitA, unitB) => {\n                unitA = this.splitUnitName(unitA[1]);\n                unitB = this.splitUnitName(unitB[1]);\n                // order by unit\n                if (unitA[1] < unitB[1]) {\n                    return -1;\n                }\n                if (unitA[1] > unitB[1]) {\n                    return 1;\n                }\n                // order by content (count)\n                if (unitA[0] < unitB[0]) {\n                    return -1;\n                }\n                if (unitA[0] > unitB[0]) {\n                    return 1;\n                }\n                return 0;\n            });\n        },\n        splitUnitName(unitName) {\n            const unitNameSplit = unitName.split(\" \");\n\n            if (!isNaN(unitNameSplit[0])) {\n                unitNameSplit[0] = unitNameSplit[0].replace(App.currencyPattern.separator_thousands, \"\");\n                unitNameSplit[0] = parseInt(unitNameSplit[0]);\n            }\n\n            return unitNameSplit;\n        }\n    },\n\n    watch:\n    {\n        currentSelection(value)\n        {\n            this.$store.commit(`${this.itemId}/variationSelect/setIsVariationSelected`, !!value);\n        },\n        variations()\n        {\n            // FIX unset variation cache after subsequent variations are loaded\n            this.filteredVariationsCache = {};\n        }\n    }\n}\n</script>\n","var DESCRIPTORS = require('../internals/descriptors');\nvar objectKeys = require('../internals/object-keys');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar propertyIsEnumerable = require('../internals/object-property-is-enumerable').f;\n\n// `Object.{ entries, values }` methods implementation\nvar createMethod = function (TO_ENTRIES) {\n  return function (it) {\n    var O = toIndexedObject(it);\n    var keys = objectKeys(O);\n    var length = keys.length;\n    var i = 0;\n    var result = [];\n    var key;\n    while (length > i) {\n      key = keys[i++];\n      if (!DESCRIPTORS || propertyIsEnumerable.call(O, key)) {\n        result.push(TO_ENTRIES ? [key, O[key]] : O[key]);\n      }\n    }\n    return result;\n  };\n};\n\nmodule.exports = {\n  // `Object.entries` method\n  // https://tc39.es/ecma262/#sec-object.entries\n  entries: createMethod(true),\n  // `Object.values` method\n  // https://tc39.es/ecma262/#sec-object.values\n  values: createMethod(false)\n};\n","var $ = require('../internals/export');\nvar $entries = require('../internals/object-to-array').entries;\n\n// `Object.entries` method\n// https://tc39.es/ecma262/#sec-object.entries\n$({ target: 'Object', stat: true }, {\n  entries: function entries(O) {\n    return $entries(O);\n  }\n});\n","var $ = require('../internals/export');\nvar $values = require('../internals/object-to-array').values;\n\n// `Object.values` method\n// https://tc39.es/ecma262/#sec-object.values\n$({ target: 'Object', stat: true }, {\n  values: function values(O) {\n    return $values(O);\n  }\n});\n","var render = function() {\n  var _vm = this\n  var _h = _vm.$createElement\n  var _c = _vm._self._c || _h\n  return _c(\n    \"div\",\n    { staticClass: \"row\" },\n    [\n      _vm.attributes.length ||\n      (_vm.possibleUnitCombinationIds.length > 1 && _vm.isContentVisible)\n        ? [\n            _vm._l(_vm.attributes, function(attribute, index) {\n              return _c(\n                \"div\",\n                { key: index, staticClass: \"col-12 variation-select\" },\n                [\n                  attribute.type === \"dropdown\"\n                    ? _c(\n                        \"div\",\n                        {\n                          ref: \"attributesContaner\",\n                          refInFor: true,\n                          staticClass: \"input-unit\"\n                        },\n                        [\n                          _c(\n                            \"select\",\n                            {\n                              staticClass: \"custom-select\",\n                              attrs: {\n                                id: \"custom-select_\" + attribute.name,\n                                \"data-testing\": \"variation-select-dropdown\"\n                              },\n                              on: {\n                                change: function($event) {\n                                  return _vm.selectAttribute(\n                                    attribute.attributeId,\n                                    $event.target.value\n                                  )\n                                }\n                              }\n                            },\n                            [\n                              _vm.addPleaseSelectOption || !_vm.hasSelection\n                                ? _c(\"option\", { domProps: { value: -1 } }, [\n                                    _vm._v(\n                                      _vm._s(\n                                        _vm.$translate(\n                                          \"Ceres::Template.singleItemPleaseSelect\"\n                                        )\n                                      )\n                                    )\n                                  ])\n                                : _vm._e(),\n                              _vm._v(\" \"),\n                              _vm.hasEmptyOption ||\n                              _vm.selectedAttributes[attribute.attributeId] ===\n                                null\n                                ? _c(\n                                    \"option\",\n                                    {\n                                      domProps: {\n                                        value: null,\n                                        selected:\n                                          _vm.selectedAttributes[\n                                            attribute.attributeId\n                                          ] === null\n                                      }\n                                    },\n                                    [\n                                      _vm._v(\n                                        _vm._s(\n                                          _vm.$translate(\n                                            \"Ceres::Template.singleItemNoSelection\"\n                                          )\n                                        )\n                                      )\n                                    ]\n                                  )\n                                : _vm._e(),\n                              _vm._v(\" \"),\n                              _vm._l(attribute.values, function(value) {\n                                return _c(\n                                  \"option\",\n                                  {\n                                    key: value.attributeValueId,\n                                    domProps: {\n                                      value: value.attributeValueId,\n                                      selected:\n                                        value.attributeValueId ===\n                                        _vm.selectedAttributes[\n                                          attribute.attributeId\n                                        ]\n                                    }\n                                  },\n                                  [\n                                    _vm.isAttributeSelectionValid(\n                                      attribute.attributeId,\n                                      value.attributeValueId,\n                                      true\n                                    )\n                                      ? [\n                                          _vm._v(\n                                            \"\\n                            \" +\n                                              _vm._s(value.name) +\n                                              \"\\n                        \"\n                                          )\n                                        ]\n                                      : _vm.isAttributeSelectionValid(\n                                          attribute.attributeId,\n                                          value.attributeValueId,\n                                          false\n                                        )\n                                      ? [\n                                          _vm._v(\n                                            \"\\n                            \" +\n                                              _vm._s(\n                                                _vm.$translate(\n                                                  \"Ceres::Template.singleItemNotSalableAttribute\",\n                                                  { name: value.name }\n                                                )\n                                              ) +\n                                              \"\\n                        \"\n                                          )\n                                        ]\n                                      : [\n                                          _vm._v(\n                                            \"\\n                            \" +\n                                              _vm._s(\n                                                _vm.$translate(\n                                                  \"Ceres::Template.singleItemInvalidAttribute\",\n                                                  { name: value.name }\n                                                )\n                                              ) +\n                                              \"\\n                        \"\n                                          )\n                                        ]\n                                  ],\n                                  2\n                                )\n                              })\n                            ],\n                            2\n                          ),\n                          _vm._v(\" \"),\n                          _c(\n                            \"label\",\n                            {\n                              directives: [\n                                {\n                                  name: \"tooltip\",\n                                  rawName: \"v-tooltip\",\n                                  value: _vm.isTextCut(attribute.name),\n                                  expression: \"isTextCut(attribute.name)\"\n                                }\n                              ],\n                              attrs: {\n                                for: \"custom-select_\" + attribute.name,\n                                \"data-toggle\": \"tooltip\",\n                                \"data-placement\": \"top\",\n                                title: attribute.name,\n                                \"data-testing\":\n                                  \"variation-select-dropdown-label\"\n                              }\n                            },\n                            [_vm._v(_vm._s(attribute.name))]\n                          )\n                        ]\n                      )\n                    : attribute.type === \"box\" || attribute.type === \"image\"\n                    ? _c(\"div\", [\n                        _c(\n                          \"span\",\n                          {\n                            staticClass: \"text-muted\",\n                            attrs: { \"data-testing\": \"attribute-name\" }\n                          },\n                          [_vm._v(_vm._s(attribute.name) + \":\")]\n                        ),\n                        _vm._v(\" \"),\n                        _c(\n                          \"b\",\n                          { attrs: { \"data-testing\": \"attribute-value\" } },\n                          [\n                            _vm._v(\n                              _vm._s(\n                                _vm.getSelectedAttributeValueName(attribute)\n                              )\n                            )\n                          ]\n                        ),\n                        _vm._v(\" \"),\n                        _c(\n                          \"div\",\n                          {\n                            staticClass: \"v-s-boxes py-3\",\n                            class: { images: attribute.type === \"image\" }\n                          },\n                          [\n                            _vm.addPleaseSelectOption\n                              ? _c(\n                                  \"div\",\n                                  {\n                                    staticClass:\n                                      \"v-s-box bg-white empty-option\",\n                                    class: {\n                                      active:\n                                        _vm.selectedAttributes[\n                                          attribute.attributeId\n                                        ] === -1,\n                                      invalid: !_vm.isAttributeSelectionValid(\n                                        attribute.attributeId,\n                                        -1\n                                      )\n                                    },\n                                    attrs: {\n                                      \"data-testing\": \"variation-select-box\"\n                                    },\n                                    on: {\n                                      click: function($event) {\n                                        return _vm.selectAttribute(\n                                          attribute.attributeId,\n                                          -1\n                                        )\n                                      }\n                                    }\n                                  },\n                                  [\n                                    _c(\"span\", { staticClass: \"mx-3\" }, [\n                                      _vm._v(\n                                        _vm._s(\n                                          _vm.$translate(\n                                            \"Ceres::Template.singleItemPleaseSelect\"\n                                          )\n                                        )\n                                      )\n                                    ])\n                                  ]\n                                )\n                              : _vm._e(),\n                            _vm._v(\" \"),\n                            _vm.hasEmptyOption\n                              ? _c(\n                                  \"div\",\n                                  {\n                                    staticClass:\n                                      \"v-s-box bg-white empty-option\",\n                                    class: {\n                                      active:\n                                        _vm.selectedAttributes[\n                                          attribute.attributeId\n                                        ] === null,\n                                      invalid: !_vm.isAttributeSelectionValid(\n                                        attribute.attributeId,\n                                        null,\n                                        true\n                                      )\n                                    },\n                                    attrs: {\n                                      \"data-testing\": \"variation-select-box\"\n                                    },\n                                    on: {\n                                      click: function($event) {\n                                        return _vm.selectAttribute(\n                                          attribute.attributeId,\n                                          null\n                                        )\n                                      }\n                                    }\n                                  },\n                                  [\n                                    _c(\"span\", { staticClass: \"mx-3\" }, [\n                                      _vm._v(\n                                        _vm._s(\n                                          _vm.$translate(\n                                            \"Ceres::Template.singleItemNoSelection\"\n                                          )\n                                        )\n                                      )\n                                    ])\n                                  ]\n                                )\n                              : _vm._e(),\n                            _vm._v(\" \"),\n                            _vm._l(attribute.values, function(value) {\n                              return _c(\n                                \"div\",\n                                {\n                                  directives: [\n                                    {\n                                      name: \"tooltip\",\n                                      rawName: \"v-tooltip\",\n                                      value: true,\n                                      expression: \"true\"\n                                    }\n                                  ],\n                                  key: value.attributeValueId,\n                                  staticClass: \"v-s-box bg-white\",\n                                  class: {\n                                    active:\n                                      value.attributeValueId ===\n                                      _vm.selectedAttributes[\n                                        attribute.attributeId\n                                      ],\n                                    invalid: !_vm.isAttributeSelectionValid(\n                                      attribute.attributeId,\n                                      value.attributeValueId,\n                                      true\n                                    )\n                                  },\n                                  attrs: {\n                                    \"data-testing\": \"variation-select-box\",\n                                    \"data-html\": \"true\",\n                                    \"data-toggle\": \"tooltip\",\n                                    \"data-placement\": \"top\",\n                                    \"data-original-title\": _vm.getTooltip(\n                                      attribute,\n                                      value\n                                    )\n                                  },\n                                  on: {\n                                    click: function($event) {\n                                      return _vm.selectAttribute(\n                                        attribute.attributeId,\n                                        value.attributeValueId\n                                      )\n                                    }\n                                  }\n                                },\n                                [\n                                  attribute.type === \"box\"\n                                    ? _c(\"span\", { staticClass: \"mx-3\" }, [\n                                        _vm._v(_vm._s(value.name))\n                                      ])\n                                    : _c(\"img\", {\n                                        staticClass: \"p-1\",\n                                        attrs: {\n                                          src: value.imageUrl,\n                                          alt: value.name\n                                        }\n                                      })\n                                ]\n                              )\n                            })\n                          ],\n                          2\n                        )\n                      ])\n                    : _vm._e()\n                ]\n              )\n            }),\n            _vm._v(\" \"),\n            _vm.possibleUnitCombinationIds.length > 1 && _vm.isContentVisible\n              ? _c(\"div\", { staticClass: \"col-12 variation-select\" }, [\n                  _c(\"div\", { staticClass: \"input-unit\" }, [\n                    _c(\n                      \"select\",\n                      {\n                        staticClass: \"custom-select\",\n                        attrs: {\n                          id: \"unit-combination-ids-select\",\n                          \"data-testing\": \"variation-select-unit\"\n                        },\n                        on: {\n                          change: function($event) {\n                            return _vm.selectUnit($event.target.value)\n                          }\n                        }\n                      },\n                      _vm._l(_vm.possibleUnitCombinationIds, function(\n                        unitCombinationId\n                      ) {\n                        return _c(\n                          \"option\",\n                          {\n                            key: unitCombinationId,\n                            domProps: {\n                              value: unitCombinationId,\n                              selected:\n                                parseInt(unitCombinationId) === _vm.selectedUnit\n                            }\n                          },\n                          [\n                            _vm.isUnitSelectionValid(unitCombinationId)\n                              ? [\n                                  _vm._v(\n                                    \"\\n                            \" +\n                                      _vm._s(\n                                        _vm.possibleUnits[unitCombinationId]\n                                      ) +\n                                      \"\\n                        \"\n                                  )\n                                ]\n                              : [\n                                  _vm._v(\n                                    \"\\n                            \" +\n                                      _vm._s(\n                                        _vm.$translate(\n                                          \"Ceres::Template.singleItemInvalidAttribute\",\n                                          {\n                                            name:\n                                              _vm.possibleUnits[\n                                                unitCombinationId\n                                              ]\n                                          }\n                                        )\n                                      ) +\n                                      \"\\n                        \"\n                                  )\n                                ]\n                          ],\n                          2\n                        )\n                      }),\n                      0\n                    ),\n                    _vm._v(\" \"),\n                    _c(\n                      \"label\",\n                      {\n                        attrs: {\n                          for: \"unit-combination-ids-select\",\n                          \"data-testing\": \"variation-select-unit-label\"\n                        }\n                      },\n                      [\n                        _vm._v(\n                          _vm._s(\n                            _vm.$translate(\"Ceres::Template.singleItemContent\")\n                          )\n                        )\n                      ]\n                    )\n                  ])\n                ])\n              : _vm._e()\n          ]\n        : [_vm._t(\"default\")]\n    ],\n    2\n  )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","import { render, staticRenderFns } from \"./VariationSelect.vue?vue&type=template&id=4a939d05&\"\nimport script from \"./VariationSelect.vue?vue&type=script&lang=js&\"\nexport * from \"./VariationSelect.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\n/* hot reload */\nif (module.hot) {\n  var api = require(\"/Users/danielmannheimer/plentyDevTool/23336/141/Ceres/node_modules/vue-hot-reload-api/dist/index.js\")\n  api.install(require('vue'))\n  if (api.compatible) {\n    module.hot.accept()\n    if (!api.isRecorded('4a939d05')) {\n      api.createRecord('4a939d05', component.options)\n    } else {\n      api.reload('4a939d05', component.options)\n    }\n    module.hot.accept(\"./VariationSelect.vue?vue&type=template&id=4a939d05&\", function () {\n      api.rerender('4a939d05', {\n        render: render,\n        staticRenderFns: staticRenderFns\n      })\n    })\n  }\n}\ncomponent.options.__file = \"resources/js/src/app/components/item/VariationSelect.vue\"\nexport default component.exports","import mod from \"-!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./VariationSelect.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./VariationSelect.vue?vue&type=script&lang=js&\"","export * from \"-!../../../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./VariationSelect.vue?vue&type=template&id=4a939d05&\""],"sourceRoot":""}