1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3422],{27256:(e,i,t)=>{"use strict";t.d(i,{I:()=>r});let r={immersiveSliderImage:{base:432,sm:640,md:864,lg:960,xl:1280,"2xl":1440},storeSectionImage:{base:640,md:960,lg:1184,xl:1344,"2xl":1440},blogCardFeatured:{base:600,md:800},eventTileImage:{base:400,md:600},heroImage:{base:640,md:960,lg:1200,xl:1440,"2xl":1920},brandCarouselImage:{base:168,md:240},brandTile:{base:400,md:400,lg:400,xl:800,"2xl":800},offerTile:{base:400,md:400,lg:400,xl:800,"2xl":800}}},36337:(e,i,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/offer-manager/edit/[[...params]]",function(){return t(66310)}])},56665:(e,i,t)=>{"use strict";t.r(i),t.d(i,{OfferManagerPreviewDetailSection:()=>u});var r=t(2860),n=t(79353),a=t(10617),l=t(52729),o=t(59030),s=t(35460),d=t(85770),c=t(65221);let u=e=>{var i,t,u;let{lang:p,showLangIndicator:h=!0,...m}=e,{brands:g}=(0,c.re)(),{values:f}=(0,o.j7)(),v=g.find(e=>{var i;return e.uid===(null==(i=f.brand)?void 0:i.uid)}),b=f.translations.find(e=>e.locale===p),{data:_,status:y}=(0,s.useSession)(),w="authenticated"===y&&(!!(null==_||null==(i=_.user)?void 0:i.isCustomer)||!!(null==_||null==(t=_.user)?void 0:t.isInvestor)),Y=f.bynder_image,x=(null==b?void 0:b.image_alt)||"No image alt set";return(0,r.FD)(n.az,{width:"100%",...m,children:[h&&(0,r.Y)(d.k,{withText:!0,lang:p}),(0,r.Y)(n.az,{transformOrigin:"top left",children:(0,r.Y)(a.l,{padding:"0 !important",brand:{title:(null==v?void 0:v.name)||"enter brand name",logo:null==v||null==(u=v.logo)?void 0:u.src,url:"#"},title:(null==b?void 0:b.detail_title)||"enter title",is_members_discount:f.is_members_discount,valid_from:f.valid_from,valid_until:f.valid_until,terms:(null==b?void 0:b.terms_conditions)||[],campaign_tag:null==b?void 0:b.campaign_tag,description:null==b?void 0:b.description,image:(0,l.n)(Y),from_price:f.from_price,to_price:f.to_price,language:p,isUserLoggedIn:w,external_url:null==b?void 0:b.external_url,image_alt:x})})]})}},65221:(e,i,t)=>{"use strict";t.d(i,{p0:()=>u,re:()=>d});var r=t(2860),n=t(13301),a=t(45272),l=t(81278),o=t(55729),s=t(79295);let d=()=>{let e=(0,o.useContext)(c);if(!c)throw Error("useOfferEditor must be used within a OfferManagerEditProvider");return e},c=(0,o.createContext)({}),u=e=>{var i,t;let{children:d,brands:u,categories:p,mainLanguageEntry:h,stepsAmount:m}=e,{query:g,push:f,asPath:v}=(0,l.useRouter)(),b=a.websiteData.locales.filter(e=>e!==a.websiteData.defaultLocale),_=Number(g.step)||0,y=(null==h||null==(i=h.image)?void 0:i.url)||"",w=null==(t=g.params)?void 0:t[0],Y=(0,n.I)({queryKey:["offerPublishDetails",w],queryFn:()=>(0,s.oI)(w),enabled:!1}),x=(0,o.useCallback)(e=>{e!==_&&f({pathname:v.split("?")[0],query:{step:e}},void 0,{shallow:!0})},[v,_,f]),D=(0,o.useMemo)(()=>({uid:w,currentStep:_,brands:u,categories:p,goToStep:x,foreignLanguages:b,imageFile:y,isLastStep:m-1===_}),[u,p,_,b,x,y,m,w]);return(0,o.useEffect)(()=>{w&&Y.refetch()},[Y.data]),(0,r.Y)(c.Provider,{value:{...D,publishDetailsQuery:Y},children:d})}},66310:(e,i,t)=>{"use strict";t.r(i),t.d(i,{__N_SSP:()=>eQ,default:()=>eZ});var r=t(2860),n=function(e){return e.info="info",e.success="success",e.error="error",e}(n||{});let a=(e,i)=>({position:"bottom-right",title:i,status:n[e],variant:"".concat(e,"Toast")}),l=(e,i,t)=>({loading:a("info",e),success:a("success",i),error:a("error",t)}),o=l("Saving offer...","Offer saved","Error saving offer"),s=l("Publishing offer...","Offer added to publish queue","Error publishing offer"),d=l("Unpublishing offer...","Offer sent for unpublishing","Error unpublishing offer");l("Requesting approval...","Request has been send","Error requesting approval"),l("Approving offer...","Approval email has been send","Error approving offer");let c=l("Rejecting offer...","Rejection email has been send","Error rejecting offer"),u=l("Publishing offers...","Offers added to the publish queue","Error publishing offers"),p=l("Unpublishing offers...","Offers sent for unpublishing","Error unpublishing offers"),h=a("error","Please fill all fields");var m=t(39618),g=t(79295),f=t(13301),v=t(35460);let b=()=>{var e,i;let t=(0,v.useSession)(),r=(null==t?void 0:t.status)==="authenticated",{data:n,isLoading:a}=(0,f.I)({queryKey:["user-groups"],queryFn:g.m_,refetchOnWindowFocus:!1,enabled:r});return{isApprover:null==n||null==(e=n.data)?void 0:e.some(e=>"Offer Manager - Approvers"===e.displayName),isAdmin:null==n||null==(i=n.data)?void 0:i.some(e=>"Offer Manager - Administrators"===e.displayName),isUserGroupsLoading:a,userGroups:n}};var _=t(21941);let y=/^\d+(\.\d{0,2})?$/,w=e=>!e||y.test(e.toString()),Y=[_.Ik().shape({brand:_.Ik().required("Required"),offer_type:_.Yj().required("Required"),publication_date:_.p6().required("Required"),valid_from:_.p6().required("Required"),valid_until:_.p6().min(new Date(Date.now()-864e5),"Invalid date").required("Required"),
1categories:_.YO(_.Ik()).min(1,"Required"),is_members_discount:_.zM()}),_.Ik().shape({translations:_.YO().of(_.Ik().shape({campaign_tag:_.Yj(),overview_title:_.Yj().max(35,"Maximum characters is 35").required("Required"),overview_description:_.Yj().required("Required")})),from_price:_.ai().positive().test("is-decimal","Maximum of two digits behind the comma",w),to_price:_.ai().positive().test("is-decimal","Maximum of two digits behind the comma",w)}),_.Ik().shape({translations:_.YO().of(_.Ik().shape({detail_title:_.Yj().max(35,"Maximum characters is 35").required("Required"),description:_.Yj().required("Required"),terms_conditions:_.YO().of(_.Yj()),external_url:_.Yj().url("Invalid URL")}))})];var x=t(32225),D=t(76382),F=t(59030),S=t(81278),C=t(79339),I=t.n(C),k=t(55729),E=t(48346),z=t(40043),j=t(79353),O=t(79861),T=t(82203),W=t.n(T),L=t(65964),M=t(74457),R=t(80191),q=t(70191),P=t(45272),B=t(20893),A=t(71024),U=t.n(A);let G=U()(()=>Promise.resolve().then(t.bind(t,56665)).then(e=>e.OfferManagerPreviewDetailSection),{loadableGenerated:{webpack:()=>[56665]},ssr:!1,loading:()=>(0,r.Y)(r.FK,{children:"Loading..."})});var N=t(19020);let J=(e,i)=>(0,f.I)({queryKey:["getOffer"],queryFn:async()=>{let t=await fetch("".concat(z.ij["offer-manager/offer"],"/").concat(e,"?").concat(new URLSearchParams({locales:i})),{method:"GET"});return await t.json()}});var K=t(28820),$=t(16216),V=t(8956),H=t(46809),X=t(90231),Q=t(51834),Z=t(62424),ee=t(94943),ei=t(87163),et=t(73086),er=t(32935);let en=(0,et.R)((e,i)=>{let t=void 0!==e.preserveColors&&e.preserveColors,n={...e};return t&&delete n.color,(0,r.Y)(er.I,{viewBox:"0 0 30 30",xmlns:"http://www.w3.org/2000/svg",ref:i,...n,children:(0,r.Y)("path",{d:"M15.707 15l14.348 14.348-.707.707L15 15.707.652 30.055l-.707-.707L14.293 15-.055.652l.707-.707L15 14.293 29.348-.055l.707.707L15.707 15z",fill:"currentColor"})})}),ea=e=>{let{onClose:i,isOpen:t,children:n,...a}=e;return(0,r.FD)(X.aF,{isOpen:t,onClose:i,isCentered:!0,size:"xl",blockScrollOnMount:!1,...a,children:[(0,r.Y)(Q.m,{}),(0,r.FD)(Z.$,{bgColor:"white",position:"relative",children:[(0,r.Y)(j.az,{sx:{display:"flex",justifyContent:"flex-end",paddingTop:"10px",paddingRight:"10px"},children:(0,r.FD)(O.$,{onClick:i,variant:"icon",children:[(0,r.Y)(ee.s6,{children:"Close modal"}),(0,r.Y)(en,{})]})}),(0,r.Y)(ei.c,{children:n})]})]})};var el=t(65221),eo=t(74901),es=t(56665),ed=t(79687);let ec=e=>new Date(e).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}),eu=e=>{var i,t;let{lang:n}=e,a=new Intl.DisplayNames([n],{type:"language"}).of(n),{values:l}=(0,F.j7)(),{publishDetailsQuery:o}=(0,el.re)(),{isApprover:c,isUserGroupsLoading:u}=b(),p=(0,x.d)(),[h,m]=(0,k.useState)(()=>!1),[f,v]=(0,k.useState)(!1),{data:_}=J(l.uid,"en"),y=!!(_&&_.status===E.O.Approved),w=()=>{setTimeout(()=>{o.refetch()},N.J)},Y=null==(t=o.data)||null==(i=t.publish_details)?void 0:i.filter(e=>e.locale.includes("-"));(0,k.useEffect)(()=>{Y&&m(Y.some(e=>e.locale===P.websiteData.prefix+n))},[Y]);let S=async()=>{if(f)return void console.warn("Publish operation already in progress, ignoring duplicate request");v(!0);try{var e;await p.promise((0,g.HM)(l.uid,[P.websiteData.prefix+n],null==(e=l.image)?void 0:e.uid),s),w()}catch(e){console.error("Error publishing offer:",e)}finally{v(!1)}},C=async()=>{if(f)return void console.warn("Publish operation already in progress, ignoring duplicate request");v(!0);try{var e;await p.promise((0,g.I4)(l.uid,[P.websiteData.prefix+n],null==(e=l.image)?void 0:e.uid),d),w()}catch(e){console.error("Error unpublishing offer:",e)}finally{v(!1)}};return u?(0,r.Y)(j.az,{paddingTop:"space-48",children:(0,r.Y)($.o,{children:(0,r.Y)(V.y,{})})}):(0,r.FD)(eo.T,{alignItems:"stretch",spacing:"space-16",py:"24px",borderBottom:"1px solid",borderColor:"gray.400",children:[(0,r.FD)(D.s,{gap:"space-24",alignItems:"center",children:[(0,r.FD)(q.E,{as:"h3",fontSize:"20px",fontWeight:"bold",children:[a," ",n===(0,L.W)(P.websiteData.defaultLocale)?"(Default)":""]}),(0,r.FD)(q.E,{mr:"16px",children:["Status:"," ",h?(0,r.Y)(q.E,{color:"green.500",as:"span",children:"Published"}):(0,r.Y)(q.E,{as:"span",color:"yellow.500",children:"Draft"})]}),(0,r.Y)(q.E,{as:"span",children:"".concat(ec(l.valid_from)," - ").concat(ec(l.valid_until))}),c&&y&&(0,r.Y)(r.FK,{children:h?(0,r.Y)(O.$,{variant:"primary",onClick:()=>C(),isLoading:f,loadingText:"Unpublishing...",children:"Unpublish"}):(0,r.Y)(O.$,{variant:"secondary",onClick:()=>S(),isLoading:f,loadingText:"Publishing...",children:"Publish"})})]}),(0,r.Y)(M.s,{theme:(0,R.oY)(B.w),resetCSS:!0,children:(0,r.FD)(D.s,{gap:"space-32",alignItems:"flex-start",children:[(0,r.Y)(ed.OfferManagerPreviewOfferTile,{flexShrink:0,flexGrow:0,showLangIndicator:!1,lang:n}),(0,r.Y)(es.OfferManagerPreviewDetailSection,{flex:"1 1 auto",showLangIndicator:!1,lang:n})]})})]},n)}
1,ep=e=>{let{authorName:i,authorEmail:t,values:n,sessionData:a,setRejectionModalOpen:l}=e,o=(0,x.d)(),s=async e=>{let r=(0,g.Wv)({...n,author_name:i,author_email:t,status:E.O.Rejected},a,n.uid,window.location.href,e);o.promise(r,c),r.finally(async()=>{await m.queryClient.refetchQueries({queryKey:["getOffer"]}),l(!1)})},d=_.Ik().shape({rejectionMessage:_.Yj().required("It is required to fill in a reason for rejecting the offer")}),u=(0,F.Wx)({initialValues:{rejectionMessage:""},validationSchema:d,onSubmit:e=>{s(e.rejectionMessage)}});return(0,r.FD)("form",{onSubmit:u.handleSubmit,style:{display:"flex",flexDirection:"column",gap:"24px"},children:[(0,r.FD)(j.az,{as:"label",sx:{display:"flex",flexDirection:"column",gap:"10px"},children:["Describe what needs to be updated in the offer before it can be approved",(0,r.Y)(K.T,{name:"rejectionMessage",onChange:u.handleChange,value:u.values.rejectionMessage}),(0,r.Y)("span",{style:{color:H.T.semantic.error[900]},children:u.errors.rejectionMessage})]}),(0,r.Y)(O.$,{type:"submit",variant:"secondary",children:"Send rejection message to author"})]})},eh=U()(()=>Promise.resolve().then(t.bind(t,79687)).then(e=>e.OfferManagerPreviewOfferTile),{loadableGenerated:{webpack:()=>[79687]},ssr:!1,loading:()=>(0,r.Y)(r.FK,{children:"Loading..."})}),em=()=>{let{currentStep:e,foreignLanguages:i}=(0,el.re)(),{values:t}=(0,F.j7)(),n=!t.brand;return(0,r.Y)(M.s,{theme:(0,R.oY)(B.w),resetCSS:!0,children:n?(0,r.Y)(j.az,{px:"150px",py:"180px",border:"1px dashed",borderColor:"gray.400",borderRadius:"12px",children:(0,r.Y)(q.E,{children:"Select brand to get started."})}):(0,r.FD)(D.s,{m:"space-80",flexWrap:"wrap",justifyContent:"flex-start",columnGap:"space-24",rowGap:"space-80",children:[(0,r.Y)(eh,{lang:(0,L.W)(P.websiteData.defaultLocale)},P.websiteData.defaultLocale),e>0&&i.map(e=>(0,r.Y)(eh,{lang:e},e))]})})};var eg=t(43442),ef=t(45025),ev=t(40700),eb=t(78930),e_=t(64388),ey=t(49063),ew=t(29630),eY=t(19483),ex=t(13790);let eD=e=>{var i;let{category:t,parentCategoryUid:n,parentSubCategoryUid:a,type:l}=e,{values:o,setFieldValue:s,setFieldTouched:d}=(0,F.j7)(),c=!!(null==(i=o.categories)?void 0:i.find(e=>e.uid===t.uid));return(0,r.Y)(eY.S,{isChecked:c,onChange:e=>{if(d("categories",!0,!1),e.currentTarget.checked){let e=[...o.categories,{uid:t.uid,_content_type_uid:l}];("sub_category"===l||"sub_sub_category"===l)&&n&&(e.find(e=>e.uid===n)||e.push({uid:n,_content_type_uid:"category"})),"sub_sub_category"===l&&a&&(e.find(e=>e.uid===a)||e.push({uid:a,_content_type_uid:"sub_category"})),s("categories",e)}else{let e=(e=>{let i=[];return e.children&&e.children.forEach(e=>{var t;i.push(e.uid),null==(t=e.children)||t.forEach(e=>{i.push(e.uid)})}),i})(t);s("categories",o.categories.filter(i=>!(i.uid===t.uid||e.includes(i.uid))))}},children:t.name},t.uid)},eF=()=>{let{categories:e}=(0,el.re)(),{errors:i,touched:t}=(0,F.j7)();return(0,r.Y)(r.FK,{children:(0,r.Y)(j.az,{borderRadius:"5px",overflow:"auto",border:"1px solid",borderColor:"gray.200",style:i.categories&&t.categories?{borderColor:"#E53E3E",boxShadow:"0 0 0 1px #E53E3E"}:void 0,children:(0,r.Y)(j.az,{maxH:"300",overflow:"auto","aria-label":"categories selector",tabIndex:0,children:(0,r.Y)(ex.B,{p:"space-12",spacing:"space-4",children:null==e?void 0:e.map(e=>{var i;return(0,r.FD)(j.az,{children:[(0,r.Y)(eD,{category:e,type:"category"}),!!(null==(i=e.children)?void 0:i.length)&&(0,r.Y)(ex.B,{pl:"space-24",spacing:"space-4",pt:"space-4",children:e.children.map(i=>{var t;return(0,r.FD)(j.az,{children:[(0,r.Y)(eD,{category:i,parentCategoryUid:e.uid,type:"sub_category"}),!!(null==(t=i.children)?void 0:t.length)&&(0,r.Y)(ex.B,{pl:"space-24",spacing:"space-4",pt:"space-4",children:i.children.map(t=>(0,r.Y)(eD,{category:t,parentCategoryUid:e.uid,parentSubCategoryUid:i.uid,type:"sub_sub_category"},t.uid))})]},i.uid)})})]},e.uid)})})})})})};var eS=t(3617),eC=t(60166),eI=t(27431),ek=t(70579),eE=t(86597),ez=t(88409),ej=t(85770);let eO=e=>{let{children:i}=e,{foreignLanguages:t}=(0,el.re)(),{values:n,errors:a}=(0,F.j7)();return(0,r.FD)(eI.t,{mb:"space-32",colorScheme:"primary.navy",children:[(0,r.Y)(ek.w,{children:t.map(e=>{var i;let t=n.translations.findIndex(i=>i.locale===e),l=null==a||null==(i=a.translations)?void 0:i[t],o=Object.keys(null!=l?l:{}).length;return(0,r.Y)(eE.o,{position:"relative",_after:{content:o?'"'.concat(o,'"'):void 0,position:"absolute",width:"12px",height:"12px",borderRadius:"50%",top:.5,right:2,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px",lineHeight:1,backgroundColor:"#E53E3E",color:"primary.white"},children:(0,r.Y)(ej.k,{lang:e})},e)})}),(0,r.Y)(ez.T,{children:null!=i?i:null})]})},eT=e=>{let{value:i,max:t}=e;return(0,r.FD)(q.E,{pointerEvents:"none",position:"absolute",bottom:0,zIndex:2,w:"100%",py:"space-4",px:"space-16",fontSize:"xs",color:i===t?"red.500":i>.8*t?"yellow.500":"GrayText",textAlign:"end",children:[(0,r.Y)(q.E,{as:"span",color:"initial",children:i}),"/",t]})},eW=e=>{var i,t,n;let{lang:a}=e,{errors:l,touched:o,values:s,setFieldValue:d}=(0,F.j7)(),c=s.translations.findIndex(e=>e.locale===a)||0,u=null==l||null==(i=l.translations)?void 0:i[c],p=null==o||null==(t=o.translations)?void 0:t[c],h=null==s||null==(n=s.translations)?void 0:n[c];return(0,r.FD)(eo.T,{spacing:"space-32",children:[(0,r.FD)(ev.MJ,{isInvalid:!!((null==u?void 0:u.overview_title)&&(null==p?void 0:p.overview_title)),children:[(0,r.Y)(eb.l,{htmlFor:"translations.".concat(c,".overview_title"),children:"Card title"}),(0,r.Y)(F.D0,{as:ew.p,placeholder:"Type your text",type:"text",id:"translations.".concat(c,".overview_title"),name:"translations.".concat(c,".overview_title"),onChange:e=>{d("translations.".concat(c,".overview_title"),e.target.value),d("translations.".concat(c,".detail_title"),e.target.value)}}),(0,r.Y)(ey.Wt,{fontSize:"xs",children:null==u?void 0:u.overview_title})]}),(0,r.FD)(ev.MJ,{isInvalid:!!((null==u?void 0:u.image_alt)&&(null==p?void 0:p.image_alt)),children:[(0,r.Y)(eb.l,{htmlFor:"translations.".concat(c,".image_alt"),children:"Image alt-text"}),(0,r.Y)(q.E,{children:"Accessible description of the image for screen readers"}),(0,r.Y)(F.D0,{as:ew.p,placeholder:"Enter image alt-text for accessibility",type:"text",id:"translations.".concat(c,".image_alt"),name:"translations.".concat(c,".image_alt")}),(0,r.Y)(ey.Wt,{fontSize:"xs",children:null==u?void 0:u.image_alt})]}),(0,r.FD)(ev.MJ,{isInvalid:!!((null==u?void 0:u.campaign_tag)&&(null==p?void 0:p.campaign_tag)),children:[(0,r.Y)(eb.l,{htmlFor:"campaign_tag",children:"Campaign label"}),(0,r.Y)(q.E,{children:"Will appear on top of the image (optional)"}),(0,r.Y)(F.D0,{as:ew.p,placeholder:"Type your text",type:"text",id:"translations.".concat(c,".campaign_tag"),name:"translations.".concat(c,".campaign_tag"),maxLength:35}),(0,r.Y)(eT,{value:null==h?void 0:h.campaign_tag.length,max:35}
1),(0,r.Y)(F.Kw,{component:ey.Wt,name:"translations.".concat(c,".campaign_tag")})]}),(0,r.FD)(ev.MJ,{isInvalid:!!((null==u?void 0:u.overview_description)&&(null==p?void 0:p.overview_description)),children:[(0,r.Y)(eb.l,{htmlFor:"overview_description",children:"Description"}),(0,r.Y)(F.D0,{as:K.T,id:"translations.".concat(c,".overview_description"),name:"translations.".concat(c,".overview_description"),placeholder:"Type your text",maxLength:100,rows:3,onChange:e=>{d("translations.".concat(c,".overview_description"),e.target.value),d("translations.".concat(c,".description"),e.target.value)}}),(0,r.Y)(eT,{value:null==h?void 0:h.overview_description.length,max:100}),(0,r.Y)(ey.Wt,{fontSize:"xs",children:null==u?void 0:u.overview_description})]})]})},eL="https://ucv.bynder.com/5.0.5/modules/compactview/bynder-compactview-5-latest.js",eM=e=>{let i=e.match(/\.([^./?#]+)(?:[?#]|$)/);return i?i[1].toLowerCase():null},eR=e=>{var i,t;let{onSelectAsset:n,value:a,portalUrl:l="marketingportal.viaoutlets.com"}=e,[o,s]=(0,k.useState)(!1),[d,c]=(0,k.useState)(null),u=(0,k.useCallback)(async()=>{s(!0),c(null);try{await new Promise((e,i)=>{if(window.BynderCompactView)return void e();if(document.querySelector('script[src="'.concat(eL,'"]'))){let i=()=>{window.BynderCompactView?e():setTimeout(i,100)};i();return}let t=document.createElement("script");t.src=eL,t.async=!0,t.onload=()=>e(),t.onerror=()=>i(Error("Failed to load Bynder script")),document.body.appendChild(t)}),window.BynderCompactView&&window.BynderCompactView.open({language:"en_US",mode:"SingleSelect",assetFieldSelection:"\n id\n name\n url\n originalUrl\n files\n type\n description\n transformBaseUrl\n derivatives {\n thumbnail\n webImage\n }\n ... on Video {\n previewUrls\n }\n",portal:{url:l},onSuccess:e=>{if(e.length>0){let i=(e=>{var i,t,r,n,a,l,o,s,d,c,u,p,h;let m=(null==(i=e.derivatives)?void 0:i.webImage)||(null==(r=e.files)||null==(t=r.webImage)?void 0:t.url)||e.url,g=eM(e.name)||(m?eM(m):null);return{id:e.id,name:e.name,description:e.description||e.name,type:e.type||"IMAGE",extensions:g?[g]:void 0,url:e.url,files:{webImage:{url:m,width:(null==(a=e.files)||null==(n=a.webImage)?void 0:n.width)||null,height:(null==(o=e.files)||null==(l=o.webImage)?void 0:l.height)||null,fileSize:(null==(d=e.files)||null==(s=d.webImage)?void 0:s.fileSize)||null}},additionalInfo:{selectedFile:{url:e.transformBaseUrl,width:(null==(u=e.files)||null==(c=u.webImage)?void 0:c.width)||null,height:(null==(h=e.files)||null==(p=h.webImage)?void 0:p.height)||null}}}})(e[0]);null==n||n(i)}}})}catch(e){c("Failed to load Bynder. Please try again."),console.error("Bynder load error:",e)}finally{s(!1)}},[n,l]),p=(0,k.useCallback)(()=>{null==n||n(null)},[n]),h=(null==a||null==(t=a.files)||null==(i=t.webImage)?void 0:i.url)||(null==a?void 0:a.url);return(0,r.FD)("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[h&&(0,r.FD)("div",{style:{position:"relative",width:"200px"},children:[(0,r.Y)("img",{src:h,alt:(null==a?void 0:a.description)||(null==a?void 0:a.name)||"Selected image",style:{width:"200px",height:"150px",objectFit:"cover",borderRadius:"4px",border:"1px solid #e2e8f0"}}),(0,r.Y)("button",{type:"button",onClick:p,style:{position:"absolute",top:"4px",right:"4px",background:"rgba(0,0,0,0.6)",color:"white",border:"none",borderRadius:"50%",width:"24px",height:"24px",cursor:"pointer",fontSize:"14px"},children:"\xd7"})]}),(0,r.Y)("div",{style:{display:"flex",gap:"8px"},children:(0,r.Y)("button",{type:"button",onClick:u,disabled:o,style:{padding:"8px 16px",borderRadius:"4px",border:"1px solid #e2e8f0",background:"#f7fafc",cursor:o?"not-allowed":"pointer"},children:o?"Loading...":a?"Change Image":"Select Image from Bynder"})}),d&&(0,r.Y)("span",{style:{color:"red",fontSize:"12px"},children:d})]})};var eq=t(91280),eP=t(99654);let eB=(0,et.R)((e,i)=>{let t=void 0!==e.preserveColors&&e.preserveColors,n={...e};return t&&delete n.color,(0,r.Y)(er.I,{width:18,height:18,fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",ref:i,...n,children:(0,r.Y)("g",{stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.Y)("path",{d:"M1.5 9h15M9 1.5v15"})})})});var eA=t(81631);let eU=e=>{var i,t,n;let{lang:a}=e,{errors:l,touched:o,values:s,setFieldValue:d}=(0,F.j7)(),c=s.translations.findIndex(e=>e.locale===a)||0,u=null==l||null==(i=l.translations)?void 0:i[c],p=null==o||null==(t=o.translations)?void 0:t[c],h=null==s||null==(n=s.translations)?void 0:n[c];return(0,r.FD)(eo.T,{mb:"space-64",spacing:"space-32",alignItems:"stretch",children:[(0,r.FD)(ev.MJ,{isInvalid:!!((null==u?void 0:u.detail_title)&&(null==p?void 0:p.detail_title)),children:[(0,r.Y)(eb.l,{htmlFor:"translations.".concat(c,".detail_title"),children:"Headline"}),(0,r.Y)(q.E,{children:"Must be the same as on the list card"}),(0,r.Y)(F.D0,{as:ew.p,placeholder:"Type your text",id:"translations.".concat(c,".detail_title"),name:"translations.".concat(c,".detail_title"),type:"text",maxLength:35,value:(null==h?void 0:h.detail_title)?null==h?void 0:h.detail_title:null==h?void 0:h.overview_title,onChange:e=>{d("translations.".concat(c,".detail_title"),e.target.value)}}),(0,r.Y)(ey.Wt,{fontSize:"xs",children:null==u?void 0:u.detail_title})]}),(0,r.FD)(ev.MJ,{isInvalid:!!((null==u?void 0:u.description)&&(null==p?void 0:p.description)),children:[(0,r.Y)(eb.l,{htmlFor:"translations.".concat(c,".description"),children:"Body copy"}),(0,r.Y)(F.D0,{as:K.T,id:"translations.".concat(c,".description"),name:"translations.".concat(c,".description"),placeholder:"Type your text",maxLength:250,rows:5}),(0,r.Y)(eT,{value:null==h?void 0:h.description.length,max:250}),(0,r.Y)(ey.Wt,{fontSize:"xs",children:null==u?void 0:u.description})]}),!1,(0,r.FD)(ev.MJ,{isInvalid:!!((null==u?void 0:u.terms_conditions)&&(null==p?void 0:p.terms_conditions)),children:[(0,r.Y)(eb.l,{htmlFor:"translations.".concat(c,".terms_conditions"),children:"Terms & conditions"}),(0,r.Y)(F.ED,{name:"translations.".concat(c,".terms_conditions"),render:e=>{let{push:i,remove:t}=e;return(0,r.FD)(r.FK,{children:[(0,r.Y)(eo.T,{spacing:"space-8",alignItems:"stretch",children:!!h.terms_conditions.length&&h.terms_conditions.map((e,i)=>(0,r.FD)(j.az,{pos:"relative",children:[(0,r.FD)(D.s,{children:[(0,r.FD)(eb.l,{flexGrow:0,flexShrink:0,htmlFor:"translations.".concat(c,".terms_conditions.").concat(i),children:[i+1,"."]}),(0,r.Y)(F.D0,{as:K.T,id:"translations.".concat(c,".terms_conditions.").concat(i),name:"translations.".concat(c,".terms_conditions.").concat(i),placeholder:"Type your text",maxLength:250,autogrow:"true",rows:2})]}),(0,r.Y)(eT,{value:null==h?void 0:h.terms_conditions[i].length,max:250}),(0,r.Y)(ey.Wt,{fontSize:"xs",children:null==u?void 0:u.terms_conditions}),(0,r.Y)(eq.K,{size:"icon",pos:"absolute",right:"-35px",top:"50%",bg:"none","aria-label":"Remove terms and condition box",icon:(0,r.Y)(eP.A,{w:"19px"}),variant:"iconSecondary",onClick:()=>t(i),_hover:{transform:"scale(1.2)"}})]},i))}),h.terms_conditions&&h.terms_conditions.length<5&&(0,r.FD)(O.$,{type:"button",justifyContent:"flex-start",variant:"iconSecondary",textTransform:"initial",fontSize:(0,eA.D0)(16),onClick:()=>i(""),p:"0",mt:"space-24",gap:"space-8",children:[(0,r.Y)(eB,{bg:"#00D64F",color:"white",borderRadius:"full",w:"32px",h:"32px",p:"space-4"}),h.terms_conditions.length>0?"Add an extra bullet":"Add terms and conditions"]})]})}})]})]})},eG=[{title:"Basic Setup",component:(0,r.Y)(()=>{var e;let{brands:i,uid:t}=(0,el.re)(),{errors:n,touched:a,values:l,setFieldValue:o}=(0,F.j7)();return(0,r.FD)(eo.T,{spacing:"space-32",alignItems:"stretch",children:[(0,r.Y)(ef.D,{size:"h4",fontSize:"xl",children:"Setup Offer"}),(0,r.FD)(ev.MJ,{isInvalid:!!(n.brand&&a.brand),children:[(0,r.Y)(eb.l,{htmlFor:"brand",children:"Brand"}),(0,r.Y)(F.D0,{as:e_.l,value:null==(e=l.brand)?void 0:e.uid,id:"brand",name:"brand",placeholder:"Select brand",onChange:e=>{let t=i.find(i=>i.uid===e.target.value);o("brand",{uid:(null==t?void 0:t.uid)||"",name:(null==t?void 0:t.name)||"",_content_type_uid:"brand"})},disabled:!!t,children:i.map(e=>(0,r.Y)("option",{value:e.uid,children:e.name},e.uid))}),(0,r.Y)(ey.Wt,{children:n.brand})]}),(0,r.FD)(ev.MJ,{isInvalid:!!(n.offer_type&&a.offer_type&&""===l.offer_type),children:[(0,r.Y)(eb.l,{htmlFor:"offer_type",children:"Offer type"}),(0,r.Y)(F.D0,{as:e_.l,id:"offer_type",name:"offer_type",placeholder:"Select type",onChange:e=>{o("offer_type",e.target.value),"discount_product"!==e.target.value&&(o("from_price",""),o("to_price",""))},children:eg._.map(e=>(0,r.Y)("option",{value:e.id,children:e.name},e.id))}),(0,r.Y)(ey.Wt,{children:n.offer_type})]}),(0,r.FD)(ev.MJ,{isInvalid:!!(n.publication_date&&a.publication_date),children:[(0,r.Y)(eb.l,{htmlFor:"publication_date",children:"Publication date"}),(0,r.Y)(F.D0,{as:ew.p,placeholder:"Choose publication date",id:"publication_date",name:"publication_date",type:"datetime-local"}),(0,r.Y)(q.E,{mt:"space-4",children:"Choose from what day to publish the offers."}),(0,r.Y)(ey.Wt,{children:n.publication_date})]}),(0,r.FD)(D.s,{gap:"space-16",children:[(0,r.FD)(ev.MJ,{isInvalid:!!(n.valid_from&&a.valid_from),children:[(0,r.Y)(eb.l,{htmlFor:"valid_from",children:"Start date"}),(0,r.Y)(F.D0,{as:ew.p,placeholder:"Choose start date",id:"valid_from",name:"valid_from",type:"date"}),(0,r.Y)(ey.Wt,{children:n.valid_from})]}),(0,r.FD)(ev.MJ,{isInvalid:!!(n.valid_until&&a.valid_until),children:[(0,r.Y)(eb.l,{htmlFor:"valid_until",children:"End date"}),(0,r.Y)(F.D0,{as:ew.p,placeholder:"Choose end date",id:"valid_until",name:"valid_until",type:"date",min:l.valid_from}),(0,r.Y)(ey.Wt,{children:n.valid_until})]})]}),(0,r.FD)(ev.MJ,{isInvalid:!!(n.categories&&a.categories),children:[(0,r.Y)(eb.l,{children:"Categories"}),(0,r.Y)(eF,{}),(0,r.Y)(ey.Wt,{children:n.categories})]}),(0,r.Y)(F.D0,{as:eY.S,id:"is_members_discount",name:"is_members_discount",isChecked:l.is_members_discount,children:"Fashion club membership required"})]})},{},"basic"),previewComponent:(0,r.Y)(em,{},"basic-preview")},{title:"List Card",component:(0,r.Y)(()=>{var e;let{foreignLanguages:i}=(0,el.re)(),[t,n]=(0,k.useState)(!1),{errors:a,touched:l,values:o,setFieldValue:s}=(0,F.j7)(),d=async()=>{n(!0);let e=o.translations.findIndex(e=>e.locale===(0,L.W)(P.websiteData.defaultLocale)),{overview_title:i,campaign_tag:t,overview_description:r,image_alt:a}=o.translations[e];
1Object.entries(await (0,g.Rg)([i,t,r,a])).forEach(e=>{let[i,t]=e,r=o.translations.findIndex(e=>e.locale===i),[n,a,l,d]=t;s("translations.".concat(r,".overview_title"),n),s("translations.".concat(r,".campaign_tag"),a),s("translations.".concat(r,".overview_description"),l),s("translations.".concat(r,".image_alt"),d)}),n(!1)},c=(e,i)=>{let t=e.target.value;""===t?s(i,""):s(i,t.toString())};return(0,r.FD)(eo.T,{mb:"space-64",spacing:"space-32",alignItems:"stretch",children:[(0,r.Y)(ef.D,{mb:"space-24",fontSize:"xl",children:"Creatives"}),(0,r.FD)(ev.MJ,{isInvalid:!!(a.image&&l.image),children:[(0,r.Y)(eb.l,{htmlFor:"image",children:"Image"}),(0,r.Y)(eR,{value:(null==(e=o.bynder_image)?void 0:e[0])||null,onSelectAsset:e=>{e?s("bynder_image",[e]):s("bynder_image",null)}}),a.image&&l.image&&(0,r.Y)(ey.Wt,{fontSize:"xs",children:"Error uploading image"})]}),(0,r.Y)(ef.D,{mb:"space-24",fontSize:"xl",children:"Description"}),(0,r.Y)(eW,{lang:(0,L.W)(P.websiteData.defaultLocale)}),"discount_product"===o.offer_type&&(0,r.FD)(r.FK,{children:[(0,r.FD)(ev.MJ,{isInvalid:!!(a.from_price&&l.from_price),children:[(0,r.Y)(eb.l,{htmlFor:"from_price",children:"From price"}),(0,r.Y)(F.D0,{as:ew.p,placeholder:"Fill in a number",type:"number",id:"from_price",name:"from_price",onChange:e=>c(e,"from_price")}),(0,r.Y)(ey.Wt,{fontSize:"xs",children:a.from_price})]}),(0,r.FD)(ev.MJ,{isInvalid:!!(a.to_price&&l.to_price),children:[(0,r.Y)(eb.l,{htmlFor:"to_price",children:"For price"}),(0,r.Y)(F.D0,{as:ew.p,placeholder:"Fill in a number",type:"number",id:"to_price",name:"to_price",onChange:e=>c(e,"to_price")}),(0,r.Y)(ey.Wt,{fontSize:"xs",children:a.to_price})]})]}),(0,r.FD)(D.s,{justifyContent:"space-between",flexWrap:"wrap",alignItems:"center",mb:"space-32",children:[(0,r.Y)(ef.D,{mr:"space-10",mt:"space-10",fontSize:"xl",children:"Translations"}),(0,r.Y)(O.$,{variant:"secondary",ml:"auto",mt:"space-10",bg:"white.900",py:3,rightIcon:(0,r.Y)(eC.sIu,{}),onClick:d,isLoading:t,children:"Auto translate"})]}),(0,r.Y)(F.ED,{name:"translations",children:()=>(0,r.Y)(eO,{children:i.map(e=>(0,r.Y)(eS.K,{px:"0",children:(0,r.Y)(eW,{lang:e},e)},e))})})]})},{},"card"),previewComponent:(0,r.Y)(em,{},"basic-preview")},{title:"Details Page",component:(0,r.Y)(()=>{let{foreignLanguages:e}=(0,el.re)(),[i,t]=(0,k.useState)(!1),{values:n,setFieldValue:a}=(0,F.j7)(),l=async()=>{t(!0);let e=n.translations.findIndex(e=>e.locale===(0,L.W)(P.websiteData.defaultLocale)),{detail_title:i,description:r,terms_conditions:l}=n.translations[e];Object.entries(await (0,g.Rg)([i,r,...l])).forEach(e=>{let[i,t]=e,r=n.translations.findIndex(e=>e.locale===i),[l,o,...s]=t;a("translations.".concat(r,".detail_title"),l,!0),a("translations.".concat(r,".description"),o,!0),a("translations.".concat(r,".terms_conditions"),s,!0)}),t(!1)};return(0,r.FD)(j.az,{children:[(0,r.Y)(ef.D,{mb:"space-24",fontSize:"xl",children:"Description"}),(0,r.Y)(eU,{lang:(0,L.W)(P.websiteData.defaultLocale)}),(0,r.FD)(j.az,{children:[(0,r.FD)(D.s,{justifyContent:"space-between",flexWrap:"wrap",alignItems:"center",mb:"space-32",children:[(0,r.Y)(ef.D,{mr:"space-10",mt:"space-10",fontSize:"xl",children:"Translations"}),(0,r.Y)(O.$,{variant:"secondary",ml:"auto",mt:"space-10",bg:"white.900",py:3,rightIcon:(0,r.Y)(eC.sIu,{}),onClick:l,isLoading:i,children:"Auto translate"})]}),(0,r.Y)(F.ED,{name:"translations",render:()=>(0,r.Y)(eO,{children:e.map(e=>(0,r.Y)(eS.K,{px:"0",children:(0,r.Y)(eU,{lang:e},e)},e))})})]})]})},{},"detailpage"),previewComponent:(0,r.Y)(()=>{let{values:e}=(0,F.j7)(),i=!e.brand;return(0,r.Y)(M.s,{theme:(0,R.oY)(B.w),resetCSS:!0,children:i?(0,r.Y)(j.az,{px:"150px",py:"180px",border:"1px dashed",borderColor:"gray.400",borderRadius:"12px",children:(0,r.Y)(q.E,{children:"Select brand to get started."})}):(0,r.Y)(D.s,{width:"100%",flexWrap:"wrap",justifyContent:"flex-start",columnGap:"space-24",rowGap:"space-24",transform:"scale(0.5",children:P.websiteData.locales.map(e=>{let i=(0,L.W)(e);return(0,r.Y)(G,{lang:i},i)})})})},{},"detail-preview")},{title:"Finish",previewComponent:(0,r.Y)(()=>{var e,i;let[t,n]=(0,k.useState)(!1),{data:a}=(0,v.useSession)(),l=P.websiteData.locales.map(e=>{let i=(0,L.W)(e);return P.websiteData.prefix+i}),{values:o}=(0,F.j7)(),{publishDetailsQuery:s}=(0,el.re)(),d=(0,x.d)(),{isApprover:c,isUserGroupsLoading:h}=b(),{data:m}=J(o.uid,"en");m&&(m.status,E.O.Approved),m&&(m.status,E.O.Rejected);let f=()=>{setTimeout(()=>{s.refetch()},N.J)},_=async()=>{var e;d.promise((0,g.HM)(o.uid,l,null==(e=o.image)?void 0:e.uid),u),f()},y=async()=>{d.promise((0,g.I4)(o.uid,l),p),f()};return((0,k.useEffect)(()=>{s.refetch()},[]),h)?(0,r.Y)(j.az,{paddingTop:"space-48",children:(0,r.Y)($.o,{children:(0,r.Y)(V.y,{})})}):(0,r.FD)(j.az,{px:"44px",width:"100%",children:[(0,r.Y)(ea,{isOpen:t,onClose:()=>n(!1),children:(0,r.Y)(ep,{authorName:null!=(e=null==m?void 0:m.author_name)?e:"",authorEmail:null!=(i=null==m?void 0:m.author_email)?i:"",values:o,sessionData:a,setRejectionModalOpen:n})}),(0,r.FD)(r.FK,{children:[(0,r.FD)(D.s,{justifyContent:"space-between",children:[(0,r.Y)(q.E,{as:"h2",fontSize:"28px",children:"Review & publish"}),(0,r.FD)(D.s,{gap:"space-24",children:[(0,r.Y)(O.$,{onClick:y,children:"Unpublish all"}),(0,r.Y)(O.$,{variant:"secondary",onClick:_,children:"Publish all"})]})]}),P.websiteData.locales.map(e=>{let i=(0,L.W)(e);return(0,r.Y)(eu,{lang:i},i)})]})]})},{},"publish")}],eN=e=>{let{steps:i,handleStepClick:t,...n}=e,{currentStep:a}=(0,el.re)();return(0,r.Y)(D.s,{flexWrap:"wrap",gap:"space-24",...n,children:i.map((e,i)=>{let{title:n}=e,l=i===a;return(0,r.FD)(D.s,{align:"center",gap:"space-8",flexShrink:0,onClick:()=>t(i),children:[(0,r.Y)(O.$,{boxSize:(0,eA.D0)(40),variant:"primary",isActive:l,minW:"unset",fontWeight:"bold",fontSize:"lg",children:i+1}),l&&(0,r.Y)(q.E,{color:"black",fontSize:"sm",fontWeight:"normal",children:n})]},n+i)})})},eJ=e=>{let{width:i="50%"}=e,{currentStep:t,goToStep:n}=(0,el.re)(),{validateForm:a,handleSubmit:l}=(0,F.j7)(),o=(0,x.d)(),s=eG.length-1===t,d=async e=>{if(0!==Object.keys(await a()).length)return void o(h);l(),n(e),window.scrollTo(0,0)};return(0,r.FD)(j.az,{flexGrow:0,flexShrink:0,flexBasis:i,backgroundColor:"#fff",px:s?0:"space-64",children:[(0,r.Y)(eN,{my:"space-32",steps:eG.map(e=>({title:e.title})),position:"absolute",left:"space-64",zIndex:1,handleStepClick:d}),eG[t].component&&(0,r.Y)(j.az,{pt:"space-96",children:eG[t].component}),!s&&(0,r.FD)(D.s,{py:"space-24",justifyContent:"space-between",children:[t>0?(0,r.Y)(O.$,{onClick:()=>d(t-1),variant:"tertiary",fontWeight:"medium",children:"Back"}):(0,r.Y)(O.$,{as:W(),href:z.Tk["offer-manager"],variant:"tertiary",fontWeight:"medium",children:"Cancel"}),(0,r.Y)(O.$,{onClick:()=>d(t+1),isDisabled:t===eG.length-1,variant:"secondary",bg:"white.900",fontWeight:"medium",px:"space-32",children:"Next"})]})]})};var eK=t(86129);
1let e$="true"===t(29143).env.NEXT_PUBLIC_ENABLE_LOCALE_DEBUGGER,eV=e=>{var i;let{editorWidth:t}=e,n=(0,x.d)(),{values:a,...l}=(0,F.j7)(),{isLastStep:s,currentStep:d}=(0,el.re)(),[c,u]=(0,k.useState)(!1),p=a.image;return(0,r.FD)(D.s,{alignItems:"flex-start",justify:"center",flexGrow:1,flexShrink:1,flexBasis:"auto",maxWidth:"calc(100% - ".concat(t,")"),p:"space-20",overflow:"hidden",mt:s?"120px":0,children:[c&&(0,r.FD)("pre",{style:{width:"100%"},children:["Preview:",p&&(0,r.Y)(eK._,{maxWidth:"100%",src:null==(i=a.image)?void 0:i.url}),"---",(0,r.Y)("br",{})]}),!c&&eG[d].previewComponent&&eG[d].previewComponent,e$&&(0,r.FD)(D.s,{p:"10px",position:"fixed",bottom:0,right:0,zIndex:99,gap:"space-10",children:[(0,r.Y)(O.$,{p:"space-8",variant:"unstyled",backgroundColor:"blue",color:"white",onClick:()=>u(e=>!e),children:c?"close debugger":"open debugger"}),(0,r.Y)(O.$,{p:"space-8",variant:"unstyled",backgroundColor:"white",color:"blue",border:"1px solid blue",onClick:()=>void n.promise((0,g.IS)(a,l),o),children:"Force save"})]})]})},eH=e=>{let{data:i}=e,{data:t}=(0,v.useSession)(),n=(0,x.d)(),{currentStep:a}=(0,el.re)(),l=(0,S.useRouter)(),[s,d]=(0,k.useState)(()=>I()(i)),[c,u]=(0,k.useState)(!1),p=3===a?"0":"576px",{isApprover:h}=b(),f=async(e,i)=>{if(0===a||3===a)return;if(c)return void console.warn("Form submission already in progress, ignoring duplicate submission");let r=I()(e);if(r!==s){u(!0);let a=(0,g.IS)({...e,status:h&&e.author_email===(null==t?void 0:t.user.email)?E.O.Approved:E.O.RequestApproval},i).then(e=>{if(e){if(e.error)return alert("Error: Something went wrong with saving. details: ".concat(JSON.stringify(e.error)));if(!l.query.params&&"string"==typeof e.uid&&e.uid){i.setFieldValue("uid",e.uid);let t=new URL(window.location.href).searchParams.get("step");e.uid&&l.replace({query:{step:t,params:[e.uid]}},void 0,{shallow:!0})}d(r)}}).catch(e=>{console.error("Error saving offer:",e),n({title:"Error saving offer",description:"Please try again",status:"error",duration:5e3,isClosable:!0})}).finally(()=>{u(!1)});n.promise(a,o),a.finally(async()=>{await m.queryClient.refetchQueries({queryKey:["getOffer"]})})}};return(0,r.Y)(F.l1,{initialValues:i,validateOnBlur:!1,validateOnChange:!0,validationSchema:Y[a],onSubmit:f,children:(0,r.Y)(F.lV,{style:{height:"100%"},children:(0,r.FD)(D.s,{width:"100%",height:"100%",background:"#F5F5F7",children:[(0,r.Y)(eJ,{width:p}),(0,r.Y)(eV,{editorWidth:p})]})})})},eX=e=>{var i,t,r,n,a;return{uid:"",title:"",offer_type:"",status:"",author_name:null!=(n=null!=(r=null==e||null==(i=e.user)?void 0:i.firstName)?r:null==e||null==(t=e.user)?void 0:t.name)?n:"Unknown",author_email:null!=(a=null==e?void 0:e.user.email)?a:"",brand:void 0,publication_date:"",valid_from:"",valid_until:"",image:void 0,bynder_image:null,is_members_discount:!1,from_price:"",to_price:"",categories:[],translations:P.websiteData.locales.map(e=>({locale:(0,L.W)(e),slug:"",url:"",overview_description:"",overview_title:"",campaign_tag:"",detail_title:"",description:"",external_url:"",terms_conditions:[],image_alt:""}))}};var eQ=!0;let eZ=e=>{let{brands:i,categories:t,offerData:n}=e,a=null==n?void 0:n.find(e=>"en"===e.locale),{data:l}=(0,v.useSession)(),o=n?((e,i,t)=>{var r,n,a,l,o,s;let d=(null==(r=e.find(e=>"en"===e.locale))?void 0:r.data)||(null==e||null==(n=e[0])?void 0:n.data);if(!d)return eX(t);let c=i.find(e=>{var i,t;return e.uid===(null==(t=d.brand)||null==(i=t[0])?void 0:i.uid)});return{uid:d.uid,title:d.title,status:d.status,author_email:d.author_email,author_name:d.author_name,offer_type:d.offer_type,publication_date:d.publication_date,valid_from:d.valid_from,valid_until:d.valid_until,is_members_discount:d.is_members_discount,from_price:d.from_price,to_price:d.to_price,categories:d.categories,brand:{uid:null==(l=d.brand)||null==(a=l[0])?void 0:a.uid,name:(null==c?void 0:c.name)||"",_content_type_uid:"brand"},image:{uid:null==(o=d.image)?void 0:o.uid,url:null==(s=d.image)?void 0:s.url},bynder_image:d.bynder_image||null,translations:P.websiteData.locales.map(i=>{var t;let r=(0,L.W)(i),n=null==(t=e.find(e=>e.locale===P.websiteData.prefix+r))?void 0:t.data;return{locale:r,slug:(null==n?void 0:n.slug)||"",url:(null==n?void 0:n.url)||"",overview_description:(null==n?void 0:n.overview_description)||"",overview_title:(null==n?void 0:n.overview_title)||"",campaign_tag:(null==n?void 0:n.campaign_tag)||"",detail_title:(null==n?void 0:n.detail_title)||"",description:(null==n?void 0:n.description)||"",terms_conditions:(null==n?void 0:n.terms_conditions)||[],external_url:(null==n?void 0:n.external_url)||"",image_alt:(null==n?void 0:n.image_alt)||""}})}})(n,i||[],l):eX(l);return(0,r.Y)(el.p0,{stepsAmount:eG.length,mainLanguageEntry:null==a?void 0:a.data,brands:i||[],categories:t||[],children:(0,r.Y)(eH,{data:o})})}},74015:(e,i,t)=>{"use strict";t.d(i,{d:()=>s});var r=t(2860),n=t(70191),a=t(45272),l=t(25702),o=t(36104);let s=e=>{let{fromPrice:i,toPrice:t,pageType:s=""}=e,{t:d}=(0,l.Bd)(),c=e=>"number"==typeof e?e:Number(e.replace(/[^0-9.,]/g,"").replace(",",".")),u=e=>{let i=new Intl.NumberFormat("en-US",{style:"currency",currency:a.websiteData.currency,currencyDisplay:"narrowSymbol",minimumFractionDigits:2*(e%1!=0),maximumFractionDigits:2*(e%1!=0)}).format(e);
1return e%1!=0?i.replace(".",","):i.replace(/,/g,".")+",-"},p=c(i),h=c(t),m=(0,o.Y)(s)?"primary.rich-black":"black.600";return(0,r.FD)(r.FK,{children:[(0,r.Y)(n.E,{as:"span",textTransform:"capitalize",color:m,children:d("offers.discount.from")}),(0,r.FD)(n.E,{as:"span",color:"black",children:[" ",u(p)," "]}),(0,r.Y)(n.E,{as:"span",textTransform:"capitalize",color:m,children:d("offers.discount.for")}),(0,r.FD)(n.E,{as:"span",color:"secondary.powersuite",fontWeight:"medium",children:[" ",u(h)," "]})]})}},79687:(e,i,t)=>{"use strict";t.r(i),t.d(i,{OfferManagerPreviewOfferTile:()=>c});var r=t(2860),n=t(79353),a=t(88851),l=t(52729),o=t(59030),s=t(85770),d=t(65221);let c=e=>{var i,t;let{lang:c,showLangIndicator:u=!0,...p}=e,{brands:h}=(0,d.re)(),{values:m}=(0,o.j7)(),g=m.translations.find(e=>e.locale===c),f=h.find(e=>{var i;return e.uid===(null==(i=m.brand)?void 0:i.uid)}),v=m.bynder_image||(null==f?void 0:f.logo),b=!m.bynder_image&&!!(null==f?void 0:f.logo),_=(null==g?void 0:g.image_alt)||"No image alt set";return(0,r.FD)(n.az,{width:"348px",...p,children:[u&&(0,r.Y)(s.k,{withText:!0,lang:c}),(0,r.Y)(a.p,{title:(null==g?void 0:g.overview_title)||"Your title goes here",brand:(null==f?void 0:f.name)||"Your brand goes here",isMembersDiscount:m.is_members_discount,campaignTag:null==g?void 0:g.campaign_tag,description:(null==g?void 0:g.overview_description)||"Your description goes here",toPrice:null==m||null==(i=m.to_price)?void 0:i.toString(),fromPrice:null==m||null==(t=m.from_price)?void 0:t.toString(),image:{...(0,l.n)(v),alt:_,...b&&{objectFit:"contain"}}})]})}},85770:(e,i,t)=>{"use strict";t.d(i,{k:()=>l});var r=t(2860),n=t(76382),a=t(70191);let l=e=>{let{lang:i,withText:t=!1,...l}=e;return(0,r.FD)(n.s,{mb:"space-8",alignItems:"center",gap:"space-12",...l,children:[(0,r.Y)("svg",{viewBox:"0 0 640 480",width:"18",height:"12",children:(0,r.Y)("use",{xlinkHref:"/images/flags.svg#".concat(i),href:"/images/flags.svg#".concat(i)})}),t&&(0,r.Y)(a.E,{as:"span",children:i})]})}},88851:(e,i,t)=>{"use strict";t.d(i,{p:()=>D});var r=t(2860),n=t(85012),a=t(88291),l=t(7341),o=t(76382),s=t(48386),d=t(79353),c=t(19855),u=t(72138),p=t(45025),h=t(70191),m=t(9260),g=t(25702),f=t(55729),v=t(40374),b=t(36104),_=t(13809),y=t(855),w=t(56843),Y=t(4097),x=t(74015);let D=e=>{var i;let{url:t,title:D,campaignTag:F,fromPrice:S,toPrice:C,isMembersDiscount:I,description:k,brand:E,image:z,gtmData:j,isShowPlaceholder:O,initialDelay:T=0,index:W=0,inSection:L=!1,startDate:M,endDate:R,offerType:q,conditions_description:P,pageType:B="",externalUrl:A,image_alt:U,...G}=e,{ref:N,isInView:J}=(0,v.p7)(),{t:K}=(0,g.Bd)(),$=(0,_.t)(),V=!!R&&new Date(R)<new Date,H=null!=(i=(0,n.A)({base:1,md:L?3:2,lg:3}))?i:1,X=J?"visible":"hidden",Q=(0,v.H)(H,W,X,T),Z=(0,v.vr)({animate:X,duration:.25,delay:(0,v.Lc)(H,W)+.25+T}),ee=(0,v.Re)({animate:"visible",duration:.5,delay:(0,v.Lc)(H,W)+T}),ei=(0,v.rc)({animate:X,duration:.25,delay:(0,v.Lc)(H,W)+.5+T}),et=(0,v.BB)({animate:X,duration:.25,delay:(0,v.Lc)(H,W)+.5+T});(0,f.useEffect)(()=>{(null==j?void 0:j.offerGtmObject)&&J&&(0,m.d)({event:"view_offer_list",offers:[null==j?void 0:j.offerGtmObject]})},[J]);let er=(0,b.Y)(B),en=er?"primary.rich-black":"text";return(0,r.FD)(w.pE,{as:a.Q,borderRadius:"xs",pt:"space-24",pb:"space-32",h:"100%",shadow:"none","data-group":"data-hover",...G,...Q,onClick:()=>(null==j?void 0:j.offerGtmObject)&&(0,m.d)({event:"select_offer",offers:[j.offerGtmObject]}),children:[(0,r.Y)(l.a,{py:0,px:{base:"space-12",md:"space-16"},color:en,children:(0,r.Y)(o.s,{justifyContent:"space-between",children:E&&(0,r.Y)(w.Om,{color:er?"primary.rich-black":"primary.navy",textTransform:"uppercase",fontWeight:"medium",fontSize:"sm",...Z,children:E})})}),(0,r.FD)(s.b,{ref:N,px:{base:"space-12",md:"space-16"},py:"space-16",children:[(0,r.FD)(d.az,{position:"relative",overflow:"hidden",borderRadius:"xs",children:[z&&(0,r.Y)(c.g,{ratio:1,_groupHover:{transform:"scale(1.05)"},transition:"transform 0.3s cubic-bezier(0.4, 0, 0.2, 1)",children:(0,r.Y)(y._,{...z,widths:{base:400,md:800,lg:800,xl:800,"2xl":800},alt:U||"".concat(F?"".concat(F," - "):"").concat(D," - ").concat(E),objectFit:z.objectFit||"cover",...ee})}),(0,r.FD)(w.MF,{position:"absolute",bottom:"space-16",flexDirection:"column",gap:"space-8",alignItems:"flex-start",...et,children:[F&&(0,r.Y)(u.vw,{variant:"campaign",size:"sm",borderRightRadius:"xxs",borderLeftRadius:"0",mx:0,color:en,children:F}),I&&(0,r.Y)(u.vw,{color:en,variant:"white",size:"sm",borderRightRadius:"xxs",borderLeftRadius:"0",mx:0,children:K("label.fashionClubExclusive")})]})]}),(0,r.FD)(w.$X,{mt:"space-16",spacing:"2",...ei,children:[(0,r.Y)(p.D,{size:"md",textTransform:"uppercase",fontWeight:"normal",color:en,children:D||O&&(0,r.FD)(r.FK,{children:[(0,r.Y)(d.az,{h:4,w:"70%",bg:"black.200",mb:1}),(0,r.Y)(d.az,{h:4,w:"85%",bg:"black.200"})]})}),(0,r.FD)(d.az,{fontSize:"sm",children:[(0,r.Y)(h.E,{color:er?"primary.rich-black":"black.600",fontSize:"sm",children:k||O&&(0,r.FD)(r.FK,{children:[(0,r.Y)(d.az,{as:"span",display:"block",h:3,w:"95%",bg:"black.200",mt:2,mb:1}),(0,r.Y)(d.az,{as:"span",display:"block",h:3,w:"20%",bg:"black.200"})]})}),S&&C&&(0,r.Y)(x.d,{fromPrice:S,toPrice:C,pageType:B})]})]}),P&&(0,r.Y)(w.e_,{...ei,children:(0,r.Y)(Y.sD,{json:P,customAttributes:{a:{fontSize:"sm",textDecoration:"underline",color:"black"},span:{color:"black"},p:{color:"black"}},rootProps:{opacity:.5,fontSize:"sm",color:"black"}})})]}),t&&(0,r.Y)(a.r,{as:g.rw,"aria-label":$(D||E,t),href:t,display:"flex",alignItems:"center",fontWeight:"medium",fontSize:"sm",textStyle:"textS",rel:V?"
1nofollow":void 0})]})}}},e=>{e.O(0,[3868,77,9223,617,3288,636,6593,8792],()=>e(e.s=36337)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.