"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__, {
    renderRating: ()=>renderRating
});
require("../atomic-icon/atomic-icon.cjs");
const external_lit_namespaceObject = require("lit");
const style_map_js_namespaceObject = require("lit/directives/style-map.js");
const multi_class_map_cjs_namespaceObject = require("../../../directives/multi-class-map.cjs");
const renderRating = ({ props })=>{
    const width = (props.numberOfActiveIcons / props.numberOfTotalIcons * 100).toString() + '%';
    const iconSize = `${props.iconSize ?? 0.75}rem`;
    const renderIcon = (active)=>{
        const iconClass = (0, multi_class_map_cjs_namespaceObject.tw)({
            'shrink-0': true,
            'text-rating-icon-active': active,
            'text-rating-icon-inactive': !active
        });
        const iconStyle = {
            width: iconSize,
            height: iconSize
        };
        return (0, external_lit_namespaceObject.html)`<atomic-icon
      icon=${props.icon}
      class=${(0, multi_class_map_cjs_namespaceObject.multiClassMap)(iconClass)}
      style=${(0, style_map_js_namespaceObject.styleMap)(iconStyle)}
      part="value-rating-icon"
    ></atomic-icon>`;
    };
    const emptyIconDisplay = ()=>{
        const emptyIcons = [];
        for(let i = 0; i < props.numberOfTotalIcons; i++)emptyIcons.push(renderIcon(false));
        return emptyIcons;
    };
    const filledIconDisplay = ()=>{
        const filledIcons = [];
        for(let i = 0; i < props.numberOfTotalIcons; i++)filledIcons.push(renderIcon(true));
        return filledIcons;
    };
    return (0, external_lit_namespaceObject.html)`<div
    class="relative w-max"
    part="value-rating"
    role="img"
    aria-label=${props.i18n.t('stars', {
        count: props.numberOfActiveIcons,
        max: props.numberOfTotalIcons
    })}
  >
    <div class="z-0 flex gap-0.5">${emptyIconDisplay()}</div>
    <div
      class="absolute top-0 left-0 z-1 flex gap-0.5 overflow-hidden"
      style=${(0, style_map_js_namespaceObject.styleMap)({
        width
    })}
    >
      ${filledIconDisplay()}
    </div>
  </div>`;
};
exports.renderRating = __webpack_exports__.renderRating;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "renderRating"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
