umwd-components 0.1.731 → 0.1.733

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/dist/cjs/src/components/common/Address.js +1 -1
  2. package/dist/cjs/src/components/common/csv/CsvDownloader.js +1 -1
  3. package/dist/cjs/src/components/e-commerce/cart/CartSummary.js +1 -1
  4. package/dist/cjs/src/components/e-commerce/cart/CartSummaryRow.js +1 -1
  5. package/dist/cjs/src/components/e-commerce/categories/CategorySelectorV2.js +1 -1
  6. package/dist/cjs/src/components/e-commerce/categories/EditCategoryForm.js +1 -1
  7. package/dist/cjs/src/components/e-commerce/checkout/Step4.js +1 -1
  8. package/dist/cjs/src/components/e-commerce/customer/CustomerProfileDisplay.js +1 -1
  9. package/dist/cjs/src/components/e-commerce/customer/CustomerProfileEditForm.js +1 -1
  10. package/dist/cjs/src/components/e-commerce/enduser/EnduserProfileEditForm.js +1 -1
  11. package/dist/cjs/src/components/e-commerce/iro/IROItemFields.js +1 -1
  12. package/dist/cjs/src/components/e-commerce/iro/IroItemUpdater.js +1 -1
  13. package/dist/cjs/src/components/e-commerce/iro/ManageIROForm.js +1 -1
  14. package/dist/cjs/src/components/e-commerce/iro/RmaForm.js +1 -1
  15. package/dist/cjs/src/components/e-commerce/iro/TextualIROItemUpdater.js +1 -1
  16. package/dist/cjs/src/components/e-commerce/iro/TextualManageIROForm.js +1 -1
  17. package/dist/cjs/src/components/e-commerce/opo/ManageOpoForm.js +1 -1
  18. package/dist/cjs/src/components/e-commerce/opo/OPOItemFields.js +1 -1
  19. package/dist/cjs/src/components/e-commerce/opo/OpoItemUpdater.js +1 -1
  20. package/dist/cjs/src/components/e-commerce/opo/OpoSummary.js +1 -1
  21. package/dist/cjs/src/components/e-commerce/opo/OpoSummaryRow.js +1 -1
  22. package/dist/cjs/src/components/e-commerce/opo/TextualManageOpoForm.js +1 -1
  23. package/dist/cjs/src/components/e-commerce/opo/TextualOpoItemUpdater.js +1 -1
  24. package/dist/cjs/src/components/e-commerce/products/EditProductForm.js +1 -1
  25. package/dist/cjs/src/components/e-commerce/products/EditStockForm.js +1 -1
  26. package/dist/cjs/src/components/e-commerce/products/PriceFields.js +1 -1
  27. package/dist/cjs/src/components/e-commerce/products/ProductCard.js +1 -1
  28. package/dist/cjs/src/components/e-commerce/products/ProductCategoryCard.js +1 -1
  29. package/dist/cjs/src/components/e-commerce/products/ProductSelector.js +1 -1
  30. package/dist/cjs/src/components/e-commerce/products/SingleProduct.js +1 -1
  31. package/dist/cjs/src/components/logistics/dispatcher/DispatcherProfileEditForm.js +1 -1
  32. package/dist/cjs/src/components/logistics/ipo/IPOItemFields.js +1 -1
  33. package/dist/cjs/src/components/logistics/ipo/IPOItemUpdater.js +1 -1
  34. package/dist/cjs/src/components/logistics/ipo/ManageIPOForm.js +1 -1
  35. package/dist/cjs/src/components/logistics/ipo/TextualIPOItemUpdater.js +1 -1
  36. package/dist/cjs/src/components/logistics/ipo/TextualManageIPOForm.js +1 -1
  37. package/dist/cjs/src/components/logistics/vendor/EditVendorForm.js +1 -1
  38. package/dist/cjs/src/components/logistics/vendor/VendorDisplay.js +1 -1
  39. package/dist/cjs/src/components/logistics/vendor/VendorSelector.js +1 -1
  40. package/dist/cjs/src/components/page-elements/CategoryBlock.js +1 -1
  41. package/dist/cjs/src/components/public-information/PublicInformationForm.js +1 -1
  42. package/dist/cjs/src/context/e-commerce/cart/CartContext.js +1 -1
  43. package/dist/cjs/src/data/actions/e-commerce/categories/updateCategoryAction.js +1 -1
  44. package/dist/cjs/src/data/actions/e-commerce/product/updateProductAction.js +1 -1
  45. package/dist/cjs/src/data/actions/logistics/vendor/updateVendorAction.js +1 -1
  46. package/dist/cjs/src/data/actions/media/uploadBase64MediaAction.js +1 -1
  47. package/dist/cjs/src/data/actions/pagebuilder-actions.js +1 -1
  48. package/dist/cjs/src/data/actions/profile-actions.js +1 -1
  49. package/dist/cjs/src/data/actions/public-information/updatePublicInformationAction.js +1 -1
  50. package/dist/cjs/src/data/loaders/e-commerce/getSingleCustomer.js +1 -1
  51. package/dist/cjs/src/data/loaders/e-commerce/getSingleProduct.js +1 -1
  52. package/dist/cjs/src/data/loaders/logistics/getIpoNames.js +1 -1
  53. package/dist/cjs/src/data/loaders/logistics/getTableIpos.js +1 -1
  54. package/dist/cjs/src/data/loaders/logistics/getVendorNames.js +1 -1
  55. package/dist/cjs/src/data/loaders/logistics/queryAllIpos.js +1 -1
  56. package/dist/cjs/src/data/loaders/logistics/queryAllVendors.js +1 -1
  57. package/dist/cjs/src/data/loaders/page-elements/getSinglePage.js +1 -1
  58. package/dist/cjs/src/lib/molliePaymentProvider.js +1 -1
  59. package/dist/cjs/src/lib/parseFormData.js +1 -1
  60. package/dist/cjs/tsconfig.build.tsbuildinfo +1 -1
  61. package/dist/esm/_virtual/index3.js +2 -2
  62. package/dist/esm/_virtual/index4.js +2 -2
  63. package/dist/esm/node_modules/prop-types/node_modules/react-is/index.js +1 -1
  64. package/dist/esm/node_modules/safe-buffer/index.js +1 -1
  65. package/dist/esm/src/components/common/Address.js +4 -4
  66. package/dist/esm/src/components/common/csv/CsvDownloader.js +0 -1
  67. package/dist/esm/src/components/e-commerce/cart/CartSummary.js +1 -1
  68. package/dist/esm/src/components/e-commerce/cart/CartSummaryRow.js +4 -4
  69. package/dist/esm/src/components/e-commerce/categories/CategorySelectorV2.js +4 -3
  70. package/dist/esm/src/components/e-commerce/categories/EditCategoryForm.js +3 -3
  71. package/dist/esm/src/components/e-commerce/checkout/Step4.js +1 -1
  72. package/dist/esm/src/components/e-commerce/customer/CustomerProfileDisplay.js +1 -1
  73. package/dist/esm/src/components/e-commerce/customer/CustomerProfileEditForm.js +4 -3
  74. package/dist/esm/src/components/e-commerce/enduser/EnduserProfileEditForm.js +2 -2
  75. package/dist/esm/src/components/e-commerce/iro/IROItemFields.js +2 -2
  76. package/dist/esm/src/components/e-commerce/iro/IroItemUpdater.js +9 -4
  77. package/dist/esm/src/components/e-commerce/iro/ManageIROForm.js +4 -2
  78. package/dist/esm/src/components/e-commerce/iro/RmaForm.js +3 -3
  79. package/dist/esm/src/components/e-commerce/iro/TextualIROItemUpdater.js +4 -4
  80. package/dist/esm/src/components/e-commerce/iro/TextualManageIROForm.js +10 -8
  81. package/dist/esm/src/components/e-commerce/opo/ManageOpoForm.js +2 -2
  82. package/dist/esm/src/components/e-commerce/opo/OPOItemFields.js +1 -1
  83. package/dist/esm/src/components/e-commerce/opo/OpoItemUpdater.js +9 -4
  84. package/dist/esm/src/components/e-commerce/opo/OpoSummary.js +1 -1
  85. package/dist/esm/src/components/e-commerce/opo/OpoSummaryRow.js +1 -1
  86. package/dist/esm/src/components/e-commerce/opo/TextualManageOpoForm.js +7 -7
  87. package/dist/esm/src/components/e-commerce/opo/TextualOpoItemUpdater.js +4 -4
  88. package/dist/esm/src/components/e-commerce/products/EditProductForm.js +19 -17
  89. package/dist/esm/src/components/e-commerce/products/EditStockForm.js +39 -16
  90. package/dist/esm/src/components/e-commerce/products/PriceFields.js +3 -2
  91. package/dist/esm/src/components/e-commerce/products/ProductCard.js +3 -3
  92. package/dist/esm/src/components/e-commerce/products/ProductCategoryCard.js +1 -1
  93. package/dist/esm/src/components/e-commerce/products/ProductSelector.js +5 -5
  94. package/dist/esm/src/components/e-commerce/products/SingleProduct.js +5 -5
  95. package/dist/esm/src/components/logistics/dispatcher/DispatcherProfileEditForm.js +2 -2
  96. package/dist/esm/src/components/logistics/ipo/IPOItemFields.js +2 -2
  97. package/dist/esm/src/components/logistics/ipo/IPOItemUpdater.js +9 -4
  98. package/dist/esm/src/components/logistics/ipo/ManageIPOForm.js +7 -5
  99. package/dist/esm/src/components/logistics/ipo/TextualIPOItemUpdater.js +4 -4
  100. package/dist/esm/src/components/logistics/ipo/TextualManageIPOForm.js +10 -8
  101. package/dist/esm/src/components/logistics/vendor/EditVendorForm.js +77 -75
  102. package/dist/esm/src/components/logistics/vendor/VendorDisplay.js +1 -1
  103. package/dist/esm/src/components/logistics/vendor/VendorSelector.js +5 -4
  104. package/dist/esm/src/components/page-elements/CategoryBlock.js +1 -1
  105. package/dist/esm/src/components/public-information/PublicInformationForm.js +42 -42
  106. package/dist/esm/src/context/e-commerce/cart/CartContext.js +2 -2
  107. package/dist/esm/src/data/actions/e-commerce/categories/updateCategoryAction.js +3 -3
  108. package/dist/esm/src/data/actions/e-commerce/enduser/profile-actions.js +2 -2
  109. package/dist/esm/src/data/actions/e-commerce/product/updateProductAction.js +5 -6
  110. package/dist/esm/src/data/actions/logistics/dispatcher/profile-actions.js +2 -2
  111. package/dist/esm/src/data/actions/logistics/vendor/updateVendorAction.js +2 -2
  112. package/dist/esm/src/data/actions/media/uploadBase64MediaAction.js +3 -3
  113. package/dist/esm/src/data/actions/pagebuilder-actions.js +3 -3
  114. package/dist/esm/src/data/actions/profile-actions.js +3 -3
  115. package/dist/esm/src/data/actions/public-information/updatePublicInformationAction.js +2 -5
  116. package/dist/esm/src/data/loaders/e-commerce/getAllOpos.js +8 -0
  117. package/dist/esm/src/data/loaders/e-commerce/getSingleCustomer.js +15 -6
  118. package/dist/esm/src/data/loaders/e-commerce/getSingleProduct.js +2 -2
  119. package/dist/esm/src/data/loaders/e-commerce/getSingleStock.js +2 -2
  120. package/dist/esm/src/data/loaders/logistics/getIpoNames.js +1 -1
  121. package/dist/esm/src/data/loaders/logistics/getSingleVendor.js +2 -2
  122. package/dist/esm/src/data/loaders/logistics/getTableIpos.js +1 -1
  123. package/dist/esm/src/data/loaders/logistics/getVendorNames.js +1 -1
  124. package/dist/esm/src/data/loaders/logistics/queryAllIpos.js +0 -1
  125. package/dist/esm/src/data/loaders/logistics/queryAllVendors.js +0 -1
  126. package/dist/esm/src/data/loaders/page-elements/getSinglePage.js +0 -1
  127. package/dist/esm/src/lib/molliePaymentProvider.js +7 -3
  128. package/dist/esm/src/lib/parseFormData.js +1 -0
  129. package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
  130. package/dist/esm/types/components/logistics/ipo/IPOItemFields.d.ts +1 -1
  131. package/dist/esm/types/components/logistics/report/PreReportsDisplay.d.ts +2 -2
  132. package/dist/esm/types/components/page-elements/CategoryBlock.d.ts +1 -1
  133. package/dist/esm/types/data/actions/e-commerce/categories/updateCategoryAction.d.ts +1 -1
  134. package/dist/esm/types/data/actions/e-commerce/checkout-action.d.ts +2 -1
  135. package/dist/esm/types/data/actions/e-commerce/enduser/profile-actions.d.ts +2 -1
  136. package/dist/esm/types/data/actions/e-commerce/product/updateProductAction.d.ts +1 -1
  137. package/dist/esm/types/data/actions/logistics/dispatcher/profile-actions.d.ts +2 -1
  138. package/dist/esm/types/data/actions/logistics/vendor/updateVendorAction.d.ts +1 -1
  139. package/dist/esm/types/data/actions/media/uploadBase64MediaAction.d.ts +1 -1
  140. package/dist/esm/types/data/actions/pagebuilder-actions.d.ts +3 -3
  141. package/dist/esm/types/data/actions/profile-actions.d.ts +1 -1
  142. package/dist/esm/types/data/actions/public-information/updatePublicInformationAction.d.ts +1 -1
  143. package/dist/esm/types/data/loaders/e-commerce/getAllOpos.d.ts +8 -0
  144. package/dist/esm/types/data/loaders/e-commerce/getSingleProduct.d.ts +3 -2
  145. package/dist/esm/types/data/loaders/e-commerce/getSingleStock.d.ts +1 -1
  146. package/dist/esm/types/data/loaders/logistics/getSingleVendor.d.ts +1 -1
  147. package/dist/esm/types/data/loaders/page-elements/getSinglePage.d.ts +2 -1
  148. package/dist/esm/types/types/AddressProps.d.ts +1 -1
  149. package/dist/esm/types/types/e-commerce/cart/types.d.ts +2 -2
  150. package/dist/esm/types/types/e-commerce/category/types.d.ts +3 -3
  151. package/dist/esm/types/types/e-commerce/customer/types.d.ts +3 -7
  152. package/dist/esm/types/types/e-commerce/enduser/types.d.ts +1 -1
  153. package/dist/esm/types/types/e-commerce/invoice/types.d.ts +6 -6
  154. package/dist/esm/types/types/e-commerce/iro/types.d.ts +2 -4
  155. package/dist/esm/types/types/e-commerce/opo/types.d.ts +2 -4
  156. package/dist/esm/types/types/e-commerce/product/types.d.ts +9 -16
  157. package/dist/esm/types/types/logistics/Ipo.d.ts +2 -4
  158. package/dist/esm/types/types/logistics/Note.d.ts +1 -1
  159. package/dist/esm/types/types/logistics/Report.d.ts +4 -4
  160. package/dist/esm/types/types/logistics/Vendor.d.ts +4 -4
  161. package/dist/esm/types/types/logistics/dispatcher/types.d.ts +1 -1
  162. package/dist/esm/types/types/public-information/types.d.ts +1 -1
  163. package/package.json +1 -1
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- "use strict";var e=require("react/jsx-runtime"),i=require("@mui/material/Divider"),s=require("@mui/material/Paper"),a=require("@mui/material/Box"),r=require("@mui/material/Stack"),n=require("@mui/material/Alert"),t=require("@mui/material/TextField"),l=require("@mui/material/Typography"),o=require("@mui/material/Grid"),c=require("../SubmitButton.js"),d=require("react-dom"),m=require("../StrapiErrors.js"),u=require("../e-commerce/customer/BusinessCredentials.js"),x=require("react"),p=require("../common/Address.js"),j=require("../../data/actions/public-information/updatePublicInformationAction.js"),h=require("../common/socials/Socials.js"),g=require("@mui/material/IconButton"),f=require("@mui/icons-material/Add");const b={zodErrors:null,strapiErrors:null,data:null,message:null};exports.PublicInformationForm=function({publicInformation:q,sx:v}){const{id:y,title:S,description:_,disclaimer_link:A,privacypolicy_link:C,maxWidth:I,email:N,phone_number:k,business_credentials:B,address:E,socials:F,header_logo:R,footer_logo:$}=q,[P,T]=d.useFormState(j.updatePublicInformationAction,b),[V,D]=x.useState([]),w=(e,i)=>{V.includes(i)?D(V.filter(e=>e!==i)):D([...V,i])},[z,G]=x.useState(F.reduce((e,i,s)=>(e.push({data:i,componentName:`socials[${s}]`,componentReference:"common.social"}),e),[])),[M,W]=x.useState([]);return e.jsx(a,{sx:[{p:2},...Array.isArray(v)?v:[v]],component:s,children:e.jsxs("form",{action:T,children:[y&&e.jsx("input",{id:"id",type:"hidden",name:"id",value:y}),e.jsxs(o,{container:!0,spacing:2,children:[e.jsx(o,{item:!0,xs:12,children:e.jsx(l,{variant:"h5",children:"Edit Public Information"})}),e.jsx(o,{item:!0,xs:12,children:e.jsxs(r,{spacing:2,children:[e.jsx(t,{id:"title",name:"title",label:"Title",defaultValue:S}),e.jsx(t,{id:"description",name:"description",label:"Description",defaultValue:_}),e.jsx(t,{id:"email",name:"email",label:"email",defaultValue:N}),e.jsx(t,{id:"phone_number",name:"phone_number",label:"phone_number",defaultValue:k})]})}),e.jsx(o,{item:!0,xs:12,lg:6,children:e.jsxs(r,{spacing:2,children:[e.jsx(l,{variant:"h6",children:"Company Address"}),e.jsx(i,{}),e.jsx(p.AddressFields,{componentName:"address",componentReference:"common.address",data:E})]})}),e.jsx(o,{item:!0,xs:12,lg:6,children:e.jsxs(r,{spacing:2,children:[e.jsx(l,{variant:"h6",children:"Business Credentials"}),e.jsx(i,{}),e.jsx(u.BusinessCredentialsFields,{componentName:"business_credentials",componentReference:"business.credentials",data:B})]})}),e.jsx(o,{item:!0,xs:12,sx:{mt:1},children:e.jsx(l,{variant:"h6",children:"Socials"})}),z.map((i,s)=>i.data?.id?V.includes(i.data?.id)?e.jsx(o,{item:!0,xs:12,md:6,lg:4,children:e.jsx(h.SocialsFields,{data:i.data,componentName:`socials[${s}]`,componentReference:"common.social",deleteCallback:()=>{G(z.filter((e,i)=>i!==s))}})},i.data.id):e.jsxs(o,{item:!0,xs:12,md:6,lg:4,children:[e.jsx("input",{type:"hidden",name:`socials[${s}].id`,value:i.data.id}),e.jsx("input",{type:"hidden",name:`socials[${s}].__component`,value:"logistics-elements.social"}),e.jsx(h.default,{data:{...i.data,onClick:w}})]},i.data.id):null),M.map((i,s)=>e.jsx(o,{item:!0,xs:12,md:6,lg:4,children:e.jsx(h.SocialsFields,{data:i.data,componentName:i.componentName,componentReference:"common.social",deleteCallback:()=>{W(M.filter((e,i)=>i!==s).map((e,i)=>({...e,componentName:`socials[${i+z.length}]`})))}})},i.data?.uuid)),e.jsx(o,{item:!0,xs:12,md:6,lg:4,justifyContent:"center",alignItems:"center",children:e.jsx(g,{onClick:()=>{W([...M,{componentName:`socials[${z.length+M.length}]`,componentReference:"logistics-elements.social",data:{uuid:Math.random(),name:"",url:""}}])},children:e.jsx(f,{})})}),e.jsx(o,{item:!0,xs:12,children:e.jsxs(r,{direction:"row-reverse",spacing:2,alignItems:"center",sx:{py:1},children:[e.jsx(c.SubmitButton,{text:"save changes",loadingText:"loading"}),P?.strapiErrors&&e.jsx(m.StrapiErrors,{error:P?.strapiErrors}),P?.message&&e.jsx(n,{severity:"error",children:P?.message})]})})]})]})})};
7
+ "use strict";var e=require("react/jsx-runtime"),i=require("@mui/material/Divider"),s=require("@mui/material/Paper"),a=require("@mui/material/Box"),r=require("@mui/material/Stack"),n=require("@mui/material/Alert"),t=require("@mui/material/TextField"),l=require("@mui/material/Typography"),o=require("@mui/material/Grid"),c=require("../SubmitButton.js"),m=require("react-dom"),d=require("../StrapiErrors.js"),u=require("../e-commerce/customer/BusinessCredentials.js"),x=require("react"),p=require("../common/Address.js"),j=require("../../data/actions/public-information/updatePublicInformationAction.js"),h=require("../common/socials/Socials.js"),g=require("@mui/material/IconButton"),f=require("@mui/icons-material/Add");const b={zodErrors:null,strapiErrors:null,data:null,message:null};exports.PublicInformationForm=function({publicInformation:q,sx:S}){const{documentId:v,title:y,description:_,disclaimer_link:A,privacypolicy_link:C,maxWidth:I,email:N,phone_number:k,business_credentials:B,address:E,socials:F,header_logo:R,footer_logo:$}=q,[P,T]=m.useFormState((e,i)=>j.updatePublicInformationAction(v,e,i),b),[V,D]=x.useState([]),w=(e,i)=>{V.includes(i)?D(V.filter(e=>e!==i)):D([...V,i])},[z,G]=x.useState(F.reduce((e,i,s)=>(e.push({data:i,componentName:`socials[${s}]`,componentReference:"common.social"}),e),[])),[M,W]=x.useState([]);return e.jsx(a,{sx:[{p:2},...Array.isArray(S)?S:[S]],component:s,children:e.jsx("form",{action:T,children:e.jsxs(o,{container:!0,spacing:2,children:[e.jsx(o,{item:!0,xs:12,children:e.jsx(l,{variant:"h5",children:"Edit Public Information"})}),e.jsx(o,{item:!0,xs:12,children:e.jsxs(r,{spacing:2,children:[e.jsx(t,{id:"title",name:"title",label:"Title",defaultValue:y}),e.jsx(t,{id:"description",name:"description",label:"Description",defaultValue:_}),e.jsx(t,{id:"email",name:"email",label:"email",defaultValue:N}),e.jsx(t,{id:"phone_number",name:"phone_number",label:"phone_number",defaultValue:k})]})}),e.jsx(o,{item:!0,xs:12,lg:6,children:e.jsxs(r,{spacing:2,children:[e.jsx(l,{variant:"h6",children:"Company Address"}),e.jsx(i,{}),e.jsx(p.AddressFields,{componentName:"address",componentReference:"common.address",data:E})]})}),e.jsx(o,{item:!0,xs:12,lg:6,children:e.jsxs(r,{spacing:2,children:[e.jsx(l,{variant:"h6",children:"Business Credentials"}),e.jsx(i,{}),e.jsx(u.BusinessCredentialsFields,{componentName:"business_credentials",componentReference:"business.credentials",data:B})]})}),e.jsx(o,{item:!0,xs:12,sx:{mt:1},children:e.jsx(l,{variant:"h6",children:"Socials"})}),z.map((i,s)=>i.data?.id?V.includes(i.data?.id)?e.jsx(o,{item:!0,xs:12,md:6,lg:4,children:e.jsx(h.SocialsFields,{data:i.data,componentName:`socials[${s}]`,componentReference:"common.social",deleteCallback:()=>{G(z.filter((e,i)=>i!==s))}})},i.data.id):e.jsxs(o,{item:!0,xs:12,md:6,lg:4,children:[e.jsx("input",{type:"hidden",name:`socials[${s}].id`,value:i.data.id}),e.jsx("input",{type:"hidden",name:`socials[${s}].__component`,value:"logistics-elements.social"}),e.jsx(h.default,{data:{...i.data,onClick:w}})]},i.data.id):null),M.map((i,s)=>e.jsx(o,{item:!0,xs:12,md:6,lg:4,children:e.jsx(h.SocialsFields,{data:i.data,componentName:i.componentName,componentReference:"common.social",deleteCallback:()=>{W(M.filter((e,i)=>i!==s).map((e,i)=>({...e,componentName:`socials[${i+z.length}]`})))}})},i.data?.uuid)),e.jsx(o,{item:!0,xs:12,md:6,lg:4,justifyContent:"center",alignItems:"center",children:e.jsx(g,{onClick:()=>{W([...M,{componentName:`socials[${z.length+M.length}]`,componentReference:"logistics-elements.social",data:{uuid:Math.random(),name:"",url:""}}])},children:e.jsx(f,{})})}),e.jsx(o,{item:!0,xs:12,children:e.jsxs(r,{direction:"row-reverse",spacing:2,alignItems:"center",sx:{py:1},children:[e.jsx(c.SubmitButton,{text:"save changes",loadingText:"loading"}),P?.strapiErrors&&e.jsx(d.StrapiErrors,{error:P?.strapiErrors}),P?.message&&e.jsx(n,{severity:"error",children:P?.message})]})})]})})})};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- "use strict";var t=require("react/jsx-runtime"),e=require("react"),i=require("../../../components/common/cookie-consent/CookieConsentContext.js"),a=require("../../../lib/getCookie.js"),o=require("../../../lib/setCookie.js");const s={items:[],totalExVAT:0,totalVAT:0,totalInclVAT:0,totalAmount:0},n=e.createContext({state:s,dispatch:()=>{}}),r=(t,e)=>{switch(e.type){case"ADD_ITEM":{const i=t.items.findIndex(t=>t.id===e.payload.id);if(i>-1){const a=t.items.map((t,a)=>a===i?{...t,quantity:t.quantity+e.payload.quantity}:t);return{...t,items:a}}return{...t,items:[...t.items,e.payload]}}case"REMOVE_ITEM":{const i=t.items.findIndex(t=>t.id===e.payload.id);if(i>-1){const e=t.items.map((t,e)=>e===i?{...t,quantity:t.quantity-1}:t).filter(t=>t.quantity>0);return{...t,items:e}}return t}case"SET_ITEMS":return{...t,items:e.payload};case"UPDATE_TOTALS":return{...t,...e.payload};default:return t}};exports.CartProvider=({children:c})=>{const[u,l]=e.useReducer(r,s),{consentGiven:d}=i.useCookieConsent();return e.useEffect(()=>{if(d){const t=a.getCookie("cart");t&&l({type:"SET_ITEMS",payload:JSON.parse(t)})}},[d]),e.useEffect(()=>{d&&o.setCookie("cart",JSON.stringify(u.items),365)},[u.items,d]),e.useEffect(()=>{(()=>{let t=0,e=0,i=0,a=0;u.items.forEach(o=>{t+=o.price_excl_vat*o.quantity,e+=o.price_excl_vat*(o.vat_rate/100)*o.quantity,i+=o.price_incl_vat*o.quantity,a+=o.quantity}),l({type:"UPDATE_TOTALS",payload:{totalExVAT:t,totalVAT:e,totalInclVAT:i,totalAmount:a}})})()},[u.items]),t.jsx(n.Provider,{value:{state:u,dispatch:l},children:c})},exports.useCart=()=>e.useContext(n);
7
+ "use strict";var t=require("react/jsx-runtime"),e=require("react"),a=require("../../../components/common/cookie-consent/CookieConsentContext.js"),i=require("../../../lib/getCookie.js"),o=require("../../../lib/setCookie.js");const n={items:[],totalExVAT:0,totalVAT:0,totalInclVAT:0,totalAmount:0},s=e.createContext({state:n,dispatch:()=>{}}),r=(t,e)=>{switch(e.type){case"ADD_ITEM":{const a=t.items.findIndex(t=>t.documentId===e.payload.documentId);if(a>-1){const i=t.items.map((t,i)=>i===a?{...t,quantity:t.quantity+e.payload.quantity}:t);return{...t,items:i}}return{...t,items:[...t.items,e.payload]}}case"REMOVE_ITEM":{const a=t.items.findIndex(t=>t.documentId===e.payload.documentId);if(a>-1){const e=t.items.map((t,e)=>e===a?{...t,quantity:t.quantity-1}:t).filter(t=>t.quantity>0);return{...t,items:e}}return t}case"SET_ITEMS":return{...t,items:e.payload};case"UPDATE_TOTALS":return{...t,...e.payload};default:return t}};exports.CartProvider=({children:c})=>{const[u,l]=e.useReducer(r,n),{consentGiven:d}=a.useCookieConsent();return e.useEffect(()=>{if(d){const t=i.getCookie("cart");t&&l({type:"SET_ITEMS",payload:JSON.parse(t)})}},[d]),e.useEffect(()=>{d&&o.setCookie("cart",JSON.stringify(u.items),365)},[u.items,d]),e.useEffect(()=>{(()=>{let t=0,e=0,a=0,i=0;u.items.forEach(o=>{t+=o.price_excl_vat*o.quantity,e+=o.price_excl_vat*(o.vat_rate/100)*o.quantity,a+=o.price_incl_vat*o.quantity,i+=o.quantity}),l({type:"UPDATE_TOTALS",payload:{totalExVAT:t,totalVAT:e,totalInclVAT:a,totalAmount:i}})})()},[u.items]),t.jsx(s.Provider,{value:{state:u,dispatch:l},children:c})},exports.useCart=()=>e.useContext(s);
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- "use strict";var r=require("../../../services/mutate-data.js"),e=require("../../../../lib/utils.js"),t=require("../../../../lib/parseFormData.js");exports.updateCategoryAction=async function(a,s){const i=Object.fromEntries(s),o=t.parseFormData(s);o.data.products&&(o.data.products=JSON.parse(o.data.products));const u=await r.mutateData("PUT",`/api/product-categories/${i.id}`,o);if(!u)return{...a,severity:"error",strapiErrors:null,message:"Ops! Something went wrong. Please try again."};if(u.error)return{...a,severity:"error",strapiErrors:u.error,message:"Failed to Update Category."};const c=e.flattenAttributes(u);return{...a,severity:"success",message:"Category Updated Successfully",data:c,strapiErrors:null}};
7
+ "use strict";var r=require("../../../services/mutate-data.js"),e=require("../../../../lib/utils.js"),t=require("../../../../lib/parseFormData.js");exports.updateCategoryAction=async function(a,s,o){Object.fromEntries(o);const i=t.parseFormData(o);i.data.products&&(i.data.products=JSON.parse(i.data.products));const u=await r.mutateData("PUT",`/api/product-categories/${a}`,i);if(!u)return{...s,severity:"error",strapiErrors:null,message:"Ops! Something went wrong. Please try again."};if(u.error)return{...s,severity:"error",strapiErrors:u.error,message:"Failed to Update Category."};const c=e.flattenAttributes(u);return{...s,severity:"success",message:"Category Updated Successfully",data:c,strapiErrors:null}};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- "use strict";var r=require("../../../services/mutate-data.js"),t=require("../../../../lib/utils.js"),e=require("../../../../lib/parseFormData.js");exports.updateProductAction=async function(a,s){const o=Object.fromEntries(s),i=e.parseFormData(s);i.data.categories&&(i.data.categories=JSON.parse(i.data.categories)),i.data.gallery&&(i.data.gallery=JSON.parse(i.data.gallery)),i.data.stock_reports&&(i.data.stock_reports=JSON.parse(i.data.stock_reports));const c=await r.mutateData("PUT",`/api/products/${o.id}`,i);if(!c)return{...a,severity:"error",strapiErrors:null,message:"Ops! Something went wrong. Please try again."};if(c.error)return{...a,severity:"error",strapiErrors:c.error,message:"Failed to Update Product."};const u=t.flattenAttributes(c);return{...a,severity:"success",message:"Product Updated Successfully",data:u,strapiErrors:null}};
7
+ "use strict";var r=require("../../../services/mutate-data.js"),a=require("../../../../lib/parseFormData.js");exports.updateProductAction=async function(e,t,s){Object.fromEntries(s);const o=a.parseFormData(s);o.data.categories&&(o.data.categories=JSON.parse(o.data.categories)),o.data.gallery&&(o.data.gallery=JSON.parse(o.data.gallery)),o.data.stock_reports&&(o.data.stock_reports=JSON.parse(o.data.stock_reports));const c=await r.mutateData("PUT",`/api/products/${e}`,o);return c?c.error?{...t,severity:"error",strapiErrors:c.error,message:"Failed to Update Product."}:{...t,severity:"success",message:"Product Updated Successfully",data:c,strapiErrors:null}:{...t,severity:"error",strapiErrors:null,message:"Ops! Something went wrong. Please try again."}};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- "use strict";var r=require("../../../services/mutate-data.js"),e=require("../../../../lib/utils.js"),t=require("../../../../lib/parseFormData.js");exports.updateVendorAction=async function(a,s){try{const o=Object.fromEntries(s),n=t.parseFormData(s);n.data.products&&(n.data.products=JSON.parse(n.data.products));const u=await r.mutateData("PUT",`/api/vendor-profiles/${o.id}`,n);if(!u)return{...a,data:null,strapiErrors:null,zodErrors:null,message:"Something went wrong while updating the vendor. Please try again.",severity:"error"};if(u.error)return{...a,data:null,strapiErrors:u.error,zodErrors:null,message:"Failed to update vendor. Please check the form and try again.",severity:"error"};const i=e.flattenAttributes(u);return{...a,data:i,strapiErrors:null,zodErrors:null,message:"Vendor updated successfully!",severity:"success"}}catch(r){return console.error("Error updating vendor:",r),{...a,data:null,strapiErrors:null,zodErrors:null,message:"An unexpected error occurred. Please try again later.",severity:"error"}}};
7
+ "use strict";var r=require("../../../services/mutate-data.js"),e=require("../../../../lib/utils.js"),t=require("../../../../lib/parseFormData.js");exports.updateVendorAction=async function(a,s,o){try{Object.fromEntries(o);const n=t.parseFormData(o);n.data.products&&(n.data.products=JSON.parse(n.data.products));const u=await r.mutateData("PUT",`/api/vendor-profiles/${a}`,n);if(!u)return{...s,data:null,strapiErrors:null,zodErrors:null,message:"Something went wrong while updating the vendor. Please try again.",severity:"error"};if(u.error)return{...s,data:null,strapiErrors:u.error,zodErrors:null,message:"Failed to update vendor. Please check the form and try again.",severity:"error"};const l=e.flattenAttributes(u);return{...s,data:l,strapiErrors:null,zodErrors:null,message:"Vendor updated successfully!",severity:"success"}}catch(r){return console.error("Error updating vendor:",r),{...s,data:null,strapiErrors:null,zodErrors:null,message:"An unexpected error occurred. Please try again later.",severity:"error"}}};
@@ -3,4 +3,4 @@
3
3
  * @copyright Jelle Paulus
