@haus-storefront-react/vendure-plugin-configs 1.0.4-next.16 → 1.0.4-next.3

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 (59) hide show
  1. package/CHANGELOG.md +0 -156
  2. package/badge.js +1 -1
  3. package/badge.mjs +424 -439
  4. package/campaign.js +1 -1
  5. package/campaign.mjs +106 -50
  6. package/compiler-runtime-oPPev21o.js +10 -0
  7. package/compiler-runtime-qHgugrLy.mjs +296 -0
  8. package/elastic.js +1 -1
  9. package/elastic.mjs +26 -10
  10. package/index-BRlTlK6a.mjs +3768 -0
  11. package/index-BgBC_k8M.js +1 -0
  12. package/index-C0E-40z0.mjs +19 -0
  13. package/index-CgxqXyHf.js +20 -0
  14. package/index.js +1 -1
  15. package/index.mjs +4 -2
  16. package/lib/configs/vendure-badge-plugin.d.ts +2 -10
  17. package/lib/configs/vendure-badge-plugin.types.d.ts +1 -0
  18. package/lib/configs/vendure-campaign-plugin.d.ts +1 -1
  19. package/lib/configs/vendure-elastic-search-plugin.d.ts +1 -1
  20. package/lib/configs/vendure-packagesize-plugin.d.ts +1 -1
  21. package/lib/configs/vendure-product-popularity-plugin.d.ts +1 -1
  22. package/lib/configs/vendure-purchase-order-payment-plugin.d.ts +2 -2
  23. package/lib/plugin-config.d.ts +1 -2
  24. package/lib/types.d.ts +0 -1
  25. package/package.json +5 -25
  26. package/packagesize.js +1 -1
  27. package/packagesize.mjs +59 -15
  28. package/product-popularity.js +1 -1
  29. package/product-popularity.mjs +22 -12
  30. package/purchase-order-payment.js +5 -5
  31. package/purchase-order-payment.mjs +631 -207
  32. package/useSdk-DOrZRSHz.mjs +2634 -0
  33. package/useSdk-YXpk8Wsi.js +21 -0
  34. package/lib/configs/vendure-product-variant-specifications-plugin.d.ts +0 -55
  35. package/lib/configs/vendure-product-variant-specifications-plugin.types.d.ts +0 -8
  36. package/lib/configs/vendure-products-by-sku-plugin.d.ts +0 -11
  37. package/lib/configs/vendure-products-by-sku-plugin.types.d.ts +0 -13
  38. package/lib/configs/vendure-related-products-plugin.d.ts +0 -39
  39. package/lib/configs/vendure-related-products-plugin.types.d.ts +0 -16
  40. package/lib/exports/product-variant-specifications.d.ts +0 -2
  41. package/lib/exports/products-by-sku.d.ts +0 -3
  42. package/lib/exports/related-products.d.ts +0 -3
  43. package/lib/hooks/use-related-products.d.ts +0 -2
  44. package/lib/strategies/quick-order-variant-sku-validation-strategy.d.ts +0 -6
  45. package/plugin-config-DrQQb9Ry.js +0 -1
  46. package/plugin-config-DywohMgp.mjs +0 -903
  47. package/product-variant-specifications.d.ts +0 -2
  48. package/product-variant-specifications.js +0 -1
  49. package/product-variant-specifications.mjs +0 -9
  50. package/products-by-sku.d.ts +0 -2
  51. package/products-by-sku.js +0 -1
  52. package/products-by-sku.mjs +0 -54
  53. package/related-products.d.ts +0 -2
  54. package/related-products.js +0 -1
  55. package/related-products.mjs +0 -35
  56. package/src-ChzQhPCd.js +0 -6
  57. package/src-CsM7SeIh.mjs +0 -455
  58. package/src-Dq29mogl.js +0 -21
  59. package/src-Dud_XHV6.mjs +0 -2718
