@haus-storefront-react/discounts 0.0.52-3 → 0.0.52-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/CHANGELOG.md +10 -0
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## 0.0.52-3 (2025-12-12)
|
|
2
|
+
|
|
3
|
+
### 🧱 Updated Dependencies
|
|
4
|
+
|
|
5
|
+
- Updated store/hooks to 0.0.52-3
|
|
6
|
+
- Updated core to 0.0.52-3
|
|
7
|
+
- Updated common/utils to 0.0.52-3
|
|
8
|
+
- Updated common/ui to 0.0.52-3
|
|
9
|
+
- Updated shared/types to 0.0.52-3
|
|
10
|
+
|
|
1
11
|
## 0.0.52-2 (2025-12-12)
|
|
2
12
|
|
|
3
13
|
### 🧱 Updated Dependencies
|
package/index.js
CHANGED
|
@@ -31,7 +31,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
31
31
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(r){return r instanceof this?r:new this(r)}static concat(r,...i){const a=new this(r);return i.forEach(u=>a.set(u)),a}static accessor(r){const a=(this[dl]=this[dl]={accessors:{}}).accessors,u=this.prototype;function l(f){const h=lr(f);a[h]||(Uy(u,f),a[h]=!0)}return S.isArray(r)?r.forEach(l):l(r),this}};$e.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);S.reduceDescriptors($e.prototype,({value:o},r)=>{let i=r[0].toUpperCase()+r.slice(1);return{get:()=>o,set(a){this[i]=a}}});S.freezeMethods($e);function os(o,r){const i=this||gr,a=r||i,u=$e.from(a.headers);let l=a.data;return S.forEach(o,function(h){l=h.call(i,l,u.normalize(),r?r.status:void 0)}),u.normalize(),l}function tc(o){return!!(o&&o.__CANCEL__)}function Bn(o,r,i){V.call(this,o??"canceled",V.ERR_CANCELED,r,i),this.name="CanceledError"}S.inherits(Bn,V,{__CANCEL__:!0});function nc(o,r,i){const a=i.config.validateStatus;!i.status||!a||a(i.status)?o(i):r(new V("Request failed with status code "+i.status,[V.ERR_BAD_REQUEST,V.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function $y(o){const r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(o);return r&&r[1]||""}function Wy(o,r){o=o||10;const i=new Array(o),a=new Array(o);let u=0,l=0,f;return r=r!==void 0?r:1e3,function(g){const v=Date.now(),y=a[l];f||(f=v),i[u]=g,a[u]=v;let A=l,D=0;for(;A!==u;)D+=i[A++],A=A%o;if(u=(u+1)%o,u===l&&(l=(l+1)%o),v-f<r)return;const L=y&&v-y;return L?Math.round(D*1e3/L):void 0}}function Hy(o,r){let i=0,a=1e3/r,u,l;const f=(v,y=Date.now())=>{i=y,u=null,l&&(clearTimeout(l),l=null),o(...v)};return[(...v)=>{const y=Date.now(),A=y-i;A>=a?f(v,y):(u=v,l||(l=setTimeout(()=>{l=null,f(u)},a-A)))},()=>u&&f(u)]}const Ai=(o,r,i=3)=>{let a=0;const u=Wy(50,250);return Hy(l=>{const f=l.loaded,h=l.lengthComputable?l.total:void 0,g=f-a,v=u(g),y=f<=h;a=f;const A={loaded:f,total:h,progress:h?f/h:void 0,bytes:g,rate:v||void 0,estimated:v&&h&&y?(h-f)/v:void 0,event:l,lengthComputable:h!=null,[r?"download":"upload"]:!0};o(A)},i)},pl=(o,r)=>{const i=o!=null;return[a=>r[0]({lengthComputable:i,total:o,loaded:a}),r[1]]},hl=o=>(...r)=>S.asap(()=>o(...r)),jy=Te.hasStandardBrowserEnv?((o,r)=>i=>(i=new URL(i,Te.origin),o.protocol===i.protocol&&o.host===i.host&&(r||o.port===i.port)))(new URL(Te.origin),Te.navigator&&/(msie|trident)/i.test(Te.navigator.userAgent)):()=>!0,Vy=Te.hasStandardBrowserEnv?{write(o,r,i,a,u,l,f){if(typeof document>"u")return;const h=[`${o}=${encodeURIComponent(r)}`];S.isNumber(i)&&h.push(`expires=${new Date(i).toUTCString()}`),S.isString(a)&&h.push(`path=${a}`),S.isString(u)&&h.push(`domain=${u}`),l===!0&&h.push("secure"),S.isString(f)&&h.push(`SameSite=${f}`),document.cookie=h.join("; ")},read(o){if(typeof document>"u")return null;const r=document.cookie.match(new RegExp("(?:^|; )"+o+"=([^;]*)"));return r?decodeURIComponent(r[1]):null},remove(o){this.write(o,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Gy(o){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o)}function zy(o,r){return r?o.replace(/\/?\/$/,"")+"/"+r.replace(/^\/+/,""):o}function rc(o,r,i){let a=!Gy(r);return o&&(a||i==!1)?zy(o,r):r}const gl=o=>o instanceof $e?{...o}:o;function cn(o,r){r=r||{};const i={};function a(v,y,A,D){return S.isPlainObject(v)&&S.isPlainObject(y)?S.merge.call({caseless:D},v,y):S.isPlainObject(y)?S.merge({},y):S.isArray(y)?y.slice():y}function u(v,y,A,D){if(S.isUndefined(y)){if(!S.isUndefined(v))return a(void 0,v,A,D)}else return a(v,y,A,D)}function l(v,y){if(!S.isUndefined(y))return a(void 0,y)}function f(v,y){if(S.isUndefined(y)){if(!S.isUndefined(v))return a(void 0,v)}else return a(void 0,y)}function h(v,y,A){if(A in r)return a(v,y);if(A in o)return a(void 0,v)}const g={url:l,method:l,data:l,baseURL:f,transformRequest:f,transformResponse:f,paramsSerializer:f,timeout:f,timeoutMessage:f,withCredentials:f,withXSRFToken:f,adapter:f,responseType:f,xsrfCookieName:f,xsrfHeaderName:f,onUploadProgress:f,onDownloadProgress:f,decompress:f,maxContentLength:f,maxBodyLength:f,beforeRedirect:f,transport:f,httpAgent:f,httpsAgent:f,cancelToken:f,socketPath:f,responseEncoding:f,validateStatus:h,headers:(v,y,A)=>u(gl(v),gl(y),A,!0)};return S.forEach(Object.keys({...o,...r}),function(y){const A=g[y]||u,D=A(o[y],r[y],y);S.isUndefined(D)&&A!==h||(i[y]=D)}),i}const ic=o=>{const r=cn({},o);let{data:i,withXSRFToken:a,xsrfHeaderName:u,xsrfCookieName:l,headers:f,auth:h}=r;if(r.headers=f=$e.from(f),r.url=Xl(rc(r.baseURL,r.url,r.allowAbsoluteUrls),o.params,o.paramsSerializer),h&&f.set("Authorization","Basic "+btoa((h.username||"")+":"+(h.password?unescape(encodeURIComponent(h.password)):""))),S.isFormData(i)){if(Te.hasStandardBrowserEnv||Te.hasStandardBrowserWebWorkerEnv)f.setContentType(void 0);else if(S.isFunction(i.getHeaders)){const g=i.getHeaders(),v=["content-type","content-length"];Object.entries(g).forEach(([y,A])=>{v.includes(y.toLowerCase())&&f.set(y,A)})}}if(Te.hasStandardBrowserEnv&&(a&&S.isFunction(a)&&(a=a(r)),a||a!==!1&&jy(r.url))){const g=u&&l&&Vy.read(l);g&&f.set(u,g)}return r},Ky=typeof XMLHttpRequest<"u",Yy=Ky&&function(o){return new Promise(function(i,a){const u=ic(o);let l=u.data;const f=$e.from(u.headers).normalize();let{responseType:h,onUploadProgress:g,onDownloadProgress:v}=u,y,A,D,L,x;function I(){L&&L(),x&&x(),u.cancelToken&&u.cancelToken.unsubscribe(y),u.signal&&u.signal.removeEventListener("abort",y)}let P=new XMLHttpRequest;P.open(u.method.toUpperCase(),u.url,!0),P.timeout=u.timeout;function q(){if(!P)return;const z=$e.from("getAllResponseHeaders"in P&&P.getAllResponseHeaders()),ce={data:!h||h==="text"||h==="json"?P.responseText:P.response,status:P.status,statusText:P.statusText,headers:z,config:o,request:P};nc(function(ue){i(ue),I()},function(ue){a(ue),I()},ce),P=null}"onloadend"in P?P.onloadend=q:P.onreadystatechange=function(){!P||P.readyState!==4||P.status===0&&!(P.responseURL&&P.responseURL.indexOf("file:")===0)||setTimeout(q)},P.onabort=function(){P&&(a(new V("Request aborted",V.ECONNABORTED,o,P)),P=null)},P.onerror=function(pe){const ce=pe&&pe.message?pe.message:"Network Error",Oe=new V(ce,V.ERR_NETWORK,o,P);Oe.event=pe||null,a(Oe),P=null},P.ontimeout=function(){let pe=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded";const ce=u.transitional||Zl;u.timeoutErrorMessage&&(pe=u.timeoutErrorMessage),a(new V(pe,ce.clarifyTimeoutError?V.ETIMEDOUT:V.ECONNABORTED,o,P)),P=null},l===void 0&&f.setContentType(null),"setRequestHeader"in P&&S.forEach(f.toJSON(),function(pe,ce){P.setRequestHeader(ce,pe)}),S.isUndefined(u.withCredentials)||(P.withCredentials=!!u.withCredentials),h&&h!=="json"&&(P.responseType=u.responseType),v&&([D,x]=Ai(v,!0),P.addEventListener("progress",D)),g&&P.upload&&([A,L]=Ai(g),P.upload.addEventListener("progress",A),P.upload.addEventListener("loadend",L)),(u.cancelToken||u.signal)&&(y=z=>{P&&(a(!z||z.type?new Bn(null,o,P):z),P.abort(),P=null)},u.cancelToken&&u.cancelToken.subscribe(y),u.signal&&(u.signal.aborted?y():u.signal.addEventListener("abort",y)));const te=$y(u.url);if(te&&Te.protocols.indexOf(te)===-1){a(new V("Unsupported protocol "+te+":",V.ERR_BAD_REQUEST,o));return}P.send(l||null)})},Jy=(o,r)=>{const{length:i}=o=o?o.filter(Boolean):[];if(r||i){let a=new AbortController,u;const l=function(v){if(!u){u=!0,h();const y=v instanceof Error?v:this.reason;a.abort(y instanceof V?y:new Bn(y instanceof Error?y.message:y))}};let f=r&&setTimeout(()=>{f=null,l(new V(`timeout ${r} of ms exceeded`,V.ETIMEDOUT))},r);const h=()=>{o&&(f&&clearTimeout(f),f=null,o.forEach(v=>{v.unsubscribe?v.unsubscribe(l):v.removeEventListener("abort",l)}),o=null)};o.forEach(v=>v.addEventListener("abort",l));const{signal:g}=a;return g.unsubscribe=()=>S.asap(h),g}},Qy=function*(o,r){let i=o.byteLength;if(i<r){yield o;return}let a=0,u;for(;a<i;)u=a+r,yield o.slice(a,u),a=u},Xy=async function*(o,r){for await(const i of Zy(o))yield*Qy(i,r)},Zy=async function*(o){if(o[Symbol.asyncIterator]){yield*o;return}const r=o.getReader();try{for(;;){const{done:i,value:a}=await r.read();if(i)break;yield a}}finally{await r.cancel()}},ml=(o,r,i,a)=>{const u=Xy(o,r);let l=0,f,h=g=>{f||(f=!0,a&&a(g))};return new ReadableStream({async pull(g){try{const{done:v,value:y}=await u.next();if(v){h(),g.close();return}let A=y.byteLength;if(i){let D=l+=A;i(D)}g.enqueue(new Uint8Array(y))}catch(v){throw h(v),v}},cancel(g){return h(g),u.return()}},{highWaterMark:2})},_l=64*1024,{isFunction:pi}=S,e0=(({Request:o,Response:r})=>({Request:o,Response:r}))(S.global),{ReadableStream:vl,TextEncoder:yl}=S.global,bl=(o,...r)=>{try{return!!o(...r)}catch{return!1}},t0=o=>{o=S.merge.call({skipUndefined:!0},e0,o);const{fetch:r,Request:i,Response:a}=o,u=r?pi(r):typeof fetch=="function",l=pi(i),f=pi(a);if(!u)return!1;const h=u&&pi(vl),g=u&&(typeof yl=="function"?(x=>I=>x.encode(I))(new yl):async x=>new Uint8Array(await new i(x).arrayBuffer())),v=l&&h&&bl(()=>{let x=!1;const I=new i(Te.origin,{body:new vl,method:"POST",get duplex(){return x=!0,"half"}}).headers.has("Content-Type");return x&&!I}),y=f&&h&&bl(()=>S.isReadableStream(new a("").body)),A={stream:y&&(x=>x.body)};u&&["text","arrayBuffer","blob","formData","stream"].forEach(x=>{!A[x]&&(A[x]=(I,P)=>{let q=I&&I[x];if(q)return q.call(I);throw new V(`Response type '${x}' is not supported`,V.ERR_NOT_SUPPORT,P)})});const D=async x=>{if(x==null)return 0;if(S.isBlob(x))return x.size;if(S.isSpecCompliantForm(x))return(await new i(Te.origin,{method:"POST",body:x}).arrayBuffer()).byteLength;if(S.isArrayBufferView(x)||S.isArrayBuffer(x))return x.byteLength;if(S.isURLSearchParams(x)&&(x=x+""),S.isString(x))return(await g(x)).byteLength},L=async(x,I)=>{const P=S.toFiniteNumber(x.getContentLength());return P??D(I)};return async x=>{let{url:I,method:P,data:q,signal:te,cancelToken:z,timeout:pe,onDownloadProgress:ce,onUploadProgress:Oe,responseType:ue,headers:st,withCredentials:Ye="same-origin",fetchOptions:hn}=ic(x),gn=r||fetch;ue=ue?(ue+"").toLowerCase():"text";let mt=Jy([te,z&&z.toAbortSignal()],pe),_t=null;const Je=mt&&mt.unsubscribe&&(()=>{mt.unsubscribe()});let Lt;try{if(Oe&&v&&P!=="get"&&P!=="head"&&(Lt=await L(st,q))!==0){let R=new i(I,{method:"POST",body:q,duplex:"half"}),W;if(S.isFormData(q)&&(W=R.headers.get("content-type"))&&st.setContentType(W),R.body){const[re,oe]=pl(Lt,Ai(hl(Oe)));q=ml(R.body,_l,re,oe)}}S.isString(Ye)||(Ye=Ye?"include":"omit");const Ne=l&&"credentials"in i.prototype,We={...hn,signal:mt,method:P.toUpperCase(),headers:st.normalize().toJSON(),body:q,duplex:"half",credentials:Ne?Ye:void 0};_t=l&&new i(I,We);let ve=await(l?gn(_t,hn):gn(I,We));const Jt=y&&(ue==="stream"||ue==="response");if(y&&(ce||Jt&&Je)){const R={};["status","statusText","headers"].forEach(Fe=>{R[Fe]=ve[Fe]});const W=S.toFiniteNumber(ve.headers.get("content-length")),[re,oe]=ce&&pl(W,Ai(hl(ce),!0))||[];ve=new a(ml(ve.body,_l,re,()=>{oe&&oe(),Je&&Je()}),R)}ue=ue||"text";let At=await A[S.findKey(A,ue)||"text"](ve,x);return!Jt&&Je&&Je(),await new Promise((R,W)=>{nc(R,W,{data:At,headers:$e.from(ve.headers),status:ve.status,statusText:ve.statusText,config:x,request:_t})})}catch(Ne){throw Je&&Je(),Ne&&Ne.name==="TypeError"&&/Load failed|fetch/i.test(Ne.message)?Object.assign(new V("Network Error",V.ERR_NETWORK,x,_t),{cause:Ne.cause||Ne}):V.from(Ne,Ne&&Ne.code,x,_t)}}},n0=new Map,oc=o=>{let r=o&&o.env||{};const{fetch:i,Request:a,Response:u}=r,l=[a,u,i];let f=l.length,h=f,g,v,y=n0;for(;h--;)g=l[h],v=y.get(g),v===void 0&&y.set(g,v=h?new Map:t0(r)),y=v;return v};oc();const ys={http:yy,xhr:Yy,fetch:{get:oc}};S.forEach(ys,(o,r)=>{if(o){try{Object.defineProperty(o,"name",{value:r})}catch{}Object.defineProperty(o,"adapterName",{value:r})}});const wl=o=>`- ${o}`,r0=o=>S.isFunction(o)||o===null||o===!1;function i0(o,r){o=S.isArray(o)?o:[o];const{length:i}=o;let a,u;const l={};for(let f=0;f<i;f++){a=o[f];let h;if(u=a,!r0(a)&&(u=ys[(h=String(a)).toLowerCase()],u===void 0))throw new V(`Unknown adapter '${h}'`);if(u&&(S.isFunction(u)||(u=u.get(r))))break;l[h||"#"+f]=u}if(!u){const f=Object.entries(l).map(([g,v])=>`adapter ${g} `+(v===!1?"is not supported by the environment":"is not available in the build"));let h=i?f.length>1?`since :
|
|
32
32
|
`+f.map(wl).join(`
|
|
33
33
|
`):" "+wl(f[0]):"as no adapter specified";throw new V("There is no suitable adapter to dispatch the request "+h,"ERR_NOT_SUPPORT")}return u}const sc={getAdapter:i0,adapters:ys};function ss(o){if(o.cancelToken&&o.cancelToken.throwIfRequested(),o.signal&&o.signal.aborted)throw new Bn(null,o)}function Al(o){return ss(o),o.headers=$e.from(o.headers),o.data=os.call(o,o.transformRequest),["post","put","patch"].indexOf(o.method)!==-1&&o.headers.setContentType("application/x-www-form-urlencoded",!1),sc.getAdapter(o.adapter||gr.adapter,o)(o).then(function(a){return ss(o),a.data=os.call(o,o.transformResponse,a),a.headers=$e.from(a.headers),a},function(a){return tc(a)||(ss(o),a&&a.response&&(a.response.data=os.call(o,o.transformResponse,a.response),a.response.headers=$e.from(a.response.headers))),Promise.reject(a)})}const ac="1.13.2",Ri={};["object","boolean","number","function","string","symbol"].forEach((o,r)=>{Ri[o]=function(a){return typeof a===o||"a"+(r<1?"n ":" ")+o}});const Sl={};Ri.transitional=function(r,i,a){function u(l,f){return"[Axios v"+ac+"] Transitional option '"+l+"'"+f+(a?". "+a:"")}return(l,f,h)=>{if(r===!1)throw new V(u(f," has been removed"+(i?" in "+i:"")),V.ERR_DEPRECATED);return i&&!Sl[f]&&(Sl[f]=!0,console.warn(u(f," has been deprecated since v"+i+" and will be removed in the near future"))),r?r(l,f,h):!0}};Ri.spelling=function(r){return(i,a)=>(console.warn(`${a} is likely a misspelling of ${r}`),!0)};function o0(o,r,i){if(typeof o!="object")throw new V("options must be an object",V.ERR_BAD_OPTION_VALUE);const a=Object.keys(o);let u=a.length;for(;u-- >0;){const l=a[u],f=r[l];if(f){const h=o[l],g=h===void 0||f(h,l,o);if(g!==!0)throw new V("option "+l+" must be "+g,V.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new V("Unknown option "+l,V.ERR_BAD_OPTION)}}const wi={assertOptions:o0,validators:Ri},wt=wi.validators;let un=class{constructor(r){this.defaults=r||{},this.interceptors={request:new fl,response:new fl}}async request(r,i){try{return await this._request(r,i)}catch(a){if(a instanceof Error){let u={};Error.captureStackTrace?Error.captureStackTrace(u):u=new Error;const l=u.stack?u.stack.replace(/^.+\n/,""):"";try{a.stack?l&&!String(a.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(a.stack+=`
|
|
34
|
-
`+l):a.stack=l}catch{}}throw a}}_request(r,i){typeof r=="string"?(i=i||{},i.url=r):i=r||{},i=cn(this.defaults,i);const{transitional:a,paramsSerializer:u,headers:l}=i;a!==void 0&&wi.assertOptions(a,{silentJSONParsing:wt.transitional(wt.boolean),forcedJSONParsing:wt.transitional(wt.boolean),clarifyTimeoutError:wt.transitional(wt.boolean)},!1),u!=null&&(S.isFunction(u)?i.paramsSerializer={serialize:u}:wi.assertOptions(u,{encode:wt.function,serialize:wt.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),wi.assertOptions(i,{baseUrl:wt.spelling("baseURL"),withXsrfToken:wt.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let f=l&&S.merge(l.common,l[i.method]);l&&S.forEach(["delete","get","head","post","put","patch","common"],x=>{delete l[x]}),i.headers=$e.concat(f,l);const h=[];let g=!0;this.interceptors.request.forEach(function(I){typeof I.runWhen=="function"&&I.runWhen(i)===!1||(g=g&&I.synchronous,h.unshift(I.fulfilled,I.rejected))});const v=[];this.interceptors.response.forEach(function(I){v.push(I.fulfilled,I.rejected)});let y,A=0,D;if(!g){const x=[Al.bind(this),void 0];for(x.unshift(...h),x.push(...v),D=x.length,y=Promise.resolve(i);A<D;)y=y.then(x[A++],x[A++]);return y}D=h.length;let L=i;for(;A<D;){const x=h[A++],I=h[A++];try{L=x(L)}catch(P){I.call(this,P);break}}try{y=Al.call(this,L)}catch(x){return Promise.reject(x)}for(A=0,D=v.length;A<D;)y=y.then(v[A++],v[A++]);return y}getUri(r){r=cn(this.defaults,r);const i=rc(r.baseURL,r.url,r.allowAbsoluteUrls);return Xl(i,r.params,r.paramsSerializer)}};S.forEach(["delete","get","head","options"],function(r){un.prototype[r]=function(i,a){return this.request(cn(a||{},{method:r,url:i,data:(a||{}).data}))}});S.forEach(["post","put","patch"],function(r){function i(a){return function(l,f,h){return this.request(cn(h||{},{method:r,headers:a?{"Content-Type":"multipart/form-data"}:{},url:l,data:f}))}}un.prototype[r]=i(),un.prototype[r+"Form"]=i(!0)});let s0=class uc{constructor(r){if(typeof r!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(l){i=l});const a=this;this.promise.then(u=>{if(!a._listeners)return;let l=a._listeners.length;for(;l-- >0;)a._listeners[l](u);a._listeners=null}),this.promise.then=u=>{let l;const f=new Promise(h=>{a.subscribe(h),l=h}).then(u);return f.cancel=function(){a.unsubscribe(l)},f},r(function(l,f,h){a.reason||(a.reason=new Bn(l,f,h),i(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]}unsubscribe(r){if(!this._listeners)return;const i=this._listeners.indexOf(r);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const r=new AbortController,i=a=>{r.abort(a)};return this.subscribe(i),r.signal.unsubscribe=()=>this.unsubscribe(i),r.signal}static source(){let r;return{token:new uc(function(u){r=u}),cancel:r}}};function a0(o){return function(i){return o.apply(null,i)}}function u0(o){return S.isObject(o)&&o.isAxiosError===!0}const fs={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(fs).forEach(([o,r])=>{fs[r]=o});function lc(o){const r=new un(o),i=Ul(un.prototype.request,r);return S.extend(i,un.prototype,r,{allOwnKeys:!0}),S.extend(i,r,null,{allOwnKeys:!0}),i.create=function(u){return lc(cn(o,u))},i}const de=lc(gr);de.Axios=un;de.CanceledError=Bn;de.CancelToken=s0;de.isCancel=tc;de.VERSION=ac;de.toFormData=Ci;de.AxiosError=V;de.Cancel=de.CanceledError;de.all=function(r){return Promise.all(r)};de.spread=a0;de.isAxiosError=u0;de.mergeConfig=cn;de.AxiosHeaders=$e;de.formToJSON=o=>ec(S.isHTMLForm(o)?new FormData(o):o);de.getAdapter=sc.getAdapter;de.HttpStatusCode=fs;de.default=de;const{Axios:B0,AxiosError:El,CanceledError:U0,isCancel:$0,CancelToken:W0,VERSION:H0,all:j0,Cancel:V0,isAxiosError:G0,spread:z0,toFormData:K0,AxiosHeaders:Y0,HttpStatusCode:J0,formToJSON:Q0,getAdapter:X0,mergeConfig:Z0}=de,l0=o=>Ml.some(o,r=>r&&r.errorCode!==void 0)||o?.errorCode!==void 0,xl=typeof window<"u";class cc{constructor(r={}){this.requestStrategy=async(i,a)=>{await a(i)},this.responseStrategy=async(i,a)=>{await a(i)},this.defaultBaseUrl=r.defaultBaseUrl,this.useGlobalSingletons=r.useGlobalSingletons??!1,this.globalQueryClientKey=r.globalQueryClientKey||"__STORE_QUERY_CLIENT__",this.globalAxiosKey=r.globalAxiosKey||"__STORE_API_CLIENT__",this.createQueryClientImpl=r.createQueryClient||(()=>new ln.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!0,refetchOnMount:!1,retry:3,staleTime:1e3*60*5}}})),this.createAxiosImpl=r.createAxios||(i=>{const a=de.create({baseURL:i||this.defaultBaseUrl,withCredentials:!0});return this.configureAxios(a)})}getQueryClient(r){if(xl){if(r?.client)return r.client;if(this.useGlobalSingletons){const i=globalThis,a=i[this.globalQueryClientKey];if(a)return a;const u=this.createQueryClientImpl();return i[this.globalQueryClientKey]=u,u}return this.queryClientSingleton||(this.queryClientSingleton=this.createQueryClientImpl()),this.queryClientSingleton}return this.createQueryClientImpl()}getAxiosInstance(){if(xl){if(this.useGlobalSingletons){const r=globalThis,i=r[this.globalAxiosKey];if(i)return i;const a=this.configureAxios(this.createAxiosImpl());return r[this.globalAxiosKey]=a,a}return this.axiosSingleton||(this.axiosSingleton=this.configureAxios(this.createAxiosImpl())),this.axiosSingleton}return this.configureAxios(this.createAxiosImpl())}setDefaultApiBaseUrl(r){this.defaultBaseUrl=r}async setApiUrl(r){const i=this.getAxiosInstance();i.defaults.baseURL=r}setRequestInterceptorStrategy(r){this.requestStrategy=r,this.axiosSingleton&&(this.axiosSingleton=this.configureAxios(this.axiosSingleton))}setResponseInterceptorStrategy(r){this.responseStrategy=r,this.axiosSingleton&&(this.axiosSingleton=this.configureAxios(this.axiosSingleton))}getAxiosProxy(){return new Proxy({},{get:(r,i)=>{const a=this.getAxiosInstance(),u=Reflect.get(a,i);return typeof u=="function"?u.bind(a):u},set:(r,i,a)=>Reflect.set(this.getAxiosInstance(),i,a)})}getQueryClientProxy(){return new Proxy({},{get:(r,i)=>{const a=this.getQueryClient(),u=Reflect.get(a,i);return typeof u=="function"?u.bind(a):u},set:(r,i,a)=>Reflect.set(this.getQueryClient(),i,a)})}configureAxios(r){return r.interceptors.request.clear(),r.interceptors.response.clear(),r.interceptors.request.use(async i=>{const a=async u=>{};return await this.requestStrategy(i,a),i}),r.interceptors.response.use(async i=>{const a=async u=>{};return await this.responseStrategy(i,a),i}),r}}const fc="auth_token",c0="lang",f0="currencyCode",Ti=new cc({createQueryClient:()=>new ln.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!0,refetchOnMount:!1,retry:3,staleTime:1e3*60*5}}}),createAxios:o=>de.create({baseURL:o,withCredentials:!0,headers:{"vendure-token":""}}),useGlobalSingletons:!0,globalQueryClientKey:"__STORE_QUERY_CLIENT__",globalAxiosKey:"__STORE_API_CLIENT__"});Ti.setRequestInterceptorStrategy(async(o,r)=>{const i=await Vt.getItem(fc),a=await Vt.getItem("channelToken"),u=await Vt.getItem(f0),l=await Vt.getItem(c0);i&&(o.headers.Authorization=`Bearer ${i}`),a&&(o.headers["vendure-token"]=a),o.params=o.params||{},u&&(o.params.currencyCode=u),l&&(o.params.languageCode=l),await r(o)});Ti.setResponseInterceptorStrategy(async(o,r)=>{const i=o.headers["vendure-auth-token"];if(i&&Vt.setItem(fc,i),l0(o.data.data)){const a=Object.values(o.data.data)[0],u=new El(a.errorCode);return u.response=o,u.config=o.config,Promise.reject(u)}if(o.data.errors?.length>0){const a=o.data.errors[0],u=new El(a.message);return u.response=o,u.config=o.config,Promise.reject(u)}await r(o)});Ti.getAxiosProxy();Ti.getQueryClientProxy();const d0=globalThis.__STORE_SDK_CONTEXT__||=zt.createContext(void 0),bs=()=>{const r=zt.useContext(d0)?.sdk;return r||console.error("You must wrap your component in a <DataProvider>"),r?.sdkType==="dummy"||r?.sdkType==="vendure",r};var ht={},hi={},gi={},mi={},Cl;function mr(){if(Cl)return mi;Cl=1,Object.defineProperty(mi,"__esModule",{value:!0});var o;return function(r){r.Mutation="mutation",r.Query="query",r.Subscription="subscription"}(o||(o={})),mi.default=o,mi}var In={},cr={},Rl;function p0(){if(Rl)return cr;Rl=1,Object.defineProperty(cr,"__esModule",{value:!0}),cr.isNestedField=void 0;function o(r){return typeof r=="object"&&r.hasOwnProperty("operation")&&r.hasOwnProperty("variables")&&r.hasOwnProperty("fields")||typeof r=="object"&&r.hasOwnProperty("operation")&&r.hasOwnProperty("fragment")&&r.hasOwnProperty("fields")}return cr.isNestedField=o,cr}var Tl;function _r(){if(Tl)return In;Tl=1;var o=In&&In.__assign||function(){return o=Object.assign||function(a){for(var u,l=1,f=arguments.length;l<f;l++){u=arguments[l];for(var h in u)Object.prototype.hasOwnProperty.call(u,h)&&(a[h]=u[h])}return a},o.apply(this,arguments)};Object.defineProperty(In,"__esModule",{value:!0});var r=p0(),i=function(){function a(){}return a.resolveVariables=function(u){for(var l={},f=0,h=u;f<h.length;f++){var g=h[f],v=g.variables,y=g.fields;l=o(o(o({},l),v),y&&a.getNestedVariables(y)||{})}return l},a.queryDataNameAndArgumentMap=function(u){return u&&Object.keys(u).length?"(".concat(Object.entries(u).reduce(function(l,f,h){var g=f[0],v=f[1];return"".concat(l).concat(h!==0?", ":"").concat(v&&v.name?v.name:g,": $").concat(g)},""),")"):""},a.queryFieldsMap=function(u){var l=this;return u?u.map(function(f){if((0,r.isNestedField)(f))return a.queryNestedFieldMap(f);if(typeof f=="object"){var h="";return Object.entries(f).forEach(function(g,v,y){var A=g[0],D=g[1];h+="".concat(A," ").concat(D.length>0?"{ "+l.queryFieldsMap(D)+" }":""),v<y.length-1&&(h+=", ")}),h}else return"".concat(f)}).join(", "):""},a.operationOrAlias=function(u){return typeof u=="string"?u:"".concat(u.alias,": ").concat(u.name)},a.isFragment=function(u){var l;return(l=u?.fragment===!0)!==null&&l!==void 0?l:!1},a.operationOrFragment=function(u){return a.isFragment(u)?u.operation:a.operationOrAlias(u.operation)},a.getFragment=function(u){return a.isFragment(u)?"... on ":""},a.queryNestedFieldMap=function(u){return"".concat(a.getFragment(u)).concat(a.operationOrFragment(u)," ").concat(this.isFragment(u)?"":this.queryDataNameAndArgumentMap(u.variables)," ").concat(u.fields.length>0?"{ "+this.queryFieldsMap(u.fields)+" }":"")},a.queryVariablesMap=function(u,l){var f={},h=function(g){g&&Object.keys(g).map(function(v){f[v]=typeof g[v]=="object"?g[v].value:g[v]})};return h(u),l&&typeof l=="object"&&h(a.getNestedVariables(l)),f},a.getNestedVariables=function(u){var l={};function f(h){return h?.forEach(function(g){if((0,r.isNestedField)(g))l=o(o(o({},g.variables),l),g.fields&&f(g.fields));else if(typeof g=="object")for(var v=0,y=Object.entries(g);v<y.length;v++){var A=y[v],D=A[1];f(D)}}),l}return f(u),l},a.queryDataType=function(u){var l="String",f=typeof u=="object"?u.value:u;if(u?.type!=null)l=u.type;else{var h=Array.isArray(f)?f[0]:f;switch(typeof h){case"object":l="Object";break;case"boolean":l="Boolean";break;case"number":l=h%1===0?"Int":"Float";break}}return typeof u=="object"&&(u.list===!0?l="[".concat(l,"]"):Array.isArray(u.list)&&(l="[".concat(l).concat(u.list[0]?"!":"","]")),u.required&&(l+="!")),l},a}();return In.default=i,In}var Ol;function h0(){if(Ol)return gi;Ol=1,Object.defineProperty(gi,"__esModule",{value:!0});var o=mr(),r=_r(),i=function(){function a(u){Array.isArray(u)?this.variables=r.default.resolveVariables(u):(this.variables=u.variables,this.fields=u.fields,this.operation=u.operation)}return a.prototype.mutationBuilder=function(){return this.operationWrapperTemplate(this.variables,this.operationTemplate(this.operation))},a.prototype.mutationsBuilder=function(u){var l=this,f=u.map(function(h){return l.operation=h.operation,l.variables=h.variables,l.fields=h.fields,l.operationTemplate(h.operation)});return this.operationWrapperTemplate(r.default.resolveVariables(u),f.join(`
|
|
34
|
+
`+l):a.stack=l}catch{}}throw a}}_request(r,i){typeof r=="string"?(i=i||{},i.url=r):i=r||{},i=cn(this.defaults,i);const{transitional:a,paramsSerializer:u,headers:l}=i;a!==void 0&&wi.assertOptions(a,{silentJSONParsing:wt.transitional(wt.boolean),forcedJSONParsing:wt.transitional(wt.boolean),clarifyTimeoutError:wt.transitional(wt.boolean)},!1),u!=null&&(S.isFunction(u)?i.paramsSerializer={serialize:u}:wi.assertOptions(u,{encode:wt.function,serialize:wt.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),wi.assertOptions(i,{baseUrl:wt.spelling("baseURL"),withXsrfToken:wt.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let f=l&&S.merge(l.common,l[i.method]);l&&S.forEach(["delete","get","head","post","put","patch","common"],x=>{delete l[x]}),i.headers=$e.concat(f,l);const h=[];let g=!0;this.interceptors.request.forEach(function(I){typeof I.runWhen=="function"&&I.runWhen(i)===!1||(g=g&&I.synchronous,h.unshift(I.fulfilled,I.rejected))});const v=[];this.interceptors.response.forEach(function(I){v.push(I.fulfilled,I.rejected)});let y,A=0,D;if(!g){const x=[Al.bind(this),void 0];for(x.unshift(...h),x.push(...v),D=x.length,y=Promise.resolve(i);A<D;)y=y.then(x[A++],x[A++]);return y}D=h.length;let L=i;for(;A<D;){const x=h[A++],I=h[A++];try{L=x(L)}catch(P){I.call(this,P);break}}try{y=Al.call(this,L)}catch(x){return Promise.reject(x)}for(A=0,D=v.length;A<D;)y=y.then(v[A++],v[A++]);return y}getUri(r){r=cn(this.defaults,r);const i=rc(r.baseURL,r.url,r.allowAbsoluteUrls);return Xl(i,r.params,r.paramsSerializer)}};S.forEach(["delete","get","head","options"],function(r){un.prototype[r]=function(i,a){return this.request(cn(a||{},{method:r,url:i,data:(a||{}).data}))}});S.forEach(["post","put","patch"],function(r){function i(a){return function(l,f,h){return this.request(cn(h||{},{method:r,headers:a?{"Content-Type":"multipart/form-data"}:{},url:l,data:f}))}}un.prototype[r]=i(),un.prototype[r+"Form"]=i(!0)});let s0=class uc{constructor(r){if(typeof r!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(l){i=l});const a=this;this.promise.then(u=>{if(!a._listeners)return;let l=a._listeners.length;for(;l-- >0;)a._listeners[l](u);a._listeners=null}),this.promise.then=u=>{let l;const f=new Promise(h=>{a.subscribe(h),l=h}).then(u);return f.cancel=function(){a.unsubscribe(l)},f},r(function(l,f,h){a.reason||(a.reason=new Bn(l,f,h),i(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]}unsubscribe(r){if(!this._listeners)return;const i=this._listeners.indexOf(r);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const r=new AbortController,i=a=>{r.abort(a)};return this.subscribe(i),r.signal.unsubscribe=()=>this.unsubscribe(i),r.signal}static source(){let r;return{token:new uc(function(u){r=u}),cancel:r}}};function a0(o){return function(i){return o.apply(null,i)}}function u0(o){return S.isObject(o)&&o.isAxiosError===!0}const fs={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(fs).forEach(([o,r])=>{fs[r]=o});function lc(o){const r=new un(o),i=Ul(un.prototype.request,r);return S.extend(i,un.prototype,r,{allOwnKeys:!0}),S.extend(i,r,null,{allOwnKeys:!0}),i.create=function(u){return lc(cn(o,u))},i}const de=lc(gr);de.Axios=un;de.CanceledError=Bn;de.CancelToken=s0;de.isCancel=tc;de.VERSION=ac;de.toFormData=Ci;de.AxiosError=V;de.Cancel=de.CanceledError;de.all=function(r){return Promise.all(r)};de.spread=a0;de.isAxiosError=u0;de.mergeConfig=cn;de.AxiosHeaders=$e;de.formToJSON=o=>ec(S.isHTMLForm(o)?new FormData(o):o);de.getAdapter=sc.getAdapter;de.HttpStatusCode=fs;de.default=de;const{Axios:B0,AxiosError:El,CanceledError:U0,isCancel:$0,CancelToken:W0,VERSION:H0,all:j0,Cancel:V0,isAxiosError:G0,spread:z0,toFormData:K0,AxiosHeaders:Y0,HttpStatusCode:J0,formToJSON:Q0,getAdapter:X0,mergeConfig:Z0}=de,l0=o=>(o&&Ml.some(o,r=>r&&r?.errorCode!==void 0)||o?.errorCode!==void 0)&&o!==void 0,xl=typeof window<"u";class cc{constructor(r={}){this.requestStrategy=async(i,a)=>{await a(i)},this.responseStrategy=async(i,a)=>{await a(i)},this.defaultBaseUrl=r.defaultBaseUrl,this.useGlobalSingletons=r.useGlobalSingletons??!1,this.globalQueryClientKey=r.globalQueryClientKey||"__STORE_QUERY_CLIENT__",this.globalAxiosKey=r.globalAxiosKey||"__STORE_API_CLIENT__",this.createQueryClientImpl=r.createQueryClient||(()=>new ln.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!0,refetchOnMount:!1,retry:3,staleTime:1e3*60*5}}})),this.createAxiosImpl=r.createAxios||(i=>{const a=de.create({baseURL:i||this.defaultBaseUrl,withCredentials:!0});return this.configureAxios(a)})}getQueryClient(r){if(xl){if(r?.client)return r.client;if(this.useGlobalSingletons){const i=globalThis,a=i[this.globalQueryClientKey];if(a)return a;const u=this.createQueryClientImpl();return i[this.globalQueryClientKey]=u,u}return this.queryClientSingleton||(this.queryClientSingleton=this.createQueryClientImpl()),this.queryClientSingleton}return this.createQueryClientImpl()}getAxiosInstance(){if(xl){if(this.useGlobalSingletons){const r=globalThis,i=r[this.globalAxiosKey];if(i)return i;const a=this.configureAxios(this.createAxiosImpl());return r[this.globalAxiosKey]=a,a}return this.axiosSingleton||(this.axiosSingleton=this.configureAxios(this.createAxiosImpl())),this.axiosSingleton}return this.configureAxios(this.createAxiosImpl())}setDefaultApiBaseUrl(r){this.defaultBaseUrl=r}async setApiUrl(r){const i=this.getAxiosInstance();i.defaults.baseURL=r}setRequestInterceptorStrategy(r){this.requestStrategy=r,this.axiosSingleton&&(this.axiosSingleton=this.configureAxios(this.axiosSingleton))}setResponseInterceptorStrategy(r){this.responseStrategy=r,this.axiosSingleton&&(this.axiosSingleton=this.configureAxios(this.axiosSingleton))}getAxiosProxy(){return new Proxy({},{get:(r,i)=>{const a=this.getAxiosInstance(),u=Reflect.get(a,i);return typeof u=="function"?u.bind(a):u},set:(r,i,a)=>Reflect.set(this.getAxiosInstance(),i,a)})}getQueryClientProxy(){return new Proxy({},{get:(r,i)=>{const a=this.getQueryClient(),u=Reflect.get(a,i);return typeof u=="function"?u.bind(a):u},set:(r,i,a)=>Reflect.set(this.getQueryClient(),i,a)})}configureAxios(r){return r.interceptors.request.clear(),r.interceptors.response.clear(),r.interceptors.request.use(async i=>{const a=async u=>{};return await this.requestStrategy(i,a),i}),r.interceptors.response.use(async i=>{const a=async u=>{};return await this.responseStrategy(i,a),i}),r}}const fc="auth_token",c0="lang",f0="currencyCode",Ti=new cc({createQueryClient:()=>new ln.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!0,refetchOnMount:!1,retry:3,staleTime:1e3*60*5}}}),createAxios:o=>de.create({baseURL:o,withCredentials:!0,headers:{"vendure-token":""}}),useGlobalSingletons:!0,globalQueryClientKey:"__STORE_QUERY_CLIENT__",globalAxiosKey:"__STORE_API_CLIENT__"});Ti.setRequestInterceptorStrategy(async(o,r)=>{const i=await Vt.getItem(fc),a=await Vt.getItem("channelToken"),u=await Vt.getItem(f0),l=await Vt.getItem(c0);i&&(o.headers.Authorization=`Bearer ${i}`),a&&(o.headers["vendure-token"]=a),o.params=o.params||{},u&&(o.params.currencyCode=u),l&&(o.params.languageCode=l),await r(o)});Ti.setResponseInterceptorStrategy(async(o,r)=>{const i=o.headers["vendure-auth-token"];if(i&&Vt.setItem(fc,i),l0(o.data.data)){const a=Object.values(o.data.data)[0],u=new El(a.errorCode);return u.response=o,u.config=o.config,Promise.reject(u)}if(o.data.errors?.length>0){const a=o.data.errors[0],u=new El(a.message);return u.response=o,u.config=o.config,Promise.reject(u)}await r(o)});Ti.getAxiosProxy();Ti.getQueryClientProxy();const d0=globalThis.__STORE_SDK_CONTEXT__||=zt.createContext(void 0),bs=()=>{const r=zt.useContext(d0)?.sdk;return r||console.error("You must wrap your component in a <DataProvider>"),r?.sdkType==="dummy"||r?.sdkType==="vendure",r};var ht={},hi={},gi={},mi={},Cl;function mr(){if(Cl)return mi;Cl=1,Object.defineProperty(mi,"__esModule",{value:!0});var o;return function(r){r.Mutation="mutation",r.Query="query",r.Subscription="subscription"}(o||(o={})),mi.default=o,mi}var In={},cr={},Rl;function p0(){if(Rl)return cr;Rl=1,Object.defineProperty(cr,"__esModule",{value:!0}),cr.isNestedField=void 0;function o(r){return typeof r=="object"&&r.hasOwnProperty("operation")&&r.hasOwnProperty("variables")&&r.hasOwnProperty("fields")||typeof r=="object"&&r.hasOwnProperty("operation")&&r.hasOwnProperty("fragment")&&r.hasOwnProperty("fields")}return cr.isNestedField=o,cr}var Tl;function _r(){if(Tl)return In;Tl=1;var o=In&&In.__assign||function(){return o=Object.assign||function(a){for(var u,l=1,f=arguments.length;l<f;l++){u=arguments[l];for(var h in u)Object.prototype.hasOwnProperty.call(u,h)&&(a[h]=u[h])}return a},o.apply(this,arguments)};Object.defineProperty(In,"__esModule",{value:!0});var r=p0(),i=function(){function a(){}return a.resolveVariables=function(u){for(var l={},f=0,h=u;f<h.length;f++){var g=h[f],v=g.variables,y=g.fields;l=o(o(o({},l),v),y&&a.getNestedVariables(y)||{})}return l},a.queryDataNameAndArgumentMap=function(u){return u&&Object.keys(u).length?"(".concat(Object.entries(u).reduce(function(l,f,h){var g=f[0],v=f[1];return"".concat(l).concat(h!==0?", ":"").concat(v&&v.name?v.name:g,": $").concat(g)},""),")"):""},a.queryFieldsMap=function(u){var l=this;return u?u.map(function(f){if((0,r.isNestedField)(f))return a.queryNestedFieldMap(f);if(typeof f=="object"){var h="";return Object.entries(f).forEach(function(g,v,y){var A=g[0],D=g[1];h+="".concat(A," ").concat(D.length>0?"{ "+l.queryFieldsMap(D)+" }":""),v<y.length-1&&(h+=", ")}),h}else return"".concat(f)}).join(", "):""},a.operationOrAlias=function(u){return typeof u=="string"?u:"".concat(u.alias,": ").concat(u.name)},a.isFragment=function(u){var l;return(l=u?.fragment===!0)!==null&&l!==void 0?l:!1},a.operationOrFragment=function(u){return a.isFragment(u)?u.operation:a.operationOrAlias(u.operation)},a.getFragment=function(u){return a.isFragment(u)?"... on ":""},a.queryNestedFieldMap=function(u){return"".concat(a.getFragment(u)).concat(a.operationOrFragment(u)," ").concat(this.isFragment(u)?"":this.queryDataNameAndArgumentMap(u.variables)," ").concat(u.fields.length>0?"{ "+this.queryFieldsMap(u.fields)+" }":"")},a.queryVariablesMap=function(u,l){var f={},h=function(g){g&&Object.keys(g).map(function(v){f[v]=typeof g[v]=="object"?g[v].value:g[v]})};return h(u),l&&typeof l=="object"&&h(a.getNestedVariables(l)),f},a.getNestedVariables=function(u){var l={};function f(h){return h?.forEach(function(g){if((0,r.isNestedField)(g))l=o(o(o({},g.variables),l),g.fields&&f(g.fields));else if(typeof g=="object")for(var v=0,y=Object.entries(g);v<y.length;v++){var A=y[v],D=A[1];f(D)}}),l}return f(u),l},a.queryDataType=function(u){var l="String",f=typeof u=="object"?u.value:u;if(u?.type!=null)l=u.type;else{var h=Array.isArray(f)?f[0]:f;switch(typeof h){case"object":l="Object";break;case"boolean":l="Boolean";break;case"number":l=h%1===0?"Int":"Float";break}}return typeof u=="object"&&(u.list===!0?l="[".concat(l,"]"):Array.isArray(u.list)&&(l="[".concat(l).concat(u.list[0]?"!":"","]")),u.required&&(l+="!")),l},a}();return In.default=i,In}var Ol;function h0(){if(Ol)return gi;Ol=1,Object.defineProperty(gi,"__esModule",{value:!0});var o=mr(),r=_r(),i=function(){function a(u){Array.isArray(u)?this.variables=r.default.resolveVariables(u):(this.variables=u.variables,this.fields=u.fields,this.operation=u.operation)}return a.prototype.mutationBuilder=function(){return this.operationWrapperTemplate(this.variables,this.operationTemplate(this.operation))},a.prototype.mutationsBuilder=function(u){var l=this,f=u.map(function(h){return l.operation=h.operation,l.variables=h.variables,l.fields=h.fields,l.operationTemplate(h.operation)});return this.operationWrapperTemplate(r.default.resolveVariables(u),f.join(`
|
|
35
35
|
`))},a.prototype.queryDataNameAndArgumentMap=function(){return this.variables&&Object.keys(this.variables).length?"(".concat(Object.keys(this.variables).reduce(function(u,l,f){return"".concat(u).concat(f!==0?", ":"").concat(l,": $").concat(l)},""),")"):""},a.prototype.queryDataArgumentAndTypeMap=function(u){return Object.keys(u).length?"(".concat(Object.keys(u).reduce(function(l,f,h){return"".concat(l).concat(h!==0?", ":"","$").concat(f,": ").concat(r.default.queryDataType(u[f]))},""),")"):""},a.prototype.operationWrapperTemplate=function(u,l){var f=typeof this.operation=="string"?this.operation:this.operation.name;return{query:"".concat(o.default.Mutation," ").concat(f.charAt(0).toUpperCase()+f.slice(1)," ").concat(this.queryDataArgumentAndTypeMap(u),` {
|
|
36
36
|
`).concat(l,`
|
|
37
37
|
}`),variables:r.default.queryVariablesMap(u)}},a.prototype.operationTemplate=function(u){var l=typeof u=="string"?u:"".concat(u.alias,": ").concat(u.name);return"".concat(l," ").concat(this.queryDataNameAndArgumentMap(),` {
|
package/index.mjs
CHANGED
|
@@ -6298,7 +6298,7 @@ const {
|
|
|
6298
6298
|
formToJSON: n1,
|
|
6299
6299
|
getAdapter: r1,
|
|
6300
6300
|
mergeConfig: i1
|
|
6301
|
-
} = de, h0 = (o) => Fl.some(o, (r) => r && r
|
|
6301
|
+
} = de, h0 = (o) => (o && Fl.some(o, (r) => r && r?.errorCode !== void 0) || o?.errorCode !== void 0) && o !== void 0, El = typeof window < "u";
|
|
6302
6302
|
class lc {
|
|
6303
6303
|
constructor(r = {}) {
|
|
6304
6304
|
this.requestStrategy = async (i, a) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haus-storefront-react/discounts",
|
|
3
|
-
"version": "0.0.52-
|
|
3
|
+
"version": "0.0.52-4",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@haus-storefront-react/common-ui": "0.0.52-
|
|
15
|
-
"@haus-storefront-react/common-utils": "0.0.52-
|
|
16
|
-
"@haus-storefront-react/core": "0.0.52-
|
|
17
|
-
"@haus-storefront-react/hooks": "0.0.52-
|
|
18
|
-
"@haus-storefront-react/shared-types": "0.0.52-
|
|
14
|
+
"@haus-storefront-react/common-ui": "0.0.52-4",
|
|
15
|
+
"@haus-storefront-react/common-utils": "0.0.52-4",
|
|
16
|
+
"@haus-storefront-react/core": "0.0.52-4",
|
|
17
|
+
"@haus-storefront-react/hooks": "0.0.52-4",
|
|
18
|
+
"@haus-storefront-react/shared-types": "0.0.52-4"
|
|
19
19
|
}
|
|
20
20
|
}
|