System.register(["./index-legacy.DRKniymH.js","./pinia-legacy.CU8UeoTp.js"],(function(t,e){"use strict";var s,a,r,o;return{setters:[t=>{s=t.a6,a=t.r,r=t.a7},t=>{o=t.d}],execute:function(){const e=window.savetowishlistObj?.maxRequests?Number(window.savetowishlistObj.maxRequests):8,i=Math.floor(1e3/e);let n=0;const c=(t={},a={})=>{const r=a.maxRequests||e,o=a.intervalInMs||i,c=s.create({timeout:3e4,responseType:"json",headers:{"Content-Type":"application/json;charset=UTF-8","X-WP-Nonce":window.savetowishlistObj.wpNonce,Nonce:window.savetowishlistObj.wcNonce},baseURL:window.savetowishlistObj.restApiUrl,...t});return c.interceptors.request.use((t=>new Promise((e=>{let s=setInterval((()=>{n<r&&(n++,clearInterval(s),e(t))}),o)})))),c.interceptors.response.use((t=>(n=Math.max(0,n-1),Promise.resolve(t))),(t=>(n=Math.max(0,n-1),Promise.reject({error:t.response.data})))),c};t("u",o("collectionsStore",(()=>{const t=a({total:0,currentPage:1,data:[]});return{collections:t,getCollections:async(e={})=>{const s={posts_per_page:12,...e},a=`${r().restApiUrl}/collections`,o=await c().get("",{baseURL:a,params:s});return t.value=o.data,o.data},getCollection:async t=>{const e=`${r().restApiUrl}/collection/${t}`;return(await c().get("",{baseURL:e})).data},saveCollection:async t=>(await c().post("",t)).data,deleteCollections:async t=>{const e=`${r().restApiUrl}`;return(await c().delete("",{baseURL:e,data:{ids:t}})).data},deleteCollection:async t=>{const e={action:"remove_wishlist",ids:[t]};return(await c().post("",e)).data},getWishlists:async(e={})=>{const s={posts_per_page:10,...e},a=`${r().restApiUrl}/wishlists`,o=await c().get("",{baseURL:a,params:s});return t.value=o.data,o.data},getWishlistItems:async(t={})=>{const e={...t},s=`${r().restApiUrl}/wishlist-items`;return(await c().get("",{baseURL:s,params:e})).data},deleteCollectionItems:async(t,e,s)=>{const a={action:"remove_wishlist_item",collection_id:t,product_id:e,variation_id:s};return(await c().post("",a)).data},updateWishlistItem:async t=>(await c().post("",t)).data,getGuestWishlistProducts:async t=>{const e=`${r().restApiUrl}/guest-wishlist-products`;return(await c().post("",{products:t},{baseURL:e})).data},updateWishlistItemPosition:async t=>(await c().post("",t)).data}}))),t("a",o("productsStore",(()=>{const t=a({data:[]}),e=a({total:0,currentPage:1,data:[]});let s=0;return{productLists:t,getProducts:async(e={})=>{const a=++s,o={per_page:20,stwlite_extended_search:1,...e},i=`${r().productsApiUrl}`,n=(await c().get("",{baseURL:i,params:o})).data||[];return a===s&&(t.value={data:n}),n},collectionProducts:e,getCollectionProducts:async(t={})=>{const s={...t},a=`${r().restApiUrl}/items`,o=await c().get("",{baseURL:a,params:s});return e.value=o.data,o.data}}}))),t("b",o("usersStore",(()=>{const t=a({data:[]});let e=0;return{users:t,getUsers:async(s={})=>{const a=++e,o={per_page:20,...s},i=`${r().usersApiUrl}`,n=(await c().get("",{baseURL:i,params:o})).data||[];return a===e&&(t.value={data:n}),n}}})))}}}));
