@orderingstack/front-hooks 3.7.0 → 3.8.0
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/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +79 -31
- package/dist/index.es.js.map +1 -1
- package/dist/src/useAvailability.d.ts +7 -1
- package/dist/src/useAvailability.d.ts.map +1 -1
- package/dist/src/useCms.d.ts +1 -0
- package/dist/src/useCms.d.ts.map +1 -1
- package/dist/src/utils/timeAvailabilityFilter.d.ts +2 -2
- package/dist/src/utils/timeAvailabilityFilter.d.ts.map +1 -1
- package/dist/src/utils.d.ts +2 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var Y=require("react"),Nt=require("@orderingstack/ordering-core-react"),Rn=require("react-i18next");function Le(e,r){const t=Y.useRef(),[n,a]=Y.useState(null);return Y.useEffect(()=>{t.current=e},[e]),Y.useEffect(()=>{function i(){var s;(s=t.current)==null||s.call(t)}if(r!==null){const s=setInterval(i,r);return a(s),()=>{a(null),clearInterval(s)}}},[r]),()=>{n&&clearInterval(n)}}var X=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Nn=Object.prototype;function Pn(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||Nn;return e===t}var xe=Pn;function Un(e,r){return function(t){return e(r(t))}}var Pt=Un,Mn=Pt,Fn=Mn(Object.keys,Object),Bn=Fn,Hn=xe,Yn=Bn,Gn=Object.prototype,qn=Gn.hasOwnProperty;function Wn(e){if(!Hn(e))return Yn(e);var r=[];for(var t in Object(e))qn.call(e,t)&&t!="constructor"&&r.push(t);return r}var Ut=Wn,Kn=typeof X=="object"&&X&&X.Object===Object&&X,Mt=Kn,Vn=Mt,kn=typeof self=="object"&&self&&self.Object===Object&&self,Jn=Vn||kn||Function("return this")(),K=Jn,zn=K,Zn=zn.Symbol,Re=Zn,Dr=Re,Ft=Object.prototype,Xn=Ft.hasOwnProperty,Qn=Ft.toString,he=Dr?Dr.toStringTag:void 0;function ea(e){var r=Xn.call(e,he),t=e[he];try{e[he]=void 0;var n=!0}catch{}var a=Qn.call(e);return n&&(r?e[he]=t:delete e[he]),a}var ra=ea,ta=Object.prototype,na=ta.toString;function aa(e){return na.call(e)}var ia=aa,jr=Re,sa=ra,oa=ia,ua="[object Null]",fa="[object Undefined]",Lr=jr?jr.toStringTag:void 0;function ca(e){return e==null?e===void 0?fa:ua:Lr&&Lr in Object(e)?sa(e):oa(e)}var Ne=ca;function la(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var $e=la,da=Ne,ha=$e,pa="[object AsyncFunction]",va="[object Function]",ga="[object GeneratorFunction]",$a="[object Proxy]";function ya(e){if(!ha(e))return!1;var r=da(e);return r==va||r==ga||r==pa||r==$a}var Bt=ya,ma=K,ba=ma["__core-js_shared__"],_a=ba,We=_a,xr=function(){var e=/[^.]+$/.exec(We&&We.keys&&We.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Aa(e){return!!xr&&xr in e}var Ea=Aa,Ta=Function.prototype,Oa=Ta.toString;function Sa(e){if(e!=null){try{return Oa.call(e)}catch{}try{return e+""}catch{}}return""}var Ht=Sa,wa=Bt,Ia=Ea,Ca=$e,Da=Ht,ja=/[\\^$.*+?()[\]{}|]/g,La=/^\[object .+?Constructor\]$/,xa=Function.prototype,Ra=Object.prototype,Na=xa.toString,Pa=Ra.hasOwnProperty,Ua=RegExp("^"+Na.call(Pa).replace(ja,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ma(e){if(!Ca(e)||Ia(e))return!1;var r=wa(e)?Ua:La;return r.test(Da(e))}var Fa=Ma;function Ba(e,r){return e==null?void 0:e[r]}var Ha=Ba,Ya=Fa,Ga=Ha;function qa(e,r){var t=Ga(e,r);return Ya(t)?t:void 0}var Q=qa,Wa=Q,Ka=K,Va=Wa(Ka,"DataView"),ka=Va,Ja=Q,za=K,Za=Ja(za,"Map"),lr=Za,Xa=Q,Qa=K,ei=Xa(Qa,"Promise"),ri=ei,ti=Q,ni=K,ai=ti(ni,"Set"),ii=ai,si=Q,oi=K,ui=si(oi,"WeakMap"),fi=ui,Xe=ka,Qe=lr,er=ri,rr=ii,tr=fi,Yt=Ne,ie=Ht,Rr="[object Map]",ci="[object Object]",Nr="[object Promise]",Pr="[object Set]",Ur="[object WeakMap]",Mr="[object DataView]",li=ie(Xe),di=ie(Qe),hi=ie(er),pi=ie(rr),vi=ie(tr),Z=Yt;(Xe&&Z(new Xe(new ArrayBuffer(1)))!=Mr||Qe&&Z(new Qe)!=Rr||er&&Z(er.resolve())!=Nr||rr&&Z(new rr)!=Pr||tr&&Z(new tr)!=Ur)&&(Z=function(e){var r=Yt(e),t=r==ci?e.constructor:void 0,n=t?ie(t):"";if(n)switch(n){case li:return Mr;case di:return Rr;case hi:return Nr;case pi:return Pr;case vi:return Ur}return r});var ye=Z;function gi(e){return e!=null&&typeof e=="object"}var se=gi,$i=Ne,yi=se,mi="[object Arguments]";function bi(e){return yi(e)&&$i(e)==mi}var _i=bi,Fr=_i,Ai=se,Gt=Object.prototype,Ei=Gt.hasOwnProperty,Ti=Gt.propertyIsEnumerable,Oi=Fr(function(){return arguments}())?Fr:function(e){return Ai(e)&&Ei.call(e,"callee")&&!Ti.call(e,"callee")},qt=Oi,Si=Array.isArray,me=Si,wi=9007199254740991;function Ii(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=wi}var Wt=Ii,Ci=Bt,Di=Wt;function ji(e){return e!=null&&Di(e.length)&&!Ci(e)}var dr=ji,ae={exports:{}};function Li(){return!1}var xi=Li;(function(e,r){var t=K,n=xi,a=r&&!r.nodeType&&r,i=a&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===a,f=s?t.Buffer:void 0,o=f?f.isBuffer:void 0,v=o||n;e.exports=v})(ae,ae.exports);var Ri=Ne,Ni=Wt,Pi=se,Ui="[object Arguments]",Mi="[object Array]",Fi="[object Boolean]",Bi="[object Date]",Hi="[object Error]",Yi="[object Function]",Gi="[object Map]",qi="[object Number]",Wi="[object Object]",Ki="[object RegExp]",Vi="[object Set]",ki="[object String]",Ji="[object WeakMap]",zi="[object ArrayBuffer]",Zi="[object DataView]",Xi="[object Float32Array]",Qi="[object Float64Array]",es="[object Int8Array]",rs="[object Int16Array]",ts="[object Int32Array]",ns="[object Uint8Array]",as="[object Uint8ClampedArray]",is="[object Uint16Array]",ss="[object Uint32Array]",P={};P[Xi]=P[Qi]=P[es]=P[rs]=P[ts]=P[ns]=P[as]=P[is]=P[ss]=!0;P[Ui]=P[Mi]=P[zi]=P[Fi]=P[Zi]=P[Bi]=P[Hi]=P[Yi]=P[Gi]=P[qi]=P[Wi]=P[Ki]=P[Vi]=P[ki]=P[Ji]=!1;function os(e){return Pi(e)&&Ni(e.length)&&!!P[Ri(e)]}var us=os;function fs(e){return function(r){return e(r)}}var hr=fs,ve={exports:{}};(function(e,r){var t=Mt,n=r&&!r.nodeType&&r,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i&&t.process,f=function(){try{var o=a&&a.require&&a.require("util").types;return o||s&&s.binding&&s.binding("util")}catch{}}();e.exports=f})(ve,ve.exports);var cs=us,ls=hr,Br=ve.exports,Hr=Br&&Br.isTypedArray,ds=Hr?ls(Hr):cs,pr=ds,hs=Ut,ps=ye,vs=qt,gs=me,$s=dr,ys=ae.exports,ms=xe,bs=pr,_s="[object Map]",As="[object Set]",Es=Object.prototype,Ts=Es.hasOwnProperty;function Os(e){if(e==null)return!0;if($s(e)&&(gs(e)||typeof e=="string"||typeof e.splice=="function"||ys(e)||bs(e)||vs(e)))return!e.length;var r=ps(e);if(r==_s||r==As)return!e.size;if(ms(e))return!hs(e).length;for(var t in e)if(Ts.call(e,t))return!1;return!0}var vr=Os,Kt={exports:{}};(function(e,r){(function(t,n){e.exports=n()})(X,function(){var t="minute",n=/[+-]\d\d(?::?\d\d)?/g,a=/([+-]|\d\d)/g;return function(i,s,f){var o=s.prototype;f.utc=function(p){var T={date:p,utc:!0,args:arguments};return new s(T)},o.utc=function(p){var T=f(this.toDate(),{locale:this.$L,utc:!0});return p?T.add(this.utcOffset(),t):T},o.local=function(){return f(this.toDate(),{locale:this.$L,utc:!1})};var v=o.parse;o.parse=function(p){p.utc&&(this.$u=!0),this.$utils().u(p.$offset)||(this.$offset=p.$offset),v.call(this,p)};var m=o.init;o.init=function(){if(this.$u){var p=this.$d;this.$y=p.getUTCFullYear(),this.$M=p.getUTCMonth(),this.$D=p.getUTCDate(),this.$W=p.getUTCDay(),this.$H=p.getUTCHours(),this.$m=p.getUTCMinutes(),this.$s=p.getUTCSeconds(),this.$ms=p.getUTCMilliseconds()}else m.call(this)};var $=o.utcOffset;o.utcOffset=function(p,T){var j=this.$utils().u;if(j(p))return this.$u?0:j(this.$offset)?$.call(this):this.$offset;if(typeof p=="string"&&(p=function(l){l===void 0&&(l="");var y=l.match(n);if(!y)return null;var w=(""+y[0]).match(a)||["-",0,0],O=w[0],I=60*+w[1]+ +w[2];return I===0?0:O==="+"?I:-I}(p),p===null))return this;var u=Math.abs(p)<=16?60*p:p,c=this;if(T)return c.$offset=u,c.$u=p===0,c;if(p!==0){var d=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(c=this.local().add(u+d,t)).$offset=u,c.$x.$localOffset=d}else c=this.utc();return c};var h=o.format;o.format=function(p){var T=p||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,T)},o.valueOf=function(){var p=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*p},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var g=o.toDate;o.toDate=function(p){return p==="s"&&this.$offset?f(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var A=o.diff;o.diff=function(p,T,j){if(p&&this.$u===p.$u)return A.call(this,p,T,j);var u=this.local(),c=f(p).local();return A.call(u,c,T,j)}}})})(Kt);var Ss=Kt.exports,Vt={exports:{}};(function(e,r){(function(t,n){e.exports=n()})(X,function(){var t={year:0,month:1,day:2,hour:3,minute:4,second:5},n={};return function(a,i,s){var f,o=function(h,g,A){A===void 0&&(A={});var p=new Date(h),T=function(j,u){u===void 0&&(u={});var c=u.timeZoneName||"short",d=j+"|"+c,l=n[d];return l||(l=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:j,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:c}),n[d]=l),l}(g,A);return T.formatToParts(p)},v=function(h,g){for(var A=o(h,g),p=[],T=0;T<A.length;T+=1){var j=A[T],u=j.type,c=j.value,d=t[u];d>=0&&(p[d]=parseInt(c,10))}var l=p[3],y=l===24?0:l,w=p[0]+"-"+p[1]+"-"+p[2]+" "+y+":"+p[4]+":"+p[5]+":000",O=+h;return(s.utc(w).valueOf()-(O-=O%1e3))/6e4},m=i.prototype;m.tz=function(h,g){h===void 0&&(h=f);var A=this.utcOffset(),p=this.toDate(),T=p.toLocaleString("en-US",{timeZone:h}),j=Math.round((p-new Date(T))/1e3/60),u=s(T).$set("millisecond",this.$ms).utcOffset(15*-Math.round(p.getTimezoneOffset()/15)-j,!0);if(g){var c=u.utcOffset();u=u.add(A-c,"minute")}return u.$x.$timezone=h,u},m.offsetName=function(h){var g=this.$x.$timezone||s.tz.guess(),A=o(this.valueOf(),g,{timeZoneName:h}).find(function(p){return p.type.toLowerCase()==="timezonename"});return A&&A.value};var $=m.startOf;m.startOf=function(h,g){if(!this.$x||!this.$x.$timezone)return $.call(this,h,g);var A=s(this.format("YYYY-MM-DD HH:mm:ss:SSS"));return $.call(A,h,g).tz(this.$x.$timezone,!0)},s.tz=function(h,g,A){var p=A&&g,T=A||g||f,j=v(+s(),T);if(typeof h!="string")return s(h).tz(T);var u=function(y,w,O){var I=y-60*w*1e3,x=v(I,O);if(w===x)return[I,w];var k=v(I-=60*(x-w)*1e3,O);return x===k?[I,x]:[y-60*Math.min(x,k)*1e3,Math.max(x,k)]}(s.utc(h,p).valueOf(),j,T),c=u[0],d=u[1],l=s(c).utcOffset(d);return l.$x.$timezone=T,l},s.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},s.tz.setDefault=function(h){f=h}}})})(Vt);var ws=Vt.exports,kt={exports:{}};(function(e,r){(function(t,n){e.exports=n()})(X,function(){var t=1e3,n=6e4,a=36e5,i="millisecond",s="second",f="minute",o="hour",v="day",m="week",$="month",h="quarter",g="year",A="date",p="Invalid Date",T=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,j=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,u={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},c=function(L,E,b){var S=String(L);return!S||S.length>=E?L:""+Array(E+1-S.length).join(b)+L},d={s:c,z:function(L){var E=-L.utcOffset(),b=Math.abs(E),S=Math.floor(b/60),_=b%60;return(E<=0?"+":"-")+c(S,2,"0")+":"+c(_,2,"0")},m:function L(E,b){if(E.date()<b.date())return-L(b,E);var S=12*(b.year()-E.year())+(b.month()-E.month()),_=E.clone().add(S,$),D=b-_<0,C=E.clone().add(S+(D?-1:1),$);return+(-(S+(b-_)/(D?_-C:C-_))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:$,y:g,w:m,d:v,D:A,h:o,m:f,s,ms:i,Q:h}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},l="en",y={};y[l]=u;var w=function(L){return L instanceof k},O=function L(E,b,S){var _;if(!E)return l;if(typeof E=="string"){var D=E.toLowerCase();y[D]&&(_=D),b&&(y[D]=b,_=D);var C=E.split("-");if(!_&&C.length>1)return L(C[0])}else{var R=E.name;y[R]=E,_=R}return!S&&_&&(l=_),_||!S&&l},I=function(L,E){if(w(L))return L.clone();var b=typeof E=="object"?E:{};return b.date=L,b.args=arguments,new k(b)},x=d;x.l=O,x.i=w,x.w=function(L,E){return I(L,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var k=function(){function L(b){this.$L=O(b.locale,null,!0),this.parse(b)}var E=L.prototype;return E.parse=function(b){this.$d=function(S){var _=S.date,D=S.utc;if(_===null)return new Date(NaN);if(x.u(_))return new Date;if(_ instanceof Date)return new Date(_);if(typeof _=="string"&&!/Z$/i.test(_)){var C=_.match(T);if(C){var R=C[2]-1||0,M=(C[7]||"0").substring(0,3);return D?new Date(Date.UTC(C[1],R,C[3]||1,C[4]||0,C[5]||0,C[6]||0,M)):new Date(C[1],R,C[3]||1,C[4]||0,C[5]||0,C[6]||0,M)}}return new Date(_)}(b),this.$x=b.x||{},this.init()},E.init=function(){var b=this.$d;this.$y=b.getFullYear(),this.$M=b.getMonth(),this.$D=b.getDate(),this.$W=b.getDay(),this.$H=b.getHours(),this.$m=b.getMinutes(),this.$s=b.getSeconds(),this.$ms=b.getMilliseconds()},E.$utils=function(){return x},E.isValid=function(){return this.$d.toString()!==p},E.isSame=function(b,S){var _=I(b);return this.startOf(S)<=_&&_<=this.endOf(S)},E.isAfter=function(b,S){return I(b)<this.startOf(S)},E.isBefore=function(b,S){return this.endOf(S)<I(b)},E.$g=function(b,S,_){return x.u(b)?this[S]:this.set(_,b)},E.unix=function(){return Math.floor(this.valueOf()/1e3)},E.valueOf=function(){return this.$d.getTime()},E.startOf=function(b,S){var _=this,D=!!x.u(S)||S,C=x.p(b),R=function(re,G){var z=x.w(_.$u?Date.UTC(_.$y,G,re):new Date(_.$y,G,re),_);return D?z:z.endOf(v)},M=function(re,G){return x.w(_.toDate()[re].apply(_.toDate("s"),(D?[0,0,0,0]:[23,59,59,999]).slice(G)),_)},U=this.$W,B=this.$M,J=this.$D,V="set"+(this.$u?"UTC":"");switch(C){case g:return D?R(1,0):R(31,11);case $:return D?R(1,B):R(0,B+1);case m:var le=this.$locale().weekStart||0,de=(U<le?U+7:U)-le;return R(D?J-de:J+(6-de),B);case v:case A:return M(V+"Hours",0);case o:return M(V+"Minutes",1);case f:return M(V+"Seconds",2);case s:return M(V+"Milliseconds",3);default:return this.clone()}},E.endOf=function(b){return this.startOf(b,!1)},E.$set=function(b,S){var _,D=x.p(b),C="set"+(this.$u?"UTC":""),R=(_={},_[v]=C+"Date",_[A]=C+"Date",_[$]=C+"Month",_[g]=C+"FullYear",_[o]=C+"Hours",_[f]=C+"Minutes",_[s]=C+"Seconds",_[i]=C+"Milliseconds",_)[D],M=D===v?this.$D+(S-this.$W):S;if(D===$||D===g){var U=this.clone().set(A,1);U.$d[R](M),U.init(),this.$d=U.set(A,Math.min(this.$D,U.daysInMonth())).$d}else R&&this.$d[R](M);return this.init(),this},E.set=function(b,S){return this.clone().$set(b,S)},E.get=function(b){return this[x.p(b)]()},E.add=function(b,S){var _,D=this;b=Number(b);var C=x.p(S),R=function(B){var J=I(D);return x.w(J.date(J.date()+Math.round(B*b)),D)};if(C===$)return this.set($,this.$M+b);if(C===g)return this.set(g,this.$y+b);if(C===v)return R(1);if(C===m)return R(7);var M=(_={},_[f]=n,_[o]=a,_[s]=t,_)[C]||1,U=this.$d.getTime()+b*M;return x.w(U,this)},E.subtract=function(b,S){return this.add(-1*b,S)},E.format=function(b){var S=this,_=this.$locale();if(!this.isValid())return _.invalidDate||p;var D=b||"YYYY-MM-DDTHH:mm:ssZ",C=x.z(this),R=this.$H,M=this.$m,U=this.$M,B=_.weekdays,J=_.months,V=function(G,z,qe,_e){return G&&(G[z]||G(S,D))||qe[z].slice(0,_e)},le=function(G){return x.s(R%12||12,G,"0")},de=_.meridiem||function(G,z,qe){var _e=G<12?"AM":"PM";return qe?_e.toLowerCase():_e},re={YY:String(this.$y).slice(-2),YYYY:this.$y,M:U+1,MM:x.s(U+1,2,"0"),MMM:V(_.monthsShort,U,J,3),MMMM:V(J,U),D:this.$D,DD:x.s(this.$D,2,"0"),d:String(this.$W),dd:V(_.weekdaysMin,this.$W,B,2),ddd:V(_.weekdaysShort,this.$W,B,3),dddd:B[this.$W],H:String(R),HH:x.s(R,2,"0"),h:le(1),hh:le(2),a:de(R,M,!0),A:de(R,M,!1),m:String(M),mm:x.s(M,2,"0"),s:String(this.$s),ss:x.s(this.$s,2,"0"),SSS:x.s(this.$ms,3,"0"),Z:C};return D.replace(j,function(G,z){return z||re[G]||C.replace(":","")})},E.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},E.diff=function(b,S,_){var D,C=x.p(S),R=I(b),M=(R.utcOffset()-this.utcOffset())*n,U=this-R,B=x.m(this,R);return B=(D={},D[g]=B/12,D[$]=B,D[h]=B/3,D[m]=(U-M)/6048e5,D[v]=(U-M)/864e5,D[o]=U/a,D[f]=U/n,D[s]=U/t,D)[C]||U,_?B:x.a(B)},E.daysInMonth=function(){return this.endOf($).$D},E.$locale=function(){return y[this.$L]},E.locale=function(b,S){if(!b)return this.$L;var _=this.clone(),D=O(b,S,!0);return D&&(_.$L=D),_},E.clone=function(){return x.w(this.$d,this)},E.toDate=function(){return new Date(this.valueOf())},E.toJSON=function(){return this.isValid()?this.toISOString():null},E.toISOString=function(){return this.$d.toISOString()},E.toString=function(){return this.$d.toUTCString()},L}(),Cr=k.prototype;return I.prototype=Cr,[["$ms",i],["$s",s],["$m",f],["$H",o],["$W",v],["$M",$],["$y",g],["$D",A]].forEach(function(L){Cr[L[1]]=function(E){return this.$g(E,L[0],L[1])}}),I.extend=function(L,E){return L.$i||(L(E,k,I),L.$i=!0),I},I.locale=O,I.isDayjs=w,I.unix=function(L){return I(1e3*L)},I.en=y[l],I.Ls=y,I.p={},I})})(kt);var ge=kt.exports;ge.extend(Ss);ge.extend(ws);const Jt=["SUN","MON","TUE","WED","THU","FRI","SAT"],Ie=e=>{const[r,t]=e.split(":");return{hour:parseInt(r||"0",10),minutes:parseInt(t||"0",10)}};function nr(e,r,t){const{availability:n}=e;if(!n)return!0;if(vr(n))return!1;const a=t?ge(t).tz(r):ge().tz(r),i=a.day(),s=n[Jt[i]];if(!Array.isArray(s)||s.length!==2)return!1;const f=a.hour(),o=a.minute(),v=Ie(s[0]),m=Ie(s[1]);return f<v.hour||f===v.hour&&o<v.minutes?!1:!(f>m.hour||f===m.hour&&o>m.minutes)}const ar=(e,r=void 0,t=void 0,n=!1)=>n?e.map(i=>{let s;return Array.isArray(i.items)&&(s=ar(i.items,r,t,n)),{...i,items:s,outsideAvailabilitySlot:!nr(i,r,t)||(s==null?void 0:s.every(f=>f.outsideAvailabilitySlot))||!1}}):e.filter(i=>nr(i,r,t)).map(i=>Array.isArray(i.items)?{...i,items:ar(i.items,r,t)}:i),Yr=(e,r=void 0,t=void 0,n=!1)=>{let a=[];return e.forEach(i=>{if(!Array.isArray(i.items)){a.push(i);return}const s=ar(i.items,r,t,n);s.length>0&&a.push({...i,items:s})}),n&&(a=a.map(i=>!i.items||!Array.isArray(i.items)?i:{...i,outsideAvailabilitySlot:!nr(i,r,t)||i.items.every(s=>s.outsideAvailabilitySlot)})),a};function pe(e){const r=e==null?void 0:e.week;if(!e||!e.active||!r)return!1;const t=ge(),n=t.day(),a=r[Jt[n]];return a?a.some(i=>Is(t,i)):!1}function Is(e,r){const t=e.hour(),n=e.minute(),a=Ie(r.from),i=Ie(r.to);return t<a.hour||t===a.hour&&n<a.minutes?!1:!(t>i.hour||t===i.hour&&n>i.minutes)}function Cs(){this.__data__=[],this.size=0}var Ds=Cs;function js(e,r){return e===r||e!==e&&r!==r}var gr=js,Ls=gr;function xs(e,r){for(var t=e.length;t--;)if(Ls(e[t][0],r))return t;return-1}var Pe=xs,Rs=Pe,Ns=Array.prototype,Ps=Ns.splice;function Us(e){var r=this.__data__,t=Rs(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():Ps.call(r,t,1),--this.size,!0}var Ms=Us,Fs=Pe;function Bs(e){var r=this.__data__,t=Fs(r,e);return t<0?void 0:r[t][1]}var Hs=Bs,Ys=Pe;function Gs(e){return Ys(this.__data__,e)>-1}var qs=Gs,Ws=Pe;function Ks(e,r){var t=this.__data__,n=Ws(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}var Vs=Ks,ks=Ds,Js=Ms,zs=Hs,Zs=qs,Xs=Vs;function oe(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}oe.prototype.clear=ks;oe.prototype.delete=Js;oe.prototype.get=zs;oe.prototype.has=Zs;oe.prototype.set=Xs;var Ue=oe,Qs=Ue;function eo(){this.__data__=new Qs,this.size=0}var ro=eo;function to(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}var no=to;function ao(e){return this.__data__.get(e)}var io=ao;function so(e){return this.__data__.has(e)}var oo=so,uo=Q,fo=uo(Object,"create"),Me=fo,Gr=Me;function co(){this.__data__=Gr?Gr(null):{},this.size=0}var lo=co;function ho(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var po=ho,vo=Me,go="__lodash_hash_undefined__",$o=Object.prototype,yo=$o.hasOwnProperty;function mo(e){var r=this.__data__;if(vo){var t=r[e];return t===go?void 0:t}return yo.call(r,e)?r[e]:void 0}var bo=mo,_o=Me,Ao=Object.prototype,Eo=Ao.hasOwnProperty;function To(e){var r=this.__data__;return _o?r[e]!==void 0:Eo.call(r,e)}var Oo=To,So=Me,wo="__lodash_hash_undefined__";function Io(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=So&&r===void 0?wo:r,this}var Co=Io,Do=lo,jo=po,Lo=bo,xo=Oo,Ro=Co;function ue(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}ue.prototype.clear=Do;ue.prototype.delete=jo;ue.prototype.get=Lo;ue.prototype.has=xo;ue.prototype.set=Ro;var No=ue,qr=No,Po=Ue,Uo=lr;function Mo(){this.size=0,this.__data__={hash:new qr,map:new(Uo||Po),string:new qr}}var Fo=Mo;function Bo(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}var Ho=Bo,Yo=Ho;function Go(e,r){var t=e.__data__;return Yo(r)?t[typeof r=="string"?"string":"hash"]:t.map}var Fe=Go,qo=Fe;function Wo(e){var r=qo(this,e).delete(e);return this.size-=r?1:0,r}var Ko=Wo,Vo=Fe;function ko(e){return Vo(this,e).get(e)}var Jo=ko,zo=Fe;function Zo(e){return zo(this,e).has(e)}var Xo=Zo,Qo=Fe;function eu(e,r){var t=Qo(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}var ru=eu,tu=Fo,nu=Ko,au=Jo,iu=Xo,su=ru;function fe(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}fe.prototype.clear=tu;fe.prototype.delete=nu;fe.prototype.get=au;fe.prototype.has=iu;fe.prototype.set=su;var zt=fe,ou=Ue,uu=lr,fu=zt,cu=200;function lu(e,r){var t=this.__data__;if(t instanceof ou){var n=t.__data__;if(!uu||n.length<cu-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new fu(n)}return t.set(e,r),this.size=t.size,this}var du=lu,hu=Ue,pu=ro,vu=no,gu=io,$u=oo,yu=du;function ce(e){var r=this.__data__=new hu(e);this.size=r.size}ce.prototype.clear=pu;ce.prototype.delete=vu;ce.prototype.get=gu;ce.prototype.has=$u;ce.prototype.set=yu;var Zt=ce,mu="__lodash_hash_undefined__";function bu(e){return this.__data__.set(e,mu),this}var _u=bu;function Au(e){return this.__data__.has(e)}var Eu=Au,Tu=zt,Ou=_u,Su=Eu;function Ce(e){var r=-1,t=e==null?0:e.length;for(this.__data__=new Tu;++r<t;)this.add(e[r])}Ce.prototype.add=Ce.prototype.push=Ou;Ce.prototype.has=Su;var wu=Ce;function Iu(e,r){for(var t=-1,n=e==null?0:e.length;++t<n;)if(r(e[t],t,e))return!0;return!1}var Cu=Iu;function Du(e,r){return e.has(r)}var ju=Du,Lu=wu,xu=Cu,Ru=ju,Nu=1,Pu=2;function Uu(e,r,t,n,a,i){var s=t&Nu,f=e.length,o=r.length;if(f!=o&&!(s&&o>f))return!1;var v=i.get(e),m=i.get(r);if(v&&m)return v==r&&m==e;var $=-1,h=!0,g=t&Pu?new Lu:void 0;for(i.set(e,r),i.set(r,e);++$<f;){var A=e[$],p=r[$];if(n)var T=s?n(p,A,$,r,e,i):n(A,p,$,e,r,i);if(T!==void 0){if(T)continue;h=!1;break}if(g){if(!xu(r,function(j,u){if(!Ru(g,u)&&(A===j||a(A,j,t,n,i)))return g.push(u)})){h=!1;break}}else if(!(A===p||a(A,p,t,n,i))){h=!1;break}}return i.delete(e),i.delete(r),h}var Xt=Uu,Mu=K,Fu=Mu.Uint8Array,Qt=Fu;function Bu(e){var r=-1,t=Array(e.size);return e.forEach(function(n,a){t[++r]=[a,n]}),t}var Hu=Bu;function Yu(e){var r=-1,t=Array(e.size);return e.forEach(function(n){t[++r]=n}),t}var Gu=Yu,Wr=Re,Kr=Qt,qu=gr,Wu=Xt,Ku=Hu,Vu=Gu,ku=1,Ju=2,zu="[object Boolean]",Zu="[object Date]",Xu="[object Error]",Qu="[object Map]",ef="[object Number]",rf="[object RegExp]",tf="[object Set]",nf="[object String]",af="[object Symbol]",sf="[object ArrayBuffer]",of="[object DataView]",Vr=Wr?Wr.prototype:void 0,Ke=Vr?Vr.valueOf:void 0;function uf(e,r,t,n,a,i,s){switch(t){case of:if(e.byteLength!=r.byteLength||e.byteOffset!=r.byteOffset)return!1;e=e.buffer,r=r.buffer;case sf:return!(e.byteLength!=r.byteLength||!i(new Kr(e),new Kr(r)));case zu:case Zu:case ef:return qu(+e,+r);case Xu:return e.name==r.name&&e.message==r.message;case rf:case nf:return e==r+"";case Qu:var f=Ku;case tf:var o=n&ku;if(f||(f=Vu),e.size!=r.size&&!o)return!1;var v=s.get(e);if(v)return v==r;n|=Ju,s.set(e,r);var m=Wu(f(e),f(r),n,a,i,s);return s.delete(e),m;case af:if(Ke)return Ke.call(e)==Ke.call(r)}return!1}var ff=uf;function cf(e,r){for(var t=-1,n=r.length,a=e.length;++t<n;)e[a+t]=r[t];return e}var en=cf,lf=en,df=me;function hf(e,r,t){var n=r(e);return df(e)?n:lf(n,t(e))}var rn=hf;function pf(e,r){for(var t=-1,n=e==null?0:e.length,a=0,i=[];++t<n;){var s=e[t];r(s,t,e)&&(i[a++]=s)}return i}var vf=pf;function gf(){return[]}var tn=gf,$f=vf,yf=tn,mf=Object.prototype,bf=mf.propertyIsEnumerable,kr=Object.getOwnPropertySymbols,_f=kr?function(e){return e==null?[]:(e=Object(e),$f(kr(e),function(r){return bf.call(e,r)}))}:yf,$r=_f;function Af(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}var Ef=Af,Tf=9007199254740991,Of=/^(?:0|[1-9]\d*)$/;function Sf(e,r){var t=typeof e;return r=r==null?Tf:r,!!r&&(t=="number"||t!="symbol"&&Of.test(e))&&e>-1&&e%1==0&&e<r}var wf=Sf,If=Ef,Cf=qt,Df=me,jf=ae.exports,Lf=wf,xf=pr,Rf=Object.prototype,Nf=Rf.hasOwnProperty;function Pf(e,r){var t=Df(e),n=!t&&Cf(e),a=!t&&!n&&jf(e),i=!t&&!n&&!a&&xf(e),s=t||n||a||i,f=s?If(e.length,String):[],o=f.length;for(var v in e)(r||Nf.call(e,v))&&!(s&&(v=="length"||a&&(v=="offset"||v=="parent")||i&&(v=="buffer"||v=="byteLength"||v=="byteOffset")||Lf(v,o)))&&f.push(v);return f}var nn=Pf,Uf=nn,Mf=Ut,Ff=dr;function Bf(e){return Ff(e)?Uf(e):Mf(e)}var yr=Bf,Hf=rn,Yf=$r,Gf=yr;function qf(e){return Hf(e,Gf,Yf)}var an=qf,Jr=an,Wf=1,Kf=Object.prototype,Vf=Kf.hasOwnProperty;function kf(e,r,t,n,a,i){var s=t&Wf,f=Jr(e),o=f.length,v=Jr(r),m=v.length;if(o!=m&&!s)return!1;for(var $=o;$--;){var h=f[$];if(!(s?h in r:Vf.call(r,h)))return!1}var g=i.get(e),A=i.get(r);if(g&&A)return g==r&&A==e;var p=!0;i.set(e,r),i.set(r,e);for(var T=s;++$<o;){h=f[$];var j=e[h],u=r[h];if(n)var c=s?n(u,j,h,r,e,i):n(j,u,h,e,r,i);if(!(c===void 0?j===u||a(j,u,t,n,i):c)){p=!1;break}T||(T=h=="constructor")}if(p&&!T){var d=e.constructor,l=r.constructor;d!=l&&"constructor"in e&&"constructor"in r&&!(typeof d=="function"&&d instanceof d&&typeof l=="function"&&l instanceof l)&&(p=!1)}return i.delete(e),i.delete(r),p}var Jf=kf,Ve=Zt,zf=Xt,Zf=ff,Xf=Jf,zr=ye,Zr=me,Xr=ae.exports,Qf=pr,ec=1,Qr="[object Arguments]",et="[object Array]",Ae="[object Object]",rc=Object.prototype,rt=rc.hasOwnProperty;function tc(e,r,t,n,a,i){var s=Zr(e),f=Zr(r),o=s?et:zr(e),v=f?et:zr(r);o=o==Qr?Ae:o,v=v==Qr?Ae:v;var m=o==Ae,$=v==Ae,h=o==v;if(h&&Xr(e)){if(!Xr(r))return!1;s=!0,m=!1}if(h&&!m)return i||(i=new Ve),s||Qf(e)?zf(e,r,t,n,a,i):Zf(e,r,o,t,n,a,i);if(!(t&ec)){var g=m&&rt.call(e,"__wrapped__"),A=$&&rt.call(r,"__wrapped__");if(g||A){var p=g?e.value():e,T=A?r.value():r;return i||(i=new Ve),a(p,T,t,n,i)}}return h?(i||(i=new Ve),Xf(e,r,t,n,a,i)):!1}var nc=tc,ac=nc,tt=se;function sn(e,r,t,n,a){return e===r?!0:e==null||r==null||!tt(e)&&!tt(r)?e!==e&&r!==r:ac(e,r,t,n,sn,a)}var ic=sn,sc=ic;function oc(e,r){return sc(e,r)}var on=oc;function uc(e,r=!1,t=void 0,n=60){const[a,i]=Y.useState(e&&Yr(e,t,void 0,r));Le(s,n*1e3);function s(){const f=e&&Yr(e,t,void 0,r);on(f,a)||(console.log("menu has changed",f),i(f))}return Y.useEffect(s,[a,e]),a}var nt;(function(e){e.UNINITIALIZED="UNINITIALIZED",e.PROCESSING="PROCESSING",e.PAID="PAID",e.FAILED="FAILED",e.PRINTING_RECEIPT="PRINTING_RECEIPT",e.PRINTING_RECEIPT_SUCCESS="PRINTING_RECEIPT_SUCCESS",e.SENDING_RECEIPT="SENDING_RECEIPT",e.SENDING_RECEIPT_SUCCESS="SENDING_RECEIPT_SUCCESS",e.ERROR="ERROR"})(nt||(nt={}));var at;(function(e){e.CAROUSEL="carousel",e.NORMAL="normal",e.IMAGE="image"})(at||(at={}));var ir;(function(e){e.GROUP="3e/group",e.PRODUCT="3e/product",e.CATEGORY="3e/group/category",e.OPTIONS="3e/group/options",e.CONFIG="3e/group/config",e.STATIC="3e/static",e.REF="3e/ref",e.QUERY="3e/query"})(ir||(ir={}));var it;(function(e){e.GROUP="group",e.PRODUCT="product"})(it||(it={}));var st;(function(e){e.TAKE_AWAY="TAKE_AWAY",e.DELIVERY="DELIVERY",e.DINE_IN="DINE_IN",e.DINE_IN_OPEN="DINE_IN_OPEN",e.GLOVO_DELIVERY="GLOVO_DELIVERY",e.GLOVO_TAKE_AWAY="GLOVO_TAKE_AWAY",e.JUSTEAT_DELIVERY="JUSTEAT_DELIVERY",e.JUSTEAT_TAKE_AWAY="JUSTEAT_TAKE_AWAY",e.UBER_DELIVERY="UBER_DELIVERY",e.UBER_TAKE_AWAY="UBER_TAKE_AWAY",e.UBER_DINE_IN="UBER_DINE_IN",e.BOLT_DELIVERY="BOLT_DELIVERY",e.BOLT_TAKE_AWAY="BOLT_TAKE_AWAY",e.WOLT_DELIVERY="WOLT_DELIVERY",e.WOLT_TAKE_AWAY="WOLT_TAKE_AWAY",e.WOLT_DINE_IN="WOLT_DINE_IN"})(st||(st={}));var ot;(function(e){e.NEW="NEW",e.COMPLETED="COMPLETED",e.VERIFIED="VERIFIED",e.DELIVER="DELIVER",e.DELIVERED="DELIVERED",e.CLOSED="CLOSED",e.ABANDONED="ABANDONED",e.CANCELLED="CANCELLED",e.PICKED="PICKED"})(ot||(ot={}));var ut;(function(e){e.CASH="CASH",e.CARD="CARD",e.COD="COD",e.TERMINAL="TERMINAL",e.EPAYMENT="EPAYMENT",e.COUPON="COUPON",e.WALLET="WALLET",e.PREAUTHORIZED="PREAUTHORIZED",e.RETURN="RETURN",e.EXTERNAL="EXTERNAL"})(ut||(ut={}));var ft;(function(e){e.KIOSK="KIOSK",e.WEB="WEB",e.JUST_EAT_TAKE_AWAY="JUSTEATTAKEAWAY",e.GLOVO="GLOVO",e.PYSZNE="PYSZNE",e.WOLT="WOLT",e.UBER="UBER",e.BOLT="BOLT"})(ft||(ft={}));var ct;(function(e){e.NEW="NEW",e.TECHNICAL="TECHNICAL",e.CONFIRMED="CONFIRMED",e.PROCESSING="PROCESSING",e.PROCESSED="PROCESSED",e.VOID="VOID",e.WASTE="WASTE"})(ct||(ct={}));var lt;(function(e){e.GROUP="group",e.PRODUCT="product"})(lt||(lt={}));var dt;(function(e){e.DINE_IN="DINE_IN",e.TAKE_AWAY="TAKE_AWAY",e.DELIVERY="DELIVERY",e.GLOVO_DELIVERY="GLOVO_DELIVERY",e.JUSTEAT_DELIVERY="JUSTEAT_DELIVERY",e.UBER_DELIVERY="UBER_DELIVERY",e.BOLT_DELIVERY="BOLT_DELIVERY",e.WOLT_DELIVERY="WOLT_DELIVERY"})(dt||(dt={}));function fc(e,r){for(var t=-1,n=e==null?0:e.length;++t<n&&r(e[t],t,e)!==!1;);return e}var cc=fc,lc=Q,dc=function(){try{var e=lc(Object,"defineProperty");return e({},"",{}),e}catch{}}(),hc=dc,ht=hc;function pc(e,r,t){r=="__proto__"&&ht?ht(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}var un=pc,vc=un,gc=gr,$c=Object.prototype,yc=$c.hasOwnProperty;function mc(e,r,t){var n=e[r];(!(yc.call(e,r)&&gc(n,t))||t===void 0&&!(r in e))&&vc(e,r,t)}var fn=mc,bc=fn,_c=un;function Ac(e,r,t,n){var a=!t;t||(t={});for(var i=-1,s=r.length;++i<s;){var f=r[i],o=n?n(t[f],e[f],f,t,e):void 0;o===void 0&&(o=e[f]),a?_c(t,f,o):bc(t,f,o)}return t}var Be=Ac,Ec=Be,Tc=yr;function Oc(e,r){return e&&Ec(r,Tc(r),e)}var Sc=Oc;function wc(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}var Ic=wc,Cc=$e,Dc=xe,jc=Ic,Lc=Object.prototype,xc=Lc.hasOwnProperty;function Rc(e){if(!Cc(e))return jc(e);var r=Dc(e),t=[];for(var n in e)n=="constructor"&&(r||!xc.call(e,n))||t.push(n);return t}var Nc=Rc,Pc=nn,Uc=Nc,Mc=dr;function Fc(e){return Mc(e)?Pc(e,!0):Uc(e)}var mr=Fc,Bc=Be,Hc=mr;function Yc(e,r){return e&&Bc(r,Hc(r),e)}var Gc=Yc,sr={exports:{}};(function(e,r){var t=K,n=r&&!r.nodeType&&r,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i?t.Buffer:void 0,f=s?s.allocUnsafe:void 0;function o(v,m){if(m)return v.slice();var $=v.length,h=f?f($):new v.constructor($);return v.copy(h),h}e.exports=o})(sr,sr.exports);function qc(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}var Wc=qc,Kc=Be,Vc=$r;function kc(e,r){return Kc(e,Vc(e),r)}var Jc=kc,zc=Pt,Zc=zc(Object.getPrototypeOf,Object),cn=Zc,Xc=en,Qc=cn,el=$r,rl=tn,tl=Object.getOwnPropertySymbols,nl=tl?function(e){for(var r=[];e;)Xc(r,el(e)),e=Qc(e);return r}:rl,ln=nl,al=Be,il=ln;function sl(e,r){return al(e,il(e),r)}var ol=sl,ul=rn,fl=ln,cl=mr;function ll(e){return ul(e,cl,fl)}var dl=ll,hl=Object.prototype,pl=hl.hasOwnProperty;function vl(e){var r=e.length,t=new e.constructor(r);return r&&typeof e[0]=="string"&&pl.call(e,"index")&&(t.index=e.index,t.input=e.input),t}var gl=vl,pt=Qt;function $l(e){var r=new e.constructor(e.byteLength);return new pt(r).set(new pt(e)),r}var br=$l,yl=br;function ml(e,r){var t=r?yl(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}var bl=ml,_l=/\w*$/;function Al(e){var r=new e.constructor(e.source,_l.exec(e));return r.lastIndex=e.lastIndex,r}var El=Al,vt=Re,gt=vt?vt.prototype:void 0,$t=gt?gt.valueOf:void 0;function Tl(e){return $t?Object($t.call(e)):{}}var Ol=Tl,Sl=br;function wl(e,r){var t=r?Sl(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}var Il=wl,Cl=br,Dl=bl,jl=El,Ll=Ol,xl=Il,Rl="[object Boolean]",Nl="[object Date]",Pl="[object Map]",Ul="[object Number]",Ml="[object RegExp]",Fl="[object Set]",Bl="[object String]",Hl="[object Symbol]",Yl="[object ArrayBuffer]",Gl="[object DataView]",ql="[object Float32Array]",Wl="[object Float64Array]",Kl="[object Int8Array]",Vl="[object Int16Array]",kl="[object Int32Array]",Jl="[object Uint8Array]",zl="[object Uint8ClampedArray]",Zl="[object Uint16Array]",Xl="[object Uint32Array]";function Ql(e,r,t){var n=e.constructor;switch(r){case Yl:return Cl(e);case Rl:case Nl:return new n(+e);case Gl:return Dl(e,t);case ql:case Wl:case Kl:case Vl:case kl:case Jl:case zl:case Zl:case Xl:return xl(e,t);case Pl:return new n;case Ul:case Bl:return new n(e);case Ml:return jl(e);case Fl:return new n;case Hl:return Ll(e)}}var ed=Ql,rd=$e,yt=Object.create,td=function(){function e(){}return function(r){if(!rd(r))return{};if(yt)return yt(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}(),nd=td,ad=nd,id=cn,sd=xe;function od(e){return typeof e.constructor=="function"&&!sd(e)?ad(id(e)):{}}var ud=od,fd=ye,cd=se,ld="[object Map]";function dd(e){return cd(e)&&fd(e)==ld}var hd=dd,pd=hd,vd=hr,mt=ve.exports,bt=mt&&mt.isMap,gd=bt?vd(bt):pd,$d=gd,yd=ye,md=se,bd="[object Set]";function _d(e){return md(e)&&yd(e)==bd}var Ad=_d,Ed=Ad,Td=hr,_t=ve.exports,At=_t&&_t.isSet,Od=At?Td(At):Ed,Sd=Od,wd=Zt,Id=cc,Cd=fn,Dd=Sc,jd=Gc,Ld=sr.exports,xd=Wc,Rd=Jc,Nd=ol,Pd=an,Ud=dl,Md=ye,Fd=gl,Bd=ed,Hd=ud,Yd=me,Gd=ae.exports,qd=$d,Wd=$e,Kd=Sd,Vd=yr,kd=mr,Jd=1,zd=2,Zd=4,dn="[object Arguments]",Xd="[object Array]",Qd="[object Boolean]",eh="[object Date]",rh="[object Error]",hn="[object Function]",th="[object GeneratorFunction]",nh="[object Map]",ah="[object Number]",pn="[object Object]",ih="[object RegExp]",sh="[object Set]",oh="[object String]",uh="[object Symbol]",fh="[object WeakMap]",ch="[object ArrayBuffer]",lh="[object DataView]",dh="[object Float32Array]",hh="[object Float64Array]",ph="[object Int8Array]",vh="[object Int16Array]",gh="[object Int32Array]",$h="[object Uint8Array]",yh="[object Uint8ClampedArray]",mh="[object Uint16Array]",bh="[object Uint32Array]",N={};N[dn]=N[Xd]=N[ch]=N[lh]=N[Qd]=N[eh]=N[dh]=N[hh]=N[ph]=N[vh]=N[gh]=N[nh]=N[ah]=N[pn]=N[ih]=N[sh]=N[oh]=N[uh]=N[$h]=N[yh]=N[mh]=N[bh]=!0;N[rh]=N[hn]=N[fh]=!1;function Oe(e,r,t,n,a,i){var s,f=r&Jd,o=r&zd,v=r&Zd;if(t&&(s=a?t(e,n,a,i):t(e)),s!==void 0)return s;if(!Wd(e))return e;var m=Yd(e);if(m){if(s=Fd(e),!f)return xd(e,s)}else{var $=Md(e),h=$==hn||$==th;if(Gd(e))return Ld(e,f);if($==pn||$==dn||h&&!a){if(s=o||h?{}:Hd(e),!f)return o?Nd(e,jd(s,e)):Rd(e,Dd(s,e))}else{if(!N[$])return a?e:{};s=Bd(e,$,f)}}i||(i=new wd);var g=i.get(e);if(g)return g;i.set(e,s),Kd(e)?e.forEach(function(T){s.add(Oe(T,r,t,T,e,i))}):qd(e)&&e.forEach(function(T,j){s.set(j,Oe(T,r,t,j,e,i))});var A=v?o?Ud:Pd:o?kd:Vd,p=m?void 0:A(e);return Id(p||e,function(T,j){p&&(j=T,T=e[j]),Cd(s,j,Oe(T,r,t,j,e,i))}),s}var _h=Oe,Ah=_h,Eh=1,Th=4;function Oh(e){return Ah(e,Eh|Th)}var Sh=Oh;function wh(e,r){if(!r||!r.filter||!e||!e.filter||e.kind!==ir.CONFIG)return!0;if(e.filter&&e.items){const t=Object.values(e.filter).flat().filter(n=>{var a,i,s,f;return r.filter[(i=(a=e.items)==null?void 0:a[0])==null?void 0:i.fltCtx]&&Object.values(r.filter[(f=(s=e.items)==null?void 0:s[0])==null?void 0:f.fltCtx]).includes(n)});if(Array.isArray(t)&&t.length===0)return!1}return!0}const De=(e,r,t=0)=>{if(!e)return 0;let n=parseFloat(e.price)||0;const{items:a}=e,i=Sh(r);return wh(e,i)&&Array.isArray(a)&&a.forEach(s=>{let f=0;if(s.kind!=="3e/product")f=De(s,i,t+1);else{const{selected:o={}}=i,{selCtx:v,id:m}=s;v in o&&m in o[v]&&(f=De(s,i,t+1)*o[v][m],delete i.selected[v][m])}n+=f}),Math.round(100*n)/100},Ih=({product:e,state:r,selected:t,cheapestGroupOptionsProduct:n})=>{var o;const a=r?De(e,r):0,i=e.state&&!vr((o=e==null?void 0:e.state)==null?void 0:o.selected)?De(e,e.state):0,s=e.minPrice&&parseFloat(e.price)===a;let f=t||!!n||parseFloat(e.price)===0?a||i:parseFloat(e.price);return n!==void 0&&(f-=n),s&&e.minPrice&&(f=parseFloat(e.minPrice)),{displayPrice:f,showAsMinPrice:s,calculatedPriceDefaultProductState:i}};function _r(e){const r=[];return e.reduce((t,n)=>{if(t[n.hash]||(t[n.hash]={...n,quantity:0,discounted:0,discounts:[],firstProductQuantity:n.quantity,itemsToRemove:[]},r.push(t[n.hash])),t[n.hash].quantity+=n.quantity,t[n.hash].itemsToRemove.push(n.id),n.discounts){t[n.hash].discounts||(t[n.hash].discounts=[]),t[n.hash].discounts=t[n.hash].discounts.concat(n.discounts),t[n.hash].discounted=0;for(let a=0;a<t[n.hash].discounts.length;a+=1)t[n.hash].discounts[a]&&(t[n.hash].discounted+=parseFloat(t[n.hash].discounts[a].discountPrice))}return t},{}),r}function Ch(e){return _r(e)}function Dh(e){return!e||e.length===0?null:_r(e.flatMap(r=>r.lines))}var Ar={exports:{}},vn=function(r,t){return function(){for(var a=new Array(arguments.length),i=0;i<a.length;i++)a[i]=arguments[i];return r.apply(t,a)}},jh=vn,ee=Object.prototype.toString;function Er(e){return ee.call(e)==="[object Array]"}function or(e){return typeof e=="undefined"}function Lh(e){return e!==null&&!or(e)&&e.constructor!==null&&!or(e.constructor)&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function xh(e){return ee.call(e)==="[object ArrayBuffer]"}function Rh(e){return typeof FormData!="undefined"&&e instanceof FormData}function Nh(e){var r;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?r=ArrayBuffer.isView(e):r=e&&e.buffer&&e.buffer instanceof ArrayBuffer,r}function Ph(e){return typeof e=="string"}function Uh(e){return typeof e=="number"}function gn(e){return e!==null&&typeof e=="object"}function Se(e){if(ee.call(e)!=="[object Object]")return!1;var r=Object.getPrototypeOf(e);return r===null||r===Object.prototype}function Mh(e){return ee.call(e)==="[object Date]"}function Fh(e){return ee.call(e)==="[object File]"}function Bh(e){return ee.call(e)==="[object Blob]"}function $n(e){return ee.call(e)==="[object Function]"}function Hh(e){return gn(e)&&$n(e.pipe)}function Yh(e){return typeof URLSearchParams!="undefined"&&e instanceof URLSearchParams}function Gh(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function qh(){return typeof navigator!="undefined"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window!="undefined"&&typeof document!="undefined"}function Tr(e,r){if(!(e===null||typeof e=="undefined"))if(typeof e!="object"&&(e=[e]),Er(e))for(var t=0,n=e.length;t<n;t++)r.call(null,e[t],t,e);else for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&r.call(null,e[a],a,e)}function ur(){var e={};function r(a,i){Se(e[i])&&Se(a)?e[i]=ur(e[i],a):Se(a)?e[i]=ur({},a):Er(a)?e[i]=a.slice():e[i]=a}for(var t=0,n=arguments.length;t<n;t++)Tr(arguments[t],r);return e}function Wh(e,r,t){return Tr(r,function(a,i){t&&typeof a=="function"?e[i]=jh(a,t):e[i]=a}),e}function Kh(e){return e.charCodeAt(0)===65279&&(e=e.slice(1)),e}var q={isArray:Er,isArrayBuffer:xh,isBuffer:Lh,isFormData:Rh,isArrayBufferView:Nh,isString:Ph,isNumber:Uh,isObject:gn,isPlainObject:Se,isUndefined:or,isDate:Mh,isFile:Fh,isBlob:Bh,isFunction:$n,isStream:Hh,isURLSearchParams:Yh,isStandardBrowserEnv:qh,forEach:Tr,merge:ur,extend:Wh,trim:Gh,stripBOM:Kh},te=q;function Et(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var yn=function(r,t,n){if(!t)return r;var a;if(n)a=n(t);else if(te.isURLSearchParams(t))a=t.toString();else{var i=[];te.forEach(t,function(o,v){o===null||typeof o=="undefined"||(te.isArray(o)?v=v+"[]":o=[o],te.forEach(o,function($){te.isDate($)?$=$.toISOString():te.isObject($)&&($=JSON.stringify($)),i.push(Et(v)+"="+Et($))}))}),a=i.join("&")}if(a){var s=r.indexOf("#");s!==-1&&(r=r.slice(0,s)),r+=(r.indexOf("?")===-1?"?":"&")+a}return r},Vh=q;function He(){this.handlers=[]}He.prototype.use=function(r,t,n){return this.handlers.push({fulfilled:r,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1};He.prototype.eject=function(r){this.handlers[r]&&(this.handlers[r]=null)};He.prototype.forEach=function(r){Vh.forEach(this.handlers,function(n){n!==null&&r(n)})};var kh=He,Jh=q,zh=function(r,t){Jh.forEach(r,function(a,i){i!==t&&i.toUpperCase()===t.toUpperCase()&&(r[t]=a,delete r[i])})},mn=function(r,t,n,a,i){return r.config=t,n&&(r.code=n),r.request=a,r.response=i,r.isAxiosError=!0,r.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},r},Zh=mn,bn=function(r,t,n,a,i){var s=new Error(r);return Zh(s,t,n,a,i)},Xh=bn,Qh=function(r,t,n){var a=n.config.validateStatus;!n.status||!a||a(n.status)?r(n):t(Xh("Request failed with status code "+n.status,n.config,null,n.request,n))},Ee=q,ep=Ee.isStandardBrowserEnv()?function(){return{write:function(t,n,a,i,s,f){var o=[];o.push(t+"="+encodeURIComponent(n)),Ee.isNumber(a)&&o.push("expires="+new Date(a).toGMTString()),Ee.isString(i)&&o.push("path="+i),Ee.isString(s)&&o.push("domain="+s),f===!0&&o.push("secure"),document.cookie=o.join("; ")},read:function(t){var n=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),rp=function(r){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(r)},tp=function(r,t){return t?r.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):r},np=rp,ap=tp,ip=function(r,t){return r&&!np(t)?ap(r,t):t},ke=q,sp=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],op=function(r){var t={},n,a,i;return r&&ke.forEach(r.split(`
|
|
2
|
-
`),function(f){if(i=f.indexOf(":"),n=ke.trim(f.substr(0,i)).toLowerCase(),a=ke.trim(f.substr(i+1)),n){if(t[n]&&sp.indexOf(n)>=0)return;n==="set-cookie"?t[n]=(t[n]?t[n]:[]).concat([a]):t[n]=t[n]?t[n]+", "+a:a}}),t},Tt=q,up=Tt.isStandardBrowserEnv()?function(){var r=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a"),n;function a(i){var s=i;return r&&(t.setAttribute("href",s),s=t.href),t.setAttribute("href",s),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return n=a(window.location.href),function(s){var f=Tt.isString(s)?a(s):s;return f.protocol===n.protocol&&f.host===n.host}}():function(){return function(){return!0}}(),Te=q,fp=Qh,cp=ep,lp=yn,dp=ip,hp=op,pp=up,Je=bn,Ot=function(r){return new Promise(function(n,a){var i=r.data,s=r.headers,f=r.responseType;Te.isFormData(i)&&delete s["Content-Type"];var o=new XMLHttpRequest;if(r.auth){var v=r.auth.username||"",m=r.auth.password?unescape(encodeURIComponent(r.auth.password)):"";s.Authorization="Basic "+btoa(v+":"+m)}var $=dp(r.baseURL,r.url);o.open(r.method.toUpperCase(),lp($,r.params,r.paramsSerializer),!0),o.timeout=r.timeout;function h(){if(!!o){var A="getAllResponseHeaders"in o?hp(o.getAllResponseHeaders()):null,p=!f||f==="text"||f==="json"?o.responseText:o.response,T={data:p,status:o.status,statusText:o.statusText,headers:A,config:r,request:o};fp(n,a,T),o=null}}if("onloadend"in o?o.onloadend=h:o.onreadystatechange=function(){!o||o.readyState!==4||o.status===0&&!(o.responseURL&&o.responseURL.indexOf("file:")===0)||setTimeout(h)},o.onabort=function(){!o||(a(Je("Request aborted",r,"ECONNABORTED",o)),o=null)},o.onerror=function(){a(Je("Network Error",r,null,o)),o=null},o.ontimeout=function(){var p="timeout of "+r.timeout+"ms exceeded";r.timeoutErrorMessage&&(p=r.timeoutErrorMessage),a(Je(p,r,r.transitional&&r.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",o)),o=null},Te.isStandardBrowserEnv()){var g=(r.withCredentials||pp($))&&r.xsrfCookieName?cp.read(r.xsrfCookieName):void 0;g&&(s[r.xsrfHeaderName]=g)}"setRequestHeader"in o&&Te.forEach(s,function(p,T){typeof i=="undefined"&&T.toLowerCase()==="content-type"?delete s[T]:o.setRequestHeader(T,p)}),Te.isUndefined(r.withCredentials)||(o.withCredentials=!!r.withCredentials),f&&f!=="json"&&(o.responseType=r.responseType),typeof r.onDownloadProgress=="function"&&o.addEventListener("progress",r.onDownloadProgress),typeof r.onUploadProgress=="function"&&o.upload&&o.upload.addEventListener("progress",r.onUploadProgress),r.cancelToken&&r.cancelToken.promise.then(function(p){!o||(o.abort(),a(p),o=null)}),i||(i=null),o.send(i)})},F=q,St=zh,vp=mn,gp={"Content-Type":"application/x-www-form-urlencoded"};function wt(e,r){!F.isUndefined(e)&&F.isUndefined(e["Content-Type"])&&(e["Content-Type"]=r)}function $p(){var e;return(typeof XMLHttpRequest!="undefined"||typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]")&&(e=Ot),e}function yp(e,r,t){if(F.isString(e))try{return(r||JSON.parse)(e),F.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(e)}var Ye={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:$p(),transformRequest:[function(r,t){return St(t,"Accept"),St(t,"Content-Type"),F.isFormData(r)||F.isArrayBuffer(r)||F.isBuffer(r)||F.isStream(r)||F.isFile(r)||F.isBlob(r)?r:F.isArrayBufferView(r)?r.buffer:F.isURLSearchParams(r)?(wt(t,"application/x-www-form-urlencoded;charset=utf-8"),r.toString()):F.isObject(r)||t&&t["Content-Type"]==="application/json"?(wt(t,"application/json"),yp(r)):r}],transformResponse:[function(r){var t=this.transitional,n=t&&t.silentJSONParsing,a=t&&t.forcedJSONParsing,i=!n&&this.responseType==="json";if(i||a&&F.isString(r)&&r.length)try{return JSON.parse(r)}catch(s){if(i)throw s.name==="SyntaxError"?vp(s,this,"E_JSON_PARSE"):s}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(r){return r>=200&&r<300}};Ye.headers={common:{Accept:"application/json, text/plain, */*"}};F.forEach(["delete","get","head"],function(r){Ye.headers[r]={}});F.forEach(["post","put","patch"],function(r){Ye.headers[r]=F.merge(gp)});var Or=Ye,mp=q,bp=Or,_p=function(r,t,n){var a=this||bp;return mp.forEach(n,function(s){r=s.call(a,r,t)}),r},_n=function(r){return!!(r&&r.__CANCEL__)},It=q,ze=_p,Ap=_n,Ep=Or;function Ze(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var Tp=function(r){Ze(r),r.headers=r.headers||{},r.data=ze.call(r,r.data,r.headers,r.transformRequest),r.headers=It.merge(r.headers.common||{},r.headers[r.method]||{},r.headers),It.forEach(["delete","get","head","post","put","patch","common"],function(a){delete r.headers[a]});var t=r.adapter||Ep.adapter;return t(r).then(function(a){return Ze(r),a.data=ze.call(r,a.data,a.headers,r.transformResponse),a},function(a){return Ap(a)||(Ze(r),a&&a.response&&(a.response.data=ze.call(r,a.response.data,a.response.headers,r.transformResponse))),Promise.reject(a)})},H=q,An=function(r,t){t=t||{};var n={},a=["url","method","data"],i=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],f=["validateStatus"];function o(h,g){return H.isPlainObject(h)&&H.isPlainObject(g)?H.merge(h,g):H.isPlainObject(g)?H.merge({},g):H.isArray(g)?g.slice():g}function v(h){H.isUndefined(t[h])?H.isUndefined(r[h])||(n[h]=o(void 0,r[h])):n[h]=o(r[h],t[h])}H.forEach(a,function(g){H.isUndefined(t[g])||(n[g]=o(void 0,t[g]))}),H.forEach(i,v),H.forEach(s,function(g){H.isUndefined(t[g])?H.isUndefined(r[g])||(n[g]=o(void 0,r[g])):n[g]=o(void 0,t[g])}),H.forEach(f,function(g){g in t?n[g]=o(r[g],t[g]):g in r&&(n[g]=o(void 0,r[g]))});var m=a.concat(i).concat(s).concat(f),$=Object.keys(r).concat(Object.keys(t)).filter(function(g){return m.indexOf(g)===-1});return H.forEach($,v),n};const Op="axios",Sp="0.21.4",wp="Promise based HTTP client for the browser and node.js",Ip="index.js",Cp={test:"grunt test",start:"node ./sandbox/server.js",build:"NODE_ENV=production grunt build",preversion:"npm test",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",postversion:"git push && git push --tags",examples:"node ./examples/server.js",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",fix:"eslint --fix lib/**/*.js"},Dp={type:"git",url:"https://github.com/axios/axios.git"},jp=["xhr","http","ajax","promise","node"],Lp="Matt Zabriskie",xp="MIT",Rp={url:"https://github.com/axios/axios/issues"},Np="https://axios-http.com",Pp={coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^8.2.1",sinon:"^4.5.0","terser-webpack-plugin":"^4.2.3",typescript:"^4.0.5","url-search-params":"^0.10.0",webpack:"^4.44.2","webpack-dev-server":"^3.11.0"},Up={"./lib/adapters/http.js":"./lib/adapters/xhr.js"},Mp="dist/axios.min.js",Fp="dist/axios.min.js",Bp="./index.d.ts",Hp={"follow-redirects":"^1.14.0"},Yp=[{path:"./dist/axios.min.js",threshold:"5kB"}];var Gp={name:Op,version:Sp,description:wp,main:Ip,scripts:Cp,repository:Dp,keywords:jp,author:Lp,license:xp,bugs:Rp,homepage:Np,devDependencies:Pp,browser:Up,jsdelivr:Mp,unpkg:Fp,typings:Bp,dependencies:Hp,bundlesize:Yp},En=Gp,Sr={};["object","boolean","number","function","string","symbol"].forEach(function(e,r){Sr[e]=function(n){return typeof n===e||"a"+(r<1?"n ":" ")+e}});var Ct={},qp=En.version.split(".");function Tn(e,r){for(var t=r?r.split("."):qp,n=e.split("."),a=0;a<3;a++){if(t[a]>n[a])return!0;if(t[a]<n[a])return!1}return!1}Sr.transitional=function(r,t,n){var a=t&&Tn(t);function i(s,f){return"[Axios v"+En.version+"] Transitional option '"+s+"'"+f+(n?". "+n:"")}return function(s,f,o){if(r===!1)throw new Error(i(f," has been removed in "+t));return a&&!Ct[f]&&(Ct[f]=!0,console.warn(i(f," has been deprecated since v"+t+" and will be removed in the near future"))),r?r(s,f,o):!0}};function Wp(e,r,t){if(typeof e!="object")throw new TypeError("options must be an object");for(var n=Object.keys(e),a=n.length;a-- >0;){var i=n[a],s=r[i];if(s){var f=e[i],o=f===void 0||s(f,i,e);if(o!==!0)throw new TypeError("option "+i+" must be "+o);continue}if(t!==!0)throw Error("Unknown option "+i)}}var Kp={isOlderVersion:Tn,assertOptions:Wp,validators:Sr},On=q,Vp=yn,Dt=kh,jt=Tp,Ge=An,Sn=Kp,ne=Sn.validators;function be(e){this.defaults=e,this.interceptors={request:new Dt,response:new Dt}}be.prototype.request=function(r){typeof r=="string"?(r=arguments[1]||{},r.url=arguments[0]):r=r||{},r=Ge(this.defaults,r),r.method?r.method=r.method.toLowerCase():this.defaults.method?r.method=this.defaults.method.toLowerCase():r.method="get";var t=r.transitional;t!==void 0&&Sn.assertOptions(t,{silentJSONParsing:ne.transitional(ne.boolean,"1.0.0"),forcedJSONParsing:ne.transitional(ne.boolean,"1.0.0"),clarifyTimeoutError:ne.transitional(ne.boolean,"1.0.0")},!1);var n=[],a=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(r)===!1||(a=a&&h.synchronous,n.unshift(h.fulfilled,h.rejected))});var i=[];this.interceptors.response.forEach(function(h){i.push(h.fulfilled,h.rejected)});var s;if(!a){var f=[jt,void 0];for(Array.prototype.unshift.apply(f,n),f=f.concat(i),s=Promise.resolve(r);f.length;)s=s.then(f.shift(),f.shift());return s}for(var o=r;n.length;){var v=n.shift(),m=n.shift();try{o=v(o)}catch($){m($);break}}try{s=jt(o)}catch($){return Promise.reject($)}for(;i.length;)s=s.then(i.shift(),i.shift());return s};be.prototype.getUri=function(r){return r=Ge(this.defaults,r),Vp(r.url,r.params,r.paramsSerializer).replace(/^\?/,"")};On.forEach(["delete","get","head","options"],function(r){be.prototype[r]=function(t,n){return this.request(Ge(n||{},{method:r,url:t,data:(n||{}).data}))}});On.forEach(["post","put","patch"],function(r){be.prototype[r]=function(t,n,a){return this.request(Ge(a||{},{method:r,url:t,data:n}))}});var kp=be;function wr(e){this.message=e}wr.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")};wr.prototype.__CANCEL__=!0;var wn=wr,Jp=wn;function je(e){if(typeof e!="function")throw new TypeError("executor must be a function.");var r;this.promise=new Promise(function(a){r=a});var t=this;e(function(a){t.reason||(t.reason=new Jp(a),r(t.reason))})}je.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};je.source=function(){var r,t=new je(function(a){r=a});return{token:t,cancel:r}};var zp=je,Zp=function(r){return function(n){return r.apply(null,n)}},Xp=function(r){return typeof r=="object"&&r.isAxiosError===!0},Lt=q,Qp=vn,we=kp,ev=An,rv=Or;function In(e){var r=new we(e),t=Qp(we.prototype.request,r);return Lt.extend(t,we.prototype,r),Lt.extend(t,r),t}var W=In(rv);W.Axios=we;W.create=function(r){return In(ev(W.defaults,r))};W.Cancel=wn;W.CancelToken=zp;W.isCancel=_n;W.all=function(r){return Promise.all(r)};W.spread=Zp;W.isAxiosError=Xp;Ar.exports=W;Ar.exports.default=W;var tv=Ar.exports;const nv=(e,r)=>{var t,n,a;return e&&((t=e==null?void 0:e.url)==null?void 0:t.length)>0&&(((n=e.url.find(i=>i.locale===r))==null?void 0:n.value)||((a=e.url.find(i=>i.locale==="*"))==null?void 0:a.value))||null},av=(e,r)=>{var t,n;return((t=e==null?void 0:e.find)==null?void 0:t.call(e,a=>a.venue===r))||((n=e==null?void 0:e.find)==null?void 0:n.call(e,a=>a.venue==="*"))};function Ir(e,r=600,t=!0,n,a){var j,u;if(!n||!a)throw new Error("baseUrl or tenant was not provided");const i=`${e}_${a}_${n}`,s=`${n.endsWith("/")?n.slice(0,-1):n}/cms-api/content/${a}/${e}`,f=((j=T())==null?void 0:j.value)||null,[o,v]=Y.useState(((u=T())==null?void 0:u.timestamp)||0),[m,$]=Y.useState(f||null),[h,g]=Y.useState(!1);function A(){tv.get(s).then(c=>{if(vr(c.data))throw new Error(`CMS data '${e}' is an empty object`);on(c.data,m)||$(c.data),h&&g(!1),t&&p(c.data)}).catch(c=>{console.error(c),g(!0)})}function p(c){const d=new Date().valueOf(),l=JSON.stringify({value:c,timestamp:d});localStorage.setItem(i,l),v(d)}function T(){try{const c=localStorage.getItem(i);if(c)return JSON.parse(c)}catch(c){console.warn(c)}return null}return Y.useEffect(()=>{new Date().valueOf()-o>r*1e3&&A()},[]),Le(A,r*1e3),{value:m,isError:h,isLoading:!h&&!m}}function Cn(e,r=600,t=!0,n,a,i){var f,o,v,m;if(!n||!a||!i)throw new Error("baseUrl, tenant or venue was not provided");const s=Ir(e,r,t,n,a);return{value:((o=(f=s.value)==null?void 0:f.find)==null?void 0:o.call(f,$=>$.venue===i))||((m=(v=s.value)==null?void 0:v.find)==null?void 0:m.call(v,$=>$.venue==="*"))||null,isError:s.isError}}function iv(e,r,t,n=300,a=!0){var m,$,h,g;const i=Y.useContext(Nt.ConfigContext);if(!i)throw new Error("Missing config context");const{value:s,isError:f}=Cn(e,n,a,i.baseUrl,i.tenant,r);let o=null,v=null;return s&&((m=s==null?void 0:s.url)==null?void 0:m.length)>0&&(o=(($=s.url.find(A=>A.locale===t))==null?void 0:$.value)||((h=s.url.find(A=>A.locale==="*"))==null?void 0:h.value)||null),!o&&s&&((g=s==null?void 0:s.url)==null?void 0:g.length)>0&&(v=s.url[0].value),{url:o,fallbackUrl:v,isError:f}}function Dn({kioskMediaId:e,kioskMediaType:r,intervalSeconds:t=600,withLocalStorage:n=!0,baseUrl:a,tenant:i,venue:s,locale:f}){var p;const{value:o,isError:v,isLoading:m}=Ir(e,t,n,a,i),$=(o==null?void 0:o[r])||[],h=av($,s),g=nv(h,f),A=!g&&h&&((p=h==null?void 0:h.url)==null?void 0:p.length)>0?h.url[0].value:null;return{url:g,fallbackUrl:A,mediaType:h==null?void 0:h.mediaType,isError:v,isLoading:m}}function sv({kioskMediaId:e,kioskMediaType:r,venue:t,intervalSeconds:n=600,withLocalStorage:a=!0}){const i=Y.useContext(Nt.ConfigContext);if(!i)throw new Error("Missing config context");const{i18n:{language:s}}=Rn.useTranslation();return Dn({kioskMediaId:e,kioskMediaType:r,intervalSeconds:n,withLocalStorage:a,venue:t,baseUrl:i.baseUrl,tenant:i.tenant,locale:s})}function ov(e,r){Y.useEffect(()=>{const t=n=>{!e.current||e.current.contains(n.target)||r(n)};return document.addEventListener("mousedown",t),document.addEventListener("touchstart",t),()=>{document.removeEventListener("mousedown",t),document.removeEventListener("touchstart",t)}},[e,r])}function uv(e){const[r,t]=Y.useState(pe(e==null?void 0:e.DINE_IN)),[n,a]=Y.useState(pe(e==null?void 0:e.TAKE_AWAY));function i(){const s=pe(e==null?void 0:e.DINE_IN),f=pe(e==null?void 0:e.TAKE_AWAY);s!==r&&(console.log("dine in open changed",r,"=>",s),t(s)),f!==n&&(console.log("take away open changed",n,"=>",f),a(f))}return Y.useEffect(()=>{i()},[e]),Le(i,6e4),{dineInOpen:r,takeAwayOpen:n,loaded:!!e}}var fr={},fv=e=>encodeURIComponent(e).replace(/[!'()*]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`),jn="%[a-f0-9]{2}",xt=new RegExp("("+jn+")|([^%]+?)","gi"),Rt=new RegExp("("+jn+")+","gi");function cr(e,r){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;r=r||1;var t=e.slice(0,r),n=e.slice(r);return Array.prototype.concat.call([],cr(t),cr(n))}function cv(e){try{return decodeURIComponent(e)}catch{for(var r=e.match(xt)||[],t=1;t<r.length;t++)e=cr(r,t).join(""),r=e.match(xt)||[];return e}}function lv(e){for(var r={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},t=Rt.exec(e);t;){try{r[t[0]]=decodeURIComponent(t[0])}catch{var n=cv(t[0]);n!==t[0]&&(r[t[0]]=n)}t=Rt.exec(e)}r["%C2"]="\uFFFD";for(var a=Object.keys(r),i=0;i<a.length;i++){var s=a[i];e=e.replace(new RegExp(s,"g"),r[s])}return e}var dv=function(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return lv(e)}},hv=(e,r)=>{if(!(typeof e=="string"&&typeof r=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(r==="")return[e];const t=e.indexOf(r);return t===-1?[e]:[e.slice(0,t),e.slice(t+r.length)]},pv=function(e,r){for(var t={},n=Object.keys(e),a=Array.isArray(r),i=0;i<n.length;i++){var s=n[i],f=e[s];(a?r.indexOf(s)!==-1:r(s,f,e))&&(t[s]=f)}return t};(function(e){const r=fv,t=dv,n=hv,a=pv,i=u=>u==null,s=Symbol("encodeFragmentIdentifier");function f(u){switch(u.arrayFormat){case"index":return c=>(d,l)=>{const y=d.length;return l===void 0||u.skipNull&&l===null||u.skipEmptyString&&l===""?d:l===null?[...d,[m(c,u),"[",y,"]"].join("")]:[...d,[m(c,u),"[",m(y,u),"]=",m(l,u)].join("")]};case"bracket":return c=>(d,l)=>l===void 0||u.skipNull&&l===null||u.skipEmptyString&&l===""?d:l===null?[...d,[m(c,u),"[]"].join("")]:[...d,[m(c,u),"[]=",m(l,u)].join("")];case"colon-list-separator":return c=>(d,l)=>l===void 0||u.skipNull&&l===null||u.skipEmptyString&&l===""?d:l===null?[...d,[m(c,u),":list="].join("")]:[...d,[m(c,u),":list=",m(l,u)].join("")];case"comma":case"separator":case"bracket-separator":{const c=u.arrayFormat==="bracket-separator"?"[]=":"=";return d=>(l,y)=>y===void 0||u.skipNull&&y===null||u.skipEmptyString&&y===""?l:(y=y===null?"":y,l.length===0?[[m(d,u),c,m(y,u)].join("")]:[[l,m(y,u)].join(u.arrayFormatSeparator)])}default:return c=>(d,l)=>l===void 0||u.skipNull&&l===null||u.skipEmptyString&&l===""?d:l===null?[...d,m(c,u)]:[...d,[m(c,u),"=",m(l,u)].join("")]}}function o(u){let c;switch(u.arrayFormat){case"index":return(d,l,y)=>{if(c=/\[(\d*)\]$/.exec(d),d=d.replace(/\[\d*\]$/,""),!c){y[d]=l;return}y[d]===void 0&&(y[d]={}),y[d][c[1]]=l};case"bracket":return(d,l,y)=>{if(c=/(\[\])$/.exec(d),d=d.replace(/\[\]$/,""),!c){y[d]=l;return}if(y[d]===void 0){y[d]=[l];return}y[d]=[].concat(y[d],l)};case"colon-list-separator":return(d,l,y)=>{if(c=/(:list)$/.exec(d),d=d.replace(/:list$/,""),!c){y[d]=l;return}if(y[d]===void 0){y[d]=[l];return}y[d]=[].concat(y[d],l)};case"comma":case"separator":return(d,l,y)=>{const w=typeof l=="string"&&l.includes(u.arrayFormatSeparator),O=typeof l=="string"&&!w&&$(l,u).includes(u.arrayFormatSeparator);l=O?$(l,u):l;const I=w||O?l.split(u.arrayFormatSeparator).map(x=>$(x,u)):l===null?l:$(l,u);y[d]=I};case"bracket-separator":return(d,l,y)=>{const w=/(\[\])$/.test(d);if(d=d.replace(/\[\]$/,""),!w){y[d]=l&&$(l,u);return}const O=l===null?[]:l.split(u.arrayFormatSeparator).map(I=>$(I,u));if(y[d]===void 0){y[d]=O;return}y[d]=[].concat(y[d],O)};default:return(d,l,y)=>{if(y[d]===void 0){y[d]=l;return}y[d]=[].concat(y[d],l)}}}function v(u){if(typeof u!="string"||u.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function m(u,c){return c.encode?c.strict?r(u):encodeURIComponent(u):u}function $(u,c){return c.decode?t(u):u}function h(u){return Array.isArray(u)?u.sort():typeof u=="object"?h(Object.keys(u)).sort((c,d)=>Number(c)-Number(d)).map(c=>u[c]):u}function g(u){const c=u.indexOf("#");return c!==-1&&(u=u.slice(0,c)),u}function A(u){let c="";const d=u.indexOf("#");return d!==-1&&(c=u.slice(d)),c}function p(u){u=g(u);const c=u.indexOf("?");return c===-1?"":u.slice(c+1)}function T(u,c){return c.parseNumbers&&!Number.isNaN(Number(u))&&typeof u=="string"&&u.trim()!==""?u=Number(u):c.parseBooleans&&u!==null&&(u.toLowerCase()==="true"||u.toLowerCase()==="false")&&(u=u.toLowerCase()==="true"),u}function j(u,c){c=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},c),v(c.arrayFormatSeparator);const d=o(c),l=Object.create(null);if(typeof u!="string"||(u=u.trim().replace(/^[?#&]/,""),!u))return l;for(const y of u.split("&")){if(y==="")continue;let[w,O]=n(c.decode?y.replace(/\+/g," "):y,"=");O=O===void 0?null:["comma","separator","bracket-separator"].includes(c.arrayFormat)?O:$(O,c),d($(w,c),O,l)}for(const y of Object.keys(l)){const w=l[y];if(typeof w=="object"&&w!==null)for(const O of Object.keys(w))w[O]=T(w[O],c);else l[y]=T(w,c)}return c.sort===!1?l:(c.sort===!0?Object.keys(l).sort():Object.keys(l).sort(c.sort)).reduce((y,w)=>{const O=l[w];return Boolean(O)&&typeof O=="object"&&!Array.isArray(O)?y[w]=h(O):y[w]=O,y},Object.create(null))}e.extract=p,e.parse=j,e.stringify=(u,c)=>{if(!u)return"";c=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},c),v(c.arrayFormatSeparator);const d=O=>c.skipNull&&i(u[O])||c.skipEmptyString&&u[O]==="",l=f(c),y={};for(const O of Object.keys(u))d(O)||(y[O]=u[O]);const w=Object.keys(y);return c.sort!==!1&&w.sort(c.sort),w.map(O=>{const I=u[O];return I===void 0?"":I===null?m(O,c):Array.isArray(I)?I.length===0&&c.arrayFormat==="bracket-separator"?m(O,c)+"[]":I.reduce(l(O),[]).join("&"):m(O,c)+"="+m(I,c)}).filter(O=>O.length>0).join("&")},e.parseUrl=(u,c)=>{c=Object.assign({decode:!0},c);const[d,l]=n(u,"#");return Object.assign({url:d.split("?")[0]||"",query:j(p(u),c)},c&&c.parseFragmentIdentifier&&l?{fragmentIdentifier:$(l,c)}:{})},e.stringifyUrl=(u,c)=>{c=Object.assign({encode:!0,strict:!0,[s]:!0},c);const d=g(u.url).split("?")[0]||"",l=e.extract(u.url),y=e.parse(l,{sort:!1}),w=Object.assign(y,u.query);let O=e.stringify(w,c);O&&(O=`?${O}`);let I=A(u.url);return u.fragmentIdentifier&&(I=`#${c[s]?m(u.fragmentIdentifier,c):u.fragmentIdentifier}`),`${d}${O}${I}`},e.pick=(u,c,d)=>{d=Object.assign({parseFragmentIdentifier:!0,[s]:!1},d);const{url:l,query:y,fragmentIdentifier:w}=e.parseUrl(u,d);return e.stringifyUrl({url:l,query:a(y,c),fragmentIdentifier:w},d)},e.exclude=(u,c,d)=>{const l=Array.isArray(c)?y=>!c.includes(y):(y,w)=>!c(y,w);return e.pick(u,l,d)}})(fr);const vv=[".png",".jpg",".jpeg",".webp",".bmp",".tiff"];function Ln(e,r=500){const t=fr.parseUrl(e);if(!(e.startsWith("https://orderingstackmedia.blob.core.windows.net/pictures")||e.startsWith("https://orderingstack-mmedia-tools.azurewebsites.net/api/img/")))return e;const n=t.url.substring(t.url.lastIndexOf("."));return vv.includes(n)?fr.stringifyUrl({url:t.url.replace("https://orderingstackmedia.blob.core.windows.net/pictures/","https://orderingstack-mmedia-tools.azurewebsites.net/api/img/"),query:{...t.query,w:r}}):e}function gv(e,r=500){return Ln(e,r)}function xn(e){let r=0;return e==null||e.forEach(t=>r+=Number(t.discountPrice)),r}function $v(e){return xn(e.discounts)}function yv(e,r,t=",",n=2){return`${Number(e).toFixed(n).replace(".",t)}${r?"\xA0"+r:""}`}exports.addDiscounts=xn;exports.formatPrice=yv;exports.getGroupedBucketLines=Dh;exports.getMediaUrl=Ln;exports.groupOrderLines=_r;exports.isChannelOpen=pe;exports.summarizeLineDiscounts=$v;exports.useAvailability=uc;exports.useCms=Ir;exports.useDisplayPrice=Ih;exports.useGroupOrderLines=Ch;exports.useInterval=Le;exports.useKioskChannelsAvailability=uv;exports.useKioskMediaCms=Dn;exports.useKioskMediaCmsWithContext=sv;exports.useLocalizedVenueMedia=iv;exports.useMediaUrl=gv;exports.useOnClickOutside=ov;exports.useVenueCms=Cn;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var G=require("react"),Pt=require("@orderingstack/ordering-core-react"),Mn=require("react-i18next");function Le(e,r){const t=G.useRef(),[n,a]=G.useState(null);return G.useEffect(()=>{t.current=e},[e]),G.useEffect(()=>{function i(){var s;(s=t.current)==null||s.call(t)}if(r!==null){const s=setInterval(i,r);return a(s),()=>{a(null),clearInterval(s)}}},[r]),()=>{n&&clearInterval(n)}}var X=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Fn=Object.prototype;function Bn(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||Fn;return e===t}var xe=Bn;function Hn(e,r){return function(t){return e(r(t))}}var Ut=Hn,Gn=Ut,qn=Gn(Object.keys,Object),Kn=qn,Yn=xe,Wn=Kn,kn=Object.prototype,Vn=kn.hasOwnProperty;function Jn(e){if(!Yn(e))return Wn(e);var r=[];for(var t in Object(e))Vn.call(e,t)&&t!="constructor"&&r.push(t);return r}var Mt=Jn,zn=typeof X=="object"&&X&&X.Object===Object&&X,Ft=zn,Zn=Ft,Xn=typeof self=="object"&&self&&self.Object===Object&&self,Qn=Zn||Xn||Function("return this")(),W=Qn,ea=W,ra=ea.Symbol,Re=ra,Dr=Re,Bt=Object.prototype,ta=Bt.hasOwnProperty,na=Bt.toString,he=Dr?Dr.toStringTag:void 0;function aa(e){var r=ta.call(e,he),t=e[he];try{e[he]=void 0;var n=!0}catch{}var a=na.call(e);return n&&(r?e[he]=t:delete e[he]),a}var ia=aa,sa=Object.prototype,oa=sa.toString;function ua(e){return oa.call(e)}var fa=ua,jr=Re,ca=ia,la=fa,da="[object Null]",ha="[object Undefined]",Lr=jr?jr.toStringTag:void 0;function pa(e){return e==null?e===void 0?ha:da:Lr&&Lr in Object(e)?ca(e):la(e)}var Ne=pa;function va(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var $e=va,ga=Ne,$a=$e,ya="[object AsyncFunction]",ma="[object Function]",ba="[object GeneratorFunction]",_a="[object Proxy]";function Aa(e){if(!$a(e))return!1;var r=ga(e);return r==ma||r==ba||r==ya||r==_a}var Ht=Aa,Ea=W,Oa=Ea["__core-js_shared__"],Ta=Oa,Ye=Ta,xr=function(){var e=/[^.]+$/.exec(Ye&&Ye.keys&&Ye.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Sa(e){return!!xr&&xr in e}var wa=Sa,Ca=Function.prototype,Ia=Ca.toString;function Da(e){if(e!=null){try{return Ia.call(e)}catch{}try{return e+""}catch{}}return""}var Gt=Da,ja=Ht,La=wa,xa=$e,Ra=Gt,Na=/[\\^$.*+?()[\]{}|]/g,Pa=/^\[object .+?Constructor\]$/,Ua=Function.prototype,Ma=Object.prototype,Fa=Ua.toString,Ba=Ma.hasOwnProperty,Ha=RegExp("^"+Fa.call(Ba).replace(Na,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ga(e){if(!xa(e)||La(e))return!1;var r=ja(e)?Ha:Pa;return r.test(Ra(e))}var qa=Ga;function Ka(e,r){return e==null?void 0:e[r]}var Ya=Ka,Wa=qa,ka=Ya;function Va(e,r){var t=ka(e,r);return Wa(t)?t:void 0}var Q=Va,Ja=Q,za=W,Za=Ja(za,"DataView"),Xa=Za,Qa=Q,ei=W,ri=Qa(ei,"Map"),lr=ri,ti=Q,ni=W,ai=ti(ni,"Promise"),ii=ai,si=Q,oi=W,ui=si(oi,"Set"),fi=ui,ci=Q,li=W,di=ci(li,"WeakMap"),hi=di,Xe=Xa,Qe=lr,er=ii,rr=fi,tr=hi,qt=Ne,ie=Gt,Rr="[object Map]",pi="[object Object]",Nr="[object Promise]",Pr="[object Set]",Ur="[object WeakMap]",Mr="[object DataView]",vi=ie(Xe),gi=ie(Qe),$i=ie(er),yi=ie(rr),mi=ie(tr),Z=qt;(Xe&&Z(new Xe(new ArrayBuffer(1)))!=Mr||Qe&&Z(new Qe)!=Rr||er&&Z(er.resolve())!=Nr||rr&&Z(new rr)!=Pr||tr&&Z(new tr)!=Ur)&&(Z=function(e){var r=qt(e),t=r==pi?e.constructor:void 0,n=t?ie(t):"";if(n)switch(n){case vi:return Mr;case gi:return Rr;case $i:return Nr;case yi:return Pr;case mi:return Ur}return r});var ye=Z;function bi(e){return e!=null&&typeof e=="object"}var se=bi,_i=Ne,Ai=se,Ei="[object Arguments]";function Oi(e){return Ai(e)&&_i(e)==Ei}var Ti=Oi,Fr=Ti,Si=se,Kt=Object.prototype,wi=Kt.hasOwnProperty,Ci=Kt.propertyIsEnumerable,Ii=Fr(function(){return arguments}())?Fr:function(e){return Si(e)&&wi.call(e,"callee")&&!Ci.call(e,"callee")},Yt=Ii,Di=Array.isArray,me=Di,ji=9007199254740991;function Li(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ji}var Wt=Li,xi=Ht,Ri=Wt;function Ni(e){return e!=null&&Ri(e.length)&&!xi(e)}var dr=Ni,ae={exports:{}};function Pi(){return!1}var Ui=Pi;(function(e,r){var t=W,n=Ui,a=r&&!r.nodeType&&r,i=a&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===a,f=s?t.Buffer:void 0,o=f?f.isBuffer:void 0,v=o||n;e.exports=v})(ae,ae.exports);var Mi=Ne,Fi=Wt,Bi=se,Hi="[object Arguments]",Gi="[object Array]",qi="[object Boolean]",Ki="[object Date]",Yi="[object Error]",Wi="[object Function]",ki="[object Map]",Vi="[object Number]",Ji="[object Object]",zi="[object RegExp]",Zi="[object Set]",Xi="[object String]",Qi="[object WeakMap]",es="[object ArrayBuffer]",rs="[object DataView]",ts="[object Float32Array]",ns="[object Float64Array]",as="[object Int8Array]",is="[object Int16Array]",ss="[object Int32Array]",os="[object Uint8Array]",us="[object Uint8ClampedArray]",fs="[object Uint16Array]",cs="[object Uint32Array]",P={};P[ts]=P[ns]=P[as]=P[is]=P[ss]=P[os]=P[us]=P[fs]=P[cs]=!0;P[Hi]=P[Gi]=P[es]=P[qi]=P[rs]=P[Ki]=P[Yi]=P[Wi]=P[ki]=P[Vi]=P[Ji]=P[zi]=P[Zi]=P[Xi]=P[Qi]=!1;function ls(e){return Bi(e)&&Fi(e.length)&&!!P[Mi(e)]}var ds=ls;function hs(e){return function(r){return e(r)}}var hr=hs,ve={exports:{}};(function(e,r){var t=Ft,n=r&&!r.nodeType&&r,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i&&t.process,f=function(){try{var o=a&&a.require&&a.require("util").types;return o||s&&s.binding&&s.binding("util")}catch{}}();e.exports=f})(ve,ve.exports);var ps=ds,vs=hr,Br=ve.exports,Hr=Br&&Br.isTypedArray,gs=Hr?vs(Hr):ps,pr=gs,$s=Mt,ys=ye,ms=Yt,bs=me,_s=dr,As=ae.exports,Es=xe,Os=pr,Ts="[object Map]",Ss="[object Set]",ws=Object.prototype,Cs=ws.hasOwnProperty;function Is(e){if(e==null)return!0;if(_s(e)&&(bs(e)||typeof e=="string"||typeof e.splice=="function"||As(e)||Os(e)||ms(e)))return!e.length;var r=ys(e);if(r==Ts||r==Ss)return!e.size;if(Es(e))return!$s(e).length;for(var t in e)if(Cs.call(e,t))return!1;return!0}var vr=Is,kt={exports:{}};(function(e,r){(function(t,n){e.exports=n()})(X,function(){var t="minute",n=/[+-]\d\d(?::?\d\d)?/g,a=/([+-]|\d\d)/g;return function(i,s,f){var o=s.prototype;f.utc=function(p){var O={date:p,utc:!0,args:arguments};return new s(O)},o.utc=function(p){var O=f(this.toDate(),{locale:this.$L,utc:!0});return p?O.add(this.utcOffset(),t):O},o.local=function(){return f(this.toDate(),{locale:this.$L,utc:!1})};var v=o.parse;o.parse=function(p){p.utc&&(this.$u=!0),this.$utils().u(p.$offset)||(this.$offset=p.$offset),v.call(this,p)};var m=o.init;o.init=function(){if(this.$u){var p=this.$d;this.$y=p.getUTCFullYear(),this.$M=p.getUTCMonth(),this.$D=p.getUTCDate(),this.$W=p.getUTCDay(),this.$H=p.getUTCHours(),this.$m=p.getUTCMinutes(),this.$s=p.getUTCSeconds(),this.$ms=p.getUTCMilliseconds()}else m.call(this)};var $=o.utcOffset;o.utcOffset=function(p,O){var j=this.$utils().u;if(j(p))return this.$u?0:j(this.$offset)?$.call(this):this.$offset;if(typeof p=="string"&&(p=function(l){l===void 0&&(l="");var y=l.match(n);if(!y)return null;var w=(""+y[0]).match(a)||["-",0,0],T=w[0],C=60*+w[1]+ +w[2];return C===0?0:T==="+"?C:-C}(p),p===null))return this;var u=Math.abs(p)<=16?60*p:p,c=this;if(O)return c.$offset=u,c.$u=p===0,c;if(p!==0){var d=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(c=this.local().add(u+d,t)).$offset=u,c.$x.$localOffset=d}else c=this.utc();return c};var h=o.format;o.format=function(p){var O=p||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,O)},o.valueOf=function(){var p=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*p},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var g=o.toDate;o.toDate=function(p){return p==="s"&&this.$offset?f(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var A=o.diff;o.diff=function(p,O,j){if(p&&this.$u===p.$u)return A.call(this,p,O,j);var u=this.local(),c=f(p).local();return A.call(u,c,O,j)}}})})(kt);var Ds=kt.exports,Vt={exports:{}};(function(e,r){(function(t,n){e.exports=n()})(X,function(){var t={year:0,month:1,day:2,hour:3,minute:4,second:5},n={};return function(a,i,s){var f,o=function(h,g,A){A===void 0&&(A={});var p=new Date(h),O=function(j,u){u===void 0&&(u={});var c=u.timeZoneName||"short",d=j+"|"+c,l=n[d];return l||(l=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:j,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:c}),n[d]=l),l}(g,A);return O.formatToParts(p)},v=function(h,g){for(var A=o(h,g),p=[],O=0;O<A.length;O+=1){var j=A[O],u=j.type,c=j.value,d=t[u];d>=0&&(p[d]=parseInt(c,10))}var l=p[3],y=l===24?0:l,w=p[0]+"-"+p[1]+"-"+p[2]+" "+y+":"+p[4]+":"+p[5]+":000",T=+h;return(s.utc(w).valueOf()-(T-=T%1e3))/6e4},m=i.prototype;m.tz=function(h,g){h===void 0&&(h=f);var A=this.utcOffset(),p=this.toDate(),O=p.toLocaleString("en-US",{timeZone:h}),j=Math.round((p-new Date(O))/1e3/60),u=s(O).$set("millisecond",this.$ms).utcOffset(15*-Math.round(p.getTimezoneOffset()/15)-j,!0);if(g){var c=u.utcOffset();u=u.add(A-c,"minute")}return u.$x.$timezone=h,u},m.offsetName=function(h){var g=this.$x.$timezone||s.tz.guess(),A=o(this.valueOf(),g,{timeZoneName:h}).find(function(p){return p.type.toLowerCase()==="timezonename"});return A&&A.value};var $=m.startOf;m.startOf=function(h,g){if(!this.$x||!this.$x.$timezone)return $.call(this,h,g);var A=s(this.format("YYYY-MM-DD HH:mm:ss:SSS"));return $.call(A,h,g).tz(this.$x.$timezone,!0)},s.tz=function(h,g,A){var p=A&&g,O=A||g||f,j=v(+s(),O);if(typeof h!="string")return s(h).tz(O);var u=function(y,w,T){var C=y-60*w*1e3,x=v(C,T);if(w===x)return[C,w];var V=v(C-=60*(x-w)*1e3,T);return x===V?[C,x]:[y-60*Math.min(x,V)*1e3,Math.max(x,V)]}(s.utc(h,p).valueOf(),j,O),c=u[0],d=u[1],l=s(c).utcOffset(d);return l.$x.$timezone=O,l},s.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},s.tz.setDefault=function(h){f=h}}})})(Vt);var js=Vt.exports,Jt={exports:{}};(function(e,r){(function(t,n){e.exports=n()})(X,function(){var t=1e3,n=6e4,a=36e5,i="millisecond",s="second",f="minute",o="hour",v="day",m="week",$="month",h="quarter",g="year",A="date",p="Invalid Date",O=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,j=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,u={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},c=function(L,E,b){var S=String(L);return!S||S.length>=E?L:""+Array(E+1-S.length).join(b)+L},d={s:c,z:function(L){var E=-L.utcOffset(),b=Math.abs(E),S=Math.floor(b/60),_=b%60;return(E<=0?"+":"-")+c(S,2,"0")+":"+c(_,2,"0")},m:function L(E,b){if(E.date()<b.date())return-L(b,E);var S=12*(b.year()-E.year())+(b.month()-E.month()),_=E.clone().add(S,$),D=b-_<0,I=E.clone().add(S+(D?-1:1),$);return+(-(S+(b-_)/(D?_-I:I-_))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:$,y:g,w:m,d:v,D:A,h:o,m:f,s,ms:i,Q:h}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},l="en",y={};y[l]=u;var w=function(L){return L instanceof V},T=function L(E,b,S){var _;if(!E)return l;if(typeof E=="string"){var D=E.toLowerCase();y[D]&&(_=D),b&&(y[D]=b,_=D);var I=E.split("-");if(!_&&I.length>1)return L(I[0])}else{var R=E.name;y[R]=E,_=R}return!S&&_&&(l=_),_||!S&&l},C=function(L,E){if(w(L))return L.clone();var b=typeof E=="object"?E:{};return b.date=L,b.args=arguments,new V(b)},x=d;x.l=T,x.i=w,x.w=function(L,E){return C(L,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var V=function(){function L(b){this.$L=T(b.locale,null,!0),this.parse(b)}var E=L.prototype;return E.parse=function(b){this.$d=function(S){var _=S.date,D=S.utc;if(_===null)return new Date(NaN);if(x.u(_))return new Date;if(_ instanceof Date)return new Date(_);if(typeof _=="string"&&!/Z$/i.test(_)){var I=_.match(O);if(I){var R=I[2]-1||0,M=(I[7]||"0").substring(0,3);return D?new Date(Date.UTC(I[1],R,I[3]||1,I[4]||0,I[5]||0,I[6]||0,M)):new Date(I[1],R,I[3]||1,I[4]||0,I[5]||0,I[6]||0,M)}}return new Date(_)}(b),this.$x=b.x||{},this.init()},E.init=function(){var b=this.$d;this.$y=b.getFullYear(),this.$M=b.getMonth(),this.$D=b.getDate(),this.$W=b.getDay(),this.$H=b.getHours(),this.$m=b.getMinutes(),this.$s=b.getSeconds(),this.$ms=b.getMilliseconds()},E.$utils=function(){return x},E.isValid=function(){return this.$d.toString()!==p},E.isSame=function(b,S){var _=C(b);return this.startOf(S)<=_&&_<=this.endOf(S)},E.isAfter=function(b,S){return C(b)<this.startOf(S)},E.isBefore=function(b,S){return this.endOf(S)<C(b)},E.$g=function(b,S,_){return x.u(b)?this[S]:this.set(_,b)},E.unix=function(){return Math.floor(this.valueOf()/1e3)},E.valueOf=function(){return this.$d.getTime()},E.startOf=function(b,S){var _=this,D=!!x.u(S)||S,I=x.p(b),R=function(re,q){var z=x.w(_.$u?Date.UTC(_.$y,q,re):new Date(_.$y,q,re),_);return D?z:z.endOf(v)},M=function(re,q){return x.w(_.toDate()[re].apply(_.toDate("s"),(D?[0,0,0,0]:[23,59,59,999]).slice(q)),_)},U=this.$W,B=this.$M,J=this.$D,k="set"+(this.$u?"UTC":"");switch(I){case g:return D?R(1,0):R(31,11);case $:return D?R(1,B):R(0,B+1);case m:var le=this.$locale().weekStart||0,de=(U<le?U+7:U)-le;return R(D?J-de:J+(6-de),B);case v:case A:return M(k+"Hours",0);case o:return M(k+"Minutes",1);case f:return M(k+"Seconds",2);case s:return M(k+"Milliseconds",3);default:return this.clone()}},E.endOf=function(b){return this.startOf(b,!1)},E.$set=function(b,S){var _,D=x.p(b),I="set"+(this.$u?"UTC":""),R=(_={},_[v]=I+"Date",_[A]=I+"Date",_[$]=I+"Month",_[g]=I+"FullYear",_[o]=I+"Hours",_[f]=I+"Minutes",_[s]=I+"Seconds",_[i]=I+"Milliseconds",_)[D],M=D===v?this.$D+(S-this.$W):S;if(D===$||D===g){var U=this.clone().set(A,1);U.$d[R](M),U.init(),this.$d=U.set(A,Math.min(this.$D,U.daysInMonth())).$d}else R&&this.$d[R](M);return this.init(),this},E.set=function(b,S){return this.clone().$set(b,S)},E.get=function(b){return this[x.p(b)]()},E.add=function(b,S){var _,D=this;b=Number(b);var I=x.p(S),R=function(B){var J=C(D);return x.w(J.date(J.date()+Math.round(B*b)),D)};if(I===$)return this.set($,this.$M+b);if(I===g)return this.set(g,this.$y+b);if(I===v)return R(1);if(I===m)return R(7);var M=(_={},_[f]=n,_[o]=a,_[s]=t,_)[I]||1,U=this.$d.getTime()+b*M;return x.w(U,this)},E.subtract=function(b,S){return this.add(-1*b,S)},E.format=function(b){var S=this,_=this.$locale();if(!this.isValid())return _.invalidDate||p;var D=b||"YYYY-MM-DDTHH:mm:ssZ",I=x.z(this),R=this.$H,M=this.$m,U=this.$M,B=_.weekdays,J=_.months,k=function(q,z,Ke,_e){return q&&(q[z]||q(S,D))||Ke[z].slice(0,_e)},le=function(q){return x.s(R%12||12,q,"0")},de=_.meridiem||function(q,z,Ke){var _e=q<12?"AM":"PM";return Ke?_e.toLowerCase():_e},re={YY:String(this.$y).slice(-2),YYYY:this.$y,M:U+1,MM:x.s(U+1,2,"0"),MMM:k(_.monthsShort,U,J,3),MMMM:k(J,U),D:this.$D,DD:x.s(this.$D,2,"0"),d:String(this.$W),dd:k(_.weekdaysMin,this.$W,B,2),ddd:k(_.weekdaysShort,this.$W,B,3),dddd:B[this.$W],H:String(R),HH:x.s(R,2,"0"),h:le(1),hh:le(2),a:de(R,M,!0),A:de(R,M,!1),m:String(M),mm:x.s(M,2,"0"),s:String(this.$s),ss:x.s(this.$s,2,"0"),SSS:x.s(this.$ms,3,"0"),Z:I};return D.replace(j,function(q,z){return z||re[q]||I.replace(":","")})},E.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},E.diff=function(b,S,_){var D,I=x.p(S),R=C(b),M=(R.utcOffset()-this.utcOffset())*n,U=this-R,B=x.m(this,R);return B=(D={},D[g]=B/12,D[$]=B,D[h]=B/3,D[m]=(U-M)/6048e5,D[v]=(U-M)/864e5,D[o]=U/a,D[f]=U/n,D[s]=U/t,D)[I]||U,_?B:x.a(B)},E.daysInMonth=function(){return this.endOf($).$D},E.$locale=function(){return y[this.$L]},E.locale=function(b,S){if(!b)return this.$L;var _=this.clone(),D=T(b,S,!0);return D&&(_.$L=D),_},E.clone=function(){return x.w(this.$d,this)},E.toDate=function(){return new Date(this.valueOf())},E.toJSON=function(){return this.isValid()?this.toISOString():null},E.toISOString=function(){return this.$d.toISOString()},E.toString=function(){return this.$d.toUTCString()},L}(),Ir=V.prototype;return C.prototype=Ir,[["$ms",i],["$s",s],["$m",f],["$H",o],["$W",v],["$M",$],["$y",g],["$D",A]].forEach(function(L){Ir[L[1]]=function(E){return this.$g(E,L[0],L[1])}}),C.extend=function(L,E){return L.$i||(L(E,V,C),L.$i=!0),C},C.locale=T,C.isDayjs=w,C.unix=function(L){return C(1e3*L)},C.en=y[l],C.Ls=y,C.p={},C})})(Jt);var ge=Jt.exports;ge.extend(Ds);ge.extend(js);const zt=["SUN","MON","TUE","WED","THU","FRI","SAT"],Ce=e=>{const[r,t]=e.split(":");return{hour:parseInt(r||"0",10),minutes:parseInt(t||"0",10)}};function nr(e,r,t){const{availability:n}=e;if(!n)return!0;if(vr(n))return!1;const a=t?ge(t).tz(r):ge().tz(r),i=a.day(),s=n[zt[i]];if(!Array.isArray(s)||s.length!==2)return!1;const f=a.hour(),o=a.minute(),v=Ce(s[0]),m=Ce(s[1]);return f<v.hour||f===v.hour&&o<v.minutes?!1:!(f>m.hour||f===m.hour&&o>m.minutes)}const ar=(e,r=void 0,t=void 0,n=!1)=>n?e.map(i=>{let s;return Array.isArray(i.items)&&(s=ar(i.items,r,t,n)),{...i,items:s,outsideAvailabilitySlot:!nr(i,r,t)||(s==null?void 0:s.every(f=>f.outsideAvailabilitySlot))||!1}}):e.filter(i=>nr(i,r,t)).map(i=>Array.isArray(i.items)?{...i,items:ar(i.items,r,t)}:i),Gr=(e,r=void 0,t=void 0,n=!1)=>{let a=[];return e.forEach(i=>{if(!Array.isArray(i.items)){a.push(i);return}const s=ar(i.items,r,t,n);s.length>0&&a.push({...i,items:s})}),n&&(a=a.map(i=>!i.items||!Array.isArray(i.items)?i:{...i,outsideAvailabilitySlot:!nr(i,r,t)||i.items.every(s=>s.outsideAvailabilitySlot)})),a};function pe(e){const r=e==null?void 0:e.week;if(!e||!e.active||!r)return!1;const t=ge(),n=t.day(),a=r[zt[n]];return a?a.some(i=>Ls(t,i)):!1}function Ls(e,r){const t=e.hour(),n=e.minute(),a=Ce(r.from),i=Ce(r.to);return t<a.hour||t===a.hour&&n<a.minutes?!1:!(t>i.hour||t===i.hour&&n>i.minutes)}function xs(){this.__data__=[],this.size=0}var Rs=xs;function Ns(e,r){return e===r||e!==e&&r!==r}var gr=Ns,Ps=gr;function Us(e,r){for(var t=e.length;t--;)if(Ps(e[t][0],r))return t;return-1}var Pe=Us,Ms=Pe,Fs=Array.prototype,Bs=Fs.splice;function Hs(e){var r=this.__data__,t=Ms(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():Bs.call(r,t,1),--this.size,!0}var Gs=Hs,qs=Pe;function Ks(e){var r=this.__data__,t=qs(r,e);return t<0?void 0:r[t][1]}var Ys=Ks,Ws=Pe;function ks(e){return Ws(this.__data__,e)>-1}var Vs=ks,Js=Pe;function zs(e,r){var t=this.__data__,n=Js(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}var Zs=zs,Xs=Rs,Qs=Gs,eo=Ys,ro=Vs,to=Zs;function oe(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}oe.prototype.clear=Xs;oe.prototype.delete=Qs;oe.prototype.get=eo;oe.prototype.has=ro;oe.prototype.set=to;var Ue=oe,no=Ue;function ao(){this.__data__=new no,this.size=0}var io=ao;function so(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}var oo=so;function uo(e){return this.__data__.get(e)}var fo=uo;function co(e){return this.__data__.has(e)}var lo=co,ho=Q,po=ho(Object,"create"),Me=po,qr=Me;function vo(){this.__data__=qr?qr(null):{},this.size=0}var go=vo;function $o(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var yo=$o,mo=Me,bo="__lodash_hash_undefined__",_o=Object.prototype,Ao=_o.hasOwnProperty;function Eo(e){var r=this.__data__;if(mo){var t=r[e];return t===bo?void 0:t}return Ao.call(r,e)?r[e]:void 0}var Oo=Eo,To=Me,So=Object.prototype,wo=So.hasOwnProperty;function Co(e){var r=this.__data__;return To?r[e]!==void 0:wo.call(r,e)}var Io=Co,Do=Me,jo="__lodash_hash_undefined__";function Lo(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Do&&r===void 0?jo:r,this}var xo=Lo,Ro=go,No=yo,Po=Oo,Uo=Io,Mo=xo;function ue(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}ue.prototype.clear=Ro;ue.prototype.delete=No;ue.prototype.get=Po;ue.prototype.has=Uo;ue.prototype.set=Mo;var Fo=ue,Kr=Fo,Bo=Ue,Ho=lr;function Go(){this.size=0,this.__data__={hash:new Kr,map:new(Ho||Bo),string:new Kr}}var qo=Go;function Ko(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}var Yo=Ko,Wo=Yo;function ko(e,r){var t=e.__data__;return Wo(r)?t[typeof r=="string"?"string":"hash"]:t.map}var Fe=ko,Vo=Fe;function Jo(e){var r=Vo(this,e).delete(e);return this.size-=r?1:0,r}var zo=Jo,Zo=Fe;function Xo(e){return Zo(this,e).get(e)}var Qo=Xo,eu=Fe;function ru(e){return eu(this,e).has(e)}var tu=ru,nu=Fe;function au(e,r){var t=nu(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}var iu=au,su=qo,ou=zo,uu=Qo,fu=tu,cu=iu;function fe(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}fe.prototype.clear=su;fe.prototype.delete=ou;fe.prototype.get=uu;fe.prototype.has=fu;fe.prototype.set=cu;var Zt=fe,lu=Ue,du=lr,hu=Zt,pu=200;function vu(e,r){var t=this.__data__;if(t instanceof lu){var n=t.__data__;if(!du||n.length<pu-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new hu(n)}return t.set(e,r),this.size=t.size,this}var gu=vu,$u=Ue,yu=io,mu=oo,bu=fo,_u=lo,Au=gu;function ce(e){var r=this.__data__=new $u(e);this.size=r.size}ce.prototype.clear=yu;ce.prototype.delete=mu;ce.prototype.get=bu;ce.prototype.has=_u;ce.prototype.set=Au;var Xt=ce,Eu="__lodash_hash_undefined__";function Ou(e){return this.__data__.set(e,Eu),this}var Tu=Ou;function Su(e){return this.__data__.has(e)}var wu=Su,Cu=Zt,Iu=Tu,Du=wu;function Ie(e){var r=-1,t=e==null?0:e.length;for(this.__data__=new Cu;++r<t;)this.add(e[r])}Ie.prototype.add=Ie.prototype.push=Iu;Ie.prototype.has=Du;var ju=Ie;function Lu(e,r){for(var t=-1,n=e==null?0:e.length;++t<n;)if(r(e[t],t,e))return!0;return!1}var xu=Lu;function Ru(e,r){return e.has(r)}var Nu=Ru,Pu=ju,Uu=xu,Mu=Nu,Fu=1,Bu=2;function Hu(e,r,t,n,a,i){var s=t&Fu,f=e.length,o=r.length;if(f!=o&&!(s&&o>f))return!1;var v=i.get(e),m=i.get(r);if(v&&m)return v==r&&m==e;var $=-1,h=!0,g=t&Bu?new Pu:void 0;for(i.set(e,r),i.set(r,e);++$<f;){var A=e[$],p=r[$];if(n)var O=s?n(p,A,$,r,e,i):n(A,p,$,e,r,i);if(O!==void 0){if(O)continue;h=!1;break}if(g){if(!Uu(r,function(j,u){if(!Mu(g,u)&&(A===j||a(A,j,t,n,i)))return g.push(u)})){h=!1;break}}else if(!(A===p||a(A,p,t,n,i))){h=!1;break}}return i.delete(e),i.delete(r),h}var Qt=Hu,Gu=W,qu=Gu.Uint8Array,en=qu;function Ku(e){var r=-1,t=Array(e.size);return e.forEach(function(n,a){t[++r]=[a,n]}),t}var Yu=Ku;function Wu(e){var r=-1,t=Array(e.size);return e.forEach(function(n){t[++r]=n}),t}var ku=Wu,Yr=Re,Wr=en,Vu=gr,Ju=Qt,zu=Yu,Zu=ku,Xu=1,Qu=2,ef="[object Boolean]",rf="[object Date]",tf="[object Error]",nf="[object Map]",af="[object Number]",sf="[object RegExp]",of="[object Set]",uf="[object String]",ff="[object Symbol]",cf="[object ArrayBuffer]",lf="[object DataView]",kr=Yr?Yr.prototype:void 0,We=kr?kr.valueOf:void 0;function df(e,r,t,n,a,i,s){switch(t){case lf:if(e.byteLength!=r.byteLength||e.byteOffset!=r.byteOffset)return!1;e=e.buffer,r=r.buffer;case cf:return!(e.byteLength!=r.byteLength||!i(new Wr(e),new Wr(r)));case ef:case rf:case af:return Vu(+e,+r);case tf:return e.name==r.name&&e.message==r.message;case sf:case uf:return e==r+"";case nf:var f=zu;case of:var o=n&Xu;if(f||(f=Zu),e.size!=r.size&&!o)return!1;var v=s.get(e);if(v)return v==r;n|=Qu,s.set(e,r);var m=Ju(f(e),f(r),n,a,i,s);return s.delete(e),m;case ff:if(We)return We.call(e)==We.call(r)}return!1}var hf=df;function pf(e,r){for(var t=-1,n=r.length,a=e.length;++t<n;)e[a+t]=r[t];return e}var rn=pf,vf=rn,gf=me;function $f(e,r,t){var n=r(e);return gf(e)?n:vf(n,t(e))}var tn=$f;function yf(e,r){for(var t=-1,n=e==null?0:e.length,a=0,i=[];++t<n;){var s=e[t];r(s,t,e)&&(i[a++]=s)}return i}var mf=yf;function bf(){return[]}var nn=bf,_f=mf,Af=nn,Ef=Object.prototype,Of=Ef.propertyIsEnumerable,Vr=Object.getOwnPropertySymbols,Tf=Vr?function(e){return e==null?[]:(e=Object(e),_f(Vr(e),function(r){return Of.call(e,r)}))}:Af,$r=Tf;function Sf(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}var wf=Sf,Cf=9007199254740991,If=/^(?:0|[1-9]\d*)$/;function Df(e,r){var t=typeof e;return r=r==null?Cf:r,!!r&&(t=="number"||t!="symbol"&&If.test(e))&&e>-1&&e%1==0&&e<r}var jf=Df,Lf=wf,xf=Yt,Rf=me,Nf=ae.exports,Pf=jf,Uf=pr,Mf=Object.prototype,Ff=Mf.hasOwnProperty;function Bf(e,r){var t=Rf(e),n=!t&&xf(e),a=!t&&!n&&Nf(e),i=!t&&!n&&!a&&Uf(e),s=t||n||a||i,f=s?Lf(e.length,String):[],o=f.length;for(var v in e)(r||Ff.call(e,v))&&!(s&&(v=="length"||a&&(v=="offset"||v=="parent")||i&&(v=="buffer"||v=="byteLength"||v=="byteOffset")||Pf(v,o)))&&f.push(v);return f}var an=Bf,Hf=an,Gf=Mt,qf=dr;function Kf(e){return qf(e)?Hf(e):Gf(e)}var yr=Kf,Yf=tn,Wf=$r,kf=yr;function Vf(e){return Yf(e,kf,Wf)}var sn=Vf,Jr=sn,Jf=1,zf=Object.prototype,Zf=zf.hasOwnProperty;function Xf(e,r,t,n,a,i){var s=t&Jf,f=Jr(e),o=f.length,v=Jr(r),m=v.length;if(o!=m&&!s)return!1;for(var $=o;$--;){var h=f[$];if(!(s?h in r:Zf.call(r,h)))return!1}var g=i.get(e),A=i.get(r);if(g&&A)return g==r&&A==e;var p=!0;i.set(e,r),i.set(r,e);for(var O=s;++$<o;){h=f[$];var j=e[h],u=r[h];if(n)var c=s?n(u,j,h,r,e,i):n(j,u,h,e,r,i);if(!(c===void 0?j===u||a(j,u,t,n,i):c)){p=!1;break}O||(O=h=="constructor")}if(p&&!O){var d=e.constructor,l=r.constructor;d!=l&&"constructor"in e&&"constructor"in r&&!(typeof d=="function"&&d instanceof d&&typeof l=="function"&&l instanceof l)&&(p=!1)}return i.delete(e),i.delete(r),p}var Qf=Xf,ke=Xt,ec=Qt,rc=hf,tc=Qf,zr=ye,Zr=me,Xr=ae.exports,nc=pr,ac=1,Qr="[object Arguments]",et="[object Array]",Ae="[object Object]",ic=Object.prototype,rt=ic.hasOwnProperty;function sc(e,r,t,n,a,i){var s=Zr(e),f=Zr(r),o=s?et:zr(e),v=f?et:zr(r);o=o==Qr?Ae:o,v=v==Qr?Ae:v;var m=o==Ae,$=v==Ae,h=o==v;if(h&&Xr(e)){if(!Xr(r))return!1;s=!0,m=!1}if(h&&!m)return i||(i=new ke),s||nc(e)?ec(e,r,t,n,a,i):rc(e,r,o,t,n,a,i);if(!(t&ac)){var g=m&&rt.call(e,"__wrapped__"),A=$&&rt.call(r,"__wrapped__");if(g||A){var p=g?e.value():e,O=A?r.value():r;return i||(i=new ke),a(p,O,t,n,i)}}return h?(i||(i=new ke),tc(e,r,t,n,a,i)):!1}var oc=sc,uc=oc,tt=se;function on(e,r,t,n,a){return e===r?!0:e==null||r==null||!tt(e)&&!tt(r)?e!==e&&r!==r:uc(e,r,t,n,on,a)}var fc=on,cc=fc;function lc(e,r){return cc(e,r)}var un=lc;function fn(e){let r=0;return e==null||e.forEach(t=>r+=Number(t.discountPrice)),r}function dc(e){return fn(e.discounts)}function hc(e,r,t=",",n=2){return`${Number(e).toFixed(n).replace(".",t)}${r?"\xA0"+r:""}`}function cn(e,r){var a;const t=(a=e._)==null?void 0:a.enableKey;return t?!r||!Array.isArray(r)||r.length===0?!1:t.replace(/\s/g,"").split(",").some(i=>r.includes(i)):!0}function ln(e,r=!1,t=void 0,n=60){const[a,i]=G.useState(e&&Gr(e,t,void 0,r));Le(s,n*1e3);function s(){const f=e&&Gr(e,t,void 0,r);un(f,a)||(console.log("menu has changed",f),i(f))}return G.useEffect(s,[a,e]),a}function dn(e,r){return e.__||(e.__={}),e.__.isHiddenByEnableKey=!cn(e,r),e.items&&e.items.length>0&&(e.items=e.items.map(t=>dn(t,r))),e}function pc(e,r){if(!!e)return e.map(t=>dn(t,r))}function vc({originalMenu:e,markOnly:r=!1,timeZone:t,interval:n=60,enableKeys:a=[]}){const i=ln(e,r,t,n);return pc(i,a)}var nt;(function(e){e.UNINITIALIZED="UNINITIALIZED",e.PROCESSING="PROCESSING",e.PAID="PAID",e.FAILED="FAILED",e.PRINTING_RECEIPT="PRINTING_RECEIPT",e.PRINTING_RECEIPT_SUCCESS="PRINTING_RECEIPT_SUCCESS",e.SENDING_RECEIPT="SENDING_RECEIPT",e.SENDING_RECEIPT_SUCCESS="SENDING_RECEIPT_SUCCESS",e.ERROR="ERROR"})(nt||(nt={}));var at;(function(e){e.CAROUSEL="carousel",e.NORMAL="normal",e.IMAGE="image"})(at||(at={}));var ir;(function(e){e.GROUP="3e/group",e.PRODUCT="3e/product",e.CATEGORY="3e/group/category",e.OPTIONS="3e/group/options",e.CONFIG="3e/group/config",e.STATIC="3e/static",e.REF="3e/ref",e.QUERY="3e/query"})(ir||(ir={}));var it;(function(e){e.GROUP="group",e.PRODUCT="product"})(it||(it={}));var st;(function(e){e.TAKE_AWAY="TAKE_AWAY",e.DELIVERY="DELIVERY",e.DINE_IN="DINE_IN",e.DINE_IN_OPEN="DINE_IN_OPEN",e.GLOVO_DELIVERY="GLOVO_DELIVERY",e.GLOVO_TAKE_AWAY="GLOVO_TAKE_AWAY",e.JUSTEAT_DELIVERY="JUSTEAT_DELIVERY",e.JUSTEAT_TAKE_AWAY="JUSTEAT_TAKE_AWAY",e.UBER_DELIVERY="UBER_DELIVERY",e.UBER_TAKE_AWAY="UBER_TAKE_AWAY",e.UBER_DINE_IN="UBER_DINE_IN",e.BOLT_DELIVERY="BOLT_DELIVERY",e.BOLT_TAKE_AWAY="BOLT_TAKE_AWAY",e.WOLT_DELIVERY="WOLT_DELIVERY",e.WOLT_TAKE_AWAY="WOLT_TAKE_AWAY",e.WOLT_DINE_IN="WOLT_DINE_IN"})(st||(st={}));var ot;(function(e){e.NEW="NEW",e.COMPLETED="COMPLETED",e.VERIFIED="VERIFIED",e.DELIVER="DELIVER",e.DELIVERED="DELIVERED",e.CLOSED="CLOSED",e.ABANDONED="ABANDONED",e.CANCELLED="CANCELLED",e.PICKED="PICKED"})(ot||(ot={}));var ut;(function(e){e.CASH="CASH",e.CARD="CARD",e.COD="COD",e.TERMINAL="TERMINAL",e.EPAYMENT="EPAYMENT",e.COUPON="COUPON",e.WALLET="WALLET",e.PREAUTHORIZED="PREAUTHORIZED",e.RETURN="RETURN",e.EXTERNAL="EXTERNAL"})(ut||(ut={}));var ft;(function(e){e.KIOSK="KIOSK",e.WEB="WEB",e.JUST_EAT_TAKE_AWAY="JUSTEATTAKEAWAY",e.GLOVO="GLOVO",e.PYSZNE="PYSZNE",e.WOLT="WOLT",e.UBER="UBER",e.BOLT="BOLT"})(ft||(ft={}));var ct;(function(e){e.NEW="NEW",e.TECHNICAL="TECHNICAL",e.CONFIRMED="CONFIRMED",e.PROCESSING="PROCESSING",e.PROCESSED="PROCESSED",e.VOID="VOID",e.WASTE="WASTE"})(ct||(ct={}));var lt;(function(e){e.GROUP="group",e.PRODUCT="product"})(lt||(lt={}));var dt;(function(e){e.DINE_IN="DINE_IN",e.TAKE_AWAY="TAKE_AWAY",e.DELIVERY="DELIVERY",e.GLOVO="GLOVO",e.JUSTEAT="JUSTEAT",e.UBER="UBER",e.BOLT="BOLT",e.WOLT="WOLT"})(dt||(dt={}));var ht;(function(e){e.ORDER_EVENT_ERROR="OrderEventError",e.ORDER_APPLIED_EVENTS="OrderAppliedEvents",e.ORDER_EVENT_FISCAL="OrderEventFiscal",e.ORDER_UPSELL="OrderUpsell"})(ht||(ht={}));function gc(e,r){for(var t=-1,n=e==null?0:e.length;++t<n&&r(e[t],t,e)!==!1;);return e}var $c=gc,yc=Q,mc=function(){try{var e=yc(Object,"defineProperty");return e({},"",{}),e}catch{}}(),bc=mc,pt=bc;function _c(e,r,t){r=="__proto__"&&pt?pt(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}var hn=_c,Ac=hn,Ec=gr,Oc=Object.prototype,Tc=Oc.hasOwnProperty;function Sc(e,r,t){var n=e[r];(!(Tc.call(e,r)&&Ec(n,t))||t===void 0&&!(r in e))&&Ac(e,r,t)}var pn=Sc,wc=pn,Cc=hn;function Ic(e,r,t,n){var a=!t;t||(t={});for(var i=-1,s=r.length;++i<s;){var f=r[i],o=n?n(t[f],e[f],f,t,e):void 0;o===void 0&&(o=e[f]),a?Cc(t,f,o):wc(t,f,o)}return t}var Be=Ic,Dc=Be,jc=yr;function Lc(e,r){return e&&Dc(r,jc(r),e)}var xc=Lc;function Rc(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}var Nc=Rc,Pc=$e,Uc=xe,Mc=Nc,Fc=Object.prototype,Bc=Fc.hasOwnProperty;function Hc(e){if(!Pc(e))return Mc(e);var r=Uc(e),t=[];for(var n in e)n=="constructor"&&(r||!Bc.call(e,n))||t.push(n);return t}var Gc=Hc,qc=an,Kc=Gc,Yc=dr;function Wc(e){return Yc(e)?qc(e,!0):Kc(e)}var mr=Wc,kc=Be,Vc=mr;function Jc(e,r){return e&&kc(r,Vc(r),e)}var zc=Jc,sr={exports:{}};(function(e,r){var t=W,n=r&&!r.nodeType&&r,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i?t.Buffer:void 0,f=s?s.allocUnsafe:void 0;function o(v,m){if(m)return v.slice();var $=v.length,h=f?f($):new v.constructor($);return v.copy(h),h}e.exports=o})(sr,sr.exports);function Zc(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}var Xc=Zc,Qc=Be,el=$r;function rl(e,r){return Qc(e,el(e),r)}var tl=rl,nl=Ut,al=nl(Object.getPrototypeOf,Object),vn=al,il=rn,sl=vn,ol=$r,ul=nn,fl=Object.getOwnPropertySymbols,cl=fl?function(e){for(var r=[];e;)il(r,ol(e)),e=sl(e);return r}:ul,gn=cl,ll=Be,dl=gn;function hl(e,r){return ll(e,dl(e),r)}var pl=hl,vl=tn,gl=gn,$l=mr;function yl(e){return vl(e,$l,gl)}var ml=yl,bl=Object.prototype,_l=bl.hasOwnProperty;function Al(e){var r=e.length,t=new e.constructor(r);return r&&typeof e[0]=="string"&&_l.call(e,"index")&&(t.index=e.index,t.input=e.input),t}var El=Al,vt=en;function Ol(e){var r=new e.constructor(e.byteLength);return new vt(r).set(new vt(e)),r}var br=Ol,Tl=br;function Sl(e,r){var t=r?Tl(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}var wl=Sl,Cl=/\w*$/;function Il(e){var r=new e.constructor(e.source,Cl.exec(e));return r.lastIndex=e.lastIndex,r}var Dl=Il,gt=Re,$t=gt?gt.prototype:void 0,yt=$t?$t.valueOf:void 0;function jl(e){return yt?Object(yt.call(e)):{}}var Ll=jl,xl=br;function Rl(e,r){var t=r?xl(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}var Nl=Rl,Pl=br,Ul=wl,Ml=Dl,Fl=Ll,Bl=Nl,Hl="[object Boolean]",Gl="[object Date]",ql="[object Map]",Kl="[object Number]",Yl="[object RegExp]",Wl="[object Set]",kl="[object String]",Vl="[object Symbol]",Jl="[object ArrayBuffer]",zl="[object DataView]",Zl="[object Float32Array]",Xl="[object Float64Array]",Ql="[object Int8Array]",ed="[object Int16Array]",rd="[object Int32Array]",td="[object Uint8Array]",nd="[object Uint8ClampedArray]",ad="[object Uint16Array]",id="[object Uint32Array]";function sd(e,r,t){var n=e.constructor;switch(r){case Jl:return Pl(e);case Hl:case Gl:return new n(+e);case zl:return Ul(e,t);case Zl:case Xl:case Ql:case ed:case rd:case td:case nd:case ad:case id:return Bl(e,t);case ql:return new n;case Kl:case kl:return new n(e);case Yl:return Ml(e);case Wl:return new n;case Vl:return Fl(e)}}var od=sd,ud=$e,mt=Object.create,fd=function(){function e(){}return function(r){if(!ud(r))return{};if(mt)return mt(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}(),cd=fd,ld=cd,dd=vn,hd=xe;function pd(e){return typeof e.constructor=="function"&&!hd(e)?ld(dd(e)):{}}var vd=pd,gd=ye,$d=se,yd="[object Map]";function md(e){return $d(e)&&gd(e)==yd}var bd=md,_d=bd,Ad=hr,bt=ve.exports,_t=bt&&bt.isMap,Ed=_t?Ad(_t):_d,Od=Ed,Td=ye,Sd=se,wd="[object Set]";function Cd(e){return Sd(e)&&Td(e)==wd}var Id=Cd,Dd=Id,jd=hr,At=ve.exports,Et=At&&At.isSet,Ld=Et?jd(Et):Dd,xd=Ld,Rd=Xt,Nd=$c,Pd=pn,Ud=xc,Md=zc,Fd=sr.exports,Bd=Xc,Hd=tl,Gd=pl,qd=sn,Kd=ml,Yd=ye,Wd=El,kd=od,Vd=vd,Jd=me,zd=ae.exports,Zd=Od,Xd=$e,Qd=xd,eh=yr,rh=mr,th=1,nh=2,ah=4,$n="[object Arguments]",ih="[object Array]",sh="[object Boolean]",oh="[object Date]",uh="[object Error]",yn="[object Function]",fh="[object GeneratorFunction]",ch="[object Map]",lh="[object Number]",mn="[object Object]",dh="[object RegExp]",hh="[object Set]",ph="[object String]",vh="[object Symbol]",gh="[object WeakMap]",$h="[object ArrayBuffer]",yh="[object DataView]",mh="[object Float32Array]",bh="[object Float64Array]",_h="[object Int8Array]",Ah="[object Int16Array]",Eh="[object Int32Array]",Oh="[object Uint8Array]",Th="[object Uint8ClampedArray]",Sh="[object Uint16Array]",wh="[object Uint32Array]",N={};N[$n]=N[ih]=N[$h]=N[yh]=N[sh]=N[oh]=N[mh]=N[bh]=N[_h]=N[Ah]=N[Eh]=N[ch]=N[lh]=N[mn]=N[dh]=N[hh]=N[ph]=N[vh]=N[Oh]=N[Th]=N[Sh]=N[wh]=!0;N[uh]=N[yn]=N[gh]=!1;function Te(e,r,t,n,a,i){var s,f=r&th,o=r&nh,v=r&ah;if(t&&(s=a?t(e,n,a,i):t(e)),s!==void 0)return s;if(!Xd(e))return e;var m=Jd(e);if(m){if(s=Wd(e),!f)return Bd(e,s)}else{var $=Yd(e),h=$==yn||$==fh;if(zd(e))return Fd(e,f);if($==mn||$==$n||h&&!a){if(s=o||h?{}:Vd(e),!f)return o?Gd(e,Md(s,e)):Hd(e,Ud(s,e))}else{if(!N[$])return a?e:{};s=kd(e,$,f)}}i||(i=new Rd);var g=i.get(e);if(g)return g;i.set(e,s),Qd(e)?e.forEach(function(O){s.add(Te(O,r,t,O,e,i))}):Zd(e)&&e.forEach(function(O,j){s.set(j,Te(O,r,t,j,e,i))});var A=v?o?Kd:qd:o?rh:eh,p=m?void 0:A(e);return Nd(p||e,function(O,j){p&&(j=O,O=e[j]),Pd(s,j,Te(O,r,t,j,e,i))}),s}var Ch=Te,Ih=Ch,Dh=1,jh=4;function Lh(e){return Ih(e,Dh|jh)}var xh=Lh;function Rh(e,r){if(!r||!r.filter||!e||!e.filter||e.kind!==ir.CONFIG)return!0;if(e.filter&&e.items){const t=Object.values(e.filter).flat().filter(n=>{var a,i,s,f;return r.filter[(i=(a=e.items)==null?void 0:a[0])==null?void 0:i.fltCtx]&&Object.values(r.filter[(f=(s=e.items)==null?void 0:s[0])==null?void 0:f.fltCtx]).includes(n)});if(Array.isArray(t)&&t.length===0)return!1}return!0}const De=(e,r,t=0)=>{if(!e)return 0;let n=parseFloat(e.price)||0;const{items:a}=e,i=xh(r);return Rh(e,i)&&Array.isArray(a)&&a.forEach(s=>{let f=0;if(s.kind!=="3e/product")f=De(s,i,t+1);else{const{selected:o={}}=i,{selCtx:v,id:m}=s;v in o&&m in o[v]&&(f=De(s,i,t+1)*o[v][m],delete i.selected[v][m])}n+=f}),Math.round(100*n)/100},Nh=({product:e,state:r,selected:t,cheapestGroupOptionsProduct:n})=>{var o;const a=r?De(e,r):0,i=e.state&&!vr((o=e==null?void 0:e.state)==null?void 0:o.selected)?De(e,e.state):0,s=e.minPrice&&parseFloat(e.price)===a;let f=t||!!n||parseFloat(e.price)===0?a||i:parseFloat(e.price);return n!==void 0&&(f-=n),s&&e.minPrice&&(f=parseFloat(e.minPrice)),{displayPrice:f,showAsMinPrice:s,calculatedPriceDefaultProductState:i}};function _r(e){const r=[];return e.reduce((t,n)=>{if(t[n.hash]||(t[n.hash]={...n,quantity:0,discounted:0,discounts:[],firstProductQuantity:n.quantity,itemsToRemove:[]},r.push(t[n.hash])),t[n.hash].quantity+=n.quantity,t[n.hash].itemsToRemove.push(n.id),n.discounts){t[n.hash].discounts||(t[n.hash].discounts=[]),t[n.hash].discounts=t[n.hash].discounts.concat(n.discounts),t[n.hash].discounted=0;for(let a=0;a<t[n.hash].discounts.length;a+=1)t[n.hash].discounts[a]&&(t[n.hash].discounted+=parseFloat(t[n.hash].discounts[a].discountPrice))}return t},{}),r}function Ph(e){return _r(e)}function Uh(e){return!e||e.length===0?null:_r(e.flatMap(r=>r.lines))}var Ar={exports:{}},bn=function(r,t){return function(){for(var a=new Array(arguments.length),i=0;i<a.length;i++)a[i]=arguments[i];return r.apply(t,a)}},Mh=bn,ee=Object.prototype.toString;function Er(e){return ee.call(e)==="[object Array]"}function or(e){return typeof e=="undefined"}function Fh(e){return e!==null&&!or(e)&&e.constructor!==null&&!or(e.constructor)&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function Bh(e){return ee.call(e)==="[object ArrayBuffer]"}function Hh(e){return typeof FormData!="undefined"&&e instanceof FormData}function Gh(e){var r;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?r=ArrayBuffer.isView(e):r=e&&e.buffer&&e.buffer instanceof ArrayBuffer,r}function qh(e){return typeof e=="string"}function Kh(e){return typeof e=="number"}function _n(e){return e!==null&&typeof e=="object"}function Se(e){if(ee.call(e)!=="[object Object]")return!1;var r=Object.getPrototypeOf(e);return r===null||r===Object.prototype}function Yh(e){return ee.call(e)==="[object Date]"}function Wh(e){return ee.call(e)==="[object File]"}function kh(e){return ee.call(e)==="[object Blob]"}function An(e){return ee.call(e)==="[object Function]"}function Vh(e){return _n(e)&&An(e.pipe)}function Jh(e){return typeof URLSearchParams!="undefined"&&e instanceof URLSearchParams}function zh(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Zh(){return typeof navigator!="undefined"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window!="undefined"&&typeof document!="undefined"}function Or(e,r){if(!(e===null||typeof e=="undefined"))if(typeof e!="object"&&(e=[e]),Er(e))for(var t=0,n=e.length;t<n;t++)r.call(null,e[t],t,e);else for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&r.call(null,e[a],a,e)}function ur(){var e={};function r(a,i){Se(e[i])&&Se(a)?e[i]=ur(e[i],a):Se(a)?e[i]=ur({},a):Er(a)?e[i]=a.slice():e[i]=a}for(var t=0,n=arguments.length;t<n;t++)Or(arguments[t],r);return e}function Xh(e,r,t){return Or(r,function(a,i){t&&typeof a=="function"?e[i]=Mh(a,t):e[i]=a}),e}function Qh(e){return e.charCodeAt(0)===65279&&(e=e.slice(1)),e}var K={isArray:Er,isArrayBuffer:Bh,isBuffer:Fh,isFormData:Hh,isArrayBufferView:Gh,isString:qh,isNumber:Kh,isObject:_n,isPlainObject:Se,isUndefined:or,isDate:Yh,isFile:Wh,isBlob:kh,isFunction:An,isStream:Vh,isURLSearchParams:Jh,isStandardBrowserEnv:Zh,forEach:Or,merge:ur,extend:Xh,trim:zh,stripBOM:Qh},te=K;function Ot(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var En=function(r,t,n){if(!t)return r;var a;if(n)a=n(t);else if(te.isURLSearchParams(t))a=t.toString();else{var i=[];te.forEach(t,function(o,v){o===null||typeof o=="undefined"||(te.isArray(o)?v=v+"[]":o=[o],te.forEach(o,function($){te.isDate($)?$=$.toISOString():te.isObject($)&&($=JSON.stringify($)),i.push(Ot(v)+"="+Ot($))}))}),a=i.join("&")}if(a){var s=r.indexOf("#");s!==-1&&(r=r.slice(0,s)),r+=(r.indexOf("?")===-1?"?":"&")+a}return r},ep=K;function He(){this.handlers=[]}He.prototype.use=function(r,t,n){return this.handlers.push({fulfilled:r,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1};He.prototype.eject=function(r){this.handlers[r]&&(this.handlers[r]=null)};He.prototype.forEach=function(r){ep.forEach(this.handlers,function(n){n!==null&&r(n)})};var rp=He,tp=K,np=function(r,t){tp.forEach(r,function(a,i){i!==t&&i.toUpperCase()===t.toUpperCase()&&(r[t]=a,delete r[i])})},On=function(r,t,n,a,i){return r.config=t,n&&(r.code=n),r.request=a,r.response=i,r.isAxiosError=!0,r.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},r},ap=On,Tn=function(r,t,n,a,i){var s=new Error(r);return ap(s,t,n,a,i)},ip=Tn,sp=function(r,t,n){var a=n.config.validateStatus;!n.status||!a||a(n.status)?r(n):t(ip("Request failed with status code "+n.status,n.config,null,n.request,n))},Ee=K,op=Ee.isStandardBrowserEnv()?function(){return{write:function(t,n,a,i,s,f){var o=[];o.push(t+"="+encodeURIComponent(n)),Ee.isNumber(a)&&o.push("expires="+new Date(a).toGMTString()),Ee.isString(i)&&o.push("path="+i),Ee.isString(s)&&o.push("domain="+s),f===!0&&o.push("secure"),document.cookie=o.join("; ")},read:function(t){var n=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),up=function(r){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(r)},fp=function(r,t){return t?r.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):r},cp=up,lp=fp,dp=function(r,t){return r&&!cp(t)?lp(r,t):t},Ve=K,hp=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],pp=function(r){var t={},n,a,i;return r&&Ve.forEach(r.split(`
|
|
2
|
+
`),function(f){if(i=f.indexOf(":"),n=Ve.trim(f.substr(0,i)).toLowerCase(),a=Ve.trim(f.substr(i+1)),n){if(t[n]&&hp.indexOf(n)>=0)return;n==="set-cookie"?t[n]=(t[n]?t[n]:[]).concat([a]):t[n]=t[n]?t[n]+", "+a:a}}),t},Tt=K,vp=Tt.isStandardBrowserEnv()?function(){var r=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a"),n;function a(i){var s=i;return r&&(t.setAttribute("href",s),s=t.href),t.setAttribute("href",s),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return n=a(window.location.href),function(s){var f=Tt.isString(s)?a(s):s;return f.protocol===n.protocol&&f.host===n.host}}():function(){return function(){return!0}}(),Oe=K,gp=sp,$p=op,yp=En,mp=dp,bp=pp,_p=vp,Je=Tn,St=function(r){return new Promise(function(n,a){var i=r.data,s=r.headers,f=r.responseType;Oe.isFormData(i)&&delete s["Content-Type"];var o=new XMLHttpRequest;if(r.auth){var v=r.auth.username||"",m=r.auth.password?unescape(encodeURIComponent(r.auth.password)):"";s.Authorization="Basic "+btoa(v+":"+m)}var $=mp(r.baseURL,r.url);o.open(r.method.toUpperCase(),yp($,r.params,r.paramsSerializer),!0),o.timeout=r.timeout;function h(){if(!!o){var A="getAllResponseHeaders"in o?bp(o.getAllResponseHeaders()):null,p=!f||f==="text"||f==="json"?o.responseText:o.response,O={data:p,status:o.status,statusText:o.statusText,headers:A,config:r,request:o};gp(n,a,O),o=null}}if("onloadend"in o?o.onloadend=h:o.onreadystatechange=function(){!o||o.readyState!==4||o.status===0&&!(o.responseURL&&o.responseURL.indexOf("file:")===0)||setTimeout(h)},o.onabort=function(){!o||(a(Je("Request aborted",r,"ECONNABORTED",o)),o=null)},o.onerror=function(){a(Je("Network Error",r,null,o)),o=null},o.ontimeout=function(){var p="timeout of "+r.timeout+"ms exceeded";r.timeoutErrorMessage&&(p=r.timeoutErrorMessage),a(Je(p,r,r.transitional&&r.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",o)),o=null},Oe.isStandardBrowserEnv()){var g=(r.withCredentials||_p($))&&r.xsrfCookieName?$p.read(r.xsrfCookieName):void 0;g&&(s[r.xsrfHeaderName]=g)}"setRequestHeader"in o&&Oe.forEach(s,function(p,O){typeof i=="undefined"&&O.toLowerCase()==="content-type"?delete s[O]:o.setRequestHeader(O,p)}),Oe.isUndefined(r.withCredentials)||(o.withCredentials=!!r.withCredentials),f&&f!=="json"&&(o.responseType=r.responseType),typeof r.onDownloadProgress=="function"&&o.addEventListener("progress",r.onDownloadProgress),typeof r.onUploadProgress=="function"&&o.upload&&o.upload.addEventListener("progress",r.onUploadProgress),r.cancelToken&&r.cancelToken.promise.then(function(p){!o||(o.abort(),a(p),o=null)}),i||(i=null),o.send(i)})},F=K,wt=np,Ap=On,Ep={"Content-Type":"application/x-www-form-urlencoded"};function Ct(e,r){!F.isUndefined(e)&&F.isUndefined(e["Content-Type"])&&(e["Content-Type"]=r)}function Op(){var e;return(typeof XMLHttpRequest!="undefined"||typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]")&&(e=St),e}function Tp(e,r,t){if(F.isString(e))try{return(r||JSON.parse)(e),F.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(e)}var Ge={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:Op(),transformRequest:[function(r,t){return wt(t,"Accept"),wt(t,"Content-Type"),F.isFormData(r)||F.isArrayBuffer(r)||F.isBuffer(r)||F.isStream(r)||F.isFile(r)||F.isBlob(r)?r:F.isArrayBufferView(r)?r.buffer:F.isURLSearchParams(r)?(Ct(t,"application/x-www-form-urlencoded;charset=utf-8"),r.toString()):F.isObject(r)||t&&t["Content-Type"]==="application/json"?(Ct(t,"application/json"),Tp(r)):r}],transformResponse:[function(r){var t=this.transitional,n=t&&t.silentJSONParsing,a=t&&t.forcedJSONParsing,i=!n&&this.responseType==="json";if(i||a&&F.isString(r)&&r.length)try{return JSON.parse(r)}catch(s){if(i)throw s.name==="SyntaxError"?Ap(s,this,"E_JSON_PARSE"):s}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(r){return r>=200&&r<300}};Ge.headers={common:{Accept:"application/json, text/plain, */*"}};F.forEach(["delete","get","head"],function(r){Ge.headers[r]={}});F.forEach(["post","put","patch"],function(r){Ge.headers[r]=F.merge(Ep)});var Tr=Ge,Sp=K,wp=Tr,Cp=function(r,t,n){var a=this||wp;return Sp.forEach(n,function(s){r=s.call(a,r,t)}),r},Sn=function(r){return!!(r&&r.__CANCEL__)},It=K,ze=Cp,Ip=Sn,Dp=Tr;function Ze(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var jp=function(r){Ze(r),r.headers=r.headers||{},r.data=ze.call(r,r.data,r.headers,r.transformRequest),r.headers=It.merge(r.headers.common||{},r.headers[r.method]||{},r.headers),It.forEach(["delete","get","head","post","put","patch","common"],function(a){delete r.headers[a]});var t=r.adapter||Dp.adapter;return t(r).then(function(a){return Ze(r),a.data=ze.call(r,a.data,a.headers,r.transformResponse),a},function(a){return Ip(a)||(Ze(r),a&&a.response&&(a.response.data=ze.call(r,a.response.data,a.response.headers,r.transformResponse))),Promise.reject(a)})},H=K,wn=function(r,t){t=t||{};var n={},a=["url","method","data"],i=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],f=["validateStatus"];function o(h,g){return H.isPlainObject(h)&&H.isPlainObject(g)?H.merge(h,g):H.isPlainObject(g)?H.merge({},g):H.isArray(g)?g.slice():g}function v(h){H.isUndefined(t[h])?H.isUndefined(r[h])||(n[h]=o(void 0,r[h])):n[h]=o(r[h],t[h])}H.forEach(a,function(g){H.isUndefined(t[g])||(n[g]=o(void 0,t[g]))}),H.forEach(i,v),H.forEach(s,function(g){H.isUndefined(t[g])?H.isUndefined(r[g])||(n[g]=o(void 0,r[g])):n[g]=o(void 0,t[g])}),H.forEach(f,function(g){g in t?n[g]=o(r[g],t[g]):g in r&&(n[g]=o(void 0,r[g]))});var m=a.concat(i).concat(s).concat(f),$=Object.keys(r).concat(Object.keys(t)).filter(function(g){return m.indexOf(g)===-1});return H.forEach($,v),n};const Lp="axios",xp="0.21.4",Rp="Promise based HTTP client for the browser and node.js",Np="index.js",Pp={test:"grunt test",start:"node ./sandbox/server.js",build:"NODE_ENV=production grunt build",preversion:"npm test",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",postversion:"git push && git push --tags",examples:"node ./examples/server.js",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",fix:"eslint --fix lib/**/*.js"},Up={type:"git",url:"https://github.com/axios/axios.git"},Mp=["xhr","http","ajax","promise","node"],Fp="Matt Zabriskie",Bp="MIT",Hp={url:"https://github.com/axios/axios/issues"},Gp="https://axios-http.com",qp={coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^8.2.1",sinon:"^4.5.0","terser-webpack-plugin":"^4.2.3",typescript:"^4.0.5","url-search-params":"^0.10.0",webpack:"^4.44.2","webpack-dev-server":"^3.11.0"},Kp={"./lib/adapters/http.js":"./lib/adapters/xhr.js"},Yp="dist/axios.min.js",Wp="dist/axios.min.js",kp="./index.d.ts",Vp={"follow-redirects":"^1.14.0"},Jp=[{path:"./dist/axios.min.js",threshold:"5kB"}];var zp={name:Lp,version:xp,description:Rp,main:Np,scripts:Pp,repository:Up,keywords:Mp,author:Fp,license:Bp,bugs:Hp,homepage:Gp,devDependencies:qp,browser:Kp,jsdelivr:Yp,unpkg:Wp,typings:kp,dependencies:Vp,bundlesize:Jp},Cn=zp,Sr={};["object","boolean","number","function","string","symbol"].forEach(function(e,r){Sr[e]=function(n){return typeof n===e||"a"+(r<1?"n ":" ")+e}});var Dt={},Zp=Cn.version.split(".");function In(e,r){for(var t=r?r.split("."):Zp,n=e.split("."),a=0;a<3;a++){if(t[a]>n[a])return!0;if(t[a]<n[a])return!1}return!1}Sr.transitional=function(r,t,n){var a=t&&In(t);function i(s,f){return"[Axios v"+Cn.version+"] Transitional option '"+s+"'"+f+(n?". "+n:"")}return function(s,f,o){if(r===!1)throw new Error(i(f," has been removed in "+t));return a&&!Dt[f]&&(Dt[f]=!0,console.warn(i(f," has been deprecated since v"+t+" and will be removed in the near future"))),r?r(s,f,o):!0}};function Xp(e,r,t){if(typeof e!="object")throw new TypeError("options must be an object");for(var n=Object.keys(e),a=n.length;a-- >0;){var i=n[a],s=r[i];if(s){var f=e[i],o=f===void 0||s(f,i,e);if(o!==!0)throw new TypeError("option "+i+" must be "+o);continue}if(t!==!0)throw Error("Unknown option "+i)}}var Qp={isOlderVersion:In,assertOptions:Xp,validators:Sr},Dn=K,ev=En,jt=rp,Lt=jp,qe=wn,jn=Qp,ne=jn.validators;function be(e){this.defaults=e,this.interceptors={request:new jt,response:new jt}}be.prototype.request=function(r){typeof r=="string"?(r=arguments[1]||{},r.url=arguments[0]):r=r||{},r=qe(this.defaults,r),r.method?r.method=r.method.toLowerCase():this.defaults.method?r.method=this.defaults.method.toLowerCase():r.method="get";var t=r.transitional;t!==void 0&&jn.assertOptions(t,{silentJSONParsing:ne.transitional(ne.boolean,"1.0.0"),forcedJSONParsing:ne.transitional(ne.boolean,"1.0.0"),clarifyTimeoutError:ne.transitional(ne.boolean,"1.0.0")},!1);var n=[],a=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(r)===!1||(a=a&&h.synchronous,n.unshift(h.fulfilled,h.rejected))});var i=[];this.interceptors.response.forEach(function(h){i.push(h.fulfilled,h.rejected)});var s;if(!a){var f=[Lt,void 0];for(Array.prototype.unshift.apply(f,n),f=f.concat(i),s=Promise.resolve(r);f.length;)s=s.then(f.shift(),f.shift());return s}for(var o=r;n.length;){var v=n.shift(),m=n.shift();try{o=v(o)}catch($){m($);break}}try{s=Lt(o)}catch($){return Promise.reject($)}for(;i.length;)s=s.then(i.shift(),i.shift());return s};be.prototype.getUri=function(r){return r=qe(this.defaults,r),ev(r.url,r.params,r.paramsSerializer).replace(/^\?/,"")};Dn.forEach(["delete","get","head","options"],function(r){be.prototype[r]=function(t,n){return this.request(qe(n||{},{method:r,url:t,data:(n||{}).data}))}});Dn.forEach(["post","put","patch"],function(r){be.prototype[r]=function(t,n,a){return this.request(qe(a||{},{method:r,url:t,data:n}))}});var rv=be;function wr(e){this.message=e}wr.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")};wr.prototype.__CANCEL__=!0;var Ln=wr,tv=Ln;function je(e){if(typeof e!="function")throw new TypeError("executor must be a function.");var r;this.promise=new Promise(function(a){r=a});var t=this;e(function(a){t.reason||(t.reason=new tv(a),r(t.reason))})}je.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};je.source=function(){var r,t=new je(function(a){r=a});return{token:t,cancel:r}};var nv=je,av=function(r){return function(n){return r.apply(null,n)}},iv=function(r){return typeof r=="object"&&r.isAxiosError===!0},xt=K,sv=bn,we=rv,ov=wn,uv=Tr;function xn(e){var r=new we(e),t=sv(we.prototype.request,r);return xt.extend(t,we.prototype,r),xt.extend(t,r),t}var Y=xn(uv);Y.Axios=we;Y.create=function(r){return xn(ov(Y.defaults,r))};Y.Cancel=Ln;Y.CancelToken=nv;Y.isCancel=Sn;Y.all=function(r){return Promise.all(r)};Y.spread=av;Y.isAxiosError=iv;Ar.exports=Y;Ar.exports.default=Y;var fv=Ar.exports;const cv=(e,r)=>{var t,n,a;return e&&((t=e==null?void 0:e.url)==null?void 0:t.length)>0&&(((n=e.url.find(i=>i.locale===r))==null?void 0:n.value)||((a=e.url.find(i=>i.locale==="*"))==null?void 0:a.value))||null},lv=(e,r)=>{var t,n;return((t=e==null?void 0:e.find)==null?void 0:t.call(e,a=>a.venue===r))||((n=e==null?void 0:e.find)==null?void 0:n.call(e,a=>a.venue==="*"))};function Cr(e,r=600,t=!0,n,a){var j,u;if(!n||!a)throw new Error("baseUrl or tenant was not provided");const i=`${e}_${a}_${n}`,s=`${n.endsWith("/")?n.slice(0,-1):n}/cms-api/content/${a}/${e}`,f=((j=O())==null?void 0:j.value)||null,[o,v]=G.useState(((u=O())==null?void 0:u.timestamp)||0),[m,$]=G.useState(f||null),[h,g]=G.useState(!1);function A(){fv.get(s).then(c=>{if(vr(c.data))throw new Error(`CMS data '${e}' is an empty object`);un(c.data,m)||$(c.data),h&&g(!1),t&&p(c.data)}).catch(c=>{console.error(c),g(!0)})}function p(c){const d=new Date().valueOf(),l=JSON.stringify({value:c,timestamp:d});localStorage.setItem(i,l),v(d)}function O(){try{const c=localStorage.getItem(i);if(c)return JSON.parse(c)}catch(c){console.warn(c)}return null}return G.useEffect(()=>{new Date().valueOf()-o>r*1e3&&A()},[]),Le(A,r*1e3),{value:m,isError:h,isLoading:!h&&!m}}function Rn(e,r=600,t=!0,n,a,i){var f,o,v,m;if(!n||!a||!i)throw new Error("baseUrl, tenant or venue was not provided");const s=Cr(e,r,t,n,a);return{value:((o=(f=s.value)==null?void 0:f.find)==null?void 0:o.call(f,$=>$.venue===i))||((m=(v=s.value)==null?void 0:v.find)==null?void 0:m.call(v,$=>$.venue==="*"))||null,isError:s.isError}}function dv(e,r,t,n=300,a=!0){var m,$,h,g;const i=G.useContext(Pt.ConfigContext);if(!i)throw new Error("Hook was used outside config context");const{value:s,isError:f}=Rn(e,n,a,i.baseUrl,i.tenant,r);let o=null,v=null;return s&&((m=s==null?void 0:s.url)==null?void 0:m.length)>0&&(o=(($=s.url.find(A=>A.locale===t))==null?void 0:$.value)||((h=s.url.find(A=>A.locale==="*"))==null?void 0:h.value)||null),!o&&s&&((g=s==null?void 0:s.url)==null?void 0:g.length)>0&&(v=s.url[0].value),{url:o,fallbackUrl:v,isError:f,mediaType:s==null?void 0:s.mediaType}}function Nn({kioskMediaId:e,kioskMediaType:r,intervalSeconds:t=600,withLocalStorage:n=!0,baseUrl:a,tenant:i,venue:s,locale:f}){var p;const{value:o,isError:v,isLoading:m}=Cr(e,t,n,a,i),$=(o==null?void 0:o[r])||[],h=lv($,s),g=cv(h,f),A=!g&&h&&((p=h==null?void 0:h.url)==null?void 0:p.length)>0?h.url[0].value:null;return{url:g,fallbackUrl:A,mediaType:h==null?void 0:h.mediaType,isError:v,isLoading:m}}function hv({kioskMediaId:e,kioskMediaType:r,venue:t,intervalSeconds:n=600,withLocalStorage:a=!0}){const i=G.useContext(Pt.ConfigContext);if(!i)throw new Error("Missing config context");const{i18n:{language:s}}=Mn.useTranslation();return Nn({kioskMediaId:e,kioskMediaType:r,intervalSeconds:n,withLocalStorage:a,venue:t,baseUrl:i.baseUrl,tenant:i.tenant,locale:s})}function pv(e,r){G.useEffect(()=>{const t=n=>{!e.current||e.current.contains(n.target)||r(n)};return document.addEventListener("mousedown",t),document.addEventListener("touchstart",t),()=>{document.removeEventListener("mousedown",t),document.removeEventListener("touchstart",t)}},[e,r])}function vv(e){const[r,t]=G.useState(pe(e==null?void 0:e.DINE_IN)),[n,a]=G.useState(pe(e==null?void 0:e.TAKE_AWAY));function i(){const s=pe(e==null?void 0:e.DINE_IN),f=pe(e==null?void 0:e.TAKE_AWAY);s!==r&&(console.log("dine in open changed",r,"=>",s),t(s)),f!==n&&(console.log("take away open changed",n,"=>",f),a(f))}return G.useEffect(()=>{i()},[e]),Le(i,6e4),{dineInOpen:r,takeAwayOpen:n,loaded:!!e}}var fr={},gv=e=>encodeURIComponent(e).replace(/[!'()*]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`),Pn="%[a-f0-9]{2}",Rt=new RegExp("("+Pn+")|([^%]+?)","gi"),Nt=new RegExp("("+Pn+")+","gi");function cr(e,r){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;r=r||1;var t=e.slice(0,r),n=e.slice(r);return Array.prototype.concat.call([],cr(t),cr(n))}function $v(e){try{return decodeURIComponent(e)}catch{for(var r=e.match(Rt)||[],t=1;t<r.length;t++)e=cr(r,t).join(""),r=e.match(Rt)||[];return e}}function yv(e){for(var r={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},t=Nt.exec(e);t;){try{r[t[0]]=decodeURIComponent(t[0])}catch{var n=$v(t[0]);n!==t[0]&&(r[t[0]]=n)}t=Nt.exec(e)}r["%C2"]="\uFFFD";for(var a=Object.keys(r),i=0;i<a.length;i++){var s=a[i];e=e.replace(new RegExp(s,"g"),r[s])}return e}var mv=function(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return yv(e)}},bv=(e,r)=>{if(!(typeof e=="string"&&typeof r=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(r==="")return[e];const t=e.indexOf(r);return t===-1?[e]:[e.slice(0,t),e.slice(t+r.length)]},_v=function(e,r){for(var t={},n=Object.keys(e),a=Array.isArray(r),i=0;i<n.length;i++){var s=n[i],f=e[s];(a?r.indexOf(s)!==-1:r(s,f,e))&&(t[s]=f)}return t};(function(e){const r=gv,t=mv,n=bv,a=_v,i=u=>u==null,s=Symbol("encodeFragmentIdentifier");function f(u){switch(u.arrayFormat){case"index":return c=>(d,l)=>{const y=d.length;return l===void 0||u.skipNull&&l===null||u.skipEmptyString&&l===""?d:l===null?[...d,[m(c,u),"[",y,"]"].join("")]:[...d,[m(c,u),"[",m(y,u),"]=",m(l,u)].join("")]};case"bracket":return c=>(d,l)=>l===void 0||u.skipNull&&l===null||u.skipEmptyString&&l===""?d:l===null?[...d,[m(c,u),"[]"].join("")]:[...d,[m(c,u),"[]=",m(l,u)].join("")];case"colon-list-separator":return c=>(d,l)=>l===void 0||u.skipNull&&l===null||u.skipEmptyString&&l===""?d:l===null?[...d,[m(c,u),":list="].join("")]:[...d,[m(c,u),":list=",m(l,u)].join("")];case"comma":case"separator":case"bracket-separator":{const c=u.arrayFormat==="bracket-separator"?"[]=":"=";return d=>(l,y)=>y===void 0||u.skipNull&&y===null||u.skipEmptyString&&y===""?l:(y=y===null?"":y,l.length===0?[[m(d,u),c,m(y,u)].join("")]:[[l,m(y,u)].join(u.arrayFormatSeparator)])}default:return c=>(d,l)=>l===void 0||u.skipNull&&l===null||u.skipEmptyString&&l===""?d:l===null?[...d,m(c,u)]:[...d,[m(c,u),"=",m(l,u)].join("")]}}function o(u){let c;switch(u.arrayFormat){case"index":return(d,l,y)=>{if(c=/\[(\d*)\]$/.exec(d),d=d.replace(/\[\d*\]$/,""),!c){y[d]=l;return}y[d]===void 0&&(y[d]={}),y[d][c[1]]=l};case"bracket":return(d,l,y)=>{if(c=/(\[\])$/.exec(d),d=d.replace(/\[\]$/,""),!c){y[d]=l;return}if(y[d]===void 0){y[d]=[l];return}y[d]=[].concat(y[d],l)};case"colon-list-separator":return(d,l,y)=>{if(c=/(:list)$/.exec(d),d=d.replace(/:list$/,""),!c){y[d]=l;return}if(y[d]===void 0){y[d]=[l];return}y[d]=[].concat(y[d],l)};case"comma":case"separator":return(d,l,y)=>{const w=typeof l=="string"&&l.includes(u.arrayFormatSeparator),T=typeof l=="string"&&!w&&$(l,u).includes(u.arrayFormatSeparator);l=T?$(l,u):l;const C=w||T?l.split(u.arrayFormatSeparator).map(x=>$(x,u)):l===null?l:$(l,u);y[d]=C};case"bracket-separator":return(d,l,y)=>{const w=/(\[\])$/.test(d);if(d=d.replace(/\[\]$/,""),!w){y[d]=l&&$(l,u);return}const T=l===null?[]:l.split(u.arrayFormatSeparator).map(C=>$(C,u));if(y[d]===void 0){y[d]=T;return}y[d]=[].concat(y[d],T)};default:return(d,l,y)=>{if(y[d]===void 0){y[d]=l;return}y[d]=[].concat(y[d],l)}}}function v(u){if(typeof u!="string"||u.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function m(u,c){return c.encode?c.strict?r(u):encodeURIComponent(u):u}function $(u,c){return c.decode?t(u):u}function h(u){return Array.isArray(u)?u.sort():typeof u=="object"?h(Object.keys(u)).sort((c,d)=>Number(c)-Number(d)).map(c=>u[c]):u}function g(u){const c=u.indexOf("#");return c!==-1&&(u=u.slice(0,c)),u}function A(u){let c="";const d=u.indexOf("#");return d!==-1&&(c=u.slice(d)),c}function p(u){u=g(u);const c=u.indexOf("?");return c===-1?"":u.slice(c+1)}function O(u,c){return c.parseNumbers&&!Number.isNaN(Number(u))&&typeof u=="string"&&u.trim()!==""?u=Number(u):c.parseBooleans&&u!==null&&(u.toLowerCase()==="true"||u.toLowerCase()==="false")&&(u=u.toLowerCase()==="true"),u}function j(u,c){c=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},c),v(c.arrayFormatSeparator);const d=o(c),l=Object.create(null);if(typeof u!="string"||(u=u.trim().replace(/^[?#&]/,""),!u))return l;for(const y of u.split("&")){if(y==="")continue;let[w,T]=n(c.decode?y.replace(/\+/g," "):y,"=");T=T===void 0?null:["comma","separator","bracket-separator"].includes(c.arrayFormat)?T:$(T,c),d($(w,c),T,l)}for(const y of Object.keys(l)){const w=l[y];if(typeof w=="object"&&w!==null)for(const T of Object.keys(w))w[T]=O(w[T],c);else l[y]=O(w,c)}return c.sort===!1?l:(c.sort===!0?Object.keys(l).sort():Object.keys(l).sort(c.sort)).reduce((y,w)=>{const T=l[w];return Boolean(T)&&typeof T=="object"&&!Array.isArray(T)?y[w]=h(T):y[w]=T,y},Object.create(null))}e.extract=p,e.parse=j,e.stringify=(u,c)=>{if(!u)return"";c=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},c),v(c.arrayFormatSeparator);const d=T=>c.skipNull&&i(u[T])||c.skipEmptyString&&u[T]==="",l=f(c),y={};for(const T of Object.keys(u))d(T)||(y[T]=u[T]);const w=Object.keys(y);return c.sort!==!1&&w.sort(c.sort),w.map(T=>{const C=u[T];return C===void 0?"":C===null?m(T,c):Array.isArray(C)?C.length===0&&c.arrayFormat==="bracket-separator"?m(T,c)+"[]":C.reduce(l(T),[]).join("&"):m(T,c)+"="+m(C,c)}).filter(T=>T.length>0).join("&")},e.parseUrl=(u,c)=>{c=Object.assign({decode:!0},c);const[d,l]=n(u,"#");return Object.assign({url:d.split("?")[0]||"",query:j(p(u),c)},c&&c.parseFragmentIdentifier&&l?{fragmentIdentifier:$(l,c)}:{})},e.stringifyUrl=(u,c)=>{c=Object.assign({encode:!0,strict:!0,[s]:!0},c);const d=g(u.url).split("?")[0]||"",l=e.extract(u.url),y=e.parse(l,{sort:!1}),w=Object.assign(y,u.query);let T=e.stringify(w,c);T&&(T=`?${T}`);let C=A(u.url);return u.fragmentIdentifier&&(C=`#${c[s]?m(u.fragmentIdentifier,c):u.fragmentIdentifier}`),`${d}${T}${C}`},e.pick=(u,c,d)=>{d=Object.assign({parseFragmentIdentifier:!0,[s]:!1},d);const{url:l,query:y,fragmentIdentifier:w}=e.parseUrl(u,d);return e.stringifyUrl({url:l,query:a(y,c),fragmentIdentifier:w},d)},e.exclude=(u,c,d)=>{const l=Array.isArray(c)?y=>!c.includes(y):(y,w)=>!c(y,w);return e.pick(u,l,d)}})(fr);const Av=[".png",".jpg",".jpeg",".webp",".bmp",".tiff"];function Un(e,r=500){const t=fr.parseUrl(e);if(!(e.startsWith("https://orderingstackmedia.blob.core.windows.net/pictures")||e.startsWith("https://orderingstack-mmedia-tools.azurewebsites.net/api/img/")))return e;const n=t.url.substring(t.url.lastIndexOf("."));return Av.includes(n)?fr.stringifyUrl({url:t.url.replace("https://orderingstackmedia.blob.core.windows.net/pictures/","https://orderingstack-mmedia-tools.azurewebsites.net/api/img/"),query:{...t.query,w:r}}):e}function Ev(e,r=500){return Un(e,r)}exports.addDiscounts=fn;exports.formatPrice=hc;exports.getGroupedBucketLines=Uh;exports.getMediaUrl=Un;exports.groupOrderLines=_r;exports.isChannelOpen=pe;exports.isProductEnabled=cn;exports.summarizeLineDiscounts=dc;exports.useAvailability=ln;exports.useCms=Cr;exports.useDisplayPrice=Nh;exports.useGroupOrderLines=Ph;exports.useInterval=Le;exports.useKioskChannelsAvailability=vv;exports.useKioskMediaCms=Nn;exports.useKioskMediaCmsWithContext=hv;exports.useLocalizedVenueMedia=dv;exports.useMediaUrl=Ev;exports.useMenu=vc;exports.useOnClickOutside=pv;exports.useVenueCms=Rn;
|
|
3
3
|
//# sourceMappingURL=index.cjs.js.map
|