1"use strict";(self.webpackChunkstorefront=self.webpackChunkstorefront||[]).push([[9443],{9443:(j,h,a)=>{a.r(h),a.d(h,{WidgetModule:()=>F,component:()=>G});var R=a(177),W=a(467),E=a(9379),s=a(3953),L=a(8179),O=a(1210);const S={name:"demo",widgetId:"demo",params:{}};let D=(()=>{var t;class d{removeResources(e){this.loadedResources.delete(e)}constructor(){this.loadedResources=new Map}addRessource(e,n){const o=this.loadedResources.get(e)||[];o.push(n),this.loadedResources.set(e,o)}removeResource(e,n){const o=this.loadedResources.get(e)||[];o.splice(o.indexOf(n),1),this.loadedResources.set(e,o)}resourceExist(e,n){var o;return(null===(o=this.loadedResources.get(e))||void 0===o?void 0:o.indexOf(n))>-1}}return(t=d).\u0275fac=function(e){return new(e||t)},t.\u0275prov=s.jDH({token:t,factory:t.\u0275fac,providedIn:"root"}),d})();var w=function(t){return t.HEAD="head",t.BODY="body",t}(w||{}),u=function(t){return t.JUST_AFTER="just_after_element",t.JUST_BEFORE="just_before_element",t.TOP="top",t.BOTTOM="bottom",t}(u||{}),g=function(t){return t.SCRIPT="script",t.LINK="link",t}(g||{}),p=a(8251),B=a(7031),M=a(6843),b=a(6078),T=a(7370);const A=["viewTemplate"];let C=(()=>{var t;class d extends O.${constructor(){super(...arguments),this.widgetService=(0,s.WQX)(D),this.store=(0,s.WQX)(p.B),this.consentService=(0,s.WQX)(b.e),this.defaultConfig=(0,E.A)({},S),this.widgetResources=[]}ngOnInit(){super.ngOnInit()}ngOnDestroy(){this.unloadAllWidgetResources()}onConfigChanges(){var e=this;return(0,W.A)(function*(){if((0,R.UE)(e.platformId)){e.elementRef.nativeElement.innerHTML="";const n=(0,L.uQ)(e.config.widgetId?e.config.widgetId:e.config.id,e.context,e.contextService.$functions,e.globalService.getGlobalData());e.store.select((0,B.jZ)(M.O.GENERIC_WIDGET),o=>{if(e.widgetLibrary=o.find(l=>l.name===e.config.name),!e.widgetLibrary)throw new Error("There is no widget library with the name ".concat(e.config.name));const c=e.widgetLibrary.widgets[n].html;if(!c)throw new Error("There is no widget with id ".concat(n," in ").concat(e.config.name," widget "));const m=document.createElement("template");m.innerHTML=c.trim();let i=m.content.childNodes[0];for(const l of Object.keys(e.config.params))i.setAttribute(l,e.config.params[l]);e.renderer.appendChild(e.elementRef.nativeElement,i),e.loadResources(i),e.loadResources(i,n),e.consentService.updateConsent()})}})()}loadResources(e,n){const o=this.widgetLibrary&&n?this.widgetLibrary.widgets[n].resources:this.widgetLibrary.resources;for(const c of o)this.createHTMLResourceElement(c,e)}unloadAllWidgetResources(){for(const e of this.widgetResources)e.remove();this.widgetService.removeResources(this)}createHTMLResourceElement(e,n){var o,c,m;if(this.widgetService.resourceExist(this,e))return;const i=this.renderer.createElement(e.type);i.setAttribute("defer","defer"),e.type===g.SCRIPT&&e.url?i.setAttribute("src",(0,T.bT)(e.url,this.appData)):e.type===g.LINK&&e.url&&(i.setAttribute("href",(0,T.bT)(e.url,this.appData)),i.setAttribute("rel","stylesheet")),i.innerHTML=null!==(o=e.content)&&void 0!==o?o:"";for(const y of Object.keys(null!==(l=e.properties)&&void 0!==l?l:{})){var l;i.setAttribute(y,e.properties[y])}const f=null!==(c=e.position)&&void 0!==c?c:u.BOTTOM,v=null!==(m=e.placement)&&void 0!==m?m:w.HEAD;f===u.JUST_AFTER?this.elementRef.nativeElement.appendChild(i):f===u.JUST_BEFORE?this.elementRef.nativeElement.insertBefore(i,n):f===u.TOP?this.document[v].insertBefore(i,this.document[v].firstChild):f===u.BOTTOM&&this.document[v].appendChild(i),this.widgetService.addRessource(this,e),this.widgetResources.push(i)}}return(t=d).\u0275fac=(()=>{let r;return function(n){return(r||(r=s.xGo(t)))(n||t)}})(),t.\u0275cmp=s.VBU({type:t,selectors:[["storefront-widget"]],viewQuery:function(e,n){if(1&e&&s.GBs(A,7,s.c1b),2&e){let o;s.mGM(o=s.lsd())&&(n.viewTemplate=o.first)}},standalone:!1,features:[s.Jv_([p.B]),s.Vt3],decls:2,vars:0,consts:[["viewTemplate",""]],template:function(e,n){1&e&&s.eu8(0,null,0)},encapsulation:2}),d})();const x=["class","pxp-widget"];let I=(()=>{var t;class d extends C{}return(t=d).\u0275fac=(()=>{let r;return function(n){return(r||(r=s.xGo(t)))(n||t)}})(),t.\u0275cmp=s.VBU({type:t,selectors:[["div",8,"pxp-widget"]],standalone:!1,features:[s.Jv_([p.B]),s.Vt3],attrs:x,decls:2,vars:0,consts:[["viewTemplate",""]],template:function(e,n){1&e&&s.eu8(0,null,0)},encapsulation:2}),d})(),F=(()=>{var t;class d{}return(t=d).\u0275fac=function(e){return new(e||t)},t.\u0275mod=s.$C({type:t}),t.\u0275inj=s.G2t({imports:[R.MD]}),d})();const G={component:C,leanDomComponent:I}}}]);
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.