"use strict";(self.webpackChunk_flagship_io_js_sdk=self.webpackChunk_flagship_io_js_sdk||[]).push([[333],{333:(e,t,s)=>{s.r(t),s.d(t,{CATEGORY_ERROR:()=>c,ERROR_MESSAGE:()=>l,Event:()=>_,VALUE_FIELD_ERROR:()=>u});var a=s(719),i=s(761),r=s(629),o=s(132),n=s(487);const l="event category and event action are required",c="The category value must be either EventCategory::ACTION_TRACKING or EventCategory::ACTION_TRACKING",u="value must be an integer and be >= 0";class _ extends n.HitAbstract{_category;_action;_label;_value;get category(){return this._category}set category(e){Object.values(o.EventCategory).includes(e)?this._category=e:(0,r.logError)(this.config,c,"category")}get action(){return this._action}set action(e){this.isNotEmptyString(e,"action")&&(this._action=e)}get label(){return this._label}set label(e){this.isNotEmptyString(e,"label")&&(this._label=e)}get value(){return this._value}set value(e){!Number.isInteger(e)||e<0?(0,r.logError)(this.config,u,"value"):this._value=e}constructor(e){super({type:i.HitType.EVENT,userIp:e.userIp,screenResolution:e.screenResolution,locale:e.locale,sessionNumber:e.sessionNumber,visitorId:e.visitorId,anonymousId:e.anonymousId,qaMode:e.qaMode,isActionTrackingHit:e.isActionTrackingHit});const{category:t,action:s,label:a,value:r}=e;this.category=t,this.action=s,a&&(this.label=a),r&&(this.value=r)}toApiKeys(){const e=super.toApiKeys();return e[a.EVENT_CATEGORY_API_ITEM]=this.category,e[a.EVENT_ACTION_API_ITEM]=this.action,this.label&&(e[a.EVENT_LABEL_API_ITEM]=this.label),this.value&&(e[a.EVENT_VALUE_API_ITEM]=this.value),e}toObject(){return{...super.toObject(),category:this.category,action:this.action,label:this.label,value:this.value}}isReady(e=!0){return!(e&&!super.isReady()||!this.category||!this.action)}getErrorMessage(){return l}}}}]);
//# sourceMappingURL=333.6e1eca20806a19f3682c.js.map