import { r as registerInstance, c as createEvent, h, H as Host } from './index-b7735e0d.js';

const dvnRatingStarsCss = "dvn-rating-stars.disabled:not(.readonly){opacity:0.6}dvn-rating-stars:not(.disabled) .star-icon-container{-webkit-transition:all 0.15s ease-in-out;transition:all 0.15s ease-in-out;cursor:pointer}dvn-rating-stars:not(.disabled) .star-icon-container:hover{-webkit-transform:scale(1.2);transform:scale(1.2)}dvn-rating-stars .star-icon-container{width:24px;height:24px;display:inline-block}";

const pathEmpty = 'M22,9.67A1,1,0,0,0,21.14,9l-5.69-.83L12.9,3a1,1,0,0,0-1.8,0L8.55,8.16,2.86,9a1,1,0,0,0-.81.68,1,1,0,0,0,.25,1l4.13,4-1,5.68a1,1,0,0,0,.4,1,1,1,0,0,0,1.05.07L12,18.76l5.1,2.68a.93.93,0,0,0,.46.12,1,1,0,0,0,.59-.19,1,1,0,0,0,.4-1l-1-5.68,4.13-4A1,1,0,0,0,22,9.67Zm-6.15,4a1,1,0,0,0-.29.89l.72,4.19-3.76-2a1,1,0,0,0-.94,0l-3.76,2,.72-4.19a1,1,0,0,0-.29-.89l-3-3,4.21-.61a1,1,0,0,0,.76-.55L12,5.7l1.88,3.82a1,1,0,0,0,.76.55l4.21.61Z';
const pathFilled = 'm22,9.67a1,1 0 0 0 -0.86,-0.67l-5.69,-0.83l-2.55,-5.17a1,1 0 0 0 -1.8,0l-2.55,5.16l-5.69,0.84a1,1 0 0 0 -0.81,0.68a1,1 0 0 0 0.25,1l4.13,4l-1,5.68a1,1 0 0 0 0.4,1a1,1 0 0 0 1.05,0.07l5.12,-2.67l5.1,2.68a0.93,0.93 0 0 0 0.46,0.12a1,1 0 0 0 0.59,-0.19a1,1 0 0 0 0.4,-1l-1,-5.68l4.13,-4a1,1 0 0 0 0.32,-1.02z';
let DvnRatingStars = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.change = createEvent(this, "change", 7);
    this.count = 5;
    this.value = 0;
  }
  render() {
    const { count, disabled, readonly, value } = this;
    let options = this.options;
    if (!options) {
      options = [];
      for (let i = 1; i <= count; i += 1) {
        options.push(i);
      }
    }
    return (h(Host, { class: { disabled, readonly } }, options.map(option => (h("div", { class: "star-icon-container" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", onClick: () => {
        if (!disabled || !readonly)
          this.change.emit(option);
      } }, h("path", { fill: `var(--color-${option <= value ? 'primary' : 'neutral'})`, d: option <= value ? pathFilled : pathEmpty })))))));
  }
};
DvnRatingStars.style = dvnRatingStarsCss;

export { DvnRatingStars as dvn_rating_stars };
