1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2554,4373],{82554:function(e,n,r){r.r(n);var t=r(85893),o=r(67294),i=r(4298),l=r.n(i),a=r(97975),c=r(36955),u=r(4453);function s(e){return"eBydqSB3gHM7324qt8ak"===e?{publicKey:"pk_live_mAYDolfRrV6k1Hf8",rsaId:"fcc873be-e010-4093-997e-2ca66131f81e",rsaPublicKey:"-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD2z7ES6aQ06JDQS7WU9VqcRm+Q\nB0XP0cpbmHp6wJ4WFy/DNYA2hn7YKCI7u9UZxDj2xJjiwPw2pYrJ3MDdBM8BGwdt\n26aeJUlwnIW4fAE4hvmIluDdtPdfHz+1wm0PIoBdbWkbpfeYk835fqQxOg20f6P9\nUMxdpQVfYwdV3xj+awIDAQAB\n-----END PUBLIC KEY-----"}:(console.error("Credenciais n\xe3o encontradas para sellerId: ".concat(e)),null)}n.default=e=>{let{sellerId:n,orderData:r,handleUpdateFields:i,onReady:d,onTokenReady:f,paymentMethod:p,isRequesting:v,isSaving:b}=e,h=(0,o.useRef)(null),m=(0,o.useRef)(!1),g=(0,o.useRef)(f),[y,C]=(0,o.useState)(!1),[w,k]=(0,o.useState)(!1),x=y&&w,j=!!(v||b),q=x&&!j;function D(){let e=s(n);e&&window.Culqi3DS&&(window.Culqi3DS.publicKey=e.publicKey,k(!0))}function E(){var e,t,o,l,a,c,u;if(m.current||!window.CulqiCheckout)return;let f=s(n);if(!f){console.error("Credenciais inv\xe1lidas, abortando init do Culqi");return}m.current=!0;let v=Math.max(0,Math.round(100*Number(null!==(t=null==r?void 0:null===(e=r.total)||void 0===e?void 0:e.raw)&&void 0!==t?t:0))),b=new window.CulqiCheckout(f.publicKey,{settings:{title:"Pagamento",currency:"PEN",amount:v},client:{email:null!==(u=null!==(c=null==r?void 0:null===(l=r.allFields)||void 0===l?void 0:null===(o=l.customer)||void 0===o?void 0:o.email)&&void 0!==c?c:null==r?void 0:null===(a=r.allFields)||void 0===a?void 0:a.email)&&void 0!==u?u:""},options:{lang:"auto",installments:"creditCard"===p||"creditCard2"===p,modal:!0,paymentMethods:{tarjeta:!0,yape:!1,billetera:!1,bancaMovil:!1,agente:!1,cuotealo:!1}}});b.culqi=async function(){var e,n,r;if(null===(e=b.token)||void 0===e?void 0:e.id){let e=b.token.id,t=function(e,n){var r,t,o,i,l;let a=null!==(l=null!==(i=null!==(o=null!==(t=null==e?void 0:e.installments)&&void 0!==t?t:null==e?void 0:e.installment)&&void 0!==o?o:null==e?void 0:e.cuotas)&&void 0!==i?i:null==e?void 0:null===(r=e.metadata)||void 0===r?void 0:r.installments)&&void 0!==l?l:null==n?void 0:n.installments;if(null==a||""===a)return 1;let c=Number.parseInt(String(a),10);return Number.isFinite(c)&&c>=1?c:1}(b.token,b),o=null;try{(null===(r=window.Culqi3DS)||void 0===r?void 0:r.generateDevice)&&(o=await window.Culqi3DS.generateDevice())}catch(e){console.error("Culqi3DS generateDevice failed",e)}i({sourceId:e,installments:String(t),...o&&{deviceFingerPrintId:o}}),null===(n=g.current)||void 0===n||n.call(g),b.close();return}if(b.order){b.close();return}b.error&&console.error("Culqi checkout error",{type:b.error.type,code:b.error.code})},h.current=b,C(!0),null==d||d(()=>{var e;return null===(e=h.current)||void 0===e?void 0:e.open()})}return(0,o.useEffect)(()=>{g.current=f},[f]),(0,o.useEffect)(()=>{window.Culqi3DS&&D(),window.CulqiCheckout&&E()},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l(),{src:"https://js.culqi.com/checkout-js",strategy:"afterInteractive",onReady:E,onError:()=>console.error("Falha ao carregar o script do Culqi")}),(0,t.jsx)(l(),{src:"https://3ds.culqi.com",strategy:"afterInteractive",onReady:D,onError:()=>console.error("Falha ao carregar o script do Culqi3DS")}),(0,t.jsxs)(a.Z,{type:"button",className:"mt-2 d-inline-flex align-items-center justify-content-center",style:{width:"100%",fontWeight:"bold",borderRadius:"4px",padding:"10px 0px",backgroundColor:"#ff7800",color:"#fff",border:"none"},onClick:function(){var e;if(!h.current){console.error("Culqi ainda n\xe3o carregado");return}(null===(e=window.Culqi3DS)||void 0===e?void 0:e.reset)&&window.Culqi3DS.reset(),i({sourceId:void 0,deviceFingerPrintId:void 0,parcel:"1"}),h.current.open()},disabled:!x||j,children:[!q&&(0,t.jsx)(c.Z,{size:"sm",color:"light",className:"mr-50"}),q?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Z,{size:24}),(0,t.jsx)("span",{style:{fontSize:"16px",marginLeft:"8px"},children:"Pagar con Culqi"})]}):j?"Procesando pagamento...":"Cargando..."]})]})}},4453:function(e,n,r){var t=r(67294),o=r(45697),i=r.n(o);function l(){return(l=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e}).apply(this,arguments)}var a=(0,t.forwardRef)(function(e,n){var r=e.color,o=e.size,i=void 0===o?24:o,a=function(e,n){if(null==e)return{};var r,t,o=function(e,n){if(null==e)return{};var r,t,o={},i=Object.keys(e);for(t=0;t<i.length;t++)r=i[t],n.indexOf(r)>=0||(o[r]=e[r]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t<i.length;t++)r=i[t],!(n.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["color","size"]);return t.createElement("svg",l({ref:n,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:void 0===r?"currentColor":r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a),t.createElement("rect",{x:"1",y:"4",width:"22",height:"16",rx:"2",ry:"2"}),t.createElement("line",{x1:"1",y1:"10",x2:"23",y2:"10"}))});
1a.propTypes={color:i().string,size:i().oneOfType([i().string,i().number])},a.displayName="CreditCard",n.Z=a},97975:function(e,n,r){var t=r(87462),o=r(63366),i=r(97326),l=r(75068),a=r(67294),c=r(45697),u=r.n(c),s=r(93967),d=r.n(s),f=r(23663),p=["active","aria-label","block","className","close","cssModule","color","outline","size","tag","innerRef"],v={active:u().bool,"aria-label":u().string,block:u().bool,color:u().string,disabled:u().bool,outline:u().bool,tag:f.iC,innerRef:u().oneOfType([u().object,u().func,u().string]),onClick:u().func,size:u().string,children:u().node,className:u().string,cssModule:u().object,close:u().bool},b=function(e){function n(n){var r;return(r=e.call(this,n)||this).onClick=r.onClick.bind((0,i.Z)(r)),r}(0,l.Z)(n,e);var r=n.prototype;return r.onClick=function(e){if(this.props.disabled){e.preventDefault();return}if(this.props.onClick)return this.props.onClick(e)},r.render=function(){var e=this.props,n=e.active,r=e["aria-label"],i=e.block,l=e.className,c=e.close,u=e.cssModule,s=e.color,v=e.outline,b=e.size,h=e.tag,m=e.innerRef,g=(0,o.Z)(e,p);c&&void 0===g.children&&(g.children=a.createElement("span",{"aria-hidden":!0},"\xd7"));var y=(0,f.mx)(d()(l,{close:c},c||"btn",c||"btn"+(v?"-outline":"")+"-"+s,!!b&&"btn-"+b,!!i&&"btn-block",{active:n,disabled:this.props.disabled}),u);g.href&&"button"===h&&(h="a");var C=c?"Close":null;return a.createElement(h,(0,t.Z)({type:"button"===h&&g.onClick?"button":void 0},g,{className:y,ref:m,onClick:this.onClick,"aria-label":r||C}))},n}(a.Component);b.propTypes=v,b.defaultProps={color:"secondary",tag:"button"},n.Z=b},97326:function(e,n,r){r.d(n,{Z:function(){return t}});function t(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},75068:function(e,n,r){function t(e,n){return(t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,n){return e.__proto__=n,e})(e,n)}function o(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,t(e,n)}r.d(n,{Z:function(){return 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.