(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1692],{6675:function(e,a,t){var n={"./siigo-button-icon-atom_2.entry.js":[8836,8836]};function i(e){if(!t.o(n,e))return Promise.resolve().then(function(){var a=Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a});var a=n[e],i=a[0];return t.e(a[1]).then(function(){return t(i)})}i.keys=function(){return Object.keys(n)},i.id=6675,e.exports=i},19482:function(e){e.exports={payment_details:"PaymentDetails_payment_details__Aef0V",payment_details__title:"PaymentDetails_payment_details__title__5dh0n",payment_details__layout:"PaymentDetails_payment_details__layout__VKA97",modal__container:"PaymentDetails_modal__container__D6gsR",modal__overlay:"PaymentDetails_modal__overlay__oPD1p",payment_details__modal:"PaymentDetails_payment_details__modal__Bcp3t",payment_details__modal__header:"PaymentDetails_payment_details__modal__header__EDKj7",payment_details__modal__title:"PaymentDetails_payment_details__modal__title__0gQ_G",payment_details__modal__body:"PaymentDetails_payment_details__modal__body__HzBN5",container__tooltip__visible:"PaymentDetails_container__tooltip__visible__UdbQ3",container__tooltip__diamond:"PaymentDetails_container__tooltip__diamond__qW8GK",container_cards__items:"PaymentDetails_container_cards__items__RCj3T",payment_details__modal__close:"PaymentDetails_payment_details__modal__close__4rNgv",payment_details__modal_container:"PaymentDetails_payment_details__modal_container__vAaIL",payment_details__color_discount:"PaymentDetails_payment_details__color_discount__AmS6R",input_base:"PaymentDetails_input_base__b4vHN",payment_details__action_container:"PaymentDetails_payment_details__action_container__tHl4R",payment_details__subtitle:"PaymentDetails_payment_details__subtitle___KAC1",payment_details__continue_btn:"PaymentDetails_payment_details__continue_btn__Z3pjC",payment_details__discount:"PaymentDetails_payment_details__discount__QOx6a",payment_details__icon_remove:"PaymentDetails_payment_details__icon_remove__Q8oZa",payment_details__row:"PaymentDetails_payment_details__row__Mtokh",font__14:"PaymentDetails_font__14__9TOvt","payment_details__row--simple":"PaymentDetails_payment_details__row--simple__g3BD8","payment_details__row--border":"PaymentDetails_payment_details__row--border___YiA1","payment_details__row--subtitle":"PaymentDetails_payment_details__row--subtitle__9A4K4","payment_details__row--subtitle--btn":"PaymentDetails_payment_details__row--subtitle--btn__atTyQ","payment_details__row--subtitle--name":"PaymentDetails_payment_details__row--subtitle--name__5HoUJ",payment_details__details:"PaymentDetails_payment_details__details__eEndH",payment_details__details__item:"PaymentDetails_payment_details__details__item__1ZmWe",payment_details__details__item__active:"PaymentDetails_payment_details__details__item__active__kg8_O",payment_details__details__item__disabled:"PaymentDetails_payment_details__details__item__disabled__bJEZz",payment_details__details__item__name:"PaymentDetails_payment_details__details__item__name__DF_Po"}},49792:function(e){e.exports={create_account_form__title:"CreateAccountForm_create_account_form__title__3VKM3",create_account_form:"CreateAccountForm_create_account_form__9vxxs","input_base__form-label":"CreateAccountForm_input_base__form-label__Z5Zc_",create_account_form__subtitle:"CreateAccountForm_create_account_form__subtitle__vexXE",create_account_form__create_btn_desktop:"CreateAccountForm_create_account_form__create_btn_desktop__6vRlm",create_account_form__create_btn:"CreateAccountForm_create_account_form__create_btn__AQtJX",create_account_form__form:"CreateAccountForm_create_account_form__form__CQp51","create_account_form__form--first":"CreateAccountForm_create_account_form__form--first__1Itcw",create_account_form__form__section:"CreateAccountForm_create_account_form__form__section__tBTzx",create_account_form__policy:"CreateAccountForm_create_account_form__policy__65Dny",create_account_form__login:"CreateAccountForm_create_account_form__login__QVq6a",create_account_form__link:"CreateAccountForm_create_account_form__link__P0CZx",create_account_form__center:"CreateAccountForm_create_account_form__center__rAui2",validatorContainer:"CreateAccountForm_validatorContainer__Dnuet",create_account_form__float:"CreateAccountForm_create_account_form__float__mUUyU",create_account_form__float_container:"CreateAccountForm_create_account_form__float_container__c6XMR",create_account_form__create_btn_mobile:"CreateAccountForm_create_account_form__create_btn_mobile__ht8is",formSectionBuy:"CreateAccountForm_formSectionBuy__4fPNS"}},53566:function(e,a,t){"use strict";t.d(a,{q:function(){return z}});var n=t(74848),i=t(96540),o=t(18473),l=t(14953),r=t.n(l),s=t(94137),c=t(47123),_=t(16933),u=t(9115),d=t(76424),m=t(86715),p=t(63474),y=t(45971);let v={invalid:"El c\xf3digo es inv\xe1lido"},h=async e=>{let{place:a,country:t,code:n,productCode:i,paymentDetails:o}=e;try{let e="/shop/product/siigo-com/".concat(i,"/").concat(n,"/get"),{product:l}=await (await fetch("".concat("https://services.siigo.com/strategy/api","/").concat(e,"?country=").concat(t,"&place=").concat(a))).json();return{code:n,amount:l.price+o.additionalAmount,additionalAmount:o.additionalAmount,total:l.prices.anual.values.total+o.additionalAmount,discount:l.prices.anual.discount.value,discountPercentage:l.prices.anual.discount.number,codeDiscountPercentage:l.activeCampaigns.upgrade.find(e=>e.code===n).configurations.discount.value,codeDiscountValue:l.prices.anual.discount.value-o.discountValue,isErrorCode:!1,errorDescription:""}}catch(e){return{isErrorCode:!0,errorDescription:v.invalid}}},b=async e=>{let a=await fetch("/api/recaptcha/validate/",{method:"POST",headers:{"Content-type":"application/json"},body:JSON.stringify(e)});return a.ok?await a.json():{score:0,success:!1,challenge_ts:"",hostname:"","error-codes":[]}},f={validateUserActive:async e=>{try{return(await (await fetch("/api/products/validate-user",{method:"POST",headers:{"Content-type":"application/json"},body:JSON.stringify({document:e})})).json()).active}catch(e){return console.error("ERROR: VALIDATE USER",e),"Error"}}};var P=t(937),g=t(21396);let C=e=>{var a;let{adminName:t,companyName:n,prospectIdType:i,nit:o,adminMail:l,adminPhoneNumber:r,product:s,campaign:c,prospectType:_,urlCampaign:u,virtualMedia:d,saleType:m,salePeriodicity:p,giftMonth:v,origin:h,amount:b,discount:f,documentCode:P,adminPass:C,AmountFC:D,comboProduct:j,productAdditionals:A,discountCodes:w=[],score:E,getProductById:F,internalDiscountPercentage:T=0}=e,S=s.version===y.KM.VERSION_2&&!!(null===(a=s.products)||void 0===a?void 0:a.idComboConversion),I=A.length>0,M=S&&I&&T>0,O={amount:b,productName:s.productName,productDesc:s.productName,value:b,productList:"",quantity:"",quotationLines:[]};if(S)N(s,O,F,T);else{let e=s.combo?s.combo.idProductMain:s.id;O.productList=e,O.quantity='[{"code":'.concat(e,',"quantity":1,"license":0}]'),O.quotationLines.push({ItemCode:e,Quantity:1,DiscountPercentage:f,AmountDC:b,AmountFC:D,IsDelete:0,OriginalTotalPrice:D,PriceList:null,SalesPrice:b,fee:1,feeValue:D})}!S&&j&&(O.productList+="-_-".concat(j.comboId),O.quotationLines.push({ItemCode:j.comboId,Quantity:1,DiscountPercentage:j.percentageDiscount,AmountDC:j.yearPrice,AmountFC:j.yearPriceDiscount||j.yearPrice,IsDelete:0,OriginalTotalPrice:j.yearPriceDiscount||j.yearPrice,PriceList:null,SalesPrice:j.yearPrice,fee:1,feeValue:j.yearPriceDiscount||j.yearPrice})),A.forEach(e=>{var a,t,n;O.productList+="-_-".concat(e.id),O.quotationLines.push({ItemCode:e.id,Quantity:1,DiscountPercentage:null!==(a=e.percentageDiscount)&&void 0!==a?a:0,AmountDC:null!==(t=e.yearPrice)&&void 0!==t?t:0,AmountFC:e.yearPriceDiscount||e.yearPrice||0,IsDelete:0,OriginalTotalPrice:e.yearPriceDiscount||e.yearPrice||0,PriceList:null,SalesPrice:null!==(n=e.yearPrice)&&void 0!==n?n:0,fee:1,feeValue:e.yearPriceDiscount||e.yearPrice||0})});let R="9380002000011";O.productList+="-_-".concat(R),O.quotationLines.push(x(R));let q=O.quotationLines.reduce((e,a)=>e+a.AmountFC,0),L=O.quotationLines.reduce((e,a)=>e+a.AmountDC,0),V=M?q:L,k=(0,g.SHA256)(f>0?"1-"+V+"-"+f+"-"+q+"-"+l:"1-"+V+"-"+V+"-"+l).toString(),z={productId:"998989",origen:h,adminMail:l,payerCountry:"CO",firma:k,discount:f,amount:q,isCustomProduct:f>0,productName:O.productName,productDesc:O.productDesc,adminName:t,adminPhoneNumber:r,siigoResponseUrl:"https://siigonube.siigo.com/ISIIGO2/Login.aspx?ReturnUrl=%2fISIIGO2%2fDefault.aspx",prospectIdType:i,customerID:o,nit:o,currency:"COP",siigoaccount:1,companyName:n,value:V,productList:O.productList,quantity:O.quantity,quotationLines:O.quotationLines,prospectType:_,campaign:c,urlCampaign:u,virtualMedia:d,verificationDigit:null!=P?P:"",adminPass:C,saleType:m,salePeriodicity:p,giftMonth:v,discountCodes:w,score:E};return console.debug("comprar - get_Payment_form_params",z),z},x=e=>({ItemCode:String(e),Quantity:1,DiscountPercentage:0,AmountDC:0,AmountFC:0,IsDelete:0,OriginalTotalPrice:0,PriceList:null,SalesPrice:0,fee:1,feeValue:0}),N=(e,a,t,n)=>{let{required:i=[],idComboConversion:o}=e.products;o&&(i.forEach(i=>{var l;let r=t(i);if(!r)return;let s=i===e.products.idProductToConvert?o:i,c=null!==(l=r.yearPrice)&&void 0!==l?l:0,_=Math.round(n/100*c),u=c-_;a.productList+=a.productList?"-_-".concat(s):s,a.quotationLines.push({ItemCode:s,Quantity:1,DiscountPercentage:n,AmountDC:c,AmountFC:u,IsDelete:0,OriginalTotalPrice:u,PriceList:null,SalesPrice:c,fee:1,feeValue:u})}),a.quantity='[{"code":'.concat(o,',"quantity":1,"license":0}]'))},D={CREATE_ACCOUNT_FORM:0,PAYMENT_DETAILS:1,PAYMENT_FORM:2,FINISH:3},j={default:{stepper:[!1,!1,!0,!0],footer:!1,goBack:!1,layout:[!1,!1,!1,!1],showDetail:!1},"/comprar/":{stepper:[!0,!0,!0,!0],footer:!1,goBack:!0,layout:[!0,!0,!0,!0],showDetail:!0}},A=e=>{var a,t;let{productResponse:n,plan:o,origin:l,isOnly:r}=e,s=(0,d.useSearchParams)(),{executeRecaptcha:c}=(0,p.lw)(),{asPath:_}=(0,u.u)(),v=(0,i.useMemo)(()=>{var e;return null!==(e=j[_.split("?")[0]])&&void 0!==e?e:j.default},[_]),g=null!=o?o:s.get("plan")||"",x=s.get("campaign"),N=s.get("virtualMedia"),A=s.get("urlCampaign"),w=null!=l?l:s.get("origin"),E=s.get("transactionId"),F=s.get("referenceCode"),{getProductByKey:T,getProductByComboId:S,getProductById:I}=n,M=T(g),O=(0,P.K)(e=>e.buycartItems),R=(0,i.useMemo)(()=>{var e;let a=O.find(e=>e.mainProduct===M.id);return null!==(e=null==a?void 0:a.optionalProducts.map(e=>I(e)))&&void 0!==e?e:[]},[O,M]),q=(0,m.useRouter)(),L=(0,i.useMemo)(()=>(null==R?void 0:R.length)?R.reduce((e,a)=>{var t;return e+(null!==(t=null==a?void 0:a.yearPrice)&&void 0!==t?t:0)},0):0,[R]),[V,k]=(0,i.useState)(E||F?D.FINISH:D.CREATE_ACCOUNT_FORM),[z,B]=(0,i.useState)({adminName:"",companyName:"",prospectIdType:"",nit:"",verificationDigit:"",adminPhoneNumber:"",prospectType:"",adminMail:"",adminPass:""}),[U,Q]=(0,i.useState)({amount:(null!==(a=null==M?void 0:M.yearPrice)&&void 0!==a?a:0)+L,additionalAmount:L,tax:0,discount:0,discountValue:0,discountPercentage:0,codeDiscountPercentage:0,codeDiscountValue:0,code:"",isErrorCode:!1,errorDescription:"",total:(null!==(t=null==M?void 0:M.yearPrice)&&void 0!==t?t:0)+L}),[Y,H]=(0,i.useState)(!1),K=e=>{var a,t;if(null==e?void 0:e.yearPriceDiscount){let{yearPriceDiscount:a,yearPrice:t,percentageDiscount:n,valueDiscount:i}=e,o={amount:(null!=t?t:0)+L,tax:0,additionalAmount:L,discount:i,discountValue:i,discountValuePercentage:n,discountPercentage:n,codeDiscountPercentage:0,codeDiscountValue:0,code:"",errorCode:"",total:a+L};return Q(o),o}let n={amount:(null!==(a=null==M?void 0:M.yearPrice)&&void 0!==a?a:0)+L,additionalAmount:L,tax:0,discount:0,discountValue:0,discountPercentage:0,codeDiscountPercentage:0,codeDiscountValue:0,code:"",errorCode:"",total:(null!==(t=null==M?void 0:M.yearPrice)&&void 0!==t?t:0)+L};return Q(n),n};(0,i.useEffect)(()=>{K(M)},[M,L]),(0,i.useLayoutEffect)(()=>{g||V!==D.CREATE_ACCOUNT_FORM||q.push("/404")},[]);let[X,G]=(0,i.useState)(null),$=(0,i.useCallback)(()=>{V===D.CREATE_ACCOUNT_FORM?window.history.back():k(e=>e-1)},[V]),Z=(0,i.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=q.query;q.push({pathname:"/compra-final",query:a}),window.scrollTo({top:0,behavior:"smooth"});let t=null!=e?e:z,n=(null==M?void 0:M.combo)?S(M.combo.idOtherProductAlias):null,i=(null==M?void 0:M.combo)?I(M.combo.idProductMain):null,o=await c("form_buy"),l=await b({code:o}),{amount:s,AmountFC:_}=J(M,i,R),u=R.length>0?0:U.discountPercentage,d=await C({...t,companyName:t.companyName||t.adminName,product:M,productAdditionals:R,origin:"siigocom",campaign:x||"VentaSiigocom",urlCampaign:A||window.location.href,virtualMedia:N||"Pagina Web",saleType:"Venta Nueva",amount:s,discount:u,salePeriodicity:"Anual",giftMonth:0,AmountFC:_,comboProduct:n,score:l.score,discountCodes:U.code?[U.code]:[],getProductById:I,internalDiscountPercentage:U.discountPercentage});window.scrollTo({top:0,behavior:"smooth"}),G(d),k(D.PAYMENT_FORM),!v.showDetail&&r&&r(!0)},[M,U,z]),J=(e,a,t)=>{var n;if(e.combo&&a&&e.version===y.KM.VERSION_1)return{amount:a.yearPrice,AmountFC:a.yearPrice};let i=e.yearPrice,o=(null!==(n=e.yearPriceDiscount)&&void 0!==n?n:0)>0?e.yearPriceDiscount:i;return t.length>0?{amount:o,AmountFC:o}:{amount:i,AmountFC:o}},W=(0,i.useCallback)(async e=>{if(""===e)return K(M),!1;let a=await h({place:w,country:"CO",code:e,productCode:null==M?void 0:M.id,paymentDetails:U});return Q(e=>({...e,...a})),a},[M,w,U]),ee=async e=>{let{target:a}=e,{value:t}=a;t.length<5||(await f.validateUserActive(t)?H(!0):H(!1))};return{stage:V,paymentParams:X,showAlert:Y,setShowAlert:H,goBack:$,paymentDetails:U,goToPaymentDetails:e=>{window.scrollTo({top:0,behavior:"smooth"}),B(e),v.showDetail?k(D.PAYMENT_DETAILS):(r&&r(!0),Z(e))},goToPayments:Z,goToPaymentFinished:()=>{let e={};Object.entries({plan:g,campaign:x,virtualMedia:N,urlCampaign:A,origin:w}).forEach(a=>{let[t,n]=a;n&&(e[t]=n)}),q.push({pathname:"/compra-final",query:e}),window.scrollTo({top:0,behavior:"smooth"}),k(D.FINISH)},product:M,accountFormData:z,redirectToShop:()=>{let e=(null==M?void 0:M.combo)?S(M.combo.idOtherProductAlias):null,a=encodeURIComponent(btoa(JSON.stringify({productsToBuy:M.combo&&e?[{id:M.combo.idProductMain},{id:e.id}]:[{id:M.idCrossSelling?M.idCrossSelling:M.id}]}))),t="".concat("https://siigonube.siigo.com","/#/login?redirect_to=shop/products/cart?externalData=").concat(a);window.location.href=t},verifyUser:ee,getDiscount:W,rule:v,productAdditionals:R}};t(95739);var w=t(34164),E=t(82646),F=t(42520),T=t(19482),S=t.n(T);let I=e=>{var a;let{goToPayments:t,productAdditionals:o,product:l,paymentDetails:r,getDiscount:_}=e,[u,d]=(0,i.useState)(!1),[m,p]=(0,i.useState)(),[y,v]=(0,i.useState)(""),{isMobileOnly:h}=(0,E.wN)(),b=(0,P.K)(e=>e.clearSession),f=(0,i.useCallback)(async()=>{(await _(y)).isErrorCode||v("")},[y,v,_]),g=(0,i.useMemo)(()=>o.length>0?[l,...o]:[l],[l,o]),C=(null==l?void 0:null===(a=l.rules)||void 0===a?void 0:a.allowCoupons)!==!1,x=()=>{t(),h&&b()};return(0,n.jsxs)("section",{className:S().payment_details,children:[(0,n.jsx)("h2",{className:S().payment_details__title,children:"Resumen de compra"}),g.map((e,a)=>(0,n.jsxs)("div",{className:(0,w.A)({[S().payment_details__row]:!0,[S()["payment_details__row--border"]]:a===g.length-1}),children:[(0,n.jsxs)("div",{className:S()["payment_details__row--subtitle"],children:[(0,n.jsx)("span",{className:S()["payment_details__row--subtitle--name"],children:null==e?void 0:e.name}),h?(0,n.jsx)("button",{onClick:()=>{p(e),d(!0)},className:S()["payment_details__row--subtitle--btn"],children:"Ver detalle"}):(0,n.jsx)(c.$n,{onClick:()=>{p(e),d(!0)},size:"s",color:"tertiary",text:"Ver detalle"})]}),(0,n.jsx)("span",{className:S().payment_details__subtitle,children:(0,F.vv)(null==e?void 0:e.yearPrice)})]},e.name)),(0,n.jsxs)("div",{className:"".concat(S().payment_details__row," ").concat(S().font__14),children:[(0,n.jsx)("span",{children:"Subtotal"}),(0,n.jsx)("span",{children:(0,F.vv)(r.amount)})]}),(0,n.jsxs)("div",{className:"".concat(S().payment_details__row," ").concat(S().font__14),children:[(0,n.jsxs)("span",{children:["Descuentos (",r.discountValuePercentage,"%)"]}),(0,n.jsx)("span",{className:r.discountValue>0?S().payment_details__color_discount:"",children:(0,F.vv)(r.discountValue)})]}),C&&(""===r.code?(0,n.jsxs)("div",{className:"".concat(S().payment_details__row," ").concat(S()["payment_details__row--border"]),children:[(0,n.jsx)(s.pd,{label:"C\xf3digo de descuento",onChange:e=>{let{target:a}=e;v(a.value)},messageError:r.errorDescription}),(0,n.jsx)(c.$n,{onClick:f,size:"m",color:"secondary",text:"Validar"})]}):(0,n.jsxs)("div",{className:"".concat(S().payment_details__row," ").concat(S()["payment_details__row--border"]),children:[(0,n.jsxs)("span",{children:["C\xf3digo de descuento (",r.codeDiscountPercentage,"%)"]}),(0,n.jsxs)("span",{className:"".concat(S()["payment_details__row--simple"]," ").concat(S().payment_details__color_discount),children:[(0,n.jsx)("span",{className:r.codeDiscountValue>0?S().payment_details__discount:"",children:(0,F.vv)(r.codeDiscountValue)}),(0,n.jsx)("i",{onClick:()=>{_("")},className:"fas fa-solid fa-trash ".concat(S().payment_details__icon_remove)})]})]})),(0,n.jsxs)("div",{className:S().payment_details__row,children:[(0,n.jsx)("span",{className:S().payment_details__subtitle,children:"Total a pagar"}),(0,n.jsx)("span",{className:S().payment_details__subtitle,children:(0,F.vv)(r.total)})]}),(0,n.jsx)("div",{className:S().payment_details__action_container,children:(0,n.jsx)(c.$n,{onClick:()=>x(),size:"l",className:S().payment_details__continue_btn,color:"primary-blue",text:"Continuar"})}),(0,n.jsx)(s.aF,{showModal:u,setShowModal:d,children:(0,n.jsx)("div",{className:S().payment_details__modal_container,children:(0,n.jsxs)("div",{className:S().payment_details__modal,children:[(0,n.jsxs)("div",{className:S().payment_details__modal__header,children:[(0,n.jsx)("h2",{className:S().payment_details__modal__title,children:null==m?void 0:m.name}),(0,n.jsx)("span",{className:S().payment_details__modal__close,onClick:()=>{d(!1)},children:"\xd7"})]}),(0,n.jsx)("div",{className:S().payment_details__modal__body,children:(0,n.jsx)("ul",{className:S().payment_details__details,children:null==m?void 0:m.items.map((e,a)=>(0,n.jsxs)("div",{className:S().payment_details__details__item,children:[(0,n.jsxs)("li",{children:[(0,n.jsx)("i",{className:"fas fa-check ".concat((null==e?void 0:e.active)?S().payment_details__details__item__active:S().payment_details__details__item__disabled)}),(0,n.jsx)("span",{className:S().payment_details__details__item__name,children:null==e?void 0:e.name})]},"".concat(a,"_pricing_item")),(null==e?void 0:e.active)&&(0,n.jsx)(s.m_,{contentTooltip:null==e?void 0:e.tooltip,alignTooltip:"right",positionTooltip:"center-left"})]},"payment_detail_".concat(a)))})})]})})})]})},M=(0,i.lazy)(()=>Promise.all([t.e(8985),t.e(6551)]).then(t.bind(t,66551)).then(e=>({default:e.PaymentForm}))),O=e=>{let{paymentParams:a,goToPaymentFinished:t}=e,[o,l]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{o&&t()},[o]),(0,n.jsx)(i.Suspense,{fallback:(0,n.jsx)("div",{}),children:(0,n.jsx)(M,{setPayFinalized:l,testMode:!1,data:a})})};var R=t(13368),q=t.n(R),L=t(81025),V=t.n(L);let k=r()(()=>Promise.resolve().then(t.bind(t,95739)).then(e=>({default:e.CreateAccountForm})),{loadableGenerated:{webpack:()=>[95739]},ssr:!1,loading:()=>(0,n.jsx)(n.Fragment,{})}),z=e=>{var a;let{stage:t,goBack:l,goToPaymentDetails:r,goToPaymentFinished:_,goToPayments:d,product:m,getDiscount:p,showAlert:y,setShowAlert:v,redirectToShop:h,verifyUser:b,accountFormData:f,paymentDetails:P,paymentParams:g,rule:C,productAdditionals:x}=A(e),{hasNotification:N}=m,[j,w]=(0,i.useState)([]);return(0,i.useEffect)(()=>{w([N])},[]),(0,n.jsxs)(B,{...e,rule:C,stage:t,children:[(0,n.jsxs)(q(),{children:[(0,n.jsx)("meta",{name:"robots",content:"noindex"}),(0,n.jsx)("title",{children:"Compra tus productos favoritos de Siigo aqu\xed"}),(0,n.jsx)("meta",{name:"description",content:"\xa1Compra online y accede al instante a tus productos Siigo! Facturaci\xf3n electr\xf3nica y n\xf3mina electr\xf3nica en minutos al mejor precio."})]}),(0,n.jsxs)("main",{className:V()["buy-plan"],children:[C.stepper[t]&&(0,n.jsx)(s.C1,{className:V()["buy-plan__stepper"],isContainer:!1,isVisible:t!==D.FINISH,steps:["Elige un plan","Crea tu cuenta","Finaliza tu compra"],currentStep:t===D.PAYMENT_FORM?2:1}),(0,n.jsx)("div",{className:V()["buy-plan__layout"]}),(0,n.jsx)("div",{className:V()["buy-plan__layout"],children:(0,n.jsxs)("div",{className:V()["buy-plan__container"],children:[(t===D.PAYMENT_DETAILS||t===D.CREATE_ACCOUNT_FORM)&&C.goBack&&(0,n.jsx)(c.$n,{onClick:()=>{l()},size:"l",color:"tertiary",icon:"fa fa-chevron-left",text:"Regresar"}),!y&&t!==D.FINISH&&(0,n.jsx)("div",{className:V()["buy-plan__notification_inline"],children:(0,n.jsx)(u.ap,{notifications:j,onClose:()=>w(e=>e.slice(1)),variation:!1})}),y&&(0,n.jsx)("div",{className:V()["buy-plan__feature_container"],children:(0,n.jsx)("div",{className:V()["buy-plan__feature"],children:(0,n.jsx)(o.L,{type:"warning",style:{width:"100%"},textBody:{text:"Este n\xfamero de documento ya est\xe1 registrado en nuestro sistema. Finaliza tu compra en Tienda Siigo,",callToAction:"haz click aqu\xed."},showCloseButton:!1,onCallToAction:()=>h()})})}),(t===D.PAYMENT_DETAILS||t===D.CREATE_ACCOUNT_FORM)&&(0,n.jsx)("div",{className:V()["buy-plan__feature_container"],children:(0,n.jsxs)("div",{className:V()["buy-plan__feature"],children:[(0,n.jsx)("div",{className:"".concat(V()["buy-plan__col"]," ").concat(C.showDetail?"":V()["buy-plan__col__fw"]),children:(0,n.jsx)("div",{className:"".concat(t===D.PAYMENT_DETAILS?V()["buy-plan__hide--mobile"]:""),children:(0,n.jsx)(k,{goToPaymentDetails:r,goToPayments:d,verifyUser:b,accountFormData:f,useShowAlert:[y,v],...{...null!==(a=e.createAccountForm)&&void 0!==a?a:{}}})})}),C.showDetail&&(0,n.jsx)("div",{className:V()["buy-plan__col"],children:(0,n.jsx)("div",{className:"".concat(t===D.CREATE_ACCOUNT_FORM?V()["buy-plan__hide--mobile"]:""),children:(0,n.jsx)(I,{goToPayments:d,product:m,getDiscount:p,paymentDetails:P,productAdditionals:x})})})]})}),(t===D.PAYMENT_FORM||t===D.FINISH)&&(0,n.jsx)(O,{paymentParams:g,goToPaymentFinished:_})]})})]})]})},B=e=>{let{children:a,rule:t,stage:i,...o}=e;return t.layout[i]?(0,n.jsx)(_.PE,{sharedComponents:o.sharedComponents,showFooter:t.footer,isPeru:!1,children:null!=a?a:""}):(0,n.jsx)(n.Fragment,{children:a})}},81025:function(e){e.exports={"buy-plan":"BuyFlux_buy-plan__5N5bb","buy-plan__stepper":"BuyFlux_buy-plan__stepper__XSM9c","buy-plan__container":"BuyFlux_buy-plan__container__PhTQG","buy-plan__hide--mobile":"BuyFlux_buy-plan__hide--mobile__Mgqkh","buy-plan__layout":"BuyFlux_buy-plan__layout__9_2KW","wc---notifications-inline":"BuyFlux_wc---notifications-inline__acp2Y",container_cicle__label:"BuyFlux_container_cicle__label__jlOaI","buy-plan__feature_container":"BuyFlux_buy-plan__feature_container__Qm3vO","buy-plan__feature":"BuyFlux_buy-plan__feature__kPDEx","buy-plan__col":"BuyFlux_buy-plan__col__0roA_","buy-plan__col__fw":"BuyFlux_buy-plan__col__fw__jOCEe","buy-plan__notification_inline":"BuyFlux_buy-plan__notification_inline__DBays"}},95739:function(e,a,t){"use strict";t.r(a),t.d(a,{CreateAccountForm:function(){return E}});var n=t(74848),i=t(96540),o=t(72487),l=t(77855),r=t(16933),s=t(82646),c=t(937),_=t(81771),u=t(42520);let d=[{label:"",value:""},{label:"C\xe9dula de ciudadan\xeda",value:"C"},{label:"NIT",value:"N"},{label:"Pasaporte",value:"P"},{label:"Nro \xdanico ID Personal",value:"V"},{label:"C\xe9dula de Extranjer\xeda",value:"E"},{label:"Tarjeta de Identidad",value:"T"},{label:"Registro Civil",value:"G"},{label:"Tarjeta de Extranjer\xeda",value:"X"},{label:"Tipo Documento Extranjero",value:"D"},{label:"RUC",value:"R"},{label:"RUT",value:"U"}],m=[{label:"",value:""},{label:"Si",value:"Soy Contador Independiente"},{label:"No",value:"Soy empresario"}],{max:p,req:y,passwordEqual:v,emailEqual:h,errorNames:b,requiredField:f,errorCompanyName:P,errorPhone:g,errorEmail:C,errorDocument:x}={min:"El valor Min\xedmo es de $",max:"El valor M\xe1ximo es de $",req:"El campo es requerido",email:"El correo electr\xf3nico no es correcto",requiredField:"Campo obligatorio",passwordEqual:"La contrase\xf1a no coincide",emailEqual:"El email no coincide",formatPhone:"El formato del celular es incorrecto",errorNames:"Comprueba tus nombres y apellidos",errorCompanyName:"Comprueba tu raz\xf3n social",errorVerificationCode:"Comprueba tu n\xfamero de verificaci\xf3n",errorPhone:"Ingresa un n\xfamero de celular v\xe1lido. Ejemplo: 3126713650",errorEmail:"Ingresa un email v\xe1lido. Ejemplo: ejemplo@email.com",errorDocument:"Comprueba tu n\xfamero de documento",errorCodeVerification:"El n\xfamero de verificaci\xf3n debe estar en un rango de 0 a 9"},N=(e,a)=>({value:a,message:e.replace("$",a)}),D=e=>{let{value:a}=e;return a.substring(0,a.length-1)},j=e=>{let{verifyUser:a,isInvalidNit:t,setIsInvalidNit:n}=e,i=[{id:"prospectIdType","data-id":"sltProspectIdType",type:"select",name:"prospectIdType",label:"Tipo Documento",children:d,size:2,required:!0,rules:{required:y,onChange:(e,a)=>{let{target:t}=e,{unregister:n,trigger:o}=a,l=i.findIndex(e=>"nit"===e.id),r=i.findIndex(e=>"companyName"===e.id),s=i.findIndex(e=>"adminName"===e.id);o("prospectIdType"),l&&r&&("N"===t.value||"R"===t.value||"U"===t.value?(i[l].input&&(i[l].input.hideField=!1),i[r].hideField=!1,i[s].size=2):(i[l].input&&(i[l].input.hideField=!0),i[r].hideField=!0,i[s].size=2,n("documentCode"),n("companyName")))}}},{id:"nit",type:"identification",name:"nit",label:"N\xfamero de documento",className:"input__identification",size:2,required:!0,rules:{required:f,minLength:{value:5,message:x},validate:e=>{let a=(0,u.Ye)(e);return(a.test&&(e=a.value),e.length<5||e.length>20)?x:!t||"Usuario ya registrado"},onBlur:async(e,t)=>{let{trigger:n}=t;await a(e),setTimeout(()=>{n("nit")},200)},onChange:(e,a)=>{let{target:i}=e,{trigger:o,setValue:l}=a;i.value.length>20&&l("nit",D({value:i.value})),t&&n(!1),setTimeout(()=>{o("nit")},200)}},input:{id:"documentCode",type:"number",name:"documentCode",label:"DV",hideField:!0,sizeInput:15,disabled:!0}},{id:"companyName",type:"text",name:"companyName",label:"Raz\xf3n social",size:4,required:!0,hideField:!0,rules:{required:f,minLength:{value:2,message:P},maxLength:N(p,50)}},{id:"adminName",type:"text",name:"adminName",label:"Nombres y apellidos",size:2,rules:{required:f,maxLength:N(p,100),minLength:{value:2,message:b},validate:e=>(0,u.YX)(e)||b}},{id:"adminPhoneNumber",type:"number",name:"adminPhoneNumber",label:"Celular",size:2,rules:{min:{value:10,message:g},required:f,minLength:{value:6,message:g},validate:e=>(0,u.V$)(e)||g,onChange:(e,a)=>{let{target:t}=e,{setValue:n}=a;t.value.length>10&&n("adminPhoneNumber",D({value:t.value}))}}},{id:"prospectType","data-id":"sltProspectType",type:"select",name:"prospectType",label:"\xbfEres contador?",size:2,children:m,hideField:!0,rules:{required:y}},{id:"adminMail",type:"email",name:"adminMail",label:"E-mail",size:2,rules:{required:f,validate:e=>(0,u.Bj)(e)||C}},{id:"adminEmailRetry",type:"email",name:"adminEmailRetry",label:"Confirmar e-mail",size:2,rules:{required:f,validate:(e,a)=>e===a.adminMail||h}},{id:"adminPass",type:"password",name:"adminPass",label:"Contrase\xf1a",size:2,rules:{required:f,minLength:{value:8,message:"La longitud minima es de 8"},validate:e=>!!((0,_.yX)(e)&&(0,_.rz)(e,8)&&(0,_.MX)(e)&&(0,_.yV)(e))||"Contrase\xf1a no cumple con los requisitos",onChange:(e,a)=>{let{trigger:t}=a;t("adminPass")}},focus:!0,tooltipPassword:!0},{id:"adminPassRetry",type:"password",name:"adminPassRetry",label:"Confirmar contrase\xf1a",size:2,rules:{required:f,validate:(e,a)=>e===a.adminPass||v,onChange:(e,a)=>{let{trigger:t}=a;t("adminPassRetry")}}}];return i};var A=t(49792),w=t.n(A);let E=e=>{let{goToPaymentDetails:a,goToPayments:t,verifyUser:_,useShowAlert:u,title:d="Crea tu cuenta",description:m="Es r\xe1pido y sencillo, ingresa los siguientes datos y explora todas las herramientas y caracter\xedsticas que tenemos para ti."}=e,[p,y]=u,{isMobile:v}=(0,s.wN)(),[h,b]=(0,i.useState)(!1),f=(0,c.K)(e=>e.clearSession),P=(0,i.useMemo)(()=>j({verifyUser:_,isInvalidNit:p,setIsInvalidNit:y}),[p]),g=e=>{v?a(e):t(e),v||f()},C=()=>{b(!0)},x=(0,i.useMemo)(()=>(0,n.jsxs)(r.tE,{classForm:w().formSectionBuy,fields:P,button:{id:"boton-crear-cuenta",label:"Crea tu cuenta",color:"primary"},onSubmit:g,children:[(0,n.jsxs)("p",{className:w().create_account_form__policy,children:["Al hacer clic, autorizo a que Siigo trate mis datos conforme a lo descrito en la\xa0",(0,n.jsx)("a",{className:w().create_account_form__link,rel:"noreferrer",onClick:C,children:"Pol\xedtica de Privacidad"}),", cree una cuenta con mis datos en www.siigo.com y me ofrezca servicios propios y/o de terceros."]}),(0,n.jsx)(o.X,{})]}),[t,p]);return(0,n.jsxs)("div",{className:w().create_account_form,children:[(0,n.jsx)("h1",{className:w().create_account_form__title,children:d}),(0,n.jsxs)("p",{className:w().create_account_form__subtitle,children:[" ",m," "]}),x,(0,n.jsx)(l.OC,{showModal:h,setShowModal:b}),(0,n.jsxs)("p",{className:w().create_account_form__login,children:["\xbfYa tienes cuenta?\xa0",(0,n.jsx)("a",{href:"".concat("https://siigonube.siigo.com","/Login.aspx?ReturnUrl=%2fISIIGO2%2fDefault.aspx"),className:w().create_account_form__link,children:"Inicia sesi\xf3n"})]})]})}}}]);