import{H as t,q as i,v as e,I as r,w as s,x as a,y as o,z as n}from"./ppyR687H.js";import"events";const u="Transaction Id, Item name and item code are required";class c extends t{_transactionId;_productName;_productSku;_itemPrice;_itemQuantity;_itemCategory;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:i.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:e,productName:r,productSku:s,itemCategory:a,itemPrice:o,itemQuantity:n}=t;this.transactionId=e,this.productName=r,this.productSku=s,a&&(this.itemCategory=a),o&&(this.itemPrice=o),n&&(this.itemQuantity=n)}isReady(t=!0){return!(t&&!super.isReady()||!this.transactionId||!this.productName||!this.productSku)}toApiKeys(){const t=super.toApiKeys();return t[e]=this.transactionId,t[r]=this.productName,t[s]=this.productSku,this.itemPrice&&(t[a]=this.itemPrice),this.itemQuantity&&(t[o]=this.itemQuantity),this.itemCategory&&(t[n]=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 u}}export{u as ERROR_MESSAGE,c as Item};
//# sourceMappingURL=CkMg1-VY.js.map
