const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/builder-io-CmGtVPtO.js","assets/customComponents-8Hj9M-RR.js","assets/index-CRze-aDK.js","assets/vendor-BGtMsOoo.js","assets/index-BBAJCwRL.css","assets/customComponents-CWjMZ39X.css","assets/slug-content-B3JA08bs.js","assets/useSlugInfo-CDk-jWkx.js","assets/slug-content-RU2OMyzC.css","assets/internal-C3XoLyOB.js"])))=>i.map(i=>d[i]);
import{O as V,a7 as B,bQ as R,d as _}from"./index-CRze-aDK.js";import{C as T,q as a,r as w,as as L,N as D,D as g,E as o,K as c,a3 as d,u as b,ag as I,Q as M}from"./vendor-BGtMsOoo.js";function x(p){const n=p.filter(r=>r.isActive&&r.state!=="empty").sort((r,m)=>r.priority-m.priority);return n.length?n[0].state==="ready"?n[0].id:"loader":null}const N={class:"matcher"},Q={key:3},F=T({__name:"matcher",props:{pathMatch:{}},setup(p){const n=p,r={builderIo:1,slugContent:2,internal:3},m=I(()=>_(()=>import("./builder-io-CmGtVPtO.js"),__vite__mapDeps([0,1,2,3,4,5]))),C=I(()=>_(()=>import("./slug-content-B3JA08bs.js"),__vite__mapDeps([6,2,3,4,7,8]))),h=I(()=>_(()=>import("./internal-C3XoLyOB.js"),__vite__mapDeps([9,2,3,4]))),{modulesSettings:A,themeContext:O}=V(),s=a(()=>{var t;return{...r,...(t=O.value.settings.previewers_settings)==null?void 0:t.priorities}}),E=B("view"),f=a(()=>{var t;return(t=A.value)==null?void 0:t.find(e=>e.moduleId==="VirtoCommerce.BuilderIO")}),S=a(()=>{var t,e;return(e=(t=f.value)==null?void 0:t.settings.find(u=>u.name==="BuilderIO.Enable"))==null?void 0:e.value}),P=a(()=>{var t,e;return(e=(t=f.value)==null?void 0:t.settings.find(u=>u.name==="BuilderIO.PublicApiKey"))==null?void 0:e.value}),i=w({builderIo:{id:"builderIo",priority:s.value.builderIo,state:"initial",isActive:S.value},slugContent:{id:"slugContent",priority:s.value.slugContent,state:"initial",isActive:!0},internal:{id:"internal",priority:s.value.internal,state:"initial",isActive:!0}}),l=a(()=>x(Object.values(i.value)));function y(t,e){i.value[e]&&(i.value[e].state=t)}const k=a(()=>Array.isArray(n.pathMatch)?n.pathMatch:["/"]);return L(E,t=>{t==="default"?i.value.slugContent.priority=Math.min(...Object.values(s.value))-1:i.value.slugContent.priority=s.value.slugContent,window.scrollTo({top:0,behavior:"smooth"})},{immediate:!0}),(t,e)=>{const u=D("VcLoaderOverlay");return o(),g("div",N,[i.value.slugContent.isActive?(o(),c(b(C),{key:0,"is-visible":l.value==="slugContent","path-match":k.value,onSetState:e[0]||(e[0]=v=>y(v,"slugContent"))},null,8,["is-visible","path-match"])):d("",!0),i.value.builderIo.isActive?(o(),c(b(m),{key:1,"is-visible":l.value==="builderIo","api-key":P.value,onSetState:e[1]||(e[1]=v=>y(v,"builderIo"))},null,8,["is-visible","api-key"])):d("",!0),i.value.internal.isActive?(o(),c(b(h),{key:2,"is-visible":l.value==="internal",onSetState:e[2]||(e[2]=v=>y(v,"internal"))},null,8,["is-visible"])):d("",!0),l.value==="loader"?(o(),g("div",Q,[M(u)])):d("",!0),l.value?d("",!0):(o(),c(R,{key:4}))])}}});export{F as default};
//# sourceMappingURL=matcher-_WAE0tKC.js.map
