PageSourceSearch

https://assets.tori.fi/pkg/recommerce-suggestions-podlet/0.0.276/entry.client.js

js tori.fi collected 2026-09-24 18:33:39 UTC 86,272 bytes, 21 lines download raw bytes

1import l,{forwardRef as ne,useState as S,useRef as Y,useEffect as q,useCallback as we,useImperativeHandle as Dt,useMemo as Pe}from"https://assets.finn.no/npm/react/v19/react.production.min.js";import Wt from"https://assets.finn.no/npm/react-dom/v19/react-dom.client.production.js";import Jt from"https://assets.finn.no/npm/react-dom/v19/react-dom.production.js";import{Button as X,Modal as Gt,Alert as Vt,TextField as bt,Affix as qt,Pagination as zt,Card as Qt,Clickable as Yt}from"https://assets.finn.no/pkg/@warp-ds/react/v2/warp-react-19.js";import{toast as Ee}from"https://assets.finn.no/pkg/@warp-ds/elements/v2/packages/toast/index.js";import $ from"https://assets.finn.no/pkg/@finn-no/pulse-sdk/v0/client.esm.min.js";import{LitElement as N}from"https://assets.finn.no/npm/lit/v3/lit.min.js";import"https://assets.finn.no/pkg/@warp-ds/elements/v2/index.js";function Kt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var _e={exports:{}},ee={};/**
2 * @license React
3 * react-jsx-runtime.production.js
4 *
5 * Copyright (c) Meta Platforms, Inc. and affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var Ve;function Xt(){if(Ve)return ee;Ve=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,o,s){var i=null;if(s!==void 0&&(i=""+s),o.key!==void 0&&(i=""+o.key),"key"in o){s={};for(var a in o)a!=="key"&&(s[a]=o[a])}else s=o;return o=s.ref,{$$typeof:t,type:n,key:i,ref:o!==void 0?o:null,props:s}}return ee.Fragment=e,ee.jsx=r,ee.jsxs=r,ee}var qe;function Zt(){return qe||(qe=1,_e.exports=Xt()),_e.exports}var h=Zt();function er(t,e=globalThis.document){return e.documentElement.getAttribute(t)}function tr(...t){for(let e=0;e<t.length;e++){const r=typeof t[e]=="function"?t[e]():t[e];if(r)return r}return null}const rr="w-icon{display:block}w-icon.inline{display:inline-block;vertical-align:middle}";function nr(){return h.jsx("style",{children:rr})}function I(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ze="__lookupFavItem",Qe=4,or=1e3*60*10,Ye=typeof window<"u";function Q(t,e,r){return{itemType:t,itemId:e,folderIds:r}}function A(t,e){return"".concat(t,":").concat(e)}class yt{constructor(e,r,n,o,s){I(this,"ttl",void 0),I(this,"version",void 0),I(this,"userId",void 0),I(this,"items",void 0),I(this,"dataFromServer",void 0),this.ttl=e,this.version=r,this.userId=s,this.items=n,this.dataFromServer=o}}function ve(t,e){return new yt(t.ttl,t.version,e,t.dataFromServer,t.userId)}class sr{constructor(e,r,n,o,s,i){I(this,"userId",void 0),I(this,"storage",void 0),I(this,"ttl",void 0),I(this,"key",void 0),I(this,"getNow",void 0),I(this,"storageHandler",void 0),this.userId=r,this.storage=n||(Ye?window.localStorage:null),this.ttl=o||or,this.key=s||ze,this.getNow=i||(()=>Date.now()),this.key=ze,this.storageHandler=a=>{try{var u,f;if(a.key!==this.key||a.oldValue===a.newValue||!a.newValue)return;var g=JSON.parse(a.newValue||"");if(((u=g.userId)===null||u===void 0?void 0:u.toString())!==((f=this.userId)===null||f===void 0?void 0:f.toString()))return;if(a.oldValue&&g.items){var p=JSON.parse(a.oldValue);g.items.forEach(m=>{var d=p.items!=null&&!p.items.find(v=>v.itemType===m.itemType&&v.itemId===m.itemId);if(d){var c=g.items.find(v=>v.itemType===m.itemType&&v.itemId===m.itemId)||Q(m.itemType,m.itemId,[]);e(A(m.itemType,m.itemId),c)}})}else g.items.forEach(m=>{var d=g.items.find(c=>c.itemType===m.itemType&&c.itemId===m.itemId)||Q(m.itemType,m.itemId,[]);e(A(m.itemType,m.itemId),d)})}catch{}},Ye&&window.addEventListener("storage",this.storageHandler)}unbind(){window.removeEventListener("storage",this.storageHandler)}createEmptyState(){var e;return new yt(this.getNow()+this.ttl,Qe,[],!1,(e=this.userId)===null||e===void 0?void 0:e.toString())}resetState(){var e,r=this.createEmptyState();return(e=this.storage)===null||e===void 0||e.setItem(this.key,JSON.stringify(r)),r}isValid(e){var r,n;return!e||e.version!==Qe||e.ttl<=this.getNow()||((r=e.userId)===null||r===void 0?void 0:r.toString())!==((n=this.userId)===null||n===void 0?void 0:n.toString())?this.resetState():e}getState(){try{var e,r=this.isValid(JSON.parse(((e=this.storage)===null||e===void 0?void 0:e.getItem(this.key))||""));if(r)return r}catch{return this.resetState()}return this.createEmptyState()}isEmpty(){return!this.getState().dataFromServer}getFolderIds(e,r){var n=i=>i.itemType===e&&i.itemId===r,o=this.getState();if(o&&o.items){if(Array.isArray(o.items)){var s=o.items.find(n);if(s)return s.folderIds}else return[];return[]}return[]}addToFolder(e,r,n){var o=!1;function s(f){return f.itemType===e&&f.itemId===r&&(o=!0,f.folderIds.push(n)),f}try{var i,a=this.getState();if(a&&a.items&&a.items){var u=a.items.map(s);a=ve(a,u)}return o||a.items.push(Q(e,r,[n])),(i=this.storage)===null||i===void 0||i.setItem(this.key,JSON.stringify(a)),!0}catch{return!1}}removeFromFolder(e,r,n){function o(u){if(u.itemType===e&&u.itemId===r){var f=u.folderIds.filter(g=>g!==n);return Q(u.itemType,u.itemId,f)}return u}try{var s,i=this.getState();if(i&&i.items){var a=i.items.map(o);i=ve(i,a)}return(s=this.storage)===null||s===void 0||s.setItem(this.key,JSON.stringify(i)),!0}catch{return!1}}deleteFolderContent(e,r){function n(a){var{itemId:u,itemType:f}=a;if(r.some(p=>p.itemId===u&&p.itemType===f)){var g=a.folderIds.filter(p=>p!==e);return Q(a.itemType,a.itemId,g)}return a}try{var o,s=this.getState();if(s&&s.items){var i=s.items.map(n);s=ve(s,i)}return(o=this.storage)===null||o===void 0||o.setItem(this.key,JSON.stringify(s)),!0}catch{return!1}}removeFolder(e){function r(a){var u=a.folderIds.filter(f=>f!==e);return Q(a.itemType,a.itemId,u)}try{var n,o=this.getState();if(o&&o.items){var s=o.items.map(r),i=s.filter(a=>a.folderIds.length>0);o=ve(o,i)}return(n=this.storage)===null||n===void 0||n.setItem(this.key,JSON.stringify(o)),!0}catch{return!1}}setItems(e){try{var r,n=this.createEmptyState();return n.items=e,n.dataFromServer=!0,(r=this.storage)===null||r===void 0||r.setItem(this.key,JSON.stringify(n)),!0}catch{return!1}}}class M{constructor(e,r){I(this,"baseUri",void 0),I(this,"fetch",void 0),this.baseUri=e,this.fetch=r||M.fetch,this.fetchFolders=this.fetchFolders.bind(this),this.fetchMinimalFavoriteMap=this.fetchMinimalFavoriteMap.bind(this),this.addToFolder=this.addToFolder.bind(this),this.removeFromFolder=this.removeFromFolder.bind(this),this.createFolder=this.createFolder.bind(this),this.deleteFolder=this.deleteFolder.bind(this),this.fetchNumFavs=this.fetchNumFavs.bind(this),this.deleteFolderContent=this.deleteFolderContent.bind(this)}static fetch(e,r){return window.fetch(e,r)}static getCredentialsHeader(){var{host:e}=window.location;return e.includes("local.finn.no")?"include":"same-origin"}fetchMinimalFavoriteMap(){return this.fetch("".concat(this.baseUri,"/minimal"),{credentials:M.getCredentialsHeader()})}addToFolder(e,r,n){return this.fetch("".concat(this.baseUri,"/").concat(n,"/").concat(e,"/").concat(r),{credentials:M.getCredentialsHeader(),method:"PUT"})}removeFromFolder(e,r,n){return this.fetch("".concat(this.baseUri,"/").concat(n,"/").concat(e,"/").concat(r),{credentials:M.getCredentialsHeader(),method:"DELETE"})}fetchFolders(){return this.fetch(this.baseUri,{credentials:M.getCredentialsHeader()})}createFolder(e){return this.fetch("".concat(this.baseUri),{credentials:M.getCredentialsHeader(),method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})})}deleteFolder(e){return this.fetch("".concat(this.baseUri,"/").concat(e),{credentials:M.getCredentialsHeader(),method:"DELETE"})}fetchNumFavs(e,r){return this.fetch("".concat(this.baseUri,"/").concat(e,"/").concat(r,"/counter"),{credentials:M.getCredentialsHeader()})}deleteFolderContent(e,r){return this.fetch("".concat(this.baseUri,"/").concat(e,"/ads"),{credentials:M.getCredentialsHeader(),method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:r})})}}var wt=typeof window<"u",U=wt?window:{};class ar{constructor(){I(this,"promise",void 0),I(this,"resolve",void 0),I(this,"reject",void 0),I(this,"timer",void 0),this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}}class ir{constructor(e,r,n){I(this,"namespace",void 0),I(this,"handler",void 0),I(this,"timeout",void 0),this.namespace=e,this.handler=r,this.timeout=n||15}getGlobalPromise(){return U[this.namespace]=U[this.namespace]||new ar,U[this.namespace]}resetState(){delete U[this.namespace]}collectAndHandle(){var e=this.getGlobalPromise();return clearTimeout(e.timer),e.timer=window.setTimeout(()=>
9{this.resetState(),this.handler().then(e.resolve).catch(e.reject)},this.timeout),e.promise}}class Ke{constructor(e){I(this,"key",void 0),this.key="".concat(e,"__queue"),U[this.key]=U[this.key]||[]}reset(){U[this.key]=[]}getQueue(){return U[this.key]}subscribe(e,r){this.getQueue().push([e,r])}unsubscribe(e,r){U[this.key]=this.getQueue().filter(n=>{var[o,s]=n;return!(o===e&&s===r)})}matches(e){return this.getQueue().filter(r=>{var[n]=r;return n.toString()===e.toString()}).map(r=>{var[,n]=r;return n})}emit(e,r){this.matches(e).forEach(n=>n(r))}}class te{constructor(e,r,n,o,s,i){I(this,"namespace",void 0),I(this,"fetcher",void 0),I(this,"toggledStateBus",void 0),I(this,"recountStateBus",void 0),I(this,"favStorage",void 0),I(this,"getItemCollector",void 0),this.namespace=r||"__lookupFavItem",this.toggledStateBus=new Ke("".concat(this.namespace,"__toggled")),this.recountStateBus=new Ke("".concat(this.namespace,"__recount")),this.favStorage=new sr((a,u)=>{this.toggledStateBus.emit(a,!!u)},e??void 0,n,o),this.fetcher=new M(i||te.getEnvBasedUrl(),s),this.getItemCollector=new ir(this.namespace,()=>this.fetcher.fetchMinimalFavoriteMap().then(te.validateResponseOK).then(a=>a.json()).then(a=>{this.favStorage.setItems(a.items)}).catch(()=>{})),this.fetchFolders=this.fetchFolders.bind(this),this.fetchFoldersForItem=this.fetchFoldersForItem.bind(this),this.addToFolder=this.addToFolder.bind(this),this.removeFromFolder=this.removeFromFolder.bind(this),this.createFolder=this.createFolder.bind(this),this.deleteFolder=this.deleteFolder.bind(this),this.deleteFolderContent=this.deleteFolderContent.bind(this)}unmount(){this.toggledStateBus.reset(),this.recountStateBus.reset(),this.favStorage.unbind()}static getEnvBasedUrl(){var{host:e}=wt?window.location:{host:""};return e.includes("local.finn.no")?"http://local.finn.no:3050/favorittliste/podium-resource/favorittlistePodlet/favorite-api":e.includes("dev.finn.no")?"https://dev.finn.no/favorittliste/podium-resource/favorittlistePodlet/favorite-api":"https://www.finn.no/favorittliste/podium-resource/favorittlistePodlet/favorite-api"}getFavoriteState(e,r,n){var o=Number(r);return this.toggledStateBus.subscribe(A(e,o),n),this.isItemFavorited(e,o),()=>{this.toggledStateBus.unsubscribe(A(e,o),n)}}subscribeToRecount(e,r,n){var o=Number(r);return this.recountStateBus.subscribe(A(e,o),n),this.fetchAndEmitNumFavs(e,o),()=>{this.recountStateBus.unsubscribe(A(e,o),n)}}isItemFavorited(e,r){var n=Number(r);if(this.favStorage.isEmpty())return this.getItemCollector.collectAndHandle().then(()=>new Promise(s=>{setTimeout(()=>{var i=this.favStorage.getFolderIds(e,n);return this.toggledStateBus.emit(A(e,n),i.length>0),i.length>0?s(!0):s(!1)},0)}));var o=this.favStorage.getFolderIds(e,n);return this.toggledStateBus.emit(A(e,n),o.length>0),o.length>0?Promise.resolve(!0):Promise.resolve(!1)}addToFolder(e,r,n){var o=Number(r),s=Number(n);return this.fetcher.addToFolder(e,o,s).then(i=>(this.toggledStateBus.matches(A(e,o)).forEach(a=>a(!0)),this.favStorage.addToFolder(e,o,s),this.fetchAndEmitNumFavs(e,o),i))}removeFromFolder(e,r,n){var o=Number(r),s=Number(n);return this.fetcher.removeFromFolder(e,o,s).then(i=>(this.favStorage.removeFromFolder(e,o,s),this.uncheckHeartIfRemovedFromAllFolders(e,o),this.fetchAndEmitNumFavs(e,o),i))}deleteFolderContent(e,r){var n=Number(e);return this.fetcher.deleteFolderContent(n,r).then(o=>(this.favStorage.deleteFolderContent(n,r),r.forEach(s=>{this.uncheckHeartIfRemovedFromAllFolders(s.itemType,s.itemId),this.fetchAndEmitNumFavs(s.itemType,s.itemId)}),o))}fetchFolders(){return this.fetcher.fetchFolders()}fetchFoldersForItem(e,r){var n=Number(r);return Promise.resolve(Q(e,n,this.favStorage.getFolderIds(e,n)))}createFolder(e){return this.fetcher.createFolder(e)}deleteFolder(e){var r=Number(e);return this.fetcher.deleteFolder(r).then(n=>(this.favStorage.removeFolder(r),n))}static validateResponseOK(e){return e.ok?Promise.resolve(e):Promise.reject(e)}uncheckHeartIfRemovedFromAllFolders(e,r){var n=this.favStorage.getFolderIds(e,r);n&&n.length<1&&this.toggledStateBus.matches(A(e,r)).forEach(o=>o(!1))}fetchAndEmitNumFavs(e,r){this.fetchNumFavs(e,r).then(te.validateResponseOK).then(n=>this.emitFavCounter(n,e,r)).catch(n=>this.emitZeroCountIfNotFound(n,e,r)).catch(()=>{})}fetchNumFavs(e,r){return this.fetcher.fetchNumFavs(e,r)}emitFavCounter(e,r,n){return e.json().then(o=>this.recountStateBus.emit(A(r,n),o.counter)).catch(()=>Promise.reject(e))}emitZeroCountIfNotFound(e,r,n){return e.status===404?(this.recountStateBus.emit(A(r,n),0),Promise.resolve(e)):Promise.reject(e)}}const Xe=t=>typeof t=="object"&&t!=null&&t.nodeType===1,Ze=(t,e)=>(!e||t!=="hidden")&&t!=="visible"&&t!=="clip",Fe=(t,e)=>{if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){const r=getComputedStyle(t,null);return Ze(r.overflowY,e)||Ze(r.overflowX,e)||(n=>{const o=(s=>{if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch{return null}})(n);return!!o&&(o.clientHeight<n.scrollHeight||o.clientWidth<n.scrollWidth)})(t)}return!1},ge=(t,e,r,n,o,s,i,a)=>s<t&&i>e||s>t&&i<e?0:s<=t&&a<=r||i>=e&&a>=r?s-t-n:i>e&&a<r||s<t&&a>r?i-e+o:0,lr=t=>{const e=t.parentElement;return e??(t.getRootNode().host||null)},et=(t,e)=>{var r,n,o,s;if(typeof document>"u")return[];const{scrollMode:i,block:a,inline:u,boundary:f,skipOverflowHiddenElements:g}=e,p=typeof f=="function"?f:H=>H!==f;if(!Xe(t))throw new TypeError("Invalid target");
9const m=document.scrollingElement||document.documentElement,d=[];let c=t;for(;Xe(c)&&p(c);){if(c=lr(c),c===m){d.push(c);break}c!=null&&c===document.body&&Fe(c)&&!Fe(document.documentElement)||c!=null&&Fe(c,g)&&d.push(c)}const v=(n=(r=window.visualViewport)==null?void 0:r.width)!=null?n:innerWidth,b=(s=(o=window.visualViewport)==null?void 0:o.height)!=null?s:innerHeight,{scrollX:y,scrollY:C}=window,{height:w,width:x,top:F,right:R,bottom:P,left:B}=t.getBoundingClientRect(),{top:W,right:j,bottom:O,left:K}=(H=>{const T=window.getComputedStyle(H);return{top:parseFloat(T.scrollMarginTop)||0,right:parseFloat(T.scrollMarginRight)||0,bottom:parseFloat(T.scrollMarginBottom)||0,left:parseFloat(T.scrollMarginLeft)||0}})(t);let _=a==="start"||a==="nearest"?F-W:a==="end"?P+O:F+w/2-W+O,L=u==="center"?B+x/2-K+j:u==="end"?R+j:B-K;const Z=[];for(let H=0;H<d.length;H++){const T=d[H],{height:oe,width:se,top:ae,right:Ne,bottom:Ie,left:ie}=T.getBoundingClientRect();if(i==="if-needed"&&F>=0&&B>=0&&P<=b&&R<=v&&F>=ae&&P<=Ie&&B>=ie&&R<=Ne)return Z;const le=getComputedStyle(T),ce=parseInt(le.borderLeftWidth,10),de=parseInt(le.borderTopWidth,10),ue=parseInt(le.borderRightWidth,10),me=parseInt(le.borderBottomWidth,10);let J=0,G=0;const fe="offsetWidth"in T?T.offsetWidth-T.clientWidth-ce-ue:0,he="offsetHeight"in T?T.offsetHeight-T.clientHeight-de-me:0,xe="offsetWidth"in T?T.offsetWidth===0?0:se/T.offsetWidth:0,Te="offsetHeight"in T?T.offsetHeight===0?0:oe/T.offsetHeight:0;if(m===T)J=a==="start"?_:a==="end"?_-b:a==="nearest"?ge(C,C+b,b,de,me,C+_,C+_+w,w):_-b/2,G=u==="start"?L:u==="center"?L-v/2:u==="end"?L-v:ge(y,y+v,v,ce,ue,y+L,y+L+x,x),J=Math.max(0,J+C),G=Math.max(0,G+y);else{J=a==="start"?_-ae-de:a==="end"?_-Ie+me+he:a==="nearest"?ge(ae,Ie,oe,de,me+he,_,_+w,w):_-(ae+oe/2)+he/2,G=u==="start"?L-ie-ce:u==="center"?L-(ie+se/2)+fe/2:u==="end"?L-Ne+ue+fe:ge(ie,Ne,se,ce,ue+fe,L,L+x,x);const{scrollLeft:Je,scrollTop:Ge}=T;J=Te===0?0:Math.max(0,Math.min(Ge+J/Te,T.scrollHeight-oe/Te+he)),G=xe===0?0:Math.max(0,Math.min(Je+G/xe,T.scrollWidth-se/xe+fe)),_+=Ge-J,L+=Je-G}Z.push({el:T,top:J,left:G})}return Z},cr=t=>t===!1?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&Object.keys(e).length!==0)(t)?t:{block:"start",inline:"nearest"};function dr(t,e){if(!t.isConnected||!(o=>{let s=o;for(;s&&s.parentNode;){if(s.parentNode===document)return!0;s=s.parentNode instanceof ShadowRoot?s.parentNode.host:s.parentNode}return!1})(t))return;const r=(o=>{const s=window.getComputedStyle(o);return{top:parseFloat(s.scrollMarginTop)||0,right:parseFloat(s.scrollMarginRight)||0,bottom:parseFloat(s.scrollMarginBottom)||0,left:parseFloat(s.scrollMarginLeft)||0}})(t);if((o=>typeof o=="object"&&typeof o.behavior=="function")(e))return e.behavior(et(t,e));const n=typeof e=="boolean"||e==null?void 0:e.behavior;for(const{el:o,top:s,left:i}of et(t,cr(e))){const a=s-r.top+r.bottom,u=i-r.left+r.right;o.scroll({top:a,left:u,behavior:n})}}const V=t=>typeof t=="string",ur=t=>typeof t=="function",tt=new Map,Et="en";function Ue(t){return[...Array.isArray(t)?t:[t],Et]}function De(t,e,r){const n=Ue(t);r||(r="default");let o;if(typeof r=="string")switch(o={day:"numeric",month:"short",year:"numeric"},r){case"full":o.weekday="long";case"long":o.month="long";break;case"short":o.month="numeric";break}else o=r;return ke(()=>Ce("date",n,r),()=>new Intl.DateTimeFormat(n,o)).format(V(e)?new Date(e):e)}function mr(t,e,r){let n;if(r||(r="default"),typeof r=="string")switch(n={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":n.timeZoneName="short";break;case"short":delete n.second}else n=r;return De(t,e,n)}function Me(t,e,r){const n=Ue(t);return ke(()=>Ce("number",n,r),()=>new Intl.NumberFormat(n,r)).format(e)}function rt(t,e,r,{offset:n=0,...o}){const s=Ue(t),i=e?ke(()=>Ce("plural-ordinal",s),()=>new Intl.PluralRules(s,{type:"ordinal"})):ke(()=>Ce("plural-cardinal",s),()=>new Intl.PluralRules(s,{type:"cardinal"}));return o[r]??o[i.select(r-n)]??o.other}function ke(t,e){const r=t();let n=tt.get(r);return n||(n=e(),tt.set(r,n)),n}function Ce(t,e,r){const n=e.join("-");return`${t}-${n}-${JSON.stringify(r)}`}const kt=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,Ct=t=>t.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(e,r,n)=>{if(r){const o=parseInt(r,16);return String.fromCharCode(o)}else{const o=parseInt(n,16);return String.fromCharCode(o)}}),Nt="%__lingui_octothorpe__%",fr=(t,e,r={})=>{const n=e||t,o=i=>typeof i=="object"?i:r[i],s=(i,a)=>{const u=Object.keys(r).length?o("number"):void 0,f=Me(n,i,u);return a.replace(new RegExp(Nt,"g"),f)};return{plural:(i,a)=>{const{offset:u=0}=a,f=rt(n,!1,i,a);return s(i-u,f)},selectordinal:(i,a)=>{const{offset:u=0}=a,f=rt(n,!0,i,a);return s(i-u,f)},select:hr,number:(i,a)=>Me(n,i,o(a)||{style:a}),date:(i,a)=>De(n,i,o(a)||a),time:(i,a)=>mr(n,i,o(a)||a)}},hr=(t,e)=>e[t]??e.other;function vr(t,e,r){return(n={},o)=>{const s=fr(e,r,o),i=(u,f=!1)=>Array.isArray(u)?u.reduce((g,p)=>
9{if(p==="#"&&f)return g+Nt;if(V(p))return g+p;const[m,d,c]=p;let v={};d==="plural"||d==="selectordinal"||d==="select"?Object.entries(c).forEach(([y,C])=>{v[y]=i(C,d==="plural"||d==="selectordinal")}):v=c;let b;if(d){const y=s[d];b=y(n[m],v)}else b=n[m];return b==null?g:g+b},""):u,a=i(t);return V(a)&&kt.test(a)?Ct(a):V(a)?a:a?String(a):""}}var gr=Object.defineProperty,pr=(t,e,r)=>e in t?gr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,br=(t,e,r)=>(pr(t,e+"",r),r);class yr{constructor(){br(this,"_events",{})}on(e,r){var n;return(n=this._events)[e]??(n[e]=[]),this._events[e].push(r),()=>this.removeListener(e,r)}removeListener(e,r){const n=this._getListeners(e);if(!n)return;const o=n.indexOf(r);~o&&n.splice(o,1)}emit(e,...r){const n=this._getListeners(e);n&&n.map(o=>o.apply(this,r))}_getListeners(e){const r=this._events[e];return Array.isArray(r)?r:!1}}var wr=Object.defineProperty,Er=(t,e,r)=>e in t?wr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,z=(t,e,r)=>(Er(t,typeof e!="symbol"?e+"":e,r),r);class kr extends yr{constructor(e){super(),z(this,"_locale",""),z(this,"_locales"),z(this,"_localeData",{}),z(this,"_messages",{}),z(this,"_missing"),z(this,"_messageCompiler"),z(this,"t",this._.bind(this)),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),e.localeData!=null&&this.loadLocaleData(e.localeData),(typeof e.locale=="string"||e.locales)&&this.activate(e.locale??Et,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(e,r){const n=this._localeData[e];n?Object.assign(n,r):this._localeData[e]=r}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,r){typeof e=="string"?this._loadLocaleData(e,r):Object.keys(e).forEach(n=>this._loadLocaleData(n,e[n])),this.emit("change")}_load(e,r){const n=this._messages[e];n?Object.assign(n,r):this._messages[e]=r}load(e,r){typeof e=="string"&&typeof r=="object"?this._load(e,r):Object.entries(e).forEach(([n,o])=>this._load(n,o)),this.emit("change")}loadAndActivate({locale:e,locales:r,messages:n}){this._locale=e,this._locales=r||void 0,this._messages[this._locale]=n,this.emit("change")}activate(e,r){this._locale=e,this._locales=r,this.emit("change")}_(e,r,n){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let o=n?.message;e||(e=""),V(e)||(r=e.values||r,o=e.message,e=e.id);const s=this.messages[e],i=s===void 0,a=this._missing;if(a&&i)return ur(a)?a(this._locale,e):a;i&&this.emit("missing",{id:e,locale:this._locale});let u=s||o||e;return V(u)&&(this._messageCompiler?u=this._messageCompiler(u):console.warn(`Uncompiled message detected! Message:
10
11> ${u}
12
13That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
14ICU features such as interpolation and plurals will not work properly for that message. 
15
16Please compile your catalog first. 
17`)),V(u)&&kt.test(u)?Ct(u):V(u)?u:vr(u,this._locale,this._locales)(r,n?.formats)}date(e,r){return De(this._locales||this._locale,e,r)}number(e,r){return Me(this._locales||this._locale,e,r)}}function Cr(t={}){return new kr(t)}const E=Cr(),We={titleText:"mb-0 h4 sm:h3"};var Nr={},Ir=Object.defineProperty,nt=Object.getOwnPropertySymbols,xr=Object.prototype.hasOwnProperty,Tr=Object.prototype.propertyIsEnumerable,ot=(t,e,r)=>e in t?Ir(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_r=(t,e)=>{for(var r in e||(e={}))xr.call(e,r)&&ot(t,r,e[r]);if(nt)for(var r of nt(e))Tr.call(e,r)&&ot(t,r,e[r]);return t},Fr=JSON.parse('{"icon.title.landscape":["Sol og fjell"]}'),Sr=JSON.parse('{"icon.title.landscape":["Sun and mountains"]}'),Lr=JSON.parse('{"icon.title.landscape":["Aurinko ja vuoret"]}'),Or=JSON.parse('{"icon.title.landscape":["Sol og bjerge"]}'),Rr=JSON.parse('{"icon.title.landscape":["Sol och berg"]}'),It=["en","nb","fi","da","sv"],xt="en",jr=()=>{var t;let e;switch((t=process==null?void 0:Nr)==null?void 0:t.NMP_BRAND){case"FINN":e="nb";break;case"TORI":e="fi";break;case"BLOCKET":e="sv";break;case"DBA":e="da";break;default:e="en"}return e},Tt=()=>{var t;const e=(t=document?.location)==null?void 0:t.hostname;return e?.includes("finn")?"nb":e.includes("tori")?"fi":e.includes("blocket")?"sv":e.includes("dba")?"da":xt},Se=t=>It.find(e=>t===e||t.toLowerCase().includes(e))||Tt();function Ar(){var t;if(typeof window>"u"){const e=jr();return Se(e)}try{const e=(t=document?.documentElement)==null?void 0:t.lang,r=Tt();return It.includes(e)?Se(e??r):(console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname"),Se(r))}catch(e){return console.warn("could not detect locale, falling back to source locale",e),xt}}var Pr=(t,e,r,n,o,s)=>t==="nb"?r:t==="fi"?n:t==="da"?o:t==="sv"?s:e,Mr=(t,e,r,n,o)=>{const s=Ar(),i=Pr(s,t,e,r,n,o);E.load(s,i),E.activate(s)};Mr(Sr,Fr,Lr,Or,Rr);var Br=E.t({message:"Sun and mountains",id:"icon.title.landscape",comment:"Title for landscape icon"}),$r=t=>l.createElement("svg",_r({xmlns:"http://www.w3.org/2000/svg",width:"56",height:"56",fill:"none",viewBox:"0 0 56 56",dangerouslySetInnerHTML:{__html:`<title>${Br}</title><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16M53 50 38.648 26.58A3.53 3.53 0 0 0 35.749 25a3.52 3.52 0 0 0-2.933 1.514l-9.393 13.464-5.821-4.685a3.53 3.53 0 0 0-2.749-.736 3.52 3.52 0 0 0-2.396 1.538L3 50"></path>`}},t)),Hr=$r,Ur={};function st(t,e,r,n,o,s,i){try{var a=t[s](i),u=a.value}catch(f){return void r(f)}a.done?e(u):Promise.resolve(u).then(n,o)}function D(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var s=t.apply(e,r);function i(u){st(s,n,o,i,a,"next",u)}function a(u){st(s,n,o,i,a,"throw",u)}i(void 0)})}}function _t(t,e,r){return(e=Gr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Be(){return Be=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}
vendor: 2,544 bytes, line 17
17).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Be.apply(null,arguments)}function at(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function it(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?at(Object(r),!0).forEach(function(n){_t(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):at(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Dr(t,e){if(t==null)return{};var r,n,o=Wr(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)r=s[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function Wr(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function Jr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Gr(t){var e=Jr(t,"string");return typeof e=="symbol"?e:e+""}var Vr=JSON.parse('{"addInAList":["Føj til liste"],"backButton":["Tilbage"],"chooseList":["Føj til en favoritliste"],"createListError":["Listen kunne ikke oprettes. Prøv venligst igen senere."],"createNewList":["Opret ny liste"],"createNewWantedList":["Opret ny ønskeliste"],"duplicateListError":["Du har allerede en liste med dette navn. Prøv igen med et andet navn."],"favoriteAddedErrorToast":["Kunne ikke tilføje favoritten. Prøv igen senere."],"favoriteAddedToast":["Favorit blev føjet til ",["folder"]],"favoriteRemovedErrorToast":["Kunne ikke fjerne favoritten, prøv igen senere."],"favoriteRemovedToast":["Fjern favorit fra ",["folder"]],"genericListErrorMessage":["Vi har lidt tekniske problemer. Prøv igen om lidt."],"genericListErrorTitle":["Hovsa!"],"heartButtonText":["Føj til favoritter."],"heartButtonTextToggled":["Tilføjet som favorit."],"heartIconAriaLabel":["Ikon formet som omridset af et hjerte"],"heartIconAriaLabelToggled":["Hjerteformet ikon med fyldfarve"],"listNameHelpText":[["length"]," / 40 tegn"],"listNameHelpTextErrorMinLength":["Indtast mindst ét tegn"],"listNameLabel":["Giv listen et navn"],"listNotFound":["Kunne ikke finde nogen lister, der matcher din 
17søgning"],"login":["Log ind"],"loginNudge":["Log ind for at føje annoncen til dine favoritter, så du nemt kan finde den igen, uanset hvor du er."],"newList":["Ny liste"],"notNow":["Ikke nu"],"searchLabel":["Søg efter en liste"],"searchPlaceholder":["Navn på en liste"]}'),qr=JSON.parse(`{"addInAList":["Add to list"],"backButton":["Back"],"chooseList":["Add to a favourite list"],"createListError":["The list could not be created. Please try again later."],"createNewList":["Create new list"],"createNewWantedList":["Create new wishlist"],"duplicateListError":["You already have a list with this name. Please give it another name."],"favoriteAddedErrorToast":["Couldn't add the favourite. Please try again later."],"favoriteAddedToast":["Favourite was added to ",["folder"]],"favoriteRemovedErrorToast":["Couldn't remove the favourite. Please try again later."],"favoriteRemovedToast":["Remove favourite from ",["folder"]],"genericListErrorMessage":["There are gremlins about. Try again in a bit."],"genericListErrorTitle":["Oops!"],"heartButtonText":["Add to favourites."],"heartButtonTextToggled":["Added as favourite."],"heartIconAriaLabel":["Icon of the outline of a heart"],"heartIconAriaLabelToggled":["Icon of a filled heart"],"listNameHelpText":[["length"]," / 40 characters"],"listNameHelpTextErrorMinLength":["Enter at least one character"],"listNameLabel":["Give the list a name"],"listNotFound":["Couldn't find any lists that match your search :("],"login":["Log in"],"loginNudge":["Log in to add the listing to your favourites so you can easily find it again, no matter where you are."],"newList":["New list"],"notNow":["Not now"],"searchLabel":["Search for a list"],"searchPlaceholder":["Name of a list"]}`),zr=JSON.parse('{"addInAList":["Tallenna"],"backButton":["Peruuta"],"chooseList":["Tallenna suosikkeihin"],"createListError":["Kansiota ei voitu luoda. Yritä myöhemmin uudelleen."],"createNewList":["Luo uusi kansio"],"createNewWantedList":["Luo toivelista"],"duplicateListError":["Tämän niminen kansio on jo olemassa. Yritä uudelleen eri nimellä."],"favoriteAddedErrorToast":["Ilmoitusta ei voitu lisätä suosikiksi. Yritä myöhemmin uudelleen."],"favoriteAddedToast":["Ilmoitus tallennettu kansioon ",["folder"]],"favoriteRemovedErrorToast":["Ilmoitusta ei voitu poistaa suosikeista. Yritä myöhemmin uudelleen."],"favoriteRemovedToast":["Ilmoitus poistettu kansiosta ",["folder"]],"genericListErrorMessage":["Jotain meni pieleen. Yritä hetken päästä uudelleen."],"genericListErrorTitle":["Hups!"],"heartButtonText":["Lisää suosikiksi."],"heartButtonTextToggled":["Lisätty suosikkeihin."],"heartIconAriaLabel":["Sydämen ääriviivojen kuvake"],"heartIconAriaLabelToggled":["Täytetyn sydämen kuvake"],"listNameHelpText":[["length"]," / 40 merkkiä"],"listNameHelpTextErrorMinLength":["Syötä vähintään yksi merkki"],"listNameLabel":["Nimi"],"listNotFound":["Hakua vastaavia kansioita ei löytynyt"],"login":["Kirjaudu sisään"],"loginNudge":["Kirjaudu sisään, niin voit lisätä ilmoituksen suosikiksi. Näin löydät sen helposti uudelleen."],"newList":["Luo uusi kansio"],"notNow":["Ei nyt"],"searchLabel":["Hae kansiota"],"searchPlaceholder":["Kansion nimi"]}'),Qr=JSON.parse('{"addInAList":["Legg i liste"],"backButton":["Tilbake"],"chooseList":["Legg til på favorittliste"],"createListError":["Listen kunne ikke opprettes. Prøv igjen senere."],"createNewList":["Lag ny liste"],"createNewWantedList":["Lag ny ønskeliste"],"duplicateListError":["Du har allerede en liste med dette navnet. Gi listen et annet navn."],"favoriteAddedErrorToast":["Kunne ikke legge til favoritten. Prøv på nytt senere."],"favoriteAddedToast":["Favoritten ble lagt til i ",["folder"]],"favoriteRemovedErrorToast":["Kunne ikke fjerne favoritten. Prøv på nytt senere."],"favoriteRemovedToast":["Fjernet favoritten fra ",["folder"]],"genericListErrorMessage":["Nå er det rusk i maskineriet. Prøv igjen om litt."],"genericListErrorTitle":["Usjda!"],"heartButtonText":["Legg til som favoritt."],"heartButtonTextToggled":["Lagt til som favoritt."],"heartIconAriaLabel":["Ikon med hjerteomriss"],"heartIconAriaLabelToggled":["Ikon med fylt hjerte"],"listNameHelpText":[["length"]," / 40 tegn"],"listNameHelpTextErrorMinLength":["Skriv minst ett tegn"],"listNameLabel":["Gi listen et navn"],"listNotFound":["Fant ingen lister som svarer til søket ditt :("],"login":["Logg inn"],"loginNudge":["Logg inn for å legge annonsen i dine favorittlister. Da kan du lett finne de igjen senere, uansett hvor du er."],"newList":["Ny liste"],"notNow":["Ikke nå"],"searchLabel":["Søk etter en liste"],"searchPlaceholder":["Navn på en liste"]}'),Yr=JSON.parse('{"addInAList":["Lägg till i lista"],"backButton":["Tillbaka"],"chooseList":["Lägg till i en favoritlista"],"createListError":["Listan kunde inte skapas. Försök igen sen
17are."],"createNewList":["Skapa ny lista"],"createNewWantedList":["Skapa ny önskelista"],"duplicateListError":["Du har redan en lista med det här namnet. Välj ett annat namn."],"favoriteAddedErrorToast":["Det gick inte att lägga till favoriten. Försök igen senare."],"favoriteAddedToast":["Favorit lades till i ",["folder"]],"favoriteRemovedErrorToast":["Det gick inte att ta bort favoriten. Försök igen senare."],"favoriteRemovedToast":["Favorit borttagen från ",["folder"]],"genericListErrorMessage":["Gångjärnen behöver smörjas. Försök igen om en stund."],"genericListErrorTitle":["Hoppsan!"],"heartButtonText":["Lägg till i favoriter."],"heartButtonTextToggled":["Tillagd i favoriter."],"heartIconAriaLabel":["Ikon med siluett av ett hjärta"],"heartIconAriaLabelToggled":["Ikon med ett ifyllt hjärta"],"listNameHelpText":[["length"]," / 40 tecken"],"listNameHelpTextErrorMinLength":["Skriv minst ett tecken"],"listNameLabel":["Ge listan ett namn"],"listNotFound":["Det fanns inga listor som matchade din sökning :("],"login":["Logga in"],"loginNudge":["Logga in för att lägga till listan i dina favoriter så att du enkelt hittar den igen, var du än är."],"newList":["Ny lista"],"notNow":["Inte nu"],"searchLabel":["Sök efter en lista"],"searchPlaceholder":["Namn på en lista"]}'),Kr=t=>l.createElement("svg",{"aria-label":t.ariaLabel,xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 16 16"},l.createElement("path",{fill:t.fill||"none",stroke:t.stroke||"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8.002 14.5 2.035 7.892a3.888 3.888 0 0 1-.99-2.057 3.93 3.93 0 0 1 .328-2.267v0A3.528 3.528 0 0 1 2.415 2.23a3.425 3.425 0 0 1 1.532-.682 3.39 3.39 0 0 1 1.667.131 3.454 3.454 0 0 1 1.412.914l.976 1.035.974-1.034c.39-.418.875-.731 1.412-.913a3.39 3.39 0 0 1 1.665-.131 3.43 3.43 0 0 1 1.532.681c.448.352.806.81 1.041 1.336v0c.332.704.447 1.494.329 2.267a3.885 3.885 0 0 1-.99 2.056L8.002 14.5Z"})),Xr=ne((t,e)=>{var{className:r,onClick:n,toggled:o,variant:s,numFavs:i}=t,a={},u={},f="inline-flex items-center justify-center flex-row-reverse ".concat(o?"s-text-link":""," ").concat(r??"");switch(s){case"heart":a={pill:!0,className:f};break;case"heart-blue":a={pill:!0,className:f},u={stroke:"var(--w-s-color-icon-primary)"};break;case"heart-on-image":a={pill:!0,className:f},u={stroke:"var(--w-s-color-icon-inverted)",fill:"var(--w-s-color-icon-subtle)"};break;case"button":a={utility:!0,quiet:!0,className:f};break;case"button-with-text":a={utility:!0,quiet:!0,className:"".concat(f," whitespace-nowrap")};break;case"button-on-image":a={utility:!0,quiet:!0,className:"".concat(f," whitespace-nowrap shadow-s")};break}u=it(it({},u),{},{ariaLabel:o?E.t({id:"heartIconAriaLabelToggled",message:"Icon of a filled heart"}):E.t({id:"heartIconAriaLabel",message:"Icon of the outline of a heart"})}),o&&(u.fill="var(--w-s-color-icon-primary)",u.stroke="var(--w-s-color-icon-primary)");var g=()=>o?E.t({id:"heartButtonTextToggled"}):E.t({id:"heartButtonText"});return l.createElement(X,Be({"aria-haspopup":"dialog","aria-pressed":o,onClick:n,ref:e},a),i>0?l.createElement("span",{className:"pl-4"},i):null,l.createElement("span",{className:"ml-14 ".concat(s!=="button-with-text"&&"sr-only")},g()),l.createElement(Kr,u))});class $e extends Error{constructor(e,r){super(e),_t(this,"isDueToConflict",void 0),this.name="CreateFolderError",this.isDueToConflict=r}}class He extends Error{constructor(e){super(e),this.name="AddFavoriteError"}}class lt extends Error{constructor(e){super(e),this.name="RemoveFavoriteError"}}var Ft=(function(){var t=D(function*(e){var{api:r,folderId:n,itemId:o,itemType:s}=e;try{var i=yield r.addToFolder(s,o,n);if(i.status!==201)return{ok:!1,error:new He("Could not add item ".concat(o," to folder ").concat(n,". Status code: ").concat(i.status,"."))};var a={type:"Click",intent:"Save",name:"New favorite",object:{id:"favoritelist:".concat(n),type:"UIElement",elementType:"Popup",name:"Favorite List",items:[{type:"ClassifiedAd",id:s==="Hotel"?"hotel:".concat(o):"".concat(o),contentId:"".concat(o),name:"n/a",category:"n/a"}]},target:{id:s==="Hotel"?"classified:hotel:".concat(o):"classified:".concat(o),type:"SavedList",name:"Favorite list"}};return $.trackEvent(a),{ok:!0,value:void 0}}catch{return{ok:!1,error:new He("Unknown error occurred")}}});return function(r){return t.apply(this,arguments)}})(),Zr=(function(){var t=D(function*(e){var{api:r,folderId:n,itemId:o,itemType:s}=e;try{var i=yield r.removeFromFolder(s,o,n);if(i.status!==204)return{ok:!1,error:new lt("Could not remove item ".concat(o," from folder ").concat(n,". Status code: ").concat(i.status,"."))};var a={type:"Click",intent:"Edit",name:"New favorite",object:{id:"favoritelist:".concat(n),type:"UIElement",elementType:"Button",name:"Favorite List",items:[{type:"ClassifiedAd",id:s==="Hotel"?"hotel:".concat(o):"".concat(o),contentId:"".concat(o),name:"n/a",category:"n/a"}]},target:{id:s==="Hotel"?"classified:hotel:".concat(o):"classified:".concat(o),type:"FavoriteItem",name:"Classified Ad"}};return $.trackEvent(a),{ok:!0,value:void 0}}catch{return{ok:!1,error:new lt("Unknown error occurred")}}});return function(r){return t.apply(this,arguments)}})(),en=(function(){var t=D(function*(e){var{api:r,folderName:n}=e;try{var o=yield r.createFolder(n);if(!o.ok)return{ok:!1,error:new $e("".concat(o.status),o.status===409)};var{folderid:s}=yield o.json(),i={type:"Click",intent:"Create",name:"New favorite list",object:{type:"UIElement",id:"favoritelist:".concat(s),elementType:"Popup"},target:{id:"favoritelist:".concat(s),type:"SavedList",name:"Favorite list"}};return $.trackEvent(i),{ok:!0,value:s}}catch{return{ok:!1,error:new $e("Unknown error occurred",!1)}}});return function(r){return t.apply(this,arguments)}})(),tn=ne((t,e)=>{var{adExists:r,itemType:n,itemId:o,api:s,closeCallback:i,folder:a,handleError:u}=t;function f(){return g.apply(this,arguments)}function g(){return g=D(function*(){u(""),r?yield d():yield p()}),g.apply(this,arguments)}function p(){return m.apply(this,arguments)}function m(){return m=D(function*(){var v=yield Ft({api:s,itemType:n,itemId:o,folderId:a.folderid});v.ok?(Ee(E.t({id:"favoriteAddedToast",values:{folder:a.name}}),{type:"success"}),i()):(console.error(v.error),u(E.t({id:"favoriteAddedErrorToast"})))}),m.apply(this,arguments)}function d(){return c.apply(this,arguments)}function c(){return c=D(function*(){var v=yield Zr({api:s,itemType:n,itemId:o,folderId:a.folderid});v.ok?(Ee(E.t({id:"favoriteRemovedToast",values:{folder:a.name}}),{type:"success"}),i()):(console.error(v.error),u(E.t({id:"favoriteRemovedErrorToast"})))}),c.apply(this,arguments)}return l.createElement(Qt,{selected:r},l.createElement("div",{className:"grid grid-cols-4 md:grid-cols-3 flex-row"},a.image?l.createElement("img",{style:{aspectRatio:"1/1"},className:"w-full rounded-l-8 object-cover",src:a.image,alt:"Description"}):l.createElement(Hr,{className:"w-full rounded-l-8 p-24 h-full image-aspect object-cover s-icon-subtle s-bg-subtle"}),l.createElement("div",{className:"col-span-2 p-16"},l.createElement(Yt,{onClick:f},l.createElement("p",{className:"text-s text-left text-ellipsis line-clamp-2"},a.name.trim())))))});function rn(t){var{currentPage:e,totalPages:r=0,setCurrentPage:n}=t,o=l.useCallback(s=>{var i={object:{type:"Listing",layout:"List",pageNumber:s}};$.trackPageView(i),n(s)},[n]);return!r||r<=1?null:l.createElement(zt,{className:"pt-8 pb-4",createHref:()=>"#",currentPage:e,lastPage:r,onChange:o})}var nn=t=>{var{onSearch:e,initialFocusRef:r}=t;return l.createElement(bt,{ref:r,label:E.t({id:"searchLabel"}),type:"search",placeholder:E.t({id:"searchPlaceholder"}),onChange:n=>e(n.target.value)},l.createElement(qt,{suffix:!0,search:!0,onClick:()=>e(r.textfield.value)}))},on=t=>{var{pageSize:e,folders:r,searchQuery:n,specialButtons:o}=t,[s,i]=S(1),a=Pe(()=>{var f=Math.ceil((r.length+o)/e),g=(s-1)*e-(s>1?o:0),p=Math.min(s*e-1-o,r.length-1);return{totalPages:f,startIndex:g,endIndex:p}},[s,r.length,e,o]),u=Pe(()=>r.filter((f,g)=>g>=a.startIndex&&g<=a.endIndex),[r,a.endIndex,a.startIndex]);return q(()=>{(n||r.length)&&i(1)},[n,r.length]),{pagination:a,paginatedFolders:u,currentPage:s,setCurrentPage:i}},sn=t=>{var{items:e}=t,[r,n]=S(""),o=Pe(()=>{var s=r.toLowerCase();return s?e.filter(i=>i.name.toLowerCase().includes(s)):e},[e,r]);return{searchQuery:r,setSearchQuery:n,filteredFavoriteLists:o}},an=ne((t,e)=>{var{itemType:r,itemId:n,api:o,closeCallback:s,folders:i,foldersWithItem:a,setErrorMessage:u,toggleCreateNewFolder:f}=t;return l.createElement("div",{className:"grid md:grid-cols-2 gap-16 mt-24 pb-24"},i.map((g,p)=>l.createElement("div",{key:g.folderid},l.createElement(tn,{ref:!f&&p===0?e:void 0,adExists:!!a.folderIds&&a.folderIds.includes(g.folderid),itemType:r,itemId:n,api:o,closeCallback:s,folder:g,handleError:m=>u(m),key:g.folderid}))))}),ln=t=>{var{itemType:e,itemId:r,api:n,closeCallback:o,errorMessage:s,foldersWithItem:i,items:a,setErrorMessage:u,toggleCreateNewFolder:f,initialFocusRef:g,mobileFocusHeading:p}=t,{filteredFavoriteLists:m,searchQuery:d,setSearchQuery:c}=sn({items:a});function v(){c(""),f()}var{currentPage:b,paginatedFolders:y,pagination:C,setCurrentPage:w}=on({folders:m,pageSize:6,searchQuery:d,specialButtons:0}),x=Y(null),F=Y(null),[R,P]=S(!1),B=we(O=>{w(O),P(!0)},[w]);q(()=>{if(p){var O;(O=x.current)===null||O===void 0||O.focus()}},[p]),q(()=>{R&&b>=0&&F.current&&(F.current.focus(),P(!1))},[b,R]);var W=l.createElement(l.Fragment,null),j=l.createElement(l.Fragment,null,l.createElement("div",{className:"grid grid-cols-5 items-end gap-16 mb-16 outline-none",ref:x,tabIndex:p?0:-1},l.createElement("div",{className:"col-span-5 sm:col-span-3"},l.createElement(nn,{onSearch:O=>c(O),initialFocusRef:g})),l.createElement(X,{utility:!0,onClick:v,className:"col-span-5 sm:col-span-2 lt-sm:min-w-full"},E.t({id:"createNewList",message:"Create new list"}))),d!==""&&m.length<1?l.createElement("p",{className:"pt-32 px-8 text-center text-m font-bold"},E.t({id:"listNotFound",message:"Couldn't find any lists that match your search :("})):l.createElement("span",null),l.createElement(Vt,{type:"negative",show:!!s},l.createElement("p",{className:"font-bold"},E.t({id:"genericListErrorTitle",message:"Oops!"})),l.createElement("p",null,s||E.t({id:"genericListErrorMessage",message:"There are gremlins about. Try again in a bit."}))),l.createElement(an,{ref:F,itemType:e,itemId:r,api:n,closeCallback:o,folders:y,foldersWithItem:i,setErrorMessage:u,toggleCreateNewFolder:b!==1||d?void 0:f}),l.createElement(rn,{currentPage:b,setCurrentPage:B,totalPages:C.totalPages}));return[j,W,l.createElement("h1",{className:We.titleText},E.t({id:"chooseList",message:"Add to a favourite list"}))]},cn=(t,e)=>{var r=o=>(s,i)=>s.default?-1:i.default?1:o.includes(s.folderid)&&o.includes(i.folderid)?0:o.includes(s.folderid)?-1:o.includes(i.folderid)?1:0;if(t){var n=r(t);return e.sort(n)}else return e},dn=t=>{var{api:e,itemType:r,itemId:n,userId:o,isOpen:s}=t,[i,a]=S([]),[u,f]=S({itemType:r,itemId:n,folderIds:[]}),[g,p]=S("");return q(()=>{if(!s)return;var m=!1;function d(){return c.apply(this,arguments)}function c(){return c=D(function*(){try{var[v,b]=yield Promise.all([e.fetchFoldersForItem(r,n),e.fetchFolders().then(C=>C.json())]);if(!m){f(v);var y=cn(v.folderIds,b);a(y)}}catch(C){console.error(C),p(E.t({id:"genericListErrorMessage"}))}}),c.apply(this,arguments)}if(o)return d(),()=>{m=!0}},[r,n,e,o,s]),{items:i,errorMessage:g,foldersWithItem:u}},un=t=>{var{toggled:e,userId:r,itemType:n,itemId:o,isOpen:s}=t;q(()=>{if(s&&r){var i={type:"Click",intent:e?"Delete":"Create",name:"New favorite",object:{id:n==="Hotel"?"classified:hotel:".concat(o):"classified:".concat(o),type:"UIElement",elementType:"Button",items:[{type:"ClassifiedAd",id:n==="Hotel"?"hotel:".concat(o):"".concat(o),contentId:"".concat(o),name:"n/a",category:"n/a"}]},target:{id:n==="Hotel"?"classified:hotel:".concat(o):"classified:".concat(o),type:"FavoriteItem",name:"Classified Ad"}};$.trackEvent(i)}},[s])},mn=t=>{var{closeCallback:e,redirectUrl:r=window.location.href}=t,n=l.createElement(l.Fragment,null,l.createElement(X,{quiet:!0,className:"mr-8",onClick:e},E.t({id:"notNow",message:"Not now"})),l.createElement(X,{primary:!0,href:"/auth/login?redirectUrl=".concat(encodeURIComponent(r))},E.t({id:"login",message:"Log in"}))),o=l.createElement("div",null,l.createElement("p",null,E.t({id:"loginNudge",message:"Log in to add the listing to your favourites so you can easily find it again, no matter where you are."})));return[o,n,l.createElement("h3",{className:We.titleText},E.t({id:"login",message:"Log in"}))]},fn=t=>{var{api:e,itemType:r,itemId:n,setErrorMessage:o,closeCallback:s}=t,i=Y(!1);return(function(){var a=D(function*(u){if(!i.current){i.current=!0;try{var f=yield en({api:e,folderName:u});if(!f.ok)throw f.error;var g=yield Ft({api:e,folderId:f.value,itemId:n,itemType:r});if(!g.ok)throw g.error;Ee(E.t({id:"favoriteAddedToast",values:{folder:u}}),{type:"success"}),s()}
17catch(p){switch(i.current=!1,!0){case p instanceof $e:console.error(p),p.isDueToConflict?o(E.t({id:"duplicateListError"})):o(E.t({id:"createListError"}));break;case p instanceof He:console.error(p),Ee(E.t({id:"favoriteAddedErrorToast"}),{type:"error"}),s();break;default:console.error("Unknown error occurred",p)}}}});return function(u){return a.apply(this,arguments)}})()},hn=ne((t,e)=>{var{itemType:r,itemId:n,api:o,closeCallback:s,initialFocusRef:i}=t,[a,u]=S(""),[f,g]=S(""),p=fn({api:o,itemType:r,itemId:n,setErrorMessage:g,closeCallback:s});function m(){return d.apply(this,arguments)}function d(){return d=D(function*(){if(!a.trim()){i&&i.current&&i.current.focus(),v(!0);return}return p(a)}),d.apply(this,arguments)}Dt(e,()=>({submit:()=>m()}));var[c,v]=S(!1),b=c&&a.trim().length<1,y=b?E.t({id:"listNameHelpTextErrorMinLength",message:"Enter at least one character"}):E.t({id:"listNameHelpText",message:"{length} / 40 characters",values:{length:a.length}}),C=l.createElement(bt,{invalid:c&&a.trim().length<1,helpText:y,label:E.t({id:"listNameLabel",message:"Give the list a name"}),minLength:1,maxLength:40,onChange:w=>u(w.target.value),ref:i,required:!0,value:a});return l.createElement("form",{className:"pb-8",onSubmit:w=>{w.preventDefault(),m()}},C,f&&l.createElement("p",{className:"s-text-negative",role:"alert"},f))}),vn=t=>{var{itemType:e,itemId:r,api:n,initialFocusRef:o,closeCallback:s,onCancel:i,onSubmit:a}=t,u=l.createElement(l.Fragment,null,l.createElement(X,{secondary:!0,quiet:!0,onClick:i,className:"mr-12"},E.t({id:"backButton",message:"Back"})),l.createElement(X,{primary:!0,onClick:a},E.t({id:"addInAList",message:"Add to list"}))),f=l.createElement(l.Fragment,null,l.createElement(hn,{itemType:e,itemId:r,api:n,initialFocusRef:o,closeCallback:s,ref:t.ref}));return[f,u,l.createElement("h1",{className:We.titleText},E.t({id:"newList",message:"New list"}))]},gn=typeof window<"u",pn=t=>{var{itemType:e,itemId:r,api:n,setOpen:o,isOpen:s,redirectUrl:i,restoreFocus:a,toggled:u,userId:f,isMobile:g}=t;un({toggled:u,userId:f,itemType:e,itemId:r,isOpen:s});var[p,m]=S(!1),d=we(()=>m(H=>!H),[]),[c,v]=S(null),{items:b,errorMessage:y,foldersWithItem:C}=dn({api:n,itemType:e,itemId:r,userId:f,isOpen:s}),w=Y(null),x=Y(null),F=Y(null),R=we(()=>{v(""),o(!1),m(!1),a()},[o,a]),P=c||y,B=mn({closeCallback:R,redirectUrl:i}),W=vn({itemType:e,itemId:r,api:n,initialFocusRef:F,closeCallback:R,ref:w,onCancel:d,onSubmit:()=>w.current.submit()}),j=ln({itemType:e,itemId:r,api:n,initialFocusRef:x,closeCallback:R,errorMessage:P,foldersWithItem:C,items:b,setErrorMessage:v,toggleCreateNewFolder:d,mobileFocusHeading:g&&s}),[O,K,_]=f?p?W:j:B,L=gn?window.innerWidth>479:0,Z=!f&&L?{"--f-modal-width":"295px"}:{};return l.createElement(Gt,{title:_,open:s,onDismiss:R,key:"favorite-modal",footer:K,right:!0,style:Z},O)},St=["en","nb","fi","da","sv"],Lt="en",bn=()=>{var t;switch(Ur.NMP_BRAND){case"FINN":t="nb";break;case"TORI":t="fi";break;case"DBA":t="da";break;default:t="en"}return t},Ot=()=>{var t,e=(t=document)===null||t===void 0||(t=t.location)===null||t===void 0?void 0:t.hostname;return e.includes("finn")?"nb":e.includes("tori")?"fi":e.includes("dba")?"da":Lt},Le=t=>St.find(e=>t===e||t.toLowerCase().includes(e))||Ot();function yn(){if(typeof window>"u"){var t=bn();return Le(t)}try{var e,r=(e=document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.lang,n=Ot();return St.includes(r)?Le(r??n):(console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname"),Le(n))}catch(o){return console.warn("could not detect locale, falling back to source locale",o),Lt}}var wn=(t,e,r,n,o,s)=>t==="nb"?r:t==="fi"?n:t==="da"?o:t==="sv"?s:e,En=(t,e)=>{var{enMessages:r,nbMessages:n,fiMessages:o,daMessages:s,svMessages:i}=t,a=e??yn(),u=wn(a,r,n,o,s,i);E.load(a,u),E.activate(a)},kn=["redirectUrl"],Oe;function Cn(t){return Oe||(Oe=new te(t.userId||"",void 0,void 0,1e3*60*5,t.fetch,t.baseUri)
17),Oe}function Nn(t){var{redirectUrl:e}=t,r=Dr(t,kn),n=Cn(r),{userId:o}=r,s=ne((i,a)=>{var u,f,{buttonClass:g,itemType:p,itemId:m,redirectUrl:d=e,renderNumFavs:c,variant:v,isMobile:b,locale:y}=i,[C,w]=S(!1),[x,F]=S((u=i.toggled)!==null&&u!==void 0?u:!1),[R,P]=S((f=i.isOpen)!==null&&f!==void 0?f:!1),[B,W]=S(0),j=Y(null);En({enMessages:qr,nbMessages:Qr,fiMessages:zr,daMessages:Vr,svMessages:Yr},y),q(()=>{if(o){var _=n.getFavoriteState(p,m,L=>F(L));if(_)return()=>_()}},[p,m]),q(()=>{if(c){var _=n.subscribeToRecount(p,m,W);if(_)return()=>_()}},[p,m,c]),q(()=>{w(!0)},[]);var O=we(()=>{setTimeout(()=>{j.current&&document.activeElement!==j.current&&(dr(j.current,{block:"center",inline:"center",scrollMode:"if-needed"}),j.current.focus())},0)},[]),K={itemType:p,itemId:m,api:n,isOpen:R,setOpen:P,redirectUrl:d,restoreFocus:O,toggled:x,userId:o,isMobile:b};return r.renderServerSide||C?l.createElement(l.Fragment,null,l.createElement(Xr,{className:g,numFavs:B,onClick:()=>P(!0),ref:_=>{j.current=_,a&&(typeof a=="function"?a(_):a.current=_)},toggled:x,variant:v}),typeof window<"u"?Jt.createPortal(l.createElement(pn,K),r.modalAttach||document.body):""):l.createElement("span",null)});return s}const Rt=l.createContext(null);function In(t){const{children:e,rootElement:r}=t,n=l.useMemo(()=>({rootElement:r}),[r]);return h.jsx(Rt.Provider,{value:n,children:e})}function xn(){const t=l.useContext(Rt);if(t===null)throw new Error("useRootElement must be used within an RootElementProvider");return t}const jt=l.createContext(null);function Tn(t){const{children:e,favoriteBaseUrl:r,isMobile:n,locale:o,loginId:s}=t,{rootElement:i}=xn(),a=Nn({baseUri:r,...i&&{modalAttach:i},renderServerSide:!0,userId:s});return h.jsx(jt.Provider,{value:{Heart:a,isMobile:n,locale:o},children:e})}function _n(t){const{Heart:e,isMobile:r=!1,locale:n="en"}=l.useContext(jt)??{};if(!e)throw new Error("FavoriteHeart must be used within an FavoriteHeartProvider");return e?h.jsx(e,{isMobile:r,itemType:"Ad",locale:n,...t}):null}/**
18 * @license
19 * Copyright 2018 Google LLC
20 * SPDX-License-Identifier: BSD-3-Clause
21 */const Fn=new Set(["children","localName","ref","style","className"]),ct=new WeakMap,dt=(t,e,r,n,o)=>{const s=o?.[e];s===void 0?(t[e]=r,r==null&&e in HTMLElement.prototype&&t.removeAttribute(e)):r!==n&&((i,a,u)=>{let f=ct.get(i);f===void 0&&ct.set(i,f=new Map);let g=f.get(a);u!==void 0?g===void 0?(f.set(a,g={handleEvent:u}),i.addEventListener(a,g)):g.handleEvent=u:g!==void 0&&(f.delete(a),i.removeEventListener(a,g))})(t,s,r)},k=({react:t,tagName:e,elementClass:r,events:n,displayName:o})=>{const s=new Set(Object.keys(n??{})),i=t.forwardRef(((a,u)=>{const f=t.useRef(new Map),g=t.useRef(null),p={},m={};for(const[d,c]of Object.entries(a))Fn.has(d)?p[d==="className"?"class":d]=c:s.has(d)||d in r.prototype?m[d]=c:p[d]=c;return t.useLayoutEffect((()=>{if(g.current===null)return;const d=new Map;for(const c in m)dt(g.current,c,a[c],f.current.get(c),n),f.current.delete(c),d.set(c,a[c]);for(const[c,v]of f.current)dt(g.current,c,void 0,v,n);f.current=d})),t.useLayoutEffect((()=>{g.current?.removeAttribute("defer-hydration")}),[]),p.suppressHydrationWarning=!0,t.createElement(e,{...p,ref:t.useCallback((d=>{g.current=d,typeof u=="function"?u(d):u!==null&&(u.current=d)}),[u])})}));return i.displayName=o??r.name,i};let Sn=class extends N{};const Ln=k({tagName:"w-affix",elementClass:Sn,react:l}),On=l.forwardRef(({ariaLabel:t,...e},r)=>l.createElement(Ln,{...e,...t!==void 0?{"aria-label":t}:{},ref:r}));On.displayName="Affix";let Rn=class extends N{};k({tagName:"w-alert",elementClass:Rn,react:l});let jn=class extends N{};const An=k({tagName:"w-attention",elementClass:jn,react:l,events:{onClose:"close",onclose:"close"}}),Pn=l.forwardRef(({canClose:t,noArrow:e,crossAxis:r,fallbackPlacements:n,...o},s)=>l.createElement(An,{...o,...t?{"can-close":!0}:{},...e?{"no-arrow":!0}:{},...r?{"cross-axis":!0}:{},...n!==void 0?{"fallback-placements":JSON.stringify(n)}:{},ref:s})),Mn=Pn;Mn.displayName="Attention";let Bn=class extends N{};const Re=k({tagName:"w-badge",elementClass:Bn,react:l});let $n=class extends N{};k({tagName:"w-box",elementClass:$n,react:l});let Hn=class extends N{};k({tagName:"w-breadcrumb-item",elementClass:Hn,react:l});let Un=class extends N{};k({tagName:"w-breadcrumbs",elementClass:Un,react:l});let Dn=class extends N{};const Wn=k({tagName:"w-button",elementClass:Dn,react:l}),Jn=l.forwardRef(({fullWidth:t,iconOnly:e,...r},n)=>l.createElement(Wn,{...r,...t?{"full-width":!0}:{},...e?{"icon-only":!0}:{},ref:n}));Jn.displayName="Button";let Gn=class extends N{};k({tagName:"w-card",elementClass:Gn,react:l});let Vn=class extends N{};k({tagName:"w-checkbox",elementClass:Vn,react:l,events:{onChange:"change",onchange:"change"}});let qn=class extends N{};const zn=k({tagName:"w-checkbox-group",elementClass:qn,react:l}),Qn=l.forwardRef(({helpText:t,...e},r)=>l.createElement(zn,{...e,...typeof t=="string"?{"help-text":t}:{},ref:r},[e.children,typeof t<"u"&&typeof t!="string"?l.createElement("div",{slot:"help-text"},t):null]));Qn.displayName="CheckboxGroup";let Yn=class extends N{};const Kn=k({tagName:"w-combobox",elementClass:Yn,react:l,events:{onSelect:"select",onselect:"select",onChange:"change",onchange:"change",onBlur:"blur",onblur:"blur",onFocus:"focus",onfocus:"focus"}}),Xn=l.forwardRef(({openOnFocus:t,selectOnBlur:e,matchTextSegments:r,disableStaticFiltering:n,helpText:o,...s},i)=>l.createElement(Kn,{...s,...t?{"open-on-focus":!0}:{},...e?{"select-on-blur":!0}:{},...r?{"match-text-segments":!0}:{},...n?{"disable-static-filtering":!0}:{},...o!==void 0?{"help-text":o}:{},ref:i}));Xn.displayName="Combobox";let Zn=class extends N{};const eo=k({tagName:"w-datepicker",elementClass:Zn,react:l,events:{onChange:"change",onchange:"change",onBlur:"blur",onblur:"blur",onInput:"input",oninput:"input"}}),to=l.forwardRef(({headerFormat:t,weekdayFormat:e,dayFormat:r,...n},o)=>l.createElement(eo,{...n,...t!==void 0?{"header-format":t}:{},...e!==void 0?{"weekday-format":e}:{},...r!==void 0?{"day-format":r}:{},ref:o}));to.displayName="DatePicker";let ro=class extends N{};const no=k({tagName:"w-expandable",elementClass:ro,react:l}),oo=l.forwardRef(({buttonClass:t,contentClass:e,noChevron:r,headingLevel:n,...o},s)=>l.createElement(no,{...o,...t!==void 0?{"button-class":t}:{},...e!==void 0?{"content-class":e}:{},...r?{"no-chevron":!0}:{},...n!==void 0?{"heading-level":n}:{},ref:s}));oo.displayName="Expandable";let so=class extends N{};const re=k({tagName:"w-icon",elementClass:so,react:l});let ao=class extends N{};const io=k({tagName:"w-link",elementClass:ao,react:l}),lo=l.forwardRef(({fullWidth:t,...e},r)=>l.createElement(io,{...e,...t?{"full-width":!0}:{},ref:r}));lo.displayName="Link";
21let co=class extends N{};const uo=k({tagName:"w-modal-footer",elementClass:co,react:l}),mo=l.forwardRef(({...t},e)=>l.createElement(uo,{slot:"footer",...t,ref:e}));mo.displayName="ModalFooter";let fo=class extends N{};const ho=k({tagName:"w-modal-header",elementClass:fo,react:l,events:{onBackClicked:"backClicked",onbackClicked:"backClicked"}}),vo=l.forwardRef(({noClose:t,...e},r)=>l.createElement(ho,{slot:"header",...e,...t?{"no-close":!0}:{},ref:r}));vo.displayName="ModalHeader";let go=class extends N{};const po=k({tagName:"w-modal",elementClass:go,react:l,events:{onShown:"shown",onshown:"shown",onHidden:"hidden",onhidden:"hidden"}}),bo=l.forwardRef(({contentId:t,ignoreBackdropClicks:e,...r},n)=>l.createElement(po,{...r,...t!==void 0?{"content-id":t}:{},...e?{"ignore-backdrop-clicks":!0}:{},ref:n}));bo.displayName="Modal";let yo=class extends N{};const wo=k({tagName:"w-page-indicator",elementClass:yo,react:l}),Eo=l.forwardRef(({selectedPage:t,pageCount:e,...r},n)=>l.createElement(wo,{...r,...t!==void 0?{"selected-page":t}:{},...e!==void 0?{"page-count":e}:{},ref:n}));Eo.displayName="PageIndicator";let ko=class extends N{};const Co=k({tagName:"w-pagination",elementClass:ko,react:l,events:{onPageClick:"page-click","onpage-click":"page-click"}}),No=l.forwardRef(({baseUrl:t,currentPageNumber:e,visiblePages:r,...n},o)=>l.createElement(Co,{...n,...t!==void 0?{"base-url":t}:{},...e!==void 0?{"current-page":e}:{},...r!==void 0?{"visible-pages":r}:{},ref:o}));No.displayName="Pagination";let Io=class extends N{};const xo=k({tagName:"w-pill",elementClass:Io,react:l,events:{onClick:"w-pill-click",onclick:"w-pill-click",onClose:"w-pill-close",onclose:"w-pill-close"}}),To=l.forwardRef(({canClose:t,openSrLabel:e,openAriaLabel:r,closeSrLabel:n,closeAriaLabel:o,...s},i)=>l.createElement(xo,{...s,...t?{"can-close":!0}:{},...e!==void 0?{"open-sr-label":e}:{},...r!==void 0?{"open-aria-label":r}:{},...n!==void 0?{"close-sr-label":n}:{},...o!==void 0?{"close-aria-label":o}:{},ref:i}));To.displayName="Pill";let _o=class extends N{};k({tagName:"w-radio",elementClass:_o,react:l});let Fo=class extends N{};const So=k({tagName:"w-radio-group",elementClass:Fo,react:l,events:{onInput:"input",oninput:"input",onChange:"change",onchange:"change"}}),Lo=l.forwardRef(({helpText:t,...e},r)=>l.createElement(So,{...e,...typeof t=="string"?{"help-text":t}:{},ref:r},[e.children,typeof t<"u"&&typeof t!="string"?l.createElement("div",{slot:"help-text"},t):null]));Lo.displayName="RadioGroup";let At=class extends N{};const Oo=k({tagName:"w-select",elementClass:At,react:l,events:{onChange:"change",onchange:"change"}}),Ro=l.forwardRef(({autoFocus:t,helpText:e,readOnly:r,...n},o)=>l.createElement(Oo,{...n,...t?{"auto-focus":!0}:{},...typeof e=="string"?{"help-text":e}:{},...r?{"read-only":!0}:{},ref:o},[n.children,typeof e<"u"&&typeof e!="string"?l.createElement("div",{slot:"help-text"},e):null]));Ro.displayName="Select";k({tagName:"w-option",elementClass:At,react:l});let jo=class extends N{};const Ao=k({tagName:"w-slider-thumb",elementClass:jo,react:l,events:{onSliderValidity:"slidervalidity","onslider-validity":"slidervalidity"}}),Po=l.forwardRef(({ariaLabel:t,ariaDescription:e,...r},n)=>l.createElement(Ao,{...r,...t!==void 0?{"aria-label":t}:{},...e!==void 0?{"aria-description":e}:{},ref:n}));Po.displayName="SliderThumb";let Mo=class extends N{};const Bo=k({tagName:"w-slider",elementClass:Mo,react:l}),$o=l.forwardRef(({openEnded:t,helpText:e,hiddenTextfield:r,...n},o)=>l.createElement(Bo,{...n,...t?{"open-ended":!0}:{},...typeof e=="string"?{"help-text":e}:{},...r?{"hidden-textfield":!0}:{},ref:o},[n.children,typeof e<"u"&&typeof e!="string"?l.createElement("span",{slot:"help-text"},e):null]));$o.displayName="Slider";let Ho=class extends N{};k({tagName:"w-snackbar",elementClass:Ho,react:l});let Uo=class extends N{};const Do=k({tagName:"w-snackbar-item",elementClass:Uo,react:l});l.forwardRef(({actionPlacement:t,...e},r)=>l.createElement(Do,{...e,...t?{"action-placement":t}:{},ref:r}));let Wo=class extends N{};k({tagName:"w-step",elementClass:Wo,react:l});let Jo=class extends N{};k({tagName:"w-step-indicator",elementClass:Jo,react:l});let Go=class extends N{};k({tagName:"w-switch",elementClass:Go,react:l,events:{onChange:"change",onchange:"change"}});let Vo=class extends N{};const qo=k({tagName:"w-tab",elementClass:Vo,react:l,events:{onClick:"click",onclick:"click"}}),zo=l.forwardRef(({ariaSelected:t,htmlFor:e,...r},n)=>l.createElement(qo,{slot:"tabs",for:e,...r,...t!==void 0?{"aria-selected":t}:{},ref:n}));zo.displayName="Tab";let Qo=class extends N{};const Yo=k({tagName:"w-tab-panel",elementClass:Qo,react:l}),Ko=l.forwardRef(({...t},e)=>l.createElement(Yo,{slot:"panels",...t,ref:e}));Ko.displayName="TabPanel";let Xo=class extends N{};const Zo=k({tagName:"w-tabs",elementClass:Xo,react:l,events:{onChange:"change",onchange:"change"}}),es=l.forwardRef(({...t},e)=>l.createElement(Zo,{...t,ref:e}));es.displayName="Tabs";let ts=class extends N{};const rs=k({tagName:"w-textarea",elementClass:ts,react:l,events:{onBlur:"blur",onblur:"blur",onChange:"change",onchange:"change",onInput:"input",oninput:"input",onFocus:"focus",onfocus:"focus"}}),ns=l.forwardRef(({helpText:t,maxRows:e,minRows:r,maxLength:n,minLength:o,readOnly:s,...i},a)=>l.createElement(rs,{...i,...typeof t=="string"?{"help-text":t}:{},...e!==void 0?{"maximum-rows":e}:{},...r!==void 0?{"minimum-rows":r}:{},...n!==void 0?{maxlength:n}:{},...o!==void 0?{minlength:o}:{},...s?{"read-only":!0}:{},ref:a},[i.children,typeof t<"u"&&typeof t!="string"?l.createElement("div",{slot:"help-text"},t):null]));ns.displayName="Textarea";let os=class extends N{};const ss=k({tagName:"w-textfield",elementClass:os,react:l,events:{onBlur:"blur",onblur:"blur",onChange:"change",onchange:"change",onInput:"input",oninput:"input",onFocus:"focus",onfocus:"focus"}}),as=l.forwardRef(({helpText:t,minLength:e,maxLength:r,readOnly:n,...o},s)=>l.createElement(ss,{...o,...typeof t=="string"?{"help-text":t}:{},...e!==void 0?{"min-length":e}:{},...r!==void 0?{"max-length":r}:{},...n?{"read-only":!0}:{},ref:s},[o.children,typeof t<"u"&&typeof t!="string"?l.createElement("div",{slot:"help-text"},t):null]));as.displayName="TextField";class is extends N{}const ls=k({tagName:"w-tooltip",elementClass:is,react:l}),cs=l.forwardRef(({htmlFor:t,...e},r)=>l.createElement(ls,{for:t,...e,ref:r}));cs.displayName="Tooltip";const ut=5e3,ds=50;function us(t){const e=`${t}/broken-image-counter`,r=[];let n=null;async function o(){if(r.length===0)return;const i=r.splice(0,ds);n=null,r.length>0&&(n=setTimeout(o,ut));try{await fetch(e,{body:JSON.stringify({items:i}),headers:{"Content-Type":"application/json"},keepalive:!0,method:"POST"})}catch{}}function s(i,a){r.push(a?{itemId:i,url:a}:{itemId:i}),n||(n=setTimeout(o,ut))}return typeof window<"u"&&window.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&r.length>0&&o()}),s}const Pt=l.createContext(null);function ms(t){const{apiUrl:e,children:r}=t,n=l.useMemo(()=>({apiUrl:e}),[e]);return h.jsx(Pt.Provider,{value:n,children:r})}function fs(){const t=l.useContext(Pt);if(t===null)throw new Error("useAppConfig must be used within an AppConfigProvider");return t}let je=null;function Mt(){const{apiUrl:t}=fs();return je||(je=us(t)),je}
21function Bt(t,e){const r=new URLSearchParams;Object.entries(t.params??{}).forEach(([o,s])=>{s.forEach(i=>{r.append(o,i)})});const n=new URL(t.path,e);return n.search=r.toString(),n}var pe={},mt={},ft;function hs(){return ft||(ft=1,(function(){if(typeof window!="object")return;if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype){"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});return}var t=window.document;function e(m){this.time=m.time,this.target=m.target,this.rootBounds=m.rootBounds,this.boundingClientRect=m.boundingClientRect,this.intersectionRect=m.intersectionRect||f(),this.isIntersecting=!!m.intersectionRect;var d=this.boundingClientRect,c=d.width*d.height,v=this.intersectionRect,b=v.width*v.height;c?this.intersectionRatio=Number((b/c).toFixed(4)):this.intersectionRatio=this.isIntersecting?1:0}function r(m,d){var c=d||{};if(typeof m!="function")throw new Error("callback must be a function");if(c.root&&c.root.nodeType!=1)throw new Error("root must be an Element");this._checkForIntersections=o(this._checkForIntersections.bind(this),this.THROTTLE_TIMEOUT),this._callback=m,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(c.rootMargin),this.thresholds=this._initThresholds(c.threshold),this.root=c.root||null,this.rootMargin=this._rootMarginValues.map(function(v){return v.value+v.unit}).join(" ")}r.prototype.THROTTLE_TIMEOUT=100,r.prototype.POLL_INTERVAL=null,r.prototype.USE_MUTATION_OBSERVER=!0,r.prototype.observe=function(m){var d=this._observationTargets.some(function(c){return c.element==m});if(!d){if(!(m&&m.nodeType==1))throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:m,entry:null}),this._monitorIntersections(),this._checkForIntersections()}},r.prototype.unobserve=function(m){this._observationTargets=this._observationTargets.filter(function(d){return d.element!=m}),this._observationTargets.length||(this._unmonitorIntersections(),this._unregisterInstance())},r.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorIntersections(),this._unregisterInstance()},r.prototype.takeRecords=function(){var m=this._queuedEntries.slice();return this._queuedEntries=[],m},r.prototype._initThresholds=function(m){var d=m||[0];return Array.isArray(d)||(d=[d]),d.sort().filter(function(c,v,b){if(typeof c!="number"||isNaN(c)||c<0||c>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return c!==b[v-1]})},r.prototype._parseRootMargin=function(m){var d=m||"0px",c=d.split(/\s+/).map(function(v){var b=/^(-?\d*\.?\d+)(px|%)$/.exec(v);if(!b)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(b[1]),unit:b[2]}});return c[1]=c[1]||c[0],c[2]=c[2]||c[0],c[3]=c[3]||c[1],c},r.prototype._monitorIntersections=function(){this._monitoringIntersections||(this._monitoringIntersections=!0,this.POLL_INTERVAL?this._monitoringInterval=setInterval(this._checkForIntersections,this.POLL_INTERVAL):(s(window,"resize",this._checkForIntersections,!0),s(t,"scroll",this._checkForIntersections,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in window&&(this._domObserver=new MutationObserver(this._checkForIntersections),this._domObserver.observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))))},r.prototype._unmonitorIntersections=function(){this._monitoringIntersections&&(this._monitoringIntersections=!1,clearInterval(this._monitoringInterval),this._monitoringInterval=null,i(window,"resize",this._checkForIntersections,!0),i(t,"scroll",this._checkForIntersections,!0),this._domObserver&&(this._domObserver.disconnect(),this._domObserver=null))},r.prototype._checkForIntersections=function(){var m=this._rootIsInDom(),d=m?this._getRootRect():f();this._observationTargets.forEach(function(c){var v=c.element,b=u(v),y=this._rootContainsTarget(v),C=c.entry,w=m&&y&&this._computeTargetAndRootIntersection(v,d),x=c.entry=new e({time:n(),target:v,boundingClientRect:b,rootBounds:d,intersectionRect:w});C?m&&y?this._hasCrossedThreshold(C,x)&&this._queuedEntries.push(x):C&&C.isIntersecting&&this._queuedEntries.push(x):this._queuedEntries.push(x)},this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)},r.prototype._computeTargetAndRootIntersection=function(m,d){if(window.getComputedStyle(m).display!="none"){for(var c=u(m),v=c,b=p(m),y=!1;!y;
21){var C=null,w=b.nodeType==1?window.getComputedStyle(b):{};if(w.display=="none")return;if(b==this.root||b==t?(y=!0,C=d):b!=t.body&&b!=t.documentElement&&w.overflow!="visible"&&(C=u(b)),C&&(v=a(C,v),!v))break;b=p(b)}return v}},r.prototype._getRootRect=function(){var m;if(this.root)m=u(this.root);else{var d=t.documentElement,c=t.body;m={top:0,left:0,right:d.clientWidth||c.clientWidth,width:d.clientWidth||c.clientWidth,bottom:d.clientHeight||c.clientHeight,height:d.clientHeight||c.clientHeight}}return this._expandRectByRootMargin(m)},r.prototype._expandRectByRootMargin=function(m){var d=this._rootMarginValues.map(function(v,b){return v.unit=="px"?v.value:v.value*(b%2?m.width:m.height)/100}),c={top:m.top-d[0],right:m.right+d[1],bottom:m.bottom+d[2],left:m.left-d[3]};return c.width=c.right-c.left,c.height=c.bottom-c.top,c},r.prototype._hasCrossedThreshold=function(m,d){var c=m&&m.isIntersecting?m.intersectionRatio||0:-1,v=d.isIntersecting?d.intersectionRatio||0:-1;if(c!==v)for(var b=0;b<this.thresholds.length;b++){var y=this.thresholds[b];if(y==c||y==v||y<c!=y<v)return!0}},r.prototype._rootIsInDom=function(){return!this.root||g(t,this.root)},r.prototype._rootContainsTarget=function(m){return g(this.root||t,m)},r.prototype._registerInstance=function(){},r.prototype._unregisterInstance=function(){};function n(){return window.performance&&performance.now&&performance.now()}function o(m,d){var c=null;return function(){c||(c=setTimeout(function(){m(),c=null},d))}}function s(m,d,c,v){typeof m.addEventListener=="function"?m.addEventListener(d,c,v):typeof m.attachEvent=="function"&&m.attachEvent("on"+d,c)}function i(m,d,c,v){typeof m.removeEventListener=="function"?m.removeEventListener(d,c,v):typeof m.detatchEvent=="function"&&m.detatchEvent("on"+d,c)}function a(m,d){var c=Math.max(m.top,d.top),v=Math.min(m.bottom,d.bottom),b=Math.max(m.left,d.left),y=Math.min(m.right,d.right),C=y-b,w=v-c;return C>=0&&w>=0&&{top:c,bottom:v,left:b,right:y,width:C,height:w}}function u(m){var d;try{d=m.getBoundingClientRect()}catch{}return d?(d.width&&d.height||(d={top:d.top,right:d.right,bottom:d.bottom,left:d.left,width:d.right-d.left,height:d.bottom-d.top}),d):f()}function f(){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}function g(m,d){for(var c=d;c;){if(c==m)return!0;c=p(c)}return!1}function p(m){var d=m.parentNode;return d&&d.nodeType==11&&d.host?d.host:d&&d.assignedSlot?d.assignedSlot.parentNode:d}window.IntersectionObserver=r,window.IntersectionObserverEntry=e})()),mt}var ht;function vs(){if(ht)return pe;ht=1,Object.defineProperty(pe,"__esModule",{value:!0});var t=(function(){function n(o,s){for(var i=0;i<s.length;i++){var a=s[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(o,a.key,a)}}return function(o,s,i){return s&&n(o.prototype,s),i&&n(o,i),o}})();hs();function e(n,o){if(!(n instanceof o))throw new TypeError("Cannot call a class as a function")}var r=(function(){function n(o){var s=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.proximity,u=a===void 0?0:a,f=i.threshold,g=f===void 0?0:f,p=i.timeout,m=p===void 0?0:p,d=i.once,c=d===void 0?!1:d;e(this,n),this._callback=o,this._proximity=u,this._threshold=g,this._timeout=m,this._once=c,this._observables=[],this._observer=new IntersectionObserver(function(v){return s.handleObservations(v)},{rootMargin:u+"px",threshold:g})}return t(n,[{key:"handleObservations",value:function(s){var i=this;s.forEach(function(a){i.isEnteringViewport(a)?i.handleOrSetObservationTimeout(a.target):i.clearObservationTimeout(a.target)})}},{key:"isEnteringViewport",value:function(s){return this.isInscreenByThreshold(s)}},{key:"isInscreenByThreshold",value:function(s){return s.isIntersecting&&s.intersectionRatio>=this._threshold}},{key:"handleOrSetObservationTimeout",value:function(s){this._timeout>0?this.setObservationTimeout(s):this.handleObservation(s)}},{key:"setObservationTimeout",value:function(s){var i=this,a=setTimeout(function(){i.handleObservation(s)},this._timeout);this.addObservable(s,a)}},{key:"handleObservation",value:function(s){this._callback(s),this._once&&this.unobserve(s)}},{key:"addObservable",value:function(s,i){this._observables.push({element:s,timeout:i})}},{key:"clearObservationTimeout",value:function(s){var i=this.removeObservable(s);i&&clearTimeout(i.timeout)}},{key:"removeObservable",value:function(s){var i=function(f){return f.element===s},a=this._observables.filter(i).pop();return this._observables=this._observables.filter(function(u){return u!==a}),a}},{key:"observe",value:function(s){this._observer.observe(s)}},{key:"unobserve",value:function(s){try{this._observer.unobserve(s)}catch{}this.clearObservationTimeout(s)}},{key:"disconnect",value:function(){this._observer.disconnect()}}]),n})();return pe.default=r,pe}var gs=vs();const $t=Kt(gs),be={once:!1,proximity:0,threshold:0,timeout:0},Ht=(t,e)=>{const[r,n]=S(null),o=ps(e);return l.useEffect(()=>{if(!r||!t)return;const s=new $t(t,o);return s.observe(r),()=>s.disconnect()},[t,o,r]),{observedEle:r,setObservedEle:n}};function ps(t){const{once:e,proximity:r,threshold:n,timeout:o}=t??{};return l.useMemo(()=>({once:e??be.once,proximity:r??be.proximity,threshold:n??be.threshold,timeout:o??be.timeout}),[e,r,n,o])}const bs=.75,ys="var(--w-s-color-background-subtle)",ws="960w",Es="1600w",ks=768,Cs="0%",Ns="10%",Is="40%",vt=160;function xs(t){const{className:e,imageCdnUrl:r,section:n,siteUrl:o}=t,{description:s,navigation:i,theme:a,title:u,uuid:f}=n,g=Mt(),p=l.useMemo(()=>Bt(i.link,o),[i.link,o]),m=l.useCallback(()=>{const F=n.tracking?.pulse.view;F&&$.trackEvent(F)},[n]),d=l.useCallback(()=>{const F=i.tracking?.pulse.click;F&&$.trackEvent(F)},[i]),{setObservedEle:c}=Ht(m,{once:!0,threshold:bs}),v=a.backgroundColorHex??ys,b=Ae(r,a.backgroundImage),y=Ae(r,a.desktopBackgroun
21dImage,Es),C=Ae(r,a.badgeImage),w=a.textColorHex,x=l.useCallback(F=>g(f,F.currentTarget.currentSrc),[g,f]);return h.jsxs("a",{className:`relative flex overflow-hidden rounded-16 no-underline hover:no-underline ${e??""}`,href:p.href,onClick:d,ref:c,style:{backgroundColor:v},children:[h.jsxs("div",{className:"flex flex-col justify-center gap-8 py-24 pl-24 md:pr-40 min-w-0 flex-[3] md:flex-[2]",children:[h.jsx("h2",{className:"t3 s-text mb-0",style:{color:w},children:u}),s&&h.jsx("p",{className:"body s-text mb-0",style:{color:w},children:s}),h.jsxs("span",{className:"flex items-center gap-4 s-text body",style:{color:w},children:[i.link.text,h.jsx(re,{name:"ChevronRight",size:"small"})]})]}),b&&h.jsxs("div",{className:"flex-[2] relative min-h-[200px] md:flex-[3]",children:[h.jsxs("picture",{children:[y&&h.jsx("source",{media:`(min-width: ${ks}px)`,srcSet:y}),h.jsx("img",{alt:"",className:"absolute inset-0 w-full h-full object-cover",onError:x,src:b})]}),h.jsx("div",{className:"absolute inset-0",style:{background:`linear-gradient(to right, ${v} ${Cs}, ${v} ${Ns}, transparent ${Is})`}})]}),b&&C&&h.jsx("img",{alt:E.t({id:"entryPoint.badgeAlt",message:"Campaign badge"}),className:"absolute top-1/2 left-1/2 hidden -translate-x-1/2 -translate-y-1/2 md:block",loading:"lazy",src:C,style:{height:vt,width:vt}})]})}function Ae(t,e,r=ws){return e?.path?`${t}/dynamic/${r}/${e.path}`:e?.url}function Ts(t){const{section:e,siteUrl:r}=t,{expand:n}=e,o=l.useMemo(()=>n?Bt(n.link,r):null,[n,r]),s=l.useCallback(()=>{const i=n?.tracking?.pulse.click;i&&$.trackEvent(i)},[n]);return!n||!o?null:h.jsx("a",{className:"font-bold",href:o.href,onClick:s,children:n.link.text})}function _s(t){const{bleed:e,children:r,className:n,fade:o,onScroll:s,role:i,scrollRef:a}=t,u=l.useRef(null),f=a??u,[g,p]=l.useState(!1),[m,d]=l.useState(!1),c=l.useCallback(()=>{const w=f.current;if(!w)return;const x=w.scrollWidth>w.clientWidth;p(x&&w.scrollLeft>0),d(x&&w.scrollLeft+w.clientWidth<w.scrollWidth-1)},[f]);l.useEffect(()=>{if(!o)return;c();const w=f.current;if(!w)return;const x=new ResizeObserver(c);return x.observe(w),()=>x.disconnect()},[o,f,c]);const v=l.useCallback(()=>{o&&c(),s?.()},[o,s,c]),y=`scroll-carousel sf-no-scrollbar ${e?"scroll-carousel-bleed":""} ${n??""}`,C=h.jsx("ul",{className:y,onScroll:v,ref:f,role:i,children:r});return o?h.jsxs("div",{className:"relative scroll-carousel-fade-container",children:[h.jsx("div",{className:`scroll-carousel-fade scroll-carousel-fade-left ${g?"scroll-carousel-fade-visible":""}`}),h.jsx("div",{className:`scroll-carousel-fade scroll-carousel-fade-right ${m?"scroll-carousel-fade-visible":""}`}),C]}):C}function Fs(){const[t,e]=l.useState(!1),[r,n]=l.useState(null),o=l.useRef(null);l.useEffect(function(){return o.current=new IntersectionObserver(([a])=>e(a.isIntersecting)),function(){o.current?.disconnect(),o.current=null}},[]),l.useEffect(function(){r!==null&&o.current?.observe(r)},[r]);const s=l.useCallback(i=>{n(a=>(a!==i&&a!==null&&o.current?.unobserve(a),i))},[]);return{isInscreen:t,inscreenRef:s}}function Ss(t){const{children:e,className:r}=t,{isInscreen:n,inscreenRef:o}=Fs();return h.jsx("li",{"aria-hidden":!n,className:r,ref:o,children:e})}function Ls(t){const{children:e,className:r,expandLink:n,heading:o,id:s,onFirstInscreen:i,scrolling:a=!1}=t,{setObservedEle:u}=Ht(i,{once:!0,threshold:.75}),f=o?`suggestions-heading-${s}`:void 0;return h.jsxs("section",{"aria-labelledby":f,className:r,ref:u,children:[(o||n)&&h.jsxs("div",{className:"flex items-baseline justify-between",children:[o&&h.jsx("h2",{className:"t3",id:f,children:o}),n?.({})]}),h.jsx("div",{className:"bet-shelf-fade -mx-8",children:h.jsx(_s,{bleed:a,className:"flex gap-4 lg:grid lg:grid-cols-5 lg:gap-8",children:l.Children.map(e,g=>h.jsx(Ss,{children:g}))})})]})}const Os=JSON.parse('{"adCard.altText.image":["Annoncebillede"]}'),Rs=JSON.parse('{"adCard.altText.image":["Ad image"]}'),js=JSON.parse('{"adCard.altText.image":["Ilmoituksen kuva"]}'),As=JSON.parse('{"adCard.altText.image":["Annonsebilde"]}'),Ps=JSON.parse('{"adCard.altText.image":["Annonsbild"]}');E.load({da:Os,en:Rs,fi:js,nb:As,sv:Ps});const Ms="480x480c/",Bs="default/",Ut={aspectRatio:"1/1"};function $s(t){const{imageUrl:e,onImageError:r}=t;return e?h.jsx("img",{className:"w-full object-cover",style:Ut,src:Us(e),alt:E.t({id:"adCard.altText.image",message:"Ad image"}),onError:r}):h.jsx(Hs,{})}function Hs(){return h.jsx("div",{className:"w-full s-bg-subtle flex items-center justify-center s-icon-subtle",style:Ut,children:h.jsx(re,{"aria-hidden":"true",name:"Image",size:"56px"})})}function Us(t){return t.replace(Bs,Ms)}function Ds(t){const{cmsArticle:e,promoted:r,sold:n}=t;return n?h.jsx("div",{className:"flex items-center",children:h.jsx(Re,{variant:"warning",children:n})}):e?h.jsx("div",{className:"flex items-center",children:h.jsx(Re,{variant:"neutral",children:e})}):r?h.jsx("div",{className:"flex items-center",children:h.jsx(Re,{variant:"info",children:r})}):null}function Ws(t){const{location:e,narrow:r,shipIt:n,shipItVariant:o="shipping"}=t;if(n){const s=o==="highlight"?"s-text-positive":"s-text-subtle";return h.jsxs("div",{className:`flex items-start gap-6 min-w-0 text-s ${s}`,children:[o==="shipping"&&h.jsx(re,{"aria-hidden":"true",className:"shrink-0 s-icon-subtle",name:"Shipping",size:"small"}),h.jsx("span",{className:"break-words",children:n})]})}return e?h.jsxs("div",{className:"flex items-start gap-6 min-w-0 text-s s-text-subtle",children:[h.jsx(re,{"aria-hidden":"true",className:"shrink-0 s-icon-subtle",name:"PinMarker",size:"small"}),h.jsx("span",{className:r?"truncate":"break-words",children:e})]}):null}const ye={once:!1,proximity:0,threshold:0,timeout:0},Js=(t,e)=>{const[r,n]=S(null),o=Gs(e);return l.useEffect(()=>{if(!r||!t)return;const s=new $t(t,o);return s.observe(r),()=>s.disconnect()},[t,o,r]),{observedEle:r,setObservedEle:n}};function Gs(t){const{once:e,proximity:r,threshold:n,timeout:o}=t??{};return l.useMemo(()=>({once:e??ye.once,proximity:r??ye.proximity,threshold:n??ye.threshold,timeout:o??ye.timeout}),[e,r,n,o])}const Vs=.5,qs=1,zs={className:"absolute top-[18px] right-[18px] w-44 h-44 flex items-center justify-center"};function Qs(t){const{ad:e,"aria-hidden":r,className:n,["data-testid"]:o,favorite:s,isSelected:i=!1,narrow:a,onFirstInscreen:u,onImageError:f,selectedLabel:g}=t,{setObservedEle:p}=Js(u,{once:!0,threshold:Vs}),m=l.useCallback(y=>{t.onClick?.(y)},[t]),d=l.useCallback(y=>{y.button===qs&&t.onClick?.(y)},[t]),c=e.price??e.labels?.tradeType,v=!!c||!!e.size,b=["ad-card-surface relative flex flex-col gap-4 p-8 h-full rounded-[24px] transition-colors duration-75 hover:s-bg-hover active:s-bg-active",i?"outline outline-2 s-outline-primary":""].filter(
21Boolean).join(" ");return h.jsxs("article",{"aria-hidden":r,className:`relative ${n??""}`,children:[h.jsx(Xs,{}),h.jsxs("div",{className:b,ref:p,children:[h.jsxs("div",{className:"relative overflow-hidden rounded-16",children:[h.jsx($s,{imageUrl:e.imageUrl,onImageError:f}),i&&g&&h.jsxs("span",{className:"absolute bottom-4 left-4 inline-flex items-center gap-4 px-10 py-6 rounded-full s-bg-primary s-text-inverted text-xs font-bold leading-16 whitespace-nowrap",children:[h.jsx(re,{"aria-hidden":"true",name:"Check",size:"small"}),h.jsx("span",{children:g})]})]}),h.jsxs("div",{className:"flex flex-col gap-8 p-8",children:[v&&h.jsxs("div",{className:"flex justify-between items-center min-h-24",children:[c&&h.jsx("span",{className:"font-bold text-m s-text",children:c}),e.size&&h.jsx("span",{className:"font-bold text-m s-text-subtle",children:e.size})]}),h.jsx("h3",{className:"m-0 text-s font-normal s-text truncate",children:h.jsx(Ys,{"data-testid":o,onAuxClick:d,onClick:m,props:t})}),h.jsx(Ws,{location:e.location,narrow:a,shipIt:e.labels?.shipIt,shipItVariant:e.labels?.shipItVariant}),h.jsx(Ds,{cmsArticle:e.labels?.cmsArticle,promoted:e.labels?.promoted,sold:e.labels?.sold})]})]}),s?.(zs)]})}function Ys(t){const{["data-testid"]:e,onAuxClick:r,onClick:n,props:o}=t,{ad:s}=o,i="ad-card-action s-text hover:no-underline focus:no-underline focus:outline-none";return o.interaction==="button"?h.jsxs("button",{"aria-haspopup":o["aria-haspopup"],"aria-label":o["aria-label"],"aria-pressed":o["aria-pressed"],className:`${i} appearance-none bg-transparent border-0 cursor-pointer p-0 text-left [font:inherit]`,"data-testid":e,onClick:n,type:"button",children:[h.jsx("span",{"aria-hidden":"true",className:"ad-card-action-hit-area inset-0 absolute rounded-[24px]"}),s.title]}):h.jsxs("a",{className:`ad-card-link ${i}`,"data-testid":e,href:o.url,onAuxClick:r,onClick:n,children:[h.jsx("span",{"aria-hidden":"true",className:"ad-card-action-hit-area inset-0 absolute rounded-[24px]"}),s.title]})}const Ks=".ad-card-action:focus-visible .ad-card-action-hit-area{box-shadow:inset 0 0 0 1px #fff,0 0 0 3px var(--w-s-color-border-focus);}";function Xs(){return h.jsx("style",{children:Ks})}const Zs="transactable";function ea(t){const{"aria-hidden":e,className:r,imageCdnUrl:n,item:o,siteUrl:s}=t,i=Mt(),a=ta(n,o),u=l.useCallback(()=>i(o.itemId,a),[i,o.itemId,a]),f=l.useMemo(()=>{const p=o.disposed?void 0:o.labels[0],m=p?.id===Zs?"shipping":"highlight";return{id:o.itemId,imageUrl:a,labels:{shipIt:p?.value,shipItVariant:m,sold:o.disposed?.text,tradeType:o.tradeType},location:o.location?.value,price:o.price?.value,size:o.extras.find(d=>d.id.includes("_size"))?.values[0],title:o.title}},[a,o]),g=l.useCallback(()=>{const p=o.tracking?.pulse.click;p&&$.trackEvent(p)},[o]);return h.jsx(Qs,{ad:f,"aria-hidden":e,className:`h-full suggestions-item ${r??""}`,favorite:({className:p})=>h.jsx(_n,{buttonClass:p,itemId:Number(o.itemId),variant:"heart-on-image"}),onClick:g,onImageError:u,url:`${s}/${o.itemId}`})}function ta(t,e){const r=e.images[0];return r?.path?`${t}/dynamic/960w/${r.path}`:r?.url}const ra=5;function na(t){const{className:e,imageCdnUrl:r,isMobile:n,sections:o,siteUrl:s}=t;return o.map(i=>{switch(i.sectionType){case"brands-carousel":return null;case"entry-point":return h.jsx(xs,{className:`${e} mb-16 last:mb-0`,imageCdnUrl:r,section:i,siteUrl:s},i.uuid);case"items-carousel":return h.jsx(sa,{className:e,imageCdnUrl:r,isMobile:n,section:i,siteUrl:s},i.uuid);default:return oa()}})}function oa(t){return null}function sa(t){const{className:e,imageCdnUrl:r,isMobile:n,section:o,siteUrl:s}=t,i=()=>{const a=o.tracking?.pulse.view;a&&$.trackEvent(a)};return h.jsx(Ls,{className:`${e} mb-16 last:mb-0`,expandLink:()=>h.jsx(Ts,{section:o,siteUrl:s}),heading:o.title,id:o.uuid,onFirstInscreen:i,scrolling:n,children:o.items.map((a,u)=>{const f=u>=ra;return h.jsx(ea,{"aria-hidden":!n&&f,className:f?"sm:hidden":"",imageCdnUrl:r,item:a,siteUrl:s},a.itemId)})})}function aa(t){const{favoriteBaseUrl:e,imageCdnUrl:r,isMobile:n,locale:o,loginId:s,siteUrl:i,suggestionsData:a}=t;return a?h.jsxs(h.Fragment,{children:[h.jsx(nr,{}),h.jsx(Tn,{favoriteBaseUrl:e,isMobile:n,locale:o,loginId:s,children:h.jsx(na,{imageCdnUrl:r,isMobile:n,sections:a.sections,siteUrl:i})})]}):null}const ia=JSON.parse('{"entryPoint.badgeAlt":["Kampagnebadge"]}'),la=JSON.parse('{"entryPoint.badgeAlt":["Campaign badge"]}'),ca=JSON.parse('{"entryPoint.badgeAlt":["Kampanjamerkki"]}'),da=JSON.parse('{"entryPoint.badgeAlt":["Kampanjemerke"]}'),ua=JSON.parse('{"entryPoint.badgeAlt":["Kampanjmärke"]}
21'),gt="en",ma=t=>{E.load({da:ia,en:la,fi:ca,nb:da,sv:ua}),E.activate(t)};function pt(t){return JSON.parse(new TextDecoder().decode(fa(t)))}function fa(t){const e=atob(t);return Uint8Array.from(e,r=>r.codePointAt(0))}const ha="recommerce-suggestions-podlet";va();async function va(){const e=document.querySelector(`${ha}-isolated`)?.shadowRoot?.querySelector("#app"),r=e instanceof HTMLElement&&e.dataset.props;if(e&&r)try{const n=tr(er("lang"),gt);ma(n??gt);const o=pt(r);Wt.hydrateRoot(e,h.jsx(l.StrictMode,{children:h.jsx(ms,{apiUrl:o.apiUrl,children:h.jsx(In,{rootElement:e,children:h.jsx(aa,{...o})})})}))}catch(n){throw new Error(`SSR(hydrate): Props (${pt(r)}) were provided but parse failed: Error message was: ${n.message}`)}}

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.