(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4184],{4184:function(e,n,i){"use strict";i.r(n),i.d(n,{Customer:function(){return u}});var a=i(20406),t=i(82841),l=i.n(t),r=i(83903),u=function(e,n){var i,t=n.behaviours;return i=(0,a.Z)(l().mark(function n(i,a){var u,o,s,d,m,c,k,v,y,N,p,f,g;return l().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!t.override){n.next=2;break}return n.abrupt("return",{firstName:"Neil Armstrong",email:"neil.armstrong@themoon.com",hashedEmail:"",wishlist:{itemCount:0,skus:[],__typename:"Wishlist"},loyalty:{pointsToNextTier:null,totalPoints:null,nonSettledPoints:null,tiers:null,product:null,earnDate:null,quantity:null,interactionType:null,orderNumber:null,earnedPoints:null,__typename:"Loyalty"},emailMarketingPreference:!1,smsMarketingPreference:!1,__typename:"Customer"});case 2:return n.next=4,e.query({query:r.P,variables:a});case 4:if((g=n.sent.data).customer){n.next=8;break}return n.abrupt("return",null);case 8:return n.abrupt("return",{firstName:g.customer.fullName.split(" ")[0],email:g.customer.email,hashedEmail:g.customer.hashedEmail,wishlist:{itemCount:(null===(u=g.customer.wishlist)||void 0===u?void 0:u.total)||0,skus:((null===(o=g.customer.wishlist)||void 0===o?void 0:o.items)||[]).map(function(e){var n,i;return(null===(n=e.selectedVariant)||void 0===n?void 0:n.sku)||(null===(i=e.product)||void 0===i?void 0:i.sku)}),__typename:"Wishlist"},emailMarketingPreference:g.customer.emailMarketingPreference||!1,smsMarketingPreference:g.customer.smsMarketingPreference||!1,loyalty:{pointsToNextTier:(null===(s=g.customer.loyaltyAccountDashboard)||void 0===s||null===(s=s.summary)||void 0===s?void 0:s.pointsToNextTier)||null,totalPoints:(null===(d=g.customer.loyaltyAccountDashboard)||void 0===d||null===(d=d.summary)||void 0===d?void 0:d.totalPoints)||null,nonSettledPoints:(null===(m=g.customer.loyaltyAccountDashboard)||void 0===m||null===(m=m.summary)||void 0===m?void 0:m.nonSettledPoints)||null,tiers:(null===(c=g.customer.loyaltyAccountDashboard)||void 0===c?void 0:c.tiers)||null,product:null===(k=g.customer.loyaltyPendingPointsInfo)||void 0===k?void 0:k.product,earnDate:null===(v=g.customer.loyaltyPendingPointsInfo)||void 0===v?void 0:v.earnDate,quantity:null===(y=g.customer.loyaltyPendingPointsInfo)||void 0===y?void 0:y.quantity,interactionType:null===(N=g.customer.loyaltyPendingPointsInfo)||void 0===N?void 0:N.interactionType,orderNumber:null===(p=g.customer.loyaltyPendingPointsInfo)||void 0===p?void 0:p.orderNumber,earnedPoints:null===(f=g.customer.loyaltyPendingPointsInfo)||void 0===f?void 0:f.earnedPoints,__typename:"Loyalty"},__typename:"Customer"});case 9:case"end":return n.stop()}},n)})),function(e,n){return i.apply(this,arguments)}}},83903:function(e){e.exports.P={kind:"Document",operationName:"MainCustomer",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"MainCustomer"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"enableWishlists"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},defaultValue:{kind:"BooleanValue",value:!1},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"enableLoyaltyAccountDashboard"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},defaultValue:{kind:"BooleanValue",value:!1},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"customer"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"fullName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"hashedEmail"},arguments:[],directives:[]},{kind:"Field",alias:{kind:"Name",value:"emailMarketingPreference"},name:{kind:"Name",value:"marketingPreferences"},arguments:[{kind:"Argument",name:{kind:"Name",value:"type"},value:{kind:"EnumValue",value:"EMAIL"}}],directives:[]},{kind:"Field",alias:{kind:"Name",value:"smsMarketingPreference"},name:{kind:"Name",value:"marketingPreferences"},arguments:[{kind:"Argument",name:{kind:"Name",value:"type"},value:{kind:"EnumValue",value:"SMS"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"wishlist"},arguments:[{kind:"Argument",name:{kind:"Name",value:"currency"},value:{kind:"EnumValue",value:"GBP"}},{kind:"Argument",name:{kind:"Name",value:"shippingDestination"},value:{kind:"EnumValue",value:"GB"}}],directives:[{kind:"Directive",name:{kind:"Name",value:"include"},arguments:[{kind:"Argument",name:{kind:"Name",value:"if"},value:{kind:"Variable",name:{kind:"Name",value:"enableWishlists"}}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"items"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"selectedVariant"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sku"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"product"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sku"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"total"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"loyaltyAccountDashboard"},arguments:[{kind:"Argument",name:{kind:"Name",value:"currency"},value:{kind:"EnumValue",value:"GBP"}}],directives:[{kind:"Directive",name:{kind:"Name",value:"include"},arguments:[{kind:"Argument",name:{kind:"Name",value:"if"},value:{kind:"Variable",name:{kind:"Name",value:"enableLoyaltyAccountDashboard"}}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"summary"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pointsToNextTier"},arguments:[],directives:[]}]}}]}}]}}]}}],loc:{source:"\nquery MainCustomer(\n $enableWishlists: Boolean! = false\n $enableLoyaltyAccountDashboard: Boolean! = false\n) {\n customer {\n fullName\n email\n hashedEmail\n emailMarketingPreference: marketingPreferences(type: EMAIL)\n smsMarketingPreference: marketingPreferences(type: SMS)\n wishlist(currency: GBP, shippingDestination: GB)\n @include(if: $enableWishlists) {\n items {\n selectedVariant {\n sku\n }\n product {\n sku\n }\n }\n total\n }\n loyaltyAccountDashboard(currency: GBP)\n @include(if: $enableLoyaltyAccountDashboard) {\n summary {\n pointsToNextTier\n }\n }\n }\n}\n"}}}}]); //# sourceMappingURL=4184.98b332b0d1dbc0e1.js.map