"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    getPartialSearchBoxSuggestionElement: ()=>getPartialSearchBoxSuggestionElement,
    renderQuerySuggestion: ()=>renderQuerySuggestion
});
require("../atomic-icon/atomic-icon.cjs");
const external_lit_namespaceObject = require("lit");
const string_utils_cjs_namespaceObject = require("../../../utils/string-utils.cjs");
const getPartialSearchBoxSuggestionElement = (suggestion, i18n)=>({
        part: 'query-suggestion-item',
        key: `qs-${(0, string_utils_cjs_namespaceObject.encodeForDomAttribute)(suggestion.rawValue)}`,
        query: suggestion.rawValue,
        ariaLabel: i18n.t('query-suggestion-label', {
            query: suggestion.rawValue,
            interpolation: {
                escapeValue: false
            }
        })
    });
const renderQuerySuggestion = ({ icon, hasQuery, suggestion, hasMultipleKindOfSuggestions, alwaysShowIcon = false })=>{
    const shouldShowIcon = alwaysShowIcon || hasMultipleKindOfSuggestions;
    const template = (0, external_lit_namespaceObject.html)`
    <div
      part="query-suggestion-content"
      class="pointer-events-none flex items-center"
    >
      ${shouldShowIcon ? (0, external_lit_namespaceObject.html)`<atomic-icon
            part="query-suggestion-icon"
            icon=${icon}
            class="mr-2 h-4 w-4 shrink-0"
          ></atomic-icon>` : external_lit_namespaceObject.nothing}${hasQuery ? (0, external_lit_namespaceObject.html)`<span
            part="query-suggestion-text"
            class="line-clamp-2 break-all"
            .innerHTML=${suggestion.highlightedValue}
          ></span>` : (0, external_lit_namespaceObject.html)`<span part="query-suggestion-text" class="line-clamp-2 break-all"
            >${suggestion.rawValue}</span
          >`}
    </div>
  `;
    const container = document.createElement('div');
    (0, external_lit_namespaceObject.render)(template, container);
    return container.firstElementChild;
};
exports.getPartialSearchBoxSuggestionElement = __webpack_exports__.getPartialSearchBoxSuggestionElement;
exports.renderQuerySuggestion = __webpack_exports__.renderQuerySuggestion;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "getPartialSearchBoxSuggestionElement",
    "renderQuerySuggestion"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
