PageSourceSearch

https://app.lunacheckout.com/_next/static/chunks/925-3b60415fea5be7b9.js

js lunacheckout.com collected 2026-10-04 22:22:20 UTC 21,799 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[925],{40925:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return _components_OrderBumpForm}});var l=t(57437),s=t(2265),a=t(24033),o=t(17158),n=t(75224),c=t(19174),i=t(41751),d=t(14185),u=t(51347),p=t(93665),m=t(87086),x=t(10338),h=t(2870);let estaEmTodasAsVariantes=(e,r)=>r.every(r=>r.products.some(r=>r.uuid===e)),buildVariationCombinations=e=>{if(!e.length)return[];let r=[],walk=(t,l,s,a)=>{if(t>=e.length){let e=new Set;for(let r of Object.values(l))for(let t of r.products)e.add(t.uuid);let t=Object.values(l),o=Array.from(e).filter(e=>estaEmTodasAsVariantes(e,t));o.length>0&&r.push({key:s,display:a,productUUIDs:o});return}let o=e[t];for(let e of o.variants){let r={...l};r[o.name]=e;let n="".concat(o.name,":").concat(e.value),c="".concat(o.name,": ").concat(e.value);walk(t+1,r,s?"".concat(s,"__").concat(n):n,a?"".concat(a," / ").concat(c):c)}};return walk(0,{},"",""),r},selectedCombinationKeys=(e,r)=>{if(!r.length||!e.length)return new Set;let t=new Set;for(let l of e){let e=l.productUUIDs.every(e=>r.includes(e));e&&t.add(l.key)}return t.size===e.length?"all":t},CheckIcon=()=>(0,l.jsxs)("svg",{className:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20",children:[(0,l.jsx)("title",{children:"Check"}),(0,l.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})]});var OrderBumpForm_VariationPicker=e=>{let{label:r,combinations:t,selected:s,onChange:a}=e;if(0===t.length)return null;let o=selectedCombinationKeys(t,s),i="all"===o||o instanceof Set&&o.size===t.length&&t.length>0,isKeySelected=e=>"all"===o||o instanceof Set&&o.has(e),uuidsOfKeys=e=>{let r=new Set;for(let s of e){var l;let e=t.find(e=>e.key===s);for(let t of null!==(l=null==e?void 0:e.productUUIDs)&&void 0!==l?l:[])r.add(t)}return Array.from(r)},handleToggleAll=()=>{if(i){a([]);return}a(uuidsOfKeys(t.map(e=>e.key)))},d=[{key:"toggle_all",display:i?"Desmarcar todos":"Marcar todos",type:"toggle"},...t.map(e=>({key:e.key,display:e.display,type:"variation"}))];return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("span",{className:"text-sm font-medium text-gray-700",children:r}),(0,l.jsx)(n.g,{className:"max-w-xs",labelPlacement:"outside",placeholder:"Selecione varia\xe7\xf5es",selectionMode:"multiple",selectedKeys:o,onSelectionChange:e=>{let r=new Set("all"===e?t.map(e=>e.key):Array.from(e).map(String));r.delete("toggle_all"),r.delete("select_all"),r.delete("deselect_all"),a(uuidsOfKeys(r))},classNames:{value:"text-sm"},items:d,children:e=>(0,l.jsx)(c.R,{textValue:e.display,className:"toggle"===e.type?"text-sm font-medium border-b border-gray-200 bg-gray-50":"text-sm",onPress:"toggle"===e.type?handleToggleAll:void 0,children:"toggle"===e.type?(0,l.jsxs)("div",{className:"flex items-center gap-2 py-1",children:[(0,l.jsx)("div",{className:"w-4 h-4 border-2 rounded flex items-center justify-center ".concat(i?"bg-blue-500 border-blue-500":"border-gray-300"),children:i&&(0,l.jsx)(CheckIcon,{})}),(0,l.jsx)("span",{className:"font-medium",children:e.display})]}):(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-4 h-4 border-2 rounded flex items-center justify-center ".concat(isKeySelected(e.key)?"bg-blue-500 border-blue-500":"border-gray-300"),children:isKeySelected(e.key)&&(0,l.jsx)(CheckIcon,{})}),(0,l.jsx)("span",{children:e.display})]})},e.key)})]})},g=t(18067),_=t.n(g);let Section=e=>{let{title:r,children:t}=e;return(0,l.jsxs)("section",{className:"rounded-lg border border-gray-200 overflow-hidden",style:{backgroundColor:"var(--bg-2)"},children:[(0,l.jsx)("div",{className:"border-b border-gray-200",children:(0,l.jsx)("h1",{className:"m-0 px-6 py-4 text-lg font-medium text-font-primary",children:r})}),t]})},v={active:"0",name:"",title:"",text_button:"",color:"#03c406",discount:"0",description:"",type_discount:"amount",products_rules:[],products_groups_rules:[],products:[],products_groups:[],price_sell:0,price_promo:0,pay_method:"",rule_type:"always_show",sell_value_type:"",sell_value:"",sell_button_color:"#000000",text_price_color:"#000000",sell_text_button_color:"#000000",hide_quantity_selector:"0"};var _components_OrderBumpForm=e=>{var r;let{current:t,onSave:g}=e,{push:b}
1=(0,a.useRouter)(),[y,f]=(0,s.useState)(!1),[j,C]=(0,s.useState)(null),[N,k]=(0,s.useState)(null!=t?t:v),[w,S]=(0,s.useState)({}),[P,O]=(0,s.useState)({}),B=(0,s.useRef)(new Set);(0,s.useEffect)(()=>{var e;let getProduct=async e=>{try{let r=await h.Z.get("/products/".concat(e)),t=r.data.data;t&&C(t)}catch(e){return null}};(null==N?void 0:null===(e=N.products_groups)||void 0===e?void 0:e.length)>0&&getProduct(N.products_groups[0])},[N.products_groups]);let A=(null==j?void 0:j.variations_list)||[],update=(e,r)=>k(t=>({...t,[e]:r})),R=(0,s.useMemo)(()=>{var e;return Array.from(new Set((null!==(e=N.products_groups_rules)&&void 0!==e?e:[]).filter(e=>e&&"all"!==e)))},[N.products_groups_rules]);(0,s.useEffect)(()=>{let e=R.filter(e=>!B.current.has(e));0!==e.length&&(e.forEach(e=>B.current.add(e)),Promise.all(e.map(e=>h.Z.get("/products/".concat(e)).then(r=>[e,r.data.data]).catch(()=>(B.current.delete(e),null)))).then(e=>{let r={};e.forEach(e=>{(null==e?void 0:e[1])&&(r[e[0]]=e[1])}),Object.keys(r).length>0&&O(e=>({...e,...r}))}))},[R]);let F=(0,s.useMemo)(()=>{let e={};return R.forEach(r=>{var t,l;let s=null!==(l=null===(t=P[r])||void 0===t?void 0:t.variations_list)&&void 0!==l?l:[];s.length>0&&(e[r]=buildVariationCombinations(s))}),e},[R,P]),E=(0,s.useCallback)(e=>{var r;return(null!==(r=F[e])&&void 0!==r?r:[]).flatMap(e=>e.productUUIDs)},[F]),I=(0,s.useCallback)((e,r)=>{let t=E(e),l=r.filter(e=>t.includes(e));return l.length>0&&l.length<t.length?l:[e]},[E]);(0,s.useEffect)(()=>{if(0===R.length)return;let e=R.every(e=>void 0!==P[e]);e&&k(e=>{let r=R.flatMap(r=>I(r,e.products_rules)),t=r.length===e.products_rules.length&&r.every((r,t)=>r===e.products_rules[t]);return t?e:{...e,products_rules:r}})},[R,P,I]);let ruleSelected=e=>{let r=E(e),t=r.filter(e=>N.products_rules.includes(e));return t.length>0?t:r},handleRuleVariantsChange=(e,r)=>{let t=E(e),l=N.products_rules.filter(r=>r!==e&&!t.includes(r));update("products_rules",[...l,...I(e,r)])},handlePriceChange=(e,r)=>{let t="object"==typeof r?Number.parseFloat(r.target.value)||0:Number.parseFloat(String(r))||0;update(e,t)},L=buildVariationCombinations(A),getInitialSelectedKeys=()=>selectedCombinationKeys(L,N.products),getSelectedVariations=()=>{let e=getInitialSelectedKeys(),r=new Set;return"all"===e?A:(e.forEach(e=>{let t=L.find(r=>r.key===e);if(t){let t=e.split("__");t.forEach(e=>{let[t]=e.split(":");r.add(t)})}}),A.filter(e=>r.has(e.name)))},T=(0,s.useCallback)(async()=>{var e,r;if((null===(e=N.products)||void 0===e?void 0:e.length)>0){let e=N.products[0];try{let r=await h.Z.get("/products/".concat(e)),t=r.data.data;t&&!j&&C(t)}catch(e){if((null===(r=N.products_groups)||void 0===r?void 0:r.length)>0)try{let e=await h.Z.get("/products/".concat(N.products_groups[0])),r=e.data.data;r&&!j&&C(r)}catch(e){}}}},[N.products,N.products_groups,j]);return(0,s.useEffect)(()=>{T()},[T]),(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"content",children:[(0,l.jsxs)("div",{className:"main-title",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-500 mb-2",children:[(0,l.jsx)("button",{type:"button",className:"cursor-pointer hover:text-primary bg-transparent p-0",onClick:()=>b("/marketing"),children:"Marketing"}),(0,l.jsx)(o.Z,{size:14}),(0,l.jsx)("button",{type:"button",className:"cursor-pointer hover:text-primary bg-transparent p-0",onClick:()=>b("/marketing/order-bumps"),children:"Order Bump"}),(0,l.jsx)(o.Z,{size:14}),(0,l.jsx)("span",{className:"text-primary",children:"Editar"})]}),(0,l.jsx)("h1",{className:"sub",children:"Novo order bump"})]}),(0,l.jsxs)("div",{className:_().gridPage,children:[(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)(Section,{title:"Informa\xe7\xf5es",children:(0,l.jsxs)("div",{className:"px-6 py-4 grid gap-4",children:[(0,l.jsx)(p.Z,{id:"name",label:"Nome do order bump",value:N.name,onChange:e=>{let{target:r}=e;return update("name",r.value)}}),(0,l.jsx)(d.Z,{label:"Ativo",checked:"1"===N.active,onChange:e=>{let{target:r}=e;return update("active",r.checked?"1":"0")}})]})}),(0,l.jsx)(Section,{title:"O que oferecer",children:(0,l.jsxs)("div",{className:"px-6 py-4 grid gap-2",children:[(0,l.jsx)(u.Z,{selectionMode:"products",type:"single",product:N.products_groups,setProduct:e=>{let r=Array.isArray(e)?e.filter(e=>"object"==typeof e&&null!==e&&!!(null==e?void 0:e.uuid)):[],t=r[0]||null;t?(C(t),update("products_groups",[t.uuid])):(C(null),update("products_groups",[])),update("products",[]),S({})},acceptObjectProducts:!0,showSelectedList:!0}),(0,l.jsx)(OrderBumpForm_VariationPicker,{label:"Varia\xe7\xf5es do produto",combinations:L,selected:N.products,onChange:e=>update("products",e)}),(0,l.jsxs)("div",{className:_().prices,children:[(0,l.jsxs)("div",{className:"grid gap-1",children:[(0,l.jsx)(p.Z,{id:"price",label:"Pre\xe7o de venda",mask:"currency",value:N.price_sell,onChange:e=>handlePriceChange("price_sell",e)}),(0,l.jsxs)("span",{className:"small-text",children:[(0,l.jsx)("strong",{children:"Obs:"})," R$ 0,00 = Gr\xe1tis"]})]}),(0,l.jsxs)("div",{className:"grid gap-1",children:[(0,l.jsx)(p.Z,{id:"price-promo",label:"Pre\xe7o sem desconto (opcional)",mask:"currency",value:N.price_promo,onChange:e=>handlePriceChange("price_promo",e)}),(0,l.jsxs)("span",{className:"small-text",children:[(0,l.jsx)("strong",{children:"Obs:"})," R$ 0,00 ou valor maior que o pre\xe7o de venda = O pre\xe7o promocional n\xe3o ser\xe1 aplicad
1o."]})]})]}),(0,l.jsxs)("div",{className:"pt-4",children:[(0,l.jsx)(d.Z,{label:"Esconder seletor de quantidade nos produtos da oferta",checked:"1"===N.hide_quantity_selector,onChange:e=>{let{target:r}=e;return update("hide_quantity_selector",r.checked?"1":"0")}}),(0,l.jsx)("span",{className:"small-text",children:"O comprador leva exatamente a quantidade configurada — \xfatil quando o pre\xe7o promocional s\xf3 vale para ela."})]})]})}),(0,l.jsx)(Section,{title:"Personaliza\xe7\xe3o",children:(0,l.jsx)("div",{className:"px-6 py-4",children:(0,l.jsxs)("div",{className:_().personalization,children:[(0,l.jsxs)("div",{className:"grid gap-2",children:[(0,l.jsx)(p.Z,{id:"text_button",label:"Texto do Bot\xe3o (CTA)",value:N.text_button,onChange:e=>{let{target:r}=e;return update("text_button",r.value)}}),(0,l.jsx)(p.Z,{id:"title",label:"T\xedtulo",value:N.title,onChange:e=>{let{target:r}=e;return update("title",r.value)}}),(0,l.jsx)(p.Z,{id:"description",label:"Descri\xe7\xe3o (opcional)",value:N.description,onChange:e=>{let{target:r}=e;return update("description",r.value)}})]}),(0,l.jsxs)("div",{className:"grid gap-2",children:[(0,l.jsx)(m.Z,{id:"color",color:N.color,label:"Fundo",setColor:e=>update("color",e)}),(0,l.jsx)(m.Z,{id:"color-button",label:"Cor do bot\xe3o",color:N.sell_button_color,setColor:e=>update("sell_button_color",e)}),(0,l.jsx)(m.Z,{id:"color-text-button",label:"Cor do texto do bot\xe3o",color:N.sell_text_button_color,setColor:e=>update("sell_text_button_color",e)}),(0,l.jsx)(m.Z,{id:"color-all",label:"Cor do t\xedtulo e descri\xe7\xe3o",color:N.text_price_color,setColor:e=>update("text_price_color",e)})]})]})})}),(0,l.jsx)(Section,{title:"Meio de pagamento",children:(0,l.jsx)("div",{className:"px-6 py-4",children:(0,l.jsxs)(n.g,{className:"max-w-xs",labelPlacement:"outside",placeholder:" ",label:"Mostrar order bump para compras com",selectedKeys:[N.pay_method],onSelectionChange:e=>{let r=Array.from(e)[0];update("pay_method",r||"")},children:[(0,l.jsx)(c.R,{children:"Cart\xe3o de cr\xe9dito"},"card"),(0,l.jsx)(c.R,{children:"Pix"},"pix"),(0,l.jsx)(c.R,{children:"Todos os meios de pagamento"},"all")]})})}),(0,l.jsx)(Section,{title:"Regras",children:(0,l.jsxs)("div",{className:"px-6 py-4 grid gap-2",children:[(0,l.jsxs)(n.g,{className:"max-w-xs",labelPlacement:"outside",placeholder:" ",label:"Tipo de regra",selectedKeys:[N.rule_type],onSelectionChange:e=>{let r=Array.from(e)[0];update("rule_type",r||"")},children:[(0,l.jsx)(c.R,{children:"Sempre mostrar"},"always_show"),(0,l.jsx)(c.R,{children:"Valor em compras"},"value"),(0,l.jsx)(c.R,{children:"Produtos espec\xedficos"},"products")]}),(0,l.jsxs)("div",{className:"grid text-sm text-gray-600",children:[(0,l.jsxs)("span",{children:[(0,l.jsx)("strong",{children:"Sempre mostrar:"})," ","oferecido em todos os produtos"]}),(0,l.jsxs)("span",{children:[(0,l.jsx)("strong",{children:"Valor em compras:"})," ","aparece apenas se carrinho atender regra"]}),(0,l.jsxs)("span",{children:[(0,l.jsx)("strong",{children:"Produtos espec\xedficos:"})," ","oferecido quando houver produtos espec\xedficos no checkout"]})]}),"value"===N.rule_type&&(0,l.jsxs)("div",{className:"flex items-end gap-4 pt-2",children:[(0,l.jsxs)(n.g,{className:"max-w-xs",labelPlacement:"outside",placeholder:" ",label:"Quando o valor de compra for",selectedKeys:[N.sell_value_type],onSelectionChange:e=>{let r=Array.from(e)[0];update("sell_value_type",r||"")},children:[(0,l.jsx)(c.R,{children:"Maior que"},"greater"),(0,l.jsx)(c.R,{children:"Menor que"},"less")]}),(0,l.jsx)(p.Z,{id:"sell-value",label:"",mask:"currency",value:N.sell_value,onChange:e=>update("sell_value",Number(e).toFixed(2))})]}),"products"===N.rule_type&&(0,l.jsxs)("div",{className:"grid gap-4",children:[(0,l.jsx)(u.Z,{selectionMode:"products",type:"multiple",product:N.products_groups_rules,acceptObjectProducts:!0,setProduct:e=>{let r=Array.isArray(e)&&(null==e?void 0:e.includes("all"))?["all"]:(null!=e?e:[]).map(e=>"string"==typeof e?e:e.uuid);k(e=>{if(r.includes("all"))return{...e,products_groups_rules:r,products_rules:r};let t=r.flatMap(r=>I(r,e.products_rules));return{...e,products_groups_rules:r,products_rules:t}})}}),R.map(e=>{var r,t;let s=null!==(t=F[e])&&void 0!==t?t:[];if(0===s.length)return null;let a=null===(r=P[e])||void 0===r?void 0:r.name;return(0,l.jsx)(OrderBumpForm_VariationPicker,{label:a?"Varia\xe7\xf5es de ".concat(a):"Varia\xe7\xf5es do produto",combinations:s,selected:ruleSelected(e),onChange:r=>handleRuleVariantsChange(e,r)},e)})]})]})})]}),(0,l.jsx)("aside",{children:(0,l.jsxs)("article",{className:_().preview,style:{"--color-bump":N.color,"--bg-bump":((e,r)=>{let t=Number.parseInt(null==e?void 0:e.slice(1,3),16),l=Number.parseInt(null==e?void 0:e.slice(3,5),16),s=Number.parseInt(null==e?void 0:e.slice(5,7),16);return"rgba(".concat(t,", ").concat(l,", ").concat(s,", ").concat(.2,")")})(N.color,0),"--bg-button":N.sell_button_color,"--button-text":N.sell_text_button_color,"--color-text":N.text_price_color},children:[(0,l.jsxs)("header",{className:_().header,children:[(0,l.jsx)("strong",{children:N.title||"T\xedtulo"}
1),(0,l.jsx)("p",{children:N.description||"Descri\xe7\xe3o"})]}),(0,l.jsxs)("div",{className:_().previewContainer,children:[(0,l.jsx)("figure",{children:(0,l.jsx)("img",{src:null==j?void 0:j.image,alt:""})}),(0,l.jsxs)("div",{className:_().contentPreview,children:[(0,l.jsx)("p",{children:null!==(r=null==j?void 0:j.name)&&void 0!==r?r:"Produto Teste"}),(()=>{let e=getSelectedVariations();return 0===e.length?null:(0,l.jsx)("div",{className:"mb-3 space-y-2",children:e.map(e=>{var r;let t=e.variants.filter(r=>{let t=getInitialSelectedKeys();return"all"===t||Array.from(t).some(t=>t.includes("".concat(e.name,":").concat(r.value)))});if(0===t.length)return null;let s=w[e.id]?t.find(r=>r.id===w[e.id]):t[0];return(0,l.jsxs)("div",{children:[(0,l.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[e.name,":"]}),(0,l.jsx)("select",{className:"block w-full border border-gray-200 rounded-md bg-white px-3 py-2 text-sm text-gray-700 focus:border-gray-500 focus:outline-none focus:ring-1 focus:ring-gray-200",value:null!==(r=null==s?void 0:s.id)&&void 0!==r?r:"",onChange:r=>{S(t=>({...t,[e.id]:r.target.value}))},children:t.map(e=>(0,l.jsx)("option",{value:e.id,children:e.value},e.id))})]},e.id)})})})(),(0,l.jsxs)("div",{className:_().priceHandles,children:[(0,l.jsx)("span",{children:(0,x.x)(N.price_promo)}),(0,l.jsx)("strong",{children:(0,x.x)(N.price_sell)})]})]})]}),(0,l.jsxs)("button",{type:"button",className:_().button,style:{opacity:N.products.length>0?1:.5,cursor:N.products.length>0?"pointer":"not-allowed"},children:[(0,l.jsx)("input",{type:"checkbox",readOnly:!0}),N.text_button||"Adicionar ao Carrinho"]})]})})]})]}),(0,l.jsxs)("div",{className:"handles",children:[(0,l.jsx)(i.A,{color:"primary",variant:"bordered",onPress:()=>b("/marketing/order-bumps"),children:"Cancelar"}),(0,l.jsx)(i.A,{color:"primary",onPress:()=>null==g?void 0:g(N,f),isLoading:y,children:y?"Aguarde...":"Salvar"})]})]})}},14185:function(e,r,t){"use strict";var l=t(57437);t(2265);var s=t(78905),a=t.n(s);r.Z=e=>{let{label:r,name:t,value:s,isList:o=!1,defaultChecked:n=!1,onChange:c,checked:i,...d}=e;return(0,l.jsx)("div",{className:a().checkList,children:(0,l.jsxs)("label",{className:a().switch,children:[r&&(0,l.jsx)("span",{className:"label",children:r}),(0,l.jsx)("input",{type:"checkbox",...d,checked:i,name:t,defaultChecked:n,onChange:c}),(0,l.jsx)("div",{className:a().slider,children:(0,l.jsxs)("div",{className:a().circle,children:[(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"6",height:"6",x:"0",y:"0",viewBox:"0 0 365.696 365.696",className:a().cross,children:(0,l.jsx)("g",{children:(0,l.jsx)("path",{d:"M243.188 182.86 356.32 69.726c12.5-12.5 12.5-32.766 0-45.247L341.238 9.398c-12.504-12.503-32.77-12.503-45.25 0L182.86 122.528 69.727 9.374c-12.5-12.5-32.766-12.5-45.247 0L9.375 24.457c-12.5 12.504-12.5 32.77 0 45.25l113.152 113.152L9.398 295.99c-12.503 12.503-12.503 32.769 0 45.25L24.48 356.32c12.5 12.5 32.766 12.5 45.247 0l113.132-113.132L295.99 356.32c12.503 12.5 32.769 12.5 45.25 0l15.081-15.082c12.5-12.504 12.5-32.77 0-45.25zm0 0",fill:"currentColor","data-original":"#2ecc71"})})}),(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"10",height:"10",x:"0",y:"0",viewBox:"0 0 24 24",className:a().checkmark,children:(0,l.jsx)("g",{children:(0,l.jsx)("path",{d:"M9.707 19.121a.997.997 0 0 1-1.414 0l-5.646-5.647a1.5 1.5 0 0 1 0-2.121l.707-.707a1.5 1.5 0 0 1 2.121 0L9 14.171l9.525-9.525a1.5 1.5 0 0 1 2.121 0l.707.707a1.5 1.5 0 0 1 0 2.121z",fill:"currentColor","data-original":"#2ecc71"})})})]})})]})})}},87086:function(e,r,t){"use strict";var l=t(57437),s=t(2265),a=t(93665),o=t(8598),n=t.n(o);r.Z=e=>{let{id:r,label:t,color:o,setColor:c,size:i="md"}=e,[d,u]=(0,s.useState)(o),p=(0,s.useRef)(null);function handleColorInputChange(e){let r=e.target.value;u(r),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{c(r)},100)}function handleHexInputChange(e){let r=e.target.value,t="#".concat(r);/^#[0-9A-Fa-f]{6}$/.test(t)&&c(t),u(t)}(0,s.useEffect)(()=>{u(o)},[o]),(0,s.useEffect)(()=>()=>{p.current&&clearTimeout(p.current)},[]);let m="sm"===i?n().small:"lg"===i?n().large:"";return(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{htmlFor:r,className:"label",children:t}),(0,l.jsxs)("div",{className:"".concat(n().colorInput," ").concat(m),children:[(0,l.jsx)("input",{id:"".concat(r,"-color"),type:"color",value:d,onChange:handleColorInputChange,className:m}),(0,l.jsx)(a.Z,{id:"".concat(r,"-hex"),label:"",value:null==d?void 0:d.replace("#",""),onChange:handleHexInputChange,mask:"hex",prefix:"#",maxLength:6,inputSize:i})]})]})}},10338:function(e,r,t){"use strict";t.d(r,{x:function(){return formatCurrency}});let formatCurrency=(e,r)=>{let t="string"==typeof e?Number.parseFloat(e):e;(null==t||Number.isNaN(t))&&(t=0);let l=["BRL","USD","GBP","EUR","CAD","CLP","ARS","BOB","COP","CRC","CUP","CUC","GTQ","HTG","HNL","MXN","NIO","PAB","PYG","PEN","DOP","UYU","VES","AED","THB","PLN","KRW","MYR","SGD","AUD"],s="BRL";if(r&&l.includes(r))s=r;else try{let e=localStorage.getItem("store"),r=e?JSON.parse(e):null;(null==r?void 0:r.currency)&&l.includes(r.currency)&&(s=r.currency)}catch(e){}let a={USD:"en-US",EUR:"de-DE",BRL:"pt-BR",CAD:"en-CA",CLP:"es-CL",ARS:"es-AR",BOB:"es-BO",COP:"es-CO",CRC:"es-CR",CUP:"es-CU",CUC:"es-CU",GTQ:"es-GT",HTG:"fr-HT",HNL:"es-HN",MXN:"es-MX",NIO:"es-NI",PAB:"es-PA",PYG:"es-PY",PEN:"es-PE",DOP:"es-DO",UYU:"es-UY",VES:"es-VE",GBP:"en-GB",AED:"ar-AE",THB:"th-TH",PLN:"pl-PL",KRW:"ko-KR",MYR:"ms-MY",SGD:"en-SG",AUD:"en-AU"}[s]||"pt-BR";
1try{return t.toLocaleString(a,{style:"currency",currency:s})}catch(e){return"R$ 0,00"}}},18067:function(e){e.exports={preview:"OrderBumpForm_preview__JO3lV",discountContainer:"OrderBumpForm_discountContainer__UgukT",discount:"OrderBumpForm_discount__S39tB",checkboxes:"OrderBumpForm_checkboxes__lgxl4",rules:"OrderBumpForm_rules__R0_0_",flexBetween:"OrderBumpForm_flexBetween__lzKye",prices:"OrderBumpForm_prices__LJl7n",personalization:"OrderBumpForm_personalization__0y5Xi",gridPage:"OrderBumpForm_gridPage__EKDTM",more:"OrderBumpForm_more__J_s5c",previewContainer:"OrderBumpForm_previewContainer__t7PCf",button:"OrderBumpForm_button__e7X_f",added:"OrderBumpForm_added__hR7vT",contentPreview:"OrderBumpForm_contentPreview__64wVj",priceHandles:"OrderBumpForm_priceHandles__mxSKu",text:"OrderBumpForm_text__X5mFq",header:"OrderBumpForm_header__atQnN",animateAdd:"OrderBumpForm_animateAdd__jxDzQ",spin:"OrderBumpForm_spin__V1Ham"}},78905:function(e){e.exports={switch:"Checkbox_switch__p4KeQ",checkmark:"Checkbox_checkmark__QaP39",cross:"Checkbox_cross__siLnL",slider:"Checkbox_slider__GTTHA",circle:"Checkbox_circle__ngWA9",checkList:"Checkbox_checkList__vvPTZ"}},8598:function(e){e.exports={colorInput:"InputColor_colorInput__z9J6H",small:"InputColor_small__FcUnx",large:"InputColor_large__c9DJ5",content:"InputColor_content__jlzVe"}}}]);

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.