1import{_}from"./ukHWZ1qF.js";import{j as C,k,e as S,r as g}from"./EW60oKse.js";import{z as N,i as w,b as u,H as L,O as i,P as o,R as s,u as n,a6 as M,J as v,V as B,S as h,_ as E}from"./QVWpw_zs.js";const V={class:"flex h-6"},I={class:"my-5 mx-10"},T={key:0,class:"text-center"},P={key:1,class:"flex flex-col divide-y"},j=["onClick"],A={key:2,class:"bg-red-100 p-4 mb-5"},F={class:"text-red-600 font-sans"},H=N({__name:"AccountShoppingListSelect",props:{product:{}},setup(b){const{pushSuccess:y,pushError:O}=C(),{apiInstance:p}=k(),{close:d}=w("modal"),{t:c}=S(),a=u(""),l=u(!0),m=b,f=u([]);L(async()=>{await g(p,"/store-api/account/shopping-list",{method:"GET"}).then(async r=>{f.value=r.elements,l.value=!1}).catch(r=>{a.value=c("shoppingLists.getError"),l.value=!1})});const x=async r=>{l.value=!0,g(p,"/store-api/account/shopping-list/product-add",{method:"POST",body:{shoppingListId:r,productId:m.product.id}}).then(e=>{if(e&&e.response==="success"){y(c("shoppingLists.addSuccess")),d();const t=m.product;t.quantity=1,trackAddToShoppinglist(sessionContext.value,[t])}e&&e.response=="error"&&(a.value=e.message??c("general.fail"))}).catch(e=>{a.value=c("shoppingLists.addError")})};return(r,e)=>(i(),o(v,null,[s("div",V,[s("button",{type:"button",class:"p-2 btn-link ml-auto mr-4 mt-4 h-fit cursor-pointer","data-test-id":"shoppinglist-modal-close-button",onClick:e[0]||(e[0]=(...t)=>n(d)&&n(d)(...t))},e[1]||(e[1]=[s("span",{class:"sr-only"},"Close panel",-1),s("img",{src:_,height:"15",alt:"Close",class:"pointer-events-none"},null,-1)]))]),s("div",I,[e[3]||(e[3]=s("h4",null,"Vælg indkøbsliste",-1)),n(l)?(i(),o("div",T,e[2]||(e[2]=[M('<div class="inline-block mx-auto"><svg viewBox="0 0 120 30" xmlns="http://www.w3.org/2000/svg" fill="#bbc2c9" width="128" height="128"><circle cx="15" cy="15" r="15"><animate attributeName="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcMode="linear" repeatCount="indefinite"></animate></circle><circle cx="60" cy="15" r="9" fill-opacity="0.3"><animate attributeName="r" from="9" to="9" begin="0s" dur="0.8s" values="9;15;9" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="fill-opacity" from="0.5" to="0.5" begin="0s" dur="0.8s" values=".5;1;.5" calcMode="linear" repeatCount="indefinite"></animate></circle><circle cx="105" cy="15" r="15"><animate attributeName="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcMode="linear" repeatCount="indefinite"></animate></circle></svg></div>',1)]))):(i(),o("div",P,[(i(!0),o(v,null,B(n(f),t=>(i(),o("div",{class:"p-4 cursor-pointer border-b-solid border-gray-400 border-1 text-lg",onClick:q=>x(t.id)},h(t.name),9,j))),256))])),n(a).length?(i(),o("div",A,[s("div",F,h(n(a)),1)])):E("",!0)])],64))}});export{H 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.