{"version":3,"sources":["webpack:///./resources/js/src/app/components/itemList/SearchSuggestionItem.vue?265b","webpack:///resources/js/src/app/components/itemList/SearchSuggestionItem.vue","webpack:///./resources/js/src/app/components/itemList/SearchSuggestionItem.vue?226b","webpack:///./resources/js/src/app/components/itemList/SearchSuggestionItem.vue"],"names":["render","_vm","this","_h","$createElement","_c","_self","autocompleteResult","length","attrs","_l","item","index","key","staticClass","class","paddingClasses","style","paddingInlineStyles","href","getTargetUrl","tabindex","showImages","image","_e","_v","compact","showAdditionalInformation","beforeLabel","afterLabel","_s","domProps","innerHTML","getHighlightedLabel","label","showCount","count","$translate","_withStripped","component","options","__file"],"mappings":"kGAAA,IAAIA,EAAS,WACX,IAAIC,EAAMC,KACNC,EAAKF,EAAIG,eACTC,EAAKJ,EAAIK,MAAMD,IAAMF,EACzB,OAAOE,EACL,MACA,CACEJ,EAAIM,oBAAsBN,EAAIM,mBAAmBC,OAC7C,CACEH,EACE,MACA,CAAEI,MAAO,CAAE,eAAgB,sBAC3BR,EAAIS,GAAGT,EAAIM,oBAAoB,SAASI,EAAMC,GAC5C,OAAOP,EACL,IACA,CACEQ,IAAKD,EACLE,YAAa,0BACbC,MAAOd,EAAIe,eACXC,MAAOhB,EAAIiB,oBACXT,MAAO,CAAEU,KAAMlB,EAAImB,aAAaT,GAAOU,SAAU,MAEnD,CACEpB,EAAIqB,WACAjB,EACE,MACA,CAAES,YAAa,4BACf,CACEH,EAAKY,MACDlB,EAAG,WAAY,CACbI,MAAO,CAAE,YAAaE,EAAKY,SAE7BtB,EAAIuB,MAEV,GAEFvB,EAAIuB,KACRvB,EAAIwB,GAAG,KACPpB,EACE,MACA,CACES,YAAa,wBACbC,MAAO,CACLW,QACEzB,EAAI0B,2BACJhB,EAAKiB,aACLjB,EAAKkB,aAGX,CACE5B,EAAI0B,2BAA6BhB,EAAKiB,YAClCvB,EACE,IACA,CAAES,YAAa,4BACf,CAACb,EAAIwB,GAAGxB,EAAI6B,GAAGnB,EAAKiB,gBA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unks/ceres-client-44.min.js","sourcesContent":["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    [\n      _vm.autocompleteResult && _vm.autocompleteResult.length\n        ? [\n            _c(\n              \"div\",\n              { attrs: { \"data-testing\": \"autocomplete-list\" } },\n              _vm._l(_vm.autocompleteResult, function(item, index) {\n                return _c(\n                  \"a\",\n                  {\n                    key: index,\n                    staticClass: \"autocomplete-suggestion\",\n                    class: _vm.paddingClasses,\n                    style: _vm.paddingInlineStyles,\n                    attrs: { href: _vm.getTargetUrl(item), tabindex: \"0\" }\n                  },\n                  [\n                    _vm.showImages\n                      ? _c(\n                          \"div\",\n                          { staticClass: \"image flex-shrink-0 mr-3\" },\n                          [\n                            item.image\n                              ? _c(\"lazy-img\", {\n                                  attrs: { \"image-url\": item.image }\n                                })\n                              : _vm._e()\n                          ],\n                          1\n                        )\n                      : _vm._e(),\n                    _vm._v(\" \"),\n                    _c(\n                      \"div\",\n                      {\n                        staticClass: \"label overflow-hidden\",\n                        class: {\n                          compact:\n                            _vm.showAdditionalInformation &&\n                            item.beforeLabel &&\n                            item.afterLabel\n                        }\n                      },\n                      [\n                        _vm.showAdditionalInformation && item.beforeLabel\n                          ? _c(\n                              \"p\",\n                              { staticClass: \"small mb-0 text-truncate\" },\n                              [_vm._v(_vm._s(item.beforeLabel))]\n                            )\n                          : _vm._e(),\n                        _vm._v(\" \"),\n                        _c(\"p\", {\n                          staticClass: \"mb-0 text-truncate\",\n                          domProps: {\n                            innerHTML: _vm._s(\n                              _vm.getHighlightedLabel(item.label)\n                            )\n                          }\n                        }),\n                        _vm._v(\" \"),\n                        _vm.showAdditionalInformation && item.afterLabel\n                          ? _c(\n                              \"p\",\n                              { staticClass: \"small mb-0 text-truncate\" },\n                              [_vm._v(_vm._s(item.afterLabel))]\n                            )\n                          : _vm._e()\n                      ]\n                    ),\n                    _vm._v(\" \"),\n                    _vm.showCount && item.count > 0\n                      ? _c(\"div\", { staticClass: \"count\" }, [\n                          _c(\"span\", [_vm._v(_vm._s(item.count))])\n                        ])\n                      : _vm._e()\n                  ]\n                )\n              }),\n              0\n            )\n          ]\n        : [\n            _c(\n              \"p\",\n              {\n                staticClass: \"text-muted\",\n                class: _vm.paddingClasses,\n                style: _vm.paddingInlineStyles\n              },\n              [\n                _vm._v(\n                  \"\\n            \" +\n                    _vm._s(\n                      _vm.$translate(\n                        \"Ceres::Template.itemSearchSuggestionNoResults\"\n                      )\n                    ) +\n                    \"\\n        \"\n                )\n              ]\n            )\n          ]\n    ],\n    2\n  )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","<template>\n    <div>\n        <template v-if=\"autocompleteResult && autocompleteResult.length\">\n            <div data-testing=\"autocomplete-list\">\n                <a\n                    v-for=\"(item, index) in autocompleteResult\"\n                    class=\"autocomplete-suggestion\"\n                    :class=\"paddingClasses\"\n                    :style=\"paddingInlineStyles\"\n                    :key=\"index\"\n                    :href=\"getTargetUrl(item)\"\n                    tabindex=\"0\">\n\n                    <div class=\"image flex-shrink-0 mr-3\" v-if=\"showImages\">\n                        <lazy-img v-if=\"item.image\" :image-url=\"item.image\" />\n                    </div>\n\n                    <div class=\"label overflow-hidden\" :class=\"{ 'compact': showAdditionalInformation && item.beforeLabel && item.afterLabel }\">\n                        <p class=\"small mb-0 text-truncate\" v-if=\"showAdditionalInformation && item.beforeLabel\">{{ item.beforeLabel }}</p>\n                        <p class=\"mb-0 text-truncate\" v-html=\"getHighlightedLabel(item.label)\"></p>\n                        <p class=\"small mb-0 text-truncate\" v-if=\"showAdditionalInformation && item.afterLabel\">{{ item.afterLabel }}</p>\n                    </div>\n\n                    <div class=\"count\" v-if=\"showCount && item.count > 0\">\n                        <span>{{ item.count }}</span>\n                    </div>\n                </a>\n            </div>\n        </template>\n\n        <template v-else>\n            <p class=\"text-muted\" :class=\"paddingClasses\" :style=\"paddingInlineStyles\">\n                {{ $translate(\"Ceres::Template.itemSearchSuggestionNoResults\") }}\n            </p>\n        </template>\n    </div>\n</template>\n\n<script>\nimport { mapState } from 'vuex';\n\nexport default {\n    props:\n    {\n        showImages: Boolean,\n\n        paddingClasses:\n        {\n            type: String,\n            default: \"px-3 py-2\"\n        },\n        \n        paddingInlineStyles:\n        {\n            type: String,\n            default: null\n        },\n\n        suggestionType:\n        {\n            type: String,\n            required: true\n        },\n\n        showCount: Boolean,\n\n        showAdditionalInformation: Boolean\n    },\n\n    computed:\n    {\n        ...mapState({\n            autocompleteResult(state)\n            {\n                return state.itemSearch.autocompleteResult[this.suggestionType];\n            },\n            autocompleteSearchString: state => state.itemSearch.autocompleteSearchString\n        })\n    },\n\n    created()\n    {\n        this.$store.commit(\"addAutocompleteType\", this.suggestionType);\n    },\n\n    methods:\n    {\n        getHighlightedLabel(label)\n        {\n            const search = this.autocompleteSearchString.split(/\\s+/)\n                .filter(word => word.length)\n                .join(\"|\");\n\n            label = (label || \"\").toString();\n\n            return label\n                .replace(new RegExp(search, \"ig\"), match =>\n                {\n                    return `<strong class=\"text-appearance\">${ match }</strong>`;\n                });\n        },\n\n        getTargetUrl(item)\n        {\n            if (item.url && item.url.length)\n            {\n                return item.url;\n            }\n\n            return `${ App.urls.search }?query=${ encodeURIComponent(item.label) }`\n        }\n    }\n}\n</script>\n","import mod from \"-!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SearchSuggestionItem.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!./SearchSuggestionItem.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./SearchSuggestionItem.vue?vue&type=template&id=4ff8d14a&\"\nimport script from \"./SearchSuggestionItem.vue?vue&type=script&lang=js&\"\nexport * from \"./SearchSuggestionItem.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(\"/home/runner/work/plugin-ceres/plugin-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('4ff8d14a')) {\n      api.createRecord('4ff8d14a', component.options)\n    } else {\n      api.reload('4ff8d14a', component.options)\n    }\n    module.hot.accept(\"./SearchSuggestionItem.vue?vue&type=template&id=4ff8d14a&\", function () {\n      api.rerender('4ff8d14a', {\n        render: render,\n        staticRenderFns: staticRenderFns\n      })\n    })\n  }\n}\ncomponent.options.__file = \"resources/js/src/app/components/itemList/SearchSuggestionItem.vue\"\nexport default component.exports"],"sourceRoot":""}