"use strict";(self.webpackChunk_flagship_io_js_sdk=self.webpackChunk_flagship_io_js_sdk||[]).push([[105],{2105:(t,i,e)=>{e.r(i),e.d(i,{ERROR_MESSAGE:()=>a,Item:()=>n});var s=e(3641),r=e(1417),o=e(8068);const a="Transaction Id, Item name and item code are required";class n extends o.HitAbstract{get transactionId(){return this._transactionId}set transactionId(t){this.isNotEmptyString(t,"transactionId")&&(this._transactionId=t)}get productName(){return this._productName}set productName(t){this.isNotEmptyString(t,"productName")&&(this._productName=t)}get productSku(){return this._productSku}set productSku(t){this.isNotEmptyString(t,"productSku")&&(this._productSku=t)}get itemPrice(){return this._itemPrice}set itemPrice(t){this.isNumeric(t,"itemPrice")&&(this._itemPrice=t)}get itemQuantity(){return this._itemQuantity}set itemQuantity(t){this.isInteger(t,"itemQuantity")&&(this._itemQuantity=Math.trunc(t))}get itemCategory(){return this._itemCategory}set itemCategory(t){this.isNotEmptyString(t,"itemCategory")&&(this._itemCategory=t)}constructor(t){super({type:r.HitType.ITEM,userIp:t.userIp,screenResolution:t.screenResolution,locale:t.locale,sessionNumber:t.sessionNumber,visitorId:t.visitorId,anonymousId:t.anonymousId,qaMode:t.qaMode,isActionTrackingHit:t.isActionTrackingHit});const{transactionId:i,productName:e,productSku:s,itemCategory:o,itemPrice:a,itemQuantity:n}=t;this.transactionId=i,this.productName=e,this.productSku=s,o&&(this.itemCategory=o),a&&(this.itemPrice=a),n&&(this.itemQuantity=n)}isReady(){return!((!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&!super.isReady()||!this.transactionId||!this.productName||!this.productSku)}toApiKeys(){const t=super.toApiKeys();return t[s.TID_API_ITEM]=this.transactionId,t[s.IN_API_ITEM]=this.productName,t[s.IC_API_ITEM]=this.productSku,this.itemPrice&&(t[s.IP_API_ITEM]=this.itemPrice),this.itemQuantity&&(t[s.IQ_API_ITEM]=this.itemQuantity),this.itemCategory&&(t[s.IV_API_ITEM]=this.itemCategory),t}toObject(){return{...super.toObject(),transactionId:this.transactionId,productName:this.productName,productSku:this.productSku,itemPrice:this.itemPrice,itemQuantity:this.itemQuantity,itemCategory:this.itemCategory}}getErrorMessage(){return a}}}}]);
//# sourceMappingURL=105.dcaf11f12fa57b23ba96.js.map