1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4414],{4306:(e,t,r)=>{"use strict";r.d(t,{T:()=>p,ZE:()=>h,e:()=>u,yB:()=>_});var l=r(14232),a=r(89099);let o="xpm-inspector-enabled",n="xpm-inspect",s=new Set,c=()=>"1"===window.localStorage.getItem(o),i=e=>{e?window.localStorage.setItem(o,"1"):window.localStorage.removeItem(o),s.forEach(e=>e())},d=e=>(s.add(e),()=>s.delete(e)),u=()=>i(!1),h=e=>i(e),p=()=>(0,l.useSyncExternalStore)(d,c,()=>!1),f=()=>{window.__xpm={inspect:()=>i(!c()),on:()=>i(!0),off:()=>i(!1)}},_=()=>{let e=(0,a.useRouter)(),t=(0,l.useSyncExternalStore)(d,c,()=>!1);return(0,l.useEffect)(f,[]),(0,l.useEffect)(()=>{if(!e.isReady)return;let t=e.query[n],r=Array.isArray(t)?t[0]:t;if(void 0===r)return;i("1"===r||"true"===r);let l={...e.query};delete l[n],e.replace({pathname:e.pathname,query:l},void 0,{shallow:!0})},[e.isReady,e.query,e]),t}},15039:(e,t)=>{var r;!function(){"use strict";var l={}.hasOwnProperty;function a(){for(var e="",t=0;t<arguments.length;t++){var r=arguments[t];r&&(e=o(e,function(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return a.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var r in e)l.call(e,r)&&e[r]&&(t=o(t,r));return t}(r)))}return e}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(a.default=a,e.exports=a):void 0===(r=(function(){return a}).apply(t,[]))||(e.exports=r)}()},24239:e=>{e.exports={rebuildBtn:"xpmDevControls_rebuildBtn__2dAd2",error:"xpmDevControls_error__5oiOa"}},30140:e=>{e.exports={Switch:"switch_Switch___Fzda",SwitchComponent:"switch_SwitchComponent__t9hGE","js-has-pseudo":"switch_js-has-pseudo__YhXNN","does-not-exist":"switch_does-not-exist__1OuzQ"}},30978:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var l=r(37876),a=r(15039),o=r.n(a),n=r(14232),s=r(31262);let c=(0,n.forwardRef)((e,t)=>{let{className:r,variant:a,size:n="normal",children:c,isLink:i,disabled:d,...u}=e,h=o()(r,"ui-btn","ui-btn_".concat(a),"ui-btn_".concat(n));return i?(0,l.jsx)(s.A,{className:h,...u,children:(0,l.jsx)("span",{children:c})}):(0,l.jsx)("button",{className:h,disabled:d,ref:t,...u,children:(0,l.jsx)("span",{children:c})})})},31262:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var l=r(37876),a=r(48230),o=r.n(a),n=r(26635),s=r(67663);let c=e=>{let{href:t,children:r,onClick:a,...c}=e,{data:i}=(0,n.Ay)(e=>e.url),{data:d}=(0,n.rU)(e=>e),u=i.split("/").slice(0,3).join("/"),h=(0,s.iY)(d),p=t;if("string"==typeof t&&t.startsWith(u)&&(p=t.replace(u,"")),!p){let{"aria-label":e,"aria-labelledby":t,...o}=c,n=o.role?{"aria-label":e,"aria-labelledby":t}:{};return(0,l.jsx)("span",{...o,...n,onClick:a,"data-custom-link":"span",children:r})}if("string"==typeof p){var f;let e=null!=(f=p.toString().trim())?f:"";if(!e&&a)return(0,l.jsx)("button",{type:"button",...c,onClick:a,"data-custom-link":"button",children:r});if("/"===e)return(0,l.jsx)("a",{href:i,...c,onClick:a,"data-custom-link":"external",children:r});if(e.includes("aspx")||e.startsWith("http"))return(0,l.jsx)("a",{href:e,...c,onClick:a,"data-custom-link":"external",children:r})}let _="string"==typeof p&&h?((e,t)=>{if(e.startsWith("#")||e.startsWith("?"))return e;let r=e.startsWith("/")?e:"/".concat(e);return r.startsWith("/api")||r.startsWith("/".concat(t))?e:"/".concat(t).concat(r.slice(1))})(p,h):p;return(0,l.jsx)(o(),{href:_,onClick:a,...c,"data-custom-link":"internal",prefetch:!1,children:r})}},36993:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var l=r(37876),a=r(90372),o=r(476);let n=e=>{let{wrap:t}=e,{currentTheme:r,setTheme:n}=(0,o.wR)();return(0,l.jsx)("div",{style:t?{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"8px",width:"100%"}:{display:"grid",gap:"8px",gridAutoFlow:"column",gridAutoColumns:"1fr"},children:a.gH.map(e=>(0,l.jsxs)("button",{onClick:()=>n(e),style:{minHeight:"20px",padding:"4px 8px",border:"1px solid",textAlign:"center",borderRadius:"var(--radius-xl)"},children:[r===e&&"â
",e]},e))})}},48199:e=>{e.exports={Root:"developers_Root__sJ965",DevelopersTrigger:"developers_DevelopersTrigger__SQ6TY",SourceDot:"developers_SourceDot__c9fbb",local:"developers_local__KzVp6",remote:"developers_remote__ZuoZG",Popover:"developers_Popover___fHt_",hidden:"developers_hidden__FSa6_",CatalogLink:"developers_CatalogLink__NsEEu",Controllers:"developers_Controllers__THQhQ"}},53293:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var l=r(37876),a=r(58410),o=r(14232),n=r(68172);let s=()=>{let e=(0,n.A)(e=>e.darkMode),t=(0,n.A)(e=>e.setDarkMode);return(0,o.useEffect)(()=>{let t=document.documentElement;e?t.classList.add("dark-mode"):t.classList.remove("dark-mode")},[e]),(0,l.jsx)(a.A,{checked:e,id:"DarkModeSwitch",onChange:e=>{let r=document.documentElement;r.classList.add("theme-switching"),setTimeout(()=>r.classList.remove("theme-switching"),1e3),t(e.target.checked)},on:"\uD83C\uDF19",off:"âï¸",label:"Dark Mode",labelLocation:"before"})}},58410:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var l=r(37876),a=r(30140),o=r.n(a);let n=e=>{let{id:t,checked:r,on:a,off:n,label:s,ariaLabel:c,labelLocation:i,onChange:d}=e;return(0,l.jsxs)("div",{className:o().Switch,"data-label-location":i,children:[(0,l.jsx)("span",{className:o().Label,children:s}),(0,l.jsxs)("label",{id:t,className:o().SwitchComponent,children:[(0,l.jsx)("input",{type:"checkbox","aria-label":c||s,onChange:d,checked:r}),(0,l.jsx)("i",{"data-on":a,"data-off":n})]})]})}},67828:(e,t,r)=>{"use strict";r.d(t,{l:()=>l.A});var l=r(1066)},68172:(e,t,r)=>{"use strict";r.d(t,{A:()=>
1o});var l=r(8106),a=r(4319);let o=(0,l.v)()((0,a.lt)((0,a.Zr)(e=>({darkMode:!1,setDarkMode:t=>e(()=>({darkMode:t})),transparentHeader:!1,setTransparentHeader:t=>e(()=>({transparentHeader:t})),headerScheme:"light",setHeaderScheme:t=>e(()=>({headerScheme:t}))}),{name:"dark-mode-store"})))},75162:e=>{e.exports={section:"sourceToggle_section__MRmDW",label:"sourceToggle_label__UrdOR",sourceRow:"sourceToggle_sourceRow__VMUfk",sourceBtn:"sourceToggle_sourceBtn__TVTpr",localDot:"sourceToggle_localDot__bDLUv",warning:"sourceToggle_warning__nob8F"}},89203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return a}});let l=r(14232);function a(e,t){let r=(0,l.useRef)(null),a=(0,l.useRef)(null);return(0,l.useCallback)(l=>{if(null===l){let e=r.current;e&&(r.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(r.current=o(e,l)),t&&(a.current=o(t,l))},[e,t])}function o(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},97872:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>F});var l,a,o=r(37876),n=r(14232),s=r(89099),c=r(53293),i=r(26635),d=r(44510),u=r(48199),h=r.n(u);let p=()=>{let e=(0,i.Yw)(),{data:t}=(0,d.B)(e=>e.sku);if(!t)return null;let r="".concat("https://site-experience-manager-develop.dev.eks.tenengroup.com","/sites/").concat(e,"/catalog2/").concat(encodeURIComponent(t));return(0,o.jsx)("a",{className:h().CatalogLink,href:r,target:"_blank",rel:"noreferrer",children:"Open in Catalog 2.0 â"})};var f=r(58410),_=r(67828);let m=()=>{let e=(0,_.l)(e=>e.isLoggedIn),t=(0,_.l)(e=>e.toggleFakeAuthentication);return(0,o.jsx)(f.A,{checked:e,id:"LoginSwitch",onChange:t,label:"Fake Auth",labelLocation:"before"})};var g=r(77874);let v=()=>{let e=(0,i.Yw)(),t=(0,g.L)(e=>e.isReady),r=(0,g.L)(e=>e.toggleFakeLoyalty);return(0,o.jsx)(f.A,{checked:t,id:"LoyaltySwitch",onChange:()=>r(e),label:"Fake Loyalty",labelLocation:"before"})};var x=r(4306);let b=()=>{let e=(0,x.T)();return(0,o.jsx)(f.A,{checked:e,id:"XpmInspectorSwitch",onChange:e=>(0,x.ZE)(e.target.checked),on:"\uD83D\uDD0D",off:"\uD83D\uDD0D",label:"XPM Inspector",labelLocation:"before"})};var S=r(68172);let j=()=>{let e=(0,S.A)(e=>e.transparentHeader),t=(0,S.A)(e=>e.setTransparentHeader),r=(0,S.A)(e=>e.headerScheme),l=(0,S.A)(e=>e.setHeaderScheme);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(f.A,{checked:e,id:"TransparentHeaderSwitch",onChange:e=>t(e.target.checked),label:"Transparent Header",labelLocation:"before"}),e&&(0,o.jsx)(f.A,{checked:"dark"===r,id:"HeaderSchemeSwitch",onChange:e=>l(e.target.checked?"dark":"light"),on:"â«",off:"âª",label:"â³ Scheme (light/dark)",labelLocation:"before"})]})};var k=r(36993);let w="true"===r(65364).env.NEXT_PUBLIC_IS_LOCALHOST,y=e=>{let[t,r]=(0,n.useState)("remote"),[l,a]=(0,n.useState)(null);(0,n.useEffect)(()=>{w&&fetch("/api/dev/".concat(e,"-source")).then(e=>e.ok?e.json():null).then(e=>(null==e?void 0:e.source)&&r(e.source)).catch(()=>void 0)},[e]),(0,n.useEffect)(()=>{if(!w||"local"!==t)return void a(null);fetch("/api/dev/".concat(e,"-health")).then(e=>e.ok?e.json():null).then(e=>a(!!e&&!!e.ok)).catch(()=>a(!1))},[e,t]);let o=async r=>{r!==t&&(await fetch("/api/dev/".concat(e,"-source"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:r})}),window.location.reload())};return{source:t,switchSource:o,localHealthy:l}};var C=r(30978),L=r(75162),A=r.n(L);let T={local:"#2e7d32",remote:"#ff8c00"},N=e=>{let{label:t,localUrl:r,source:l,onSwitch:a,localHealthy:n,children:s}=e,c="local"===l&&!1===n,i=c?"remote":l,d="Local :".concat(new URL(r).port||"80");return(0,o.jsxs)("div",{className:A().section,children:[(0,o.jsx)("p",{className:A().label,children:t}),(0,o.jsx)("div",{className:A().sourceRow,children:["local","remote"].map(e=>{let t=e===i;return(0,o.jsxs)(C.A,{variant:"ghost",size:"xsmall",className:A().sourceBtn,style:t?{backgroundColor:T[e],borderColor:T[e],color:"#fff"}:void 0,onClick:()=>a(e),children:["local"===e?d:"Remote","local"===e&&!1===n&&(0,o.jsx)("span",{className:A().localDot,title:"Local unreachable"})]},e)})}),c&&(0,o.jsx)("p",{className:A().warning,children:"â Local unreachable â using Remote"}),"local"===l&&!c&&s]})};var D=r(65364);let R=globalThis,E=(e,t)=>{let r=()=>{var t,r;return null!=(r=null==(t=R.__devSources)?void 0:t[e])?r:"remote"};return{localUrl:t,get:r,set:t=>{R.__devSources={...R.__devSources,[e]:t}},isLocal:()=>"true"===D.env.NEXT_PUBLIC_IS_LOCALHOST&&"local"===r()}}
1,H=E("xpm",null!=(l=r(65364).env.NEXT_PUBLIC_XPM_LOCAL_FRONTEND_URL)?l:"http://localhost:5201");H.get;let O=H.localUrl;var P=r(24239),I=r.n(P);let M=e=>{let[t,r]=(0,n.useState)("idle"),l=async()=>{r("pending");try{let e=await fetch("/api/dev/rebuild-xpm",{method:"POST"}),t=await e.json().catch(()=>null);if(e.ok&&(null==t?void 0:t.ok))return void window.location.reload();r("error")}catch(e){r("error")}};return(0,o.jsxs)(N,{label:"XPM Source",localUrl:O,...e,children:[(0,o.jsx)(C.A,{variant:"ghost",size:"xsmall",className:I().rebuildBtn,disabled:"pending"===t,onClick:l,children:"pending"===t?"Rebuildingâ¦":"Rebuild Local XPM"}),"error"===t&&(0,o.jsx)("p",{className:I().error,children:"Rebuild failed"})]})},U=E("sps",null!=(a=r(65364).env.NEXT_PUBLIC_SPS_LOCAL_API_URL)?a:"http://localhost:5005"),B="true"===r(65364).env.NEXT_PUBLIC_IS_LOCALHOST,F=()=>{let[e,t]=(0,n.useState)(!1),r=(0,n.useRef)(null),{data:l}=(0,i.Ay)(e=>e.environment),a=y("xpm"),d=y("sps"),u="/[context]/products/[productId]/[page]"===(0,s.useRouter)().pathname,f=[a,d].some(e=>"local"===e.source&&!1!==e.localHealthy)?h().local:h().remote;return((0,n.useEffect)(()=>{if(!e)return;let l=e=>{r.current&&!r.current.contains(e.target)&&t(!1)};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[e]),"production"!==l||B)?(0,o.jsxs)("div",{className:h().Root,ref:r,children:[(0,o.jsxs)("div",{className:"".concat(h().Popover," ").concat(e?"":h().hidden),children:[u&&(0,o.jsx)(p,{}),(0,o.jsx)(k.A,{wrap:!0}),(0,o.jsxs)("ul",{className:h().Controllers,children:[(0,o.jsx)(j,{}),(0,o.jsx)(c.A,{}),(0,o.jsx)(m,{}),(0,o.jsx)(v,{}),(0,o.jsx)(b,{})]}),B&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(M,{source:a.source,onSwitch:a.switchSource,localHealthy:a.localHealthy}),(0,o.jsx)(N,{label:"SPS Source",localUrl:U.localUrl,source:d.source,onSwitch:d.switchSource,localHealthy:d.localHealthy})]})]}),(0,o.jsxs)("button",{className:h().DevelopersTrigger,onClick:()=>t(e=>!e),children:["âï¸",B&&(0,o.jsx)("span",{className:"".concat(h().SourceDot," ").concat(f)})]})]}):null}}}]);
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.