enqueueScripts([function(){ (window.webpackJsonpvtexventures_livestreaming_free_0_45_1=window.webpackJsonpvtexventures_livestreaming_free_0_45_1||[]).push([[11],{157:function(e,n){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"updateOrderFormMarketingData"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MarketingDataInput"}}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtexventures.livestreaming-free@0.45.1",block:!1}}]},{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"b8baa932c70b3673e7978c61af098be097c8eb0ccf1774d419f9fb7d419d0fe0",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateOrderFormMarketingData"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"provider"},value:{kind:"StringValue",value:"vtex.checkout-graphql",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"marketingData"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"utmSource"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:394}};t.loc.source={body:'mutation updateOrderFormMarketingData($input: MarketingDataInput!) @context(sender: "vtexventures.livestreaming-free@0.45.1") @runtimeMeta(hash: "b8baa932c70b3673e7978c61af098be097c8eb0ccf1774d419f9fb7d419d0fe0") {\n updateOrderFormMarketingData(input: $input) @context(provider: "vtex.checkout-graphql") {\n id\n marketingData {\n utmSource\n __typename\n }\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var a={};function i(e,n){for(var t=0;t0;){var d=u;u=new Set,d.forEach((function(e){o.has(e)||(o.add(e),(a[e]||new Set).forEach((function(e){u.add(e)})))}))}return o.forEach((function(n){var a=i(e,n);a&&t.definitions.push(a)})),t}(t,"updateOrderFormMarketingData")},89:function(e,n,t){"use strict";var a=t(3),i=t.n(a),r=t(5),o=t(0),u=t.n(o),d=t(12),c=t.n(d),s=t(75),l=t.n(s),m=t(53),v=t(9),f=t(105),k=t.n(f),p=t(28),b=t(15),g=t(7),w=t(157),h=t.n(w),O=function(e){var n=e.client,t=e.utm,a=e.orderFormObject,o=a.orderForm,u=a.setOrderForm,d=setTimeout(Object(r.a)(i.a.mark((function e(){var a;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:if(!(!t||t===(null===(a=null==o?void 0:o.marketingData)||void 0===a?void 0:a.utmSource))){e.next=5;break}return e.abrupt("return");case 5:return e.next=7,n.mutate({mutation:h.a,variables:{input:{utmSource:t}}});case 7:u(Object.assign(Object.assign({},o),{marketingData:Object.assign(Object.assign({},null==o?void 0:o.marketingData),{utmSource:t})}));case 8:case"end":return e.stop()}}),e)}))),1e4);return function(){return clearTimeout(d)}},S=l.a.useOrderItems,D=["player"];n.a=function(e){var n,t,a,d=e.livestreamingId,s=Object(v.useRuntime)(),l=s.production,f=s.account,w=S().addItems,h=(t=Object(g.useApolloClient)(),a=Object(m.useOrderForm)(),{setUTM:(n=Object(r.a)(i.a.mark((function e(n){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",O({client:t,orderFormObject:a,utm:n}));case 1:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})}).setUTM,F=Object(m.useOrderForm)().orderForm,N=c()(D),x=k()().addToCartConfig,y=null===window||void 0===window?void 0:window.nizza,j=Object(o.useCallback)(function(){var e=Object(r.a)(i.a.mark((function e(n){var t,a,r,o;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.product,a=n.quantity,r=void 0===a?1:a,y){e.next=5;break}if(y=null===window||void 0===window?void 0:window.nizza){e.next=5;break}return e.abrupt("return");case 5:return o=y.utils.buildVtexCartItem(t,r),e.abrupt("return",w([o]));case 7:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),[w]),_=Object(o.useMemo)((function(){return{config:{environment:l?"prod":"dev",account:f,idLivestreaming:d,originOfProducts:"VTEX",isInGlobalPage:!1,isInfinite:!0,redirectTo:!1,showChat:!0,showLike:!0,showQuickView:!0,showProductsCarousel:!1,showSidebarProducts:!0,showViewers:!0,time:10,currentOrderForm:F.id,setUTM:h,addToCartConfig:Object.assign(Object.assign({},x),{actionFactory:Object.assign({addToCart:j},null==x?void 0:x.actionFactory)})}}}),[d,F.id]),M=Object(b.i)({id:"nz-player",src:p.a.nzPlayerScript,renderProps:_}).script;return u.a.createElement("div",{className:N.player,id:null==M?void 0:M.fullId})}}}]); },function(){ (window.webpackJsonpvtexventures_livestreaming_free_0_45_1=window.webpackJsonpvtexventures_livestreaming_free_0_45_1||[]).push([["ClientLivestreaming"],{0:function(e,n){e.exports=React},1:function(e,n){e.exports=ReactIntl},105:function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtexventures.livestreaming-utils@0.x/useLivestreaming"]},12:function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@0.x/useCssHandles"]},156:function(e,n){var i={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getLiveStreamingsLive"},variableDefinitions:[],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtexventures.livestreaming-free@0.45.1",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"liveStreamingsLive"},arguments:[],directives:[{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"d0145d4c8188af25992bc0badea5a0e7bdfc2177a4d18a6a1d276ff71efcf37b",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"eventName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:241}};i.loc.source={body:'query getLiveStreamingsLive @context(sender: "vtexventures.livestreaming-free@0.45.1") {\n liveStreamingsLive @runtimeMeta(hash: "d0145d4c8188af25992bc0badea5a0e7bdfc2177a4d18a6a1d276ff71efcf37b") {\n id\n eventName\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var t={};function a(e,n){for(var i=0;i0;){var d=s;s=new Set,d.forEach((function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(n){var t=a(e,n);t&&i.definitions.push(t)})),i}(i,"getLiveStreamingsLive")},178:function(e,n,i){"use strict";i.r(n),function(e){var n=i(11);i.p=Object(n.getPublicPath)("vtexventures.livestreaming-free@0.45.1");var t=Object(n.register)((function(){return i(179)}),e,"vtexventures.livestreaming-free@0.45.1","vtexventures.livestreaming-free@0.x","ClientLivestreaming");t.renderHotReload,t.setupHMR}.call(this,i(32)(e))},179:function(e,n,i){"use strict";i.r(n),i.d(n,"schema",(function(){return g}));var t=i(25),a=i(0),r=i.n(a),o=i(7),s=i(1),d=i(53),u=i(9),c=i(156),l=i.n(c),v=i(89),m=Object(s.defineMessages)({id:{id:"admin/editor.live-streaming.id"},title:{id:"admin/editor.live-streaming.title"},showComponent:{id:"admin/editor.live-streaming.show-component"}}),f={title:m.id.id,type:"string",default:"__default__",enum:[""],enumNames:[""]},_=function(e){var n=e.showComponent,i=Object(u.useRuntime)().query,s=null==i?void 0:i.__siteEditor,c=Object(o.useQuery)(l.a,{fetchPolicy:"network-only",ssr:!1,skip:!s}),m=c.loading,_=c.data;return Object(a.useEffect)((function(){var e;if(!(m||!(null===(e=null==_?void 0:_.liveStreamingsLive)||void 0===e?void 0:e.length)||(null==f?void 0:f.enum.length)>1||(null==f?void 0:f.enumNames.length)>1)){var n=null==_?void 0:_.liveStreamingsLive,i=n.map((function(e){return e.id})),a=n.map((function(e){return e.eventName}));f=Object.assign(Object.assign({},f),{enum:[].concat(Object(t.a)(f.enum),Object(t.a)(i)),enumNames:[].concat(Object(t.a)(f.enumNames),Object(t.a)(a))})}}),[_,m]),n?r.a.createElement(d.OrderFormProvider,null,r.a.createElement(v.a,{livestreamingId:e.idLiveStreamingLive})):null},g=function(){return{title:m.title.id,type:"object",properties:{showComponent:{title:m.showComponent.id,type:"boolean"},idLiveStreamingLive:Object.assign({},f)}}};_.displayName="ConfigureLiveStreaming",_.getSchema=g,n.default=_},29:function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.session-client@1.x/useFullSession"]},36:function(e,n){e.exports=regeneratorRuntime},41:function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.session-client@1.x/useRenderSession"]},53:function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.order-manager@0.x/OrderForm"]},7:function(e,n){e.exports=ReactApollo},75:function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.order-items@0.x/OrderItems"]},9:function(e,n){e.exports=__RENDER_8_RUNTIME__}},[[178,"common",3,1,2,11]]]); }], document.currentScript.dataset.index)