PageSourceSearch

https://www.bonduelle.cz/chunk-UNP3NDCR.js

js bonduelle.cz collected 2026-10-09 00:37:23 UTC 8,527 bytes, 1 lines download raw bytes

1import{a as k}from"./chunk-BJUC3M5N.js";import{a as l}from"./chunk-QUF6YDDF.js";import{a as p}from"./chunk-P5KIW4CD.js";import{b as Q,c as P,l as y,m as v}from"./chunk-WP7UA2RR.js";import{i as x}from"./chunk-P4HTJB2O.js";import{a as A}from"./chunk-CRAP6PHG.js";import{$b as $,Bc as C,D as L,H as u,Nb as O,W as T,Xc as V,Y as I,a as f,ac as w,k as R,l as S,tc as U,x as E}from"./chunk-Q2IVITMG.js";var i=(function(o){return o.ALL="all",o.PRODUCTS="products",o.RECIPES="recipes",o.ARTICLES="articles",o})(i||{});var g=class{constructor(){}};var h=class{constructor(a,t,e,s,r){this.item=a,this.corporate_route=t,this.faq_route=s,this.legumiz_route=e,this.menu_page_route=r}adapt(){return this._parseCommonAttributes()}_extractAttributeValueFromPrediggo(a){let t=this.item.attributeInfo.find(e=>e.attributeName===a);if(t)return t.vals[0].label}_parseCommonAttributes(){let a=new g,t=this.item;return a.id=t.sku,a.trackingCode=t.trackingCode,a.title=this._extractAttributeValueFromPrediggo("shortDescription"),a.category=this._extractAttributeValueFromPrediggo("category"),a.url=this._buildUrl(a.category),a.thumbnailUrl=this._extractAttributeValueFromPrediggo("thumbnailUrl")||"/assets/images/placeholder.png",a}_buildUrl(a){let t=this._extractAttributeValueFromPrediggo("itemUrl"),e=this._extractAttributeValueFromPrediggo("idPage"),s=this._extractAttributeValueFromPrediggo("duplicationId");switch(a){case"corporate_article":return`/${t}/${e}/${s}`;case"faq_entity":return`/${this.faq_route}${t}`;case"magazine_article":return`/${this.legumiz_route}/${t}/${e}/${s}`;case"menu_article":return`/${this.menu_page_route}/${t}/${e}/${s}`}}};var _="recipeListReco",q=V(),gt=(()=>{class o{get recipeList(){return this.recipeListSubject.asObservable()}get currentRecipeList(){return this.recipeListSubject.getValue()}set keywords(t){this.somQuery.parameters.query=t||""}get keywords(){return this.somQuery.parameters.query||""}get urlKeywords(){return q(this.somQuery.parameters.query)}set pageType(t){switch(t){case i.PRODUCTS:this.somQuery.pageId=l.recherche_nos_produits;break;case i.RECIPES:this.somQuery.pageId=l.recherche_nos_recettes;break;case i.ARTICLES:this.somQuery.pageId=l.recherche_nos_articles;break;default:this.somQuery.pageId=l.pre_produit_recette}}get pageType(){switch(this.somQuery.pageId){case l.recherche_nos_articles:return i.ARTICLES;case l.recherche_nos_produits:return i.PRODUCTS;case l.recherche_nos_recettes:return i.RECIPES;default:return i.ALL}}set sortings(t){this.somQuery.parameters.sortingCode=t||""}get sorting(){return this.somQuery?.parameters?.sortingCode||""}set filters(t){this.somQuery.parameters.filters=t}get filters(){return this.somQuery.parameters.filters}isEmpty(){let t=this.filters;for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}set pageNumber(t){this.somQuery.parameters.page=t}get pageNumber(){return this.somQuery?.parameters?.page||1}constructor(){this.router=u(C),this.location=u(O),this.prediggo=u(v),this.translate=u(U),this.transferState=u(I),this.platformId=u(T),this.tagManager=u(A),this.NUMBER_OF_ITEMS_PER_LOADING=21,this.total={recipe:0,product:0,article:0},this.productsPage={results:[],facets:[],sortings:[],totalResults:0},this.recipesPage={results:[],facets:[],sortings:[],totalResults:0},this.articlesPage={results:[],facets:[],sortings:[],totalResults:0},this.isRequestDone=!1,this.isResults=!1,this.recipeListSubject=new R([]),this.querySearch=new R(""),this.querySearchObs=this.querySearch.asObservable(),this.somQuery=P.create(),this.somQuery.parameters=Q.create(),this.somQuery.parameters.resultsPerPage=this.NUMBER_OF_ITEMS_PER_LOADING,this.somQuery.parameters.page=1,this.total={recipe:0,product:0,article:0}}search(t=!0){t&&this._clearResults(),this.isRequestDone=!1,this.prediggo.simplePageContent(this.somQuery).pipe(E(()=>this.isRequestDone=!0)).subscribe({next:e=>{let s=e?.blocks?.searches||[];this._handleResultsByPageType(s),this.total=this._calculateTotals(s,this.pageType),this._handleSearchEventOrRedirect(s),this.isResults=this.isResultsEmpty()===!1},error:e=>console.error(e)})}_clearResults(){this.productsPage.results=[],this.recipesPage.results=[],this.articlesPage.results=[]}_handleResultsByPageType(t){let e=(s,r,c=[],n=[])=>({results:[...n||[],...(s?.slots?.map(m=>new r(m.item,...c).adapt())||[]).flat()],facets:s?.facets,sortings:s?.sortings,totalResults:s?.stats?.totalResults});if(this.pageType===i.ALL&&t.length>1){let s=r=>t.find(c=>c.blockName===r);this.productsPage=e(s("Liste de produits"),y,[this.translate.currentLang]),this.recipesPage=e(s("Liste de recettes"),p,[this.translate.currentLang]),this.articlesPage=e(s("Liste des articles"),h,[`${this.translate.instant("ROUTES.since-1853")}/${this.translate.instant("ROUTES.article")}`,`${this.translate.instant("ROUTES.magazine")}/${this.translate.instant("ROUTES.article")}`,`${this.translate.instant("ROUTES.faq")}`,`${this.translate.instant("ROUTES.menu-page")}/${this.translate.instant("ROUTES.article")}`])}else{let s=t[0];switch(this.pageType){case i.PRODUCTS:this.productsPage=e(s,y,[this.translate.currentLang],this.productsPage?.results);break;case i.RECIPES:this.recipesPage=e(s,p,[this.translate.currentLang],this.recipesPage?.results);break;case i.ARTICLES:this.articlesPage=e(s,h,[`${this.translate.instant("ROUTES.since-1853")}/${this.translate.instant("ROUTES.article")}`,`${this.translate.instant("ROUTES.magazine")}/${this.translate.instant("ROUTES.article")}`,`${this.translate.instant("ROUTES.faq")}`,`${this.translate.instant("ROUTES.menu-page")}/${this.translate.instant("ROUTES.article")}`],this.articlesPage?.results);break}}this._filterResultsIfSearchIsGtin()}_filterResultsIfSearchIsGtin(){if(x(this.somQuery.parameters.query
1)){let t=this.productsPage.results.filter(e=>e.gtin===this.somQuery.parameters.query);this.productsPage.results=t||this.productsPage.results}}_handleSearchEventOrRedirect(t){let{keywords:e,tagManager:s,total:r}=this,c=t[0].redirection?t[0].redirection.redirectUrl:"";r.article>0||r.product>0||r.recipe>0?s.setSearchEvent(r,e):c?this._redirect(c):this.fetchPrediggoRecipesReco()}_redirect(t){if(t.includes("www.bonduelle.")||t.startsWith("/")){let e=t.includes("www.bonduelle")?t.substring(24):t;this.router.navigate([e])}else window&&(this.windowReference=window.open(t,"_blank"))}_calculateTotals(t,e){let s=this.total,[r,c,n]=t;return e===i.ALL&&t.length>1?(s.recipe=r.stats.totalResults,s.product=this.productsPage.results.length,s.article=n.stats.totalResults):e===i.PRODUCTS?s.product=this.productsPage.results.length:e===i.RECIPES?s.recipe=r.stats.totalResults:e===i.ARTICLES&&(s.article=r.stats.totalResults),s}isResultsEmpty(){return this.total.article===0&&this.total.product===0&&this.total.recipe===0}addOrRemoveFilter(t){let e={};e[t.name]=this.filters[t.name]||[];let s=e[t.name].indexOf(t.value);s>=0?e[t.name].splice(s,1):e[t.name].push(t.value),this.filters=f(f({},this.filters),e)}updateFilters(t){this.filters=t}refactorUrl(){let t=this.getTranslatedPath(this.pageType),e=this.translate.instant("ROUTES.search"),s=this.translate.instant(`ROUTES.${t}`),r=q(this.keywords),c=Object.entries(this.filters),n=this.translate.currentLang.split("_")[1],d=`${this.translate.currentLang.split("_")[0]==="be"?`${n}/`:""}${e}/${r}/${s}`;d=c.reduce((j,[F,D])=>{let B=D.map(M=>{let b=encodeURI(`${F}/${M}`);return k[n][b]||b});return j+"/"+B.join("/")},d),this.location.replaceState(d)}getTranslatedPath(t){let e={articles:"articles-search",products:"products-search",recipes:"recipes-home"};return e[t]?e[t]:"all"}fetchPrediggoRecipesReco(){let t=new S;if(w(this.platformId))t=this.fetchPrediggoRecipesRecoSSR();else if($(this.platformId))if(!(this.currentRecipeList&&this.currentRecipeList.length>0)&&this.transferState.hasKey(_)){let e=this.transferState.get(_,this.currentRecipeList);this.recipeListSubject.next(e),t.next(e),t.complete()}else t=this.fetchPrediggoRecipesRecoSSR();return t.asObservable()}fetchPrediggoRecipesRecoSSR(){let t=P.create(),e=new S;return t.pageId=l.page_404,this.prediggo.simplePageContent(t).subscribe(s=>{let r=[];if(s?.blocks?.recommendations){let c=s.blocks.recommendations.filter(n=>n.blockId===0);c?.[0]?.slots?.length&&(r=c[0].slots.map(n=>new p(n.item,this.translate.currentLang).adapt()))}this.recipeListSubject.next(r),e.next(r),this.transferState.set(_,r),e.complete()},s=>{e.error(s)}),e}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();export{i as a,gt as b};

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.