package/CHANGELOG.md CHANGED
@@ -1,159 +1,3 @@
1
- ## 1.0.4-next.15 (2026-03-26)
2
-
3
- ### 🧱 Updated Dependencies
4
-
5
- - Updated store/components/quick-order to 1.0.0-next.9
6
- - Updated store/strategies to 1.0.4-next.15
7
- - Updated core to 1.0.4-next.15
8
- - Updated common/utils to 1.0.4-next.15
9
- - Updated shared/types to 1.0.4-next.15
10
- - Updated providers to 1.0.4-next.15
11
-
12
- ## 1.0.4-next.14 (2026-03-26)
13
-
14
- ### 🧱 Updated Dependencies
15
-
16
- - Updated store/components/quick-order to 1.0.0-next.8
17
- - Updated store/strategies to 1.0.4-next.14
18
- - Updated core to 1.0.4-next.14
19
- - Updated common/utils to 1.0.4-next.14
20
- - Updated shared/types to 1.0.4-next.14
21
- - Updated providers to 1.0.4-next.14
22
-
23
- ## 1.0.4-next.13 (2026-03-24)
24
-
25
- ### 🩹 Fixes
26
-
27
- - update RelatedProductsInput to use facetValueIds instead of facetIds
28
-
29
- ### 🧱 Updated Dependencies
30
-
31
- - Updated store/components/quick-order to 1.0.0-next.7
32
- - Updated store/strategies to 1.0.4-next.13
33
- - Updated core to 1.0.4-next.13
34
- - Updated common/utils to 1.0.4-next.13
35
- - Updated shared/types to 1.0.4-next.13
36
- - Updated providers to 1.0.4-next.13
37
-
38
- ## 1.0.4-next.12 (2026-03-19)
39
-
40
- ### 🧱 Updated Dependencies
41
-
42
- - Updated store/components/quick-order to 1.0.0-next.6
43
- - Updated store/strategies to 1.0.4-next.12
44
- - Updated core to 1.0.4-next.12
45
- - Updated common/utils to 1.0.4-next.12
46
- - Updated shared/types to 1.0.4-next.12
47
- - Updated providers to 1.0.4-next.12
48
-
49
- ## 1.0.4-next.11 (2026-03-18)
50
-
51
- ### 🧱 Updated Dependencies
52
-
53
- - Updated store/components/quick-order to 1.0.0-next.5
54
- - Updated store/strategies to 1.0.4-next.11
55
- - Updated core to 1.0.4-next.11
56
- - Updated common/utils to 1.0.4-next.11
57
- - Updated shared/types to 1.0.4-next.11
58
- - Updated providers to 1.0.4-next.11
59
-
60
- ## 1.0.4-next.10 (2026-03-18)
61
-
62
- ### 🧱 Updated Dependencies
63
-
64
- - Updated store/components/quick-order to 1.0.0-next.4
65
- - Updated store/strategies to 1.0.4-next.10
66
- - Updated core to 1.0.4-next.10
67
- - Updated common/utils to 1.0.4-next.10
68
- - Updated shared/types to 1.0.4-next.10
69
- - Updated providers to 1.0.4-next.10
70
-
71
- ## 1.0.4-next.9 (2026-03-16)
72
-
73
- ### 🧱 Updated Dependencies
74
-
75
- - Updated store/components/quick-order to 1.0.0-next.3
76
- - Updated store/strategies to 1.0.4-next.9
77
- - Updated core to 1.0.4-next.9
78
- - Updated common/utils to 1.0.4-next.9
79
- - Updated shared/types to 1.0.4-next.9
80
- - Updated providers to 1.0.4-next.9
81
-
82
- ## 1.0.4-next.8 (2026-03-13)
83
-
84
- ### 🚀 Features
85
-
86
- - Switch out lodash for lodash-es
87
- - **vendure:** add related products plugin and types
88
-
89
- ### 🧱 Updated Dependencies
90
-
91
- - Updated store/components/quick-order to 1.0.0-next.2
92
- - Updated store/strategies to 1.0.4-next.8
93
- - Updated core to 1.0.4-next.8
94
- - Updated common/utils to 1.0.4-next.8
95
- - Updated shared/types to 1.0.4-next.8
96
- - Updated providers to 1.0.4-next.8
97
-
98
- ## 1.0.4-next.7 (2026-03-11)
99
-
100
- ### 🚀 Features
101
-
102
- - add product variant specifications feature to storefront
103
-
104
- ### 🧱 Updated Dependencies
105
-
106
- - Updated store/components/quick-order to 1.0.0-next.1
107
- - Updated store/strategies to 1.0.4-next.7
108
- - Updated core to 1.0.4-next.7
109
- - Updated common/utils to 1.0.4-next.7
110
- - Updated shared/types to 1.0.4-next.7
111
- - Updated providers to 1.0.4-next.7
112
-
113
- ## 1.0.4-next.6 (2026-03-09)
114
-
115
- ### 🚀 Features
116
-
117
- - add Product Variant Specifications plugin
118
-
119
- ### 🧱 Updated Dependencies
120
-
121
- - Updated core to 1.0.4-next.6
122
- - Updated common/utils to 1.0.4-next.6
123
- - Updated shared/types to 1.0.4-next.6
124
- - Updated providers to 1.0.4-next.6
125
-
126
- ## 1.0.4-next.5 (2026-03-09)
127
-
128
- ### 🚀 Features
129
-
130
- - add Product Variant Specifications plugin
131
-
132
- ### 🧱 Updated Dependencies
133
-
134
- - Updated core to 1.0.4-next.5
135
- - Updated common/utils to 1.0.4-next.5
136
- - Updated shared/types to 1.0.4-next.5
137
- - Updated providers to 1.0.4-next.5
138
-
139
- ## 1.0.4-next.4 (2026-03-09)
140
-
141
- ### 🧱 Updated Dependencies
142
-
143
- - Updated core to 1.0.4-next.4
144
- - Updated common/utils to 1.0.4-next.4
145
- - Updated shared/types to 1.0.4-next.4
146
- - Updated providers to 1.0.4-next.4
147
-
148
- ## 1.0.4-next.3 (2026-03-06)
149
-
150
- ### 🧱 Updated Dependencies
151
-
152
- - Updated core to 1.0.4-next.3
153
- - Updated common/utils to 1.0.4-next.3
154
- - Updated shared/types to 1.0.4-next.3
155
- - Updated providers to 1.0.4-next.3
156
-
157
1
  ## 1.0.4-next.2 (2026-03-04)
