1import{r as O}from"./__vite-preact-custom-element.esm.Cpr3XFy2.js";import{g as e,w as L}from"./__vite-preact.module.DLwCyBYy.js";import{u as I,S as D,C as W}from"./__vite-Search.DIJ0tHmo.js";import{u as R,A as G}from"./__vite-ArticlesContext.lpAhEPrC.js";import{U as S}from"./__vite-urlManager.5nG60_Av.js";import{p as P,_ as H,F as A}from"./__vite-hooks.module.BfHYZFGq.js";import{P as z,a as Z}from"./__vite-ProductComparison.ByUQVAb1.js";import{A as j}from"./__vite-ArticleGrid.Cpk9Px1G.js";import"./__vite-utils.bEHj0ca_.js";import"./__vite-currency.CSCTdhpv.js";import"./__vite-richTextConverter.IKlQw-Sh.js";import"./__vite-ProductCard.CyGpZhIb.js";import"./__vite-shopify-image.Br3HHSz6.js";import"./__vite-ProductPrice.D8-JsQlE.js";import"./__vite-ProductBadges.BmMDy6Fm.js";import"./__vite-splide.esm.C1lbcObU.js";import"./__vite-format.Du7_FhYl.js";import"./__vite-PaginationControls.YBonHCla.js";import"./__vite-ChevronDownIcon.CAwKTRcL.js";function T(a){return{Price:window.themeVars.strings.collection.price,"Fuel Type":window.themeVars.strings.collection.fuelType,"Oven Size":window.themeVars.strings.collection.ovenSize,"Gas-powered ovens":window.themeVars.strings.collection.gasPoweredOvens,"Multi-fuel ovens":window.themeVars.strings.collection.multiFuelOvens,"Electric ovens":window.themeVars.strings.collection.electricOvens,"Wood Pellet ovens":window.themeVars.strings.collection.woodPelletOvens}[a.trim()]||a}const U=[{value:"manual",label:window.themeVars.strings.collection.collectionSortByManual},{value:"price-ascending",label:window.themeVars.strings.collection.collectionSortByLowToHigh},{value:"price-descending",label:window.themeVars.strings.collection.collectionSortByHighToLow},{value:"best-selling",label:window.themeVars.strings.collection.collectionSortByBestSelling},{value:"relevance",label:window.themeVars.strings.collection.collectionSortByRelevance}],q=()=>{const{selectedSort:a,setSelectedSort:r}=I(),d=c=>{const n=c.target;r(n.value),S.updateUrlWithSortOptions(n.value)};return e("div",{className:"sort-select"},e("label",{className:"visually-hidden",htmlFor:"product-sort"},window.themeVars.strings.collection.sortBy),e("select",{id:"product-sort",value:a,onChange:d,className:"sort-select__select text-medium--semi btn btn--outline"},U.map(c=>e("option",{key:c.value,value:c.value},c.label))))},B=({id:a,label:r,modelValue:d=!1,onUpdateModelValue:c,name:n="",blockClass:p="",labelClass:_="text-navigation",disabled:h=!1,loading:m=!1})=>{const[u,f]=P(!1);H(()=>{f(d)},[d]);const y=x=>{const F=x.target,k=F==null?void 0:F.checked;f(k),c(k)};return e("div",{className:`checkbox-input ${p} ${m?"loading":""}`},e("input",{id:a,className:`checkbox-input__input visually-hidden ${h?"disabled":""}`,disabled:h||m,name:n,type:"checkbox",checked:u,onChange:y}),e("label",{className:"checkbox-input__label",htmlFor:a},e("span",{className:`checkbox-input__label-text ${_}`},T(r))))},E=({id:a,label:r,value:d,name:c,onUpdateModelValue:n,checked:p=!1,blockClass:_="",labelClass:h="text-navigation",disabled:m=!1,loading:u=!1})=>{const f=y=>{n(y)};return e("div",{className:`radio-input ${_} ${u?"loading":""}`},e("input",{id:a,className:`radio-input__input visually-hidden ${m?"disabled":""}`,disabled:m||u,name:c,type:"radio",value:d,onChange:f,checked:p}),e("label",{className:"radio-input__label",htmlFor:a},e("span",{className:`radio-input__label-text ${h}`},r)))},J=({closeDrawer:a})=>{const{filters:r,selectedFilters:d,setSelectedFilters:c,pagination:n,setPagination:p,selectedSort:_,setSelectedSort:h}=I(),[m,u]=P(""),y=window.themeVars.store.template==="search"?r.filter(t=>t.param_name!=="pf_m_::custom::level_1_collection"):r,x=()=>{c([]),S.removeUrlFilters(y),p({...n,currentPage:1}),a()},F=t=>{const[s,o]=t.split("-");let w;s==="*"?w=`${window.themeVars.store.currency.symbol}0`:w=`${window.themeVars.store.currency.symbol}${s}`;let g;return o==="*"?g="":g=`${window.themeVars.store.currency.symbol}${o}`,g?`${w} - ${g}`:`${w}+`},k=(t,s,o,w)=>{const g=w,v=(C=>{const b=[...C],N=b.findIndex($=>$.param_name===t);if(N!==-1){const $=g?[...b[N].values,s]:b[N].values.filter(V=>V!==s);$.length>0?b[N]={...b[N],values:$,type:o}:b.splice(N,1)}else g&&b.push({param_name:t,values:[s],type:o});return b})(d);c(v),S.updateUrlWithFilters(v),p({...n,currentPage:1})},l=t=>{if(m===t){u("");return}u(t)},i=t=>{const s=t.target;h(s.value),S.updateUrlWithSortOptions(s.value)};return e("div",{className:"filters-form"},e("div",{className:` 2 filters-form__page 3 ${m===""?"is-active":""} 4 `},e("div",{className:"filters-form__header"},e("p",{className:"title-5",dangerouslySetInnerHTML:{__html:window.themeVars.strings.collection.refineBy}}),e("button",{className:"filters-form__close-button","aria-label":window.themeVars.strings.accessibility.close,"data-close-drawer":!0,dangerouslySetInnerHTML:{__html:window.themeVars.icons.close}})),e("ul",{className:"filters-form__list"},e("li",{className:"filters-form__filter"},e("button",{className:"title-6",onClick:()=>l("sort")},e("span",null,window.themeVars.strings.collection.sortBy),e("span",{dangerouslySetInnerHTML:{__html:window.themeVars.icons.caret}}))),y.filter(t=>["list","price"].includes(t.type)).map(t=>t.values.length>0&&e("li",{className:"filters-form__filter",key:t.param_name},e("button",{className:"title-6",onClick:()=>l(t.param_name)},e("span",null,T(t.label)),e("span",{dangerouslySetInnerHTML:{__html:window.themeVars.icons.caret}})))))),e("div",{className:` 5 filters-form__page 6 ${m==="sort"?"is-active":""} 7 `},e("div",{className:"filters-form__header"},e("button",{onClick:()=>l(""),dangerouslySetInnerHTML:{__html:window.themeVars.icons.caret}}),e("p",{className:"title-6"},window.themeVars.strings.collection.sortBy),e("button",{className:"filters-form__close-button","aria-label":window.themeVars.strings.accessibility.close,"data-close-drawer":!0,dangerouslySetInnerHTML:{__html:window.themeVars.icons.close}})),e("div",{className:"filters-form__list"},U.map(t=>e(E,{key:t.label,blockClass:"filters-form__label",id:t.label,label:t.label,onUpdateModelValue:i,name:"sort",checked:t.value===(_||"manual"),value:t.value})))),y.filter(t=>["list","price"].includes(t.type)).map(t=>t.values.length>0&&e("div",{className:` 8 filters-form__page 9 ${m===t.param_name?"is-active":""} 10 `,key:t.param_name},e("div",{className:"filters-form__header"},e("button",{onClick:()=>l(""),dangerouslySetInnerHTML:{__html:window.themeVars.icons.caret}}),e("p",{className:"title-6"},T(t.label)),e("button",{className:"filters-form__close-button","aria-label":window.themeVars.strings.accessibility.close,"data-close-drawer":!0,dangerouslySetInnerHTML:{__html:window.themeVars.icons.close}})),e("div",{className:"filters-form__list"},t.values.map(s=>{const o=t.type==="price"?S.cleanPriceFilter(s.label):s.label;return e(B,{key:s.label,blockClass:"filters-form__label",id:s.label,label:t.type==="price"?F(s.label):s.label,modelValue:d.some(w=>w.param_name===t.param_name&&w.values.includes(o)),onUpdateModelValue:w=>k(t.param_name,o,t.type,w)})})))),e("div",{className:"filters-form__actions"},e("button",{className:"btn btn--outline text-sm filters-form__action",onClick:x},window.themeVars.strings.collection.clearFilters),e("button",{className:"btn btn--secondary text-sm filters-form__action",onClick:a,dangerouslySetInnerHTML:{__html:window.themeVars.strings.collection.viewResults}})))},K=()=>{const{filters:a,selectedFilters:r,setSelectedFilters:d,pagination:c,setPagination:n,products:p}=I(),[_,h]=P(""),m=window.themeVars.store.template,u=m==="search"?a.filter(l=>l.param_name!=="pf_m_::custom::level_1_collection"):a,f=m==="search"?r.filter(l=>l.param_name!=="pf_m_::custom::level_1_collection"):r,y=l=>{const[i,t]=l.split("-");let s;i==="*"?s=`${window.themeVars.store.currency.symbol}0`:s=`${window.themeVars.store.currency.symbol}${i}`;let o;return t==="*"?o="":o=`${window.themeVars.store.currency.symbol}${t}`,o?`${s} - ${o}`:`${s}+`},x=(l,i,t,s)=>{const o=s,g=(M=>
10{const v=[...M],C=v.findIndex(b=>b.param_name===l);if(C!==-1){const b=o?[...v[C].values,i]:v[C].values.filter(N=>N!==i);b.length>0?v[C]={...v[C],values:b,type:t}:v.splice(C,1)}else o&&v.push({param_name:l,values:[i],type:t});return v})(r);d(g),S.updateUrlWithFilters(g),n({...c,currentPage:1})},F=l=>{if(_===l){h("");return}h(l)},k=()=>{const l=m==="search"?r.filter(i=>i.param_name==="pf_m_::custom::level_1_collection"||i.param_name==="q"):[];d(l),S.updateUrlWithFilters(l),n({...c,currentPage:1})};return e("div",{className:"desktop-filters-form"},e("div",{className:"desktop-filters-form__toggles"},u.filter(l=>["list","price"].includes(l.type)).map(l=>{var t,s;if(l.values.length===0)return null;const i=((s=(t=f.find(o=>o.param_name===l.param_name))==null?void 0:t.values)==null?void 0:s.length)||0;return e("button",{className:` 11 desktop-filters-form__toggle text-medium--semi btn btn--outline 12 ${_===l.param_name?"is-active":""} 13 `,onClick:()=>F(l.param_name),key:l.param_name,"aria-controls":`filter-list-${l.param_name.replace(/[^a-zA-Z0-9]/g,"-")}`,"aria-expanded":_===l.param_name},e("span",null,T(l.label),i>0&&` (${i})`),e("span",{dangerouslySetInnerHTML:{__html:window.themeVars.icons.caret}}))}),f.length>0&&e("button",{className:"text-medium btn btn--text desktop-filters-form__clear",onClick:k},window.themeVars.strings.collection.clearFilters),p==="pending"&&u.length<2&&[...Array(3).keys()].map(l=>e("button",{className:"desktop-filters-form__toggle text-medium--semi btn btn--outline is-loading__skeleton",key:l},e("span",null,"loading"),e("span",{dangerouslySetInnerHTML:{__html:window.themeVars.icons.caret}})))),u.filter(l=>["list","price"].includes(l.type)).map(l=>l.values.length>0&&e("fieldset",{className:` 14 desktop-filters-form__list 15 ${_===l.param_name?"is-active":""} 16 `,key:l.param_name,id:`filter-list-${l.param_name.replace(/[^a-zA-Z0-9]/g,"-")}`},e("legend",{className:"visually-hidden"},l.label),l.values.map(i=>{const t=l.type==="price"?S.cleanPriceFilter(i.label):i.label;return e(B,{key:i.label,id:i.label,label:l.type==="price"?y(i.label):i.label,modelValue:r.some(s=>s.param_name===l.param_name&&s.values.includes(t)),onUpdateModelValue:s=>x(l.param_name,t,l.type,s)})}))))},Q=()=>{const{productCount:a}=I();if(a===0)return null;const r=a>1?window.themeVars.strings.collection.productsCountPlural.replace("{{count}}",`${a}`):window.themeVars.strings.collection.productsCountOne.replace("{{count}}",`${a}`);return e("div",{className:"products-count text-medium"},r)},X=({children:a,comparisonModalTitle:r="",enableProductComparison:d,enableDatalayerDebugMode:c,query:n,showProductBadges:p,contentBlocks:_,showProductReviews:h})=>{const{collectionId:m,filters:u,products:f,productCount:y,setSelectedFilters:x,pagination:F,setPagination:k}=I(),{articles:l,setPageCursor:i}=R(),t=A(null),s=S.getActiveTabFromUrl(),[o,w]=P(s||""),[g,M]=P(!1),v=window.themeVars.store.template;if(f==="pending")return e("div",null,a);const C=()=>{const V=t.current;V&&V.showDrawer()},b=()=>{const V=t.current;V&&V.hideDrawer()},N=V=>{if(!V){$(),w("");return}if(o===V){$(),w("");return}if(V==="articles"){w("articles"),S.updateUrlWithActiveTab("articles");return}},$=()=>{x([]),S.removeUrlFilters(u),k({...F,currentPage:1})};return e(L,null,v==="search"&&e(L,null,e(D,{query:n,activeTab:o,onSearch:()=>{$(),N(),i(null)}}),e(Y,{activeTab:o,articlesCount:l.length,setTabsFilter:N,productCount:y})),o!=="articles"&&e(L,null,e("div",{className:"collection__actions"},e("div",{className:"container collection__actions-container"},e("div",{className:"collection__filters collection__filters--desktop"},e(K,null)),e("div",{className:"collection__filters collection__filters--mobile"},e("button",{className:"collection__filter-action text-medium--semi",onClick:C},e("span",{dangerouslySetInnerHTML:{__html:window.themeVars.strings.collection.refineBy}}),e("span",{className:"collection__actions-icon",dangerouslySetInnerHTML:{__html:window.themeVars.icons.settings}})),e("uwp-drawer",{"modal-name":"filter-drawer",className:"drawer collection-filters-drawer","aria-hidden":"true",ref:t},e("div",{className:"modal__overlay",tabIndex:-1,"data-close-drawer":!0}),e("aside",{className:"drawer__container",role:"dialog","aria-modal":"true"},e("div",{className:"collection-filters-drawer__content"},e(J,{closeDrawer:b}))))),e("div",{className:"collection__grid-change"},e("button",{"aria-label":window.themeVars.strings.collection.changeGrid,type:"button",className:`collection__actions-icon ${g?"is-active":""}`,dangerouslySetInnerHTML:{__html:window.themeVars.icons.oneCard},onClick:()=>M(!0)}),e("button",{"aria-label":window.themeVars.strings.collection.changeGrid,type:"button",className:`collection__actions-icon ${g?"":"is-active"}`,dangerouslySetInnerHTML:{__html:window.themeVars.icons.multiCard},onClick:()=>M(!1)})),e(Q,null),e(q,null))),d?e(z,{comparisonModalTitle:r,enableDatalayerDebugMode:c,cardStyleMobile:g?"list":"grid",products:f,contentBlocks:_,query:n,showProductBadges:p,showProductReviews:h,uniqueId:`${m}`}):e(Z,{pagination:F,setPagination:k,products:f,query:n,showOneCards:g,showProductBadges:p,contentBlocks:_,showProductReviews:h}
16)),o==="articles"&&e(j,{query:n}))},Y=({activeTab:a,articlesCount:r,setTabsFilter:d,productCount:c})=>{const n=A(null);H(()=>{document.title=p(String(a==="articles"?r:c)),n.current&&n.current.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})},[n,a]);const p=_=>{const h=document.title,m=h.split(" ");return isNaN(Number(m[1]))?h:(m[1]=_,m.join(" "))};return e("div",{className:"search-tabs"},e("button",{className:`search-tabs__tab ${a!=="articles"?"is-active":""}`,onClick:()=>d(""),ref:a==="articles"?n:null},e("span",null,window.themeVars.strings.search.pageProducts||"Products"),e("sup",null,"(",c,")")),e("button",{className:`search-tabs__tab ${a==="articles"?"is-active":""}`,onClick:()=>d("articles"),ref:a==="articles"?n:null},e("span",null,window.themeVars.strings.search.pageArticles||"Articles"),e("sup",null,"(",r,")")))},ee=({children:a,collectionId:r,comparisonModalTitle:d="",enableProductComparison:c,enableDatalayerLogging:n,searchTerm:p,showProductReviews:_,showProductBadges:h,contentBlocks:m})=>{let u;try{u=JSON.parse(m)}catch(f){console.warn("Error parsing contentBlocks",f)}return e(W,{collectionId:r,searchTerm:p},e(G,{blogTitle:"Recipes",query:p},e(X,{comparisonModalTitle:d,enableDatalayerDebugMode:n==="true",enableProductComparison:c==="true",query:p,showProductBadges:h==="true",contentBlocks:(u==null?void 0:u.contentBlocks)||[],showProductReviews:_==="true"},a)))};O(ee,"uwp-collection",["collection-handle","search-term"]);
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.