var m=Object.defineProperty,y=Object.defineProperties;var d=Object.getOwnPropertyDescriptors;var o=Object.getOwnPropertySymbols;var p=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var b=(r,s,e)=>s in r?m(r,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[s]=e,a=(r,s)=>{for(var e in s||(s={}))p.call(s,e)&&b(r,e,s[e]);if(o)for(var e of o(s))k.call(s,e)&&b(r,e,s[e]);return r},c=(r,s)=>y(r,d(s));import{_ as i,b as f,z as l}from"./main.2.8.10.js";const P=(r,s,e)=>{const _=a({},s),{name:t}=r.target;r.target.value!==""?_[t]=r.target.value:delete _[t],e(a({},_))},q=r=>{const s=r.filter(e=>e.required===!0);return s.length>0?s.map(e=>({formField:"",lmfwcFormField:e.key})):[{formField:"",lmfwcFormField:""}]},A=r=>!((r!=null&&r.field_map?r.field_map.filter(e=>!e.formField||!e.lmfwcFormField||e.formField==="custom"&&!e.customValue||e.lmfwcFormField==="customFieldKey"&&!e.customFieldKey):[]).length>0),N=(r,s,e,_,t,u)=>{if(!r.api_key||!r.api_secret){e({base_url:r.base_url?"":i("Consumer key can't be empty","bit-integrations"),api_key:r.api_key?"":i("Consumer key can't be empty","bit-integrations"),api_secret:r.api_secret?"":i("Consumer secret can't be empty","bit-integrations")});return}e({}),u(c(a({},t),{auth:!0}));const h={base_url:r.base_url,api_key:r.api_key,api_secret:r.api_secret};f(h,"lmfwc_authentication").then(n=>{if(n&&n.success){_(!0),u(c(a({},t),{auth:!1})),l.success(i("Authorized Successfully","bit-integrations"));return}u(c(a({},t),{auth:!1})),l.error(n!=null&&n.data&&typeof n.data=="string"?n.data:i("Authorized failed, Please enter valid Consumer key & Consumer secret","bit-integrations"))})},z=(r,s,e)=>{e(c(a({},e),{customer:!0}));const _={base_url:r.base_url,api_key:r.api_key,api_secret:r.api_secret};f(_,"lmfwc_fetch_all_customer").then(t=>{if(t&&t.success){if(t.data){s(u=>(u.customers=t.data,u)),e(c(a({},e),{customer:!1})),l.success(i("Customers fetched successfully","bit-integrations"));return}e(c(a({},e),{customer:!1})),l.error(i("Customers Not Found!","bit-integrations"));return}e(c(a({},e),{customer:!1})),l.error(i("Customers fetching failed","bit-integrations"))})},G=(r,s,e)=>{e(c(a({},e),{product:!0}));const _={base_url:r.base_url,api_key:r.api_key,api_secret:r.api_secret};f(_,"lmfwc_fetch_all_product").then(t=>{if(t&&t.success){if(t.data){s(u=>(u.products=t.data,u)),e(c(a({},e),{product:!1})),l.success(i("Product fetched successfully","bit-integrations"));return}e(c(a({},e),{product:!1})),l.error(i("Product Not Found!","bit-integrations"));return}e(c(a({},e),{product:!1})),l.error(i("Product fetching failed","bit-integrations"))})},O=(r,s,e)=>{e(c(a({},e),{order:!0}));const _={base_url:r.base_url,api_key:r.api_key,api_secret:r.api_secret};f(_,"lmfwc_fetch_all_order").then(t=>{if(t&&t.success){if(t.data){s(u=>(u.orders=t.data,u)),e(c(a({},e),{order:!1})),l.success(i("Order fetched successfully","bit-integrations"));return}e(c(a({},e),{order:!1})),l.error(i("Order Not Found!","bit-integrations"));return}e(c(a({},e),{order:!1})),l.error(i("Order fetching failed","bit-integrations"))})},K=(r,s,e)=>{e(c(a({},e),{license:!0}));const _={base_url:r.base_url,api_key:r.api_key,api_secret:r.api_secret};f(_,"lmfwc_fetch_all_license").then(t=>{if(t&&t.success){if(t.data){s(u=>(u.licenses=t.data,u)),e(c(a({},e),{license:!1})),l.success(i("License fetched successfully","bit-integrations"));return}e(c(a({},e),{license:!1})),l.error(i("License Not Found!","bit-integrations"));return}e(c(a({},e),{license:!1})),l.error(i("License fetching failed","bit-integrations"))})},x=(r,s,e)=>{e(c(a({},e),{generator:!0}));const _={base_url:r.base_url,api_key:r.api_key,api_secret:r.api_secret};f(_,"lmfwc_fetch_all_generator").then(t=>{if(t&&t.success){if(t.data){s(u=>(u.generators=t.data,u)),e(c(a({},e),{generator:!1})),l.success(i("Generator fetched successfully","bit-integrations"));return}e(c(a({},e),{generator:!1})),l.error(i("Generator Not Found!","bit-integrations"));return}e(c(a({},e),{generator:!1})),l.error(i("Generator fetching failed","bit-integrations"))})};export{x as a,z as b,A as c,G as d,O as e,q as f,K as g,P as h,N as l};
