import{w as M}from"./vendor-core-CzvSW5ae.js";import{o as p,E as o}from"./index-B5qe6yln.js";const E=(a="")=>{if(!a)throw new Error("createCompMetaStore scopeId is required");return M(`compMeta_${a}`,{state:()=>({detail:{},depEntryNameToFile:{},versionToFileAccessPath:{},localCompInfo:[],latestVersion:""}),getters:{isLocalExist:e=>e.localCompInfo.length!==0,latestVersionToFileAccessPath:e=>e.versionToFileAccessPath[e.latestVersion]??[]},actions:{setLatestVersion(e){this.$patch(t=>{t.latestVersion=e})},setLocalCompInfo(e){this.$patch(t=>{t.localCompInfo=e})},setDetail(e,t){this.$patch(r=>{r.detail[e]={...r.detail[e],...t}})},setDepEntryNameToFile(e,t){this.$patch(r=>{r.depEntryNameToFile[e]=t})},setVersionToFileAccessPath(e,t){this.$patch(r=>{r.versionToFileAccessPath[e]=t})}}})};function P(a,e){return a.filter(t=>{const r=e.find(l=>l.name===t.name||l.name===t.parent?.name);if(!r)return!1;const{match:h}=r,{major:s,minor:n,patch:m}=p.parseVersion(t.version),{major:i,minor:c,patch:T}=p.parseVersion(r.version);switch(h){case o.COMP_MATCH_TYPE_ONLY_INSTALL:return!0;case o.COMP_MATCH_TYPE_MAJOR_VERSION:return s===i;case o.COMP_MATCH_TYPE_MINOR_VERSION:return s===i&&n===c;case o.COMP_MATCH_TYPE_EXACT_VERSION:return s===i&&n===c&&m===T}})}export{E as c,P as p};
