1import{$a as l,Ad as h,Fd as I,H as d,Pd as g,Se as T,Sf as E,Va as f,Vc as p,Z as a,fa as n,ga as u,ia as s,ja as c,yc as m,ze as v}from"./chunk-4FBTFN23.js";var R=(()=>{class i{static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275prov=n({token:i,factory:function(e){let r=null;return e?r=new(e||i):r=s(h),r},providedIn:"root"})}}return i})(),M="smartEdit",S=(()=>{class i{static{this.STORAGE_KEY_CMS_TICKET_ID="smartedit.cmsTicketId"}get cmsTicketId(){return this._cmsTicketId}constructor(t,e,r){this.config=t,this.location=e,this.scriptLoader=r,this.featureModulesService=c(E),this.windowRef=c(g)}load(){this.isLaunchedInSmartEdit()&&(this.featureModulesService.resolveFeature(M).subscribe(),this.scriptLoader?.embedScript({src:"assets/webApplicationInjector.js",params:void 0,attributes:{id:"text/smartedit-injector","data-smartedit-allow-origin":this.config.smartEdit?.allowOrigin}}))}isLaunchedInSmartEdit(){let[t,e]=this.location.path().split("?"),o=e?.split("&").find(w=>w.startsWith("cmsTicketId="))?.split("=")[1];return this.isInitialSmartEditPage(t,o)||this.isFullPageRedirectInSmartEdit()}isInitialSmartEditPage(t,e){return t.split("/").pop()===this.config.smartEdit?.storefrontPreviewRoute&&e?(this.persistCmsTicketId(e),this._cmsTicketId=e,!0):!1}isFullPageRedirectInSmartEdit(){return this._cmsTicketId=this.restoreCmsTicketId(),!!this._cmsTicketId}persistCmsTicketId(t){this.windowRef.isBrowser()&&sessionStorage.setItem(i.STORAGE_KEY_CMS_TICKET_ID,t)}restoreCmsTicketId(){return this.windowRef.isBrowser()?sessionStorage.getItem(i.STORAGE_KEY_CMS_TICKET_ID)??void 0:void 0}static{this.\u0275fac=function(e){return new(e||i)(s(R),s(m),s(v))}}static{this.\u0275prov=n({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),P={smartEdit:{storefrontPreviewRoute:"cx-preview",allowOrigin:"localhost:9002"}},k=(()=>{class i{constructor(t){this.service=t,this.routingService=c(T)}intercept(t,e){let r=this.service.cmsTicketId;return r?t.url.includes("/productList")?this.setRequestForProductListPage(t,e,r):((t.url.includes("/cms/")||t.url.includes("/products/"))&&(t=t.clone({setParams:{cmsTicketId:r}})),e.handle(t)):e.handle(t)}setRequestForProductListPage(t,e,r){return this.routingService.getPageContext().pipe(d(1),a(o=>(t=t.clone(o.id?{setParams:{cmsTicketId:r,categoryCode:o.id}}:{setParams:{cmsTicketId:r}}),e.handle(t))))}static{this.\u0275fac=function(e){return new(e||i)(s(S))}}static{this.\u0275prov=n({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),y=[{provide:p,useExisting:k,multi:!0}];function C(i){return()=>{i.load()}}var G=(()=>{class i{static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275mod=f({type:i})}static{this.\u0275inj=u({providers:[...y,I(P),{provide:l,useFactory:C,deps:[S],multi:!0}]})}}return i})();export{R as a,M as b,G as c};
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.