import{w as d,k as g,r,aW as h,an as E}from"./index-D92x6h1h.js";function S(n){const t=r(null),o=r(null),l=r(null),i=r(null),a=r(null),s=r(null),y=g(()=>s.value?.effectiveLevel??"basic"),p=g(()=>l.value&&n.createList?n.createList:n.editList.value);function m(u){if(u.length===0)return;if(u.length===1){const e=u[0].uuid;typeof e=="string"&&(t.value=e);return}const c=u.map(e=>e.uuid).filter(e=>typeof e=="string"&&!!e);c.length>=2&&(o.value=c)}function q(u){n.createBase&&(l.value=n.createBase,i.value=u??null,a.value=null)}function L(u){n.createBase&&(l.value=n.createBase,i.value=null,a.value=u)}function U(){t.value=null,o.value=null,l.value=null,i.value=null,a.value=null}function B(u){l.value=null,i.value=null,a.value=null,o.value=null,t.value=u}if(n.urlSync){const u=h(),c=E();d(()=>u.query.editUuid,e=>{typeof e!="string"||!e||t.value!==e&&(t.value=e)},{immediate:!0}),d(t,e=>{const f=u.query.editUuid;if(e===null){if(!f)return;const v={...u.query};delete v.editUuid,c.replace({query:v});return}f!==e&&c.replace({query:{...u.query,editUuid:e}})})}return{editingUuid:t,editingUuids:o,creatingBase:l,creatingSubclass:i,creatingParentScope:a,gridRef:s,editorLevel:y,editorList:p,openEditor:m,openCreate:q,openCreateForParent:L,closeEditor:U,flipToEdit:B}}export{S as u};
