@haus-storefront-react/vendure-plugin-configs 1.0.4-next.2 → 1.0.4-next.4

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.
package/campaign.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-CgxqXyHf.js"),e=require("./index-DgRzu7XX.js"),d=new c.VendurePluginConfig({name:"campaign",enableFeatures:{ordinaryPrice:({variant:i,orderLine:r,searchResult:n,product:a})=>{if(r){const t=r.productVariant;return t?.ordinaryPrice?e.getPrice(t?.ordinaryPrice)*r.quantity:r.discountedLinePriceWithTax}return i?e.getPrice(i.ordinaryPrice||0):n?e.getPrice(n.ordinaryPrice||0):a?e.getProductPriceFromVariants(a.variants):0}},queryUpdates:{}});d.setQueryUpdates({search:{fields:[{items:[{ordinaryPrice:[{operation:"PriceRange",fields:["min, max"],fragment:!0},{operation:"SinglePrice",fields:["value"],fragment:!0}]}]}]},product:{fields:[{ordinaryPrice:[{operation:"PriceRange",fields:["min, max"],fragment:!0},{operation:"SinglePrice",fields:["value"],fragment:!0}]},{variants:["ordinaryPrice"]}]},briefProducts:{fields:[{items:[{ordinaryPrice:[{operation:"PriceRange",fields:["min, max"],fragment:!0},{operation:"SinglePrice",fields:["value"],fragment:!0}]},{variants:["ordinaryPrice"]}]}]},activeOrder:{fields:[{lines:[{productVariant:["ordinaryPrice"]}]}]},orderByCode:{fields:[{lines:[{productVariant:["ordinaryPrice"]}]}]},adjustOrderLine:{fields:[{fields:[{lines:[{productVariant:["ordinaryPrice"]}]}]}]},addItemToOrder:{fields:[{fields:[{lines:[{productVariant:["ordinaryPrice"]}]}]}]}});const o=(i,r)=>{const n=e.getPrice(i),a=e.getPrice(r);return e.getPrice(i)===0?!1:a!==n};exports.VendureCampaignPlugin=d;exports.isCampaign=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-CgxqXyHf.js"),e=require("./index-BgBC_k8M.js"),d=new c.VendurePluginConfig({name:"campaign",enableFeatures:{ordinaryPrice:({variant:i,orderLine:r,searchResult:n,product:a})=>{if(r){const t=r.productVariant;return t?.ordinaryPrice?e.getPrice(t?.ordinaryPrice)*r.quantity:r.discountedLinePriceWithTax}return i?e.getPrice(i.ordinaryPrice||0):n?e.getPrice(n.ordinaryPrice||0):a?e.getProductPriceFromVariants(a.variants):0}},queryUpdates:{}});d.setQueryUpdates({search:{fields:[{items:[{ordinaryPrice:[{operation:"PriceRange",fields:["min, max"],fragment:!0},{operation:"SinglePrice",fields:["value"],fragment:!0}]}]}]},product:{fields:[{ordinaryPrice:[{operation:"PriceRange",fields:["min, max"],fragment:!0},{operation:"SinglePrice",fields:["value"],fragment:!0}]},{variants:["ordinaryPrice"]}]},briefProducts:{fields:[{items:[{ordinaryPrice:[{operation:"PriceRange",fields:["min, max"],fragment:!0},{operation:"SinglePrice",fields:["value"],fragment:!0}]},{variants:["ordinaryPrice"]}]}]},activeOrder:{fields:[{lines:[{productVariant:["ordinaryPrice"]}]}]},orderByCode:{fields:[{lines:[{productVariant:["ordinaryPrice"]}]}]},adjustOrderLine:{fields:[{fields:[{lines:[{productVariant:["ordinaryPrice"]}]}]}]},addItemToOrder:{fields:[{fields:[{lines:[{productVariant:["ordinaryPrice"]}]}]}]}});const o=(i,r)=>{const n=e.getPrice(i),a=e.getPrice(r);return e.getPrice(i)===0?!1:a!==n};exports.VendureCampaignPlugin=d;exports.isCampaign=o;
package/campaign.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { V as d } from "./index-BRlTlK6a.mjs";
2
- import { g as e, a as o } from "./index-BCrKAB0K.mjs";
2
+ import { g as e, a as o } from "./index-C0E-40z0.mjs";
3
3
  const s = new d({
4
4
  name: "campaign",
5
5
  enableFeatures: {
@@ -0,0 +1,10 @@
1
+ "use strict";const g=require("react");var v={exports:{}},d={};var L;function ue(){if(L)return d;L=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function l(f,u,s){var m=null;if(s!==void 0&&(m=""+s),u.key!==void 0&&(m=""+u.key),"key"in u){s={};for(var _ in u)_!=="key"&&(s[_]=u[_])}else s=u;return u=s.ref,{$$typeof:a,type:f,key:m,ref:u!==void 0?u:null,props:s}}return d.Fragment=i,d.jsx=l,d.jsxs=l,d}var R={};var q;function se(){return q||(q=1,process.env.NODE_ENV!=="production"&&(function(){function a(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ne?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case X:return"Profiler";case z:return"StrictMode";case K:return"Suspense";case ee:return"SuspenseList";case te:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case J:return"Portal";case Z:return e.displayName||"Context";case B:return(e._context.displayName||"Context")+".Consumer";case Q:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case re:return r=e.displayName||null,r!==null?r:a(e.type)||"Memo";case h:r=e._payload,e=e._init;try{return a(e(r))}catch{}}return null}function i(e){return""+e}function l(e){try{i(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),i(e)}}function f(e){if(e===T)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===h)return"<...>";try{var r=a(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function u(){var e=O.A;return e===null?null:e.getOwner()}function s(){return Error("react-stack-top-frame")}function m(e){if(j.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function _(e,r){function t(){Y||(Y=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function G(){var e=a(this.type);return I[e]||(I[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function H(e,r,t,n,E,S){var o=t.ref;return e={$$typeof:C,type:e,key:r,props:t,_owner:n},(o!==void 0?o:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:G}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:E}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:S}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function P(e,r,t,n,E,S){var o=r.children;if(o!==void 0)if(n)if(oe(o)){for(n=0;n<o.length;n++)y(o[n]);Object.freeze&&Object.freeze(o)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else y(o);if(j.call(r,"key")){o=a(e);var c=Object.keys(r).filter(function(ae){return ae!=="key"});n=0<c.length?"{key: someKey, "+c.join(": ..., ")+": ...}":"{key: someKey}",$[o+n]||(c=0<c.length?"{"+c.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
+ let props = %s;
3
+ <%s {...props} />
4
+ React keys must be passed directly to JSX without using spread:
5
+ let props = %s;
6
+ <%s key={someKey} {...props} />`,n,o,c,o),$[o+n]=!0)}if(o=null,t!==void 0&&(l(t),o=""+t),m(r)&&(l(r.key),o=""+r.key),"key"in r){t={};for(var A in r)A!=="key"&&(t[A]=r[A])}else t=r;return o&&_(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),H(e,o,t,u(),E,S)}function y(e){w(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===h&&(e._payload.status==="fulfilled"?w(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function w(e){return typeof e=="object"&&e!==null&&e.$$typeof===C}var p=g,C=Symbol.for("react.transitional.element"),J=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),X=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),Z=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),re=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),ne=Symbol.for("react.client.reference"),O=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=Object.prototype.hasOwnProperty,oe=Array.isArray,k=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(e){return e()}};var Y,I={},D=p.react_stack_bottom_frame.bind(p,s)(),U=k(f(s)),$={};R.Fragment=T,R.jsx=function(e,r,t){var n=1e4>O.recentlyCreatedOwnerStacks++;return P(e,r,t,!1,n?Error("react-stack-top-frame"):D,n?k(f(e)):U)},R.jsxs=function(e,r,t){var n=1e4>O.recentlyCreatedOwnerStacks++;return P(e,r,t,!0,n?Error("react-stack-top-frame"):D,n?k(f(e)):U)}})()),R}var F;function ie(){return F||(F=1,process.env.NODE_ENV==="production"?v.exports=ue():v.exports=se()),v.exports}var le=ie(),b={exports:{}},N={};var M;function ce(){if(M)return N;M=1;var a=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return N.c=function(i){return a.H.useMemoCache(i)},N}var x={};var W;function fe(){return W||(W=1,process.env.NODE_ENV!=="production"&&(function(){var a=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;x.c=function(i){var l=a.H;return l===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
7
+ 1. You might have mismatching versions of React and the renderer (such as React DOM)
8
+ 2. You might be breaking the Rules of Hooks
9
+ 3. You might have more than one copy of React in the same app
10
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),l.useMemoCache(i)}})()),x}var V;function me(){return V||(V=1,process.env.NODE_ENV==="production"?b.exports=ce():b.exports=fe()),b.exports}var _e=me();exports.compilerRuntimeExports=_e;exports.jsxRuntimeExports=le;
@@ -1,33 +1,32 @@
1
- import "./index-BRlTlK6a.mjs";
2
1
  import g from "react";
3
2
  var v = { exports: {} }, d = {};
4
- var F;
3
+ var $;
5
4
  function ue() {
6
- if (F) return d;
7
- F = 1;
8
- var t = /* @__PURE__ */ Symbol.for("react.transitional.element"), u = /* @__PURE__ */ Symbol.for("react.fragment");
9
- function s(c, i, l) {
5
+ if ($) return d;
6
+ $ = 1;
7
+ var a = /* @__PURE__ */ Symbol.for("react.transitional.element"), i = /* @__PURE__ */ Symbol.for("react.fragment");
8
+ function l(f, u, s) {
10
9
  var m = null;
11
- if (l !== void 0 && (m = "" + l), i.key !== void 0 && (m = "" + i.key), "key" in i) {
12
- l = {};
13
- for (var _ in i)
14
- _ !== "key" && (l[_] = i[_]);
15
- } else l = i;
16
- return i = l.ref, {
17
- $$typeof: t,
18
- type: c,
10
+ if (s !== void 0 && (m = "" + s), u.key !== void 0 && (m = "" + u.key), "key" in u) {
11
+ s = {};
12
+ for (var _ in u)
13
+ _ !== "key" && (s[_] = u[_]);
14
+ } else s = u;
15
+ return u = s.ref, {
16
+ $$typeof: a,
17
+ type: f,
19
18
  key: m,
20
- ref: i !== void 0 ? i : null,
21
- props: l
19
+ ref: u !== void 0 ? u : null,
20
+ props: s
22
21
  };
23
22
  }
24
- return d.Fragment = u, d.jsx = s, d.jsxs = s, d;
23
+ return d.Fragment = i, d.jsx = l, d.jsxs = l, d;
25
24
  }
26
25
  var R = {};
27
- var L;
26
+ var F;
28
27
  function se() {
29
- return L || (L = 1, process.env.NODE_ENV !== "production" && (function() {
30
- function t(e) {
28
+ return F || (F = 1, process.env.NODE_ENV !== "production" && (function() {
29
+ function a(e) {
31
30
  if (e == null) return null;
32
31
  if (typeof e == "function")
33
32
  return e.$$typeof === ne ? null : e.displayName || e.name || null;
@@ -37,7 +36,7 @@ function se() {
37
36
  return "Fragment";
38
37
  case X:
39
38
  return "Profiler";
40
- case V:
39
+ case z:
41
40
  return "StrictMode";
42
41
  case K:
43
42
  return "Suspense";
@@ -50,7 +49,7 @@ function se() {
50
49
  switch (typeof e.tag == "number" && console.error(
51
50
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
52
51
  ), e.$$typeof) {
53
- case z:
52
+ case J:
54
53
  return "Portal";
55
54
  case Z:
56
55
  return e.displayName || "Context";
@@ -60,52 +59,52 @@ function se() {
60
59
  var r = e.render;
61
60
  return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
62
61
  case re:
63
- return r = e.displayName || null, r !== null ? r : t(e.type) || "Memo";
62
+ return r = e.displayName || null, r !== null ? r : a(e.type) || "Memo";
64
63
  case h:
65
64
  r = e._payload, e = e._init;
66
65
  try {
67
- return t(e(r));
66
+ return a(e(r));
68
67
  } catch {
69
68
  }
70
69
  }
71
70
  return null;
72
71
  }
73
- function u(e) {
72
+ function i(e) {
74
73
  return "" + e;
75
74
  }
76
- function s(e) {
75
+ function l(e) {
77
76
  try {
78
- u(e);
77
+ i(e);
79
78
  var r = !1;
80
79
  } catch {
81
80
  r = !0;
82
81
  }
83
82
  if (r) {
84
83
  r = console;
85
- var n = r.error, o = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
86
- return n.call(
84
+ var t = r.error, n = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
85
+ return t.call(
87
86
  r,
88
87
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
89
- o
90
- ), u(e);
88
+ n
89
+ ), i(e);
91
90
  }
92
91
  }
93
- function c(e) {
92
+ function f(e) {
94
93
  if (e === T) return "<>";
95
94
  if (typeof e == "object" && e !== null && e.$$typeof === h)
96
95
  return "<...>";
97
96
  try {
98
- var r = t(e);
97
+ var r = a(e);
99
98
  return r ? "<" + r + ">" : "<...>";
100
99
  } catch {
101
100
  return "<...>";
102
101
  }
103
102
  }
104
- function i() {
103
+ function u() {
105
104
  var e = O.A;
106
105
  return e === null ? null : e.getOwner();
107
106
  }
108
- function l() {
107
+ function s() {
109
108
  return Error("react-stack-top-frame");
110
109
  }
111
110
  function m(e) {
@@ -116,34 +115,34 @@ function se() {
116
115
  return e.key !== void 0;
117
116
  }
118
117
  function _(e, r) {
119
- function n() {
118
+ function t() {
120
119
  Y || (Y = !0, console.error(
121
120
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
122
121
  r
123
122
  ));
124
123
  }
125
- n.isReactWarning = !0, Object.defineProperty(e, "key", {
126
- get: n,
124
+ t.isReactWarning = !0, Object.defineProperty(e, "key", {
125
+ get: t,
127
126
  configurable: !0
128
127
  });
129
128
  }
130
- function H() {
131
- var e = t(this.type);
129
+ function G() {
130
+ var e = a(this.type);
132
131
  return I[e] || (I[e] = !0, console.error(
133
132
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
134
133
  )), e = this.props.ref, e !== void 0 ? e : null;
135
134
  }
136
- function J(e, r, n, o, E, S) {
137
- var a = n.ref;
135
+ function H(e, r, t, n, E, S) {
136
+ var o = t.ref;
138
137
  return e = {
139
138
  $$typeof: C,
140
139
  type: e,
141
140
  key: r,
142
- props: n,
143
- _owner: o
144
- }, (a !== void 0 ? a : null) !== null ? Object.defineProperty(e, "ref", {
141
+ props: t,
142
+ _owner: n
143
+ }, (o !== void 0 ? o : null) !== null ? Object.defineProperty(e, "ref", {
145
144
  enumerable: !1,
146
- get: H
145
+ get: G
147
146
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
148
147
  configurable: !1,
149
148
  enumerable: !1,
@@ -166,50 +165,50 @@ function se() {
166
165
  value: S
167
166
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
168
167
  }
169
- function P(e, r, n, o, E, S) {
170
- var a = r.children;
171
- if (a !== void 0)
172
- if (o)
173
- if (oe(a)) {
174
- for (o = 0; o < a.length; o++)
175
- y(a[o]);
176
- Object.freeze && Object.freeze(a);
168
+ function P(e, r, t, n, E, S) {
169
+ var o = r.children;
170
+ if (o !== void 0)
171
+ if (n)
172
+ if (oe(o)) {
173
+ for (n = 0; n < o.length; n++)
174
+ y(o[n]);
175
+ Object.freeze && Object.freeze(o);
177
176
  } else
178
177
  console.error(
179
178
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
180
179
  );
181
- else y(a);
180
+ else y(o);
182
181
  if (j.call(r, "key")) {
183
- a = t(e);
184
- var f = Object.keys(r).filter(function(ae) {
182
+ o = a(e);
183
+ var c = Object.keys(r).filter(function(ae) {
185
184
  return ae !== "key";
186
185
  });
187
- o = 0 < f.length ? "{key: someKey, " + f.join(": ..., ") + ": ...}" : "{key: someKey}", U[a + o] || (f = 0 < f.length ? "{" + f.join(": ..., ") + ": ...}" : "{}", console.error(
186
+ n = 0 < c.length ? "{key: someKey, " + c.join(": ..., ") + ": ...}" : "{key: someKey}", L[o + n] || (c = 0 < c.length ? "{" + c.join(": ..., ") + ": ...}" : "{}", console.error(
188
187
  `A props object containing a "key" prop is being spread into JSX:
189
188
  let props = %s;
190
189
  <%s {...props} />
191
190
  React keys must be passed directly to JSX without using spread:
192
191
  let props = %s;
193
192
  <%s key={someKey} {...props} />`,
193
+ n,
194
194
  o,
195
- a,
196
- f,
197
- a
198
- ), U[a + o] = !0);
195
+ c,
196
+ o
197
+ ), L[o + n] = !0);
199
198
  }
200
- if (a = null, n !== void 0 && (s(n), a = "" + n), m(r) && (s(r.key), a = "" + r.key), "key" in r) {
201
- n = {};
199
+ if (o = null, t !== void 0 && (l(t), o = "" + t), m(r) && (l(r.key), o = "" + r.key), "key" in r) {
200
+ t = {};
202
201
  for (var A in r)
203
- A !== "key" && (n[A] = r[A]);
204
- } else n = r;
205
- return a && _(
206
- n,
202
+ A !== "key" && (t[A] = r[A]);
203
+ } else t = r;
204
+ return o && _(
205
+ t,
207
206
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
208
- ), J(
207
+ ), H(
209
208
  e,
210
- a,
211
- n,
212
- i(),
209
+ o,
210
+ t,
211
+ u(),
213
212
  E,
214
213
  S
215
214
  );
@@ -220,7 +219,7 @@ React keys must be passed directly to JSX without using spread:
220
219
  function w(e) {
221
220
  return typeof e == "object" && e !== null && e.$$typeof === C;
222
221
  }
223
- var p = g, C = /* @__PURE__ */ Symbol.for("react.transitional.element"), z = /* @__PURE__ */ Symbol.for("react.portal"), T = /* @__PURE__ */ Symbol.for("react.fragment"), V = /* @__PURE__ */ Symbol.for("react.strict_mode"), X = /* @__PURE__ */ Symbol.for("react.profiler"), B = /* @__PURE__ */ Symbol.for("react.consumer"), Z = /* @__PURE__ */ Symbol.for("react.context"), Q = /* @__PURE__ */ Symbol.for("react.forward_ref"), K = /* @__PURE__ */ Symbol.for("react.suspense"), ee = /* @__PURE__ */ Symbol.for("react.suspense_list"), re = /* @__PURE__ */ Symbol.for("react.memo"), h = /* @__PURE__ */ Symbol.for("react.lazy"), te = /* @__PURE__ */ Symbol.for("react.activity"), ne = /* @__PURE__ */ Symbol.for("react.client.reference"), O = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, j = Object.prototype.hasOwnProperty, oe = Array.isArray, k = console.createTask ? console.createTask : function() {
222
+ var p = g, C = /* @__PURE__ */ Symbol.for("react.transitional.element"), J = /* @__PURE__ */ Symbol.for("react.portal"), T = /* @__PURE__ */ Symbol.for("react.fragment"), z = /* @__PURE__ */ Symbol.for("react.strict_mode"), X = /* @__PURE__ */ Symbol.for("react.profiler"), B = /* @__PURE__ */ Symbol.for("react.consumer"), Z = /* @__PURE__ */ Symbol.for("react.context"), Q = /* @__PURE__ */ Symbol.for("react.forward_ref"), K = /* @__PURE__ */ Symbol.for("react.suspense"), ee = /* @__PURE__ */ Symbol.for("react.suspense_list"), re = /* @__PURE__ */ Symbol.for("react.memo"), h = /* @__PURE__ */ Symbol.for("react.lazy"), te = /* @__PURE__ */ Symbol.for("react.activity"), ne = /* @__PURE__ */ Symbol.for("react.client.reference"), O = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, j = Object.prototype.hasOwnProperty, oe = Array.isArray, k = console.createTask ? console.createTask : function() {
224
223
  return null;
225
224
  };
226
225
  p = {
@@ -230,82 +229,68 @@ React keys must be passed directly to JSX without using spread:
230
229
  };
231
230
  var Y, I = {}, D = p.react_stack_bottom_frame.bind(
232
231
  p,
233
- l
234
- )(), M = k(c(l)), U = {};
235
- R.Fragment = T, R.jsx = function(e, r, n) {
236
- var o = 1e4 > O.recentlyCreatedOwnerStacks++;
232
+ s
233
+ )(), U = k(f(s)), L = {};
234
+ R.Fragment = T, R.jsx = function(e, r, t) {
235
+ var n = 1e4 > O.recentlyCreatedOwnerStacks++;
237
236
  return P(
238
237
  e,
239
238
  r,
240
- n,
239
+ t,
241
240
  !1,
242
- o ? Error("react-stack-top-frame") : D,
243
- o ? k(c(e)) : M
241
+ n ? Error("react-stack-top-frame") : D,
242
+ n ? k(f(e)) : U
244
243
  );
245
- }, R.jsxs = function(e, r, n) {
246
- var o = 1e4 > O.recentlyCreatedOwnerStacks++;
244
+ }, R.jsxs = function(e, r, t) {
245
+ var n = 1e4 > O.recentlyCreatedOwnerStacks++;
247
246
  return P(
248
247
  e,
249
248
  r,
250
- n,
249
+ t,
251
250
  !0,
252
- o ? Error("react-stack-top-frame") : D,
253
- o ? k(c(e)) : M
251
+ n ? Error("react-stack-top-frame") : D,
252
+ n ? k(f(e)) : U
254
253
  );
255
254
  };
256
255
  })()), R;
257
256
  }
258
- var $;
257
+ var M;
259
258
  function ie() {
260
- return $ || ($ = 1, process.env.NODE_ENV === "production" ? v.exports = ue() : v.exports = se()), v.exports;
259
+ return M || (M = 1, process.env.NODE_ENV === "production" ? v.exports = ue() : v.exports = se()), v.exports;
261
260
  }
262
- var Re = ie(), b = { exports: {} }, N = {};
261
+ var _e = ie(), b = { exports: {} }, N = {};
263
262
  var q;
264
263
  function le() {
265
264
  if (q) return N;
266
265
  q = 1;
267
- var t = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
268
- return N.c = function(u) {
269
- return t.H.useMemoCache(u);
266
+ var a = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
267
+ return N.c = function(i) {
268
+ return a.H.useMemoCache(i);
270
269
  }, N;
271
270
  }
272
271
  var x = {};
273
272
  var W;
274
273
  function ce() {
275
274
  return W || (W = 1, process.env.NODE_ENV !== "production" && (function() {
276
- var t = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
277
- x.c = function(u) {
278
- var s = t.H;
279
- return s === null && console.error(
275
+ var a = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
276
+ x.c = function(i) {
277
+ var l = a.H;
278
+ return l === null && console.error(
280
279
  `Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
281
280
  1. You might have mismatching versions of React and the renderer (such as React DOM)
282
281
  2. You might be breaking the Rules of Hooks
283
282
  3. You might have more than one copy of React in the same app
284
283
  See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`
285
- ), s.useMemoCache(u);
284
+ ), l.useMemoCache(i);
286
285
  };
287
286
  })()), x;
288
287
  }
289
- var G;
288
+ var V;
290
289
  function fe() {
291
- return G || (G = 1, process.env.NODE_ENV === "production" ? b.exports = le() : b.exports = ce()), b.exports;
290
+ return V || (V = 1, process.env.NODE_ENV === "production" ? b.exports = le() : b.exports = ce()), b.exports;
292
291
  }
293
- var pe = fe();
294
- const me = (t) => t == null ? 0 : typeof t == "number" ? t : "value" in t ? t.value : "min" in t ? t.min : 0, Ee = (t) => {
295
- const u = t.map((i) => me(i.price)), s = Math.min(...u), c = Math.max(...u);
296
- return s === void 0 || c === void 0 ? {
297
- value: 0
298
- } : s === c ? {
299
- value: s
300
- } : {
301
- min: s,
302
- max: c
303
- };
304
- }, ve = (t, u) => typeof t == "function" ? t(u) : t;
292
+ var de = fe();
305
293
  export {
306
- Ee as a,
307
- pe as c,
308
- me as g,
309
- Re as j,
310
- ve as r
294
+ de as c,
295
+ _e as j
311
296
  };
@@ -0,0 +1 @@
1
+ "use strict";require("./index-CgxqXyHf.js");require("./compiler-runtime-oPPev21o.js");require("react");const i=r=>r==null?0:typeof r=="number"?r:"value"in r?r.value:"min"in r?r.min:0,o=r=>{const t=r.map(u=>i(u.price)),n=Math.min(...t),e=Math.max(...t);return n===void 0||e===void 0?{value:0}:n===e?{value:n}:{min:n,max:e}},s=(r,t)=>typeof r=="function"?r(t):r;exports.getPrice=i;exports.getProductPriceFromVariants=o;exports.renderChildren=s;
@@ -0,0 +1,19 @@
1
+ import "./index-BRlTlK6a.mjs";
2
+ import "./compiler-runtime-qHgugrLy.mjs";
3
+ import "react";
4
+ const e = (t) => t == null ? 0 : typeof t == "number" ? t : "value" in t ? t.value : "min" in t ? t.min : 0, f = (t) => {
5
+ const r = t.map((o) => e(o.price)), n = Math.min(...r), i = Math.max(...r);
6
+ return n === void 0 || i === void 0 ? {
7
+ value: 0
8
+ } : n === i ? {
9
+ value: n
10
+ } : {
11
+ min: n,
12
+ max: i
13
+ };
14
+ }, a = (t, r) => typeof t == "function" ? t(r) : t;
15
+ export {
16
+ f as a,
17
+ e as g,
18
+ a as r
19
+ };
@@ -0,0 +1,14 @@
1
+ import { ErrorResult, Order } from '@haus-storefront-react/shared-types';
2
+ import { VendurePluginConfig } from '../plugin-config';
3
+ import { AddPurchaseOrderPaymentToOrderInput, PurchaseOrderPaymentPluginRequests } from './vendure-purchase-order-payment-plugin.types';
4
+ declare module '@haus-storefront-react/core' {
5
+ interface IEcomSDK {
6
+ addPurchaseOrderPaymentToOrder?: (input: AddPurchaseOrderPaymentToOrderInput) => Promise<Order | ErrorResult>;
7
+ }
8
+ }
9
+ /**
10
+ * Extend Vendure SDK with Purchase Order payment mutation request.
11
+ */
12
+ export declare const VendurePurchaseOrderPaymentPlugin: VendurePluginConfig<Record<string, never>, PurchaseOrderPaymentPluginRequests, {
13
+ [x: string]: any;
14
+ }, import('@haus-storefront-react/shared-types').IGraphQLSDK>;
@@ -0,0 +1,7 @@
1
+ import { ErrorResult, Order } from '@haus-storefront-react/shared-types';
2
+ export interface AddPurchaseOrderPaymentToOrderInput {
3
+ poNumber: string;
4
+ }
5
+ export type PurchaseOrderPaymentPluginRequests = {
6
+ addPurchaseOrderPaymentToOrder: (input: AddPurchaseOrderPaymentToOrderInput) => Promise<Order | ErrorResult>;
7
+ };
@@ -0,0 +1,3 @@
1
+ export * from '../configs/vendure-purchase-order-payment-plugin';
2
+ export * from '../configs/vendure-purchase-order-payment-plugin.types';
3
+ export * from '../hooks/use-add-purchase-order-payment';
@@ -0,0 +1,13 @@
1
+ import { ErrorResult, Order } from '@haus-storefront-react/shared-types';
2
+ import { AddPurchaseOrderPaymentToOrderInput } from '../configs/vendure-purchase-order-payment-plugin.types';
3
+ type AddPurchaseOrderPaymentResult = Order | ErrorResult;
4
+ export declare const useAddPurchaseOrderPayment: () => {
5
+ addPurchaseOrderPayment: (input: AddPurchaseOrderPaymentToOrderInput) => Promise<AddPurchaseOrderPaymentResult>;
6
+ error: Error | null;
7
+ isLoading: boolean;
8
+ isError: boolean;
9
+ isSuccess: boolean;
10
+ data: AddPurchaseOrderPaymentResult | undefined;
11
+ reset: () => void;
12
+ };
13
+ export {};
package/lib/types.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './configs/vendure-badge-plugin.types';
2
2
  export * from './configs/vendure-product-popularity-plugin.types';
3
+ export * from './configs/vendure-purchase-order-payment-plugin.types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haus-storefront-react/vendure-plugin-configs",
3
- "version": "1.0.4-next.2",
3
+ "version": "1.0.4-next.4",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -33,6 +33,12 @@
33
33
  "require": "./packagesize.js",
34
34
  "default": "./packagesize"
35
35
  },
36
+ "./purchase-order-payment": {
37
+ "types": "./lib/exports/purchase-order-payment.d.ts",
38
+ "import": "./purchase-order-payment.mjs",
39
+ "require": "./purchase-order-payment.js",
40
+ "default": "./purchase-order-payment"
41
+ },
36
42
  "./product-popularity": {
37
43
  "types": "./lib/exports/product-popularity.d.ts",
38
44
  "import": "./product-popularity.mjs",
@@ -41,9 +47,10 @@
41
47
  }
42
48
  },
43
49
  "dependencies": {
44
- "@haus-storefront-react/common-utils": "1.0.4-next.2",
45
- "@haus-storefront-react/core": "1.0.4-next.2",
46
- "@haus-storefront-react/shared-types": "1.0.4-next.2"
50
+ "@haus-storefront-react/common-utils": "1.0.4-next.4",
51
+ "@haus-storefront-react/core": "1.0.4-next.4",
52
+ "@haus-storefront-react/providers": "1.0.4-next.4",
53
+ "@haus-storefront-react/shared-types": "1.0.4-next.4"
47
54
  },
48
55
  "publishConfig": {
49
56
  "access": "restricted"
@@ -0,0 +1,2 @@
1
+ export * from './lib/exports/purchase-order-payment'
2
+ export {}
@@ -0,0 +1,27 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("./useSdk-YXpk8Wsi.js"),S=require("./index-CgxqXyHf.js"),T=require("./compiler-runtime-oPPev21o.js");require("react");const k=require("@tanstack/react-query");var p=(e=>(e.ACTIVE_ORDER="activeOrder",e.ACTIVE_CHANNEL="activeChannel",e.ACTIVE_CUSTOMER="activeCustomer",e.ACTIVE_CUSTOMER_ORDERS="activeCustomerOrders",e.AVAILABLE_COUNTRIES="availableCountries",e.FACETS="facets",e.ORDER_BY_CODE="orderByCode",e.ORDER_STATES="orderStates",e.PRODUCT="product",e.PAYMENT_METHODS="paymentMethods",e.SEARCH="search",e.SEARCH_FIELD="searchField",e.SHIPPING_METHODS="shippingMethods",e))(p||{}),N=(e=>(e.AlreadyLoggedInError="ALREADY_LOGGED_IN_ERROR",e.CouponCodeExpiredError="COUPON_CODE_EXPIRED_ERROR",e.CouponCodeInvalidError="COUPON_CODE_INVALID_ERROR",e.CouponCodeLimitError="COUPON_CODE_LIMIT_ERROR",e.EmailAddressConflictError="EMAIL_ADDRESS_CONFLICT_ERROR",e.GuestCheckoutError="GUEST_CHECKOUT_ERROR",e.IdentifierChangeTokenExpiredError="IDENTIFIER_CHANGE_TOKEN_EXPIRED_ERROR",e.IdentifierChangeTokenInvalidError="IDENTIFIER_CHANGE_TOKEN_INVALID_ERROR",e.IneligiblePaymentMethodError="INELIGIBLE_PAYMENT_METHOD_ERROR",e.IneligibleShippingMethodError="INELIGIBLE_SHIPPING_METHOD_ERROR",e.InsufficientStockError="INSUFFICIENT_STOCK_ERROR",e.InvalidCredentialsError="INVALID_CREDENTIALS_ERROR",e.MissingPasswordError="MISSING_PASSWORD_ERROR",e.NativeAuthStrategyError="NATIVE_AUTH_STRATEGY_ERROR",e.NegativeQuantityError="NEGATIVE_QUANTITY_ERROR",e.NotVerifiedError="NOT_VERIFIED_ERROR",e.NoActiveOrderError="NO_ACTIVE_ORDER_ERROR",e.OrderLimitError="ORDER_LIMIT_ERROR",e.OrderModificationError="ORDER_MODIFICATION_ERROR",e.OrderPaymentStateError="ORDER_PAYMENT_STATE_ERROR",e.OrderStateTransitionError="ORDER_STATE_TRANSITION_ERROR",e.PasswordAlreadySetError="PASSWORD_ALREADY_SET_ERROR",e.PasswordResetTokenExpiredError="PASSWORD_RESET_TOKEN_EXPIRED_ERROR",e.PasswordResetTokenInvalidError="PASSWORD_RESET_TOKEN_INVALID_ERROR",e.PasswordValidationError="PASSWORD_VALIDATION_ERROR",e.PaymentDeclinedError="PAYMENT_DECLINED_ERROR",e.PaymentFailedError="PAYMENT_FAILED_ERROR",e.UnknownError="UNKNOWN_ERROR",e.VerificationTokenExpiredError="VERIFICATION_TOKEN_EXPIRED_ERROR",e.VerificationTokenInvalidError="VERIFICATION_TOKEN_INVALID_ERROR",e))(N||{});const _=(e,i)=>{const d=k.useQueryClient();return k.useMutation(e,d)},g={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"EligiblePaymentMethods"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PaymentMethodQuote"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"code"}}]}}]},P={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"login"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"email"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"password"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"rememberMe"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"login"},arguments:[{kind:"Argument",name:{kind:"Name",value:"username"},value:{kind:"Variable",name:{kind:"Name",value:"email"}}},{kind:"Argument",name:{kind:"Name",value:"password"},value:{kind:"Variable",name:{kind:"Name",value:"password"}}},{kind:"Argument",name:{kind:"Name",value:"rememberMe"},value:{kind:"Variable",name:{kind:"Name",value:"rememberMe"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CurrentUser"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"identifier"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorResult"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"errorCode"}},{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},I={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"logout"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"logout"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"success"}}]}}]}}]},v={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]},y={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"transitionOrderToState"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"transitionOrderToState"},arguments:[{kind:"Argument",name:{kind:"Name",value:"state"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorResult"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"errorCode"}},{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},D={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"nextOrderStates"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nextOrderStates"}}]}}]},A={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"EligiblePaymentMethods"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"eligiblePaymentMethods"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"EligiblePaymentMethods"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"EligiblePaymentMethods"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PaymentMethodQuote"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"code"}}]}}]},h={"\n mutation login($email: String!, $password: String!, $rememberMe: Boolean) {\n login(username: $email, password: $password, rememberMe: $rememberMe) {\n __typename\n ... on CurrentUser {\n id\n identifier\n }\n ... on ErrorResult {\n errorCode\n message\n }\n }\n }\n":P,"\n mutation logout {\n logout {\n success\n }\n }\n":I,"\n query me {\n me {\n id\n }\n }\n":v,"\n mutation transitionOrderToState($input: String!) {\n transitionOrderToState(state: $input) {\n ... on ErrorResult {\n errorCode\n message\n }\n }\n }\n":y,"\n query nextOrderStates {\n nextOrderStates\n }\n":D,"\n fragment EligiblePaymentMethods on PaymentMethodQuote {\n id\n name\n description\n code\n }\n":g,"\n query EligiblePaymentMethods {\n eligiblePaymentMethods {\n ...EligiblePaymentMethods\n }\n }\n":A};function m(e){return h[e]??{}}const f=["id","code","active","createdAt","updatedAt","orderPlacedAt","state","totalQuantity","currencyCode","total","totalWithTax","subTotal","subTotalWithTax","shipping",{discounts:["type","description","amount","amountWithTax"]},{promotions:["couponCode","description","name","enabled","perCustomerUsageLimit","perCustomerUsageLimit"]},"couponCodes","shippingWithTax","currencyCode",{taxSummary:["description","taxRate","taxBase","taxTotal"]},{customer:["id","firstName","lastName","emailAddress","phoneNumber"]},{billingAddress:["fullName","streetLine1","streetLine2","company","city","province","postalCode","countryCode","phoneNumber"]},{shippingAddress:["fullName","streetLine1","streetLine2","company","city","province","postalCode","countryCode","phoneNumber"]},{shippingLines:[{shippingMethod:["id","name"]},"priceWithTax","price"]},{lines:["id","unitPrice","unitPriceWithTax","linePrice","linePriceWithTax","discountedUnitPrice","discountedUnitPriceWithTax","discountedLinePrice","discountedLinePriceWithTax","proratedUnitPrice","proratedUnitPriceWithTax","proratedLinePrice","proratedLinePriceWithTax","quantity",{featuredAsset:["id","preview"]},{productVariant:["id","name","sku","price","priceWithTax","currencyCode",{facetValues:[{facet:["id","code","name"]},"id","code","name"]},{featuredAsset:["id","preview"]},{product:["id","slug","description",{facetValues:[{facet:["id","code","name"]},"id","code","name"],collections:["id","name","slug","parentId",{breadcrumbs:["id","name","slug"]}]}]}]}]},{payments:["id","state","method","amount","metadata"]},{history:[{items:["id","type","data","createdAt","updatedAt"]},"totalItems"]}];m(`
2
+ mutation transitionOrderToState($input: String!) {
3
+ transitionOrderToState(state: $input) {
4
+ ... on ErrorResult {
5
+ errorCode
6
+ message
7
+ }
8
+ }
9
+ }
10
+ `);m(`
11
+ query nextOrderStates {
12
+ nextOrderStates
13
+ }
14
+ `);m(`
15
+ fragment EligiblePaymentMethods on PaymentMethodQuote {
16
+ id
17
+ name
18
+ description
19
+ code
20
+ }
21
+ `);m(`
22
+ query EligiblePaymentMethods {
23
+ eligiblePaymentMethods {
24
+ ...EligiblePaymentMethods
25
+ }
26
+ }
27
+ `);const E=new S.VendurePluginConfig({name:"purchase-order-payment",queryUpdates:{}});E.setRequests({addPurchaseOrderPaymentToOrder:async e=>{try{return(await E.getSdk().createRequest({operation:"addPurchaseOrderPaymentToOrder",fields:[{operation:"Order",fields:f,fragment:!0},{operation:"ErrorResult",fields:["errorCode","message"],fragment:!0}],variables:{input:{type:"AddPurchaseOrderPaymentToOrderInput!"}}},{input:e},!0)).data}catch(i){return{errorCode:N.UnknownError,message:i instanceof Error?i.message:"Unknown payment error"}}}});const b=()=>{const e=T.compilerRuntimeExports.c(17),i=O.useSdk(),d=k.useQueryClient();let t;e[0]!==i?(t=async r=>{const R=i.addPurchaseOrderPaymentToOrder;if(typeof R!="function")throw new Error("addPurchaseOrderPaymentToOrder is not available. Ensure VendurePurchaseOrderPaymentPlugin is registered.");return R(r)},e[0]=i,e[1]=t):t=e[1];let a;e[2]!==d?(a=r=>{r&&!("errorCode"in r)&&d.invalidateQueries({queryKey:[p.ACTIVE_ORDER]})},e[2]=d,e[3]=a):a=e[3];let o;e[4]!==t||e[5]!==a?(o={mutationFn:t,onSuccess:a},e[4]=t,e[5]=a,e[6]=o):o=e[6];const n=_(o);let s;e[7]!==n?(s=async r=>n.mutateAsync(r),e[7]=n,e[8]=s):s=e[8];const u=s,c=n.error;let l;return e[9]!==u||e[10]!==n.data||e[11]!==n.isError||e[12]!==n.isPending||e[13]!==n.isSuccess||e[14]!==n.reset||e[15]!==c?(l={addPurchaseOrderPayment:u,error:c,isLoading:n.isPending,isError:n.isError,isSuccess:n.isSuccess,data:n.data,reset:n.reset},e[9]=u,e[10]=n.data,e[11]=n.isError,e[12]=n.isPending,e[13]=n.isSuccess,e[14]=n.reset,e[15]=c,e[16]=l):l=e[16],l};exports.VendurePurchaseOrderPaymentPlugin=E;exports.useAddPurchaseOrderPayment=b;