PageSourceSearch

https://crumblcookies.com/_next/static/chunks/pages/promo/share/[shortId]-944126fb6f592946.js

js crumblcookies.com collected 2026-09-24 09:14:07 UTC 12,605 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3389],{1033:(e,r,o)=>{"use strict";o.r(r),o.d(r,{__N_SSP:()=>A,default:()=>k});var l=o(37876),a=o(56557),n=o.n(a),t=o(66315),i=o.n(t),s=o(89033),d=o(54587),c=o.n(d),u=o(89099),m=o(14232),p=o(73604),h=o(69936),f=o(85426),x=o(4359),g=o(46637),v=o(55020),_=o(20596),y=o(12099),w=o(19528),j=o(57303),b=o(63382);let N={src:"/_next/static/media/giftFriendCookie.b3224a42.png"},S={src:"/_next/static/media/giftFriendCookieVoucher.d66ad651.png"};n().extend(i());var A=!0;function k(e){var r,o,a,t,i,d,A,k,C,E,P,I,M,D,T,B,F,O,U,Y,G,R,q,W,Q,V,K,L,H;let{promotionId:X,shortId:$,promotionOg:z}=e,J=(0,u.useRouter)(),{t:Z}=(0,s.Bd)(["promoShare","common"]),{customer:ee,loadingCustomer:er,openSignIn:eo}=(0,f.L)(),[el,{data:ea,loading:en}]=(0,y.bO)(_.OIC),et=null==ea||null==(r=ea.customerProductPromotions)?void 0:r.redeemPromoShareByShortId,{data:ei,loading:es}=(0,g.Kx)({promotionId:X}),ed=null==ei||null==(o=ei.customerProductPromotions)?void 0:o.getMyPromoShareLink,{data:ec,loading:eu}=(0,g.Lz)({promotionId:X}),em=null!=(W=null==ec||null==(a=ec.customerProductPromotions)?void 0:a.promotion)?W:null,[ep,eh]=(0,m.useState)(!1),[ef,ex]=(0,m.useState)(!1),eg=null!=em&&!!em.endDate&&n()(em.endDate).isBefore(n()()),ev=(null!=(Q=null==em?void 0:em.redemptionType)?Q:null==z?void 0:z.redemptionType)===_.EDx.Voucher,e_=null!=(V=null==em?void 0:em.description)?V:null==z?void 0:z.description,ey=(null==et||null==(t=et.redemptionError)?void 0:t.code)===_.nDH.AlreadyRedeemed,ew={[_.WQ5.Dessert]:Z("promoShare:reward_category_dessert"),[_.WQ5.Soda]:Z("promoShare:reward_category_soda"),[_.WQ5.GiftCard]:Z("promoShare:reward_category_gift_card")},ej=!!(((null==et?void 0:et.giftcard)||(null==et?void 0:et.voucher))&&(null==et?void 0:et.success)),eb=null==et||null==(d=et.sender)||null==(i=d.name)?void 0:i.split(" ")[0],eN=(()=>{if((null==ee?void 0:ee.userId)&&et&&!ej&&!ey){var e,r;return null!=(r=null==(e=et.redemptionError)?void 0:e.message)?r:Z("promoShare:default_redemption_error")}return eb&&(null==et?void 0:et.rewardCategory)?Z("promoShare:sender_sent_you_free_reward",{name:eb,category:ew[et.rewardCategory]}):Z("promoShare:welcome_to_crumbl")})();(0,m.useEffect)(()=>{eh(!0)},[]),(0,m.useEffect)(()=>{if(!er&&(null==ee?void 0:ee.userId)&&$&&X)try{el({variables:{shortId:$}})}catch(e){console.error("Error redeeming promo share:",e)}},[er,null==ee?void 0:ee.userId,$,X]);let eS=null==em||null==(A=em.amountsByRegion)?void 0:A.find(e=>e.region===(0,b.kO)(J.locale)),eA=()=>{eo({next:J.asPath})},ek=async()=>{ex(!0);try{await J.push({pathname:ev?"/vouchers":"/account",...!ev&&{query:{tab:"my_gift_cards"}}})}catch(e){console.error("Error redirecting to login:",e)}finally{ex(!1)}},eC=async()=>{ex(!0);try{await J.push({pathname:"/order"})}catch(e){console.error("Error redirecting to order:",e)}finally{ex(!1)}},eE=async()=>{if(null==ed?void 0:ed.shareUrl){ex(!0);try{window.navigator.share?await window.navigator.share({text:ed.shareUrl,title:ev?Z("promoShare:open_graph_title_voucher"):Z("promoShare:open_graph_title")}):window.open(ed.shareUrl,"_blank","noopener")}catch(e){console.error("Error referring friend:",e)}finally{ex(!1)}}};return X?(0,l.jsx)(v.A,{cta:!1,footer:!1,hideFullWidth:!0,overrideOpenGraphTitle:ev?Z("promoShare:open_graph_title_voucher"):Z("promoShare:open_graph_title"),overrideOpenGraphDescription:e_,overrideOpenGraphImage:ev?S.src:N.src,children:(0,l.jsx)("div",{className:"flex flex-col items-center justify-start h-full w-full sm:py-[40px] sm:px-[30px] lg:py-[60px] bg-secondary-light",children:(0,l.jsx)("div",{className:"bg-white w-full max-w-[524px] p-[40px] rounded-[15px] overflow-hidden flex flex-col items-center justify-center gap-[24px] sm:shadow-[0_4px_16px_0_rgba(0,0,0,0.10)]",children:!ep||er||en||es||eu||(null==ee?void 0:ee.userId)&&!ea?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"animate-pulse bg-grey-200 w-full h-[200px] rounded-[10px]"}),(0,l.jsx)("div",{className:"animate-pulse bg-grey-200 w-full h-[200px] rounded-[10px]"}),(0,l.jsx)("div",{className:"animate-pulse bg-grey-200 w-full h-[200px] rounded-[10px]"}),(0,l.jsx)("div",{className:"animate-pulse bg-grey-200 w-full h-[200px] rounded-[10px]"})]}):eg?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c(),{src:"/images/v2/gift_crumbl.png",alt:"crumbl gift image",width:100,height:100}),(0,l.jsx)(h.A,{variant:"display4",className:"text-center",children:Z("promoShare:promo_expired")}),(0,l.jsx)(h.A,{variant:"body1",className:"text-center",children:Z("promoShare:promo_expired_on",{date:n()(null==em?void 0:em.endDate).format("MM/DD/YYYY")})}),(0,l.jsx)(c(),{src:null!=(K=null==em?void 0:em.image)?K:"/images/v2/giftwrap-illustration-box.png",alt:"promotion image",width:500,height:500,className:"w-full h-auto rounded-[10px] border border-solid border-grey-200"})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c(),{src:"/images/v2/gift_crumbl.png",alt:"crumbl gift image",width:100,height:100}),(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center gap-[8px]",children:[(0,l.jsx)(h.A,{variant:"display4",className:"text-center",children:eN}),(null==ee?void 0:ee.userId)?(0,l.jsx)(h.A,{variant:"body1",className:"text-center",children:(null==et||null==(k=et.redemptionError)?void 0:k.message)?ey?null==et||null==(C=et.redemptionError)?void 0:C.message:Z("promoShare:refer_a_friend_instead"):(0,l.jsx)(s.x6,{i18nKey:"promoShare:gift_card_added_to_account",values:{rewardType:ev?Z("promoShare:redemption_type_voucher"):Z("promoShare:redemption_type_gift_card"),senderName:null!=(L=null==et||null==(E=et.sender)?void 0:E.name)?L:""},components:{bold:(0,l.jsx)("strong",{})}})}):(0,l.jsx)(h.A,{variant:"body1",className:"text-center",children:(0,l.jsx)(s.x6,{i18nKey:"promoShare:sign_in_to_add_gift_card",values:{amount:(0,j.up)(null==eS?void 0:eS.amount,J.locale)},components:{signIn:(0,l.jsx)("button",{type:"button",className:"underline cursor-pointer",onClick:eA})}})})]}),(null==et?void 0:et.success)&&(0,l.jsx)(h.A,{variant:"title1",className:"text-center",children:null==em?void 0:em.name}),(null==eS?void 0:eS.amount)&&(0,l.jsx)(h.A,{variant:"title1",className:"text-center",children:(0,j.up)(eS.amount,J.locale)}),(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center gap-[16px] w-full",children:[ev?(0,l.jsxs)("div",{className:"relative w-full max-w-[356px]",children:[(0,l.jsx)(c(),{src:"/images/v2/Voucher.png",alt:"voucher image",width:500,height:500,className:"w-full h-auto rounded-[10px]"}),(0,l.jsxs)("div",{className:"absolute top-[24px] left-[16px] flex flex-col",children:[(0,l.jsx)(h.A,{variant:"lineItem",children:null==et||null==(P=et.voucher)?void 0:P.name}),eb&&(0,l.jsx)(h.A,{variant:"body2",children:Z("promoShare:voucher_from",{name:eb})})]})]}):(0,l.jsx)(c(),{src:null!=(H=null==em?void 0:em.image)?H:"/images/v2/giftwrap-illustration-box.png",alt:"promotion image",width:500,height:500,className:"w-full h-auto rounded-[10px] border border-solid border-grey-200"}),(null==et||null==(I=et.voucher)?void 0:I.expiresAt)&&(0,l.jsx)(h.A,{variant:"body2",className:"text-center text-grey-60",children:Z("promoShare:expires_on",{date:n()(et.voucher.expiresAt).format("MMM D, YYYY")})})]}),(null==et?void 0:et.success)||ey?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(p.A,{}),(0,l.jsxs)("div",{className:"flex items-center justify-center gap-[40px]",children:[((null==et||null==(D=et.giftcard)||null==(M=D.qrCodeUrl)?void 0:M.url)||(null==et||null==(B=et.voucher)||null==(T=B.qrCodeUrl)?void 0:T.url))&&(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center gap-[8px]",children:[(0,l.jsx)(c(),{src:(null==(O=et.giftcard)||null==(F=O.qrCodeUrl)?void 0:F.url)||(null==(Y=et.voucher)||null==(U=Y.qrCodeUrl)?void 0:U.url),alt:(null==(R=et.giftcard)||null==(G=R.qrCodeUrl)?void 0:G.url)?"Gift Card QR Code":"Voucher QR Code",width:500,height:500,className:"w-full h-auto rounded-[10px] max-w-[115px] max-h-[115px] self-center"}),(0,l.jsx)(h.A,{variant:"finePrint",className:"text-center text-grey-60",children:Z("promoShare:scan_to_use_in_store")})]}),(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center gap-[12px]",children:[(0,l.jsx)(x.A,{variant:"primary",className:"w-full",onClick:eC,disabled:ef,children:Z("promoShare:start_an_order")}),(0,l.jsx)(x.A,{variant:"secondary",className:"w-full",onClick:ek,disabled:ef,children:ev?Z("promoShare:view_my_vouchers"):Z("promoShare:view_my_gift_cards")})]})]})]}):(null==et?void 0:et.redemptionError)&&(null==ee?void 0:ee.userId)?(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center gap-[16px]",children:[(0,l.jsx)(x.A,{disabled:ef,variant:"primary",className:"w-full",onClick:eE,children:Z("promoShare:refer_a_friend")}),(null==et||null==(q=et.redemptionError)?void 0:q.code)===_.nDH.SelfRedemption&&(0,l.jsx)(x.A,{disabled:ef,variant:"secondary",className:"w-full",onClick:ek,children:ev?Z("promoShare:view_my_vouchers"):Z("promoShare:view_my_gift_cards")})]}):(0,l.jsx)(x.A,{disabled:ef,variant:"primary",className:"w-full",onClick:eA,children:Z("promoShare:sign_in_to_redeem")}),(0,l.jsx)(p.A,{}),(0,l.jsx)(h.A,{variant:"body2",className:"text-center",children:(0,l.jsx)(s.x6,{i18nKey:"promoShare:download_app_for_best_experience",components:{appLink:(0,l.jsx)("button",{type:"button",className:"underline cursor-pointer",onClick:()=>{let e="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent);window.open(e?w.Bg:w.sG,"_blank","noopener")}})}})})]})})})}):(0,l.jsx)(v.A,{cta:!1,footer:!1,hideFullWidth:!0,children:(0,l.jsx)("div",{className:"flex flex-col items-center justify-start h-full w-full sm:py-[40px] sm:px-[30px] lg:py-[60px] bg-secondary-light",children:(0,l.jsxs)("div",{className:"bg-white w-full max-w-[524px] p-[40p
1x] rounded-[15px] overflow-hidden flex flex-col items-center justify-center gap-[24px] sm:shadow-[0_4px_16px_0_rgba(0,0,0,0.10)]",children:[(0,l.jsx)(c(),{src:"/images/v2/gift_crumbl.png",alt:"crumbl gift image",width:100,height:100}),(0,l.jsx)(h.A,{variant:"display4",className:"text-center",children:Z("promoShare:promo_not_found_title")}),(0,l.jsx)(h.A,{variant:"body1",className:"text-center",children:Z("promoShare:promo_not_found_description")})]})})})}},19528:(e,r,o)=>{"use strict";o.d(r,{Bg:()=>a,RA:()=>u,aT:()=>t,m0:()=>c,ph:()=>i,sG:()=>l,un:()=>s});let l="https://apps.apple.com/us/app/crumbl-cookies/id1438166219?ls=1&mt=8",a="https://play.google.com/store/apps/details?id=crumbl.cookies",n=()=>["tmobile-tuesday-oct-2024","/off-site/","/order/off-site","/flavor-vote","/flavour-vote"].some(e=>window.location.pathname.includes(e)),t=()=>{if(n())return!1;window.location.href=l},i=()=>{if(n())return!1;window.location.href=a},s=()=>"undefined"!=typeof navigator&&(navigator.userAgent.match("iPad")||navigator.userAgent.match("iPhone")||navigator.userAgent.match("iPod")),d=/Android/i,c=()=>"undefined"!=typeof navigator&&d.test(navigator.userAgent),u=()=>{s()?t():c()&&(window.location.href="intent://order/#Intent;package=crumbl.cookies;scheme=crumbl.cookies;action=android.intent.action.VIEW;S.browser_fallback_url=https://play.google.com/store/apps/details?id=crumbl.cookies;end")}},34272:(e,r,o)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/promo/share/[shortId]",function(){return o(1033)}])},66315:function(e){e.exports=function(e,r,o){e=e||{};var l=r.prototype,a={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function n(e,r,o,a){return l.fromToBase(e,r,o,a)}o.en.relativeTime=a,l.fromToBase=function(r,l,n,t,i){for(var s,d,c,u=n.$locale().relativeTime||a,m=e.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],p=m.length,h=0;h<p;h+=1){var f=m[h];f.d&&(s=t?o(r).diff(n,f.d,!0):n.diff(r,f.d,!0));var x=(e.rounding||Math.round)(Math.abs(s));if(c=s>0,x<=f.r||!f.r){x<=1&&h>0&&(f=m[h-1]);var g=u[f.l];i&&(x=i(""+x)),d="string"==typeof g?g.replace("%d",x):g(x,l,f.l,c);break}}if(l)return d;var v=c?u.future:u.past;return"function"==typeof v?v(d):v.replace("%s",d)},l.to=function(e,r){return n(e,r,this,!0)},l.from=function(e,r){return n(e,r,this)};var t=function(e){return e.$u?o.utc():o()};l.toNow=function(e){return this.to(t(this),e)},l.fromNow=function(e){return this.from(t(this),e)}}}},e=>{e.O(0,[4e3,9555,1221,5020,636,6593,8792],()=>e(e.s=34272)),_N_E=e.O()}]);
2//# sourceMappingURL=[shortId]-944126fb6f592946.js.map

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.