{"version":3,"sources":["dcLogger.js"],"names":["window","app","operations","objToString","value","undefined","toString","sendEvent","operation","isGuest","isMobile","result","errorDescription","event","JSON","stringify","eventType","isGuestCheckout","frontEndInfo","frontEnd","uiVersion","osVersion","visitorInfo","userCohorts","userGroup","company","GlobalSettings","Country","ID","region","visitorId","cookie","get","$","ajax","method","headers","Content-Type","data","getCohortsFromCookie","ut","cohortIds","split","i","length","substring","indexOf","getUserGroupFromCookie","usFromCookie","obj","objItem","b","sendMyAccountEvent","ug","featureInfo","type","userId","events","initCheckoutEvents","payOnInitialScreen","ourpayOnInitialScreen","description","directPayment","creditCard","paypal","paypalCredit","visacheckout","masterpass","iPay","afterpay","openpay","ourpay","currentOurpay","paymentType","toLowerCase","currentCreditCard","currentPayPal","currentMasterpass","currentVisacheckout","zipPayButtonClick","zipPayCreateOrder","zipPayCreateCharge","lPayButtonClick","lPayCreateOrder","lPayCreateCharge","humm","klarnaButtonClick","klarnaWidgetLoad","klarnaAuthorize","klarnaFinalize","klarnaCreateOrder","stripeCreditCard","stripeCurrentCreditCard","stripeThreeDSecureOpen","stripeThreeDSecurePassed","stripeThreeDSecureFail","error","changeAddress","useAnotherAddress","chooseAddressTypeSimple","chooseAddressTypePickupPoint","choosePickupPoint","useThisAddress","addressValidation","chooseSignatureDelivery","chooseDeliveryOption","optionName","selectMoreDetails","increaseItemQty","decreaseItemQty","deleteOrderItem","displayVoucherField","applyVoucher","hideVoucherField","logIn","userAgreementsTermsAndCondition","userAgreementsReceivePromotional","threeDSecureOpen","threeDSecurePassed","addressFieldFocus","addressSuggestionShow","addressSuggestionSelect","ageRestrictedDisplay","ageRestrictedOpen","ageRestrictedNotValid","ageRestrictedValid","itemNonLongerAvailable","notAvailableDeliverToLocation","stripeLoaded","stripeFailed","confirmationInfo","info","replace","login","initialized","displayed","click","fields_not_filled","login_method","signin_method","signin_customer_method","success","embeddedLogin","signinClick","signin_success","signupClick","signup_method","signup_customer_method","signup_success","forgotPasswordClick","pay_button_click","recaptcha","requesttoken","receivetoken","initMyAccountEvents","open_contact_us_from_menu","open_new_contact_from_footer","open_new_contact_from_contact_list","inviteFriend","open","sendInvites","hasPersonalInvitation","sendErrorMessageEvents","sendErrorMessageEvent","errorEventType","errorEventName","errorMessage","errorInfo","text","name"],"mappings":"CAAA,WAEIA,OAAOC,IAAMD,OAAOC,QAEpB,IAAIC,yBACe,EADfA,sBAEY,EAFZA,kBAGQ,EAHRA,wBAIc,EAJdA,sBAKY,EALZA,kBAMQ,EANRA,oBAOU,EAPVA,gBAQM,EARNA,6BAUmB,EAVnBA,yBAWe,EAXfA,yBAYe,GAZfA,6BAamB,GAbnBA,+BAcqB,GAdrBA,yBAgBe,GAhBfA,6BAiBmB,GAjBnBA,mCAkByB,GAlBzBA,wCAmB8B,GAnB9BA,6BAoBmB,GApBnBA,0BAqBgB,GArBhBA,6BAsBmB,GAtBnBA,mCAuByB,GAvBzBA,gCAyBsB,GAzBtBA,6BA0BmB,GA1BnBA,2BA4BiB,GA5BjBA,2BA6BiB,GA7BjBA,+BA+BqB,GA/BrBA,wBAgCc,GAhCdA,4BAiCkB,GAjClBA,iBAmCO,GAnCPA,2CAqCiC,GArCjCA,4CAsCkC,GAtClCA,8BAwCoB,GAxCpBA,iCAyCuB,GAzCvBA,wBA2Cc,GA3CdA,+BA4CqB,GA5CrBA,4BA8CkB,IA9ClBA,8BA+CoB,IA/CpBA,mBAiDS,IAjDTA,6BAmDmB,IAnDnBA,6BAoDmB,IApDnBA,8BAqDoB,IArDpBA,2BAuDiB,IAvDjBA,2BAwDiB,IAxDjBA,4BAyDiB,IAzDjBA,gBA2DM,IA3DNA,6BA6DmB,IA7DnBA,4BA8DkB,IA9DlBA,2BA+DiB,IA/DjBA,0BAgEgB,IAhEhBA,6BAiEmB,IAjEnBA,4BAmEkB,IAnElBA,mCAoEyB,IApEzBA,kCAqEwB,IArExBA,oCAsE0B,IAtE1BA,kCAuEwB,IAvExBA,6BAyEmB,IAzEnBA,iCA0EuB,IA1EvBA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KC,WACbC,UAAW,GACXuJ,WACIhH,KAAM6G,eACNI,KAAMF,aACNG,KAAMJ,gBAEVnJ,cACIC,SAAUT,SAAW,iBAAmB,kBACxCU,UAAW,GACXC,UAAW,IAEfC,aACIC,YAAakB,UACbjB,UAAW6B,GAAO,GAAIA,GAAO,GAAI,KACjC5B,QAASC,eAAeC,QAAQC,GAChCC,OAAQ,GACRC,UAAW7B,IAAI8B,OAAOC,IAAI,KAC1BwB,OAAQ,MAGhBvB,EAAEC,KAAK,gCAECC,OAAQ,OACRC,SACIC,eAAgB,oBAEpBC,KAAMzB,QA8XNsJ,CAAsBC,eAAgBC,eAAgBC,aAAc5J,aAppBpF","file":"dcLogger.min.js","sourcesContent":["(function() {\n \n window.app = window.app || {};\n\n var operations = {\n DirectPayment: 0,\n CreditCard: 1,\n PayPal: 2,\n VisaCheckout: 3,\n Masterpass: 4,\n Ourpay: 5,\n Afterpay: 6,\n IPay: 7,\n\n CurrentCreditCard: 8,\n CurrentPayPal: 9,\n CurrentOurpay: 10,\n CurrentMasterpass: 11,\n CurrentVisacheckout: 12,\n\n ChangeAddress: 13,\n UseAnotherAddress: 14,\n ChooseAddressTypeSimple: 15,\n ChooseAddressTypePickupPoint: 16,\n ChoosePickupPoint: 17,\n UseThisAddress: 18,\n AddressValidation: 19,\n ChooseSignatureDelivery: 20,\n\n ChooseDeliveryOption: 21,\n SelectMoreDetails: 22,\n\n IncreaseItemQty: 23,\n DecreaseItemQty: 24,\n\n DisplayVoucherField: 25,\n ApplyVoucher: 26,\n HideVoucherField: 27,\n\n LogIn: 28,\n\n UserAgreementsTermsAndCondition: 30,\n UserAgreementsReceivePromotional: 31,\n\n PayOnInitialScreen: 50,\n OurpayOnInitialScreen: 51,\n\n PayPalCredit: 98,\n CurrentPayPalOurpay: 99,\n\n ThreeDSecureOpen: 100,\n ThreeDSecurePassed: 101,\n\n Openpay: 200,\n\n ZipPayButtonClick: 300,\n ZipPayCreateOrder: 301,\n ZipPayCreateCharge: 302,\n\n LPayButtonClick: 350,\n LPayCreateOrder: 351,\n LPayCreateCharge:352,\n\n Humm: 400,\n\n KlarnaButtonClick: 450,\n KlarnaWidgetLoad: 451,\n KlarnaAuthorize: 452,\n KlarnaFinalize: 453,\n KlarnaCreateOrder: 454,\n\n StripeCreditCard: 500,\n StripeCurrentCreditCard: 501,\n StripeThreeDSecureOpen: 520,\n StripeThreeDSecurePassed: 521,\n StripeThreeDSecureFail: 522,\n\n AddressFieldFocus: 600,\n AddressSuggestionShow: 601,\n AddressSuggestionSelect: 602,\n\n AgeRestrictedOpen: 700,\n AgeRestrictedDisplay: 701,\n AgeRestrictedValid: 704,\n AgeRestrictedNotValid: 705,\n\n ItemNonLongerAvailable: 800,\n\n recaptcha_requesttoken: 1003,\n recaptcha_receivetoken: 1004,\n\n open_contact_us_from_menu: 1035,\n open_new_contact_from_footer: 1037,\n open_new_contact_from_contact_list: 1038,\n\n login_initialized: 2000,\n login_displayed: 2001,\n login_click: 2002,\n login_fields_not_filled: 2003,\n\n login_login_method: 2004,\n login_signin_method: 2005,\n login_signin_customer_method: 2006,\n\n login_success: 2007,\n\n embeddedLogin_signin_click: 2100,\n embeddedLogin_signin_method: 2101,\n embeddedLogin_signin_customer_method: 2102,\n embeddedLogin_signin_success: 2103,\n embeddedLogin_signup_click: 2104,\n embeddedLogin_signup_method: 2105,\n embeddedLogin_signup_customer_method: 2106,\n embeddedLogin_signup_success: 2107,\n embeddedLogin_forgotPassword_click: 2108,\n embeddedLogin_fields_not_filled: 2109,\n embeddedLogin_pay_button_click: 2110,\n\n DeleteItemQty: 2225,\n\n inviteFriend_openPage: 3000,\n inviteFriend_sendInvites_with_personal_invitation: 3001,\n inviteFriend_sendInvites_without_personal_invitation: 3002,\n\n not_available_deliver_to_location: 4000,\n\n stripe_loaded: 4100,\n stripe_failed: 4101,\n\n confirmationInfo: 4200\n };\n\n var objToString = function(value) {\n if (value === undefined) {\n return 'undefined';\n }\n if (value === null) {\n return 'null';\n }\n if (typeof (value) === 'boolean') {\n return value.toString();\n }\n return '';\n }\n\n var sendEvent = function(operation, isGuest, isMobile, result, errorDescription) {\n if (result === undefined) {\n result = true;\n }\n errorDescription = errorDescription || '';\n\n var event = JSON.stringify({\n eventType: 8,\n operation: operation,\n result: result ? 1 : 0,\n errorDescription: errorDescription,\n isGuestCheckout: isGuest,\n\n frontEndInfo: {\n frontEnd: isMobile ? \"Mobile website\" : \"Desktop website\",\n uiVersion:\"\",\n osVersion:\"\"\n },\n visitorInfo: {\n userCohorts: null,\n userGroup: null,\n company: GlobalSettings.Country.ID,\n region: \"\",\n visitorId: app.cookie.get('v')\n }\n });\n $.ajax('/api/shop/eventing/v1/events',\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n data: event\n });\n };\n\n var getCohortsFromCookie = function (ut) {\n var cohortIds = null;\n if (ut) {\n cohortIds = ut.split(\"&\");\n if (cohortIds) {\n for (i = 0; i < cohortIds.length; i++) {\n cohortIds[i] = cohortIds[i].substring(cohortIds[i].indexOf(\"=\") + 1, cohortIds[i].length);\n }\n }\n }\n\n return cohortIds;\n }\n\n var getUserGroupFromCookie = function (usFromCookie) {\n var userGroup = {};\n if (usFromCookie) {\n var obj = usFromCookie.split('&');\n for (var i = 0; i < obj.length; i++) {\n var objItem = obj[i];\n if (objItem) {\n var b = objItem.split('=');\n if (b) {\n userGroup[b[0]] = b[1];\n }\n }\n }\n }\n return userGroup;\n }\n\n var sendMyAccountEvent = function (eventType, operation, isMobile) {\n\n var cohortIds = getCohortsFromCookie(app.cookie.get('ut'));\n var ug = getUserGroupFromCookie(app.cookie.get('us'));\n\n var event = JSON.stringify({\n eventType: eventType,\n frontEndInfo: {\n frontEnd: isMobile ? \"Mobile website\" : \"Desktop website\",\n uiVersion: \"\",\n osVersion: \"\"\n },\n featureInfo: {\n type: operation\n },\n visitorInfo: {\n userCohorts: cohortIds,\n userGroup: ug['ug'] ? ug['ug'] : null,\n company: GlobalSettings.Country.ID,\n region: \"\",\n visitorId: app.cookie.get('v'),\n userId: \"\"\n }\n });\n $.ajax('/api/shop/eventing/v1/events',\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n data: event\n });\n };\n\n var sendErrorMessageEvent = function (errorEventType, errorEventName, errorMessage, isMobile) {\n\n var cohortIds = getCohortsFromCookie(app.cookie.get('ut'));\n var ug = getUserGroupFromCookie(app.cookie.get('us'));\n\n var event = JSON.stringify({\n eventType: 23,\n errorInfo: {\n type: errorEventType,\n text: errorMessage,\n name: errorEventName\n },\n frontEndInfo: {\n frontEnd: isMobile ? \"Mobile website\" : \"Desktop website\",\n uiVersion: \"\",\n osVersion: \"\"\n },\n visitorInfo: {\n userCohorts: cohortIds,\n userGroup: ug['ug'] ? ug['ug'] : null,\n company: GlobalSettings.Country.ID,\n region: \"\",\n visitorId: app.cookie.get('v'),\n userId: \"\"\n }\n });\n $.ajax('/api/shop/eventing/v1/events',\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n data: event\n });\n };\n\n window.app.events = {\n initCheckoutEvents: function(isGuest, isMobile) {\n return {\n payOnInitialScreen: function() {\n /* only for mobile sites */\n sendEvent(operations.PayOnInitialScreen, isGuest, isMobile);\n },\n\n ourpayOnInitialScreen: function(result, description) {\n /* only for mobile sites */\n sendEvent(operations.OurpayOnInitialScreen, isGuest, isMobile, result, description);\n },\n\n directPayment: function() {\n sendEvent(operations.DirectPayment, isGuest, isMobile);\n },\n\n creditCard: function() {\n sendEvent(operations.CreditCard, isGuest, isMobile);\n },\n\n paypal: function() {\n sendEvent(operations.PayPal, isGuest, isMobile);\n },\n\n paypalCredit: function() {\n sendEvent(operations.PayPalCredit, isGuest, isMobile);\n },\n\n visacheckout: function() {\n sendEvent(operations.VisaCheckout, isGuest, isMobile);\n },\n\n masterpass: function() {\n sendEvent(operations.Masterpass, isGuest, isMobile);\n },\n\n iPay: function() {\n sendEvent(operations.IPay, isGuest, isMobile);\n },\n\n afterpay: function() {\n sendEvent(operations.Afterpay, isGuest, isMobile);\n },\n\n openpay: function () {\n sendEvent(operations.Openpay, isGuest, isMobile);\n },\n\n ourpay: function() {\n sendEvent(operations.Ourpay, isGuest, isMobile);\n },\n\n currentOurpay: function(paymentType) {\n var operation = operations.CurrentOurpay;\n if (paymentType && paymentType.toLowerCase() === 'paypal') {\n operation = operations.CurrentPayPalOurpay;\n }\n sendEvent(operation, isGuest, isMobile);\n },\n\n currentCreditCard: function() {\n sendEvent(operations.CurrentCreditCard, isGuest, isMobile);\n },\n\n currentPayPal: function() {\n sendEvent(operations.CurrentPayPal, isGuest, isMobile);\n },\n\n currentMasterpass: function() {\n sendEvent(operations.CurrentMasterpass, isGuest, isMobile);\n },\n\n currentVisacheckout: function() {\n sendEvent(operations.CurrentVisacheckout, isGuest, isMobile);\n },\n \n zipPayButtonClick: function () {\n sendEvent(operations.ZipPayButtonClick, isGuest, isMobile);\n },\n \n zipPayCreateOrder: function () {\n sendEvent(operations.ZipPayCreateOrder, isGuest, isMobile);\n },\n \n zipPayCreateCharge: function() {\n sendEvent(operations.ZipPayCreateCharge, isGuest, isMobile);\n },\n \n lPayButtonClick: function () {\n sendEvent(operations.LPayButtonClick, isGuest, isMobile);\n },\n \n lPayCreateOrder: function () {\n sendEvent(operations.LPayCreateOrder, isGuest, isMobile);\n },\n \n lPayCreateCharge: function() {\n sendEvent(operations.LPayCreateCharge, isGuest, isMobile);\n },\n \n humm: function() {\n sendEvent(operations.Humm, isGuest, isMobile);\n },\n\n klarnaButtonClick: function () {\n sendEvent(operations.KlarnaButtonClick, isGuest, isMobile);\n },\n\n klarnaWidgetLoad: function () {\n sendEvent(operations.KlarnaWidgetLoad, isGuest, isMobile);\n },\n\n klarnaAuthorize: function () {\n sendEvent(operations.KlarnaAuthorize, isGuest, isMobile);\n },\n\n klarnaFinalize: function () {\n sendEvent(operations.KlarnaFinalize, isGuest, isMobile);\n },\n\n klarnaCreateOrder: function () {\n sendEvent(operations.KlarnaCreateOrder, isGuest, isMobile);\n },\n\n\n stripeCreditCard: function() {\n sendEvent(operations.StripeCreditCard, isGuest, isMobile);\n },\n stripeCurrentCreditCard: function() {\n sendEvent(operations.StripeCurrentCreditCard, isGuest, isMobile);\n },\n stripeThreeDSecureOpen: function() {\n sendEvent(operations.StripeThreeDSecureOpen, isGuest, isMobile);\n },\n stripeThreeDSecurePassed: function() {\n sendEvent(operations.StripeThreeDSecurePassed, isGuest, isMobile);\n },\n stripeThreeDSecureFail: function(error) {\n sendEvent(operations.StripeThreeDSecureFail, isGuest, isMobile, null, error);\n },\n\n\n changeAddress: function() {\n sendEvent(operations.ChangeAddress, isGuest, isMobile);\n },\n\n useAnotherAddress: function() {\n sendEvent(operations.UseAnotherAddress, isGuest, isMobile);\n },\n\n chooseAddressTypeSimple: function() {\n sendEvent(operations.ChooseAddressTypeSimple, isGuest, isMobile);\n },\n\n chooseAddressTypePickupPoint: function() {\n sendEvent(operations.ChooseAddressTypePickupPoint, isGuest, isMobile);\n },\n\n choosePickupPoint: function() {\n sendEvent(operations.ChoosePickupPoint, isGuest, isMobile);\n },\n\n useThisAddress: function() {\n sendEvent(operations.UseThisAddress, isGuest, isMobile);\n },\n\n addressValidation: function(result, errorDescription) {\n sendEvent(operations.AddressValidation, isGuest, isMobile, result, errorDescription);\n },\n\n chooseSignatureDelivery: function() {\n sendEvent(operations.ChooseSignatureDelivery, isGuest, isMobile);\n },\n\n chooseDeliveryOption: function(optionName) {\n sendEvent(operations.ChooseDeliveryOption, isGuest, isMobile, true, optionName || '');\n },\n\n selectMoreDetails: function() {\n sendEvent(operations.SelectMoreDetails, isGuest, isMobile);\n },\n\n increaseItemQty: function() {\n sendEvent(operations.IncreaseItemQty, isGuest, isMobile);\n },\n\n decreaseItemQty: function() {\n sendEvent(operations.DecreaseItemQty, isGuest, isMobile);\n },\n\n deleteOrderItem: function() {\n sendEvent(operations.DeleteItemQty, isGuest, isMobile);\n },\n\n displayVoucherField: function() {\n sendEvent(operations.DisplayVoucherField, isGuest, isMobile);\n },\n\n applyVoucher: function() {\n sendEvent(operations.ApplyVoucher, isGuest, isMobile);\n },\n\n hideVoucherField: function() {\n sendEvent(operations.HideVoucherField, isGuest, isMobile);\n },\n\n logIn: function() {\n sendEvent(operations.LogIn, isGuest, isMobile);\n },\n\n userAgreementsTermsAndCondition: function(value) {\n sendEvent(operations.UserAgreementsTermsAndCondition, isGuest, isMobile, true, objToString(value));\n },\n\n userAgreementsReceivePromotional: function(value) {\n sendEvent(operations.UserAgreementsReceivePromotional, isGuest, isMobile, true, objToString(value));\n },\n\n threeDSecureOpen: function() {\n sendEvent(operations.ThreeDSecureOpen, isGuest, isMobile);\n },\n\n threeDSecurePassed: function() {\n sendEvent(operations.ThreeDSecurePassed, isGuest, isMobile);\n },\n \n addressFieldFocus: function() {\n sendEvent(operations.AddressFieldFocus, isGuest, isMobile);\n },\n\n addressSuggestionShow: function() {\n sendEvent(operations.AddressSuggestionShow, isGuest, isMobile);\n },\n\n addressSuggestionSelect: function() {\n sendEvent(operations.AddressSuggestionSelect, isGuest, isMobile);\n },\n\n ageRestrictedDisplay: function () {\n sendEvent(operations.AgeRestrictedDisplay, isGuest, isMobile);\n },\n\n ageRestrictedOpen: function () {\n sendEvent(operations.AgeRestrictedOpen, isGuest, isMobile);\n },\n\n ageRestrictedNotValid: function () {\n sendEvent(operations.AgeRestrictedNotValid, isGuest, isMobile);\n },\n\n ageRestrictedValid: function () {\n sendEvent(operations.AgeRestrictedValid, isGuest, isMobile);\n },\n\n itemNonLongerAvailable: function () {\n sendEvent(operations.ItemNonLongerAvailable, isGuest, isMobile);\n },\n\n notAvailableDeliverToLocation: function () {\n sendEvent(operations.not_available_deliver_to_location, isGuest, isMobile);\n },\n\n stripeLoaded: function () {\n sendEvent(operations.stripe_loaded, isGuest, isMobile);\n },\n\n stripeFailed: function () {\n sendEvent(operations.stripe_failed, isGuest, isMobile);\n },\n\n confirmationInfo: function (info) {\n sendEvent(operations.confirmationInfo, isGuest, isMobile, true, info.replace(/.*(.{20}$)/g, '***$1'));\n }\n };\n },\n login: {\n initialized: function () {\n sendEvent(operations.login_initialized, false, false);\n },\n displayed: function () {\n sendEvent(operations.login_displayed, false, false);\n },\n click: function () {\n sendEvent(operations.login_click, false, false);\n },\n fields_not_filled: function () {\n sendEvent(operations.login_fields_not_filled, false, false);\n },\n\n login_method: function () {\n sendEvent(operations.login_login_method, false, false);\n },\n signin_method: function () {\n sendEvent(operations.login_signin_method, false, false);\n },\n signin_customer_method: function () {\n sendEvent(operations.login_signin_customer_method, false, false);\n },\n\n success: function () {\n sendEvent(operations.login_success, false, false);\n }\n },\n embeddedLogin: {\n signinClick: function () {\n sendEvent(operations.embeddedLogin_signin_click, false, false);\n },\n signin_method: function () {\n sendEvent(operations.embeddedLogin_signin_method, false, false);\n },\n signin_customer_method: function () {\n sendEvent(operations.embeddedLogin_signin_customer_method, false, false);\n },\n signin_success: function () {\n sendEvent(operations.embeddedLogin_signin_success, false, false);\n },\n\n signupClick: function () {\n sendEvent(operations.embeddedLogin_signup_click, false, false);\n },\n signup_method: function () {\n sendEvent(operations.embeddedLogin_signup_method, false, false);\n },\n signup_customer_method: function () {\n sendEvent(operations.embeddedLogin_signup_customer_method, false, false);\n },\n signup_success: function () {\n sendEvent(operations.embeddedLogin_signup_success, false, false);\n },\n\n forgotPasswordClick: function () {\n sendEvent(operations.embeddedLogin_forgotPassword_click, false, false);\n },\n\n fields_not_filled: function () {\n sendEvent(operations.embeddedLogin_fields_not_filled, false, false);\n },\n\n pay_button_click: function () {\n sendEvent(operations.embeddedLogin_pay_button_click, false, false);\n }\n },\n recaptcha: {\n requesttoken: function() {\n sendEvent(operations.recaptcha_requesttoken, false, false);\n },\n receivetoken: function() {\n sendEvent(operations.recaptcha_receivetoken, false, false);\n }\n },\n initMyAccountEvents: function (isMobile) {\n return {\n open_contact_us_from_menu: function () {\n sendMyAccountEvent(18, operations.open_contact_us_from_menu, isMobile);\n },\n open_new_contact_from_footer: function () {\n sendMyAccountEvent(18, operations.open_new_contact_from_footer, isMobile);\n },\n open_new_contact_from_contact_list: function () {\n sendMyAccountEvent(18, operations.open_new_contact_from_contact_list, isMobile);\n }\n }\n },\n inviteFriend: {\n open: function () {\n sendEvent(operations.inviteFriend_openPage, false, false);\n },\n sendInvites: function (result, errorDescription, hasPersonalInvitation) {\n if (hasPersonalInvitation) {\n sendEvent(operations.inviteFriend_sendInvites_with_personal_invitation, false, false, result, errorDescription);\n } else {\n sendEvent(operations.inviteFriend_sendInvites_without_personal_invitation, false, false, result, errorDescription);\n }\n }\n },\n sendErrorMessageEvents: {\n sendErrorMessageEvent: function (errorEventType, errorEventName, errorMessage, isMobile) {\n sendErrorMessageEvent(errorEventType, errorEventName, errorMessage, isMobile);\n }\n }\n };\n})();"]}