import{a as E,b as g}from"./chunk-IO2MXSIA.js";import{h as d}from"./chunk-G3CUAKBR.js";import{a as y,b as T,c as m,g as I,n as v,p as C}from"./chunk-XI2EB733.js";import{a as l}from"./chunk-JWAFQ6PQ.js";import{b as A}from"./chunk-E5SP5NNO.js";import{e as a,f,g as _}from"./chunk-ALDBR463.js";var u=function(r){return r.LISTING="Listing",r.INSURANCE_IMEI_INFO="Insurance IMEI Info",r.QUICK_CART="Quick Cart",r.DELIVERED_TAB="Delivered Tab",r.INSURANCE_AVAILABILITY_POP_UP="Insurance Availability Pop Up",r}(u||{}),s=function(r){return r.LOGIN="Login",r.INFO_ICON="Info Icon",r.T_AND_C="T&C",r.ADD_INSURANCE="Add Insurance",r.PREMIUM_PLAN_UNAVAILABLE="Premium Plan Unavailable",r}(s||{});var i=class{static createNullDeviceInfo(){return{insured_device_name:null,insured_device_brand:null,insured_device_category:null}}static createKnownDeviceInfo(e,t,n){return{insured_device_name:e,insured_device_brand:t,insured_device_category:A[n]}}static createLoginButtonEvent(){return{event:m.MIKRO_USER_CLICK,event_category:I.USER_PROFILE,event_action:u.LISTING,event_label:s.LOGIN,event_value:v.ZERO}}static createIMEIInfoEvent(){return{event:m.MIKRO_USER_CLICK,event_category:I.PRODUCT_DETAIL,event_action:u.INSURANCE_IMEI_INFO,event_label:s.INFO_ICON,event_value:v.ZERO}}static createTermsConditionsEvent(){return{event:m.MIKRO_USER_CLICK,event_category:I.CHECKOUT,event_action:u.QUICK_CART,event_label:s.T_AND_C,event_value:v.ZERO}}static createAddInsuranceFromOrdersEvent(){return{event:m.MIKRO_USER_CLICK,event_category:I.ORDERS_HISTORY,event_action:u.DELIVERED_TAB,event_label:s.ADD_INSURANCE,event_value:v.ZERO}}static createPremiumPlanUnavailableEvent(){return{event:m.MIKRO_EVENT,event_category:I.PRODUCT_DETAIL,event_action:u.INSURANCE_AVAILABILITY_POP_UP,event_label:s.PREMIUM_PLAN_UNAVAILABLE}}static createEcommerceEvent(e,t,n){return{eventType:e,productData:t,additionalData:n}}static typeOfCartItemIsInsuranceOffering(e){return e.__typename==="PendingCartResource"&&e.items.some(t=>t?.__typename==="CartItemSubResource"&&t.product?.__typename==="InsuranceOfferingSubResource")}static createAddToCartEvent(e,t,n,o){return{event:C.addToCart,page_type:g.insurance,page_section:E.main_offer,shop_type:"B2C",ecommerce:{currencyCode:l.EUR,add:{customerId:t?.ssoId,products:this.mapAddToCartImpression(e,n,o)}}}}static createProductImpressionEvent(e,t,n){return{event:C.productImpression,page_type:g.insurance,page_section:E.main_offer,shop_type:"B2C",ecommerce:{currencyCode:l.EUR,impressions:{products:this.mapAddToCartImpression(e,t,n)}}}}static createProductDetailEvent(e){return{event:C.productDetail,page_type:g.insurance,page_section:E.main_offer,shop_type:"B2C",ecommerce:{currencyCode:l.EUR,detail:{products:e.length?this.mapAddToCartImpression(e):[]}}}}static mapAddToCartImpression(e,t,n){return e.map((o,p)=>({brand:o.insured_device_brand||d.brand,category:"asigurari",file:"insurance.tracking.helper",id:t?.insuranceId.toString()||n?.newInsuranceId.toString()||d.id,img_url:t?.productDetails.thumbnail||d.img_url,item_name_full:d.name,list:void 0,name:d.name,position:p,price:void 0,reviews:null,color:d.color,memory:d.memory,base_price:void 0,period:void 0,installments:t?.term.value,transactionSubType:void 0,transactionType:y.insurance,retail_price:void 0,promotion_name:void 0,abonamentAtasat:void 0,availability:T.inStock,quantity:1,gift:void 0,insured_device_category:o.insured_device_category,insured_device_brand:o.insured_device_brand,insured_device_name:o.insured_device_name}))}};var c=f({source:"Insurance Tracking",events:{"Category Page Loaded":a(),"Login Button Clicked":_(),"Product Page Loaded":a(),"IMEI Info Icon Clicked":_(),"Add Insurance Clicked":a(),"Premium Plan Unavailable Popup Shown":_(),"Cart Page Loaded":a(),"Premium Upgrade Added":a(),"Insurance Removed From Cart":a(),"Cart Reloaded After Product Change":a(),"Terms And Conditions Clicked":_(),"Complete OrderClicked":a(),"Add Insurance From Orders Clicked":_(),"Track Mikro Gtm Event":a(),"Track DataLayer Event":a(),"Track Ecommerce Event":a()}}),R=class{static categoryPageLoaded(){return c.categoryPageLoaded({productData:i.createNullDeviceInfo()})}static loginButtonClicked(){return c.trackMikroGtmEvent({eventData:i.createLoginButtonEvent()})}static productPageLoaded(){return c.productPageLoaded({productData:i.createNullDeviceInfo()})}static imeiInfoClicked(){return c.trackMikroGtmEvent({eventData:i.createIMEIInfoEvent()})}static addInsuranceClicked(e,t,n,o,p){return c.addInsuranceClicked({productData:i.createKnownDeviceInfo(e,t,n),insurance:o,userIdentity:p})}static premiumPlanUnavailablePopupShown(){return c.trackDataLayerEvent({eventData:i.createPremiumPlanUnavailableEvent()})}static premiumUpgradeAdded(e,t,n,o,p){return c.premiumUpgradeAdded({productData:i.createKnownDeviceInfo(e,t,n),upgradedInsurance:o,userIdentity:p})}static termsConditionsClicked(){return c.trackMikroGtmEvent({eventData:i.createTermsConditionsEvent()})}static completeOrderClicked(){return c.trackMikroGtmEvent({eventData:i.createAddInsuranceFromOrdersEvent()})}};export{i as a,c as b,R as c};