import{u as h,z as O,bZ as v,l,aS as m}from"./app-BgLa5dit.js";const T=c=>{var k;const[d,s]=h(v.CURATOR_WORKING_LISTS,void 0,{storage:O.LocalStorage}),n=d||{},u=l();function g(e,r=c){var t,o;return!e||!r?!1:(r=r.toString(),e=e.toString(),!!((o=(t=n[r])==null?void 0:t.objects)!=null&&o[e]))}function b(e,r=c,t,o){if(!g(e,r)&&(s({...n,[r]:{id:n[r].id,name:n[r].name,objects:{...n[r].objects,[e]:!0}}}),!(o!=null&&o.noAlert))){if(t){u.success(`Successfully added <strong>${t}</strong> to your workbench.`);return}u.success("Successfully added item to your workbench.")}}function w(e,r=c,t,o){if(g(e,r)&&(s({...n,[r]:{id:n[r].id,name:n[r].name,objects:m.omit(n[r].objects,[e])}}),!(o!=null&&o.noAlert))){if(t){u.success(`Successfully removed <strong>${t}</strong> from your workbench.`);return}u.success("Successfully removed item from your workbench.")}}function S(e=c){e&&s({...n,[e]:{id:n[e].id,name:n[e].name,objects:{}}})}function f(e,r=[]){const t=Object.keys(n).sort((i,a)=>+i-+a),o=t.length?+t[t.length-1]+1:1,L={id:o.toString(),name:e,objects:r.reduce((i,a)=>(i[a]=!0,i),{})};return s({...n,[o]:L}),L}function y(e,r){const t=f(r);s({...n,[t.id]:{...t,objects:{...n[e].objects}}})}function W(e){const r=m.omit(n,[e]);s(r)}function j(e,r){s({...n,[e]:{...n[e],name:r}})}return{isInWorkingList:g,addToWorkingList:b,removeFromWorkingList:w,workingList:c?Object.keys(((k=n[c])==null?void 0:k.objects)??{}):[],workingLists:Object.values(n),clearWorkingList:S,createWorkingList:f,copyWorkingList:y,deleteWorkingList:W,renameWorkingList:j}};export{T as u};
//# sourceMappingURL=CKjyFQLY.chunk.js.map
