1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1161],{1578:(e,t,a)=>{"use strict";a.d(t,{s:()=>r.A});var r=a(97739)},3070:(e,t,a)=>{"use strict";function r(e){return(t,a)=>fetch(t,{...a,next:e})}a.d(t,{$:()=>r})},10639:(e,t,a)=>{"use strict";a.d(t,{default:()=>c});var r=a(67368),s=a(26880),i=a(25720),n=a(66253),l=a(26345),o=a(93057);function c(e){let t,a,c,d,u,m,h,f,p=(0,s.c)(18),{content:g,settings:b}=e,x=(0,i.useRouter)();p[0]!==b.storesParentPage.url?(t=(0,l.$i)(b.storesParentPage.url),p[0]=b.storesParentPage.url,p[1]=t):t=p[1];let y=t;p[2]===Symbol.for("react.memo_cache_sentinel")?(a=new URLSearchParams,p[2]=a):a=p[2];let _=a;p[3]!==y||p[4]!==x?(c=function(e,t){_.set("y",String(e)),_.set("x",String(t)),x.push(`${y}${_?`?${String(_)}`:""}`)},p[3]=y,p[4]=x,p[5]=c):c=p[5];let j=c,w=g.headline||"";p[6]!==w?(d=(0,r.jsx)(o.g,{type:"headline4",tag:"h3",className:"text-primary pb-2",children:w}),p[6]=w,p[7]=d):d=p[7];let v=g?.textArea||"";return p[8]!==v?(u=(0,r.jsx)(o.g,{type:"bodyLight",className:"text-white",children:v}),p[8]=v,p[9]=u):u=p[9],p[10]!==d||p[11]!==u?(m=(0,r.jsxs)("div",{className:"w-full tablet:max-w-[330px] pb-4 tablet:pb-0",children:[d,u]}),p[10]=d,p[11]=u,p[12]=m):m=p[12],p[13]!==j?(h=(0,r.jsx)(n.A,{onSuggestionSelection:j,invertIcon:!0}),p[13]=j,p[14]=h):h=p[14],p[15]!==m||p[16]!==h?(f=(0,r.jsxs)("section",{className:"flex justify-between items-end p-4 bg-black break-container tablet:rounded-2xl flex-wrap tablet:gap-6 tablet:container tablet:py-6 tablet:px-10 last-of-type:tablet:mb-[var(--app-container-gap)]",children:[m,h]}),p[15]=m,p[16]=h,p[17]=f):f=p[17],f}},11773:(e,t,a)=>{"use strict";function r(e){return Math.round(e/1.25*100)/100}function s(e){return{item_id:e.id,item_name:e.name,quantity:e.quantity,price:r(e.priceIncludingVat)}}function i(e){return{item_id:e.id,item_name:e.name,price:r(e.priceIncludingVat),index:e.listIndex,offer_type:e.type}}function n(e){return{currency:"DKK",items:e.map(s),value:e.reduce((e,t)=>e+r(t.priceIncludingVat)*(t.quantity??1),0)}}function l(e){return{index:e.index,item_id:e.id,item_name:e.name,item_type:"job",item_list_name:e.listName,job_category:e.categories?.length?e.categories.join(","):void 0,job_country:e.country,job_format:e.format,job_level:e.jobLevel,job_region:e.region}}a.d(t,{P:()=>p});class o{constructor(e){this._config=e}outboundLinkClicked(e){this._config.pushEvent("external_click",{url:e.url})}trackingId(e){this._config.pushEvent(void 0,{tracking_id:e.trackingId??""})}addedToBasket(e){this._config.pushEvent("add_to_cart",{ecommerce:n(e.products)})}pdpViewed(e){this._config.pushEvent("view_item",{ecommerce:{items:[s(e.product)]}})}purchased(e){this._config.pushEvent("purchase",{ecommerce:{items:e.products.map(s),currency:"DKK",shipping:r(e.pickingCostsIncVat+e.shippingCostsIncVat),transaction_id:e.orderId,value:r(e.productTotalIncVat)}})}removedFromBasket(e){this._config.pushEvent("remove_from_cart",{ecommerce:n(e.products)})}login(e){this._config.pushEvent("login",{customer_type:e.customerType,login_area:e.loginArea})}userId(e){this._config.pushEvent(void 0,{user_id:e.gigyaId??""})}anonymousId(e){this._config.pushEvent(void 0,{anonymous_id:e.anonymousId??""})}pageViewed(e){this._config.pushEvent("page_view",{page_location:e.location,page_type:e.type,format:e.format,server_variant:e.variant})}signUpCompleted(e){this._config.pushEvent("sign_up",{page_type:e.area})}signUpNewsletter(e){this._config.pushEvent("sign_up_newsletter",{page_type:e.area})}leafletListViewed(e){this._config.pushEvent("view_leaflet_list",{leaflet_name:e.leafletName})}selectLeaflet(e){this._config.pushEvent("select_leaflet",{leaflet_name:e.leafletName})}viewLeaflet(e){this._config.pushEvent("view_leaflet",{leaflet_name:e.leafletName,leaflet_page:e.leafletPage})}viewLeaflet25(e){this._config.pushEvent("view_leaflet_25",{leaflet_name:e.leafletName,leaflet_page:e.leafletPage})}viewLeaflet50(e){this._config.pushEvent("view_leaflet_50",{leaflet_name:e.leafletName,leaflet_page:e.leafletPage})}viewLeaflet75(e){this._config.pushEvent("view_leaflet_75",{leaflet_name:e.leafletName,leaflet_page:e.leafletPage})}viewLeaflet100(e){this._config.pushEvent("view_leaflet_100",{leaflet_name:e.leafletName,leaflet_page:e.leafletPage})}viewItemList(e){this._config.pushEvent("view_item_list",{content_type:e.contentType,ecommerce:{item_list_name:e.ecommerce.listName,currency:e.ecommerce.currency,items:e.ecommerce.items.map(i)}})}selectContent(e){this._config.pushEvent("select_content",{content_type:e.contentType,content_name:e.contentName,content_url:e.contentUrl})}selectItem(e){this._config.pushEvent("select_item",{content_type:e.contentType,ecommerce:{item_list_name:e.ecommerce.listName,currency:e.ecommerce.currency,items:e.ecommerce.items.map(i)}})}cartViewed(e){this._config.pushEvent("view_cart",{ecommerce:{currency:"DKK",coupon:e.coupon||"",value:r(e.totalPrice),basket_type:e.basketType,items:e.products.map(s)}})}beginCheckout(e){this._config.pushEvent("begin_checkout",{ecommerce:{value:r(e.totalPriceIncludingVat),currency:"DKK",basket_type:e.basketType,coupon:e.coupon,items:e.products.map(s)}})}jobViewed(e){this._config.pushEvent("view_item",{item_list_name:e.listName,items:[l(e.job)]})}jobListViewed(e){this._config.pushEvent("view_item_list",{index:e.index,item_list_name:e.listName,items:e.jobs.map(l)})}jobApplied(e){this._config.pushEvent("apply_job",{items:[{job_name:e.name,job_id:e.id,job_format:e.format,job_level:e.jobLevel,job_c
1ountry:e.country,job_region:e.region,job_category:e.categories?.length?e.categories.join(","):void 0}]})}jobClicked(e){this._config.pushEvent("select_item",{item_type:"job",item_list_name:e.listName,items:[l(e.job)]})}filtersClicked(e){let t="Added"===e.action?"add_filter":"remove_filter";e.filters.forEach(e=>{this._config.pushEvent(t,{filter_category:e.key,filter_value:e.value})})}search(e){this._config.pushEvent("search",{search_term:e.searchTerm,search_area:e.searchArea})}}var c=a(18379),d=a(68419),u=a(28095),m=a(12367);class h{constructor(e){this._tracker=e}track(e,t){let a=this._tracker[e];if(a)return a.apply(this._tracker,[t])}}class f{get eventStream(){return this._queue}constructor(e){this._trackers=e.map(e=>void 0!==e.track?e:new h(e)),this._queueEntry=new c.B7,this._queue=this._queueEntry.pipe((0,u.H)(([e,t])=>(0,d.H)(new Promise(a=>{Promise.all(this._trackers.map(a=>Promise.resolve(a.track(e,t)))).then(()=>a([e,t]))}))),(0,m.u)()),this._queue.subscribe()}track(e,t){this._queueEntry.next([e,t])}}let p=new f([new o({pushEvent:function(e,t){window.dataLayer||(window.dataLayer=[]),window.dataLayer.push({...e?{event:e}:{},...t})}})])},15811:()=>{},20792:(e,t,a)=>{"use strict";a.d(t,{KSeFMain:()=>ef,P:()=>eh});var r=a(67368),s=a(26880),i=a(98946),n=a(18242);let l={currentStep:1,receiptData:void 0,invoiceData:void 0,initialInvoiceData:void 0,selectedEntities:[],entities:[],additionalInformation:void 0,employeeName:void 0,otherRoleDescription:void 0},o=(0,i.vt)()((0,n.Zr)((e,t)=>({...l,setCurrentStep:t=>e({currentStep:t}),nextStep:()=>e(e=>({currentStep:Math.min(e.currentStep+1,5)})),previousStep:()=>e(e=>({currentStep:Math.max(e.currentStep-1,1)})),setReceiptData:t=>e({receiptData:t}),setReceiptValues:t=>e({receiptData:t}),setInvoiceData:t=>e({invoiceData:t}),setInitialInvoiceData:t=>e({initialInvoiceData:t}),setUserData:t=>e({invoiceData:t}),setSelectedEntities:t=>e({selectedEntities:t}),setEntities:t=>e({entities:t}),addEntity:t=>e(e=>({entities:[...e.entities,t]})),updateEntity:(t,a)=>e(e=>({entities:e.entities.map(e=>e.id===t?a:e)})),setAdditionalInformation:t=>e({additionalInformation:t}),setEmployeeName:t=>e({employeeName:t}),setOtherRoleDescription:t=>e({otherRoleDescription:t}),checkForAddressChanges:()=>{let e=t();return!!e.invoiceData&&!!e.initialInvoiceData&&(e.initialInvoiceData.street!==e.invoiceData.street||e.initialInvoiceData.streetNumber!==e.invoiceData.streetNumber||e.initialInvoiceData.city!==e.invoiceData.city||e.initialInvoiceData.postalCode!==e.invoiceData.postalCode)},resetStore:()=>e(e=>({...l,currentStep:e.currentStep}))}),{name:"ksef-storage"}));var c=a(15467),d=a(19875),u=a(74180),m=a(25720),h=a(92726);function f(){let{setCurrentStep:e,resetStore:t}=o(),a=(0,m.useRouter)(),{getSpecificTranslation:s}=(0,h.WR)(),i=s("ksef","confirmation_message"),n=s("ksef","request_another_invoice_button_label"),l=s("ksef","take_me_home_button_label"),f=s("ksef","confirmation_title");function p(){e(1)}return(0,u.useEffect)(()=>(eh("ksef-step-6"),t(),window.addEventListener("beforeunload",p),sessionStorage.getItem("ksef-confirmation-viewed")?e(1):sessionStorage.setItem("ksef-confirmation-viewed","true"),()=>{window.removeEventListener("beforeunload",p),sessionStorage.removeItem("ksef-confirmation-viewed")}),[t,e]),(0,r.jsxs)("div",{id:"ksef-step-6",className:"flex flex-col items-center text-center justify-center min-h-[552px] tablet:max-w-[640px] laptop:max-w-full",children:[(0,r.jsx)(d.default,{src:"/assets/icons/confirmation.svg",alt:"Confirmation Icon",width:"80",height:"80",className:"mx-auto mt-6"}),(0,r.jsx)(c.g,{tag:"h3",type:"headline3",content:f}),(0,r.jsx)(c.g,{tag:"p",type:"body",className:"my-4",content:i}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-3",children:[(0,r.jsx)(c.l,{size:"lg",fullWidth:!0,onClick:function(){sessionStorage.removeItem("ksef-confirmation-viewed"),t(),e(1)},children:n}),(0,r.jsx)(c.l,{size:"lg",variant:"secondary",className:"text-text-white",fullWidth:!0,onClick:function(){sessionStorage.removeItem("ksef-confirmation-viewed"),t(),a.push("/"),setTimeout(()=>{e(1)},100)},children:l})]})]})}var p=a(98760),g=a(72266),b=a(53333),x=a(87115);function y(e){let t,a=e.currentTarget.value.replace(/\D/g,"").substring(0,10);e.currentTarget.value=0===(t=a.replace(/\D/g,"").substring(0,10)).length?"":[t.substring(0,3),t.substring(3,5),t.substring(5,7),t.substring(7,10)].filter(e=>e.length>0).join("-")}function _(){let e,t,a=(0,s.c)(4),{getSpecificTranslation:i}=(0,h.WR)();a[0]!==i?(e=i("ksef","nip_number_label"),a[0]=i,a[1]=e):e=a[1];let n=e;return a[2]!==n?(t=(0,r.jsx)(x.j,{type:"text",label:n,fieldName:"nipNumber",placeholder:"XXX-XX-XX-XXX",onInput:y,maxLength:13}),a[2]=n,a[3]=t):t=a[3],t}function j(e){let t=e.currentTarget.value,a=(t=(t=t.replace(/\./g,",")).replace(/[^\d,]/g,"")).split(",");a.length>2&&(t=a[0]+","+a.slice(1).join("")),2===a.length&&a[1].length>2&&(t=a[0]+","+a[1].substring(0,2)),e.currentTarget.value=t}function w(e){let t=e.currentTarget.value;(t=t.replace(/[^\d/]/g,"")).length>23&&(t=t.substring(0,23)),e.currentTarget.value=t}function v(){let e,t,a,i,n,l,o=(0,s.c)(12),{getSpecificTranslation:c}=(0,h.WR)();o[0]!==c?(e=c("ksef","amount_label"),o[0]=c,o[1]=e):e=o[1];let d=e;o[2]!==c?(t=c("ksef","receipt_number_label"),o[2]=c,o[3]=t):t=o[3];let u=t;return o[4]!==d?(a=(0,r.jsx)(x.j,{type:"text",placeholder:"1234,56",label:d,fieldName:"amount",onInput:j}),o[4]=d,o[5]=a):a=o[5],o[6]===Symbol.for("react.memo_cache_sentinel")?(i=(0,r.jsx)(_,{}),o[6]=i):i=o[6],o[7]!==u?(n=(0,r.jsx)("div",{className:"space-y-2",children:(0,r.jsx)(x.j,{type:"text",label:u,fieldName:"receiptNumber",placeholder:"SSSS/YY/MM/DD/TTT/RRRR",maxLength:22,onInput:w})}),o[7]=u,o[8]=n):n=o[8],o[9]!==a||o[10]!==n?(l=(0,r.jsxs)("div",{className:"space-y-6 pb-10",children:[a,i,n]}),o[9]=a,o[10]=n,o[11]=l):l=o[11],l}var N=a(42718);function S(e){let t,a,i,n,l,o,c=(0,s.c)(19),{firstStep:d,lastStep:u,onNext:m,onBack:f,nextLabel:p,backLabel:g,nextDisabled:b,nextType:x,nextLoading:y}=e,_=void 0!==d&&d,j=void 0!==b&&b,w=void 0===x?"button":x,v=void 0!==y&&y,{get
1SpecificTranslation:S}=(0,h.WR)();c[0]!==S?(t=S("ksef","next_step_button_label"),c[0]=S,c[1]=t):t=c[1];let k=t;c[2]!==S?(a=S("ksef","previous_step_button_label"),c[2]=S,c[3]=a):a=c[3];let $=a;c[4]!==S?(i=S("ksef","submit_button_label"),c[4]=S,c[5]=i):i=c[5];let P=i,E=g||$;c[6]!==_||c[7]!==f||c[8]!==E?(n=(0,r.jsx)(N.l,{className:"!text-text-white",variant:"secondary",size:"lg",fullWidth:!0,disabled:_,onClick:f,type:"button",children:E}),c[6]=_,c[7]=f,c[8]=E,c[9]=n):n=c[9];let T="button"===w?m:void 0,R=p||(void 0!==u&&u?P:k);return c[10]!==j||c[11]!==v||c[12]!==w||c[13]!==T||c[14]!==R?(l=(0,r.jsx)(N.l,{size:"lg",fullWidth:!0,onClick:T,type:w,disabled:j,loading:v,children:R}),c[10]=j,c[11]=v,c[12]=w,c[13]=T,c[14]=R,c[15]=l):l=c[15],c[16]!==n||c[17]!==l?(o=(0,r.jsxs)("div",{className:"py-7 gap-3 flex laptop:gap-4",children:[n,l]}),c[16]=n,c[17]=l,c[18]=o):o=c[18],o}var k=a(29159),$=a(29733),P=a(93057);function E(e){let t,a,i,n=(0,s.c)(6),{message:l,type:o}=e;n[0]===Symbol.for("react.memo_cache_sentinel")?(t={error:"border-surface-danger text-text-error",warning:"border-border-primary text-border-primary",info:"border-border-info text-text-visited"},n[0]=t):t=n[0];let c=t,d=`p-4 rounded-lg border ${c[void 0===o?"info":o]}`;return n[1]!==l?(a=(0,r.jsx)(P.g,{tag:"p",type:"bodyBold",children:l}),n[1]=l,n[2]=a):a=n[2],n[3]!==d||n[4]!==a?(i=(0,r.jsx)("div",{className:d,children:a}),n[3]=d,n[4]=a,n[5]=i):i=n[5],i}var T=a(22640),R=a(83518);let I=b.Ik({ReceiptNumber:b.Yj().min(1,"Receipt number is required").regex(/^\d{4}\/\d{2}\/\d{2}\/\d{2}\/\d{3}\/\d{4}$/,"Receipt number must be in format SSSS/YY/MM/DD/TTT/RRRR with only numbers"),Amount:b.Yj().min(1,"Amount is required").regex(/^\d+(\.\d{1,2})?$/,"Amount must be a valid number with up to 2 decimal places"),NIP_ID:b.Yj().min(1,"NIP ID is required").regex(/^\d{10}$/,"NIP ID must be exactly 10 digits")});class C extends Error{constructor(e,t){super(e),this.name="CustomerNIPError",this.errorCode=t}}function L(e){if(!e||""===e.trim())return"";let t=e.split("/");if(6!==t.length)return e;let[a,r,s,i,n,l]=t,o=n.padStart(3,"0"),c=l.padStart(4,"0");return`${a}/${r}/${s}/${i}/${o}/${c}`}function U(){var e;let{previousStep:t,nextStep:a,receiptData:s,setReceiptData:i,setInvoiceData:n,setInitialInvoiceData:l}=o(),{validateCustomerNIP:c,isLoading:m}=function(){let[e,t]=(0,u.useState)(!1),[a,r]=(0,u.useState)(null),[s,i]=(0,u.useState)(null),n=o(e=>e.setReceiptValues),l=o(e=>e.setUserData),{sallingGroupApiKey:c,sallingGroupApiUrl:d,KSeFEndpoint:m}=R.WN,h=d+m+"/customer-address-validation",f=c||"";return{validateCustomerNIP:async e=>{t(!0),r(null),i(null);try{let t=I.parse(e),a=await fetch(h,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${f}`},body:JSON.stringify({CustomerNIPRequest:t})});if(!a.ok)throw Error(`HTTP error! status: ${a.status}`);let r=await a.json();i(r);let s=r.CustomerInvoiceLookupSelfServResp;if(s.ErrorCode&&s.ErrorText)throw new C(s.ErrorText,s.ErrorCode);return n({amount:t.Amount,nipNumber:t.NIP_ID,receiptNumber:t.ReceiptNumber}),l({nipNumber:s.NIP_ID,label:"Changed Address",name:s.Name||"",street:s.Street||"",streetNumber:s.HouseNumber||"",city:s.City||"",postalCode:s.PostalCode||""}),r}catch(t){let e="An error occurred";throw t instanceof T.G?e=t.errors.map(e=>e.message).join(", "):t instanceof Error&&(e=t.message),r(e),t}finally{t(!1)}},isLoading:e,error:a,response:s}}(),[f,x]=(0,u.useState)(null),[y,_]=(0,u.useState)(!1),{getSpecificTranslation:j}=(0,h.WR)(),w=j("ksef","provide_information_text"),N=j("ksef","receipt_simplified_invoice_error_message"),P=j("ksef","required_field_error_message"),U=j("ksef","receipt_already_sent_error_message"),A=j("ksef","amount_error_message"),O=j("ksef","document_not_found_message"),D=j("ksef","time_for_adding_passed_error_message"),q=j("ksef","receipt_error_message"),H=j("ksef","nip_number_format_error_message"),X=j("ksef","amount_input_validation_message"),W=j("ksef","amount_character_limit_validation_message"),z=j("ksef","amount_must_be_greater_than_validation_message"),B=j("ksef","go_to_store_message"),Y=j("ksef","authentication_error_message"),M=j("ksef","connection_error_message"),F=j("ksef","unexpected_error_message"),G={"001":{message:(e={documentAmountMismatch:A,documentNotFound:O,receiptDateTooOld:D,incorrectNIPNumber:H,receiptAlreadySe
1nt:U}).documentAmountMismatch,goToTill:!1},"002":{message:e.documentNotFound,goToTill:!1},"003":{message:e.receiptDateTooOld,goToTill:!1},"004":{message:e.incorrectNIPNumber,goToTill:!1},"005":{message:e.receiptAlreadySent,goToTill:!0}},V={authenticationError:Y,connectionError:M,unexpectedError:F};(0,u.useEffect)(function(){eh("ksef-step-2")},[]);let K=b.Ik({amount:b.Yj().regex(/^\d+(?:[,]\d{1,2})?$/,X).min(1,P).max(20,W).refine(e=>parseFloat(e.replace(",","."))>450,z),nipNumber:b.Yj().min(1,P).transform(e=>e.replace(/-/g,"")).pipe(b.Yj().regex(/^\d{10}$/,H)),receiptNumber:b.Yj().min(1,P).regex(/^\d+\/\d+\/\d+\/\d+\/\d{1,3}\/\d{1,4}$/,q)}),J=(0,k.mN)({resolver:(0,$.u)(K),defaultValues:{amount:s?.amount||"",nipNumber:function(e){if(!e)return"";let t=e.replace(/\D/g,"");return t.length<=3?t:t.length<=5?`${t.slice(0,3)}-${t.slice(3)}`:t.length<=7?`${t.slice(0,3)}-${t.slice(3,5)}-${t.slice(5)}`:`${t.slice(0,3)}-${t.slice(3,5)}-${t.slice(5,7)}-${t.slice(7,10)}`}(s?.nipNumber||""),receiptNumber:L(s?.receiptNumber||"")}});async function Q(e){x(null),_(!1);let t=L(e.receiptNumber);try{let r=e.amount.replace(",","."),s=await c({ReceiptNumber:t,Amount:r,NIP_ID:e.nipNumber});i({amount:e.amount,nipNumber:e.nipNumber,receiptNumber:t});let o=s.CustomerInvoiceLookupSelfServResp,d={nipNumber:o.NIP_ID,label:"Changed Address",name:o.Name||"",street:o.Street||"",streetNumber:o.HouseNumber||"",city:o.City||"",postalCode:o.PostalCode||""};n(d),l(d),a()}catch(e){!function(e,t,a,r,s){if(e instanceof C){let i=e.errorCode?r[e.errorCode]:null;if(i){t(i.message),a(i.goToTill);return}t(s.unexpectedError);return}if(e instanceof Error){let r=e.message;if(r.includes("401")){t(s.authenticationError),a(!0);return}if(r.includes("404")||r.includes("500")){t(s.connectionError),a(!0);return}t(s.unexpectedError),a(!0);return}t(s.unexpectedError),a(!0)}(e,x,_,G,V)}}return(0,r.jsxs)("div",{id:"ksef-step-2",children:[(0,r.jsx)(g.g,{tag:"h3",type:"headline4",content:w}),(0,r.jsx)("div",{className:"flex gap-9 flex-col w-full max-w-[400px]",children:(0,r.jsxs)(p.X,{className:"space-y-6 py-6",onSubmit:Q,form:J,formType:K,children:[(0,r.jsx)(v,{}),J.formState.errors.amount&&(0,r.jsx)(E,{message:N,type:"info"}),f&&(0,r.jsx)(E,{message:f,type:"error"}),y&&(0,r.jsx)(E,{message:B,type:"warning"}),(0,r.jsx)("div",{className:"w-full flex justify-center",children:(0,r.jsx)(d.default,{src:"/assets/images/nip-guide-receipt.png",alt:"netto-phone",width:"235",height:"308"})}),(0,r.jsx)(S,{firstStep:!0,onBack:function(){t()},nextType:"submit",nextLoading:m})]})})]})}function A(){let e,t,a,i,n,l,c,d,m,f,p,g,b,x=(0,s.c)(30),{invoiceData:y}=o(),{setValue:_}=(0,k.xW)(),j=y?.nipNumber||"",w=y?.name||"";x[0]!==j?(e=function(e){if(!e)return"";let t=e.replace(/\D/g,"");return t.length<=3?t:t.length<=5?`${t.slice(0,3)}-${t.slice(3)}`:t.length<=7?`${t.slice(0,3)}-${t.slice(3,5)}-${t.slice(5)}`:`${t.slice(0,3)}-${t.slice(3,5)}-${t.slice(5,7)}-${t.slice(7,10)}`}(j),x[0]=j,x[1]=e):e=x[1];let v=e,{getSpecificTranslation:N}=(0,h.WR)();x[2]!==N?(t=N("ksef","name_label"),x[2]=N,x[3]=t):t=x[3];let S=t;x[4]!==N?(a=N("ksef","nip_number_label"),x[4]=N,x[5]=a):a=x[5];let $=a;x[6]!==N?(i=N("ksef","invoice_information_title"),x[6]=N,x[7]=i):i=x[7];let E=i;return x[8]!==w||x[9]!==j||x[10]!==_?(n=()=>{j&&_("nipNumber",j),w&&_("name",w)},l=[j,w,_],x[8]=w,x[9]=j,x[10]=_,x[11]=n,x[12]=l):(n=x[11],l=x[12]),(0,u.useEffect)(n,l),x[13]!==E?(c=(0,r.jsx)(P.g,{tag:"h4",type:"headline6",className:"text-text-placeholder py-6",content:E}),x[13]=E,x[14]=c):c=x[14],x[15]!==$?(d=(0,r.jsx)(P.g,{tag:"p",type:"bodyBlack",className:"text-text-placeholder",content:$}),x[15]=$,x[16]=d):d=x[16],x[17]!==v?(m=(0,r.jsx)(P.g,{tag:"p",type:"bodyLight",className:"pb-3",content:v}),x[17]=v,x[18]=m):m=x[18],x[19]!==S?(f=(0,r.jsx)(P.g,{tag:"p",type:"bodyBlack",className:"text-text-placeholder",content:S}),x[19]=S,x[20]=f):f=x[20],x[21]!==w?(p=(0,r.jsx)(P.g,{tag:"p",type:"bodyLight",className:"pb-6",content:w}),x[21]=w,x[22]=p):p=x[22],x[23]===Symbol.for("react.memo_cache_sentinel")?(g=(0,r.jsx)("div",{className:"h-[1px] bg-grey-400"}),x[23]=g):g=x[23],x[24]!==p||x[25]!==c||x[26]!==d||x[27]!==m||x[28]!==f?(b=(0,r.jsxs)("div",{children:[c,d,m,f,p,g]}),x[24]=p,x[25]=c,x[26]=d,x[27]=m,x[28]=f,x[29]=b):b=x[29],b}var O=a(85049);function D(e){let t=e.currentTarget.value.replace(/[^a-zA-Z0-9/-]/g,"");e.currentTarget.value=t}function q(e){let t=e.currentTarget.value.replace(/\D/g,"").substring(0,5),a=t;t.length>2&&(a=t.substring(0,2)+"-"+t.substring(2)),e.currentTarget.value=a}function H(e){let t,a,i,n,l,o,c,d,u,m,f,p,b=(0,s.c)(60),{isReadOnly:y,street:_,streetNumber:j,city:w,postalCode:v,onEdit:N}=e,{getSpecificTranslation:S}=(0,h.WR)();b[0]!==S?(t=S("ksef","street_label"),b[0]=S,b[1]=t):t=b[1];let k=t;b[2]!==S?(a=S("ksef","number_label"),b[2]=S,b[3]=a):a=b[3];let $=a;b[4]!==S?(i=S("ksef","city_label"),b[4]=S,b[5]=i):i=b[5];let P=i;b[6]!==S?(n=S("ksef","postal_code_label"),b[6]=S,b[7]=n):n=b[7];let E=n;b[8]!==S?(l=S("ksef","address_information_title"),b[8]=S,b[9]=l):l=b[9];let T=l;b[10]!==S?(o=S("ksef","edit_button_label"),b[10]=S,b[11]=o):o=b[11];let R=o;if(void 0!==y&&y&&_&&j&&w&&v){let e,t,a,s,i,n,l,o,c,d,u;return b[12]!==T?(e=(0,r.jsx)(g.g,{tag:"h4",type:"headline6",className:"text-text-placeholder py-6",content:T}),b[12]=T,b[13]=e):e=b[13],b[14]!==k?(t=(0,r.jsx)(g.g,{tag:"p",type:"bodyLight",className:"text-text-placeholder",content:k}),b[14]=k,b[15]=t):t=b[15],b[16]!==_?(a=(0,r.jsx)(g.g,{tag:"p",type:"bodyLight",className:"pb-3",children:_}),b[16]=_,b[17]=a):a=b[17],b[18]!==$?(s=(0,r.jsx)(g.g,{tag:"p",type:"bodyLight",className:"text-text-placeholder",content:$}),b[18]=$,b[19]=s):s=b[19],b[20]!==j?(i=(0,r.jsx)(g.g,{tag:"p",type:"bodyLight",className:"pb-3",children:j}),b[20]=j,b[21]=i):i=b[21],b[22]!==P?(n=(0,r.jsx)(g.g,{tag:"p",type:"bodyLight",className:"text-text-placeholder",content:P}),b[22]=P,b[23]=n):n=b[23],b[24]!==w?(l=(0,r.jsx)(g.g,{tag:"p",type:"bodyLight",className:"pb-3",children:w}),b[24]=w,b[25]=l):l=b[25],b[26]!==E?(o=(0,r.jsx)(g.g,{tag:"p",type:"bodyLight",className:"text-text-placeholder",content:E}),b[26]=E,b[27]=o):o=b[27],b[28]!==v?(c=(0,r.jsx)(g.g,{tag:"p",type:"bodyLight",className:"pb-6",children:v}),b[28]=v,b[29]=c):c=b[29],b[30]!==R||b[31]!==N?(d=N&&(0,r.jsx)(O.UIButton,{type:"button",onClick:N,variant:"secondary",size:"lg",className:"!text-text-white",children:R}),b[30]=R,b[31]=N,b[32]=d):d=b[32],b[33]!==a||b[34]!==s||b[35]!==i||b[36]!==n||b[37]!==l||b[38]!==o||b[39]!==c||b[40]!==d||b[41]!==e||b[42]!==t?(u=(0,r.jsxs)(r.Fragment,{children:[e,t,a,s,i,n,l,o,c,d]}),b[33]=a,b[34]=s,b[35]=i,b[36]=n,b[37]=l,b[38]=o,b[39]=c,b[40]=d,b[41]=e,b[42]=t,b[43]=u):u=b[43],u}return b[44]!==T?(c=(0,r.jsx)(g.g,{tag:"h3",type:"label",content:T}),b[44]=T,b[45]=c):c=b[45],b[46]!==k?(d=(0,r.jsx)(x.j,{type:"text",label:k,fieldName:"street",placeholder:"e.g. Main Street"}),b[46]=k,b[47]=d):d=b[47],b[48]!==$?(u=(0,r.jsx)(x.j,{type:"text",label:$,fieldName:"streetNumber",placeholder:"e.g. 123A",onInput:D}),b[48]=$,b[49]=u):u=b[49],b[50]!==P?(m=(0,r.jsx)(x.j,{type:"text",label:P,fieldName:"
1city",placeholder:"e.g. Warsaw"}),b[50]=P,b[51]=m):m=b[51],b[52]!==E?(f=(0,r.jsx)(x.j,{type:"text",label:E,fieldName:"postalCode",placeholder:"XX-XXX",maxLength:6,onInput:q}),b[52]=E,b[53]=f):f=b[53],b[54]!==u||b[55]!==m||b[56]!==f||b[57]!==c||b[58]!==d?(p=(0,r.jsxs)("div",{className:"space-y-4 py-6",children:[c,d,u,m,f]}),b[54]=u,b[55]=m,b[56]=f,b[57]=c,b[58]=d,b[59]=p):p=b[59],p}var X=a(46313),W=a(28492);function z({className:e}){let{selectedEntities:t,setSelectedEntities:a,setEntities:s,setEmployeeName:i,setOtherRoleDescription:n}=o(),{setValue:l}=(0,k.xW)(),[c,d]=(0,u.useState)(()=>t.length>0?"yes":"no"),m=(0,u.useCallback)((e,r)=>{r?a([...t,e]):a(t.filter(t=>t!==e))},[t,a]),f=(0,u.useMemo)(()=>({recipient:e=>m("recipient",e),primaryEntity:e=>m("primaryEntity",e),additionalBuyer:e=>m("additionalBuyer",e),payer:e=>m("payer",e),localGovernmentUnit:e=>m("localGovernmentUnit",e),memberOfVATGroup:e=>m("memberOfVATGroup",e),employee:e=>m("employee",e),other:e=>m("other",e)}),[t,a]),{getSpecificTranslation:p}=(0,h.WR)(),b=p("ksef","add_third_entity_label"),x=p("ksef","yes_button_label"),y=p("ksef","no_button_label"),_=p("ksef","recipient_label"),j=p("ksef","primary_entity_label"),w=p("ksef","additional_buyer_label"),v=p("ksef","payer_label"),N=p("ksef","local_government_label"),S=p("ksef","member_of_vat_group_label"),$=p("ksef","employee_label"),P=p("ksef","other_role_label"),E=p("ksef","entities_to_add_title");return(0,r.jsxs)("div",{className:e,children:[(0,r.jsx)(g.g,{tag:"h4",type:"bodyBold",content:b}),(0,r.jsx)(W.r,{groupName:"ksef-entities-group",required:!1,checkedValue:c,options:[{label:x,value:"yes"},{label:y,value:"no"}],onChange:function(e){let t=e.target.value;d(t),l("hasAdditionalEntities",t,{shouldValidate:!0}),"no"===t&&(a([]),s([]),i(""),n(""))}}),(0,r.jsx)("div",{className:`overflow-hidden transition-all duration-300 ease-in-out ${"yes"===c?"max-h-96 opacity-100":"max-h-0 opacity-0"}`,children:(0,r.jsxs)("div",{className:"mt-4",children:[(0,r.jsx)(g.g,{tag:"h4",type:"bodyBold",className:"pb-3",content:E}),(0,r.jsxs)("div",{className:"flex flex-col gap-2 pb-6 [&_*]:focus-within:outline-none",children:[(0,r.jsx)(X.c,{label:_,checked:t.includes("recipient"),onCheckedChange:f.recipient}),(0,r.jsx)(X.c,{label:j,checked:t.includes("primaryEntity"),onCheckedChange:f.primaryEntity}),(0,r.jsx)(X.c,{label:w,checked:t.includes("additionalBuyer"),onCheckedChange:f.additionalBuyer}),(0,r.jsx)(X.c,{label:v,checked:t.includes("payer"),onCheckedChange:f.payer}),(0,r.jsx)(X.c,{label:N,checked:t.includes("localGovernmentUnit"),onCheckedChange:f.localGovernmentUnit}),(0,r.jsx)(X.c,{label:S,checked:t.includes("memberOfVATGroup"),onCheckedChange:f.memberOfVATGroup}),(0,r.jsx)(X.c,{label:$,checked:t.includes("employee"),onCheckedChange:f.employee}),(0,r.jsx)(X.c,{label:P,checked:t.includes("other"),onCheckedChange:f.other})]})]})})]})}function B(){let e,t,a,i,n,l,c,d,m,f,x,y,_,j=(0,s.c)(36),{previousStep:w,nextStep:v,setCurrentStep:N,currentStep:P,selectedEntities:E,setInvoiceData:T,invoiceData:R}=o(),{getSpecificTranslation:I}=(0,h.WR)(),C=I("ksef","required_field_error_message");j[0]!==I?(e=I("ksef","regon_database_info_text"),j[0]=I,j[1]=e):e=j[1];let L=e,U=I("ksef","postal_code_format_error_message"),O=I("ksef","name_too_long_error_message"),D=I("ksef","street_too_long_error_message"),q=I("ksef","street_number_too_long_error_message"),X=I("ksef","city_too_long_error_message"),W=I("ksef","nip_number_format_error_message");j[2]===Symbol.for("react.memo_cache_sentinel")?(t=[],j[2]=t):t=j[2],(0,u.useEffect)(M,t);let B=b.Ik({nipNumber:b.Yj().min(1,C).transform(Y).pipe(b.Yj().regex(/^\d{10}$/,W)),name:b.Yj().min(1,C).max(512,O),street:b.Yj().min(1,C).max(60,D),streetNumber:b.Yj().min(1,C).max(10,q),city:b.Yj().min(1,C).max(40,X),postalCode:b.Yj().min(1,C).regex(/^\d{2}-\d{3}$/,U)}),F=(0,$.u)(B),G=R?.nipNumber||"",V=R?.name||"",K=R?.street||"",J=R?.streetNumber||"",Q=R?.city||"",Z=R?.postalCode||"";j[3]!==G||j[4]!==V||j[5]!==K||j[6]!==J||j[7]!==Q||j[8]!==Z?(a={nipNumber:G,name:V,street:K,streetNumber:J,city:Q,postalCode:Z},j[3]=G,j[4]=V,j[5]=K,j[6]=J,j[7]=Q,j[8]=Z,j[9]=a):a=j[9],j[10]!==F||j[11]!==a?(i={resolver:F,defaultValues:a},j[10]=F,j[11]=a,j[12]=i):i=j[12];let ee=(0,k.mN)(i);j[13]!==P||j[14]!==v||j[15]!==E.length||j[16]!==N||j[17]!==T?(n=function(e){T({nipNumber:e.nipNumber,label:"Changed Address",name:e.name,street:e.street,streetNumber:e.streetNumber,city:e.city,postalCode:e.postalCode}),E.length>0?v():N(P+2)},j[13]=P,j[14]=v,j[15]=E.length,j[16]=N,j[17]=T,j[18]=n):n=j[18];let et=n;j[19]!==w?(l=function(){w()},j[19]=w,j[20]=l):l=j[20];let ea=l;return j[21]!==L?(c=(0,r.jsx)(g.g,{tag:"h3",type:"headline4",content:L}),j[21]=L,j[22]=c):c=j[22],j[23]===Symbol.for("react.memo_cache_sentinel")?(d=(0,r.jsx)(A,{}),m=(0,r.jsx)(H,{}),f=(0,r.jsx)(z,{className:"py-6"}),j[23]=d,j[24]=m,j[25]=f):(d=j[23],m=j[24],f=j[25]),j[26]!==ea?(x=(0,r.jsx)(S,{onBack:ea,nextType:"submit"}),j[26]=ea,j[27]=x):x=j[27],j[28]!==ee||j[29]!==B||j[30]!==et||j[31]!==x?(y=(0,r.jsxs)(p.X,{className:"space-y-6 max-w-[400px]",onSubmit:et,form:ee,formType:B,children:[d,m,f,x]}),j[28]=ee,j[29]=B,j[30]=et,j[31]=x,j[32]=y):y=j[32],j[33]!==c||j[34]!==y?(_=(0,r.jsxs)("div",{id:"ksef-step-3",className:"container",children:[c,y]}),j[33]=c,j[34]=y,j[35]=_):_=j[35],_}function Y(e){return e.replace(/-/g,"")}function M(){eh("ksef-step-3")}function F(e){let t,a=(0,s.c)(5),{label:i,fieldName:n,required:l,className:o}=e;return a[0]!==o||a[1]!==n||a[2]!==i||a[3]!==l?(t=(0,r.jsx)(x.j,{fieldName:n,placeholder:"",label:i,required:l,className:o}),a[0]=o,a[1]=n,a[2]=i,a[3]=l,a[4]=t):t=a[4],t}function G(e){let t,a,i,n,l,o,c,d,u,m,f,p,b,y,_,j,w,v,N,S=(0,s.c)(52),{label:$,fieldPrefix:P}=e,{setValue:E}=(0,k.xW)(),{getSpecificTranslation:T}=(0,h.WR)();S[0]!==T?(t=T("ksef","nip_number_label"),S[0]=T,S[1]=t):t=S[1];let R=t;S[2]!==T?(a=T("ksef","name_label"),S[2]=T,S[3]=a):a=S[3];let I=a;S[4]!==T?(i=T("ksef","street_label"),S[4]=T,S[5]=i):i=S[5];let C=i;S[6]!==T?(n=T("ksef","number_label"),S[6]=T,S[7]=n):n=S[7];let L=n;S[8]!==T?(l=T("ksef","city_label"),S[8]=T,S[9]=l):l=S[9];let U=l;S[10]!==T?(o=T("ksef","postal_code_label"),S[10]=T,S[11]=o):o=S[11];let A=o;S[12]!==T?(c=T("ksef","optional_label"),S[12]=T,S[13]=c):c=S[13];let O=c;S[14]===Symbol.for("react.memo_cache_sentinel")?(d=function(e){let t=e.replace(/\D/g,""),a="";return t.length>0&&(a=""+t.substring(0,3)),t.length>3&&(a+="-"+t.substring(3,5)),t.length>5&&(a+="-"+t.substring(5,7)),t.length>7&&(a+="-"+t.substring(7,10)),a},S[14]=d):d=S[14];let D=d;S[15]===Symbol.for("react.memo_cache_sentinel")?(u=function(e){let t=e.replace(/\D/g,""),a="";return t.length>0&&(a=""+t.substring(0,2)),t.length>2&&(a+="-"+t.substring(2,5)),a},S[15]=u):u=S[15];let q=u;S[16]!==P||S[17]!==E?(m=function(e){let t=e.target.value.replace(/\D/g,""),a=D(t);e.target.value=a,E(`${P}NIP`,t,{shouldValidate:!0})},S[16]=P,S[17]=E,S[18]=m):m=S[18];let H=m;S[19]!==P||S[20]!==E?(f=function(e){let t=e.target.value.replace(/\D/g,""),a=q(t);e.target.value=a,E(`${P}PostalCode`,t,{shouldValidate:!0})},S[19]=P,S[20]=E,S[21]=f):f=S[21];let X=f;S[22]!==$?(p=(0,r.jsx)(g.g,{tag:"h5",type:"headline6",className:"pt-6",children:$}),S[22]=$,S[23]=p):p=S[23];let W=`${P}NIP`;S[24]!==H||S[25]!==R||S[26]!==W?(b=(0,r.jsx)(x.j,{fieldName:W,placeholder:"XXX-XX-XX-XXX",label:R,maxLength:13,onInput:H}),S[24]=H,S[25]=R,S[26]=W,S[27]=b):b=S[27];let z=`${P}Name`;S[28]!==I||S[29]!==z?(y=(0,r.jsx)(F,{label:I,fieldName:z}),S[28]=I,S[29]=z,S[30]=y):y=S[30];let B=`${P}Street`,Y=`${C} (${O})`;S[31]!==B||S[32]!==Y?(_=(0,r.jsx)(x.j,{fieldName:B,placeholder:"",label:Y}),S[31]=B,S[32]=Y,S[33]=_):_=S[33];let M=`${P}
1StreetNumber`,G=`${L} (${O})`;S[34]!==M||S[35]!==G?(j=(0,r.jsx)(x.j,{fieldName:M,placeholder:"",label:G}),S[34]=M,S[35]=G,S[36]=j):j=S[36];let V=`${P}City`,K=`${U} (${O})`;S[37]!==V||S[38]!==K?(w=(0,r.jsx)(x.j,{fieldName:V,placeholder:"",label:K}),S[37]=V,S[38]=K,S[39]=w):w=S[39];let J=`${P}PostalCode`,Q=`${A} (${O})`;return S[40]!==X||S[41]!==J||S[42]!==Q?(v=(0,r.jsx)(x.j,{fieldName:J,placeholder:"XX-XXX",label:Q,maxLength:6,onInput:X}),S[40]=X,S[41]=J,S[42]=Q,S[43]=v):v=S[43],S[44]!==p||S[45]!==b||S[46]!==y||S[47]!==_||S[48]!==j||S[49]!==w||S[50]!==v?(N=(0,r.jsxs)("div",{className:"grid gap-6",children:[p,b,y,_,j,w,v]}),S[44]=p,S[45]=b,S[46]=y,S[47]=_,S[48]=j,S[49]=w,S[50]=v,S[51]=N):N=S[51],N}let V=[{id:"recipient",translationKey:"recipient_label",roleNumber:"2"},{id:"primaryEntity",translationKey:"primary_entity_label",roleNumber:"3"},{id:"additionalBuyer",translationKey:"additional_buyer_label",roleNumber:"4"},{id:"payer",translationKey:"payer_label",roleNumber:"6"},{id:"localGovernmentUnit",translationKey:"local_government_label",roleNumber:"7"},{id:"memberOfVATGroup",translationKey:"member_of_vat_group_label",roleNumber:"10"},{id:"employee",translationKey:"employee_label",roleNumber:"11"},{id:"other",translationKey:"other_label",roleNumber:"91"}];function K(){let e,t,a,i,n,l,c,d,m,f,x,y,_,j,w,v=(0,s.c)(39),{previousStep:N,nextStep:P,selectedEntities:E,setEntities:T,setEmployeeName:R,setOtherRoleDescription:I,entities:C,employeeName:L,otherRoleDescription:U}=o(),{getTranslatedEntities:A}=function(){let e,t,a,r=(0,s.c)(7),{getSpecificTranslation:i}=(0,h.WR)();r[0]!==i?(e=e=>V.filter(t=>e.includes(t.id)).map(e=>({...e,label:i("ksef",e.translationKey)})),r[0]=i,r[1]=e):e=r[1];let n=e;r[2]!==i?(t=e=>{let t=V.find(t=>t.id===e);return t?i("ksef",t.translationKey):e},r[2]=i,r[3]=t):t=r[3];let l=t;return r[4]!==l||r[5]!==n?(a={getTranslatedEntities:n,getEntityLabel:l,ENTITY_OPTIONS:V},r[4]=l,r[5]=n,r[6]=a):a=r[6],a}(),{getSpecificTranslation:O}=(0,h.WR)(),D=O("ksef","required_field_error_message");v[0]!==O?(e=O("ksef","additional_information_label"),v[0]=O,v[1]=e):e=v[1];let q=e;v[2]!==O?(t=O("ksef","name_of_employee_label"),v[2]=O,v[3]=t):t=v[3];let H=t;v[4]!==O?(a=O("ksef","role_description_label"),v[4]=O,v[5]=a):a=v[5];let X=a,W=O("ksef","nip_must_be_empty_or_filled_out_error_message"),z=O("ksef","name_too_long_error_message"),B=O("ksef","street_too_long_error_message"),Y=O("ksef","street_number_too_long_error_message"),M=O("ksef","city_too_long_error_message"),G=O("ksef","postal_code_format_error_message"),K=O("ksef","nip_or_name_required_error_message"),en=A(E);v[6]!==E?(i=E.includes("employee"),v[6]=E,v[7]=i):i=v[7];let el=i;v[8]!==E?(n=E.includes("other"),v[8]=E,v[9]=n):n=v[9];let eo=n,ec=(w={},en.filter(ei).forEach(e=>{let t=e.id;w[`${t}NIP`]=b.Yj().optional().transform(es).pipe(b.Yj().regex(/^$|^\d{10}$/,W)),w[`${t}Name`]=b.Yj().max(100,z).optional(),w[`${t}Street`]=b.Yj().max(60,B).optional(),w[`${t}StreetNumber`]=b.Yj().max(10,Y).optional(),w[`${t}City`]=b.Yj().max(40,M).optional(),w[`${t}PostalCode`]=b.Yj().optional().refine(er,G)}),el&&(w.employeeName=b.Yj().min(1,{message:D||""})),eo&&(w.otherRole=b.Yj().min(1,{message:D||""})),b.Ik(w)),ed={};en.filter(ea).forEach(e=>{let t=C.find(t=>t.id===e.id),a=e.id;ed[`${a}NIP`]=t?.nipNumber||"",ed[`${a}Name`]=t?.name||"",ed[`${a}Street`]=t?.street||"",ed[`${a}StreetNumber`]=t?.streetNumber||"",ed[`${a}City`]=t?.city||"",ed[`${a}PostalCode`]=t?.postalCode||""}),el&&(ed.employeeName=L||""),eo&&(ed.otherRole=U||"");let eu=(0,k.mN)({resolver:(0,$.u)(ec),defaultValues:ed});v[10]===Symbol.for("react.memo_cache_sentinel")?(l=[],v[10]=l):l=v[10],(0,u.useEffect)(()=>{eh("ksef-step-4"),eu.reset(ed)},l);let em=function(e){let t=[];if(en.filter(et).forEach(a=>{let r=a.id,s=e[`${r}NIP`],i=e[`${r}Name`];s&&0!==s.length||i&&0!==i.length||t.push(`${a.label}: ${K}`)}),t.length>0){en.filter(ee).forEach(t=>{let a=t.id,r=e[`${a}NIP`],s=e[`${a}Name`];r&&0!==r.length||s&&0!==s.length||(eu.setError(`${a}NIP`,{type:"manual",message:K}),eu.setError(`${a}Name`,{type:"manual",message:K}))}),eh("ksef-step-4");return}T(en.filter(Z).map(t=>{let a=t.id;return{id:t.id,roleNumber:t.roleNumber,label:t.label,nipNumber:e[`${a}NIP`],name:e[`${a}Name`],street:e[`${a}Street`],streetNumber:e[`${a}StreetNumber`],city:e[`${a}City`],postalCode:e[`${a}PostalCode`]}})),el&&e.employeeName&&R(e.employeeName),eo&&e.otherRole&&I(e.otherRole),P()};v[11]!==N?(c=function(){N()},v[11]=N,v[12]=c):c=v[12];let ef=c;v[13]!==q?(d=(0,r.jsx)(g.g,{tag:"h3",type:"headline4",content:q}),v[13]=q,v[14]=d):d=v[14];let ep=p.X,eg=en.filter(Q).map(J);return v[15]!==H||v[16]!==el?(m=el&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)(g.g,{tag:"h4",type:"headline6",content:H}),(0,r.jsx)(F,{label:H,fieldName:"employeeName"})]}),v[15]=H,v[16]=el,v[17]=m):m=v[17],v[18]!==el||v[19]!==eo?(f=el&&eo&&(0,r.jsx)("div",{className:"divider"}),v[18]=el,v[19]=eo,v[20]=f):f=v[20],v[21]!==eo||v[22]!==X?(x=eo&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)(g.g,{tag:"h4",type:"headline6",content:X}),(0,r.jsx)(F,{label:X,fieldName:"otherRole"})]}),v[21]=eo,v[22]=X,v[23]=x):x=v[23],v[24]!==ef?(y=(0,r.jsx)(S,{onBack:ef,nextType:"submit"}),v[24]=ef,v[25]=y):y=v[25],v[26]!==ep||v[27]!==eu||v[28]!==ec||v[29]!==em||v[30]!==eg||v[31]!==m||v[32]!==f||v[33]!==x||v[34]!==y?(_=(0,r.jsx)("div",{className:"flex gap-9 flex-col w-full max-w-[400px]",children:(0,r.jsxs)(ep,{className:"space-y-6 py-6",onSubmit:em,form:eu,formType:ec,children:[eg,m,f,x,y]})}),v[26]=ep,v[27]=eu,v[28]=ec,v[29]=em,v[30]=eg,v[31]=m,v[32]=f,v[33]=x,v[34]=y,v[35]=_):_=v[35],v[36]!==_||v[37]!==d?(j=(0,r.jsxs)("div",{id:"ksef-step-4",className:"container",children:[d,_]}
1),v[36]=_,v[37]=d,v[38]=j):j=v[38],j}function J(e){return(0,r.jsxs)("div",{children:[(0,r.jsx)(G,{label:e.label,fieldPrefix:e.id}),(0,r.jsx)("div",{className:"divider"})]},e.id)}function Q(e){return"employee"!==e.id&&"other"!==e.id}function Z(e){return"employee"!==e.id&&"other"!==e.id}function ee(e){return"employee"!==e.id&&"other"!==e.id}function et(e){return"employee"!==e.id&&"other"!==e.id}function ea(e){return"employee"!==e.id&&"other"!==e.id}function er(e){return!e||/^\d{2}-\d{3}$/.test(e)}function es(e){return e?e.replace(/-/g,""):""}function ei(e){return"employee"!==e.id&&"other"!==e.id}var en=a(18945);function el(e){if(!e)return"";let t=e.replace(/\D/g,""),a="";return t.length>0&&(a+=t.substring(0,3)),t.length>3&&(a+="-"+t.substring(3,5)),t.length>5&&(a+="-"+t.substring(5,7)),t.length>7&&(a+="-"+t.substring(7,10)),a}function eo(e){if(!e)return"";let t=e.replace(/\D/g,""),a="";return t.length>0&&(a+=t.substring(0,2)),t.length>2&&(a+="-"+t.substring(2,5)),a}function ec(e){let t,a,i,n,l,o,c,d,m,f,p,b,y,_,j,w,v,N,S,$,P,E,T,R,I,C,L=(0,s.c)(102),{label:U,data:A,className:O,isEditing:D,fieldPrefix:q}=e,H=void 0!==D&&D,{setValue:X,getValues:W}=(0,k.xW)(),{getSpecificTranslation:z}=(0,h.WR)();L[0]!==z?(t=z("ksef","nip_number_label"),L[0]=z,L[1]=t):t=L[1];let B=t;L[2]!==z?(a=z("ksef","street_label"),L[2]=z,L[3]=a):a=L[3];let Y=a;L[4]!==z?(i=z("ksef","number_label"),L[4]=z,L[5]=i):i=L[5];let M=i;L[6]!==z?(n=z("ksef","city_label"),L[6]=z,L[7]=n):n=L[7];let F=n;L[8]!==z?(l=z("ksef","postal_code_label"),L[8]=z,L[9]=l):l=L[9];let G=l;L[10]!==z?(o=z("ksef","name_label"),L[10]=z,L[11]=o):o=L[11];let V=o;L[12]!==z?(c=z("ksef","edit_button_label"),L[12]=z,L[13]=c):c=L[13];let K=c;L[14]!==q||L[15]!==W||L[16]!==H?(m=()=>{if(H){let e=W(`${q}NIPNumber`),t=W(`${q}PostalCode`);setTimeout(()=>{let a=document.querySelector(`input[name="${q}NIPNumber"]`),r=document.querySelector(`input[name="${q}PostalCode"]`);a&&e&&(a.value=el(e)),r&&t&&(r.value=eo(t))},0)}},d=[H,q,W],L[14]=q,L[15]=W,L[16]=H,L[17]=d,L[18]=m):(d=L[17],m=L[18]),(0,u.useEffect)(m,d),L[19]!==q||L[20]!==X?(f=function(e){let t=e.target.value.replace(/\D/g,""),a=el(t);e.target.value=a,X(`${q}NIPNumber`,t,{shouldValidate:!0})},L[19]=q,L[20]=X,L[21]=f):f=L[21];let J=f;L[22]!==q||L[23]!==X?(p=function(e){let t=e.target.value.replace(/\D/g,""),a=eo(t);e.target.value=a,X(`${q}PostalCode`,t,{shouldValidate:!0})},L[22]=q,L[23]=X,L[24]=p):p=L[24];let Q=p;if(H){let e,t,a,s,i,n,l,o,c;L[25]!==K||L[26]!==U?(e=(0,r.jsxs)(g.g,{tag:"h4",type:"headline6",className:"text-text-placeholder mb-4",children:[K," ",U]}),L[25]=K,L[26]=U,L[27]=e):e=L[27];let d=`${q}NIPNumber`;L[28]!==J||L[29]!==B||L[30]!==d?(t=(0,r.jsx)(x.j,{fieldName:d,label:B,placeholder:"XXX-XX-XX-XXX",maxLength:13,onInput:J}),L[28]=J,L[29]=B,L[30]=d,L[31]=t):t=L[31];let u=`${q}Name`;L[32]!==V||L[33]!==u?(a=(0,r.jsx)(x.j,{fieldName:u,label:V,placeholder:V}),L[32]=V,L[33]=u,L[34]=a):a=L[34];let m=`${q}Street`;L[35]!==Y||L[36]!==m?(s=(0,r.jsx)(x.j,{fieldName:m,label:Y,placeholder:Y}),L[35]=Y,L[36]=m,L[37]=s):s=L[37];let h=`${q}StreetNumber`;L[38]!==M||L[39]!==h?(i=(0,r.jsx)(x.j,{fieldName:h,label:M,placeholder:M}),L[38]=M,L[39]=h,L[40]=i):i=L[40];let f=`${q}City`;L[41]!==F||L[42]!==f?(n=(0,r.jsx)(x.j,{fieldName:f,label:F,placeholder:F}),L[41]=F,L[42]=f,L[43]=n):n=L[43];let p=`${q}PostalCode`;return L[44]!==Q||L[45]!==G||L[46]!==p?(l=(0,r.jsx)(x.j,{fieldName:p,label:G,placeholder:"XX-XXX",maxLength:6,onInput:Q}),L[44]=Q,L[45]=G,L[46]=p,L[47]=l):l=L[47],L[48]!==t||L[49]!==a||L[50]!==s||L[51]!==i||L[52]!==n||L[53]!==l?(o=(0,r.jsxs)("div",{className:"space-y-4",children:[t,a,s,i,n,l]}),L[48]=t,L[49]=a,L[50]=s,L[51]=i,L[52]=n,L[53]=l,L[54]=o):o=L[54],L[55]!==O||L[56]!==e||L[57]!==o?(c=(0,r.jsxs)("div",{className:O,children:[e,o]}),L[55]=O,L[56]=e,L[57]=o,L[58]=c):c=L[58],c}L[59]!==U?(b=(0,r.jsx)(g.g,{tag:"h4",type:"headline6",className:"text-text-placeholder mb-4",children:U}),L[59]=U,L[60]=b):b=L[60],L[61]!==B?(y=(0,r.jsx)(g.g,{tag:"p",type:"bodyLight",className:"text-text-placeholder",content:B}),L[61]=B,L[62]=y):y=L[62],L[63]!==A.NIPNumber?(_=el(A.NIPNumber)||"-",L[63]=A.NIPNumber,L[64]=_):_=L[64],L[65]!==_?
1(j=(0,r.jsx)(g.g,{tag:"p",type:"bodyLight",className:"pb-3 text-text-black",content:_}),L[65]=_,L[66]=j):j=L[66],L[67]!==V?(w=(0,r.jsx)(g.g,{tag:"p",type:"bodyLight",className:"text-text-placeholder",content:V}),L[67]=V,L[68]=w):w=L[68];let Z=A.name||"-";L[69]!==Z?(v=(0,r.jsx)(g.g,{tag:"p",type:"bodyLight",className:"pb-3 text-text-black",content:Z}),L[69]=Z,L[70]=v):v=L[70],L[71]!==Y?(N=(0,r.jsx)(g.g,{tag:"p",type:"bodyLight",className:"text-text-placeholder",content:Y}),L[71]=Y,L[72]=N):N=L[72];let ee=A.street||"-";L[73]!==ee?(S=(0,r.jsx)(g.g,{tag:"p",type:"bodyLight",className:"pb-3",content:ee}),L[73]=ee,L[74]=S):S=L[74],L[75]!==M?($=(0,r.jsx)(g.g,{tag:"p",type:"bodyLight",className:"text-text-placeholder",content:M}),L[75]=M,L[76]=$):$=L[76];let et=A.number||"-";L[77]!==et?(P=(0,r.jsx)(g.g,{tag:"p",type:"bodyLight",className:"pb-3",content:et}),L[77]=et,L[78]=P):P=L[78],L[79]!==F?(E=(0,r.jsx)(g.g,{tag:"p",type:"bodyLight",className:"text-text-placeholder",content:F}),L[79]=F,L[80]=E):E=L[80];let ea=A.city||"-";L[81]!==ea?(T=(0,r.jsx)(g.g,{tag:"p",type:"bodyLight",className:"pb-3",content:ea}),L[81]=ea,L[82]=T):T=L[82],L[83]!==G?(R=(0,r.jsx)(g.g,{tag:"p",type:"bodyLight",className:"text-text-placeholder",content:G}),L[83]=G,L[84]=R):R=L[84];let er=A.postalCode||"-";return L[85]!==er?(I=(0,r.jsx)(g.g,{tag:"p",type:"bodyLight",className:"pb-6",content:er}),L[85]=er,L[86]=I):I=L[86],L[87]!==O||L[88]!==b||L[89]!==y||L[90]!==j||L[91]!==w||L[92]!==v||L[93]!==N||L[94]!==S||L[95]!==$||L[96]!==P||L[97]!==E||L[98]!==T||L[99]!==R||L[100]!==I?(C=(0,r.jsxs)("div",{className:O,children:[b,y,j,w,v,N,S,$,P,E,T,R,I]}),L[87]=O,L[88]=b,L[89]=y,L[90]=j,L[91]=w,L[92]=v,L[93]=N,L[94]=S,L[95]=$,L[96]=P,L[97]=E,L[98]=T,L[99]=R,L[100]=I,L[101]=C):C=L[101],C}let ed=b.Ik({Role:b.Yj(),RoleNIPNumber:b.Yj().regex(/^\d{10}$/,"Role NIP must be exactly 10 digits").optional().or(b.eu("")),RoleText:b.Yj(),Name:b.Yj(),Street:b.Yj().optional(),HouseNumber:b.Yj().optional(),City:b.Yj().optional(),PostalCode:b.Yj().regex(/^\d{2}-\d{3}$/,"Postal code must be in format XX-XXX").optional().or(b.eu(""))}),eu=b.Ik({ReceiptNumber:b.Yj().regex(/^\d{4}\/\d{2}\/\d{2}\/\d{2}\/\d{3}\/\d{4}$/,"Receipt number must be in format SSSS/YY/MM/DD/TTT/RRRR"),NIP_ID:b.Yj().regex(/^\d{10}$/,"NIP ID must be exactly 10 digits"),EmailID:b.Yj().email("Invalid email address").optional().or(b.eu("")),AdditionalInformation:b.Yj().optional(),NoRole:b.Yj().optional(),RoleAdded:b.YO(ed)});function em(){let e,{nextStep:t,previousStep:a,setCurrentStep:s,currentStep:i,receiptData:n,invoiceData:l,entities:c,employeeName:d,otherRoleDescription:m,setAdditionalInformation:f,additionalInformation:x,updateEntity:y,setInvoiceData:_,setEmployeeName:j,setOtherRoleDescription:w,checkForAddressChanges:v}=o(),{updateAddressInfo:N,isLoading:P}=function(){let[e,t]=(0,u.useState)(!1),[a,r]=(0,u.useState)(null),[s,i]=(0,u.useState)(null),{sallingGroupApiKey:n,sallingGroupApiUrl:l,KSeFEndpoint:o}=R.WN,c=l+o+"/update-address-info",d=n||"";return{updateAddressInfo:async e=>{t(!0),r(null),i(null);try{let t=eu.parse(e),a=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${d}`},body:JSON.stringify({CustomerRoleForReceiptSelfServResp:t})});if(!a.ok)throw Error(`HTTP error! status: ${a.status}`);let r=await a.json();return i(r),r}catch(t){let e="An error occurred";throw t instanceof T.G?e=t.errors.map(e=>e.message).join(", "):t instanceof Error&&(e=t.message),r(e),t}finally{t(!1)}},isLoading:e,error:a,response:s}}(),[I,C]=(0,u.useState)(null),[L,U]=(0,u.useState)(!1);(0,u.useEffect)(()=>{eh("ksef-step-5")},[]);let{getSpecificTranslation:D}=(0,h.WR)(),q=D("ksef","required_field_error_message"),X=D("ksef","employee_label"),W=D("ksef","name_of_employee_label"),z=D("ksef","other_role_label"),B=D("ksef","role_description_label"),Y=D("ksef","confirm_data_provided_title"),M=D("ksef","nip_or_name_required_error_message"),G=D("ksef","name_too_long_error_message"),V=D("ksef","street_too_long_error_message"),K=D("ksef","street_number_too_long_error_message"),J=D("ksef","city_too_long_error_message"),Q=D("ksef","postal_code_format_error_message"),Z=D("
1ksef","nip_must_be_empty_or_filled_out_error_message"),ee=D("ksef","additional_information_label"),et=D("ksef","additional_information_textarea_info_text"),ea=D("ksef","go_to_store_info_message"),er={authenticationError:D("ksef","authentication_error_message"),connectionError:D("ksef","connection_error_message"),unexpectedError:D("ksef","unexpected_error_message")},es=D("ksef","save_button_label"),ei=D("ksef","cancel_button_label"),el=D("ksef","edit_button_label"),[eo,ed]=(0,u.useState)(null),[em,ef]=(0,u.useState)(!1),ep=(e={additionalText:b.Yj().optional().default("")},em&&(e.street=b.Yj().min(1,q).max(60,V),e.streetNumber=b.Yj().min(1,q).max(10,K),e.city=b.Yj().min(1,q).max(40,J),e.postalCode=b.Yj().min(1,q).regex(/^\d{2}-\d{3}$/,Q)),eo&&"employee"!==eo&&"other"!==eo&&(e[`${eo}NIPNumber`]=b.Yj().optional().transform(e=>e?e.replace(/-/g,""):"").pipe(b.Yj().regex(/^$|^\d{10}$/,Z)),e[`${eo}Name`]=b.Yj().max(100,G).optional(),e[`${eo}Street`]=b.Yj().max(60,V).optional(),e[`${eo}StreetNumber`]=b.Yj().max(10,K).optional(),e[`${eo}City`]=b.Yj().max(40,J).optional(),e[`${eo}PostalCode`]=b.Yj().optional().refine(e=>!e||/^\d{2}-\d{3}$/.test(e),Q)),"employee"===eo&&(e.employeeName=b.Yj().min(1,{message:q||""})),"other"===eo&&(e.otherRole=b.Yj().min(1,{message:q||""})),b.Ik(e)),eg=(0,k.mN)({resolver:(0,$.u)(ep),mode:"onChange",defaultValues:{additionalText:x||"",...em&&l&&{street:l.street||"",streetNumber:l.streetNumber||"",city:l.city||"",postalCode:l.postalCode||""},...eo&&{[`${eo}NIPNumber`]:c.find(e=>e.id===eo)?.nipNumber||"",[`${eo}Name`]:c.find(e=>e.id===eo)?.name||"",[`${eo}Street`]:c.find(e=>e.id===eo)?.street||"",[`${eo}StreetNumber`]:c.find(e=>e.id===eo)?.streetNumber||"",[`${eo}City`]:c.find(e=>e.id===eo)?.city||"",[`${eo}PostalCode`]:c.find(e=>e.id===eo)?.postalCode||""},..."employee"===eo&&{employeeName:d||""},..."other"===eo&&{otherRole:m||""}}});async function eb(e){C(null),U(!1),e.additionalText&&f(e.additionalText);let a=v(),r=[];for(let e of(a&&l&&r.push({Role:"92",RoleNIPNumber:l.nipNumber||"",RoleText:l.name||"",Name:l.name||"",Street:l.street||"",HouseNumber:l.streetNumber||"",City:l.city||"",PostalCode:l.postalCode||""}),c)){let t=e.nipNumber&&10===e.nipNumber.length;if(e.name&&e.name.trim().length>0||t){let a={Role:e.roleNumber,RoleText:e.name||"",Name:e.label||""};t&&(a.RoleNIPNumber=e.nipNumber),e.street&&(a.Street=e.street),e.streetNumber&&(a.HouseNumber=e.streetNumber),e.city&&(a.City=e.city),e.postalCode&&/^\d{2}-\d{3}$/.test(e.postalCode)&&(a.PostalCode=e.postalCode),r.push(a)}}d&&r.push({Role:"11",RoleText:d,Name:"Employee"}),m&&r.push({Role:"91",RoleText:m,Name:"Other Role"});let s=r.length>0,i={ReceiptNumber:n?.receiptNumber||"",NIP_ID:l?.nipNumber||"",NoRole:s?"":"X",RoleAdded:r};e.additionalText&&e.additionalText.trim().length>0&&(i.AdditionalInformation=e.additionalText);try{await N(i),t()}catch(e){!function(e,t,a,r){if(!(e instanceof Error))return t(r.unexpectedError);let s=e.message;if(s.includes("status: 401")){t(r.authenticationError),a(!0);return}if(s.includes("status: 500")){t(r.connectionError),a(!0);return}t(s)}(e,C,U,er),eh("ksef-step-5")}}async function ex(){if(!await eg.trigger(["street","streetNumber","city","postalCode"]))return;let e=eg.getValues();l&&_({...l,street:e.street,streetNumber:e.streetNumber,city:e.city,postalCode:e.postalCode}),ef(!1)}async function ey(){if(!await eg.trigger())return;let e=eg.getValues();if("employee"===eo){j(e.employeeName),ed(null);return}if("other"===eo){w(e.otherRole),ed(null);return}if(eo){let t=e[`${eo}NIPNumber`],a=e[`${eo}Name`];if((!t||0===t.length)&&(!a||0===a.length)){eg.setError(`${eo}NIPNumber`,{type:"manual",message:M}),eg.setError(`${eo}Name`,{type:"manual",message:M});return}y(eo,{id:eo,roleNumber:c.find(e=>e.id===eo)?.roleNumber||"",label:c.find(e=>e.id===eo)?.label||"Unknown",nipNumber:t,name:a,street:e[`${eo}Street`],streetNumber:e[`${eo}StreetNumber`],city:e[`${eo}City`],postalCode:e[`${eo}PostalCode`]}),ed(null)}}function e_(){eg.reset({additionalText:eg.getValues("additionalText")||""}),ed(null)}return(0,u.useEffect)(()=>{em&&l&&eg.reset({additionalText:x||"",street:l.street||"",streetNumber:l.streetNumber||"",city:l.city||"",postalCode:l.postalCode||""})},[em,l,eg,x]),(0,r.jsxs)("div",{id:"ksef-step-5",className:"container",children:[(0,r.jsx)(g.g,{tag:"h3",type:"headline4",content:Y}),I&&(0,r.jsx)("div",{className:"mt-6",children:(0,r.jsx)(E,{message:I,type:"error"})}),L&&(0,r.jsx)("div",{className:"mt-3",children:(0,r.jsx)(E,{message:ea,type:"warning"})}),(0,r.jsxs)(p.X,{onSubmit:eb,form:eg,formType:ep,className:"max-w-[400px]",children:[n&&(0,r.jsx)(A,{}),l&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(H,{isReadOnly:!em,street:l.street,streetNumber:l.streetNumber,city:l.city,postalCode:l.postalCode,onEdit:function(){l&&eg.reset({additionalText:eg.getValues("additionalText")||"",street:l.street||"",streetNumber:l.streetNumber||"",city:l.city||"",postalCode:l.postalCode||""}),ef(!0)}}),em&&(0,r.jsxs)("div",{className:"flex gap-3 mt-6 mb-6",children:[(0,r.jsx)(O.UIButton,{size:"lg",variant:"secondary",onClick:function(){eg.reset({additionalText:eg.getValues("additionalText")||""}),ef(!1)},fullWidth:!0,type:"button",children:ei}),(0,r.jsx)(O.UIButton,{size:"lg",onClick:ex,fullWidth:!0,type:"button",children:es})]})]}),(0,r.jsx)("div",{className:"divider"}),(0,r.jsx)(g.g,{tag:"h4",type:"headline6",className:"text-text-placeholder pb-6 pt-6",content:ee}),(0,r.jsx)(en.B,{fieldName:"additionalText",label:et,placeholder:"",maxCharLength:256}),c.length>0&&(0,r.jsx)(r.Fragment,{children:c.map(function(e){return(0,r.jsxs)("div",{children:[(0,r.jsx)(ec,{label:e.label,className:"mt-6",isEditing:eo===e.id,fieldPrefix:e.id,data:{NIPNumber:e.nipNumber||"",name:e.name||"",street:e.street||"",number:e.streetNumber||"",city:e.city||"",postalCode:e.postalCode||""}}),eo===e.id?(0,r.jsxs)("div",{className:"flex gap-3 mt-6 mb-6",children:[(0,r.jsx)(O.UIButton,{size:"lg",variant:"secondary",onClick:e_,fullWidth:!0,type:"button",children:ei}),(0,r.jsx)(O.UIButton,{size:"lg",onClick:ey,fullWidth:!0,type:"button",children:es})]}):(0,r.jsx)(O.UIButton,{variant:"secondary",onClick:function(){var t;let a;t=e.id,(a=c.find(function(e){return e.id===t}))&&eg.reset({additionalText:eg.getValues("additionalText")||"",[`${t}NIPNumber`]:a.nipNumber||"",[`${t}Name`]:a.name||"",[`${t}Street`]:a.street||"",[`${t}
1StreetNumber`]:a.streetNumber||"",[`${t}City`]:a.city||"",[`${t}PostalCode`]:a.postalCode||""}),ed(t)},type:"button",className:"mb-6",children:el}),(0,r.jsx)("div",{className:"divider"})]},e.id)})}),d&&(0,r.jsxs)("div",{children:[(0,r.jsx)(g.g,{tag:"h4",type:"headline6",className:"mt-6 mb-4",content:X}),"employee"===eo?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(F,{fieldName:"employeeName",label:W}),(0,r.jsxs)("div",{className:"flex gap-3 mt-6 mb-6",children:[(0,r.jsx)(O.UIButton,{size:"lg",variant:"secondary",onClick:e_,fullWidth:!0,type:"button",children:ei}),(0,r.jsx)(O.UIButton,{size:"lg",onClick:ey,fullWidth:!0,type:"button",children:es})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g.g,{tag:"p",type:"body",className:"mb-4",children:d}),(0,r.jsx)(O.UIButton,{variant:"secondary",onClick:function(){eg.reset({additionalText:eg.getValues("additionalText")||"",employeeName:d||""}),ed("employee")},type:"button",className:"mb-6",children:el})]}),(0,r.jsx)("div",{className:"divider"})]}),m&&(0,r.jsxs)("div",{children:[(0,r.jsx)(g.g,{tag:"h4",type:"headline6",className:"mt-6 mb-4",content:z}),"other"===eo?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(F,{fieldName:"otherRole",label:B}),(0,r.jsxs)("div",{className:"flex gap-3 mt-6 mb-6",children:[(0,r.jsx)(O.UIButton,{size:"lg",variant:"secondary",onClick:e_,fullWidth:!0,type:"button",children:ei}),(0,r.jsx)(O.UIButton,{size:"lg",onClick:ey,fullWidth:!0,type:"button",children:es})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g.g,{tag:"p",type:"body",className:"mb-4",children:m}),(0,r.jsx)(O.UIButton,{variant:"secondary",onClick:function(){eg.reset({additionalText:eg.getValues("additionalText")||"",otherRole:m||""}),ed("other")},type:"button",className:"mb-6",children:el})]}),(0,r.jsx)("div",{className:"divider"})]}),(0,r.jsx)(S,{lastStep:!0,onBack:function(){c.length>0||d||m?a():s(i-2)},nextType:"submit",nextLoading:P})]})]})}function eh(e){if(e){let t=document.getElementById(e);if(t){let e=t.getBoundingClientRect().top+window.pageYOffset-80;window.scrollTo({top:e,behavior:"smooth"});return}}window.scrollTo({top:0,behavior:"smooth"})}function ef(){let e,t,a=(0,s.c)(4),i=o(ep);a[0]!==i?(e=()=>{switch(i){case 1:default:return(0,r.jsx)(U,{});case 2:return(0,r.jsx)(B,{});case 3:return(0,r.jsx)(K,{});case 4:return(0,r.jsx)(em,{});case 5:return(0,r.jsx)(f,{})}},a[0]=i,a[1]=e):e=a[1];let n=e;return a[2]!==n?(t=(0,r.jsx)("div",{className:"container pt-6 laptop:pt-16",children:n()}),a[2]=n,a[3]=t):t=a[3],t}function ep(e){return e.currentStep}},21947:(e,t,a)=>{"use strict";a.d(t,{default:()=>n});var r=a(26880),s=a(74180),i=a(11773);function n(e){let t,a,n=(0,r.c)(3),{type:l}=e,o=void 0===l?"CONTENT_PAGE":l;return n[0]!==o?(t=()=>{i.P.track("pageViewed",{location:window.location.href,format:"Netto",type:o})},n[0]=o,n[1]=t):t=n[1],n[2]===Symbol.for("react.memo_cache_sentinel")?(a=[],n[2]=a):a=n[2],(0,s.useEffect)(t,a),null}},25949:()=>{},43518:(e,t,a)=>{"use strict";a.d(t,{MembershipOfferCarousel:()=>y});var r=a(67368),s=a(26880),i=a(19875),n=a(74180),l=a(86278),o=a(71491),c=a(92726),d=a(77097),u=a(11773),m=a(74573),h=a(80600),f=a(93057),p=a(67697),g=a(83518),b=a(11411);function x(e){let t,a,o,p,x,y,_,j,w,v,N,S,k,$,P,E,T,R,I,C=(0,s.c)(62),{offerItem:L,className:U,offerTitle:A,offerIndex:O,offerAppLink:D}=e,{getSpecificTranslation:q}=(0,c.WR)(),H=L.startTime,X=L.endTime;C[0]!==X||C[1]!==H?(t=(0,m.bq)(H,X),C[0]=X,C[1]=H,C[2]=t):t=C[2];let W=t;C[3]!==W||C[4]!==X||C[5]!==H?(a=W?(0,m.RR)(X):(0,m.RR)(H),C[3]=W,C[4]=X,C[5]=H,C[6]=a):a=C[6];let z=a,{appLocale:B,cloudinaryImageUrl:Y}=g.WN,M=z-1,[F,G]=(0,n.useState)("");C[7]!==L.price?(o=(0,h.hq)(L.price.toString()),C[7]=L.price,C[8]=o):o=C[8];let V=o,K="_blank";D?.url&&(K=D.target||""),C[9]!==q?(p=q("leaflet","offer_days_left_first"),C[9]=q,C[10]=p):p=C[10];let J=p;C[11]!==q?(x=q("leaflet","offer_days_left_first_singular"),C[11]=q,C[12]=x):x=C[12];let Q=x;C[13]!==q?(y=q("leaflet","offer_netto_plus_app"),C[13]=q,C[14]=y):y=C[14];let Z=y;C[15]!==q?(_=q("leaflet","offer_netto_normal_price"),C[15]=q,C[16]=_):_=C[16];let ee=_;C[17]!==q?(j=q("leaflet","days_left_second_singular"),C[17]=q,C[18]=j):j=C[18];let et=j;C[19]!==q?(w=q("leaflet","days_left_second_plural"),C[19]=q,C[20]=w):w=C[20];let ea=w;C[21]!==L.currency?(v=function(){switch(L.currency){case"DKK":case"EUR":case"PLN":return L.currency;default:return"DKK"}},C[21]=L.currency,C[22]=v):v=C[22];let er=v;C[23]!==er?(N=er(),C[23]=er,C[24]=N):N=C[24];let es=O+1,ei=L.originalPrice||0;
1C[25]!==L.id||C[26]!==L.title||C[27]!==es||C[28]!==ei?(S=[{id:L.id,name:L.title,listName:"m-offer-list",listIndex:es,type:"membership",priceIncludingVat:ei}],C[25]=L.id,C[26]=L.title,C[27]=es,C[28]=ei,C[29]=S):S=C[29],C[30]!==N||C[31]!==S?(k={contentType:"products",ecommerce:{listName:"m-offer-list",currency:N,items:S}},C[30]=N,C[31]=S,C[32]=k):k=C[32];let en=k;C[33]!==en?($=function(){u.P.track("selectItem",en)},C[33]=en,C[34]=$):$=C[34];let el=$;C[35]!==M||C[36]!==ea||C[37]!==et||C[38]!==J||C[39]!==Q?(P=function(){return M>0?`${J} ${M} ${ea}`:`${Q} ${et}`},C[35]=M,C[36]=ea,C[37]=et,C[38]=J,C[39]=Q,C[40]=P):P=C[40];let eo=P;C[41]===Symbol.for("react.memo_cache_sentinel")?(E=function(e){let{src:t,width:a,quality:r}=e,s=new URL(t),i=s.pathname.split("/").at(-1),n=["f_auto","c_limit","e_trim",`w_${a}`,`q_${r||"auto"}`];return`${s.origin}/image/upload/${n.join(",")}/${i}`},C[41]=E):E=C[41];let ec=E;C[42]!==D?.url?(T=()=>{G((0,l.XB)(D?.url)||"")},C[42]=D?.url,C[43]=T):T=C[43];let ed=D?.url;return C[44]!==ed?(R=[ed],C[44]=ed,C[45]=R):R=C[45],(0,n.useEffect)(T,R),C[46]!==W||C[47]!==U||C[48]!==eo||C[49]!==el||C[50]!==en||C[51]!==F||C[52]!==Z||C[53]!==ee||C[54]!==L.offerImage||C[55]!==L.originalPrice||C[56]!==L.title||C[57]!==L.toregprice||C[58]!==K||C[59]!==A||C[60]!==V?(
1I=W&&L.offerImage?.includes(Y)?(0,r.jsx)(d.A,{event:"viewItemList",itemViewPayload:en,children:(0,r.jsxs)("li",{className:`${U||""} gap-1 bg-white rounded-2xl p-2 flex flex-col justify-end items-center relative`,children:[(0,r.jsx)("div",{className:"bg-primary absolute top-2 w-[calc(100%_-_16px)] left-2 text-center py-1 rounded-full text-paragraph-base-bold",children:(0,r.jsx)("p",{children:Z})}),(0,r.jsx)("div",{className:"flex items-center h-36 pt-3 w-44",children:(0,r.jsx)(i.default,{src:L.offerImage,alt:L.title,width:"176",height:"144",loader:ec,className:"object-contain w-full h-full aspect-[5/4]"})}),(0,r.jsxs)(b.default,{href:F,target:K,className:"link-cover h-44 flex flex-col justify-between items-center w-full",onClick:el,children:[(0,r.jsx)("div",{className:"flex items-end h-16 w-full",children:(0,r.jsx)(f.g,{type:"headline5",className:"text-center text-ellipsis line-clamp-2 w-full leading-7 align-baseline pb-[3px]",wordBreak:!0,children:A})}),"da"===B&&L.originalPrice&&(0,r.jsxs)(f.g,{type:"bodyLight",tag:"p",className:"text-paragraph-sm-light text-grey-500",children:[ee," ",L.toregprice?L.toregprice?.toLocaleString(B):L.originalPrice?.toLocaleString(B)]}),(0,r.jsxs)("p",{className:"text-heading-4xl flex items-start",children:[V.integer," ",(0,r.jsx)("span",{className:`${V.decimal?"text-heading-2xl pt-1":"relative"}`,children:V.decimal||(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{children:"."}),(0,r.jsx)("span",{className:"absolute left-[2px] leading-[34px] tablet:leading-[44px]",children:"-"})]})})]}),(0,r.jsx)("p",{className:"text-paragraph-base-bold",children:eo()})]})]})}):null,C[46]=W,C[47]=U,C[48]=eo,C[49]=el,C[50]=en,C[51]=F,C[52]=Z,C[53]=ee,C[54]=L.offerImage,C[55]=L.originalPrice,C[56]=L.title,C[57]=L.toregprice,C[58]=K,C[59]=A,C[60]=V,C[61]=I):I=C[61],I}function y(e){let t,a,i,n,l=(0,s.c)(11),{carouselName:c,offers:d,offerAppLink:u}=e,m=(0,o.W)();l[0]===Symbol.for("react.memo_cache_sentinel")?(t={grabCursor:!0,slidesPerView:"auto",spaceBetween:4,breakpoints:{1024:{slidesPerGroup:2}},mousewheel:{enabled:!0,forceToAxis:!0}},l[0]=t):t=l[0];let h=t;if(!d.length)return null;if(l[1]===Symbol.for("react.memo_cache_sentinel")?(a={container:"absolute top-0 -right-24 z-10 hidden tablet:flex",buttonContainer:"gap-1",button:"!rounded-full !w-9 !h-9 !min-w-0 !p-0 !bg-white border border-grey-200 hover:!bg-grey-100"},l[1]=a):a=l[1],l[2]!==u||l[3]!==d){let e;l[5]!==u?(e=(e,t)=>(0,r.jsx)(x,{offerTitle:e.title,className:"w-52 !h-[360px]",offerIndex:t,offerItem:e,offerAppLink:u},e.id),l[5]=u,l[6]=e):e=l[6],i=d.map(e),l[2]=u,l[3]=d,l[4]=i}else i=l[4];return l[7]!==m||l[8]!==c||l[9]!==i?(n=(0,r.jsx)(p.dW,{carouselName:c,options:h,carouselAccessibilityLabels:m,showPagination:!1,showNavigation:!0,showThumbs:!1,navigationClassNames:a,children:i}),l[7]=m,l[8]=c,l[9]=i,l[10]=n):n=l[10],n}},45543:(e,t,a)=>{"use strict";a.d(t,{default:()=>m});var r=a(67368),s=a(74180),i=a(46626),n=a(86907),l=a(51285),o=a(75277),c=a(83518),d=a(98601);a(97931);var u=a(11773);function m({content:e,settings:t}){let{appLocale:a,gigyaApiKey:h,gigyaNewsletterScreenID:f}=c.WN,{signupHeadline:p,signupText:g,signupButtonLabel:b,signupButtonLoadingLabel:x,signupSuccessTitle:y,signupSuccessMessage:_,signupErrorMessage:j,signupImage:w}=t,[v,N]=(0,s.useState)(!0),[S,k]=(0,s.useState)(!1),[$,P]=(0,s.useState)(!1),[E,T]=(0,s.useState)(!1),[R,I]=(0,s.useState)(!1),C=(0,s.useRef)(null),L=(0,s.useRef)(null),U=(0,s.useRef)(null),A=(0,s.useRef)(null),O=(0,s.useRef)(null),D=(0,s.useRef)(null);async function q(){let e;"gigya"in window||await H(),e=L.current?.scrollHeight,L.current?.style.setProperty("min-height",`${e}px`),P(!0),await (0,d.oF)(D.current),await (0,d.Cx)(A.current),L.current?.style.setProperty("min-height","auto")}function H(){return new Promise(e=>{if("gigya"in window)X(),e();else{let t=new URL("https://cdns.gigya.com/js/gigya.js");t.searchParams.append("apikey",h),t.searchParams.append("lang",a),(0,l.handleClientScriptLoad)({src:t.href,defer:!0,strategy:"afterInteractive",onLoad:()=>{X(),e()}})}})}function X(){S||window.gigya.accounts.showScreenSet({screenSet:f,containerID:"newsletterSignup",lang:a,regSource:window.location.hostname,onError:()=>{I(!0)},onAfterScreenLoad:()=>{k(!0),N(!1)},onAfterSubmit:async e=>{e?.response?.errorCode===0&&(await (0,d.Ls)(U.current),await (0,d.qF)(O.current),u.P.track("signUpNewsletter",{area:"FRONTPAGE"}),T(!0),P(!1))}})}return(0,s.useEffect)(()=>{H()},[]),(0,r.jsxs)("section",{ref:C,className:"newsletter flex flex-col tablet:flex-row overflow-hidden min-h-[224px]",children:[(0,r.jsx)("div",{className:` 2 relative 3 flex 4 items-center 5 justify-center 6 basis-full 7 max-h-full 8 tablet:basis-1/2 9 bg-surface-primary 10 rounded-t-2xl 11 tablet:rounded-tr-none 12 tablet:rounded-l-2xl 13 transition-all 14 duration-1000 15 overflow-auto 16 `,children:w?.url&&(0,r.jsx)(o.default,{className:"flex-shrink-0 w-3/4 max-w-xs tablet:max-w-3/4 object-contain transition-all duration-1000 relative z-10",src:w?.url,width:512,sizeMap:{360:"90vw",750:"90vw",768:"45vw",828:"45vw",1024:"45vw"},alt:w?.media?.name,aspectRatio:"5-4",cropMode:"pad"})}),(0,r.jsx)("div",{ref:L,className:`p-4 w-full tablet:w-1/2 tablet:p-6 bg-surface-white relative flex items-center justify-center flex-col rounded-b-2xl tablet:rounded-b-none tablet:rounded-r-2xl ${R?"justify-center":""}`,children:R?(0,r.jsx)(i.gL,{type:"headline4",className:"mb-3 text-center",children:j}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{ref:U,className:` 17 max-w-sm 18 ${E?"motion-reduce:hidden":"motion-reduce:block"} 19 `,children:[(0,r.jsx)(i.gL,{type:"headline4",className:"mb-3 text-center",children:p}),(0,r.jsxs)("div",{ref:D,className:` 20 text-center 21 ${$?"motion-reduce:hidden":"motion-reduce:block"} 22 `,children:[(0,r.jsx)("p",{className:"text-paragraph-base-light mb-3",children:g}),(0,r.jsx)(i.lD,{disabled:v,loadingStyle:"spinner",className:"!w-full",onClick:q,children:v?x:b})]}),(0,r.jsx)("div",{ref:A,"aria-hidden":!$,className:` 23 relative 24 motion-safe:h-0 25 motion-safe:overflow-hidden 26 ${$?"motion-reduce:block motion-safe:visible":"motion-reduce:hidden motion-safe:invisible "} 27 `,children:(0,r.jsx)("div",{id:"newsletterSignup"})})]}),(0,r.jsxs)("div",{"aria-hidden":!E,ref:O,className:E?"block my-auto":"my-auto h-0 overflow-hidden hidden",children:[y&&(0,r.jsxs)(i.gL,{type:"headline4",className:"flex items-center gap-4 mb-3",children:[(0,r.jsx)("span",{className:`bg-primary-200 rounded-full p-[3px] ${E?"motion-safe:transition-transform motion-safe:duration-500 motion-safe:scale-100 motion-safe:ease-in-out":"motion-safe:scale-50"}`,children:(0,r.jsx)(n.D,{className:"stroke-2"})}),y]}),_&&(0,r.jsx)(i.G3,{children:_})]})]})})]})}},49201:(e,t,a)=>{"use strict";a.d(t,{default:()=>S});var r=a(67368),s=a(26880),i=a(25720),n=a(74180),l=a(4645),o=a(72266),c=a(37480),d=a(17906),u=a(56145),m=a(81494);async function h(e,t){let a=e.statusText;
27try{let r=await e.json();throw a=r.error||r.message||e.statusText,new t(e.statusText,e.status,a)}catch(a){if(a instanceof t)throw a;throw new t(e.statusText,e.status)}}function f(e){return e.endsWith("/")?e.slice(0,-1):e}let p={requestHandler:fetch,baseUrl:"https://api.sallinggroup.com",localeISO:"da-DK",apiKey:"",headers:{}};class g extends Error{constructor(e,t,a){super(e),this.status=t,this.statusCode=t,this.error=a||e,this.name="ErrorWithStatusCode"}}class b{constructor(e){const t={...p,...e};if(!t.apiKey)throw Error("SallingGroupAPI: Missing API key");this._config=t,this._requestHandler=t.requestHandler,this._headers={Authorization:`Bearer ${t.apiKey}`,"Content-Type":"application/json",...t.headers}}async handleErrorResponse(e){return h(e,g)}async getStore({path:e,query:t},a=this._requestHandler){let r=new URL(`${this._config.baseUrl}/v2/stores/${e.id}`);if(t)for(let[e,a]of Object.entries(t))a&&r.searchParams.set(e,String(a));let s=await a(r.toString().toString(),{headers:this._headers});if(!s.ok)throw Error(s.statusText);return s.json()}async getStores({query:e},t=this._requestHandler){let a=new URL(`${this._config.baseUrl}/v2/stores`);if(e)for(let[t,r]of Object.entries(e))r&&a.searchParams.set(t,String(r));let r=await t(a.toString(),{headers:this._headers});if(!r.ok)throw Error(r.statusText);return r.json()}async getOffers(e,t=this._requestHandler){let a=new URL(`${this._config.baseUrl}/v1/leaflet-offers`);if(e)for(let[t,r]of Object.entries(e))r&&a.searchParams.set(t,Array.isArray(r)?r.join(","):String(r));let r=await t(a.toString(),{headers:this._headers});if(!r.ok)throw Error(r.statusText);return r.json()}async getStoreSchedules({path:e},t=this._requestHandler){let a=new URL(`${this._config.baseUrl}/v2/stores/${e.id}/schedules`),r=await t(a.toString(),{method:"GET",headers:this._headers});if(!r.ok)throw Error(`Error fetching store schedules: ${r.status}`);return r.json()}async getRecommendationsAlternativeProducts(e,t=this._requestHandler){let{path:a,query:r}=e,s=new URL(`${this._config.baseUrl}/v2/recommendations/alternative-products/${a.shop}/${a.sku}`);if(r)for(let[e,t]of Object.entries(r))t&&s.searchParams.set(e,Array.isArray(t)?t.join(","):String(t));let i=await t(s.toString(),{headers:this._headers});if(!i.ok)throw Error(`Error fetching alternative products: ${i.status}`);return i.json()}async getStoreHolidays({storeId:e}
27,t=this._requestHandler){let a=await this.getStoreSchedules({path:{id:e}},t),r=a.store?.deviations||[];return r.sort((e,t)=>new Date(e.validFrom).getTime()-new Date(t.validFrom).getTime()),r}static getUniqueOffers(e){let t=e.map(e=>({...e.offers?.[0]})),a=[...new Set(t.map(e=>e.id))],r=[];return a.forEach(e=>{let a=t.find(t=>t.id===e);a&&r.push(a)}),r.sort((e,t)=>e.ranking-t.ranking)}async genAIChatCompletion({signal:e,body:t},a=this._requestHandler){let r=new URL(`${this._config.baseUrl}/v1/gen-ai/chat/completions`),s=await a(r.href,{method:"POST",headers:this._headers,signal:e,body:JSON.stringify(t)});if(!s.ok)throw Error(`Error getting a chat response: ${s.status}`);return s.json()}async chat({signal:e,body:t,idToken:a},r=this._requestHandler){let s=new URL(`${this._config.baseUrl}/v1/sallie/chat`),i=await r(s.href,{method:"POST",headers:{...this._headers,"SG-APIM-IDENTIFIER-ID":this._config.identifierId||"",Authorization:`Bearer ${a}`},signal:e,body:JSON.stringify(t)});if(!i.ok)throw Error(`Error getting a chat response: ${i.status}`);return i.json()}async getSession({idToken:e},t=this._requestHandler){let a=new URL(`${this._config.baseUrl}/v1/sallie/session`),r=await t(a.href,{method:"GET",headers:{...this._headers,"SG-APIM-IDENTIFIER-ID":this._config.identifierId||"",Authorization:`Bearer ${e}`}});if(!r.ok)throw Error(`Error getting a session: ${r.status}`);return r.json()}async getUploadedFiles({idToken:e},t=this._requestHandler){let a=new URL(`${this._config.baseUrl}/v1/sallie/knowledgebase`),r=await t(a.href,{method:"GET",headers:{...this._headers,"SG-APIM-IDENTIFIER-ID":this._config.identifierId||"",Authorization:`Bearer ${e}`}});if(!r.ok)throw Error(`Error getting a session: ${r.status}`);return r.json()}async uploadFile({file:e,idToken:t},a=this._requestHandler){let r=new URL(`${this._config.baseUrl}/v1/sallie/knowledgebase`),s=await a(r.href,{method:"POST",headers:{"SG-APIM-IDENTIFIER-ID":this._config.identifierId||"",Authorization:`Bearer ${t}`},body:e});if(!s.ok)throw new g(`Request failed with status ${s.status}`,s.status);return s.json()}async removeFile({fileId:e,idToken:t},a=this._requestHandler){let r=new URL(`${this._config.baseUrl}/v1/sallie/knowledgebase/${e}`),s=await a(r.href,{method:"DELETE",headers:{"SG-APIM-IDENTIFIER-ID":this._config.identifierId||"",Authorization:`Bearer ${t}`}});if(!s.ok)throw Error(`Error getting a session: ${s.status}`);return s.json()}async getJobCategoryTranslations(e,t=this._requestHandler){let a=new URL(`${this._config.baseUrl}/v1/jobs/categories`);if(e)for(let[t,r]of Object.entries(e))r&&a.searchParams.set(t,Array.isArray(r)?r.join(","):String(r));let r=await t(a.toString(),{headers:this._headers});if(!r.ok)throw Error(r.statusText);return r.json()}async getJobLevelsTranslations(e,t=this._requestHandler){let a=new URL(`${this._config.baseUrl}/v1/jobs/levels`);if(e)for(let[t,r]of Object.entries(e))r&&a.searchParams.set(t,Array.isArray(r)?r.join(","):String(r));let r=await t(a.toString(),{headers:this._headers});if(!r.ok)throw Error(r.statusText);return r.json()}async getJobTypesTranslations(e,t=this._requestHandler){let a=new URL(`${this._config.baseUrl}/v1/jobs/types`);if(e)for(let[t,r]of Object.entries(e))r&&a.searchParams.set(t,Array.isArray(r)?r.join(","):String(r));let r=await t(a.toString(),{headers:this._headers});if(!r.ok)throw Error(r.statusText);return r.json()}async getJobRegionTranslations(e,t=this._requestHandler){let a=new URL(`${this._config.baseUrl}/v1/jobs/categories`);if(e)for(let[t,r]of Object.entries(e))r&&a.searchParams.set(t,Array.isArray(r)?r.join(","):String(r));let r=await t(a.toString(),{headers:this._headers});if(!r.ok)throw Error(r.statusText);return r.json()}async getJobTranslations(e){let[t,a,r,s]=await Promise.all([this.getJobCategoryTranslations(e),this.getJobLevelsTranslations(e),this.getJobTypesTranslations(e),this.getJobRegionTranslations(e)]);return{categories:t,levels:a,types:r,regions:s}}async getMemberOffers({isActive:e,isRedeemable:t,validFrom:a,validUntil:r,validAt:s,type:i,tacticType:n,tactic:l,trackingId:o,hasExpired:c,offerTacticType:d,offerIds:u,embed:m,pageSize:h,offerTactics:f,excludeOfferTactics:p,hasExposedArticles:g},b=this._requestHandler){let x=new URL(`${this._config.baseUrl}/members/${o}/offers`);c&&x.searchParams.append("isExpired",String(c)),e&&x.searchParams.append("isActive",String(e)),t&&x.searchParams.append("isRedeemable",String(t)),a&&x.searchParams.append("validFrom",String(a)),r&&x.searchParams.append("validUntil",String(r)),s&&x.searchParams.append("validAt",String(s)),i&&x.searchParams.append("type",String(i)),n&&x.searchParams.append("tacticType",String(n)),l&&x.searchParams.append("tactic",String(l)),d&&x.searchParams.append("offerTacticType",String(d)),u&&u.length>
270&&u.forEach(e=>{x.searchParams.append("offerId",e)}),f&&f.length>0&&f.forEach(e=>{x.searchParams.append("offerTactic",e)}),p&&p.length>0&&p.forEach(e=>{x.searchParams.append("excludeOfferTactic",e)}),m&&x.searchParams.append("embed",String(m)),h&&x.searchParams.append("pageSize",h.toString()),void 0!==g&&x.searchParams.append("hasExposedArticles",String(g));let y=x.toString(),_=await b(y,{headers:this._headers});if(!_.ok)throw Error(_.statusText);return _.json()}async getPointOffers({pointsMin:e,pointsMax:t,offersIds:a,validAt:r},s=this._requestHandler){let i=new URL(`${this._config.baseUrl}/point-offers`);e&&i.searchParams.append("pointsMin",String(e)),t&&i.searchParams.append("pointsMax",String(t)),a&&i.searchParams.append("offersIds",String(a)),r&&i.searchParams.append("validAt",String(r));let n=await s(i.toString(),{headers:this._headers});if(!n.ok)throw Error(n.statusText);return n.json()}async getPunchOffers({trackingId:e,isFullyPunched:t,validAt:a,excludeComebackVoucher:r,offerValidAt:s},i=this._requestHandler){let n=new URL(`${this._config.baseUrl}/members/${e}/punch-cards`);t&&n.searchParams.append("isFullyPunched",String(t)),a&&n.searchParams.append("validAt",a),r&&(n.searchParams.append("tactic","SPECIFIC_PRODUCTS"),n.searchParams.append("tactic","PRODUCT_CATEGORY"),n.searchParams.append("tactic","PURCHASE_TOTAL")),s&&n.searchParams.append("offerValidAt",s);let l=await i(n.toString(),{headers:this._headers});if(!l.ok)throw Error(l.statusText);return l.json()}async memberOffersActivation({offerId:e,trackingId:t,body:a},r=this._requestHandler){let s=f(new URL(`${this._config.baseUrl}/members/${t}/offers/${e}/activation`).toString()),i=await r(s.toString(),{headers:this._headers,method:"PATCH",body:JSON.stringify(a)});if(!i.ok)throw Error(i.statusText);return i.json()}async pointOffersRedeem({pointOfferId:e,trackingId:t},a=this._requestHandler){let r=f(new URL(`${this._config.baseUrl}/members/${t}/point-offers/${e}/redeem`).toString()),s=await a(r.toString(),{headers:this._headers,method:"POST"});if(!s.ok)throw Error(s.statusText);return s.json()}async memberOffersRedemption({trackingId:e,body:t},a=this._requestHandler){let r=f(new URL(`${this._config.baseUrl}/members/${e}/offers/redemption`).toString()),s=await a(r.toString(),{headers:this._headers,method:"PATCH",body:JSON.stringify(t)});if(!s.ok)throw Error(s.statusText);return s.json()}async createMember({body:e},t=this._requestHandler){let a=f(new URL(`${this._config.baseUrl}/members`).toString()),r=await t(a.toString(),{headers:this._headers,method:"POST",body:JSON.stringify(e)});if(!r.ok)throw Error(r.statusText);return r.json()}async createMemberWithErrorHandling({body:e},t=this._requestHandler){let a=f(new URL(`${this._config.baseUrl}/members`).toString()),r=await t(a.toString(),{headers:this._headers,method:"POST",body:JSON.stringify(e)});return r.ok||await this.handleErrorResponse(r),r.json()}async useWalletOnPurchase({trackingId:e,body:t},a=this._requestHandler){let r=f(new URL(`${this._config.baseUrl}/members/${e}/use-wallet-on-purchase`).toString()),s=await a(r.toString(),{headers:this._headers,method:"PATCH",body:JSON.stringify(t)});if(!s.ok)throw Error(s.statusText);return s.json()}async useWalletOnNextPurchase({trackingId:e,body:t},a=this._requestHandler){let r=f(new URL(`${this._config.baseUrl}/members/${e}/use-wallet-on-next-purchase`).toString()),s=await a(r.toString(),{headers:this._headers,method:"PATCH",body:JSON.stringify(t)});if(!s.ok)throw Error(s.statusText);return s.json()}async lockMember({trackingId:e,body:t},a=this._requestHandler){let r=f(new URL(`${this._config.baseUrl}/members/${e}/lock`).toString()),s=await a(r.toString(),{headers:this._headers,method:"PATCH",body:JSON.stringify(t)});if(!s.ok)throw Error(s.statusText);return s.json()}async getMemberInfo({trackingId:e},t=this._requestHandler){let a=f(new URL(`${this._config.baseUrl}/members/${e}`).toString()),r=await t(a.toString(),{headers:this._headers,method:"GET"});return r.ok||await this.handleErrorResponse(r),r.json()}async getMemberOffer({trackingId:e,offerId:t,embed:a},r=this._requestHandler){let s=new URL(`${this._config.baseUrl}/members/${e}/offers/${t}`);a&&s.searchParams.append("embed",String(a));let i=f(s.toString()),n=await r(i.toString(),{headers:this._headers,method:"GET"});if(!n.ok)throw Error(n.statusText);return n.json()}async getOffer({offerId:e,embed:t},a=this._requestHandler){let r=new URL(`${this._config.baseUrl}/offers/${e}`);t&&r.searchParams.append("embed",String(t));let s=f(r.toString()),i=await a(s.toString(),{headers:this._headers,method:"GET"});if(!i.ok)throw Error(i.statusText);return i.json()}async getWalletInfo({trackingId:e},t=this._requestHandler){let a=f(new URL(`${this._config.baseUrl}/wallets/${e}`).toString()),r=await t(a.toString(),{headers:this._headers,method:"GET"});if(!r.ok)throw Error(r.statusText);return r.json()}async getMembersWallet({trackingId:e},t=this._requestHandler){let a=f(new URL(`${this._config.baseUrl}/members/${e}/wallets`).toString()),r=await t(a.toString(),{headers:this._headers,method:"GET"});if(!r.ok)throw Error(r.statusText);return r.json()}async getMemberBanners({trackingId:e,isCurrentlyValid:t,isActive:a,isTopBanner:r},s=this._requestHandler){let i=new URL(`${this._config.baseUrl}/members/${e}/banners`);t&&i.searchParams.append("isCurrentlyValid",String(t)),a&&i.searchParams.append("isActive",String(a)),(!0===r||!1===r)&&i.searchParams.append("isTopBanner",String(r));let n=await s(i.toString(),{headers:this._headers});if(!n.ok)throw Error(n.statusText);return n.json()}async sendActivityToBigQuery({sapCdcId:e,body:t}
27,a=this._requestHandler){let r=f(new URL(`${this._config.baseUrl}/members/${e}/activity`).toString()),s=await a(r.toString(),{headers:this._headers,method:"POST",body:JSON.stringify(t)});if(!s.ok)throw Error(s.statusText);return s.json()}async getAntiFoodWasteId({id:e},t=this._requestHandler){let a=new URL(`${this._config.baseUrl}/v1/food-waste/${e}`),r=await t(a.toString().toString(),{headers:this._headers,method:"GET"});if(!r.ok)throw Error(r.statusText);return r.json()}async addCustomerCards({sapCdcId:e,cardId:t},a=this._requestHandler){let r=f(new URL(`${this._config.baseUrl}/customers/${e}/cards/${t}/enrollPSP`).toString()),s=await a(r.toString(),{headers:this._headers,method:"POST"});if(!s.ok)throw Error(s.statusText);return s.json()}async getCustomersCards({sapCdcId:e},t=this._requestHandler){let a=f(new URL(`${this._config.baseUrl}/customers/${e}/cards`).toString()),r=await t(a.toString(),{headers:this._headers,method:"GET"});return r.ok||await this.handleErrorResponse(r),r.json()}async deleteCustomersCards({sapCdcId:e,cardId:t},a=this._requestHandler){let r=f(new URL(`${this._config.baseUrl}/customers/${e}/cards/${t}`).toString()),s=await a(r.toString(),{headers:this._headers,method:"DELETE"});if(!s.ok)throw Error(s.statusText)}async deleteCustomersCardsSuccessNoResponse({sapCdcId:e,cardId:t},a=this._requestHandler){let r=f(new URL(`${this._config.baseUrl}/customers/${e}/cards/${t}`).toString()),s=await a(r.toString(),{headers:this._headers,method:"DELETE"});if(!s.ok)throw Error(s.statusText)}async getSecureFrames({sapCdcId:e,body:t},a=this._requestHandler){let r=f(new URL(`${this._config.baseUrl}/customers/${e}/secure-frames`).toString()),s=await a(r.toString(),{headers:this._headers,method:"POST",body:JSON.stringify(t)});if(!s.ok)throw Error(s.statusText);return s.json()}async makeRefund({trackingId:e,body:t},a=this._requestHandler){let r=f(new URL(`${this._config.baseUrl}/members/${e}/refunds`).toString()),s=await a(r.toString(),{headers:this._headers,method:"POST",body:JSON.stringify(t)});if(!s.ok)throw Error(s.statusText);return s.json()}async uploadImage({trackingId:e,form:t,idToken:a,identifierId:r},s=this._requestHandler){let i=new URL(`${this._config.baseUrl}/members/${e}/refunds/images`),n=await s(i.toString(),{method:"POST",headers:{"SG-APIM-IDENTIFIER-ID":r||"","SG-APIM-ROUTER":"B",Authorization:`Bearer ${a}`},body:t});if(!n.ok)throw Error(n.statusText);return n.json()}async getReceipts({memberId:e,offset:t,limit:a},r=this._requestHandler){let s=f(new URL(`${this._config.baseUrl}/loyalty/foetex/members/${e}/app-receipts?page=${t}&pageSize=${a}`).toString()),i=await r(s.toString(),{headers:this._headers,method:"GET"});return i.ok||await this.handleErrorResponse(i),i.json()}async getNettoReceipts({memberId:e,offset:t,limit:a,brand:r},s=this._requestHandler){let i=f(new URL(`${this._config.baseUrl}/loyalty/${r}/members/${e}/app-receipts?page=${t}&pageSize=${a}`).toString()),n=await s(i.toString(),{headers:this._headers,method:"GET"});return n.ok||await this.handleErrorResponse(n),n.json()}async getClubSallingReceipts({memberId:e,offset:t,limit:a,brand:r},s=this._requestHandler){let i=f(new URL(`${this._config.baseUrl}/loyalty/${r}/members/${e}/app-receipts?page=${t}&pageSize=${a}`).toString()),n=await s(i.toString(),{headers:this._headers,method:"GET"});return n.ok||await this.handleErrorResponse(n),n.json()}async getReceiptDetails({memberId:e,receiptId:t},a=this._requestHandler){let r=f(new URL(`${this._config.baseUrl}/loyalty/foetex/members/${e}/receipts/${t}`).toString()),s=await a(r.toString(),{headers:this._headers,method:"GET"});if(!s.ok)throw Error(s.statusText);return s.json()}async getNettoReceiptDetails({memberId:e,receiptId:t,brand:a},r=this._requestHandler){let s=f(new URL(`${this._config.baseUrl}/loyalty/${a}/members/${e}/receipts/${t}`).toString()),i=await r(s.toString(),{headers:this._headers,method:"GET"});if(!i.ok)throw Error(i.statusText);return i.json()}async getClubSallingReceiptDetails({memberId:e,receiptId:t,brand:a},r=this._requestHandler){let s=f(new URL(`${this._config.baseUrl}/loyalty/${a}/members/${e}/receipts/${t}`).toString()),i=await r(s.toString(),{headers:this._headers,method:"GET"});if(!i.ok)throw Error(i.statusText);return i.json()}async getEnrichedArticles({id:e,storeId:t},a=this._requestHandler){let r=new URL(`${this._config.baseUrl}/viking/dk/enriched-articles/rpc`),s=JSON.stringify({articleIds:[Number(e)],storeId:Number(t)}),i=await a(r.toString(),{headers:this._headers,method:"POST",body:s});if(!i.ok)throw Error(i.statusText);return i.json()}async getShoppingLists({trackingId:e,isActive:t},a=this._requestHandler){let r=new URL(`${this._config.baseUrl}/members/${e}/shopping-lists`);r.searchParams.append("isActive",String(t));let s=await a(r.toString(),{headers:this._headers,method:"GET"});return s.ok||await this.handleErrorResponse(s),s.json()}async createShoppingList({trackingId:e,name:t}
27,a=this._requestHandler){let r=f(new URL(`${this._config.baseUrl}/members/${e}/shopping-lists`).toString()),s=await a(r.toString(),{headers:this._headers,method:"POST",body:JSON.stringify({name:t})});if(!s.ok)throw Error(s.statusText);return s.json()}async getFirestoreToken({trackingId:e},t=this._requestHandler){let a=f(new URL(`${this._config.baseUrl}/members/${e}/auths/firestore-token`).toString()),r=await t(a.toString(),{headers:this._headers,method:"POST"});return r.ok||await this.handleErrorResponse(r),r.json()}async shareShoppingList({trackingId:e,listId:t,body:a},r=this._requestHandler){let s=new URL(`${this._config.baseUrl}/members/${e}/shopping-lists/${t}/share`),i=await r(s.toString(),{headers:this._headers,method:"POST",body:JSON.stringify(a)});if(!i.ok)throw Error(i.statusText);return i.json()}async unshareShoppingList({trackingId:e,listId:t,body:a},r=this._requestHandler){let s=new URL(`${this._config.baseUrl}/members/${e}/shopping-lists/${t}/unshare`),i=await r(s.toString(),{headers:this._headers,method:"POST",body:JSON.stringify(a)});if(!i.ok)throw Error(i.statusText);return i.json()}async joinShoppingList({trackingId:e,body:t},a=this._requestHandler){let r=new URL(`${this._config.baseUrl}/members/${e}/shopping-lists/join`),s=await a(r.toString(),{headers:this._headers,method:"POST",body:JSON.stringify(t)});if(!s.ok)throw Error(s.status.toString());return s.json()}async leaveShoppingList({trackingId:e,listId:t},a=this._requestHandler){let r=new URL(`${this._config.baseUrl}/members/${e}/shopping-lists/${t}/leave`),s=await a(r.toString(),{headers:this._headers,method:"POST"});if(!s.ok)throw Error(s.statusText);return s.json()}async getClaims({path:e},t=this._requestHandler){let a=new URL(`${this._config.baseUrl}/short-io/claims`);a.searchParams.append("path",e);let r=await t(a.toString(),{headers:this._headers,method:"GET"});if(!r.ok)throw Error(r.statusText);return r.json()}async getOrderHistory({userId:e},t=this._requestHandler){let a=new URL(`${this._config.baseUrl}/v1/mock-servers/104512f1-7b79-40fa-9872-90b21065ff4b/users/${e}/orders`),r=await t(a.toString(),{headers:this._headers});return r.ok||await this.handleErrorResponse(r),r.json()}}var x=a(3070),y=a(83518);let _=new b({apiKey:y.WN.sallingGroupApiKey,baseUrl:y.WN.sallingGroupApiUrl,localeISO:y.WN.appLocaleIso,requestHandler:(0,x.$)({revalidate:21600})});function j({stores:e,activeStoreId:t,activeStore:a,setActiveStoreId:s,settings:i,searchParams:l}){let o=(0,n.useMemo)(()=>void 0!==e.find(e=>e.id===t),[t,e]),[h,f]=(0,n.useState)([]),[p,g]=(0,n.useState)(!1),[b,x]=(0,n.useState)(!1),y=(0,n.useRef)({});function w(){s(void 0),f([]),g(!1)}return(0,n.useEffect)(()=>{(async()=>{if(t)try{x(!0);let a=await _.getStoreHolidays({storeId:t});x(!1),f(a);let r=e.some(e=>e.id===t&&e.hours?.some(e=>e.date===new Date().toISOString().split("T")[0]&&e.closed));g(r)}catch(e){console.error("Error fetching holidays:",e)}finally{x(!1)}})()},[t,e]),(0,n.useEffect)(()=>{t&&y.current[t]&&setTimeout(()=>{y.current[t].scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})},200)},[t]),(0,r.jsxs)("ul",{children:[a&&!o&&(0,r.jsx)("li",{ref:e=>{e&&a.id&&(y.current[a.id]=e)},children:(0,r.jsx)(c.Z,{as:"div",isOpen:!0,onOpen:function(){s(t===a?.id?null:t)},onClose:function(){s(void 0)},header:(0,r.jsx)(u.A,{item:a,isDetail:!1}),children:(0,r.jsx)(m.A,{isDetail:!1,data:a,deviations:h,closedToday:p,settings:i,isOpen:!0,searchParams:l})})}),e?.length?e.map(e=>(0,r.jsx)("li",{ref:t=>{t&&e.id&&(y.current[e.id]=t)},children:(0,r.jsx)(c.Z,{as:"div",isOpen:t===e.id,onOpen:()=>{s(e.id)},onClose:w,header:(0,r.jsx)(u.A,{item:e,isDetail:!1}),children:b?(0,r.jsx)("div",{className:"text-center",children:(0,r.jsx)(d.U,{className:"h-6 w-6"})}):(0,r.jsx)(m.A,{isDetail:!1,data:e,deviations:h,closedToday:p,isOpen:t===e.id,settings:i,searchParams:l})})},e.id)):null]})}var w=a(66253),v=a(40232);a(44968);var N=a(92726);function S(e){let t,a,c,d,u,m,h,f,p,g,b,x,S,P,E,T,R,I,C,L,U=(0,s.c)(65),{content:A,initialStores:O,settings:D,searchParams:q}=e,H=(0,i.useRouter)(),X=(0,i.usePathname)(),W=q?.holiday==="true",{headline:z,textArea:B,bankHolidayToggle:Y}=A,{getSpecificTranslation:M}
27=(0,N.ip)(),[F,G]=function(){let[e,t]=(0,n.useState)([]);return[e,(0,n.useCallback)(async(e,a,r)=>{let{appCountry:s}=y.WN;try{let i=await _.getStores({query:{brand:"netto",holidayOpen:r,country:s,geo:e&&a?`${e},${a}`:"0,0",radius:100,per_page:11}});t(i)}catch(e){console.error("Error fetching store data:",e)}},[])]}(),[V,K]=(0,n.useState)(W),[J,Q]=(0,n.useState)(0),[Z,ee]=(0,n.useState)(null);U[0]===Symbol.for("react.memo_cache_sentinel")?(t=new URLSearchParams,U[0]=t):t=U[0];let et=t;U[1]!==M?(a=M("store_finder","bank_holiday_toggle"),U[1]=M,U[2]=a):a=U[2];let ea=a;U[3]!==V||U[4]!==q||U[5]!==G?(c=()=>{let{y:e,x:t}=q;e&&t&&G(Number(e),Number(t),V),Q(window.innerWidth-document.body.clientWidth)},U[3]=V,U[4]=q,U[5]=G,U[6]=c):c=U[6],U[7]===Symbol.for("react.memo_cache_sentinel")?(d=[],U[7]=d):d=U[7],(0,n.useEffect)(c,d),U[8]!==F?(u=F.map($),U[8]=F,U[9]=u):u=U[9];let er=u;U[10]!==O||U[11]!==er?(m=[...O,...er].filter(k),U[10]=O,U[11]=er,U[12]=m):m=U[12];let es=m;e:{let e;if(!Z){h=null;break e}U[13]!==Z||U[14]!==es?(e=es.find(e=>e.id===Z),U[13]=Z,U[14]=es,U[15]=e):e=U[15],h=e}let ei=h;U[16]!==X||U[17]!==H||U[18]!==G?(f=function(e,t,a){let r=new URLSearchParams(window.location.search);r.has("y")&&r.has("x")&&(et.set("y",r.get("y")),et.set("x",r.get("x"))),a&&et.set("holiday","true"),e&&t&&(et.set("y",String(e)),et.set("x",String(t))),H.push(`${X}${et?`?${String(et)}`:""}`),G(e,t,a)},U[16]=X,U[17]=H,U[18]=G,U[19]=f):f=U[19];let en=f;U[20]!==Z||U[21]!==er?(p=function(e){if(null!==e&&null!==Z&&e!==Z&&er.find(t=>t.id===e)&&!er.find(e=>e.id===Z)){ee(null),setTimeout(()=>{ee(e)},100);return}ee(e)},U[20]=Z,U[21]=er,U[22]=p):p=U[22];let el=p;U[23]!==en||U[24]!==V?(g=function(){let e=!V;K(e);let t=new URLSearchParams(window.location.search);if(t.has("y")&&t.has("x")){let a=t.get("y"),r=t.get("x");return en(Number(a),Number(r),e)}return en(void 0,void 0,e)},U[23]=en,U[24]=V,U[25]=g):g=U[25];let eo=g,ec=`${J}px`;U[26]!==ec?(b={"--scrollbar-width":ec},U[26]=ec,U[27]=b):b=U[27];let ed=b;return U[28]!==Y||U[29]!==en||U[30]!==z||U[31]!==q||U[32]!==B?(x=(z||B)&&(0,r.jsxs)("section",{className:`bg-primary py-6 flex flex-col gap-2 ${Y?"pb-0":""}`,children:[z&&(0,r.jsx)(o.g,{type:"headline3",tag:"h1",children:z}),B&&(0,r.jsx)(o.g,{type:"bodyLight",children:B}),(0,r.jsx)(w.A,{onSuggestionSelection:en,invertIcon:!1,searchParams:q})]}),U[28]=Y,U[29]=en,U[30]=z,U[31]=q,U[32]=B,U[33]=x):x=U[33],U[34]!==ea||U[35]!==Y||U[36]!==V||U[37]!==eo?(S=Y&&(0,r.jsxs)("div",{className:"flex justify-between items-center py-2",children:[(0,r.jsx)(o.g,{type:"bodyLight",tag:"p",children:ea}),(0,r.jsx)(l.D,{variant:"black",labelPosition:"left",checked:V,onChange:eo})]}),U[34]=ea,U[35]=Y,U[36]=V,U[37]=eo,U[38]=S):S=U[38],U[39]!==x||U[40]!==S?(P=(0,r.jsxs)("section",{className:"bg-surface-primary px-4",children:[x,S]}),U[39]=x,U[40]=S,U[41]=P):P=U[41],U[42]!==O||U[43]!==er?(E=er.length?er:O.slice(0,12),U[42]=O,U[43]=er,U[44]=E):E=U[44],U[45]!==ei||U[46]!==Z||U[47]!==q||U[48]!==D||U[49]!==E?(T=(0,r.jsx)("section",{className:"bg-surface-white\n overflow-y-auto\n relative\n z-10\n store-finder-scrollbar",children:(0,r.jsx)(j,{stores:E,settings:D,activeStore:ei,activeStoreId:Z,setActiveStoreId:ee,searchParams:q})}),U[45]=ei,U[46]=Z,U[47]=q,U[48]=D,U[49]=E,U[50]=T):T=U[50],U[51]!==P||U[52]!==T?(R=(0,r.jsxs)("aside",{className:"w-full tablet:w-[26rem] flex flex-col",children:[P,T]}),U[51]=P,U[52]=T,U[53]=R):R=U[53],U[54]!==Z||U[55]!==er||U[56]!==el||U[57]!==es?(I=(0,r.jsx)("section",{className:"max-h-[var(--store-finder-content-h)] min-h-96 flex flex-col flex-grow",children:(0,r.jsx)(v.A,{locations:es,proximityLocations:er,activeMarkerId:Z,setActiveLocation:el})}),U[54]=Z,U[55]=er,U[56]=el,U[57]=es,U[58]=I):I=U[58],U[59]!==R||U[60]!==I?(C=(0,r.jsxs)("div",{className:"h-[var(--store-finder-content-h)] flex flex-col-reverse tablet:flex-row",children:[R,I]}),U[59]=R,U[60]=I,U[61]=C):C=U[61],U[62]!==ed||U[63]!==C?(L=(0,r.jsx)("section",{className:"store-finder \n -my-8 \n break-container \n tablet:-my-10 \n desktop:-my-16 \n laptop:mx-[calc((50%_-_50vw)_+_(var(--scrollbar-width)_/_2))] \n tablet:max-w-[calc(100vw_-_(var(--scrollbar-width)_/_2))]",style:ed,children:C}),U[62]=ed,U[63]=C,U[64]=L):L=U[64],L}function k(e,t,a){return 1===a.filter(t=>t.id===e.id).length||"proximity"in e}function $(e){return{...e,proximity:!0}}},51210:()=>{},61611:(e,t,a)=>{"use strict";a.d(t,{default:()=>c});var r=a(67368),s=a(26880),i=a(74180),n=a(42718),l=a(86278),o=a(11411);function c(e){let t,a,c,d=(0,s.c)(5),{children:u}=e,[m,h]=(0,i.useState)("");return d[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{h((0,l.XB)()||"")},a=[],d[0]=t,d[1]=a):(t=d[0],a=d[1]),(0,i.useEffect)(t,a),d[2]!==u||d[3]!==m?(c=(0,r.jsx)(n.l,{asChild:!0,variant:"primary",children:(0,r.jsx)(o.default,{href:m,target:"_blank",children:u})}),d[2]=u,d[3]=m,d[4]=c):c=d[4],c}},64708:(e,t,a)=>{"use strict";a.d(t,{default:()=>o});var r=a(67368),s=a(26880),i=a(19743),n=a(25720),l=a(74180);function o(e){let t,a,o,c,d,u,m=(0,s.c)(16),{checklistItem:h,checklistTitle:f}=e,[p,g]=(0,l.useState)(""),[b,x]=(0,l.useState)(!1);m[0]!==f?(t=f.replaceAll(" ","-").replaceAll(".",""),m[0]=f,m[1]=t):t=m[1];let y=t;m[2]!==h?(a=h.replaceAll(" ","-").replaceAll(".",""),m[2]=h,m[3]=a):a=m[3];let _=a,j=`${y}-${_}`,w=(0,n.usePathname)();m[4]!==p||m[5]!==j?(o=function(e){x(e);let t=JSON.parse(localStorage.getItem(p)??"[]"),a=t.findIndex(e=>e.key===j);return -1===a?localStorage.setItem(p,JSON.stringify([...t,{key:j,value:e}])):(t[a].value=e,localStorage.setItem(p,JSON.stringify(t)))},m[4]=p,m[5]=j,m[6]=o):o=m[6];let v=o;return m[7]!==p||m[8]!==j||m[9]!==w?(c=()=>
27{g(w.split("/").filter(Boolean).pop()||""),JSON.parse(localStorage.getItem(p)??"[]").forEach(e=>{e.key===j&&!0===e.value&&x(!0)})},d=[p,j,w],m[7]=p,m[8]=j,m[9]=w,m[10]=c,m[11]=d):(c=m[10],d=m[11]),(0,l.useEffect)(c,d),m[12]!==b||m[13]!==h||m[14]!==v?(u=(0,r.jsx)(i.c,{label:h,checked:b,onCheckedChange:v}),m[12]=b,m[13]=h,m[14]=v,m[15]=u):u=m[15],u}},66253:(e,t,a)=>{"use strict";a.d(t,{A:()=>v});var r=a(67368),s=a(26880),i=a(74180),n=a(3864),l=a.n(n),o=a(67984),c=a(92726),d=a(92312),u=a(45019),m=a(42978),h=a(98150),f=a(13365),p=a(6421);a(88669);var g=a(11411);let b=(0,i.forwardRef)((e,t)=>{let{disabled:a=!1,readOnly:s=!1,options:n,isOptionEqualToValue:l,autoHighlight:o,autoComplete:b,onInputChange:x,onEnter:y,className:_,...j}=e,{getRootProps:w,getInputProps:v,getListboxProps:N,getOptionProps:S,getClearProps:k,inputValue:$,id:P,popupOpen:E,anchorEl:T,setAnchorEl:R,groupedOptions:I}=(0,u.m)({...e,componentName:"Autocomplete"}),{getSpecificTranslation:C,settings:L}=(0,c.WR)(),U=C("store_locator","help_text"),A=C("store_locator","no_results"),O=C("store_locator","label_go_to_map"),D=(0,m.A)(t,R),q="autocomplete-item flex items-center list-none text-paragraph-base-regular text-black py-3 pl-6 pr-4 border-t group border-grey-100 first:border-t-0";return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{...w(j),ref:D,className:` 28 flex 29 pr-4 30 bg-white 31 overflow-auto 32 rounded-3xl 33 ${E?"!rounded-b-none":""} 34 ${_||""} 35 `,children:[(0,r.jsx)("input",{id:P,disabled:a,readOnly:s,onKeyUp:function(t){if("Enter"===t.key&&I?.length===1){let t=I[0];e.onEnter?.($,t)}},...v(),placeholder:e.placeholder,autoComplete:"new-password",type:"text",className:"cursor-text grow w-0 leading-normal focus:rounded-b-none pl-6 pr-4 py-3 rounded-l-3xl text-paragraph-base-regular focus:outline-none"}),!$&&(0,r.jsx)("div",{className:"w-6 self-center",children:(0,r.jsx)(p.A,{className:"cursor-text size-6 motion-safe:scale-100 motion-safe:hover:scale-105 motion-safe:duration-300 will-change-transform"})}),$&&(0,r.jsx)("button",{type:"button",...k(),className:"self-center",children:(0,r.jsx)(f.A,{className:"size-6"})})]}),T&&E&&(0,r.jsx)(d.N,{id:P,open:E,style:{width:T?.clientWidth},anchorEl:T,modifiers:[{name:"flip",enabled:!1},{name:"preventOverflow",enabled:!1}],slotProps:{root:{className:"relative z-100 w-full bg-white rounded-b-3xl overflow-hidden border border-grey-100 shadow-2xl"}},children:(0,r.jsxs)("ul",{...N(),className:"cursor-pointer min-w-[300px] z-10 max-h-44 overflow-y-auto",children:[I.map((e,t)=>{let a=S({option:e,index:t});return(0,i.createElement)("li",{...a,key:e.label,className:q,children:[(0,r.jsx)("span",{className:"grow",children:e.label}),(0,r.jsx)("span",{className:"group-hover:motion-safe:translate-x-2 motion-safe:ease-in-out motion-safe:translate-x-0 motion-safe:duration-150",children:(0,r.jsx)(h.A,{className:"size-6 text-[#000]"})})]})}),$.length>0&&0===I.length&&(0,r.jsxs)("li",{className:q,children:[A," ",L?.storesParentPage.url&&(0,r.jsx)(g.default,{className:"underline",href:L?.storesParentPage.url,children:O})]},"noResult"),!$&&(0,r.jsx)("li",{className:`${q} !cursor-text`,children:U},"helpText")]})})]})});var x=a(55338);let y=(0,x.createServerReference)("400be5a4ffa85dfb8a7005ed94e7011e2a3fcee6e5",x.callServer,void 0,x.findSourceMapURL,"locationLookup"),_=(0,x.createServerReference)("40667fa88aba843132d6bdf9da6ccf06eab3fd8aa3",x.callServer,void 0,x.findSourceMapURL,"geocodeLookup");var j=a(67697);function w(e){let t,a,i,n,l=(0,s.c)(11),{isLocatingUser:c,handleLottieFinishAnimation:d,invertIcon:u}=e,m=void 0!==u&&u,h=m?"find-my-location-yellow.lottie":"find-my-location.lottie";l[0]!==d||l[1]!==c||l[2]!==h?(t=c&&(0,r.jsx)(j.d6,{src:`/assets/animations/${h}`,autoplay:!0,style:{width:"100%",height:"100%"},onFinishAnimation:d}),l[0]=d,l[1]=c,l[2]=h,l[3]=t):t=l[3],l[4]!==t?(a=(0,r.jsx)("div",{className:"row-start-1 row-end-1 col-start-1 col-end-2",children:t}),l[4]=t,l[5]=a):a=l[5];let f=` 36 cursor-pointer 37 size-[22px] 38 mt-[2px] 39 ml-[-1px] 40 ${c&&"!hidden"} 41 ${m&&"fill-black text-black"} 42 ${!m&&"fill-primary text-primary"} 43 `;return l[6]!==f?(i=(0,r.jsx)("div",{className:"row-start-1 row-end-1 col-start-1 col-end-2 flex justify-center items-center",children:(0,r.jsx)(o.A,{"aria-hidden":"true",viewBox:"0 0 24 24",className:f})}),l[6]=f,l[7]=i):i=l[7],l[8]!==a||l[9]!==i?(n=(0,r.jsxs)("div",{className:"grid grid-cols-1 size-8",children:[a,i]}),l[8]=a,l[9]=i,l[10]=n):n=l[10],n}function v({onSuggestionSelection:e,invertIcon:t=!1,searchParams:a}){let[s,n]=(0,i.useState)([]),[o,d]=(0,i.useState)(!1),u=(0,i.useRef)(!1),m=a?.holiday==="true",{getSpecificTranslation:h}=(0,c.WR)(),f=h("store_finder","textbox_placeholder"),p=h("store_finder","search_by_gps"),g=(0,i.useCallback)(async e=>{try{if(!e)return void n([]);let t=await y(e);n(t)}catch(e){console.error("Error fetching address suggestions:",e),u.current=!1}},[]),x=l()(e=>{g(e)},200);async function j(){try{if(!("geolocation"in navigator))throw Error("Geolocation is not available in this browser.");d(()=>!0),navigator.geolocation.getCurrentPosition(t=>{let{latitude:a,longitude:r}=t.coords;
43u.current=!0,e(a,r,m)},e=>{d(()=>!1),u.current=!1,console.error("Error getting user location. Please enable location services or try again later.",e)})}catch(e){d(()=>!1),u.current=!1,console.error("An error occurred while getting user location. Please try again later.",e)}}async function N(t){if(t){let a=await _(t.text);e(a.y,a.x,m)}}return(0,r.jsxs)("section",{className:"grow grid grid-cols-[1fr_auto] gap-2 items-center relative",children:[(0,r.jsx)(b,{options:s?.map(e=>({...e,label:e.text})),placeholder:f,autoHighlight:!0,autoComplete:!0,isOptionEqualToValue:(e,t)=>e.text===t.text,onInputChange:(e,t)=>x(t),onChange:(e,t)=>N(t),onEnter:(e,t)=>{N(t)}}),(0,r.jsx)("button",{type:"button",onClick:j,"aria-label":p,className:` 44 size-12 rounded-full flex justify-center items-center 45 ${t&&"bg-primary"} 46 ${!t&&"bg-black"} 47 `,children:(0,r.jsx)(w,{isLocatingUser:o,handleLottieFinishAnimation:function(){u.current&&d(()=>!1)},invertIcon:t})})]})}},68081:(e,t,a)=>{"use strict";a.d(t,{default:()=>X});var r=a(67368),s=a(26880),i=a(94660),n=a(74180),l=a(25720),o=a(83518),c=a(71491),d=a(15467);function u(e){let t,a,i,n,l,o=(0,s.c)(18),{headlineType:c,className:u,textClassName:m,content:h,showOpenLeafletButton:f,onOpenLeafletClick:p}=e,{headline:g,headlineToggle:b,singleLeafletButtonLabel:x}=h,y=` 48 hidden z-10 relative laptop:block laptop:pl-7 49 ${u||""} 50 `;return o[0]!==g||o[1]!==b||o[2]!==c||o[3]!==f||o[4]!==x||o[5]!==m?(t=g&&(0,r.jsx)(d.g,{type:c,className:`text-white ${m||""} ${f&&x?"mb-7":""}`,tag:b?"h1":"h3",children:g}),o[0]=g,o[1]=b,o[2]=c,o[3]=f,o[4]=x,o[5]=m,o[6]=t):t=o[6],o[7]!==p||o[8]!==f||o[9]!==x?(a=f&&x?(0,r.jsx)(d.l,{onClick:p,children:x}):null,o[7]=p,o[8]=f,o[9]=x,o[10]=a):a=o[10],o[11]!==y||o[12]!==t||o[13]!==a?(i=(0,r.jsxs)("div",{className:y,children:[t,a]}),o[11]=y,o[12]=t,o[13]=a,o[14]=i):i=o[14],o[15]===Symbol.for("react.memo_cache_sentinel")?(n=(0,r.jsx)("div",{className:"absolute hidden laptop:block w-full top-0 left-0 bg-black z-[1] h-full tablet:h-[300px] desktop:rounded-2xl tablet:top-auto"}),o[15]=n):n=o[15],o[16]!==i?(l=(0,r.jsxs)(r.Fragment,{children:[i,n]}),o[16]=i,o[17]=l):l=o[17],l}var m=a(6632),h=a(17533),f=a(3347),p=a(50636),g=a(13365),b=a(73281),x=a(19875),y=a(65876),_=a(11773),j=a(95022),w=a(97750);let v=(0,n.forwardRef)(({viewer:e,isOpen:t,useNativeModal:a=!0,showDownloadButton:s,leaflet:i,onClose:l,onDownload:o},c)=>{let d=(0,n.useRef)(null),u=(0,n.useRef)(null),v=(0,n.useRef)(null),N=(0,n.useRef)(0);function S(){d.current?.close(),u.current?.removeEventListener("click",$),l()}function k(e){if(!e?.progressLabel||0===e.progress&&0===N.current)return;_.P.track("viewLeaflet",{leafletName:i?.catalog?.label||"",leafletPage:e.progressLabel||""});let t=Math.round(e.progress);t>=25&&N.current<25&&_.P.track("viewLeaflet25",{leafletName:i?.catalog?.label||"",leafletPage:e.progressLabel||""}),t>=50&&N.current<50&&_.P.track("viewLeaflet50",{leafletName:i?.catalog?.label||"",leafletPage:e.progressLabel||""}),t>=75&&N.current<75&&_.P.track("viewLeaflet75",{leafletName:i?.catalog?.label||"",leafletPage:e.progressLabel||""}),t>=100&&N.current<100&&_.P.track("viewLeaflet100",{leafletName:i?.catalog?.label||"",leafletPage:e.progressLabel||""}),e.progress>N.current&&(N.current=t)}function $(e){e.target===u.current&&u.current?.close()}return(0,y.A)("Escape",()=>{S()}),(0,n.useEffect)(()=>{t&&e&&(N.current=0,e?.bind("beforeNavigation",k),d.current?.open||(a?d.current?.showModal():d.current?.show()),window.dispatchEvent(new Event("resize")),u.current?.addEventListener("click",$))},[t,a,e]),(0,r.jsx)("dialog",{ref:d,children:(0,r.jsx)(w.m,{open:t&&a,children:(0,r.jsxs)("div",{ref:c,tabIndex:-1,id:"publication__modal",className:"sgn__pp","data-layout-absolute":"true",children:[(0,r.jsxs)("header",{className:"sgn-pp__header sgn__navbar p-2",children:[(0,r.jsxs)("section",{className:"sgn-navbar__section flex justify-end",children:[s&&(0,r.jsx)("button",{"aria-label":"Download leaflet",onClick:function(){o(i?.catalog?.id||"")},type:"button",className:"text-black motion-safe:transition-transform motion-safe:duration-200 scale-100 hover:motion-safe:scale-110 focus:motion-safe:scale-110 mr-2",children:(0,r.jsx)(b.A,{"aria-hidden":"true",className:"w-10 h-10"})}),(0,r.jsx)("button",{"aria-label":"Close leaflet dialog",ref:v,onClick:S,type:"button",className:"text-black motion-safe:transition-transform motion-safe:duration-200 scale-100 hover:motion-safe:scale-110 focus:motion-safe:scale-110 ",children:(0,r.jsx)(g.A,{"aria-hidden":"true",className:"w-10 h-10"})})]}),(0,r.jsx)("section",{className:"sgn-navbar__section"})]}),(0,r.jsx)("div",{className:"verso",children:(0,r.jsx)("div",{className:"verso__scroller",children:(0,r.jsx)("div",{className:"sgn-pp__pages"})})}),(0,r.jsx)("div",{className:"sgn-pp__progress",children:(0,r.jsx)("div",{className:"sgn-pp-progress__bar"})}),(0,r.jsx)("button",{type:"button",onClick:function(){u.current?.showModal()},"aria-label":"Show pages",children:(0,r.jsx)("div",{className:"sgn-pp__progress-label"})}),(0,r.jsx)("button",{type:"button",onClick:function(){e?.first()},className:"sgn-pp__control","data-direction":"first","aria-label":"Go to first page",children:(0,r.jsx)(m.A,{className:"text-heading-2xl"})}),(0,r.jsx)("button",{type:"button",className:"sgn-pp__control","data-direction":"prev","aria-label":"Go to previous page",children:(0,r.jsx)(f.A,{className:"text-heading-4xl"})}),(0,r.jsx)("button",{type:"button",className:"sgn-pp__control","data-direction":"next","aria-label":"Go to next page",children:(0,r.jsx)(p.A,{className:"text-heading-4xl"})}),(0,r.jsx)("button",{onClick:function(){e?.last()},type:"button",className:"sgn-pp__control","data-direction":"last","aria-label":"Go to last page",children:(0,r.jsx)(h.A,{className:"text-heading-2xl"})}),(0,r.jsx)("div",{className:"sgn-page_decorations"}),(0,r.jsx)("dialog",{className:"leaflet-pages-dialog z-20 w-screen max-w-none bottom-0 bg-primary border-t m-0 top-auto",ref:u,children:(0,r.jsx)(j.b,{className:"gap-4 p-4",children:e?.options?.pages?.map(t=>(0,r.jsx)("li",{className:"w-32",children:(0,r.jsxs)("button",{className:"block relative",type:"button",onClick:()=>{var a;return a=t.id,void(e?.navigateToPageId(a),u.current?.close())},children:[(0,r.jsx)(x.default,{src:t.images.medium,alt:`page ${t.label}`,width:"152",height:"206",className:"w-32 h-[180px] min-w-full",unoptimized:!0,loader:({src:e})=>e}),(0,r.jsx)("div",{className:"absolute left-0 right-0 bottom-0 text-center bg-black/75 text-white p-2",children:t.label})]})},t.id))})})]})})})});var N=a(74573),S=a(92726),k=a(77097),$=a(86278);let{appTimeZone:P,appLocale:E}=o.WN;function T(e){let t,a,n,l,o,c,u,m,h,f,p,g,b,y,_,j,w,v,T,I,C,L,U,A,O,D,q,H,X,W=(0,s.c)(86),{leafletItem:z,className:B,isAgeGateActive:Y,hideLabel:M,onLeafletClick:F}=e,G=void 0===B?"":B,V=void 0!==M&&M,{getSpecificTranslation:K}=(0,S.WR)(),{id:J,run_from:Q,run_till:Z,display_run_till:ee,images:et,label:ea,tags:er}=z,es=!ee;W[0]!==Z||W[1]!==es||W[2]!==Q?(t=(0,N.uo)(Q,Z,E,P,es),W[0]=Z,W[1]=es,W[2]=Q,W[3]=t):t=W[3];let ei=t;W[4]!==Z||W[5]!==Q?(a=(0,N.bq)(Q,Z),W[4]=Z,W[5]=Q,W[6]=a):a=W[6];let en=a;W[7]!==en||W[8]!==Z||W[9]!==Q?(n=en?(0,N.RR)(Z)+1:(0,N.RR)(Q),W[7]=en,W[8]=Z,W[9]=Q,W[10]=n):n=W[10];let el=n;W[11]!==K?(l=K("leaflet","days_left_first"),W[11]=K,W[12]=l):l=W[12];let eo=l;W[13]!==K?(o=K("leaflet","days_left_second_singular"),W[13]=K,W[14]=o):o=W[14];let ec=o;W[15]!==K?(c=K("leaflet","days_left_second_plural"),W[15]=K,W[16]=c):c=W[16];let ed=c;W[17]!==K?(u=K("leaflet","days_untill_first"),W[17]=K,W[18]=u):u=W[18];let eu=u;W[19]!==K?(m=K("leaflet","days_left_detailed_prefix"),W[19]=K,W[20]=m):m=W[20];let em=m;W[21]!==K?(h=K("leaflet","days_untill_detailed_prefix"),W[21]=K,W[22]=h):h=W[22];let eh=h;W[23]!==K?(f=K("leaflet","days_till_prefix"),W[23]=K,W[24]=f):f=W[24];let ef=f;W[25]!==K?(p=K("leaflet","leaflet_active_today"),W[25]=K,W[26]=p):p=W[26];let ep=p;W[27]!==K?(g=K("leaflet","adults_only_leaflet_heading"),W[27]=K,W[28]=g):g=W[28];let eg=g;W[29]!==K?(b=K("leaflet","adults_only_leaflet_unlock"),W[29]=K,W[30]=b):b=W[30];let eb=b;W[31]!==en||W[32]!==el||W[33]!==Z||W[34]!==ep||W[35]!==ed||W[36]!==ec||W[37]!==em||W[38]!==eo||W[39]!==eh||W[40]!==eu||W[41]!==Q?(y=function(){let e=el<=1?"":el,t=el>1?ed:ec;t=0===el?ep:t;let a=en?eo:eu;if(el>=5)return`${a} ${e} ${t}`;let r=en?em:eh;return"today"===(0,N.pD)(Z,E,P)&&en?`${r} ${t}`:"pl"===E?en?`${r} ${(0,N.H2)(Z,P)}`:`${r} ${(0,N.H2)(Q,P)}`:en?`${r} ${(0,N.pD)(Z,E,P)}`:`${r} ${(0,N.pD)(Q,E,P)}`},W[31]=en,W[32]=el,W[33]=Z,W[34]=ep,W[35]=ed,W[36]=ec,W[37]=em,W[38]=eo,W[39]=eh,W[40]=eu,W[41]=Q,W[42]=y):y=W[42];let ex=y;W[43]!==J||W[44]!==F?(_=function(e){e.preventDefault(),F(J)},W[43]=J,W[44]=F,W[45]=_):_=W[45];let ey=_;W[46]!==ea?(j={leafletName:ea},W[46]=ea,W[47]=j):j=W[47];let e_=j;W[48]===Symbol.for("react.memo_cache_sentinel")?(w=(0,$.C2)(360,E),W[48]=w):w=W[48];let ej=w;W[49]!==er?(v=er||[],W[49]=er,W[50]=v):v=W[50],W[51]!==v?(T=v.includes("restricted"),W[51]=v,W[52]=T):T=W[52];let ew=T&&Y,ev=`${ef} ${ei}`,eN=es?ev:ei;W[53]!==et.view||W[54]!==eN?(I=(0,r.jsx)(x.default,{src:et.view,alt:eN,width:360,height:ej,unoptimized:!0,loading:"eager",loader:R}),W[53]=et.view,W[54]=eN,W[55]=I):I=W[55];let eS=I;return W[56]!==G?(C=(0,i.cn)("relative",G),W[56]=G,W[57]=C):C=W[57],W[58]===Symbol.for("react.memo_cache_sentinel")?(L=(0,i.cn)("grid","grid-cols-1","gap-y-4","text-paragraph-xs-bold"),W[58]=L):L=W[58],W[59]!==eg||W[60]!==eb||W[61]!==ey||W[62]!==ew?(U=ew&&(0,r.jsxs)("div",{className:"absolute inset-0 !top-auto bg-white opacity-70 z-10 min-h-32 rounded-t-lg px-4 py-5",children:[(0,r.jsx)(d.g,{type:"headline5",tag:"p",className:"text-center mb-3",content:eg}),(0,r.jsx)(d.l,{variant:"secondary",className:"!block !w-full",onClick:ey,asChild:!0,children:(0,r.jsx)("span",{children:eb})})]}),W[59]=eg,W[60]=eb,W[61]=ey,W[62]=ew,W[63]=U):U=W[63],W[64]!==eS||W[65]!==U?(A=(0,r.jsxs)("div",{className:"relative scale-hover-animation will-change-transform",children:[U,eS]}),W[64]=eS,W[65]=U,W[66]=A):A=W[66],W[67]!==en||W[68]!==ex||W[69]!==V||W[70]!==es||W[71]!==ev||W[72]!==ei?(O=!V&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.g,{type:"bodySmBold",className:"flex whitespace-nowrap",children:es?ev:ei}),!es&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:`py-1 px-2 rounded-full ${en?"bg-primary normal-case":"border-black border-x border-y bg-white normal-case"}`,children:(0,r.jsx)(d.g,{type:"bodySmBold",className:"whitespace-nowrap",children:ex()})})})]}),W[67]=en,W[68]=ex,W[69]=V,W[70]=es,W[71]=ev,W[72]=ei,W[73]=O):O=W[73],W[74]!==O?(D=(0,r.jsx)("div",{className:"flex items-center justify-center gap-2 capitalize",children:O}),W[74]=O,W[75]=D):D=W[75],W[76]!==ey||W[77]!==A||W[78]!==D?(q=(0,r.jsxs)("button",{type:"button",onClick:ey,className:L,children:[A,D]}),W[76]=ey,W[77]=A,W[78]=D,W[79]=q):q=W[79],W[80]!==C||W[81]!==q?(H=(0,r.jsx)("li",{className:C,children:q}),W[80]=C,W[81]=q,W[82]=H):H=W[82],W[83]!==e_||W[84]!==H?(X=(0,r.jsx)(k.A,{event:"leafletListViewed",leafletPayload:e_,children:H}),W[83]=e_,W[84]=H,W[85]=X):X=W[85],X}function R(e){let{src:t}=e;return t}a(51210),a(72753);let I={requestHandler:fetch,baseUrl:"https://squid-api.tjek.com",catalogsLimit:"12",apiKey:"",dealerId:""};class C{constructor(e){const t={...I,...e};if(!t.apiKey)throw Error("ShopgunAPI: Missing API key");if(!t.dealerId)throw Error("ShopgunAPI: Missing dealer id");this._config=t,this._requestHandler=t.requestHandler,this._requestOptions={headers:{"Api-Key":t.apiKey},method:"GET"}}async getLeaflets({requestHandlerCatalogs:e=this._requestHandler,requestHandlerPages:t=this._requestHandler}){try{let a=await this.getCatalogs(e);return await Promise.all(a.map(async e=>{try{let a=await this.getPages({catalogId:e.id},t);return{catalog:e,pages:a}}catch(t){return console.error(`Failed to get pages for catalog ${e.id}:`,t),{catalog:e,pages:[]}}}))}catch(e){return console.error("Failed to get catalogs:",e),[]}}async getLeafletPDF(e=this._requestHandler,t){try{if(!t)throw Error("Missing catalog id");let a=new URL(`${this._config.baseUrl}/v2/catalogs/${t}/download`),r=await e(a.href,this._requestOptions);if(!r.ok)throw Error(`Failed to fetch data from: ${a}`);return await r.json()}catch(e){return console.error("Failed to get catalogs:",e),{pdf_url:""}}}async getCatalogs(e=this._requestHandler){let t=new URL(`${this._config.baseUrl}/v2/catalogs`);t.searchParams.set("dealer_id",this._config.dealerId),t.searchParams.set("order_by","publication_date"),t.searchParams.set("offset","0"),t.searchParams.set("limit",this._config.catalogsLimit);let a=await e(t.href,this._requestOptions);if(!a.ok)throw Error(`Failed to fetch data from: ${t}`);let r=await a.json();return this.sortCatalogs(r)}async getPages({catalogId:e},t=this._requestHandler){let a=new URL(`${this._config.baseUrl}/v2/catalogs/${e}/pages`),r=await t(a.href,{...this._requestOptions});if(!r.ok)throw Error(`Failed to fetch pages for catalog ${e}: ${r.statusText}`);return r.json()}sortCatalogs(e){return e.sort((e,t)=>
50{let a="trade",r=e.tags?.map(e=>e.toLowerCase().trim()),s=t.tags?.map(e=>e.toLowerCase().trim());return r?.includes(a)&&!s?.includes(a)?-1:!r?.includes(a)&&s?.includes(a)?1:new Date(e.run_till).getTime()-new Date(t.run_till).getTime()})}}var L=a(3070);let U=new C({apiKey:o.WN.sgnApiKey,baseUrl:o.WN.sgnSQUIDUrl,dealerId:o.WN.sgnDealerID,catalogsLimit:"12",requestHandler:(0,L.$)({revalidate:7200})});var A=a(99369),O=a(61065),D=a(67697);let{sgnApiKey:q,sgnTrackingId:H}=o.WN;function X(e){let t,a,d,m,h,f,p,g,b,x,y,w,N,k=(0,s.c)(102),{content:$}=e,{leaflets:P}=(0,S.ip)();k[0]!==P?(t=void 0===P?[]:P,k[0]=P,k[1]=t):t=k[1];let E=t,{openDialogue:R}=(0,A.K)(),[I,C]=(0,n.useState)(null),[X,W]=(0,n.useState)(!1),[z,B]=(0,n.useState)(!1),[Y,M]=(0,n.useState)(void 0),[F,G]=(0,n.useState)(!0),V=(0,n.useRef)(null),K=(0,n.useRef)(null),J=(0,l.useSearchParams)();k[2]!==J?(a=J.get("leafletid"),k[2]=J,k[3]=a):a=k[3];let Q=a;k[4]!==J?(d=J.get("leafletindex"),k[4]=J,k[5]=d):d=k[5];let Z=d;k[6]!==J?(m=J.get("page"),k[6]=J,k[7]=m):m=k[7];let ee=m,[et,ea]=(0,n.useState)(!1),er=(0,c.W)();if(O.$W.set({apiKey:q,eventTracker:new O.yW.Tracker({trackId:H})}),k[8]!==E||k[9]!==I){let e,t,a;g=function(e,t,a){let r=void 0===t?1:t;I?.destroy(),G((void 0===a?{}:a).useNativeModal??!0);let s=E.find(t=>t.catalog.id===e);M(s),B(!1),K.current=e,es(e),setTimeout(()=>{let t=O.Sc.Bootstrapper({el:V.current,id:e,pageId:`page${encodeURIComponent(r)}`,eventTracker:O.$W.get("eventTracker")}).createViewer({details:s?.catalog,pages:s?.pages||[]},{keyboard:"enabled",eventTracker:O.$W.get("eventTracker")});if(t.start(),C(t),s?.catalog.label){_.P.track("selectLeaflet",{leafletName:s?.catalog.label});let e=r.toString();_.P.track("viewLeaflet",{leafletName:s?.catalog.label,leafletPage:`${e} / ${s?.pages?.length}`})}},0),document.body.classList.add("publication--open"),W(!0)},p=function(){g(E[0].catalog.id)},k[14]!==I?(e=function(){W(!1),K.current=null,document.body.classList.remove("publication--open"),I?.destroy()},k[14]=I,k[15]=e):e=k[15],h=e,k[16]===Symbol.for("react.memo_cache_sentinel")?(t=async function(e){return U.getLeafletPDF((0,L.$)({revalidate:400}),e)},k[16]=t):t=k[16];let r=t;async function es(e){try{let t=await r(e);K.current===e&&B(!!t.pdf_url)}catch{K.current===e&&B(!1)}}k[17]===Symbol.for("react.memo_cache_sentinel")?(a=async function(e){let t=await r(e);if(!t.pdf_url)return;let a=window.open(t.pdf_url,"_blank","noopener,noreferrer");a&&(a.opener=null)},k[17]=a):a=k[17],f=a,k[8]=E,k[9]=I,k[10]=h,k[11]=f,k[12]=p,k[13]=g}else h=k[10],f=k[11],p=k[12],g=k[13];k[18]!==Q||k[19]!==Z||k[20]!==E||k[21]!==g||k[22]!==ee?(b=function(){let e=ee?Number(ee):1;if(Q){E?.find(e=>e.catalog.id===Q)&&g(Q,e,{useNativeModal:!1});return}let t=Number(Z)-1,a=E?.[t]?.catalog?.id;a&&g(a,e,{useNativeModal:!1})},k[18]=Q,k[19]=Z,k[20]=E,k[21]=g,k[22]=ee,k[23]=b):b=k[23];let ei=b;k[24]!==ei||k[25]!==Q||k[26]!==Z?(x=()=>{sessionStorage&&ea("true"===sessionStorage.getItem(o.Vg)),(Q||Z)&&ei()},k[24]=ei,k[25]=Q,k[26]=Z,k[27]=x):x=k[27],k[28]!==Q||k[29]!==Z||k[30]!==ee?(y=[Q,Z,ee],k[28]=Q,k[29]=Z,k[30]=ee,k[31]=y):y=k[31],(0,n.useEffect)(x,y),k[32]!==et||k[33]!==E||k[34]!==R||k[35]!==g?(w=function(e,t){let a=void 0===t?1:t,r=E.find(t=>t.catalog.id===e);r?.catalog?.tags?.includes("restricted")&&!0!==et?R({dialogue:"leafletAgeVerificationModal",payload:{onAgeVerify:t=>{ea(t),g(e,a)}}}):g(e,a)},k[32]=et,k[33]=E,k[34]=R,k[35]=g,k[36]=w):w=k[36];let en=w;k[37]!==Y||k[38]!==h||k[39]!==f||k[40]!==X||k[41]!==z||k[42]!==F||k[43]!==I?(N=(0,r.jsx)(v,{isOpen:X,useNativeModal:F,showDownloadButton:z,onClose:h,onDownload:f,leaflet:Y,ref:V,viewer:I}),k[37]=Y,k[38]=h,k[39]=f,k[40]=X,k[41]=z,k[42]=F,k[43]=I,k[44]=N):N=k[44];let el=N;if(!E?.length)return null;if(E?.length>3){let e,t,a,s;k[45]===Symbol.for("react.memo_cache_sentinel")?(e={slidesPerView:"auto",spaceBetween:16,breakpoints:{1024:{slidesPerGroup:3}},mousewheel:{enabled:!0,forceToAxis:!0}},k[45]=e):e=k[45];let n=e,l=$.contentTypeAlias;if(k[46]!==en||k[47]!==et||k[48]!==E){let e;k[50]!==en||k[51]!==et?(e=e=>(0,r.jsx)(T,{className:(0,i.cn)("w-72","laptop:text-paragraph-base-bold","laptop:w-[28vw]","de
50sktop:w-[360px]"),leafletItem:e.catalog,isAgeGateActive:!et,hideLabel:!!e?.catalog?.tags?.includes("permanent"),onLeafletClick:en},e.catalog.id),k[50]=en,k[51]=et,k[52]=e):e=k[52],t=E.map(e),k[46]=en,k[47]=et,k[48]=E,k[49]=t}else t=k[49];return k[53]!==er||k[54]!==$.contentTypeAlias||k[55]!==t?(a=(0,r.jsx)(D.dW,{carouselName:l,options:n,carouselAccessibilityLabels:er,showPagination:!1,showNavigation:!0,showThumbs:!1,carouselWrapperClassName:"tablet:[&:not(.swiper-initialized)>.swiper-wrapper]:justify-center",children:t}),k[53]=er,k[54]=$.contentTypeAlias,k[55]=t,k[56]=a):a=k[56],k[57]!==el||k[58]!==a?(s=(0,r.jsxs)("div",{children:[a,el]}),k[57]=el,k[58]=a,k[59]=s):s=k[59],s}if(E?.length===3){let e,t,a;if(k[60]!==en||k[61]!==et||k[62]!==E){let t;k[64]!==en||k[65]!==et?(t=e=>(0,r.jsx)(T,{className:(0,i.cn)("w-72","laptop:text-paragraph-base-bold","tablet:min-w-72","tablet:w-auto","tablet:flex-1"),leafletItem:e.catalog,isAgeGateActive:!et,hideLabel:!!e?.catalog?.tags?.includes("permanent"),onLeafletClick:en},e.catalog.id),k[64]=en,k[65]=et,k[66]=t):t=k[66],e=E.map(t),k[60]=en,k[61]=et,k[62]=E,k[63]=e}else e=k[63];return k[67]!==e?(t=(0,r.jsx)(j.b,{className:"gap-4",children:e}),k[67]=e,k[68]=t):t=k[68],k[69]!==el||k[70]!==t?(a=(0,r.jsxs)(r.Fragment,{children:[t,el]}),k[69]=el,k[70]=t,k[71]=a):a=k[71],a}if(2===E.length){let e,t,a,s,i;return k[72]!==et||k[73]!==E||k[74]!==g?(e=E?.map(e=>(0,r.jsx)(T,{className:"w-72 tablet:w-1/2 max-w-[360px]",leafletItem:e.catalog,isAgeGateActive:!et,hideLabel:!!e?.catalog?.tags?.includes("permanent"),onLeafletClick:g},e.catalog.id)),k[72]=et,k[73]=E,k[74]=g,k[75]=e):e=k[75],k[76]!==e?(t=(0,r.jsx)("div",{className:"w-full flex relative z-[2] laptop:mb-0 laptop:max-w-[55%] desktop:max-w-[50%]",children:(0,r.jsx)(j.b,{className:"gap-6 pr-5",children:e})}),k[76]=e,k[77]=t):t=k[77],k[78]!==$?(a=(0,r.jsx)(u,{content:$,headlineType:"headline4",textClassName:"max-w-[450px]"}),k[78]=$,k[79]=a):a=k[79],k[80]!==t||k[81]!==a?(s=(0,r.jsxs)("section",{className:"break-container desktop:container pl-5 flex relative overflow-hidden flex-col laptop:flex-row laptop:items-center",children:[t,a]}),k[80]=t,k[81]=a,k[82]=s):s=k[82],k[83]!==el||k[84]!==s?(i=(0,r.jsxs)(r.Fragment,{children:[s,el]}),k[83]=el,k[84]=s,k[85]=i):i=k[85],i}if(1===E.length){let e,t,a,s,i,n=!et;k[86]!==E[0].catalog.tags?(e=E[0]?.catalog?.tags?.includes("permanent"),k[86]=E[0].catalog.tags,k[87]=e):e=k[87];let l=!!e;return k[88]!==E[0].catalog||k[89]!==g||k[90]!==n||k[91]!==l?(t=(0,r.jsx)("ul",{className:"tablet:w-auto flex gap-4 relative z-[2]",children:(0,r.jsx)(T,{className:"w-full max-w-[450px] tablet:w-[360px] tablet:text-paragraph-xs-bold",leafletItem:E[0].catalog,isAgeGateActive:n,hideLabel:l,onLeafletClick:g},E[0].catalog.id)}),k[88]=E[0].catalog,k[89]=g,k[90]=n,k[91]=l,k[92]=t):t=k[92],k[93]!==$||k[94]!==p?(a=(0,r.jsx)(u,{content:$,headlineType:"headline3",textClassName:"max-w-[600px]",showOpenLeafletButton:!0,onOpenLeafletClick:p}),k[93]=$,k[94]=p,k[95]=a):a=k[95],k[96]!==t||k[97]!==a?(s=(0,r.jsxs)("section",{className:"break-container desktop:container px-5 tablet:pl-5 flex relative flex-col items-center tablet:flex-row tablet:items-center",children:[t,a]}),k[96]=t,k[97]=a,k[98]=s):s=k[98],k[99]!==el||k[100]!==s?(i=(0,r.jsxs)(r.Fragment,{children:[s,el]}),k[99]=el,k[100]=s,k[101]=i):i=k[101],i}}},68863:(e,t,a)=>{"use strict";a.d(t,{default:()=>d});var r=a(67368),s=a(26880),i=a(93057),n=a(74180),l=a(1578),o=a(75277),c=a(75704);function d(e){let t,a,d,u,m=(0,s.c)(13),{content:h}=e,{imageOverlay:f,videoCaption:p,vimeoId:g,youTubeId:b}=h,[x,y]=(0,n.useState)(!0),[_,j]=(0,n.useState)(!1);m[0]===Symbol.for("react.memo_cache_sentinel")?(t=function(e){e.preventDefault(),j(!0),setTimeout(()=>{y(!1)},500)},m[0]=t):t=m[0];let w=t;return m[1]!==f||m[2]!==x||m[3]!==_||m[4]!==p||m[5]!==g||m[6]!==b?(a=(0,r.jsx)("div",{className:"relative bg-grey-800",children:f?(0,r.jsxs)(r.Fragment,{children:[x&&(0,r.jsxs)("div",{className:"cursor-pointer",children:[(0,r.jsx)(o.default,{aspectRatio:"16-9",width:"890",className:`transition-all w-full duration-300 ease-in-out 51 ${_?"opacity-0":"opacity-75"}`,alt:p||"",sizeMap:{375:"100vw",1024:"100vw",1280:"890px"},src:f?.url||"",onClick:w,cropMode:"crop"}),(0,r.jsx)(l.s,{viewBox:"0 0 56 56",className:` 52 opacity-100 53 transition-all 54 duration-300 55 ease-in-out 56 absolute 57 text-white 58 w-[56px] 59 h-[56px] 60 tablet:w-[112px] 61 tablet:h-[112px] 62 top-[50%] 63 left-[50%] 64 z-20 65 transform 66 translate-x-[-50%] 67 translate-y-[-50%] 68 pointer-events-none 69 ${_?" !opacity-0":""}`})]}),!x&&(0,r.jsx)(c.default,{vimeoId:g,youTubeId:b})]}):(0,r.jsx)(c.default,{vimeoId:g,youTubeId:b})}),m[1]=f,m[2]=x,m[3]=_,m[4]=p,m[5]=g,m[6]=b,m[7]=a):a=m[7],m[8]!==p?(d=p&&(0,r.jsx)(i.g,{type:"bodyLight",className:"flex pt-4 text-grey-500 px-4 tablet:px-0",children:p}),m[8]=p,m[9]=d):d=m[9],m[10]!==a||m[11]!==d?(u=(0,r.jsxs)("div",{children:[a,d]}),m[10]=a,m[11]=d,m[12]=u):u=m[12],u}},71491:(e,t,a)=>{"use strict";a.d(t,{W:()=>i});var r=a(26880),s=a(92726);function i(){let e,t,a,i,n,l=(0,r.c)(13),{getSpecificTranslation:o}=(0,s.ip)();return l[0]!==o?(e=o("carousel","previous_slide_aria_label"),l[0]=o,l[1]=e):e=l[1],l[2]!==o?(t=o("carousel","next_slide_aria_label"),l[2]=o,l[3]=t):t=l[3],l[4]!==o?(a=o("carousel","first_slide_message"),l[4]=o,l[5]=a):a=l[5],l[6]!==o?(i=o("carousel","last_slide_message"),l[6]=o,l[7]=i):i=l[7],l[8]!==e||l[9]!==t||l[10]!==a||l[11]!==i?(n={prevSlideMessage:e,nextSlideMessage:t,firstSlideMessage:a,lastSlideMessage:i},l[8]=e,l[9]=t,l[10]=a,l[11]=i,l[12]=n):n=l[12],n}},72753:()=>{},75277:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>o});var r=a(67368),s=a(26880);a(74180);var i=a(19875);let n={"1.91-1":{aspectRatio:1.91},"16-9":{aspectRatio:16/9},"5-4":{aspectRatio:5/4},"5-2":{aspectRatio:2.5},"3-4":{aspectRatio:3/4},"3-1":{aspectRatio:3},"2-3":{aspectRatio:2/3}
69,"2-1":{aspectRatio:2},"1-1":{aspectRatio:1}};var l=a(92726);let o=function(e){let t,a,o,c,d,u,m,h,f,p,g,b,x,y=(0,s.c)(31);y[0]!==e?({aspectRatio:t,format:c,cropMode:o,cropAnchor:a,sizeMap:h,width:p,src:f,quality:m,priority:d,...u}=e,y[0]=e,y[1]=t,y[2]=a,y[3]=o,y[4]=c,y[5]=d,y[6]=u,y[7]=m,y[8]=h,y[9]=f,y[10]=p):(t=y[1],a=y[2],o=y[3],c=y[4],d=y[5],u=y[6],m=y[7],h=y[8],f=y[9],p=y[10]);let{settings:_}=(0,l.ip)(),j=f||_?.notFoundImage?.url;if(!j)return null;y[11]!==t||y[12]!==a||y[13]!==o||y[14]!==c||y[15]!==j||y[16]!==m||y[17]!==h||y[18]!==p?(g=function({src:e,width:t,forceHeight:a,aspectRatio:r,sizeMap:s,format:i,cropMode:l,cropAnchor:o,quality:c}){let d=n[r],u=Number(t)/Number(d?.aspectRatio),m=s?Object.keys(s).map(e=>{let t=s[e];return`(max-width: ${e}px) ${t}`}).join(",\n"):"",h=new URL(e),f=Number(t)/Number(d?.aspectRatio);return h.searchParams.set("format",i||"webp"),h.searchParams.set("width",String(t)),h.searchParams.set("height",String(a||f)),h.searchParams.set("quality",String(c||75)),h.searchParams.set("mode",l||"crop"),h.searchParams.set("cropAnchor",o||"CENTER"),{imageSrc:h.href,imageHeight:u,imageWidth:t,sizeString:m}}({src:j,width:p,aspectRatio:t,sizeMap:h,format:c,cropMode:o,cropAnchor:a,quality:m}),y[11]=t,y[12]=a,y[13]=o,y[14]=c,y[15]=j,y[16]=m,y[17]=h,y[18]=p,y[19]=g):g=y[19];let{imageHeight:w,imageSrc:v,sizeString:N}=g,S=d?"eager":u.loading||"lazy",k=`${N}, ${p}px`;return y[20]!==v?(b=()=>v,y[20]=v,y[21]=b):b=y[21],y[22]!==w||y[23]!==v||y[24]!==d||y[25]!==u||y[26]!==S||y[27]!==k||y[28]!==b||y[29]!==p?(x=(0,r.jsx)(i.default,{...u,src:v,alt:u.alt,width:p,loading:S,height:w,sizes:k,priority:d,unoptimized:!0,loader:b}),y[22]=w,y[23]=v,y[24]=d,y[25]=u,y[26]=S,y[27]=k,y[28]=b,y[29]=p,y[30]=x):x=y[30],x}},75704:(e,t,a)=>{"use strict";a.d(t,{default:()=>c});var r=a(67368),s=a(26880),i=a(95297);function n(e){let t,a,i,n=(0,s.c)(9),{vimeoId:l,autoPlay:o,className:c,dnt:d}=e;n[0]!==o||n[1]!==d||n[2]!==l?((t=new URL(`https://player.vimeo.com/video/${l}`)).searchParams.set("autoplay",o?"1":"0"),t.searchParams.set("dnt",d?"true":"false"),t.searchParams.set("title","0"),t.searchParams.set("byline","0"),t.searchParams.set("portrait","0"),t.searchParams.set("color","004a62"),t.searchParams.set("background","0"),t.searchParams.set("dnt","1"),n[0]=o,n[1]=d,n[2]=l,n[3]=t):t=n[3];let u=`aspect-16-9 min-h-0 h-full ${c||""}`;return n[4]!==t.href?(a=(0,r.jsx)("iframe",{title:"title",src:t.href,loading:"lazy",allow:"autoplay; fullscreen; picture-in-picture",className:"aspect-2-1 h-full w-full mx-auto"}),n[4]=t.href,n[5]=a):a=n[5],n[6]!==u||n[7]!==a?(i=(0,r.jsx)("div",{className:u,children:a}),n[6]=u,n[7]=a,n[8]=i):i=n[8],i}var l=a(75277),o=a(92726);function c(e){let t,a=(0,s.c)(19),{youTubeId:c,vimeoId:d,mainImage:u,className:m,autoPlay:h}=e,{getSpecificTranslation:f}=(0,o.WR)();a[0]!==f?(t=f("articles","no_image"),a[0]=f,a[1]=t):t=a[1];let p=t;if(c){let e,t,s=`aspect-16-9 ${m||""}`,n=`controls=1${h?"&autoplay=1":""}`;return a[2]!==n||a[3]!==c?(e=(0,r.jsx)(i.YouTubeEmbed,{videoid:c,params:n,style:"max-width: 100%; margin: 0 auto"}),a[2]=n,a[3]=c,a[4]=e):e=a[4],a[5]!==s||a[6]!==e?(t=(0,r.jsx)("div",{className:s,children:e}),a[5]=s,a[6]=e,a[7]=t):t=a[7],t}if(d){let e,t=m||"";return a[8]!==h||a[9]!==t||a[10]!==d?(e=(0,r.jsx)(n,{vimeoId:d,className:t,autoPlay:h}),a[8]=h,a[9]=t,a[10]=d,a[11]=e):e=a[11],e}if(!c&&!d){let e,t,s=u?.url||"",i=u?.media.name||p,n=u?.media.name||p,o=u?"2-1":"5-4",c=m||"";return a[12]===Symbol.for("react.memo_cache_sentinel")?(e={360:"100vw",1024:"100vw"},a[12]=e):e=a[12],a[13]!==s||a[14]!==i||a[15]!==n||a[16]!==o||a[17]!==c?(t=(0,r.jsx)(l.default,{src:s,alt:i,title:n,aspectRatio:o,width:"890",className:c,sizeMap:e}),a[13]=s,a[14]=i,a[15]=n,a[16]=o,a[17]=c,a[18]=t):t=a[18],t}}},76121:(e,t,a)=>{"use strict";a.d(t,{default:()=>x});var r=a(67368),s=a(26880),i=a(25720),n=a(67697),l=a(98857),o=a(83518),c=a(92726),d=a(4836),u=a.n(d),m=a(45530);function h(e){return Array.isArray(e)?e:[e]}var f=a(90699),p=a(11411);function g(e){let t,a,i,n,l,o,d,u,m,h=(0,s.c)(25),{hit:g}=e,{getJobTranslation:b}=(0,f.ym)(),{settings:x}=(0,c.ip)(),y=x?.singleJobPage?`/${x?.singleJobPage}/${g.id}`:`/jobs/${g.objectID}`;h[0]!==g.title||h[1]!==y?(t=(0,r.jsx)("h4",{className:"text-paragraph-base-bold",children:(0,r.jsx)(p.default,{href:y,className:"after:content-[''] after:absolute after:inset-0 font-bold",children:g.title})}),h[0]=g.title,h[1]=y,h[2]=t):t=h[2],h[3]!==g.address?(a=g.address?(0,r.jsxs)("p",{className:"text-grey-600",children:[g.address.street?`${g.address.street}, `:null,g.address.zip?g.address.zip:null," ",g.address.city?g.address.city:null]}):null,h[3]=g.address,h[4]=a):a=h[4],h[5]!==t||h[6]!==a?(i=(0,r.jsxs)("div",{className:"basis-full",children:[t,a]}),h[5]=t,h[6]=a,h[7]=i):i=h[7],h[8]!==b||h[9]!==g.categories?(n=g.categories?.map(e=>(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{className:"laptop:hidden inline-block px-2 py-1 text-paragraph-xs-regular text-grey-800 bg-grey-200 rounded-full",children:b(e,"categories")}),(0,r.jsx)("span",{className:"hidden laptop:inline",children:b(e,"categories")})]},e)),h[8]=b,h[9]=g.categories,h[10]=n):n=h[10],h[11]!==n?(l=(0,r.jsx)("div",{children:n}),h[11]=n,h[12]=l):l=h[12];let _=g.address?.city?g.address.city:null;return h[13]!==_?(o=(0,r.jsx)("div",{className:"hidden laptop:block",children:_}),h[13]=_,h[14]=o):o=h[14],h[15]!==b||h[16]!==g.employmentType?(d=g.employmentType?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"inline-block laptop:hidden px-2 py-1 text-paragraph-xs-regular text-grey-800 bg-grey-200 rounded-full",children:b(g.employmentType,"types")}),(0,r.jsx)("span",{className:"hidden laptop:inline",children:b(g.employmentType,"types")})]}):null,h[15]=b,h[16]=g.employmentType,h[17]=d):d=h[17],h[18]!==d?(u=(0,r.jsx)("div",{children:d}),h[18]=d,h[19]=u):u=h[19],h[20]!==u||h[21]!==i||h[22]!==l||h[23]!==o?(m=(0,r.jsxs)("div",{className:"relative\n flex\n flex-wrap\n p-8\n items-center\n gap-x-2\n gap-y-4\n min-h-[114px]\n -mt-[1px]\n border-y\n border-grey-200/50\n bg-white\n hover:bg-grey-100\n hover:z-15\n laptop:grid\n laptop:grid-cols-[3fr_1fr_1fr_1fr]\n laptop:gap-x-4\n laptop:py-5\n motion-safe:transition-colors\n motion-safe:duration-300",children:[i,l,o,u]}),h[20]=u,h[21]=i,h[22]=l,h[23]=o,h[24]=m):m=h[24],m}var b=a(11773);function x(e){let t,a,d,f,p,x,_,j,w,v,N,S,k,$=(0,s.c)(24),{content:P}=e,{headline:E,preselectedFilters:T}=P,{siteUrl:R,algoliaJobApiKey:I,algoliaJobApplicationId:C,algoliaJobIndex:L,appCountry:U}=o.WN,{getJobTranslations:A,sgJobTranslations:O}=(0,c.ip)();$[0]!==A?(t=A("facets"),$[0]=A,$[1]=t):t=$[1];let D=t;$[2]!==D||$[3]!==O?(a={jobTranslations:{...O,umbraco:D},trackingService:b.P},$[2]=D,$[3]=O,$[4]=a):a=$[4];let q=a,H=(0,i.usePathname)(),X=(0,i.useSearchParams)(),W=`${R}${H}${X?`?${X}`:""}`;$[5]!==T?(d=function(e){if(!e)return{};let t=e.replace(/\s/g,"").trim();return u().parse(t,{ignoreQueryPrefix:!0,decoder(e,t,a,r){let s=t(e);return"key"===r?s.replace(/^f:/,""):s}})}(T),$[5]=T,$[6]=d):d=$[6];let z=d;if($[7]!==W)f={stateMapping:{stateToRoute(e){let t=e[L],a={q:t.query};return Object.entries(t.refinementList||{}
69).forEach(([e,t])=>{a[`f:${e}`]=[...h(t).map(String)]}),t.page&&(a.page=String(t.page)),a},routeToState:e=>({[L]:{...e,page:e.page?Number(e.page):1}})},router:(0,m.A)({parseURL({qsModule:e,location:t}){let{q:a="",page:r=1,...s}=e.parse(t.search.slice(1)),i=Object.entries(s).filter(([e])=>e.startsWith("f:")).reduce((e,[t,a])=>(delete s[t],e[t.replace("f:","")]=h(a),e),{});return{query:a?decodeURIComponent(String(a)):"",page:r?Number(r):1,refinementList:i,...s}},writeDelay:400,cleanUrlOnDispose:!1,getLocation:()=>window.location})},$[7]=W,$[8]=f;else f=$[8];let B=f;$[9]===Symbol.for("react.memo_cache_sentinel")?(p=[{attribute:"region",translation:"region"},{attribute:"address.city",translation:"umbraco"},{attribute:"jobLevel",translation:"levels"},{attribute:"categories",translation:"categories"},{attribute:"employmentType",translation:"types"}],$[9]=p):p=$[9];let Y=p;$[10]===Symbol.for("react.memo_cache_sentinel")?(x=function(e){b.P.track("jobListViewed",{listName:"jobList",jobs:e.map(y)})},$[10]=x):x=$[10];let M=x;$[11]===Symbol.for("react.memo_cache_sentinel")?(_=function(e,t){t&&b.P.track("jobClicked",{job:{index:e,id:t?.datasourceId||t?.id||"noId",format:t?.brand,jobLevel:t?.jobLevel,name:t?.title,region:t?.region,categories:t?.categories||[],country:t?.country,listName:"jobList"},listName:"jobList"})},$[11]=_):_=$[11];let F=_;$[12]===Symbol.for("react.memo_cache_sentinel")?(j=function(e,t,a){b.P.track("filtersClicked",{action:!0===e?"Removed":"Added",filters:[{key:a||"",value:t.join(",")}],page:"SEARCH"})},$[12]=j):j=$[12];let G=j;$[13]===Symbol.for("react.memo_cache_sentinel")?(w=e=>{let{insightsMethod:t,attribute:a,hits:r,payload:s}=e,i=r?.[0];if(t)switch(t){case"viewedObjectIDs":break;case"clickedFilters":if("filters"in s){let{filters:e,isRemoved:t}=s;G(t,e,a)}break;case"customViewedObjectIDs":r&&M(r);break;case"clickedObjectIDsAfterSearch":if("positions"in s){let{positions:e}=s;F(e[0],i)}}},$[13]=w):w=$[13];let V=w;return $[14]===Symbol.for("react.memo_cache_sentinel")?(v={onEvent:V},$[14]=v):v=$[14],$[15]!==z?(N={brand:"netto",country:U,...z},$[15]=z,$[16]=N):N=$[16],$[17]!==E||$[18]!==N?(S=(0,r.jsx)(l.A,{hitsPerPage:8,headline:E,configuredFilters:N,attributeList:Y,hitComponent:g}),$[17]=E,$[18]=N,$[19]=S):S=$[19],$[20]!==q||$[21]!==B||$[22]!==S?(k=(0,r.jsx)(n.XS,{applicationId:C,apiKey:I,indexName:L,routing:B,contextData:q,insights:v,children:S}),$[20]=q,$[21]=B,$[22]=S,$[23]=k):k=$[23],k}function y(e,t){return{id:e.datasourceId||e.id||"noId",index:t,format:e.brand,categories:e.categories,jobLevel:e.jobLevel,name:e.title,country:e.country,listName:"jobList",region:e.region}}},77097:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var r=a(67368),s=a(26880),i=a(82482),n=a(11773);function l(e){let t,a,l=(0,s.c)(7),{event:o,itemViewPayload:c,leafletPayload:d,children:u}=e;if(!o)return null;l[0]!==o||l[1]!==c||l[2]!==d?(t=function(){"viewItemList"===o&&c&&n.P.track(o,c),"leafletListViewed"===o&&d&&n.P.track(o,d)},l[0]=o,l[1]=c,l[2]=d,l[3]=t):t=l[3];let m=t;return l[4]!==u||l[5]!==m?(a=(0,r.jsx)(i.A,{onVisible:m,children:u}),l[4]=u,l[5]=m,l[6]=a):a=l[6],a}},77670:(e,t,a)=>{"use strict";a.d(t,{default:()=>d});var r=a(67368),s=a(26880),i=a(93057),n=a(1578),l=a(75277),o=a(11773),c=a(11411);function d(e){let t,a,d,u,m,h,f,p,g=(0,s.c)(26),{item:b,className:x}=e,y=b?.previewImage||b?.mainImage,_=y?.url||"",j=y?.media?.name||b?.mainImage?.media?.name||"",w=b.youtubeId||b.vimeoId;g[0]!==b.headline||g[1]!==b.url?(t=function(){o.P.track("selectContent",{contentName:b.headline,contentUrl:b.url,contentType:"content"})},g[0]=b.headline,g[1]=b.url,g[2]=t):t=g[2];let v=t,N=`article-card z-20 animate-item flex flex-col justify-between relative group 70 ${x||""} ${w?"video-card":""}`;g[3]!==w?(a=w?(0,r.jsx)(n.s,{viewBox:"0 0 56 56",className:"group-hover:motion-safe:animate-pulse duration-75 absolute text-white w-[56px] h-[56px] top-[50%] left-[50%] z-20 transform translate-x-[-50%] translate-y-[-50%]"}):"",g[3]=w,g[4]=a):a=g[4];let S=`overflow-hidden h-full w-full -z-10 71 ${w?"":"max-h-[calc(100%_-_90px)] laptop:max-h-[calc(100%_-_144px)]"}`;g[5]===Symbol.for("react.memo_cache_sentinel")?(d={500:"50vw",750:"40vw",1024:"25vw",1200:"250px",1280:"300px"},g[5]=d):d=g[5];let k=w?"2-3":"1-1";g[6]!==j||g[7]!==_||g[8]!==k?(u=(0,r.jsx)(l.default,{src:_,alt:j,sizeMap:d,aspectRatio:k,width:"300",className:"object-cover h-full w-full"}),g[6]=j,g[7]=_,g[8]=k,g[9]=u):u=g[9],g[10]!==S||g[11]!==u?(m=(0,r.jsx)("div",{className:S,children:u}),g[10]=S,g[11]=u,g[12]=m):m=g[12];let $=` 72 flex z-20 justify-center text-center placeholder:text-center p-4 laptop:p-6 w-full laptop:text-heading-2xl 73 ${w?"absolute h-full items-end bg-transparent text-white":"h-[90px] items-center laptop:h-36 bg-white"}`,P=`link-cover 74 ${w?"flex items-center laptop:h-24":""}`,E=b.headline?b.headline:b.name;return g[13]!==v||g[14]!==b.url||g[15]!==P||g[16]!==E?(h=(0,r.jsx)(c.default,{href:b.url,prefetch:!0,onClick:v,className:P,children:E}),g[13]=v,g[14]=b.url,g[15]=P,g[16]=E,g[17]=h):h=g[17],g[18]!==h||g[19]!==$?(f=(0,r.jsx)(i.g,{type:"bodyBold",className:$,children:h}),g[18]=h,g[19]=$,g[20]=f):f=g[20],g[21]!==f||g[22]!==N||g[23]!==a||g[24]!==m?(p=(0,r.jsxs)("div",{className:N,children:[a,m,f]}),g[21]=f,g[22]=N,g[23]=a,g[24]=m,g[25]=p):p=g[25],p}},88669:()=>{},97931:()=>{},98601:(e,t,a)=>{"use strict";a.d(t,{yo:()=>g,U8:()=>p,BJ:()=>b,oF:()=>j,Cx:()=>y,Ls:()=>_,qF:()=>w,Rp:()=>x});var r=a(46267),s=a(87543);let i={"heading-6xl":r.sQ.heading6xl,"heading-5xl":r.sQ.heading5xl,"heading-4xl":r.sQ.heading4xl,"heading-3xl":r.sQ.heading3xl,"heading-2xl":r.sQ.heading2xl,"heading-xl":r.sQ.heading2xl,"meta-handwriting":r.sQ.metaHandwriting,"meta-sm-narrow":r.sQ.metaSmlight,"paragraph-base-bold":r.sQ.paragraphBasebold,"paragraph-base-bold-allcaps":r.sQ.paragraphBaseboldallcaps,"paragraph-base-light":r.sQ.paragraphBaselight,"paragraph-base-regular":r.sQ.paragraphBaseregular,"paragraph-lg-bold":r.sQ.paragraphLgbold,"paragraph-sm-bold":r.sQ.paragraphSmbold,"paragraph-sm-light":r.sQ.paragraphSmlight,"paragraph-sm-regular":r.sQ.paragraphSmregular,"paragraph-xl-bold":r.sQ.paragraphXlbold,"paragraph-xl-regular":r.sQ.paragraphXlbold,"paragraph-xs-bold":r.sQ.paragraphXsbold,"paragraph-xs-regular":r.sQ.paragraphXsregular,"paragraph-xxs-regular":r.sQ.paragraphXxsregular,"paragraph-lg-regular":r.sQ.paragraphLgbold,"button-sm":r.sQ.paragraphBasebold,"button-base":r.sQ.paragraphBasebold,"button-lg":r.sQ.paragraphLgbold},n={content:[],presets:[s.A],safelist:["text-grey-700"],plugins:[a(78465)],theme:{colors:{...r.fi,surface:{white:"#ffffffff",black:"#242424ff",neutral:"#e7e7e7ff",disabled:"#e7e7e7ff",primary:"#fad85bff","primary-hover":"#fbe07cff","primary-pressed":"#f2c241ff","primary-focused":"#fbe07cff","primary-disabled":"#fce89dff",secondary:"#242424ff","secondary-pressed":"#353535ff","secondary-hover":"#505050ff","secondary-focused":"#353535ff","secondary-disabled":"#858585ff",tertiary:"#79a278ff"},text:{white:"#ffffffff",black:"#242424ff",base:"#242424ff","base-hover":"#505050ff",placeholder:"#65666B",disabled:"#6a6a6aff",pressed:"#242424ff",primary:"#242424ff","primary-hover":"#242424ff",secondary:"#ffffffff",link:"#242424ff",hover:"#505050ff",error:"#dc2626ff"},border:{white:"#ffffffff",black:"#242424ff",neutral:"#e7e7e7ff",hover:"#cececeff",pressed:"#505050ff",disabled:"#6a6a6aff",primary:"#c79100ff",secondary:"#c79100ff",tertiary:"#79a278ff",info:"#0EA5E9ff",success:"#16A34Aff"}},fontSize:{...i},fontFamily:{main:["var(--font-gentonanetto)","sans-serif"]},container:{center:!0,screens:{DEFAULT:"100%",desktop:"1280px"}}}},l={content:["./src/**/*.{js,ts,jsx,tsx}
74","./node_modules/@salling-group/ui-library-react-dom/src/**/*.{js,ts,jsx,tsx}","./node_modules/@salling-group/ui-library-nextjs/src/**/*.{js,ts,jsx,tsx,mdx}"],future:{hoverOnlyWhenSupported:!0},presets:[s.A],plugins:n.plugins,theme:{screens:{tablet:"768px",laptop:"1024px",desktop:"1200px"},extend:{...n.theme,backgroundImage:{"gradient-to-bottom-with-calc":"linear-gradient(to bottom, transparent calc(100% - 1px), currentColor 1px)"}}}},o="cubic-bezier(0.4, 0, 0.2, 1)",c="cubic-bezier(0.250, 0.460, 0.450, 0.940)",d="cubic-bezier(0.2, 0, 1, 0.9)",u=window.matchMedia("(prefers-reduced-motion: reduce)").matches,m="animate"in document.body,h=m&&!u;function f(){return{isMobile:window.matchMedia(`(width < ${l.theme.screens.tablet}`).matches,isTablet:window.matchMedia(`(width >= ${l.theme.screens.tablet}`).matches,isLaptop:window.matchMedia(`(width >= ${l.theme.screens.laptop}`).matches,isDesktop:window.matchMedia(`(width >= ${l.theme.screens.desktop}`).matches}}function p(e,t){if(!e||!h)return;let{isLaptop:a}=f();t?(e.classList.remove("overflow-hidden"),e.animate([{transform:a?"translateY(-100%)":"translateX(100%)",transformOrigin:"top right",offset:0},{transform:a?"translateY(0%)":"translateX(0%)",transformOrigin:"top right",offset:1}],{delay:60*!a,duration:a?400:600,fill:"forwards",easing:"cubic-bezier(0.215, 0.610, 0.355, 1.000)"}),e.classList.remove("overflow-y-auto")):e.animate([{transform:a?"translateY(0)":"translateX(0)",transformOrigin:"top right",offset:0},{transform:a?"translateY(-100%)":"translateX(100%)",transformOrigin:"top right",offset:1}],{delay:0,duration:400,fill:"forwards",easing:o})}function g(e,t){if(!e||!h)return;let{isLaptop:a}=f();a?e.classList.add("!hidden"):(e.classList.remove("!hidden"),t?e.animate([{transform:"scaleX(0)",transformOrigin:"top right",offset:0},{transform:"scaleX(1)",transformOrigin:"top right",offset:1}],{delay:0,duration:400,fill:"forwards",easing:o}):e.animate([{transform:"scaleX(1)",transformOrigin:"top right",offset:0},{transform:"scaleX(0)",transformOrigin:"top right",offset:1}],{delay:0,duration:1,fill:"forwards",easing:d}))}function b(e,t,a=".animate-item"){let r=e?.querySelectorAll(a);r?.length&&h&&(t?r.forEach((e,t)=>{e.animate([{opacity:0,transform:"translateX(20px)",offset:0},{opacity:1,transform:"translateX(0)",offset:1}],{duration:600,delay:60*t-2*t,fill:"both",easing:"cubic-bezier(0.4, 0, 0.2, 1)"}),e.classList.add("after:opacity-100")}):r.forEach(e=>{e.animate([{opacity:1,transform:"translateX(0px)",offset:0},{opacity:0,transform:"translateX(40px)",offset:1}],{duration:300,delay:10,fill:"both",easing:"cubic-bezier(0.4, 0, 0.2, 1)"})}))}function x(e,t){let a=e?.querySelectorAll("a");a?.length&&h&&t&&a?.forEach((e,t)=>{let a=t+1;e.animate([{opacity:0,transform:"translateY(100px)",offset:0},{opacity:1,transform:"translateY(0)",offset:1}],{duration:900,delay:40*a-6*a,fill:"both",easing:c})})}async function y(e){if(!e||!h)return;let t=e.scrollHeight;await e.animate([{height:0,opacity:0,offset:0,overflow:"hidden"},{height:`${t}px`,opacity:1,offset:1,overflow:"hidden"},{height:"auto",offset:1,overflow:"visible"}],{duration:400,fill:"both",easing:c}).finished,e.style.setProperty("height","auto")}async function _(e){if(!e||!h)return;let t=e.scrollHeight;await e.animate([{height:`${t}px`,opacity:1,offset:0,overflow:"hidden"},{height:"0px",opacity:0,offset:1,overflow:"hidden"},{display:"none",offset:1}],{duration:400,fill:"both",easing:o}).finished,e.style.setProperty("height","auto")}async function j(e){e&&h&&(await e.animate([{opacity:1,offset:0},{opacity:0,offset:1},{display:"none",offset:1}],{duration:400,fill:"both",easing:o}).finished,e.style.setProperty("display","none"))}async function w(e){if(!e||!h)return;let t=e.scrollHeight;await e.animate([{opacity:0,transform:"translateY(6px)",visibility:"visible",height:"0px",offset:0},{opacity:1,visibility:"visible",transform:"translateY(0)",height:`${t}px`,offset:1},{height:"auto",visibility:"visible",offset:1}],{duration:500,fill:"both",easing:o}).finished}}}]);
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.