import t,{Component as e}from"react";import{classNames as n}from"primereact/utils";import{tip as o}from"primereact/tooltip";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;ne.props.value,"pi pi-star-fill":o<=e.props.value});return t.createElement("span",{className:r,onClick:function(t){return e.rate(t,o)},key:o,tabIndex:e.getFocusIndex(),onKeyDown:function(t){return e.onStarKeyDown(t,o)}})}))}},{key:"renderCancelIcon",value:function(){return this.props.cancel?t.createElement("span",{className:"p-rating-icon p-rating-cancel pi pi-ban",onClick:this.clear,tabIndex:this.getFocusIndex(),onKeyDown:this.onCancelKeyDown}):null}},{key:"render",value:function(){var e=this,o=n("p-rating",{"p-disabled":this.props.disabled,"p-rating-readonly":this.props.readOnly},this.props.className),r=this.renderCancelIcon(),i=this.renderStars();return t.createElement("div",{ref:function(t){return e.element=t},id:this.props.id,className:o,style:this.props.style},r,i)}}])&&i(y.prototype,b),v&&i(y,v),Object.defineProperty(y,"prototype",{writable:!1}),O}();f(b,"defaultProps",{id:null,value:null,disabled:!1,readOnly:!1,stars:5,cancel:!0,style:null,className:null,tooltip:null,tooltipOptions:null,onChange:null});export{b as Rating};