1import{j as t,R as bt,r as c,L as yt,v as ct,p as jt,$ as $t}from"./vendor-CgNlHjan.js";import{d as v,c as a,u as _,r as S,a as p,i as L,h as kt,j as R,H as lt,l as G,B as Q,o as X,A as Ct,P as St,k as Lt,m as Dt,b as _t,n as Et,F as Bt}from"./index-C4f9OTyq.js";import{g as n}from"./styled-BxsIIp_3.js";import{a as It,f as Tt}from"./currencyUtils-CEaA9HfY.js";import{P as At}from"./index-zNmcnTXg.js";import{C as it}from"./crypto-B9kvC4sX.js";import{a as Pt,p as zt}from"./participants-BDXQQ20J.js";import{R as Nt}from"./confetti-BQChKg6H.js";import{i as Rt,g as Gt,P as Ot}from"./index-CEEPPnEK.js";import{f as Wt}from"./dateUtils-6BhcEyO9.js";import"./query-MPVCYooq.js";const Mt=n.div` 2 display: flex; 3 flex-direction: column; 4 align-items: center; 5 justify-content: center; 6 width: 470px; 7 margin: 0 auto; 8 padding-top: 132px; 9 padding-bottom:132px; 10 11 @media (max-width: ${v}px) { 12 width: 360px; 13 } 14`,Ft=n.div` 15 display: flex; 16 flex-direction: column; 17 align-items: center; 18 justify-content: center; 19 width: 100%; 20 margin-top: 32px; 21 padding: 8px 0; 22 23 @media (max-width: ${v}px) { 24 } 25`,Yt=n.div` 26 display: flex; 27 text-align: center; 28 justify-content: center; 29 align-items: center; 30 width: 100%; 31`,W=n.div` 32 display: flex; 33 flex-direction: column; 34 align-items: center; 35 width: 100%; 36 gap: 12px; 37`,M=n.div` 38 display: flex; 39 align-items: center; 40 justify-content: center; 41 gap: 4px; 42 width: 100%; 43 44 @media (max-width: ${v}px) { 45 } 46`,F=n.div` 47 display: flex; 48 align-items: center; 49 justify-content: center; 50 text-align: center; 51 width: 100%; 52 max-width: 470px; 53 54 @media (max-width: ${v}px) { 55 max-width: 360px; 56 } 57`,Y=n.img` 58 width: 32px; 59 height: 32px; 60 flex-shrink: 0; 61 62 @media (max-width: ${v}px) { 63 width: 28px; 64 height: 28px; 65 } 66`,Ht=n.div` 67 width: ${e=>e.width||"100%"}; 68 height: ${e=>e.dotSize||2}px; 69 background-image: radial-gradient( 70 circle, 71 ${e=>e.color||a.brandBlack} ${e=>(e.dotSize||2)/2}px, 72 transparent ${e=>(e.dotSize||2)/2}px 73 ); 74 background-size: ${e=>(e.dotSize||2)*3}px ${e=>e.dotSize||2}px; 75 background-repeat: repeat-x; 76 background-position: left center; 77 margin-top: ${e=>e.marginTop}px; 78 margin-bottom: ${e=>e.marginBottom}px; 79 opacity: ${e=>e.opacity}; 80 81 /* Mobile como responsivo */ 82 @media (max-width: ${v}px) { 83 background-size: ${e=>(e.dotSize||1)*2}px ${e=>e.dotSize||1}px; 84 height: ${e=>e.dotSize||1}px; 85 } 86`;function J({opacity:e=1,color:i=a.neutralMedium,marginTop:r=16,marginBottom:s=16,width:o="100%",dotSize:d=2}){return t.jsx(Ht,{opacity:e,color:i,marginTop:r,marginBottom:s,width:o,dotSize:d})}function Ut({group:e,chosenDate:i}){const r=_().drawInfo;return bt.useEffect(()=>{S({screenName:"group_details",param:"group_details_view"})},[]),e?t.jsxs(Mt,{children:[t.jsx(Yt,{children:t.jsx(p,{variant:"Display24",children:r.detailsTitle})}),t.jsxs(Ft,{children:[t.jsxs(W,{children:[t.jsxs(M,{children:[t.jsx(Y,{src:L.calendar}),t.jsx(p,{variant:"LargeSemiBold",children:r.giftDelivery})]}),t.jsx(F,{children:t.jsx(p,{variant:"BigRegular",color:a.neutralDark,children:i})})]}),t.jsx(J,{opacity:1,marginTop:32,marginBottom:32}),t.jsxs(W,{children:[t.jsxs(M,{children:[t.jsx(Y,{src:L.wallet}),t.jsx(p,{variant:"LargeSemiBold",children:r.budget})]}),t.jsx(F,{children:t.jsx(p,{variant:"BigRegular",color:a.neutralDark,children:It(e.budget)})})]}),t.jsx(J,{opacity:1,marginTop:32,marginBottom:32}),t.jsxs(W,{children:[t.jsxs(M,{children:[t.jsx(Y,{src:L.pencil}),t.jsx(p,{variant:"LargeSemiBold",children:r.description})]}),t.jsx(F,{children:t.jsx(p,{variant:"BigRegular",color:a.neutralDark,children:e.description})})]})]})]}):null}n.body` 87 overflow-x: hidden; 88`;const qt=n.div` 89 position: fixed; 90 top: 0; 91 left: 0; 92 width: 100%; 93 height: 100%; 94 z-index: 9999; 95 pointer-events: none; 96`,Kt=n.div` 97 overflow-x: hidden; 98 padding-top: 80px; 99 /* Compensa a barra fixa do CTA para não cobrir o Footer/PromoSlot. */ 100 padding-bottom: ${e=>e.$hasCta?"96px":"0"}; 101 102 @media (max-width: ${v}px) { 103 padding-bottom: ${e=>e.$hasCta?"88px":"0"}; 104 } 105`,Vt=n.div` 106 position: fixed; 107 bottom: 0; 108 left: 0; 109 right: 0; 110 z-index: 1000; 111 display: flex; 112 justify-content: center; 113 padding: 16px 24px; 114 background: ${a.brandWhite}; 115 border-top: 1px solid ${a.neutralLight}; 116 box-shadow: 0 -4px 16px -8px ${a.shadowPopover}; 117`,Jt=n.div` 118 width: 100%; 119 max-width: ${kt}px; 120 display: flex; 121 flex-direction: column; 122 align-items: center; 123`,Zt=n.div` 124 display: flex; 125 width: 100%; 126 min-height: 400px; 127 align-items: center; 128 flex-direction: column; 129 overflow-x: hidden; 130 padding: 132px 0px; 131 132 @media (max-width: ${v}px) { 133 min-height: 300px; 134 } 135`,Qt=n.div` 136 display: flex; 137 flex-direction: column; 138 align-items: center; 139 width: 100%; 140 max-width: 344px; 141 margin-top: 64px; 142 gap: 32px; 143 144 @media (max-width: ${v}px) { 145 max-width: 344px; 146 margin-top: 32px; 147 } 148`,Xt=n.div` 149 display: flex; 150 gap: 16px; 151 align-items: center; 152 justify-content: center; 153 154 @media (max-width: ${v}px) { 155 gap: 12px; 156 } 157`,te=n.div` 158 display: flex; 159 flex-direction: column; 160 align-items: center; 161 gap: 64px; 162 width: 100%; 163 164 @media (max-width: ${v}px) { 165 gap: 32px; 166 padding: 0px 24px; 167 } 168`,nt=n.div` 169 display: flex; 170 text-align: center; 171 justify-content: center; 172 align-items: center; 173 width: 100%; 174`,rt=n.img` 175 width: ${e=>e.$wide?"169px":"150px"}; 176 height: 50px; 177 cursor: pointer; 178 transition: transform 0.3s ease-in-out; 179 180 &:hover { 181 transform: scale(${e=>e.isHover?1.05:1}); 182 } 183 184 @media (max-width: ${v}px) { 185 width: 140px; 186 height: 42px; 187 } 188`,ee=n.div` 189 display: flex; 190 flex-direction: column; 191 height: 100%; 192 overflow-x: hidden; 193 overflow-y: hidden; 194`,ie=n.div` 195 height: 85vh; 196 margin-top: 80px; 197`,ne=n.div` 198 width: auto; 199 height: 168px; 200 display: flex; 201 flex-direction: column; 202 justify-content: space-between; 203 margin-left: 24px; 204 margin-top: 48px; 205`,re=n.div` 206 display: flex; 207 justify-content: center; 208 margin-top: auto; 209 margin-bottom: 56px; 210`,H=n.div` 211 cursor: pointer; 212 transition: transform 0.3s ease-in-out; 213 214 &:hover { 215 transform: scale(1.01); 216 } 217`;function ae(){const e=_().drawInfo,[i,r]=c.useState(""),{appleStoreLink:s,playStoreLink:o}=G;return c.useEffect(()=>{const d=R();r(d)},[]),t.jsx(ie,{children:t.jsxs(ee,{children:[t.jsx(lt,{}),t.jsxs(ne,{children:[t.jsx(H,{children:t.jsx(p,{variant:"H3",weight:"400",children:t.jsx("a",{href:"/",children:e.menuHome})})}),t.jsx(H,{children:t.jsx("a",{href:G.papelzinhoStoreLink,target:"_blank",children:t.jsx(p,{variant:"H3",children:e.menuStore})})}),t.jsx(H,{children:t.jsx(yt,{to:"/faq",style:{textDecoration:"none"},children:e.menuFaq})})]}),t.jsx(re,{children:t.jsx(Q,{onClick:()=>X(i==="ios"?s:o)})})]})})}const oe=()=>{const[e,i]=c.useState(null),[r,s]=c.useState([]),o=ct(),d=jt(),f=new URLSearchParams(d.search),u=f.get("p"),x=f.get("g"),b="Papelzinho@web";function g(m,h){const w=it.AES.decrypt(m,h).toString(it.enc.Utf8);return JSON.parse(w)}const y=async(m,h)=>{try{const w=await(await fetch(`${Ct}/web/${m}`,{method:"GET",headers:{"Content-Type":"application/json"}})).json();let j;try{j=g(w.data,b)}catch(C){throw console.error("Erro ao decriptar payload do grupo:",C),new Error("groupNotFound")}if(j===void 0)throw new Error("groupNotFound");if(!h())return;i(j);const E=await Pt(j.participants),D=E==null?void 0:E.data,T=D?Object.values(D).find(Array.isArray):void 0;let $=[];return Array.isArray(T)&&($=T.flatMap(C=>{try{return g(C,b)}catch(O){return console.error("Erro ao decriptar um item:",O),[]}})),h()?(s($),$.some(C=>C.id===u)||o("/participantNotFound"),{group:j,participants:$}):void 0}catch(l){if(!h())return;if(l instanceof Error&&l.message==="groupNotFound"){o("/groupDeleted");return}console.error("Erro inesperado ao carregar informações do sorteio:",l),o("/error")}};return c.useEffect(()=>{let m=!0;return(async()=>{x&&u?await y(x,()=>m):m&&o("/error")})(),()=>{m=!1}},[x,u,o]),{group:e,participants:r}};function se(e,i){if(!i||!Array.isArray(e))return;const r=e.find(s=>
217s.id===i);if(r)return r.email??r.phone??void 0}function de(e,i,r){const s=Lt(i);return e?{to:s}:{to:St.login,state:{from:{pathname:s},...r?{prefillContact:r}:{}}}}function ce({group:e,participants:i}){const[r,s]=c.useState(window.innerWidth>v),[o,d]=c.useState(""),[f,u]=c.useState(!0),[x,b]=c.useState(!1),{theme:g}=Dt(),{width:y,height:m}=$t(),h=new URLSearchParams(window.location.search),l=h.get("p"),w=h.get("g")??void 0,j=se(i,l),[E,D]=c.useState(),[T,$]=c.useState();c.useEffect(()=>{C()},[e,l,i]),c.useEffect(()=>{O()},[l,i]),c.useEffect(()=>{if(e&&e.deliveryDate){const k=Wt(e.deliveryDate);d(k)}u(!1)},[e]),c.useEffect(()=>{const k=()=>{s(window.innerWidth>v)};return window.addEventListener("resize",k),()=>{window.removeEventListener("resize",k)}},[]);const z=()=>{b(!0);const k=setTimeout(()=>{b(!1)},5e3);return()=>clearTimeout(k)};async function C(){if(u(!0),!l||!e||!Array.isArray(i)||i.length===0||!e.participants||!e.raffle){D(void 0),$(void 0),u(!1);return}const k=e.raffle[l];if(k){const B=i.find(vt=>vt.id===k);B?(D(B.name),Rt(e.drawStyle)?$(Gt(B)):$(void 0)):(D(void 0),$(void 0))}else D(void 0),$(void 0);u(!1)}async function O(){if(!l||!Array.isArray(i))return;const k=i.find(B=>B.id===l);if(k)try{await zt(l,{...k,raffleStatus:"read"})}catch(B){console.error("Error updating participant:",B)}}return{secretFriendName:E,secretFriendDrawColor:T,loading:f,showConfetti:x,triggerConfetti:z,width:y,height:m,theme:g,isWideEnough:r,chosenDate:o,groupId:w,myContact:j}}const A=n.div` 218 display: flex; 219 padding: 20px 0 20px 0; 220 width: 100%; 221 max-width: 1240px; 222 justify-content: center; 223 flex-direction: column; 224 margin: 0 auto; 225`,le=n.div` 226 text-align: center; 227 margin-bottom: 32px; 228`,Z=n.div` 229 display: flex; 230 color: ${a.brandBlack}; 231 margin-bottom: 8px; 232 margin-left: 20px; 233 margin-top: 4px; 234 text-align: left; 235`,pe=n.div` 236 display: flex; 237 margin-left: 20px; 238 margin-right: 20px; 239 margin-bottom: 32px; 240`,pt=n.div` 241 position: relative; 242 width: 100%; 243 244 @media (max-width: 375px) { 245 overflow: hidden; 246 } 247`,xt=n.div` 248 overflow-x: auto; 249 overflow-y: visible; 250 251 scrollbar-width: none; 252 -ms-overflow-style: none; 253 -webkit-overflow-scrolling: touch; 254 scroll-behavior: smooth; 255 position: relative; 256 overscroll-behavior-y: auto; 257 overscroll-behavior-x: contain; 258 touch-action: auto; 259 260 &::-webkit-scrollbar {
261 display: none; 262 } 263 264 @media (max-width: 768px) { 265 scroll-snap-type: x mandatory; 266 touch-action: pan-x pan-y; 267 } 268`,xe=n.div` 269 display: flex; 270 gap: 16px; 271 padding-left: 20px; 272 min-width: 100%; 273 274 @media (max-width: 375px) { 275 gap: 16px; 276 padding-left: 20px; 277 } 278`,P=n.div` 279 width: 100%; 280 max-width: 350px; 281 min-width: 280px; 282 height: 304px; 283 margin: 0; 284 padding: 16px; 285 flex: 0 0 auto; 286 user-select: none; 287 border-radius: 16px; 288 background: linear-gradient( 289 to bottom, 290 ${a.brandWhite} 0%, 291 ${a.brandTint16} 100% 292 ); 293 position: relative; 294 box-shadow: 0 0 0 1px ${a.blackAlpha07}, 0px 2px 4px ${a.shadowSoft}; 295 transition: transform 0.2s ease-out; 296 will-change: transform; 297 transform: translateZ(0); 298 @media (max-width: 768px) { 299 scroll-snap-align: center; 300 } 301 302 &::before { 303 content: ""; 304 position: absolute; 305 top: 0; 306 left: 0; 307 right: 0; 308 bottom: 0; 309 background-image: url(${L.paper}); 310 background-size: 100% 100%; 311 background-repeat: no-repeat; 312 background-position: center; 313 opacity: 0.05; 314 border-radius: 16px; 315 pointer-events: none; 316 z-index: 0; 317 } 318 319 & > * { 320 position: relative; 321 z-index: 1; 322 } 323`,tt=n.div` 324 color: ${a.brandBlack}; 325 margin-bottom: 16px; 326`,et=n.div` 327 color: ${a.neutralDark}; 328 display: flex; 329 justify-content: space-between; 330`,ht=n.div` 331 display: flex; 332 flex-direction: column; 333 position: relative; 334`;n.div` 335 display: flex; 336 align-items: center; 337 justify-content: center; 338 padding: 8px; 339 margin-top: 8px; 340 color: ${a.neutralDark}; 341 font-size: 14px; 342 border-top: 1px dashed ${a.neutralLight}; 343`;const ut=n.div` 344 display: flex; 345 align-items: center; 346 gap: 8px; 347 cursor: pointer; 348 border-radius: 4px; 349 transition-property: transform; 350 transition-duration: 0.2s; 351 transition-timing-function: ease-in-out; 352 353&:hover { 354 transform: translateY(-2px); 355 } 356 357 &:active { 358 transform: scale(0.96); 359 } 360 361 &.loading { 362 cursor: not-allowed; 363 364 &:hover { 365 transform: none; 366 } 367 368 &:active { 369 transform: none; 370 } 371 } 372`,mt=n.div` 373 width: 48px; 374 height: 48px; 375 background: ${a.orange}; 376 border-radius: 8px; 377 display: flex; 378 align-items: center; 379 justify-content: center; 380 overflow: hidden; 381 position: relative; 382`,he=n.img` 383 width: 100%; 384 height: 100%; 385 object-fit: cover; 386 border-radius: 8px; 387 outline: 1px solid ${a.blackAlpha07}; 388 outline-offset: -1px; 389`,ft=n.div` 390 flex: 1; 391`,gt=n.div` 392 color: ${a.brandBlack}; 393 margin-bottom: 4px; 394 display: -webkit-box; 395 -webkit-line-clamp: 2; 396 -webkit-box-orient: vertical; 397 overflow: hidden; 398`,ue=n.div` 399 color: ${a.neutralDark}; 400`,me=n.div` 401 display: flex; 402 align-items: center; 403 justify-content: flex-start; 404 gap: 8px; 405 padding: 16px; 406 color: ${a.neutralDark}; 407 border: 1px solid ${a.neutralLight}; 408 border-radius: 16px; 409 margin-top: 16px; 410`,fe=n.div` 411 display: flex; 412 justify-content: center; 413 align-items: center; 414 gap: 16px; 415 margin-top: 32px; 416`,at=n.button` 417 width: 48px; 418 height: 48px; 419 border-radius: 50%; 420 border: none; 421 background: ${e=>e.$disabled?a.neutralDark:a.brandBlack}; 422 color: ${e=>e.$disabled?a.neutralDark:a.brandWhite}; 423 cursor: ${e=>e.$disabled?"not-allowed":"pointer"}; 424 display: flex; 425 align-items: center; 426 justify-content: center; 427 transition-property: background, scale; 428 transition-duration: 0.15s; 429 transition-timing-function: ease-out; 430 431 &:active { 432 ${e=>!e.$disabled&&"scale: 0.96;"} 433 } 434`,I=` 435 @keyframes shimmer { 436 0% { 437 opacity: 1; 438 } 439 50% { 440 opacity: 0.5; 441 } 442 100% { 443 opacity: 1; 444 } 445 } 446`,ge=` 447 @keyframes bounce { 448 0%, 80%, 100% { 449 transform: scale(0); 450 } 451 40% { 452 transform: scale(1); 453 } 454 } 455`,wt=` 456 @keyframes pulse { 457 0%, 100% { 458 opacity: 1; 459 } 460 50% { 461 opacity: 0.5; 462 } 463 } 464`,U=n.div` 465 height: 28px; 466 width: 300px; 467 background-color: ${a.skeletonBase}; 468 border-radius: 8px; 469 margin: 0 auto 8px; 470 animation: shimmer 1.5s ease-in-out infinite; 471 ${I} 472`,q=n.div` 473 height: 20px; 474 width: 200px; 475 background-color: ${a.skeletonBase}; 476 border-radius: 8px; 477 margin: 0 auto 8px; 478 animation: shimmer 1.5s ease-in-out infinite; 479 ${I} 480`,K=n.div` 481 height: 16px; 482 width: 400px; 483 background-color: ${a.skeletonBase}; 484 border-radius: 8px; 485 margin: 0 auto; 486 animation: shimmer 1.5s ease-in-out infinite; 487 ${I} 488`,we=n.div` 489 display: flex; 490 gap: 20px; 491 padding: 0 10px; 492`,N=n.div` 493 min-width: 300px; 494 padding: 24px; 495 background: linear-gradient(135deg, ${a.skeletonHighlight} 0%, ${a.skeletonBase} 100%); 496 border-radius: 16px; 497 box-shadow: 0 0 0 1px ${a.skeletonBorder}, 0 4px 12px ${a.shadowSoft}; 498 position: relative; 499`,ve=n.div` 500 width: 32px; 501 height: 32px; 502 background-color: ${a.skeletonBorder}; 503 border-radius: 50%; 504 position: absolute; 505 top: 16px; 506 right: 16px; 507 transform: rotate(45deg); 508 animation: bounce 1.4s ease-in-out infinite both; 509 ${ge} 510`,be=n.div` 511 height: 24px; 512 width: 180px; 513 background-color: ${a.neutralLight}; 514 border-radius: 8px; 515 animation: shimmer 1.5s ease-in-out infinite; 516 ${I} 517`,ye=n.div` 518 display: flex; 519 flex-direction: column; 520 gap: 12px; 521 margin-top: 16px; 522`,je=n.div` 523 display: flex; 524 align-items: center; 525 gap: 12px; 526 padding: 12px; 527 background: ${a.brandWhite}; 528 border-radius: 12px; 529 border: 1px solid ${a.neutralLight}; 530`,$e=n.div` 531 width: 48px; 532 height: 48px; 533 background-color: ${a.neutralLight}; 534 border-radius: 8px; 535 animation: pulse 1.5s ease-in-out infinite; 536 ${wt} 537`,ke=n.div` 538 flex: 1; 539 display: flex; 540 flex-direction: column; 541 gap: 4px; 542`,Ce=n.div` 543 height: 16px; 544 width: 100%; 545 background-color: ${a.neutralLight}; 546 border-radius: 4px; 547 animation: shimmer 1.5s ease-in-out infinite; 548 ${I} 549`,Se=n.div` 550 height: 16px; 551 width: 60%; 552 background-color: ${a.neutralLight}; 553 border-radius: 4px; 554 animation: shimmer 1.5s ease-in-out infinite; 555 ${I} 556`,Le=n.div` 557 display: flex; 558 justify-content: center; 559 align-items: center; 560 gap: 20px; 561 margin-top: 32px; 562`,De=n.div` 563 width: 48px; 564 height: 48px; 565 border-radius: 50%; 566 background-color: ${a.skeletonBase}; 567 animation: pulse 1.5s ease-in-out infinite; 568 ${wt} 569`;n.div` 570 display: flex; 571 gap: 8px; 572`;n.div` 573 width: 8px; 574 height: 8px; 575 border-radius: 50%; 576 background-color: ${a.skeletonBase}; 577 animation: shimmer 1.5s ease-in-out infinite; 578 ${I} 579`;const _e=n.div` 580 @media (max-width: 1024px) { 581 ${A} { 582 max-width: 900px; 583 margin-left: 20px; 584 margin-right: 20px; 585 } 586 } 587 588 @media (max-width: 768px) { 589 ${A} { 590 max-width: 720px; 591 margin-left: 16px; 592 margin-right: 16px; 593 padding: 16px 0; 594 } 595 596 ${P} { 597 width: 320px; 598 max-width: 320px; 599 min-width: 320px; 600 height: 320px; 601 margin: 0; 602 padding: 16px; 603 border-radius: 16px; 604 } 605 606 ${N} { 607 max-width: 280px; 608 padding: 16px; 609 } 610 611 ${Z} { 612 font-size: 20px; 613 } 614 615 ${U} { 616 width: 250px; 617 height: 24px; 618 } 619 620 ${q} { 621 width: 180px; 622 height: 18px; 623 } 624 625 ${K} { 626 width: 300px; 627 } 628 } 629 630 @media (max-width: 480px) { 631 ${A} { 632 max-width: 375px; 633 margin: 32px auto; 634 padding: 12px 0; 635 } 636 637 ${P} { 638 width: 324px; 639 max-width: 324px; 640 min-width: 324px; 641 height: 324px; 642 margin: 0; 643 padding: 16px; 644 border-radius: 16px; 645 } 646 647 ${N} { 648 max-width: 260px; 649 padding: 12px; 650 } 651 652 ${Z} { 653 font-size: 18px; 654 } 655 656 ${U} { 657 width: 200px; 658 } 659 660 ${q} { 661 width: 150px; 662 } 663 664 ${K} { 665 width: 250px; 666 } 667 } 668 669 @media (max-width: 375px) { 670 ${A} { 671 margin: 16px auto; 672 justify-content: center; 673 674 } 675 676 ${P} { 677 width: 300px; 678 max-width: 300px; 679 min-width: 300px; 680 height: 300px; 681 margin: 0; 682 padding: 16px; 683 border-radius: 16px; 684 } 685 686 ${N} { 687 max-width: 240px; 688 padding: 10px; 689 } 690 691 ${U} { 692 width: 180px; 693 } 694 695 ${q} { 696 width: 120px; 697 } 698 699 ${K} { 700 width: 200px; 701 } 702 } 703`,Ee=n.div` 704 width: 100%; 705 padding: 28px 0 64px; 706`,Be=n.div` 707 max-width: 1200px; 708 margin: 0 auto; 709 display: flex; 710 justify-content: center; 711`,Ie=n.div` 712 display: flex; 713 flex-direction: column; 714 align-items: center; 715`,Te=n.div` 716 display: flex; 717 flex-direction: column; 718 align-items: center; 719 justify-content: center; 720 gap: 8px; 721 margin-bottom: 16px; 722`,Ae=n.div` 723 width: 300px; 724 height: 100%; 725 display: flex; 726 flex-direction: column; 727 align-items: center; 728 justify-content: center; 729 gap: 8px; 730 margin-bottom: 32px; 731`,Pe=n.div` 732 margin-top: 16px; 733`,ze=16,Ne=150,Re=50,ot=768,st=1024,V={mobile:375,mobileMedium:480,mobileLarge:768},dt=()=>R()==="ios"?G.appleStoreLink:G.playStoreLink,Ge=e=>{try{let i=e;!e.startsWith("http://")&&!e.startsWith("https://")&&(i=`https://${e}`);
733const r=new URL(i);return r.hostname.toLowerCase().includes("amazon")?(r.searchParams.set("tag","papelzinho-20"),r.toString()):e}catch{if(e.toLowerCase().includes("amazon")){const r=e.includes("?")?"&":"?";return`${e}${r}tag=papelzinho-20`}return e}};function Oe(){const[e,i]=c.useState(()=>{const r=window.innerWidth;return r<ot?1:r<st?2:3});return c.useEffect(()=>{let r;const s=()=>{const d=window.innerWidth;i(d<ot?1:d<st?2:3)},o=()=>{clearTimeout(r),r=setTimeout(s,Ne)};return window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o),clearTimeout(r)}},[]),e}function We(e){const[i,r]=c.useState(0);return c.useEffect(()=>{const s=()=>{e.current&&r(e.current.offsetWidth)};if(s(),typeof ResizeObserver<"u"){const o=new ResizeObserver(s);return e.current&&o.observe(e.current),()=>{o.disconnect()}}else return window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)}},[e]),i}function Me(e,i){const[r,s]=c.useState(0),o=c.useRef(null),d=We(o),f=c.useCallback(()=>d===0||i===0?350:d<=V.mobile?300:d<=V.mobileMedium?310:d<=V.mobileLarge?320:d/i,[d,i]),u=c.useCallback(()=>f()+ze,[f]),x=c.useMemo(()=>Math.max(0,e-i),[e,i]),b=c.useCallback(()=>{if(!o.current)return 0;const h=o.current.scrollLeft,l=u(),w=Math.round(h/l);return Math.max(0,Math.min(w,x))},[u,x]),g=c.useCallback(h=>{if(!o.current)return;const l=Math.max(0,Math.min(h,x)),w=u();o.current.scrollTo({left:l*w,behavior:"smooth"}),s(l)},[x,u]),y=c.useCallback(()=>{r<x&&g(r+1)},[r,x,g]),m=c.useCallback(()=>{r>0&&g(r-1)},[r,g]);return c.useEffect(()=>{const h=o.current;if(!h)return;let l;const w=()=>{clearTimeout(l),l=setTimeout(()=>{const j=b();s(j)},Re)};return h.addEventListener("scroll",w,{passive:!0}),()=>{h.removeEventListener("scroll",w),clearTimeout(l)}},[b]),c.useEffect(()=>{r>x&&s(x)},[i,x,r]),c.useEffect(()=>{if(d>0&&o.current){const h=u(),l=r*h;o.current.scrollLeft=l}},[d,r,u]),{currentIndex:r,carouselRef:o,nextSlide:y,prevSlide:m,maxSlides:x}}const Fe=({gift:e,index:i,onClick:r})=>{const s=_().drawInfo;return t.jsxs("div",{children:[t.jsxs(ut,{onClick:()=>r==null?void 0:r(e),children:[t.jsx(mt,{children:e.product_photo&&t.jsx(he,{src:e.product_photo,alt:e.product_title||s.productAlt,loading:"lazy",onError:o=>{const d=o.target;d.style.display="none",d.parentElement&&(d.parentElement.innerHTML="")}})}),t.jsxs(ft,{children:[t.jsx(gt,{children:e.product_title||""}),t.jsx(ue,{children:Tt(e.product_price,e.currency)})]})]}),i<2&&t.jsx(J,{marginTop:12,marginBottom:12,width:"100%",dotSize:2})]},i)},Ye=({participant:e})=>{const i=_().drawInfo,r=s=>{S({screenName:"gift_list",param:"gift_item_click",attributes:{participant_id:e.id,gift_title:s.product_title,gift_price:s.product_price,has_link:!!(s.product_link||s.product_url)}});const o=s.product_link||s.product_url;if(o){const d=Ge(o);X(d)}};return t.jsxs(P,{className:"gift-card",$hasGifts:e.hasGifts,role:"listitem","aria-label":_t(i.listAria,{name:e.name}),children:[t.jsxs(et,{children:[t.jsx(p,{variant:"SecondaryRegular",color:a.neutralDark,children:i.listOf}),t.jsx("img",{src:L.logo,alt:i.logoAlt,width:24,height:24})]}),t.jsx(tt,{children:t.jsx(p,{variant:"BigBold",color:a.brandBlack,translate:"no",children:e.name})}),e.hasGifts?t.jsx(ht,{children:e.gifts.slice(0,3).map((s,o)=>t.jsx(Fe,{gift:s,index:o,onClick:r},o))}):t.jsxs(me,{children:[t.jsx("img",{src:L.information,alt:i.infoAlt,width:24,height:24}),t.jsx(p,{variant:"TertiaryRegular",color:a.neutralDark,children:i.noGiftsYet})]})]},e.id)},He=({itemsPerView:e})=>{const i=_().drawInfo;return t.jsxs(pt,{children:[t.jsx(xt,{children:t.jsx(we,{children:Array.from({length:e},(r,s)=>t.jsxs(N,{children:[t.jsx(ve,{}),t.jsx(et,{children:t.jsx(p,{variant:"SecondaryRegular",color:a.neutralDark,children:i.listOf})}),t.jsx(tt,{children:t.jsx(p,{variant:"BigBold",color:a.brandBlack,translate:"no",children:t.jsx(be,{})})}),t.jsx(ye,{children:Array.from({length:3},(o,d)=>t.jsxs(je,{children:[t.jsx($e,{}),t.jsxs(ke,{children:[t.jsx(p,{variant:"SecondaryRegular",color:a.brandBlack,children:t.jsx(Ce,{})}
733),t.jsx(p,{variant:"SecondaryRegular",color:a.brandBlack,children:t.jsx(Se,{})})]})]},d))})]},s))})}),t.jsx(Le,{children:t.jsx(De,{})})]})},Ue=()=>{const e=_().drawInfo;c.useEffect(()=>{S({screenName:"gift_list",param:"empty_card_view",attributes:{timestamp:new Date().toISOString(),platform:R()}})},[]);const i=()=>{const r=R();S({screenName:"gift_list",param:"empty_card_cta_click",attributes:{platform:r,store_link:dt(),action:"download_app"}}),S({screenName:"gift_list",param:"app_download_attempt",attributes:{platform:r==="ios"?"ios":"android",source:"website"}}),X(dt())};return t.jsx(Ee,{children:t.jsx(Be,{children:t.jsxs(Ie,{children:[t.jsx(Te,{children:t.jsx(p,{variant:"Display24",color:a.brandBlack,children:e.emptyCardTitle})}),t.jsx(Ae,{children:t.jsx(p,{variant:"SecondaryRegular",color:a.neutralDark,children:e.emptyCardDescription})}),t.jsxs(P,{$hasGifts:!0,children:[t.jsxs(et,{children:[t.jsx(p,{variant:"SecondaryRegular",color:a.neutralDark,children:e.listOf}),t.jsx("img",{src:L.logo,alt:e.logoAlt,width:24,height:24})]}),t.jsx(tt,{children:t.jsx(p,{variant:"BigBold",color:a.brandBlack,children:e.emptyCardMockName})}),t.jsx(ht,{children:t.jsxs(ut,{children:[t.jsx(mt,{}),t.jsx(ft,{children:t.jsx(gt,{children:e.emptyCardMockGift})})]})})]}),t.jsx(Pe,{children:t.jsx(Q,{variant:"primary",onClick:i,children:t.jsx(p,{variant:"SecondaryMedium",color:a.brandWhite,children:e.emptyCardCta})})})]})})})},qe=({currentIndex:e,maxSlides:i,onPrev:r,onNext:s})=>{const o=_().drawInfo,d=()=>{S({screenName:"gift_list",param:"gift_list_navigation",attributes:{action:"prev",current_index:e,max_slides:i,direction:"backward"}}),r()},f=()=>{S({screenName:"gift_list",param:"gift_list_navigation",attributes:{action:"next",current_index:e,max_slides:i,direction:"forward"}}),s()};return t.jsxs(fe,{children:[t.jsx(at,{onClick:d,$disabled:e===0,"aria-label":o.prevAria,"aria-disabled":e===0,tabIndex:e===0?-1:0,children:t.jsx("img",{src:L.chevron,alt:o.chevronAlt,style:{transform:"rotate(180deg)"},width:24,height:24})}),t.jsx(at,{onClick:f,$disabled:e>=i,"aria-label":o.nextAria,"aria-disabled":e>=i,tabIndex:e>=i?-1:0,children:t.jsx("img",{src:L.chevron,alt:o.chevronAlt,width:24,height:24})})]})},Ke=({participantData:e,currentIndex:i,itemsPerView:r,carouselRef:s,onPrev:o,onNext:d,maxSlides:f})=>{const u=_().drawInfo;return t.jsxs(pt,{role:"region","aria-label":u.carouselAria,children:[t.jsx(xt,{ref:s,role:"list","data-horizontal-carousel":!0,children:t.jsx(xe,{$currentIndex:i,$itemsPerView:r,role:"presentation",children:e.map(x=>t.jsx(Ye,{participant:x},x.id))})}),t.jsx(qe,{currentIndex:i,maxSlides:f,onPrev:o,onNext:d})]})};function Ve({participants:e=[]}){const i=_().drawInfo,[r,s]=c.useState([]),o=Oe(),{currentIndex:d,carouselRef:f,nextSlide:u,prevSlide:x,maxSlides:b}=Me(r.length,o);return c.useEffect(()=>{S({screenName:"gift_list",param:"gift_list_view",attributes:{total_participants:e.length,has_participants:e.length>0,items_per_view:o}})},[e.length,o]),c.useEffect(()=>{if((e==null?void 0:e.length)>0){const g=e.map(y=>{const m=y.giftOptions||[];return{id:y.id,name:y.name||i.noName,gifts:m,hasGifts:m.length>0}});s(g)}},[e,i.noName]),t.jsxs(_e,{children:[t.jsx(le,{children:t.jsx(p,{variant:"Display24",color:a.brandBlack,children:i.giftListMainTitle})}),t.jsxs(A,{children:[t.jsx(Z,{children:t.jsx(p,{variant:"BigMedium",color:a.brandBlack,children:i.giftListTitle})}),t.jsx(pe,{children:t.jsx(p,{variant:"SecondaryRegular",color:a.neutralDark,textAlign:"left",children:i.giftListDescription})}),r.length===0?t.jsx(He,{itemsPerView:o}):t.jsx(Ke,{participantData:r,currentIndex:d,itemsPerView:o,carouselRef:f,onPrev:x,onNext:u,maxSlides:b})]}),t.jsx(Ue,{})]})}function si(){const e=_().drawInfo,{group:i,participants:r}=oe(),{secretFriendName:s,secretFriendDrawColor:o,loading:d,showConfetti:f,triggerConfetti:u,width:x,height:b,theme:g,isWideEnough:y,chosenDate:m,groupId:h,myContact:l}=ce({group:i,participants:r}),w=ct(),{isAuthenticated:j}=Et(),E=!g||y,D=E&&!d&&!!i&&!!h,T=()=>{if(!h)return;S({screenName:"DrawInfo",param:"group_cta_click",attributes:{authenticated:j?"true":"false"}});const C=de(j,h,l);
733w(C.to,C.state?{state:C.state}:void 0)},$=()=>{S({screenName:"DrawInfo",param:"app_download_attempt",attributes:{platform:"ios",source:"website"}}),window.open("https://apps.apple.com/br/app/papelzinho/id1133660909","_blank")},z=()=>{S({screenName:"DrawInfo",param:"app_download_attempt",attributes:{platform:"android",source:"website"}}),window.open("https://play.google.com/store/apps/details?id=kaiquedamato.com.papelzinho","_blank")};return t.jsxs(Kt,{$hasCta:D,children:[f&&t.jsx(qt,{children:t.jsx(Nt,{width:x,height:b,recycle:!1,numberOfPieces:300,gravity:.3,wind:.05,tweenDuration:4e3})}),t.jsx(lt,{}),g&&!y?t.jsx(ae,{}):t.jsxs(t.Fragment,{children:[t.jsxs(Zt,{children:[t.jsxs(te,{children:[t.jsx(nt,{children:t.jsx(p,{variant:"Display48",children:e.revealTitle})}),t.jsx(Ot,{name:s||"",drawColor:o,loading:d,onReveal:u})]}),t.jsxs(Qt,{children:[t.jsx(nt,{children:t.jsxs(p,{variant:"SecondaryRegular",color:a.neutralDark,children:[e.secretLine1," ",t.jsx("br",{}),e.secretLine2]})}),t.jsxs(Xt,{children:[t.jsx(rt,{src:L.appStore,alt:e.appStoreAlt,onClick:$}),t.jsx(rt,{$wide:!0,src:L.playStore,alt:e.playStoreAlt,onClick:z})]})]})]}),t.jsx(Ve,{participants:r}),t.jsx(Ut,{group:i,chosenDate:m})]}),E&&!d&&i&&t.jsx(At,{}),E&&t.jsx(Bt,{}),D&&t.jsx(Vt,{children:t.jsx(Jt,{children:t.jsx(Q,{variant:"primary",onClick:T,children:t.jsx(p,{variant:"SecondaryMedium",color:a.brandWhite,children:e.seeMyGroup})})})})]})}export{si as DrawInfo};
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.