4
4
  * @license MIT
5
5
  */
6
- "use strict";var e=require("zod"),r=require("../../services/mutate-data.js"),s=require("../../../lib/utils.js"),a=require("../../../lib/parseFormData.js");const t=e.z.object({files:e.z.any()});exports.uploadBase64MediaAction=async function(e,n,l,i,o){const u=Object.fromEntries(o);a.parseFormData(o);const d=t.safeParse({files:u.files});if(!d.success)return{...i,zodErrors:d.error.flatten().fieldErrors,strapiErrors:null,data:null,message:"Invalid Image"};const m=`${e}/${n}`,c=o.getAll("files");c.map(e=>e instanceof File?e.name:null).filter(e=>null!==e);const p=await Promise.all(c.map(async e=>{if(e instanceof File){const r=e.name.split(".").pop(),s=e.type,a=new FileReader;return a.readAsDataURL(e),new Promise(t=>{a.onloadend=()=>{const n=a.result?.toString().split(",")[1]||"";t({name:e.name,ext:r,mime:s,base64_string:n})}})}return null})),f={data:{id:n,[l]:p[0]}},g=await r.mutateData("PUT",m,f);if(!g)return{...i,strapiErrors:null,zodErrors:null,message:"Ops! Something went wrong. Please try again."};if(g.error)return{...i,strapiErrors:g.error,zodErrors:null,message:"Failed to Upload File."};const E=s.flattenAttributes(g);return{...i,data:E,zodErrors:null,strapiErrors:null,message:"File Uploaded"}};
6
+ "use strict";var e=require("zod"),r=require("../../services/mutate-data.js"),s=require("../../../lib/utils.js"),t=require("../../../lib/parseFormData.js");const a=e.z.object({files:e.z.any()});exports.uploadBase64MediaAction=async function(e,n,l,i,o){const u=Object.fromEntries(o);t.parseFormData(o);const d=a.safeParse({files:u.files});if(!d.success)return{...i,zodErrors:d.error.flatten().fieldErrors,strapiErrors:null,data:null,message:"Invalid Image"};const m=`${e}/${n}`,c=o.getAll("files");c.map(e=>e instanceof File?e.name:null).filter(e=>null!==e);const p=await Promise.all(c.map(async e=>{if(e instanceof File){const r=e.name.split(".").pop(),s=e.type,t=new FileReader;return t.readAsDataURL(e),new Promise(a=>{t.onloadend=()=>{const n=t.result?.toString().split(",")[1]||"";a({name:e.name,ext:r,mime:s,base64_string:n})}})}return null})),f={data:{documentId:n,[l]:p[0]}},g=await r.mutateData("PUT",m,f);if(!g)return{...i,strapiErrors:null,zodErrors:null,message:"Ops! Something went wrong. Please try again."};if(g.error)return{...i,strapiErrors:g.error,zodErrors:null,message:"Failed to Upload File."};const E=s.flattenAttributes(g);return{...i,data:E,zodErrors:null,strapiErrors:null,message:"File Uploaded"}};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- "use strict";var e=require("zod"),t=require("../../lib/utils.js"),a=require("../services/mutate-data.js");const s=e.z.object({id:e.z.string(),title:e.z.string().min(3).max(100,{message:"Title must be between 3 and 100 characters"}),description:e.z.string().min(3).max(200,{message:"Description must be between 3 and 200 characters"}),blocks:e.z.array(e.z.object({id:e.z.string(),__component:e.z.string(),heading:e.z.string().min(3).max(100,{message:"Heading must be between 3 and 100 characters"}).optional(),subHeading:e.z.string().min(3).max(200,{message:"Subheading must be between 3 and 200 characters"}).optional(),title:e.z.string().min(3).max(100,{message:"Title must be between 3 and 100 characters"}).optional(),subtitle:e.z.string().min(3).max(200,{message:"Subtitle must be between 3 and 200 characters"}).optional(),link:e.z.object({text:e.z.string({message:"Link text must be between 3 and 100 characters"}).optional(),url:e.z.string({message:"Please enter a valid URL"}).optional()}).optional(),feature:e.z.object({heading:e.z.string().min(3).max(100,{message:"Heading must be between 3 and 100 characters"}).optional(),subHeading:e.z.string().min(3).max(200,{message:"Subheading must be between 3 and 200 characters"}).optional(),text:e.z.string().min(3).max(200,{message:"Text must be between 3 and 200 characters"}).optional()}).optional()})).optional()});exports.updatePageAction=async function(e,r){const n=t.formDataToBlocks(r),i=s.safeParse({id:r.get("id"),title:r.get("title"),description:r.get("description"),blocks:n});if(!i.success)return{...e,zodErrors:i.error.flatten().fieldErrors,strapiErrors:null,message:"Missing Fields. Failed to Update Page."};const{data:o}=i,g=await a.mutateData("PUT",`/api/pages/${o.id}`,{data:o});return g?g.error?{...e,strapiErrors:g.error,zodErrors:null,message:"Failed to Update Page."}:{...e,strapiErrors:null,zodErrors:null,message:"Page Updated Successfully."}:{...e,strapiErrors:null,zodErrors:null,message:"Ops! Something went wrong. Please try again."}};
7
+ "use strict";var e=require("zod"),t=require("../../lib/utils.js"),a=require("../services/mutate-data.js");const s=e.z.object({documentId:e.z.string(),title:e.z.string().min(3).max(100,{message:"Title must be between 3 and 100 characters"}),description:e.z.string().min(3).max(200,{message:"Description must be between 3 and 200 characters"}),blocks:e.z.array(e.z.object({id:e.z.string(),__component:e.z.string(),heading:e.z.string().min(3).max(100,{message:"Heading must be between 3 and 100 characters"}).optional(),subHeading:e.z.string().min(3).max(200,{message:"Subheading must be between 3 and 200 characters"}).optional(),title:e.z.string().min(3).max(100,{message:"Title must be between 3 and 100 characters"}).optional(),subtitle:e.z.string().min(3).max(200,{message:"Subtitle must be between 3 and 200 characters"}).optional(),link:e.z.object({text:e.z.string({message:"Link text must be between 3 and 100 characters"}).optional(),url:e.z.string({message:"Please enter a valid URL"}).optional()}).optional(),feature:e.z.object({heading:e.z.string().min(3).max(100,{message:"Heading must be between 3 and 100 characters"}).optional(),subHeading:e.z.string().min(3).max(200,{message:"Subheading must be between 3 and 200 characters"}).optional(),text:e.z.string().min(3).max(200,{message:"Text must be between 3 and 200 characters"}).optional()}).optional()})).optional()});exports.updatePageAction=async function(e,r){const n=t.formDataToBlocks(r),i=s.safeParse({documentId:r.get("documentId"),title:r.get("title"),description:r.get("description"),blocks:n});if(!i.success)return{...e,zodErrors:i.error.flatten().fieldErrors,strapiErrors:null,message:"Missing Fields. Failed to Update Page."};const{data:o}=i,m=await a.mutateData("PUT",`/api/pages/${o.documentId}`,{data:o});return m?m.error?{...e,strapiErrors:m.error,zodErrors:null,message:"Failed to Update Page."}:{...e,strapiErrors:null,zodErrors:null,message:"Page Updated Successfully."}:{...e,strapiErrors:null,zodErrors:null,message:"Ops! Something went wrong. Please try again."}};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- "use strict";var r=require("../services/mutate-data.js"),e=require("../../lib/utils.js"),t=require("../../lib/parseFormData.js");exports.updateCustomerProfileAction=async function(a,s){const i=Object.fromEntries(s),o=t.parseFormData(s);void 0===o.data.delivery_address&&(o.data.delivery_address=null),void 0===o.data.billing_address&&(o.data.billing_address=null);const d=i.id,l=await r.mutateData("PUT",`/api/customer-profiles/${d}`,o);if(!l)return{...a,strapiErrors:null,message:"Ops! Something went wrong. Please try again."};if(l.error)return{...a,strapiErrors:l.error,message:"Failed to Register."};const n=e.flattenAttributes(l);return{...a,message:"Profile Updated",data:n,strapiErrors:null}};
7
+ "use strict";var r=require("../services/mutate-data.js"),e=require("../../lib/utils.js"),t=require("../../lib/parseFormData.js");exports.updateCustomerProfileAction=async function(a,s,i){const o=Object.fromEntries(i),d=t.parseFormData(i);void 0===d.data.delivery_address&&(d.data.delivery_address=null),void 0===d.data.billing_address&&(d.data.billing_address=null),o.id;const l=await r.mutateData("PUT",`/api/customer-profiles/${a}`,d);if(!l)return{...s,strapiErrors:null,message:"Ops! Something went wrong. Please try again."};if(l.error)return{...s,strapiErrors:l.error,message:"Failed to Register."};const n=e.flattenAttributes(l);return{...s,message:"Profile Updated",data:n,strapiErrors:null}};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- "use strict";var r=require("../../services/mutate-data.js"),t=require("../../../lib/utils.js"),a=require("../../../lib/parseFormData.js");exports.updatePublicInformationAction=async function(e,s){const o=Object.fromEntries(s);console.log("rawFormData",o);const i=a.parseFormData(s);console.log("parsedFormData",i),o.id;const n=await r.mutateData("PUT","/api/public-information",i);if(!n)return{...e,strapiErrors:null,message:"Ops! Something went wrong. Please try again."};if(n.error)return{...e,strapiErrors:n.error,message:"Failed to Register."};const u=t.flattenAttributes(n);return{...e,message:"Public Information Updated",data:u,strapiErrors:null}};
7
+ "use strict";var r=require("../../services/mutate-data.js"),t=require("../../../lib/utils.js"),a=require("../../../lib/parseFormData.js");exports.updatePublicInformationAction=async function(e,s,o){const i=Object.fromEntries(o);console.log("rawFormData",i);const n=a.parseFormData(o);console.log("parsedFormData",n);const u=await r.mutateData("PUT",`/api/public-information/${e}`,n);if(!u)return{...s,strapiErrors:null,message:"Ops! Something went wrong. Please try again."};if(u.error)return{...s,strapiErrors:u.error,message:"Failed to Register."};const l=t.flattenAttributes(u);return{...s,message:"Public Information Updated",data:l,strapiErrors:null}};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- "use strict";var e=require("../../../../node_modules/qs/lib/index.js"),r=require("../loaders.js"),s=require("../../../lib/utils.js"),t=require("next/cache");const i=s.getStrapiURL();exports.getSingleCustomer=async function(s){t.unstable_noStore();const a=new URL(`/api/customer-profiles/${s}`,i);return a.search=e.default.stringify({populate:{company_address:"*",delivery_address:"*",billing_address:"*",business_credentials:"*",orders:"*",returns:"*"}}),await r.fetchData(a.href)};
7
+ "use strict";var e=require("../../../../node_modules/qs/lib/index.js"),r=require("../loaders.js"),s=require("../../../lib/utils.js"),t=require("next/cache");const n=s.getStrapiURL();exports.getSingleCustomer=async function(s){t.unstable_noStore();const a=new URL(`/api/customer-profiles/${s}`,n);return a.search=e.default.stringify({populate:{company_address:!0,delivery_address:!0,billing_address:!0,business_credentials:!0,orders:{fields:["opo_number","order_date","internal_status","total_incl_vat"]},returns:{fields:["return_number","return_date","internal_status"]}}}),await r.fetchData(a.href)};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- "use strict";var e=require("../../../../node_modules/qs/lib/index.js"),r=require("../loaders.js"),i=require("../../../lib/utils.js"),s=require("next/cache");const t=i.getStrapiURL();exports.getSingleProduct=async function(i){s.unstable_noStore();const a=new URL(`/api/slugify/slugs/product/${i}`,t);return a.search=e.default.stringify({filters:{is_archive:!1},populate:{price:!0,image:!0,gallery:!0,dimensions:!0,categories:!0,brand:!0,vendors:!0}}),await r.fetchData(a.href)};
7
+ "use strict";var e=require("../../../../node_modules/qs/lib/index.js"),r=require("../loaders.js"),i=require("../../../lib/utils.js"),t=require("next/cache");const s=i.getStrapiURL();exports.getSingleProduct=async function(i){t.unstable_noStore();const a=new URL(`/api/products/${i}`,s);return a.search=e.default.stringify({filters:{is_archive:!1},populate:{price:!0,image:!0,gallery:!0,dimensions:!0,categories:!0,brand:!0,vendors:!0}}),await r.fetchData(a.href)};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- "use strict";var e=require("../../../../node_modules/qs/lib/index.js"),i=require("../loaders.js");const s=require("../../../lib/utils.js").getStrapiURL();exports.getIpoNames=async function(){const r=new URL("/api/ipos",s);return r.search=e.default.stringify({fields:["id","ipo_number"],pagination:{pageSize:100,page:1}}),await i.fetchData(r.href)};
7
+ "use strict";var e=require("../../../../node_modules/qs/lib/index.js"),i=require("../loaders.js");const s=require("../../../lib/utils.js").getStrapiURL();exports.getIpoNames=async function(){const t=new URL("/api/ipos",s);return t.search=e.default.stringify({fields:["documentId","ipo_number"],pagination:{pageSize:100,page:1}}),await i.fetchData(t.href)};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- "use strict";var e=require("../../../../node_modules/qs/lib/index.js"),r=require("../loaders.js"),s=require("../../../lib/utils.js"),i=require("next/cache"),t=require("../../../lib/processFilters.js");const a=s.getStrapiURL();exports.getTableIpos=async function(s,n,o,l,u=[!1],p={}){i.unstable_noStore();const c=new URL("/api/ipos",a),d=t.processFilters(p);return c.search=e.default.stringify({filters:{is_archive:{$in:u},...d},sort:`${l||"id"}:${o||"desc"}`,populate:{vendor_profile:{fields:["vendor_number","website_url"],populate:{business_credentials:{fields:"company_name"}}},items:{populate:{product:{fields:["title","product_number","external_product_number"]},reports:!0}}},pagination:{pageSize:n||10,page:s?s+1:1}}),await r.fetchData(c.href)};
7
+ "use strict";var e=require("../../../../node_modules/qs/lib/index.js"),r=require("../loaders.js"),s=require("../../../lib/utils.js"),t=require("next/cache"),i=require("../../../lib/processFilters.js");const a=s.getStrapiURL();exports.getTableIpos=async function(s,n,o,l,u=[!1],p={}){t.unstable_noStore();const c=new URL("/api/ipos",a),d=i.processFilters(p);return c.search=e.default.stringify({filters:{is_archive:{$in:u},...d},sort:`${l||"createdAt"}:${o||"desc"}`,populate:{vendor_profile:{fields:["vendor_number","website_url"],populate:{business_credentials:{fields:"company_name"}}},items:{populate:{product:{fields:["title","product_number","external_product_number"]},reports:!0}}},pagination:{pageSize:n||10,page:s?s+1:1}}),await r.fetchData(c.href)};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- "use strict";var e=require("../../../../node_modules/qs/lib/index.js"),s=require("../loaders.js");const i=require("../../../lib/utils.js").getStrapiURL();exports.getVendorNames=async function(){const n=new URL("/api/vendor-profiles",i);return n.search=e.default.stringify({fields:["id","vendor_number"],populate:{business_credentials:{fields:["company_name","business_entity_name"]}},pagination:{pageSize:100,page:1}}),await s.fetchData(n.href)};
7
+ "use strict";var e=require("../../../../node_modules/qs/lib/index.js"),s=require("../loaders.js");const i=require("../../../lib/utils.js").getStrapiURL();exports.getVendorNames=async function(){const n=new URL("/api/vendor-profiles",i);return n.search=e.default.stringify({fields:["documentId","vendor_number"],populate:{business_credentials:{fields:["company_name","business_entity_name"]}},pagination:{pageSize:100,page:1}}),await s.fetchData(n.href)};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- "use strict";var e=require("../loaders.js"),r=require("../../../lib/utils.js"),t=require("next/cache");const s=r.getStrapiURL();exports.queryAllIpos=async function(r){t.unstable_noStore();const a=new URL("/api/ipos",s);return console.log("query",r),a.search=r,await e.fetchData(a.href)};
7
+ "use strict";var e=require("../loaders.js"),r=require("../../../lib/utils.js"),t=require("next/cache");const s=r.getStrapiURL();exports.queryAllIpos=async function(r){t.unstable_noStore();const a=new URL("/api/ipos",s);return a.search=r,await e.fetchData(a.href)};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- "use strict";var e=require("../loaders.js"),r=require("../../../lib/utils.js"),t=require("next/cache");const s=r.getStrapiURL();exports.queryAllVendors=async function(r){t.unstable_noStore();const n=new URL("/api/vendor-profiles",s);return console.log("query",r),n.search=r,await e.fetchData(n.href)};
7
+ "use strict";var e=require("../loaders.js"),r=require("../../../lib/utils.js"),t=require("next/cache");const s=r.getStrapiURL();exports.queryAllVendors=async function(r){t.unstable_noStore();const a=new URL("/api/vendor-profiles",s);return a.search=r,await e.fetchData(a.href)};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- "use strict";var e=require("../../../../node_modules/qs/lib/index.js"),t=require("../../../lib/utils.js"),n=require("next/cache");const o=t.getStrapiURL();exports.getSinglePage=async function(r){n.unstable_noStore(),console.log("getSinglePage",r),r||(r="home");const s=new URL(`/api/slugify/slugs/page/${r}`,o);s.search=e.default.stringify({populate:{blocks:{populate:"*"}}}),console.log(s.href);const a={method:"GET",headers:{"Content-Type":"application/json"}};try{const e=await fetch(s,a),n=await e.json();return t.flattenAttributes(n)}catch(e){return console.error("Error fetching data:",e),null}};
7
+ "use strict";var e=require("../../../../node_modules/qs/lib/index.js"),t=require("../../../lib/utils.js"),n=require("next/cache");const r=t.getStrapiURL();exports.getSinglePage=async function(o){n.unstable_noStore(),o||(o="home");const s=new URL(`/api/slugify/slugs/page/${o}`,r);s.search=e.default.stringify({populate:{blocks:{populate:"*"}}}),console.log(s.href);const a={method:"GET",headers:{"Content-Type":"application/json"}};try{const e=await fetch(s,a),n=await e.json();return t.flattenAttributes(n)}catch(e){return console.error("Error fetching data:",e),null}};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- "use strict";const e=require("../../node_modules/@mollie/api-client/dist/mollie.esm.js").createMollieClient({apiKey:`${process.env.MOLLIE_KEY}`});exports.createMolliePayment=async function(r){const{id:o,opo_number:t,total_incl_vat:i,order_currency:c,uuid:n}=r;return o&&t&&i&&c&&n?await e.payments.create({amount:{currency:c,value:i.toFixed(2)},description:`Order #${t}`,redirectUrl:`${process.env.FRONTEND_URL}/shop/check-out?order=${n}`,webhookUrl:`${process.env.FRONTEND_URL}/api/mollie`,metadata:{id:o,opo_number:t}}).catch(e=>`error from payment creation: ${e}`):"missing order data"};
7
+ "use strict";const e=require("../../node_modules/@mollie/api-client/dist/mollie.esm.js").createMollieClient({apiKey:`${process.env.MOLLIE_KEY}`});exports.createMolliePayment=async function(r){const{documentId:o,opo_number:t,total_incl_vat:c,order_currency:n,uuid:i}=r;return o&&t&&c&&n&&i?await e.payments.create({amount:{currency:n,value:c.toFixed(2)},description:`Order #${t}`,redirectUrl:`${process.env.FRONTEND_URL}/shop/check-out?order=${i}`,webhookUrl:`${process.env.FRONTEND_URL}/api/mollie`,metadata:{documentId:o,opo_number:t}}).catch(e=>`error from payment creation: ${e}`):"missing order data"};
@@ -3,4 +3,4 @@
3
3
  * @copyright Jelle Paulus
