flowrix 1.0.1-beta.14 → 1.0.1-beta.141

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 (275) hide show
  1. package/dist/module.d.mts +1 -6
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +169 -30
  4. package/dist/runtime/composables/Blog/useBlogIndex.d.ts +2 -5
  5. package/dist/runtime/composables/Blog/useBlogSingle.js +2 -4
  6. package/dist/runtime/composables/Brand/brand.d.ts +1 -1
  7. package/dist/runtime/composables/Brand/brand.js +30 -2
  8. package/dist/runtime/composables/Cart/useCart.d.ts +40 -0
  9. package/dist/runtime/composables/Cart/useCart.js +10 -0
  10. package/dist/runtime/composables/Cart/useCartComponent.d.ts +1 -0
  11. package/dist/runtime/composables/Cart/useCartComponent.js +11 -0
  12. package/dist/runtime/composables/Cart/useCartDetail.d.ts +15 -5
  13. package/dist/runtime/composables/Cart/useCartDetail.js +3 -0
  14. package/dist/runtime/composables/Category/useCategoryIndex.d.ts +25 -32
  15. package/dist/runtime/composables/Category/useCategoryIndex.js +63 -44
  16. package/dist/runtime/composables/Checkout/PaymentMethods/useDirectDeposit.js +8 -0
  17. package/dist/runtime/composables/Checkout/PaymentMethods/useEway.js +16 -6
  18. package/dist/runtime/composables/Checkout/PaymentMethods/useFlowrixpay.d.ts +40 -1
  19. package/dist/runtime/composables/Checkout/PaymentMethods/useFlowrixpay.js +10 -2
  20. package/dist/runtime/composables/Checkout/PaymentMethods/useOpayo.d.ts +40 -1
  21. package/dist/runtime/composables/Checkout/PaymentMethods/useOpayo.js +10 -2
  22. package/dist/runtime/composables/Checkout/PaymentMethods/usePaymentMethods.js +3 -14
  23. package/dist/runtime/composables/Checkout/PaymentMethods/usePaypal.js +8 -0
  24. package/dist/runtime/composables/Checkout/PaymentMethods/useStripe.d.ts +2 -2
  25. package/dist/runtime/composables/Checkout/PaymentMethods/useStripe.js +8 -0
  26. package/dist/runtime/composables/Checkout/PaymentMethods/useZippay.js +8 -0
  27. package/dist/runtime/composables/Checkout/useCheckout.d.ts +85 -73
  28. package/dist/runtime/composables/Checkout/useCheckout.js +84 -53
  29. package/dist/runtime/composables/Checkout/useCheckoutBillingAddress.d.ts +43 -0
  30. package/dist/runtime/composables/Checkout/useCheckoutBillingAddress.js +84 -0
  31. package/dist/runtime/composables/Checkout/useCheckoutShippingAddress.d.ts +55 -0
  32. package/dist/runtime/composables/Checkout/useCheckoutShippingAddress.js +196 -0
  33. package/dist/runtime/composables/Checkout/useCreateAccount.d.ts +7 -7
  34. package/dist/runtime/composables/Checkout/useCreateAccount.js +3 -1
  35. package/dist/runtime/composables/Checkout/useDeliveryMethod.d.ts +2 -2
  36. package/dist/runtime/composables/Checkout/useDeliveryMethod.js +18 -11
  37. package/dist/runtime/composables/Customer/useBillingAddress.d.ts +112 -0
  38. package/dist/runtime/composables/Customer/useBillingAddress.js +93 -0
  39. package/dist/runtime/composables/Customer/useLogin.d.ts +9 -0
  40. package/dist/runtime/composables/Customer/useLogin.js +34 -0
  41. package/dist/runtime/composables/Customer/useOrders.d.ts +29 -0
  42. package/dist/runtime/composables/Customer/useOrders.js +56 -0
  43. package/dist/runtime/composables/Customer/usePasswordReset.d.ts +26 -0
  44. package/dist/runtime/composables/Customer/usePasswordReset.js +258 -0
  45. package/dist/runtime/composables/Customer/useProfile.d.ts +75 -0
  46. package/dist/runtime/composables/Customer/useProfile.js +106 -0
  47. package/dist/runtime/composables/Customer/useQuotations.d.ts +32 -0
  48. package/dist/runtime/composables/Customer/useQuotations.js +40 -0
  49. package/dist/runtime/composables/Customer/useRegister.d.ts +121 -13
  50. package/dist/runtime/composables/Customer/useRegister.js +310 -35
  51. package/dist/runtime/composables/Customer/useShippingAddress.d.ts +121 -0
  52. package/dist/runtime/composables/Customer/useShippingAddress.js +145 -0
  53. package/dist/runtime/composables/Customer/useUpdatePassword.d.ts +21 -0
  54. package/dist/runtime/composables/Customer/useUpdatePassword.js +130 -0
  55. package/dist/runtime/composables/Customer/useUserCards.d.ts +22 -0
  56. package/dist/runtime/composables/Customer/useUserCards.js +65 -0
  57. package/dist/runtime/composables/{useWishlists.d.ts → Customer/useWishlists.d.ts} +7 -20
  58. package/dist/runtime/composables/{useWishlists.js → Customer/useWishlists.js} +21 -30
  59. package/dist/runtime/composables/Extras/useCountry.d.ts +11 -6
  60. package/dist/runtime/composables/Extras/useCountry.js +5 -4
  61. package/dist/runtime/composables/Footer/useFooter.d.ts +4 -4
  62. package/dist/runtime/composables/Footer/useFooter.js +12 -8
  63. package/dist/runtime/composables/Header/useHeader.d.ts +6 -20
  64. package/dist/runtime/composables/Header/useHeader.js +3 -2
  65. package/dist/runtime/composables/Product/CustomProduct/useCustomeScript.js +4 -5
  66. package/dist/runtime/composables/Product/CustomProduct/useSteps.d.ts +1 -1
  67. package/dist/runtime/composables/Product/useProductComponent.js +110 -0
  68. package/dist/runtime/composables/Product/useProductSlug.d.ts +8 -1
  69. package/dist/runtime/composables/Product/useQuickView.d.ts +8 -0
  70. package/dist/runtime/composables/Product/useQuickView.js +27 -0
  71. package/dist/runtime/composables/Product/useService.d.ts +42 -15
  72. package/dist/runtime/composables/Product/useService.js +137 -48
  73. package/dist/runtime/composables/Samples/useSamples.d.ts +5 -6
  74. package/dist/runtime/composables/Samples/useSamples.js +19 -15
  75. package/dist/runtime/composables/SideBar/Filters/useFilters.d.ts +2 -2
  76. package/dist/runtime/composables/SideBar/Filters/useSorting.d.ts +2 -2
  77. package/dist/runtime/composables/index.d.ts +18 -12
  78. package/dist/runtime/composables/index.js +18 -12
  79. package/dist/runtime/composables/useAddresses.js +6 -6
  80. package/dist/runtime/composables/useApp.d.ts +1 -0
  81. package/dist/runtime/composables/useApp.js +88 -0
  82. package/dist/runtime/composables/useCards.js +2 -2
  83. package/dist/runtime/composables/useDataLayer.js +1 -1
  84. package/dist/runtime/composables/useDotDigital.d.ts +3 -0
  85. package/dist/runtime/composables/useDotDigital.js +122 -0
  86. package/dist/runtime/composables/useLocation.d.ts +61 -19
  87. package/dist/runtime/composables/useLocation.js +353 -25
  88. package/dist/runtime/composables/useMetaLayer.js +11 -11
  89. package/dist/runtime/composables/useQuotationCheckout.d.ts +78 -0
  90. package/dist/runtime/composables/useQuotationCheckout.js +137 -0
  91. package/dist/runtime/composables/useSubscriptions.d.ts +17 -10
  92. package/dist/runtime/composables/useSubscriptions.js +68 -33
  93. package/dist/runtime/composables/useTikTokDatalayer.js +7 -7
  94. package/dist/runtime/composables/useWebforms.d.ts +38 -9
  95. package/dist/runtime/composables/useWebforms.js +93 -60
  96. package/dist/runtime/middleware/flowrix.d.ts +5 -4
  97. package/dist/runtime/middleware/flowrix.js +40 -22
  98. package/dist/runtime/pages/404.d.vue.ts +3 -0
  99. package/dist/runtime/pages/404.vue +6 -0
  100. package/dist/runtime/pages/404.vue.d.ts +3 -0
  101. package/dist/runtime/pages/flowrix-default.d.vue.ts +3 -0
  102. package/dist/runtime/pages/flowrix-default.vue +42 -0
  103. package/dist/runtime/pages/flowrix-default.vue.d.ts +3 -0
  104. package/dist/runtime/plugin.d.ts +1 -1
  105. package/dist/runtime/plugins/router.d.ts +2 -0
  106. package/dist/runtime/plugins/router.js +11 -0
  107. package/dist/runtime/server/api/albums.d.ts +1 -0
  108. package/dist/runtime/server/api/albums.js +35 -7
  109. package/dist/runtime/server/api/auth/forgot.js +1 -2
  110. package/dist/runtime/server/api/auth/login.d.ts +7 -0
  111. package/dist/runtime/server/api/auth/login.js +4 -16
  112. package/dist/runtime/server/api/auth/logout.js +1 -2
  113. package/dist/runtime/server/api/auth/register.js +1 -2
  114. package/dist/runtime/server/api/auth/session.get.js +1 -3
  115. package/dist/runtime/server/api/auth/user/reset-password.js +1 -2
  116. package/dist/runtime/server/api/auth/user/session.js +1 -2
  117. package/dist/runtime/server/api/auth/user/verify-token.js +1 -2
  118. package/dist/runtime/server/api/banners.js +20 -15
  119. package/dist/runtime/server/api/brand/[...slug].js +55 -0
  120. package/dist/runtime/server/api/brand/index.d.ts +3 -0
  121. package/dist/runtime/server/api/brand/index.js +46 -0
  122. package/dist/runtime/server/api/cache/[...slug].delete.d.ts +4 -1
  123. package/dist/runtime/server/api/cache/[...slug].delete.js +4 -7
  124. package/dist/runtime/server/api/cache/clean.get.d.ts +5 -0
  125. package/dist/runtime/server/api/cache/clean.get.js +4 -7
  126. package/dist/runtime/server/api/cart/[slug]/add.d.ts +1 -1
  127. package/dist/runtime/server/api/cart/[slug]/add.js +11 -11
  128. package/dist/runtime/server/api/cart/[slug]/update.d.ts +1 -1
  129. package/dist/runtime/server/api/cart/[slug]/update.js +11 -11
  130. package/dist/runtime/server/api/{v2/[...slug].d.ts → cart/related.d.ts} +0 -1
  131. package/dist/runtime/server/api/cart/related.js +21 -0
  132. package/dist/runtime/server/api/cart/remove.d.ts +1 -1
  133. package/dist/runtime/server/api/cart/remove.js +10 -10
  134. package/dist/runtime/server/api/cart/service/[slug]/add.d.ts +1 -1
  135. package/dist/runtime/server/api/cart/service/[slug]/add.js +12 -12
  136. package/dist/runtime/server/api/catalog/brands.d.ts +3 -0
  137. package/dist/runtime/server/api/catalog/brands.js +52 -0
  138. package/dist/runtime/server/api/catalog/categories.js +28 -19
  139. package/dist/runtime/server/api/catalog/categoriesall.d.ts +3 -0
  140. package/dist/runtime/server/api/catalog/categoriesall.js +52 -0
  141. package/dist/runtime/server/api/catalog/featured.js +28 -17
  142. package/dist/runtime/server/api/catalog/posts.d.ts +3 -0
  143. package/dist/runtime/server/api/catalog/posts.js +52 -0
  144. package/dist/runtime/server/api/catalog/samples.js +28 -19
  145. package/dist/runtime/server/api/catalog/search.js +28 -19
  146. package/dist/runtime/server/api/category/[...slug].js +31 -20
  147. package/dist/runtime/server/api/check-404.d.ts +4 -0
  148. package/dist/runtime/server/api/check-404.js +8 -0
  149. package/dist/runtime/server/api/checkout/applyCoupon.d.ts +1 -1
  150. package/dist/runtime/server/api/checkout/applyCoupon.js +13 -13
  151. package/dist/runtime/server/api/checkout/configs.d.ts +1 -1
  152. package/dist/runtime/server/api/checkout/configs.js +11 -11
  153. package/dist/runtime/server/api/checkout/countries.d.ts +1 -1
  154. package/dist/runtime/server/api/checkout/countries.js +5 -9
  155. package/dist/runtime/server/api/checkout/paymentmethod.d.ts +1 -1
  156. package/dist/runtime/server/api/checkout/paymentmethod.js +16 -11
  157. package/dist/runtime/server/api/{blog/blog.d.ts → checkout/quotation/[slug].d.ts} +0 -1
  158. package/dist/runtime/server/api/checkout/quotation/[slug].js +20 -0
  159. package/dist/runtime/server/api/checkout/quotation/guest/[slug].d.ts +2 -0
  160. package/dist/runtime/server/api/checkout/quotation/guest/[slug].js +35 -0
  161. package/dist/runtime/server/api/checkout/quotation/guest/customer.d.ts +2 -0
  162. package/dist/runtime/server/api/checkout/quotation/guest/customer.js +20 -0
  163. package/dist/runtime/server/api/checkout/quotation/submit/[slug].d.ts +2 -0
  164. package/dist/runtime/server/api/checkout/quotation/submit/[slug].js +22 -0
  165. package/dist/runtime/server/api/checkvariables.d.ts +3 -0
  166. package/dist/runtime/server/api/checkvariables.js +37 -0
  167. package/dist/runtime/server/api/cmspost/[...slug].js +54 -0
  168. package/dist/runtime/server/api/cmspost/all.d.ts +3 -0
  169. package/dist/runtime/server/api/cmspost/all.js +52 -0
  170. package/dist/runtime/server/api/company/profile.d.ts +1 -1
  171. package/dist/runtime/server/api/company/profile.js +12 -7
  172. package/dist/runtime/server/api/contact-center/webforms/[id]/details.d.ts +1 -1
  173. package/dist/runtime/server/api/contact-center/webforms/[id]/details.js +50 -15
  174. package/dist/runtime/server/api/contact-center/webforms/create.d.ts +1 -1
  175. package/dist/runtime/server/api/contact-center/webforms/create.js +13 -9
  176. package/dist/runtime/server/api/countries.d.ts +2 -0
  177. package/dist/runtime/server/api/countries.js +44 -0
  178. package/dist/runtime/server/api/customer/address/add.js +1 -2
  179. package/dist/runtime/server/api/customer/address/delete.js +2 -3
  180. package/dist/runtime/server/api/customer/address/setshipping.js +1 -2
  181. package/dist/runtime/server/api/customer/address/update.js +1 -2
  182. package/dist/runtime/server/api/customer/cards/delete.js +2 -3
  183. package/dist/runtime/server/api/customer/cards/get.js +2 -3
  184. package/dist/runtime/server/api/customer/change-password.js +2 -3
  185. package/dist/runtime/server/api/customer/checkout.js +1 -2
  186. package/dist/runtime/server/api/customer/orders.js +2 -3
  187. package/dist/runtime/server/api/customer/profile/update.js +1 -2
  188. package/dist/runtime/server/api/customer/quotations.js +2 -3
  189. package/dist/runtime/server/api/customer/search.js +1 -2
  190. package/dist/runtime/server/api/customer/tax-invoice.js +1 -2
  191. package/dist/runtime/server/api/customer/wishlist/add.js +1 -2
  192. package/dist/runtime/server/api/customer/wishlist/createWishList.js +1 -2
  193. package/dist/runtime/server/api/customer/wishlist/deleteFromWishList.js +1 -2
  194. package/dist/runtime/server/api/customer/wishlist/deleteWishList.js +1 -2
  195. package/dist/runtime/server/api/customer/wishlist/get.js +2 -3
  196. package/dist/runtime/server/api/customer/wishlist/getWishListItems.js +1 -2
  197. package/dist/runtime/server/api/customer/wishlist/updateWishList.js +2 -3
  198. package/dist/runtime/server/api/featured.d.ts +3 -0
  199. package/dist/runtime/server/api/featured.js +52 -0
  200. package/dist/runtime/server/api/generate/robots.get.d.ts +2 -0
  201. package/dist/runtime/server/api/generate/robots.get.js +20 -0
  202. package/dist/runtime/server/api/generate/sitemap.get.d.ts +2 -0
  203. package/dist/runtime/server/api/generate/sitemap.get.js +32 -0
  204. package/dist/runtime/server/api/location.d.ts +1 -1
  205. package/dist/runtime/server/api/location.js +24 -12
  206. package/dist/runtime/server/api/nav/[id]/links.d.ts +1 -0
  207. package/dist/runtime/server/api/nav/[id]/links.js +46 -10
  208. package/dist/runtime/server/api/page/[...slug].js +54 -0
  209. package/dist/runtime/server/api/product/[...slug].js +28 -13
  210. package/dist/runtime/server/api/quickview/[slug].d.ts +2 -0
  211. package/dist/runtime/server/api/quickview/[slug].js +21 -0
  212. package/dist/runtime/server/api/reviews.d.ts +2 -0
  213. package/dist/runtime/server/api/reviews.js +23 -0
  214. package/dist/runtime/server/api/samples.d.ts +3 -0
  215. package/dist/runtime/server/api/samples.js +53 -0
  216. package/dist/runtime/server/api/search.d.ts +3 -0
  217. package/dist/runtime/server/api/search.js +53 -0
  218. package/dist/runtime/server/api/service/[slug].js +22 -16
  219. package/dist/runtime/server/api/service/availability.d.ts +1 -1
  220. package/dist/runtime/server/api/service/availability.js +14 -12
  221. package/dist/runtime/server/api/service/getall.d.ts +3 -0
  222. package/dist/runtime/server/api/service/getall.js +57 -0
  223. package/dist/runtime/server/api/shop.d.ts +3 -0
  224. package/dist/runtime/server/api/shop.js +53 -0
  225. package/dist/runtime/server/api/subscribe.d.ts +1 -1
  226. package/dist/runtime/server/api/subscribe.js +23 -14
  227. package/dist/runtime/server/api/v2/[...slug].get.d.ts +2 -0
  228. package/dist/runtime/server/api/v2/[...slug].get.js +32 -0
  229. package/dist/runtime/server/api/webform.d.ts +3 -0
  230. package/dist/runtime/server/api/webform.js +54 -0
  231. package/dist/runtime/server/tsconfig.json +3 -3
  232. package/dist/runtime/stores/Cart.d.ts +12 -0
  233. package/dist/runtime/stores/Cart.js +62 -17
  234. package/dist/runtime/stores/Checkout.d.ts +9 -15
  235. package/dist/runtime/stores/Checkout.js +38 -45
  236. package/dist/runtime/stores/IpLocation.d.ts +95 -4
  237. package/dist/runtime/stores/IpLocation.js +93 -15
  238. package/dist/runtime/stores/Search.d.ts +1 -1
  239. package/dist/runtime/stores/Services.d.ts +5 -0
  240. package/dist/runtime/stores/Services.js +59 -8
  241. package/dist/runtime/stores/auth.d.ts +8 -11
  242. package/dist/runtime/stores/auth.js +385 -8
  243. package/dist/runtime/stores/countries.d.ts +1 -3
  244. package/dist/runtime/stores/countries.js +4 -8
  245. package/dist/runtime/stores/product/README.md +6 -6
  246. package/dist/runtime/stores/product/slug.d.ts +1 -17
  247. package/dist/runtime/stores/webforms.d.ts +24 -9
  248. package/dist/runtime/stores/webforms.js +105 -5
  249. package/dist/runtime/stores/wishlists.d.ts +125 -8
  250. package/dist/runtime/stores/wishlists.js +212 -20
  251. package/dist/runtime/utils/api.js +7 -13
  252. package/dist/runtime/utils/htmlCache.d.ts +2 -2
  253. package/dist/runtime/utils/htmlCache.js +23 -13
  254. package/dist/types.d.mts +6 -2
  255. package/package.json +16 -5
  256. package/dist/runtime/composables/Checkout/useBillingAddress.d.ts +0 -19
  257. package/dist/runtime/composables/Checkout/useBillingAddress.js +0 -82
  258. package/dist/runtime/composables/Checkout/useShippingAddress.d.ts +0 -9
  259. package/dist/runtime/composables/Checkout/useShippingAddress.js +0 -121
  260. package/dist/runtime/composables/useAuth.d.ts +0 -45
  261. package/dist/runtime/composables/useAuth.js +0 -180
  262. package/dist/runtime/composables/useCountries.d.ts +0 -12
  263. package/dist/runtime/composables/useCountries.js +0 -50
  264. package/dist/runtime/composables/useOrders.d.ts +0 -21
  265. package/dist/runtime/composables/useOrders.js +0 -82
  266. package/dist/runtime/composables/useQuotations.d.ts +0 -14
  267. package/dist/runtime/composables/useQuotations.js +0 -50
  268. package/dist/runtime/server/api/blog/[slug].js +0 -51
  269. package/dist/runtime/server/api/blog/blog.js +0 -17
  270. package/dist/runtime/server/api/brand/[slug].js +0 -58
  271. package/dist/runtime/server/api/page/[slug].js +0 -51
  272. package/dist/runtime/server/api/v2/[...slug].js +0 -9
  273. /package/dist/runtime/server/api/brand/{[slug].d.ts → [...slug].d.ts} +0 -0
  274. /package/dist/runtime/server/api/{blog/[slug].d.ts → cmspost/[...slug].d.ts} +0 -0
  275. /package/dist/runtime/server/api/page/{[slug].d.ts → [...slug].d.ts} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { computed } from "vue";
