1import{x as N,aa as s,n as g,_ as I,b0 as y,p as l,u as d,o as h,m as o,as as f,f as R,t as $,b4 as E,l as F,F as b,ai as B,ah as L,aO as O,a6 as P,az as S}from"./B48720pF.js";import{_ as V}from"./CeviF6g1.js";import{_ as A}from"./BIWs7lsX.js";import{_ as M}from"./52uiaSXB.js";import{u as D}from"./B61J54Gx.js";import"./DAtltRl5.js";import"./r7owGZXa.js";import"./CjkO4axe.js";const U={key:0,class:"bookmark-item__cover"},x={class:"bookmark-item__content"},z={class:"bookmark-item__desc"},J={class:"bookmark-item__buttons"},j=N({__name:"UserProfileBookmarkItem",props:{item:{},type:{}},setup(_){return(e,n)=>{const m=I;return s(),g(m,{to:e.item.url,class:"bookmark-item"},{default:y(()=>[e.item.image?(s(),l("div",U,[d(A,{image:e.item.image,alt:e.item.title},null,8,["image","alt"])])):h("",!0),o("div",x,[o("div",z,[o("h4",null,f(e.item.title),1),e.item.description?(s(),g(V,{key:0,content:e.item.description},null,8,["content"])):h("",!0)]),o("div",J,[d(R,{variant:"primary-inverted",size:"small",tag:"NuxtLink",to:e.item.url},{default:y(()=>[$(" View "+f(e.type),1)]),_:1},8,["to"]),o("button",{class:"bookmark-item__remove-button",onClick:n[0]||(n[0]=E(u=>e.$emit("remove",e.item.uid),["prevent"]))}," Remove from list ")])])]),_:1},8,["to"])}}}),q={key:0},G={key:1,class:"bookmarks-list"},H={class:"count"},K={class:"bookmarks-list__list"},Q=N({__name:"UserProfileBookmarksList",props:{bookmarks:{default:()=>[]}},setup(_){const e=_,n=F(()=>e.bookmarks.every(m=>!m.items?.length));return(m,u)=>(s(),l("div",null,[n.value?(s(),l("div",q,u[0]||(u[0]=[o("p",{class:"text-center empty-list-info"},"No bookmarks yet",-1)]))):(s(),l("div",G,[(s(!0),l(b,null,B(m.bookmarks,i=>(s(),l("div",{key:i.type,class:"bookmarks-list__group"},[i.items?.length>0?(s(),l(b,{key:0},[o("h3",null,[o("div",null,[$(f(i.label.multiple)+" (",1),o("span",H,f(i.count),1),u[1]||(u[1]=$(") "))])]),o("ul",K,[(s(!0),l(b,null,B(i.items,k=>(s(),l("li",{key:k.uid,class:"bookmarks-list__item"},[d(j,{item:k,type:i.label.single,onRemove:v=>m.$emit("remove",v,i)},null,8,["item","type","onRemove"])]))),128))])],64)):h("",!0)]))),128))]))]))}}),W={class:"form-account-wrapper"},ne=N({__name:"T3CeMacmillanusers_bookmarks",props:{data:{default:()=>({})}},setup(_){const e=_,n=L([]),m={event:{multiple:"Events",single:"Event"},page:{multiple:"Pages",single:"Page"},article:{multiple:"Articles",single:"Article"},resource:{multiple:"Resources",single:"Resource"},course:{multiple:"Courses",single:"Course"}},{$fetch:u}=O(),{userFullName:i}=D();function k(c,a){const t=JSON.parse(JSON.stringify(n.value)),r=t.findIndex(p=>p.type===a.type);if(r!==-1){const p=t[r].items.findIndex(C=>C.uid===c);p!==-1&&(t[r].items.splice(p,1),t[r].count--)}n.value=t}async function v(c,a){const t=new FormData;t.append("bookmark",String(c));try{await u("?type=11008",{method:"POST",body:t})&&k(c,a)}catch{}}function w(c){const a=[];Object.entries(c).forEach(([t,r])=>{const p={type:t,items:r,label:m[t]??{multiple:t,single:t},count:r.length};a.push(p)}),n.value=a}return P(()=>{w(e.data)}),(c,a)=>(s(),g(M,{user:S(i)},{default:y(()=>[o("div",W,[a[0]||(a[0]=o("h1",{class:"bookmarks-list__title"},"My Bookmarks",-1)),d(Q,{bookmarks:n.value,onRemove:v},null,8,["bookmarks"])])]),_:1},8,["user"]))}});export{ne as default};
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.