1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5018],{8487:(e,r,o)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/checkout/callback/googlepay",function(){return o(74041)}])},35197:(e,r,o)=>{"use strict";o.d(r,{B_:()=>y,Kf:()=>b,iT:()=>m});var a=o(74807),l=o.n(a),t=o(21239),n=o(13437),i=o(51509),d=o(40011);let{publicRuntimeConfig:u}=l()(),{googlePayEnvironment:c,googlePayMerchantName:s,googlePayMerchantId:p,googlePayGatewayId:g}=u,y=async()=>{if(window.google)return new window.google.payments.api.PaymentsClient({environment:c})},b=(e,r)=>({apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:[{type:"CARD",tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:"tuna",gatewayMerchantId:g}},parameters:{allowedCardNetworks:null==r?void 0:r.allowedCardNetworks,allowedAuthMethods:null==r?void 0:r.allowedAuthMethods,billingAddressRequired:!0,billingAddressParameters:{format:"FULL",phoneNumberRequired:!0}}}],merchantInfo:{merchantId:p,merchantName:s},transactionInfo:{totalPriceStatus:"FINAL",totalPriceLabel:"Total",totalPrice:String(e),currencyCode:"BRL",countryCode:"BR"}}),m=async(e,r,o,a)=>{try{var l,u,c,s,p,g,m,k,$;let v,h=null==r||null==(u=r.payments)||null==(l=u.summary)?void 0:l.totalPrice;if(r.googlepayResponse)v=r.googlepayResponse;else{let e=await y();v=await (null==e?void 0:e.loadPaymentData(b(h,a)))}let w=null==v||null==(s=v.paymentMethodData)||null==(c=s.tokenizationData)?void 0:c.token;if(!w)return void t.v.error("GooglePay token is null: ".concat(w));let C=await (0,d.p6)(null==e||null==(p=e.customer)?void 0:p.email,o);return{type:i.zm,currency:"BRL",installments:1,documentType:(null==e||null==(g=e.customer)?void 0:g.documentType)||(null==e||null==(k=e.passengers)||null==(m
1=k[0])?void 0:m.documentType),amount:h,paymentDetails:{googlePay:{token:w},meta:{tunaSessionId:C||null,tunaClearSaleSessionId:(null==e?void 0:e.tunaClearSaleSessionId)||null,tunaKoinSessionId:n.uW.get("koinTunaSessionId")||null,tunaSessionMpId:(null==($=window)?void 0:$.MP_DEVICE_SESSION_ID)||null}}}}catch(e){t.v.error("GooglePay Unexpected Error:",e);return}}},74041:(e,r,o)=>{"use strict";o.r(r),o.d(r,{GooglePayPayment:()=>c,__N_SSP:()=>u,default:()=>s});var a=o(7765),l=o(15977),t=o(21239),n=o(91729),i=o(76873),d=o(35197),u=!0;let c=e=>{var r;let{cms:o,params:u,whitelabel:c}=e,{payment:s}=o.content,[p,g]=(0,l.useState)(!1),y=(e,r)=>{try{let o={event:e,...r},a=(null==u?void 0:u.origin)||"*";window.parent.postMessage(o,a)}catch(e){t.v.error("Erro ao enviar postMessage para o pai:",e)}finally{window.close()}},b=async()=>{try{await new Promise((e,r)=>{if(window.google)return e();let o=document.querySelector("#google-pay-script");o||r(Error("Script do Google Pay n\xe3o encontrado.")),null==o||o.addEventListener("load",()=>{window.google?e():r(Error("Google API ainda n\xe3o dispon\xedvel."))}),null==o||o.addEventListener("error",()=>{r(Error("Falha ao carregar o script do Google Pay."))})});let e=await (0,d.B_)(),{totalPrice:r,allowedAuthMethods:o,allowedCardNetworks:a}=u,l=await (null==e?void 0:e.loadPaymentData((0,d.Kf)(Number(r),{allowedAuthMethods:o,allowedCardNetworks:a})));y("success",{paymentData:l}),g(!1)}catch(e){g(!1),t.v.error("Erro ao gerar paymentData do Google Pay:",e),y("error",{message:e.message})}};return(0,l.useEffect)(()=>{let e=new MutationObserver(()=>{let e=document.querySelector("gpay-graypane");e&&e.remove()});return e.observe(document.body,{childList:!0,subtree:!0}),()=>e.disconnect()},[]),(0,a.jsx)(i.A,{cms:o,whitelabel:c,children:(0,a.jsx)(n.A,{fill:!0,type:"submit",disabled:!!p,"data-testid":"order-button",onClick:()=>{g(!0),b(),y("start",{message:"Iniciar pagamento"})},cssDisable:{borderWidth:"1px",borderColor:"$neutralBlack100"},children:null==s||null==(r=s.newPaymentMethods)?void 0:r.orderNewButtonText})})},s=c},91729:(e,r,o)=>{"use strict";o.d(r,{$:()=>t,A:()=>n});var a=o(7765);let l=(0,o(26244).I4)("button",{flexDirection:"row",alignItems:"center",justifyContent:"center",borderRadius:"$pill",fontSize:"$xxs",defaultVariants:{layout:"primary",size:"md"},variants:{fill:{true:{width:"100%"},false:{width:"max-content"}},size:{sm:{padding:"$6px $16px"},md:{padding:"$10px $16px"},lg:{padding:"$14px $16px"},xl:{padding:"$10px $48px"}},layout:{primary:{backgroundColor:"$primary500",color:"$neutralWhite100","&:hover":{backgroundColor:"$primary600"},"&:active":{backgroundColor:"$primary800"},"&:disabled,&[disabled]":{backgroundColor:"$neutralWhite200",color:"$neutralBlack100"}},secondary:{borderWidth:"$hairline",borderColor:"$primary500",background:"transparent",color:"$primary500","&:hover":{borderColor:"$primary600",backgroundColor:"$primary100",color:"$primary600"},"&:active":{borderColor:"$primary600",backgroundColor:"$primary200",color:"$primary600"},"&:disabled,&[disabled]":{background:"transparent",borderColor:"$neutralBlack100",color:"$neutralBlack100"}},tertiary:{background:"transparent",color:"$info500","&:hover":{color:"$info600"},"&:active":{color:"$info800"},"&:disabled,&[disabled]":{color:"$neutralBlack100"}},black:{backgroundColor:"$neutralBlack500",color:"$neutralWhite100","&:hover":{backgroundColor:"$neutralBlack100"},"&:active":{backgroundColor:"$neutralBlack300"},"&:disabled,&[disabled]":{backgroundColor:"$neutralWhite200",color:"$neutralBlack100"}},white:{backgroundColor:"$neutralWhite100",color:"$neutralBlack500","&:hover":{backgroundColor:"$neutralBlack100"},"&:active":{backgroundColor:"$neutralBlack300"},"&:disabled,&[disabled]":{backgroundColor:"$neutralWhite200",color:"$neutralBlack100"}},gray:{backgroundColor:"$neutralWhite400",color:"$neutralBlack500","&:hover":{backgroundColor:"$secondary500"},"&:active, &.active":{backgroundColor:"$secondary500"},"&:disabled,&[disabled]":{backgroundColor:"$neutralWhite200",color:"$neutralBlack100"}},error:{backgroundColor:"$error500",color:"$neutralWhite100","&:hover":{backgroundColor:"$error600"},"&:active":{backgroundColor:"$error800"},"&:disabled,&[disabled]":{backgroundColor:"$neutralWhite200",color:"$neutralBlack100"}}}},"&[disabled]":{pointerEvents:"none"}}),t=e=>{let{size:r="md",type:o="button",variant:t,css:n,cssHover:i,cssActive:d,cssDisable:u,fill:c=!1,hide:s,...p}=e,g={...n,"&:hover":i,"&:active":d,"&:disabled,&[disabled]":u};return s?null:(0,a.jsx)(l,{type:o,size:r,layout:t,css:g,fill:c,...p})};t.displayName="Button";let n=t}},e=>
1{e.O(0,[8,8705,6667,2925,11,636,6593,8792],()=>e(e.s=8487)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.