4
4
  * @license MIT
5
5
  */
6
- "use strict";exports.parseFormData=function(t){const e={};for(const[n,s]of t.entries()){if(!s)continue;const t=n.split("."),o=(t,e,n)=>{if(e[0].endsWith("]")&&e[0].includes("[")&&e.length>1){const s=e[0].split("[")[0],c=parseInt(e[0].split("[")[1].replace("]",""));t[s]||(t[s]=[]),t[s][c]||(t[s][c]={}),e.shift(),o(t[s][c],e,n)}else if(e.length>1){const s=e.shift();null!=s&&(t[s]||(t[s]=e[0].endsWith("]")?[]:{}),o(t[s],e,n))}else t[e[0]]=n};o(e,t,s)}const n=t=>{for(const e in t)"object"==typeof t[e]&&1===Object.keys(t[e]).length&&t[e].__component?delete t[e]:"object"==typeof t[e]&&n(t[e])};return n(e),{data:e}};
6
+ "use strict";exports.parseFormData=function(t){const e={};for(const[s,n]of t.entries()){if(!n)continue;const t=s.split(".");console.log("parts",t);const o=(t,e,s)=>{if(e[0].endsWith("]")&&e[0].includes("[")&&e.length>1){const n=e[0].split("[")[0],c=parseInt(e[0].split("[")[1].replace("]",""));t[n]||(t[n]=[]),t[n][c]||(t[n][c]={}),e.shift(),o(t[n][c],e,s)}else if(e.length>1){const n=e.shift();null!=n&&(t[n]||(t[n]=e[0].endsWith("]")?[]:{}),o(t[n],e,s))}else t[e[0]]=s};o(e,t,n)}const s=t=>{for(const e in t)"object"==typeof t[e]&&1===Object.keys(t[e]).length&&t[e].__component?delete t[e]:"object"==typeof t[e]&&s(t[e])};return s(e),{data:e}};