2
2
  import { useAddressesStore } from "../stores/addresses.js";
3
- import { useAuth } from "./useAuth.js";
3
+ import { useAuthStore } from "../stores/auth.js";
4
4
  import { useApi } from "../utils/api.js";
5
5
  function formatErrorMessage(message) {
6
6
  if (!message) return "An error occurred";
@@ -19,14 +19,14 @@ function formatErrorMessage(message) {
19
19
  }
20
20
  export function useAddresses() {
21
21
  const store = useAddressesStore();
22
- const { fetchProfile } = useAuth();
22
+ const { fetchProfile } = useAuthStore();
23
23
  const { post, patch, delete: deleteRequest } = useApi();
24
24
  async function addAddress(userData) {
25
25
  store.setLoading(true);
26
26
  store.setError(null);
27
27
  try {
28
28
  userData.shipping = 1;
29
- const response = await post("/customer/address/add", userData);
29
+ const response = await post("/mystore/customer/address/add", userData);
30
30
  if (response.status === "Success" && response.data) {
31
31
  await fetchProfile();
32
32
  return response;
@@ -48,7 +48,7 @@ export function useAddresses() {
48
48
  store.setLoading(true);
49
49
  store.setError(null);
50
50
  try {
51
- const response = await patch(`/customer/address/${userData.id}/update`, userData);
51
+ const response = await patch(`/mystore/customer/address/${userData.id}/update`, userData);
52
52
  if (response.status === "Success" && response.data) {
53
53
  await fetchProfile();
54
54
  return response;
@@ -70,7 +70,7 @@ export function useAddresses() {
70
70
  store.setLoading(true);
71
71
  store.setError(null);
72
72
  try {
73
- const response = await patch(`/customer/address/${id}/delete`, {});
73
+ const response = await patch(`/mystore/customer/address/${id}/delete`, {});
74
74
  if (response.status === "Success") {
75
75
  await fetchProfile();
76
76
  return response;
@@ -92,7 +92,7 @@ export function useAddresses() {
92
92
  store.setLoading(true);
93
93
  store.setError(null);
94
94
  try {
95
- const response = await post(`/customer/address/${addressId}/setshipping`, {});
95
+ const response = await post(`/mystore/customer/address/${addressId}/setshipping`, {});
96
96
  if (response.status === "Success") {
97
97
  await fetchProfile();
98
98
  return response;
@@ -0,0 +1 @@
1
+ export declare const useApp: () => {};
@@ -0,0 +1,88 @@
1
+ import { useHead, useRequestEvent, useRoute } from "#imports";
2
+ import { getRequestURL } from "h3";
3
+ import { useCompanyProfile } from "../stores/useCompanyProfile.js";
4
+ export const useApp = () => {
5
+ const route = useRoute();
6
+ const companyProfile = useCompanyProfile();
7
+ let gtmId = companyProfile.profile?.data?.integrations["google-tag-manager"];
8
+ gtmId = gtmId ? gtmId["script"] : "";
9
+ let tiktok = companyProfile.profile?.data?.integrations["tiktok"];
10
+ tiktok = tiktok ? tiktok["script"] : "";
11
+ let facebookMeta = companyProfile.profile?.data?.integrations["meta"] || "";
12
+ facebookMeta = facebookMeta ? facebookMeta["script"] : "";
13
+ const sitename = companyProfile.profile?.data?.name || "";
14
+ const meta_title = companyProfile.profile?.data?.meta_title || "";
15
+ const meta_description = companyProfile.profile?.data?.meta_description || "";
16
+ const robots = companyProfile.profile?.data?.robots || "";
17
+ const logo = companyProfile.profile?.data?.logo || "";
18
+ let recaptcha = "";
19
+ if (companyProfile.profile?.data?.recaptcha) {
20
+ recaptcha = `https://www.google.com/recaptcha/api.js?render=${companyProfile.profile?.data?.recaptcha}`;
21
+ }
22
+ let websiteurl = "";
23
+ if (process.server) {
24
+ const event = useRequestEvent();
25
+ websiteurl = getRequestURL(event).origin;
26
+ } else {
27
+ websiteurl = window.location.origin;
28
+ }
29
+ useHead({
30
+ link: [
31
+ {
32
+ rel: "canonical",
33
+ href: `${websiteurl}${route.path}`
34
+ }
35
+ ],
36
+ meta: [
37
+ {
38
+ name: "robots",
39
+ content: robots
40
+ },
41
+ { property: "og:title", content: meta_title },
42
+ { property: "og:description", content: meta_description },
43
+ { property: "og:type", content: "website" },
44
+ { property: "og:url", content: `${websiteurl}${route.path}` },
45
+ { property: "og:image", content: logo }
46
+ ],
47
+ script: [
48
+ {
49
+ src: recaptcha,
50
+ async: true,
51
+ defer: true
52
+ },
53
+ {
54
+ children: `
55
+ (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
56
+ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
57
+ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
58
+ 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
59
+ })(window,document,'script','dataLayer','${gtmId}');
60
+ `
61
+ },
62
+ {
63
+ children: `${tiktok}`
64
+ },
65
+ {
66
+ children: `${facebookMeta}`
67
+ },
68
+ {
69
+ type: "application/ld+json",
70
+ children: JSON.stringify({
71
+ "@context": "https://schema.org",
72
+ "@type": "WebSite",
73
+ "url": websiteurl,
74
+ "name": sitename,
75
+ "alternateName": meta_title,
76
+ "description": meta_description,
77
+ "inLanguage": "en",
78
+ "potentialAction": {
79
+ "@type": "SearchAction",
80
+ "target": `${websiteurl}/search?search={search_term_string}`,
81
+ "query-input": "required name=search_term_string"
82
+ }
83
+ })
84
+ }
85
+ ]
86
+ });
87
+ return {};
88
+ };
@@ -23,7 +23,7 @@ export function useCards() {
23
23
  store.setLoading(true);
24
24
  store.setError(null);
25
25
  try {
26
- const response = await get("/customer/cards");
26
+ const response = await get("/mystore/customer/cards");
27
27
  if (response.status === "Success" && response.data) {
28
28
  store.setCards(response.data.data);
29
29
  return response;
@@ -45,7 +45,7 @@ export function useCards() {
45
45
  store.setLoading(true);
46
46
  store.setError(null);
47
47
  try {
48
- const response = await del(`/customer/cards/${cardId}`);
48
+ const response = await del(`/mystore/customer/cards/${cardId}`);
49
49
  if (response.status === "Success") {
50
50
  store.removeCard(cardId);
51
51
  return response;
@@ -9,7 +9,7 @@ const getDataLayer = () => {
9
9
  };
10
10
  const getCurrencyCode = () => {
11
11
  const companyProfile = useCompanyProfile();
12
- return companyProfile.profile?.currencyCode || "USD";
12
+ return companyProfile.profile?.data?.currencyCode || "USD";
13
13
  };
14
14
  export function GTM_page_view(to) {
15
15
  const dataLayer = getDataLayer();
@@ -0,0 +1,3 @@
1
+ export declare function addtodotdigital(email: any): void;
2
+ export declare function sendCartInsight(): void;
3
+ export declare function CompleteCartInsight(cart: any, status: any): void;
@@ -0,0 +1,122 @@
1
+ import { useCartStore } from "../stores/Cart.js";
2
+ import { useAuthStore } from "../stores/auth.js";
3
+ import { useRouter } from "vue-router";
4
+ const cartStore = useCartStore();
5
+ const authStore = useAuthStore();
6
+ const router = useRouter();
7
+ const getUTCDateTime = () => {
8
+ const now = /* @__PURE__ */ new Date();
9
+ const pad = (number) => number < 10 ? `0${number}` : number;
10
+ const year = now.getUTCFullYear();
11
+ const month = pad(now.getUTCMonth() + 1);
12
+ const day = pad(now.getUTCDate());
13
+ const hours = pad(now.getUTCHours());
14
+ const minutes = pad(now.getUTCMinutes());
15
+ const seconds = pad(now.getUTCSeconds());
16
+ return `${year}${month}${day}T${hours}${minutes}${seconds}Z`;
17
+ };
18
+ const generateProductUrl = (sku) => {
19
+ const resolvedRoute = router.resolve({ name: "Product", params: { slug: sku } });
20
+ return window.location.origin + resolvedRoute.href;
21
+ };
22
+ const generateCartUrl = (token) => {
23
+ const resolvedRoute = router.resolve({ name: "AbandonedCart", params: { slug: token } });
24
+ return "https://" + window.location.host + resolvedRoute.href;
25
+ };
26
+ export function addtodotdigital(email) {
27
+ if (typeof window.dmPt !== "undefined" && window.dmPt) {
28
+ window.dmPt("identify", email);
29
+ }
30
+ }
31
+ export function sendCartInsight() {
32
+ if (typeof window.dmPt !== "undefined" && window.dmPt) {
33
+ const cartItems = cartStore.cart.items;
34
+ const totals = cartStore.cart.totals;
35
+ const abndToken = cartStore.cart.abndToken;
36
+ const isAuthenticated = authStore.isAuthenticated;
37
+ const cartPhase = isAuthenticated ? "CUSTOMER_LOGIN" : "Guest";
38
+ if (isAuthenticated) {
39
+ window.dmPt("identify", authStore.user.email);
40
+ }
41
+ let lineItems = [];
42
+ if (cartItems) {
43
+ Object.values(cartItems).forEach((item, index) => {
44
+ lineItems.push({
45
+ sku: item.sku,
46
+ name: item.name,
47
+ description: item.name,
48
+ category: item.category,
49
+ unitPrice: item.rpfloat,
50
+ salePrice: item.pricefloat,
51
+ quantity: item.qty,
52
+ totalPrice: Number(item.qty * item.pricefloat),
53
+ imageUrl: item.image,
54
+ productUrl: generateProductUrl(item.slug)
55
+ });
56
+ });
57
+ }
58
+ const cartData = {
59
+ programID: 33188,
60
+ cartDelay: 1,
61
+ cartID: abndToken,
62
+ cartPhase: "CART",
63
+ currency: "AUD",
64
+ subtotal: totals.subtotal,
65
+ discountAmount: totals.discount,
66
+ createDate: getUTCDateTime(),
67
+ modifiedDate: getUTCDateTime(),
68
+ taxAmount: totals.gst,
69
+ shipping: totals.shipping,
70
+ grandTotal: totals.total,
71
+ cartUrl: generateCartUrl(abndToken),
72
+ lineItems
73
+ };
74
+ window.dmPt("cartInsight", cartData);
75
+ }
76
+ }
77
+ export function CompleteCartInsight(cart, status) {
78
+ if (typeof window.dmPt !== "undefined" && window.dmPt) {
79
+ const cartItems = cart.items;
80
+ const totals = cart.totals;
81
+ const abndToken = cart.abndToken;
82
+ const isAuthenticated = authStore.isAuthenticated;
83
+ const cartPhase = isAuthenticated ? "CUSTOMER_LOGIN" : "Guest";
84
+ if (isAuthenticated == true) {
85
+ dmPt("identify", authStore.user.email);
86
+ }
87
+ let lineItems = [];
88
+ if (cartItems) {
89
+ Object.values(cartItems).forEach((item, index) => {
90
+ lineItems.push({
91
+ sku: item.sku,
92
+ name: item.name,
93
+ description: item.name,
94
+ category: item.category,
95
+ unitPrice: item.rpfloat,
96
+ salePrice: item.pricefloat,
97
+ quantity: item.qty,
98
+ totalPrice: Number(item.qty * item.pricefloat),
99
+ imageUrl: item.image,
100
+ productUrl: generateProductUrl(item.slug)
101
+ });
102
+ });
103
+ }
104
+ const cartData = {
105
+ programID: 33188,
106
+ cartDelay: 1,
107
+ cartID: abndToken,
108
+ cartPhase: status,
109
+ currency: "AUD",
110
+ subtotal: totals.subtotal,
111
+ discountAmount: totals.discount,
112
+ createDate: getUTCDateTime(),
113
+ modifiedDate: getUTCDateTime(),
114
+ taxAmount: totals.gst,
115
+ shipping: totals.shipping,
116
+ grandTotal: totals.total,
117
+ cartUrl: generateCartUrl(abndToken),
118
+ lineItems
119
+ };
120
+ window.dmPt("cartInsight", cartData);
121
+ }
122
+ }
@@ -1,23 +1,65 @@
1
- export interface LocationData {
1
+ interface LocationInputs {
2
2
  country: string;
3
- countryCode?: string;
4
- state?: string;
3
+ country_id: string | number;
4
+ zip_code: string | number;
5
+ region: string;
6
+ region_id: string | number | null;
7
+ }
8
+ interface LocationData {
5
9
  city?: string;
10
+ country_name?: string;
11
+ country_code?: string;
12
+ country_id?: number;
13
+ ip?: string;
14
+ proxy?: boolean;
15
+ region?: string;
16
+ region_short?: string;
17
+ region_id?: number;
18
+ zip_code?: string;
6
19
  }
7
- export declare const useLocation: () => {
8
- location: Readonly<import("vue").Ref<{
9
- readonly country: string;
10
- readonly countryCode?: string | undefined;
11
- readonly state?: string | undefined;
12
- readonly city?: string | undefined;
13
- }, {
14
- readonly country: string;
15
- readonly countryCode?: string | undefined;
16
- readonly state?: string | undefined;
17
- readonly city?: string | undefined;
18
- }>>;
19
- shippingCountry: Readonly<import("vue").Ref<string, string>>;
20
- updateLocation: (newLocation: Partial<LocationData>) => void;
21
- updateCountry: (country: string, countryCode?: string) => void;
22
- resetLocation: () => void;
20
+ export declare function useLocation(): {
21
+ states: import("vue").Ref<never[], never[]>;
22
+ manualLocationHeading: import("vue").Ref<string | null, string | null>;
23
+ locationInputs: import("vue").Ref<{
24
+ country: string;
25
+ country_id: string | number;
26
+ zip_code: string | number;
27
+ region: string;
28
+ region_id: string | number | null;
29
+ }, LocationInputs | {
30
+ country: string;
31
+ country_id: string | number;
32
+ zip_code: string | number;
33
+ region: string;
34
+ region_id: string | number | null;
35
+ }>;
36
+ location: import("vue").ComputedRef<{
37
+ city?: string | undefined;
38
+ country_name?: string | undefined;
39
+ country_code?: string | undefined;
40
+ country_id?: number | undefined;
41
+ ip?: string | undefined;
42
+ proxy?: boolean | undefined;
43
+ region?: string | undefined;
44
+ region_short?: string | undefined;
45
+ region_id?: number | undefined;
46
+ zip_code?: string | undefined;
47
+ } | null>;
48
+ countries: import("vue").ComputedRef<any>;
49
+ loading: import("vue").ComputedRef<boolean>;
50
+ companyCountryId: import("vue").ComputedRef<any>;
51
+ getStateShort: (stateName: string) => string;
52
+ getStates: (countryId: number | string) => any;
53
+ changeStates: (selectedCountry: string | number) => void;
54
+ changeLocation: (data?: Partial<LocationInputs>) => Promise<void>;
55
+ updateLocationData: (data?: Partial<LocationInputs>) => Promise<void>;
56
+ getLocation: (skipBrowserRequest?: boolean) => Promise<void>;
57
+ checkCurrentLocation: () => void;
58
+ initLocationInputs: () => void;
59
+ loadLocation: () => LocationData | null;
60
+ checkLocationPermission: () => Promise<string>;
61
+ initializeCountriesAndStates: () => Promise<void>;
62
+ requestBrowserLocation: () => Promise<boolean>;
63
+ openLocationModal: () => void;
23
64
  };
65
+ export {};