"use strict";function FsrsStarConstructor(t,s,n){let e;this.elementId=t,e=t.getAttribute("fsrs-data-rating");let i=Math.ceil(parseFloat(e));s||(initStars(t,i),setRating(i,"pointer","checked",null)),s&&(initReadonlyStars(t,i),setReadonlyRating(i)),n&&(initEmojiStars(t,i),setEmojiIcoRating(i))}function initStars(t,s){let n=0,e="";try{for(let t=5;t>0;t--)e+=`<i class="fsrs-rating-icon"\n                    id="fsrs-rating-icon${n=t}" fsrs-star-value="${n}" role="radio"><span\n                     id="fsrs-star-hover-txt--${n}" class="fsrs-star-hover-txt"></span><span \n                     id="fsrs-min-width-star-hover-txt${n}" class="fsrs-min-width-star-hover-text"></span></i>`}catch(t){throw t}t.innerHTML=e}function initEmojiStars(t,s){let n=0,e="";try{for(let t=5;t>0;t--)e+=`<i class="fsrs-rating-emoji-icon"\n                    id="fsrs-rating-emoji-icon${n=t}" fsrs-star-value="${n}" role="radio"><span\n                     id="fsrs-star-hover-txt--${n}" class="fsrs-star-hover-txt"></span><span \n                     id="fsrs-min-width-star-hover-txt${n}" class="fsrs-min-width-star-hover-text"></span></i>`}catch(t){throw t}t.innerHTML=e}function initReadonlyStars(t,s){let n=0,e="";try{for(let t=5;t>0;t--)e+=`<i class="fsrs-rating-icon fsrs-rating-icon--readonly"\n                    id="fsrs-rating-icon--readonly${n=t}" fsrs-star-value="${n}" role="radio"></i>`}catch(t){throw t}return t.innerHTML=e}function setEmojiIcoRating(t){let s=t;const n=document.getElementById(`fsrs-rating-emoji-icon${s}`);for(;s>=1;){if(s-1!=0)try{document.getElementById(`fsrs-rating-emoji-icon${s-1}`).classList.add("checked")}catch(t){console.log(t)}--s}n.classList.add("checked")}function setReadonlyRating(t){let s=t;const n=document.getElementById(`fsrs-rating-icon--readonly${s}`);for(;s>=1;){if(s-1!=0)try{document.getElementById(`fsrs-rating-icon--readonly${s-1}`).classList.add("checked")}catch(t){console.log(t)}--s}n.classList.add("checked")}function setRating(t,s,n,e){for(let t=1;t<=5;t++){const n=document.getElementById(`fsrs-rating-icon${t}`);n.classList.remove("checked","fsrs-rating-icon--clicked","selected"),n.style.cursor=s,n.onmouseover=null,n.onmouseleave=null}let i=t;const o=document.getElementById(`fsrs-rating-icon${i}`);for(;i>=1;){if(i-1!=0)try{null!==n&&document.getElementById(`fsrs-rating-icon${i-1}`).classList.add(n),null!==e&&document.getElementById(`fsrs-rating-icon${i-1}`).classList.add(e)}catch(t){console.log(t)}--i}null!==n&&o.classList.add(n),null!==e&&o.classList.add(e)}function setEmojiRating(t,s,n,e){for(let t=1;t<=5;t++){const n=document.getElementById(`fsrs-rating-emoji-icon${t}`);n.classList.remove("checked","fsrs-rating-emoji-icon--clicked","selected"),n.style.cursor=s,n.onmouseover=null,n.onmouseleave=null}let i=t;const o=document.getElementById(`fsrs-rating-emoji-icon${i}`);for(;i>=1;){if(i-1!=0)try{null!==n&&document.getElementById(`fsrs-rating-emoji-icon${i-1}`).classList.add(n),null!==e&&document.getElementById(`fsrs-rating-emoji-icon${i-1}`).classList.add(e)}catch(t){console.log(t)}--i}null!==n&&o.classList.add(n),null!==e&&o.classList.add(e)}function setupEvents(t){for(let s=1;s<=5;s++){let n=document.getElementById(`fsrs-rating-icon${s}`);const e=n;t.classList.contains("readonly")||(e.onclick=function(){onStarClickEvent(n,e,t)})}}function onStarClickEvent(t,s,n){n.classList.contains("readonly")}