import{p as f}from"./Dl_woRDU.js";const q=o=>({fetchChildrenByParentId:async t=>{const{data:e}=await o.invoke.post("/store-api/product",{filter:[{type:"equals",field:"parentId",value:`${t}`}],associations:{children:{}},includes:{product:["id","name","cover","calculatedPrice","children","childCount","options","customFields","properties","propertyIds","optionIds","translated","availableStock","available","configuratorSettings","search","minPurchase"],configurator:["name","options"],product_media:["media"],media:["url","thumbnails","alt","metaData"],propert_group_option:["group","name"]},extensions:{availability:{},productType:{}}});return e==null?void 0:e.elements},fetchProductById:async t=>{const{data:e}=await o.invoke.post(`/store-api/product/${t}`);return e.product},fetchProductSearchById:async t=>{const{data:e}=await o.invoke.post("/store-api/product",{filter:[{type:"equals",field:"id",value:`${t}`}]});return e==null?void 0:e.elements[0]},fetchProductByProductNumber:async t=>{const{data:e}=await o.invoke.post("/store-api/product",{filter:[{type:"equals",field:"productNumber",value:`${t}`}]});return e==null?void 0:e.elements[0]},fetchConfigurationById:async t=>{const{data:e}=await o.invoke.post(`/store-api/product/${t}`,{includes:{product:[]}});return e.configurator},fetchProductImageById:async t=>{const{data:e}=await o.invoke.post("/store-api/product",{filter:[{type:"equals",field:"id",value:`${t}`}],includes:{product:["cover"]}});return e==null?void 0:e.elements[0].cover},fetchProductImagesById:async t=>{const{data:e}=await o.invoke.post("/store-api/product",{filter:[{type:"equals",field:"id",value:`${t}`}],includes:{product:["cover","media","position"]},associations:{media:{}}});return e==null?void 0:e.elements[0]},fetchProductsByCategoryId:async t=>{const{data:e}=await o.invoke.post(`/store-api/product-listing/${t}`,f);return e==null?void 0:e.elements},fetchProductDescriptionByCategoryId:async t=>{const{data:e}=await o.invoke.post(`/store-api/product-listing/${t}`,{includes:{product:["description","productNumber","translated"]}});return e==null?void 0:e.elements},fetchPropertiesById:async t=>{const{data:e}=await o.invoke.post("/store-api/product",{filter:[{type:"equals",field:"id",value:`${t}`}],associations:{properties:{associations:{group:{}}}},includes:{product:["properties"],propert_group_option:["group","name","customFields","translated","groupId"]}});return e==null?void 0:e.elements[0].properties},fetchProperties:async t=>{var r;const{data:e}=await o.invoke.post("/store-api/product",{filter:[{type:"equals",field:"id",value:`${t}`}],associations:{properties:{associations:{group:{}}}},includes:{product:["properties"],propert_group_option:["group","name","customFields","translated","groupId"]}});return(r=e==null?void 0:e.elements[0])==null?void 0:r.properties},fetchWheelSize:async t=>{var a,c;const{data:e}=await o.invoke.post("/store-api/product",{filter:[{type:"equals",field:"id",value:`${t}`}],associations:{properties:{associations:{group:{}}}},includes:{product:["properties"],propert_group_option:["group","name","customFields","translated","groupId"]}});return(c=(a=e==null?void 0:e.elements[0])==null?void 0:a.properties)==null?void 0:c.find(s=>{var n,u,i;return((i=(u=(n=s==null?void 0:s.group)==null?void 0:n.translated)==null?void 0:u.customFields)==null?void 0:i.technical_name)==="wheel_size"})},fetchPropertyByGroupName:async(t,e)=>{var c,s,n,u;const{data:r}=await o.invoke.post("/store-api/product",{filter:[{type:"equals",field:"id",value:`${t}`}],associations:{properties:{associations:{group:{}}}},includes:{product:["properties"],propert_group_option:["group","name","customFields","translated","groupId"]}});return(u=(n=(s=(c=r==null?void 0:r.elements[0])==null?void 0:c.properties)==null?void 0:s.find(i=>{var p,d,l;return((l=(d=(p=i==null?void 0:i.group)==null?void 0:p.translated)==null?void 0:d.customFields)==null?void 0:l.technical_name)===e}))==null?void 0:n.translated)==null?void 0:u.name},fetchSizingChartById:async t=>{const{data:e}=await o.invoke.get(`/store-api/sizing-chart/${t}`);return e}});export{q as u};