158
2
 
159
3
  ### 🧱 Updated Dependencies
package/badge.js CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./src-ChzQhPCd.js`),t=require(`./plugin-config-DrQQb9Ry.js`),n=require(`./src-Dq29mogl.js`);let r=require(`react`);var i=`__lodash_hash_undefined__`;function a(e){return this.__data__.set(e,i),this}function o(e){return this.__data__.has(e)}function s(e){var n=-1,r=e==null?0:e.length;for(this.__data__=new t.f;++n<r;)this.add(e[n])}s.prototype.add=s.prototype.push=a,s.prototype.has=o;function c(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function l(e,t){return e.has(t)}var u=1,d=2;function f(e,t,n,r,i,a){var o=n&u,f=e.length,p=t.length;if(f!=p&&!(o&&p>f))return!1;var m=a.get(e),h=a.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=n&d?new s:void 0;for(a.set(e,t),a.set(t,e);++g<f;){var y=e[g],b=t[g];if(r)var x=o?r(b,y,g,t,e,a):r(y,b,g,e,t,a);if(x!==void 0){if(x)continue;_=!1;break}if(v){if(!c(t,function(e,t){if(!l(v,t)&&(y===e||i(y,e,n,r,a)))return v.push(t)})){_=!1;break}}else if(!(y===b||i(y,b,n,r,a))){_=!1;break}}return a.delete(e),a.delete(t),_}function p(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function m(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var h=1,g=2,_=`[object Boolean]`,v=`[object Date]`,y=`[object Error]`,b=`[object Map]`,x=`[object Number]`,S=`[object RegExp]`,C=`[object Set]`,ee=`[object String]`,te=`[object Symbol]`,ne=`[object ArrayBuffer]`,re=`[object DataView]`,w=t.T?t.T.prototype:void 0,T=w?w.valueOf:void 0;function E(e,n,r,i,a,o,s){switch(r){case re:if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case ne:return!(e.byteLength!=n.byteLength||!o(new t.r(e),new t.r(n)));case _:case v:case x:return t.y(+e,+n);case y:return e.name==n.name&&e.message==n.message;case S:case ee:return e==n+``;case b:var c=p;case C:var l=i&h;if(c||=m,e.size!=n.size&&!l)return!1;var u=s.get(e);if(u)return u==n;i|=g,s.set(e,n);var d=f(c(e),c(n),i,a,o,s);return s.delete(e),d;case te:if(T)return T.call(e)==T.call(n)}return!1}var ie=1,ae=Object.prototype.hasOwnProperty;function oe(e,n,r,i,a,o){var s=r&ie,c=t.a(e),l=c.length;if(l!=t.a(n).length&&!s)return!1;for(var u=l;u--;){var d=c[u];if(!(s?d in n:ae.call(n,d)))return!1}var f=o.get(e),p=o.get(n);if(f&&p)return f==n&&p==e;var m=!0;o.set(e,n),o.set(n,e);for(var h=s;++u<l;){d=c[u];var g=e[d],_=n[d];if(i)var v=s?i(_,g,d,n,e,o):i(g,_,d,e,n,o);if(!(v===void 0?g===_||a(g,_,r,i,o):v)){m=!1;break}h||=d==`constructor`}if(m&&!h){var y=e.constructor,b=n.constructor;y!=b&&`constructor`in e&&`constructor`in n&&!(typeof y==`function`&&y instanceof y&&typeof b==`function`&&b instanceof b)&&(m=!1)}return o.delete(e),o.delete(n),m}var se=1,D=`[object Arguments]`,O=`[object Array]`,k=`[object Object]`,A=Object.prototype.hasOwnProperty;function j(e,n,r,i,a,o){var s=t.C(e),c=t.C(n),l=s?O:t.i(e),u=c?O:t.i(n);l=l==D?k:l,u=u==D?k:u;var d=l==k,p=u==k,m=l==u;if(m&&t.g(e)){if(!t.g(n))return!1;s=!0,d=!1}if(m&&!d)return o||=new t.s,s||t.h(e)?f(e,n,r,i,a,o):E(e,n,l,r,i,a,o);if(!(r&se)){var h=d&&A.call(e,`__wrapped__`),g=p&&A.call(n,`__wrapped__`);if(h||g){var _=h?e.value():e,v=g?n.value():n;return o||=new t.s,a(_,v,r,i,o)}}return m?(o||=new t.s,oe(e,n,r,i,a,o)):!1}function M(e,n,r,i,a){return e===n?!0:e==null||n==null||!t.w(e)&&!t.w(n)?e!==e&&n!==n:j(e,n,r,i,M,a)}var N=1,P=2;function F(e,n,r,i){var a=r.length,o=a,s=!i;if(e==null)return!o;for(e=Object(e);a--;){var c=r[a];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<o;){c=r[a];var l=c[0],u=e[l],d=c[1];if(s&&c[2]){if(u===void 0&&!(l in e))return!1}else{var f=new t.s;if(i)var p=i(u,d,l,e,n,f);if(!(p===void 0?M(d,u,N|P,i,f):p))return!1}}return!0}function I(e){return e===e&&!t.S(e)}function L(e){for(var n=t.m(e),r=n.length;r--;){var i=n[r],a=e[i];n[r]=[i,a,I(a)]}return n}function R(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function z(e){var t=L(e);return t.length==1&&t[0][2]?R(t[0][0],t[0][1]):function(n){return n===e||F(n,e,t)}}function B(e,t){return e!=null&&t in Object(e)}function V(e,n,r){n=t.d(n,e);for(var i=-1,a=n.length,o=!1;++i<a;){var s=t.u(n[i]);if(!(o=e!=null&&r(e,s)))break;e=e[s]}return o||++i!=a?o:(a=e==null?0:e.length,!!a&&t.v(a)&&t.b(s,a)&&(t.C(e)||t._(e)))}function H(e,t){return e!=null&&V(e,t,B)}var U=1,W=2;function G(e,n){return t.p(e)&&I(n)?R(t.u(e),n):function(r){var i=t.c(r,e);return i===void 0&&i===n?H(r,e):M(n,i,U|W)}}function ce(e){return function(t){return t?.[e]}}function le(e){return function(n){return t.l(n,e)}}function ue(e){return t.p(e)?ce(t.u(e)):le(e)}function de(e){return typeof e==`function`?e:e==null?t.x:typeof e==`object`?t.C(e)?G(e[0],e[1]):z(e):ue(e)}function fe(e,n){var r=[];return t.n(e,function(e,t,i){n(e,t,i)&&r.push(e)}),r}function pe(e,n){return(t.C(e)?t.o:fe)(e,de(n,3))}var K=new t.t({name:`badges`,enableFeatures:{showBadges:({badges:e=[],parentComponent:t})=>{let n=t?K.getSettings().availablePositions[t]:K.getSettings().defaultPositions;return{badges:pe(e,e=>n?n.includes(e.position):!0),availablePositions:n}}},queryUpdates:{},settings:{defaultPositions:[`top-left`,`top-right`,`bottom-left`,`bottom-right`],availablePositions:{productListItem:[`top-left`,`top-right`,`bottom-left`,`bottom-right`],productDetail:[`top-left`,`top-right`,`bottom-left`,`bottom-right`],imageCarousel:[`top-left`,`top-right`,`bottom-left`,`bottom-right`]}}});K.setQueryUpdates({product:{fields:[{badges:[`id`,`position`,`assetId`,{asset:[`id`,`name`,`preview`,`source`]},{collection:[`id`,`name`]}]}]},search:{fields:[{items:[{badges:[`id`,`position`,`assetId`,{asset:[`id`,`name`,`preview`,`source`]},{collection:[`id`,`name`]}]}]}]},products:{fields:[{items:[{badges:[`id`,`position`,`assetId`,{asset:[`id`,`name`,`preview`,`source`]},{collection:[`id`,`name`]}]}]}]},briefProducts:{fields:[{items:[{badges:[`id`,`position`,`assetId`,{asset:[`id`,`name`,`preview`,`source`]},{collection:[`id`,`name`]}]}]}]}}),K.setRequests({getBadges:async()=>K.getSdk().createRequest({operation:`badges`,fields:[`totalItems`,{items:[`id`,`createdAt`,`updatedAt`,`collectionId`,`position`,`assetId`,{asset:[`id`,`name`,`preview`,`source`]},{collection:[`id`,`name`]}]}]},{options:{take:100}},!1).then(e=>e.data).catch(e=>({message:e.message,errorCode:e.code||`unknown`}))});var q=e.c(),J=`ProductBadge`,[Y]=e.s(J),[me,he]=Y(J),X=({children:t,product:i,__scopeProductBadge:a,style:o,...s})=>{let c=(0,r.useRef)(null),l=e.a(n.r());if(!K.getEnabled())return null;let{badges:u}=i;if(!u)return null;let d=u.reduce((e,t)=>(e[t.position]||(e[t.position]=[]),e[t.position].push(t),e),{}),f={groupedBadges:d,badges:u,badgesRef:c,positions:Object.keys(d)};return(0,q.jsx)(me,{scope:a,...f,children:(0,q.jsx)(l,{...s,style:o,children:e.r(t,f)})})};X.displayName=J;var Z=({children:t,position:r,asChild:i,__scopeProductBadge:a,...o})=>{let s=e.a(n.r(),i,`div`),{groupedBadges:c}=he(J,a),l=c[r];return(0,q.jsx)(s,{...o,"data-position":r,children:e.r(t,{badges:l,position:r})})},Q=({children:t,asChild:r,badge:i,...a})=>(0,q.jsx)(e.a(n.r(),r,`div`),{...a,"data-badge-id":i?.id,children:t}),$=({badge:t,asChild:r,...i})=>{let a=n.r(),o=e.a(a,r,`img`),s=e.o(i,a);return(0,q.jsx)(o,{src:t.asset?.preview,alt:t.collection.name,"data-badge-name":t.collection.name,...s})};Z.displayName=`ProductBadgeGroup`,Q.displayName=`ProductBadgeItem`,$.displayName=`ProductBadgeImage`;var ge={Root:X,Group:Z,Item:Q,Image:$};exports.ProductBadge=ge,exports.VendureBadgePlugin=K;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("./index-CgxqXyHf.js"),g=require("./compiler-runtime-oPPev21o.js"),C=require("react"),I=require("./index-BgBC_k8M.js"),T=require("./useSdk-YXpk8Wsi.js");require("@tanstack/react-query");function $(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const m=$(C),P=new j.VendurePluginConfig({name:"badges",enableFeatures:{showBadges:({badges:t=[],parentComponent:e})=>{const n=e?P.getSettings().availablePositions[e]:P.getSettings().defaultPositions;return{badges:j.lodashExports.filter(t,c=>n?n.includes(c.position):!0),availablePositions:n}}},queryUpdates:{},settings:{defaultPositions:["top-left","top-right","bottom-left","bottom-right"],availablePositions:{productListItem:["top-left","top-right","bottom-left","bottom-right"],productDetail:["top-left","top-right","bottom-left","bottom-right"],imageCarousel:["top-left","top-right","bottom-left","bottom-right"]}}});P.setQueryUpdates({product:{fields:[{badges:["id","position","assetId",{asset:["id","name","preview","source"]},{collection:["id","name"]}]}]},search:{fields:[{items:[{badges:["id","position","assetId",{asset:["id","name","preview","source"]},{collection:["id","name"]}]}]}]},products:{fields:[{items:[{badges:["id","position","assetId",{asset:["id","name","preview","source"]},{collection:["id","name"]}]}]}]},briefProducts:{fields:[{items:[{badges:["id","position","assetId",{asset:["id","name","preview","source"]},{collection:["id","name"]}]}]}]}});P.setRequests({getBadges:async()=>P.getSdk().createRequest({operation:"badges",fields:["totalItems",{items:["id","createdAt","updatedAt","collectionId","position","assetId",{asset:["id","name","preview","source"]},{collection:["id","name"]}]}]},{options:{take:100}},!1).then(t=>t.data).catch(t=>({message:t.message,errorCode:t.code||"unknown"}))});function N(t){const e=[];function n(c,o){const s=m.createContext(o),r=e.length;e.push(s);const l=u=>{const d=g.compilerRuntimeExports.c(8);let f,p,x;d[0]!==u?({scope:x,children:f,...p}=u,d[0]=u,d[1]=f,d[2]=p,d[3]=x):(f=d[1],p=d[2],x=d[3]);const y=x?.[t]?.[r]||s,b=p;let h;return d[4]!==y.Provider||d[5]!==f||d[6]!==b?(h=g.jsxRuntimeExports.jsx(y.Provider,{value:b,children:f}),d[4]=y.Provider,d[5]=f,d[6]=b,d[7]=h):h=d[7],h};l.displayName=c+"Provider";function a(u,d){const f=d?.[t]?.[r]||s,p=m.useContext(f);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${c}\``)}return[l,a]}function i(){const c=e.map(o=>m.createContext(o));return function(s){const r=s?.[t]||c;return m.useMemo(()=>({[`__scope${t}`]:{...s,[t]:r}}),[s,r])}}return i.scopeName=t,[n,i]}function O(t,e){if(e==="web")return t;const{src:n,alt:i,width:c,height:o,...s}=t,r=[typeof c=="number"?{width:c}:void 0,typeof o=="number"?{height:o}:void 0].filter(Boolean);let l;return r.length===1?l=r[0]:r.length>1&&(l=r),{...s,source:{uri:n},...l?{style:l}:{}}}function k(t){const{src:e,alt:n,...i}=t;return e?{...i,source:{uri:e}}:i}const q={div:"View",span:"Text",p:"Text",h1:"Text",h2:"Text",h3:"Text",h4:"Text",h5:"Text",h6:"Text",button:"Pressable",input:"TextInput",form:"View",section:"View",article:"View",nav:"View",header:"View",footer:"View",main:"View",aside:"View",ul:"View",ol:"View",li:"View",a:"Pressable",img:"Image",label:"Text",textarea:"TextInput",select:"Pressable",option:"Text"};function A(t,e){if(e==="web")return t;let n=null;try{n=require("react-native")}catch{n=null}if(!n)return console.warn(`react-native is not available at runtime; falling back to 'View' for '${t}'`),"div";const i=q[t];if(!i)return console.warn(`No native component mapping found for '${t}', falling back to View`),n.View;if(i==="Image"){const o=C.forwardRef((s,r)=>{const l=g.compilerRuntimeExports.c(5);if(!s.src)return null;let a;l[0]!==s?(a=k(s),l[0]=s,l[1]=a):a=l[1];let u;return l[2]!==r||l[3]!==a?(u=g.jsxRuntimeExports.jsx(n.Image,{ref:r,...a}),l[2]=r,l[3]=a,l[4]=u):u=l[4],u});return o.displayName="PlatformPrimitiveImage",o}const c=n[i];return c||(console.warn(`Native component '${i}' not found, falling back to View`),n.View)}const D=Symbol("radix.slottable");function F(...t){return e=>t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}function M(t,e){const n={...e};for(const i in e){const c=t[i],o=e[i];/^on[A-Z]/.test(i)?c&&o?n[i]=(...r)=>{const l=o(...r);return c(...r),l}:c&&(n[i]=c):i==="style"?n[i]=W(c,o):i==="className"&&(n[i]=[c,o].filter(Boolean).join(" "))}return{...t,...n}}function W(t,e){let n=null;try{n=require("react-native")}catch{n=null}const i=n?.StyleSheet?.flatten;if(typeof t=="function"&&typeof e=="function")return o=>{const s=[t(o),e(o)];return i?i(s):s};if(typeof t=="function")return o=>{const s=e?[t(o),e]:t(o);return i?i(s):s};if(typeof e=="function")return o=>{const s=t?[t,e(o)]:e(o);return i?i(s):s};const c=[t,e].filter(Boolean);return i?i(c):c}function G(t){return m.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===D}function L(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function U(t,e){const n=m.forwardRef((i,c)=>{const{children:o,...s}=i;if(m.isValidElement(o)){const r=L(o),l=M(s,o.props);return o.type!==m.Fragment&&(l.ref=c?F(c,r):r),m.cloneElement(o,l)}return m.Children.count(o)>1?m.Children.only(null):null});return n.displayName=`${t}.SlotClone`,n}function v(t,e=!1,n="div"){if(!e)return A(n,t);const i=U("Slot"),c=m.forwardRef((o,s)=>{const r=g.compilerRuntimeExports.c(15);let l,a;r[0]!==o?({children:l,...a}=o,r[0]=o,r[1]=l,r[2]=a):(l=r[1],a=r[2]);let u;if(r[3]!==l||r[4]!==s||r[5]!==a){u=Symbol.for("react.early_return_sentinel");e:{const f=m.Children.toArray(l),p=f.find(G);if(p){const x=p.props.children,y=f.map(R=>R===p?m.Children.count(x)>1?m.Children.only(null):m.isValidElement(x)?x.props.children:null:R),b=m.isValidElement(x)?m.cloneElement(x,void 0,y):null;let h;r[7]!==s||r[8]!==a||r[9]!==b?(h=g.jsxRuntimeExports.jsx(i,{...a,ref:s,children:b}),r[7]=s,r[8]=a,r[9]=b,r[10]=h):h=r[10],u=h;break e}}r[3]=l,r[4]=s,r[5]=a,r[6]=u}else u=r[6];if(u!==Symbol.for("react.early_return_sentinel"))return u;let d;return r[11]!==l||r[12]!==s||r[13]!==a?(d=g.jsxRuntimeExports.jsx(i,{...a,ref:s,children:l}),r[11]=l,r[12]=s,r[13]=a,r[14]=d):d=r[14],d});return c.displayName="Slot",c}const E=()=>{const t=g.compilerRuntimeExports.c(2),{getPlatform:e}=T.useSdk();let n;return t[0]!==e?(n=e(),t[0]=e,t[1]=n):n=t[1],n},w="ProductBadge",[H]=N(w),[z,K]=H(w),B=t=>{const e=g.compilerRuntimeExports.c(13);let n,i,c,o,s;e[0]!==t?({children:i,product:c,__scopeProductBadge:n,style:s,...o}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=c,e[4]=o,e[5]=s):(n=e[1],i=e[2],c=e[3],o=e[4],s=e[5]);const r=C.useRef(null),l=E();let a;e[6]!==l?(a=v(l),e[6]=l,e[7]=a):a=e[7];const u=a;if(!P.getEnabled())return null;const{badges:d}=c;if(!d)return null;const f=d.reduce(Z,{}),p=Object.keys(f),x={groupedBadges:f,badges:d,badgesRef:r,positions:p},y=I.renderChildren(i,x);let b;return e[8]!==u||e[9]!==o||e[10]!==s||e[11]!==y?(b=g.jsxRuntimeExports.jsx(u,{...o,style:s,children:y}),e[8]=u,e[9]=o,e[10]=s,e[11]=y,e[12]=b):b=e[12],g.jsxRuntimeExports.jsx(z,{scope:n,...x,children:b})};B.displayName=w;const S=t=>{const e=g.compilerRuntimeExports.c(18);let n,i,c,o,s;e[0]!==t?({children:c,position:o,asChild:i,__scopeProductBadge:n,...s}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=c,e[4]=o,e[5]=s):(n=e[1],i=e[2],c=e[3],o=e[4],s=e[5]);const r=E();let l;e[6]!==i||e[7]!==r?(l=v(r,i,"div"),e[6]=i,e[7]=r,e[8]=l):l=e[8];const a=l,{groupedBadges:u}=K(w,n),d=u[o];let f;e[9]!==d||e[10]!==c||e[11]!==o?(f=I.renderChildren(c,{badges:d,position:o}),e[9]=d,e[10]=c,e[11]=o,e[12]=f):f=e[12];let p;return e[13]!==a||e[14]!==o||e[15]!==s||e[16]!==f?(p=g.jsxRuntimeExports.jsx(a,{...s,"data-position":o,children:f}),e[13]=a,e[14]=o,e[15]=s,e[16]=f,e[17]=p):p=e[17],p},_=t=>{const e=g.compilerRuntimeExports.c(13);let n,i,c,o;e[0]!==t?({children:c,asChild:n,badge:i,...o}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=c,e[4]=o):(n=e[1],i=e[2],c=e[3],o=e[4]);const s=E();let r;e[5]!==n||e[6]!==s?(r=v(s,n,"div"),e[5]=n,e[6]=s,e[7]=r):r=e[7];const l=r,a=i?.id;let u;return e[8]!==l||e[9]!==c||e[10]!==o||e[11]!==a?(u=g.jsxRuntimeExports.jsx(l,{...o,"data-badge-id":a,children:c}),e[8]=l,e[9]=c,e[10]=o,e[11]=a,e[12]=u):u=e[12],u},V=t=>{const e=g.compilerRuntimeExports.c(8),{badge:n,asChild:i,...c}=t,o=E();let s;e[0]!==i||e[1]!==o?(s=v(o,i,"img"),e[0]=i,e[1]=o,e[2]=s):s=e[2];const r=s,l=O(c,o),a=n.asset?.preview;let u;return e[3]!==r||e[4]!==n.collection.name||e[5]!==a||e[6]!==l?(u=g.jsxRuntimeExports.jsx(r,{src:a,alt:n.collection.name,"data-badge-name":n.collection.name,...l}),e[3]=r,e[4]=n.collection.name,e[5]=a,e[6]=l,e[7]=u):u=e[7],u};S.displayName="ProductBadgeGroup";_.displayName="ProductBadgeItem";V.displayName="ProductBadgeImage";const Q={Root:B,Group:S,Item:_,Image:V};function Z(t,e){return t[e.position]||(t[e.position]=[]),t[e.position].push(e),t}exports.ProductBadge=Q;exports.VendureBadgePlugin=P;